/* Owner dashboard visual polish, Website Design, 2026-11-19.
   CSS only. Load after style.css, sms.css, sms-section.css and fx/fx4.css on owner.html.
   No features added. Hooks marked NEW are for Developer's regrouped markup (5 groups + sub-tabs). */

/* 1. Page: one white surface, sidebar reaches the bottom */
html,body{background:#fff}
.main{padding:32px 36px 64px}
.main section>.top{margin-bottom:4px}
.top h2{font-size:26px;letter-spacing:-.6px;line-height:1.15}
.top .muted{font-size:14px;line-height:1.45;max-width:62ch}

/* 2. Sidebar header: language pill no longer covers the title */
.side .nxb{display:flex;flex-direction:column;align-items:flex-start;gap:2px}
.side .nxb>.lgw{position:static;order:3;margin-top:10px}
.side b{font-size:15px;color:var(--ink);margin:0 10px 16px}

/* NEW: nav group labels for the 5 groups */
.side nav .navg{display:block;margin:18px 12px 6px;font-size:11px;font-weight:650;letter-spacing:1.2px;text-transform:uppercase;color:var(--mut)}
.side nav .navg:first-child{margin-top:0}
.side nav a{padding:9px 12px;font-size:14px;border-radius:10px}
@media(hover:hover){.side nav a:hover:not(.a){background:var(--bg);color:var(--ink)}}
/* WhatsApp support as a small help link, not a section */
.side .help{margin:auto 12px 4px;font-size:13px;color:var(--sub);text-decoration:none}
.side .help+.out{margin-top:0}

/* 3. Cards: one calm style, no blue top line */
.k,.box{box-shadow:none!important;border:1px solid var(--line);border-radius:16px}
.box{padding:20px}
.grid,.kpi{gap:16px}
.grid{margin-top:16px}
.kpi{margin-top:20px}
.k{padding:16px 18px}
.k small{font-size:12px;font-weight:600;color:var(--sub)}
/* Card headers: title left, emoji before it, links/counters pushed right */
.box h3{justify-content:flex-start;gap:8px;font-size:15px;font-weight:650;letter-spacing:-.2px;margin-bottom:14px;line-height:1.3}
.box h3>a,.box h3>.r{margin-left:auto;font-size:13px}
.box h3>span[aria-hidden]{font-size:16px;line-height:1}
.box h3>.muted{font-size:13px}

/* 4. Buttons: one primary per form, sized to content on desktop */
.main .box form>.btn,.main .box>.btn{display:inline-flex;align-items:center;justify-content:center;width:auto;min-width:140px;height:44px;padding:0 20px;font-size:14px;font-weight:650;border-radius:12px;margin-top:18px!important}
.main .btn.sm,.main .rfrow .btn{height:36px;padding:0 14px;font-size:13px;border-radius:10px}
/* 21.11 QA f76efff0 bug 3: the <a> "Support on WhatsApp" button centres its label like the <button> Subscribe */
.main .rfrow a.btn:not([hidden]){display:inline-flex;align-items:center;justify-content:center;line-height:1.2}
.main .msg{margin-top:8px}

/* 5. Forms: tighter rhythm, shorter helper text */
.main .field{margin-top:14px}
.main .hint,.main .field small{line-height:1.45}
/* NEW: collapsed helper text, Developer toggles .open on "More" */
.hint.clamp{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.hint.clamp.open{display:block;-webkit-line-clamp:unset}
.hint-more{font-size:12px;color:var(--acc);background:none;border:0;padding:0;margin-top:4px;cursor:pointer}

/* NEW: sub-tabs inside a group (segmented control) */
.seg{display:inline-flex;gap:2px;padding:3px;margin:18px 0 4px;background:var(--bg);border-radius:12px;max-width:100%;overflow-x:auto;scrollbar-width:none}
.seg::-webkit-scrollbar{display:none}
.seg a,.seg button{flex:none;border:0;background:none;font:inherit;font-size:13px;font-weight:600;color:var(--sub);padding:8px 14px;border-radius:9px;cursor:pointer;white-space:nowrap;text-decoration:none}
.seg .a,.seg [aria-selected=true]{background:#fff;color:var(--ink);box-shadow:0 1px 2px #0000001a}

/* Tables: calmer rows */
.main table{font-size:13.5px}
.main td,.main th{padding:12px 8px 12px 0}
.main th{font-size:11.5px;letter-spacing:.3px;text-transform:uppercase}

@media(max-width:860px){
 .main{padding:20px 16px 96px}
 .top h2{font-size:23px}
 .box{padding:16px}
 .grid,.kpi{gap:12px}
 .k{padding:14px}
 .main .box form>.btn,.main .box>.btn{width:100%}
 .side .nxb>.lgw{position:absolute;top:0;right:0;margin:0;order:0}
 .side .nxb{display:block}
 /* NEW: bottom bar for the 5 groups on phones */
 .botnav{position:fixed;left:0;right:0;bottom:var(--vv-bottom,0px);z-index:20;display:grid;grid-auto-flow:column;grid-auto-columns:minmax(0,1fr);background:#fff;transform:translateZ(0);-webkit-transform:translateZ(0);border-top:1px solid var(--line);padding:6px 4px calc(6px + env(safe-area-inset-bottom))}
 .botnav a{display:flex;flex-direction:column;align-items:center;gap:3px;font-size:10.5px;font-weight:600;color:var(--mut);text-decoration:none;padding:4px 2px;min-height:44px;justify-content:center;text-align:center;line-height:1.15}
 .botnav a svg{width:22px;height:22px}
 .botnav a.a{color:var(--ink)}
 /* when the bottom bar exists, the old sideways strip goes */
 body.has-botnav .side nav{display:none}
 /* NEW: sticky Save on phones */
 .savebar{position:fixed;left:0;right:0;bottom:calc(var(--botnav-h, calc(64px + env(safe-area-inset-bottom))) + var(--vv-bottom, 0px));z-index:19;margin:0;padding:10px 16px;background:#fff;transform:translateZ(0);-webkit-transform:translateZ(0);border-top:1px solid var(--line)}
 .savebar .btn{width:100%;margin:0!important}
 /* reserve space: fixed .savebar is out of flow */
 section[data-s=card] form{padding-bottom:72px}
 /* NEW: customers as stacked rows; Developer adds data-l="Label" on each td */
 .cut.stack{min-width:0}
 .cut.stack tr:first-child{display:none}
 .cut.stack tr{display:block;padding:12px 0;border-top:1px solid var(--line)}
 .cut.stack td{display:flex;justify-content:space-between;gap:12px;border:0;padding:3px 0;white-space:normal;text-align:right;color:var(--ink)}
 .cut.stack td:first-child{font-weight:650;font-size:15px;text-align:left}
 .cut.stack td[data-l]::before{content:attr(data-l);color:var(--mut);font-size:12px;text-align:left}
}
@media(min-width:861px){.botnav{display:none}}

/* v2 re-check fixes (2026-11-19 23:30) */
.seg{margin:14px 0 18px}
@media(max-width:860px){
 /* WhatsApp help: small line under the header, left-aligned, not floating mid-row */
 .side .help{order:4;width:100%;margin:2px 10px 4px;font-size:12px;text-align:left;color:var(--mut)}
 /* stacked customers: no double line under the table head */
 .cut.stack tr:nth-child(2){border-top:0;padding-top:4px}
}

/* phone sub-tabs fit the screen, no sideways swipe (2026-11-19 23:45) */
@media(max-width:860px){
 .seg{display:flex;width:100%;overflow:visible}
 .seg a,.seg button{flex:1 1 0;min-width:0;white-space:normal;text-align:center;line-height:1.2;font-size:12.5px;padding:8px 4px;display:flex;align-items:center;justify-content:center}
}
/* audit M2 (21.11): the phone tab bar shows only for a logged-in owner (body.has-botnav is set after /api/owner/me) */
body:not(.has-botnav) .botnav{display:none!important}
/* 21.11 Huy 21:13: keyboard open (kbguard.js sets html.kb-open): no tab bar / install hint, fixed bars become static so nothing floats over the form */
html.kb-open .botnav,html.kb-open .a2hs{display:none!important}
html.kb-open .cb .cb-bar,html.kb-open .savebar{position:static!important;transform:none!important}
