/* ============================================================
   Veuzora — Meuze-inspired design system
   ONE coherent pass. Warm editorial surface, hairline borders,
   a single ink accent, mono micro-labels, soft consistent radii.
   ============================================================ */

/* ---------- Tokens: LIGHT (primary) ---------- */
:root,
:root[data-theme="light"] {
  color-scheme: light;

  --bg-0: #f6f5f2;      /* page */
  --bg-1: #fbfaf8;      /* raised */
  --bg-2: #eeece7;      /* sunken chip */
  --surface: #ffffff;
  --surface-hover: #f4f2ee;
  --surface-solid: #ffffff;
  --border: #e6e3db;
  --border-strong: #d5d1c7;

  --text-0: #17150f;    /* ink */
  --text-1: #4f4c44;
  --text-2: #817d72;
  --text-3: #a9a498;

  --accent: #17150f;    /* monochrome ink */
  --accent-strong: #000000;
  --accent-text: #17150f;
  --on-accent: #ffffff;
  --accent-bg: #edeae3;

  --good: #2f8a56;  --good-bg: #e7f2ea;
  --warn: #9a7415;  --warn-bg: #f6efdc;
  --bad:  #bb3b40;  --bad-bg:  #f7e8e8;

  --radius: 16px;
  --radius-s: 10px;
  --shadow: 0 1px 2px rgba(20,18,12,.04), 0 12px 32px rgba(20,18,12,.05);
  --shadow-lg: 0 24px 70px rgba(20,18,12,.16);

  --font: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --mono: ui-monospace, "SF Mono", "Menlo", "Cascadia Code", "Consolas", monospace;
}

/* ---------- Tokens: DARK ---------- */
:root[data-theme="dark"] {
  color-scheme: dark;

  --bg-0: #0b0b0a;
  --bg-1: #131311;
  --bg-2: #1b1a17;
  --surface: #141311;
  --surface-hover: #1c1b17;
  --surface-solid: #141311;
  --border: #272621;
  --border-strong: #3a382f;

  --text-0: #f5f3ee;
  --text-1: #b9b5aa;
  --text-2: #868277;
  --text-3: #5f5c53;

  --accent: #f5f3ee;
  --accent-strong: #ffffff;
  --accent-text: #f5f3ee;
  --on-accent: #0b0b0a;
  --accent-bg: #1f1e1a;

  --good: #6fd39b;  --good-bg: #10241a;
  --warn: #e2bd74;  --warn-bg: #251f12;
  --bad:  #ef8b90;  --bad-bg:  #271416;

  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 12px 32px rgba(0,0,0,.35);
  --shadow-lg: 0 30px 80px rgba(0,0,0,.55);
}

/* ---------- Reset ---------- */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg-0);
  color: var(--text-0);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  letter-spacing: -0.011em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background .25s ease, color .25s ease;
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
ul { margin: 0; padding: 0; list-style: none; }
h1, h2, h3, h4, p { margin: 0; }

.visually-hidden { position: absolute; left: -9999px; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.skip-link {
  position: absolute; left: -999px; top: 0; z-index: 300;
  background: var(--surface-solid); color: var(--text-0);
  padding: 10px 18px; border: 1px solid var(--border-strong); border-radius: var(--radius-s);
}
.skip-link:focus { left: 16px; top: 16px; }

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001ms !important; transition-duration: .001ms !important; }
  html { scroll-behavior: auto; }
}

/* ============================================================
   Header
   ============================================================ */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: color-mix(in srgb, var(--bg-0) 82%, transparent);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.header-inner {
  max-width: 1240px; margin: 0 auto;
  min-height: 66px;
  padding: 12px 24px;
  display: flex; align-items: center; gap: 24px;
}

.brand { display: flex; align-items: center; gap: 10px; white-space: nowrap; color: var(--text-0); flex-shrink: 0; }
.brand-mark { width: 26px; height: 26px; flex-shrink: 0; }
.brand-mark-light { display: none; }
.brand-mark-dark { display: block; }
:root[data-theme="light"] .brand-mark-dark { display: none; }
:root[data-theme="light"] .brand-mark-light { display: block; }
.brand-word { font-size: 1.05rem; font-weight: 650; letter-spacing: -.03em; line-height: 1; }

/* nav */
.primary-nav { flex: 1; min-width: 0; display: flex; overflow-x: auto; scrollbar-width: none; }
.primary-nav::-webkit-scrollbar { display: none; }

.nav-list { position: relative; display: flex; align-items: center; gap: 2px; width: max-content; margin: 0 auto; }

