/* ═══════════════════════════════════════════════════════════════
   AKILLI UI — Light Neumorphism Design System
   Single theme · Soft surfaces · Top-left lighting · 8px grid
   ═══════════════════════════════════════════════════════════════ */

/* ── 1. FONT IMPORTS ─────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700&display=swap');

/* ── 2. CSS VARIABLES — LIGHT NEUMORPHISM ────────────────────── */
:root {
  /* Base surface (same for page, cards, sidebar, buttons) */
  --surface:       #E6E7EE;
  --surface-hover: #DEE0E8;

  /* Neumorphic lighting: top-left light, bottom-right dark */
  --shadow-light:  #FFFFFF;
  --shadow-dark:   #C8CAD4;

  /* Raised: soft outer shadows (light top-left, dark bottom-right) */
  --raised-sm:    -3px -3px 6px var(--shadow-light), 3px 3px 6px var(--shadow-dark);
  --raised:       -6px -6px 12px var(--shadow-light), 6px 6px 12px var(--shadow-dark);
  --raised-lg:    -8px -8px 16px var(--shadow-light), 8px 8px 16px var(--shadow-dark);

  /* Inset: pressed into surface (inputs, search, filters) */
  --inset:        inset 4px 4px 8px var(--shadow-dark), inset -4px -4px 8px var(--shadow-light);
  --inset-sm:     inset 2px 2px 4px var(--shadow-dark), inset -2px -2px 4px var(--shadow-light);

  /* Accent — screenshot-inspired green */
  --accent:       #22C55E;
  --accent-dim:   rgba(34, 197, 94, 0.14);

  /* Text */
  --text:         #0F172A;
  --text-muted:   #64748B;
  --text-subtle:  #94A3B8;

  /* Status (small labels only) */
  --status-delivered:  #22C55E;
  --status-pending:    #F59E0B;
  --status-cancelled: #EF4444;
  --status-transit:   #3B82F6;

  /* Border radius system */
  --radius-card:   24px;
  --radius-btn:    16px;
  --radius-input:  14px;
  --radius-panel:  24px;
  --radius-modal:  28px;
  --radius-pill:   9999px;

  /* Typography */
  --font-sans:     'Outfit', system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  --font-display:  'Outfit', system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;

  /* Type scale */
  --text-page:     28px;
  --text-section:  22px;
  --text-card:     16px;
  --text-metric:   32px;
  --text-table:    14px;
  --text-small:    12px;

  /* Spacing (8px grid) */
  --space-8:       8px;
  --space-16:      16px;
  --space-24:      24px;
  --space-32:      32px;
  --space-48:      48px;
  --space-64:      64px;

  /* Layout */
  --sidebar-w:     260px;
  --topbar-h:      64px;
  --content-max:   1400px;
  --t-fast:        0.18s ease;
  --control-h:     40px;
  --control-h-sm:  36px;

  /* Responsive breakpoints (use in media queries) */
  --bp-desktop:    1280px;
  --bp-laptop:     1024px;
  --bp-tablet:     768px;
  --bp-mobile:     767px;
  --content-pad-d: 24px;
  --content-pad-t: 20px;
  --content-pad-m: 16px;
  --heading-d:     24px;
  --heading-t:     22px;
  --heading-m:     20px;
  --body-d:        16px;
  --body-t:        15px;
  --body-m:        14px;
  --touch-min:     44px;
  --btn-gap:       12px;

  /* Aliases for pages that still reference old vars */
  --bg:            var(--surface);
  --card:          var(--surface);
  --card-hover:    var(--surface-hover);
  --border:        rgba(34, 197, 94, 0.20);
  --border-light:  rgba(200, 202, 212, 0.35);
  --secondary:     #fff;
  --primary-hover: #5558e3;
  --green:         var(--status-delivered);
  --red:           var(--status-cancelled);
  --red-dim:       rgba(239, 68, 68, 0.12);
}

/* ── 3. RESET & BASE ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; height: 100%; }
body {
  font-family: var(--font-sans);
  font-size: var(--body-d);
  color: var(--text);
  background:
    radial-gradient(circle at 18% -8%, rgba(34, 197, 94, 0.26), transparent 48%),
    radial-gradient(circle at 88% 2%, rgba(34, 197, 94, 0.12), transparent 42%),
    var(--surface);
  line-height: 1.5;
  min-height: 100%;
  height: 100%;
  overflow: hidden;
}
a { text-decoration: none; color: inherit; }
button { cursor: pointer; font-family: var(--font-sans); border: none; background: none; }
input, select, textarea { font-family: var(--font-sans); }
img { max-width: 100%; }
ul, ol { list-style: none; }

/* Scrollbar — defined in UI V2 block (single source, 8px) */

/* ── 4. LAYOUT ───────────────────────────────────────────────── */
.layout {
  display: flex;
  height: 100vh;
  min-height: 100vh;
  position: relative;
  z-index: 1;
  overflow: hidden;
}

.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-w);
  height: 100vh;
  max-height: 100vh;
  background: var(--surface);
  box-shadow: 4px 0 16px rgba(200, 202, 212, 0.22);
  display: flex;
  flex-direction: column;
  z-index: 100;
  transition: transform var(--t-fast);
  overflow: hidden;
}

.content-wrap {
  flex: 1;
  margin-left: var(--sidebar-w);
  min-width: 0;
  height: 100vh;
  max-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.topbar {
  flex-shrink: 0;
  z-index: 90;
  height: var(--topbar-h);
  background: var(--surface);
  box-shadow: var(--raised-sm);
  display: flex;
  align-items: center;
}

.topbar-inner {
  width: 100%;
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 var(--content-pad-d);
  display: flex;
  align-items: center;
  gap: var(--space-16);
}

.main-content {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 0 var(--space-24);
  padding: var(--space-32) var(--content-pad-d);
  max-width: var(--content-max);
  width: 100%;
  margin: 0 auto;
}
.main-content > * { grid-column: 1 / -1; }

/* ── 5. SIDEBAR ──────────────────────────────────────────────── */
.sidebar-logo {
  flex-shrink: 0;
  padding: var(--space-24) var(--space-16);
  border-bottom: none;
}
.sidebar-logo-img { height: 26px; width: auto; display: block; }

.sidebar-nav {
  flex: 1;
  min-height: 0;
  padding: var(--space-16) var(--space-8);
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.nav-section-label {
  font-family: var(--font-sans);
  font-size: var(--text-small);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: var(--space-8) var(--space-16);
  margin-top: var(--space-8);
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px var(--space-16);
  border-radius: var(--radius-btn);
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  transition: all var(--t-fast);
  position: relative;
  cursor: pointer;
  user-select: none;
  background: var(--surface);
  box-shadow: var(--raised-sm);
}
.nav-item svg {
  width: 18px; height: 18px;
  flex-shrink: 0;
  stroke: currentColor; fill: none;
  stroke-width: 1.75;
  stroke-linecap: round; stroke-linejoin: round;
}
.nav-item:hover {
  box-shadow: var(--raised);
  transform: translateY(-1px);
}
.nav-item.active {
  background: var(--accent-dim);
  color: var(--accent);
  box-shadow: var(--inset-sm);
  border-left: 3px solid var(--accent);
  padding-left: calc(var(--space-16) - 3px);
}
.nav-item.active svg { stroke: var(--accent); }
.nav-badge {
  margin-left: auto;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  background: var(--accent-dim);
  color: var(--accent);
  padding: 3px 8px;
  border-radius: var(--radius-pill);
}
.nav-item.nav-disabled { opacity: 0.5; cursor: not-allowed; pointer-events: none; }

.sidebar-footer {
  flex-shrink: 0;
  padding: var(--space-16);
  font-size: var(--text-small);
  color: var(--text-muted);
  line-height: 1.4;
  border-top: none;
}
.status-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--status-delivered);
  display: inline-block;
}
.sidebar-status { display: flex; align-items: center; gap: 8px; }
.status-label { font-size: var(--text-small); font-weight: 600; color: var(--status-delivered); }
.status-sub { font-size: 11px; color: var(--text-subtle); margin-top: 2px; }

.hamburger-btn {
  display: none;
  align-items: center; justify-content: center;
  width: 40px; height: 40px;
  border-radius: var(--radius-btn);
  background: var(--surface);
  box-shadow: var(--raised-sm);
  color: var(--text-muted);
}
.hamburger-btn:hover { box-shadow: var(--raised); }
.hamburger-btn svg { width: 18px; height: 18px; }

/* ── 6. TOPBAR ───────────────────────────────────────────────── */
.topbar-left { display: flex; align-items: center; gap: var(--space-16); flex: 1; }
.topbar-right { display: flex; align-items: center; gap: var(--space-16); flex-shrink: 0; }
.topbar-divider { width: 1px; height: 24px; background: var(--shadow-dark); flex-shrink: 0; }

.page-title {
  font-family: var(--font-display);
  font-size: var(--heading-d);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
  white-space: nowrap;
  flex-shrink: 0;
}
.greeting { font-size: 14px; color: var(--text-muted); margin-left: var(--space-8); }
.greeting strong { color: var(--text); font-weight: 600; }

/* Search — inset surface */
.topbar-search {
  position: relative;
  flex: 0 1 auto;
  max-width: 320px;
  min-width: 200px;
}
.topbar-search-icon {
  position: absolute; left: 14px; top: 50%;
  transform: translateY(-50%);
  width: 16px; height: 16px;
  color: var(--text-subtle);
  pointer-events: none;
}
.topbar-search input {
  width: 100%;
  height: var(--control-h);
  padding: 12px 16px 12px 42px;
  background: var(--surface);
  border: none;
  border-radius: var(--radius-input);
  box-shadow: var(--inset);
  font-size: 14px;
  font-family: var(--font-sans);
  color: var(--text);
  outline: none;
  transition: box-shadow var(--t-fast);
}
.topbar-search input::placeholder { color: var(--text-subtle); }
.topbar-search input:focus { box-shadow: var(--inset), 0 0 0 2px var(--accent-dim); }
.search-shortcut {
  position: absolute; right: 12px; top: 50%;
  transform: translateY(-50%);
  font-size: 10px; font-weight: 600;
  color: var(--text-subtle);
}

.topbar-icon-btn {
  display: flex; align-items: center; justify-content: center;
  width: var(--control-h); height: var(--control-h);
  border-radius: var(--radius-btn);
  background: var(--surface);
  box-shadow: var(--raised-sm);
  color: var(--text-muted);
  transition: all var(--t-fast);
}
.topbar-icon-btn:hover {
  box-shadow: var(--raised);
  transform: translateY(-1px);
  color: var(--accent);
}
.topbar-icon-btn:active { box-shadow: var(--inset-sm); transform: translateY(0); }
.topbar-icon-btn svg { width: 18px; height: 18px; }

.user-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--surface);
  box-shadow: var(--raised-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700;
  color: var(--text);
  flex-shrink: 0;
  cursor: pointer;
  transition: all var(--t-fast);
}
.user-avatar:hover { box-shadow: var(--raised); transform: translateY(-1px); }

/* ── 7. METRIC CARDS (4 per row, raised) ─────────────────────── */
.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-24);
  margin-bottom: 0;
  align-items: stretch;
}
.metric-card {
  background: var(--surface);
  border-radius: var(--radius-card);
  padding: var(--space-24);
  box-shadow: var(--raised);
  transition: transform var(--t-fast), box-shadow var(--t-fast);
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  min-height: 0;
  position: relative;
  overflow: hidden;
}
.metric-card::before {
  content: '';
  position: absolute;
  inset: -2px -2px auto -2px;
  height: 88px;
  background: radial-gradient(circle at 18% 0%, rgba(34, 197, 94, 0.35), rgba(34, 197, 94, 0.04) 58%, transparent 70%);
  pointer-events: none;
}
.metric-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--raised-lg);
}
.metric-label {
  font-family: var(--font-sans);
  font-size: var(--text-small);
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: var(--space-8);
  text-align: left;
}
.metric-value {
  font-family: var(--font-display);
  font-size: var(--text-metric);
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
  letter-spacing: -0.02em;
  text-align: left;
}
.metric-sub { font-size: var(--text-small); color: var(--text-subtle); margin-top: 8px; }
.metric-icon {
  position: absolute; top: var(--space-16); right: var(--space-16);
  width: 40px; height: 40px;
  border-radius: var(--radius-btn);
  background: var(--surface);
  box-shadow: var(--raised-sm);
  display: flex; align-items: center; justify-content: center;
  color: var(--accent);
}
.metric-icon svg { width: 18px; height: 18px; }

.metric-card.skeleton .metric-value,
.metric-card.skeleton .metric-label {
  background: var(--shadow-dark);
  color: transparent;
  border-radius: 8px;
  animation: shimmer 1.6s infinite;
}
@keyframes shimmer { 0%, 100% { opacity: 0.5; } 50% { opacity: 1; } }

.stats-bar { display: flex; gap: var(--space-24); margin-bottom: var(--space-24); flex-wrap: wrap; }
.stat-card {
  background: var(--surface);
  border-radius: var(--radius-card);
  padding: 20px var(--space-24);
  box-shadow: var(--raised);
  display: flex;
  flex-direction: column;
  gap: var(--space-8);
  min-width: 120px;
}
.stat-label { font-family: var(--font-sans); font-size: var(--text-small); font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); }
.stat-value { font-family: var(--font-display); font-size: var(--text-metric); font-weight: 700; color: var(--text); }

.all-orders-page { display: flex; flex-direction: column; gap: 0; }
.orders-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-16);
  margin-bottom: var(--space-32);
  flex-wrap: wrap;
}
.orders-page-header .section-heading::after { display: none; }
.orders-toolbar-card {
  background: var(--surface);
  border-radius: var(--radius-card);
  padding: var(--space-16) var(--space-24);
  box-shadow: var(--raised);
  display: flex;
  align-items: center;
  gap: 16px;
}
.orders-toolbar-card .search-box { margin-left: 0; }
.orders-stats-bar { display: flex; gap: var(--space-24); margin-bottom: var(--space-24); flex-wrap: wrap; }
.orders-table-card { margin-top: 0; }
.orders-table-card .table-scroll { padding: var(--space-16); }

.section-heading {
  font-family: var(--font-display);
  font-size: var(--text-section);
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text);
  margin-bottom: var(--space-16);
  display: flex;
  align-items: center;
  gap: var(--space-8);
}
.section-heading::after { content: ''; flex: 1; height: 1px; background: var(--shadow-dark); }
.section-zone { margin-top: var(--space-48); }
.section-zone:first-of-type { margin-top: 0; }

/* ── 8. CHARTS ───────────────────────────────────────────────── */
.chart-card {
  background: var(--surface);
  border-radius: var(--radius-card);
  padding: var(--space-24);
  margin-bottom: 0;
  box-shadow: var(--raised);
  position: relative;
  overflow: hidden;
}
.chart-card::before {
  content: '';
  position: absolute;
  inset: -2px -2px auto -2px;
  height: 120px;
  background:
    radial-gradient(circle at 22% 0%, rgba(34, 197, 94, 0.30), transparent 58%),
    radial-gradient(circle at 72% 8%, rgba(34, 197, 94, 0.14), transparent 55%);
  pointer-events: none;
}
.chart-card:hover { box-shadow: var(--raised-lg); }
.chart-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.chart-title { font-family: var(--font-display); font-size: var(--text-card); font-weight: 600; color: var(--text); }
.chart-subtitle { font-size: var(--text-small); color: var(--text-muted); margin-top: 4px; font-family: var(--font-sans); }
.chart-mini-stats {
  display: flex;
  gap: 24px;
  margin-bottom: 16px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.chart-mini-stat { display: flex; flex-direction: column; gap: 2px; }
.chart-mini-label { font-size: 12px; color: var(--text-muted); }
.chart-mini-value { font-size: 15px; font-weight: 600; color: var(--text); }
.chart-metric-toggles {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}
.chart-metric-btn {
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
  font-family: var(--font-sans);
  color: var(--text-muted);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-input);
  cursor: pointer;
  transition: color var(--t-fast), background var(--t-fast), border-color var(--t-fast);
  box-shadow: var(--inset-sm);
}
.chart-metric-btn:hover { color: var(--text); background: var(--surface-hover); }
.chart-metric-btn.active { color: var(--accent); border-color: var(--accent); background: var(--accent-dim); box-shadow: none; }
.chart-wrap { position: relative; height: 320px; min-height: 280px; }
.chart-tooltip { padding: 4px 0; }
.chart-tooltip-title { font-weight: 600; display: block; margin-bottom: 4px; }
.chart-tooltip-value { display: block; }
.chart-tooltip-extra { font-size: 12px; color: var(--text-muted); display: block; margin-top: 2px; }
.chart-empty { display: flex; align-items: center; justify-content: center; height: 280px; color: var(--text-muted); font-size: 14px; }

/* ── 9. TABLES ───────────────────────────────────────────────── */
.table-card {
  background: var(--surface);
  border-radius: var(--radius-card);
  box-shadow: var(--raised);
  overflow: hidden;
  margin-top: var(--space-24);
  margin-bottom: var(--space-24);
}
.table-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-16) var(--space-24);
  gap: var(--space-16);
  flex-wrap: wrap;
}
.table-title { font-family: var(--font-display); font-size: var(--text-card); font-weight: 600; color: var(--text); }
.table-scroll { overflow-x: auto; }

table { width: 100%; border-collapse: collapse; }
thead th {
  padding: 12px var(--space-16);
  text-align: left;
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted);
  background: rgba(200, 202, 212, 0.15);
  border-bottom: 1px solid rgba(200, 202, 212, 0.5);
}
thead th.num, td.num { text-align: right; }
tbody tr {
  height: 48px;
  transition: background 0.15s ease;
}
tbody tr:hover { background: var(--surface-hover); }
.orders-table .order-row { transition: background 0.15s ease; }
tbody td {
  padding: 12px var(--space-16);
  font-size: var(--text-table);
  font-family: var(--font-sans);
  color: var(--text);
  vertical-align: middle;
  border-bottom: 1px solid rgba(200, 202, 212, 0.4);
}
tbody tr:last-child td { border-bottom: none; }
tbody td strong { font-weight: 600; }
.min-w-140 { min-width: 140px; }
.min-w-160 { min-width: 160px; }

/* Orders table: 11-column fixed layout (no column jitter) */
.orders-table-fixed { table-layout: fixed; width: 100%; }
.orders-table-fixed thead th:nth-child(1)  { width: 200px; }
.orders-table-fixed thead th:nth-child(2)  { width: auto; min-width: 160px; }
.orders-table-fixed thead th:nth-child(3)  { width: 180px; }
.orders-table-fixed thead th:nth-child(4)  { width: 120px; }
.orders-table-fixed thead th:nth-child(5)  { width: 80px; }
.orders-table-fixed thead th:nth-child(6)  { width: 90px; }
.orders-table-fixed thead th:nth-child(7)  { width: 140px; }
.orders-table-fixed thead th:nth-child(8)  { width: 80px; }
.orders-table-fixed thead th:nth-child(9)  { width: 130px; }
.orders-table-fixed thead th:nth-child(10) { width: 100px; }
.orders-table-fixed thead th:nth-child(11) { width: 90px; }

