/* Stockatoo vendor portal: Galah Night */
:root {
  --bg: #12141C;
  --surface: #1C1F2A;
  --surface-2: #232633;
  --border: #262A36;
  --rule: #2A2E3B;
  --text: #F2F0F5;
  --muted: #B7B9C6;
  --faint: #9EA1B0;
  --accent: #F28CB1;
  --accent-soft: #F7B3CD;
  --accent-ink: #12141C;
  --bar-quiet: #3B4152;
  --warning: #F2C14E;
  --critical: #FF6B8B;
  --critical-soft: #FF9DB2;
  --good: #7FD8B0;
  --radius: 18px;
  --font-head: 'Space Grotesk', system-ui, sans-serif;
  --font-body: Inter, system-ui, -apple-system, 'Segoe UI', sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.45 var(--font-body); }
body { min-height: 100vh; -webkit-font-smoothing: antialiased; }
a { color: var(--text); }
a:hover { color: var(--accent-soft); }
h1, h2, h3 { font-family: var(--font-head); margin: 0; letter-spacing: -0.3px; }
h1 { font-size: 30px; font-weight: 700; letter-spacing: -0.6px; }
h2 { font-size: 20px; font-weight: 700; }
h3 { font-size: 16px; font-weight: 600; }
p { margin: 0; }
button, input, select { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 12px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Header ---------- */
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 36px; border-bottom: 1px solid var(--border); background: var(--bg); position: sticky; top: 0; z-index: 10; }
.topbar-left { display: flex; align-items: center; gap: 28px; min-width: 0; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; flex: none; }
.brand span { font-family: var(--font-head); font-weight: 700; font-size: 22px; letter-spacing: -0.4px; }
.nav { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.nav::-webkit-scrollbar { display: none; }
.nav a { display: flex; align-items: center; min-height: 40px; padding: 0 14px; border-radius: 8px; text-decoration: none; color: var(--muted); white-space: nowrap; }
.nav a[aria-current="page"] { background: var(--surface-2); color: var(--text); font-weight: 600; }
.badge { margin-left: 8px; background: var(--accent); color: var(--accent-ink); font-size: 12px; font-weight: 700; padding: 1px 7px; border-radius: 999px; }
.account { position: relative; flex: none; }
.account > button { height: 40px; padding: 0 12px; border-radius: 10px; border: 1px solid #343949; background: var(--surface); font-weight: 600; font-size: 13px; cursor: pointer; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu { position: absolute; right: 0; top: 48px; min-width: 240px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 8px; box-shadow: 0 12px 32px rgba(0,0,0,.4); }
.menu[hidden] { display: none; }
.menu .who { padding: 8px 10px 10px; border-bottom: 1px solid var(--rule); margin-bottom: 6px; }
.menu button { display: block; width: 100%; text-align: left; padding: 10px; border: 0; background: none; border-radius: 8px; cursor: pointer; }
.menu button:hover { background: var(--surface-2); }

/* ---------- Layout ---------- */
main { max-width: 1240px; margin: 0 auto; padding: 28px 36px 64px; display: flex; flex-direction: column; gap: 22px; }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; }
.page-head p { margin-top: 4px; }
.row { display: flex; flex-wrap: wrap; gap: 22px; align-items: stretch; }
.row > * { min-width: 0; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px 26px; }
.card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.card-head a { font-size: 13px; color: var(--accent-soft); }
.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.tile { display: block; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; text-decoration: none; }
a.tile:hover { border-color: #3A3F50; color: var(--text); }
.tile .label { font-size: 12px; color: var(--muted); }
.tile .value { font-family: var(--font-head); font-size: 30px; font-weight: 700; margin-top: 8px; line-height: 1.1; }
.tile .sub { font-size: 12px; margin-top: 4px; color: var(--muted); }
.hero-number { font-family: var(--font-head); font-weight: 700; font-size: 64px; letter-spacing: -2px; line-height: 1; }
.delta-up { color: var(--accent); font-weight: 600; }
.delta-down { color: var(--muted); font-weight: 600; }
.pink { color: var(--accent); }
.crit { color: var(--critical-soft); }
.warn { color: var(--warning); }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; margin: 0 -4px; padding: 0 4px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 500; padding: 10px 8px; white-space: nowrap; }
td { padding: 11px 8px; border-top: 1px solid var(--rule); vertical-align: middle; }
th:first-child, td:first-child { padding-left: 0; }
th:last-child, td:last-child { padding-right: 0; }
.r { text-align: right; }
td.r, th.r { font-variant-numeric: tabular-nums; }
tbody tr.link { cursor: pointer; }
tbody tr.link:hover td { background: rgba(255,255,255,.02); }
td a { text-decoration: none; font-weight: 600; }
.sub-line { font-size: 12px; color: var(--faint); margin-top: 2px; }
th button.sort { background: none; border: 0; padding: 0; color: inherit; font: inherit; cursor: pointer; }
th button.sort[aria-sort]::after { content: ' ↓'; }

/* ---------- Controls ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px; border-radius: 12px; border: 1px solid #343949; background: var(--surface); font-weight: 600; cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:hover { border-color: #4A4F60; color: var(--text); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { background: var(--accent-soft); border-color: var(--accent-soft); color: var(--accent-ink); }
.btn.dark { background: var(--bg); border-color: var(--bg); color: #fff; }
.btn.small { min-height: 36px; padding: 0 12px; border-radius: 10px; font-size: 13px; }
.btn[disabled] { opacity: .5; cursor: default; }
.link-btn { background: none; border: 0; padding: 0; color: var(--accent-soft); cursor: pointer; text-decoration: underline; font-size: 13px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { min-height: 36px; padding: 0 14px; border-radius: 999px; border: 1px solid #343949; background: transparent; color: var(--muted); cursor: pointer; font-size: 13px; }
.chip[aria-pressed="true"] { background: var(--text); border-color: var(--text); color: var(--accent-ink); font-weight: 600; }
.search { display: flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 12px; border: 1px solid #343949; border-radius: 10px; background: var(--surface); flex: 0 1 300px; }
.search input { border: 0; background: none; outline: none; width: 100%; min-height: 38px; }
.toolbar { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; align-items: center; }

label.field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); }
label.field input, label.field select, input.qty, select.qty { min-height: 42px; padding: 0 12px; border-radius: 10px; border: 1px solid #343949; background: var(--bg); color: var(--text); font-size: 14px; }
label.field .hint { font-size: 12px; color: var(--faint); }
input.qty { width: 76px; min-height: 36px; text-align: right; }
select.qty { min-height: 36px; padding: 0 8px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 14px; }
.methods { display: flex; flex-wrap: wrap; gap: 6px; }
.check { display: flex; align-items: center; gap: 10px; color: var(--text); font-size: 14px; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); }
fieldset { border: 0; padding: 0; margin: 0; }
legend { font-size: 13px; color: var(--muted); margin-bottom: 8px; padding: 0; }

/* ---------- Pieces ---------- */
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; padding: 2px 9px; border-radius: 999px; background: var(--surface-2); color: var(--muted); white-space: nowrap; }
.pill.live::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--good); }
.pill.crit { color: var(--critical-soft); }
.pill.pink { color: var(--accent); }
.notice { display: flex; gap: 10px; align-items: flex-start; padding: 14px 16px; border-radius: 12px; background: rgba(242,193,78,.08); border: 1px solid rgba(242,193,78,.25); }
.notice svg { flex: none; margin-top: 1px; }
.banner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; background: var(--accent); color: var(--accent-ink); border-radius: var(--radius); padding: 20px 26px; }
.banner h2 { font-size: 22px; }
.banner p { margin-top: 4px; font-weight: 500; }
.store-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 440px), 1fr)); gap: 16px; }
.store-tile { display: flex; flex-direction: column; gap: 6px; padding: 14px; border-radius: 12px; background: var(--surface-2); text-decoration: none; }
.share-bar { height: 6px; border-radius: 3px; background: var(--surface-2); overflow: hidden; }
.share-bar > div { height: 100%; border-radius: 3px; background: var(--accent); }
dl.facts { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 0; font-size: 13px; }
dl.facts dt { color: var(--muted); }
dl.facts dd { margin: 0; text-align: right; }
.breadcrumb { font-size: 13px; color: var(--muted); }
.breadcrumb a { color: var(--muted); }
.stat-row { display: flex; flex-wrap: wrap; gap: 12px; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 12px 16px; min-width: 120px; }
.stat .label { font-size: 12px; color: var(--muted); }
.stat .value { font-family: var(--font-head); font-size: 24px; font-weight: 700; margin-top: 2px; }
.empty { padding: 26px; text-align: center; color: var(--muted); }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--text); color: var(--accent-ink); padding: 12px 18px; border-radius: 12px; font-weight: 600; z-index: 50; box-shadow: 0 10px 30px rgba(0,0,0,.4); max-width: calc(100vw - 32px); }
.loading { display: grid; place-items: center; min-height: 60vh; color: var(--muted); gap: 14px; }
.spinner { width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--surface-2); border-top-color: var(--accent); animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Charts ---------- */
.chart { position: relative; }
.chart svg { display: block; width: 100%; overflow: visible; }
.chart .axis text, .chart text.axis { fill: var(--faint); font-size: 11px; font-family: var(--font-body); }
.chart .ylab, .chart .xlab { position: absolute; font-size: 11px; color: var(--faint); pointer-events: none; line-height: 14px; }
.chart .ylab { left: 0; width: 32px; text-align: right; }
.chart .xlab { bottom: 4px; transform: translateX(-50%); white-space: nowrap; }
.chart .grid line { stroke: var(--rule); stroke-width: 1; }
.chart .hit { fill: transparent; cursor: crosshair; }
.chart .hover-line { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 3 3; opacity: 0; pointer-events: none; }
.chart .hover-dot { fill: var(--accent); stroke: var(--surface); stroke-width: 2; opacity: 0; pointer-events: none; }
.bars { display: flex; align-items: flex-end; gap: 6px; }
.bars .bar-col { flex: 1 1 0; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; cursor: default; }
.bars .bar { width: 100%; border-radius: 4px 4px 0 0; min-height: 2px; background: var(--bar-quiet); }
.bars .bar.on { background: var(--accent); }
.bars .bar-col:hover .bar { filter: brightness(1.2); }
.bar-labels { display: flex; gap: 6px; margin-top: 8px; }
.bar-labels span { flex: 1 1 0; text-align: center; font-size: 11px; color: var(--faint); }
.tip { position: fixed; z-index: 60; pointer-events: none; background: #0B0C11; color: var(--text); border: 1px solid #343949; padding: 8px 10px; border-radius: 8px; font-size: 12px; line-height: 1.4; max-width: 240px; box-shadow: 0 8px 24px rgba(0,0,0,.45); }
.tip[hidden] { display: none; }
.tip b { font-weight: 600; }
.heat td.cell { text-align: right; font-variant-numeric: tabular-nums; border-top: 2px solid var(--surface); border-left: 2px solid var(--surface); padding: 9px 10px; border-radius: 4px; }
.heat td.cell.neg { box-shadow: inset 0 0 0 2px var(--critical); }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--muted); align-items: center; }
.legend .sw { display: inline-block; width: 12px; height: 12px; border-radius: 3px; vertical-align: -2px; margin-right: 6px; }

/* ---------- Sign-in ---------- */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.auth-card { width: 100%; max-width: 420px; display: flex; flex-direction: column; gap: 18px; }
.auth-card .brand { justify-content: center; margin-bottom: 6px; }
.auth-card .card { display: flex; flex-direction: column; gap: 16px; }
.auth-card form { display: flex; flex-direction: column; gap: 14px; }
.auth-card .btn { width: 100%; }
.auth-links { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.error { color: var(--critical-soft); font-size: 13px; }
.ok { color: var(--good); font-size: 13px; }

/* ---------- Phone ---------- */
@media (max-width: 760px) {
  .topbar { padding: 10px 16px; flex-wrap: wrap; gap: 8px; }
  .topbar-left { width: 100%; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
  .nav { order: 3; width: 100%; margin: 0 -4px; }
  .account { position: absolute; right: 16px; top: 10px; }
  .account > button { max-width: 150px; }
  main { padding: 20px 16px 48px; gap: 16px; }
  .card { padding: 18px 16px; }
  h1 { font-size: 26px; }
  .hero-number { font-size: 52px; }
  .banner { padding: 18px 16px; }
  .hide-phone { display: none; }
}
