/* Order Desk: clean, calm workspace. Dark green-ink side menu, white cards, one teal accent.
   Status colours: amber = waiting, blue = to process, violet = needs tracking, teal = upload, green = done. */

@font-face {
  font-family: "Jakarta";
  src: url("/static/fonts/plus-jakarta-sans-latin-wght-normal.woff2") format("woff2");
  font-weight: 200 800; font-style: normal; font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Jakarta";
  src: url("/static/fonts/plus-jakarta-sans-latin-ext-wght-normal.woff2") format("woff2");
  font-weight: 200 800; font-style: normal; font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "JetBrains";
  src: url("/static/fonts/jetbrains-mono-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 800; font-style: normal; font-display: swap;
}

:root {
  --bg: #f3f5f4;
  --surface: #ffffff;
  --surface-2: #f8faf9;
  --ink: #12201c;
  --ink-2: #33433e;
  --muted: #637570;
  --line: #e1e8e5;
  --line-2: #ccd7d3;
  --accent: #0b7566;
  --accent-hover: #095f53;
  --accent-ink: #ffffff;
  --accent-soft: #def3ee;
  --side: #0f1f1b;
  --side-ink: #b7c8c3;
  --side-hover: rgba(255, 255, 255, 0.06);
  --side-active: rgba(94, 214, 189, 0.14);
  --side-active-ink: #ffffff;
  --amber: #a35a00; --amber-bg: #fdf1dc;
  --blue: #1f55c9; --blue-bg: #e3ecfd;
  --violet: #6b3fc9; --violet-bg: #eee8fc;
  --teal: #0b7566; --teal-bg: #dcf3ee;
  --green: #187a3e; --green-bg: #dff4e6;
  --danger: #b42318; --danger-bg: #fdeceb;
  --shadow-sm: 0 1px 2px rgba(18, 32, 28, 0.05);
  --shadow: 0 1px 2px rgba(18, 32, 28, 0.04), 0 6px 20px rgba(18, 32, 28, 0.05);
  --radius: 14px;
  --radius-sm: 10px;
  --sans: "Jakarta", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0c1513;
    --surface: #131f1c;
    --surface-2: #17241f;
    --ink: #e5eeeb;
    --ink-2: #c3d1cc;
    --muted: #8fa29c;
    --line: #22332e;
    --line-2: #2e423c;
    --accent: #3cc3a7;
    --accent-hover: #5ad2b8;
    --accent-ink: #06231d;
    --accent-soft: #143a32;
    --side: #08100e;
    --amber: #f0b961; --amber-bg: #392a12;
    --blue: #8db1ff; --blue-bg: #18284a;
    --violet: #b9a0ff; --violet-bg: #2a1f47;
    --teal: #5ed6bd; --teal-bg: #123a32;
    --green: #78d69c; --green-bg: #15341f;
    --danger: #ff8f86; --danger-bg: #3b1a18;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.25);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.55 var(--sans); font-feature-settings: "ss01"; }
a { color: var(--accent); text-underline-offset: 2px; }
img { max-width: 100%; }
[hidden] { display: none !important; }
h1, h2, h3 { margin: 0 0 14px; line-height: 1.2; letter-spacing: -0.02em; text-wrap: balance; color: var(--ink); }
h1 { font-size: 28px; font-weight: 750; }
h2 { font-size: 18px; font-weight: 700; margin-top: 32px; }
h3 { font-size: 15px; font-weight: 700; margin: 24px 0 10px; }
p { margin: 0 0 12px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.mono { font-family: var(--mono); font-size: 0.93em; letter-spacing: -0.01em; }
.nowrap { white-space: nowrap; }
.tight { margin-top: 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* ---------- app shell ---------- */
.ico { width: 20px; height: 20px; flex: none; }
.app { display: grid; grid-template-columns: 252px minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 18px;
  padding: 20px 14px; background: var(--side); color: var(--side-ink);
}
.brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; font-weight: 750; font-size: 17px; letter-spacing: -0.01em; padding: 4px 8px; }
.logo { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: linear-gradient(135deg, #19a68a, #0b7566); color: #fff; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.15); }
.logo .ico { width: 19px; height: 19px; }
.side-nav { display: grid; gap: 2px; margin-top: 8px; }
.side-nav a {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px;
  color: var(--side-ink); text-decoration: none; font-weight: 550; font-size: 14.5px; transition: background 0.15s, color 0.15s;
}
.side-nav a:hover { background: var(--side-hover); color: #fff; }
.side-nav a[aria-current="page"] { background: var(--side-active); color: var(--side-active-ink); }
.side-nav a[aria-current="page"] .ico { color: #5ed6bd; }
.side-foot { margin-top: auto; display: flex; align-items: center; gap: 6px; padding-top: 14px; border-top: 1px solid rgba(255, 255, 255, 0.08); }
.side-foot form { margin: 0; }
.side-user { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 10px; color: inherit; text-decoration: none; }
.side-user:hover, .side-user.on { background: var(--side-hover); }
.avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; flex: none; background: #1d3a33; color: #8be3cf; font-weight: 700; }
.who { display: grid; min-width: 0; line-height: 1.25; }
.who strong { color: #fff; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who span { font-size: 12px; color: var(--side-ink); }
.icon-btn { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; border: 0; background: transparent; color: var(--side-ink); cursor: pointer; }
.icon-btn:hover { background: var(--side-hover); color: #fff; }

.main { min-width: 0; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 32px 36px 72px; }

@media (max-width: 900px) {
  .app { display: block; }
  .sidebar {
    position: sticky; top: 0; z-index: 10; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center;
    gap: 8px; padding: 10px 12px;
  }
  .brand { font-size: 16px; padding: 2px 4px; }
  .logo { width: 30px; height: 30px; }
  .side-nav { order: 3; flex-basis: 100%; display: flex; overflow-x: auto; gap: 4px; margin: 0; scrollbar-width: none; }
  .side-nav::-webkit-scrollbar { display: none; }
  .side-nav a { white-space: nowrap; padding: 8px 12px; font-size: 14px; }
  .side-foot { margin: 0 0 0 auto; padding: 0; border: 0; }
  .side-user { padding: 4px; }
  .side-user .who { display: none; }
  .avatar { width: 30px; height: 30px; font-size: 13px; }
  .wrap { padding: 20px 16px 56px; }
  h1 { font-size: 24px; }
}

/* ---------- sign-in pages ---------- */
.auth { min-height: 100vh; background: radial-gradient(1200px 600px at 10% -10%, var(--accent-soft), transparent 60%), var(--bg); }
.auth-main { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px; padding: 32px 16px; }
.auth-brand { color: var(--ink); font-size: 20px; }
.auth .card.narrow, .auth section.narrow { margin: 0; width: 100%; max-width: 420px; padding: 28px; }
.auth h1 { font-size: 24px; }

/* ---------- page headings ---------- */
.page-head { display: flex; flex-wrap: wrap; gap: 12px 20px; align-items: flex-end; justify-content: space-between; margin-bottom: 22px; }
.page-head h1 { margin: 0; }
.eyebrow { font-size: 13px; font-weight: 600; color: var(--muted); margin: 0 0 4px; }
.section-head { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; justify-content: space-between; margin: 32px 0 14px; }
.section-head h2 { margin: 0; }

/* ---------- cards, forms, buttons ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin: 16px 0; box-shadow: var(--shadow); }
.card.narrow, section.narrow { max-width: 460px; margin: 56px auto; }
.card.flush { padding: 0; overflow: hidden; }
.card.flush .scroll { border: 0; border-radius: 0; box-shadow: none; border-top: 1px solid var(--line); }
.pad { padding: 14px 18px; margin: 0; }
.stack { display: grid; gap: 16px; }
.row { display: flex; flex-wrap: wrap; gap: 10px 12px; align-items: flex-end; }
.row.between { justify-content: space-between; align-items: center; }
.row > .inp { width: auto; flex: 0 1 260px; }
.tight-row { gap: 6px; align-items: center; flex-wrap: nowrap; }
.tight-row form { margin: 0; }
.grow { flex: 1 1 260px; }
.form-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); }
.narrow-fld { max-width: 380px; }

.fld, .box { display: grid; gap: 6px; align-content: start; min-width: 0; }
.lbl { font-size: 12.5px; font-weight: 650; color: var(--ink-2); letter-spacing: 0.01em; }
.inp {
  font: inherit; font-size: 15px; min-height: 44px; padding: 9px 12px; width: 100%; min-width: 0;
  border-radius: var(--radius-sm); border: 1px solid var(--line-2); background: var(--surface); color: var(--ink);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.inp:hover { border-color: var(--muted); }
.inp:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.inp:disabled { background: var(--surface-2); color: var(--muted); }
.inp::placeholder { color: #9aaaa5; }
textarea.inp { resize: vertical; line-height: 1.5; }
select.inp { cursor: pointer; }
.small-inp { min-height: 36px; font-size: 14px; padding: 5px 10px; width: auto; }
.num-inp { width: 84px; }
input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--accent); cursor: pointer; }
input[type="file"].inp { padding: 8px; }

.btn {
  font: inherit; font-weight: 650; font-size: 14.5px; min-height: 44px; padding: 0 18px; border-radius: var(--radius-sm);
  border: 1px solid var(--line-2); background: var(--surface); color: var(--ink); cursor: pointer; text-decoration: none;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; box-shadow: var(--shadow-sm);
  transition: background 0.15s, border-color 0.15s, transform 0.05s;
}
.btn:hover { background: var(--surface-2); border-color: var(--muted); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn.danger { color: var(--danger); }
.btn.danger:hover { background: var(--danger-bg); border-color: var(--danger); }
.btn.small { min-height: 34px; padding: 0 12px; font-size: 13px; }
.btn.off, .btn:disabled { opacity: 0.45; pointer-events: none; }
.copy { min-height: 28px; padding: 0 9px; font-size: 12px; margin-left: 4px; box-shadow: none; }

.notice { padding: 12px 16px; border-radius: var(--radius-sm); margin: 14px 0; font-weight: 550; background: var(--green-bg); color: var(--green); border: 1px solid transparent; }
.notice.bad { background: var(--danger-bg); color: var(--danger); }
.notice .inp { margin-top: 8px; color: var(--ink); }
.notice a { color: inherit; }
.bad-text { color: var(--danger); font-weight: 600; }

/* ---------- status pills ---------- */
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px 3px 8px; border-radius: 999px; font-size: 12px; font-weight: 650; white-space: nowrap; background: var(--surface-2); color: var(--ink-2); }
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; opacity: 0.85; }
.pill.unassigned { background: var(--amber-bg); color: var(--amber); }
.pill.new { background: var(--blue-bg); color: var(--blue); }
.pill.processed { background: var(--violet-bg); color: var(--violet); }
.pill.upload { background: var(--teal-bg); color: var(--teal); }
.pill.complete, .pill.shipped { background: var(--green-bg); color: var(--green); }
.pill.off { background: var(--surface-2); color: var(--muted); }

/* ---------- tabs, chips, search, pager ---------- */
.tabs { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; margin: 4px 0 18px; box-shadow: var(--shadow-sm); }
.tab { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 14px; border-radius: 9px; color: var(--muted); text-decoration: none; font-weight: 600; }
.tab:hover { color: var(--ink); background: var(--surface-2); }
.tab[aria-current="page"] { background: var(--accent-soft); color: var(--accent); }
.count { font-family: var(--mono); font-size: 12px; min-width: 24px; text-align: center; padding: 1px 7px; border-radius: 999px; background: var(--bg); color: var(--ink-2); }
.tab[aria-current="page"] .count { background: var(--surface); color: var(--accent); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; }
.chip { padding: 6px 12px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); color: var(--ink); text-decoration: none; font-size: 13.5px; font-weight: 550; }
.chip strong { margin-left: 4px; color: var(--accent); }
.chip.on { border-color: var(--accent); background: var(--accent-soft); }
.search, .filters, .range { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; margin: 0 0 16px; }
.search .fld { flex: 1 1 260px; max-width: 520px; }
.filters .fld, .range .fld { flex: 0 1 190px; }
.filters.card, .range.card { margin: 0 0 16px; }
.quick { display: flex; flex-wrap: wrap; gap: 10px 12px; align-items: center; background: var(--accent-soft); border-color: transparent; box-shadow: none; }
.quick strong { color: var(--accent); }
.quick .inp { width: auto; background: var(--surface); }
.quick .num-inp { width: 80px; }
.pager { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; justify-content: space-between; margin: 16px 0; }

/* ---------- tables ---------- */
.scroll { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
table { border-collapse: collapse; width: 100%; min-width: 640px; font-size: 14px; }
th, td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; overflow-wrap: anywhere; }
thead th { font-size: 12px; font-weight: 650; color: var(--muted); background: var(--surface-2); white-space: nowrap; }
tbody tr { transition: background 0.1s; }
tbody tr:hover td { background: var(--surface-2); }
tbody tr:last-child td { border-bottom: 0; }
tfoot th { background: var(--surface-2); font-size: 14px; color: var(--ink); border-bottom: 0; border-top: 1px solid var(--line); }
td a.mono, td .mono { font-weight: 600; }
td a { text-decoration: none; }
td a:hover { text-decoration: underline; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
td.check, th.check { width: 44px; text-align: center; }
tr.row-bad td { background: var(--danger-bg); }
.thumbcell { width: 64px; }
.thumb { width: 48px; height: 48px; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); display: block; flex: none; background: var(--surface-2); }
.empty-thumb { background: var(--surface-2); }

/* ---------- stat cards ---------- */
.cards { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); margin: 0 0 8px; }
.stat {
  position: relative; display: grid; gap: 4px; padding: 18px 18px 16px; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); color: var(--ink); text-decoration: none; box-shadow: var(--shadow); transition: transform 0.15s, box-shadow 0.15s;
}
a.stat:hover { transform: translateY(-2px); box-shadow: 0 2px 4px rgba(18, 32, 28, 0.05), 0 12px 28px rgba(18, 32, 28, 0.08); }
.stat .lbl { color: var(--muted); font-weight: 600; font-size: 13px; }
.stat-icon { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; margin-bottom: 8px; background: var(--surface-2); color: var(--ink-2); }
.stat.unassigned .stat-icon { background: var(--amber-bg); color: var(--amber); }
.stat.new .stat-icon { background: var(--blue-bg); color: var(--blue); }
.stat.processed .stat-icon { background: var(--violet-bg); color: var(--violet); }
.stat.upload .stat-icon { background: var(--teal-bg); color: var(--teal); }
.stat.money .stat-icon { background: var(--accent-soft); color: var(--accent); }
.big { font-size: 28px; font-weight: 750; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; line-height: 1.15; }
.stat-go { position: absolute; top: 18px; right: 18px; font-size: 12px; font-weight: 600; color: var(--muted); }

.snaps { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); margin: 0 0 16px; }
.snap { display: grid; gap: 2px; padding: 12px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; color: var(--ink); text-decoration: none; box-shadow: var(--shadow-sm); }
.snap:hover { border-color: var(--line-2); }
.snap .big { font-size: 20px; }
.snap .lbl { color: var(--muted); }
.snap.on { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), var(--shadow-sm); background: var(--accent-soft); }

/* ---------- dashboard chart ---------- */
.chart-card { display: grid; grid-template-columns: minmax(200px, 260px) minmax(0, 1fr); gap: 24px; align-items: end; }
.chart-card .big { font-size: 34px; }
.trend { font-size: 13px; font-weight: 650; color: var(--muted); }
.trend.up { color: var(--green); }
.trend.down { color: var(--danger); }
.chart { width: 100%; height: auto; display: block; }
.chart .bar { fill: var(--accent); opacity: 0.35; }
.chart .bar.has { opacity: 0.85; }
.chart .bar.today { opacity: 1; fill: var(--accent); }
.chart .base { stroke: var(--line-2); stroke-width: 1; }
.chart .grid { stroke: var(--line); stroke-width: 1; stroke-dasharray: 3 4; }
.chart text { fill: var(--muted); font-family: var(--sans); font-size: 11px; }
.chart text.val { fill: var(--ink-2); font-weight: 650; font-size: 10.5px; }
@media (max-width: 760px) { .chart-card { grid-template-columns: 1fr; } }

/* ---------- order lists ---------- */
.orders { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.order-row {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 14px; padding: 12px 16px 12px 12px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); color: var(--ink); text-decoration: none;
  box-shadow: var(--shadow-sm); transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}
.order-row::after { content: "›"; font-size: 22px; color: var(--muted); line-height: 1; }
.order-row:hover { border-color: var(--accent); box-shadow: var(--shadow); transform: translateY(-1px); }
.order-row .thumb { width: 56px; height: 56px; }
.order-main { display: grid; gap: 2px; min-width: 0; }
.ono { font-size: 15px; font-weight: 700; overflow-wrap: anywhere; }
.addr-line { overflow-wrap: anywhere; }

/* ---------- one order ---------- */
.order-view { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 24px; align-items: start; margin: 8px 0 16px; }
@media (max-width: 820px) { .order-view { grid-template-columns: 1fr; } }
.bigphoto { width: 100%; max-height: 560px; object-fit: contain; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; display: block; box-shadow: var(--shadow); }
.bigphoto.none { display: grid; place-items: center; height: 240px; color: var(--muted); }
.order-info { min-width: 0; }
.product-title { font-size: 26px; margin: 8px 0 6px; }
.addr-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; margin-top: 16px; box-shadow: var(--shadow); }
.addr-card .addr { font-size: 16px; margin: 8px 0 0; line-height: 1.6; }
.addr { white-space: pre-wrap; overflow-wrap: anywhere; }
.boxes { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr)); margin-bottom: 16px; }
.big-inp { font-family: var(--mono); font-size: 22px; letter-spacing: 0.3em; font-weight: 600; }
.money { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 0; }
.money .prefix { height: 44px; display: grid; place-items: center; padding: 0 12px; border: 1px solid var(--line-2); border-right: 0; border-radius: var(--radius-sm) 0 0 var(--radius-sm); background: var(--surface-2); font-weight: 650; color: var(--muted); }
.money .inp { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; margin: 14px 0 0; font-size: 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }
.danger-zone summary { cursor: pointer; font-weight: 650; color: var(--muted); }
.danger-zone .row { margin-top: 14px; }
.danger-zone form { margin: 0; }