.orders-table th:nth-child(7),
.orders-table td:nth-child(7) { text-align: center; }
.orders-table th:nth-child(8),
.orders-table td:nth-child(8) { text-align: center; }
.orders-table th:nth-child(9),
.orders-table td:nth-child(9) { text-align: center; }
.orders-table th:nth-child(10),
.orders-table td:nth-child(10) { text-align: center; }
.orders-table th:nth-child(11),
.orders-table td:nth-child(11) { text-align: right; }

.orders-table .td-order,
.orders-table .td-product,
.orders-table .td-customer,
.orders-table .td-phone,
.orders-table .td-state,
.orders-table .td-pincode { text-align: left; }
.orders-table .td-status,
.orders-table .td-qty,
.orders-table .td-time,
.orders-table .td-payment { text-align: center; }
.orders-table .td-total { text-align: right; }

.orders-table .order-row { height: 48px; }
.orders-table .order-cell { display: flex; flex-direction: column; gap: 2px; }
.orders-table .order-id { font-weight: 600; color: var(--text); font-size: 13px; }
.orders-table .store-order-id { font-size: 12px; color: var(--text-muted); }
.orders-table .product-cell { line-height: 1.4; }
.orders-table .product-sku-line {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
}
.orders-table .product-cell-combo { position: relative; }
.orders-table .combo-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  background: var(--surface);
  box-shadow: var(--raised-sm);
  border-radius: 10px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.orders-table .combo-toggle:hover { box-shadow: var(--raised); }
.orders-table .combo-arrow { width: 12px; height: 12px; transition: transform 0.15s ease; }
.orders-table .combo-toggle.open .combo-arrow { transform: rotate(90deg); }
.orders-table .combo-detail {
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.15s ease;
  margin-top: 8px;
  padding-left: 20px;
  border-left: 2px solid rgba(200, 202, 212, 0.5);
}
.orders-table .combo-detail.open { max-height: 400px; }
.orders-table .combo-sku-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 0;
  min-height: 40px;
  border-bottom: 1px solid rgba(200, 202, 212, 0.35);
  font-size: 12px;
}
.orders-table .combo-sku-row:last-child { border-bottom: none; }
.orders-table .combo-sku-name { color: var(--text); word-break: break-word; }
.orders-table .combo-sku-qty { color: var(--text-muted); margin-left: 8px; flex-shrink: 0; }
.orders-table .customer-cell { font-weight: 500; font-size: 14px; color: var(--text); }
.orders-table .phone-cell,
.orders-table .state-cell,
.orders-table .pincode-cell { font-size: 13px; color: var(--text); }
.orders-table .qty-cell,
.orders-table .time-cell,
.orders-table .payment-cell { font-size: 13px; color: var(--text); }
.orders-table .total-cell { font-size: 13px; font-weight: 600; color: var(--text); }
.orders-table .status-badge { max-width: 160px; white-space: normal; word-break: break-word; }

.row-actions { display: flex; align-items: center; gap: 8px; opacity: 0; transition: opacity var(--t-fast); }
tbody tr:hover .row-actions { opacity: 1; }
.row-action-btn {
  display: flex; align-items: center; justify-content: center;
  width: 28px; height: 28px;
  border-radius: var(--radius-input);
  background: var(--surface);
  box-shadow: var(--raised-sm);
  color: var(--text-muted);
  transition: all var(--t-fast);
}
.row-action-btn:hover { color: var(--accent); box-shadow: var(--raised); transform: translateY(-1px); }

.date-header-row { background: rgba(200, 202, 212, 0.25) !important; cursor: pointer; height: 44px; }
.date-header-row td { padding: 0 var(--space-16); border-bottom: 1px solid rgba(200, 202, 212, 0.4); }
.date-header-inner { display: flex; align-items: center; gap: 10px; padding: 12px 0; }
.date-arrow { width: 14px; height: 14px; flex-shrink: 0; color: var(--text-muted); transition: transform 0.15s ease; }
.date-header-row.open .date-arrow { transform: rotate(90deg); }
.date-header-text { font-family: var(--font-sans); font-weight: 500; font-size: 14px; color: var(--text); }
.date-order-count {
  font-size: 11px; font-weight: 700; color: var(--accent);
  background: var(--accent-dim);
  padding: 4px 10px;
  border-radius: 10px;
}

/* ── 10. FILTERS & SEARCH BOX ─────────────────────────────────── */
.toolbar { display: flex; align-items: center; gap: var(--space-16); padding: var(--space-16) 0; flex-wrap: wrap; }
.search-box { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-left: auto; }
.search-box select {
  height: var(--control-h-sm);
  padding: 0 14px;
  background: var(--surface);
  border: none;
  border-radius: var(--radius-input);
  box-shadow: var(--raised-sm);
  color: var(--text);
  font-size: 14px;
  outline: none;
  transition: box-shadow var(--t-fast);
}
.search-box input[type="text"] {
  height: var(--control-h-sm);
  padding: 0 14px;
  background: var(--surface);
  border: none;
  border-radius: var(--radius-input);
  box-shadow: var(--inset);
  color: var(--text);
  font-size: 14px;
  outline: none;
  transition: box-shadow var(--t-fast);
  min-width: 220px;
}
.search-box input:focus,
.search-box select:focus { box-shadow: var(--inset-sm), 0 0 0 2px var(--accent-dim); }
.search-box input::placeholder { color: var(--text-subtle); }

.filters-card {
  background: var(--surface);
  border-radius: var(--radius-card);
  padding: var(--space-16) var(--space-24);
  margin-bottom: var(--space-32);
  box-shadow: var(--raised);
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.date-presets { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.multi-store-dropdown {
  display: flex;
  align-items: center;
  position: relative;
  overflow: visible;
}
.multi-store-dropdown .msd-trigger {
  white-space: nowrap;
}
.preset-btn {
  height: var(--control-h-sm);
  padding: 0 16px;
  border-radius: var(--radius-input);
  font-size: var(--text-small);
  font-weight: 600;
  background: var(--surface);
  box-shadow: var(--inset-sm);
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--t-fast);
  display: inline-flex;
  align-items: center;
}
.preset-btn:hover { box-shadow: var(--inset-sm), 0 0 0 1px var(--shadow-dark); color: var(--text); }
.preset-btn.active {
  background: var(--accent);
  color: #fff;
  box-shadow: var(--inset-sm), 0 2px 8px rgba(34, 197, 94, 0.3);
}
.preset-btn.active:hover { color: #fff; }
.msd-trigger {
  height: var(--control-h-sm);
  padding: 0 16px;
  border-radius: var(--radius-btn);
  font-size: var(--text-small);
  font-weight: 600;
  background: var(--surface);
  box-shadow: var(--raised-sm);
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all var(--t-fast);
}
.msd-trigger::after {
  content: '';
  width: 12px; height: 12px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E") no-repeat center;
  opacity: 0.8;
}
.msd-trigger:hover { box-shadow: var(--raised); color: var(--text); }
.msd-panel {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  min-width: 220px;
  max-height: 320px;
  overflow-y: auto;
  background: var(--surface);
  border-radius: var(--radius-input);
  padding: 8px;
  z-index: 1200;
  box-shadow: var(--raised-lg);
}
.msd-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: var(--radius-input);
  font-size: 14px;
  color: var(--text);
  cursor: pointer;
  transition: background var(--t-fast);
}
.msd-option:hover { background: var(--surface-hover); }
.msd-option input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 38px;
  height: 22px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.55);
  background: rgba(148, 163, 184, 0.3);
  position: relative;
  transition: background var(--t-fast), border-color var(--t-fast);
  cursor: pointer;
  flex-shrink: 0;
}
.msd-option input[type="checkbox"]::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.26);
  transition: transform var(--t-fast);
}
.msd-option input[type="checkbox"]:checked {
  background: rgba(34, 197, 94, 0.4);
  border-color: rgba(34, 197, 94, 0.7);
}
.msd-option input[type="checkbox"]:checked::after {
  transform: translateX(16px);
}
.filters-sep { width: 1px; height: 24px; background: var(--shadow-dark); }

/* ── Dashboard: chip-based store filter (Overview) ───────────────── */
.store-filter-bar {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0;
  flex: 1;
  min-width: 0;
  z-index: 1;
}
.store-filter-chips-row {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-width: 0;
  position: relative;
  z-index: 3;
}
.store-filter-chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  min-width: 0;
  flex: 1;
}
.store-filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  padding: 4px 6px 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text);
  background: rgba(15, 23, 42, 0.06);
  border: 1px solid var(--border);
  line-height: 1.3;
}
.store-filter-chip--all {
  color: var(--text-muted);
  background: rgba(15, 23, 42, 0.04);
  padding: 4px 12px;
}
/* “All Stores” is a real control (opens panel), not inert text */
button.store-filter-chip {
  appearance: none;
  -webkit-appearance: none;
  font: inherit;
  font-family: inherit;
  cursor: pointer;
  text-align: left;
  border: 1px solid var(--border);
}
button.store-filter-chip--all:hover {
  color: var(--text);
  background: rgba(15, 23, 42, 0.07);
  border-color: rgba(15, 23, 42, 0.12);
}
button.store-filter-chip--all:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px rgba(34, 197, 94, 0.35);
}
button.store-filter-chip--all:active {
  transform: scale(0.98);
}
.store-filter-chip-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 160px;
}
.store-filter-chip-remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  margin: 0 -2px 0 0;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
  transition: background var(--t-fast), color var(--t-fast);
}
.store-filter-chip-remove:hover {
  background: rgba(15, 23, 42, 0.08);
  color: var(--text);
}
.btn-store-filter-add {
  flex-shrink: 0;
  height: 32px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(34, 197, 94, 0.22);
  cursor: pointer;
  position: relative;
  z-index: 25;
  transition: color var(--t-fast), border-color var(--t-fast), background var(--t-fast), box-shadow var(--t-fast);
}
.btn-store-filter-add:hover {
  color: var(--accent);
  border-color: rgba(34, 197, 94, 0.45);
  background: rgba(255, 255, 255, 0.98);
}
.store-filter-popover {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  width: 0;
  max-width: 100%;
  height: 38px;
  max-height: 38px;
  opacity: 0;
  transform: translateX(-14px);
  pointer-events: none;
  overflow: hidden;
  z-index: 10;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.88);
  border: none;
  box-shadow: none;
  transition: transform 220ms ease, opacity 220ms ease, width 240ms ease;
}
.store-filter-popover.open {
  width: 100%;
  opacity: 1;
  transform: translateX(0);
  pointer-events: auto;
}
.dashboard-page .custom-date-inputs {
  position: relative;
  z-index: 30;
}
.store-filter-popover-inner {
  display: flex;
  align-items: center;
  height: 100%;
  padding: 4px 8px;
  min-height: 0;
  overflow: hidden;
}
.store-filter-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  flex-shrink: 0;
}
.store-filter-panel-title {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text);
  line-height: 1.2;
}
.store-filter-clear-link {
  flex-shrink: 0;
  margin: 0;
  padding: 4px 0;
  border: none;
  background: none;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  text-decoration: none;
  transition: color var(--t-fast);
}
.store-filter-clear-link:hover {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.store-filter-search {
  width: 100%;
  height: 40px;
  padding: 0 14px;
  border-radius: 12px;
  border: 1px solid transparent;
  background: rgba(15, 23, 42, 0.045);
  font-size: 13px;
  color: var(--text);
  box-sizing: border-box;
  transition: background var(--t-fast), box-shadow var(--t-fast);
}
.store-filter-search::placeholder {
  color: var(--text-muted);
  opacity: 0.85;
}
.store-filter-search:hover {
  background: rgba(15, 23, 42, 0.055);
}
.store-filter-search:focus {
  outline: none;
  background: var(--surface);
  border-color: rgba(15, 23, 42, 0.08);
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.12);
}
.store-filter-select-all-wrap {
  margin-top: 14px;
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
  flex-shrink: 0;
}
.store-filter-select-all-label {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
  user-select: none;
}
.store-filter-select-all-cb {
  width: 16px;
  height: 16px;
  margin: 0;
  flex-shrink: 0;
  accent-color: var(--accent);
  cursor: pointer;
}
.store-filter-select-all-text {
  line-height: 1.3;
}
.store-filter-list {
  overflow-x: auto;
  overflow-y: hidden;
  width: 100%;
  min-height: 0;
  max-height: none;
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  margin: 0;
  padding: 0;
  -webkit-overflow-scrolling: touch;
}
.store-filter-row {
  flex: 0 0 auto;
  flex-shrink: 0;
  border-radius: 10px;
  transition: background var(--t-fast), border-color var(--t-fast);
  border: 1px solid rgba(15, 23, 42, 0.06);
  background: rgba(255, 255, 255, 0.66);
  min-width: 0;
  max-width: none;
}
.store-filter-row:hover {
  background: rgba(15, 23, 42, 0.04);
  border-color: rgba(34, 197, 94, 0.26);
}
.store-filter-row-label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 6px 9px;
  cursor: pointer;
  font-size: 12px;
  color: var(--text);
  line-height: 1.2;
}
.store-filter-row input.store-filter-cb {
  appearance: none;
  -webkit-appearance: none;
  width: 32px;
  height: 18px;
  margin: 0;
  flex-shrink: 0;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.55);
  background: rgba(148, 163, 184, 0.28);
  position: relative;
  transition: background var(--t-fast), border-color var(--t-fast);
  cursor: pointer;
}
.store-filter-row input.store-filter-cb::after {
  content: '';
  position: absolute;
  top: 1px;
  left: 1px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.24);
  transition: transform var(--t-fast);
}
.store-filter-row input.store-filter-cb:checked {
  background: rgba(34, 197, 94, 0.42);
  border-color: rgba(34, 197, 94, 0.72);
}
.store-filter-row input.store-filter-cb:checked::after {
  transform: translateX(14px);
}
.store-filter-row-name {
  flex: 0 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 500;
}

