/* Print Society Co — shop portal.
   Sleek system: Inter Tight display + Inter UI, cool neutrals, dark rail, one electric-violet accent. */

:root {
  --bg: #F6F6F8;
  --bg-2: #EEEEF2;
  --surface: #FFFFFF;
  --surface-2: #FAFAFB;
  --sunken: #F2F2F5;
  --ink: #09090B;
  --ink-2: #3F3F46;
  --muted: #71717A;
  --faint: #A1A1AA;
  --line: #E6E6EB;
  --line-2: #F0F0F3;
  --hover: #F5F5F7;
  --primary: #09090B;
  --on-primary: #FFFFFF;

  --accent: #6D5EF8;
  --accent-2: #8F7CFF;
  --accent-soft: #EFEDFF;
  --accent-ink: #4B3BE0;
  --focus: #6D5EF8;

  --c: #19A7CE;
  --m: #E8467C;
  --y: #F2A93B;
  --k: #09090B;
  --c-bg: #E6F6FB;
  --m-bg: #FDECF2;
  --y-bg: #FEF5E6;

  --good: #12A150;
  --good-bg: #E7F7EE;
  --warn: #C2700A;
  --warn-bg: #FEF3E2;
  --bad: #DC2D2D;
  --bad-bg: #FDECEC;
  --info: #2F6FEB;
  --info-bg: #EAF1FE;

  --rail: #0B0B0E;
  --rail-2: #131317;
  --rail-line: #1F1F25;
  --rail-text: #A1A1AA;
  --rail-ink: #FAFAFA;

  --radius: 14px;
  --radius-md: 12px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(9, 9, 11, .05);
  --shadow: 0 1px 2px rgba(9, 9, 11, .04), 0 1px 3px rgba(9, 9, 11, .03);
  --shadow-hover: 0 8px 24px -12px rgba(9, 9, 11, .18), 0 2px 6px -2px rgba(9, 9, 11, .06);
  --shadow-lg: 0 30px 80px -20px rgba(9, 9, 11, .35), 0 4px 12px rgba(9, 9, 11, .06);

  --display: 'Inter Tight', 'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --serif: var(--display);
  --sans: 'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, Consolas, monospace;

  --sidebar-w: 248px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #09090B; --bg-2: #0E0E11; --surface: #121215; --surface-2: #16161A; --sunken: #1B1B20;
    --ink: #FAFAFA; --ink-2: #D4D4D8; --muted: #A1A1AA; --faint: #6B6B75;
    --line: #26262C; --line-2: #1E1E23; --hover: #1C1C21;
    --primary: #FAFAFA; --on-primary: #09090B;
    --accent: #8B7FFF; --accent-2: #A79DFF; --accent-soft: #221E3D; --accent-ink: #B3A9FF; --focus: #8B7FFF;
    --c-bg: #0C2630; --m-bg: #331421; --y-bg: #33250E;
    --good: #3DD68C; --good-bg: #0E2A1C; --warn: #F5B25B; --warn-bg: #33240C; --bad: #FF6B6B; --bad-bg: #3A1414; --info: #6EA3FF; --info-bg: #14223D;
    --rail: #060608; --rail-2: #0F0F13; --rail-line: #1A1A20;
    --shadow: 0 1px 2px rgba(0,0,0,.4);
    --shadow-hover: 0 10px 30px -12px rgba(0,0,0,.7);
    --shadow-lg: 0 30px 80px -20px rgba(0,0,0,.8);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #09090B; --bg-2: #0E0E11; --surface: #121215; --surface-2: #16161A; --sunken: #1B1B20;
  --ink: #FAFAFA; --ink-2: #D4D4D8; --muted: #A1A1AA; --faint: #6B6B75;
  --line: #26262C; --line-2: #1E1E23; --hover: #1C1C21;
  --primary: #FAFAFA; --on-primary: #09090B;
  --accent: #8B7FFF; --accent-2: #A79DFF; --accent-soft: #221E3D; --accent-ink: #B3A9FF; --focus: #8B7FFF;
  --c-bg: #0C2630; --m-bg: #331421; --y-bg: #33250E;
  --good: #3DD68C; --good-bg: #0E2A1C; --warn: #F5B25B; --warn-bg: #33240C; --bad: #FF6B6B; --bad-bg: #3A1414; --info: #6EA3FF; --info-bg: #14223D;
  --rail: #060608; --rail-2: #0F0F13; --rail-line: #1A1A20;
  --shadow: 0 1px 2px rgba(0,0,0,.4);
  --shadow-hover: 0 10px 30px -12px rgba(0,0,0,.7);
  --shadow-lg: 0 30px 80px -20px rgba(0,0,0,.8);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 14px/1.5 var(--sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: 'cv11', 'ss01', 'ss03', 'calt';
  letter-spacing: -.006em;
}
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
a { color: inherit; }
img { max-width: 100%; }
::selection { background: color-mix(in srgb, var(--accent) 25%, transparent); }
svg.i { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.num, .money { font-variant-numeric: tabular-nums; }
.mono { font-family: var(--mono); font-size: .88em; letter-spacing: -.01em; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.serif { font-family: var(--display); font-weight: 650; letter-spacing: -.035em; font-variant-numeric: tabular-nums; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.grow { flex: 1; min-width: 0; }
.row { display: flex; align-items: center; gap: 10px; }
.row-wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.hidden { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
a:not(.btn):not(.sb-link):not(.kpi):not(.tile) { text-decoration-color: color-mix(in srgb, currentColor 30%, transparent); text-underline-offset: 3px; }

.logo-img { display: block; height: 28px; width: auto; max-width: 100%; object-fit: contain; }
:root[data-theme="dark"] .logo-img, :root[data-theme="dark"] .boot-logo { filter: invert(1); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .logo-img, :root:not([data-theme="light"]) .boot-logo { filter: invert(1); } }

.boot { min-height: 100vh; display: grid; place-items: center; }
.boot-logo { width: 160px; opacity: .9; animation: pulse 1.2s var(--ease) infinite alternate; }
@keyframes pulse { from { opacity: .3; } to { opacity: .9; } }

/* ---------------- Shell ---------------- */
.shell { display: grid; grid-template-columns: var(--sidebar-w) 1fr; min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; z-index: 30;
  background: linear-gradient(180deg, var(--rail) 0%, var(--rail-2) 100%); color: var(--rail-text);
  border-right: 1px solid var(--rail-line);
}
.sidebar .logo-img { filter: invert(1) !important; height: 26px; }
.sb-head { display: flex; align-items: center; justify-content: space-between; padding: 20px 18px 14px; }
.sb-head .cmyk { display: none; }
.sb-search {
  margin: 2px 12px 8px; display: flex; align-items: center; gap: 9px; padding: 8px 10px; border-radius: 10px;
  background: rgba(255,255,255,.045); border: 1px solid rgba(255,255,255,.07); color: var(--rail-text); cursor: pointer; text-align: left; width: calc(100% - 24px);
  transition: background .15s, border-color .15s; font-size: 13px;
}
.sb-search:hover { background: rgba(255,255,255,.07); color: var(--rail-ink); }
.sb-search .kbd { margin-left: auto; background: rgba(255,255,255,.06); border-color: rgba(255,255,255,.1); color: var(--rail-text); }
.kbd { font: 500 11px var(--mono); padding: 1px 6px; border-radius: 6px; border: 1px solid var(--line); background: var(--surface-2); color: var(--muted); white-space: nowrap; }
.sb-nav { flex: 1; overflow-y: auto; padding: 4px 10px 12px; scrollbar-width: none; }
.sb-group { margin-top: 18px; }
.sb-label { font: 500 11.5px var(--sans); color: #5F5F69; padding: 0 10px 6px; }
.sb-link {
  display: flex; align-items: center; gap: 11px; padding: 7px 10px; margin: 1px 0; border-radius: 9px; text-decoration: none;
  color: var(--rail-text); font-weight: 500; font-size: 13.5px; position: relative; transition: background .15s, color .15s;
}
.sb-link svg.i { width: 17px; height: 17px; opacity: .85; }
.sb-link:hover { background: rgba(255,255,255,.05); color: var(--rail-ink); }
.sb-link.active { background: rgba(255,255,255,.08); color: var(--rail-ink); }
.sb-link.active::before { content: ''; position: absolute; left: -10px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--accent-2); }
.sb-link.active svg.i { opacity: 1; color: var(--accent-2); }
.sb-link .badge { margin-left: auto; background: rgba(255,255,255,.08); color: var(--rail-ink); }
.sb-link .badge.alert { background: rgba(232,70,124,.2); color: #FF8FB3; }
.badge { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 6px; display: inline-grid; place-items: center; font: 600 11px var(--sans); background: var(--sunken); color: var(--ink-2); }
.badge.alert { background: var(--m-bg); color: var(--m); }
.sb-foot { border-top: 1px solid var(--rail-line); padding: 10px; }
.me { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 10px; cursor: pointer; width: 100%; border: 0; background: none; text-align: left; color: var(--rail-text); }
.me:hover { background: rgba(255,255,255,.05); }
.me .who { min-width: 0; flex: 1; }
.me .who b { display: block; font-weight: 600; font-size: 13px; color: var(--rail-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me .who span { display: block; font-size: 12px; color: var(--rail-text); text-transform: capitalize; }

.avatar {
  width: 30px; height: 30px; border-radius: 50%; display: inline-grid; place-items: center; flex: none;
  font: 600 11.5px var(--sans); color: #fff; background: #3F3F46; letter-spacing: .01em;
}
.avatar.sm { width: 24px; height: 24px; font-size: 10px; }
.avatar.lg { width: 44px; height: 44px; font-size: 15px; }
.avatar[data-tone="c"] { background: linear-gradient(135deg, #19A7CE, #2F6FEB); }
.avatar[data-tone="m"] { background: linear-gradient(135deg, #E8467C, #B03BD6); }
.avatar[data-tone="y"] { background: linear-gradient(135deg, #F2A93B, #E8673A); }
.avatar[data-tone="k"] { background: linear-gradient(135deg, #8F7CFF, #4B3BE0); }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 20; height: 58px; display: flex; align-items: center; gap: 10px; padding: 0 28px;
  background: color-mix(in srgb, var(--bg) 80%, transparent); backdrop-filter: saturate(1.6) blur(16px); -webkit-backdrop-filter: saturate(1.6) blur(16px);
  border-bottom: 1px solid var(--line-2);
}
.crumbs { display: flex; align-items: center; gap: 8px; color: var(--muted); font-weight: 500; min-width: 0; font-size: 13.5px; }
.crumbs b { color: var(--ink); font-weight: 600; }
.crumbs svg.i { width: 14px; height: 14px; color: var(--faint); }
.topbar .spacer { flex: 1; }
.btn.menu-btn { display: none; }
.sync-pill { display: inline-flex; align-items: center; gap: 7px; height: 30px; padding: 0 11px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); font-size: 12.5px; color: var(--muted); cursor: pointer; font-weight: 500; }
.sync-pill .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--good); box-shadow: 0 0 0 3px var(--good-bg); }
.sync-pill.err .dot { background: var(--bad); box-shadow: 0 0 0 3px var(--bad-bg); }
.sync-pill.off .dot { background: var(--faint); box-shadow: none; }

.page { width: 100%; max-width: 1320px; margin: 0 auto; padding: 28px 32px 80px; animation: rise .4s var(--ease) both; }
@keyframes rise { from { opacity: 0; transform: translateY(4px); } }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.eyebrow { font: 500 12.5px var(--sans); color: var(--muted); display: flex; align-items: center; gap: 8px; }
.h1 { font: 650 30px/1.15 var(--display); letter-spacing: -.035em; margin: 4px 0 4px; }
.h1 em { font-style: normal; color: var(--faint); }
.sub { color: var(--muted); margin: 0; font-size: 14px; }
.h2 { font: 650 18px/1.25 var(--display); letter-spacing: -.02em; margin: 0; }
.h3 { font: 600 14px var(--sans); margin: 0; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

.cmyk { display: inline-flex; gap: 3px; }
.cmyk i { width: 6px; height: 6px; border-radius: 50%; display: block; }
.cmyk i:nth-child(1) { background: var(--c); } .cmyk i:nth-child(2) { background: var(--m); }
.cmyk i:nth-child(3) { background: var(--y); } .cmyk i:nth-child(4) { background: var(--accent); }

/* ---------------- Buttons ---------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 36px; padding: 0 14px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink); font-weight: 550; font-size: 13.5px; cursor: pointer;
  text-decoration: none; white-space: nowrap; transition: transform .12s var(--ease), background .15s, border-color .15s, box-shadow .15s;
  box-shadow: var(--shadow-sm);
}
.btn svg.i { width: 16px; height: 16px; }
.btn:hover { border-color: color-mix(in srgb, var(--ink) 18%, var(--line)); background: var(--surface-2); }
.btn:active { transform: scale(.98); }
.btn[disabled] { opacity: .5; pointer-events: none; }
.btn.primary { background: var(--primary); color: var(--on-primary); border-color: var(--primary); box-shadow: 0 1px 2px rgba(9,9,11,.2), inset 0 1px 0 rgba(255,255,255,.12); }
.btn.primary:hover { background: color-mix(in srgb, var(--primary) 86%, var(--accent)); border-color: color-mix(in srgb, var(--primary) 86%, var(--accent)); }
.btn.accent { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn.quiet { background: transparent; border-color: transparent; box-shadow: none; color: var(--ink-2); }
.btn.quiet:hover { background: var(--hover); }
.btn.danger { color: var(--bad); }
.btn.danger.solid { background: var(--bad); color: #fff; border-color: var(--bad); }
.btn.sm { height: 30px; padding: 0 10px; font-size: 12.5px; gap: 6px; border-radius: 8px; }
.btn.sm svg.i { width: 14px; height: 14px; }
.btn.icon { width: 36px; padding: 0; }
.btn.icon.sm { width: 30px; }
.btn.block { width: 100%; }
.btn .spin { width: 14px; height: 14px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.link { background: none; border: 0; padding: 0; color: var(--accent-ink); font-weight: 550; cursor: pointer; text-decoration: none; font-size: 13px; }
.link:hover { text-decoration: underline; text-underline-offset: 3px; }
.link.muted { color: var(--muted); font-weight: 500; }
.link.muted:hover { color: var(--ink); }

/* ---------------- Cards ---------------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); min-width: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--line-2); min-height: 52px; }
.card-head .title { display: flex; align-items: center; gap: 9px; font: 600 14px var(--sans); letter-spacing: -.01em; }
.card-head .title svg.i { width: 16px; height: 16px; color: var(--muted); }
.card-body { padding: 16px 18px; }
.card-foot { padding: 12px 18px; border-top: 1px solid var(--line-2); display: flex; justify-content: flex-end; gap: 8px; }
.grid { display: grid; gap: 16px; }
.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, 1.75fr) minmax(0, 1fr); }
.mt { margin-top: 16px; }
.mt-lg { margin-top: 24px; }

.kpi { padding: 16px 18px; position: relative; overflow: hidden; display: flex; flex-direction: column; gap: 2px; text-decoration: none; color: inherit; transition: box-shadow .2s, border-color .2s; }
a.kpi:hover { box-shadow: var(--shadow-hover); border-color: color-mix(in srgb, var(--ink) 12%, var(--line)); }
.kpi .label { font: 500 13px var(--sans); color: var(--muted); display: flex; align-items: center; gap: 7px; }
.kpi .label .tick { width: 8px; height: 8px; border-radius: 3px; }
.kpi .value { font: 650 28px/1.15 var(--display); letter-spacing: -.035em; margin-top: 12px; font-variant-numeric: tabular-nums; }
.kpi .foot { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted); margin-top: 6px; min-height: 22px; }
.kpi svg.spark { position: absolute; right: 18px; top: 14px; width: 84px; height: 24px; overflow: visible; }
.kpi .value { padding-right: 4px; }
.delta { display: inline-flex; align-items: center; gap: 2px; font-weight: 600; font-size: 12px; padding: 1px 6px; border-radius: 6px; font-variant-numeric: tabular-nums; }
.delta.up { color: var(--good); background: var(--good-bg); }
.delta.down { color: var(--bad); background: var(--bad-bg); }
.delta.flat { color: var(--muted); background: var(--sunken); }

.stat-strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 16px; }
.stat-strip > div { padding: 14px 18px; border-left: 1px solid var(--line-2); min-width: 0; }
.stat-strip > div:first-child { border-left: 0; }
.stat-strip .label { font: 500 12.5px var(--sans); color: var(--muted); }
.stat-strip .value { font: 650 22px/1.25 var(--display); letter-spacing: -.03em; margin-top: 4px; font-variant-numeric: tabular-nums; }
.stat-strip .value small { font: 500 12.5px var(--sans); color: var(--muted); margin-left: 6px; letter-spacing: 0; }

/* ---------------- Pills / chips ---------------- */
.pill { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 8px; border-radius: 6px; font: 550 12px var(--sans); white-space: nowrap; background: var(--sunken); color: var(--ink-2); border: 1px solid transparent; }
.pill::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.plain::before { display: none; }
.pill.good { background: var(--good-bg); color: var(--good); }
.pill.warn { background: var(--warn-bg); color: var(--warn); }
.pill.bad { background: var(--bad-bg); color: var(--bad); }
.pill.info { background: var(--info-bg); color: var(--info); }
.pill.c { background: var(--c-bg); color: var(--c); }
.pill.m { background: var(--m-bg); color: var(--m); }
.pill.y { background: var(--y-bg); color: var(--warn); }
.pill.k { background: var(--primary); color: var(--on-primary); }
.pill.accent { background: var(--accent-soft); color: var(--accent-ink); }
.pill.ghost { background: transparent; border-color: var(--line); color: var(--muted); }
select.pill-select { appearance: none; border: 0; cursor: pointer; padding-right: 22px; height: 24px; background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%); background-position: calc(100% - 11px) 10px, calc(100% - 7px) 10px; background-size: 4px 4px; background-repeat: no-repeat; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: 9px; border: 1px solid var(--line); background: var(--surface); font-weight: 500; font-size: 13px; cursor: pointer; color: var(--ink-2); white-space: nowrap; transition: background .15s, border-color .15s; }
.chip:hover { border-color: color-mix(in srgb, var(--ink) 18%, var(--line)); }
.chip.on { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 40%, transparent); color: var(--accent-ink); }
.chip .n { font-size: 11.5px; color: var(--muted); font-weight: 600; }
.src { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--muted); }
.src.shopify { color: #5A9B3A; }

.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 16px; overflow-x: auto; scrollbar-width: none; }
.tabs button { background: none; border: 0; padding: 10px 12px; font-weight: 500; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; display: inline-flex; gap: 7px; align-items: center; font-size: 13.5px; }
.tabs button:hover { color: var(--ink); }
.tabs button.on { color: var(--ink); border-bottom-color: var(--accent); font-weight: 600; }
.tabs .n { font-size: 11.5px; padding: 0 6px; border-radius: 6px; background: var(--sunken); color: var(--muted); font-weight: 600; }
.tabs button.on .n { background: var(--accent-soft); color: var(--accent-ink); }
.seg { display: inline-flex; padding: 3px; border-radius: 10px; background: var(--sunken); border: 1px solid var(--line-2); gap: 2px; }
.seg button { border: 0; background: transparent; padding: 5px 11px; border-radius: 7px; font-weight: 550; font-size: 12.5px; color: var(--muted); cursor: pointer; display: inline-flex; align-items: center; gap: 6px; transition: color .15s, background .15s; }
.seg button:hover { color: var(--ink); }
.seg button.on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(9,9,11,.08), 0 0 0 1px var(--line-2); }

.toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.search-box { position: relative; flex: 1; min-width: 200px; max-width: 360px; }
.search-box svg.i { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--faint); width: 16px; height: 16px; }
.search-box input { padding-left: 34px; height: 36px; }

/* ---------------- Forms ---------------- */
.input, .select, .textarea {
  width: 100%; height: 38px; padding: 0 12px; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--surface);
  color: var(--ink); transition: border-color .15s, box-shadow .15s; outline: none; font-size: 13.5px;
}
.textarea { height: auto; min-height: 90px; padding: 10px 12px; resize: vertical; line-height: 1.5; }
.input::placeholder, .textarea::placeholder { color: var(--faint); }
.input:hover, .select:hover, .textarea:hover { border-color: color-mix(in srgb, var(--ink) 16%, var(--line)); }
.input:focus, .select:focus, .textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
.select { appearance: none; padding-right: 32px; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 16px) 16px, calc(100% - 11px) 16px; background-size: 5px 5px; background-repeat: no-repeat; }
.input.sm, .select.sm { height: 32px; font-size: 13px; border-radius: 8px; }
.select.sm { background-position: calc(100% - 15px) 13px, calc(100% - 10px) 13px; }
.form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field.full { grid-column: 1 / -1; }
.field > label, .flabel { font-weight: 550; font-size: 12.5px; color: var(--ink-2); display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.field .hint { font-size: 12px; color: var(--muted); }
.affix { position: relative; }
.affix .pre, .affix .post { position: absolute; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 13.5px; pointer-events: none; }
.affix .pre { left: 12px; } .affix .post { right: 12px; }
.affix .pre + .input { padding-left: 24px; }
.affix .input.has-post { padding-right: 30px; }
.check { display: inline-flex; align-items: center; gap: 9px; cursor: pointer; font-weight: 500; }
.check input, input[type=checkbox] { accent-color: var(--accent); }
.check input { width: 16px; height: 16px; }
.switch { position: relative; width: 36px; height: 20px; flex: none; }
.switch input { opacity: 0; width: 100%; height: 100%; position: absolute; margin: 0; cursor: pointer; z-index: 1; }
.switch span { position: absolute; inset: 0; border-radius: 999px; background: var(--line); transition: background .2s; }
.switch span::after { content: ''; position: absolute; left: 2px; top: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.25); transition: transform .2s var(--ease); }
.switch input:checked + span { background: var(--accent); }
.switch input:checked + span::after { transform: translateX(16px); }
.form-error { color: var(--bad); background: var(--bad-bg); padding: 9px 12px; border-radius: 10px; font-weight: 500; font-size: 13px; }
.note { padding: 12px 14px; border-radius: 12px; background: var(--sunken); color: var(--ink-2); font-size: 13px; display: flex; gap: 10px; align-items: flex-start; }
.note.warn { background: var(--warn-bg); color: var(--warn); }
.note.good { background: var(--good-bg); color: var(--good); }
.note.bad { background: var(--bad-bg); color: var(--bad); }
.note svg.i { margin-top: 1px; width: 16px; height: 16px; }

.combo { position: relative; }
.combo-list { position: absolute; left: 0; right: 0; top: calc(100% + 4px); background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-lg); z-index: 60; max-height: 280px; overflow-y: auto; padding: 4px; }
.combo-opt { padding: 8px 10px; border-radius: 8px; cursor: pointer; display: flex; justify-content: space-between; gap: 10px; }
.combo-opt small { color: var(--muted); }
.combo-opt.hl, .combo-opt:hover { background: var(--hover); }
.combo-opt.create { color: var(--accent-ink); font-weight: 600; border-top: 1px solid var(--line-2); margin-top: 4px; }
.combo-picked { display: flex; align-items: center; gap: 8px; height: 38px; padding: 0 6px 0 10px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); }
.combo-picked b { font-weight: 550; flex: 1; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }

.li-table { width: 100%; border-collapse: collapse; }
.li-table th { font: 500 12px var(--sans); color: var(--muted); text-align: left; padding: 0 6px 8px; }
.li-table td { padding: 4px 6px; vertical-align: top; }
.li-table .input { height: 36px; }
.li-table td.amt { padding-top: 13px; text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; font-weight: 550; }
.totals { margin-left: auto; width: min(320px, 100%); display: grid; gap: 6px; padding-top: 12px; }
.totals div { display: flex; justify-content: space-between; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.totals .grand { border-top: 1px solid var(--line); padding-top: 10px; margin-top: 4px; font: 650 20px var(--display); letter-spacing: -.03em; color: var(--ink); }

/* ---------------- Tables ---------------- */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: separate; border-spacing: 0; }
.table th { position: sticky; top: 0; background: var(--surface-2); font: 500 12px var(--sans); color: var(--muted); text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table th:first-child { border-top-left-radius: var(--radius); }
.table th:last-child { border-top-right-radius: var(--radius); }
.table td { padding: 11px 14px; border-bottom: 1px solid var(--line-2); vertical-align: middle; font-size: 13.5px; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background .12s; }
.table tbody tr.click { cursor: pointer; }
.table tbody tr.click:hover { background: var(--hover); }
.table td.right, .table th.right { text-align: right; }
.table .primary-cell b { font-weight: 550; display: block; }
.table .primary-cell small { color: var(--muted); font-size: 12.5px; }
.table .chk { width: 36px; padding-right: 0; }
.table-foot { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; color: var(--muted); font-size: 12.5px; border-top: 1px solid var(--line-2); }

.qtybar { display: flex; align-items: center; gap: 9px; min-width: 120px; }
.qtybar .bar { flex: 1; height: 5px; border-radius: 999px; background: var(--sunken); overflow: hidden; min-width: 50px; }
.qtybar .bar i { display: block; height: 100%; border-radius: 999px; background: var(--good); }
.qtybar.low .bar i { background: var(--warn); }
.qtybar.out .bar i { background: var(--bad); }
.qtybar b { font-variant-numeric: tabular-nums; font-weight: 600; min-width: 42px; text-align: right; }

.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; align-items: center; gap: 12px; padding: 10px 18px; border-bottom: 1px solid var(--line-2); }
.list li:last-child { border-bottom: 0; }
.list li.click { cursor: pointer; transition: background .12s; }
.list li.click:hover { background: var(--hover); }
.list .meta { min-width: 0; flex: 1; }
.list .meta b { display: block; font-weight: 550; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 13.5px; }
.list .meta small { display: block; color: var(--muted); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dot { width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--faint); }
.dot.good { background: var(--good); } .dot.warn { background: var(--warn); } .dot.bad { background: var(--bad); } .dot.c { background: var(--c); } .dot.m { background: var(--m); } .dot.y { background: var(--y); } .dot.accent { background: var(--accent); }

.empty { text-align: center; padding: 40px 20px; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 8px; }
.empty .ico { width: 44px; height: 44px; border-radius: 12px; background: var(--sunken); display: grid; place-items: center; color: var(--ink-2); margin-bottom: 4px; border: 1px solid var(--line-2); }
.empty .ico svg.i { width: 20px; height: 20px; }
.empty b { color: var(--ink); font-weight: 600; font-size: 14.5px; }
.empty p { margin: 0 0 8px; max-width: 380px; font-size: 13.5px; }
.empty.sm { padding: 24px 16px; }

.skel { background: linear-gradient(90deg, var(--sunken) 0%, var(--hover) 50%, var(--sunken) 100%); background-size: 200% 100%; animation: shimmer 1.2s linear infinite; border-radius: 8px; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------------- Overlays ---------------- */
.scrim { position: fixed; inset: 0; background: rgba(9, 9, 11, .42); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); z-index: 80; animation: fade .2s var(--ease); }
@keyframes fade { from { opacity: 0; } }
.modal {
  position: fixed; left: 50%; top: 9vh; transform: translateX(-50%); width: min(540px, calc(100vw - 32px)); max-height: 84vh; display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow-lg); z-index: 81; animation: pop .22s var(--ease);
}
.modal.wide { width: min(800px, calc(100vw - 32px)); }
@keyframes pop { from { opacity: 0; transform: translate(-50%, 8px) scale(.985); } }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 20px 22px 4px; }
.modal-head h2 { font: 650 19px/1.25 var(--display); margin: 0; letter-spacing: -.025em; }
.modal-head p { margin: 4px 0 0; color: var(--muted); font-size: 13.5px; }
.modal-body { padding: 14px 22px 8px; overflow-y: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 22px 18px; }
.drawer {
  position: fixed; top: 8px; right: 8px; bottom: 8px; width: min(560px, calc(100vw - 16px)); background: var(--surface); border: 1px solid var(--line); z-index: 81; border-radius: 16px;
  box-shadow: var(--shadow-lg); display: flex; flex-direction: column; animation: slide .3s var(--ease); overflow: hidden;
}
.drawer.wide { width: min(760px, calc(100vw - 16px)); }
@keyframes slide { from { transform: translateX(24px); opacity: 0; } }
.drawer-head { padding: 18px 22px 14px; border-bottom: 1px solid var(--line-2); display: flex; gap: 12px; align-items: flex-start; }
.drawer-head .t { flex: 1; min-width: 0; }
.drawer-head h2 { font: 650 22px/1.2 var(--display); margin: 2px 0 0; letter-spacing: -.03em; overflow-wrap: anywhere; }
.drawer-body { flex: 1; overflow-y: auto; padding: 18px 22px 30px; }
.drawer-foot { padding: 12px 22px; border-top: 1px solid var(--line-2); display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; background: var(--surface-2); }
.section { margin-top: 22px; }
.section:first-child { margin-top: 0; }
.section-title { font: 600 12px var(--sans); color: var(--muted); margin: 0 0 10px; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.kv { display: grid; grid-template-columns: 130px 1fr; gap: 8px 12px; font-size: 13.5px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }

.menu { position: fixed; z-index: 90; min-width: 200px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-lg); padding: 5px; animation: pop2 .14s var(--ease); }
@keyframes pop2 { from { opacity: 0; transform: translateY(-4px); } }
.menu button, .menu a { display: flex; width: 100%; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 8px; border: 0; background: none; cursor: pointer; text-align: left; text-decoration: none; font-weight: 500; color: var(--ink-2); font-size: 13.5px; }
.menu button svg.i { width: 16px; height: 16px; color: var(--muted); }
.menu button:hover, .menu a:hover { background: var(--hover); color: var(--ink); }
.menu hr { border: 0; border-top: 1px solid var(--line-2); margin: 5px 4px; }
.menu .danger, .menu .danger svg.i { color: var(--bad); }

#toasts { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 100; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { pointer-events: auto; display: flex; align-items: center; gap: 10px; padding: 10px 14px 10px 12px; border-radius: 12px; background: #18181B; color: #FAFAFA; box-shadow: var(--shadow-lg); font-weight: 500; font-size: 13.5px; animation: toastIn .3s var(--ease); max-width: min(520px, calc(100vw - 32px)); border: 1px solid rgba(255,255,255,.08); }
.toast svg.i { color: #3DD68C; }
.toast.bad { background: #2A1010; }
.toast.bad svg.i { color: #FF6B6B; }
.toast.out { animation: toastOut .25s var(--ease) forwards; }
.toast button { margin-left: 6px; background: none; border: 0; color: inherit; font-weight: 700; cursor: pointer; text-decoration: underline; }
@keyframes toastIn { from { opacity: 0; transform: translateY(10px) scale(.98); } }
@keyframes toastOut { to { opacity: 0; transform: translateY(8px); } }

.palette { position: fixed; left: 50%; top: 12vh; transform: translateX(-50%); width: min(620px, calc(100vw - 28px)); background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow-lg); z-index: 91; overflow: hidden; animation: pop .2s var(--ease); }
.palette .pin { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line-2); }
.palette .pin input { border: 0; outline: 0; background: none; flex: 1; font-size: 15px; }
.palette .pres { max-height: 54vh; overflow-y: auto; padding: 6px; }
.palette .pgroup { font: 500 12px var(--sans); color: var(--faint); padding: 10px 10px 4px; }
.palette .popt { display: flex; align-items: center; gap: 11px; padding: 8px 10px; border-radius: 10px; cursor: pointer; }
.palette .popt.hl { background: var(--hover); }
.palette .popt .ic { width: 30px; height: 30px; border-radius: 8px; background: var(--sunken); display: grid; place-items: center; color: var(--ink-2); flex: none; border: 1px solid var(--line-2); }
.palette .popt.hl .ic { background: var(--accent-soft); color: var(--accent-ink); border-color: transparent; }
.palette .popt .ic svg.i { width: 16px; height: 16px; }
.palette .popt b { font-weight: 550; }
.palette .popt small { color: var(--muted); display: block; font-size: 12px; }
.palette .popt .go { margin-left: auto; color: var(--faint); }

.timeline { list-style: none; padding: 0; margin: 0; position: relative; }
.timeline::before { content: ''; position: absolute; left: 7px; top: 6px; bottom: 6px; width: 1px; background: var(--line); }
.timeline li { position: relative; padding: 0 0 14px 26px; font-size: 13.5px; }
.timeline li::before { content: ''; position: absolute; left: 3px; top: 6px; width: 9px; height: 9px; border-radius: 50%; background: var(--surface); border: 2px solid var(--faint); }
.timeline li.note::before { border-color: var(--c); }
.timeline li.stage::before { border-color: var(--accent); }
.timeline li small { display: block; color: var(--muted); font-size: 12px; }
.timeline li .body { white-space: pre-wrap; overflow-wrap: anywhere; }

.stepper { display: flex; gap: 4px; }
.stepper button { flex: 1; border: 0; background: var(--sunken); color: var(--muted); padding: 8px 4px; border-radius: 8px; font-weight: 550; font-size: 12px; cursor: pointer; transition: background .15s, color .15s; }
.stepper button:hover { color: var(--ink); }
.stepper button.done { background: var(--accent-soft); color: var(--accent-ink); }
.stepper button.on { background: var(--accent); color: #fff; }

.board { display: grid; grid-template-columns: repeat(5, minmax(230px, 1fr)); gap: 12px; overflow-x: auto; padding-bottom: 8px; align-items: start; }
.col { background: var(--bg-2); border: 1px solid var(--line-2); border-radius: var(--radius); display: flex; flex-direction: column; min-height: 200px; max-height: calc(100vh - 240px); }
.col-head { padding: 12px 14px 8px; display: flex; align-items: center; gap: 8px; }
.col-head .name { font-weight: 600; font-size: 13.5px; }
.col-head .sum { margin-left: auto; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.col-body { padding: 4px 8px 10px; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; flex: 1; min-height: 60px; }
.col.drop .col-body { background: color-mix(in srgb, var(--accent) 7%, transparent); border-radius: 12px; }
.lead-card { background: var(--surface); border: 1px solid var(--line); border-radius: 11px; padding: 11px 12px; cursor: grab; box-shadow: var(--shadow-sm); transition: box-shadow .15s, border-color .15s; }
.lead-card:hover { box-shadow: var(--shadow-hover); border-color: color-mix(in srgb, var(--ink) 12%, var(--line)); }
.lead-card.dragging { opacity: .45; }
.lead-card b { display: block; font-weight: 600; font-size: 13.5px; }
.lead-card .co { color: var(--muted); font-size: 12.5px; }
.lead-card .lc-foot { display: flex; align-items: center; gap: 6px; margin-top: 9px; }
.lead-card .val { font-weight: 600; font-variant-numeric: tabular-nums; margin-right: auto; font-size: 13px; }
.due { font-size: 11.5px; font-weight: 550; padding: 2px 7px; border-radius: 6px; background: var(--sunken); color: var(--muted); display: inline-flex; gap: 4px; align-items: center; white-space: nowrap; }
.due svg.i { width: 12px; height: 12px; }
.due.today { background: var(--y-bg); color: var(--warn); }
.due.over { background: var(--bad-bg); color: var(--bad); }

/* Charts */
.chart { width: 100%; display: block; overflow: visible; }
.chart .gridline { stroke: var(--line-2); stroke-width: 1; }
.chart .axis { fill: var(--faint); font: 500 11px var(--sans); }
.chart .bar { fill: var(--ink); transition: opacity .15s; }
.chart .bar.zero { fill: var(--line); }
.chart .bar:hover { opacity: .8; }
.chart-tip { position: fixed; pointer-events: none; z-index: 95; background: #18181B; color: #FAFAFA; padding: 8px 11px; border-radius: 10px; font-size: 12px; box-shadow: var(--shadow-lg); white-space: nowrap; transform: translate(-50%, calc(-100% - 12px)); border: 1px solid rgba(255,255,255,.08); line-height: 1.5; }
.chart-tip b { display: block; font-size: 13.5px; font-weight: 600; }
.chart-tip .tl { display: flex; align-items: center; gap: 7px; }
.chart-tip .tl span:last-child { margin-left: auto; padding-left: 14px; font-variant-numeric: tabular-nums; font-weight: 600; }
.chart-tip .sw { width: 8px; height: 8px; border-radius: 2px; display: inline-block; }
.hbar { display: grid; grid-template-columns: minmax(90px, 160px) 1fr auto; align-items: center; gap: 12px; padding: 7px 0; font-size: 13px; }
.hbar .track { height: 8px; border-radius: 999px; background: var(--sunken); overflow: hidden; }
.hbar .track i { display: block; height: 100%; border-radius: 999px; background: var(--accent); }
.hbar .lbl { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar .v { font-variant-numeric: tabular-nums; font-weight: 600; }
.legend { display: flex; gap: 14px; font-size: 12px; color: var(--muted); align-items: center; flex-wrap: wrap; }
.legend i { display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.legend i.dash { width: 14px; height: 0; border-top: 2px dashed var(--faint); border-radius: 0; vertical-align: 3px; }
.stagebar { display: flex; height: 8px; border-radius: 999px; overflow: hidden; background: var(--sunken); gap: 2px; }
.stagebar i { display: block; height: 100%; }

/* Dashboard */
.dash-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.dash-head .h1 { font-size: 28px; }
.setup-strip { display: flex; align-items: center; gap: 16px; padding: 12px 14px 12px 16px; margin-bottom: 16px; border-radius: 14px; border: 1px solid color-mix(in srgb, var(--accent) 25%, var(--line)); background: linear-gradient(90deg, var(--accent-soft), var(--surface) 70%); }
.setup-strip .prog { width: 110px; height: 6px; border-radius: 999px; background: color-mix(in srgb, var(--accent) 15%, var(--sunken)); overflow: hidden; flex: none; }
.setup-strip .prog i { display: block; height: 100%; background: var(--accent); border-radius: 999px; }
.setup-strip .steps { display: flex; gap: 6px; flex-wrap: wrap; flex: 1; min-width: 0; }
.setup-strip .st { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; border-radius: 8px; font-size: 12.5px; font-weight: 550; text-decoration: none; color: var(--ink-2); background: var(--surface); border: 1px solid var(--line); }
.setup-strip .st:hover { border-color: var(--accent); color: var(--accent-ink); }
.setup-strip .st.done { color: var(--muted); text-decoration: line-through; background: transparent; border-color: transparent; }
.setup-strip .st.done svg.i { color: var(--good); }
.setup-strip .st svg.i { width: 14px; height: 14px; }
.chart-card .big { font: 650 32px/1.1 var(--display); letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.chart-host { position: relative; height: 260px; }
.prod-bar { display: flex; height: 10px; border-radius: 999px; overflow: hidden; gap: 3px; background: var(--sunken); }
.prod-bar i { display: block; height: 100%; min-width: 4px; }
.prod-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-top: 14px; }
.prod-stats.five { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.prod-stats a { min-width: 0; }
.prod-stats a { text-decoration: none; color: inherit; padding: 10px 10px 8px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--surface-2); transition: border-color .15s; }
.prod-stats a:hover { border-color: var(--accent); }
.prod-stats .n { font: 650 22px var(--display); letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.prod-stats .l { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.prod-stats .l i { flex: none; }
.prod-stats .l i { width: 7px; height: 7px; border-radius: 2px; display: inline-block; }
.rank { width: 22px; height: 22px; border-radius: 7px; display: grid; place-items: center; font: 650 11.5px var(--sans); background: var(--sunken); color: var(--muted); flex: none; }
.rank.r1 { background: linear-gradient(135deg, #F7D774, #F2A93B); color: #4A3000; }
.rank.r2 { background: linear-gradient(135deg, #ECECF0, #C9C9D1); color: #3F3F46; }
.rank.r3 { background: linear-gradient(135deg, #F0C6A8, #D9906A); color: #4A2410; }
.meter { height: 4px; border-radius: 999px; background: var(--sunken); overflow: hidden; margin-top: 6px; }
.meter i { display: block; height: 100%; border-radius: 999px; background: var(--accent); }
.mini-tbl { width: 100%; border-collapse: collapse; }
.mini-tbl td { padding: 10px 18px; border-bottom: 1px solid var(--line-2); font-size: 13.5px; }
.mini-tbl tr:last-child td { border-bottom: 0; }
.mini-tbl tr.click { cursor: pointer; }
.mini-tbl tr.click:hover td { background: var(--hover); }
.mine-card { background: radial-gradient(260px 200px at 100% 0%, rgba(143,124,255,.35), transparent 70%), linear-gradient(135deg, #17142E 0%, #0B0B0E 70%); color: #FAFAFA; border-color: #24203F; }
.mine-card .card-head { border-color: rgba(255,255,255,.08); }
.mine-card .card-head .title svg.i, .mine-card .muted, .mine-card .eyebrow, .mine-card .link.muted { color: #A1A1AA; }
.mine-card .big { font: 650 30px/1.1 var(--display); letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.mine-card .list li { border-color: rgba(255,255,255,.06); }

.tile { display: flex; align-items: center; gap: 14px; padding: 16px 18px; text-decoration: none; color: inherit; transition: box-shadow .2s, border-color .2s; }
.tile:hover { box-shadow: var(--shadow-hover); border-color: color-mix(in srgb, var(--ink) 12%, var(--line)); }
.tile .ti { width: 40px; height: 40px; border-radius: 11px; background: var(--accent-soft); color: var(--accent-ink); display: grid; place-items: center; flex: none; }
.tile b { display: block; font-weight: 600; }
.tile small { color: var(--muted); }
.tile .go { margin-left: auto; color: var(--faint); transition: transform .2s var(--ease); }
.tile:hover .go { transform: translateX(3px); color: var(--ink); }

/* Scan station */
.scan-shell { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(320px, .7fr); background: var(--bg); }
.scan-main { padding: 26px 34px; display: flex; flex-direction: column; gap: 20px; }
.scan-top { display: flex; align-items: center; gap: 14px; }
.scan-input-wrap { position: relative; }
.scan-input { width: 100%; height: 72px; border-radius: 18px; border: 1.5px solid var(--line); background: var(--surface); font: 500 24px var(--mono); padding: 0 120px 0 66px; outline: none; transition: border-color .2s, box-shadow .2s; }
.scan-input:focus { border-color: var(--accent); box-shadow: 0 0 0 5px color-mix(in srgb, var(--accent) 16%, transparent); }
.scan-input-wrap > svg.i { position: absolute; left: 24px; top: 50%; transform: translateY(-50%); width: 26px; height: 26px; color: var(--muted); }
.scan-input-wrap .btn { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); height: 48px; }
.mode-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.mode { border: 1.5px solid var(--line); background: var(--surface); border-radius: 16px; padding: 14px 16px; text-align: left; cursor: pointer; transition: border-color .15s, background .15s; display: flex; flex-direction: column; gap: 4px; }
.mode b { font: 650 19px var(--display); letter-spacing: -.02em; }
.mode small { color: var(--muted); }
.mode .k { font: 500 11px var(--mono); color: var(--faint); }
.mode:hover { border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); }
.mode.on { border-color: var(--accent); background: var(--accent-soft); }
.mode.on b { color: var(--accent-ink); }
.qty-step { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); overflow: hidden; }
.qty-step button { width: 42px; height: 42px; border: 0; background: none; font-size: 20px; cursor: pointer; color: var(--ink-2); }
.qty-step button:hover { background: var(--hover); }
.qty-step input { width: 70px; text-align: center; border: 0; outline: 0; background: none; font: 600 17px var(--sans); }
.scan-result { border-radius: 18px; padding: 22px 24px; display: flex; gap: 20px; align-items: center; min-height: 132px; }
.scan-result.ok { background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); }
.scan-result.err { background: var(--bad-bg); color: var(--bad); }
.scan-result.idle { border: 1.5px dashed var(--line); color: var(--muted); justify-content: center; }
.scan-result .big { font: 650 50px/1 var(--display); letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.scan-result .flow { display: flex; align-items: center; gap: 12px; margin-left: auto; }
.scan-side { border-left: 1px solid var(--line); background: var(--surface-2); padding: 26px 22px; display: flex; flex-direction: column; min-height: 0; }
.scan-log { list-style: none; margin: 10px 0 0; padding: 0; overflow-y: auto; flex: 1; }
.scan-log li { display: flex; gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line-2); font-size: 13.5px; }
.scan-log .d { font-weight: 700; font-variant-numeric: tabular-nums; min-width: 54px; text-align: right; }
.scan-log .d.plus { color: var(--good); } .scan-log .d.minus { color: var(--bad); }
.flash-ok { animation: flashOk .6s var(--ease); }
@keyframes flashOk { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--good) 45%, transparent); } 100% { box-shadow: 0 0 0 16px transparent; } }
.cam { position: relative; border-radius: 16px; overflow: hidden; background: #000; aspect-ratio: 16 / 9; }
.cam video { width: 100%; height: 100%; object-fit: cover; display: block; }
.cam .frame { position: absolute; inset: 22% 18%; border: 2px solid rgba(255,255,255,.85); border-radius: 14px; box-shadow: 0 0 0 999px rgba(0,0,0,.35); }

/* Auth */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1.05fr 1fr; background: var(--bg); }
.auth-art {
  background:
    radial-gradient(620px 420px at 85% 95%, rgba(109,94,248,.42), transparent 60%),
    radial-gradient(520px 380px at 5% 110%, rgba(232,70,124,.24), transparent 60%),
    radial-gradient(420px 300px at 100% 0%, rgba(25,167,206,.18), transparent 60%),
    #09090B;
  color: #FAFAFA; padding: 40px 48px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden;
}
.auth-art::before { content: ''; position: absolute; inset: 0; background-image: linear-gradient(rgba(255,255,255,.045) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.045) 1px, transparent 1px); background-size: 44px 44px; -webkit-mask-image: radial-gradient(ellipse at 70% 75%, #000 15%, transparent 70%); mask-image: radial-gradient(ellipse at 70% 75%, #000 15%, transparent 70%); }
.auth-art > * { position: relative; z-index: 1; }
.auth-art .logo-img { height: 30px; width: auto; align-self: flex-start; filter: invert(1) !important; }
.auth-art h1 { font: 650 clamp(38px, 4.6vw, 60px)/1.02 var(--display); letter-spacing: -.045em; margin: 0; max-width: 560px; }
.auth-art h1 em { font-style: normal; background: linear-gradient(90deg, #A79DFF, #FF8FB3); -webkit-background-clip: text; background-clip: text; color: transparent; }
.auth-art p { color: #A1A1AA; max-width: 420px; font-size: 15px; }
.auth-art .cmyk i:nth-child(4) { background: #FAFAFA; }
.halftone { display: none; }
.auth-form { display: grid; place-items: center; padding: 40px 24px; }
.auth-card { width: min(380px, 100%); }
.auth-card h2 { font: 650 28px/1.15 var(--display); margin: 2px 0 6px; letter-spacing: -.035em; }
.auth-card .btn.primary { height: 42px; }

/* Invoice paper (public + print) */
.paper { background: #fff; color: #09090B; max-width: 820px; margin: 0 auto; border-radius: 10px; box-shadow: 0 30px 80px -30px rgba(0,0,0,.35); padding: 56px 60px; font-family: var(--sans); }
.paper .ph { display: flex; justify-content: space-between; gap: 30px; align-items: flex-start; }
.paper .ph img { height: 40px; }
.paper h1 { font: 650 40px/1 var(--display); margin: 0; letter-spacing: -.04em; }
.paper .cmyk-rule { display: grid; grid-template-columns: repeat(4, 1fr); height: 4px; margin: 28px 0; border-radius: 999px; overflow: hidden; }
.paper .cmyk-rule i:nth-child(1) { background: #19A7CE; } .paper .cmyk-rule i:nth-child(2) { background: #E8467C; } .paper .cmyk-rule i:nth-child(3) { background: #F2A93B; } .paper .cmyk-rule i:nth-child(4) { background: #6D5EF8; }
.paper .meta-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 24px; font-size: 13.5px; }
.paper .meta-grid h4 { font: 600 11px var(--sans); letter-spacing: .08em; text-transform: uppercase; color: #71717A; margin: 0 0 6px; }
.paper table { width: 100%; border-collapse: collapse; margin-top: 34px; font-size: 14px; }
.paper th { font: 600 11px var(--sans); letter-spacing: .08em; text-transform: uppercase; color: #71717A; text-align: left; padding: 0 0 10px; border-bottom: 1.5px solid #09090B; }
.paper td { padding: 12px 0; border-bottom: 1px solid #E6E6EB; vertical-align: top; }
.paper .r { text-align: right; }
.paper .tot { width: 300px; margin: 18px 0 0 auto; display: grid; gap: 7px; font-size: 14px; }
.paper .tot div { display: flex; justify-content: space-between; }
.paper .tot .g { border-top: 1.5px solid #09090B; padding-top: 10px; font: 650 24px var(--display); letter-spacing: -.03em; }
.paper .foot { margin-top: 44px; padding-top: 18px; border-top: 1px solid #E6E6EB; color: #71717A; font-size: 13px; white-space: pre-wrap; }
.paid-stamp { display: inline-block; border: 2px solid #12A150; color: #12A150; font: 700 16px var(--sans); letter-spacing: .2em; padding: 4px 12px; border-radius: 8px; transform: rotate(-4deg); }
.public-wrap { min-height: 100vh; background: #EEEEF2; padding: 40px 16px 80px; }
.public-bar { max-width: 820px; margin: 0 auto 16px; display: flex; justify-content: space-between; align-items: center; }

#print-root { display: none; }
@media print {
  @page { margin: 0; }
  body.printing > *:not(#print-root) { display: none !important; }
  body.printing #print-root { display: block !important; }
  body.printing { background: #fff !important; }
  .public-wrap { background: #fff; padding: 0; }
  .public-bar, .no-print { display: none !important; }
  .paper { box-shadow: none; padding: 40px; max-width: none; }
}
.plabel-sheet { display: flex; flex-wrap: wrap; gap: 0; }
.plabel { width: var(--lw, 2in); height: var(--lh, 1in); padding: .07in .1in; display: flex; flex-direction: column; justify-content: space-between; overflow: hidden; page-break-inside: avoid; break-inside: avoid; color: #000; background: #fff; font-family: var(--sans); }
.plabel.sheet-mode { border: 1px dashed #ccc; }
.plabel .ln { font-weight: 700; font-size: 9pt; line-height: 1.1; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.plabel .lm { display: flex; justify-content: space-between; font: 600 7pt var(--mono); }
.plabel svg { width: 100%; height: 36%; display: block; }
.plabel-preview { display: flex; flex-wrap: wrap; gap: 10px; padding: 14px; background: var(--sunken); border-radius: 12px; max-height: 300px; overflow: auto; }
.plabel-preview .plabel { box-shadow: 0 1px 3px rgba(0,0,0,.15); border-radius: 4px; }

/* Responsive */
.mobile-nav { display: none; }
@media (max-width: 1180px) {
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g-main { grid-template-columns: 1fr; }
  .g3.dash-row { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 960px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: min(290px, 86vw); transform: translateX(-102%); transition: transform .3s var(--ease); box-shadow: var(--shadow-lg); }
  .shell.nav-open .sidebar { transform: none; }
  .shell.nav-open::after { content: ''; position: fixed; inset: 0; background: rgba(9,9,11,.45); z-index: 25; }
  .btn.menu-btn { display: inline-flex; }
  .topbar { padding: 0 12px; gap: 8px; }
  .crumbs > span:first-child, .crumbs > svg { display: none; }
  .crumbs b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font: 650 17px var(--display); letter-spacing: -.02em; }
  .topbar [data-quick-sale] span { display: none; }
  .topbar [data-quick-sale] { width: 34px; padding: 0; }
  .page { padding: 18px 16px 110px; }
  .h1, .dash-head .h1 { font-size: 24px; }
  .g3, .g2, .g3.dash-row { grid-template-columns: 1fr; }
  .stat-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat-strip > div:nth-child(3) { border-left: 0; }
  .stat-strip > div:nth-child(n+3) { border-top: 1px solid var(--line-2); }
  .scan-shell { grid-template-columns: 1fr; }
  .scan-side { border-left: 0; border-top: 1px solid var(--line); }
  .scan-main { padding: 18px 16px; }
  .mode-grid { grid-template-columns: repeat(2, 1fr); }
  .auth { grid-template-columns: 1fr; }
  .auth-art { min-height: 250px; padding: 26px 22px; }
  .setup-strip { flex-wrap: wrap; gap: 10px 14px; }
  .setup-strip .prog { flex: 1; width: auto; }
  .setup-strip .steps { flex-basis: 100%; order: 3; }
  .setup-strip .st.done { display: none; }
  .mobile-nav {
    display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 10px; right: 10px; bottom: calc(10px + env(safe-area-inset-bottom)); z-index: 40;
    background: rgba(11,11,14,.92); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
    border: 1px solid rgba(255,255,255,.08); border-radius: 18px; box-shadow: var(--shadow-lg); padding: 6px;
  }
  .mobile-nav a { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 7px 0 5px; border-radius: 12px; text-decoration: none; color: #8B8B96; font-size: 10.5px; font-weight: 550; }
  .mobile-nav a.on { color: #FAFAFA; background: rgba(255,255,255,.08); }
  .mobile-nav a.scan { background: var(--accent); color: #fff; }
  .drawer, .drawer.wide { width: 100vw; top: 0; right: 0; bottom: 0; border-radius: 0; }
  .modal { top: auto; bottom: 0; transform: translateX(-50%); border-radius: 20px 20px 0 0; max-height: 92vh; width: 100vw; animation: sheet .3s var(--ease); }
  @keyframes sheet { from { transform: translate(-50%, 40px); opacity: 0; } }
  .sync-pill span.t { display: none; }
  .paper { padding: 28px 20px; }
  .paper .meta-grid { grid-template-columns: 1fr; }
  .prod-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .prod-stats.five { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  .g4 { grid-template-columns: 1fr 1fr; gap: 10px; }
  .kpi { padding: 13px 14px; }
  .kpi .value { font-size: 22px; }
  .kpi svg.spark { display: none; }
  .form { grid-template-columns: 1fr; }
  .page-head .actions, .dash-head .actions { width: 100%; }
  .page-head .actions .btn { flex: 1; }
  .kv { grid-template-columns: 110px 1fr; }
  .chart-host { height: 200px; }
  .hide-sm { display: none; }
  .mini-tbl td { padding: 10px 12px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