/* ---------- empty states ---------- */
.empty { text-align: center; padding: 44px 20px; border: 1.5px dashed var(--line-2); border-radius: var(--radius); color: var(--muted); background: var(--surface-2); }
.empty strong { display: block; color: var(--ink); font-size: 17px; margin-bottom: 4px; }

/* ---------- products ---------- */
.product-grid { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 190px), 1fr)); }
.product-card a {
  display: grid; gap: 4px; padding: 10px 10px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  color: var(--ink); text-decoration: none; height: 100%; box-shadow: var(--shadow-sm); transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}
.product-card a:hover { border-color: var(--accent); box-shadow: var(--shadow); transform: translateY(-2px); }
.product-card img, .product-card .noimg { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 10px; background: var(--surface-2); display: grid; place-items: center; color: var(--muted); font-size: 13px; margin-bottom: 6px; }
.product-card strong { padding: 0 4px; }
.product-card span { padding: 0 4px; }
.hidden-item { opacity: 0.55; }
.narrow-card { max-width: 560px; }

/* Tables keep each value on one line; the box scrolls sideways on small screens. */
th, td { white-space: nowrap; overflow-wrap: normal; }
td .small, td .addr-line { white-space: normal; max-width: 260px; }
.app .sidebar { align-self: start; }
.card.flush > .row.pad { align-items: center; }
.tabs { max-width: 100%; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
.tab { white-space: nowrap; }

/* =================== version 2.3: dashboard and shell =================== */
.side-label { margin: 16px 12px 6px; font-size: 11.5px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: #6f8a83; }
.side-nav .side-label:first-child { margin-top: 4px; }

.topbar {
  position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 16px; padding: 14px 36px;
  background: color-mix(in srgb, var(--bg) 85%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line);
}
.top-search { flex: 1; max-width: 560px; display: flex; align-items: center; gap: 10px; padding: 0 14px; height: 44px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; color: var(--muted); box-shadow: var(--shadow-sm); }
.top-search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.top-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font: inherit; font-size: 14.5px; color: var(--ink); }
.top-search input::placeholder { color: var(--muted); }
.top-chip { margin-left: auto; display: flex; align-items: center; gap: 10px; padding: 5px 12px 5px 5px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); color: var(--ink); text-decoration: none; box-shadow: var(--shadow-sm); }
.top-chip:hover { border-color: var(--line-2); }
.avatar.sm { width: 32px; height: 32px; font-size: 13px; background: var(--accent-soft); color: var(--accent); }
.who-top { display: grid; line-height: 1.2; }
.who-top strong { font-size: 13.5px; }
.who-top span { font-size: 12px; color: var(--muted); }
@media (max-width: 900px) { .topbar { padding: 10px 16px; position: static; } .who-top { display: none; } .top-chip { padding: 4px; } }