.nav-pill {
  position: absolute; top: 4px; bottom: 4px; left: 0;
  background: var(--bg-2);
  border-radius: 999px;
  opacity: 0;
  transition: transform .28s cubic-bezier(.4,0,.2,1), width .28s cubic-bezier(.4,0,.2,1), opacity .2s ease;
  z-index: 0;
}

.nav-list a {
  position: relative; z-index: 1;
  display: block; padding: 9px 15px;
  font-size: .82rem; font-weight: 500;
  color: var(--text-2); white-space: nowrap;
  border-radius: 999px;
  transition: color .15s ease;
}
.nav-list a:hover { color: var(--text-0); }
.nav-list a.active { color: var(--text-0); font-weight: 600; }

/* header actions */
.header-actions { display: flex; align-items: center; gap: 12px; flex-shrink: 0; margin-left: auto; }

.theme-switch {
  position: relative; display: flex; align-items: center;
  padding: 3px; gap: 0;
  border: 1px solid var(--border); border-radius: 999px;
  background: var(--bg-1); flex-shrink: 0;
}
.theme-switch-thumb {
  position: absolute; top: 3px; bottom: 3px; left: 3px; width: 28px;
  background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: 999px;
  box-shadow: 0 1px 2px rgba(0,0,0,.08);
  transition: transform .25s cubic-bezier(.4,0,.2,1), width .25s cubic-bezier(.4,0,.2,1);
  z-index: 0;
}
.theme-switch-btn {
  position: relative; z-index: 1;
  width: 28px; height: 26px;
  display: flex; align-items: center; justify-content: center;
  background: none; border: none; cursor: pointer;
  color: var(--text-2); border-radius: 999px;
  transition: color .2s ease;
}
.theme-switch-btn svg { width: 14px; height: 14px; }
.theme-switch-btn[aria-checked="true"] { color: var(--text-0); }

.header-cta {
  display: inline-flex; align-items: center; gap: 8px;
  height: 38px; padding: 0 16px;
  background: var(--accent); color: var(--on-accent);
  font-size: .82rem; font-weight: 600; letter-spacing: -.01em;
  border-radius: 999px; white-space: nowrap;
  transition: transform .16s ease, opacity .16s ease;
}
.header-cta:hover { transform: translateY(-1px); opacity: .92; }
.header-cta span { font-size: .95rem; }

/* mobile toggle */
.nav-toggle {
  display: none; align-items: center; justify-content: center;
  width: 38px; height: 38px; flex-shrink: 0;
  background: var(--bg-1); border: 1px solid var(--border); border-radius: 999px;
  cursor: pointer; color: var(--text-0); position: relative;
}
.nav-toggle-icon { position: absolute; width: 19px; height: 19px; transition: opacity .15s ease, transform .15s ease; }
.nav-toggle-icon.icon-close { opacity: 0; transform: scale(.7); }
.nav-toggle[aria-expanded="true"] .icon-menu { opacity: 0; transform: scale(.7); }
.nav-toggle[aria-expanded="true"] .icon-close { opacity: 1; transform: scale(1); }

/* ============================================================
   Layout
   ============================================================ */
main { max-width: 1240px; margin: 0 auto; padding: 72px 24px 120px; }
.view { display: none; }
.view.active { display: block; }

.reveal { opacity: 0; transform: translateY(16px); transition: opacity .55s cubic-bezier(.22,1,.36,1), transform .55s cubic-bezier(.22,1,.36,1); }
.reveal.in-view { opacity: 1; transform: none; }

