/* GoArk web admin. Follows the "Store Dashboard — Web & Mobile" desktop boards.
   The web CSP blocks inline style attributes, so every look lives here and
   computed sizes are set from admin.js through element.style. */

@font-face { font-family: "Sora"; font-weight: 500; font-display: swap; src: url("/public/goark/fonts/sora-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Sora"; font-weight: 600; font-display: swap; src: url("/public/goark/fonts/sora-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Sora"; font-weight: 700; font-display: swap; src: url("/public/goark/fonts/sora-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-weight: 400; font-display: swap; src: url("/public/goark/fonts/ibm-plex-sans-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-weight: 500; font-display: swap; src: url("/public/goark/fonts/ibm-plex-sans-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-weight: 600; font-display: swap; src: url("/public/goark/fonts/ibm-plex-sans-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-weight: 500; font-display: swap; src: url("/public/goark/fonts/ibm-plex-mono-latin-500-normal.woff2") format("woff2"); }

:root {
  --bg: #F3F2EE; --surface: #FFFFFF; --ink: #17181C; --ink-2: #3C3E45; --muted: #5E6068; --faint: #74767D;
  --line: #E3E1DA; --line-2: #EEECE6; --field-line: #D6D4CC; --chip-line: #DDDBD3; --field: #F7F6F3; --tint: #ECEAE4; --seg: #F0EEE9;
  --dark: #15171C; --dark-2: #1D2026; --dark-3: #2A2D35; --dark-line: #2E3139; --dark-text: #C4C6CD; --dark-muted: #9A9DA6;
  --accent: #0E6B5C; --accent-ink: #0A5146; --accent-soft: #E3F0EC; --accent-wash: #F4FAF8; --mint: #7FC7B6;
  --ok-bg: #E3F0EC; --ok-fg: #0A5146; --warn-bg: #FDF1DE; --warn-fg: #8A4B06; --info-bg: #E8ECF8; --info-fg: #243A85;
  --bad-bg: #FDEBEA; --bad-fg: #9B1C14; --badge: #B42318; --amber: #B45309; --blue: #2F4AA8;
  --sans: "IBM Plex Sans", "Segoe UI", system-ui, sans-serif;
  --display: "Sora", "IBM Plex Sans", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
  color-scheme: light;
}
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); }
body { font-family: var(--sans); color: var(--ink); font-size: 14px; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--accent); }
a:hover { color: var(--accent-ink); }
h1, h2, h3, p { margin: 0; }
input::placeholder { color: #8A8C93; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
[hidden] { display: none !important; }
.mono { font-family: var(--mono); font-weight: 500; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 13px; }
.caption { font-size: 12px; color: var(--muted); }
.grow { flex: 1 1 auto; min-width: 0; }
.row { display: flex; align-items: center; gap: 12px; }
.row.tight { gap: 8px; }
.between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.stack { display: flex; flex-direction: column; gap: 8px; }
.stack.tight { gap: 2px; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.center { text-align: center; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* ------------------------------------------------------------------ auth */
.auth { min-height: 100vh; display: grid; grid-template-columns: 620px 1fr; }
.auth-hero { position: relative; overflow: hidden; background: var(--dark); color: var(--bg); padding: 56px 64px; display: flex; flex-direction: column; justify-content: space-between; gap: 40px; }
.auth-hero .grid-art { position: absolute; inset: 0; opacity: .07; pointer-events: none; }
.auth-hero > * { position: relative; }
.auth-hero h2 { font-family: var(--display); font-weight: 600; font-size: 44px; line-height: 1.12; letter-spacing: -.02em; max-width: 470px; }
.auth-points { display: flex; flex-direction: column; gap: 16px; font-size: 16px; color: var(--dark-text); }
.auth-points div { display: flex; align-items: center; gap: 12px; }
.auth-points .ic { color: var(--mint); }
.auth-hero footer { font-size: 13px; color: var(--dark-muted); }
.auth-panel { display: flex; align-items: center; justify-content: center; padding: 48px 24px; }
.auth-form { width: 100%; max-width: 420px; display: flex; flex-direction: column; gap: 24px; }
.auth-form h1 { font-family: var(--display); font-weight: 600; font-size: 32px; letter-spacing: -.01em; }
.auth-form .lead { font-size: 16px; color: var(--muted); }
.or { display: flex; align-items: center; gap: 12px; font-size: 13px; color: var(--faint); }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--chip-line); }
.demo-note { border-radius: 10px; background: var(--tint); padding: 10px 14px; font-size: 13px; color: var(--ink-2); }
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark { width: 40px; height: 40px; flex-shrink: 0; object-fit: contain; }
.brand-name { font-family: var(--display); font-weight: 600; font-size: 18px; }
.otp { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; }
.otp input { height: 60px; width: 100%; border: 1px solid var(--field-line); border-radius: 12px; background: #fff; text-align: center; font-family: var(--mono); font-size: 24px; outline: none; }
.otp input:focus { border: 2px solid var(--accent); }
.otp.invalid input { border-color: var(--bad-fg); }
.strength { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.strength span { height: 4px; border-radius: 2px; background: var(--tint); }
.strength[data-level="1"] span:nth-child(-n+1) { background: var(--badge); }
.strength[data-level="2"] span:nth-child(-n+2) { background: var(--amber); }
.strength[data-level="3"] span:nth-child(-n+3) { background: #1A8F5A; }
.strength[data-level="4"] span { background: var(--accent); }

/* ------------------------------------------------------------------ forms */
.field { display: flex; flex-direction: column; gap: 8px; }
.field > label, .label { font-size: 14px; font-weight: 600; }
.field .help { font-size: 12px; color: var(--muted); line-height: 1.45; }
.field .error { font-size: 12px; color: var(--bad-fg); font-weight: 500; }
.field.invalid .input, .field.invalid .input-group { border-color: var(--bad-fg); }
.input { height: 48px; width: 100%; padding: 0 14px; border: 1px solid var(--field-line); border-radius: 10px; background: #fff; font-size: 15px; outline: none; }
.input.sm { height: 40px; font-size: 14px; }
.input.mono { font-family: var(--mono); font-size: 14px; }
select.input { padding-right: 8px; }
.input:focus, .input-group:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(14, 107, 92, .14); }
.input-group { display: flex; align-items: center; height: 48px; border: 1px solid var(--field-line); border-radius: 10px; background: #fff; overflow: hidden; }
.input-group input { flex: 1; min-width: 0; height: 46px; border: 0; outline: none; background: transparent; font-size: 15px; padding: 0 14px; }
.input-group .prefix { height: 100%; padding: 0 12px; display: flex; align-items: center; border-right: 1px solid var(--line); background: var(--field); font-family: var(--mono); color: var(--ink-2); }
.check { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--ink-2); cursor: pointer; min-height: 32px; }
.check input { width: 18px; height: 18px; margin: 0; accent-color: var(--accent); }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.search { height: 44px; border: 1px solid var(--chip-line); border-radius: 10px; background: var(--field); display: flex; align-items: center; gap: 10px; padding: 0 14px; color: var(--faint); }
.search input { flex: 1; min-width: 0; border: 0; outline: none; background: transparent; font-size: 14px; color: var(--ink); }
.search kbd { font-family: var(--mono); font-size: 11px; padding: 2px 6px; border-radius: 4px; border: 1px solid var(--chip-line); color: var(--muted); }

/* ---------------------------------------------------------------- buttons */
.btn { height: 44px; padding: 0 16px; border-radius: 10px; border: 0; display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-size: 14px; font-weight: 600; text-decoration: none; white-space: nowrap; transition: background .15s, opacity .15s; }
.btn.lg { height: 50px; font-size: 16px; }
.btn.sm { height: 36px; padding: 0 12px; font-size: 13px; border-radius: 8px; }
.btn.block { width: 100%; }
.btn.primary { background: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-ink); color: #fff; }
.btn.primary[aria-disabled="true"] { background: #5F6B68; }
.btn.outline { background: #fff; color: var(--ink); border: 1px solid var(--field-line); }
.btn.outline:hover { background: var(--field); color: var(--ink); }
.btn.danger { background: #fff; color: var(--bad-fg); border: 1px solid var(--field-line); }
.btn.dark { background: var(--dark); color: #fff; }
.btn.ghost { background: transparent; color: var(--accent); padding: 0 8px; }
.btn[data-busy="true"] { opacity: .65; pointer-events: none; }
.icon-btn { width: 44px; height: 44px; flex-shrink: 0; border-radius: 10px; border: 1px solid var(--chip-line); background: #fff; color: var(--ink-2); display: inline-flex; align-items: center; justify-content: center; position: relative; text-decoration: none; }
.icon-btn.plain { border: 0; background: transparent; }
.icon-btn.sm { width: 36px; height: 36px; border-radius: 8px; }
.icon-btn[aria-expanded="true"] { background: var(--seg); border-color: var(--field-line); }
.link-btn { border: 0; background: none; padding: 0; color: var(--accent); font-size: 13px; font-weight: 600; text-decoration: none; display: inline-flex; align-items: center; gap: 6px; min-height: 32px; }
.link-btn:hover { color: var(--accent-ink); }
.count { position: absolute; top: -5px; right: -5px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px; border: 2px solid #fff; background: var(--badge); color: #fff; font-size: 11px; font-weight: 600; display: flex; align-items: center; justify-content: center; }

/* ------------------------------------------------------------ app shell */
.admin { min-height: 100vh; display: grid; grid-template-columns: 264px minmax(0, 1fr); }
.side { position: sticky; top: 0; height: 100vh; overflow-y: auto; background: var(--dark); color: var(--dark-text); padding: 22px 16px; display: flex; flex-direction: column; gap: 20px; z-index: 40; }
.side .brand { padding: 0 8px; }
.side .brand-mark { width: 36px; height: 36px; }
.side .brand-name { font-size: 16px; color: var(--bg); }
.store-switch { position: relative; }
.store-switch > button { width: 100%; min-height: 56px; border-radius: 12px; border: 1px solid var(--dark-line); background: var(--dark-2); padding: 8px 10px; display: flex; align-items: center; gap: 10px; text-align: left; color: var(--bg); }
.mono-tile { width: 36px; height: 36px; border-radius: 9px; background: var(--dark-3); display: flex; align-items: center; justify-content: center; font-family: var(--display); font-weight: 700; font-size: 12px; flex-shrink: 0; }
.mono-tile.light { background: var(--tint); color: var(--ink-2); }
.mono-tile.sm { width: 28px; height: 28px; border-radius: 7px; font-size: 10px; }
.mono-tile.on { background: var(--accent); color: #fff; }
.store-switch .meta { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--dark-muted); }
.dot { width: 6px; height: 6px; border-radius: 3px; background: #3CC48A; flex-shrink: 0; display: inline-block; }
.dot.lg { width: 8px; height: 8px; border-radius: 4px; }
.dot.syncing { background: #7C9CF5; }
.dot.attention { background: #E5484D; }
.dot.sample { background: var(--mint); }
.dot.off { background: #A3A5AB; }
.menu { position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 50; background: #fff; color: var(--ink); border-radius: 12px; box-shadow: 0 12px 32px rgba(21, 23, 28, .28); padding: 6px; display: flex; flex-direction: column; }
.menu button, .menu a { min-height: 44px; border: 0; border-radius: 8px; padding: 6px 8px; display: flex; align-items: center; gap: 10px; background: transparent; text-align: left; text-decoration: none; color: var(--ink); font-size: 13px; }
.menu button:hover, .menu a:hover, .menu [aria-current="true"] { background: var(--seg); }
.menu a.accent { color: var(--accent); font-weight: 600; }
.menu hr { border: 0; height: 1px; background: var(--line-2); margin: 4px 0; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav .heading { font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: #8A8D96; padding: 14px 12px 6px; }
.nav a { height: 40px; border-radius: 8px; padding: 0 12px; display: flex; align-items: center; gap: 12px; font-size: 14px; font-weight: 500; text-decoration: none; color: var(--dark-text); }
.nav a:hover { background: var(--dark-2); color: #fff; }
.nav a[aria-current="page"] { background: var(--accent); color: #fff; }
.nav .badge { margin-left: auto; min-width: 22px; height: 20px; padding: 0 6px; border-radius: 10px; background: #3A3E47; color: #fff; font-size: 11px; font-weight: 600; display: flex; align-items: center; justify-content: center; }
.nav .badge.warn { background: var(--amber); }
.nav a[aria-current="page"] .badge { background: var(--accent-ink); }
.plan-card { border-radius: 12px; background: var(--dark-2); border: 1px solid var(--dark-line); padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.plan-card strong { font-size: 13px; color: var(--bg); }
.plan-card a { font-size: 12px; font-weight: 600; color: var(--mint); }
.bar-track { height: 6px; border-radius: 3px; background: var(--dark-line); overflow: hidden; }
.bar-track i { display: block; height: 100%; background: var(--mint); }
.side-user { border-top: 1px solid var(--dark-3); padding: 14px 8px 0; display: flex; align-items: center; gap: 12px; }
.side-user .avatar { background: var(--dark-3); color: var(--bg); }
.side-user strong { font-size: 14px; color: var(--bg); }
.side-user .icon-btn { border: 0; background: transparent; color: var(--dark-text); }
.side-user .icon-btn:hover { background: var(--dark-2); }
.side .spacer { flex: 1; }

.workspace { min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 30; height: 72px; padding: 0 32px; background: #fff; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 16px; }
.topbar .search { width: 400px; max-width: 100%; position: relative; }
.topbar .menu-toggle { display: none; }
.results { position: absolute; left: 0; right: 0; top: calc(100% + 6px); background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 16px 40px rgba(21, 23, 28, .18); padding: 6px; max-height: 420px; overflow-y: auto; color: var(--ink); }
.results .group { font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); padding: 8px 10px 4px; }
.results a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; text-decoration: none; color: var(--ink); }
.results a:hover, .results a[aria-selected="true"] { background: var(--seg); }
.segmented { display: flex; gap: 4px; padding: 4px; border-radius: 10px; background: var(--seg); }
.segmented button { height: 34px; padding: 0 12px; border: 0; border-radius: 7px; background: transparent; color: var(--muted); font-size: 13px; font-weight: 600; }
.segmented button[aria-pressed="true"] { background: #fff; color: var(--ink); box-shadow: 0 1px 2px rgba(0, 0, 0, .06); }
.avatar { width: 40px; height: 40px; border-radius: 50%; flex-shrink: 0; background: var(--tint); color: var(--ink-2); display: inline-flex; align-items: center; justify-content: center; font-weight: 600; font-size: 13px; }
.avatar.sm { width: 28px; height: 28px; font-size: 10px; }
.avatar.lg { width: 56px; height: 56px; font-size: 16px; }
.avatar.accent { background: var(--accent); color: #fff; }
.avatar.team { background: var(--accent-soft); color: var(--accent-ink); }
.popover { position: absolute; top: 66px; right: 32px; width: 400px; max-width: calc(100vw - 32px); background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 16px 40px rgba(21, 23, 28, .18); overflow: hidden; z-index: 60; }
.popover-head { height: 56px; padding: 0 16px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line-2); }
.popover-head strong { font-family: var(--display); font-size: 16px; font-weight: 600; }
.popover-foot { height: 48px; display: flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 600; text-decoration: none; }

.content { padding: 28px 32px 40px; display: flex; flex-direction: column; gap: 22px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.page-head h1 { font-family: var(--display); font-weight: 600; font-size: 28px; letter-spacing: -.01em; }
.page-head p { font-size: 15px; color: var(--muted); margin-top: 6px; }
.page-head .actions { display: flex; gap: 12px; flex-wrap: wrap; }
.crumb { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; text-decoration: none; margin-bottom: 6px; }

/* ---------------------------------------------------------------- cards */
.grid { display: grid; gap: 18px; }
.grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.side-layout { grid-template-columns: minmax(0, 1fr) 340px; align-items: start; }
.span-2 { grid-column: span 2; }
.card { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 22px; display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.card.flush { padding: 0; gap: 0; overflow: hidden; }
.card.tall { min-height: 330px; }
.card.taller { min-height: 380px; }
.card h2, .card-title { font-family: var(--display); font-size: 17px; font-weight: 600; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.card.flush .card-head { height: 62px; padding: 0 22px; }
.card .sub { font-size: 13px; color: var(--muted); }
.card.dark { background: var(--dark); color: var(--bg); border-color: var(--dark); }
.overline { font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.kpi { padding: 18px 18px 14px; gap: 10px; }
.kpi .label { font-size: 14px; font-weight: 500; color: var(--muted); }
.kpi .value { font-family: var(--mono); font-size: 26px; font-weight: 500; }
.kpi svg { width: 100%; height: 36px; display: block; }
.pill { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.pill.sm { height: 20px; padding: 0 8px; font-size: 11px; }
.s-paid, .s-ok, .s-synced { background: var(--ok-bg); color: var(--ok-fg); }
.s-pending, .s-warn { background: var(--warn-bg); color: var(--warn-fg); }
.s-refunded, .s-info, .s-syncing { background: var(--info-bg); color: var(--info-fg); }
.s-failed, .s-bad, .s-attention { background: var(--bad-bg); color: var(--bad-fg); }
.s-neutral, .s-customer { background: var(--tint); color: var(--ink-2); }
.s-owner { background: var(--dark); color: #fff; }
.s-staff { background: var(--info-bg); color: var(--info-fg); }
.legend { display: flex; align-items: center; gap: 16px; font-size: 13px; color: var(--muted); flex-wrap: wrap; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.sw { width: 10px; height: 10px; border-radius: 3px; display: inline-block; flex-shrink: 0; background: var(--accent); }
.sw.prev { background: var(--field-line); }

/* Charts (heights and widths come from admin.js) */
.chart { flex: 1; display: flex; gap: 14px; min-height: 230px; }
.chart .axis { width: 52px; display: flex; flex-direction: column; justify-content: space-between; font-family: var(--mono); font-size: 11px; color: var(--faint); text-align: right; padding-bottom: 26px; }
.chart .plot { flex: 1; display: flex; align-items: flex-end; gap: 10px; border-bottom: 1px solid var(--line); position: relative; }
.chart .col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 8px; position: relative; top: 26px; min-width: 0; }
.chart .pair { display: flex; align-items: flex-end; gap: 3px; height: 190px; }
.chart .pair i { width: 11px; border-radius: 3px 3px 0 0; background: var(--accent); display: block; min-height: 2px; }
.chart .pair i.prev { background: var(--field-line); }
.chart .single i { width: 100%; max-width: 34px; }
.chart .col > span { font-size: 11px; color: var(--faint); white-space: nowrap; }
.chart .col:hover .tip { opacity: 1; }
.tip { position: absolute; bottom: calc(100% + 4px); left: 50%; transform: translateX(-50%); background: var(--dark); color: #fff; border-radius: 8px; padding: 6px 8px; font-size: 11px; white-space: nowrap; opacity: 0; pointer-events: none; transition: opacity .12s; z-index: 5; }
.hbar { height: 8px; border-radius: 4px; background: var(--line-2); overflow: hidden; }
.hbar i { display: block; height: 100%; border-radius: 4px; background: var(--accent); }
.hbar.sm { height: 6px; border-radius: 3px; }
.split-bar { display: flex; height: 10px; border-radius: 5px; overflow: hidden; gap: 2px; background: var(--line-2); }
.split-bar i { display: block; height: 100%; }
.donut { position: relative; width: 150px; height: 150px; flex-shrink: 0; }
.donut .center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.ring { position: relative; width: 96px; height: 96px; flex-shrink: 0; }
.ring span { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-family: var(--mono); font-size: 18px; }
.rank { width: 16px; font-family: var(--mono); font-size: 12px; color: var(--faint); }
.thumb { width: 40px; height: 40px; border-radius: 8px; background: var(--tint); flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 600; color: var(--ink-2); }
.list-row { display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 6px 0; border-bottom: 1px solid var(--line-2); }
.list-row:last-child { border-bottom: 0; }
.empty { padding: 40px 20px; display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; color: var(--muted); }
.empty strong { font-size: 16px; color: var(--ink); }
.empty .tile { width: 52px; height: 52px; border-radius: 14px; background: var(--accent-soft); color: var(--accent); display: flex; align-items: center; justify-content: center; }
.dashed { min-height: 40px; border-radius: 10px; border: 1.5px dashed #B9B7AF; display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 13px; font-weight: 600; text-decoration: none; color: var(--accent); background: transparent; }

/* ---------------------------------------------------------------- tables */
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 14px; }
table.data th { height: 40px; padding: 0 16px; background: var(--field); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); text-align: left; white-space: nowrap; }
table.data th:first-child, table.data td:first-child { padding-left: 22px; }
table.data th:last-child, table.data td:last-child { padding-right: 22px; }
table.data th button { border: 0; background: none; padding: 0; font: inherit; color: inherit; letter-spacing: inherit; text-transform: inherit; display: inline-flex; align-items: center; gap: 4px; }
table.data td { height: 54px; padding: 0 16px; border-bottom: 1px solid var(--line-2); white-space: nowrap; }
table.data tbody tr { cursor: pointer; }
table.data tbody tr:hover { background: #FBFAF8; }
table.data tbody tr[aria-selected="true"] { background: var(--accent-wash); }
table.data td.num, table.data th.num { text-align: right; }
.table-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 22px; font-size: 13px; color: var(--muted); }
.toolbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.toolbar .search { width: 320px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { height: 36px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--chip-line); background: #fff; color: var(--ink-2); font-size: 13px; font-weight: 600; display: inline-flex; align-items: center; gap: 6px; }
.chip[aria-pressed="true"] { background: var(--dark); border-color: var(--dark); color: #fff; }
.chip .n { min-width: 20px; height: 18px; padding: 0 6px; border-radius: 9px; background: var(--tint); color: var(--ink-2); font-size: 11px; display: inline-flex; align-items: center; justify-content: center; }
.chip[aria-pressed="true"] .n { background: rgba(255, 255, 255, .18); color: #fff; }
.stepper { display: inline-flex; align-items: center; border: 1px solid var(--field-line); border-radius: 8px; overflow: hidden; background: #fff; }
.stepper button { width: 34px; height: 34px; border: 0; background: transparent; color: var(--ink-2); display: inline-flex; align-items: center; justify-content: center; }
.stepper button:hover { background: var(--seg); }
.stepper input { width: 64px; height: 34px; border: 0; border-left: 1px solid var(--line); border-right: 1px solid var(--line); text-align: center; font-family: var(--mono); outline: none; }

/* ------------------------------------------------- notifications page */
.notif-list .group-label { font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); padding: 16px 22px 8px; background: var(--field); border-bottom: 1px solid var(--line-2); }
.notif-row { display: flex; gap: 14px; padding: 16px 22px; border-bottom: 1px solid var(--line-2); align-items: flex-start; }
.notif-row[data-unread="true"] { background: #fff; }
.notif-row[data-unread="false"] { background: #FBFAF8; }
.notif-row .ic { width: 40px; height: 40px; border-radius: 12px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.notif-row .title { font-size: 15px; font-weight: 500; }
.notif-row[data-unread="true"] .title { font-weight: 600; }
.notif-row .body { font-size: 13px; color: var(--muted); line-height: 1.45; }
.notif-row .meta { font-size: 12px; color: var(--faint); }
.notif-row .unread-dot { width: 8px; height: 8px; border-radius: 4px; background: var(--accent); display: inline-block; }
.ic.order { background: var(--ok-bg); color: var(--ok-fg); }
.ic.payment { background: var(--bad-bg); color: var(--bad-fg); }
.ic.stock { background: var(--warn-bg); color: var(--warn-fg); }
.ic.sync { background: var(--info-bg); color: var(--info-fg); }
.ic.team { background: var(--tint); color: var(--ink-2); }
.pop-row { display: flex; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line-2); text-decoration: none; color: var(--ink); }
.pop-row[data-unread="false"] { background: #FBFAF8; }
.pop-row:hover { background: var(--seg); color: var(--ink); }
.pop-row .ic { width: 36px; height: 36px; border-radius: 10px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.pref-grid { display: grid; grid-template-columns: 1fr 64px 64px; align-items: center; row-gap: 4px; }
.pref-grid .head { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; padding-bottom: 6px; border-bottom: 1px solid var(--line-2); }
.pref-grid .cell { display: flex; justify-content: center; }
.pref-grid .name { min-height: 48px; display: flex; align-items: center; font-size: 14px; }
.switch { width: 44px; height: 26px; flex-shrink: 0; border: 0; border-radius: 13px; padding: 3px; background: #C9C7C0; display: inline-flex; transition: background .15s; }
.switch .knob { width: 20px; height: 20px; border-radius: 10px; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform .15s; }
.switch[aria-checked="true"], .switch[aria-pressed="true"] { background: var(--accent); }
.switch[aria-checked="true"] .knob, .switch[aria-pressed="true"] .knob { transform: translateX(18px); }

/* ------------------------------------------------------- stores / connect */
.store-card { gap: 14px; }
.store-card[data-active="true"] { border: 2px solid var(--accent); padding: 21px; }
.platforms { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.platform { border: 1px solid var(--line); background: #fff; border-radius: 14px; padding: 16px; display: flex; flex-direction: column; align-items: flex-start; gap: 12px; text-align: left; min-height: 124px; color: var(--ink); }
.platform:hover { border-color: var(--field-line); }
.platform[aria-pressed="true"] { border: 2px solid var(--accent); padding: 15px; background: var(--accent-wash); }
.platform[aria-pressed="true"] .mono-tile { background: var(--accent); color: #fff; }
.platform[aria-disabled="true"] { opacity: .55; }
.platform .name { font-size: 15px; font-weight: 600; }
.platform .how { font-size: 12px; color: var(--muted); }
.platform.wide { flex-direction: row; align-items: center; min-height: 0; grid-column: 1 / -1; }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; max-width: 360px; }
.steps span { height: 4px; border-radius: 2px; background: var(--tint); }
.steps span.on { background: var(--accent); }
.sync-opts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.sync-opt { height: 48px; border-radius: 10px; border: 1px solid var(--field-line); background: #fff; display: flex; align-items: center; gap: 10px; padding: 0 12px; font-size: 14px; font-weight: 600; }
.sync-opt[aria-pressed="true"] { border: 1.5px solid var(--accent); background: var(--accent-wash); }
.box { width: 20px; height: 20px; flex-shrink: 0; border-radius: 6px; border: 1.5px solid #9A9CA3; background: #fff; color: #fff; display: flex; align-items: center; justify-content: center; }
.box svg { opacity: 0; }
[aria-pressed="true"] > .box, [aria-checked="true"] > .box { border: 0; background: var(--accent); }
[aria-pressed="true"] > .box svg, [aria-checked="true"] > .box svg { opacity: 1; }
.banner { border-radius: 12px; padding: 12px 14px; display: flex; gap: 10px; align-items: flex-start; font-size: 14px; line-height: 1.45; font-weight: 500; }
.banner.ok { background: var(--ok-bg); color: var(--ok-fg); }
.banner.bad { background: var(--bad-bg); color: var(--bad-fg); }
.banner.info { background: var(--tint); color: var(--ink-2); }
.sync-step { display: flex; align-items: center; gap: 12px; min-height: 56px; border-bottom: 1px solid var(--line-2); }
.sync-step:last-child { border-bottom: 0; }
.sync-step .mark { width: 24px; height: 24px; border-radius: 12px; border: 2px solid var(--field-line); background: #fff; color: #fff; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.sync-step[data-state="active"] .mark { border-color: var(--accent); }
.sync-step[data-state="done"] .mark { border: 0; background: var(--accent); }
.sync-step[data-state="waiting"] strong { color: var(--faint); }
.big-ring { position: relative; width: 140px; height: 140px; }
.big-ring span { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-family: var(--mono); font-size: 26px; }
.note { background: #E9E7E1; border-radius: 14px; padding: 14px; display: flex; gap: 12px; font-size: 13px; color: var(--ink-2); line-height: 1.5; }

/* ----------------------------------------------------- modal / drawer */
.overlay { position: fixed; inset: 0; z-index: 100; background: rgba(21, 23, 28, .45); display: flex; align-items: center; justify-content: center; padding: 24px; animation: fade .15s ease; }
.modal { width: 100%; max-width: 480px; max-height: calc(100vh - 48px); overflow-y: auto; background: var(--bg); border-radius: 18px; padding: 24px; display: flex; flex-direction: column; gap: 16px; box-shadow: 0 24px 60px rgba(0, 0, 0, .25); animation: pop .18s cubic-bezier(.2, .8, .2, 1); }
.modal h2 { font-family: var(--display); font-size: 20px; font-weight: 600; }
.modal .actions { display: flex; justify-content: flex-end; gap: 10px; padding-top: 4px; }
.overlay.drawer { justify-content: flex-end; align-items: stretch; padding: 0; }
.drawer-panel { width: 100%; max-width: 480px; height: 100vh; overflow-y: auto; background: var(--bg); display: flex; flex-direction: column; animation: slide .2s cubic-bezier(.2, .8, .2, 1); }
.drawer-head { position: sticky; top: 0; z-index: 2; background: #fff; border-bottom: 1px solid var(--line); min-height: 64px; padding: 0 12px 0 22px; display: flex; align-items: center; gap: 8px; }
.drawer-head h2 { flex: 1; font-family: var(--display); font-size: 18px; font-weight: 600; }
.drawer-body { flex: 1; padding: 20px 22px; display: flex; flex-direction: column; gap: 14px; }
.drawer-foot { position: sticky; bottom: 0; background: #fff; border-top: 1px solid var(--line); padding: 14px 22px; display: flex; gap: 10px; }
.drawer-foot .btn { flex: 1; }
.drawer-body .card { padding: 16px; gap: 12px; }
.kv { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; }
.kv span:first-child { color: var(--muted); }
.kv.total { font-weight: 600; font-size: 16px; }
.divider { border-top: 1px solid var(--line-2); padding-top: 12px; }
.toast { position: fixed; right: 24px; bottom: 24px; z-index: 200; max-width: 420px; background: var(--dark); color: #fff; border-radius: 12px; padding: 12px 16px; font-size: 14px; box-shadow: 0 10px 30px rgba(0, 0, 0, .25); transform: translateY(16px); opacity: 0; transition: transform .2s, opacity .2s; pointer-events: none; }
.toast.show { transform: none; opacity: 1; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { transform: scale(.97); opacity: 0; } }
@keyframes slide { from { transform: translateX(40px); opacity: .5; } }
@keyframes spin { to { transform: rotate(360deg); } }
.spin { display: inline-flex; animation: spin .9s linear infinite; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ------------------------------------------------------------- responsive */
@media (max-width: 1280px) {
  .grid.cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .platforms { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1100px) {
  .grid.cols-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid.cols-3 > .span-2 { grid-column: 1 / -1; }
  .grid.side-layout { grid-template-columns: minmax(0, 1fr); }
  .auth { grid-template-columns: 1fr 1fr; }
  .auth-hero { padding: 40px; }
  .auth-hero h2 { font-size: 34px; }
  .sync-opts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .admin { grid-template-columns: minmax(0, 1fr); }
  .side { position: fixed; left: 0; top: 0; bottom: 0; width: 280px; transform: translateX(-100%); transition: transform .2s ease; box-shadow: 0 0 40px rgba(0, 0, 0, .3); }
  .admin.nav-open .side { transform: none; }
  .topbar { padding: 0 16px; gap: 10px; }
  .topbar .menu-toggle { display: inline-flex; }
  .topbar .search { width: auto; flex: 1; }
  .topbar .search kbd, .topbar .segmented { display: none; }
  .content { padding: 20px 16px 32px; }
  .grid.cols-3, .grid.cols-2 { grid-template-columns: minmax(0, 1fr); }
  .span-2 { grid-column: auto; }
  .auth { grid-template-columns: 1fr; }
  .auth-hero { padding: 28px 24px; }
  .auth-hero h2 { font-size: 28px; }
  .auth-points, .auth-hero footer { display: none; }
  .popover { right: 16px; top: 64px; }
  .toolbar .search { width: 100%; }
}
@media (max-width: 600px) {
  .grid.cols-4, .grid-2, .platforms, .sync-opts { grid-template-columns: minmax(0, 1fr); }
  .page-head h1 { font-size: 24px; }
  .chart .pair i { width: 6px; }
  .chart .col > span { font-size: 9px; }
}

/* Helpers used by admin.js and the admin views */
.gap-16 { gap: 16px; }
.gap-18 { gap: 18px; }
.wrap { flex-wrap: wrap; }
.row.top { align-items: flex-start; }
.row.end { justify-content: flex-end; }
.strong { font-weight: 600; }
.big { font-size: 22px; }
.narrow { width: 96px; }
.span-all { grid-column: 1 / -1; }
.mint { background: var(--mint); }
.link-btn.mint { color: var(--mint); background: none; min-height: 0; }
.on-dark { color: var(--dark-muted); }
.on-dark-2 { color: var(--dark-text); display: inline-flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.goal-amount { font-size: 18px; }
.grow-card { flex: 1; }
.chart.short { min-height: 200px; }
.chart.short .pair { height: 150px; }
.store-sales { gap: 16px; flex: 1; }
.donut-row { gap: 20px; flex: 1; }
.legend-row { display: flex; align-items: center; gap: 8px; font-size: 13px; min-height: 28px; color: var(--ink); text-decoration: none; border-radius: 6px; }
.legend-row:hover { color: var(--accent); }
.thumb.lg-thumb { width: 52px; height: 52px; border-radius: 12px; font-size: 14px; }
.step-num { width: 22px; height: 22px; border-radius: 11px; background: var(--accent-soft); color: var(--accent-ink); font-size: 12px; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.display-sm { font-family: var(--display); font-size: 24px; font-weight: 600; }
.welcome-card { padding: 32px; gap: 24px; }
.welcome-card p { max-width: 560px; }
.cell-name { max-width: 240px; }
.cell-store { max-width: 160px; }
.meter-cell { display: block; width: 140px; }
.wrap-cell { white-space: normal; }
table.data tbody tr.static { cursor: default; }
table.data tbody tr.static:hover { background: transparent; }
.dot.unread { background: var(--accent); margin-top: 6px; }
.modal .card.kpi .value { font-size: 22px; }
.drawer-body .card.flush .card-head { height: 52px; padding: 0 16px; }

/* Layout fixes from the review pass */
.auth-hero .stack { gap: 28px; }
.chart .plot { align-items: stretch; border-bottom: 0; }
.chart .col { top: 0; justify-content: flex-end; }
.chart .pair { width: 100%; justify-content: center; border-bottom: 1px solid var(--line); }
.chart .axis { padding-bottom: 24px; }
.chart.short .axis { padding-bottom: 24px; }
.mono.small, .list-row .mono, .kv .mono { white-space: nowrap; }
.goal-amount { font-size: 16px; white-space: nowrap; }
.list-row .caption { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.store-switch .meta, .side-user .caption { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }
.store-switch .meta .dot { margin-right: 6px; vertical-align: middle; }
.side-user .grow { min-width: 0; }
.cell-store { max-width: 140px; }
.topbar .search { min-width: 0; }
@media (max-width: 900px) {
  .side { box-shadow: none; }
  .admin.nav-open .side { box-shadow: 0 0 40px rgba(0, 0, 0, .3); }
}
@media (max-width: 600px) {
  .topbar > .avatar { display: none; }
}

.side .brand, .topbar > .avatar { text-decoration: none; }
.side .brand:hover .brand-name { color: #fff; }

/* Sign-in / sign-up: responsive layout */
.auth { min-height: 100vh; min-height: 100dvh; }
.auth-panel { min-width: 0; }
@media (max-width: 1100px) and (min-width: 901px) {
  .auth-hero .auth-points { font-size: 15px; }
}
@media (max-width: 900px) {
  /* Short dark band on top, form directly underneath. */
  .auth { grid-template-rows: auto 1fr; }
  .auth-hero { gap: 28px; justify-content: flex-start; }
  .auth-hero .stack { gap: 0; }
  .auth-hero h2 { max-width: 560px; }
  .auth-panel { align-items: flex-start; padding: 40px 24px 48px; }
}
@media (max-width: 600px) {
  .auth-hero { padding: 20px 20px 24px; gap: 16px; }
  .auth-hero h2 { font-size: 22px; line-height: 1.2; }
  .auth-panel { padding: 28px 20px 40px; }
  .auth-form { gap: 20px; }
  .auth-form h1 { font-size: 26px; line-height: 1.2; }
  .auth-form .lead { font-size: 15px; }
  /* 16px stops iOS Safari from zooming into fields on focus. */
  .auth-form .input, .auth-form .input-group input { font-size: 16px; }
}
@media (max-width: 360px) {
  .auth-form .between { flex-wrap: wrap; row-gap: 4px; }
}

/* Operator console (operator.js) */
select.input { appearance: none; padding-right: 36px; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%235E6068' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 6l4 4 4-4'/%3E%3C/svg%3E") no-repeat right 12px center; cursor: pointer; }
select.input.narrow-select { width: auto; min-width: 150px; }
textarea.input.textarea { height: auto; min-height: 88px; padding: 12px 14px; resize: vertical; line-height: 1.45; }
.input.otp-single { height: 60px; font-family: var(--mono); font-size: 28px; letter-spacing: .5em; text-align: center; }
.card.flush .card-head.toolbar { height: auto; min-height: 62px; padding: 12px 22px; flex-wrap: wrap; justify-content: flex-start; }
.card-head.toolbar .search { width: 300px; max-width: 100%; }
.drawer-stores { padding: 0 16px 8px; }
.plan-tile { gap: 18px; }
.plan-tile.is-off { opacity: .72; }
.plan-tile .btn { margin-top: auto; }
.list-row.legend-row { min-height: 52px; border-radius: 0; }
.list-row.legend-row:hover { color: inherit; background: #FBFAF8; }
.kv svg { vertical-align: -3px; margin-right: 4px; }
.avatar.sm.accent { background: var(--accent); color: #fff; }
@media (max-width: 900px) {
  .card-head.toolbar .search { width: 100%; }
  .card-head.toolbar .grow { display: none; }
  .plan-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
  .plan-grid { grid-template-columns: minmax(0, 1fr); }
  select.input.narrow-select { flex: 1; }
  .page-head .actions { width: 100%; }
  .page-head .actions .btn { flex: 1; }
}
/* Keep edge tooltips inside the card so narrow screens don't scroll sideways. */
.chart .col:nth-last-child(-n+2) .tip { left: auto; right: 0; transform: none; }
.chart .col:nth-child(-n+2) .tip { left: 0; transform: none; }
