/* ============================================================
   Grilzo · Operator Console
   Premium SaaS dashboard: dark sidebar, light content, data-dense.
   ============================================================ */

:root {
  /* Surfaces — white content, dark-grey sidebar */
  --bg:           #F7F8FA;
  --bg-2:         #ECEFF3;
  --surface:      #FFFFFF;
  --surface-2:    #FAFBFC;
  --sidebar:      #1F2127;          /* dark grey (lighter than pure black) */
  --sidebar-2:    #2A2D35;
  --sidebar-line: rgba(255, 255, 255, .08);
  --sidebar-text: #C5C8CE;
  --sidebar-text-strong: #FFFFFF;
  --sidebar-text-muted:  #6E737B;

  /* Ink (light black) */
  --ink:          #0F1115;
  --ink-2:        #1A1D24;
  --ink-3:        #2A2F38;
  --text:         #1A1D24;
  --text-2:       #4A5160;
  --muted:        #6B7280;
  --muted-2:      #9AA1AE;

  /* Borders / dividers */
  --line:         #E5E8EE;
  --line-2:       #EFF2F6;
  --line-strong:  #CFD4DC;

  /* Brand accent — YELLOW. Variable names kept (--gold/--ember) for stability; values changed. */
  --gold:         #F5C518;          /* primary yellow */
  --gold-2:       #D4A50E;          /* darker yellow (hover / pressed) */
  --gold-soft:    #FCE789;          /* soft yellow */
  --gold-bg:      #FFF8DD;          /* yellow tint background */
  --ember:        #6B7280;          /* re-cast as neutral grey — no more red */
  --ember-2:      #4A5160;
  --olive:        #4A5160;          /* re-cast as dark slate */

  /* Functional status colors */
  --success:      #0F8F5B;
  --success-bg:   #E3F5EC;
  --warning:      #B26A00;
  --warning-bg:   #FFF1D6;
  --danger:       #C0322B;
  --danger-bg:    #FBE3E1;
  --info:         #1F5BB8;
  --info-bg:      #E0EBFA;
  --neutral-bg:   #EEF0F4;

  /* Chart palette — yellow + greyscale + functional colors */
  --chart-1:      #F5C518;  /* yellow */
  --chart-2:      #1F2127;  /* dark grey */
  --chart-3:      #0F8F5B;  /* green */
  --chart-4:      #1F5BB8;  /* blue */
  --chart-5:      #9AA1AE;  /* light grey */
  --chart-6:      #D4A50E;  /* darker yellow */

  /* Type */
  --f-display: 'Fraunces', 'Playfair Display', Georgia, serif;
  --f-body:    'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --f-mono:    'JetBrains Mono', 'SF Mono', Consolas, monospace;

  /* Geometry */
  --sidebar-w:    228px;
  --topbar-h:     64px;
  --r-xs: 6px;
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 24px;
  --r-pill: 999px;

  /* Shadow */
  --sh-xs: 0 1px 2px rgba(11, 13, 18, .04);
  --sh-sm: 0 1px 3px rgba(11, 13, 18, .06), 0 1px 2px rgba(11, 13, 18, .04);
  --sh-md: 0 6px 16px -6px rgba(11, 13, 18, .10), 0 2px 6px rgba(11, 13, 18, .06);
  --sh-lg: 0 24px 40px -16px rgba(11, 13, 18, .18), 0 8px 16px -8px rgba(11, 13, 18, .08);
  --sh-focus: 0 0 0 3px rgba(194, 135, 41, .25);
}

/* ============================================================
   Dark theme — main content inverts; sidebar stays dark.
   Activated by html[data-theme="dark"] (toggled by JS, persisted in localStorage).
   ============================================================ */
html[data-theme="dark"] {
  --bg:           #0E1014;
  --bg-2:         #15181E;
  --surface:      #181B22;
  --surface-2:    #1F232B;

  --ink:          #F4F6FA;
  --ink-2:        #E1E4EA;
  --ink-3:        #C4C9D3;
  --text:         #E5E8EE;
  --text-2:       #B7BDC6;
  --muted:        #8C939E;
  --muted-2:      #6E737B;

  --line:         rgba(255, 255, 255, .08);
  --line-2:       rgba(255, 255, 255, .05);
  --line-strong:  rgba(255, 255, 255, .14);

  /* Status backgrounds — translucent overlays of the foreground colour */
  --success-bg:   rgba(15, 143, 91, .18);
  --warning-bg:   rgba(178, 106, 0, .22);
  --danger-bg:    rgba(192, 50, 43, .22);
  --info-bg:      rgba(31, 91, 184, .22);
  --gold-bg:      rgba(232, 163, 58, .15);
  --neutral-bg:   rgba(255, 255, 255, .06);

  /* Marigold — warm, food-brand, premium on dark surfaces. Replaces the harsh bright yellow. */
  --gold:         #E8A33A;
  --gold-2:       #C48421;
  --gold-soft:    rgba(232, 163, 58, .35);

  /* Slightly brighter functional colours so they read on dark surfaces */
  --success:      #2BB378;
  --warning:      #E8A23A;
  --danger:       #E66058;
  --info:         #5A8AE0;

  /* Shadows deepen on dark surfaces */
  --sh-xs: 0 1px 2px rgba(0, 0, 0, .35);
  --sh-sm: 0 2px 6px rgba(0, 0, 0, .35), 0 1px 2px rgba(0, 0, 0, .25);
  --sh-md: 0 8px 22px -8px rgba(0, 0, 0, .55), 0 3px 8px rgba(0, 0, 0, .35);
  --sh-lg: 0 28px 48px -18px rgba(0, 0, 0, .65), 0 10px 20px -8px rgba(0, 0, 0, .45);
}

/* OSM / Leaflet tiles look harsh on dark — invert + hue-rotate gives a usable dark map */
html[data-theme="dark"] .leaflet-tile-pane { filter: invert(1) hue-rotate(180deg) brightness(.9) contrast(.85); }
html[data-theme="dark"] .leaflet-control-attribution { background: rgba(24, 27, 34, .85); color: var(--text-2); }
html[data-theme="dark"] .leaflet-control-attribution a { color: var(--text); }

/* Inputs in dark mode need a darker fill or they look like punched holes */
html[data-theme="dark"] .input,
html[data-theme="dark"] input[type="text"],
html[data-theme="dark"] input[type="email"],
html[data-theme="dark"] input[type="tel"],
html[data-theme="dark"] input[type="number"],
html[data-theme="dark"] input[type="date"],
html[data-theme="dark"] input[type="time"],
html[data-theme="dark"] input[type="password"],
html[data-theme="dark"] textarea,
html[data-theme="dark"] select {
  background: var(--bg-2);
  color: var(--text);
  border-color: var(--line);
}
html[data-theme="dark"] .btn-ghost {
  background: var(--surface);
  border-color: var(--line-strong);
  color: var(--text);
}
html[data-theme="dark"] .btn-ghost:hover { background: var(--bg-2); }
html[data-theme="dark"] code { background: var(--bg-2); color: #F2C26A; padding: 1px 6px; border-radius: 4px; }

/* Gold-backed elements need dark text in both themes (gold itself is a light hue) */
html[data-theme="dark"] .btn-gold,
html[data-theme="dark"] .btn-gold:hover,
html[data-theme="dark"] .avatar,
html[data-theme="dark"] .sidebar-brand .mark {
  color: #0F1115;
}
/* Elements that use --ink as background flip to light surface in dark mode.
   Their hardcoded `color: white` becomes white-on-white. Force dark text. */
html[data-theme="dark"] .btn-primary,
html[data-theme="dark"] .btn-primary:hover,
html[data-theme="dark"] .pill-ink,
html[data-theme="dark"] .status-DELIVERED,
html[data-theme="dark"] .status-FULFILLED,
html[data-theme="dark"] .status-PAID,
html[data-theme="dark"] .step-rail .step.current {
  color: #0F1115;
}
/* Active sidebar nav: gold accent rail reads cleaner in the new tone */
html[data-theme="dark"] .nav a.active { box-shadow: inset 2px 0 0 var(--gold); }
/* Gold pill: ensure foreground reads on the translucent gold bg */
html[data-theme="dark"] .pill-gold { color: #F2C26A; }

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }
body {
  font-family: var(--f-body);
  font-size: 14px;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: inherit; text-decoration: none; transition: color .15s ease; }
a:hover { color: var(--gold); }
button { font: inherit; cursor: pointer; border: 0; background: none; color: inherit; }
ul, ol { margin: 0; padding: 0; list-style: none; }
img, svg { display: block; max-width: 100%; }
hr { border: 0; border-top: 1px solid var(--line); margin: 16px 0; }

h1, h2, h3, h4 {
  margin: 0;
  font-weight: 600;
  letter-spacing: -.01em;
  color: var(--ink);
  line-height: 1.25;
}
/* Browser default of 700 for <strong>/<b> reads as blocky on dark surfaces.
   Tame to 600 (semi-bold) so emphasis stays clear without smearing. */
strong, b { font-weight: 600; }
h1 { font-size: 22px; }
h2 { font-size: 18px; }
h3 { font-size: 15px; }
h4 { font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 600; }

.display { font-family: var(--f-display); font-weight: 500; letter-spacing: -.02em; }
.mono { font-family: var(--f-mono); }
.muted { color: var(--muted); }
.muted-2 { color: var(--muted-2); }
.ta-right { text-align: right; }
.ta-center { text-align: center; }
.flex { display: flex; gap: 12px; align-items: center; }
.flex-1 { flex: 1; }
.space-between { justify-content: space-between; }
.col { display: flex; flex-direction: column; gap: 12px; }
.mt-8 { margin-top: 8px; } .mt-12 { margin-top: 12px; } .mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; } .mt-32 { margin-top: 32px; }
.mb-8 { margin-bottom: 8px; } .mb-12 { margin-bottom: 12px; } .mb-16 { margin-bottom: 16px; } .mb-24 { margin-bottom: 24px; }

