/* CASA ESSENTIIALS — commerce console. One signature: the rib-knit texture on the brand. Everything else stays quiet. */
:root {
  --ink: #1B2140;
  --ink-2: #252C52;
  --ink-3: #343C68;
  --plum: #6E4AA8;
  --plum-soft: #EFEAF8;
  --bg: #F4F5F8;
  --surface: #FFFFFF;
  --line: #E2E5EC;
  --line-2: #EEF0F4;
  --text: #1A2032;
  --muted: #5D6478;
  --faint: #8A90A2;
  --good: #1D7348; --good-bg: #E5F3EB;
  --warn: #9A5B00; --warn-bg: #FCF1DC;
  --bad: #B42318;  --bad-bg: #FCEBE9;
  --info: #2C56AE; --info-bg: #E8EEFA;
  --r-card: 12px;
  --r-ctl: 8px;
  --side-w: 256px;
  --font: "Hanken Grotesk", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.5 var(--font); font-feature-settings: "tnum" 1; }
a { color: var(--plum); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--plum); outline-offset: 2px; border-radius: 4px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.icon { flex: none; vertical-align: middle; }
h1, h2, h3 { margin: 0; font-weight: 650; letter-spacing: -0.01em; color: var(--ink); }
h2 { font-size: 16px; }
h3 { font-size: 14px; }