/* ── DELIVERY ANALYTICS PAGE ────────────────────────────────── */
.delivery-analytics-page {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 var(--space-24);
}
.delivery-filters-card {
  border-radius: 24px;
  padding: var(--space-24);
  gap: 12px;
  box-shadow: var(--raised);
}
.delivery-hero-insight {
  margin-top: 18px;
  border-radius: 20px;
  padding: 18px 20px;
  background:
    radial-gradient(circle at 100% 0, rgba(34, 197, 94, 0.1), transparent 52%),
    var(--surface);
  box-shadow: var(--raised-sm);
}
.delivery-hero-insight__kicker {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.delivery-hero-insight__title {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text);
  margin-bottom: 4px;
}
.delivery-hero-insight__meta {
  font-size: 13px;
  color: var(--text-muted);
}
.delivery-metric-grid {
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-top: 18px;
}
.delivery-metric-grid--secondary {
  grid-template-columns: repeat(3, 1fr);
  margin-top: 10px;
}
.delivery-metric-card {
  padding: 16px 18px;
  border-radius: 16px;
  box-shadow: var(--raised-sm);
  border: 1px solid rgba(200, 202, 212, 0.32);
}
.delivery-metric-card .metric-label {
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.delivery-metric-card .metric-value {
  font-family: var(--font-display);
  font-size: 34px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  line-height: 1.2;
}
.delivery-metric-card--secondary .metric-value {
  font-size: 24px;
}
.delivery-metric-card .metric-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.metric-dot-delivered { background: #22C55E; }
.metric-dot-transit { background: #3B82F6; }
.metric-dot-rto { background: #EF4444; }
.metric-dot-pending,
.metric-dot-neutral { background: var(--text-muted); }
.metric-value-delivered { color: var(--accent); }
.metric-value-transit { color: #3B82F6; }
.metric-value-rto { color: #EF4444; }
.metric-value-pending,
.metric-value-neutral { color: var(--text); }

/* Delivery table */
.delivery-trend-card {
  border-radius: 18px;
  box-shadow: var(--raised-sm);
  overflow: hidden;
}
.delivery-trend-header {
  padding-bottom: 8px !important;
}
.delivery-trend-card .chart-wrap {
  height: 220px;
}
.delivery-table-card { border-radius: 18px; box-shadow: var(--raised-sm); overflow: hidden; }
.delivery-table-card .table-scroll { padding: 16px; }
.delivery-table { table-layout: fixed; width: 100%; }
.delivery-table thead th {
  width: auto;
  padding: 10px 14px;
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted);
  background: rgba(200, 202, 212, 0.14);
  border-bottom: 1px solid rgba(200, 202, 212, 0.38);
  text-align: left;
}
.delivery-table thead th:nth-child(1) { width: 140px; }
.delivery-table thead th:nth-child(2) { width: 120px; }
.delivery-table thead th:nth-child(3),
.delivery-table thead th:nth-child(4),
.delivery-table thead th:nth-child(5),
.delivery-table thead th:nth-child(6) { width: 100px; }
.delivery-table thead th:nth-child(7),
.delivery-table thead th:nth-child(8) { width: 160px; }
.delivery-table tbody tr.delivery-table-row {
  height: 44px;
  transition: background 0.15s ease;
}
.delivery-table tbody tr.delivery-table-row:hover { background: rgba(200, 202, 212, 0.14); }
.delivery-table tbody td {
  padding: 10px 14px;
  font-size: 12.5px;
  vertical-align: middle;
  border-bottom: 1px solid rgba(200, 202, 212, 0.28);
}
.delivery-table .td-date { font-weight: 600; color: var(--text); }
.delivery-table .td-total { color: var(--text); font-weight: 600; }
.delivery-table .td-pending { color: #64748B; font-weight: 600; }
.delivery-table .td-delivered { color: var(--accent); font-weight: 600; }
.delivery-table .td-transit { color: #3B82F6; font-weight: 600; }
.delivery-table .td-rto { color: #EF4444; font-weight: 600; }
.delivery-table .td-projected,
.delivery-table .td-realtime { color: var(--text); font-weight: 700; }
@media (max-width: 1100px) {
  .delivery-metric-grid--primary { grid-template-columns: repeat(2, 1fr); }
  .delivery-metric-grid--secondary { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  .delivery-analytics-page { padding: 0 10px; }
  .delivery-hero-insight__title { font-size: 18px; }
  .delivery-metric-grid--primary { grid-template-columns: 1fr; }
  .delivery-table thead th:nth-child(7),
  .delivery-table thead th:nth-child(8) { width: 130px; }
}

@media (max-width: 420px) {
  .all-orders-search-row select { width: 128px; }
  .all-orders-search-row input[type="text"] { width: 190px; }
  .all-orders-search-row #searchBtn,
  .all-orders-search-row #clearSearchBtn { width: 86px; }
}

.custom-date-inputs { display: none; align-items: center; gap: 8px; }
.custom-date-inputs.visible { display: flex; }
.custom-date-inputs input[type="date"] {
  height: var(--control-h-sm);
  padding: 0 12px;
  background: var(--surface);
  border: none;
  border-radius: var(--radius-input);
  box-shadow: var(--inset-sm);
  font-size: var(--text-small);
  color: var(--text);
  outline: none;
}

/* ── 11. STATUS BADGES ───────────────────────────────────────── */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.03em;
  white-space: nowrap;
}
.status-badge::before {
  content: '';
  width: 5px;
  height: 5px;
  border-radius: 50%;
  flex-shrink: 0;
}
.status-delivered  { background: rgba(34, 197, 94, 0.12);  color: var(--status-delivered); }
.status-delivered::before  { background: var(--status-delivered); }
.status-pending    { background: rgba(245, 158, 11, 0.12);  color: var(--status-pending); }
.status-pending::before    { background: var(--status-pending); }
.status-cancelled  { background: rgba(239, 68, 68, 0.12);   color: var(--status-cancelled); }
.status-cancelled::before  { background: var(--status-cancelled); }
.status-transit    { background: rgba(59, 130, 246, 0.12);   color: var(--status-transit); }
.status-transit::before    { background: var(--status-transit); }
.status-rto        { background: rgba(239, 68, 68, 0.12);   color: var(--status-cancelled); }
.status-rto::before        { background: var(--status-cancelled); }
.payment-cod     { background: rgba(245, 158, 11, 0.12); color: var(--status-pending); border-radius: var(--radius-pill); padding: 2px 8px; font-size: 11px; font-weight: 700; }
.payment-prepaid { background: rgba(34, 197, 94, 0.12);  color: var(--status-delivered); border-radius: var(--radius-pill); padding: 2px 8px; font-size: 11px; font-weight: 700; }

/* ── 12. BUTTONS (raised, 16px radius, lift/sink) ────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--radius-btn);
  font-size: 14px;
  font-weight: 600;
  font-family: var(--font-sans);
  transition: all var(--t-fast);
  cursor: pointer;
  border: none;
  white-space: nowrap;
  background: var(--surface);
  box-shadow: var(--raised-sm);
}
.btn svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.btn:hover { box-shadow: var(--raised); transform: translateY(-1px); }
.btn:active { box-shadow: var(--inset-sm); transform: translateY(0); }
.btn:focus-visible { outline: none; box-shadow: var(--raised-sm), 0 0 0 3px var(--accent-dim); }
.row-action-btn:active,
.topbar-icon-btn:active { box-shadow: var(--inset-sm); transform: translateY(0); }

.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: var(--raised-sm), 0 2px 10px rgba(34, 197, 94, 0.3);
}
.btn-primary:hover {
  box-shadow: var(--raised), 0 4px 16px rgba(34, 197, 94, 0.35);
  transform: translateY(-1px);
}
.btn-primary:active { box-shadow: var(--inset-sm); transform: translateY(0); }

.btn-secondary {
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--raised-sm);
}
.btn-secondary:hover { box-shadow: var(--raised); color: var(--text); }

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  box-shadow: none;
}
.btn-ghost:hover { background: var(--surface); box-shadow: var(--raised-sm); color: var(--text); }

.btn-danger {
  background: rgba(239, 68, 68, 0.12);
  color: var(--status-cancelled);
  box-shadow: var(--raised-sm);
}
.btn-danger:hover {
  background: var(--status-cancelled);
  color: #fff;
  box-shadow: var(--raised);
  transform: translateY(-1px);
}

.btn-success {
  background: rgba(34, 197, 94, 0.12);
  color: var(--status-delivered);
  box-shadow: var(--raised-sm);
}
.btn-success:hover {
  background: var(--status-delivered);
  color: #fff;
  box-shadow: var(--raised);
  transform: translateY(-1px);
}

.btn-sm { padding: 8px 14px; font-size: var(--text-small); height: var(--control-h-sm); }
.btn-lg { padding: 12px 24px; font-size: 16px; height: var(--control-h); }
.btn-pill { border-radius: var(--radius-pill); }
.btn-icon { padding: 10px; width: 40px; height: 40px; }

/* ── 13. FORMS (inset inputs) ─────────────────────────────────── */
.form-label {
  font-family: var(--font-sans);
  font-size: var(--text-small);
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 6px;
  display: block;
}
.form-input {
  padding: 12px 16px;
  background: var(--surface);
  border: none;
  border-radius: var(--radius-input);
  box-shadow: var(--inset);
  color: var(--text);
  font-size: 14px;
  outline: none;
  transition: box-shadow var(--t-fast);
  width: 100%;
}
.form-input:focus { box-shadow: var(--inset), 0 0 0 2px var(--accent-dim); }
.form-input::placeholder { color: var(--text-subtle); }

/* ── GLOBAL TOGGLE (SKU Costs, VAULT, etc.) ───────────────────── */
.toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-sans);
  font-size: 13px;
  color: var(--text-muted);
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}
.toggle input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  pointer-events: none;
}
.toggle-switch {
  width: 42px;
  height: 22px;
  border-radius: 9999px;
  background: rgba(200, 202, 212, 0.28);
  box-shadow: var(--inset-sm);
  position: relative;
  transition: background 0.18s ease-in-out, box-shadow 0.18s ease-in-out;
  flex-shrink: 0;
  overflow: hidden;
}
.toggle-switch::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 9999px;
  background: var(--surface);
  box-shadow: var(--raised-sm);
  transition: transform 0.18s ease-in-out;
}
.toggle:hover .toggle-switch { box-shadow: var(--inset), 0 0 0 1px rgba(200, 202, 212, 0.35); }
.toggle:active .toggle-switch { box-shadow: var(--inset-sm); }
.toggle input[type="checkbox"]:checked + .toggle-switch {
  background: rgba(34, 197, 94, 0.65);
  box-shadow: var(--inset-sm);
}
.toggle input[type="checkbox"]:checked + .toggle-switch::after {
  transform: translateX(20px);
}

/* ── VAULT PASSCODE MODAL (daily DDMMYYYY) ────────────────────── */
.vault-passcode-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(255, 255, 255, 0.5);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}
.vault-passcode-overlay.open {
  opacity: 1;
  visibility: visible;
}
.vault-passcode-modal {
  width: 360px;
  max-width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-modal);
  padding: 28px;
  box-shadow: var(--raised-lg);
  text-align: center;
}
.vault-passcode-icon-wrap {
  margin-bottom: 16px;
}
.vault-passcode-icon {
  width: 48px;
  height: 48px;
  color: var(--text-muted);
}
.vault-passcode-title {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 8px 0;
}
.vault-passcode-desc {
  font-size: 14px;
  color: var(--text-muted);
  margin: 0 0 20px 0;
}
.vault-passcode-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.vault-passcode-input {
  width: 100%;
  height: 44px;
  padding: 0 14px;
  font-size: 16px;
  letter-spacing: 0.05em;
  text-align: center;
  border: 1px solid var(--border);
  border-radius: var(--radius-input);
  background: var(--surface);
  box-shadow: var(--inset-sm);
  color: var(--text);
  font-family: var(--font-sans);
  transition: box-shadow var(--t-fast);
}
.vault-passcode-input:focus {
  outline: none;
  box-shadow: var(--inset-sm), 0 0 0 2px var(--accent-dim);
}
.vault-passcode-input.shake {
  animation: vault-passcode-shake 0.4s ease;
}
@keyframes vault-passcode-shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-6px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
}
.vault-passcode-error {
  font-size: 13px;
  color: var(--status-cancelled);
  margin: 0;
  text-align: center;
}
.vault-passcode-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-top: 4px;
}
.vault-passcode-actions .btn { min-width: 100px; }

/* ── 14. LOGIN PAGE ───────────────────────────────────────────── */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #E6E7EE;
  position: relative;
}
.login-video-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #E6E7EE;
  z-index: 50;
  transition: opacity 0.9s ease;
}
.login-video-overlay.fade-out { opacity: 0; pointer-events: none; }
.login-video-overlay.hidden { display: none; }
.login-video {
  width: 80vw;
  max-width: 560px;
  max-height: 70vh;
  object-fit: contain;
}
@media (max-width: 768px) {
  .login-video { width: 70vw; max-width: 360px; max-height: 55vh; }
}
@media (max-width: 480px) {
  .login-video { width: 70vw; max-width: 300px; max-height: 50vh; }
}

.login-card {
  position: relative;
  z-index: 10;
  width: 100%;
  max-width: 420px;
  margin: var(--space-24);
  background: var(--surface);
  border-radius: var(--radius-modal);
  padding: var(--space-48);
  box-shadow: var(--raised-lg);
  opacity: 0;
  transform: translateY(16px) scale(0.98);
  transition: opacity 0.5s ease, transform 0.5s ease;
}
.login-card.visible { opacity: 1; transform: translateY(0) scale(1); }
.login-logo { display: flex; justify-content: center; margin-bottom: var(--space-24); }
.login-logo img { height: 36px; width: auto; }
.login-title {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  text-align: center;
  margin-bottom: 8px;
}
.login-subtitle {
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-muted);
  text-align: center;
  margin-bottom: var(--space-24);
}
.login-form { display: flex; flex-direction: column; gap: var(--space-16); }
.form-group { display: flex; flex-direction: column; gap: 6px; }
.login-btn {
  width: 100%;
  padding: 14px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius-btn);
  font-size: 15px;
  font-weight: 700;
  font-family: var(--font-sans);
  cursor: pointer;
  margin-top: 8px;
  box-shadow: var(--raised-sm), 0 4px 16px rgba(34, 197, 94, 0.25);
  transition: all var(--t-fast);
}
 .login-btn:hover { box-shadow: var(--raised), 0 6px 20px rgba(34, 197, 94, 0.3); transform: translateY(-1px); }
.login-btn:active { box-shadow: var(--inset-sm); transform: translateY(0); }
.login-error {
  font-size: 14px;
  color: var(--status-cancelled);
  background: rgba(239, 68, 68, 0.1);
  border-radius: var(--radius-input);
  padding: 12px 16px;
  text-align: center;
  display: none;
}
.login-error.visible { display: block; }

/* ── 15. COMMAND PALETTE ─────────────────────────────────────── */
.cmd-overlay {
  position: fixed;
  inset: 0;
  background: rgba(45, 49, 66, 0.4);
  backdrop-filter: blur(8px);
  z-index: 999;
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding-top: 120px;
}
.cmd-overlay.open { display: flex; animation: fade-in 0.2s ease; }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
.cmd-panel {
  width: 100%;
  max-width: 560px;
  margin: 0 var(--space-16);
  background: var(--surface);
  border-radius: var(--radius-modal);
  box-shadow: var(--raised-lg);
  overflow: hidden;
  animation: modal-up 0.2s ease;
}
@keyframes modal-up { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.cmd-input-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: var(--space-16);
  box-shadow: var(--inset-sm);
}
.cmd-icon { color: var(--text-muted); width: 18px; height: 18px; flex-shrink: 0; }
.cmd-input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  font-size: 16px;
  color: var(--text);
  font-family: var(--font-sans);
}
.cmd-input::placeholder { color: var(--text-subtle); }
.cmd-results { max-height: 320px; overflow-y: auto; }
.cmd-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px var(--space-16);
  cursor: pointer;
  transition: background var(--t-fast);
  color: var(--text);
  font-size: 14px;
}
.cmd-item:hover,
.cmd-item.focused { background: var(--accent-dim); color: var(--accent); }
.cmd-item svg { width: 16px; height: 16px; color: var(--text-muted); flex-shrink: 0; stroke: currentColor; fill: none; }
.cmd-item:hover svg,
.cmd-item.focused svg { color: var(--accent); }
.cmd-item-label { font-weight: 500; }
.cmd-item-sub { font-size: 12px; color: var(--text-subtle); margin-left: auto; }
.cmd-footer {
  display: flex;
  align-items: center;
  gap: var(--space-16);
  padding: 10px var(--space-16);
  font-size: var(--text-small);
  color: var(--text-subtle);
  box-shadow: var(--inset-sm);
}
.cmd-key {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 6px;
  background: var(--surface);
  box-shadow: var(--inset-sm);
  border-radius: 6px;
  font-size: 10px;
  font-weight: 700;
  font-family: var(--font-sans);
  color: var(--text-muted);
}

/* ── 16. NOTIFICATIONS ───────────────────────────────────────── */
.notifications-container {
  position: fixed;
  top: 80px;
  right: var(--space-24);
  z-index: 998;
  display: flex;
  flex-direction: column;
  gap: var(--space-8);
  pointer-events: none;
}
.notification {
  background: var(--surface);
  border-radius: var(--radius-input);
  padding: 14px var(--space-16);
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 280px;
  max-width: 380px;
  box-shadow: var(--raised-lg);
  pointer-events: all;
  color: var(--text);
  font-size: 14px;
  font-family: var(--font-sans);
  animation: slide-in-right 0.25s ease, fade-out 0.4s ease 3.6s forwards;
}
@keyframes slide-in-right { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes fade-out { from { opacity: 1; } to { opacity: 0; transform: translateX(20px); } }
.notification svg { width: 18px; height: 18px; flex-shrink: 0; }
.notification-success svg { color: var(--status-delivered); }
.notification-error svg { color: var(--status-cancelled); }
.notification-info svg { color: var(--accent); }

/* ── 17. TOOLTIPS ────────────────────────────────────────────── */
[data-tip] { position: relative; }
[data-tip]::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--surface);
  color: var(--text);
  border-radius: var(--radius-input);
  padding: 6px 12px;
  font-size: var(--text-small);
  font-weight: 500;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--t-fast);
  z-index: 200;
  box-shadow: var(--raised);
}
[data-tip]:hover::after { opacity: 1; }

/* ── 18. PAGE LOADING ─────────────────────────────────────────── */
.page-loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 2147483600;
  background:
    radial-gradient(120% 90% at 10% 0%, rgba(70, 86, 78, 0.14), transparent 50%),
    radial-gradient(90% 80% at 100% 100%, rgba(28, 38, 33, 0.18), transparent 56%),
    linear-gradient(180deg, #050708 0%, #07090b 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.24s ease, visibility 0.24s ease;
  opacity: 1;
  visibility: visible;
}
.page-loading-overlay.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.page-loading-console {
  width: min(720px, 92vw);
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.04) 0%, rgba(255, 255, 255, 0.01) 100%),
    rgba(5, 8, 7, 0.74);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.1),
    0 28px 64px rgba(0, 0, 0, 0.58);
  backdrop-filter: blur(12px) saturate(112%);
  -webkit-backdrop-filter: blur(12px) saturate(112%);
  overflow: hidden;
}
.page-loading-console__head {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 42px;
  padding: 0 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  color: rgba(232, 240, 236, 0.82);
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.page-loading-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #7fd7ad;
  box-shadow: 0 0 0 6px rgba(127, 215, 173, 0.12);
}
.page-loading-console__env {
  margin-left: auto;
  font-size: 10px;
  letter-spacing: 0.12em;
  color: rgba(196, 214, 204, 0.6);
}
.page-loading-console__body {
  min-height: 210px;
  max-height: 42vh;
  overflow: hidden;
  padding: 14px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 12px;
  line-height: 1.6;
  color: rgba(216, 229, 222, 0.86);
}
.page-loading-log-line {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  opacity: 0;
  transform: translateY(9px);
  animation: loaderLogIn 0.11s linear forwards;
}
.page-loading-log-line .ts {
  color: rgba(152, 173, 161, 0.64);
  margin-right: 8px;
}
.page-loading-log-line .ok {
  color: #8ee6ba;
}
.page-loading-log-line::after {
  content: " _";
  color: rgba(186, 208, 198, 0.6);
  animation: loaderCaret 0.42s steps(1, end) infinite;
}
.page-loading-log-line:last-child::after {
  opacity: 1;
}
.page-loading-console__foot {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 10px 14px 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.page-loading-progress {
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}
.page-loading-progress__bar {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #75cfa6 0%, #9ee6c2 100%);
  transition: width 0.14s ease;
}
.page-loading-progress__meta {
  min-width: 44px;
  text-align: right;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 11px;
  color: rgba(218, 232, 224, 0.84);
}
.page-enter { animation: page-enter 0.18s ease both; }
@keyframes page-enter { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes loaderLogIn { from { opacity: 0; transform: translateY(9px); } to { opacity: 1; transform: translateY(0); } }
@keyframes loaderCaret { 0%, 49% { opacity: 0; } 50%, 100% { opacity: 1; } }

/* ── 19. STORE CARDS ─────────────────────────────────────────── */
.store-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: var(--space-24); margin-bottom: var(--space-24); }
.store-card {
  background: var(--surface);
  border-radius: var(--radius-card);
  overflow: hidden;
  box-shadow: var(--raised);
  transition: transform var(--t-fast), box-shadow var(--t-fast);
  border: none;
}
.store-card:hover { transform: translateY(-2px); box-shadow: var(--raised-lg); }
.store-card-header {
  padding: var(--space-16) var(--space-24);
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: none;
}
.store-name { font-family: var(--font-display); font-size: var(--text-card); font-weight: 700; }
.store-prefix-badge { font-size: 10px; font-weight: 700; padding: 3px 8px; border-radius: var(--radius-pill); letter-spacing: 0.06em; }
.store-card-metrics { padding: var(--space-16) var(--space-24); }
.store-metric-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
  font-size: var(--text-small);
  color: var(--text-muted);
  font-family: var(--font-sans);
}
.store-metric-row span:last-child { font-weight: 600; color: var(--text); }
.store-card-footer { padding: var(--space-16) var(--space-24); display: flex; gap: 12px; }
.btn-store-filter {
  flex: 1;
  padding: 8px 14px;
  background: var(--surface);
  box-shadow: var(--raised-sm);
  border-radius: 14px;
  color: var(--accent);
  font-size: var(--text-small);
  font-weight: 600;
  cursor: pointer;
  transition: all var(--t-fast);
}
.btn-store-filter:hover { box-shadow: var(--raised); transform: translateY(-1px); color: var(--accent); }
.btn-store-filter:active { box-shadow: var(--inset-sm); transform: translateY(0); }
.store-card-mobile-toggle { display: none; }
.btn-store-delete {
  padding: 8px 14px;
  background: var(--surface);
  box-shadow: var(--raised-sm);
  border-radius: 14px;
  color: var(--status-cancelled);
  font-size: var(--text-small);
  font-weight: 600;
  cursor: pointer;
  transition: all var(--t-fast);
}
.btn-store-delete:hover { box-shadow: var(--raised); transform: translateY(-1px); color: var(--status-cancelled); background: rgba(239, 68, 68, 0.08); }
.btn-store-delete:active { box-shadow: var(--inset-sm); transform: translateY(0); }
#addStoreBtn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-8);
  padding: var(--space-16) var(--space-24);
  background: var(--surface);
  box-shadow: var(--inset-sm);
  border-radius: var(--radius-card);
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--t-fast);
}
#addStoreBtn:hover { box-shadow: var(--raised); color: var(--accent); }