::selection { background: var(--gold-soft); color: var(--ink); }

code {
  font-family: var(--f-mono);
  font-size: 12px;
  background: var(--neutral-bg);
  padding: 2px 6px;
  border-radius: var(--r-xs);
  color: var(--ink-2);
}

/* ---------- App shell ---------- */
.app {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: 100vh;
}

/* ----- Sidebar ----- */
.sidebar {
  background: var(--sidebar);
  color: var(--sidebar-text);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  border-right: 1px solid var(--sidebar-line);
  /* Hide scrollbar but allow scrolling when content overflows */
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.sidebar::-webkit-scrollbar { width: 0; height: 0; display: none; }
.sidebar-brand {
  display: flex; align-items: center; gap: 11px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--sidebar-line);
  color: var(--sidebar-text-strong);
}
.sidebar-brand .mark {
  width: 38px; height: 38px;
  border-radius: 10px;
  display: block;
  flex-shrink: 0;
  box-shadow: 0 6px 14px -4px rgba(194, 135, 41, .5);
}
.sidebar-brand .word {
  font-family: var(--f-display);
  font-size: 20px;
  letter-spacing: -.02em;
  line-height: 1.05;
}
.sidebar-brand .word small {
  display: block;
  font-family: var(--f-mono);
  font-size: 9px;
  letter-spacing: .25em;
  text-transform: uppercase;
  color: var(--sidebar-text-muted);
  margin-top: 2px;
}

.sidebar-section { padding: 8px 8px 0; }
.sidebar-section + .sidebar-section {
  margin-top: 10px;
  padding-top: 8px;
}
.sidebar-section-title {
  font-family: var(--f-mono);
  font-size: 9px;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--sidebar-text-muted);
  padding: 0 10px 4px;
  opacity: .75;
}

.nav { display: flex; flex-direction: column; gap: 1px; }
.nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 5px 10px;
  border-radius: var(--r-sm);
  color: var(--sidebar-text);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.4;
  transition: background .15s ease, color .15s ease;
}
.nav a:hover {
  background: var(--sidebar-2);
  color: var(--sidebar-text-strong);
}
.nav a.active {
  background: var(--sidebar-2);
  color: var(--sidebar-text-strong);
  box-shadow: inset 2px 0 0 var(--gold);
}
.nav a .icon { width: 15px; height: 15px; flex-shrink: 0; color: currentColor; opacity: .85; }
.nav a .badge {
  margin-left: auto;
  background: var(--gold);
  color: var(--ink);
  font-size: 11px;
  font-weight: 600;
  padding: 1px 7px;
  border-radius: var(--r-pill);
}

.sidebar-foot {
  margin-top: auto;
  padding: 10px 12px;
  border-top: 1px solid var(--sidebar-line);
  display: flex; align-items: center; gap: 9px;
}
.avatar {
  width: 30px; height: 30px;
  border-radius: var(--r-pill);
  background: linear-gradient(135deg, var(--gold-soft), var(--gold));
  color: var(--ink);
  display: grid; place-items: center;
  font-weight: 600; font-size: 12px;
  flex-shrink: 0;
}
.sidebar-foot .avatar { width: 30px; height: 30px; font-size: 12px; }
.sidebar-foot .who { display: flex; flex-direction: column; min-width: 0; }
.sidebar-foot .who strong { color: var(--sidebar-text-strong); font-size: 12.5px; font-weight: 600; }
.sidebar-foot .who small { font-size: 10.5px; color: var(--sidebar-text-muted); }
.sidebar-foot .logout-btn {
  margin-left: auto;
  color: var(--sidebar-text-muted);
  width: 28px; height: 28px;
  border-radius: var(--r-sm);
  display: grid; place-items: center;
  transition: background .15s, color .15s;
}
.sidebar-foot .logout-btn:hover { background: var(--sidebar-2); color: var(--sidebar-text-strong); }
/* Theme toggle: show moon in light, sun in dark. */
.theme-toggle .theme-icon-light { display: none; }
.theme-toggle .theme-icon-dark  { display: block; }
html[data-theme="dark"] .theme-toggle .theme-icon-light { display: block; }
html[data-theme="dark"] .theme-toggle .theme-icon-dark  { display: none; }

/* ----- Main column ----- */
.main {
  display: flex; flex-direction: column;
  min-width: 0;     /* lets tables scroll */
  background: var(--bg);
}
.topbar {
  height: var(--topbar-h);
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center;
  padding: 0 28px;
  gap: 16px;
  position: sticky; top: 0; z-index: 5;
}
.topbar h1 {
  font-size: 17px;
  font-weight: 600;
  margin: 0;
}
.topbar .crumbs {
  font-size: 12px;
  color: var(--muted);
  display: flex; align-items: center; gap: 6px;
}
.topbar .crumbs .sep { color: var(--line-strong); }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.searchbox {
  display: flex; align-items: center; gap: 8px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  padding: 6px 14px;
  min-width: 240px;
  color: var(--muted);
}
.searchbox input {
  border: 0; background: transparent; outline: none;
  flex: 1; font-size: 13px; color: var(--ink);
}
.icon-btn {
  width: 36px; height: 36px;
  border-radius: var(--r-sm);
  display: grid; place-items: center;
  color: var(--muted);
  transition: background .15s, color .15s;
}
.icon-btn:hover { background: var(--bg-2); color: var(--ink); }

.page {
  padding: 28px;
  display: flex; flex-direction: column; gap: 24px;
}
.page-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  flex-wrap: wrap; gap: 16px;
}
.page-head h1 {
  font-family: var(--f-display);
  font-weight: 500;
  font-size: 28px;
  letter-spacing: -.02em;
  color: var(--ink);
}
.page-head .sub { color: var(--muted); font-size: 14px; margin-top: 4px; }

/* ---------- Flash messages ---------- */
.flashes { display: flex; flex-direction: column; gap: 8px; }
.flash {
  display: flex; align-items: flex-start; gap: 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 3px solid var(--gold);
  border-radius: var(--r-md);
  padding: 10px 14px;
  font-size: 13.5px;
  box-shadow: var(--sh-xs);
}
.flash-info { border-left-color: var(--info); }
.flash-error { border-left-color: var(--danger); background: var(--danger-bg); }

