/* Amazon Accounts Hub - on top of the shared app.css tokens.
   Color carries state only: green = usable, amber = recoverable, red = lost, gray = no orders, blue = info. */
:root { --g-ok:var(--green); --g-rec:var(--amber); --g-lost:var(--red); --g-none:#9aa5b8; --g-info:var(--blue); }
:root[data-theme="dark"] { --g-none:#5d6a80; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --g-none:#5d6a80; } }

.small { font-size:12px; } .faint { color:var(--faint); } .num { font-variant-numeric:tabular-nums; }
.mono { font-family:ui-monospace, SFMono-Regular, Menlo, monospace; font-size:12px; overflow-wrap:anywhere; }
.spacer { flex:1; }
.page.enter { animation:pageIn 220ms var(--ease-out); }
@keyframes pageIn { from { opacity:0; transform:translateY(4px); } }
@media (prefers-reduced-motion: reduce) { .page.enter { animation:none; } }

/* ---------- status pills (icon + label, never color alone) */
.spill { display:inline-flex; align-items:center; gap:5px; padding:3px 9px 3px 7px; border-radius:999px; font-size:12px; font-weight:600; white-space:nowrap; line-height:1.4; border:1px solid transparent; }
.spill svg { width:13px; height:13px; flex:none; }
.spill.big { font-size:14px; padding:5px 12px 5px 9px; } .spill.big svg { width:16px; height:16px; }
.spill .mine { display:inline-flex; margin-left:2px; opacity:.75; } .spill .mine svg { width:11px; height:11px; }
.g-ok.spill, .kpill.g-ok { background:var(--green-soft); color:var(--green-ink); border-color:var(--green-line); }
.g-rec.spill, .kpill.g-rec { background:var(--amber-soft); color:var(--amber-ink); border-color:var(--amber-line); }
.g-lost.spill, .kpill.g-lost { background:var(--red-soft); color:var(--red-ink); border-color:var(--red-line); }
.g-none.spill, .kpill.g-none { background:var(--soft); color:var(--muted); border-color:var(--line); }
.kpill.g-info { background:var(--blue-soft); color:var(--blue-ink); }
.kpill { display:inline-block; padding:1px 8px; border-radius:999px; font-size:11px; font-weight:600; border:1px solid transparent; white-space:nowrap; }
.sw { display:inline-block; width:10px; height:10px; border-radius:3px; flex:none; }
.sw.g-ok, .seg.g-ok, .hbT i.g-ok, .goalTrack i.g-ok { background:var(--g-ok); } .sw.g-rec, .seg.g-rec, .hbT i.g-rec { background:var(--g-rec); }
.sw.g-lost, .seg.g-lost, .hbT i.g-lost { background:var(--g-lost); } .sw.g-none, .seg.g-none, .hbT i.g-none { background:var(--g-none); }
.cpill { display:inline-block; padding:2px 8px; border-radius:6px; font-size:12px; font-weight:600; white-space:nowrap; }
.c-todo { background:var(--soft); color:var(--ink2); } .c-wait { background:var(--blue-soft); color:var(--blue-ink); }
.c-replied { background:var(--green-soft); color:var(--green-ink); } .c-over { background:var(--red-soft); color:var(--red-ink); }
.flagTag, .useTag { display:inline-flex; align-items:center; gap:4px; font-size:11px; font-weight:650; margin-left:6px; padding:1px 7px; border-radius:6px; background:var(--amber-soft); color:var(--amber-ink); vertical-align:1px; }
.flagTag svg, .useTag svg { width:11px; height:11px; }
.useTag { margin-left:0; background:var(--soft); color:var(--ink2); } .useTag.crit { background:var(--red); color:#fff; }

/* ---------- top row: live scan chip */
.topRow { display:flex; justify-content:flex-end; min-height:4px; margin-bottom:6px; }
.scanChip { display:inline-flex; align-items:center; gap:10px; padding:6px 12px; border-radius:999px; background:var(--card); border:1px solid var(--line); box-shadow:var(--shadow-1); font-size:12px; color:var(--ink2); max-width:100%; }
.scanChip .meter { width:110px; height:5px; border-radius:9px; background:var(--soft); overflow:hidden; flex:none; } .scanChip .meter i { display:block; height:100%; background:var(--blue); border-radius:9px; }
.pulse { width:8px; height:8px; border-radius:50%; background:var(--blue); flex:none; box-shadow:0 0 0 0 rgba(47,91,234,.5); animation:pulse 2s infinite; }
@keyframes pulse { 70% { box-shadow:0 0 0 7px rgba(47,91,234,0); } 100% { box-shadow:0 0 0 0 rgba(47,91,234,0); } }
@media (prefers-reduced-motion: reduce) { .pulse { animation:none; } }

/* ---------- dashboard */
.secLabel { font-size:11px; font-weight:700; letter-spacing:.06em; text-transform:uppercase; color:var(--muted); margin:2px 0 8px; }
.needGrid { display:grid; grid-template-columns:repeat(auto-fill, minmax(250px, 1fr)); gap:10px; margin-bottom:18px; }
.need { display:grid; grid-template-columns:auto auto 1fr auto; align-items:center; gap:12px; padding:12px 14px; border-radius:12px; border:1px solid var(--line); background:var(--card); color:var(--ink); box-shadow:var(--shadow-1); transition:transform var(--t-press) var(--ease-out), box-shadow var(--t-fast) ease; position:relative; overflow:hidden; }
.need::before { content:''; position:absolute; left:0; top:0; bottom:0; width:4px; }
.need:active { transform:scale(0.98); }
@media (hover:hover) and (pointer:fine) { .need:hover { box-shadow:var(--shadow-2); } }
.needIco { width:32px; height:32px; border-radius:9px; display:grid; place-items:center; } .needIco svg { width:17px; height:17px; }
.needN { font-size:26px; font-weight:750; letter-spacing:-.03em; font-variant-numeric:tabular-nums; }
.needT { display:flex; flex-direction:column; min-width:0; } .needT b { font-size:13px; } .needT span { font-size:11.5px; color:var(--muted); }
.need .chev { width:16px; height:16px; color:var(--faint); }
.n-crit { border-color:var(--red-line); background:var(--red-soft2); } .n-crit::before { background:var(--red); } .n-crit .needIco { background:var(--red); color:#fff; } .n-crit .needN { color:var(--red-ink); }
.n-warn::before { background:var(--amber); } .n-warn .needIco { background:var(--amber-soft); color:var(--amber-ink); }
.n-good::before { background:var(--green); } .n-good .needIco { background:var(--green-soft); color:var(--green-ink); }
.allClear { display:flex; align-items:center; gap:10px; padding:12px 14px; border-radius:12px; background:var(--green-soft); color:var(--green-ink); margin-bottom:18px; font-size:13px; } .allClear svg { width:18px; height:18px; }

.kpis { display:grid; grid-template-columns:repeat(4, minmax(0, 1fr)); gap:12px; margin-bottom:18px; }
.kpi { display:block; background:var(--card); border:1px solid var(--line); border-radius:14px; padding:14px 16px; color:var(--ink); box-shadow:var(--shadow-1); transition:transform var(--t-press) var(--ease-out), box-shadow var(--t-fast) ease, border-color var(--t-fast) ease; }
.kpi:active { transform:scale(0.98); }
@media (hover:hover) and (pointer:fine) { .kpi:hover { box-shadow:var(--shadow-2); border-color:var(--line2); } }
.kTop { display:flex; align-items:center; gap:8px; } .kL { font-size:13px; font-weight:600; color:var(--ink2); }
.kIco { width:26px; height:26px; border-radius:8px; display:grid; place-items:center; background:var(--soft); color:var(--ink2); } .kIco svg { width:15px; height:15px; }
.kN { font-size:34px; font-weight:750; letter-spacing:-.035em; line-height:1.1; margin-top:10px; font-variant-numeric:tabular-nums; }
.kS { font-size:11.5px; color:var(--muted); margin-top:2px; }
.k-ok .kIco { background:var(--green-soft); color:var(--green-ink); } .k-rec .kIco { background:var(--amber-soft); color:var(--amber-ink); }
.kpi.zero .kN { color:var(--faint); }

.dashGrid { display:grid; grid-template-columns:minmax(0, 1.6fr) minmax(0, 1fr); gap:14px; margin-bottom:14px; align-items:start; }
.dashGrid > .card, .stackCol > .card { margin-bottom:0; } .stackCol { display:flex; flex-direction:column; gap:14px; }
.compBar { display:flex; gap:2px; height:14px; border-radius:4px; overflow:hidden; margin:6px 0 12px; background:var(--soft); }
.seg { display:block; min-width:3px; transition:opacity var(--t-fast) ease; }
@media (hover:hover) and (pointer:fine) { .compBar:hover .seg { opacity:.55; } .compBar .seg:hover { opacity:1; } }
.compLegend { display:grid; grid-template-columns:repeat(auto-fill, minmax(190px, 1fr)); gap:4px 10px; }
.lg { display:flex; align-items:center; gap:7px; color:var(--ink); font-size:12.5px; padding:6px 8px; border-radius:8px; white-space:nowrap; } .lg b { margin-left:auto; font-variant-numeric:tabular-nums; } .lg .faint { font-size:11px; min-width:30px; text-align:right; }
@media (hover:hover) and (pointer:fine) { .lg:hover { background:var(--hover); } }
.divider { height:1px; background:var(--line); margin:12px 0 6px; }
.hbar { display:grid; grid-template-columns:minmax(150px, 220px) 1fr 54px; align-items:center; gap:12px; padding:6px 4px; color:var(--ink); border-radius:6px; font-size:12.5px; }
@media (hover:hover) and (pointer:fine) { .hbar:hover { background:var(--hover); } }
.hbL { display:flex; align-items:center; gap:7px; min-width:0; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; } .hbL .mine svg { width:11px; height:11px; color:var(--faint); }
.hbT { height:8px; } .hbT i { display:block; height:100%; border-radius:0 4px 4px 0; }
.hbar b { text-align:right; font-variant-numeric:tabular-nums; }
.goalN { display:flex; align-items:baseline; gap:8px; } .goalN b { font-size:30px; font-weight:750; letter-spacing:-.03em; } .goalN span { color:var(--muted); font-size:13px; }
.goalTrack { height:8px; border-radius:9px; background:var(--soft); overflow:hidden; margin:10px 0 6px; } .goalTrack i { display:block; height:100%; background:var(--blue); border-radius:9px; }
.ilRow { display:flex; justify-content:space-between; padding:8px 4px; border-bottom:1px solid var(--line); color:var(--ink); font-size:13px; } .ilRow:last-child { border-bottom:0; } .ilRow b { font-variant-numeric:tabular-nums; }
@media (hover:hover) and (pointer:fine) { .ilRow:hover { background:var(--hover); } }

/* ---------- list */
.card.flush { padding:0; overflow:hidden; } .card.flush .toolbar { padding:12px 14px; border-bottom:1px solid var(--line); margin:0; }
.tabs button.tHot b:not(:empty) { background:var(--red); color:#fff; }
.tbl.acc td { vertical-align:middle; padding-top:10px; padding-bottom:10px; }
.tbl.acc tr.click { cursor:pointer; } .tbl.acc tr.click td:first-child { box-shadow:inset 3px 0 0 transparent; }
.tbl.acc tr.r-ok td:first-child { box-shadow:inset 3px 0 0 var(--g-ok); } .tbl.acc tr.r-rec td:first-child { box-shadow:inset 3px 0 0 var(--g-rec); }
.tbl.acc tr.r-lost td:first-child { box-shadow:inset 3px 0 0 var(--g-lost); } .tbl.acc tr.r-none td:first-child { box-shadow:inset 3px 0 0 var(--g-none); }
@media (hover:hover) and (pointer:fine) { .tbl.acc tr.click:hover td { background:var(--row-h); } }
.nameCell b { font-size:13.5px; } .nameCell .mono { margin-top:1px; }
.reason { font-size:11.5px; color:var(--muted); margin-top:3px; max-width:320px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.dt { display:block; font-variant-numeric:tabular-nums; }
.tbl th[data-sort] { cursor:pointer; user-select:none; white-space:nowrap; } .tbl th.sorted { color:var(--ink); } .tbl th.sorted::after { content:' ↓'; color:var(--blue); } .tbl th.sorted[data-dir=asc]::after { content:' ↑'; }
.pager { display:flex; align-items:center; gap:8px; margin-left:auto; font-size:12px; color:var(--muted); } .pager.bottom { justify-content:flex-end; padding:10px 14px; } .pager:empty { display:none; }
.emptyBig { display:flex; flex-direction:column; align-items:center; gap:4px; padding:40px 0; color:var(--muted); } .emptyBig svg { width:28px; height:28px; color:var(--faint); margin-bottom:4px; } .emptyBig b { color:var(--ink); }

/* ---------- account drawer */
.drawerBody.wide { width:min(860px, 100vw); }
.skel { height:64px; border-radius:12px; background:var(--soft); margin-bottom:12px; animation:skel 1.2s ease-in-out infinite alternate; } .skel.s2 { height:120px; } .skel.s3 { height:220px; }
@keyframes skel { to { opacity:.5; } }
.acctHead { display:flex; justify-content:space-between; gap:14px; flex-wrap:wrap; align-items:flex-end; margin:2px 44px 16px 0; }
.ahL { display:flex; gap:12px; align-items:center; min-width:0; }
.ahL h2 { margin:0; display:flex; align-items:center; gap:4px; font-size:20px; letter-spacing:-.01em; }
.avatarL { width:44px; height:44px; border-radius:12px; display:grid; place-items:center; font-weight:750; font-size:15px; flex:none; background:var(--soft); color:var(--ink2); }
.avatarL.g-ok { background:var(--green-soft); color:var(--green-ink); } .avatarL.g-rec { background:var(--amber-soft); color:var(--amber-ink); } .avatarL.g-lost { background:var(--red-soft); color:var(--red-ink); }
.useSel { display:flex; flex-direction:column; gap:3px; } .useSel select { min-width:220px; }
.banner { border-radius:14px; padding:14px 16px; margin-bottom:14px; border:1px solid var(--line); background:var(--soft2); }
.banner.g-ok { background:var(--green-soft); border-color:var(--green-line); } .banner.g-rec { background:var(--amber-soft); border-color:var(--amber-line); } .banner.g-lost { background:var(--red-soft); border-color:var(--red-line); }
.bTop { display:flex; align-items:center; gap:12px; }
.bIco { width:40px; height:40px; border-radius:11px; display:grid; place-items:center; flex:none; background:var(--card); } .bIco svg { width:21px; height:21px; }
.g-ok .bIco { color:var(--green); } .g-rec .bIco { color:var(--amber); } .g-lost .bIco { color:var(--red); } .g-none .bIco { color:var(--g-none); }
.bLabel { font-size:19px; font-weight:750; letter-spacing:-.015em; color:var(--ink); } .bSub { font-size:12.5px; color:var(--ink2); margin-top:1px; }
.bBtn { margin-left:auto; flex:none; }
.bWarn { display:flex; gap:8px; align-items:flex-start; margin-top:12px; padding:9px 11px; border-radius:9px; background:var(--card); color:var(--amber-ink); font-size:12.5px; border:1px solid var(--amber-line); } .bWarn svg { width:15px; height:15px; flex:none; margin-top:1px; }
.bQuote { margin-top:12px; padding:10px 12px; border-radius:9px; background:var(--card); font-size:13px; color:var(--ink2); line-height:1.5; display:flex; flex-direction:column; gap:3px; border-left:3px solid var(--line2); }
.facts { display:grid; grid-template-columns:repeat(5, minmax(0, 1fr)); gap:1px; background:var(--line); border:1px solid var(--line); border-radius:12px; overflow:hidden; margin-bottom:18px; }
.facts > div { background:var(--card); padding:10px 12px; display:flex; flex-direction:column; min-width:0; }
.facts span { font-size:11px; color:var(--muted); text-transform:uppercase; letter-spacing:.04em; font-weight:600; } .facts b { font-size:16px; font-weight:700; margin-top:3px; font-variant-numeric:tabular-nums; } .facts em { font-style:normal; font-size:11px; color:var(--faint); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.dSec { border-top:1px solid var(--line); padding:14px 0 6px; } .dSec h3 { display:flex; align-items:center; gap:7px; margin:0 0 10px; font-size:14px; } .dSec h3 svg { width:16px; height:16px; color:var(--muted); } .dSec h3 .faint { font-weight:500; }
.caseEmpty { display:flex; align-items:center; justify-content:space-between; gap:10px; flex-wrap:wrap; } .caseEmpty .actions, .dSec .actions { margin:0; }
.caseHead { display:flex; align-items:center; gap:10px; margin-bottom:8px; }
.steps { list-style:none; padding:0; margin:0 0 12px; } .steps li { display:flex; gap:10px; padding:8px 0; border-bottom:1px dashed var(--line); } .steps li:last-child { border-bottom:0; }
.stepN { width:22px; height:22px; border-radius:50%; background:var(--blue-soft); color:var(--blue-ink); font-size:11px; font-weight:700; display:grid; place-items:center; flex:none; }
.stepNote { margin-top:4px; color:var(--ink2); white-space:pre-wrap; }
.past summary { cursor:pointer; color:var(--muted); font-size:12px; margin-top:8px; }
.tpl { color:var(--ink2); font-family:inherit; white-space:pre-wrap; font-size:12.5px; line-height:1.55; background:var(--soft2); padding:12px 14px; border-radius:10px; max-height:240px; overflow:auto; margin:0; border:1px solid var(--line); }
.note { padding:9px 0; border-bottom:1px solid var(--line); white-space:pre-wrap; font-size:13px; } .note:last-of-type { border-bottom:0; } .note .faint { display:block; margin-top:2px; }
.tl { position:relative; padding-left:18px; } .tl::before { content:''; position:absolute; left:5px; top:6px; bottom:6px; width:2px; background:var(--line); border-radius:2px; }
.tlRow { position:relative; padding:0 0 14px; } .tlDot { position:absolute; left:-18px; top:4px; width:12px; height:12px; border-radius:50%; border:2px solid var(--card); background:var(--g-none); }
.tlDot.g-ok { background:var(--g-ok); } .tlDot.g-rec { background:var(--g-rec); } .tlDot.g-lost { background:var(--g-lost); } .tlDot.g-info { background:var(--blue); }
.tlTop { display:flex; align-items:center; gap:8px; } .tlSubj { font-weight:600; font-size:13px; margin-top:3px; } .tlSnip { font-size:12.5px; color:var(--muted); margin-top:3px; line-height:1.45; }

/* ---------- modals */
.modalBody.wideModal { width:min(680px, calc(100vw - 32px)); }
.optGroups { display:grid; grid-template-columns:repeat(3, minmax(0, 1fr)); gap:12px; margin:10px 0; }
.optH { font-size:11px; font-weight:700; text-transform:uppercase; letter-spacing:.05em; color:var(--muted); margin-bottom:6px; }
.opt { display:flex !important; flex-direction:row !important; align-items:center; gap:8px; padding:8px 10px; border:1px solid var(--line); border-radius:9px; margin-bottom:6px; font-size:13px; cursor:pointer; font-weight:500; transition:border-color var(--t-fast) ease, background var(--t-fast) ease; }
.opt input { margin:0; width:auto; } .opt:has(input:checked) { border-color:var(--blue); background:var(--blue-soft); }
.opt.auto { margin:4px 0 12px; }
textarea { width:100%; font:inherit; }

@media (max-width: 1100px) { .kpis { grid-template-columns:repeat(2, minmax(0, 1fr)); } .dashGrid { grid-template-columns:1fr; } .facts { grid-template-columns:repeat(3, minmax(0, 1fr)); } }
@media (max-width: 700px) { .hbar { grid-template-columns:120px 1fr 44px; } .optGroups { grid-template-columns:1fr; } .facts { grid-template-columns:repeat(2, minmax(0, 1fr)); } .bTop { flex-wrap:wrap; } .bBtn { margin-left:0; } .reason { max-width:200px; } }
.tbl.acc th, .tbl.acc td { padding-left:12px; padding-right:12px; }
.tbl.acc th:first-child, .tbl.acc td:first-child { padding-left:18px; } .tbl.acc th:last-child, .tbl.acc td:last-child { padding-right:18px; }
.card.flush .toolbar { flex-wrap:wrap; }
.card.flush .tableWrap { margin:0 !important; width:100%; }
.emailMain { font-weight:600; color:var(--ink); font-size:13px; overflow-wrap:anywhere; }
