/* FMR CRM — brand: navy #1B293C · burgundy #992334→#440816 · gold #C6AE71 · warm ivory ground (from the FMR logo + office identity)
   Layout: navy sidebar with white logo on desktop, bottom tab bar on phone; S1–S7 stage bar + lead cards; guided lead drawer */
:root{
  --navy:#1b293c; --navy-2:#24364f; --navy-ink:#d9dee7; --burgundy:#8a1f2f; --burgundy-deep:#5a1220; --gold-brand:#c6ae71;
  --bg:#f6f2ec; --surface:#ffffff; --surface-2:#f1ebe2; --line:#e5ddd1;
  --fg:#1b293c; --muted:#646c78; --accent:#8a1f2f; --accent-fg:#ffffff; --accent-soft:#f6e7e8;
  --warn:#a85a07; --warn-soft:#fbeedb; --bad:#d23a2a; --bad-soft:#fde6e2; --good:#1f7a45; --good-soft:#e0f2e7;
  --info:#2b5d8f; --info-soft:#e3edf7; --gold:#8c7333; --gold-soft:#f4eddb;
  --shadow:0 1px 2px rgba(27,41,60,.06),0 6px 20px rgba(27,41,60,.07);
  --font:"Be Vietnam Pro",system-ui,-apple-system,"Segoe UI",Roboto,sans-serif;
  --display:"Montserrat","Be Vietnam Pro",system-ui,sans-serif;
  --mono:"JetBrains Mono",ui-monospace,SFMono-Regular,Menlo,monospace;
  --r:10px; color-scheme:light;
}
@media (prefers-color-scheme: dark){:root:not([data-theme="light"]){
  --navy:#0d1522; --navy-2:#1a2639; --navy-ink:#c9d1dd;
  --bg:#101824; --surface:#172234; --surface-2:#1e2b40; --line:#2b3a52;
  --fg:#ece7de; --muted:#9ba5b4; --accent:#e0707f; --accent-fg:#2a0a10; --accent-soft:#3b1d27;
  --warn:#f0aa55; --warn-soft:#3a2a14; --bad:#ff7a6b; --bad-soft:#401d1a; --good:#5cc98a; --good-soft:#163526;
  --info:#86b2e6; --info-soft:#1b2d47; --gold:#dcc589; --gold-soft:#352f1f;
  --shadow:0 1px 2px rgba(0,0,0,.3),0 6px 20px rgba(0,0,0,.28); color-scheme:dark}}
*{box-sizing:border-box}
[hidden]{display:none!important}
html,body{height:100%;margin:0}
body{background:var(--bg);color:var(--fg);font-family:var(--font);font-size:14px;line-height:1.5;padding-top:env(safe-area-inset-top,0px)}
button,input,select,textarea{font:inherit;color:inherit}
:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
.num{font-variant-numeric:tabular-nums}
.mono{font-family:var(--mono);font-size:13px}

/* brand pieces */
.tagline{display:flex;align-items:center;gap:10px;font-family:var(--display);font-size:10.5px;font-weight:600;letter-spacing:.32em;text-transform:uppercase;color:var(--gold-brand);white-space:nowrap}
.tagline::before,.tagline::after{content:"";height:1px;flex:1;background:currentColor;opacity:.75}
.tagline i{display:inline-block;width:4px;height:4px;border-radius:50%;background:currentColor;margin:0 .35em;vertical-align:middle;font-style:normal}