/* ---------- Cards ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  box-shadow: var(--sh-xs);
}
.card-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line-2);
}
.card-head h2 { font-size: 14px; font-weight: 600; }
.card-head .sub { font-size: 12px; color: var(--muted); }
.card-body { padding: 20px; }
.card-foot { padding: 14px 20px; border-top: 1px solid var(--line-2); display: flex; justify-content: flex-end; gap: 10px; }
.card-flush { padding: 0; }
.card-flush .data-table { border: 0; border-radius: 0; box-shadow: none; }
.card-flush .data-table thead th:first-child,
.card-flush .data-table tbody td:first-child { padding-left: 20px; }
.card-flush .data-table thead th:last-child,
.card-flush .data-table tbody td:last-child { padding-right: 20px; }

/* ---------- Metric cards ---------- */
.metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}
.metric {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 18px 20px;
  box-shadow: var(--sh-xs);
  position: relative;
  overflow: hidden;
}
.metric .metric-label {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px;
  color: var(--muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .06em;
}
.metric .metric-label .icon {
  width: 16px; height: 16px;
  padding: 4px;
  background: var(--neutral-bg);
  border-radius: var(--r-xs);
  color: var(--ink-2);
  box-sizing: content-box;
}
.metric .metric-label .icon.gold  { background: var(--gold-bg);    color: var(--gold-2); }
.metric .metric-label .icon.green { background: var(--success-bg); color: var(--success); }
.metric .metric-label .icon.blue  { background: var(--info-bg);    color: var(--info); }
.metric .metric-label .icon.red   { background: var(--danger-bg);  color: var(--danger); }
.metric .metric-value {
  font-family: var(--f-display);
  font-weight: 500;
  font-size: 28px;
  color: var(--ink);
  letter-spacing: -.02em;
  margin-top: 10px;
  line-height: 1.1;
}
.metric .metric-foot {
  margin-top: 6px;
  font-size: 12px;
  color: var(--muted);
  display: flex; align-items: center; gap: 6px;
}
.trend { display: inline-flex; align-items: center; gap: 3px; font-weight: 600; font-size: 12px; }
.trend-up   { color: var(--success); }
.trend-down { color: var(--danger); }
.trend-flat { color: var(--muted); }

/* ---------- Grid helpers ---------- */
.row {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 16px;
}
.col-12 { grid-column: span 12; }
.col-8  { grid-column: span 8; }
.col-6  { grid-column: span 6; }
.col-4  { grid-column: span 4; }
.col-3  { grid-column: span 3; }
@media (max-width: 1100px) { .col-8, .col-6, .col-4, .col-3 { grid-column: span 12; } }

/* ---------- Tables ---------- */
.data-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  overflow: hidden;
  font-size: 13.5px;
  box-shadow: var(--sh-xs);
}
.data-table thead th {
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
  text-align: left;
  font-weight: 600;
  font-size: 11.5px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 10px 14px;
}
.data-table tbody td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line-2);
  vertical-align: middle;
}
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover td { background: var(--surface-2); }
.data-table tfoot td { padding: 12px 14px; font-weight: 500; background: var(--surface-2); border-top: 1px solid var(--line); }
.data-table .cell-strong { font-weight: 600; color: var(--ink); }
.data-table .cell-money { font-family: var(--f-mono); font-variant-numeric: tabular-nums; }
.actions-cell { display: flex; gap: 10px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 500;
  border-radius: var(--r-sm);
  border: 1px solid transparent;
  transition: background .15s ease, color .15s ease, transform .08s ease, box-shadow .15s ease;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn .icon { width: 15px; height: 15px; }
.btn-primary {
  background: var(--ink);
  color: white;
  border-color: var(--ink);
}
.btn-primary:hover { background: var(--ink-2); color: white; }
.btn-gold {
  background: var(--gold);
  color: var(--ink);
  border-color: var(--gold);
  font-weight: 600;
}
.btn-gold:hover { background: var(--gold-2); color: var(--ink); }
.btn-ghost {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--line);
  box-shadow: var(--sh-xs);
}
.btn-ghost:hover { background: var(--bg-2); }
.btn-danger {
  background: var(--surface);
  color: var(--danger);
  border-color: var(--line);
}
.btn-danger:hover { background: var(--danger-bg); border-color: var(--danger-bg); }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-icon {
  padding: 8px;
  width: 34px; height: 34px;
}
.link-btn {
  background: none; border: 0; padding: 0;
  color: var(--info);
  font-weight: 500;
  font-size: 13px;
}
.link-btn:hover { text-decoration: underline; }

/* ---------- Forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field-label { font-size: 12px; font-weight: 600; color: var(--text-2); letter-spacing: .02em; }
.field-hint  { font-size: 12px; color: var(--muted); }
.field input, .field textarea, .field select,
input.input, select.input, textarea.input {
  width: 100%;
  padding: 10px 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  font: inherit;
  font-size: 13.5px;
  color: var(--ink);
  transition: border-color .15s, box-shadow .15s;
}
.field input:focus, .field textarea:focus, .field select:focus,
input.input:focus, select.input:focus, textarea.input:focus {
  outline: 0;
  border-color: var(--gold);
  box-shadow: var(--sh-focus);
}
.field textarea { resize: vertical; min-height: 80px; }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; }
@media (max-width: 700px) { .row-2, .row-3 { grid-template-columns: 1fr; } }
.radio-row, .check-row {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: background .15s, border-color .15s;
}
.radio-row:hover, .check-row:hover { background: var(--bg); }
.radio-row input, .check-row input { accent-color: var(--gold); }
.qty-input { width: 76px; }

/* ---------- Status pills ---------- */
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 9px;
  border-radius: var(--r-pill);
  font-family: var(--f-mono);
  font-size: 10.5px;
  letter-spacing: .08em;
  text-transform: uppercase;
  font-weight: 600;
  background: var(--neutral-bg);
  color: var(--ink-2);
  border: 1px solid transparent;
}
.pill::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor;
}
.pill-success      { color: var(--success); background: var(--success-bg); }
.pill-warning      { color: var(--warning); background: var(--warning-bg); }
.pill-danger       { color: var(--danger);  background: var(--danger-bg); }
.pill-info         { color: var(--info);    background: var(--info-bg); }
.pill-gold         { color: var(--gold-2);  background: var(--gold-bg); }
.pill-ember        { color: var(--warning); background: var(--warning-bg); }
.pill-ink          { color: white; background: var(--ink); }

/* status -> pill mapping */
.status-DRAFT             { color: var(--muted);   background: var(--neutral-bg); }
.status-PLACED            { color: var(--gold-2);  background: var(--gold-bg); }
.status-ACCEPTED          { color: var(--info);    background: var(--info-bg); }
.status-PREPARING         { color: var(--warning); background: var(--warning-bg); }
.status-READY             { color: var(--success); background: var(--success-bg); }
.status-OUT_FOR_DELIVERY  { color: var(--gold-2);  background: var(--gold-bg); }
.status-DELIVERED         { color: white;          background: var(--ink); }
.status-CANCELLED         { color: var(--danger);  background: var(--danger-bg); }
.status-active            { color: var(--success); background: var(--success-bg); }
.status-inactive          { color: var(--muted);   background: var(--neutral-bg); }
.status-OPEN              { color: var(--success); background: var(--success-bg); }
.status-CLOSED            { color: var(--muted);   background: var(--neutral-bg); }
.status-MAINTENANCE       { color: var(--warning); background: var(--warning-bg); }
.status-ONLINE            { color: var(--success); background: var(--success-bg); }
.status-OFFLINE           { color: var(--muted);   background: var(--neutral-bg); }
.status-ON_TRIP           { color: var(--gold-2);  background: var(--gold-bg); }
.status-REQUESTED         { color: var(--gold-2);  background: var(--gold-bg); }
.status-ACKNOWLEDGED      { color: var(--info);    background: var(--info-bg); }
.status-IN_TRANSIT        { color: var(--warning); background: var(--warning-bg); }
.status-DISPATCHED        { color: var(--warning); background: var(--warning-bg); }
.status-FULFILLED         { color: white;          background: var(--ink); }
.status-CREATED           { color: var(--info);    background: var(--info-bg); }
.status-CAPTURED          { color: var(--success); background: var(--success-bg); }
.status-FAILED            { color: var(--danger);  background: var(--danger-bg); }
.status-REFUNDED          { color: var(--muted);   background: var(--neutral-bg); }
/* Hiring Phase 2 statuses */
.status-SCHEDULED         { color: var(--info);    background: var(--info-bg); }
.status-COMPLETED         { color: var(--success); background: var(--success-bg); }
.status-MISSED            { color: var(--danger);  background: var(--danger-bg); }
.status-PRESENT           { color: var(--success); background: var(--success-bg); }
.status-LATE              { color: var(--warning); background: var(--warning-bg); }
.status-HALF_DAY          { color: var(--gold-2);  background: var(--gold-bg); }
.status-ABSENT            { color: var(--danger);  background: var(--danger-bg); }
.status-FINALIZED         { color: var(--info);    background: var(--info-bg); }
.status-PAID              { color: white;          background: var(--ink); }
.status-warning           { color: var(--warning); background: var(--warning-bg); }

/* ---------- Pipeline (the 7-step order lifecycle) ---------- */
.pipeline {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 6px;
  padding: 16px 20px;
}
@media (max-width: 900px) { .pipeline { grid-template-columns: repeat(3, 1fr); } }
.pipe-step {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 12px 14px;
  position: relative;
}
.pipe-step .pipe-label {
  font-family: var(--f-mono);
  font-size: 10px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
}
.pipe-step .pipe-count {
  font-family: var(--f-display);
  font-weight: 500;
  font-size: 26px;
  color: var(--ink);
  letter-spacing: -.02em;
  line-height: 1.1;
  margin-top: 4px;
}
.pipe-step .pipe-bar {
  position: absolute; left: 0; right: 0; bottom: 0;
  height: 3px; border-radius: 0 0 var(--r-md) var(--r-md);
}
.pipe-PLACED   .pipe-bar { background: var(--gold); }
.pipe-ACCEPTED .pipe-bar { background: var(--info); }
.pipe-PREPARING .pipe-bar { background: var(--warning); }
.pipe-READY    .pipe-bar { background: var(--success); }
.pipe-OUT_FOR_DELIVERY .pipe-bar { background: var(--gold-2); }
.pipe-DELIVERED .pipe-bar { background: var(--ink); }

/* Step rail for order detail */
.step-rail {
  display: flex; gap: 0;
  background: var(--bg);
  border-radius: var(--r-md);
  padding: 4px;
  overflow-x: auto;
}
.step-rail .step {
  flex: 1;
  display: flex; flex-direction: column; gap: 4px;
  padding: 10px 12px;
  border-radius: var(--r-sm);
  color: var(--muted);
  min-width: 110px;
}
.step-rail .step strong {
  font-family: var(--f-mono);
  font-size: 10px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: inherit;
}
.step-rail .step small { font-size: 12px; }
.step-rail .step.done    { background: var(--surface); color: var(--ink); box-shadow: var(--sh-xs); }
.step-rail .step.current { background: var(--ink); color: white; box-shadow: var(--sh-md); }
.step-rail .step.current strong { color: var(--gold-soft); }