/* ── 20. MODAL ───────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(45, 49, 66, 0.4);
  backdrop-filter: blur(8px);
  z-index: 500;
  display: none;
  align-items: center;
  justify-content: center;
}
.modal-overlay.open { display: flex; animation: fade-in 0.2s ease; }
.modal {
  background: var(--surface);
  border-radius: var(--radius-modal);
  padding: var(--space-32);
  width: 100%;
  max-width: 460px;
  margin: var(--space-16);
  box-shadow: var(--raised-lg);
  animation: modal-up 0.22s ease;
}
.modal-title { font-family: var(--font-display); font-size: 20px; font-weight: 700; color: var(--text); margin-bottom: var(--space-16); }
.modal-body { font-size: 14px; color: var(--text-muted); line-height: 1.6; margin-bottom: var(--space-24); font-family: var(--font-sans); }
.modal-footer { display: flex; gap: var(--space-16); justify-content: flex-end; }

/* ── 21. ACCOUNT CARD, FIELD ROW, DATE RANGE ──────────────────── */
.account-card {
  background: var(--surface);
  border-radius: var(--radius-card);
  padding: var(--space-24);
  margin-bottom: var(--space-24);
  box-shadow: var(--raised);
}
.account-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-16);
  padding-bottom: var(--space-16);
}
.account-actions { display: flex; gap: var(--space-8); }
.date-range-row {
  display: flex;
  align-items: center;
  gap: var(--space-8);
  flex-wrap: wrap;
}
.date-range-row input,
.date-range-row .btn { height: var(--control-h-sm); }
.field-row {
  display: flex;
  align-items: center;
  gap: var(--space-8);
  margin-bottom: var(--space-16);
}
.field-row input { flex: 1; min-width: 0; }
.vault-step-footer {
  margin-top: var(--space-32);
  padding-top: var(--space-24);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.page-actions { display: flex; align-items: center; gap: var(--space-16); margin-left: auto; }
.page-actions a { font-size: 14px; font-weight: 500; color: var(--accent); }
.input-with-prefix {
  display: flex;
  align-items: center;
  background: var(--surface);
  border-radius: var(--radius-input);
  box-shadow: var(--inset);
}
.input-prefix { padding: 0 14px; color: var(--text-muted); font-size: 14px; font-weight: 500; }
.input-with-prefix input { border: none; background: transparent; padding: 12px 16px; flex: 1; min-width: 0; outline: none; }

/* ── 22. RISK PAGE ───────────────────────────────────────────── */
.risk-layout { display: grid; grid-template-columns: 3fr 2fr; gap: var(--space-24); align-items: start; }
.risk-section-title {
  font-family: var(--font-display);
  font-size: var(--text-small);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: var(--space-16);
  display: flex;
  align-items: center;
  gap: var(--space-8);
}
.risk-section-title::after { content: ''; flex: 1; height: 1px; background: var(--shadow-dark); }
.risk-card {
  background: var(--surface);
  border-radius: var(--radius-card);
  margin-bottom: var(--space-16);
  box-shadow: var(--raised);
  overflow: hidden;
  border-left: 4px solid var(--status-cancelled);
  transition: box-shadow var(--t-fast);
}
.risk-card:hover { box-shadow: var(--raised-lg); }
.risk-card-header { padding: var(--space-16) var(--space-24); display: flex; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.risk-customer-name { font-weight: 700; font-size: 14px; color: var(--text); }
.risk-customer-phone { font-size: var(--text-small); color: var(--text-muted); margin-top: 4px; }
.risk-reasons { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.risk-reason-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  background: rgba(239, 68, 68, 0.12);
  color: var(--status-cancelled);
}
.risk-card-actions { display: flex; gap: 8px; margin-left: auto; align-self: flex-start; }
.risk-order-table { width: 100%; border-collapse: collapse; font-size: var(--text-small); }
.risk-order-table th { padding: 10px 14px; background: var(--surface); box-shadow: var(--inset-sm); color: var(--text-muted); font-weight: 600; text-transform: uppercase; font-size: 10px; letter-spacing: 0.06em; text-align: left; }
.risk-order-table td { padding: 10px 14px; color: var(--text); border-bottom: 1px solid rgba(200, 202, 212, 0.4); }
.risk-collapse-btn { font-size: 11px; color: var(--text-muted); cursor: pointer; padding: 6px 16px; display: flex; align-items: center; gap: 6px; transition: color var(--t-fast); }
.risk-collapse-btn:hover { color: var(--accent); }
.blocked-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.blocked-table th { padding: 10px 14px; background: var(--surface); box-shadow: var(--inset-sm); font-size: 10px; font-weight: 600; letter-spacing: 0.07em; text-transform: uppercase; color: var(--text-muted); text-align: left; }
.blocked-table td { padding: 10px 14px; border-bottom: 1px solid rgba(200, 202, 212, 0.4); color: var(--text); }
.risk-empty { text-align: center; padding: var(--space-48); color: var(--text-muted); font-size: 14px; }
.risk-empty svg { width: 40px; height: 40px; color: var(--text-subtle); margin: 0 auto var(--space-16); display: block; }

.pulse-dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
.pulse-green { background: var(--status-delivered); }
.pulse-blue { background: var(--status-transit); }

/* ── 23. DELIVERY PAGE ───────────────────────────────────────── */
.delivery-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-24); margin-bottom: var(--space-24); }
.delivery-card {
  background: var(--surface);
  border-radius: var(--radius-card);
  padding: var(--space-24);
  box-shadow: var(--raised);
  transition: transform var(--t-fast), box-shadow var(--t-fast);
}
.delivery-card:hover { transform: translateY(-2px); box-shadow: var(--raised-lg); }
.delivery-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.07em; color: var(--text-muted); margin-bottom: 8px; }
.delivery-value { font-family: var(--font-display); font-size: 24px; font-weight: 700; color: var(--text); }

/* ── 24. COMING SOON ─────────────────────────────────────────── */
.coming-soon-wrap { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 58vh; text-align: center; gap: var(--space-24); }
.coming-soon-icon { width: 80px; height: 80px; background: var(--surface); box-shadow: var(--raised); border-radius: 50%; display: flex; align-items: center; justify-content: center; color: var(--accent); }
.coming-soon-icon svg { width: 40px; height: 40px; stroke: currentColor; fill: none; }
.coming-soon-title { font-family: var(--font-display); font-size: 26px; font-weight: 700; color: var(--text); }
.coming-soon-sub { font-size: 14px; color: var(--text-muted); max-width: 360px; line-height: 1.65; font-family: var(--font-sans); }

/* ── 25. META / SKU FORMS ───────────────────────────────────── */
.meta-input-card {
  background: var(--surface);
  border-radius: var(--radius-card);
  padding: var(--space-24);
  margin-bottom: var(--space-24);
  box-shadow: var(--raised);
}
.meta-form { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.meta-form .form-group { flex: 1; min-width: 180px; }
.meta-form .form-label { font-size: 11px; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; color: var(--text-muted); margin-bottom: 6px; display: block; }
.meta-accounts-list { display: flex; flex-direction: column; gap: var(--space-16); }
.meta-account-item {
  background: var(--surface);
  border-radius: var(--radius-input);
  padding: 14px var(--space-16);
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: var(--raised-sm);
}
.meta-account-name { font-weight: 600; color: var(--text); flex: 1; }
.meta-account-id { font-size: var(--text-small); color: var(--text-muted); }
.sku-input-row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }

/* ── 26. STORE ORDER ID, COMBO BADGES ─────────────────────────── */
.store-order-cell { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; vertical-align: middle; }
.store-order-cell strong {
  font-weight: 600;
  color: var(--text);
  word-break: break-word;
  overflow-wrap: break-word;
  white-space: normal;
  font-size: inherit;
}
.order-type-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  padding: 4px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  line-height: 1.2;
}
.badge-single { background: rgba(59, 130, 246, 0.12); color: var(--status-transit); }
.badge-combo { background: var(--accent-dim); color: var(--accent); }
.combo-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  background: var(--surface);
  box-shadow: var(--inset-sm);
  border-radius: 6px;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--t-fast);
}
.combo-toggle:hover { color: var(--accent); box-shadow: var(--raised-sm); }
.combo-arrow { width: 10px; height: 10px; flex-shrink: 0; transition: transform 0.2s ease; transform: rotate(-90deg); }
.combo-toggle.open .combo-arrow { transform: rotate(0); }
.combo-detail-row:not(.open) { height: 0 !important; overflow: hidden; border: none !important; }
.combo-detail-row:not(.open) .combo-detail-td { padding: 0 !important; height: 0 !important; min-height: 0 !important; border: none !important; line-height: 0; font-size: 0; vertical-align: top; overflow: hidden; }
.combo-detail-row:not(.open) .combo-detail { margin: 0; padding: 0; }
.combo-detail-row.open { position: relative; z-index: 1; }
.combo-detail-row.open .combo-detail-td { padding: 0 16px 10px !important; vertical-align: top; background: var(--surface); box-shadow: var(--inset-sm); }
.combo-detail { max-height: 0; overflow: hidden; padding: 0 0 0 24px; margin: 0; background: var(--surface); transition: max-height 0.2s ease-out; }
.combo-detail.open { padding: 8px 0 10px 24px; }
.combo-table { width: 100%; font-size: var(--text-small); }
.combo-table th { padding: 8px 12px; background: var(--surface); box-shadow: var(--inset-sm); color: var(--text-muted); font-weight: 600; text-align: left; font-size: 10px; letter-spacing: 0.05em; text-transform: uppercase; }
.combo-table td { padding: 8px 12px; color: var(--text); border-bottom: 1px solid rgba(200, 202, 212, 0.4); font-size: 12px; }
.combo-table tr:last-child td { border-bottom: none; }
.refresh-indicator { display: inline-flex; align-items: center; gap: 8px; font-size: var(--text-small); color: var(--text-muted); }
#autoRefreshStatus { color: var(--status-delivered); font-weight: 600; }
#countdown { color: var(--accent); font-weight: 600; }

.skeleton-text { display: inline-block; height: 12px; border-radius: 6px; background: var(--shadow-dark); animation: shimmer 1.5s infinite; }

/* ── 27. RESPONSIVE ──────────────────────────────────────────── */
/* Overlay for sidebar drawer (tablet/mobile). z-index below .sidebar.open so menu taps hit sidebar, not overlay. */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(45, 49, 66, 0.35);
  z-index: 99;
  transition: opacity var(--t-fast);
}
.sidebar-overlay.open { display: block; }

/* Laptop: 1024px – 1279px */
@media (max-width: 1279px) {
  .metric-grid { grid-template-columns: repeat(3, 1fr); }
  .delivery-grid { grid-template-columns: repeat(2, 1fr); }
  .delivery-metric-grid { grid-template-columns: repeat(2, 1fr); }
}

/* Tablet: 768px – 1023px — sidebar becomes drawer */
@media (max-width: 1023px) {
  .sidebar {
    transform: translateX(-100%);
    box-shadow: none;
    width: var(--sidebar-w);
  }
  .sidebar.open {
    transform: translateX(0);
    box-shadow: var(--raised-lg);
    z-index: 100;
  }
  .content-wrap { margin-left: 0; }
  .hamburger-btn {
    display: flex !important;
    align-items: center;
    justify-content: center;
    min-width: var(--touch-min);
    min-height: var(--touch-min);
  }
  .main-content { padding: var(--content-pad-t); }
  .topbar-inner { padding: 0 var(--content-pad-t); }
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .risk-layout { grid-template-columns: 1fr; }
  .delivery-grid { grid-template-columns: repeat(2, 1fr); }
  .section-heading { font-size: var(--heading-t); }
  .chart-wrap { height: 280px; min-height: 240px; }
  body { font-size: var(--body-t); }
}

/* Mobile: <= 767px */
@media (max-width: 767px) {
  .main-content { padding: var(--content-pad-m); }
  .topbar-inner { padding: 0 var(--content-pad-m); }
  .topbar {
    position: sticky;
    top: 0;
    left: 0;
    right: 0;
    z-index: 90;
  }
  .page-title { font-size: var(--heading-m); }
  .greeting { font-size: var(--body-m); }
  .metric-grid { grid-template-columns: 1fr; }
  .metric-card { padding: var(--space-16); }
  .delivery-grid { grid-template-columns: 1fr; }
  .delivery-metric-grid { grid-template-columns: 1fr; }
  .filters-card {
    padding: var(--content-pad-m);
    gap: var(--btn-gap);
  }
  .date-presets { gap: var(--btn-gap); }
  .preset-btn,
  .msd-trigger {
    min-height: var(--touch-min);
  }
  .btn,
  .btn-sm,
  .topbar-icon-btn,
  .user-avatar {
    min-height: var(--touch-min);
    min-width: var(--touch-min);
  }
  .topbar-left .btn { min-height: var(--touch-min); }
  .topbar-search,
  .search-shortcut { display: none !important; }
  .topbar-left { gap: 8px; }
  .topbar-divider { display: none; }
  .section-heading { font-size: var(--heading-m); }
  .section-zone { margin-top: var(--space-32); }
  .chart-card { padding: var(--content-pad-m); }
  .chart-wrap { height: 260px; min-height: 220px; }
  .chart-mini-stats { flex-wrap: wrap; gap: 16px; }
  .chart-metric-toggles { gap: var(--btn-gap); }
  .chart-metric-btn { min-height: var(--touch-min); padding: 10px 14px; }
  body { font-size: var(--body-m); }
  .store-grid { grid-template-columns: 1fr; }
}

/* Form stacking and full-width inputs on mobile */
@media (max-width: 767px) {
  .form-group,
  .form-input,
  .form-select,
  .search-box input { width: 100%; max-width: none; }
  .meta-form { flex-direction: column; align-items: stretch; }
  .meta-form .form-group { min-width: 0; }
  .date-range-row { flex-direction: column; align-items: stretch; gap: var(--btn-gap); }
  .date-range-row input { width: 100%; }
}

/* Table mobile: stacked cards (optional horizontal scroll for wide tables) */
@media (max-width: 767px) {
  .table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .table-mobile-cards {
    display: block;
  }
  .table-mobile-cards thead { display: none; }
  .table-mobile-cards tr {
    display: block;
    margin-bottom: var(--space-16);
    padding: var(--space-16);
    background: var(--surface);
    border-radius: var(--radius-card);
    box-shadow: var(--raised-sm);
    border: 1px solid var(--border);
  }
  .table-mobile-cards td {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
  }
  .table-mobile-cards td:last-child { border-bottom: none; }
  .table-mobile-cards td::before {
    content: attr(data-label);
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    flex-shrink: 0;
  }
}

/* Images: scale automatically */
img { max-width: 100%; height: auto; }

/* Button groups: minimum spacing */
.btn + .btn,
.preset-btn + .preset-btn { margin-left: 0; }
@media (max-width: 767px) {
  .vault-panel-actions,
  .vault-step-footer-right,
  .ops-controls-grid { gap: var(--btn-gap); }
}

/* ── DASHBOARD MOBILE (max-width: 768px only; desktop unchanged) ── */
.chart-mini-label-short { display: none; }
@media (max-width: 768px) {
  /* Scope: Dashboard only (prevents affecting other pages) */

  /* 1) Filter section: horizontal scroll row + store filter below */
  .dashboard-page .filters-card { padding: 14px; gap: 12px; box-shadow: var(--raised-sm); }
  .dashboard-page .container-filters {
    display: flex;
    flex-wrap: nowrap;
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    gap: 10px;
    padding: 2px 0 8px;
    margin: 0;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    min-width: 0;
  }
  .dashboard-page .container-filters::-webkit-scrollbar { display: none; }
  .dashboard-page .filter-btn {
    flex-shrink: 0;
    white-space: nowrap;
    height: 40px;
    min-height: 40px;
    padding: 0 14px;
  }
  .dashboard-page .store-filter,
  .dashboard-page .store-filter-bar { width: 100%; margin-top: 10px; }
  .dashboard-page .store-filter-chips-row { align-items: flex-start; gap: 10px; }
  .dashboard-page .store-filter-chip { min-height: 34px; padding-top: 6px; padding-bottom: 6px; }
  .dashboard-page .btn-store-filter-add { height: 40px; min-height: 40px; padding: 0 16px; }
  .dashboard-page .store-filter-popover {
    left: 0;
    right: 0;
    min-width: 0;
    max-width: none;
  }
  .dashboard-page .custom-date-inputs.visible {
    display: flex;
    flex-wrap: wrap;
    width: 100%;
    gap: 8px;
    align-items: center;
  }
  .dashboard-page .custom-date-inputs.visible input[type="date"] {
    flex: 1 1 calc(50% - 20px);
    min-width: 0;
  }
  .dashboard-page .custom-date-inputs.visible span {
    flex: 0 0 auto;
  }
  .dashboard-page .custom-date-inputs.visible #applyDate {
    flex: 1 1 100%;
    width: 100%;
    min-height: 40px;
  }
  .dashboard-page .filters-sep { display: none; }

  /* Mobile: do NOT sticky filters (prevents covering KPI cards while scrolling) */
  .dashboard-page .filters-card {
    position: relative;
    top: auto;
    z-index: 1;
    background: rgba(255, 255, 255, 0.74);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border-radius: 18px !important;
  }
  .dashboard-page .filters-card.filters-card--dashboard { z-index: 1; }

  /* 2) Metric cards: two columns on small tablets; see narrower breakpoint below for one column */
  .dashboard-page .metrics-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
  }
  .dashboard-page .metric-card {
    min-height: 100px;
    padding: 14px;
    box-shadow: var(--raised-sm);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
  }
  .dashboard-page .metric-label {
    font-size: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 6px;
  }
  .dashboard-page .metric-value {
    font-size: clamp(16px, 5.2vw, 28px);
    font-weight: 600;
    line-height: 1.15;
    letter-spacing: -0.03em;
    max-width: 100%;
    white-space: nowrap;
    overflow: hidden;
  }
  .dashboard-page .metric-sub {
    font-size: 11px;
    opacity: 0.7;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-top: 6px;
  }

  /* 3) Delivered section: reduced visual weight */
  .dashboard-page .delivered-section { opacity: 0.9; }

  /* 4) Orders trend: chart + toggles + stats row */
  .dashboard-page .chart-container { min-height: 300px; height: 300px; }
  .dashboard-page .chart-toggle { display: flex; flex-wrap: wrap; gap: 8px; }
  .dashboard-page .chart-toggle .chart-metric-btn { height: 38px; min-height: 38px; padding: 0 12px; }

  .dashboard-page .stats-row {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    text-align: center;
    gap: 8px;
    padding: 10px 0;
  }
  .dashboard-page .stats-row .chart-mini-stat { align-items: center; }
  .dashboard-page .stats-row .chart-mini-stat .chart-mini-label:not(.chart-mini-label-short) { display: none; }
  .dashboard-page .chart-mini-label-short { display: block; font-size: 12px; color: var(--text-muted); }
  .dashboard-page .chart-mini-value { font-size: 14px; font-weight: 600; }

  /* 5) Store section: one column on phones for easier scanning */
  .dashboard-page .store-grid { grid-template-columns: 1fr; gap: 14px; }
  .dashboard-page .store-card { box-shadow: var(--raised-sm); }
  .dashboard-page .store-card-header { padding: 12px; gap: 8px; }
  .dashboard-page .store-card-metrics { padding: 10px 12px; gap: 8px 12px; }
  .dashboard-page .store-metric-row { font-size: 12px; }
  .dashboard-page .store-card-footer { padding: 10px 12px; }
  .dashboard-page .store-card-footer button { width: 100%; height: 40px; }
  .dashboard-page .store-card-mobile-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: auto;
    border: 1px solid var(--border);
    background: rgba(15, 23, 42, 0.04);
    color: var(--text-muted);
    height: 30px;
    min-width: 66px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    padding: 0 10px;
    cursor: pointer;
  }
  .dashboard-page .store-card-mobile-toggle:active { transform: scale(0.98); }
  .dashboard-page .store-card--mobile-collapsed .store-card-metrics,
  .dashboard-page .store-card--mobile-collapsed .store-card-footer { display: none; }
  .dashboard-page .store-card--mobile-collapsed .store-card-mobile-toggle::after {
    content: ' ▼';
    font-size: 10px;
  }
  .dashboard-page .store-card:not(.store-card--mobile-collapsed) .store-card-mobile-toggle::after {
    content: ' ▲';
    font-size: 10px;
  }

  /* 6) Section spacing system */
  .dashboard-page .section-zone {
    margin-top: 22px;
    padding-top: 2px;
    border-top: 1px solid rgba(15, 23, 42, 0.06);
  }
  .dashboard-page .section-zone:first-of-type {
    border-top: none;
    padding-top: 0;
  }
  .dashboard-page .chart-card { padding: 14px; box-shadow: var(--raised-sm); }

  /* 8) Text overflow fix (dashboard only) */
  .dashboard-page .store-name,
  .dashboard-page .chart-title,
  .dashboard-page .chart-subtitle {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  /* 9) Reduce heavy effects on mobile (dashboard only) */
  .dashboard-page .metric-card:hover,
  .dashboard-page .chart-card:hover,
  .dashboard-page .store-card:hover { box-shadow: var(--raised-sm); transform: none; }
}