.dash-head { display: flex; flex-wrap: wrap; gap: 12px 20px; align-items: flex-end; justify-content: space-between; margin-bottom: 18px; }
.dash-head h1 { font-size: 32px; margin: 0 0 4px; }
.dash-head p { margin: 0; }
.dash-live { display: flex; align-items: center; gap: 14px; }
.live { display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--muted); }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: #22b07d; box-shadow: 0 0 0 4px color-mix(in srgb, #22b07d 20%, transparent); }
.btn.soft { background: var(--accent-soft); border-color: transparent; color: var(--accent); box-shadow: none; }
.btn.soft:hover { background: color-mix(in srgb, var(--accent) 18%, var(--surface)); }
.btn .ico { width: 18px; height: 18px; }

.range-bar { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; justify-content: space-between; padding: 8px; margin-bottom: 18px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-sm); }
.pill-tabs { display: flex; flex-wrap: wrap; gap: 4px; align-items: flex-start; }
.pill-tab { display: inline-flex; align-items: center; height: 36px; padding: 0 14px; border-radius: 10px; color: var(--ink-2); font-size: 14px; font-weight: 650; text-decoration: none; cursor: pointer; list-style: none; border: 1px solid transparent; }
.pill-tab::-webkit-details-marker { display: none; }
.pill-tab:hover { background: var(--surface-2); }
.pill-tab.on { background: var(--accent-soft); color: var(--accent); border-color: color-mix(in srgb, var(--accent) 35%, transparent); }
.custom-range { position: relative; }
.custom-range[open] > .pill-tab { background: var(--accent-soft); color: var(--accent); }
.custom-form { position: absolute; z-index: 6; top: 44px; left: 0; display: flex; gap: 10px; align-items: flex-end; padding: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 12px 32px rgba(18, 32, 28, 0.14); }
.custom-form .fld { width: 170px; }
.range-text { padding: 0 10px; font-size: 13.5px; font-weight: 600; color: var(--muted); }
@media (max-width: 700px) { .custom-form { position: static; flex-wrap: wrap; margin-top: 8px; } .custom-form .fld { width: 100%; } }