.view-header { margin-bottom: 48px; }
.eyebrow {
  display: inline-flex; align-items: center;
  font-family: var(--mono); font-size: .68rem; font-weight: 600;
  letter-spacing: .14em; text-transform: uppercase;
  color: var(--text-3); margin-bottom: 16px;
}
.eyebrow-live { gap: 9px; }
.live-pulse { position: relative; width: 7px; height: 7px; border-radius: 999px; background: var(--good); flex-shrink: 0; }
.live-pulse::after { content: ""; position: absolute; inset: -4px; border: 1px solid var(--good); border-radius: 999px; animation: ring 2s ease-out infinite; }
@keyframes ring { 0% { transform: scale(.6); opacity: .7; } 100% { transform: scale(2.2); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .live-pulse::after { animation: none; opacity: 0; } }

.view-title { font-size: clamp(2.2rem, 4.5vw, 3.6rem); font-weight: 640; letter-spacing: -.04em; line-height: 1.02; max-width: 16ch; }
.view-sub { margin-top: 16px; color: var(--text-2); font-size: 1.02rem; line-height: 1.55; max-width: 56ch; }

/* ============================================================
   Hairline grids — ONE technique everywhere.
   Container paints the 1px separators; cells stay borderless.
   ============================================================ */
.stat-grid,
.product-grid,
.profile-grid,
.info-grid {
  display: grid;
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.stat-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 60px; }
.stat-card { background: var(--surface); padding: 26px 24px; min-height: 172px; display: flex; flex-direction: column; }
.stat-icon {
  width: 34px; height: 34px; border-radius: var(--radius-s);
  border: 1px solid var(--border); background: var(--bg-1);
  display: flex; align-items: center; justify-content: center; margin-bottom: 22px;
}
.stat-icon svg { width: 16px; height: 16px; color: var(--text-2); }
.stat-label { font-size: .82rem; color: var(--text-2); font-weight: 500; margin-bottom: 10px; }
.stat-value { font-size: 1.95rem; font-weight: 640; letter-spacing: -.03em; line-height: 1.1; font-variant-numeric: tabular-nums; word-break: break-word; }
.stat-delta-row { margin-top: auto; padding-top: 14px; }
.stat-delta {
  display: inline-block; font-family: var(--mono);
  font-size: .68rem; font-weight: 600; padding: 4px 9px;
  border-radius: 999px; border: 1px solid var(--border); color: var(--text-2);
}
.stat-delta.up { color: var(--good); border-color: transparent; background: var(--good-bg); }
.stat-delta.down { color: var(--bad); border-color: transparent; background: var(--bad-bg); }

/* ============================================================
   Sections & chips
   ============================================================ */
.section-block { margin-bottom: 60px; }
.section-title {
  font-family: var(--mono); font-size: .74rem; font-weight: 600;
  letter-spacing: .1em; text-transform: uppercase; color: var(--text-2);
  margin-bottom: 20px;
}

.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 15px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--surface);
  font-size: .84rem; font-weight: 500; color: var(--text-1);
  cursor: pointer; transition: border-color .15s ease, color .15s ease, background .15s ease;
}
.chip:hover { border-color: var(--border-strong); color: var(--text-0); background: var(--surface-hover); }
.chip .count { font-family: var(--mono); font-size: .72rem; color: var(--text-3); }

/* ============================================================
   Toolbar
   ============================================================ */
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 24px; }
.search-field { flex: 1; min-width: 220px; position: relative; display: flex; align-items: center; }
.search-field svg { position: absolute; left: 16px; width: 16px; height: 16px; color: var(--text-3); pointer-events: none; }
.search-field input {
  width: 100%; height: 46px; padding: 0 16px 0 42px;
  border: 1px solid var(--border); border-radius: 999px;
  background: var(--surface); color: var(--text-0); font-size: .92rem;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.search-field input::placeholder { color: var(--text-3); }
.search-field input:focus { outline: none; border-color: var(--border-strong); box-shadow: 0 0 0 3px var(--accent-bg); }

.filter-select { display: flex; flex-wrap: wrap; border: 1px solid var(--border); border-radius: 999px; overflow: hidden; background: var(--surface); }
.filter-btn {
  padding: 0 16px; height: 46px;
  border: none; border-right: 1px solid var(--border);
  background: transparent; font-size: .84rem; font-weight: 500;
  color: var(--text-2); cursor: pointer; white-space: nowrap;
  transition: background .15s ease, color .15s ease;
}
.filter-btn:last-child { border-right: none; }
.filter-btn:hover { background: var(--surface-hover); color: var(--text-0); }
.filter-btn.active { background: var(--accent); color: var(--on-accent); font-weight: 600; }

.low-stock-toggle {
  display: inline-flex; align-items: center; gap: 8px; height: 46px; padding: 0 18px;
  border: 1px solid var(--border); border-radius: 999px; background: var(--surface);
}
.low-stock-toggle[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); font-weight: 600; }
.low-stock-toggle[aria-pressed="true"] .stock-dot { background: var(--on-accent); }

.result-count { font-family: var(--mono); font-size: .78rem; color: var(--text-3); margin-bottom: 20px; }

/* ============================================================
   Product cards
   ============================================================ */