/* Dashboard: phones — one column metrics, clearer type, calmer chart */
@media (max-width: 540px) {
  .dashboard-page .metrics-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .dashboard-page .delivered-section .metrics-grid {
    grid-template-columns: 1fr;
  }
  .dashboard-page .metric-card {
    min-height: 0;
    padding: 16px;
  }
  .dashboard-page .metric-value {
    font-size: clamp(22px, 6.5vw, 34px);
    white-space: normal;
    overflow: visible;
    word-break: break-word;
  }
  .dashboard-page .metric-label {
    white-space: normal;
    line-height: 1.35;
  }
  .dashboard-page .section-heading {
    font-size: 17px;
    font-weight: 600;
    margin-bottom: 12px;
  }
  .dashboard-page .chart-container {
    min-height: 240px;
    height: auto;
  }
  .dashboard-page .dashboard-insight-card .insight-text {
    font-size: clamp(26px, 8vw, 36px);
  }
  .dashboard-page .section-zone {
    margin-top: 20px;
  }
  .dashboard-page .chart-metric-toggles {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    gap: 8px;
    padding-bottom: 4px;
    margin: 0 -4px;
    padding-left: 4px;
    padding-right: 4px;
  }
  .dashboard-page .chart-metric-toggles::-webkit-scrollbar {
    display: none;
  }
  .dashboard-page .chart-metric-btn {
    flex-shrink: 0;
  }
}

/* ── GLOBAL MOBILE HARDENING (<= 768px only) ─────────────────── */
@media (max-width: 768px) {
  /* 1) CROPPING + OVERFLOW: contain widths and padding safely */
  *, *::before, *::after { box-sizing: border-box; }

  /* Safe padding system */
  :root { --content-pad-m: 12px; }
  .topbar-inner { padding-left: 12px; padding-right: 12px; }
  .main-content { padding-left: 12px; padding-right: 12px; }

  /* Avoid clipping absolute panels/dropdowns on mobile */
  .layout,
  .content-wrap { overflow: visible; }
  .main-content { overflow-x: hidden; }

  /* 3) HORIZONTAL SCROLL REMOVAL: allow wrapping in common rows */
  .toolbar,
  .orders-page-header,
  .orders-toolbar-card,
  .orders-stats-bar,
  .filters-card,
  .date-presets,
  .search-box { flex-wrap: wrap; }

  /* 4) BUTTON VISIBILITY FIX: full-width buttons in content */
  .main-content .btn,
  .main-content .btn-sm,
  .main-content .btn-store-filter,
  .main-content .btn-store-delete {
    width: 100%;
  }
  .store-card-footer { flex-direction: column; gap: 8px; }

  /* 5) TOUCH FIX: ensure click targets receive events */
  .sidebar,
  .sidebar * { pointer-events: auto; }

  /* DASHBOARD: metric cards spacing */
  #mainMetrics.metric-grid,
  #deliveredMetrics.metric-grid { gap: 12px; }

  /* All pages: filter areas should scroll with content (no sticky overlap) */
  .filters-card,
  .delivery-filters-card,
  .orders-top-stack {
    position: relative !important;
    top: auto !important;
    z-index: 1 !important;
  }

  /* ALL ORDERS: stack search controls */
  .orders-page-header { align-items: stretch; }
  .orders-toolbar-card { width: 100%; }
  .orders-toolbar-card .search-box { width: 100%; flex-direction: column; align-items: stretch; gap: 8px; }
  .orders-toolbar-card .search-box select,
  .orders-toolbar-card .search-box input[type="text"],
  .orders-toolbar-card .search-box button { width: 100%; max-width: 100%; }
  .search-box input[type="text"] { min-width: 0; }

  /* ALL ORDERS: stats grid 2 columns */
  .orders-stats-bar { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .stat-card { min-width: 0; }

  /* DELIVERY: cards grid 2 per row on mobile */
  .delivery-metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }

  /* DELIVERY: keep table scroll inside table only */
  .delivery-table-card .table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
}

/* Avoid horizontal scroll on body */
html, body { overflow-x: hidden; }
.main-content { overflow-x: hidden; }

/* ── UI V2 OVERRIDE: FLAT / GLASS MODERN (no neumorphism) ───────────── */
:root {
  --surface: #f6f8f7;
  --surface-hover: #eef3f1;
  --shadow-light: #ffffff;
  --shadow-dark: #dfe7e4;
  --raised-sm: 0 2px 8px rgba(15, 23, 42, 0.05);
  --raised: 0 8px 24px rgba(15, 23, 42, 0.07);
  --raised-lg: 0 14px 32px rgba(15, 23, 42, 0.10);
  --inset: inset 0 0 0 1px rgba(15, 23, 42, 0.10);
  --inset-sm: inset 0 0 0 1px rgba(15, 23, 42, 0.10);
  --accent: #15803d;
  --accent-dim: rgba(21, 128, 61, 0.16);
  --text: #0b1210;
  --text-muted: #4b5b56;
  --text-subtle: #7a8a84;
  --border: rgba(15, 23, 42, 0.09);
  --border-light: rgba(15, 23, 42, 0.06);
  --radius-card: 16px;
  --radius-btn: 12px;
  --radius-input: 12px;
}

body {
  background:
    radial-gradient(circle at 45% -10%, rgba(118, 251, 145, 0.25), transparent 38%),
    #f4f7f6;
}

.topbar,
.sidebar,
.filters-card,
.chart-card,
.table-card,
.store-card,
.metric-card,
.stat-card,
.modal,
.orders-toolbar-card,
.delivery-card,
.account-card,
.ops-status-card,
.ops-activity-feed,
.ops-alerts-list {
  box-shadow: var(--raised-sm);
  border: 1px solid var(--border-light);
}

.sidebar {
  background: rgba(246, 248, 247, 0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: none;
  border-right: 1px solid var(--border-light);
}

.topbar {
  background: rgba(246, 248, 247, 0.88);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: none;
  border-bottom: 1px solid var(--border-light);
}

.nav-item {
  background: transparent;
  box-shadow: none;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 10px 14px;
}
.nav-item:hover {
  background: rgba(15, 23, 42, 0.04);
  transform: none;
  box-shadow: none;
}
.nav-item.active {
  background: #0b0f0d;
  color: #fff;
  border-left: 0;
  padding-left: 14px;
  box-shadow: none;
}
.nav-item.active svg { stroke: #fff; }

.page-title {
  font-size: clamp(38px, 4.8vw, 56px);
  font-weight: 600;
  letter-spacing: -0.03em;
}

.btn,
.ops-control-btn,
.chart-metric-btn,
.preset-btn,
.msd-trigger,
.btn-store-filter,
.btn-store-delete {
  border: 1px solid var(--border);
  box-shadow: none !important;
  transform: none !important;
  border-radius: 12px;
}
.btn:hover,
.ops-control-btn:hover,
.chart-metric-btn:hover,
.preset-btn:hover,
.msd-trigger:hover,
.btn-store-filter:hover,
.btn-store-delete:hover {
  background: var(--surface-hover);
}
.btn-primary,
.preset-btn.active,
.chart-metric-btn.active {
  background: #0b0f0d;
  color: #fff;
  border-color: #0b0f0d;
}

.topbar-search input,
.form-input,
.sr-input,
.search-box input[type="text"],
.search-box select,
.custom-date-inputs input[type="date"],
.msd-panel,
.sr-code-field,
.sr-token-field {
  box-shadow: none;
  border: 1px solid var(--border);
  background: #fff;
}

.metric-card,
.store-card,
.chart-card,
.table-card,
.stat-card {
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.metric-card::before,
.chart-card::before { display: none; }

.metric-label {
  text-transform: none;
  letter-spacing: 0;
  font-size: 13px;
  color: var(--text-muted);
}
.metric-value {
  font-size: clamp(30px, 3.1vw, 52px);
  font-weight: 600;
  letter-spacing: -0.03em;
}

.section-heading::after {
  background: linear-gradient(90deg, rgba(15, 23, 42, 0.16), transparent);
}

.notifications-container { top: 74px; right: 16px; }
.notification {
  border: 1px solid var(--border);
  border-left: 4px solid #76fb91;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.14);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.94);
}
.notification-error { border-left-color: #ef4444; }
.notification-success { border-left-color: #22c55e; }

.status-badge {
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 10px;
  letter-spacing: 0.04em;
}

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #d4ddd9, #b7c4be);
  border-radius: 999px;
}
::-webkit-scrollbar-thumb:hover { background: linear-gradient(180deg, #c1cbc6, #9eafa8); }

.topbar-icon-btn,
.user-avatar,
.hamburger-btn,
.row-action-btn {
  border: 1px solid var(--border);
  box-shadow: none;
  background: #fff;
}
.topbar-icon-btn:hover,
.user-avatar:hover,
.hamburger-btn:hover,
.row-action-btn:hover {
  background: var(--surface-hover);
  color: var(--text);
}

@media (max-width: 1023px) {
  .page-title { font-size: clamp(28px, 7vw, 40px); }
}

/* Dashboard v3 look (reference-match pass) */
.dashboard-page .dashboard-hero {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 20px;
  align-items: end;
  margin-bottom: 24px;
}
.dashboard-page .dashboard-hero-kicker {
  font-size: 11px;
  letter-spacing: 0.03em;
  text-transform: none;
  color: var(--text-muted);
  margin-bottom: 10px;
}
.dashboard-page .dashboard-hero-title {
  font-size: clamp(44px, 6.6vw, 72px);
  line-height: 0.95;
  letter-spacing: -0.035em;
  font-weight: 600;
  margin: 0;
}
.dashboard-page .dashboard-hero-stack {
  position: relative;
  height: 170px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
}
.dashboard-page .dashboard-insight-card {
  width: min(430px, 92%);
  min-height: 150px;
  border-radius: 18px;
  border: 1px solid rgba(34, 197, 94, 0.22);
  background:
    radial-gradient(circle at 20% 10%, rgba(118, 251, 145, 0.65), rgba(118, 251, 145, 0.25) 45%, rgba(255,255,255,0.78) 78%);
  box-shadow: 0 18px 32px rgba(34, 197, 94, 0.16);
  padding: 18px 20px;
}
.dashboard-page .dashboard-insight-card .insight-top {
  font-size: 12px;
  color: #0b1210;
  margin-bottom: 24px;
  font-weight: 500;
}
.dashboard-page .dashboard-insight-card .insight-text {
  font-size: 34px;
  line-height: 1.04;
  letter-spacing: -0.028em;
  font-weight: 600;
  max-width: 340px;
}
.dashboard-page .dashboard-insight-card.ghost {
  position: absolute;
  top: 10px;
  right: 54px;
  width: 300px;
  min-height: 136px;
  opacity: 0.52;
  filter: blur(0.2px);
  padding: 0;
}
.dashboard-page .dashboard-insight-card.ghost::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: inherit;
}
.dashboard-page .dashboard-insight-card.ghost-1 { transform: translateX(46px) scale(0.95); }
.dashboard-page .dashboard-insight-card.ghost-2 { transform: translateX(92px) scale(0.88); opacity: 0.34; }

.dashboard-page .filters-card {
  background: rgba(255, 255, 255, 0.74);
  border-radius: 14px;
  border: 1px solid var(--border);
  box-shadow: none;
  margin-top: 0;
  margin-bottom: 20px;
}
.dashboard-page .preset-btn,
.dashboard-page .msd-trigger,
.dashboard-page .chart-metric-btn {
  border-radius: 11px;
  height: 34px;
  padding: 0 14px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 500;
}
.dashboard-page .btn-store-filter-add {
  border-radius: 999px;
  height: 34px;
  padding: 0 14px;
  border: 1px dashed var(--border);
  background: rgba(255, 255, 255, 0.35);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 500;
}
.dashboard-page .btn-store-filter-add:hover {
  background: rgba(34, 197, 94, 0.08);
  border-color: rgba(34, 197, 94, 0.4);
  color: var(--accent);
}
.dashboard-page .preset-btn.active,
.dashboard-page .chart-metric-btn.active {
  background: #0d1210;
  border-color: #0d1210;
  color: #fff;
}

.dashboard-page .section-heading {
  font-size: 18px;
  font-weight: 500;
  letter-spacing: -0.01em;
}
.dashboard-page .section-zone { margin-top: 18px; }
.dashboard-page .metric-grid { gap: 12px; }
.dashboard-page .metric-card {
  border-radius: 13px;
  border: 1px solid var(--border);
  box-shadow: none;
  background: rgba(255, 255, 255, 0.84);
}
.dashboard-page .metric-label { font-size: 12px; }
.dashboard-page .metric-value {
  font-size: clamp(28px, 3.1vw, 46px);
  font-weight: 600;
}
.dashboard-page .chart-card {
  border-radius: 16px;
  border: 1px solid var(--border);
  box-shadow: none;
}
.dashboard-page .chart-wrap { min-height: 310px; }
.dashboard-page .store-card {
  border-radius: 13px;
  border: 1px solid var(--border);
  box-shadow: none;
}

@media (max-width: 1100px) {
  .dashboard-page .dashboard-hero {
    grid-template-columns: 1fr;
    align-items: start;
  }
  .dashboard-page .dashboard-hero-stack {
    justify-content: flex-start;
    height: 150px;
  }
  .dashboard-page .dashboard-insight-card { width: min(500px, 100%); }
}

@media (max-width: 768px) {
  .dashboard-page .dashboard-hero { margin-bottom: 12px; }
  .dashboard-page .dashboard-hero-kicker { font-size: 10px; margin-bottom: 6px; }
  .dashboard-page .dashboard-hero-title { font-size: clamp(32px, 10vw, 46px); }
  .dashboard-page .dashboard-hero-stack { height: auto; }
  .dashboard-page .dashboard-insight-card.main {
    width: 100%;
    min-height: auto;
    padding: 14px;
  }
  .dashboard-page .dashboard-insight-card .insight-top { margin-bottom: 10px; font-size: 11px; }
  .dashboard-page .dashboard-insight-card .insight-text {
    font-size: 20px;
    line-height: 1.2;
    max-width: none;
  }
  .dashboard-page .dashboard-insight-card.ghost { display: none; }
}

/* Icon stroke consistency */
.nav-item svg,
.topbar-icon-btn svg,
.hamburger-btn svg,
.row-action-btn svg,
.topbar-search-icon,
.topbar-v2 .topbar-icon-btn svg,
.topnav-mobile-toggle svg {
  stroke-width: 1.5;
}

.topbar-search input {
  height: var(--control-h);
  min-height: var(--control-h);
}

/* ═══════════════════════════════════════════════════════════════
   TOP NAV LAYOUT — full width, no sidebar (layout-topnav)
   ═══════════════════════════════════════════════════════════════ */
.layout-topnav {
  flex-direction: row;
  align-items: stretch;
}
.layout-topnav .content-wrap {
  margin-left: 0 !important;
  width: 100%;
  max-width: none;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.topbar-v2.topbar {
  height: auto;
  min-height: 72px;
  background: rgba(250, 252, 251, 0.78) !important;
  backdrop-filter: blur(18px) saturate(1.2);
  -webkit-backdrop-filter: blur(18px) saturate(1.2);
  border-bottom: none !important;
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.04) !important;
}

.topbar-v2__shell {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: clamp(10px, 2vw, 24px);
  width: 100%;
  max-width: 1680px;
  margin: 0 auto;
  padding: 10px clamp(16px, 3vw, 40px);
  position: relative;
  z-index: 340;
}

.topbar-v2__left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.topnav-mobile-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 14px;
  border: none;
  background: rgba(255, 255, 255, 0.65);
  color: var(--text-muted);
  cursor: pointer;
  transition: background 0.15s ease;
}
.topnav-mobile-toggle:hover {
  background: rgba(255, 255, 255, 0.9);
  color: var(--text);
}

.topbar-v2__logo {
  display: flex;
  align-items: center;
  text-decoration: none;
  flex-shrink: 0;
}
.topbar-v2__logo-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px 12px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.85);
  box-shadow: 0 4px 20px rgba(15, 23, 42, 0.06);
}
.topbar-v2__logo-img {
  height: 22px;
  width: auto;
  display: block;
}

/* Brand animation: right side of header, no chip background */
.topbar-v2__header-video-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  padding: 0;
  margin: 0;
  background: transparent;
  border: none;
  box-shadow: none;
  border-radius: 0;
  overflow: visible;
}

/* ===== Premium Dark Direction Overrides ===== */
:root {
  --bg: #f5f7fb;
  --surface: #ffffff;
  --surface-hover: #f8fafc;
  --card: #ffffff;
  --text: #0f172a;
  --text-muted: #64748b;
  --text-subtle: #94a3b8;
  --accent: #22c55e;
  --accent-dim: rgba(34, 197, 94, 0.14);
  --border: rgba(15,23,42,0.08);
  --radius-card: 12px;
  --radius-btn: 10px;
  --t-fast: 150ms ease;
  --t-page: 250ms ease;
}
body, #html-root { background: var(--bg); color: var(--text); }
.layout, .content-wrap, .main-content { background: transparent; }
.main-content { padding-top: 16px; }
.app-shell { display:flex; gap:16px; align-items:flex-start; }
.app-sidebar {
  width: 70px;
  position: sticky;
  top: 12px;
  height: calc(100vh - 24px);
  border: 1px solid var(--border);
  background: #ffffff;
  border-radius: 12px;
  padding: 10px 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow: hidden;
  transition: width 180ms ease, box-shadow 150ms ease;
}
.app-sidebar:hover { width: 220px; box-shadow: 0 10px 24px rgba(15,23,42,0.1); }
.app-side-item {
  height: 40px;
  border-radius: 10px;
  display:flex;
  align-items:center;
  gap:10px;
  color: var(--text-muted);
  text-decoration:none;
  padding: 0 10px;
  border-left: 2px solid transparent;
  transition: all var(--t-fast);
}
.app-side-item:hover { background: rgba(15,23,42,0.04); color: var(--text); }
.app-side-item.active {
  background: rgba(34,197,94,0.1);
  border-left-color: var(--accent);
  color: #166534;
  box-shadow: inset 0 0 0 1px rgba(34,197,94,0.2);
}
.app-side-icon {
  width: 22px;
  height: 22px;
  border-radius: 8px;
  background: rgba(15,23,42,0.06);
  display:inline-flex;
  align-items:center;
  justify-content:center;
  font-size:11px;
  font-weight:700;
  flex-shrink:0;
}
.app-side-label { white-space: nowrap; opacity: 0; transform: translateX(6px); transition: opacity 150ms ease, transform 150ms ease; }
.app-sidebar:hover .app-side-label { opacity: 1; transform: translateX(0); }
.content-wrap { flex: 1; min-width: 0; }
.topbar-v2.topbar {
  background: rgba(255,255,255,0.9);
  border: 1px solid var(--border);
  border-radius: 12px;
  backdrop-filter: blur(10px);
}
.topbar-pill, .topnav-pill {
  border-radius: var(--radius-btn);
}
.topnav-pill.active {
  background: rgba(34,197,94,0.1);
  border-left: 2px solid var(--accent);
  box-shadow: inset 0 0 0 1px rgba(34,197,94,0.2);
}
.btn, .btn-primary, .btn-secondary, .btn-sm {
  border-radius: var(--radius-btn);
  transition: transform var(--t-fast), box-shadow var(--t-fast), background var(--t-fast), color var(--t-fast);
}
.btn:active { transform: translateY(1px); }
.table-card, .chart-card, .metric-card, .stat-card, .filters-card, .orders-toolbar-card {
  background: var(--card) !important;
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  box-shadow: 0 8px 24px rgba(15,23,42,0.08);
}
.metric-card, .chart-card, .table-card {
  transition: transform 150ms ease, box-shadow 150ms ease, border-color 150ms ease;
}
.metric-card:hover, .chart-card:hover, .table-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 26px rgba(15,23,42,0.12), 0 0 0 1px rgba(34,197,94,0.12);
  border-color: rgba(34,197,94,0.22);
}
.orders-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #ffffff;
}
.orders-table .order-row:hover { background: rgba(15,23,42,0.03); }
.row-actions { opacity: 1; }
.row-action-btn {
  height: 26px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #f8fafc;
}
.ao-filter-chips { display:flex; flex-wrap:wrap; gap:8px; margin-top:10px; }
.ao-chip {
  height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #ffffff;
  color: var(--text-muted);
  transition: all var(--t-fast);
}
.ao-chip.active {
  color: #ffffff;
  background: var(--accent);
  border-color: transparent;
}
.dashboard-page .section-zone { margin-top: 16px; }
.dashboard-page .metrics-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.dashboard-page .delivered-section { display: none; }
.dashboard-page .chart-card { min-height: 360px; }
.dashboard-page .store-grid { display:none; }
.dashboard-page .section-heading { font-weight: 700; letter-spacing: -0.01em; }
.metric-value, .stat-value, .chart-kpi-value { font-size: clamp(28px, 3vw, 40px); font-weight: 700; }
.metric-label, .stat-label { color: var(--text-muted); }
.page-enter .main-content {
  animation: pageEnter var(--t-page);
}
@keyframes pageEnter {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
html { scroll-behavior: smooth; }
@media (max-width: 768px) {
  .topbar-v2__nav { display:none; }
  .app-sidebar { display:none; }
  .main-content { padding-bottom: 74px; }
  .dashboard-page .metrics-grid { grid-template-columns: 1fr 1fr; }
  .orders-toolbar-card .search-box { flex-direction: column; }
}
.dashboard-analytics-grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr);
  gap: 16px;
  align-items: stretch;
}
.dashboard-top-strip {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:12px 14px;
  margin-bottom:14px;
}
.dashboard-top-strip__date { font-size:13px; color:var(--text-muted); font-weight:600; }
.dashboard-top-strip__actions { display:flex; gap:8px; }
.insight-card { padding: 16px; }
.insight-list { display: flex; flex-direction: column; gap: 12px; }
.insight-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  border: 1px solid var(--border);
  background: rgba(15,23,42,0.02);
  border-radius: 10px;
  padding: 10px 12px;
}
.insight-k { font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); }
.insight-v { font-size: 14px; color: var(--text); line-height: 1.35; }
@media (max-width: 1024px) {
  .dashboard-analytics-grid { grid-template-columns: 1fr; }
}