.actions { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr)); margin-bottom: 18px; }
.action { position: relative; display: flex; align-items: center; gap: 12px; padding: 12px 14px; min-height: 60px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; color: var(--ink); text-decoration: none; font-weight: 650; font-size: 14.5px; box-shadow: var(--shadow-sm); transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s; }
.action:hover { border-color: var(--line-2); box-shadow: var(--shadow); transform: translateY(-1px); }
.action-ico { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; flex: none; color: var(--t); background: color-mix(in srgb, var(--t) 13%, var(--surface)); }
.action-ico .ico { width: 19px; height: 19px; }
.action-badge { margin-left: auto; min-width: 26px; height: 24px; padding: 0 8px; border-radius: 999px; display: grid; place-items: center; font-size: 12.5px; font-weight: 700; color: #fff; background: var(--t, var(--accent)); }
.action:has(.action-ico.violet) .action-badge { --t: #8257e6; }
.action:has(.action-ico.teal) .action-badge { --t: #0f9a86; }

.green { --t: #1f9d74; } .violet { --t: #8257e6; } .teal { --t: #0f9a86; } .amber { --t: #d9822b; }
.slate { --t: #5b6f7c; } .blue { --t: #3b6fe0; } .pink { --t: #e0517c; } .lime { --t: #6f9a1e; }
.mint { --t: #1f9d74; } .peach { --t: #e0832b; } .sky { --t: #1f9ac2; } .lilac { --t: #7a5bd6; }

.gcards { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); margin-bottom: 14px; }
.gcard {
  position: relative; overflow: hidden; display: grid; gap: 6px; align-content: start; min-height: 158px; padding: 20px 20px 18px;
  border-radius: 16px; border: 1px solid color-mix(in srgb, var(--t) 22%, var(--line)); color: var(--ink); text-decoration: none;
  background: linear-gradient(135deg, color-mix(in srgb, var(--t) 15%, var(--surface)) 0%, color-mix(in srgb, var(--t) 5%, var(--surface)) 100%);
  box-shadow: var(--shadow-sm); transition: transform 0.15s, box-shadow 0.15s;
}
a.gcard:hover { transform: translateY(-2px); box-shadow: 0 2px 4px rgba(18, 32, 28, 0.05), 0 14px 30px rgba(18, 32, 28, 0.08); }
.gcard-label { font-size: 13.5px; font-weight: 700; color: var(--ink-2); }
.gcard-value { font-size: 34px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.1; font-variant-numeric: tabular-nums; position: relative; }
.gcard-note { font-size: 13px; color: var(--muted); max-width: 80%; position: relative; }
.gcard-ico { position: absolute; right: -14px; bottom: -18px; width: 118px; height: 118px; color: var(--t); opacity: 0.13; stroke-width: 1.3; pointer-events: none; }
.tight-head { margin: 22px 0 12px; }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 20px; margin: 16px 0; box-shadow: var(--shadow); min-width: 0; }
.panel-head { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: flex-start; justify-content: space-between; margin-bottom: 12px; }
.panel-head h2 { margin: 0 0 2px; font-size: 17px; }
.panel-head p { margin: 0; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: center; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.lg-a { background: #9fb8ef; }
.lg-b { background: var(--accent); }
.legend-cost { padding: 4px 10px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); }
.chart2 { width: 100%; height: auto; display: block; }
.chart2 .grid { stroke: var(--line); stroke-dasharray: 3 4; }
.chart2 .base { stroke: var(--line-2); }
.chart2 .axis { fill: var(--muted); font-family: var(--sans); font-size: 11px; }
.chart2 .bar-a { fill: #9fb8ef; }
.chart2 .bar-b { fill: var(--accent); }
.chart2 .hit { fill: transparent; }
.chart2 .day:hover .hit { fill: var(--surface-2); }
.chart2 .day.today .axis { fill: var(--accent); font-weight: 700; }

.panels-3 { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); margin: 16px 0; }
.panels-3 .panel { margin: 0; }
.share-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.share-row { display: flex; align-items: center; gap: 10px; }
.share-name { flex: 1; min-width: 0; font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.share-val { font-weight: 700; font-variant-numeric: tabular-nums; }
.share-meta { display: flex; justify-content: space-between; margin: 2px 0 6px; padding-left: 38px; }
.share-bar { display: block; width: calc(100% - 38px); margin-left: 38px; height: 6px; }
.share-bar .track { fill: var(--surface-2); }
.share-bar .fill { fill: var(--accent); }
.mini-avatar, .rank { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; flex: none; font-size: 12.5px; font-weight: 700; }
.rank { border-radius: 8px; background: var(--surface-2); color: var(--muted); }
.mini-avatar.c0 { background: #def3ee; color: #0b7566; } .mini-avatar.c1 { background: #e3ecfd; color: #1f55c9; }
.mini-avatar.c2 { background: #eee8fc; color: #6b3fc9; } .mini-avatar.c3 { background: #fdf1dc; color: #a35a00; }
.mini-avatar.c4 { background: #ffe8ef; color: #c0365f; } .mini-avatar.c5 { background: #e3f5fb; color: #16799a; }
.list-empty { padding: 18px 0; text-align: center; }