.product-grid { grid-template-columns: repeat(auto-fill, minmax(258px, 1fr)); }
.product-card {
  background: var(--surface); padding: 24px;
  display: flex; flex-direction: column; gap: 12px; min-height: 232px;
  cursor: pointer; transition: background .18s ease;
}
.product-card:hover { background: var(--surface-hover); }
.product-card:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.product-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.product-cat {
  font-family: var(--mono); font-size: .62rem; font-weight: 600;
  letter-spacing: .08em; text-transform: uppercase; color: var(--text-2);
  border: 1px solid var(--border); border-radius: 999px; padding: 4px 10px;
}
.stock-dot { width: 8px; height: 8px; border-radius: 999px; flex-shrink: 0; margin-top: 6px; }
.stock-dot.ok { background: var(--good); }
.stock-dot.low { background: var(--warn); }
.stock-dot.out { background: var(--bad); }
.product-name { font-size: 1.08rem; font-weight: 620; letter-spacing: -.02em; line-height: 1.3; }
.product-desc { font-size: .84rem; color: var(--text-2); line-height: 1.55; }
.product-meta { margin-top: auto; padding-top: 14px; border-top: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; }
.product-sku { font-family: var(--mono); font-size: .72rem; color: var(--text-3); }
.product-price { font-size: 1.02rem; font-weight: 650; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.product-qty { font-size: .78rem; color: var(--text-2); }

/* ============================================================
   Row tables (preview / pricing)
   ============================================================ */
.preview-table { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.preview-row {
  display: grid; grid-template-columns: 1.4fr 1.2fr .7fr .7fr; gap: 18px;
  padding: 15px 20px; border-bottom: 1px solid var(--border);
  color: var(--text-1); font-size: .86rem; align-items: center;
}
.preview-row:last-child { border-bottom: none; }
.preview-row-head { color: var(--text-3); font-family: var(--mono); font-size: .64rem; letter-spacing: .08em; background: var(--bg-1); }
.preview-row > span:not(:first-child) { color: var(--text-2); }
.sync-ok { color: var(--good) !important; }
.sync-warn { color: var(--warn) !important; }
.sync-pending { color: var(--text-2) !important; }

.price-table .price-row { grid-template-columns: 1.6fr 1fr 1fr .8fr .9fr; }
.price-table .price-row span:nth-child(4),
.price-table .price-row span:nth-child(5) { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.price-row-clickable { cursor: pointer; transition: background .15s ease; }
.price-row-clickable:hover { background: var(--surface-hover); }

@media (max-width: 640px) {
  .price-table .price-row { grid-template-columns: 1.4fr .8fr .9fr; }
  .price-table .price-row span:nth-child(3) { display: none; }
}

/* ============================================================
   Data tables
   ============================================================ */
.table-wrap { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; overflow-x: auto; background: var(--surface); }
table { width: 100%; border-collapse: collapse; font-size: .88rem; min-width: 560px; }
thead th {
  text-align: left; font-family: var(--mono); font-size: .66rem; font-weight: 600;
  letter-spacing: .08em; text-transform: uppercase; color: var(--text-3);
  padding: 15px 20px; border-bottom: 1px solid var(--border); white-space: nowrap; background: var(--bg-1);
}
tbody td { padding: 15px 20px; border-bottom: 1px solid var(--border); color: var(--text-1); vertical-align: middle; }
tbody tr:last-child td { border-bottom: none; }
tbody tr { transition: background .15s ease; }
tbody tr:hover { background: var(--surface-hover); }

.pill-status {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: 999px;
  font-family: var(--mono); font-size: .72rem; font-weight: 600;
  border: 1px solid transparent;
}
.pill-status.done, .pill-status.delivered, .pill-status.success, .pill-status.admin { color: var(--good); background: var(--good-bg); }
.pill-status.pending, .pill-status.viewer { color: var(--warn); background: var(--warn-bg); }
.pill-status.failed, .pill-status.cancelled { color: var(--bad); background: var(--bad-bg); }

/* ============================================================
   Empty state
   ============================================================ */
.empty-state {
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 64px 30px; text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 16px; background: var(--surface);
}
.empty-icon { width: 50px; height: 50px; border: 1px solid var(--border); border-radius: var(--radius-s); display: flex; align-items: center; justify-content: center; }
.empty-icon svg { width: 22px; height: 22px; color: var(--text-3); }
.empty-title { font-size: 1.04rem; font-weight: 620; }
.empty-sub { font-size: .88rem; color: var(--text-2); max-width: 38ch; }

/* ============================================================
   Profiles / info cards
   ============================================================ */
.profile-grid { grid-template-columns: repeat(auto-fill, minmax(248px, 1fr)); }
.profile-card { background: var(--surface); padding: 24px; display: flex; align-items: center; gap: 14px; transition: background .15s ease; }
.profile-card:hover { background: var(--surface-hover); }
.avatar {
  width: 42px; height: 42px; border-radius: 12px; flex-shrink: 0;
  border: 1px solid var(--border-strong); background: var(--bg-1);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--mono); font-weight: 650; font-size: .9rem; color: var(--text-0);
}
.profile-name { font-weight: 620; font-size: .96rem; margin-bottom: 4px; }
.profile-user { font-family: var(--mono); font-size: .76rem; color: var(--text-3); }

.info-grid { grid-template-columns: repeat(auto-fill, minmax(258px, 1fr)); }
.info-card { background: var(--surface); padding: 24px; }
.info-card-title { font-weight: 620; font-size: .96rem; margin-bottom: 14px; }
.info-row { display: flex; justify-content: space-between; gap: 12px; font-size: .84rem; padding: 8px 0; border-bottom: 1px solid var(--border); color: var(--text-2); }
.info-row:last-child { border-bottom: none; }
.info-row span:last-child { color: var(--text-1); font-weight: 500; text-align: right; }

.privacy-note {
  display: flex; align-items: flex-start; gap: 10px;
  font-size: .8rem; color: var(--text-3); line-height: 1.5;
  margin-top: 24px; padding: 16px 18px;
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg-1);
}
.privacy-note svg { width: 16px; height: 16px; flex-shrink: 0; color: var(--text-3); margin-top: 2px; }

/* ============================================================
   Connect panel
   ============================================================ */
.connect-panel { border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; background: var(--surface); }
.connect-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.connect-field { flex: 1; min-width: 190px; display: flex; flex-direction: column; gap: 8px; }
.connect-field label { font-family: var(--mono); font-size: .72rem; font-weight: 600; color: var(--text-2); text-transform: uppercase; letter-spacing: .06em; }
.connect-field input {
  height: 44px; padding: 0 14px; border: 1px solid var(--border); border-radius: var(--radius-s);
  background: var(--bg-1); color: var(--text-0); font-family: var(--mono); font-size: .86rem;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.connect-field input:focus { outline: none; border-color: var(--border-strong); box-shadow: 0 0 0 3px var(--accent-bg); }
.connect-btn {
  height: 44px; padding: 0 24px; flex-shrink: 0;
  border: 1px solid var(--accent); border-radius: 999px;
  background: var(--accent); color: var(--on-accent);
  font-weight: 600; font-size: .86rem; cursor: pointer; white-space: nowrap;
  transition: transform .16s ease, opacity .16s ease;
}
.connect-btn:hover { transform: translateY(-1px); opacity: .92; }
.connect-btn:disabled { opacity: .5; cursor: default; transform: none; }
.connect-status { display: flex; align-items: center; gap: 10px; margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--border); font-size: .85rem; color: var(--text-2); }
.status-dot { width: 8px; height: 8px; border-radius: 999px; background: var(--text-3); flex-shrink: 0; }
.connect-status.ok .status-dot { background: var(--good); }
.connect-status.error .status-dot { background: var(--bad); }
.connect-status.loading .status-dot { background: var(--warn); animation: pulseDot 1s ease-in-out infinite; }
@keyframes pulseDot { 0%,100% { opacity: 1; } 50% { opacity: .3; } }
.connect-reset { margin-left: auto; background: none; border: 1px solid var(--border); border-radius: 999px; color: var(--text-2); padding: 7px 16px; font-size: .78rem; font-weight: 500; cursor: pointer; transition: border-color .15s ease, color .15s ease; }
.connect-reset:hover { border-color: var(--border-strong); color: var(--text-0); }

.live-badge { display: inline-flex; align-items: center; gap: 6px; font-family: var(--mono); font-size: .72rem; font-weight: 600; color: var(--good); background: var(--good-bg); border-radius: 999px; padding: 4px 10px; margin-left: 10px; }
.live-badge .dot { width: 6px; height: 6px; border-radius: 999px; background: var(--good); }

/* ============================================================
   Product modal
   ============================================================ */
.modal-overlay {
  position: fixed; inset: 0; z-index: 200;
  display: flex; align-items: center; justify-content: center; padding: 20px;
  background: color-mix(in srgb, var(--text-0) 45%, transparent);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  opacity: 0; transition: opacity .2s ease;
}
.modal-overlay[hidden] { display: none; }
.modal-overlay.open { opacity: 1; }
.modal-panel {
  position: relative; width: 100%; max-width: 480px; max-height: 86vh; overflow-y: auto;
  padding: 34px 30px 30px; background: var(--surface-solid);
  border: 1px solid var(--border); border-radius: 20px; box-shadow: var(--shadow-lg);
  transform: translateY(10px) scale(.99); opacity: 0; transition: transform .24s ease, opacity .2s ease;
}
.modal-overlay.open .modal-panel { transform: none; opacity: 1; }
.modal-close {
  position: absolute; top: 18px; right: 18px; width: 32px; height: 32px;
  border: 1px solid var(--border); border-radius: 999px; background: var(--bg-1); color: var(--text-1);
  display: flex; align-items: center; justify-content: center; cursor: pointer;
  transition: background .15s ease, color .15s ease;
}
.modal-close:hover { background: var(--surface-hover); color: var(--text-0); }
.modal-close svg { width: 15px; height: 15px; }
.modal-cat {
  display: inline-block; font-family: var(--mono); font-size: .66rem; font-weight: 600;
  letter-spacing: .08em; text-transform: uppercase; color: var(--text-2);
  border: 1px solid var(--border); border-radius: 999px; padding: 4px 10px; margin-bottom: 16px;
}
.modal-name { font-size: 1.4rem; font-weight: 640; letter-spacing: -.03em; margin-bottom: 8px; }
.modal-desc { font-size: .92rem; color: var(--text-2); line-height: 1.55; margin-bottom: 22px; }
.modal-status { display: flex; align-items: center; gap: 10px; padding: 13px 16px; border-radius: var(--radius-s); margin-bottom: 22px; font-size: .86rem; font-weight: 500; }
.modal-status.ok { background: var(--good-bg); color: var(--good); }
.modal-status.low { background: var(--warn-bg); color: var(--warn); }
.modal-status.out { background: var(--bad-bg); color: var(--bad); }
.modal-status-dot { width: 8px; height: 8px; border-radius: 999px; background: currentColor; flex-shrink: 0; }
.modal-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: var(--radius-s); overflow: hidden; }
.modal-field { background: var(--surface-solid); padding: 15px 16px; }
.modal-field-label { font-family: var(--mono); font-size: .66rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); margin-bottom: 6px; }
.modal-field-value { font-size: .94rem; font-weight: 620; color: var(--text-0); }
.modal-field-value.mono { font-family: var(--mono); font-size: .82rem; font-weight: 500; }