/* ---------- Chart container ---------- */
.chart {
  width: 100%;
  min-height: 280px;
}
.chart-sm { min-height: 200px; }

/* ---------- Misc ---------- */
.kpi-strip {
  display: flex; gap: 14px; flex-wrap: wrap;
  font-size: 13px;
  color: var(--muted);
}
.kpi-strip .item { display: inline-flex; gap: 6px; }
.kpi-strip .item strong { color: var(--ink); font-weight: 600; }

.timeline { display: flex; flex-direction: column; gap: 10px; }
.timeline li {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 12px;
  background: var(--bg);
  border-radius: var(--r-sm);
  font-size: 13px;
}
.timeline li strong { font-weight: 500; }

.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; }
.dot-success { background: var(--success); }
.dot-warning { background: var(--warning); }
.dot-danger  { background: var(--danger); }
.dot-info    { background: var(--info); }

.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--muted);
}
.empty-state .icon {
  width: 40px; height: 40px;
  margin: 0 auto 12px;
  color: var(--muted-2);
}

/* ---------- Auth screens (premium centered card) ---------- */
.auth-shell {
  position: relative;
  min-height: 100vh; min-height: 100dvh;
  display: grid; place-items: center;
  padding: 24px;
  overflow: hidden;
  background:
    radial-gradient(900px 480px at 50% -12%, rgba(232, 163, 58, .18), transparent 62%),
    radial-gradient(680px 360px at 0% 100%, rgba(184, 58, 27, .12), transparent 60%),
    var(--bg);
}
.auth-shell::before {
  content: ""; position: absolute; z-index: 0;
  width: 540px; height: 540px; border-radius: 50%;
  top: -190px; left: 50%; transform: translateX(-50%);
  background: radial-gradient(circle, var(--gold-soft), transparent 70%);
  filter: blur(22px); opacity: .55; pointer-events: none;
  animation: authGlow 7s ease-in-out infinite;
}
@keyframes authGlow {
  0%, 100% { opacity: .42; transform: translateX(-50%) scale(1); }
  50%      { opacity: .7;  transform: translateX(-50%) scale(1.08); }
}
.auth-card {
  position: relative; z-index: 1;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-lg), inset 0 0 0 1px rgba(232, 163, 58, .05);
  padding: 38px 34px;
  max-width: 430px; width: 100%;
  animation: authCardIn .5s cubic-bezier(.2, .8, .2, 1) both;
}
@keyframes authCardIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.auth-card .brand-head {
  display: flex; align-items: center; gap: 11px;
  margin-bottom: 24px;
}
.auth-card .brand-head .mark {
  width: 42px; height: 42px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-2) 100%);
  display: grid; place-items: center;
  color: #0F1115;
  font-family: var(--f-display);
  font-weight: 600;
  font-size: 22px;
  box-shadow: 0 6px 18px -6px rgba(232, 163, 58, .7), inset 0 0 0 1px rgba(255, 255, 255, .14);
}
.auth-card h1 {
  font-family: var(--f-display);
  font-size: 27px;
  font-weight: 500;
  letter-spacing: -.02em;
  margin-bottom: 6px;
}
.auth-card .step {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--gold-2);
  margin-bottom: 6px;
}
.auth-card .step::before { content: ""; width: 18px; height: 1px; background: var(--gold-2); opacity: .55; }
.auth-card .input { font-size: 15px; padding: 12px 14px; }
.auth-card .btn-gold { margin-top: 4px; padding: 13px; font-size: 14.5px; }
.auth-trust {
  display: flex; gap: 16px; flex-wrap: wrap; justify-content: center;
  margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--line);
}
.auth-trust span { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; color: var(--muted); }
.auth-trust i { width: 13px; height: 13px; color: var(--gold-2); }
.seed-hint {
  margin-top: 22px;
  padding: 14px 16px;
  background: var(--surface-2);
  border: 1px dashed var(--line-strong);
  border-radius: var(--r-md);
  font-size: 12.5px;
}
.seed-hint summary { font-weight: 600; cursor: pointer; color: var(--ink); }
.seed-hint ul { margin-top: 10px; display: flex; flex-direction: column; gap: 4px; padding-left: 0; }
.seed-hint code { font-size: 11px; }
/* Phone-first: the card becomes a full-bleed app screen */
@media (max-width: 560px) {
  .auth-shell { padding: 0; place-items: stretch; }
  .auth-card {
    max-width: none; min-height: 100vh; min-height: 100dvh;
    border: 0; border-radius: 0; box-shadow: none;
    display: flex; flex-direction: column; justify-content: center;
    padding: calc(30px + env(safe-area-inset-top)) 22px calc(30px + env(safe-area-inset-bottom));
  }
  .auth-card h1 { font-size: 30px; }
  .auth-card .input { font-size: 16px; }   /* ≥16px stops iOS zoom-on-focus */
}

/* ---------- Customer storefront (uses same chrome but warmer) ---------- */
.storefront .hero-stall {
  background: linear-gradient(135deg, #1F2127 0%, #0F1115 100%);
  color: white;
  padding: 28px 32px;
  border-radius: var(--r-lg);
  display: flex; gap: 24px; align-items: center; justify-content: space-between;
  flex-wrap: wrap;
}
.storefront .hero-stall h1 {
  font-family: var(--f-display);
  font-size: 28px;
  color: white;
  letter-spacing: -.02em;
}
.storefront .hero-stall .stall-meta {
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--gold-soft);
}
.storefront .hero-stall .stall-meta .dot { background: var(--success); margin-right: 6px; }

.menu-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}
/* Fixed 5-up grid for catalog pages (recipe + supply). Degrades on narrower screens. */
.menu-grid-5 {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 14px;
}
@media (max-width: 1500px) { .menu-grid-5 { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 1180px) { .menu-grid-5 { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 820px)  { .menu-grid-5 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 540px)  { .menu-grid-5 { grid-template-columns: 1fr; } }
.menu-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 18px;
  display: flex; flex-direction: column; gap: 8px;
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s;
  box-shadow: var(--sh-xs);
}
.menu-card:hover { transform: translateY(-2px); box-shadow: var(--sh-md); border-color: var(--gold-soft); }
.menu-card .cat {
  font-family: var(--f-mono);
  font-size: 10px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--gold-2);
}
.menu-card h3 { margin: 4px 0; }
.menu-card .desc { font-size: 13px; color: var(--muted); flex: 1; }
.menu-card .foot {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 10px;
}
.menu-card .price {
  font-family: var(--f-display);
  font-weight: 500;
  font-size: 18px;
  color: var(--ink);
}

/* ---------- Mobile sidebar collapse ---------- */
@media (max-width: 900px) {
  :root { --sidebar-w: 0px; }
  .app { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed;
    width: 248px;
    z-index: 100;
    transform: translateX(-100%);
    transition: transform .2s ease;
  }
  .sidebar.open { transform: translateX(0); }
  .topbar { padding: 0 16px; }
  .page { padding: 16px; }
}
.menu-toggle {
  display: none;
  width: 36px; height: 36px;
  border-radius: var(--r-sm);
  align-items: center; justify-content: center;
  color: var(--ink);
}
@media (max-width: 900px) { .menu-toggle { display: inline-flex; } }

/* ---------- Admin dashboard tabs (Network / Customers / Rentals / …) ---------- */
.dash-tabs {
  display: flex;
  gap: 4px;
  padding: 6px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.dash-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: var(--r-pill);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-2);
  white-space: nowrap;
  transition: background .15s, color .15s, transform .08s;
  flex-shrink: 0;
}
.dash-tab:hover { background: var(--surface); color: var(--ink); }
.dash-tab.active {
  background: var(--ink);
  color: white;
  box-shadow: var(--sh-sm);
}
.dash-tab.active:hover { color: white; }
.dash-tab .icon { width: 14px; height: 14px; }

/* Dark theme: active tab uses marigold gold (since --ink flips to light, the default would be invisible). */
html[data-theme="dark"] .dash-tab.active,
html[data-theme="dark"] .dash-tab.active:hover {
  background: var(--gold);
  color: #0F1115;
  box-shadow: 0 4px 14px -4px rgba(232, 163, 58, .45);
}
html[data-theme="dark"] .dash-tab:hover { background: rgba(255, 255, 255, .06); color: var(--ink); }
html[data-theme="dark"] .dash-tab { color: var(--text-2); }

/* ============================================================
   Landing pages (marketing chrome for the 8 subdomains)
   ============================================================ */

.land-shell { background: var(--surface); color: var(--ink); }
.land-nav {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center;
  padding: 16px clamp(20px, 4vw, 48px);
  background: rgba(255, 255, 255, .8);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.land-nav .brand {
  display: inline-flex; align-items: center; gap: 10px;
  color: var(--ink);
}
.land-nav .brand .mark {
  width: 32px; height: 32px; border-radius: 9px;
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-2) 100%);
  display: grid; place-items: center; color: white;
  font-family: var(--f-display); font-weight: 600; font-size: 16px;
}
.land-nav .brand .word {
  font-family: var(--f-display); font-size: 18px;
  letter-spacing: -.02em; font-weight: 500;
}
.land-nav .brand small {
  font-family: var(--f-mono); font-size: 9px;
  letter-spacing: .22em; text-transform: uppercase;
  color: var(--muted); display: block; margin-top: 1px;
}
.land-nav-right { margin-left: auto; display: flex; gap: 12px; align-items: center; }