/* Desktop visibility safety fix */
#pageLoadingOverlay {
  display: none !important;
}
@media (min-width: 769px) {
  .main-content,
  .dashboard-page,
  .dashboard-page > *,
  .all-orders-page {
    visibility: visible !important;
    opacity: 1 !important;
  }
  .dashboard-page .dashboard-hero,
  .dashboard-page .filters-card,
  .dashboard-page .section-zone,
  .dashboard-page .chart-card,
  .dashboard-page .table-card,
  .dashboard-page .metric-grid {
    display: block !important;
  }
}
.topbar-v2__header-video {
  display: block;
  height: 44px;
  width: auto;
  max-width: min(220px, 42vw);
  object-fit: contain;
  object-position: center center;
  background: transparent;
  pointer-events: none;
}

.topbar-v2__nav {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
}
.topnav-expand-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border-radius: 999px;
  border: 1px solid rgba(15, 23, 42, 0.1);
  background: rgba(255, 255, 255, 0.72);
  color: var(--text);
  font-size: 0;
  line-height: 0;
  transition: background 0.14s ease, color 0.14s ease, border-color 0.14s ease;
}
.topnav-expand-trigger svg {
  width: 14px;
  height: 14px;
  stroke-width: 2.2;
}
.topnav-expand-trigger:hover {
  background: rgba(15, 23, 42, 0.05);
  border-color: rgba(15, 23, 42, 0.22);
}
.topnav-expand-panel {
  position: fixed;
  inset: 0;
  transform-origin: top center;
  transform: translateY(-14px) scaleY(0.92);
  clip-path: inset(0 0 100% 0);
  width: 100vw;
  height: 100vh;
  max-height: none;
  z-index: 2147483000;
  background:
    radial-gradient(ellipse 85% 50% at 50% -8%, rgba(88, 108, 95, 0.14), transparent 58%),
    radial-gradient(ellipse 75% 58% at 50% 110%, rgba(14, 20, 18, 0.34), transparent 46%),
    linear-gradient(165deg, #050807 0%, #040606 46%, #090c0a 100%);
  color: #fff;
  border-radius: 0;
  border: none;
  box-shadow: none;
  padding: 0;
  display: flex;
  align-items: stretch;
  justify-content: stretch;
  flex-direction: column;
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
  overflow: hidden;
  backdrop-filter: blur(10px) saturate(106%);
  -webkit-backdrop-filter: blur(10px) saturate(106%);
  transition:
    clip-path 0.46s cubic-bezier(0.23, 0.78, 0.24, 1),
    transform 0.46s cubic-bezier(0.23, 0.78, 0.24, 1),
    opacity 0.28s ease,
    visibility 0.28s ease;
}
.topnav-expand-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: radial-gradient(ellipse 95% 85% at 50% 45%, transparent 40%, rgba(0, 0, 0, 0.32) 100%);
  opacity: 0.45;
}
.topnav-expand-panel::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.018) 0 1px, transparent 1px 3px),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.01) 0 1px, transparent 1px 4px);
  opacity: 0.06;
}
.topnav-expand-panel__body {
  position: relative;
  z-index: 1;
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 76px 24px 36px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.topnav-expand-panel.open {
  transform: translateY(0) scaleY(1);
  clip-path: inset(0 0 0 0);
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}
.topnav-expand-backdrop {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 90% 65% at 50% 18%, rgba(24, 32, 28, 0.36), transparent 56%),
    linear-gradient(180deg, rgba(2, 4, 3, 0.72) 0%, rgba(0, 0, 0, 0.84) 100%);
  backdrop-filter: blur(5px) saturate(102%);
  -webkit-backdrop-filter: blur(5px) saturate(102%);
  z-index: 2147482900;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.18s ease, visibility 0.18s ease;
}
.topnav-expand-backdrop.open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}
.topnav-expand-panel.is-routing {
  clip-path: inset(0 0 0 0) !important;
  transform: translateY(0) scaleY(1) !important;
  opacity: 1 !important;
  visibility: visible !important;
  transition: none !important;
  pointer-events: none !important;
}
.topnav-expand-backdrop.is-routing {
  opacity: 1 !important;
  visibility: visible !important;
  transition: none !important;
  pointer-events: none !important;
}
.topnav-expand-panel__head {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px 12px;
  background: linear-gradient(180deg, rgba(4, 6, 5, 0.92) 0%, rgba(4, 6, 5, 0) 100%);
  pointer-events: none;
}
.topnav-expand-panel__head > * {
  pointer-events: auto;
}
.topnav-expand-panel__title {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.62);
  text-shadow: none;
}
.topnav-expand-panel__close {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background:
    linear-gradient(160deg, rgba(255, 255, 255, 0.14) 0%, rgba(255, 255, 255, 0.04) 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.18),
    0 6px 16px rgba(0, 0, 0, 0.28);
  color: rgba(255, 255, 255, 0.95);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.16s ease, border-color 0.16s ease, transform 0.12s ease, box-shadow 0.16s ease;
}
.topnav-expand-panel__close:hover {
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.2) 0%, rgba(255, 255, 255, 0.08) 100%);
  border-color: rgba(255, 255, 255, 0.22);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.22),
    0 8px 20px rgba(0, 0, 0, 0.32);
}
.topnav-expand-panel__close:active { transform: scale(0.96); }
.topnav-expand-panel__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  width: 100%;
  margin: 0;
}
.topnav-expand-sections {
  margin: 0 auto;
  width: 100%;
  max-width: min(700px, 94vw);
  padding: 28px 26px 30px;
  border-radius: 26px;
  background:
    radial-gradient(140% 150% at 100% 0%, rgba(118, 145, 130, 0.12) 0%, transparent 54%),
    linear-gradient(155deg, rgba(255, 255, 255, 0.06) 0%, rgba(255, 255, 255, 0.018) 44%, rgba(0, 0, 0, 0.13) 100%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.14),
    inset 0 -16px 36px rgba(0, 0, 0, 0.18),
    0 28px 56px rgba(0, 0, 0, 0.48),
    0 0 0 1px rgba(0, 0, 0, 0.34);
  backdrop-filter: blur(12px) saturate(114%);
  -webkit-backdrop-filter: blur(12px) saturate(114%);
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  transform: translateY(10px) scale(0.988);
  opacity: 0;
}
.topnav-expand-panel.open .topnav-expand-sections {
  animation: topnavCardIn 0.46s cubic-bezier(0.23, 0.78, 0.24, 1) 0.12s forwards;
}
.topnav-expand-section {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}
.topnav-expand-section + .topnav-expand-section {
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding-top: 14px;
}
.topnav-expand-section__label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.42);
  margin: 0 0 2px 1px;
}
.topnav-expand-panel .topnav-expand-link {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  justify-content: flex-start;
  border-radius: 13px;
  min-height: 44px;
  padding: 9px 11px;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.005em;
  color: rgba(255, 255, 255, 0.94);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0.025) 100%),
    linear-gradient(180deg, rgba(10, 14, 12, 0.8) 0%, rgba(6, 9, 8, 0.93) 100%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.14),
    inset 0 -8px 16px rgba(0, 0, 0, 0.16),
    0 6px 14px rgba(0, 0, 0, 0.24);
  transform: translateY(4px);
  opacity: 0;
  animation: topnavItemIn 0.22s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
.topnav-expand-panel.open .topnav-expand-link:nth-child(1) { animation-delay: 0.02s; }
.topnav-expand-panel.open .topnav-expand-link:nth-child(2) { animation-delay: 0.04s; }
.topnav-expand-panel.open .topnav-expand-link:nth-child(3) { animation-delay: 0.06s; }
.topnav-expand-panel.open .topnav-expand-link:nth-child(4) { animation-delay: 0.08s; }
.topnav-expand-panel.open .topnav-expand-link:nth-child(5) { animation-delay: 0.10s; }
.topnav-expand-panel.open .topnav-expand-link:nth-child(6) { animation-delay: 0.12s; }
.topnav-expand-panel.open .topnav-expand-link:nth-child(7) { animation-delay: 0.14s; }
.topnav-expand-panel.open .topnav-expand-link:nth-child(8) { animation-delay: 0.16s; }
.topnav-expand-panel.open .topnav-expand-link:nth-child(9) { animation-delay: 0.18s; }
.topnav-expand-panel.open .topnav-expand-link:nth-child(10) { animation-delay: 0.20s; }
.topnav-expand-panel.open .topnav-expand-link:nth-child(11) { animation-delay: 0.22s; }
.topnav-expand-panel.open .topnav-expand-link:nth-child(12) { animation-delay: 0.24s; }
.topnav-expand-icon {
  width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 7px;
  color: rgba(255, 255, 255, 0.94);
  background:
    linear-gradient(160deg, rgba(255, 255, 255, 0.15) 0%, rgba(255, 255, 255, 0.035) 100%),
    rgba(10, 15, 12, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    0 3px 8px rgba(0, 0, 0, 0.2);
}
.topnav-expand-icon svg {
  width: 12px;
  height: 12px;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.topnav-expand-panel .topnav-expand-link:hover {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.16) 0%, rgba(255, 255, 255, 0.06) 100%),
    linear-gradient(180deg, rgba(12, 16, 14, 0.78) 0%, rgba(8, 12, 10, 0.92) 100%);
  border-color: rgba(255, 255, 255, 0.11);
  color: #fff;
  transform: translateY(-2px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.18),
    inset 0 -10px 18px rgba(0, 0, 0, 0.14),
    0 10px 18px rgba(0, 0, 0, 0.28);
}
.topnav-expand-panel .topnav-expand-link:active {
  transform: translateY(0) scale(0.992);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.14),
    0 2px 8px rgba(0, 0, 0, 0.24);
}
.topnav-expand-panel .topnav-expand-link.active {
  border-color: rgba(126, 205, 164, 0.2);
  background:
    linear-gradient(180deg, rgba(124, 232, 176, 0.18) 0%, rgba(42, 108, 77, 0.3) 100%),
    linear-gradient(180deg, rgba(10, 30, 21, 0.8) 0%, rgba(6, 22, 15, 0.9) 100%) !important;
  color: #f0fff6 !important;
  box-shadow:
    inset 0 1px 0 rgba(186, 242, 214, 0.28),
    inset 0 0 24px rgba(90, 196, 146, 0.1),
    0 10px 20px rgba(8, 36, 24, 0.34);
  transform: translateY(-1px) scale(1.01);
}
.topnav-expand-panel .topnav-expand-link.active .topnav-expand-icon {
  border-color: rgba(155, 230, 194, 0.28);
  background:
    linear-gradient(160deg, rgba(172, 244, 211, 0.2) 0%, rgba(122, 216, 172, 0.06) 100%),
    rgba(10, 28, 20, 0.7);
  box-shadow:
    inset 0 1px 0 rgba(198, 246, 222, 0.24),
    0 3px 10px rgba(21, 82, 53, 0.22);
}
body.topnav-expand-open .topbar-v2__nav > .topnav-pill:not(.active),
body.topnav-expand-open .topbar-v2__nav > .topnav-more {
  display: none;
}
body.topnav-expand-open .topbar-v2 {
  background: transparent !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  box-shadow: none !important;
}
body.topnav-expand-open .topbar-v2__shell,
body.topnav-expand-open .topbar-v2__actions,
body.topnav-expand-open .topbar-v2__logo,
body.topnav-expand-open .topbar-v2__header-video-wrap {
  opacity: 1;
  pointer-events: auto;
}
body.topnav-expand-open .main-content {
  opacity: 1;
  pointer-events: auto;
}
body.topnav-expand-open .topnav-expand-panel,
body.topnav-expand-open .topnav-expand-backdrop {
  pointer-events: none;
}
/* Desktop nav should show full set (mobile + desktop parity).
   Do NOT hide inactive pills or the More menu on desktop. */