/* ============================================================
   Landing / product page
   ============================================================ */
.landing-hero {
  display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(260px, .6fr);
  gap: clamp(40px, 7vw, 96px); align-items: end;
  padding: 4vh 0 8vh; border-bottom: 1px solid var(--border);
}
.landing-title { max-width: 15ch; font-size: clamp(3rem, 7vw, 6.4rem); line-height: .95; letter-spacing: -.05em; font-weight: 600; text-wrap: balance; }
.landing-lede { max-width: 640px; margin-top: 30px; color: var(--text-1); font-size: clamp(1.05rem, 1.4vw, 1.28rem); line-height: 1.55; }
.landing-actions { display: flex; gap: 12px; margin-top: 34px; flex-wrap: wrap; }
.landing-primary, .landing-secondary {
  display: inline-flex; align-items: center; gap: 14px; height: 52px; padding: 0 24px;
  border-radius: 999px; font-size: .9rem; font-weight: 600;
  transition: transform .16s ease, background .16s ease, border-color .16s ease, color .16s ease, opacity .16s ease;
}
.landing-primary { background: var(--accent); color: var(--on-accent); border: 1px solid var(--accent); }
.landing-primary:hover { transform: translateY(-2px); opacity: .92; }
.landing-secondary { border: 1px solid var(--border-strong); color: var(--text-1); }
.landing-secondary:hover { border-color: var(--text-0); color: var(--text-0); }

