/* Growza design system
   Palette comes from the logo: wordmark blue, leaf green, ink navy.
   One family (Hanken Grotesk), tabular figures for money, sentence-case labels.
   Panels are outlined, not shadowed; shadows are reserved for things that float. */

@font-face { font-family: "Hanken Grotesk"; src: url("../fonts/hanken-grotesk.woff2") format("woff2"); font-weight: 100 900; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+20B9, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Hanken Grotesk"; src: url("../fonts/hanken-grotesk-ext.woff2") format("woff2"); font-weight: 100 900; font-display: swap; unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }

:root {
  --brand: #1673FF; --brand-2: #3DAE2B; --side: #0E1A2B;
  --ink: #14233A; --ink-2: #4A5A70; --ink-3: #7A889B;
  --paper: #F5F7FA; --surface: #FFFFFF; --sunken: #EEF2F6; --line: #E1E7EE; --line-2: #CFD8E3;
  --ok: #238A1C; --ok-bg: #E8F6E4; --info: #155FD0; --info-bg: #E7F0FF; --warn: #9A5B00; --warn-bg: #FFF3DC; --bad: #C22A2A; --bad-bg: #FDECEC; --muted-bg: #EEF1F5;
  --r: 10px; --r-sm: 6px; --focus: 0 0 0 3px color-mix(in srgb, var(--brand) 28%, transparent);
  --shadow-float: 0 12px 32px -8px rgba(15, 30, 55, .22), 0 2px 6px rgba(15, 30, 55, .08);
  --side-w: 248px; --top-h: 60px;
  --font: "Hanken Grotesk", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}
[data-theme="dark"] {
  --ink: #E6ECF4; --ink-2: #A9B6C7; --ink-3: #7E8DA1;
  --paper: #0B1320; --surface: #121D2D; --sunken: #0E1827; --line: #22324A; --line-2: #2E4260;
  --ok: #6BD160; --ok-bg: #16301A; --info: #7DB0FF; --info-bg: #14264A; --warn: #F2B659; --warn-bg: #3A2A10; --bad: #FF8A8A; --bad-bg: #3B1A1D; --muted-bg: #1B283A;
  --side: #08111D; --shadow-float: 0 16px 40px -8px rgba(0, 0, 0, .6);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 400 14px/1.5 var(--font); color: var(--ink); background: var(--paper); font-feature-settings: "ss01"; -webkit-font-smoothing: antialiased; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }
h1, h2, h3, h4 { margin: 0; font-weight: 650; letter-spacing: -0.01em; line-height: 1.25; }
h1 { font-size: 24px; letter-spacing: -0.02em; }
h2 { font-size: 17px; }
h3 { font-size: 15px; }
p { margin: 0 0 .75em; }
hr { border: 0; border-top: 1px solid var(--line); margin: 20px 0; }
code { font: 500 12.5px/1 ui-monospace, SFMono-Regular, Menlo, monospace; background: var(--sunken); padding: 2px 5px; border-radius: 4px; }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: 4px; }
.num, .money, td.n, th.n { font-variant-numeric: tabular-nums; }
.ic { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; flex: none; vertical-align: -4px; }
.ic-sm { width: 15px; height: 15px; vertical-align: -3px; }
.ic-lg { width: 22px; height: 22px; }
.muted { color: var(--ink-3); } .small { font-size: 12.5px; } .strong { font-weight: 600; }
.ok { color: var(--ok); } .bad { color: var(--bad); } .warn { color: var(--warn); }
.nowrap { white-space: nowrap; } .right { text-align: right; } .center { text-align: center; }
.hide { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: var(--side-w) 1fr; min-height: 100vh; }
.side { background: var(--side); color: #C8D3E2; position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; z-index: 40; }
.side-brand { height: var(--top-h); display: flex; align-items: center; padding: 0 20px; border-bottom: 1px solid rgba(255,255,255,.06); }
.side-brand img { height: 30px; width: auto; }
.side-scope { margin: 14px 12px 6px; padding: 10px 12px; border-radius: var(--r-sm); background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.06); }
.side-scope b { display: block; color: #fff; font-weight: 600; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-scope span { font-size: 12px; color: #8A9AB0; }
.nav { flex: 1; overflow-y: auto; padding: 6px 10px 20px; scrollbar-width: thin; scrollbar-color: #26364d transparent; }
.nav-group { margin-top: 14px; }
.nav-group > span { display: block; padding: 0 10px 4px; font-size: 12px; color: #6F8199; font-weight: 500; }
.nav a, .nav summary { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 7px; color: #C8D3E2; font-weight: 500; cursor: pointer; list-style: none; position: relative; }
.nav summary::-webkit-details-marker { display: none; }
.nav a:hover, .nav summary:hover { background: rgba(255,255,255,.06); color: #fff; text-decoration: none; }
.nav a.on { background: rgba(22,115,255,.18); color: #fff; }
.nav a.on::before { content: ""; position: absolute; left: -10px; top: 7px; bottom: 7px; width: 4px; border-radius: 0 4px 4px 0; background: var(--brand-2); }
.nav details > div { padding-left: 18px; margin: 2px 0 4px; border-left: 1px solid rgba(255,255,255,.08); margin-left: 19px; }
.nav details > div a { padding: 5px 10px; font-size: 13.5px; }
.nav details > summary .chev { margin-left: auto; transition: transform .15s; opacity: .6; }
.nav details[open] > summary .chev { transform: rotate(90deg); }
.side-foot { padding: 12px 20px; border-top: 1px solid rgba(255,255,255,.06); font-size: 12px; color: #6F8199; }

.main { min-width: 0; display: flex; flex-direction: column; }
.top { height: var(--top-h); position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 12px; padding: 0 24px; background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.top .burger { display: none; }
.cmdk-trigger { display: flex; align-items: center; gap: 10px; min-width: 280px; padding: 7px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--paper); color: var(--ink-3); cursor: pointer; font: inherit; }
.cmdk-trigger kbd { margin-left: auto; }
kbd { font: 600 11px/1 var(--font); padding: 3px 6px; border-radius: 5px; border: 1px solid var(--line-2); border-bottom-width: 2px; color: var(--ink-2); background: var(--surface); }
.top-right { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.icon-btn { position: relative; display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 8px; border: 1px solid transparent; background: transparent; color: var(--ink-2); cursor: pointer; }
.icon-btn:hover { background: var(--sunken); color: var(--ink); }
.icon-btn .pip { position: absolute; top: 7px; right: 7px; width: 8px; height: 8px; border-radius: 50%; background: var(--bad); border: 2px solid var(--surface); }
.store-switch select { font: 500 13.5px var(--font); padding: 7px 30px 7px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='%237A889B' stroke-width='2' viewBox='0 0 24 24'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 10px center; appearance: none; color: var(--ink); max-width: 220px; }
.avatar { width: 34px; height: 34px; border-radius: 50%; display: inline-grid; place-items: center; font-weight: 650; font-size: 12.5px; color: #fff; background: linear-gradient(135deg, var(--brand), #0B4FC0); flex: none; }
.avatar.lg { width: 56px; height: 56px; font-size: 19px; }
.avatar.green { background: linear-gradient(135deg, #3DAE2B, #1F7A16); }
.user-btn { display: flex; align-items: center; gap: 8px; padding: 3px 8px 3px 3px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; color: var(--ink); font: inherit; }

.content { padding: 24px 28px 48px; max-width: 1440px; width: 100%; }
.page-head { display: flex; align-items: flex-end; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head .t { min-width: 0; }
.page-head p { margin: 4px 0 0; color: var(--ink-2); }
.page-head .actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.crumbs { font-size: 13px; color: var(--ink-3); margin-bottom: 6px; display: flex; gap: 6px; align-items: center; }
.crumbs a { color: var(--ink-3); }

/* ---------- banners ---------- */
.banner { display: flex; gap: 12px; align-items: center; padding: 12px 16px; border-radius: var(--r); border: 1px solid; margin-bottom: 18px; }
.banner.warn { background: var(--warn-bg); border-color: color-mix(in srgb, var(--warn) 30%, transparent); color: var(--warn); }
.banner.bad { background: var(--bad-bg); border-color: color-mix(in srgb, var(--bad) 30%, transparent); color: var(--bad); }
.banner.info { background: var(--info-bg); border-color: color-mix(in srgb, var(--info) 25%, transparent); color: var(--info); }
.banner .btn { margin-left: auto; }

/* ---------- panels ---------- */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); min-width: 0; }
.panel-h { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.panel-h h2 { font-size: 15px; }
.panel-h .sub { color: var(--ink-3); font-size: 12.5px; }
.panel-h .tools { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.panel-b { padding: 18px; }
.panel-b.tight { padding: 0; }
.panel-f { padding: 12px 18px; border-top: 1px solid var(--line); display: flex; gap: 8px; justify-content: flex-end; background: var(--paper); border-radius: 0 0 var(--r) var(--r); }
.grid { display: grid; gap: 18px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } .g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-main { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.g-side { grid-template-columns: minmax(0, 1fr) 340px; }
.stack > * + * { margin-top: 18px; }

/* KPI band: one continuous strip divided by rules, not a row of cards */
.band { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); margin-bottom: 18px; overflow: hidden; }
.kpi { padding: 16px 20px; border-left: 1px solid var(--line); min-width: 0; }
.kpi:first-child { border-left: 0; }
.kpi .l { color: var(--ink-2); font-size: 13px; display: flex; align-items: center; gap: 6px; }
.kpi .v { font-size: 25px; font-weight: 650; letter-spacing: -0.02em; margin-top: 4px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.kpi .d { font-size: 12.5px; margin-top: 2px; color: var(--ink-3); }
.kpi .d.up { color: var(--ok); } .kpi .d.down { color: var(--bad); }
.kpi.lead { background: linear-gradient(180deg, color-mix(in srgb, var(--brand) 6%, var(--surface)), var(--surface)); }
.kpi.lead .v { color: var(--brand); }

/* ---------- buttons ---------- */
.btn { --b: var(--surface); --c: var(--ink); --bd: var(--line-2); display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 14px; border-radius: 8px; border: 1px solid var(--bd); background: var(--b); color: var(--c); font: 550 13.5px/1 var(--font); cursor: pointer; white-space: nowrap; text-decoration: none !important; transition: background .12s, border-color .12s; }
.btn:hover { --b: var(--sunken); }
.btn.primary { --b: var(--brand); --c: #fff; --bd: var(--brand); }
.btn.primary:hover { --b: color-mix(in srgb, var(--brand) 88%, #000); }
.btn.green { --b: var(--brand-2); --c: #fff; --bd: var(--brand-2); }
.btn.green:hover { --b: color-mix(in srgb, var(--brand-2) 88%, #000); }
.btn.danger { --c: var(--bad); --bd: color-mix(in srgb, var(--bad) 35%, transparent); }
.btn.danger:hover { --b: var(--bad-bg); }
.btn.ghost { --bd: transparent; --b: transparent; }
.btn.ghost:hover { --b: var(--sunken); }
.btn.sm { height: 30px; padding: 0 10px; font-size: 13px; gap: 5px; }
.btn.lg { height: 44px; padding: 0 20px; font-size: 15px; }
.btn.block { width: 100%; justify-content: center; }
.btn[disabled], .btn.loading { opacity: .6; pointer-events: none; }
.btn.loading::after { content: ""; width: 14px; height: 14px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.btn-group { display: inline-flex; }
.btn-group .btn { border-radius: 0; margin-left: -1px; }
.btn-group .btn:first-child { border-radius: 8px 0 0 8px; margin-left: 0; }
.btn-group .btn:last-child { border-radius: 0 8px 8px 0; }
.btn-group .btn.on { --b: var(--ink); --c: var(--surface); --bd: var(--ink); position: relative; z-index: 1; }
form.inline { display: inline; }

/* ---------- forms ---------- */
.form-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 14px 16px; }
.f { grid-column: span 6; min-width: 0; }
.f.c12 { grid-column: span 12; } .f.c3 { grid-column: span 3; } .f.c4 { grid-column: span 4; } .f.c8 { grid-column: span 8; } .f.c2 { grid-column: span 2; }
.f > label, .lbl { display: block; font-weight: 550; font-size: 13px; margin-bottom: 5px; color: var(--ink); }
.f > label .req { color: var(--bad); margin-left: 2px; }
.f .help { font-size: 12.5px; color: var(--ink-3); margin-top: 4px; }
.f-section { grid-column: span 12; padding-top: 10px; margin-top: 4px; border-top: 1px solid var(--line); }
.f-section:first-child { border-top: 0; padding-top: 0; margin-top: 0; }
.f-section h3 { font-size: 14px; }
.f-section p { color: var(--ink-3); font-size: 12.5px; margin: 2px 0 0; }
input.in, select.in, textarea.in, .in { width: 100%; height: 38px; padding: 0 11px; border: 1px solid var(--line-2); border-radius: 7px; background: var(--surface); color: var(--ink); font: 400 14px var(--font); transition: border-color .12s, box-shadow .12s; }
textarea.in { height: auto; min-height: 84px; padding: 9px 11px; resize: vertical; line-height: 1.45; }
select.in { appearance: none; padding-right: 30px; background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='%237A889B' stroke-width='2' viewBox='0 0 24 24'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 11px center; }
select.in[multiple] { height: auto; min-height: 96px; padding: 6px; background-image: none; }
.in:focus { border-color: var(--brand); box-shadow: var(--focus); outline: none; }
.in::placeholder { color: var(--ink-3); }
.in-group { display: flex; } .in-group .in { border-radius: 0; } .in-group > :first-child { border-radius: 7px 0 0 7px; } .in-group > :last-child { border-radius: 0 7px 7px 0; margin-left: -1px; }
.in-prefix { display: inline-flex; align-items: center; padding: 0 10px; border: 1px solid var(--line-2); border-right: 0; border-radius: 7px 0 0 7px; background: var(--sunken); color: var(--ink-2); }
.in-prefix + .in { border-radius: 0 7px 7px 0; }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; user-select: none; font-weight: 500; }
.check input { width: 17px; height: 17px; accent-color: var(--brand); margin: 0; }
.switch { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; }
.switch input { appearance: none; width: 36px; height: 20px; border-radius: 999px; background: var(--line-2); position: relative; cursor: pointer; transition: background .15s; margin: 0; }
.switch input::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.switch input:checked { background: var(--brand-2); }
.switch input:checked::after { transform: translateX(16px); }
.color-in { display: flex; gap: 8px; align-items: center; }
.color-in input[type=color] { width: 44px; height: 38px; padding: 3px; border: 1px solid var(--line-2); border-radius: 7px; background: var(--surface); }
.err { color: var(--bad); font-size: 12.5px; margin-top: 4px; }
.form-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 20px; }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; }
table.t { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13.5px; }
table.t th { text-align: left; font-weight: 550; color: var(--ink-2); font-size: 12.5px; padding: 10px 14px; border-bottom: 1px solid var(--line); background: var(--paper); white-space: nowrap; position: sticky; top: 0; }
table.t th:first-child { border-top-left-radius: var(--r); } table.t th:last-child { border-top-right-radius: var(--r); }
table.t th.sortable { cursor: pointer; } table.t th.sortable:hover { color: var(--ink); }
table.t th .sort-ind { opacity: .5; margin-left: 3px; }
table.t td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.t tbody tr:last-child td { border-bottom: 0; }
table.t tbody tr:hover td { background: color-mix(in srgb, var(--brand) 3%, var(--surface)); }
table.t td.n, table.t th.n { text-align: right; }
table.t tfoot td { font-weight: 650; background: var(--paper); border-top: 1px solid var(--line); border-bottom: 0; }
table.t.compact td { padding: 7px 12px; } table.t.compact th { padding: 8px 12px; }
.cell-link { color: var(--ink); font-weight: 600; }
.cell-sub { font-size: 12.5px; color: var(--ink-3); margin-top: 1px; }
.row-actions { display: flex; gap: 2px; justify-content: flex-end; }
.row-actions .icon-btn { width: 30px; height: 30px; }
.toolbar { display: flex; gap: 8px; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.toolbar .search { position: relative; flex: 1 1 240px; max-width: 360px; }
.toolbar .search .ic { position: absolute; left: 10px; top: 10px; color: var(--ink-3); }
.toolbar .search input { padding-left: 34px; }
.toolbar select.in { width: auto; min-width: 140px; height: 36px; }
.toolbar input.in[type=date] { width: auto; height: 36px; }
.pager { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-top: 1px solid var(--line); font-size: 13px; color: var(--ink-3); }
.pager .btn-group { margin-left: auto; }
.skel { display: block; height: 12px; border-radius: 4px; background: linear-gradient(90deg, var(--sunken) 25%, color-mix(in srgb, var(--sunken) 50%, var(--surface)) 50%, var(--sunken) 75%); background-size: 200% 100%; animation: shimmer 1.2s infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------- badges & chips ---------- */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; border-radius: 5px; font-size: 12px; font-weight: 600; white-space: nowrap; line-height: 1.5; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .8; }
.badge-ok { background: var(--ok-bg); color: var(--ok); } .badge-info { background: var(--info-bg); color: var(--info); } .badge-warn { background: var(--warn-bg); color: var(--warn); }
.badge-bad { background: var(--bad-bg); color: var(--bad); } .badge-muted { background: var(--muted-bg); color: var(--ink-2); }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 550; background: var(--sunken); color: var(--ink-2); border: 1px solid var(--line); }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--line-2); margin-right: 6px; } .dot-ok { background: var(--ok); }
.swatch { display: inline-block; width: 14px; height: 14px; border-radius: 4px; vertical-align: -2px; margin-right: 6px; border: 1px solid var(--line); }
.stars { color: #E7A400; letter-spacing: 1px; white-space: nowrap; } .stars .off { color: var(--line-2); }

/* ---------- lists ---------- */
.list { list-style: none; margin: 0; padding: 0; }
.list > li { display: flex; align-items: center; gap: 12px; padding: 11px 18px; border-bottom: 1px solid var(--line); }
.list > li:last-child { border-bottom: 0; }
.list .grow { flex: 1; min-width: 0; }
.list .title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dl { display: grid; grid-template-columns: 150px 1fr; gap: 9px 14px; margin: 0; font-size: 13.5px; }
.dl dt { color: var(--ink-3); } .dl dd { margin: 0; font-weight: 500; min-width: 0; overflow-wrap: anywhere; }
.bar { height: 6px; border-radius: 999px; background: var(--sunken); overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--brand); border-radius: inherit; }
.bar.green > i { background: var(--brand-2); }

/* ---------- timeline ---------- */
.tl { list-style: none; margin: 0; padding: 4px 0 0 0; position: relative; }
.tl li { position: relative; padding: 0 0 16px 26px; }
.tl li::before { content: ""; position: absolute; left: 6px; top: 16px; bottom: -2px; width: 2px; background: var(--line); }
.tl li:last-child::before { display: none; }
.tl li::after { content: ""; position: absolute; left: 1px; top: 4px; width: 12px; height: 12px; border-radius: 50%; background: var(--surface); border: 2px solid var(--brand); }
.tl li.done::after { background: var(--brand-2); border-color: var(--brand-2); }
.tl .when { font-size: 12px; color: var(--ink-3); }

/* stepper for order progress */
.steps { display: flex; gap: 0; margin: 4px 0 2px; overflow-x: auto; }
.steps > div { flex: 1; min-width: 92px; text-align: center; font-size: 12px; color: var(--ink-3); position: relative; padding-top: 22px; }
.steps > div::before { content: ""; position: absolute; top: 6px; left: 0; right: 0; height: 3px; background: var(--line); }
.steps > div::after { content: ""; position: absolute; top: 1px; left: calc(50% - 6px); width: 13px; height: 13px; border-radius: 50%; background: var(--surface); border: 2px solid var(--line-2); }
.steps > div.done { color: var(--ink); } .steps > div.done::before { background: var(--brand-2); } .steps > div.done::after { background: var(--brand-2); border-color: var(--brand-2); }
.steps > div.now { color: var(--brand); font-weight: 650; } .steps > div.now::after { border-color: var(--brand); box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 18%, transparent); }

/* ---------- tabs ---------- */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; }
.tabs a, .tabs button { padding: 10px 14px; color: var(--ink-2); font-weight: 550; border: 0; background: none; font: 550 14px var(--font); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a:hover, .tabs button:hover { color: var(--ink); text-decoration: none; }
.tabs .on { color: var(--brand); border-bottom-color: var(--brand); }
.tab-pane { display: none; } .tab-pane.on { display: block; }

/* ---------- empty state ---------- */
.empty { text-align: center; padding: 48px 24px; color: var(--ink-2); }
.empty .glyph { width: 56px; height: 56px; margin: 0 auto 14px; display: grid; place-items: center; border-radius: 14px; background: color-mix(in srgb, var(--brand-2) 12%, var(--surface)); color: var(--brand-2); }
.empty .glyph .ic { width: 26px; height: 26px; }
.empty h3 { color: var(--ink); margin-bottom: 4px; }
.empty p { max-width: 380px; margin: 0 auto 14px; }

/* ---------- menus, dialogs, toasts, palette ---------- */
.dd { position: relative; display: inline-block; }
.dd-menu { position: absolute; right: 0; top: calc(100% + 6px); min-width: 220px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow-float); padding: 6px; z-index: 60; display: none; }
.dd.open .dd-menu { display: block; animation: pop .12s ease-out; }
@keyframes pop { from { opacity: 0; transform: translateY(-4px); } }
.dd-menu a, .dd-menu button { display: flex; align-items: center; gap: 9px; width: 100%; padding: 8px 10px; border-radius: 6px; color: var(--ink); border: 0; background: none; font: 500 13.5px var(--font); cursor: pointer; text-align: left; }
.dd-menu a:hover, .dd-menu button:hover { background: var(--sunken); text-decoration: none; }
.dd-menu .danger { color: var(--bad); }
.dd-menu hr { margin: 6px 0; }
.dd-head { padding: 8px 10px; }
.notif { width: 360px; padding: 0; }
.notif .list li { padding: 10px 14px; align-items: flex-start; }
.notif .list li.unread { background: color-mix(in srgb, var(--brand) 5%, var(--surface)); }

dialog.modal { border: 0; padding: 0; border-radius: 14px; width: min(560px, calc(100vw - 32px)); background: var(--surface); color: var(--ink); box-shadow: var(--shadow-float); }
dialog.modal.wide { width: min(860px, calc(100vw - 32px)); }
dialog.modal::backdrop { background: rgba(10, 20, 36, .45); backdrop-filter: blur(2px); }
dialog.modal[open] { animation: pop .15s ease-out; }
.modal-h { display: flex; align-items: center; gap: 10px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.modal-h h2 { font-size: 16px; }
.modal-h .icon-btn { margin-left: auto; }
.modal-b { padding: 20px; max-height: 70vh; overflow-y: auto; }
.modal-f { padding: 14px 20px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 8px; }

.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 100; display: flex; flex-direction: column; gap: 8px; }
.toast { display: flex; gap: 10px; align-items: flex-start; min-width: 280px; max-width: 420px; padding: 12px 14px; background: var(--ink); color: var(--surface); border-radius: 10px; box-shadow: var(--shadow-float); font-weight: 500; animation: toastin .2s ease-out; }
[data-theme="dark"] .toast { background: #E6ECF4; color: #0B1320; }
.toast .ic { margin-top: 1px; }
.toast.success .ic { color: #6BD160; } .toast.error .ic { color: #FF8A8A; } .toast.warning .ic { color: #F2B659; } .toast.info .ic { color: #7DB0FF; }
[data-theme="dark"] .toast.success .ic { color: var(--ok); }
@keyframes toastin { from { opacity: 0; transform: translateY(8px); } }

.cmdk { width: min(620px, calc(100vw - 32px)); margin-top: 12vh; }
.cmdk .search-in { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.cmdk .search-in input { flex: 1; border: 0; background: none; font: 400 16px var(--font); color: var(--ink); outline: none; }
.cmdk .results { max-height: 50vh; overflow-y: auto; padding: 6px; }
.cmdk .grp { padding: 8px 12px 4px; font-size: 12px; color: var(--ink-3); font-weight: 550; }
.cmdk .res { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 8px; color: var(--ink); }
.cmdk .res.sel, .cmdk .res:hover { background: var(--sunken); text-decoration: none; }
.cmdk .res .sub { margin-left: auto; font-size: 12.5px; color: var(--ink-3); }
.cmdk .foot { padding: 10px 16px; border-top: 1px solid var(--line); font-size: 12px; color: var(--ink-3); display: flex; gap: 14px; }

/* ---------- charts ---------- */
.chart { position: relative; height: 260px; }
.chart.sm { height: 190px; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--ink-2); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }

/* ---------- auth ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); }
.auth-art { background: var(--side); color: #fff; padding: 48px 56px; display: flex; flex-direction: column; position: relative; overflow: hidden; }
.auth-art .logo { height: 70px; width: auto; align-self: flex-start; }
.auth-art .pitch { margin-top: auto; max-width: 460px; position: relative; z-index: 1; }
.auth-art .pitch h1 { font-size: 36px; line-height: 1.1; letter-spacing: -0.03em; font-weight: 700; }
.auth-art .pitch p { color: #A9B6C7; font-size: 16px; margin-top: 14px; }
.auth-art .rings { position: absolute; right: -180px; top: -120px; width: 620px; height: 620px; opacity: .9; }
.auth-art .ledger { margin-top: 28px; display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid rgba(255,255,255,.12); padding-top: 18px; gap: 18px; }
.auth-art .ledger b { display: block; font-size: 20px; color: #fff; font-variant-numeric: tabular-nums; }
.auth-art .ledger span { color: #8A9AB0; font-size: 13px; }
.auth-form { display: grid; place-items: center; padding: 40px 24px; background: var(--surface); }
.auth-card { width: 100%; max-width: 400px; }
.auth-card h2 { font-size: 26px; letter-spacing: -0.02em; }
.auth-card .lead { color: var(--ink-2); margin: 6px 0 26px; }
.auth-card .f { margin-bottom: 14px; }
.otp { font-size: 26px; letter-spacing: .5em; text-align: center; font-variant-numeric: tabular-nums; height: 56px !important; }
.demo-logins { margin-top: 26px; border-top: 1px solid var(--line); padding-top: 16px; }
.demo-logins button { display: flex; width: 100%; justify-content: space-between; padding: 7px 10px; border: 1px solid var(--line); border-radius: 7px; background: var(--paper); margin-top: 6px; cursor: pointer; font: 500 13px var(--font); color: var(--ink); }
.demo-logins button:hover { border-color: var(--brand); }

/* ---------- POS ---------- */
.pos > * { min-height: 0; }
.pos { display: grid; grid-template-columns: minmax(0, 1fr) 420px; gap: 0; height: calc(100vh - var(--top-h)); margin: -24px -28px -48px; }
.pos-catalog { display: flex; flex-direction: column; min-width: 0; border-right: 1px solid var(--line); }
.pos-search { display: flex; gap: 8px; padding: 14px 18px; border-bottom: 1px solid var(--line); background: var(--surface); }
.pos-search .in { height: 42px; font-size: 15px; }
.pos-cats { display: flex; gap: 6px; padding: 10px 18px; overflow-x: auto; border-bottom: 1px solid var(--line); background: var(--surface); }
.pos-cats button { padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); font: 550 13px var(--font); color: var(--ink-2); cursor: pointer; white-space: nowrap; }
.pos-cats button.on { background: var(--ink); color: var(--surface); border-color: var(--ink); }
.pos-grid { flex: 1; overflow-y: auto; padding: 16px 18px; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; align-content: start; }
.tile { text-align: left; border: 1px solid var(--line); background: var(--surface); border-radius: 10px; padding: 12px; cursor: pointer; font: inherit; color: var(--ink); display: flex; flex-direction: column; gap: 6px; min-height: 96px; transition: border-color .12s; }
.tile:hover { border-color: var(--brand); }
.tile:active { transform: scale(.98); }
.tile .nm { font-weight: 600; line-height: 1.3; font-size: 13.5px; }
.tile .pr { margin-top: auto; font-weight: 650; font-variant-numeric: tabular-nums; }
.tile .meta { font-size: 12px; color: var(--ink-3); display: flex; justify-content: space-between; }
.tile.svc { border-left: 3px solid var(--brand-2); }
.tile.low .meta b { color: var(--bad); }
.pos-cart { display: flex; flex-direction: column; background: var(--surface); min-height: 0; overflow: hidden; }
.pos-cust { padding: 14px 16px; border-bottom: 1px solid var(--line); }
.pos-lines { flex: 1; overflow-y: auto; min-height: 0; }
.pos-line { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; padding: 10px 16px; border-bottom: 1px solid var(--line); }
.pos-line .nm { font-weight: 600; font-size: 13.5px; }
.pos-line .ctl { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--ink-3); flex-wrap: wrap; }
.pos-line .qty { display: inline-flex; border: 1px solid var(--line-2); border-radius: 7px; overflow: hidden; }
.pos-line .qty button { width: 26px; height: 26px; border: 0; background: var(--sunken); cursor: pointer; color: var(--ink); }
.pos-line .qty input { width: 44px; height: 26px; border: 0; text-align: center; font: 600 13px var(--font); background: var(--surface); color: var(--ink); }
.pos-line .amt { text-align: right; font-weight: 650; font-variant-numeric: tabular-nums; }
.pos-line select, .pos-line input.mini { height: 26px; font-size: 12.5px; padding: 0 6px; border: 1px solid var(--line-2); border-radius: 6px; background: var(--surface); color: var(--ink); }
.pos-totals { padding: 12px 16px; border-top: 1px solid var(--line); background: var(--paper); font-size: 13.5px; }
.pos-totals .row { display: flex; justify-content: space-between; padding: 2px 0; }
.pos-totals .grand { font-size: 22px; font-weight: 700; padding-top: 8px; margin-top: 6px; border-top: 1px dashed var(--line-2); font-variant-numeric: tabular-nums; }
.pos-pay { padding: 12px 16px; border-top: 1px solid var(--line); }
.pay-methods { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-bottom: 10px; }
.pay-methods button { padding: 8px 4px; border: 1px solid var(--line-2); border-radius: 8px; background: var(--surface); font: 600 12.5px var(--font); cursor: pointer; color: var(--ink); display: flex; flex-direction: column; align-items: center; gap: 3px; }
.pay-methods button.on { border-color: var(--brand); background: color-mix(in srgb, var(--brand) 8%, var(--surface)); color: var(--brand); }
.split-row { display: grid; grid-template-columns: 120px 1fr 1fr 28px; gap: 6px; margin-bottom: 6px; }

/* ---------- calendar (appointments) ---------- */
.cal { display: grid; border: 1px solid var(--line); border-radius: var(--r); overflow: auto; background: var(--surface); max-height: calc(100vh - 220px); }
.cal-head { position: sticky; top: 0; z-index: 2; display: contents; }
.cal-col-h { position: sticky; top: 0; background: var(--paper); border-bottom: 1px solid var(--line); border-left: 1px solid var(--line); padding: 10px; font-weight: 600; font-size: 13px; display: flex; align-items: center; gap: 8px; z-index: 2; }
.cal-time { border-right: 1px solid var(--line); font-size: 11.5px; color: var(--ink-3); text-align: right; padding-right: 6px; position: sticky; left: 0; background: var(--surface); z-index: 1; }
.cal-slot { border-left: 1px solid var(--line); border-bottom: 1px dashed color-mix(in srgb, var(--line) 70%, transparent); height: 28px; position: relative; cursor: pointer; }
.cal-slot:hover { background: color-mix(in srgb, var(--brand) 5%, transparent); }
.cal-slot.hour { border-bottom-style: solid; border-bottom-color: var(--line); }
.appt { position: absolute; left: 4px; right: 4px; z-index: 1; border-radius: 6px; padding: 4px 7px; font-size: 12px; line-height: 1.3; overflow: hidden; border-left: 3px solid var(--c, var(--brand)); background: color-mix(in srgb, var(--c, var(--brand)) 13%, var(--surface)); color: var(--ink); cursor: pointer; }
.appt b { display: block; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.appt.completed { opacity: .6; } .appt.cancelled, .appt.no_show { opacity: .45; text-decoration: line-through; }

/* ---------- kanban (leads) ---------- */
.kanban { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(250px, 1fr); gap: 14px; overflow-x: auto; padding-bottom: 8px; }
.kcol { background: var(--sunken); border-radius: var(--r); padding: 10px; min-height: 300px; }
.kcol h3 { font-size: 13.5px; display: flex; justify-content: space-between; padding: 4px 6px 10px; }
.kcard { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; margin-bottom: 8px; cursor: grab; }
.kcard.drag { opacity: .5; }
.kcol.over { outline: 2px dashed var(--brand); outline-offset: -4px; }

/* ---------- print / invoice document ---------- */
.doc { background: #fff; color: #14233A; max-width: 820px; margin: 0 auto; padding: 40px 44px; border: 1px solid var(--line); border-radius: var(--r); }
.doc-head { display: flex; justify-content: space-between; gap: 24px; padding-bottom: 20px; border-bottom: 2px solid #14233A; }
.doc-head h1 { font-size: 22px; } .doc-head .title { text-align: right; }
.doc-head .title h2 { font-size: 26px; letter-spacing: -0.02em; color: var(--brand); }
.doc-parties { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; padding: 18px 0; border-bottom: 1px solid #E1E7EE; font-size: 13px; }
.doc-parties .lbl { color: #7A889B; font-weight: 500; font-size: 12px; margin-bottom: 4px; }
.doc table.t th { background: #F5F7FA; color: #4A5A70; } .doc table.t td, .doc table.t th { border-color: #E1E7EE; }
.doc table.t tbody tr:hover td { background: none; }
.doc-sum { display: grid; grid-template-columns: 1fr 300px; gap: 24px; margin-top: 18px; }
.doc-sum .rows div { display: flex; justify-content: space-between; padding: 4px 0; font-variant-numeric: tabular-nums; }
.doc-sum .rows .grand { border-top: 2px solid #14233A; margin-top: 6px; padding-top: 8px; font-size: 18px; font-weight: 700; }
.doc-foot { margin-top: 28px; padding-top: 14px; border-top: 1px solid #E1E7EE; font-size: 12px; color: #4A5A70; display: flex; justify-content: space-between; gap: 20px; align-items: flex-end; }
.stamp { display: inline-block; border: 2px solid; border-radius: 6px; padding: 4px 12px; font-weight: 700; transform: rotate(-6deg); font-size: 14px; }
.stamp.paid { color: #238A1C; } .stamp.due { color: #C22A2A; }

/* public pages */
.pub { min-height: 100vh; background: var(--paper); padding: 28px 16px 60px; }
.pub-top { max-width: 820px; margin: 0 auto 18px; display: flex; align-items: center; gap: 12px; }
.pub-top img { height: 28px; }
.pub-card { max-width: 520px; margin: 0 auto; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 28px; }
.rate { display: flex; gap: 8px; justify-content: center; margin: 18px 0; flex-direction: row-reverse; }
.rate input { display: none; }
.rate label { font-size: 40px; color: var(--line-2); cursor: pointer; transition: transform .1s, color .1s; line-height: 1; }
.rate label:hover, .rate label:hover ~ label, .rate input:checked ~ label { color: #E7A400; }
.rate label:active { transform: scale(.9); }
.nps { display: grid; grid-template-columns: repeat(11, 1fr); gap: 4px; }
.nps label { display: block; } .nps input { display: none; }
.nps span { display: grid; place-items: center; height: 34px; border: 1px solid var(--line-2); border-radius: 6px; font-weight: 600; cursor: pointer; font-size: 13px; }
.nps input:checked + span { background: var(--brand); color: #fff; border-color: var(--brand); }

/* marketplace */
.sup-card { display: grid; grid-template-columns: 56px 1fr auto; gap: 14px; padding: 16px 18px; border-bottom: 1px solid var(--line); align-items: center; }
.sup-card:last-child { border-bottom: 0; }
.sup-logo { width: 56px; height: 56px; border-radius: 12px; display: grid; place-items: center; font-weight: 700; font-size: 18px; color: #fff; }
.sup-meta { display: flex; gap: 12px; flex-wrap: wrap; font-size: 12.5px; color: var(--ink-3); margin-top: 3px; }
.sup-meta span { display: inline-flex; gap: 4px; align-items: center; }
.cat-row { display: grid; grid-template-columns: 1fr 120px 150px; gap: 14px; padding: 14px 18px; border-bottom: 1px solid var(--line); align-items: center; }
.cat-row:last-child { border-bottom: 0; }
.qty-add { display: flex; gap: 6px; }
.qty-add .in { height: 34px; width: 70px; text-align: center; }

/* errors */
.err-page { min-height: 100vh; display: grid; place-items: center; padding: 24px; text-align: center; }
.err-page .code { font-size: 88px; font-weight: 800; letter-spacing: -0.05em; line-height: 1; color: var(--brand); }
.err-page .code span { color: var(--brand-2); }

/* ---------- responsive ---------- */
@media (max-width: 1200px) {
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .band { grid-auto-flow: row; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .band .kpi:nth-child(3n+1) { border-left: 0; } .band .kpi:nth-child(n+4) { border-top: 1px solid var(--line); }
  .pos { grid-template-columns: minmax(0, 1fr) 380px; }
}
@media (max-width: 960px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; left: 0; top: 0; bottom: 0; width: var(--side-w); transform: translateX(-100%); transition: transform .2s; }
  body.nav-open .side { transform: none; box-shadow: var(--shadow-float); }
  body.nav-open::after { content: ""; position: fixed; inset: 0; background: rgba(10,20,36,.4); z-index: 35; }
  .top .burger { display: inline-grid; }
  .cmdk-trigger { min-width: 0; } .cmdk-trigger span, .cmdk-trigger kbd { display: none; }
  .g2, .g3, .g-main, .g-side { grid-template-columns: 1fr; }
  .content { padding: 18px 16px 40px; }
  .auth { grid-template-columns: 1fr; } .auth-art { display: none; }
  .pos { grid-template-columns: 1fr; height: auto; margin: -18px -16px -40px; }
  .pos-grid { max-height: 50vh; }
  .f, .f.c3, .f.c4, .f.c8, .f.c2 { grid-column: span 12; }
  .band { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .band .kpi { border-left: 0 !important; border-top: 1px solid var(--line); } .band .kpi:nth-child(-n+2) { border-top: 0; } .band .kpi:nth-child(2n) { border-left: 1px solid var(--line) !important; }
  .dl { grid-template-columns: 1fr; gap: 2px; } .dl dd { margin-bottom: 8px; }
  .doc { padding: 22px; } .doc-parties, .doc-sum { grid-template-columns: 1fr; }
  .top { padding: 0 12px; } .store-switch select { max-width: 130px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
@media print {
  .side, .top, .no-print, .toasts, .page-head .actions { display: none !important; }
  .shell { display: block; } .content { padding: 0; max-width: none; } body { background: #fff; }
  .doc { border: 0; padding: 0; max-width: none; }
}
.pos-search .search .ic { position: absolute; left: 11px; top: 13px; color: var(--ink-3); }
.pos-search .search .in { padding-left: 36px; }

@media (max-width: 640px) {
  .top { gap: 8px; }
  .top-right .btn.primary.sm { display: none; }      /* the sidebar already has New sale */
  .store-switch select { max-width: 116px; }
  .page-head h1 { font-size: 20px; }
  .pos-grid { max-height: 44vh; }
  .pos-cart { position: sticky; bottom: 0; }
}