/* ---------- Shell ---------- */
.shell { display: flex; min-height: 100vh; background: linear-gradient(to right, var(--ink) var(--side-w), transparent var(--side-w)); }
.side {
  width: var(--side-w); flex: none; background: var(--ink); color: #C9CDE0;
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.brand {
  display: flex; align-items: center; gap: 12px; padding: 22px 20px 20px; color: #fff; text-decoration: none;
  border-bottom: 1px solid rgba(255,255,255,.07);
  background: repeating-linear-gradient(90deg, rgba(255,255,255,.035) 0 2px, transparent 2px 7px);
}
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 9px; flex: none;
  background:
    repeating-linear-gradient(90deg, rgba(255,255,255,.28) 0 2px, transparent 2px 5px),
    linear-gradient(160deg, #8A64C6, var(--plum) 55%, #4E3380);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.18);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-text strong { font-size: 13.5px; letter-spacing: 0.08em; font-weight: 700; }
.brand-text small { font-size: 12px; color: #9EA4C2; margin-top: 2px; }
.nav { padding: 10px 12px 16px; flex: 1; }
.nav-group { margin-top: 14px; }
.nav-label { font-size: 12px; color: #8389AA; padding: 0 10px 6px; }
.nav a {
  display: flex; align-items: center; gap: 11px; padding: 8px 10px; margin: 1px 0; border-radius: 8px;
  color: #C9CDE0; font-weight: 500; text-decoration: none; position: relative;
}
.nav a:hover { background: var(--ink-2); color: #fff; }
.nav a.active { background: var(--ink-3); color: #fff; }
.nav a.active::before { content: ""; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: #A98BE0; }
.nav a .icon { opacity: .85; }
.side-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 14px 16px; border-top: 1px solid rgba(255,255,255,.07); }
.who { display: flex; align-items: center; gap: 10px; min-width: 0; }
.who strong { display: block; color: #fff; font-weight: 600; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.who small { color: #8F96B5; font-size: 12px; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--ink-3); color: #fff; display: grid; place-items: center; font-weight: 600; flex: none; }
.logout { color: #9EA4C2; padding: 7px; border-radius: 8px; display: inline-flex; }
.logout:hover { background: var(--ink-2); color: #fff; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: flex-end; gap: 16px; padding: 26px 32px 18px; flex-wrap: wrap; }
.titles { flex: 1; min-width: 220px; }
.topbar h1 { font-size: 23px; line-height: 1.2; }
.subtitle { margin: 5px 0 0; color: var(--muted); max-width: 72ch; }
.back { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); font-size: 13px; margin-bottom: 6px; }
.top-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.menu-btn { display: none; }
.content { padding: 0 32px 48px; max-width: 1480px; width: 100%; }

/* ---------- Cards & layout ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); margin-bottom: 20px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line-2); flex-wrap: wrap; }
.card-head p { margin: 2px 0 0; color: var(--muted); font-size: 13px; }
.card-body { padding: 18px 20px; }
.card-body.flush { padding: 0; }
.grid { display: grid; gap: 20px; }
.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.split > *, .grid > * { min-width: 0; }
.split { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(300px, 1fr); gap: 20px; align-items: start; }
.stack > * + * { margin-top: 12px; }
.muted { color: var(--muted); }
.faint { color: var(--faint); font-size: 12.5px; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }

/* Metric strip: one panel, divided — not a row of identical cards */
.metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); margin-bottom: 20px; overflow: hidden; }
.metric { padding: 16px 20px; border-left: 1px solid var(--line-2); }
.metric:first-child { border-left: 0; }
.metric .label { color: var(--muted); font-size: 13px; }
.metric .value { font-size: 24px; font-weight: 650; color: var(--ink); margin-top: 2px; letter-spacing: -0.02em; }
.metric .sub { color: var(--faint); font-size: 12.5px; margin-top: 1px; }
.metric .value.neg { color: var(--bad); }

/* ---------- Tables ---------- */
.table-wrap { position: relative; overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th { text-align: left; font-weight: 600; color: var(--muted); font-size: 12.5px; padding: 10px 14px; background: #FAFBFC; border-bottom: 1px solid var(--line); white-space: nowrap; position: sticky; top: 0; z-index: 1; }
.tbl td { padding: 10px 14px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.tbl tbody tr:hover td { background: #FAFAFD; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl .num { text-align: right; white-space: nowrap; }
.tbl td.check, .tbl th.check { width: 36px; padding-right: 0; }
.orders-tbl td.check, .orders-tbl th.check { width: 30px; padding-left: 16px; }
.orders-tbl .sku-name { max-width: 230px; }
.tbl td select { min-width: 128px; }
.tbl td input { min-width: 90px; }
.tbl td input[type=checkbox], .tbl td input[type=radio] { min-width: 0; }
.tbl tfoot td { font-weight: 650; background: #FAFBFC; border-top: 1px solid var(--line); }
.sku { font-weight: 600; color: var(--ink); white-space: nowrap; }
.sku-name { display: block; color: var(--muted); font-size: 12.5px; font-weight: 400; max-width: 260px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.desc { display: block; color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.empty { padding: 36px 20px; text-align: center; color: var(--muted); }
.empty strong { display: block; color: var(--text); margin-bottom: 4px; }

/* ---------- Chips, badges, stock ---------- */
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px 2px 7px; border: 1px solid var(--line); border-radius: 999px; font-size: 12.5px; white-space: nowrap; background: #fff; color: var(--text); }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: none; }
.badge { display: inline-block; padding: 2px 8px; border-radius: 6px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.badge.good { background: var(--good-bg); color: var(--good); }
.badge.warn { background: var(--warn-bg); color: var(--warn); }
.badge.bad { background: var(--bad-bg); color: var(--bad); }
.badge.info { background: var(--info-bg); color: var(--info); }
.badge.muted { background: #EEF0F4; color: var(--muted); }
.stock { display: inline-block; min-width: 34px; text-align: center; padding: 2px 8px; border-radius: 6px; font-weight: 650; font-size: 12.5px; }
.stock.good { background: var(--good-bg); color: var(--good); }
.stock.warn { background: var(--warn-bg); color: var(--warn); }
.stock.bad { background: var(--bad-bg); color: var(--bad); }
.price-cell { white-space: nowrap; }
.price-cell .dot { margin-right: 6px; }
.price-cell.off { color: var(--faint); }
.size-chips { display: flex; gap: 4px; flex-wrap: wrap; }
.size-chips span { font-size: 11.5px; padding: 1px 6px; border-radius: 5px; background: #F0F1F5; color: var(--muted); }
.size-chips span.zero { background: var(--bad-bg); color: var(--bad); }

/* ---------- Buttons & forms ---------- */
.btn { display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 14px; border-radius: var(--r-ctl); border: 1px solid var(--ink); background: var(--ink); color: #fff; font: 600 13.5px var(--font); cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:hover { background: var(--ink-2); text-decoration: none; }
.btn.secondary { background: #fff; color: var(--ink); border-color: var(--line); }
.btn.secondary:hover { background: #F6F7FA; border-color: #D3D7E0; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.ghost:hover { background: #EEF0F4; color: var(--ink); }
.btn.danger { background: #fff; color: var(--bad); border-color: #F2C9C4; }
.btn.danger:hover { background: var(--bad-bg); }
.btn.accent { background: var(--plum); border-color: var(--plum); }
.btn.accent:hover { background: #5D3D93; }
.btn.sm { height: 30px; padding: 0 10px; font-size: 12.5px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
label { font-weight: 600; font-size: 13px; color: var(--text); }
.field { display: flex; flex-direction: column; gap: 5px; }
.field .hint { font-weight: 400; color: var(--faint); font-size: 12.5px; }
input:not([type]), input[type=text], input[type=email], input[type=number], input[type=password], input[type=date], input[type=datetime-local], input[type=search], select, textarea {
  height: 36px; padding: 0 11px; border: 1px solid #D5D9E2; border-radius: var(--r-ctl); background: #fff; color: var(--text); font: 14px var(--font); width: 100%;
}
textarea { height: auto; padding: 9px 11px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--plum); box-shadow: 0 0 0 3px rgba(110,74,168,.15); }
input[type=file] { font: 13px var(--font); }
input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--plum); }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px 16px; }
.form-actions { display: flex; gap: 8px; margin-top: 18px; flex-wrap: wrap; }
.filters { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; padding: 14px 20px; border-bottom: 1px solid var(--line-2); }
.filters .field { min-width: 150px; }
.filters .field.grow { flex: 1; min-width: 220px; }
.inline-field { display: inline-flex; align-items: center; gap: 8px; font-weight: 500; color: var(--muted); white-space: nowrap; }
.inline-field select { width: auto; height: 32px; }
.search-input { position: relative; }
.search-input .icon { position: absolute; left: 10px; top: 9px; color: var(--faint); }
.search-input input { padding-left: 34px; }
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 20px; border-bottom: 1px solid var(--line-2); flex-wrap: wrap; background: #FCFCFE; }
.bulkbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.bulkbar select { width: auto; height: 32px; }

/* ---------- Alerts ---------- */
.alert { display: flex; gap: 10px; align-items: flex-start; padding: 12px 16px; border-radius: 10px; margin-bottom: 16px; border: 1px solid transparent; }
.alert .icon { margin-top: 2px; }
.alert.success { background: var(--good-bg); color: #155C39; border-color: #C6E5D3; }
.alert.error { background: var(--bad-bg); color: #8E1C13; border-color: #F2C9C4; }
.alert.info { background: var(--info-bg); color: #1F4290; border-color: #CCD9F3; }
.alert.warn { background: var(--warn-bg); color: #7A4800; border-color: #F0DBB1; }

/* Attention list on dashboard */
.attention { list-style: none; margin: 0; padding: 0; }
.attention li { display: flex; gap: 12px; align-items: center; padding: 12px 20px; border-bottom: 1px solid var(--line-2); }
.attention li:last-child { border-bottom: 0; }
.attention .count { min-width: 38px; height: 28px; padding: 0 8px; border-radius: 7px; display: grid; place-items: center; font-weight: 700; }
.attention .count.bad { background: var(--bad-bg); color: var(--bad); }
.attention .count.warn { background: var(--warn-bg); color: var(--warn); }
.attention .count.info { background: var(--info-bg); color: var(--info); }
.attention .what { flex: 1; }
.attention .what small { display: block; color: var(--muted); }
.all-clear { padding: 22px 20px; color: var(--good); display: flex; gap: 8px; align-items: center; }

/* Channel split rows */
.split-rows { padding: 6px 20px 14px; }
.split-row { display: grid; grid-template-columns: 150px 1fr 90px; gap: 12px; align-items: center; padding: 8px 0; }
.split-row .bar { height: 10px; background: #EEF0F4; border-radius: 5px; overflow: hidden; }
.split-row .bar i { display: block; height: 100%; border-radius: 5px; }
.split-row .val { text-align: right; font-weight: 600; }
.split-row .val small { display: block; color: var(--faint); font-weight: 400; }

/* Chart */
.chart { position: relative; padding: 8px 20px 16px; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart .axis text { fill: var(--faint); font-size: 11px; font-family: var(--font); }
.chart .grid line { stroke: var(--line-2); }
.chart .hit { fill: transparent; cursor: default; }
.chart .hit:hover + g rect, .chart g.col:hover rect { opacity: .85; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.tip { position: absolute; pointer-events: none; background: var(--ink); color: #fff; padding: 8px 10px; border-radius: 8px; font-size: 12.5px; line-height: 1.45; min-width: 130px; transform: translate(-50%, -100%); margin-top: -8px; display: none; z-index: 5; box-shadow: 0 6px 18px rgba(20,24,50,.18); }
.tip b { display: block; margin-bottom: 2px; }
.tip i { width: 8px; height: 8px; border-radius: 2px; display: inline-block; margin-right: 6px; }

/* Waterfall */
.waterfall td { padding: 11px 20px; }
.waterfall .minus td:first-child { padding-left: 36px; color: var(--muted); }
.waterfall .minus .num { color: var(--bad); }
.waterfall .total td { font-weight: 650; border-top: 1px solid var(--line); }
.waterfall .grand td { font-size: 16px; font-weight: 700; background: #FAFBFD; }

/* Tabs */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); padding: 0 20px; overflow-x: auto; }
.tabs a { padding: 12px 12px 11px; color: var(--muted); font-weight: 600; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; text-decoration: none; }
.tabs a:hover { color: var(--ink); }
.tabs a.active { color: var(--ink); border-bottom-color: var(--plum); }

/* Steps (bulk update) */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; border-bottom: 1px solid var(--line-2); }
.step { padding: 14px 20px; display: flex; gap: 10px; align-items: center; color: var(--muted); border-right: 1px solid var(--line-2); }
.step:last-child { border-right: 0; }
.step .n { width: 24px; height: 24px; border-radius: 50%; border: 1.5px solid #CCD0DA; display: grid; place-items: center; font-weight: 700; font-size: 12px; flex: none; }
.step.on { color: var(--ink); }
.step.on .n { background: var(--plum); border-color: var(--plum); color: #fff; }
.step.done .n { background: var(--good); border-color: var(--good); color: #fff; }
.diff-old { color: var(--faint); text-decoration: line-through; margin-right: 6px; }
.diff-new { color: var(--ink); font-weight: 650; }

/* Dropzone */
.drop { border: 1.5px dashed #CBD0DB; border-radius: 10px; padding: 22px; text-align: center; background: #FBFBFD; }
.drop p { margin: 6px 0 12px; color: var(--muted); }

/* Pager */
.pager { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 20px; border-top: 1px solid var(--line-2); flex-wrap: wrap; }
.pager-info { color: var(--muted); font-size: 13px; }
.pager-links { display: flex; gap: 4px; align-items: center; flex-wrap: wrap; }
.pager-links a, .pager-links span { min-width: 32px; height: 32px; padding: 0 10px; display: inline-grid; place-items: center; border-radius: 7px; font-size: 13px; color: var(--text); text-decoration: none; }
.pager-links a { border: 1px solid var(--line); background: #fff; }
.pager-links a:hover { border-color: #C7CCD8; background: #F7F8FB; }
.pager-links .current { background: var(--ink); color: #fff; font-weight: 600; }
.pager-links .gap { color: var(--faint); min-width: 18px; padding: 0; }

/* Definition list (stock card) */
.ledger { margin: 0; }
.ledger div { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--line-2); }
.ledger div:last-child { border-bottom: 0; font-weight: 700; font-size: 15px; color: var(--ink); }
.ledger dt { color: var(--muted); }
.ledger dd { margin: 0; font-weight: 600; }

/* Login */
.login { min-height: 100vh; display: grid; grid-template-columns: 1fr minmax(380px, 480px); }
.login-art {
  background:
    repeating-linear-gradient(90deg, rgba(255,255,255,.045) 0 3px, transparent 3px 11px),
    radial-gradient(120% 90% at 0% 100%, #33295C 0%, transparent 60%),
    var(--ink);
  color: #fff; padding: 48px; display: flex; flex-direction: column; justify-content: space-between;
}
.login-art .brand { padding: 0; border: 0; background: none; }
.login-art blockquote { margin: 0; font-size: 30px; line-height: 1.25; font-weight: 600; max-width: 18ch; letter-spacing: -0.02em; }
.login-art p { color: #A9AFCB; max-width: 44ch; }
.login-form { background: #fff; display: flex; align-items: center; justify-content: center; padding: 40px; }
.login-form form { width: 100%; max-width: 340px; }
.login-form h1 { font-size: 24px; margin-bottom: 4px; }
.login-form .field { margin-top: 16px; }
.login-form .btn { width: 100%; justify-content: center; height: 42px; margin-top: 22px; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .split { grid-template-columns: 1fr; }
  .cols-3 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 860px) {
  .shell { background: none; }
  html, body { overflow-x: hidden; }
  .side { position: fixed; left: 0; top: 0; z-index: 20; transform: translateX(-100%); transition: transform .2s ease; box-shadow: 0 0 40px rgba(0,0,0,.25); }
  .side.open { transform: none; }
  .menu-btn { display: inline-flex; align-self: center; background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 7px; color: var(--ink); cursor: pointer; }
  .topbar { padding: 16px 16px 12px; align-items: center; }
  .topbar h1 { font-size: 20px; }
  .content { padding: 0 16px 40px; }
  .cols-2, .cols-3 { grid-template-columns: 1fr; }
  .steps { grid-template-columns: 1fr; }
  .step { border-right: 0; border-bottom: 1px solid var(--line-2); }
  .split-row { grid-template-columns: 96px 1fr 76px; }
  .login { grid-template-columns: 1fr; }
  .login-art { display: none; }
  .metric { border-left: 0; border-top: 1px solid var(--line-2); }
  .filters .field, .filters .field.grow { min-width: 100%; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* ---------- v3 additions ---------- */
.badge.new { background: var(--plum); color: #fff; }
.status-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
@media (max-width: 860px) { .status-tabs { gap: 6px; } .status-tabs a { height: 34px; padding: 0 11px; } }
.main { min-width: 0; }
.status-tabs a { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line); background: #fff; color: var(--muted); font-weight: 600; font-size: 13px; text-decoration: none; }
.status-tabs a span { color: var(--faint); font-weight: 600; }
.status-tabs a:hover { border-color: #C7CCD8; color: var(--ink); }
.status-tabs a.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.status-tabs a.on span { color: #B9BEDA; }
.tbl td select.status-select { min-width: 118px; height: 32px; padding: 0 28px 0 10px; font-weight: 600; font-size: 12.5px; border-radius: 7px; }
.status-select.s-created { background-color: #EEF0F4; color: var(--muted); border-color: #E1E4EA; }
.status-select.s-packed, .status-select.s-picked, .status-select.s-shipped { background-color: var(--info-bg); color: var(--info); border-color: #CCD9F3; }
.status-select.s-delivered { background-color: var(--good-bg); color: var(--good); border-color: #C6E5D3; }
.status-select.s-cancelled { background-color: var(--bad-bg); color: var(--bad); border-color: #F2C9C4; }
.status-select:disabled { opacity: .6; }
.mono { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 12.5px; letter-spacing: .01em; }
.track { display: inline-flex; align-items: center; gap: 4px; }
.icon-btn { display: inline-grid; place-items: center; width: 24px; height: 24px; border: 0; background: transparent; color: var(--faint); border-radius: 6px; cursor: pointer; padding: 0; }
.icon-btn:hover { background: #EEF0F4; color: var(--ink); }
.small-link { font-size: 12.5px; }
.import-result { margin: 6px 0 6px; padding-left: 18px; }
.import-result li { margin: 2px 0; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 10px; font-weight: 600; font-size: 13.5px; box-shadow: 0 8px 30px rgba(27,33,64,.25); opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 50; max-width: min(560px, calc(100vw - 32px)); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.bad { background: var(--bad); }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 600; color: var(--ink); word-break: break-all; }
.radio-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.radio-cards label { display: flex; gap: 10px; align-items: flex-start; border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; cursor: pointer; font-weight: 400; }
.radio-cards label:has(input:checked) { border-color: var(--plum); background: var(--plum-soft); }
.radio-cards input { margin-top: 3px; accent-color: var(--plum); width: auto; height: auto; }
.radio-cards strong { display: block; color: var(--ink); }
.radio-cards small { color: var(--muted); }
.check-line { display: flex; gap: 8px; align-items: flex-start; font-weight: 400; }
.check-line input { width: auto; height: auto; margin-top: 3px; accent-color: var(--plum); }

/* Business report */
.report-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; padding: 20px 22px; background: var(--ink); color: #fff; border-radius: var(--r-card); margin-bottom: 18px; position: relative; overflow: hidden; }
.report-head:before { content: ""; position: absolute; inset: 0; background: repeating-linear-gradient(90deg, rgba(255,255,255,.04) 0 3px, transparent 3px 11px); }
.report-head > * { position: relative; }
.report-head h2 { color: #fff; font-size: 22px; letter-spacing: -0.02em; }
.report-head p { margin: 4px 0 0; color: #B9BEDA; }
.report-head .meta { text-align: right; color: #B9BEDA; font-size: 12.5px; }
.metric .delta { font-size: 12px; font-weight: 600; margin-left: 4px; }
.delta.up { color: var(--good); } .delta.down { color: var(--bad); } .delta.flat { color: var(--faint); }
.bar-cell { display: flex; align-items: center; gap: 8px; min-width: 140px; }
.bar-cell i { display: block; height: 8px; border-radius: 4px; background: var(--plum); min-width: 2px; }
.report-note { color: var(--faint); font-size: 12.5px; margin: 6px 0 20px; }
@media print {
  @page { size: A4; margin: 12mm; }
  body { background: #fff; font-size: 11px; }
  .side, .topbar, .no-print, .filters, .menu-btn, .pager, .toast { display: none !important; }
  .shell { display: block; background: none; }
  .content { padding: 0; }
  .card, .metrics { break-inside: avoid; box-shadow: none; }
  .report-head, .badge, .bar-cell i, .chart rect { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .table-wrap { overflow: visible; }
  .tbl th { position: static; }
  .grid.cols-2 { grid-template-columns: 1fr; }
  .metrics { grid-template-columns: repeat(5, 1fr); }
  .tbl td, .tbl th { padding: 5px 7px; }
  .tbl { font-size: 10px; } .tbl th { white-space: normal; font-size: 9.5px; }
  .chip { font-size: 9.5px; padding: 1px 6px; }
  a { color: inherit; }
}
@media (max-width: 860px) {
  .radio-cards { grid-template-columns: 1fr; }
  .report-head { flex-direction: column; align-items: flex-start; }
  .report-head .meta { text-align: left; }
}

.ret-line { margin-top: 4px; white-space: nowrap; }
[hidden] { display: none !important; }
.focus-card { border-color: var(--plum); box-shadow: 0 0 0 3px var(--plum-soft); scroll-margin-top: 16px; }

/* Mobile menu: close button + backdrop so a second tap never lands on a sidebar link */
.menu-close { display: none; }
.side-backdrop { display: none; }
@media (max-width: 860px) {
  .menu-close { display: inline-grid; place-items: center; position: absolute; top: 14px; right: 12px; width: 36px; height: 36px; border: 0; border-radius: 8px; background: rgba(255,255,255,.08); color: #fff; cursor: pointer; z-index: 2; }
  .side .brand { padding-right: 56px; }
  .side-backdrop { display: block; position: fixed; inset: 0; background: rgba(15,18,38,.45); z-index: 19; opacity: 0; pointer-events: none; transition: opacity .2s; }
  .side-backdrop.show { opacity: 1; pointer-events: auto; }
  body.menu-open { overflow: hidden; }
}

/* Status "when" box + order timeline */
.modal-backdrop { position: fixed; inset: 0; background: rgba(15,18,38,.45); z-index: 60; display: grid; place-items: center; padding: 16px; }
.modal-backdrop[hidden] { display: none !important; }
.modal { background: #fff; border-radius: 14px; width: min(440px, 100%); padding: 22px 22px 18px; box-shadow: 0 20px 60px rgba(15,18,38,.3); }
.modal h2 { font-size: 18px; margin: 0 0 2px; }
.modal .muted { margin: 0 0 14px; }
.modal .field { margin-bottom: 12px; }
.quick-times { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.quick-times button { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 4px 10px; font: 600 12px var(--font); color: var(--ink); cursor: pointer; }
.quick-times button:hover { border-color: var(--plum); color: var(--plum); }
.sm-error { color: var(--bad); background: var(--bad-bg); border-radius: 8px; padding: 8px 10px; font-size: 13px; }
.since-line { display: inline-flex; align-items: center; gap: 4px; margin-top: 4px; border: 0; background: none; padding: 0; color: var(--faint); font: 12px var(--font); cursor: pointer; white-space: nowrap; }
.since-line:hover { color: var(--plum); }
.when-input { width: auto; height: 32px; font-size: 12.5px; }
.timeline { list-style: none; margin: 0; padding: 22px 22px 20px; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 8px; }
.timeline li { position: relative; text-align: center; padding-top: 34px; font-size: 13px; color: var(--muted); }
.timeline li::before { content: ""; position: absolute; top: 13px; left: -50%; right: 50%; height: 3px; background: var(--line); }
.timeline li:first-child::before { display: none; }
.timeline li.done::before { background: var(--good); }
.timeline .dot { position: absolute; top: 2px; left: 50%; transform: translateX(-50%); width: 26px; height: 26px; border-radius: 50%; background: #fff; border: 2px solid var(--line); display: grid; place-items: center; color: #fff; z-index: 1; }
.timeline li.done .dot { background: var(--good); border-color: var(--good); }
.timeline li.current .dot { box-shadow: 0 0 0 4px var(--good-bg); }
.timeline li.cancel .dot { background: var(--bad); border-color: var(--bad); }
.timeline li.cancel::before { background: var(--bad); }
.timeline strong { display: block; color: var(--ink); }
.timeline .when { display: block; margin-top: 2px; font-size: 12px; line-height: 1.35; }
@media (max-width: 860px) {
  .timeline { grid-auto-flow: row; grid-auto-columns: auto; padding: 16px 20px; gap: 0; }
  .timeline li { text-align: left; padding: 0 0 16px 40px; }
  .timeline li::before { display: none; }
  .timeline li:not(:last-child)::after { content: ""; position: absolute; left: 12px; top: 26px; bottom: 0; width: 3px; background: var(--line); }
  .timeline li.done:not(:last-child)::after { background: var(--good); }
  .timeline .dot { left: 0; transform: none; top: 0; }
}
.bulkbar .when-input { width: 200px; max-width: 100%; }
.status-tabs a.sub { border-style: dashed; }