.landing-hero-note { align-self: end; border-top: 1px solid var(--border-strong); padding-top: 16px; }
.landing-note-label, .landing-section-label { font-family: var(--mono); font-size: .68rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--text-3); }
.landing-hero-note p { margin-top: 12px; color: var(--text-1); font-size: .92rem; line-height: 1.5; max-width: 30ch; }
.landing-note-line { height: 1px; background: var(--border); margin: 28px 0 8px; }
.landing-note-grid { display: grid; grid-template-columns: 1fr 1fr; font-family: var(--mono); font-size: .66rem; text-transform: uppercase; color: var(--text-3); }
.landing-note-grid span { padding: 9px 0; border-bottom: 1px solid var(--border); }

.landing-product-frame {
  margin: 8vh 0; border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface); box-shadow: var(--shadow); overflow: hidden;
}
.product-frame-bar { min-height: 40px; padding: 0 16px; border-bottom: 1px solid var(--border); background: var(--bg-1); display: flex; align-items: center; justify-content: space-between; color: var(--text-3); font-family: var(--mono); font-size: .62rem; letter-spacing: .08em; }
.product-frame-body { display: grid; grid-template-columns: 56px 1fr; }
.preview-sidebar { border-right: 1px solid var(--border); padding: 20px 14px; background: var(--bg-1); }
.preview-brand { width: 30px; height: 30px; display: grid; place-items: center; border: 1px solid var(--border-strong); border-radius: 8px; font-family: var(--mono); font-weight: 600; font-size: .78rem; margin: 0 auto 40px; }
.preview-side-lines { display: grid; gap: 16px; }
.preview-side-lines span { height: 2px; border-radius: 2px; background: var(--border-strong); }
.preview-main { padding: 32px 36px 40px; min-width: 0; }
.preview-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; padding-bottom: 22px; border-bottom: 1px solid var(--border); }
.preview-kicker { display: block; font-family: var(--mono); font-size: .62rem; text-transform: uppercase; letter-spacing: .08em; color: var(--text-3); margin-bottom: 8px; }
.preview-heading strong { display: block; font-size: clamp(1.4rem, 2.6vw, 2.1rem); letter-spacing: -.035em; font-weight: 620; }
.preview-live { display: inline-flex; align-items: center; gap: 7px; font-family: var(--mono); font-size: .68rem; color: var(--text-2); white-space: nowrap; }
.preview-live i { width: 6px; height: 6px; border-radius: 999px; background: var(--good); }
.preview-stats { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 1px; background: var(--border); border-bottom: 1px solid var(--border); margin-top: 1px; }
.preview-stats > div { background: var(--surface); padding: 20px 18px; }
.preview-stats small { display: block; font-family: var(--mono); font-size: .6rem; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); }
.preview-stats b { display: block; margin: 10px 0 6px; font-size: clamp(1.15rem, 2vw, 1.6rem); font-weight: 640; letter-spacing: -.03em; }
.preview-stats span { display: block; font-size: .72rem; color: var(--text-3); }
.preview-table.preview-table { margin-top: 24px; border: none; border-radius: 0; background: transparent; }
.landing-product-frame .preview-row { padding-left: 0; padding-right: 0; }

