html { -webkit-text-size-adjust: 100%; } body { margin: 0; } [hidden] { display: none !important; } img { max-width: 100%; }
/* Layout: sticky header (name, freshness, tabs) > today's four numbers > one view: briefing, orders, payments or dashboard. */
:root {
  --bg: #0b1220; --surface: #111a2e; --surface-2: #18233b; --line: rgba(251,244,228,.13); --line-2: rgba(251,244,228,.07);
  --ink: #fbf4e4; --ink-2: #b9c0d2; --ink-3: #8089a0;
  --accent: #ff5c8a; --accent-ink: #1a0810; --gold: #e5b567;
  --chart: #5b9dff; --chart-dim: rgba(91,157,255,.42);
  --s-new: #fab219; --s-packed: #ec835a; --s-shipped: #5b9dff; --s-delivered: #2fbf4a; --s-cancelled: #8089a0; --critical: #ff6b6b;
  --pill-ink: #0b0b0b;
  --display: "Bowlby One", "Arial Black", Impact, sans-serif;
  --body: "DM Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: dark;
}
@media (prefers-color-scheme: light) { :root:not([data-theme="dark"]) {
  --bg: #f2f4f8; --surface: #ffffff; --surface-2: #eef1f6; --line: rgba(11,18,32,.14); --line-2: rgba(11,18,32,.07);
  --ink: #0b1220; --ink-2: #3d4760; --ink-3: #66708a;
  --accent: #d62a63; --accent-ink: #ffffff; --gold: #8a5a00;
  --chart: #2f6fe0; --chart-dim: rgba(47,111,224,.38);
  --s-new: #fab219; --s-packed: #ec835a; --s-shipped: #2f6fe0; --s-delivered: #0c8f2a; --s-cancelled: #66708a; --critical: #c62828;
  --pill-ink: #0b0b0b; color-scheme: light;
} }
:root[data-theme="light"] {
  --bg: #f2f4f8; --surface: #ffffff; --surface-2: #eef1f6; --line: rgba(11,18,32,.14); --line-2: rgba(11,18,32,.07);
  --ink: #0b1220; --ink-2: #3d4760; --ink-3: #66708a;
  --accent: #d62a63; --accent-ink: #ffffff; --gold: #8a5a00;
  --chart: #2f6fe0; --chart-dim: rgba(47,111,224,.38);
  --s-new: #fab219; --s-packed: #ec835a; --s-shipped: #2f6fe0; --s-delivered: #0c8f2a; --s-cancelled: #66708a; --critical: #c62828;
  --pill-ink: #0b0b0b; color-scheme: light;
}
* { box-sizing: border-box; }
body { background: var(--bg); color: var(--ink); font: 15px/1.45 var(--body); }
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 10; background: var(--bg); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.wrap { max-width: 1120px; margin: 0 auto; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.num { font-variant-numeric: tabular-nums; }
.mono { font-family: var(--mono); font-size: .9em; }

/* header */
.top { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 9; background: var(--bg); border-bottom: 1px solid var(--line); }
.top .wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; padding-block: 10px; }
.brand { display: flex; align-items: baseline; gap: 8px; margin-right: auto; min-width: 0; }
.brand b { font: 400 20px/1 var(--display); color: var(--gold); letter-spacing: .01em; white-space: nowrap; }
.brand span { font-size: 12px; text-transform: uppercase; letter-spacing: .12em; color: var(--ink-3); white-space: nowrap; }
.tabs { display: flex; gap: 4px; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 3px; }
.tabs a { padding: 6px 14px; border-radius: 999px; color: var(--ink-2); text-decoration: none; font-weight: 600; font-size: 14px; }
.tabs a[aria-current="page"] { background: var(--ink); color: var(--bg); }
.feed { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-2); min-width: 0; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--ink-3); flex: none; }
.feed[data-state="live"] .dot { background: var(--s-delivered); box-shadow: 0 0 0 4px rgba(47,191,74,.18); }
.feed[data-state="busy"] .dot { background: var(--s-new); }
.feed[data-state="warn"] .dot { background: var(--critical); }
.btn { border: 1px solid var(--line); background: var(--surface); border-radius: 8px; padding: 7px 12px; font-weight: 600; font-size: 14px; }
.btn:hover { background: var(--surface-2); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.btn.small { padding: 5px 10px; font-size: 13px; }
.btn.quiet { background: transparent; }
.btn[disabled] { opacity: .5; cursor: default; }

/* today strip */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; padding-block: 16px 4px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; min-width: 0; }
.kpi h3 { margin: 0; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .1em; color: var(--ink-3); }
.kpi .v { font-size: 30px; font-weight: 700; line-height: 1.15; margin-top: 4px; font-variant-numeric: tabular-nums; }
.kpi .sub { font-size: 13px; color: var(--ink-2); margin-top: 2px; }
.kpi .sub.late { color: var(--critical); font-weight: 600; }
.note { font-size: 13px; color: var(--ink-2); }
.banner { margin-top: 12px; border: 1px solid var(--line); border-left: 3px solid var(--s-new); background: var(--surface); border-radius: 8px; padding: 10px 12px; font-size: 14px; }