@media (min-width: 720px) {
  .topnav-expand-panel__grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
@media (max-width: 719px) {
  .topnav-expand-sections {
    padding: 22px 18px 26px;
    border-radius: 18px;
  }
  .topnav-expand-panel__body {
    padding: 72px 16px 28px;
  }
}
@keyframes topnavItemIn {
  from { opacity: 0; transform: translateY(6px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes topnavCardIn {
  from { opacity: 0; transform: translateY(16px) scale(0.975); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.topnav-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 16px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--text-muted);
  text-decoration: none;
  border: none;
  background: transparent;
  cursor: pointer;
  transition: color 0.15s ease, background 0.15s ease;
  white-space: nowrap;
  font-family: var(--font-sans);
}
.topnav-pill:hover {
  color: var(--text);
  background: rgba(15, 23, 42, 0.04);
}
.topnav-pill.active {
  background: #0f1412 !important;
  color: #fff !important;
  box-shadow: 0 6px 20px rgba(15, 23, 42, 0.12);
}
.topnav-pill--more {
  gap: 4px;
}
.topnav-pill--current {
  text-transform: none;
  letter-spacing: -0.01em;
}
.topnav-more-caret {
  font-size: 10px;
  opacity: 0.7;
}
.topnav-pill--more.open {
  background: rgba(15, 23, 42, 0.06);
  color: var(--text);
}

.topnav-more {
  position: relative;
}
.topnav-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  min-width: 200px;
  padding: 8px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.12);
  border: 1px solid rgba(15, 23, 42, 0.06);
  z-index: 200;
}
.topnav-dropdown.open {
  display: block;
}
.topnav-dropdown__link {
  display: block;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  text-decoration: none;
  transition: background 0.12s ease;
}
.topnav-dropdown__link:hover {
  background: rgba(15, 23, 42, 0.05);
}
.topnav-dropdown__section-title {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: lowercase;
  color: var(--text-subtle);
  opacity: 0.8;
  padding: 8px 10px 6px;
}
.topnav-dropdown__divider {
  height: 1px;
  background: rgba(15, 23, 42, 0.08);
  margin: 8px 6px;
  border-radius: 999px;
}
.topnav-dropdown__link--logout {
  margin-top: 4px;
  padding-top: 12px;
  border-top: 1px solid rgba(15, 23, 42, 0.06);
  color: #b91c1c;
}
.topnav-dropdown__link--logout:hover {
  background: rgba(239, 68, 68, 0.08);
}

.topbar-v2__actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-shrink: 0;
  min-width: 0;
}

.topbar-search--v2 {
  max-width: 220px;
  min-width: 120px;
}
.topbar-search--v2 input {
  height: 40px;
  min-height: 40px;
  padding: 10px 14px 10px 40px;
  border-radius: 999px !important;
  border: none !important;
  background: rgba(255, 255, 255, 0.72) !important;
  box-shadow: none !important;
  font-size: 13px;
}
.topbar-search--v2 input:focus {
  outline: none;
  box-shadow: 0 0 0 2px rgba(118, 251, 145, 0.35) !important;
}
.topbar-search--v2 .topbar-search-icon {
  left: 14px;
  width: 16px;
  height: 16px;
}

.topbar-icon-btn--v2 {
  width: 42px;
  height: 42px;
  border-radius: 14px !important;
  background: rgba(255, 255, 255, 0.65) !important;
  border: none !important;
  box-shadow: none !important;
}
.topbar-icon-btn--v2:hover {
  background: rgba(255, 255, 255, 0.92) !important;
}

.topbar-profile {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 4px 4px 4px;
  margin-left: 4px;
}
.topbar-profile__avatar {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: linear-gradient(145deg, #e8f5ec, #d4ebe0);
  color: #0f1412;
  font-weight: 700;
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.topbar-profile__meta {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
  max-width: 140px;
}
.topbar-profile__name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.topbar-profile__role {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 500;
}

/* Mobile drawer */
.topnav-drawer-backdrop {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 90% 55% at 50% 0%, rgba(26, 40, 33, 0.26), transparent 62%),
    linear-gradient(180deg, rgba(2, 6, 4, 0.72) 0%, rgba(0, 0, 0, 0.82) 100%);
  z-index: 9998;
  backdrop-filter: blur(8px) saturate(108%);
  -webkit-backdrop-filter: blur(8px) saturate(108%);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.24s ease, visibility 0.24s ease;
}
.topnav-drawer-backdrop.open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}
.topnav-drawer {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  width: 100vw;
  max-height: min(88vh, 780px);
  z-index: 9999;
  color: #ecf4ef;
  background:
    radial-gradient(ellipse 85% 50% at 50% -8%, rgba(88, 108, 95, 0.18), transparent 58%),
    radial-gradient(ellipse 75% 58% at 50% 110%, rgba(14, 20, 18, 0.34), transparent 46%),
    linear-gradient(165deg, #050807 0%, #040606 46%, #090c0a 100%);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
  border-bottom: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 0 0 24px 24px;
  padding: 14px 14px 18px;
  overflow-y: auto;
  isolation: isolate;
  transform: translateY(-108%);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: transform 0.32s cubic-bezier(0.22, 0.72, 0.21, 1), opacity 0.24s ease, visibility 0.24s ease;
  will-change: transform;
}
.topnav-drawer.open {
  transform: translateY(0);
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}
.topnav-drawer__head {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 2px 12px;
  margin: 0 0 8px;
  background: rgba(6, 12, 9, 0.78);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.topnav-drawer__title {
  font-size: 14px;
  font-weight: 700;
  color: #e8f2ec;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.topnav-drawer__close {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.08);
  color: #ecf4ef;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease, transform 0.12s ease;
}
.topnav-drawer__close:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.28);
}
.topnav-drawer__close:active { transform: scale(0.97); }
.topnav-drawer__inner {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.topnav-drawer__section-label {
  margin: 2px 6px 0;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(204, 219, 210, 0.72);
}
.topnav-drawer__inner .topnav-pill {
  width: 100%;
  justify-content: flex-start;
  padding: 12px 14px;
  border-radius: 14px;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0;
  color: rgba(235, 246, 239, 0.92);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.topnav-drawer__inner .topnav-pill:hover {
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(255, 255, 255, 0.18);
  color: #ffffff;
}
.topnav-drawer__inner .topnav-pill.active {
  background: linear-gradient(180deg, rgba(118, 251, 145, 0.24), rgba(118, 251, 145, 0.16)) !important;
  color: #ccffd8 !important;
  border-color: rgba(118, 251, 145, 0.42);
  box-shadow: inset 0 0 0 1px rgba(118, 251, 145, 0.25);
}
.topnav-drawer__sep {
  height: 1px;
  background: rgba(255, 255, 255, 0.12);
  margin: 10px 2px;
}
.topnav-pill--logout {
  margin-top: 10px;
  color: #b91c1c !important;
  justify-content: center;
  background: rgba(185, 28, 28, 0.03) !important;
  border-color: rgba(185, 28, 28, 0.14) !important;
}

.page-heading-bar {
  grid-column: 1 / -1;
  padding-bottom: 8px;
  margin-bottom: 8px;
}
.page-heading-bar__title {
  font-family: var(--font-display);
  font-size: clamp(26px, 3.2vw, 40px);
  font-weight: 600;
  letter-spacing: -0.03em;
  color: var(--text);
  margin: 0;
}

.layout-topnav .main-content {
  max-width: none !important;
  width: 100%;
  padding-top: clamp(20px, 3vw, 36px);
  padding-left: clamp(16px, 3vw, 40px);
  padding-right: clamp(16px, 3vw, 40px);
  padding-bottom: var(--space-32);
}

/* Dashboard: hero + glass + chart breathing room */
.dashboard-page .dashboard-hero {
  margin-top: clamp(8px, 2vw, 20px);
  margin-bottom: 28px;
  gap: 24px;
}
.dashboard-page .dashboard-hero-kicker {
  margin-bottom: 14px;
  font-size: 12px;
}
.dashboard-page .dashboard-hero-title {
  font-weight: 600;
}

.dashboard-page .dashboard-hero-stack {
  height: 200px;
}
.dashboard-page .dashboard-insight-card.main {
  width: min(480px, 100%);
  min-height: 176px;
  padding: 20px 22px;
  border: none !important;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-radius: 20px;
  background:
    radial-gradient(ellipse 120% 80% at 18% 0%, rgba(118, 251, 145, 0.85), rgba(118, 251, 145, 0.35) 42%, rgba(255, 255, 255, 0.55) 100%) !important;
  box-shadow:
    0 0 0 1px rgba(118, 251, 145, 0.25),
    0 24px 48px rgba(34, 197, 94, 0.18),
    0 0 70px rgba(118, 251, 145, 0.12) !important;
}
.dashboard-page .dashboard-insight-card .insight-top.hero-kpi-label {
  margin-bottom: 12px;
  font-size: 11px;
  letter-spacing: 0.02em;
  color: var(--text-subtle);
  font-weight: 600;
}
.dashboard-page .dashboard-insight-card .insight-text.hero-kpi-value {
  font-size: clamp(22px, 3.3vw, 38px);
  letter-spacing: -0.03em;
  font-weight: 600;
  line-height: 1.04;
}
.dashboard-page .dashboard-insight-card .hero-kpi-secondary {
  margin-top: 6px;
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 600;
  opacity: 0.95;
}
.dashboard-page .dashboard-insight-card.ghost {
  top: 14px;
  right: 48px;
  width: 320px;
  min-height: 148px;
  border: none !important;
  opacity: 0.45;
  box-shadow: 0 16px 32px rgba(34, 197, 94, 0.12) !important;
}
.dashboard-page .dashboard-insight-card.ghost-2 {
  opacity: 0.28;
}
.dashboard-page .dashboard-insight-card.ghost-3 {
  transform: translateX(138px) scale(0.84);
  opacity: 0.22;
  filter: blur(0.15px);
}

/* Desktop: positioning context for store popover. Mobile uses sticky rules in dashboard mobile block. */
@media (min-width: 769px) {
  .dashboard-page .filters-card--dashboard {
    position: relative;
  }
}
.dashboard-page .filters-card--dashboard {
  z-index: 120;
  border: none !important;
  background: rgba(255, 255, 255, 0.55) !important;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 8px 32px rgba(15, 23, 42, 0.06) !important;
  border-radius: 20px !important;
  margin-bottom: 28px;
  overflow: visible;
}

.dashboard-page .metric-card {
  border: none !important;
  background: rgba(255, 255, 255, 0.58) !important;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 10px 36px rgba(15, 23, 42, 0.07) !important;
  border-radius: 18px !important;
}
.dashboard-page .metric-grid {
  gap: 20px !important;
}
.dashboard-page .section-zone {
  margin-top: 28px !important;
}

.dashboard-page .chart-card {
  border: none !important;
  background: rgba(255, 255, 255, 0.58) !important;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 12px 40px rgba(15, 23, 42, 0.08) !important;
  border-radius: 22px !important;
  padding: clamp(20px, 2.5vw, 28px) !important;
}
.dashboard-page .chart-wrap {
  min-height: 360px !important;
}
.dashboard-page .store-grid {
  gap: 22px !important;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)) !important;
}
.dashboard-page .store-card {
  border: none !important;
  background: rgba(255, 255, 255, 0.58) !important;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 10px 36px rgba(15, 23, 42, 0.07) !important;
  border-radius: 18px !important;
}

@media (max-width: 1100px) {
  .topbar-profile__meta {
    display: none;
  }
}

@media (max-width: 1023px) {
  .topbar-v2__nav {
    display: none;
  }
  .topnav-expand-panel,
  .topnav-expand-backdrop,
  .topnav-expand-trigger {
    display: none !important;
  }
  .topnav-mobile-toggle {
    display: flex;
  }
  .topbar-search--v2 {
    max-width: 140px;
  }
  .topnav-drawer {
    max-height: min(90vh, 760px);
    border-radius: 0 0 20px 20px;
  }
  body.topnav-drawer-open {
    overflow: hidden;
    touch-action: none;
  }
}

@media (max-width: 600px) {
  .topbar-search--v2 {
    display: none !important;
  }
  .topbar-v2__header-video {
    height: 52px;
    max-width: min(240px, 55vw);
  }
}

body.topnav-drawer-open { overflow: hidden; }
body.topnav-drawer-open .topbar {
  z-index: 11000 !important;
}
body.topnav-drawer-open .topbar-v2 {
  isolation: isolate;
}

/* Dashboard: chart polish (minimal green line, subtle tooltip, pill filters) */
.dashboard-page .chart-metric-toggles {
  gap: 10px !important;
  margin-bottom: 14px !important;
}
.dashboard-page .chart-metric-btn {
  border-radius: 9999px !important;
  border: none !important;
  background: rgba(15, 23, 42, 0.05) !important;
  box-shadow: none !important;
  color: var(--text-subtle) !important;
  padding: 8px 12px !important;
  font-size: 12px !important;
  transition: background var(--t-fast), color var(--t-fast) !important;
}
.dashboard-page .chart-metric-btn:hover {
  background: rgba(15, 23, 42, 0.08) !important;
  color: var(--text) !important;
}
.dashboard-page .chart-metric-btn.active {
  background: #0b0f0d !important;
  color: #fff !important;
}

.dashboard-page .chart-wrap {
  padding-top: 6px;
  padding-bottom: 6px;
  min-height: 240px !important;
}

.dashboard-page .chart-card {
  border: none !important;
  border-radius: 20px !important;
  padding: 18px 18px 16px !important;
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.06) !important;
}

.dashboard-page .chart-kpi {
  padding: 0 2px;
  margin-bottom: 10px;
}
.dashboard-page .chart-kpi-value {
  font-size: clamp(28px, 3.4vw, 44px) !important;
  font-weight: 650;
  letter-spacing: -0.03em;
  color: var(--text);
}
.dashboard-page .chart-kpi-label {
  margin-top: 4px;
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 600;
}

.dashboard-page .chart-tooltip {
  padding: 8px 12px !important;
  border-radius: 14px !important;
  background: rgba(255, 255, 255, 0.92) !important;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: none !important;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.10) !important;
}
.dashboard-page .chart-tooltip-title {
  font-weight: 700;
  font-size: 12px;
  margin-bottom: 6px;
  color: var(--text) !important;
}
.dashboard-page .chart-tooltip-value {
  font-weight: 700;
  font-size: 13px;
  color: var(--text) !important;
  margin-bottom: 0;
}
.dashboard-page .chart-tooltip-extra {
  font-size: 11px;
  color: var(--text-muted) !important;
  margin-top: 6px;
}

/* ── ALL ORDERS UI REFRESH (desktop + mobile) ───────────────────── */
.all-orders-page { gap: 18px; }
.orders-top-stack {
  position: sticky;
  top: 0;
  z-index: 80;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding-top: 6px;
  padding-bottom: 10px;
  background: linear-gradient(180deg, rgba(246, 248, 247, 0.98) 0%, rgba(246, 248, 247, 0.95) 75%, rgba(246, 248, 247, 0.6) 100%);
  backdrop-filter: blur(6px);
}
.orders-toolbar-card {
  position: relative;
  border: 1px solid var(--border);
  box-shadow: var(--raised-sm);
  margin-bottom: 0;
}
.all-orders-search-row {
  width: 100%;
  display: grid;
  grid-template-columns: 180px minmax(240px, 1fr) 110px auto;
  gap: 10px;
  align-items: center;
}
.all-orders-search-row select,
.all-orders-search-row input[type="text"],
.all-orders-search-row button {
  height: 40px;
}
.orders-stats-bar {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 6px;
}
.orders-stats-bar .stat-card {
  min-height: 104px;
  border: 1px solid var(--border);
  box-shadow: var(--raised-sm);
}
.orders-table-card {
  margin-top: 0;
  border: 1px solid var(--border);
  box-shadow: var(--raised-sm);
}
.orders-table-card .table-scroll { padding: 8px 12px 12px; }
.orders-table-fixed { table-layout: fixed; width: 100%; }
.orders-table-fixed thead th:nth-child(1) { width: 42%; }
.orders-table-fixed thead th:nth-child(2) { width: 28%; }
.orders-table-fixed thead th:nth-child(3) { width: 18%; }
.orders-table-fixed thead th:nth-child(4) { width: 12%; }
.orders-table th:nth-child(4), .orders-table td:nth-child(4) { text-align: right; }
.orders-table thead th {
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
  background: transparent;
}
.orders-table tbody td { border-bottom: 1px solid rgba(15, 23, 42, 0.06); padding: 14px 12px; vertical-align: top; }
.orders-table tbody tr.order-summary-row td { padding-top: 16px; padding-bottom: 16px; }
.orders-table tbody tr.order-summary-row { transition: background var(--t-fast); }
.orders-table tbody tr.order-summary-row:hover { background: rgba(15, 23, 42, 0.02); }

.orders-table tbody tr.order-summary-row td { overflow: hidden; text-overflow: ellipsis; }
.orders-table tbody tr.order-summary-row .td-order,
.orders-table tbody tr.order-summary-row .td-mid { overflow: hidden; }