.landing-section { padding: 12vh 0; border-bottom: 1px solid var(--border); display: grid; grid-template-columns: 22% 1fr; gap: clamp(40px, 6vw, 88px); }
.landing-section > div:last-child { min-width: 0; }
.landing-section h2 { max-width: 18ch; font-size: clamp(2.3rem, 4.8vw, 4.6rem); line-height: 1; letter-spacing: -.045em; font-weight: 620; }
.landing-section > div:last-child > p { max-width: 640px; margin-top: 24px; color: var(--text-1); font-size: 1.05rem; line-height: 1.6; }

.landing-steps { margin-top: 56px; display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.landing-steps > div { background: var(--surface); padding: 26px 24px; min-height: 180px; display: flex; flex-direction: column; }
.landing-steps span { font-family: var(--mono); font-size: .66rem; color: var(--text-3); margin-bottom: auto; }
.landing-steps strong { margin-top: 32px; font-size: 1.2rem; font-weight: 620; letter-spacing: -.02em; }
.landing-steps p { margin-top: 10px; color: var(--text-2); font-size: .88rem; line-height: 1.5; }

.landing-feature-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.landing-feature-grid article { background: var(--surface); padding: 30px; min-height: 260px; display: flex; flex-direction: column; }
.landing-feature-grid article > span { font-family: var(--mono); font-size: .62rem; letter-spacing: .08em; color: var(--text-3); }
.landing-feature-grid h3 { max-width: 16ch; margin-top: auto; font-size: clamp(1.4rem, 2.2vw, 2rem); line-height: 1.05; letter-spacing: -.035em; font-weight: 620; }
.landing-feature-grid p { max-width: 44ch; margin-top: 16px; color: var(--text-2); font-size: .88rem; line-height: 1.55; }

.landing-section-dark { background: var(--bg-1); border-radius: var(--radius); padding-left: clamp(24px, 4vw, 56px); padding-right: clamp(24px, 4vw, 56px); border-bottom: none; margin-bottom: 0; }
.control-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.control-grid div { background: var(--surface); min-height: 152px; padding: 24px; display: flex; flex-direction: column; justify-content: space-between; gap: 16px; }
.control-grid strong { font-size: 1.14rem; font-weight: 620; letter-spacing: -.02em; }
.control-grid span { max-width: 34ch; color: var(--text-2); font-size: .85rem; line-height: 1.5; }

.landing-final { padding: 16vh 0 8vh; text-align: center; }
.landing-final .eyebrow { justify-content: center; }
.landing-final h2 { max-width: 20ch; margin: 0 auto; font-size: clamp(2.8rem, 6.5vw, 6rem); line-height: .95; letter-spacing: -.05em; font-weight: 620; }
.landing-final p { margin: 24px auto 32px; max-width: 46ch; color: var(--text-2); font-size: 1.02rem; line-height: 1.55; }
.landing-final .landing-primary { margin: 0 auto; }

/* ============================================================
   Footer
   ============================================================ */
.site-footer { border-top: 1px solid var(--border); padding: 36px 24px 68px; }
.footer-inner { max-width: 1240px; margin: 0 auto; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; font-family: var(--mono); font-size: .78rem; color: var(--text-3); }

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 1080px) {
  .stat-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
}