/* auth: navy brand panel + form */
.auth{min-height:100vh;min-height:100dvh;display:grid;grid-template-columns:minmax(0,1.05fr) minmax(0,1fr);background:var(--bg)}
.auth-brand{position:relative;overflow:hidden;background:radial-gradient(120% 90% at 0% 0%,var(--navy-2) 0%,var(--navy) 60%);color:#fff;display:flex;flex-direction:column;justify-content:space-between;gap:32px;padding:48px max(48px,env(safe-area-inset-left,0px))}
.auth-brand::after{content:"";position:absolute;right:-12%;bottom:-18%;width:70%;aspect-ratio:530/599;background:url(brand/fmr-mark-white.svg) no-repeat center/contain;opacity:.07;pointer-events:none}
.auth-brand img{width:min(320px,80%);height:auto}
.auth-brand h2{font-family:var(--display);font-size:clamp(24px,3vw,34px);line-height:1.25;font-weight:600;margin:0;max-width:16ch;text-wrap:balance}
.auth-brand p{color:var(--navy-ink);max-width:40ch;margin:12px 0 0;font-size:15px}
.auth-brand .tagline{max-width:340px}
.auth-main{display:grid;place-items:center;padding:32px max(16px,env(safe-area-inset-right,0px)) 32px max(16px,env(safe-area-inset-left,0px))}
.auth-card{width:100%;max-width:400px;background:var(--surface);border:1px solid var(--line);border-radius:16px;padding:28px 24px;box-shadow:var(--shadow);display:flex;flex-direction:column;gap:14px;position:relative}
.auth-card::before{content:"";position:absolute;left:0;right:0;top:0;height:4px;border-radius:16px 16px 0 0;background:linear-gradient(90deg,#992334,#440816)}
.auth-card .mobile-logo{display:none;width:170px;height:auto;margin-bottom:4px}
.auth-card h1{font-size:22px}
@media (max-width:860px){
  .auth{grid-template-columns:minmax(0,1fr)}
  .auth-brand{display:none}
  .auth-card .mobile-logo{display:block}
}
.auth-card .btn{justify-content:center}
.auth-links{display:flex;justify-content:space-between;gap:8px;flex-wrap:wrap;font-size:13px}
.link{border:0;background:none;color:var(--accent);cursor:pointer;padding:0;font-weight:500}
.err{color:var(--bad);font-size:13px;min-height:1em}
.ok{color:var(--good);font-size:13px}
.demo-roles{display:flex;flex-direction:column;gap:8px}

/* shell */
.shell{display:grid;grid-template-columns:232px 1fr;min-height:100%}
/* navy sidebar — the one bold brand surface; everything else stays quiet */
.side{background:var(--navy);color:var(--navy-ink);padding:22px 14px 16px;display:flex;flex-direction:column;gap:22px;position:sticky;top:0;height:100vh;overflow:auto}
.side-logo{padding:2px 8px 0;display:flex;flex-direction:column;gap:10px}
.side-logo img{width:150px;height:auto;display:block}
.side-logo .tagline{font-size:8.5px;letter-spacing:.28em}
.nav{display:flex;flex-direction:column;gap:2px}
.nav a{display:flex;align-items:center;gap:11px;padding:10px 12px;border-radius:8px;color:var(--navy-ink);text-decoration:none;font-weight:500;position:relative}
.nav a:hover{background:rgba(255,255,255,.06);color:#fff}
.nav a[aria-current="page"]{background:rgba(198,174,113,.14);color:#fff}
.nav a[aria-current="page"]::before{content:"";position:absolute;left:0;top:8px;bottom:8px;width:3px;border-radius:0 3px 3px 0;background:var(--gold-brand)}
.nav a[aria-current="page"] svg{color:var(--gold-brand)}
.nav svg{width:18px;height:18px;flex:none;opacity:.9}
.nav .count{margin-left:auto;font-size:12px;color:rgba(217,222,231,.7)}
.nav .count.alert{background:#c8394a;color:#fff;border-radius:999px;padding:0 7px;font-weight:600}
.side-foot{margin-top:auto;font-size:12px;color:rgba(217,222,231,.75);display:flex;flex-direction:column;gap:8px}
.side-foot>span{padding:0 8px}
.me{display:flex;align-items:center;gap:10px;border:1px solid rgba(255,255,255,.1);background:rgba(255,255,255,.04);border-radius:10px;padding:8px;cursor:pointer;text-align:left;width:100%;color:inherit}
.me:hover{background:rgba(255,255,255,.08)}
.me b{display:block;font-size:13px;color:#fff;line-height:1.2;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.me small{color:var(--gold-brand);font-size:12px;font-weight:500}
.me .avatar{background:var(--gold-brand);color:var(--navy)}
.brand{display:flex;align-items:center;gap:10px}
.brand img{width:34px;height:auto}
.brand b{font-family:var(--display);font-size:16px;display:block;line-height:1.1}
.brand small{color:var(--muted);font-size:12px}
.me .grow{min-width:0;flex:1}
.dot{display:inline-block;width:8px;height:8px;border-radius:50%;background:var(--muted);margin-right:6px}
.dot.on{background:var(--good)} .dot.off{background:var(--warn)}
main{min-width:0;padding-block:24px 40px;padding-left:max(24px,env(safe-area-inset-left,0px));padding-right:max(24px,env(safe-area-inset-right,0px))}
.top{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;margin-bottom:18px}
h1{font-size:22px;margin:0;font-weight:700;text-wrap:balance}
h2{font-size:15px;margin:0;font-weight:600}
h3{font-size:12px;margin:0 0 8px;font-weight:600;text-transform:uppercase;letter-spacing:.05em;color:var(--muted)}
.sub{color:var(--muted);font-size:13px;margin:2px 0 0}
.btn{border:1px solid var(--line);background:var(--surface);padding:8px 14px;border-radius:8px;cursor:pointer;font-weight:500;display:inline-flex;align-items:center;gap:6px;white-space:nowrap;text-decoration:none;position:relative}
.btn:hover{background:var(--surface-2)}
.btn:disabled{opacity:.45;cursor:not-allowed}
.btn.primary{background:var(--accent);border-color:var(--accent);color:var(--accent-fg)}
.btn.primary:hover{filter:brightness(1.07)}
.btn.danger{color:var(--bad);border-color:var(--bad-soft)}
.btn.danger.armed{background:var(--bad);color:#fff;border-color:var(--bad)}
.btn.sm{padding:5px 10px;font-size:13px}
.btn.ghost{border-color:transparent;background:transparent}
.btn.block{width:100%;justify-content:center}
.badge{position:absolute;top:-6px;right:-6px;background:var(--bad);color:#fff;border-radius:999px;font-size:11px;font-weight:700;min-width:18px;height:18px;display:grid;place-items:center;padding:0 5px}
.actions{display:flex;gap:8px;flex-wrap:wrap;align-items:center}
.banner{display:flex;gap:10px;align-items:center;flex-wrap:wrap;background:var(--info-soft);border-radius:var(--r);padding:10px 14px;margin-bottom:16px;font-size:13px}
.banner b{color:var(--info)}
.banner.warn{background:var(--warn-soft)} .banner.warn b{color:var(--warn)}
.card{background:var(--surface);border:1px solid var(--line);border-radius:var(--r);min-width:0}
.card-h{display:flex;justify-content:space-between;align-items:center;gap:8px;padding:14px 16px;border-bottom:1px solid var(--line);flex-wrap:wrap}
.kpis{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;margin-bottom:16px}
.kpi{padding:14px 16px}
.kpi .l{color:var(--muted);font-size:12px;text-transform:uppercase;letter-spacing:.05em;font-weight:600}
.kpi .v{font-size:24px;font-weight:700;margin-top:4px;line-height:1.2}
.kpi .v small{font-size:14px;color:var(--muted);font-weight:500}
.kpi .h{font-size:12px;color:var(--muted);margin-top:2px}
.kpi.hot .v{color:var(--bad)}
.grid2{display:grid;grid-template-columns:minmax(0,1.3fr) minmax(0,1fr);gap:16px}
.mt{margin-top:16px}
.funnel{padding:14px 16px;display:flex;flex-direction:column;gap:10px}
.frow{display:grid;grid-template-columns:150px 1fr 70px;gap:10px;align-items:center;font-size:13px}
.fbar{height:10px;background:var(--surface-2);border-radius:5px;overflow:hidden;display:flex}
.fbar i{display:block;height:100%;background:var(--accent)}
.fbar i.hold{background:var(--warn)} .fbar i.dep{background:var(--info)} .fbar i.sold{background:var(--muted)} .fbar i.bad{background:var(--bad)} .fbar i.good{background:var(--good)}
.frow .amt{text-align:right;font-family:var(--mono);font-size:12px}
.legend{display:flex;gap:14px;flex-wrap:wrap;font-size:12px;color:var(--muted);padding:0 16px 14px}
.legend i{display:inline-block;width:10px;height:10px;border-radius:3px;margin-right:5px;vertical-align:-1px}
.list{list-style:none;margin:0;padding:0}
.list li{display:flex;gap:12px;align-items:center;padding:11px 16px;border-bottom:1px solid var(--line)}
.list li:last-child{border-bottom:0}
.list .grow{flex:1;min-width:0}
.list .t{font-weight:500;overflow-wrap:anywhere}
.list .m{color:var(--muted);font-size:12px}
.clickable{cursor:pointer}
.empty{padding:28px 16px;text-align:center;color:var(--muted)}
.chip{display:inline-flex;align-items:center;font-size:12px;font-weight:600;padding:2px 8px;border-radius:999px;background:var(--surface-2);color:var(--muted);white-space:nowrap}
.chip.stage{background:var(--accent-soft);color:var(--accent);font-family:var(--mono);font-size:11px}
.chip.lost{background:var(--bad-soft);color:var(--bad)}
.chip.won{background:var(--good-soft);color:var(--good)}
.chip.available{background:var(--good-soft);color:var(--good)}
.chip.hold{background:var(--warn-soft);color:var(--warn)}
.chip.deposit{background:var(--info-soft);color:var(--info)}
.chip.buy{background:var(--accent-soft);color:var(--accent)}
.chip.invest{background:var(--gold-soft);color:var(--gold)}
.chip.both{background:var(--info-soft);color:var(--info)}
.chip.overdue,.chip.reclaim{background:var(--bad-soft);color:var(--bad)}
.chip.warn{background:var(--warn-soft);color:var(--warn)}
.chip.remind,.chip.today{background:var(--info-soft);color:var(--info)}
.chip.pool{background:var(--gold-soft);color:var(--gold)}
.chip.ceo{background:var(--gold-soft);color:var(--gold)} .chip.mkt{background:var(--info-soft);color:var(--info)} .chip.sale{background:var(--accent-soft);color:var(--accent)} .chip.pending{background:var(--warn-soft);color:var(--warn)}
.chips{display:flex;gap:4px;flex-wrap:wrap}
.toolbar{display:flex;gap:8px;flex-wrap:wrap;padding:12px 16px;border-bottom:1px solid var(--line)}
.toolbar input,.toolbar select{border:1px solid var(--line);background:var(--bg);border-radius:8px;padding:7px 10px;min-width:0}
.toolbar input{flex:1;min-width:160px}
.seg{display:inline-flex;border:1px solid var(--line);border-radius:8px;overflow:hidden;background:var(--surface)}
.seg button{border:0;background:transparent;padding:7px 12px;cursor:pointer;color:var(--muted);font-weight:500}
.seg button[aria-pressed="true"]{background:var(--accent-soft);color:var(--accent)}
.tablewrap{overflow-x:auto}
table{width:100%;border-collapse:collapse;font-size:13.5px}
th{text-align:left;font-size:12px;text-transform:uppercase;letter-spacing:.05em;color:var(--muted);font-weight:600;padding:10px 14px;border-bottom:1px solid var(--line);white-space:nowrap}
td{padding:11px 14px;border-bottom:1px solid var(--line);vertical-align:middle}
td.r,th.r{text-align:right}
tbody tr.clickable:hover{background:var(--surface-2)}
tbody tr:last-child td{border-bottom:0}
td select{border:1px solid var(--line);background:var(--bg);border-radius:6px;padding:4px 8px}
.avatar{width:32px;height:32px;border-radius:50%;background:var(--accent-soft);color:var(--accent);display:grid;place-items:center;font-weight:700;font-size:12px;flex:none}
.unit{width:40px;height:32px;border-radius:6px;background:var(--surface-2);color:var(--fg);display:grid;place-items:center;font-weight:700;font-size:11px;flex:none}
.who{display:flex;gap:10px;align-items:center;min-width:180px}
.mobile-list{display:none}
.board{display:grid;grid-auto-flow:column;grid-auto-columns:minmax(210px,1fr);gap:10px;overflow-x:auto;padding-bottom:8px}
.col{background:var(--surface-2);border-radius:var(--r);padding:10px;display:flex;flex-direction:column;gap:8px;min-height:200px}
.col-h{padding:2px 4px 6px}
.col-h .code{font-family:var(--mono);font-size:11px;color:var(--accent);font-weight:500}
.col-h b{display:block;font-size:13px;line-height:1.3}
.col-h span{font-size:12px;color:var(--muted)}
.col.lost .col-h .code,.col.lost .col-h b{color:var(--bad)}
.col.s7 .col-h .code,.col.s7 .col-h b{color:var(--good)}
.lead{background:var(--surface);border:1px solid var(--line);border-radius:8px;padding:10px 12px;cursor:pointer;box-shadow:var(--shadow);display:flex;flex-direction:column;gap:4px;text-align:left;width:100%}
.lead:hover{border-color:var(--accent)}
.lead.alert-reclaim{border-left:3px solid var(--bad)} .lead.alert-warn{border-left:3px solid var(--warn)} .lead.alert-remind{border-left:3px solid var(--info)}
.lead .t{font-weight:600;overflow-wrap:anywhere}
.lead .m{font-size:12px;color:var(--muted)}
.check{width:20px;height:20px;border-radius:6px;border:2px solid var(--line);background:transparent;cursor:pointer;flex:none;display:grid;place-items:center;margin-top:1px}
.check.on{background:var(--accent);border-color:var(--accent);color:var(--accent-fg)}
.done .t{text-decoration:line-through;color:var(--muted)}
.tabs{display:flex;gap:4px;padding:10px 12px;border-bottom:1px solid var(--line);flex-wrap:wrap}
.tabs button{border:0;background:transparent;padding:6px 12px;border-radius:999px;cursor:pointer;color:var(--muted);font-weight:500}
.tabs button[aria-pressed="true"]{background:var(--accent-soft);color:var(--accent)}
.alertrow{display:flex;gap:10px;align-items:flex-start;padding:11px 16px;border-bottom:1px solid var(--line);cursor:pointer}
.alertrow:last-child{border-bottom:0}
.alertrow:hover{background:var(--surface-2)}
.alertrow .grow{flex:1;min-width:0}

/* overlays */
.scrim{position:fixed;inset:0;background:rgba(10,20,16,.45);z-index:40;display:flex;align-items:center;justify-content:center;padding:max(16px,env(safe-area-inset-top,0px)) max(16px,env(safe-area-inset-right,0px)) max(16px,env(safe-area-inset-bottom,0px)) max(16px,env(safe-area-inset-left,0px))}
.modal{background:var(--surface);border-radius:14px;width:100%;max-width:560px;max-height:100%;overflow:auto;box-shadow:0 20px 60px rgba(0,0,0,.25)}
.modal form,.modal .body{padding:18px 20px;display:flex;flex-direction:column;gap:12px}
.modal-h{display:flex;justify-content:space-between;align-items:center;padding:16px 20px;border-bottom:1px solid var(--line)}
.field{display:flex;flex-direction:column;gap:4px;min-width:0}
.field label,.field .lbl{font-size:12px;font-weight:600;color:var(--muted)}
.field input,.field select,.field textarea{border:1px solid var(--line);background:var(--bg);border-radius:8px;padding:9px 11px;width:100%}
.field textarea{min-height:72px;resize:vertical}
.field .hint{font-size:12px;color:var(--muted)}
.opts{display:flex;gap:6px;flex-wrap:wrap}
.opts label{display:inline-flex;align-items:center;gap:6px;border:1px solid var(--line);border-radius:999px;padding:6px 12px;cursor:pointer;font-size:13px;color:var(--fg);font-weight:500}
.opts input{width:auto;margin:0;accent-color:var(--accent)}
.opts label:has(input:checked){background:var(--accent-soft);border-color:var(--accent);color:var(--accent)}
.row2{display:grid;grid-template-columns:1fr 1fr;gap:12px}
.row3{display:grid;grid-template-columns:1fr 1fr 1fr;gap:12px}
.modal-f{display:flex;justify-content:space-between;gap:8px;flex-wrap:wrap;padding-top:6px}
.calc{background:var(--surface-2);border-radius:8px;padding:8px 12px;font-size:13px;display:flex;justify-content:space-between;gap:8px}
.drawer{position:fixed;top:0;right:0;bottom:0;width:min(500px,100%);background:var(--surface);z-index:41;box-shadow:-10px 0 40px rgba(0,0,0,.2);overflow:auto;padding-bottom:env(safe-area-inset-bottom,0px)}
.drawer .hd{padding:max(18px,env(safe-area-inset-top,0px)) max(20px,env(safe-area-inset-right,0px)) 16px 20px;border-bottom:1px solid var(--line);display:flex;gap:12px;align-items:flex-start;position:sticky;top:0;background:var(--surface);z-index:2}
.drawer section{padding:16px 20px;border-bottom:1px solid var(--line)}
.notice{background:var(--accent-soft);border-radius:10px;padding:12px 14px;white-space:pre-line;font-size:13.5px;line-height:1.55}
.notice.money{background:var(--gold-soft)} .notice.lost{background:var(--bad-soft)} .notice.won{background:var(--good-soft)}
.alertbox{margin-top:8px;border-radius:8px;padding:8px 12px;font-size:13px;font-weight:500}
.alertbox.reclaim{background:var(--bad-soft);color:var(--bad)} .alertbox.warn{background:var(--warn-soft);color:var(--warn)} .alertbox.remind{background:var(--info-soft);color:var(--info)}
.steps{display:flex;flex-direction:column;gap:6px}
.step{display:flex;align-items:center;justify-content:space-between;gap:10px;width:100%;text-align:left;border:1px solid var(--line);background:var(--surface);border-radius:8px;padding:10px 12px;cursor:pointer;font-weight:500}
.step:hover:not(:disabled){border-color:var(--accent);background:var(--accent-soft)}
.step:disabled{opacity:.45;cursor:not-allowed}
.step .to{font-family:var(--mono);font-size:11px;color:var(--muted);white-space:nowrap}
.step.danger{color:var(--bad)} .step.danger .to{color:var(--bad)}
.step.go .to{color:var(--accent)}
.actform{margin-top:10px;border:1px solid var(--accent);border-radius:10px;padding:12px;display:flex;flex-direction:column;gap:10px;background:var(--bg)}
.gate{display:flex;flex-direction:column;gap:10px;margin-bottom:12px;padding:12px;border-radius:10px;background:var(--surface-2)}
.kv{display:grid;grid-template-columns:120px 1fr;gap:6px 12px;font-size:13.5px}
.kv dt{color:var(--muted)} .kv dd{margin:0;overflow-wrap:anywhere}
.log{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:8px;font-size:13px}
.log li{display:grid;grid-template-columns:92px 1fr;gap:10px}
.log time{color:var(--muted);font-size:12px;font-family:var(--mono)}
.copy{border:0;background:none;color:var(--accent);cursor:pointer;font-size:12px;padding:0 4px}
.sheet{position:fixed;left:0;right:0;bottom:0;background:var(--surface);border-radius:16px 16px 0 0;z-index:41;padding:16px max(16px,env(safe-area-inset-right,0px)) calc(16px + env(safe-area-inset-bottom,0px)) max(16px,env(safe-area-inset-left,0px));display:flex;flex-direction:column;gap:6px;box-shadow:0 -10px 40px rgba(0,0,0,.2)}
.sheet a,.sheet button.item{display:flex;align-items:center;gap:12px;padding:12px;border-radius:10px;text-decoration:none;color:var(--fg);font-weight:500;border:0;background:none;width:100%;text-align:left;cursor:pointer}
.sheet a:hover,.sheet button.item:hover{background:var(--surface-2)}
.sheet svg{width:20px;height:20px;color:var(--muted)}
.preview{max-height:220px;overflow:auto;border:1px solid var(--line);border-radius:8px}
.preview table{font-size:12.5px}
.preview td,.preview th{padding:6px 10px}
.toast{position:fixed;left:50%;transform:translateX(-50%);bottom:calc(84px + env(safe-area-inset-bottom,0px));background:var(--fg);color:var(--bg);padding:10px 16px;border-radius:12px;font-size:13px;z-index:60;box-shadow:var(--shadow);max-width:min(440px,calc(100% - 32px));white-space:pre-line}
.tabbar{display:none}
@media (max-width:1100px){.kpis{grid-template-columns:repeat(2,minmax(0,1fr))}.grid2{grid-template-columns:minmax(0,1fr)}}
@media (max-width:760px){
  .shell{grid-template-columns:minmax(0,1fr)}
  .side{display:none}
  main{padding-block:16px 96px;padding-left:max(16px,env(safe-area-inset-left,0px));padding-right:max(16px,env(safe-area-inset-right,0px))}
  .tabbar{display:grid;grid-template-columns:repeat(5,1fr);position:fixed;left:0;right:0;bottom:0;z-index:30;background:var(--surface);border-top:1px solid var(--line);padding:6px max(4px,env(safe-area-inset-right,0px)) calc(6px + env(safe-area-inset-bottom,0px)) max(4px,env(safe-area-inset-left,0px))}
  .tabbar a,.tabbar button{display:flex;flex-direction:column;align-items:center;gap:2px;font-size:10.5px;color:var(--muted);text-decoration:none;padding:4px 0;font-weight:500;text-align:center;position:relative;border:0;background:none;cursor:pointer}
  .tabbar a[aria-current="page"]{color:var(--accent)}
  .tabbar svg{width:22px;height:22px}
  .tabbar .badge{top:-2px;right:calc(50% - 22px)}
  .desk-table{display:none}
  .mobile-list{display:block}
  .frow{grid-template-columns:110px 1fr 50px}
  .row2,.row3{grid-template-columns:1fr}
  .board{grid-auto-columns:80%}
  .kv{grid-template-columns:104px 1fr}
  .top .btn.primary{position:fixed;right:max(16px,env(safe-area-inset-right,0px));bottom:calc(76px + env(safe-area-inset-bottom,0px));z-index:31;border-radius:999px;padding:12px 18px;box-shadow:0 6px 20px rgba(0,0,0,.2)}
}
@media (prefers-reduced-motion:no-preference){.lead,.btn,.step,.nav a{transition:background .15s,border-color .15s,filter .15s}}

/* ---------- stage bar (coloured step chips with counts) ---------- */
:root{
  --st-all:#1b293c; --st-alert:#d23a2a; --st-s1:#e5484d; --st-callback:#d6336c; --st-s2:#e8772e; --st-s3:#e9c23b; --st-s4:#9a6b45;
  --st-s5:#4f9d4a; --st-s6:#b8955a; --st-s7:#1f7a45; --st-lost:#7c8784; --st-pool:#b8a27a; --st-ink-light:#ffffff; --st-ink-dark:#2a2208;
}
.stagebar{padding:12px;margin-bottom:14px;display:flex;flex-direction:column;gap:12px}
.sb-tools{display:flex;gap:8px;flex-wrap:wrap}
.sb-tools input{flex:1;min-width:0;border:1px solid var(--line);background:var(--bg);border-radius:999px;padding:9px 16px}
.sb-tools select{border:1px solid var(--line);background:var(--bg);border-radius:999px;padding:9px 12px;min-width:0}
.stc-row{display:flex;flex-wrap:wrap;gap:12px 8px;padding-top:8px}
.stc{--c:var(--st-all);display:inline-flex;align-items:center;gap:6px;position:relative;border:0;border-radius:999px;padding:6px 14px;font-size:13px;font-weight:600;white-space:nowrap;background:var(--c);color:var(--st-ink-light);line-height:1.3}
button.stc{cursor:pointer;box-shadow:0 1px 2px rgba(0,0,0,.12)}
button.stc:hover{filter:brightness(1.06)}
button.stc[aria-pressed="false"]{opacity:.92}
button.stc[aria-pressed="true"]{box-shadow:0 0 0 2px var(--surface),0 0 0 4px var(--c)}
.stc .cnt{position:absolute;top:-9px;right:-4px;background:var(--bad);color:#fff;font-size:10.5px;font-weight:700;border-radius:999px;min-width:18px;height:18px;display:grid;place-items:center;padding:0 5px;border:2px solid var(--surface)}
.stc.all{--c:var(--st-all)} .stc.alert{--c:var(--st-alert)} .stc.s1{--c:var(--st-s1)} .stc.callback{--c:var(--st-callback)} .stc.s2{--c:var(--st-s2)}
.stc.s3{--c:var(--st-s3);color:var(--st-ink-dark)} .stc.s4{--c:var(--st-s4)} .stc.s5{--c:var(--st-s5)} .stc.s6{--c:var(--st-s6)} .stc.s7{--c:var(--st-s7)} .stc.lost{--c:var(--st-lost)} .stc.pool{--c:var(--st-pool);color:var(--st-ink-dark)}
span.stc{padding:3px 10px;font-size:12px}

/* ---------- lead cards ---------- */
.lcards{display:grid;grid-template-columns:repeat(auto-fill,minmax(320px,1fr));gap:12px}
.lcard{background:var(--surface);border:1px solid var(--line);border-radius:14px;padding:14px 16px;display:flex;flex-direction:column;gap:10px;cursor:pointer;min-width:0}
.lcard:hover{border-color:var(--accent);box-shadow:var(--shadow)}
.lcard.alert-reclaim{border-color:var(--bad);box-shadow:inset 3px 0 0 var(--bad)} .lcard.alert-warn{box-shadow:inset 3px 0 0 var(--warn)} .lcard.alert-remind{box-shadow:inset 3px 0 0 var(--info)}
.lc-top{display:flex;gap:10px;align-items:flex-start}
.lc-top .grow{flex:1;min-width:0}
.lc-name{color:var(--accent);font-weight:600;font-size:16px;overflow-wrap:anywhere}
.lc-phone{font-size:19px;font-weight:600;letter-spacing:.01em}
.lc-acts{display:flex;gap:6px;flex:none}
.ic{width:38px;height:38px;border-radius:10px;display:grid;place-items:center;border:1px solid var(--line);background:var(--surface);color:var(--muted);cursor:pointer;text-decoration:none;font-size:11px;font-weight:700}
.ic svg{width:18px;height:18px}
.ic:hover{background:var(--surface-2)}
.ic.call{color:var(--good)} .ic.zalo{color:#0068ff}
.lc-row{display:flex;justify-content:space-between;align-items:center;gap:8px;font-size:13px}
.lc-who{display:inline-flex;align-items:center;gap:6px;font-weight:500;min-width:0}
.lc-who svg{width:16px;height:16px;color:var(--muted);flex:none}
.lc-kv{display:grid;grid-template-columns:auto 1fr;gap:5px 14px;margin:0;font-size:13px}
.lc-kv dt{color:var(--muted)} .lc-kv dd{margin:0;text-align:right;overflow-wrap:anywhere}
.lc-kv dd.bad{color:var(--bad);font-weight:600}
.lc-note{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.lc-foot{display:flex;justify-content:space-between;align-items:center;gap:8px;border-top:1px dashed var(--line);padding-top:10px}
.lc-go{color:var(--accent);font-weight:600;font-size:13px;white-space:nowrap}
@media (max-width:760px){
  .lcards{grid-template-columns:minmax(0,1fr)}
  .stc{font-size:12.5px;padding:6px 12px}
}

/* ---------- brand typography & details ---------- */
h1,h2,.kpi .v,.lc-name,.col-h b{font-family:var(--display)}
h1{letter-spacing:-.01em}
.kpi .v{font-weight:700}
.btn.primary{background:linear-gradient(180deg,#99263a,var(--accent));border-color:var(--accent)}
.card-h h2{font-size:14.5px}
.kpi{position:relative}
.kpi::after{content:"";position:absolute;left:16px;top:0;width:28px;height:2px;background:var(--gold-brand);border-radius:0 0 2px 2px}
.stc.all{--c:var(--navy)}
@media (prefers-color-scheme: dark){:root:not([data-theme="light"]) .stc.all{--c:#3a5274}}
.mtop{display:none}
@media (max-width:760px){
  .mtop{display:flex;align-items:center;justify-content:space-between;gap:10px;position:sticky;top:env(safe-area-inset-top,0px);z-index:25;background:var(--navy);padding:10px max(16px,env(safe-area-inset-right,0px)) 10px max(16px,env(safe-area-inset-left,0px))}
  body:has(.mtop:not([hidden]))::before{content:"";position:fixed;inset:0 0 auto;height:env(safe-area-inset-top,0px);z-index:26;background:var(--navy)}
  .mtop img{height:26px;width:auto;display:block}
  .mtop .who-mini{color:var(--navy-ink);font-size:12px;text-align:right;line-height:1.25}
  .mtop .who-mini b{color:#fff;display:block;font-size:13px}
  .tabbar a[aria-current="page"]{color:var(--accent)}
}
a.btn{color:var(--fg)}
a.btn.ghost,.link{color:var(--accent)}
a.btn.primary{color:var(--accent-fg)}
.btn.primary,a.btn.primary{background:linear-gradient(180deg,#a02a3d,#7e1b2b);border-color:#7e1b2b;color:#fff}

/* ---------- lost rotation & lead distribution ---------- */
.chip.ltag{background:#3b2a12;color:#f3d48a;font-family:var(--mono);font-size:11px;letter-spacing:.02em}
.relost{font-size:12.5px;font-weight:500;color:var(--warn);background:var(--warn-soft);border-radius:8px;padding:5px 10px;align-self:flex-start}
.relost.arch{color:var(--muted);background:var(--surface-2)}
.switch{display:inline-flex;align-items:center;gap:8px;border:0;background:none;padding:2px;cursor:pointer;color:var(--muted);font-size:12.5px;font-weight:500;white-space:nowrap}
.switch:disabled{cursor:default;opacity:.7}
.switch i{width:34px;height:20px;border-radius:999px;background:var(--line);position:relative;flex:none;transition:background .15s}
.switch i::after{content:"";position:absolute;top:2px;left:2px;width:16px;height:16px;border-radius:50%;background:#fff;box-shadow:0 1px 2px rgba(0,0,0,.25);transition:transform .15s}
.switch[aria-checked="true"]{color:var(--good)}
.switch[aria-checked="true"] i{background:var(--good)}
.switch[aria-checked="true"] i::after{transform:translateX(14px)}
.setrow{display:flex;justify-content:space-between;align-items:flex-start;gap:14px;padding:12px 14px;border:1px solid var(--line);border-radius:10px;cursor:pointer}
.setrow>span{display:flex;flex-direction:column;gap:2px}
.setrow input{width:20px;height:20px;accent-color:var(--accent);flex:none;margin-top:2px}
.stc.archive{--c:#5b6472}

/* ---------- org chart (phòng ban) ---------- */
.orgwrap{overflow-x:auto;padding:24px 16px 8px}
.tree,.tree ul{list-style:none;margin:0;padding:0;display:flex;justify-content:center}
.tree ul{padding-top:22px;position:relative}
.tree li{position:relative;padding:22px 8px 0;display:flex;flex-direction:column;align-items:center}
.tree>li{padding-top:0}
.tree li::before,.tree li::after{content:"";position:absolute;top:0;width:50%;height:22px;border-top:1.5px solid var(--line)}
.tree li::before{right:50%} .tree li::after{left:50%;border-left:1.5px solid var(--line)}
.tree li:only-child::before,.tree li:only-child::after{display:none}
.tree li:only-child{padding-top:22px}
.tree>li:only-child{padding-top:0}
.tree li:first-child::before,.tree li:last-child::after{border:0}
.tree li:last-child::before{border-right:1.5px solid var(--line);border-radius:0 6px 0 0}
.tree li:first-child::after{border-radius:6px 0 0 0}
.tree ul::before{content:"";position:absolute;top:0;left:50%;height:22px;border-left:1.5px solid var(--line)}
.tree li:only-child>.dnode::before{content:"";position:absolute;top:-22px;left:50%;height:22px;border-left:1.5px solid var(--line)}
.dnode{position:relative;display:flex;flex-direction:column;align-items:center;gap:6px}
.dcard{position:relative;min-width:190px;max-width:230px;border:0;border-radius:12px;padding:12px 16px;text-align:left;color:#fff;cursor:pointer;
  background:linear-gradient(135deg,color-mix(in srgb,var(--dc) 88%,#fff),var(--dc));box-shadow:var(--shadow);display:flex;flex-direction:column;gap:2px}
.dcard b{font-family:var(--display);font-size:15px;line-height:1.25}
.dcard small{font-size:12px;opacity:.88}
.dcard:hover{filter:brightness(1.08)}
.dcount{position:absolute;top:-9px;right:-9px;min-width:22px;height:22px;border-radius:999px;background:var(--gold-brand);color:var(--navy);font-size:11px;font-weight:700;display:grid;place-items:center;padding:0 6px;border:2px solid var(--surface)}
.rootcard{flex-direction:row;align-items:center;gap:12px;background:linear-gradient(135deg,var(--navy-2),var(--navy));cursor:default;min-width:240px}
.rootcard img{width:30px;height:auto}
.rootcard span{display:flex;flex-direction:column}
.dmembers{display:flex;flex-direction:column;gap:4px;min-width:190px;max-width:230px}
.dmembers.row{flex-direction:row;flex-wrap:wrap;max-width:none;padding:0 16px 16px}
.person{display:flex;align-items:center;gap:8px;border:1px solid var(--line);background:var(--surface);border-radius:999px;padding:4px 10px 4px 4px;cursor:pointer;text-align:left;min-width:0}
.person:hover{border-color:var(--accent)}
.person .avatar{width:26px;height:26px;font-size:10px}
.person .grow{min-width:0;display:flex;flex-direction:column;line-height:1.2}
.person b{font-size:12.5px;font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.person small{font-size:11px;color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.loose{border-top:1px solid var(--line);padding-top:12px;margin-top:8px}
.loose h3{padding:0 16px}
.chip.lead-chip{background:var(--gold-soft);color:var(--gold)}
.tabs.card{padding:6px}
.orgwrap>.tree{width:max-content;min-width:100%}

/* ---------- Thiết lập tác nghiệp + bảng màu ---------- */
.palette{display:flex;flex-wrap:wrap;gap:8px;align-items:center}
.sw{width:30px;height:30px;border-radius:8px;border:2px solid transparent;background:var(--sw);cursor:pointer;padding:0;box-shadow:inset 0 0 0 1px rgba(0,0,0,.12)}
.sw[aria-checked="true"]{border-color:var(--fg);box-shadow:0 0 0 2px var(--surface) inset}
.sw.custom{width:auto;display:inline-flex;align-items:center;gap:6px;padding:0 10px 0 4px;background:var(--surface);border:1px dashed var(--line);font-size:12.5px;color:var(--muted);height:30px}
.sw.custom input{width:22px;height:22px;border:0;padding:0;background:none;cursor:pointer}
.sw.custom.on{border:2px solid var(--fg);color:var(--fg)}
.swatch{display:inline-block;width:28px;height:18px;border-radius:5px;background:var(--sw);box-shadow:inset 0 0 0 1px rgba(0,0,0,.12);vertical-align:middle}
.flow{padding:16px;display:flex;flex-direction:column;gap:12px;overflow-x:auto}
.flow-row{display:grid;grid-template-columns:220px 40px 1fr;align-items:center;gap:0;min-width:640px}
.flow-stage,.flow-step{border:0;border-radius:10px;background:var(--c);font-weight:600;font-size:13px;padding:10px 14px;cursor:pointer;text-align:center;line-height:1.25;box-shadow:var(--shadow)}
.flow-stage:disabled,.flow-step:disabled{cursor:default}
.flow-stage:hover:not(:disabled),.flow-step:hover:not(:disabled){filter:brightness(1.08)}
.flow-steps{display:flex;align-items:center;flex-wrap:wrap;gap:8px 0}
.flow-step{min-width:130px;position:relative;display:flex;flex-direction:column;align-items:center;gap:1px}
.flow-step small{font-size:10.5px;font-weight:500;opacity:.88}
.flow-step.off{opacity:.45;text-decoration:line-through}
.flow-step .cnt2{position:absolute;top:-8px;right:-6px;background:var(--surface);color:var(--fg);border:1px solid var(--line);border-radius:999px;font-size:10.5px;min-width:18px;padding:0 5px;line-height:16px}
.flow-step .cnt2:empty{display:none}
.flow-arrow{height:2px;background:var(--line);position:relative;width:100%}
.flow-arrow::after{content:"";position:absolute;right:-1px;top:-4px;border:5px solid transparent;border-left:7px solid var(--line);border-right:0}
.flow-arrow.sm{width:26px;flex:none}
.flow-add{margin-left:10px;width:34px;height:34px;border-radius:50%;border:1.5px dashed var(--line);background:var(--surface);color:var(--muted);font-size:18px;cursor:pointer}
.flow-add:hover{border-color:var(--accent);color:var(--accent)}
.col-h .code,.col-h b{color:var(--colc)}
.col{border-top:3px solid var(--colc)}
@media (max-width:760px){
  .flow-row{grid-template-columns:minmax(0,1fr);min-width:0;gap:8px;padding-bottom:12px;border-bottom:1px solid var(--line)}
  .flow-row:last-child{border-bottom:0}
  .flow-row>.flow-arrow{display:none}
  .flow-stage{justify-self:start}
  .flow-steps{gap:8px}
  .flow-arrow.sm{display:none}
  .flow-step{min-width:0}
}

/* ---------- Sale: Hôm nay + kết quả cuộc gọi ---------- */
.mini-kpis{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:8px;margin-bottom:14px}
.mini-kpis>div{background:var(--surface);border:1px solid var(--line);border-radius:12px;padding:10px 12px;display:flex;flex-direction:column;gap:2px;min-width:0}
.mini-kpis b{font-family:var(--display);font-size:20px;line-height:1.2}
.mini-kpis span{font-size:11.5px;color:var(--muted)}
.queue .qi{align-items:center;gap:14px;border-left:4px solid transparent}
.qi.lv-reclaim{border-left-color:var(--bad)} .qi.lv-new{border-left-color:#f21b1b} .qi.lv-warn{border-left-color:var(--warn)}
.qi.lv-today{border-left-color:var(--info)} .qi.lv-money{border-left-color:var(--gold-brand)} .qi.lv-remind{border-left-color:var(--line)}
.qi-top{display:flex;gap:6px;flex-wrap:wrap;align-items:center;margin-bottom:2px}
.qi-tag{font-size:11px;font-weight:700;text-transform:uppercase;letter-spacing:.04em;color:var(--muted)}
.qi.lv-reclaim .qi-tag{color:var(--bad)} .qi.lv-new .qi-tag{color:#d81b1b} .qi.lv-warn .qi-tag{color:var(--warn)} .qi.lv-money .qi-tag{color:var(--gold)}
.qi-name{font-family:var(--display);font-weight:600;font-size:15.5px;overflow-wrap:anywhere}
.qi-acts{display:flex;gap:6px;flex:none;flex-wrap:wrap;justify-content:flex-end}
.call-btn svg{width:16px;height:16px}
.zalo-btn{color:#0068ff}
.callsheet{max-width:520px;margin:0 auto}
.cr{display:flex;flex-direction:column;align-items:flex-start;gap:2px;width:100%;text-align:left;border:1px solid var(--line);background:var(--surface);border-radius:12px;padding:12px 14px;cursor:pointer}
.cr b{font-size:15px} .cr span{font-size:12.5px;color:var(--muted)}
.cr.ok{border-color:var(--good);background:var(--good-soft)} .cr.ok b{color:var(--good)}
.cr.bad b{color:var(--bad)} .cr.bad.armed{background:var(--bad-soft);border-color:var(--bad)}
.cr.ghost{border-style:dashed;align-items:center}
.cr:hover{filter:brightness(.98)}
@media (max-width:760px){
  .mini-kpis{grid-template-columns:repeat(3,minmax(0,1fr))}
  .mini-kpis>div:nth-child(n+4){display:none}
  .queue .qi{flex-direction:column;align-items:stretch;gap:8px}
  .qi-acts{justify-content:flex-start}
  .qi-acts .btn{flex:1;justify-content:center}
}
.sb-tools input[type=search]{flex:1 1 100%}
.sb-tools select{flex:1 1 150px}
@media (min-width:1100px){.sb-tools input[type=search]{flex:2 1 260px}}

/* ---------- Giỏ hàng: dự án theo loại hình ---------- */
.typeseg{flex-wrap:wrap}
.typeseg .num{opacity:.7;font-size:11px;margin-left:2px}
.pgroup{padding:6px 16px 16px}
.pgroup h3{font-family:var(--head,inherit);font-size:14px;margin:10px 0;display:flex;gap:8px;align-items:baseline;flex-wrap:wrap}
.pgrid{display:grid;grid-template-columns:repeat(auto-fill,minmax(240px,1fr));gap:12px}
.pcard{border:1px solid var(--line);border-radius:12px;background:var(--surface);display:flex;flex-direction:column;overflow:hidden}
.pcard.off{opacity:.6}
.pc-main{display:flex;gap:12px;align-items:center;padding:14px;border:0;background:transparent;text-align:left;cursor:pointer;color:inherit;font:inherit;width:100%}
.pc-main:hover{background:var(--surface-2)}
.pc-main b{display:block;font-size:15px;overflow-wrap:anywhere}
.pc-main small{display:block;color:var(--muted);font-size:12px;margin-top:2px}
.pc-type{width:40px;height:40px;border-radius:10px;background:var(--accent-soft);color:var(--accent);display:grid;place-items:center;font-weight:700;font-size:12px;flex:none}
.pc-foot{display:flex;gap:8px;align-items:center;padding:8px 14px 12px;flex-wrap:wrap}
.pc-foot .sub{flex:1}
.pc-note{margin:0;padding:0 14px 12px;font-size:12px;color:var(--muted);white-space:pre-wrap}
.chip.ps-selling{background:var(--good-soft);color:var(--good)}
.chip.ps-upcoming{background:var(--warn-soft);color:var(--warn)}
.chip.ps-closed{background:var(--surface-2);color:var(--muted)}
@media (max-width:640px){ .pgroup{padding:4px 12px 12px} .pgrid{grid-template-columns:1fr} }
.chip.hr{background:var(--good-soft);color:var(--good)}

.drange{display:inline-flex;align-items:center;gap:6px;flex:1 1 260px}
.drange input{flex:1;min-width:0;border:1px solid var(--line);background:var(--bg);border-radius:999px;padding:8px 12px;font:inherit;color:var(--fg)}
.drange span{color:var(--muted)}

/* ---------- áp lực gọi khách mới ---------- */
.hotbar{position:sticky;top:8px;z-index:20;display:flex;align-items:center;gap:12px;margin-bottom:14px;padding:10px 12px 10px 16px;border-radius:12px;background:var(--bad);color:#fff;box-shadow:0 6px 18px rgba(120,20,30,.25);animation:hb-pulse 1.6s ease-in-out infinite}
.hotbar .grow{display:flex;flex-direction:column;gap:2px;min-width:0}
.hotbar .grow b{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.hotbar .grow span{font-size:13px;opacity:.95}
.hotbar #hb-t{font-size:15px;font-variant-numeric:tabular-nums}
.hotbar .btn{background:#fff;color:var(--bad);border-color:#fff;font-weight:600;flex:none}
.hotbar.called{background:var(--warn);animation:none;box-shadow:0 6px 18px rgba(120,80,0,.2)}
.hotbar.called .btn{color:var(--warn)}
@keyframes hb-pulse{50%{box-shadow:0 6px 26px rgba(200,30,45,.55)}}
@media (prefers-reduced-motion:reduce){.hotbar{animation:none}}
@media (max-width:760px){.hotbar{top:calc(env(safe-area-inset-top,0px) + 54px);margin-inline:-4px}}
.callgate{border:1px dashed var(--bad);background:var(--bad-soft);border-radius:12px;padding:12px 14px;display:flex;flex-direction:column;gap:10px;align-items:flex-start}
.callgate p{margin:0;color:var(--bad);font-size:13.5px}
table.board tr.me td{background:var(--accent-soft)}

/* ---------- Báo cáo CEO ---------- */
.rfilters{display:flex;flex-wrap:wrap;gap:8px;align-items:center;padding:12px 14px;margin-bottom:16px}
.rfilters select{border:1px solid var(--line);background:var(--bg);border-radius:999px;padding:8px 12px;min-width:0;flex:0 1 auto;font:inherit;color:var(--fg)}
.dl{font-weight:600;color:var(--muted)} .dl.up{color:var(--good)} .dl.down{color:var(--bad)}
.grid2e{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}
.grid3{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px}
.ins{list-style:none;margin:0;padding:6px 0}
.ins li{display:flex;gap:10px;align-items:flex-start;padding:10px 16px;border-top:1px solid var(--line);font-size:13.5px;line-height:1.45}
.ins li:first-child{border-top:0}
.ins .ins-tag{flex:none;font-size:11px;font-weight:700;text-transform:uppercase;letter-spacing:.04em;border-radius:6px;padding:2px 7px;margin-top:1px}
.ins li.bad .ins-tag{background:var(--bad-soft);color:var(--bad)}
.ins li.warn .ins-tag{background:var(--warn-soft);color:var(--warn)}
.ins li.good .ins-tag{background:var(--good-soft);color:var(--good)}
.ins .link{flex:none;font-size:12.5px;white-space:nowrap}
.frow.rf .amt small{font-weight:500;color:var(--muted)} .frow.rf .amt small.bad{color:var(--bad);font-weight:600}
.frow .amt small{font-size:11px}
.hb{padding:14px 16px 12px}
.hb-plot{position:relative;height:160px;margin-left:52px}
.hb-g{position:absolute;left:0;right:0;border-top:1px solid var(--line);height:0}
.hb-g span{position:absolute;right:calc(100% + 6px);top:-8px;font-size:11px;color:var(--muted);white-space:nowrap;font-variant-numeric:tabular-nums}
.hb-cols{position:absolute;inset:0;display:flex;align-items:flex-end;gap:2px}
.hb-col{flex:1;height:100%;display:flex;align-items:flex-end;justify-content:center;min-width:0}
.hb-col i{display:block;width:100%;max-width:26px;background:var(--accent);border-radius:4px 4px 0 0}
.hb-col:hover i{filter:brightness(1.25)}
.hb-col:hover{background:color-mix(in srgb,var(--fg) 5%,transparent);border-radius:4px}
.hb-x{display:flex;gap:2px;margin-left:52px;margin-top:6px}
.hb-x span{flex:1;min-width:0;font-size:11px;color:var(--muted);text-align:center;white-space:nowrap;overflow:visible}
.rtip{position:fixed;z-index:80;pointer-events:none;background:var(--fg);color:var(--bg);font-size:12.5px;font-weight:500;padding:6px 10px;border-radius:8px;box-shadow:0 4px 14px rgba(0,0,0,.2);max-width:260px}
.rkv{padding:6px 16px 14px;grid-template-columns:1fr auto}
tr.tot td{font-weight:700;border-top:2px solid var(--line)}
@media (max-width:1100px){.grid3{grid-template-columns:1fr}}
@media (max-width:760px){.grid2e{grid-template-columns:1fr}.rfilters select{flex:1 1 140px}.hb-plot,.hb-x{margin-left:44px}}
@media print{
  .side,.tabbar,.mtop,.hotbar,.banner,.rfilters select,.rfilters .drange,.top .actions,.seg,#rtip{display:none!important}
  body,main{background:#fff!important} .card{break-inside:avoid;box-shadow:none!important}
  .shell,main{display:block!important;padding:0!important}
}
.sdot{display:inline-block;width:9px;height:9px;border-radius:50%;margin-right:6px;vertical-align:1px}

/* ô xổ cập nhật trên thẻ khách + nút Lead mới gọn ở góc (điện thoại) */
.lc-sel{max-width:62%;border:1px solid var(--accent);background:var(--accent-soft);color:var(--accent);font:inherit;font-size:13px;font-weight:600;border-radius:999px;padding:7px 12px;cursor:pointer;min-width:0;text-overflow:ellipsis}
.lc-sel:disabled{opacity:.6}
@media (max-width:760px){
  main{padding-bottom:calc(150px + env(safe-area-inset-bottom,0px))}
  .top .btn.primary[data-add="customer"]{width:52px;height:52px;padding:0;font-size:0;justify-content:center;right:max(14px,env(safe-area-inset-right,0px));bottom:calc(74px + env(safe-area-inset-bottom,0px));opacity:.95}
  .top .btn.primary[data-add="customer"]::before{content:"+";font-size:30px;font-weight:400;line-height:1}
}