/* Hero with palette-based gradient */
.land-hero {
  padding: clamp(60px, 9vw, 110px) clamp(20px, 4vw, 48px) clamp(50px, 8vw, 90px);
  position: relative; overflow: hidden;
}
.land-hero-inner {
  max-width: 1100px; margin: 0 auto;
  display: grid; grid-template-columns: 1fr; gap: 28px;
  position: relative; z-index: 2;
}
.land-hero .kicker {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--f-mono); font-size: 11px;
  letter-spacing: .22em; text-transform: uppercase;
  color: var(--gold-2); font-weight: 600;
}
.land-hero .kicker::before {
  content: ""; width: 24px; height: 1px; background: currentColor;
}
.land-hero h1 {
  font-family: var(--f-display);
  font-weight: 500;
  font-size: clamp(40px, 6vw, 68px);
  line-height: 1.02;
  letter-spacing: -.025em;
  color: var(--ink);
  max-width: 860px;
}
.land-hero p.lede {
  font-size: clamp(15px, 1.4vw, 18px);
  color: var(--text-2);
  max-width: 620px;
  line-height: 1.55;
}
.land-hero-cta { display: flex; gap: 12px; flex-wrap: wrap; }

/* Hero ambient gradient — yellow accents on white, with one dark variant.
   All palette- classes kept (template references them); colors all map to yellow/grey/white. */
.land-hero.palette-ember     { background: radial-gradient(900px 500px at 100% 0%, rgba(245, 197, 24, .18), transparent 60%), radial-gradient(800px 460px at -10% 100%, rgba(31, 33, 39, .04), transparent 60%); }
.land-hero.palette-gold      { background: radial-gradient(900px 500px at 100% 0%, rgba(245, 197, 24, .25), transparent 60%), radial-gradient(800px 460px at -10% 100%, rgba(252, 231, 137, .22), transparent 60%); }
.land-hero.palette-olive     { background: radial-gradient(900px 500px at 100% 0%, rgba(74, 81, 96, .07), transparent 60%), radial-gradient(800px 460px at -10% 100%, rgba(245, 197, 24, .16), transparent 60%); }
.land-hero.palette-ink       { color: white; background: radial-gradient(900px 500px at 100% 0%, rgba(245, 197, 24, .30), transparent 50%), linear-gradient(135deg, #1F2127 0%, #0F1115 100%); }
.land-hero.palette-ink h1    { color: white; }
.land-hero.palette-ink .lede { color: rgba(255,255,255,.85); }
.land-hero.palette-ink .kicker { color: var(--gold-soft); }
.land-hero.palette-embergold { background: radial-gradient(900px 500px at 100% 0%, rgba(245, 197, 24, .25), transparent 60%), radial-gradient(800px 460px at -10% 100%, rgba(31, 33, 39, .04), transparent 60%); }
.land-hero.palette-warm      { background: radial-gradient(900px 500px at 100% 0%, rgba(245, 197, 24, .18), transparent 60%), radial-gradient(800px 460px at -10% 100%, rgba(255, 248, 221, 1), rgba(255, 248, 221, .2) 60%, transparent 80%); }

/* Decorative icon in hero corner */
.land-hero .hero-icon {
  position: absolute; right: -40px; bottom: -40px;
  width: 280px; height: 280px;
  opacity: .06; color: var(--ink);
  z-index: 1;
}
.land-hero.palette-ink .hero-icon { color: white; opacity: .12; }

/* Hero stat strip */
.hero-stats {
  display: flex; gap: 36px; flex-wrap: wrap;
  margin-top: 12px;
  padding-top: 22px;
  border-top: 1px solid rgba(0,0,0,.08);
}
.land-hero.palette-ink .hero-stats { border-top-color: rgba(255,255,255,.12); }
.hero-stat .num {
  font-family: var(--f-display); font-weight: 500;
  font-size: 32px; letter-spacing: -.02em; line-height: 1;
}
.hero-stat .lbl {
  font-family: var(--f-mono); font-size: 11px;
  letter-spacing: .16em; text-transform: uppercase;
  color: var(--muted); margin-top: 4px;
}
.land-hero.palette-ink .hero-stat .lbl { color: rgba(255,255,255,.6); }

/* Sections */
.land-section {
  padding: clamp(50px, 7vw, 90px) clamp(20px, 4vw, 48px);
}
.land-section-inner {
  max-width: 1100px; margin: 0 auto;
}
.land-section .eyebrow {
  font-family: var(--f-mono); font-size: 11px;
  letter-spacing: .22em; text-transform: uppercase;
  color: var(--gold-2); font-weight: 600;
  margin-bottom: 12px;
}
.land-section h2 {
  font-family: var(--f-display);
  font-weight: 500; font-size: clamp(28px, 3.4vw, 40px);
  letter-spacing: -.02em; color: var(--ink);
  max-width: 780px; line-height: 1.1;
}
.land-section .sub {
  color: var(--muted); margin-top: 12px;
  font-size: 16px; max-width: 620px;
}

.land-section.alt { background: var(--surface-2); }

/* Feature grid */
.feature-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px; margin-top: 36px;
}
.feature {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-md); padding: 22px 22px 24px;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.feature:hover { transform: translateY(-2px); box-shadow: var(--sh-md); border-color: var(--gold-soft); }
.feature .ficon {
  width: 36px; height: 36px;
  border-radius: 10px;
  background: var(--gold-bg);
  color: var(--gold-2);
  display: grid; place-items: center;
  margin-bottom: 14px;
}
.feature h3 { font-size: 16px; font-weight: 600; margin-bottom: 6px; }
.feature p { font-size: 13.5px; color: var(--muted); line-height: 1.55; }

/* Steps */
.step-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px; margin-top: 36px;
}
.step-card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-md); padding: 24px;
  position: relative;
}
.step-card .n {
  font-family: var(--f-display); font-weight: 500;
  font-size: 40px; line-height: 1; color: var(--gold);
  letter-spacing: -.02em;
}
.step-card h3 { font-size: 16px; font-weight: 600; margin: 12px 0 6px; }
.step-card p { font-size: 13.5px; color: var(--muted); line-height: 1.55; }

/* CTA banner */
.land-cta {
  margin: 0;
  padding: clamp(50px, 7vw, 90px) clamp(20px, 4vw, 48px);
  background: var(--ink); color: white;
  text-align: center;
}
.land-cta h2 {
  font-family: var(--f-display); font-weight: 500;
  font-size: clamp(28px, 3.4vw, 44px);
  letter-spacing: -.02em; color: white;
  max-width: 720px; margin: 0 auto;
  line-height: 1.1;
}
.land-cta p { color: rgba(255,255,255,.7); margin-top: 12px; }
.land-cta .btn-gold { margin-top: 24px; }

/* Footer */
.land-foot {
  padding: 24px clamp(20px, 4vw, 48px);
  border-top: 1px solid var(--line);
  background: var(--surface);
  display: flex; justify-content: space-between; gap: 16px;
  font-size: 12px; color: var(--muted); flex-wrap: wrap;
}
.land-foot a { color: var(--muted); }
.land-foot a:hover { color: var(--ink); }

/* App-landing role grid (for app.grilzo.com main page) */
.role-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px; margin-top: 36px;
}
.role-card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-md); padding: 24px;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
  display: flex; flex-direction: column; gap: 10px;
}
.role-card:hover { transform: translateY(-2px); box-shadow: var(--sh-md); border-color: var(--gold-soft); }
.role-card .ricon {
  width: 40px; height: 40px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--gold-bg), var(--gold-soft));
  color: var(--gold-2);
  display: grid; place-items: center;
}
.role-card h3 { font-size: 16px; font-weight: 600; }
.role-card .sub { font-size: 13px; color: var(--muted); flex: 1; }
.role-card .domain {
  font-family: var(--f-mono); font-size: 11px;
  color: var(--gold-2); letter-spacing: .04em;
}

/* Rentals: variant cards */
.variant-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px; margin-top: 36px;
}
.variant-card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-md); padding: 24px;
  display: flex; flex-direction: column; gap: 10px;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.variant-card:hover { transform: translateY(-2px); box-shadow: var(--sh-md); border-color: var(--gold-soft); }
.variant-card .vbadge {
  align-self: flex-start;
  font-family: var(--f-mono); font-size: 10px;
  letter-spacing: .18em; text-transform: uppercase;
  background: var(--gold-bg); color: var(--gold-2);
  padding: 4px 10px; border-radius: var(--r-pill);
}
.variant-card h3 {
  font-family: var(--f-display); font-size: 22px;
  font-weight: 500; letter-spacing: -.02em;
}
.variant-card .price {
  font-family: var(--f-display);
  font-size: 28px; color: var(--ink); font-weight: 500;
  letter-spacing: -.02em;
}
.variant-card .price small {
  font-family: var(--f-body); font-size: 13px;
  color: var(--muted); font-weight: 400;
}
.variant-card ul {
  list-style: none; padding: 0; margin: 8px 0 0;
  display: flex; flex-direction: column; gap: 6px;
}
.variant-card li {
  font-size: 13px; color: var(--text-2);
  display: flex; align-items: flex-start; gap: 8px;
}
.variant-card li::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%;
  background: var(--gold); margin-top: 7px; flex-shrink: 0;
}