@media (max-width: 900px) {
  .header-cta { display: none; }
  .landing-hero { grid-template-columns: 1fr; align-items: start; gap: 56px; padding-top: 2vh; }
  .landing-hero-note { max-width: 440px; border-top: none; padding-top: 0; }
  .landing-hero-note .landing-note-line { margin-top: 0; }
  .landing-section { grid-template-columns: 1fr; gap: 36px; }
  .preview-stats { grid-template-columns: repeat(2, minmax(0,1fr)); }
}

@media (max-width: 780px) {
  .header-inner { min-height: 58px; padding: 10px 16px; gap: 14px; position: relative; }
  .nav-toggle { display: flex; }
  .brand-word { display: none; }

  .primary-nav {
    position: absolute; top: 100%; left: 0; right: 0;
    display: none; overflow: visible;
    background: color-mix(in srgb, var(--bg-0) 97%, transparent);
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  }
  .primary-nav.open { display: block; }
  .nav-list { flex-direction: column; align-items: stretch; width: 100%; margin: 0; padding: 8px; gap: 2px; }
  .nav-pill { display: none; }
  .nav-list a { padding: 13px 16px; border-radius: var(--radius-s); }
  .nav-list a.active { background: var(--bg-2); }

  main { padding: 44px 16px 90px; }
  .landing-steps { grid-template-columns: 1fr; }
  .landing-feature-grid, .control-grid { grid-template-columns: 1fr; }
  .product-frame-body { grid-template-columns: 1fr; }
  .preview-sidebar { display: none; }
  .preview-main { padding: 24px 20px 30px; }
}

@media (max-width: 560px) {
  .stat-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .stat-card { padding: 20px 16px; min-height: 148px; }
  .stat-value { font-size: 1.55rem; }
  .preview-stats { grid-template-columns: 1fr 1fr; }
  .preview-row { grid-template-columns: 1.4fr .7fr .8fr; gap: 10px; padding-left: 0; padding-right: 0; }
  .preview-row span:nth-child(2) { display: none; }
  .landing-actions { display: grid; grid-template-columns: 1fr; }
  .landing-primary, .landing-secondary { justify-content: space-between; }
  .footer-inner { flex-direction: column; align-items: flex-start; }
}

/* ============================================================
   Mobile toolbar: compact, single-row filter bars
   ============================================================ */
@media (max-width: 780px) {
  .toolbar { gap: 8px; margin-bottom: 18px; }
  .search-field { flex: 1 1 100%; min-width: 0; }
  .search-field input { height: 42px; }

  /* category bar: one row, swipe sideways, never stacks */
  .filter-select {
    flex: 1 1 100%; flex-wrap: nowrap; min-width: 0;
    overflow-x: auto; overflow-y: hidden;
    -webkit-overflow-scrolling: touch; scrollbar-width: none;
    scroll-snap-type: x proximity;
  }
  .filter-select::-webkit-scrollbar { display: none; }
  .filter-btn { flex: 0 0 auto; height: 38px; padding: 0 14px; font-size: .82rem; scroll-snap-align: start; }

  /* low stock toggle: compact, not full height */
  .low-stock-toggle { height: 38px; padding: 0 14px; font-size: .82rem; flex: 0 0 auto; }

  /* price sort: two buttons share one row */
  #pricingSortGroup { flex: 0 0 auto; overflow: hidden; }
}
@media (max-width: 560px) {
  .filter-btn { padding: 0 12px; }
}

/* ============================================================
   Print
   ============================================================ */
@media print {
  .site-header, .site-footer, .nav-toggle, .theme-switch, .header-cta, .modal-overlay { display: none !important; }
  main { padding: 0; max-width: none; }
  .reveal { opacity: 1 !important; transform: none !important; }
  .stat-grid, .product-grid, .profile-grid, .info-grid, .table-wrap, .preview-table { break-inside: avoid; }
}