/* orders view */
.bar { display: flex; flex-wrap: wrap; gap: 10px 12px; align-items: center; padding-block: 14px 10px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { border: 1px solid var(--line); background: transparent; border-radius: 999px; padding: 6px 12px; font-size: 14px; font-weight: 600; color: var(--ink-2); }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: transparent; }
.chip i { font-style: normal; opacity: .7; margin-left: 6px; font-variant-numeric: tabular-nums; }
.search { flex: 1 1 200px; min-width: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; }
.check { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink-2); }
.pack { font-size: 14px; color: var(--ink-2); padding-bottom: 10px; }
.pack b { color: var(--ink); }
.list { display: flex; flex-direction: column; gap: 8px; padding-bottom: 48px; }
.order { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.head { width: 100%; text-align: left; background: none; border: 0; padding: 12px 14px; display: grid; grid-template-columns: 118px minmax(0, 1.2fr) minmax(0, 1.4fr) auto; gap: 4px 14px; align-items: center; }
.head:hover { background: var(--surface-2); }
.oid { font-family: var(--mono); font-weight: 600; font-size: 14px; }
.when { font-size: 12px; color: var(--ink-3); }
.who { font-weight: 600; overflow-wrap: anywhere; }
.where, .what { font-size: 13px; color: var(--ink-2); overflow-wrap: anywhere; }
.end { text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.amt { font-weight: 700; font-variant-numeric: tabular-nums; }
.pill { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 2px 10px; font-size: 12px; font-weight: 700; color: var(--pill-ink); white-space: nowrap; }
.pill[data-s="new"] { background: var(--s-new); } .pill[data-s="packed"] { background: var(--s-packed); }
.pill[data-s="shipped"] { background: var(--s-shipped); color: #fff; } .pill[data-s="delivered"] { background: var(--s-delivered); color: #fff; }
.pill[data-s="cancelled"] { background: var(--s-cancelled); color: #fff; }
.tag { border: 1px solid var(--line); border-radius: 4px; font-size: 11px; font-weight: 700; letter-spacing: .08em; padding: 0 5px; color: var(--ink-2); margin-left: 6px; }
.age { font-size: 12px; color: var(--ink-3); } .age.late { color: var(--critical); font-weight: 700; }
.detail { border-top: 1px solid var(--line); padding: 14px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px 24px; }
.detail h4 { margin: 0 0 6px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .1em; color: var(--ink-3); }
.kv { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 3px 10px; font-size: 14px; }
.kv dt { color: var(--ink-3); } .kv dd { margin: 0; overflow-wrap: anywhere; }
.addr { white-space: pre-line; font-size: 14px; overflow-wrap: anywhere; }
.acts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.shipform { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; margin-top: 10px; }
.shipform .full { grid-column: 1 / -1; }
.field { display: flex; flex-direction: column; gap: 3px; font-size: 12px; color: var(--ink-3); min-width: 0; }
.field input, .field select, .field textarea { background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; font-size: 14px; color: var(--ink); width: 100%; min-width: 0; }
.trail { font-size: 13px; color: var(--ink-2); margin-top: 10px; display: flex; flex-direction: column; gap: 2px; }
.empty { border: 1px dashed var(--line); border-radius: 12px; padding: 28px 20px; text-align: center; color: var(--ink-2); }
.empty b { display: block; color: var(--ink); font-size: 16px; margin-bottom: 4px; }
a.link { color: var(--accent); }

/* dashboard */
.dash { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 12px; padding-block: 14px 48px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px; min-width: 0; }
.card h2 { margin: 0; font-size: 15px; font-weight: 700; } .card .cap { font-size: 13px; color: var(--ink-2); margin: 2px 0 12px; }
.c12 { grid-column: span 12; } .c6 { grid-column: span 6; } .c4 { grid-column: span 4; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.seg button { border: 0; background: transparent; padding: 5px 12px; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--bg); }
.totals { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 12px 20px; }
.totals div span { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .1em; color: var(--ink-3); font-weight: 600; }
.totals div b { font-size: 22px; font-variant-numeric: tabular-nums; }
.plot { position: relative; height: 170px; padding-left: 40px; }
.grid { position: absolute; inset: 0 0 22px 40px; display: flex; flex-direction: column; justify-content: space-between; pointer-events: none; }
.grid span { border-top: 1px solid var(--line-2); position: relative; height: 0; }
.grid span::before { content: attr(data-l); position: absolute; right: calc(100% + 6px); top: -8px; font-size: 11px; color: var(--ink-3); font-variant-numeric: tabular-nums; white-space: nowrap; }
.grid span:last-child { border-top-color: var(--line); }
.cols { position: absolute; inset: 0 0 0 40px; display: flex; align-items: stretch; gap: 2px; }
.col { flex: 1 1 0; min-width: 0; position: relative; display: flex; flex-direction: column; justify-content: flex-end; padding-bottom: 22px; }
.col .b { background: var(--chart-dim); border-radius: 4px 4px 0 0; min-height: 0; margin: 0 auto; width: 100%; max-width: 26px; }
.col.today .b { background: var(--chart); }
.col:hover .b, .col:focus .b { background: var(--chart); }
.col .x { position: absolute; bottom: 2px; left: 50%; transform: translateX(-50%); font-size: 11px; color: var(--ink-3); white-space: nowrap; }
.col.today .x { color: var(--ink); font-weight: 700; }
.col .tip { display: none; position: absolute; bottom: calc(100% - 6px); left: 50%; transform: translateX(-50%); background: var(--ink); color: var(--bg); font-size: 12px; font-weight: 600; padding: 4px 8px; border-radius: 6px; white-space: nowrap; z-index: 2; pointer-events: none; }
.col:hover .tip, .col:focus .tip { display: block; }
.col:first-child .tip, .col:nth-child(2) .tip { left: 0; transform: none; } .col:last-child .tip, .col:nth-last-child(2) .tip { left: auto; right: 0; transform: none; }
.hbars { display: grid; grid-template-columns: minmax(70px, auto) minmax(0, 1fr) auto; gap: 8px 10px; align-items: center; font-size: 14px; }
.hbars .t { background: var(--line-2); border-radius: 4px; height: 12px; overflow: hidden; }
.hbars .t i { display: block; height: 100%; background: var(--chart); border-radius: 0 4px 4px 0; }
.hbars .n { font-variant-numeric: tabular-nums; font-weight: 600; text-align: right; }
.hbars .l { overflow-wrap: anywhere; }
.pipe { display: flex; gap: 2px; height: 14px; border-radius: 4px; overflow: hidden; background: var(--line-2); }
.pipe i { display: block; min-width: 0; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 10px; font-size: 14px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; } .legend em { width: 10px; height: 10px; border-radius: 3px; display: inline-block; } .legend b { font-variant-numeric: tabular-nums; }
details.tbl { margin-top: 10px; font-size: 13px; } details.tbl summary { cursor: pointer; color: var(--ink-2); }
.scroll { overflow-x: auto; } table { border-collapse: collapse; width: 100%; font-variant-numeric: tabular-nums; } th, td { text-align: left; padding: 4px 10px 4px 0; border-bottom: 1px solid var(--line-2); } th { color: var(--ink-3); font-weight: 600; }

/* dialog + toast */
dialog { background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: 14px; padding: 18px; width: min(560px, calc(100vw - 32px)); max-height: calc(100% - 32px); }
dialog::backdrop { background: rgba(0,0,0,.55); }
dialog h2 { margin: 0 0 4px; font-size: 18px; } .formgrid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; margin-top: 12px; } .formgrid .full { grid-column: 1 / -1; }
.err { color: var(--critical); font-size: 13px; min-height: 18px; margin-top: 8px; }
.toast { position: fixed; left: 50%; bottom: calc(18px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); background: var(--ink); color: var(--bg); font-weight: 600; padding: 10px 16px; border-radius: 10px; z-index: 20; max-width: calc(100vw - 32px); }

@media (max-width: 760px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } .kpi .v { font-size: 24px; }
  .head { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "a d" "b d" "c c"; }
  .head .c1 { grid-area: a; } .head .c2 { grid-area: b; } .head .c3 { grid-area: c; } .head .end { grid-area: d; align-self: start; }
  .detail { grid-template-columns: minmax(0, 1fr); }
  .c6, .c4 { grid-column: span 12; } .brand span { display: none; }
  .shipform, .formgrid { grid-template-columns: minmax(0, 1fr); }
  .top { position: static; } .tabs { margin-left: auto; }
}
@media (prefers-reduced-motion: no-preference) { .toast { animation: up .25s ease-out; } @keyframes up { from { opacity: 0; transform: translate(-50%, 8px); } } }

/* briefing */
.brief { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 12px; padding-block: 14px 48px; }
.brief .card.wide { grid-column: 1 / -1; }
.lede h1 { margin: 0 0 8px; font-size: 26px; line-height: 1.2; text-wrap: balance; }
.lede p { margin: 0; font-size: 16px; color: var(--ink-2); max-width: 68ch; }
.byline { margin-top: 12px; font-size: 12px; color: var(--ink-3); display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: center; }
.todo { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 8px; font-size: 15px; }
.clear { color: var(--s-delivered); font-weight: 700; }
.flag { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 12px; padding: 12px 0; border-top: 1px solid var(--line-2); }
.flag:first-of-type { border-top: 0; padding-top: 0; }
.flag .t { font-weight: 700; } .flag .d { grid-column: 2; font-size: 14px; color: var(--ink-2); }
.flag .o { grid-column: 2; display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.lvl { align-self: start; border-radius: 4px; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; padding: 2px 7px; color: #fff; white-space: nowrap; }
.lvl[data-l="high"] { background: var(--critical); } .lvl[data-l="medium"] { background: var(--s-new); color: var(--pill-ink); } .lvl[data-l="info"] { background: var(--s-cancelled); }
.ochip { border: 1px solid var(--line); background: transparent; border-radius: 6px; padding: 2px 8px; font-family: var(--mono); font-size: 12px; }
.ochip:hover { background: var(--surface-2); }
/* payments */
.pay { padding-block: 14px 48px; display: flex; flex-direction: column; gap: 12px; }
.pay table td, .pay table th { padding: 8px 12px 8px 0; font-size: 14px; white-space: nowrap; } .pay td.wrap { white-space: normal; min-width: 180px; color: var(--ink-2); }
.pill[data-s="captured"] { background: var(--s-delivered); color: #fff; } .pill[data-s="failed"] { background: var(--critical); color: #fff; }
.pill[data-s="refunded"] { background: var(--s-cancelled); color: #fff; } .pill[data-s="processed"] { background: var(--s-delivered); color: #fff; }
.pill[data-s="created"], .pill[data-s="authorized"] { background: var(--s-new); }
/* sign in */
.signin { max-width: 400px; margin: 12vh auto 0; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 24px; }
.signin h1 { margin: 0 0 4px; font: 400 24px/1.1 var(--display); color: var(--gold); } .signin p { color: var(--ink-2); margin: 0 0 16px; }
.signin .field input { padding: 10px 12px; font-size: 16px; } .signin .btn { margin-top: 12px; width: 100%; padding: 10px; }
.me { font-size: 12px; color: var(--ink-3); }
@media (max-width: 760px) { .brief { grid-template-columns: minmax(0, 1fr); } .lede h1 { font-size: 22px; } }