/* Inquiry form */
.inquiry-card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: 32px;
  box-shadow: var(--sh-md);
  max-width: 620px; margin: 36px auto 0;
}


/* ============================================================
   PWA mobile app shell — bottom nav, app bar, install
   ============================================================ */
.bottom-nav { display: none; }
.app-bar-actions { display: flex; align-items: center; gap: 6px; }
.icon-badge-btn {
  position: relative; width: 38px; height: 38px; border-radius: var(--r-sm);
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--ink); background: transparent; border: 0; cursor: pointer; text-decoration: none;
}
.icon-badge-btn:hover { background: var(--bg-2); }
.icon-badge-btn .badge {
  position: absolute; top: 3px; right: 3px; min-width: 16px; height: 16px; padding: 0 4px;
  background: var(--danger); color: #fff; font-size: 9px; font-weight: 700;
  border-radius: 999px; display: flex; align-items: center; justify-content: center;
}

@media (max-width: 900px) {
  .pwa-investor .bottom-nav {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 95;
    background: var(--surface); border-top: 1px solid var(--line);
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom, 0px));
    box-shadow: 0 -6px 20px -8px rgba(11, 13, 18, .14);
  }
  .bottom-nav a {
    flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px;
    padding: 5px 0; color: var(--muted); font-size: 10px; font-weight: 600;
    text-decoration: none; position: relative; transition: color .15s;
  }
  .bottom-nav a .icon { width: 22px; height: 22px; }
  .bottom-nav a.active { color: var(--gold-2); }
  .bottom-nav a.active .icon { color: var(--gold-2); }
  .bottom-nav .bn-badge {
    position: absolute; top: 0; left: 56%; background: var(--danger); color: #fff;
    font-size: 9px; font-weight: 700; min-width: 15px; height: 15px; padding: 0 3px;
    border-radius: 999px; display: flex; align-items: center; justify-content: center;
  }
  .pwa-investor .page { padding-bottom: 86px; }
  /* sticky app bar on mobile */
  .topbar { position: sticky; top: 0; z-index: 80; background: var(--surface);
            border-bottom: 1px solid var(--line); }
}

/* ============================================================
   Investor mobile — premium dark/gold polish
   ============================================================ */
@media (max-width: 900px) {
  /* Floating pill bottom nav */
  .pwa-investor .bottom-nav {
    left: 12px; right: 12px; bottom: 12px; border-radius: 22px;
    border: 1px solid var(--line); background: var(--surface);
    box-shadow: 0 14px 36px -10px rgba(0, 0, 0, .55), 0 2px 8px rgba(0, 0, 0, .25);
    padding: 8px 6px calc(8px + env(safe-area-inset-bottom, 0px));
  }
  .pwa-investor .bottom-nav a { border-radius: 14px; transition: color .15s, background .15s; }
  .pwa-investor .bottom-nav a.active {
    background: var(--gold-bg);
  }
  .pwa-investor .page { padding-bottom: 104px; }

  /* Premium app bar */
  .pwa-investor .topbar {
    background: var(--surface); backdrop-filter: blur(12px);
  }
  .pwa-investor .topbar h1 { font-size: 19px; }

  /* Glassy, rounded cards + metrics on mobile */
  .pwa-investor .card,
  .pwa-investor .kpi,
  .pwa-investor .metric { border-radius: 18px; }
  .pwa-investor .card { box-shadow: 0 1px 0 rgba(255,255,255,.02); }
  .pwa-investor .page { padding-left: 14px; padding-right: 14px; }

  /* Bigger, punchier display numbers */
  .pwa-investor .metric-value,
  .pwa-investor .kpi-val { letter-spacing: -.01em; }

  /* Tap targets */
  .pwa-investor .btn { padding: 11px 16px; }
  .pwa-investor .link-btn { padding: 4px 0; }
}

/* Mobile: show only essential nav items in the drawer; deep analytics stay desktop/tablet only */
@media (max-width: 900px) {
  .pwa-investor .nav-deep { display: none !important; }
}

/* ============================================================
   No horizontal scrollbars + outlet selector tabs
   ============================================================ */
.page { overflow-x: hidden; }

.tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.tab {
  padding: 7px 14px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--surface); color: var(--muted); font-size: 13px; font-weight: 600; text-decoration: none;
}
.tab:hover { border-color: var(--line-strong); color: var(--ink); }
.tab.active { background: var(--gold); border-color: var(--gold); color: #0F1115; }

@media (max-width: 900px) {
  img { max-width: 100%; height: auto; }
  .metrics, .row, .card { max-width: 100%; }
  /* tables fit the screen — wrap instead of scroll */
  .data-table { width: 100%; font-size: 12px; }
  .data-table th, .data-table td {
    padding: 8px 6px; white-space: normal !important; word-break: break-word; overflow-wrap: anywhere;
  }
  .data-table code { font-size: 11px; }
}

/* Live orders — mobile: drop the outlet column (shown as a subtitle), cap recent to 10 */
.outlet-sub { display: none; }
@media (max-width: 900px) {
  .col-outlet { display: none; }
  .outlet-sub { display: block; font-size: 11px; margin-top: 3px; }
  #recent-body tr:nth-child(n+11) { display: none; }
}

/* ============================================================
   Investor portal — stack tables into label/value cards on phones
   ============================================================ */
@media (max-width: 640px) {
  .pwa-investor .data-table thead { display: none; }
  .pwa-investor .data-table,
  .pwa-investor .data-table tbody { display: block; width: 100%; }
  .pwa-investor .data-table tr {
    display: block; padding: 12px 16px; border-bottom: 1px solid var(--line);
  }
  .pwa-investor .data-table tr:last-child { border-bottom: 0; }
  .pwa-investor .data-table td {
    display: flex; justify-content: space-between; align-items: center; gap: 14px;
    padding: 4px 0; border: 0; text-align: right; white-space: normal; font-size: 13px;
  }
  .pwa-investor .data-table td::before {
    content: attr(data-label); color: var(--muted); font-weight: 600; font-size: 11px;
    letter-spacing: .03em; text-transform: uppercase; text-align: left; flex-shrink: 0;
  }
  /* first cell of each row reads as a heading */
  .pwa-investor .data-table td.cell-head {
    font-family: var(--f-display); font-size: 15px; color: var(--ink);
    border-bottom: 1px dashed var(--line); padding-bottom: 8px; margin-bottom: 4px;
  }
  .pwa-investor .data-table td.cell-head::before { content: ""; }
  .pwa-investor .data-table td:empty { display: none; }
  .pwa-investor .data-table td.ta-right { justify-content: space-between; }
  /* forms inside a stacked cell keep to the right */
  .pwa-investor .data-table td form { margin-left: auto; }
}

/* In stacked mode (phones) show the outlet as its own labelled row, not the subtitle */
@media (max-width: 640px) {
  .pwa-investor .col-outlet { display: flex; }
  .pwa-investor .outlet-sub { display: none; }
}

/* ============================================================
   Mobile tables → two-part card (heading on top, details in 2 cols)
   + business-setup 2-column grid
   ============================================================ */
@media (max-width: 640px) {
  .pwa-investor .data-table tr {
    display: grid; grid-template-columns: 1fr 1fr; gap: 6px 14px; align-items: start;
  }
  .pwa-investor .data-table td {
    display: flex; flex-direction: column; align-items: flex-start; justify-content: flex-start;
    gap: 1px; text-align: left; padding: 2px 0;
  }
  .pwa-investor .data-table td::before { font-size: 10px; }
  .pwa-investor .data-table td.cell-head {
    grid-column: 1 / -1; flex-direction: row; align-items: center; gap: 8px;
  }
  .pwa-investor .data-table td[data-label=""] { grid-column: 1 / -1; align-items: stretch; }
  .pwa-investor .data-table td.ta-right { align-items: flex-start; }

  /* Business setup: 2 columns, no dead space */
  .biz-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
  .biz-grid .col-3 { grid-column: auto; }
}

/* ============================================================
   Camera tiles — premium live-console look
   ============================================================ */
@keyframes grz-pulse { 0%,100% { opacity: 1; } 50% { opacity: .35; } }
.cam-tile {
  border-radius: var(--r-md); overflow: hidden;
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}
.cam-tile.card:hover { transform: translateY(-3px); box-shadow: var(--sh-lg); border-color: var(--gold); }
.cam-frame {
  background: #05070a;
  box-shadow: inset 0 0 70px rgba(0,0,0,.65);
  border-radius: var(--r-sm);
}
.cam-frame::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(120% 100% at 50% 0%, transparent 60%, rgba(0,0,0,.35) 100%);
  border-radius: inherit;
}
.cam-tile .pill { backdrop-filter: blur(4px); }
.cam-tile .pill span { animation: grz-pulse 1.6s infinite; }
.cam-tile .icon-badge-btn { color: var(--ink); }
.cam-tile .icon-badge-btn:hover { background: var(--gold); color: #0F1115; }

/* a touch more lift on investor cards (mobile) */
@media (max-width: 900px) {
  .pwa-investor .card { transition: transform .15s ease, box-shadow .15s ease; }
}

/* ============================================================
   UX layer — toasts, top progress bar, tap feedback
   ============================================================ */
.flashes {
  position: fixed; top: 12px; left: 50%; transform: translateX(-50%);
  z-index: 1000; display: flex; flex-direction: column; gap: 8px;
  width: min(440px, calc(100% - 24px)); pointer-events: none;
}
.flash {
  pointer-events: auto; display: flex; align-items: flex-start; gap: 10px;
  padding: 12px 14px; border-radius: 12px; background: var(--surface);
  border: 1px solid var(--line); border-left: 3px solid var(--gold);
  box-shadow: var(--sh-lg); font-size: 14px; color: var(--text); cursor: pointer;
  animation: toastIn .28s cubic-bezier(.2,.8,.2,1);
}
.flash span { flex: 1; }
.flash-close { color: var(--muted); flex-shrink: 0; margin-top: 1px; opacity: .7; }
.flash-info i:first-child { color: var(--success); }
.flash-error { border-left-color: var(--danger); }
.flash-error i:first-child { color: var(--danger); }
.flash-out { animation: toastOut .26s forwards; }
@keyframes toastIn { from { opacity: 0; transform: translateY(-10px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateY(-12px); height: 0; padding-top: 0; padding-bottom: 0; margin: 0; } }

#grz-bar {
  position: fixed; top: 0; left: 0; height: 3px; width: 0; z-index: 1001; opacity: 0;
  background: linear-gradient(90deg, var(--gold), var(--gold-2));
  box-shadow: 0 0 10px var(--gold); transition: width .2s ease, opacity .3s ease;
}
#grz-bar.go { opacity: 1; width: 88%; transition: width 8s cubic-bezier(.1,.7,.1,1); }
#grz-bar.done { opacity: 0; width: 100%; transition: width .2s ease, opacity .35s ease .1s; }

/* tactile tap feedback */
.btn, .bottom-nav a, .icon-badge-btn, .tab, .dash-tab { transition: transform .1s ease, background .15s ease, color .15s ease, border-color .15s ease, box-shadow .15s ease; }
.btn:active, .bottom-nav a:active, .icon-badge-btn:active, .tab:active, .dash-tab:active { transform: scale(.96); }
.pwa-investor .card:active { transform: scale(.995); }
/* keyboard focus visibility */
a:focus-visible, .btn:focus-visible, .input:focus-visible, button:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

/* Pull-to-refresh indicator (investor mobile) */
#ptr {
  position: fixed; top: 0; left: 50%; transform: translate(-50%, -48px); z-index: 999;
  width: 38px; height: 38px; border-radius: 50%; background: var(--surface);
  border: 1px solid var(--line); box-shadow: var(--sh-md); display: grid; place-items: center;
  color: var(--gold-2); opacity: 0; transition: opacity .15s ease;
}
#ptr.show { opacity: 1; }
#ptr.spin i { animation: grz-spin .8s linear infinite; }
@keyframes grz-spin { to { transform: rotate(360deg); } }