.ao-order-id { font-size: 15px; font-weight: 800; letter-spacing: -0.02em; color: var(--text); }
.ao-store-id { display: inline-block; margin-left: 8px; font-size: 12px; color: var(--text-subtle); font-weight: 600; }
.ao-customer { margin-top: 6px; font-size: 13px; font-weight: 600; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ao-mid .ao-loc { font-size: 13px; font-weight: 650; color: var(--text); display: flex; gap: 10px; flex-wrap: wrap; }
.ao-mid .ao-pay { margin-top: 6px; font-size: 12px; color: var(--text-muted); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ao-right { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.ao-time { font-size: 12px; color: var(--text-muted); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.total-cell { white-space: nowrap; }

/* Stronger status pills */
.orders-table .status-badge {
  border-radius: 999px;
  padding: 6px 10px;
  font-weight: 800;
  font-size: 11px;
  letter-spacing: 0.02em;
}
.orders-table .date-header-row {
  cursor: default;
  background: transparent !important;
}
.orders-table .date-header-row td {
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
  padding-top: 12px;
  padding-bottom: 8px;
}
.orders-table .date-header-inner { gap: 8px; }
.orders-table .date-header-text {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}
.orders-table .order-summary-row {
  cursor: pointer;
  transition: background var(--t-fast);
}
.orders-table .order-summary-row:hover { background: rgba(15, 23, 42, 0.03); }
.orders-table .order-summary-row.open { background: rgba(15, 23, 42, 0.04); }
.orders-table .order-cell { gap: 4px; }
.orders-table .order-id { font-size: 14px; font-weight: 600; }
.orders-table .store-order-id { font-size: 12px; color: var(--text-subtle); }
.orders-table .customer-cell { font-size: 14px; font-weight: 500; }
.orders-table .state-cell { font-size: 13px; }
.orders-table .total-cell { font-size: 14px; font-weight: 700; }
.orders-table .order-details-row[hidden] { display: none; }
.orders-table .order-details-row td {
  padding: 0 14px 14px;
  background: transparent;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}
.orders-table .order-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 14px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.74);
  border: 1px solid rgba(15, 23, 42, 0.07);
  border-radius: 12px;
}
.orders-table .order-detail-item { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.orders-table .order-detail-item .k {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-subtle);
}
.orders-table .order-detail-item .v {
  font-size: 13px;
  color: var(--text);
  overflow-wrap: anywhere;
}
.orders-table .order-detail-item--full { grid-column: 1 / -1; }
.status-new { background: rgba(100, 116, 139, 0.14); color: #475569; }
.status-new::before { background: #64748b; }
.status-return { background: rgba(239, 68, 68, 0.14); color: #b91c1c; }
.status-return::before { background: #ef4444; }
.status-pickup { background: rgba(245, 158, 11, 0.16); color: #b45309; }
.status-pickup::before { background: #f59e0b; }
#pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 0 16px;
}
#pagination button {
  min-width: 36px;
  height: 36px;
  padding: 0 10px;
  border-radius: 10px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  background: #fff;
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  box-shadow: var(--raised-sm);
  transition: background var(--t-fast), color var(--t-fast), border-color var(--t-fast), transform var(--t-fast);
}
#pagination button:hover:not(:disabled) {
  background: rgba(15, 23, 42, 0.04);
  border-color: rgba(15, 23, 42, 0.2);
  transform: translateY(-1px);
}
#pagination button.active {
  background: #0f1412;
  color: #fff;
  border-color: #0f1412;
}
#pagination button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

@media (max-width: 768px) {
  /* Mobile: cards from table rows (no absolute, no overflow hidden) */
  .orders-table thead { display: none; }
  .orders-table,
  .orders-table tbody,
  .orders-table tr,
  .orders-table td { display: block; width: 100%; }

  .orders-table tbody td { padding: 0; border-bottom: none; }
  .orders-stats-bar .stat-card:nth-child(2) { display: none; }

  .orders-table .date-header-row td {
    padding: 10px 6px 8px;
  }
  .orders-table .date-header-inner {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
  }
  .orders-table .date-order-count {
    background: rgba(34, 197, 94, 0.16);
    color: #137d41;
    border: 1px solid rgba(34, 197, 94, 0.22);
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 800;
    text-transform: none;
    letter-spacing: 0;
    flex-shrink: 0;
  }

  .orders-table .order-summary-row {
    margin: 0 0 8px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.06);
    border: 1px solid rgba(15, 23, 42, 0.06);
  }
  .orders-table .order-summary-row:hover { background: rgba(255, 255, 255, 0.96); }

  .orders-table .order-summary-row td { padding: 0; }

  /* Mobile: show ONLY order id in list */
  .ao-id-only {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    min-height: 52px;
  }
  .ao-id-only__label {
    font-size: 11px;
    font-weight: 800;
    color: var(--text-subtle);
    text-transform: uppercase;
    letter-spacing: 0.10em;
    line-height: 1;
  }
  .ao-id-only__id {
    font-size: 16px;
    font-weight: 900;
    letter-spacing: -0.02em;
    color: var(--text);
    line-height: 1.1;
  }

  .ao-mobile-id-row:active .ao-id-only {
    transform: translateY(0.5px);
  }

  .ao-card { padding: 12px; display: flex; flex-direction: column; gap: 10px; }
  .ao-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
  .ao-card-id { font-size: 16px; font-weight: 800; letter-spacing: -0.02em; color: var(--text); }
  .ao-card-mid { display: flex; flex-direction: column; gap: 4px; }
  .ao-card-customer { font-size: 13px; font-weight: 650; color: var(--text); }
  .ao-card-loc { display: flex; gap: 10px; flex-wrap: wrap; font-size: 12px; color: var(--text-muted); font-weight: 600; }
  .ao-card-bot { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; font-size: 12px; color: var(--text-muted); font-weight: 650; }
  .ao-card-amt { font-size: 14px; font-weight: 800; color: var(--text); white-space: nowrap; }
  .ao-card-time { font-size: 12px; color: var(--text-subtle); font-weight: 600; }
  .ao-card-pay { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 62%; }

  .orders-table .order-details-row td { padding: 0; border: none; }
  .ao-card-details { margin: -6px 0 10px; }
  .ao-card-details .order-detail-grid {
    border-radius: 12px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.86);
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.07);
    border: 1px solid rgba(15, 23, 42, 0.06);
  }
  .orders-table .order-details-row[hidden] { display: none; }

  /* Expand state (inline only) */
  .orders-table .order-summary-row.active {
    border-color: rgba(34, 197, 94, 0.28);
    box-shadow: 0 12px 32px rgba(34, 197, 94, 0.14);
  }
}

/* All Orders: mobile popup (modal) */
body.ao-pop-open { overflow: hidden; }
.ao-pop-overlay {
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 23, 0.52);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 1200;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.16s ease, visibility 0.16s ease;
}
.ao-pop-overlay.open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}
.ao-pop {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -48%) scale(0.985);
  width: min(720px, calc(100vw - 24px));
  max-height: min(78vh, 720px);
  overflow: auto;
  background: var(--surface);
  border: 1px solid rgba(15, 23, 42, 0.10);
  border-radius: var(--radius-modal);
  box-shadow: var(--raised-lg);
  z-index: 1201;
  padding: 16px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s ease;
}
.ao-pop.open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translate(-50%, -50%) scale(1);
}
.ao-pop-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
}
.ao-pop-title {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 800;
  color: var(--text);
}
.ao-pop-close {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: 1px solid rgba(15, 23, 42, 0.10);
  background: rgba(255, 255, 255, 0.7);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.ao-pop-sub {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 12px;
}
.ao-pop-body { padding-bottom: 6px; }
.ao-pop-kv {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 12px;
}
.ao-pop-kv__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: rgba(15, 23, 42, 0.02);
}
.ao-pop-kv__row .k { font-size: 12px; font-weight: 800; color: var(--text-subtle); }
.ao-pop-kv__row .v { font-size: 12px; font-weight: 800; color: var(--text); text-align: right; }

@media (max-width: 420px) {
  .ao-pop { padding: 14px; max-height: 82vh; }
  .ao-pop-kv { grid-template-columns: 1fr; }
}
  .orders-top-stack {
    top: 0;
    gap: 10px;
    padding-top: 4px;
    padding-bottom: 8px;
  }
  .orders-toolbar-card { padding: 10px; }
  .all-orders-search-row {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 8px;
    padding-bottom: 2px;
    margin-bottom: 8px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .all-orders-search-row::-webkit-scrollbar { display: none; }
  .all-orders-search-row select,
  .all-orders-search-row input[type="text"],
  .all-orders-search-row button {
    flex-shrink: 0;
  }
  .all-orders-search-row select { width: 140px; }
  .all-orders-search-row input[type="text"] { width: 210px; }
  .all-orders-search-row #searchBtn,
  .all-orders-search-row #clearSearchBtn { width: 92px; }
  .all-orders-search-row select,
  .all-orders-search-row input[type="text"],
  .all-orders-search-row button {
    height: 38px;
    min-height: 38px;
    border-radius: 12px;
  }
  .orders-page-header .section-heading { margin-bottom: 0; }
  .orders-stats-bar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }
  .orders-stats-bar .stat-card {
    min-height: 84px;
    padding: 10px 12px;
  }
}

/* =========================================================
   SUROZAX PREMIUM LIGHT OVERRIDES (2026 SYSTEM)
   ========================================================= */
:root {
  --bg: #FAFAFA;
  --surface: #FFFFFF;
  --surface-hover: #F5F5F5;
  --card: #FFFFFF;
  --border: #EAEAEA;
  --text: #111111;
  --text-muted: #6B6B6B;
  --text-subtle: #A0A0A0;
  --accent: #D6CFC7;
  --danger: #E57373;
  --font-sans: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  --font-display: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  --s4: 4px;
  --s8: 8px;
  --s12: 12px;
  --s16: 16px;
  --s20: 20px;
  --s24: 24px;
  --s32: 32px;
  --s40: 40px;
  --radius-card: 12px;
  --radius-btn: 10px;
  --radius-input: 10px;
  --radius-modal: 14px;
  --btn-h: 40px;
  --control-h: 44px;
  --t-fast: 120ms ease-out;
  --t-norm: 180ms ease-out;
  --t-slow: 250ms ease-out;
  --t-page: 200ms ease-out;
}

body, #html-root {
  background: var(--bg) !important;
  color: var(--text) !important;
  font-family: var(--font-sans);
}

.layout,
.content-wrap,
.main-content { background: transparent !important; }

.content-wrap {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
}

.main-content {
  padding: var(--s24) var(--s24) var(--s40);
  animation: surozaxPageEnter var(--t-page);
}
@keyframes surozaxPageEnter {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* 12-column base grid */
.dashboard-page,
.all-orders-page {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: var(--s24);
}
.dashboard-page > * ,
.all-orders-page > * {
  grid-column: 1 / -1;
}

/* Shell + nav */
.app-shell { gap: var(--s24) !important; align-items: flex-start; }
.app-sidebar {
  width: 70px !important;
  height: calc(100vh - 16px);
  position: sticky;
  top: var(--s8);
  border: 1px solid var(--border) !important;
  border-radius: var(--radius-card) !important;
  background: #fff !important;
  padding: var(--s8) !important;
  box-shadow: none !important;
  transition: width var(--t-norm), border-color var(--t-fast);
}
.app-sidebar:hover { width: 220px !important; border-color: #dcdcdc !important; }
.app-side-item {
  height: 40px !important;
  border-radius: var(--radius-btn) !important;
  border-left: 2px solid transparent;
  color: var(--text-muted) !important;
  transition: background var(--t-fast), color var(--t-fast), transform var(--t-fast), border-color var(--t-fast);
}
.app-side-item:hover {
  background: var(--surface-hover) !important;
  color: var(--text) !important;
}
.app-side-item.active {
  background: #f2efeb !important;
  color: var(--text) !important;
  border-left-color: var(--accent) !important;
  box-shadow: none !important;
}
.app-side-icon {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: #f4f4f4 !important;
  color: var(--text-muted);
}

.topbar.topbar-v2 {
  position: sticky;
  top: var(--s8);
  z-index: 80;
  border: 1px solid var(--border) !important;
  border-bottom: 1px solid var(--border) !important;
  border-radius: var(--radius-card) !important;
  background: #fff !important;
  box-shadow: none !important;
}
.topbar-v2__shell {
  padding: var(--s12) var(--s16) !important;
}

/* Typography hierarchy */
h1, .page-heading-bar__title { font-size: 32px; font-weight: 600; letter-spacing: -0.01em; line-height: 1.5; }
h2, .section-heading { font-size: 24px !important; font-weight: 600 !important; letter-spacing: -0.01em; line-height: 1.5; }
h3, .table-title { font-size: 18px !important; font-weight: 500 !important; line-height: 1.5; }
body, p, input, select, button, td, th { font-size: 14px; line-height: 1.5; }
.metric-label, .stat-label, .form-label { font-size: 12px !important; font-weight: 400 !important; color: var(--text-muted) !important; }
.metric-value, .stat-value, .chart-kpi-value { font-size: clamp(32px, 2.8vw, 42px) !important; font-weight: 600 !important; color: var(--text) !important; }

/* Cards */
.table-card, .chart-card, .metric-card, .stat-card, .orders-toolbar-card, .filters-card, .store-card, .insight-item, .dashboard-top-strip {
  background: #fff !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius-card) !important;
  box-shadow: none !important;
}
.table-card, .chart-card, .orders-toolbar-card, .filters-card, .dashboard-top-strip { padding: var(--s20) !important; }
.metric-card, .stat-card { padding: var(--s20) !important; min-height: 120px; }
.metric-card, .chart-card, .table-card, .stat-card {
  transition: transform var(--t-fast), border-color var(--t-fast), background var(--t-fast);
}
.metric-card:hover, .chart-card:hover, .table-card:hover, .stat-card:hover {
  transform: translateY(-2px);
  border-color: #dcdcdc !important;
}

/* Buttons */
.btn, .btn-primary, .btn-secondary, .btn-sm, .btn-ghost {
  height: var(--btn-h) !important;
  min-height: var(--btn-h) !important;
  border-radius: var(--radius-btn) !important;
  padding: 0 var(--s16) !important;
  transition: transform var(--t-fast), background var(--t-fast), border-color var(--t-fast), color var(--t-fast);
}
.btn:active, .btn-primary:active, .btn-secondary:active { transform: scale(0.98); }
.btn-primary {
  background: #111 !important;
  color: #fff !important;
  border: 1px solid #111 !important;
}
.btn-primary:hover { background: #222 !important; }
.btn-secondary, .btn-ghost {
  background: transparent !important;
  color: var(--text) !important;
  border: 1px solid var(--border) !important;
}
.btn-secondary:hover, .btn-ghost:hover { background: var(--surface-hover) !important; }

/* Inputs/selects/forms */
input[type="text"], input[type="search"], input[type="date"], input[type="number"], input[type="password"], select, textarea, .form-input {
  height: var(--control-h) !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius-input) !important;
  background: #fff !important;
  color: var(--text) !important;
  padding: 12px 14px !important;
  transition: border-color 150ms ease-out, background 150ms ease-out;
  box-shadow: none !important;
  caret-color: #111;
}
input::placeholder, textarea::placeholder { color: var(--text-subtle) !important; }
input:hover, select:hover, textarea:hover, .form-input:hover { border-color: #dcdcdc !important; }
input:focus, select:focus, textarea:focus, .form-input:focus {
  outline: 2px solid rgba(17,17,17,0.10) !important;
  outline-offset: 1px;
  border-color: #111 !important;
}
input:disabled, select:disabled, textarea:disabled { background: #F5F5F5 !important; color: #9a9a9a !important; }
.is-error, input[aria-invalid="true"] { border-color: var(--danger) !important; }
.form-group { margin-bottom: var(--s16) !important; }

/* Modal + popup */
.modal-overlay, .ao-pop-overlay {
  background: rgba(0,0,0,0.2) !important;
  backdrop-filter: blur(6px);
}
.modal, .ao-pop {
  border: 1px solid var(--border) !important;
  border-radius: var(--radius-modal) !important;
  background: #fff !important;
  padding: var(--s24) !important;
  max-width: 500px;
  box-shadow: 0 8px 24px rgba(17,17,17,0.08) !important;
  transform: translate(-50%, -48%) scale(0.96);
  transition: opacity var(--t-page), transform var(--t-page), visibility var(--t-page) !important;
}
.modal.open, .ao-pop.open { transform: translate(-50%, -50%) scale(1); }
.modal-footer, .vault-passcode-actions {
  border-top: 1px solid var(--border);
  margin-top: var(--s16);
  padding-top: var(--s16);
  display: flex;
  justify-content: flex-end;
  gap: var(--s12);
}

/* Dropdown + chips + toggles + tooltip */
.topnav-dropdown, .store-filter-popover, .topnav-expand-panel {
  border: 1px solid var(--border) !important;
  border-radius: 10px !important;
  background: #fff !important;
  box-shadow: 0 8px 18px rgba(17,17,17,0.08) !important;
}
.topnav-dropdown__link:hover, .store-filter-row:hover {
  background: var(--surface-hover) !important;
}
.ao-chip {
  height: 32px !important;
  border: 1px solid var(--border) !important;
  border-radius: 999px !important;
  background: #fff !important;
  color: var(--text-muted) !important;
}
.ao-chip.active {
  background: #111 !important;
  color: #fff !important;
  border-color: #111 !important;
}
.switch, .toggle, input[type="checkbox"].switch {
  width: 40px; height: 22px; border-radius: 999px; background: var(--border);
}
[role="tooltip"], .tooltip {
  background: #111 !important;
  color: #fff !important;
  font-size: 12px !important;
  border-radius: 6px !important;
  padding: 6px 10px !important;
  opacity: 0;
  transition: opacity 100ms ease-out;
}

/* Dashboard hierarchy */
.dashboard-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(280px, 1fr);
  gap: var(--s24);
  align-items: stretch;
}
.dashboard-hero-copy { display: flex; flex-direction: column; gap: var(--s8); }
.dashboard-hero-kicker { font-size: 12px; color: var(--text-muted); }
.dashboard-hero-title { font-size: 32px !important; font-weight: 600; letter-spacing: -0.01em; }
.dashboard-hero-subtitle { font-size: 14px; color: var(--text-muted); }
.dashboard-hero-graphic {
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  background: linear-gradient(135deg, #faf8f6 0%, #f2ede7 100%);
  min-height: 140px;
}

.metrics-grid {
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  gap: var(--s24) !important;
}
.dashboard-analytics-grid {
  display: grid !important;
  grid-template-columns: minmax(0, 8fr) minmax(0, 4fr) !important;
  gap: var(--s24) !important;
}

/* Table perfection */
.table-scroll { border: 1px solid var(--border); border-radius: var(--radius-card); overflow: auto; }
.orders-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #fff !important;
  border-bottom: 1px solid var(--border) !important;
  text-align: left;
}
.orders-table tbody td {
  height: 52px;
  padding: 12px 16px !important;
  border-bottom: 1px solid #f1f1f1;
  text-align: left;
}
.orders-table tbody tr:hover { background: #F5F5F5 !important; }
.row-action-btn {
  border: 1px solid var(--border) !important;
  border-radius: 8px !important;
  background: #fff !important;
}

/* Mobile adaptations */
@media (max-width: 1024px) {
  .dashboard-page,
  .all-orders-page { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .dashboard-hero, .dashboard-analytics-grid { grid-template-columns: 1fr !important; }
}
@media (max-width: 768px) {
  .dashboard-page,
  .all-orders-page { grid-template-columns: 1fr; gap: var(--s16); }
  .main-content { padding: var(--s16) var(--s16) 84px; }
  .metrics-grid {
    display: flex !important;
    overflow-x: auto;
    gap: var(--s12) !important;
    padding-bottom: var(--s4);
    scroll-snap-type: x mandatory;
  }
  .metrics-grid > .metric-card {
    min-width: min(82vw, 300px);
    scroll-snap-align: start;
  }
  .table-scroll table { min-width: 760px; }
  .mobile-bottom-nav {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: 10px;
    z-index: 120;
    height: 56px;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: var(--s8);
    padding: var(--s8);
    border: 1px solid var(--border);
    border-radius: 14px;
    background: #fff;
  }
  .mobile-bottom-nav__item {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: var(--text-muted);
    border-radius: 8px;
  }
  .mobile-bottom-nav__item.is-active {
    background: #f2efeb;
    color: var(--text);
  }
  .orders-table thead { display: none; }
  .orders-table,
  .orders-table tbody,
  .orders-table tr,
  .orders-table td {
    display: block;
    width: 100%;
  }
  .orders-table tr {
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #fff;
    margin-bottom: var(--s12);
    padding: var(--s12);
  }
  .orders-table td {
    height: auto;
    border: 0;
    padding: var(--s4) 0 !important;
  }
  .orders-table td::before {
    content: attr(data-label);
    display: block;
    color: var(--text-muted);
    font-size: 12px;
    margin-bottom: 2px;
  }
}

/* Desktop safety: never let content stay hidden */
@media (min-width: 769px) {
  body.topnav-expand-open .main-content {
    opacity: 1 !important;
    pointer-events: auto !important;
  }
  body.topnav-expand-open .topbar-v2,
  body.topnav-expand-open .topbar-v2__shell,
  body.topnav-expand-open .topbar-v2__actions,
  body.topnav-expand-open .topbar-v2__logo,
  body.topnav-expand-open .topbar-v2__header-video-wrap {
    opacity: 1 !important;
    pointer-events: auto !important;
    background: #fff !important;
  }
  body.topnav-expand-open .topnav-expand-panel,
  body.topnav-expand-open .topnav-expand-backdrop {
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
  }
  body.topnav-expand-open {
    overflow: auto !important;
  }
  .main-content,
  .dashboard-page,
  .dashboard-page > *,
  .all-orders-page {
    visibility: visible !important;
    opacity: 1 !important;
  }
}

/* Desktop layout safety (working version):
   - Allow normal page scroll
   - Prevent flex/overflow traps that can appear blank
*/
@media (min-width: 769px) {
  html, body { height: auto !important; overflow: auto !important; }
  body { overflow-x: hidden !important; }
  .layout { height: auto !important; min-height: 100vh !important; }
  .content-wrap { height: auto !important; max-height: none !important; overflow: visible !important; }
  .main-content { overflow: visible !important; min-height: calc(100vh - 120px) !important; }
}