/* ============================================================
   Mobile tables — compact 3–4 column table (override stacking)
   Show only essential columns (.m-hide is dropped on phones)
   ============================================================ */
@media (max-width: 900px) {
  .pwa-investor .data-table { display: table; width: 100%; font-size: 12.5px; }
  .pwa-investor .data-table thead { display: table-header-group; }
  .pwa-investor .data-table tbody { display: table-row-group; }
  .pwa-investor .data-table tfoot { display: table-footer-group; }
  .pwa-investor .data-table tr { display: table-row; padding: 0; border: 0; }
  .pwa-investor .data-table th,
  .pwa-investor .data-table td {
    display: table-cell; width: auto; gap: 0; padding: 9px 7px; text-align: left;
    border: 0; border-bottom: 1px solid var(--line); white-space: normal; word-break: break-word;
    flex-direction: initial; align-items: initial;
  }
  .pwa-investor .data-table th { font-size: 10px; color: var(--muted); }
  .pwa-investor .data-table td::before,
  .pwa-investor .data-table th::before { content: none !important; }
  .pwa-investor .data-table td.ta-right,
  .pwa-investor .data-table th.ta-right { text-align: right; }
  .pwa-investor .data-table td.cell-head {
    font-family: inherit; font-size: 12.5px; border-bottom: 1px solid var(--line);
    padding-bottom: 9px; margin-bottom: 0;
  }
  /* drop non-essential columns on phones */
  .pwa-investor .data-table .m-hide { display: none !important; }
}

@media (max-width: 900px) { .pwa-investor .m-show { display: inline !important; } }

/* Outlet column: never shown on mobile (authoritative) */
@media (max-width: 900px) {
  .pwa-investor .col-outlet { display: none !important; }
}

/* ============================================================
   Flashy full-screen loader (auth / loading states)
   ============================================================ */
#grz-loader {
  position: fixed; inset: 0; z-index: 2000; display: none;
  align-items: center; justify-content: center;
  background: radial-gradient(60% 60% at 50% 38%, rgba(22, 17, 8, .82), rgba(8, 9, 12, .94));
  -webkit-backdrop-filter: blur(7px); backdrop-filter: blur(7px);
}
#grz-loader.show { display: flex; animation: grzLoaderIn .22s ease both; }
@keyframes grzLoaderIn { from { opacity: 0; } to { opacity: 1; } }
.grz-loader-card { display: flex; flex-direction: column; align-items: center; gap: 20px; }
.grz-loader-spin { position: relative; width: 86px; height: 86px; }
.grz-loader-ring {
  position: absolute; inset: 0; border-radius: 50%;
  background: conic-gradient(from 0deg, transparent 0deg, var(--gold) 130deg, var(--gold-2) 290deg, transparent 360deg);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 8px), #000 calc(100% - 7px));
          mask: radial-gradient(farthest-side, transparent calc(100% - 8px), #000 calc(100% - 7px));
  animation: grzLoaderSpin .9s linear infinite;
  filter: drop-shadow(0 0 16px rgba(232, 163, 58, .55));
}
.grz-loader-mark {
  position: absolute; inset: 0; display: grid; place-items: center;
  font-family: var(--f-display); font-weight: 600; font-size: 32px;
  color: var(--gold); text-shadow: 0 0 20px rgba(232, 163, 58, .6);
  animation: grzLoaderPulse 1.3s ease-in-out infinite;
}
@keyframes grzLoaderSpin { to { transform: rotate(360deg); } }
@keyframes grzLoaderPulse { 0%, 100% { transform: scale(1); opacity: .9; } 50% { transform: scale(1.12); opacity: 1; } }
.grz-loader-text {
  font-size: 12px; letter-spacing: .18em; text-transform: uppercase; font-weight: 600;
  background: linear-gradient(90deg, rgba(233, 216, 182, .3) 0%, #fff 50%, rgba(233, 216, 182, .3) 100%);
  background-size: 200% 100%;
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
  animation: grzLoaderShimmer 1.6s linear infinite;
}
@keyframes grzLoaderShimmer { to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) {
  .grz-loader-ring, .grz-loader-mark, .grz-loader-text, .auth-shell::before, .auth-card { animation-duration: .001ms !important; }
}

/* ============================================================
   Dashboard mobile: wallet 2-col + outlet "this month / est net" side-by-side
   ============================================================ */
@media (max-width: 900px) {
  /* Wallet card: two columns, third stat spans the full width below */
  .pwa-investor .wstats { grid-template-columns: 1fr 1fr; gap: 14px; }
  .pwa-investor .wstats .col-4 { grid-column: auto; }
  .pwa-investor .wstats .col-4:last-child {
    grid-column: 1 / -1; margin-top: 4px; padding-top: 12px; border-top: 1px solid var(--line);
  }
}
@media (max-width: 700px) {
  /* Outlet card: keep "This month" + "Your est. net" on one row */
  .pwa-investor .row-2.keep-2 { grid-template-columns: 1fr 1fr; gap: 12px; }
}

/* ============================================================
   Onboarding card — each step as its own row (number + text)
   ============================================================ */
.onb-step { display: flex; gap: 12px; align-items: flex-start; }
.onb-step .onb-n {
  flex: none; width: 28px; height: 28px; border-radius: 50%;
  background: var(--gold-bg); color: var(--gold-2); border: 1px solid var(--gold-soft);
  display: grid; place-items: center; font-weight: 700; font-size: 13px; margin-top: 1px;
}
.onb-step strong { display: block; font-size: 13.5px; }
.onb-step p { margin: 2px 0 0; }

/* ============================================================
   Install app — small dismissible popup (not in the top bar)
   ============================================================ */
.install-pop {
  position: fixed; z-index: 96; display: none; align-items: center; gap: 12px;
  left: 12px; right: 12px; bottom: calc(86px + env(safe-area-inset-bottom, 0px));
  background: var(--surface); border: 1px solid var(--line-strong);
  border-radius: 16px; box-shadow: var(--sh-lg); padding: 12px 12px 12px 14px;
}
.install-pop.show { display: flex; animation: installPopIn .32s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes installPopIn { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
.install-pop-mark {
  flex: none; width: 38px; height: 38px; border-radius: 11px;
  background: linear-gradient(135deg, var(--gold), var(--gold-2)); color: #0F1115;
  font-family: var(--f-display); font-weight: 600; font-size: 20px;
  display: grid; place-items: center; box-shadow: 0 4px 12px -4px rgba(232, 163, 58, .6);
}
.install-pop-txt { flex: 1; min-width: 0; line-height: 1.3; }
.install-pop-txt strong { display: block; font-size: 14px; }
.install-pop-txt span { font-size: 11.5px; color: var(--muted); }
.install-pop .btn-gold { flex: none; }
.install-pop-x {
  flex: none; width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center;
  color: var(--muted); background: transparent;
}
.install-pop-x:hover { background: var(--bg-2); color: var(--ink); }
@media (min-width: 901px) {
  .install-pop { left: auto; right: 20px; bottom: 20px; max-width: 380px; }
}

/* ============================================================
   Investor mobile — compact app header (smaller bar + title)
   ============================================================ */
@media (max-width: 900px) {
  .pwa-investor .topbar { height: 50px; padding: 0 12px; gap: 10px; }
  .pwa-investor .topbar h1 { font-size: 15px; font-weight: 600; letter-spacing: -.01em; }
  .pwa-investor .topbar .crumbs,
  .pwa-investor .topbar-sub { display: none; }
  .pwa-investor .topbar .icon-badge-btn,
  .pwa-investor .topbar .menu-toggle { width: 34px; height: 34px; }
  .pwa-investor .topbar .menu-toggle .icon { width: 19px; height: 19px; }
}

/* ============================================================
   Responsive variant toggles — show one block on desktop, another on mobile
   (used by the investor dashboard so desktop layout stays unchanged)
   ============================================================ */
.only-mobile { display: none; }
@media (max-width: 900px) {
  .only-desktop { display: none !important; }
  .only-mobile { display: block !important; }
}

/* ============================================================
   Edge-to-edge PWA — sit cleanly against the device system bars.
   viewport-fit=cover enables env(safe-area-inset-*); without it these are 0,
   so browsers (non-installed) are unaffected. Mobile / investor app only.
   ============================================================ */
@media (max-width: 900px) {
  /* Dark app header fills the status-bar / notch region */
  .pwa-investor .topbar {
    height: calc(50px + env(safe-area-inset-top, 0px));
    padding-top: env(safe-area-inset-top, 0px);
  }
  /* Floating bottom nav rides ABOVE the home indicator / gesture bar */
  .pwa-investor .bottom-nav {
    bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    padding: 8px 6px;
  }
  /* Keep page content clear of the floating nav + system bar */
  .pwa-investor .page {
    padding-bottom: calc(104px + env(safe-area-inset-bottom, 0px));
  }
}

/* ============================================================
   Mobile home — merged "Last payout / This month" card:
   shrink the two side-by-side currency values so they fit on narrow phones
   ============================================================ */
@media (max-width: 900px) {
  .pwa-investor .only-mobile .keep-2 .kpi-val { font-size: clamp(15px, 4.5vw, 19px); }
}

/* ============================================================
   Mobile stack utility — force a 2-column .row of undefined col-5/col-7
   cards into two full-width rows. Used by Wallet (Withdraw + history)
   and Refer & earn (Invite + Your referrals).
   ============================================================ */
@media (max-width: 900px) {
  .pwa-investor .wd-stack { grid-template-columns: 1fr; gap: 16px; }
  .pwa-investor .wd-stack > [class*="col-"] { grid-column: 1 / -1; }
}

/* ============================================================
   Mobile outlet — show only the 6 most recent orders (desktop keeps all)
   ============================================================ */
@media (max-width: 900px) {
  .pwa-investor #outlet-recent-body tr:nth-child(n+7) { display: none; }
}

/* ============================================================
   Mobile Refer & earn — premium reward hero
   (markup lives in .only-mobile, so these only render on phones)
   ============================================================ */
.ref-hero-m {
  position: relative; overflow: hidden; text-align: center;
  border-radius: var(--r-lg); padding: 22px 20px 20px;
  background: linear-gradient(160deg, var(--gold-bg) 0%, var(--surface) 70%);
  border: 1px solid var(--gold-soft); box-shadow: var(--sh-md);
}
.ref-hero-m::before {
  content: ""; position: absolute; top: -80px; right: -50px; width: 220px; height: 220px;
  border-radius: 50%; background: radial-gradient(circle, var(--gold-soft), transparent 70%);
  opacity: .6; pointer-events: none;
}
.ref-hero-m > * { position: relative; }
.ref-badge {
  display: inline-flex; align-items: center; gap: 6px;
  background: linear-gradient(135deg, var(--gold), var(--gold-2)); color: #0F1115;
  font-weight: 700; font-size: 12px; padding: 6px 13px; border-radius: 999px;
  box-shadow: 0 6px 16px -6px rgba(232, 163, 58, .7);
}
.ref-badge i { width: 14px; height: 14px; }
.ref-earned-lbl { margin-top: 16px; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.ref-earned { font-family: var(--f-display); font-size: 42px; line-height: 1; color: var(--success); margin-top: 3px; }
.ref-counts { display: flex; align-items: center; justify-content: center; gap: 10px; margin-top: 8px; font-size: 12px; color: var(--muted); }
.ref-counts b { color: var(--ink); }
.ref-counts .dot { width: 4px; height: 4px; border-radius: 50%; background: var(--muted-2); }
.ref-code-wrap {
  position: relative; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-top: 18px; padding: 12px 16px; text-align: left; cursor: pointer;
  background: var(--surface); border: 1.5px dashed var(--gold-2); border-radius: var(--r-md);
  transition: transform .1s ease, border-color .15s ease;
}
.ref-code-wrap:active { transform: scale(.99); }
.ref-code-lbl { font-size: 10px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.ref-code-big { font-family: var(--f-mono); font-size: 24px; letter-spacing: .14em; color: var(--ink); margin-top: 2px; }
.ref-code-wrap > i { width: 20px; height: 20px; color: var(--gold-2); flex: none; }
.ref-code-wrap.copied { border-color: var(--success); }
.ref-code-wrap.copied::after {
  content: "Copied ✓"; position: absolute; top: 8px; right: 10px;
  background: var(--success); color: #fff; font-size: 10px; font-weight: 700;
  padding: 2px 8px; border-radius: 999px; animation: refCopiedIn .18s ease;
}
@keyframes refCopiedIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.ref-share { width: 100%; margin-top: 14px; padding: 13px; font-size: 14.5px; }

/* ============================================================
   Mobile Profile & Banking — premium profile header
   (markup in .only-mobile, so renders on phones only)
   ============================================================ */
.prof-hero {
  display: flex; align-items: center; gap: 14px;
  border-radius: var(--r-lg); padding: 18px;
  background: linear-gradient(160deg, var(--gold-bg), var(--surface) 70%);
  border: 1px solid var(--gold-soft); box-shadow: var(--sh-sm);
}
.prof-ava {
  flex: none; width: 54px; height: 54px; border-radius: 50%;
  background: linear-gradient(135deg, var(--gold), var(--gold-2)); color: #0F1115;
  display: grid; place-items: center; font-family: var(--f-display); font-weight: 600; font-size: 24px;
  box-shadow: 0 6px 16px -6px rgba(232, 163, 58, .6);
}
.prof-name { font-family: var(--f-display); font-size: 19px; color: var(--ink); line-height: 1.1; }
.prof-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.prof-pills { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }

/* ============================================================
   Cart photos — installed-cart angle views (admin manage + investor gallery)
   ============================================================ */
.cart-photo-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px;
}
.cart-photo {
  position: relative; display: block; border-radius: var(--r-sm); overflow: hidden;
  border: 1px solid var(--line); background: var(--bg-2);
  transition: transform .12s ease, box-shadow .15s ease;
}
.cart-photo:hover { transform: translateY(-2px); box-shadow: var(--sh-md); }
.cart-photo img { display: block; width: 100%; height: 140px; object-fit: cover; }
.cart-photo-cap {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 4px 8px; font-size: 11px;
  color: #fff; background: linear-gradient(transparent, rgba(0,0,0,.62));
}
.cart-photo-del { position: absolute; top: 5px; right: 5px; margin: 0; }
.cart-photo-del button {
  width: 24px; height: 24px; border-radius: 50%; background: rgba(0,0,0,.55); color: #fff;
  display: grid; place-items: center; cursor: pointer;
}
.cart-photo-del button:hover { background: var(--danger); }
@media (max-width: 560px) {
  .cart-photo-grid { grid-template-columns: 1fr 1fr; }
  .cart-photo img { height: 120px; }
}
