/* ═══════════════════════════════════════════════════════════════
   AZy — Amazon Business Suite  ·  World-Class Dashboard 2026
   Deep Dark · Premium Gold · Clean Typography
═══════════════════════════════════════════════════════════════ */

/* ── DESIGN TOKENS ────────────────────────────────────────── */
:root {
  --ui-scale: 1.14;
  --ui-font-weight: 500;
  --bg:      #07080d;
  --s1:      #0d0f1b;
  --s2:      #131728;
  --s3:      #1b1f34;
  --gold:    #e9bb3a;
  --gold2:   #f6d464;
  --teal:    #3ecdc4;
  --red:     #f47070;
  --green:   #45d97c;
  --purple:  #9d7ef5;
  --orange:  #f8963c;
  --text:    #f2eee5;
  --text2:   #c0c6d9;
  --muted:   #8a93ad;
  --border:  rgba(255,255,255,0.07);
  --border2: rgba(255,255,255,0.04);
  --font-mono: 'IBM Plex Mono', monospace;
  --font-display: 'Cormorant Garamond', serif;
  --font-sans: 'IBM Plex Sans', sans-serif;
  --shadow-sm: 0 1px 4px rgba(0,0,0,0.4);
  --shadow-md: 0 4px 18px rgba(0,0,0,0.45);
  --shadow-lg: 0 12px 48px rgba(0,0,0,0.6);
  --r-xs: 4px;
  --r-sm: 7px;
  --r-md: 11px;
  --r-lg: 16px;
  --r-xl: 24px;
}

html { font-size: calc(16px * var(--ui-scale)); }

/* ── LIGHT THEME ─────────────────────────────────────────── */
body.theme-light {
  --bg: #f0ece3;
  --s1: #faf9f5;
  --s2: #f0ece4;
  --s3: #e5dfd3;
  --gold: #c49015;
  --gold2: #dfa820;
  --teal: #0d9088;
  --red: #d53535;
  --green: #1ea855;
  --purple: #6b39d4;
  --orange: #df721c;
  --text: #1a1814;
  --text2: #4e473b;
  --muted: #6b6458;
  --border: rgba(0,0,0,0.1);
  --border2: rgba(0,0,0,0.05);
}
body.theme-midnight {
  --bg: #060b16;
  --s1: #0d1629;
  --s2: #14203a;
  --s3: #1a2b4b;
  --gold: #ffd166;
  --gold2: #ffe39c;
  --teal: #52d1ff;
  --red: #ff7f8a;
  --green: #54dd93;
  --purple: #9ea3ff;
  --orange: #ffb05c;
  --text: #eaf0ff;
  --text2: #bcc8ea;
  --muted: #8e9bc0;
  --border: rgba(154, 183, 255, 0.18);
  --border2: rgba(154, 183, 255, 0.09);
}
body.theme-sand {
  --bg: #f5f0e5;
  --s1: #fffaf0;
  --s2: #f0e7d7;
  --s3: #e7dac3;
  --gold: #ad7a2b;
  --gold2: #cb9550;
  --teal: #1e8f85;
  --red: #c54a4a;
  --green: #1f9a52;
  --purple: #6656d6;
  --orange: #cb6f23;
  --text: #1e1a15;
  --text2: #5b5348;
  --muted: #7c7366;
  --border: rgba(60, 49, 34, 0.16);
  --border2: rgba(60, 49, 34, 0.08);
}
body.theme-apple {
  --bg: #eef1f4;
  --s1: #ffffff;
  --s2: #f1f4f7;
  --s3: #e8edf1;
  --gold: #12b76a;
  --gold2: #34d399;
  --teal: #8b5cf6;
  --red: #f04438;
  --green: #16a34a;
  --purple: #8b5cf6;
  --orange: #f5a623;
  --text: #16212c;
  --text2: #576673;
  --muted: #8593a0;
  --border: rgba(24, 46, 66, 0.11);
  --border2: rgba(24, 46, 66, 0.06);
  --font-display: 'Inter', sans-serif;
  --font-sans: 'Inter', sans-serif;
  --font-mono: 'Roboto Mono', monospace;
  --shadow-sm: 0 1px 4px rgba(22,42,60,.06);
  --shadow-md: 0 8px 22px rgba(22,42,60,.08);
  --shadow-lg: 0 16px 38px rgba(22,42,60,.1);
}
body.theme-fuji-night {
  --bg: #0c1220;
  --s1: #141c2e;
  --s2: #1a2438;
  --s3: #212d45;
  --gold: #ffb3c6;
  --gold2: #ffd1de;
  --teal: #8b5cf6;
  --red: #f87171;
  --green: #4ade80;
  --purple: #a78bfa;
  --orange: #fbbf6b;
  --text: #f2eef8;
  --text2: #c7c9e0;
  --muted: #8f92b8;
  --border: rgba(226, 220, 255, 0.12);
  --border2: rgba(226, 220, 255, 0.06);
  --font-display: 'Inter', sans-serif;
  --font-sans: 'Inter', sans-serif;
  --font-mono: 'Roboto Mono', monospace;
  --shadow-sm: 0 1px 4px rgba(0,0,0,.3);
  --shadow-md: 0 8px 22px rgba(0,0,0,.35);
  --shadow-lg: 0 16px 40px rgba(0,0,0,.45);
}
body.theme-graphite {
  --bg: #111317;
  --s1: #171a20;
  --s2: #1d222b;
  --s3: #262d38;
  --gold: #8fb6ff;
  --gold2: #b6ceff;
  --teal: #5fd7cc;
  --red: #ff8a94;
  --green: #6fe2a0;
  --purple: #c0b2ff;
  --orange: #ffbf7d;
  --text: #eef3ff;
  --text2: #c8d1e6;
  --muted: #94a0bb;
  --border: rgba(182, 206, 255, 0.14);
  --border2: rgba(182, 206, 255, 0.08);
}
body:is(.theme-light, .theme-sand, .theme-apple) .sidebar {
  background: linear-gradient(180deg,#f8f2e7,#f2eadc);
  border-right: 1px solid rgba(0,0,0,0.08);
  box-shadow: 4px 0 20px rgba(0,0,0,0.06);
}
body:is(.theme-light, .theme-sand, .theme-apple) tbody tr:hover td { background: rgba(0,0,0,0.03); }
body:is(.theme-light, .theme-sand, .theme-apple) tbody tr:nth-child(even) td { background: rgba(0,0,0,0.015); }
body:is(.theme-light, .theme-sand, .theme-apple) th { background: var(--s2); color:var(--muted); }
body.theme-light .sidebar { background: linear-gradient(180deg,#f5f3ee,#f0ece3); border-right: 1px solid rgba(0,0,0,0.08); box-shadow: 4px 0 20px rgba(0,0,0,0.06); }
body.theme-light .logo-name { background: linear-gradient(135deg,var(--gold),var(--gold2)); -webkit-background-clip:text; -webkit-text-fill-color:transparent; background-clip:text; }
body.theme-light .logo-sub { -webkit-text-fill-color:var(--muted); color:var(--muted); }
body.theme-light .nav-item { color: var(--text2); }
body.theme-light .nav-item:hover { background: rgba(0,0,0,0.05); color: var(--text); }
body.theme-light .nav-item.active { background: rgba(196,144,21,0.1); color: var(--gold); }
body.theme-light .kpi { background: linear-gradient(135deg,var(--s1),var(--s2)); box-shadow: 0 1px 4px rgba(0,0,0,0.07); }
body.theme-light .kpi:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.12); }
body.theme-light .card { background: var(--s1); box-shadow: 0 1px 4px rgba(0,0,0,0.06); border-color: rgba(0,0,0,0.08); }
body.theme-light .card:hover { border-color: rgba(0,0,0,0.14); }
body.theme-light .forecast-card { background: var(--s2); border-color: rgba(0,0,0,0.08); }
body.theme-light .ai-product-card { background: var(--s2); border-color: rgba(0,0,0,0.08); }
body.theme-light .drill-content { background: var(--s1); box-shadow: var(--shadow-lg); }
body.theme-light #filter-bar { background: rgba(240,236,227,0.95); border-bottom: 1px solid rgba(0,0,0,0.08); }
body.theme-light .filter-group { background: rgba(0,0,0,0.025); }
body.theme-light .filter-group-label { color: var(--muted); }
body.theme-light .filter-btn { color: var(--text2); }
body.theme-light .filter-btn:hover { background: rgba(0,0,0,0.06); color: var(--text); }
body.theme-light .filter-btn.active { background: rgba(196,144,21,0.12); color: var(--gold); }
body.theme-light .filter-status-pill { color: var(--muted); }
body.theme-light .filter-chip { background: var(--s2); color: var(--text2); border-color: rgba(0,0,0,0.1); }
body.theme-light .filter-chip.active { background: rgba(196,144,21,0.1); color:var(--gold); border-color: rgba(196,144,21,0.25); }
body.theme-light .data-badge { color: var(--muted); }
body.theme-light .col-picker-btn { background:var(--s2); color:var(--text); border-color:rgba(0,0,0,0.1); }
body.theme-light .stock-card { background:var(--s2) !important; border-color:rgba(0,0,0,0.08) !important; }
body.theme-light tbody tr:hover td { background: rgba(0,0,0,0.03); }
body.theme-light tbody tr:nth-child(even) td { background: rgba(0,0,0,0.015); }
body.theme-light th { background: var(--s2); color:var(--muted); }
body.theme-light .orders-expanded { background: var(--bg); }
body.theme-light .orders-expanded .orders-table-card th { background: var(--s2); }
body.theme-light .target-input-row { background: var(--s2); border-color: rgba(0,0,0,0.08); }
body.theme-light .target-input { background: var(--s3); color: var(--text); }

.review-actions {
  display:flex;
  gap:0.45rem;
  align-items:center;
  flex-wrap:wrap;
  margin-bottom:0.75rem;
}

.review-filter-bar {
  display:flex;
  align-items:center;
  gap:0.45rem;
  flex-wrap:wrap;
  margin:0 0 0.75rem;
  padding:0.65rem;
  border:1px solid var(--border);
  border-radius:8px;
  background:var(--s2);
}

.review-filter-bar select,
.review-filter-bar input {
  min-height:1.8rem;
  border:1px solid var(--border);
  border-radius:6px;
  background:var(--s1);
  color:var(--text);
  padding:0.28rem 0.5rem;
  font-family:var(--font-mono);
  font-size:0.62rem;
}

.review-filter-bar input {
  min-width:220px;
  flex:1 1 220px;
}

.review-metric-sync-panel {
  margin:0 0 0.85rem;
  padding:0.75rem;
  border:1px solid var(--border);
  border-radius:8px;
  background:var(--s1);
}

.review-sync-head {
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:0.75rem;
  margin-bottom:0.65rem;
}

.review-sync-head strong,
.review-sync-head span {
  display:block;
}

.review-sync-head span,
#review-metric-sync-note {
  color:var(--muted);
  font-family:var(--font-mono);
  font-size:0.62rem;
  margin-top:0.16rem;
}

.review-metric-input {
  width:86px;
  min-height:1.8rem;
  border:1px solid var(--border);
  border-radius:6px;
  background:var(--s0);
  color:var(--text);
  padding:0 0.45rem;
}

#review-filter-count {
  color:var(--muted);
  font-family:var(--font-mono);
  font-size:0.62rem;
  margin-left:auto;
}

.review-live-banner {
  margin:0 0 0.85rem;
  padding:0.8rem 1rem;
  border:1px solid rgba(244,112,112,0.45);
  border-radius:8px;
  background:rgba(244,112,112,0.16);
  color:var(--red);
  font-family:var(--font-mono);
  font-size:0.72rem;
  font-weight:700;
  text-transform:uppercase;
}

.review-mode-banner {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:0.75rem;
  margin:0 0 0.85rem;
  padding:0.65rem 0.85rem;
  border:1px solid var(--border);
  border-radius:8px;
  background:var(--s2);
  color:var(--text2);
  font-family:var(--font-mono);
  font-size:0.66rem;
}

.review-mode-banner strong {
  color:var(--gold);
  text-transform:uppercase;
}

.review-mode-banner span {
  color:var(--muted);
  text-align:right;
}

.review-badge {
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-height:1.35rem;
  padding:0.18rem 0.45rem;
  border:1px solid var(--border);
  border-radius:6px;
  background:var(--s2);
  color:var(--muted);
  font-family:var(--font-mono);
  font-size:0.58rem;
  white-space:nowrap;
}

.review-badge-good {
  color:var(--green);
  border-color:rgba(69,217,124,0.25);
  background:rgba(69,217,124,0.08);
}

.review-badge-warn {
  color:var(--gold);
  border-color:rgba(233,187,58,0.25);
  background:rgba(233,187,58,0.08);
}

.review-alerts {
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(220px,1fr));
  gap:0.6rem;
}

.review-alert {
  border:1px solid var(--border);
  border-radius:8px;
  background:var(--s2);
  padding:0.75rem;
}

.review-alert strong {
  display:block;
  color:var(--text);
  font-family:var(--font-mono);
  font-size:0.68rem;
  text-transform:uppercase;
}

.review-alert span {
  display:block;
  margin-top:0.25rem;
  color:var(--muted);
  font-family:var(--font-mono);
  font-size:0.62rem;
}

.review-alert p {
  margin:0.45rem 0 0;
  color:var(--text2);
  font-size:0.72rem;
}

.review-product-cell {
  display:flex;
  align-items:center;
  gap:0.5rem;
  min-width:260px;
  max-width:360px;
}

.review-product-thumb,
.review-product-thumb-fallback {
  width:34px;
  height:34px;
  flex:0 0 34px;
  border-radius:6px;
  border:1px solid var(--border);
  background:var(--s2);
}

.review-product-thumb {
  object-fit:cover;
}

.review-product-thumb-fallback {
  align-items:center;
  justify-content:center;
  color:var(--muted);
  font-family:var(--font-mono);
  font-size:0.52rem;
}

.review-product-copy {
  min-width:0;
}

.review-product-title {
  color:var(--text);
  font-size:0.72rem;
  line-height:1.25;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

.review-product-meta {
  margin-top:0.15rem;
  color:var(--muted);
  font-family:var(--font-mono);
  font-size:0.58rem;
}

#panel-reviews .table-pan-shell {
  width:100%;
  max-width:100%;
  overflow-x:auto;
  overflow-y:visible;
  border:1px solid var(--border);
  border-radius:8px;
}

#panel-reviews table {
  min-width:1480px;
  width:max-content;
}

#panel-reviews th,
#panel-reviews td {
  white-space:nowrap;
  vertical-align:middle;
}

#panel-reviews .review-product-cell {
  white-space:normal;
}

#panel-reviews .review-candidate-check:disabled {
  opacity:0.35;
  cursor:not-allowed;
}
body.theme-apple {
  background-image:
    linear-gradient(180deg, rgba(238,241,244,0.86) 0%, rgba(238,241,244,0.93) 45%, #eef1f4 100%),
    url('img/hero-fuji.png');
  background-size: cover;
  background-position: center 30%;
  background-attachment: fixed;
}
body.theme-apple .sidebar { background: rgba(255,255,255,0.9); backdrop-filter: blur(10px); border-right: 1px solid var(--border2); box-shadow: 1px 0 0 var(--border2); }
body.theme-apple .logo-name { background: linear-gradient(135deg,#16212c,#12b76a 82%); -webkit-background-clip:text; -webkit-text-fill-color:transparent; background-clip:text; }
body.theme-apple .logo-sub { -webkit-text-fill-color:var(--muted); color:var(--muted); }
body.theme-apple .nav-item { color: var(--text2); }
body.theme-apple .nav-item:hover { background: rgba(18,183,106,0.08); color: var(--text); }
body.theme-apple .nav-item.active { background: rgba(18,183,106,0.12); color: var(--gold); }
body.theme-apple .nav-dot { background: rgba(133,147,160,0.6); }
body.theme-apple .nav-item.active .nav-dot { background: var(--gold); box-shadow: 0 0 8px rgba(18,183,106,0.3); }
body.theme-apple .kpi, body.theme-apple .card, body.theme-apple .forecast-card { background: #ffffff; border-color: var(--border2); box-shadow: var(--shadow-md); }
body.theme-apple .drill-content { background: #ffffff; }
body.theme-apple #filter-bar { background: rgba(255,255,255,0.92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--border2); }
body.theme-apple .filter-group { background: #ffffff; border-color: var(--border2); }
body.theme-apple .filter-group-label { color: var(--muted); }
body.theme-apple .filter-btn { color: var(--text2); }
body.theme-apple .filter-btn:hover { background: rgba(18,183,106,0.08); color: var(--text); }
body.theme-apple .filter-btn.active { background: rgba(18,183,106,0.12); color: var(--gold); box-shadow: 0 0 0 1px rgba(18,183,106,0.18); }
body.theme-apple .filter-status-pill { color: var(--muted); }
body.theme-apple .data-badge { color: var(--muted); }
body.theme-apple .appearance-panel,
body.theme-apple .appearance-switcher,
body.theme-apple .btn-ghost,
body.theme-apple .target-input-row,
body.theme-apple .target-input,
body.theme-apple .mobile-sheet,
body.theme-apple .mobile-sheet-btn { background: var(--s1); color: var(--text2); border-color: var(--border2); }
body.theme-apple .btn-primary { background: var(--gold); color: #ffffff; }

body.theme-fuji-night {
  background-image:
    linear-gradient(180deg, rgba(12,18,32,0.82) 0%, rgba(12,18,32,0.9) 45%, #0c1220 100%),
    url('img/hero-fuji.png');
  background-size: cover;
  background-position: center 30%;
  background-attachment: fixed;
}
body.theme-fuji-night .sidebar { background: rgba(20,28,46,0.82); backdrop-filter: blur(12px); border-right: 1px solid var(--border2); box-shadow: 1px 0 0 var(--border2); }
body.theme-fuji-night .logo-name { background: linear-gradient(135deg,#f2eef8,#ffb3c6 82%); -webkit-background-clip:text; -webkit-text-fill-color:transparent; background-clip:text; }
body.theme-fuji-night .logo-sub { -webkit-text-fill-color:var(--muted); color:var(--muted); }
body.theme-fuji-night .nav-item { color: var(--text2); }
body.theme-fuji-night .nav-item:hover { background: rgba(255,179,198,0.08); color: var(--text); }
body.theme-fuji-night .nav-item.active { background: rgba(255,179,198,0.14); color: var(--gold); }
body.theme-fuji-night .nav-dot { background: rgba(143,146,184,0.6); }
body.theme-fuji-night .nav-item.active .nav-dot { background: var(--gold); box-shadow: 0 0 8px rgba(255,179,198,0.35); }
body.theme-fuji-night .kpi, body.theme-fuji-night .card, body.theme-fuji-night .forecast-card { background: rgba(20,28,46,0.88); backdrop-filter: blur(10px); border-color: var(--border2); box-shadow: var(--shadow-md); }
body.theme-fuji-night .drill-content { background: rgba(20,28,46,0.95); }
body.theme-fuji-night #filter-bar { background: rgba(12,18,32,0.85); backdrop-filter: blur(8px); border-bottom: 1px solid var(--border2); }
body.theme-fuji-night .filter-group { background: rgba(20,28,46,0.88); border-color: var(--border2); }
body.theme-fuji-night .filter-group-label { color: var(--muted); }
body.theme-fuji-night .filter-btn { color: var(--text2); }
body.theme-fuji-night .filter-btn:hover { background: rgba(255,179,198,0.08); color: var(--text); }
body.theme-fuji-night .filter-btn.active { background: rgba(255,179,198,0.14); color: var(--gold); box-shadow: 0 0 0 1px rgba(255,179,198,0.2); }
body.theme-fuji-night .filter-status-pill { color: var(--muted); }
body.theme-fuji-night .data-badge { color: var(--muted); }
body.theme-fuji-night .appearance-panel,
body.theme-fuji-night .appearance-switcher,
body.theme-fuji-night .btn-ghost,
body.theme-fuji-night .target-input-row,
body.theme-fuji-night .target-input,
body.theme-fuji-night .mobile-sheet,
body.theme-fuji-night .mobile-sheet-btn { background: var(--s1); color: var(--text2); border-color: var(--border2); }
body.theme-fuji-night .btn-primary { background: var(--gold); color: #1a0f14; }
body.theme-fuji-night tbody tr:hover td { background: rgba(255,179,198,0.04); }
body.theme-fuji-night tbody tr:nth-child(even) td { background: rgba(226,220,255,0.02); }
body.theme-fuji-night th { background: var(--s2); color: var(--muted); }

/* ── Fuji theme quick toggle (inline, filter bar) ─────────────── */
.fuji-toggle {
  margin-left: 10px;
  width: 32px; height: 32px; border-radius: 999px; flex: 0 0 auto;
  display: none; align-items: center; justify-content: center;
  background: var(--s2); border: 1px solid var(--border);
  cursor: pointer; font-size: 15px; line-height: 1;
  transition: transform 0.15s ease, background 0.15s ease;
}
.fuji-toggle:hover { transform: scale(1.06); background: var(--s3); }
body.theme-apple .fuji-toggle, body.theme-fuji-night .fuji-toggle { display: flex; }
body.theme-apple .btn-primary:hover { background: var(--gold2); }
body.theme-apple .mobile-nav { background: rgba(255,255,255,0.92); border-top: 1px solid var(--border2); }
body.theme-apple .mobile-nav-item { color: var(--muted); }
body.theme-apple .mobile-nav-item.active { color: var(--gold); background: rgba(13,148,136,0.08); }
body.theme-apple tbody tr:hover td { background: rgba(13,148,136,0.03); }
body.theme-apple tbody tr:nth-child(even) td { background: rgba(24,46,66,0.012); }
body.theme-apple th { background: var(--s2); color: var(--muted); }
body.theme-graphite .sidebar { background: linear-gradient(180deg,#151922,#101319); border-right: 1px solid rgba(182,206,255,0.14); box-shadow: 6px 0 24px rgba(0,0,0,0.42); }
body.theme-graphite .nav-item.active { background: rgba(143,182,255,0.14); color: #b6ceff; }

  /* ── APPEARANCE CONTROLS ─────────────────────────────────── */
  .top-controls {
    display: none;
  }
  .appearance-switcher {
    background: var(--s2); border: 1px solid var(--border);
    color: var(--text2); border-radius: var(--r-xl);
    padding: 0.42rem 2rem 0.42rem 0.85rem; cursor: pointer;
      font-family: var(--font-sans); font-size: 0.78rem;
    box-shadow: var(--shadow-sm); transition: all 0.2s;
    appearance: none; -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L5 5L9 1' stroke='%2348516a' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 0.7rem center;
  }
  .appearance-switcher:hover { border-color: rgba(233,187,58,0.5); color: var(--gold); }
  .appearance-switcher option { background: var(--s2); color: var(--text); }

  /* ── RESET ──────────────────────────────────────────────── */
  *, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
  body {
    background: var(--bg); color: var(--text);
      font-family: var(--font-sans); font-size: 0.95rem; line-height: 1.55;
      font-weight: var(--ui-font-weight);
    min-height: 100vh; -webkit-font-smoothing: antialiased;
    background-image:
      radial-gradient(ellipse 80% 50% at 15% -5%, rgba(233,187,58,0.045) 0%, transparent 60%),
      radial-gradient(ellipse 60% 50% at 85% 105%, rgba(62,205,196,0.03) 0%, transparent 55%);
  }

  .layout { display: grid; grid-template-columns: 264px minmax(0, 1fr); min-height: 100vh; }
  body.sidebar-collapsed .layout { grid-template-columns: 0 1fr; }

  .sidebar {
    background: var(--sidebar);
    border-right: 1px solid var(--border);
    width: 264px;
    min-width: 264px;
    flex: 0 0 264px;
    height: 100vh;
    position: sticky;
    top: 0;
    overflow-y: auto; overflow-x: hidden;
    display: flex; flex-direction: column;
    box-shadow: 6px 0 32px rgba(0,0,0,0.35);
    transition: width 0.22s ease, min-width 0.22s ease;
  }
  body.sidebar-collapsed .sidebar {
    width: 0; min-width: 0; overflow: hidden; border: none; box-shadow: none;
  }

  .sidebar-collapse-btn {
    display: flex; align-items: center; justify-content: center;
    gap: 0.35rem; width: 100%; padding: 0.42rem 0.75rem;
    background: var(--s2); border: 1px solid var(--border); border-radius: 7px;
    cursor: pointer; color: var(--muted);
    font-family: var(--font-mono); font-size: 0.58rem; text-transform: uppercase;
    letter-spacing: 0.09em; transition: all 0.15s; margin-bottom: 0.55rem;
  }

  .sidebar-show-btn {
    position: fixed; left: 0; top: 50%; z-index: 70;
    display: none;
    transform: translateY(-50%);
    background: var(--s1); border: 1px solid var(--border); border-left: none;
    border-radius: 0 12px 12px 0;
    padding: 0.7rem 0.55rem; cursor: pointer; color: var(--muted);
    box-shadow: 4px 0 16px rgba(0,0,0,0.35);
    font-size: 0.85rem; transition: all 0.15s; line-height: 1;
  }
  .sidebar-show-btn:hover { color: var(--gold); background: rgba(233,187,58,0.07); }
  body.sidebar-collapsed .sidebar-show-btn { display: flex; align-items: center; }

  .logo {
    padding: 1.4rem 1.2rem 1rem;
    border-bottom: 1px solid var(--border);
    margin-bottom: 0.85rem;
  }
  .logo-name {
    font-family: var(--font-sans); font-size: 1.15rem; font-weight: 800;
    letter-spacing: -0.02em;
    display: flex; align-items: center; gap: 0.5rem; line-height: 1.2;
    background: linear-gradient(135deg, var(--gold) 0%, var(--gold2) 60%, #fff8e6 100%);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    background-clip: text;
  }
  .logo-sub {
    margin-top: 0.28rem;
    font-family: var(--font-mono);
    font-size: 0.58rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
  }

  .nav-section {
    display: flex;
    flex-direction: column;
    gap: 0.14rem;
    padding: 0 0.7rem 0.85rem;
    min-width: 0;
  }
  .nav-label {
    padding: 0 0.5rem 0.4rem;
    font-family: var(--font-mono);
    font-size: 0.56rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--muted);
  }
  .nav-item {
    display: flex;
    align-items: center;
    gap: 0.58rem;
    min-width: 0;
    margin: 0;
    padding: 0.64rem 0.72rem;
    border-radius: 10px;
    font-family: var(--font-sans);
    font-size: 0.76rem;
    font-weight: 600;
    line-height: 1.2;
    color: var(--text2);
    cursor: pointer;
    transition: background 0.16s ease, color 0.16s ease, transform 0.16s ease;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .nav-item:hover {
    transform: translateX(2px);
  }
  .nav-dot {
    width: 8px;
    height: 8px;
    border-radius: 999px;
    flex: 0 0 auto;
    background: rgba(255,255,255,0.35);
    box-shadow: inset 0 0 0 1px rgba(0,0,0,0.08);
  }
  .sidebar-footer {
    margin-top: auto;
    padding: 0.85rem 0.9rem 1rem;
    border-top: 1px solid var(--border);
  }

  .appearance-panel {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.55rem;
    background: var(--s1);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 0.8rem;
    margin-bottom: 0.8rem;
  }
  .appearance-panel-label {
    display: flex;
    flex-direction: column;
    gap: 0.28rem;
    font-family: var(--font-mono);
    font-size: 0.58rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--muted);
  }
  .appearance-panel .appearance-switcher {
    width: 100%;
    border-radius: 10px;
    font-size: 0.68rem;
  }

  /* ── MAIN ─────────────────────────────────────────────────── */
  .main { display: flex; flex-direction: column; overflow-x: hidden; min-width: 0; }

  /* ── FILTER BAR ──────────────────────────────────────────── */
  #filter-bar {
    display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
    padding: 0.6rem 2rem;
    background: rgba(7,8,13,0.9);
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    position: sticky; top: 0; z-index: 50;
  }
  .filter-group {
    display: flex; align-items: center; gap: 0.2rem;
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--border2); border-radius: 9px; padding: 0.2rem;
  }
  .filter-group-label {
    font-family: var(--font-sans); font-size: 0.58rem; font-weight: 600;
    text-transform: uppercase; letter-spacing: 0.12em;
    color: var(--muted); padding: 0 0.5rem 0 0.4rem; white-space: nowrap;
  }
  .filter-btn {
    font-family: var(--font-sans); font-size: 0.72rem; font-weight: 500;
    padding: 0.3rem 0.75rem; border-radius: 6px; border: none; cursor: pointer;
    background: transparent; color: var(--text2); transition: all 0.15s;
  }
  .filter-btn:hover { background: rgba(255,255,255,0.07); color: var(--text); }
  .filter-btn.active { background: rgba(233,187,58,0.14); color: var(--gold); box-shadow: 0 0 0 1px rgba(233,187,58,0.22); }
  .filter-divider { width: 1px; height: 20px; background: rgba(255,255,255,0.12); flex-shrink: 0; }
  .filter-status-pill { margin-left: auto; font-family: var(--font-sans); font-size: 0.62rem; color: var(--muted); }

  /* ── PANELS ──────────────────────────────────────────────── */
  .panel { display: none; padding: 2rem 2rem 3rem; }
  .panel.active { display: block; }

  /* ── PAGE HEADER ─────────────────────────────────────────── */
  .page-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 2rem; }
  .orders-page-header {
    align-items: flex-end;
    gap: 1rem 1.25rem;
    margin-bottom: 0.9rem;
  }
  .orders-header-main {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    min-width: 0;
    flex: 1 1 auto;
  }
  .orders-sync-meta-inline {
    margin: 0;
  }
  .page-title {
    font-family: var(--font-display); font-size: 2.2rem; line-height: 1.1;
    color: var(--text); letter-spacing: -0.01em;
  }
  .page-sub {
    font-family: var(--font-sans); font-size: 0.68rem; font-weight: 500;
    color: var(--text2); margin-top: 0.35rem; text-transform: uppercase; letter-spacing: 0.12em;
  }
  .header-actions { display: flex; gap: 0.75rem; align-items: center; }
  .orders-header-actions { gap: 0.55rem; }

  /* ── BUTTONS ─────────────────────────────────────────────── */
  .btn {
    font-family: var(--font-sans); font-size: 0.72rem; font-weight: 600;
    letter-spacing: 0.02em; padding: 0.48rem 1rem; border-radius: var(--r-sm);
    cursor: pointer; border: none; transition: all 0.2s;
  }
  .btn:disabled { opacity: 0.55; cursor: not-allowed; }
  .btn.is-loading {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
  }
  .btn-spinner {
    width: 0.78rem;
    height: 0.78rem;
    border: 2px solid rgba(255,255,255,0.2);
    border-top-color: var(--teal);
    border-radius: 999px;
    animation: catalogue-spin 0.7s linear infinite;
    flex: 0 0 auto;
  }
  .btn-primary { background: var(--gold); color: #07080d; }
  .btn-primary:hover { background: var(--gold2); transform: translateY(-1px); }
  .btn-secondary { background: var(--s2); color: var(--text); border: 1px solid var(--border); }
  .btn-secondary:hover { border-color: rgba(255,255,255,0.15); }
  .btn-ghost { background: var(--s2); color: var(--text2); border: 1px solid var(--border); }
  .btn-ghost:hover { color: var(--text); border-color: rgba(255,255,255,0.15); }
  .btn.is-active {
    color: var(--text);
    border-color: rgba(62,205,196,0.26);
    background: rgba(62,205,196,0.08);
  }
  .btn-refresh {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.58rem;
    padding: 0.5rem 0.95rem;
    background: linear-gradient(180deg, rgba(62,205,196,0.14), rgba(62,205,196,0.08));
    color: var(--text);
    border: 1px solid rgba(62,205,196,0.28);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.04), 0 10px 24px rgba(0,0,0,0.16);
  }
  .btn-sync-minimal {
    min-width: 0;
    padding: 0.44rem 0.78rem;
    gap: 0.48rem;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.03), 0 8px 18px rgba(0,0,0,0.12);
  }
  .btn-refresh:hover {
    transform: translateY(-1px);
    border-color: rgba(62,205,196,0.42);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.05), 0 14px 28px rgba(0,0,0,0.2);
  }
  .btn-refresh.is-loading .btn-refresh-icon { animation: catalogue-spin 0.7s linear infinite; }
  .btn-refresh-icon {
    width: 1.42rem;
    height: 1.42rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: rgba(7,14,20,0.34);
    border: 1px solid rgba(62,205,196,0.24);
    color: var(--teal);
    font-size: 0.8rem;
    line-height: 1;
    flex: 0 0 auto;
  }
  .btn-sync-minimal .btn-refresh-icon {
    width: 1.22rem;
    height: 1.22rem;
    font-size: 0.72rem;
  }
  .btn-view-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.42rem;
    padding: 0.44rem 0.78rem;
    background: transparent;
  }
  .btn-caret {
    font-size: 0.55rem;
    color: var(--muted);
  }
  .orders-view-panel {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem 1rem;
    align-items: center;
    margin: 0 0 0.85rem;
    padding: 0.7rem 0.9rem;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: rgba(255,255,255,0.025);
  }
  .orders-view-group,
  .orders-view-inline-tools {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
    align-items: center;
  }
  .orders-view-preset-group {
    flex: 1 1 100%;
    align-items: flex-start;
    gap: 0.45rem;
  }
  .orders-view-presets-label {
    font-family: var(--font-mono);
    font-size: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--muted);
    padding-top: 0.2rem;
  }
  .orders-view-presets {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
  }
  .btn-view-action,
  .btn-view-secondary {
    padding: 0.38rem 0.68rem;
    font-size: 0.67rem;
  }
  .orders-view-preset-btn.is-active {
    background: rgba(62,205,196,0.12);
    border-color: rgba(62,205,196,0.35);
    color: var(--teal);
  }
  .orders-view-preset-note {
    flex: 1 1 100%;
    font-family: var(--font-sans);
    font-size: 0.68rem;
    color: var(--muted);
    line-height: 1.45;
  }
  .orders-view-select-wrap {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.3rem 0.38rem 0.3rem 0.55rem;
    border: 1px solid var(--border);
    border-radius: 999px;
    font-family: var(--font-mono);
    font-size: 0.61rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
  }
  .orders-view-select {
    background: transparent;
    border: none;
    color: var(--text);
    font-family: var(--font-mono);
    font-size: 0.68rem;
    outline: none;
    cursor: pointer;
  }
  .orders-view-drawer {
    display: none;
    background: var(--s2);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1rem 1.1rem;
    margin-bottom: 0.9rem;
  }
  .btn-refresh-sidebar {
    width: 100%;
    font-size: 0.69rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
  }
  .sync-meta {
    display: flex;
    flex-direction: column;
    gap: 0.28rem;
    align-items: flex-start;
    font-family: var(--font-mono);
    font-size: 0.6rem;
    color: var(--muted);
    line-height: 1.5;
  }
  .sync-meta-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    align-items: center;
  }
  .sync-meta-summary-item {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.18rem 0.48rem;
    border-radius: 999px;
    background: rgba(255,255,255,0.025);
    border: 1px solid rgba(255,255,255,0.05);
    color: var(--text2);
  }
  .sync-meta-summary-label {
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.54rem;
  }
  .sync-meta-summary-live {
    color: var(--text);
    border-color: rgba(78,205,196,0.14);
    background: rgba(78,205,196,0.04);
  }
  .sync-meta-summary-active {
    color: var(--text);
    border-color: rgba(233,187,58,0.16);
    background: rgba(233,187,58,0.05);
  }
  .sync-meta-summary-error {
    color: var(--red);
    border-color: rgba(239,68,68,0.18);
    background: rgba(239,68,68,0.06);
  }
  .sync-meta-summary-muted {
    color: var(--muted);
  }
  .sync-meta-detail {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem 0.85rem;
    color: var(--muted);
  }
  .sync-meta-detail-item {
    display: inline-flex;
    align-items: center;
    gap: 0.28rem;
    font-size: 0.56rem;
  }
  .sync-meta-detail-item strong {
    color: var(--text2);
    font-weight: 600;
  }

  @keyframes catalogue-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
  }

  /* ── LAYOUT EDITOR ──────────────────────────────────────── */
  .layout-control-cluster,
  .sidebar-layout-controls {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
  }
  .layout-mini-btn {
    min-width: 34px;
    min-height: 34px;
    padding: 0.35rem 0.55rem;
    font-size: 0.62rem;
    line-height: 1;
    border-radius: 999px;
  }
  .layout-secondary-control {
    display: none;
  }
  .layout-control-cluster.is-editing .layout-secondary-control,
  .sidebar-layout-controls.is-editing .layout-secondary-control {
    display: inline-flex;
  }
  .layout-edit-mode .layout-editable-item {
    position: relative;
    outline: 1px dashed rgba(233,187,58,0.35);
    outline-offset: 3px;
    border-radius: 10px;
  }
  .layout-drag-handle {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 6;
    background: rgba(8, 11, 20, 0.88);
    border: 1px solid rgba(233,187,58,0.28);
    border-radius: 999px;
    padding: 0.15rem 0.5rem;
    cursor: grab;
    font-family: var(--font-mono);
    font-size: 0.56rem;
    color: var(--gold);
    text-transform: uppercase;
    letter-spacing: 0.06em;
  }
  .layout-hide-btn {
    position: absolute;
    top: 8px;
    right: 56px;
    z-index: 6;
    border: 1px solid rgba(244,112,112,0.25);
    background: rgba(8, 11, 20, 0.88);
    color: var(--red);
    border-radius: 999px;
    padding: 0.15rem 0.5rem;
    cursor: pointer;
    font-family: var(--font-mono);
    font-size: 0.56rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
  }
  .layout-hide-btn:hover {
    border-color: rgba(244,112,112,0.45);
  }
  .layout-editable-item.layout-dragging {
    opacity: 0.72;
    transform: scale(0.98);
    box-shadow: 0 10px 28px rgba(0,0,0,0.35);
  }
  .layout-hidden-item {
    display: none !important;
  }
  .layout-empty-container {
    display: none !important;
  }

  .sidebar-layout-controls {
    margin-top: 0.5rem;
    flex-wrap: wrap;
  }
  .sidebar-layout-edit-mode .nav-item.layout-editable-item {
    position: relative;
    outline: 1px dashed rgba(62,205,196,0.35);
    outline-offset: 2px;
    border-radius: 8px;
  }

  /* ── KPI CARDS ───────────────────────────────────────────── */
  .kpi-row { display: grid; grid-template-columns: repeat(4,1fr); gap: 1rem; margin-bottom: 1.5rem; }
  .kpi {
    background: linear-gradient(145deg, var(--s1) 0%, var(--s2) 100%);
    border: 1px solid var(--border); border-radius: var(--r-md);
    padding: 1.4rem 1.3rem; position: relative; overflow: hidden;
    transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s;
    cursor: default;
  }
  .kpi:hover { transform: translateY(-3px); box-shadow: 0 12px 32px rgba(0,0,0,0.45); border-color: rgba(255,255,255,0.12); }
  .kpi::after {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px;
    background: linear-gradient(90deg, var(--accent, var(--gold)) 0%, transparent 75%);
  }
  .kpi::before {
    content: ''; position: absolute; top: -30px; right: -15px;
    width: 100px; height: 100px; border-radius: 50%;
    background: radial-gradient(circle, rgba(233,187,58,0.07) 0%, transparent 70%);
    pointer-events: none;
  }
  .kpi[style*="--accent:var(--teal)"]::before   { background: radial-gradient(circle, rgba(62,205,196,0.07) 0%, transparent 70%); }
  .kpi[style*="--accent:var(--purple)"]::before { background: radial-gradient(circle, rgba(157,126,245,0.07) 0%, transparent 70%); }
  .kpi[style*="--accent:var(--red)"]::before    { background: radial-gradient(circle, rgba(244,112,112,0.07) 0%, transparent 70%); }
  .kpi[style*="--accent:var(--green)"]::before  { background: radial-gradient(circle, rgba(69,217,124,0.07) 0%, transparent 70%); }
  .kpi-label {
    font-family: var(--font-sans); font-size: 0.66rem; font-weight: 600;
    color: var(--text2); text-transform: uppercase; letter-spacing: 0.13em; margin-bottom: 0.7rem;
  }
  .kpi-value { font-family: var(--font-mono); font-size: 1.95rem; font-weight: 500; line-height: 1; letter-spacing: -0.02em; }
  .kpi-sub { font-family: var(--font-sans); font-size: 0.72rem; color: var(--text2); margin-top: 0.45rem; }
  .kpi-delta { font-family: var(--font-mono); font-size: 0.72rem; margin-top: 0.3rem; }
  .delta-up { color: var(--green); }
  .delta-down { color: var(--red); }

  .profit-surface {
    padding: 1.1rem 1.2rem 1rem;
  }
  .profit-surface-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 0.9rem;
  }
  .profit-surface-title {
    font-family: var(--font-sans);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text);
    margin-bottom: 0.28rem;
  }
  .profit-surface-sub {
    max-width: 760px;
    font-family: var(--font-sans);
    font-size: 0.8rem;
    line-height: 1.5;
    color: var(--text2);
  }
  .profit-surface-status {
    flex-shrink: 0;
    font-family: var(--font-mono);
    font-size: 0.66rem;
    color: var(--muted);
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 0.45rem 0.8rem;
    white-space: nowrap;
  }
  .profit-filter-row {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 0.75rem;
  }
  .profit-filter-row-advanced {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-top: 0.8rem;
  }
  .profit-filter-field {
    display: flex;
    flex-direction: column;
    gap: 0.38rem;
    font-family: var(--font-mono);
    font-size: 0.66rem;
    color: var(--muted);
  }
  .profit-filter-field span {
    letter-spacing: 0.04em;
    text-transform: uppercase;
  }
  .profit-filter-field select,
  .profit-filter-field input,
  .profit-table-search,
  .profit-table-select {
    background: var(--s2);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 0.42rem 0.55rem;
    border-radius: 8px;
    font-family: var(--font-mono);
    font-size: 0.72rem;
    outline: none;
  }
  .profit-filter-field select:focus,
  .profit-filter-field input:focus,
  .profit-table-search:focus,
  .profit-table-select:focus {
    border-color: rgba(62,205,196,0.4);
  }
  .profit-filter-field-small {
    max-width: 120px;
  }
  .profit-advanced {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border);
  }
  .profit-advanced summary {
    cursor: pointer;
    list-style: none;
    font-family: var(--font-sans);
    font-size: 0.74rem;
    font-weight: 600;
    color: var(--text2);
  }
  .profit-advanced summary::-webkit-details-marker {
    display: none;
  }
  .profit-advanced summary::after {
    content: 'Show';
    margin-left: 0.45rem;
    font-family: var(--font-mono);
    font-size: 0.62rem;
    color: var(--muted);
  }
  .profit-advanced[open] summary::after {
    content: 'Hide';
  }
  .profit-alert-strip {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    margin-top: 0.8rem;
  }
  .profit-alert-strip-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    align-items: center;
  }
  .profit-alert-strip-empty {
    font-family: var(--font-sans);
    font-size: 0.8rem;
    color: var(--green);
    padding: 0.8rem 0.9rem;
    border-radius: 12px;
    background: rgba(69,217,124,0.08);
    border: 1px solid rgba(69,217,124,0.15);
  }
  .profit-watch-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.36rem 0.65rem;
    border-radius: 999px;
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--border);
    font-family: var(--font-sans);
    font-size: 0.72rem;
    color: var(--text2);
  }
  .profit-watch-chip strong {
    font-family: var(--font-mono);
    font-size: 0.68rem;
    font-weight: 600;
  }
  .profit-watch-chip.is-critical {
    border-color: rgba(244,112,112,0.22);
    background: rgba(244,112,112,0.08);
    color: var(--text);
  }
  .profit-watch-chip.is-warning {
    border-color: rgba(248,150,60,0.22);
    background: rgba(248,150,60,0.08);
    color: var(--text);
  }
  .profit-watch-chip.is-muted {
    color: var(--muted);
  }
  .profit-table-toolbar {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border);
  }
  .profit-table-search {
    flex: 1;
    min-width: 180px;
  }
  .profit-table-select {
    cursor: pointer;
  }
  .profit-table-count {
    margin-left: auto;
    font-family: var(--font-mono);
    font-size: 0.68rem;
    color: var(--muted);
  }
  .profit-product-cell {
    font-family: var(--font-sans);
    font-size: 0.76rem;
    font-weight: 600;
    color: var(--text);
  }
  .profit-product-wrap {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    min-width: 0;
  }
  .profit-product-copy {
    min-width: 0;
  }
  .profit-product-thumb,
  .profit-product-thumb-fallback {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: 1px solid var(--border);
    object-fit: cover;
    flex: 0 0 auto;
    background: var(--s2);
  }
  .profit-product-thumb-fallback {
    align-items: center;
    justify-content: center;
    font-family: var(--font-mono);
    font-size: 0.52rem;
    color: var(--muted);
  }
  .profit-product-meta,
  .profit-scope-cell,
  .profit-empty-state {
    font-family: var(--font-mono);
    font-size: 0.68rem;
    color: var(--muted);
  }
  .profit-product-meta {
    margin-top: 0.2rem;
  }
  .profit-empty-state {
    text-align: center;
    padding: 1.2rem;
  }

  /* ── SECTION TABS ────────────────────────────────────────── */
  .section-tabs { display: flex; gap: 0.3rem; margin-bottom: 1.5rem; border-bottom: 1px solid var(--border); padding-bottom: 0; }
  .stab {
    font-family: var(--font-sans); font-size: 0.74rem; font-weight: 500;
    padding: 0.6rem 1.1rem; cursor: pointer; color: var(--text2);
    border: none; background: none; border-bottom: 2px solid transparent;
    margin-bottom: -1px; transition: all 0.15s;
  }
  .stab:hover { color: var(--text); }
  .stab.active { color: var(--gold); border-bottom-color: var(--gold); }

  /* ── GRIDS ───────────────────────────────────────────────── */
  .grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; margin-bottom: 1.25rem; }
  .grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 1.25rem; margin-bottom: 1.25rem; }
  .span-2 { grid-column: 1/-1; }

  /* ── CARD ────────────────────────────────────────────────── */
  .card {
    background: var(--s1); border: 1px solid var(--border);
    border-radius: var(--r-md); padding: 1.25rem;
    box-shadow: var(--shadow-sm); transition: border-color 0.2s;
  }
  .card:hover { border-color: rgba(255,255,255,0.11); }
    .card-expand-btn {
      background: transparent;
      border: 1px solid var(--border);
      color: var(--text2);
      border-radius: 999px;
      padding: 0.2rem 0.55rem;
      font-family: var(--font-mono);
      font-size: 0.6rem;
      cursor: pointer;
    }
    .card-expand-btn:hover {
      border-color: rgba(233,187,58,0.5);
      color: var(--gold);
    }
    body.overview-card-open {
      overflow: hidden;
    }
    .overview-card-expanded {
      position: fixed !important;
      z-index: 650;
      inset: 1.1rem;
      background: var(--s1);
      border-color: rgba(233,187,58,0.35);
      box-shadow: var(--shadow-lg);
      margin: 0 !important;
    }
    .overview-card-expanded canvas {
      max-height: calc(100vh - 180px);
    }
    @media (max-width: 768px) {
      .overview-card-expanded {
        inset: 0.4rem;
        border-radius: 12px;
        padding: 0.8rem;
      }
      .overview-card-expanded canvas {
        max-height: calc(100vh - 150px);
      }
    }
  .card-title {
    font-family: var(--font-sans); font-size: 0.7rem; font-weight: 700;
    color: var(--text2); text-transform: uppercase; letter-spacing: 0.1em;
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 1.1rem;
  }
  .card-title-left { display: flex; align-items: center; gap: 0.5rem; }
  .card-accent { width: 3px; height: 13px; border-radius: 2px; background: var(--gold); flex-shrink: 0; }
  canvas { max-height: 280px; }

  /* ── PRODUCT FILTER CHIPS ────────────────────────────────── */
  .filter-row { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 1.25rem; align-items: center; }
  .orders-filter-primary {
    gap: 0.55rem;
  }
  .orders-filter-search {
    min-width: min(100%, 280px);
    margin-left: auto;
  }
  .orders-filter-count {
    white-space: nowrap;
  }
  .orders-filter-advanced {
    padding-top: 0.05rem;
    border-top: 1px solid var(--border2);
  }
  .btn-filter-more,
  .btn-filter-clear {
    padding: 0.4rem 0.7rem;
    font-size: 0.66rem;
  }
  .filter-chip {
    font-family: var(--font-sans); font-size: 0.68rem; font-weight: 500;
    padding: 0.35rem 0.85rem; border-radius: var(--r-xl); cursor: pointer;
    background: var(--s2); color: var(--text2); border: 1px solid var(--border); transition: all 0.15s;
  }
  .filter-chip:hover { color: var(--text); border-color: rgba(255,255,255,0.14); }
  .filter-chip.active { background: rgba(233,187,58,0.1); color: var(--gold); border-color: rgba(233,187,58,0.28); }

  /* ── TABLE ───────────────────────────────────────────────── */
  table { width: 100%; border-collapse: separate; border-spacing: 0; }
  th {
    font-family: var(--font-sans); font-size: 0.6rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.1em;
    color: var(--muted); text-align: left; padding: 0.7rem 0.75rem;
    border-bottom: 1px solid var(--border); position: sticky; top: 0;
    background: var(--s1); z-index: 2; white-space: nowrap;
  }
  td {
    padding: 0.62rem 0.75rem; border-bottom: 1px solid var(--border2);
    text-align: left; font-size: 0.8rem; transition: background 0.1s;
  }
  .settings-products-wrap {
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--s1);
    padding: 0.6rem;
  }
  .settings-products-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
    gap: 0.6rem;
  }
  .settings-products-hint {
    font-family: var(--font-mono);
    font-size: 0.58rem;
    color: var(--muted);
    line-height: 1.4;
  }
  .settings-products-table-scroll {
    overflow-x: auto;
  }
  .settings-products-table {
    width: 100%;
    min-width: 760px;
  }
  .settings-products-input {
    width: 98px;
    background: var(--s2);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text);
    padding: 0.28rem 0.42rem;
    font-family: var(--font-mono);
    font-size: 0.66rem;
    text-align: right;
  }
  .settings-products-input:focus {
    outline: none;
    border-color: rgba(78,205,196,0.45);
  }
  .settings-cell-warn {
    border-color: rgba(244,112,112,0.45);
    color: var(--red);
  }
  .settings-products-save {
    padding: 0.28rem 0.62rem;
    font-size: 0.58rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
  }
  .settings-products-row-status {
    display: inline-block;
    margin-left: 0.42rem;
    font-family: var(--font-mono);
    font-size: 0.56rem;
    min-width: 42px;
  }
  .settings-ai-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.8rem;
  }
  .settings-ai-field {
    display: grid;
    gap: 0.34rem;
  }
  .settings-ai-field span {
    color: var(--muted);
    font-family: var(--font-mono);
    font-size: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
  }
  .settings-ai-field input,
  .settings-ai-field select {
    width: 100%;
    background: var(--s2);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    padding: 0.56rem 0.7rem;
    font-family: var(--font-sans);
    font-size: 0.75rem;
  }
  .settings-ai-field-wide { grid-column: span 2; }
  .settings-ai-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    align-items: center;
    margin-top: 0.9rem;
  }
  .settings-ai-status {
    margin-top: 0.8rem;
    padding: 0.8rem 0.9rem;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: rgba(255,255,255,0.02);
    color: var(--muted);
    font-family: var(--font-mono);
    font-size: 0.64rem;
    line-height: 1.55;
  }
  tr:last-child td { border-bottom: none; }
  tbody tr:nth-child(even) td { background: rgba(255,255,255,0.013); }
  tbody tr:hover td { background: rgba(233,187,58,0.04); }
  th[data-col="buy_cost"],th[data-col="ship_cost"],th[data-col="customs_yen"],
  th[data-col="amazon_fees"],th[data-col="total_cost"] { color: rgba(244,112,112,0.65); }
  th[data-col="profit_yen"] { color: rgba(69,217,124,0.65); }
  th[data-col="sell_yen"]   { color: var(--text2); }

  /* ── SORTABLE ────────────────────────────────────────────── */
  th.sortable { cursor: pointer; user-select: none; }
  th.sortable:hover { color: var(--text2); }
  th.sortable::after { content: ' ⇅'; opacity: 0.25; font-size: 0.5rem; }
  th.sort-asc::after  { content: ' ↑'; opacity: 1; color: var(--gold); }
  th.sort-desc::after { content: ' ↓'; opacity: 1; color: var(--gold); }
  th.sort-asc,th.sort-desc { color: var(--gold); }

  /* ── STATUS CHIPS ────────────────────────────────────────── */
  .chip {
    font-family: var(--font-sans); font-size: 0.63rem; font-weight: 700;
    padding: 0.2rem 0.55rem; border-radius: var(--r-xs); display: inline-block; letter-spacing: 0.02em;
  }
  .chip-done             { background: rgba(69,217,124,0.1);  color: var(--green); }
  .chip-shipped          { background: rgba(62,205,196,0.1);  color: var(--teal); }
  .chip-unshipped        { background: rgba(233,187,58,0.12); color: var(--gold); }
  .chip-partiallyshipped { background: rgba(248,150,60,0.12); color: var(--orange); }
  .chip-pending          { background: rgba(157,126,245,0.1); color: var(--purple); }
  .chip-invoiceunshipped { background: rgba(233,187,58,0.08); color: var(--gold2); }
  .chip-returned         { background: rgba(244,112,112,0.1); color: var(--red); }
  .chip-canceled,.chip-cancelled { background: rgba(72,81,106,0.2); color: var(--muted); }
  .chip-unknown          { background: rgba(72,81,106,0.12);  color: var(--muted); }

  /* ── FBA/FBM PILLS ───────────────────────────────────────── */
  .pill-fba {
    font-family: var(--font-sans); font-size: 0.63rem; font-weight: 700;
    padding: 0.2rem 0.55rem; border-radius: var(--r-xs);
    background: rgba(62,205,196,0.12); color: var(--teal); letter-spacing: 0.04em;
  }
  .pill-fbm {
    font-family: var(--font-sans); font-size: 0.63rem; font-weight: 700;
    padding: 0.2rem 0.55rem; border-radius: var(--r-xs);
    background: rgba(157,126,245,0.12); color: var(--purple); letter-spacing: 0.04em;
  }

  /* ── EST BADGE ───────────────────────────────────────────── */
  .est-badge {
    font-family: var(--font-sans); font-size: 0.48rem; font-weight: 700;
    padding: 0.1rem 0.3rem; border-radius: 3px;
    background: rgba(248,150,60,0.1); color: var(--orange);
    margin-left: 0.3rem; vertical-align: middle; text-transform: uppercase;
  }

  /* ── ORDERS TABLE ────────────────────────────────────────── */
  .orders-mobile-list {
    display: none;
  }
  .table-pan-shell {
    touch-action: pan-x pan-y;
      overscroll-behavior-x: contain;
      overscroll-behavior-y: auto;
    scrollbar-gutter: stable both-edges;
  }
  .table-pan-shell.table-pan-active {
    user-select: none;
  }
  .table-pan-rail {
    overflow-x: auto;
    overflow-y: hidden;
    height: 14px;
    margin-top: 0.35rem;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--s2);
  }
  .table-pan-rail-spacer {
    height: 1px;
  }
  .table-pan-rail::-webkit-scrollbar {
    height: 12px;
  }
  .table-pan-rail::-webkit-scrollbar-track {
    background: transparent;
  }
  .table-pan-rail::-webkit-scrollbar-thumb {
    background: rgba(62,205,196,0.35);
    border-radius: 999px;
    border: 2px solid transparent;
    background-clip: padding-box;
  }
  .orders-table-card {
    overflow-x: auto;
    overflow-y: hidden;
    max-height: none;
    padding: 0 !important;
    background: var(--s1);
    border-radius: 18px;
    border: 1px solid var(--border);
    position: relative;
  }
  .orders-expanded {
    position: fixed !important; inset: 0; z-index: 500;
    background: var(--bg); overflow-y: auto;
    padding: 1rem 1.5rem; margin: 0 !important; display: block;
  }
  .orders-expanded .page-header { position: sticky; top: 0; z-index: 10; background: var(--bg); padding-bottom: 0.75rem; }
  .orders-expanded .orders-table-card { max-height: calc(100vh - 200px); overflow-y: auto; overflow-x: auto; border: 1px solid var(--border); border-radius: var(--r-md); }
  .orders-expanded #orders-view-panel,
  .orders-expanded #col-picker-panel {
    background: var(--s1);
  }
  .orders-table-card::before {
    content: '';
    position: sticky;
    top: 0;
    display: block;
    height: 0;
    z-index: 6;
    box-shadow: 0 10px 18px rgba(0,0,0,0.08);
  }
  .orders-table-card thead th { position: sticky; background: var(--s2); z-index: 5; }
  .orders-table-card thead tr:first-child th { top: 0; box-shadow: 0 1px 0 var(--border), 0 8px 18px rgba(0,0,0,0.06); }
  .orders-table-card thead tr.orders-header-filters th { position: sticky; top: 36px; background: var(--s1); padding: 0.35rem 0.45rem; border-bottom: 1px solid var(--border2); z-index: 4; }
  .orders-expanded .orders-table-card thead tr:first-child th { top: 0; }
  .orders-expanded .orders-table-card thead tr.orders-header-filters th { top: 36px; }
  .orders-table-card td.orders-frozen-cell {
    background: var(--s1);
    z-index: 2;
  }
  .orders-table-card th.orders-frozen-cell {
    background: var(--s2);
    z-index: 8;
  }
  .orders-header-filters th.orders-frozen-cell {
    background: var(--s1);
    z-index: 7;
  }
  .orders-frozen-edge {
    box-shadow: 2px 0 0 rgba(0,0,0,0.22);
  }
  body.theme-light .orders-table-card td.orders-frozen-cell {
    background: #f7f4ed;
  }
  body.theme-light tbody tr:nth-child(even) td.orders-frozen-cell {
    background: #f1ede4;
  }
  body.theme-light tbody tr:hover td.orders-frozen-cell {
    background: #ece7dc;
  }
  body.theme-light .orders-table-card {
    background: #fbf8f0;
  }
  .orders-col-head {
    min-width: 120px;
  }
  .orders-th-shell {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.45rem;
  }
  .orders-th-label {
    flex: 1 1 auto;
    min-width: 0;
    background: transparent;
    border: none;
    color: inherit;
    cursor: pointer;
    text-align: left;
    font: inherit;
    text-transform: inherit;
    letter-spacing: inherit;
    padding: 0;
  }
  .orders-th-filter-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 999px;
    border: 1px solid transparent;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    font-family: var(--font-mono);
    font-size: 0.62rem;
    line-height: 1;
    flex: 0 0 auto;
  }
  .orders-th-filter-btn:hover {
    color: var(--text);
    border-color: var(--border);
    background: rgba(255,255,255,0.04);
  }
  .orders-th-filter-btn.is-active {
    color: var(--gold);
    border-color: rgba(233,187,58,0.28);
    background: rgba(233,187,58,0.1);
  }
  .orders-col-head-filtered {
    color: var(--gold);
  }
  .orders-filter-cell { min-width: 110px; }
  .orders-header-filter,
  .orders-header-select,
  .orders-inline-input {
    width: 100%;
    background: var(--s2);
    border: 1px solid var(--border);
    color: var(--text);
    border-radius: 6px;
    padding: 0.35rem 0.5rem;
    font-family: var(--font-mono);
    font-size: 0.66rem;
    outline: none;
  }
  .orders-header-filter:focus,
  .orders-header-select:focus,
  .orders-inline-input:focus { border-color: rgba(212,168,67,0.45); }
  .orders-header-filters th {
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.02);
  }
  .orders-filter-actions { min-width: 72px; text-align: center; }
  .orders-clear-filters {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--muted);
    border-radius: 6px;
    padding: 0.3rem 0.55rem;
    cursor: pointer;
    font-family: var(--font-mono);
    font-size: 0.62rem;
  }
  .orders-column-note {
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 0.7rem 0.85rem;
    background: linear-gradient(135deg, rgba(233,187,58,0.06), rgba(62,205,196,0.04));
  }
  .orders-column-note-empty {
    font-family: var(--font-mono);
    font-size: 0.62rem;
    color: var(--muted);
  }
  .orders-column-note-title {
    font-family: var(--font-sans);
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--gold);
    margin-bottom: 0.35rem;
    letter-spacing: 0.03em;
    text-transform: uppercase;
  }
  .orders-column-note-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(160px, 1fr));
    gap: 0.6rem;
  }
  .orders-column-note-grid div {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    background: rgba(255,255,255,0.02);
    border: 1px solid var(--border2);
    border-radius: 8px;
    padding: 0.45rem 0.55rem;
  }
  .orders-column-note-grid strong {
    font-family: var(--font-mono);
    font-size: 0.56rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--muted);
  }
  .orders-column-note-grid span {
    font-family: var(--font-sans);
    font-size: 0.68rem;
    color: var(--text);
    line-height: 1.4;
  }
  .orders-inline-cell { min-width: 110px; }
  .orders-col-group { width: 100%; }
  .orders-col-group + .orders-col-group { margin-top: 0.9rem; }
  .orders-col-group-title {
    font-family: var(--font-mono);
    font-size: 0.58rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--muted);
    margin-bottom: 0.5rem;
  }
  .orders-col-chip-row { display: flex; flex-wrap: wrap; gap: 0.5rem; }
  .orders-col-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--muted);
    border-radius: 999px;
    padding: 0.3rem 0.65rem;
    font-family: var(--font-mono);
    font-size: 0.64rem;
    cursor: pointer;
  }
  .orders-col-chip.active {
    background: rgba(212,168,67,0.08);
    color: var(--text);
    border-color: rgba(212,168,67,0.24);
    cursor: default;
  }
  .orders-mobile-card {
    display: grid;
    gap: 0.72rem;
    padding: 0.9rem;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0.015));
    box-shadow: 0 8px 22px rgba(0,0,0,0.08);
  }
  .orders-mobile-card.is-corrected {
    border-color: rgba(233,187,58,0.28);
    box-shadow: inset 3px 0 0 var(--gold), 0 8px 22px rgba(0,0,0,0.08);
  }
.orders-mobile-card.is-deep-linked {
  border-color: rgba(62,205,196,0.42);
  box-shadow: inset 3px 0 0 var(--teal), 0 10px 24px rgba(0,0,0,0.12);
}
.orders-table-card tr.is-deep-linked td {
  background: rgba(62,205,196,0.08) !important;
}
.orders-table-card tr.is-deep-linked td:first-child {
  box-shadow: inset 3px 0 0 var(--teal);
}
  .orders-mobile-summary-btn {
    display: grid;
    gap: 0.72rem;
    cursor: pointer;
    outline: none;
  }
  .orders-mobile-summary-btn:focus-visible {
    border-radius: 12px;
    box-shadow: 0 0 0 2px rgba(62,205,196,0.28);
  }
  .orders-mobile-top,
  .orders-mobile-footer,
  .orders-mobile-product-line,
  .orders-mobile-metrics {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.7rem;
  }
  .orders-mobile-date-block {
    display: grid;
    gap: 0.14rem;
  }
  .orders-mobile-date {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--text);
  }
  .orders-mobile-time,
  .orders-mobile-source,
  .orders-mobile-meta-row {
    font-family: var(--font-mono);
    font-size: 0.58rem;
    color: var(--muted);
  }
  .orders-mobile-age {
    font-family: var(--font-mono);
    font-size: 0.58rem;
    color: var(--teal);
  }
  .orders-mobile-top-tags {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.35rem;
  }
  .orders-mobile-image,
  .orders-mobile-image-fallback {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    border: 1px solid var(--border);
    object-fit: cover;
    flex: 0 0 auto;
  }
  .orders-mobile-image-fallback {
    align-items: center;
    justify-content: center;
    background: var(--s2);
    color: var(--muted);
    font-family: var(--font-mono);
    font-size: 0.54rem;
  }
  .orders-mobile-product-copy {
    min-width: 0;
    display: grid;
    gap: 0.2rem;
    flex: 1 1 auto;
  }
  .orders-mobile-product {
    font-family: var(--font-sans);
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text);
    line-height: 1.35;
  }
  .orders-mobile-order-link {
    color: var(--teal);
    text-decoration: none;
    border-bottom: 1px dotted rgba(62,205,196,0.35);
  }
  .orders-mobile-order-link-muted {
    color: var(--muted);
    border-bottom: none;
  }
  .orders-mobile-metrics {
    align-items: stretch;
  }
  .orders-mobile-metric {
    flex: 1 1 0;
    display: grid;
    gap: 0.12rem;
    padding: 0.55rem 0.62rem;
    border-radius: 12px;
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--border2);
  }
  .orders-mobile-metric span {
    font-family: var(--font-mono);
    font-size: 0.54rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
  }
  .orders-mobile-metric strong {
    font-family: var(--font-mono);
    font-size: 0.74rem;
    color: var(--text);
  }
  .orders-mobile-metric-pos strong { color: var(--green); }
  .orders-mobile-metric-neg strong { color: var(--red); }
  .orders-mobile-metric-muted strong { color: var(--muted); }
  .orders-mobile-edit-btn {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text2);
    border-radius: 999px;
    padding: 0.32rem 0.7rem;
    cursor: pointer;
    font-family: var(--font-mono);
    font-size: 0.6rem;
  }
  .orders-mobile-actions {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    flex-wrap: wrap;
    justify-content: flex-end;
  }
  .orders-mobile-toggle-btn {
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--border);
    color: var(--text);
    border-radius: 999px;
    padding: 0.32rem 0.7rem;
    cursor: pointer;
    font-family: var(--font-mono);
    font-size: 0.6rem;
  }
  .orders-mobile-card.is-expanded .orders-mobile-toggle-btn {
    border-color: rgba(233,187,58,0.28);
    background: rgba(233,187,58,0.08);
    color: var(--gold);
  }
  .orders-mobile-details {
    display: grid;
    gap: 0.55rem;
    padding-top: 0.2rem;
    border-top: 1px solid var(--border2);
  }
  .orders-mobile-detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.45rem;
  }
  .orders-mobile-detail-item {
    display: grid;
    gap: 0.1rem;
    padding: 0.5rem 0.58rem;
    border-radius: 12px;
    background: rgba(255,255,255,0.025);
    border: 1px solid var(--border2);
  }
  .orders-mobile-detail-item span,
  .orders-mobile-detail-note {
    font-family: var(--font-mono);
    font-size: 0.54rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
  }
  .orders-mobile-detail-item strong {
    font-family: var(--font-mono);
    font-size: 0.66rem;
    color: var(--text);
    line-height: 1.4;
    word-break: break-word;
  }
  .orders-mobile-detail-note {
    text-transform: none;
    letter-spacing: 0.03em;
  }
  .orders-mobile-empty {
    padding: 1rem;
    border: 1px dashed var(--border);
    border-radius: 14px;
    text-align: center;
    font-family: var(--font-mono);
    font-size: 0.66rem;
    color: var(--muted);
  }
  .orders-col-move,
  .orders-col-toggle {
    background: transparent;
    border: none;
    color: inherit;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.64rem;
    padding: 0;
  }
  .orders-col-move[disabled] { opacity: 0.25; cursor: not-allowed; }
  /* Drag-to-reorder column headers */
  th[draggable="true"] { cursor: grab; user-select: none; position: relative; }
  th[draggable="true"]:active { cursor: grabbing; }
  th.col-drag-over {
    background: rgba(78,205,196,0.25) !important;
    box-shadow: inset 0 0 0 2px var(--teal) !important;
    outline: 2px solid var(--teal);
    outline-offset: -1px;
  }
  .bar-mini { display: flex; align-items: center; gap: 0.5rem; }
  .bar-bg { flex: 1; height: 3px; background: var(--s3); border-radius: 2px; }
  .bar-fg { height: 100%; border-radius: 2px; background: var(--gold); }
  .num-mono   { font-family: var(--font-mono); font-size: 0.82rem; }
  .trend-up   { color: var(--green);  font-family: var(--font-mono); font-size: 0.78rem; }
  .trend-down { color: var(--red);    font-family: var(--font-mono); font-size: 0.78rem; }
  .trend-flat { color: var(--muted);  font-family: var(--font-mono); font-size: 0.78rem; }
  .dest-ksa { background: rgba(62,205,196,0.1);  color: var(--teal);   font-family: var(--font-sans); font-size: 0.63rem; font-weight: 700; padding: 0.18rem 0.45rem; border-radius: var(--r-xs); }
  .dest-uae { background: rgba(157,126,245,0.1); color: var(--purple); font-family: var(--font-sans); font-size: 0.63rem; font-weight: 700; padding: 0.18rem 0.45rem; border-radius: var(--r-xs); }

  @media (max-width: 980px) {
    .orders-column-note-grid { grid-template-columns: 1fr; }
  }

  @media (max-width: 768px) {
    .appearance-switcher {
      width: 100%;
      min-width: 0;
      font-size: 0.62rem;
      padding: 0.34rem 0.42rem;
    }
    .settings-products-wrap {
      padding: 0.45rem;
      border-radius: 8px;
    }
    .appearance-panel {
      padding: 0.65rem;
    }
    .settings-products-hint {
      font-size: 0.54rem;
    }
    .settings-products-table {
      min-width: 640px;
    }
    .settings-products-input {
      width: 84px;
      font-size: 0.62rem;
    }
    .settings-products-save {
      padding: 0.26rem 0.5rem;
    }
  }

  /* ── PRODUCT CARDS ───────────────────────────────────────── */
  .product-card { background: var(--s1); border: 1px solid var(--border); border-radius: var(--r-md); padding: 0.75rem; cursor: pointer; position: relative; display: flex; flex-direction: column; transition: border-color 0.18s, background 0.18s; }
  .product-card:hover { border-color: rgba(255,255,255,0.14); background: var(--s2); }
  .product-card-selected { border-color: var(--teal) !important; background: rgba(78,205,196,0.06) !important; }
  body.theme-light .product-card { background: var(--s2); border-color: rgba(0,0,0,0.08); }
  body.theme-light .product-card:hover { background: var(--s1); }
  body.theme-light .product-card-selected { border-color: var(--teal) !important; background: rgba(78,205,196,0.07) !important; }

  /* ── STOCK CARDS ─────────────────────────────────────────── */
  .stock-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px,1fr)); gap: 1rem; }
  .stock-card { background: var(--s1); border: 1px solid var(--border); border-radius: var(--r-md); padding: 1.25rem; position: relative; overflow: hidden; transition: border-color 0.2s; }
  .stock-card.critical { border-color: rgba(244,112,112,0.3); }
  .stock-card.warning  { border-color: rgba(248,150,60,0.3); }
  .stock-card.good     { border-color: rgba(69,217,124,0.2); }
  .stock-product { font-family: var(--font-sans); font-size: 0.85rem; font-weight: 600; margin-bottom: 0.25rem; }
  .stock-product-presence,
  .stock-card-presence { color: var(--muted); font-family: var(--font-mono); font-size: 0.58rem; margin-top: 0.18rem; }
  .stock-market-split { display:flex; gap:0.4rem; margin-bottom:0.5rem; font-family:var(--font-mono); font-size:0.58rem; }
  .stock-market-split span { padding:0.12rem 0.38rem; border-radius:999px; border:1px solid var(--border); background:var(--s2); color:var(--text2); }
  .stock-asin { font-family: var(--font-mono); font-size: 0.6rem; color: var(--muted); margin-bottom: 1rem; }
  .stock-metrics { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0.5rem; margin-bottom: 1rem; }
  .metric-item { text-align: center; }
  .metric-val { font-family: var(--font-mono); font-size: 1.1rem; font-weight: 500; }
  .metric-lbl { font-family: var(--font-sans); font-size: 0.6rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; margin-top: 0.15rem; }
  .stock-input-row { display: flex; gap: 0.5rem; align-items: center; margin-bottom: 0.75rem; }
  .stock-input { flex: 1; background: var(--s2); border: 1px solid var(--border); border-radius: var(--r-sm); padding: 0.4rem 0.75rem; font-family: var(--font-mono); font-size: 0.8rem; color: var(--text); outline: none; }
  .stock-input:focus { border-color: var(--gold); }
  .stock-input-label { font-family: var(--font-sans); font-size: 0.65rem; color: var(--muted); white-space: nowrap; }
  .alert-badge { display: inline-flex; align-items: center; gap: 0.35rem; font-family: var(--font-sans); font-size: 0.65rem; font-weight: 700; text-transform: uppercase; padding: 0.3rem 0.75rem; border-radius: var(--r-xl); }
  .alert-critical { background: rgba(244,112,112,0.12); color: var(--red);    border: 1px solid rgba(244,112,112,0.2); }
  .alert-warning  { background: rgba(248,150,60,0.12);  color: var(--orange); border: 1px solid rgba(248,150,60,0.2); }
  .alert-good     { background: rgba(69,217,124,0.08);  color: var(--green);  border: 1px solid rgba(69,217,124,0.15); }
  .alert-healthy  { background: transparent;             color: var(--muted);  border: 1px solid var(--border); }
  .alert-na       { background: rgba(72,81,106,0.15);   color: var(--muted);  border: 1px solid var(--border); }
  .progress-bar { height: 3px; background: var(--s3); border-radius: 2px; overflow: hidden; margin-top: 0.75rem; }
  .progress-fill { height: 100%; border-radius: 2px; transition: width 0.5s; }
.stock-tab-btn { background: var(--s2); color: var(--muted); border: 1px solid var(--border); border-radius: 6px; padding: 0.3rem 0.7rem; font-family: var(--font-mono); font-size: 0.62rem; cursor: pointer; transition: all 0.15s; }
.stock-tab-btn:hover { border-color: var(--teal); color: var(--teal); }
.stock-tab-btn.active { background: rgba(78,205,196,0.12); color: var(--teal); border-color: rgba(78,205,196,0.4); font-weight: 600; }
.stock-channel-btn { background: var(--s2); color: var(--muted); border: 1px solid var(--border); border-radius: 6px; padding: 0.3rem 0.7rem; font-family: var(--font-mono); font-size: 0.62rem; cursor: pointer; transition: all 0.15s; }
.stock-channel-btn:hover { border-color: var(--gold); color: var(--gold); }
.stock-channel-btn.active { background: rgba(212,168,67,0.12); color: var(--gold); border-color: rgba(212,168,67,0.4); font-weight: 600; }
.stock-focus-btn { background: var(--s2); color: var(--muted); border: 1px solid var(--border); border-radius: 6px; padding: 0.3rem 0.7rem; font-family: var(--font-mono); font-size: 0.62rem; cursor: pointer; transition: all 0.15s; }
.stock-focus-btn:hover { border-color: var(--green); color: var(--green); }
.stock-focus-btn.active { background: rgba(69,217,124,0.12); color: var(--green); border-color: rgba(69,217,124,0.4); font-weight: 600; }
.stock-fulfillment-btn { background: var(--s2); color: var(--muted); border: 1px solid var(--border); border-radius: 6px; padding: 0.3rem 0.7rem; font-family: var(--font-mono); font-size: 0.62rem; cursor: pointer; transition: all 0.15s; }
.stock-fulfillment-btn:hover { border-color: var(--teal); color: var(--teal); }
.stock-fulfillment-btn.active { background: rgba(78,205,196,0.12); color: var(--teal); border-color: rgba(78,205,196,0.4); font-weight: 600; }
.stock-filter-toolbar { margin: 0.4rem 0 1rem; padding: 0.9rem 1rem; }
.stock-filter-toolbar-main { display: flex; gap: 0.9rem; flex-wrap: wrap; align-items: flex-start; }
.stock-filter-group { display: flex; flex-direction: column; gap: 0.4rem; min-width: 140px; }
.stock-filter-label { font-family: var(--font-mono); font-size: 0.56rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; }
.stock-filter-pills { display: flex; gap: 0.35rem; flex-wrap: wrap; }
.stock-filter-toolbar-note { margin-top: 0.75rem; font-family: var(--font-mono); font-size: 0.6rem; color: var(--muted); }
.stock-market-table th { white-space: nowrap; }
.stock-market-table td { white-space: nowrap; }
.stock-market-table {
  width: 100%;
  min-width: max-content;
  table-layout: fixed;
}
.stock-market-table thead th {
  position: sticky;
  top: 0;
  z-index: 4;
  background: var(--s2);
  box-shadow: 0 1px 0 var(--border), 0 8px 18px rgba(0,0,0,0.08);
}
.stock-market-table tbody td {
  vertical-align: middle;
}
.stock-market-table th:not(:first-child),
.stock-market-table td:not(:first-child) {
  text-align: center;
}
.stock-profit-meter {
  position: relative;
  min-width: 108px;
  height: 28px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.035);
}
.stock-profit-meter-fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0;
  opacity: 0.95;
}
.stock-profit-meter-label {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  height: 100%;
  padding: 0 0.55rem;
}
.stock-profit-meter-positive .stock-profit-meter-fill {
  background: linear-gradient(90deg, rgba(69,217,124,0.18), rgba(69,217,124,0.42));
}
.stock-profit-meter-positive .stock-profit-meter-label {
  color: var(--green);
}
.stock-profit-meter-negative .stock-profit-meter-fill {
  background: linear-gradient(90deg, rgba(244,112,112,0.14), rgba(244,112,112,0.34));
}
.stock-profit-meter-negative .stock-profit-meter-label {
  color: var(--red);
}
.stock-profit-meter-neutral .stock-profit-meter-label {
  color: var(--muted);
}
.stock-transit-link { background: transparent; border: 0; color: var(--orange); padding: 0; cursor: pointer; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.16em; font: inherit; }
.stock-transit-link:hover { color: var(--gold); }
  .stock-transit-zero { color: var(--muted); font-family: var(--font-mono); }
  .stock-transit-summary { display:flex; gap:0.75rem; flex-wrap:wrap; margin-bottom:1rem; }
  .stock-transit-summary > div { min-width:150px; padding:0.7rem 0.8rem; background:var(--s2); border:1px solid var(--border); border-radius:10px; }
  .stock-transit-summary strong { display:block; margin-top:0.18rem; font-family:var(--font-mono); font-size:1.05rem; color:var(--text); }
  .stock-transit-summary-label { font-family:var(--font-mono); font-size:0.58rem; color:var(--muted); text-transform:uppercase; letter-spacing:0.08em; }
  .stock-transit-table { width:100%; border-collapse:collapse; }
  .stock-transit-table th,
  .stock-transit-table td { padding:0.62rem 0.55rem; border-bottom:1px solid var(--border); text-align:left; }
  .stock-transit-table th { font-family:var(--font-mono); font-size:0.58rem; color:var(--muted); text-transform:uppercase; letter-spacing:0.08em; }
  .stock-transit-shipment { font-family:var(--font-mono); font-size:0.72rem; color:var(--text); }
  .stock-transit-source { display:inline-flex; padding:0.18rem 0.45rem; border:1px solid var(--border); border-radius:999px; font-family:var(--font-mono); font-size:0.58rem; color:var(--text2); background:var(--s2); }
  .stock-transit-qty { color:var(--orange); font-weight:700; text-align:right; }

  /* ── DRILL MODAL ─────────────────────────────────────────── */
  .drill-modal { display: none; position: fixed; inset: 0; z-index: 200; background: rgba(0,0,0,0.75); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); align-items: center; justify-content: center; padding: 1rem; }
  .drill-modal.open { display: flex; }
  .drill-content { background: var(--s1); border: 1px solid rgba(255,255,255,0.1); border-radius: var(--r-lg); padding: 1.5rem; width: 100%; max-width: 700px; max-height: 85vh; overflow-y: auto; box-shadow: var(--shadow-lg); }
  .drill-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.25rem; }
  .drill-title { font-family: var(--font-display); font-size: 1.4rem; color: var(--text); }
  .drill-close { background: var(--s2); border: 1px solid var(--border); color: var(--text2); border-radius: var(--r-sm); padding: 0.3rem 0.75rem; cursor: pointer; font-family: var(--font-sans); font-size: 0.68rem; font-weight: 600; transition: all 0.15s; }
  .drill-close:hover { color: var(--text); border-color: rgba(255,255,255,0.18); }

  /* ── FORECAST ────────────────────────────────────────────── */
  .forecast-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 1rem; margin-bottom: 1.25rem; }
  .forecast-card { background: var(--s2); border: 1px solid var(--border); border-radius: var(--r-md); padding: 1rem; text-align: center; position: relative; overflow: hidden; transition: transform 0.2s, border-color 0.2s; }
  .forecast-card:hover { transform: translateY(-2px); border-color: rgba(62,205,196,0.3); }
  .forecast-card::after { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px; background: linear-gradient(90deg, transparent, var(--teal), transparent); }
  .forecast-month { font-family: var(--font-sans); font-size: 0.62rem; font-weight: 700; color: var(--text2); text-transform: uppercase; letter-spacing: 0.12em; margin-bottom: 0.5rem; }
  .forecast-value { font-family: var(--font-mono); font-size: 1.45rem; font-weight: 500; color: var(--teal); }
  .forecast-range { font-family: var(--font-sans); font-size: 0.6rem; color: var(--text2); margin-top: 0.3rem; }
  .forecast-confidence { font-family: var(--font-sans); font-size: 0.62rem; color: var(--green); margin-top: 0.2rem; }
  .target-input-row { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; padding: 0.75rem 1rem; background: var(--s2); border-radius: var(--r-sm); border: 1px solid var(--border); margin-bottom: 1rem; font-family: var(--font-sans); font-size: 0.7rem; }
  .target-input { background: var(--s3); border: 1px solid var(--border); color: var(--text); border-radius: var(--r-sm); padding: 0.35rem 0.75rem; font-family: var(--font-mono); font-size: 0.75rem; width: 130px; outline: none; }
  .target-input:focus { border-color: var(--gold); }

  /* ── AI PRODUCTS ─────────────────────────────────────────── */
  .ai-product-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 1rem; margin-bottom: 1.25rem; }
  @media(max-width:900px){ .ai-product-grid { grid-template-columns: 1fr; } }
  @media(max-width:1100px){
    .profit-filter-row,
    .profit-filter-row-advanced {
      grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .profit-surface-top {
      flex-direction: column;
    }
    .profit-surface-status {
      white-space: normal;
    }
  }
  .ai-product-card { background: var(--s2); border: 1px solid var(--border); border-radius: var(--r-md); padding: 1.25rem; position: relative; overflow: hidden; transition: border-color 0.2s, transform 0.2s; }
  .ai-product-card:hover { border-color: var(--teal); transform: translateY(-2px); }
  .ai-product-card::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px; background: linear-gradient(90deg, var(--teal), var(--purple)); }
  .ai-product-name     { font-family: var(--font-display); font-size: 1.05rem; color: var(--text); margin-bottom: 0.3rem; font-weight: 600; }
  .ai-product-category { font-family: var(--font-sans); font-size: 0.58rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.12em; color: var(--teal); margin-bottom: 0.75rem; }
  .ai-product-why      { font-family: var(--font-sans); font-size: 0.78rem; color: var(--text2); line-height: 1.55; margin-bottom: 0.75rem; }
  .ai-product-metrics  { display: flex; gap: 0.75rem; flex-wrap: wrap; }
  .ai-metric { font-family: var(--font-sans); font-size: 0.63rem; font-weight: 600; padding: 0.2rem 0.5rem; border-radius: var(--r-xs); }
  .ai-metric.profit      { background: rgba(69,217,124,0.1);  color: var(--green); }
  .ai-metric.demand      { background: rgba(62,205,196,0.1);  color: var(--teal); }
  .ai-metric.competition { background: rgba(157,126,245,0.1); color: var(--purple); }
  .ai-metric.risk        { background: rgba(244,112,112,0.1); color: var(--red); }
  .ai-generate-btn { background: linear-gradient(135deg,rgba(62,205,196,0.12),rgba(157,126,245,0.12)); border: 1px solid rgba(62,205,196,0.25); color: var(--teal); border-radius: var(--r-sm); padding: 0.65rem 1.5rem; cursor: pointer; font-family: var(--font-sans); font-size: 0.72rem; font-weight: 700; letter-spacing: 0.04em; transition: all 0.2s; display: flex; align-items: center; gap: 0.5rem; }
  .ai-generate-btn:hover { border-color: var(--teal); background: rgba(62,205,196,0.2); }
  .ai-generate-btn:disabled { opacity: 0.45; cursor: not-allowed; }
  .ai-loading { text-align: center; padding: 3rem; font-family: var(--font-sans); font-size: 0.78rem; color: var(--text2); }
  .ai-loading-dots::after { content: ''; animation: dots 1.5s infinite; }
  @keyframes dots { 0%{content:'.'}33%{content:'..'}66%{content:'...'}100%{content:'....'} }
  .ai-context-bar { background: var(--s2); border: 1px solid var(--border); border-radius: var(--r-sm); padding: 0.75rem 1rem; margin-bottom: 1rem; font-family: var(--font-sans); font-size: 0.65rem; color: var(--text2); display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
  .ai-context-chip { background: rgba(233,187,58,0.1); color: var(--gold); padding: 0.2rem 0.5rem; border-radius: var(--r-xs); font-size: 0.62rem; }

  /* ── LOGO ICON ────────────────────────────────────────────── */
  /* ── SCROLLBAR ───────────────────────────────────────────── */
  ::-webkit-scrollbar { width: 4px; height: 4px; }
  ::-webkit-scrollbar-track { background: var(--s1); }
  ::-webkit-scrollbar-thumb { background: var(--s3); border-radius: 2px; }
  ::-webkit-scrollbar-thumb:hover { background: var(--muted); }

  /* ── MOBILE NAV ──────────────────────────────────────────── */
  .mobile-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: rgba(13,15,27,0.95);
    border-top: 1px solid var(--border);
    backdrop-filter: blur(12px);
    padding: 0.5rem 0.4rem env(safe-area-inset-bottom);
    justify-content: flex-start;
    gap: 0.45rem;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x proximity;
    touch-action: pan-x;
  }
  .mobile-nav-item { display: flex; flex-direction: column; align-items: center; gap: 0.24rem; font-family: var(--font-sans); font-size: 0.46rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); cursor: pointer; padding: 0.38rem 0.58rem; border-radius: var(--r-sm); transition: all 0.15s; flex-shrink: 0; min-width: 58px; scroll-snap-align: center; white-space: nowrap; }
  .mobile-nav-item.active { color: var(--gold); }
  .mobile-nav-item svg { width: 18px; height: 18px; }
  #mobile-sync-btn { color: var(--teal); }
  @keyframes spin { from{transform:rotate(0deg)} to{transform:rotate(360deg)} }
  .spinning { animation: spin 1s linear infinite; }
  .mobile-sheet-overlay { display: none; position: fixed; inset: 0; z-index: 300; background: rgba(0,0,0,0.65); backdrop-filter: blur(4px); }
  .mobile-sheet-overlay.open { display: block; }
  .mobile-sheet { position: fixed; bottom: 0; left: 0; right: 0; z-index: 301; background: var(--s1); border-top: 1px solid var(--border); border-radius: 18px 18px 0 0; padding: 1.5rem 1.5rem calc(1.5rem + env(safe-area-inset-bottom)); transform: translateY(100%); transition: transform 0.3s cubic-bezier(0.32,0.72,0,1); }
  .mobile-sheet.open { transform: translateY(0); }
  .mobile-sheet-handle { width: 36px; height: 4px; background: var(--muted); border-radius: 2px; margin: 0 auto 1.2rem; opacity: 0.4; }
  .mobile-sheet-title { font-family: var(--font-sans); font-size: 0.65rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.15em; margin-bottom: 1rem; }
  .mobile-sheet-btn { width: 100%; padding: 0.88rem; border-radius: var(--r-md); border: none; cursor: pointer; font-family: var(--font-sans); font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 0.55rem; transition: all 0.15s; }
  .mobile-sheet-btn:active { transform: scale(0.97); }

  /* ── RESPONSIVE ──────────────────────────────────────────── */
  @media (max-width:900px) {
    .layout { grid-template-columns: 1fr; }
    .sidebar { display: none; }
    .mobile-nav { display: flex; }
    .panel { padding: 1rem 0.75rem 5rem; }
    .kpi-row { grid-template-columns: repeat(2,1fr); gap: 0.6rem; }
    .grid-2, .grid-3 { grid-template-columns: 1fr; gap: 0.75rem; }
    .forecast-grid { grid-template-columns: repeat(2,1fr); }
    #filter-bar { padding: 0.5rem 0.75rem; gap: 0.75rem; }
    .filter-group { flex-wrap: wrap; }
    canvas { max-height: 220px; }
    .page-title { font-size: 1.6rem; }
    .kpi-value { font-size: 1.45rem; }
    .drill-content { padding: 1rem; }
    .appearance-switcher { font-size: 0.66rem; padding: 0.35rem 1.7rem 0.35rem 0.65rem; }
  }
  @media (max-width:480px) {
    .kpi-row { grid-template-columns: 1fr 1fr; }
    .forecast-grid { grid-template-columns: 1fr; }
  }

  @media (max-width: 900px) and (orientation: landscape) {
    .panel { padding: 0.7rem 0.7rem 4.1rem; }
    .page-header { margin-bottom: 1rem; }
    .page-title { font-size: 1.35rem; }
    #filter-bar { padding: 0.42rem 0.6rem; gap: 0.5rem; }
    .mobile-nav { padding-top: 0.35rem; }
    .mobile-nav-item { min-width: 52px; font-size: 0.42rem; padding: 0.3rem 0.5rem; }
    .mobile-nav-item svg { width: 15px; height: 15px; }
    .orders-table-card { max-height: calc(100vh - 180px); }
    .orders-expanded .orders-table-card { max-height: calc(100vh - 120px); }
  }
.shipment-weight-row label { color:var(--muted); white-space:nowrap; }
.shipment-weight-row input {
  width:60px; background:var(--s3); border:1px solid var(--border);
  color:var(--text); border-radius:4px; padding:0.2rem 0.4rem;
  font-family:var(--font-mono); font-size:0.65rem; text-align:right;
}
.shipment-weight-row input:focus { border-color:var(--gold); outline:none; }
#shipment-table td { padding:0.4rem 0.6rem; border-bottom:1px solid var(--border); vertical-align:middle; }
#shipment-table th { padding:0.45rem 0.6rem; background:var(--s2); color:var(--muted);
  font-family:var(--font-mono); font-size:0.6rem; font-weight:500; white-space:nowrap; }
#shipment-table tfoot td { padding:0.5rem 0.6rem; font-weight:600; border-top:2px solid var(--border); background:var(--s2); }
.ship-qty-input {
  width:60px; background:var(--s3); border:1px solid var(--border); color:var(--text);
  border-radius:4px; padding:0.2rem 0.4rem; font-family:var(--font-mono); font-size:0.72rem;
  text-align:center;
}
.ship-qty-input:focus { border-color:var(--gold); outline:none; }
.ship-check { width:16px; height:16px; cursor:pointer; accent-color:var(--gold); }
.ship-status-critical { color:var(--red); font-size:0.6rem; font-family:var(--font-mono); }
.ship-status-warning  { color:var(--orange); font-size:0.6rem; font-family:var(--font-mono); }
.ship-status-good     { color:var(--green); font-size:0.6rem; font-family:var(--font-mono); }
.ship-status-na       { color:var(--muted); font-size:0.6rem; font-family:var(--font-mono); }
.packing-item { display:flex; justify-content:space-between; align-items:center;
  padding:0.45rem 0.75rem; border-bottom:1px solid var(--border);
  font-family:var(--font-mono); font-size:0.7rem; }
.packing-item:last-child { border-bottom:none; }
.packing-item-name { color:var(--text); flex:1; }
.packing-item-detail { color:var(--muted); font-size:0.62rem; margin-left:1rem; text-align:right; }
.packing-total { background:var(--s2); border-radius:0 0 8px 8px; padding:0.6rem 0.75rem;
  font-family:var(--font-mono); font-size:0.7rem; font-weight:600;
  display:flex; justify-content:space-between; }
@media print {
  nav, .nav-sidebar, .mobile-nav, .mobile-sheet-overlay, .page-header button,
  #shipment-weight-inputs, .card-title button, #shipment-kpis { display:none!important; }
  .panel { display:block!important; }
  .panel:not(#panel-shipment) { display:none!important; }
  body { background:#fff; color:#000; }
  .card { border:1px solid #ccc; box-shadow:none; }
  .packing-item { color:#000; }
  .packing-item-detail { color:#444; }
}

/* ── FBA PLANNER ──────────────────────────────────────────── */
.fba-dest-btn {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  padding: 0.4rem 1.1rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.15s;
}
.fba-dest-btn:hover  { border-color: var(--gold); color: var(--gold); }
.fba-dest-btn.active { background: rgba(212,168,67,0.12); border-color: var(--gold); color: var(--gold); font-weight: 600; }

.fba-settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 0.75rem;
  padding: 0.25rem 0;
}
.fba-setting-group { display: flex; flex-direction: column; gap: 0.25rem; }
.fba-setting-label { font-family: var(--font-mono); font-size: 0.58rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; }
.fba-setting-input {
  background: var(--s3);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 4px;
  padding: 0.25rem 0.4rem;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  width: 100%;
  outline: none;
}
.fba-setting-input:focus { border-color: var(--gold); }

/* FBA table */
#fba-table { font-size: 0.74rem; }
#fba-table th {
  font-family: var(--font-mono);
  font-size: 0.57rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
  padding: 0.5rem 0.4rem;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
#fba-table td { padding: 0.45rem 0.35rem; border-bottom: 1px solid rgba(30,34,52,0.4); vertical-align: middle; }
.fba-row-urgent  { background: rgba(255,107,107,0.04); }
.fba-row-soon    { background: rgba(255,190,0,0.03); }
.fba-row-healthy { }
.fba-row-inactive{ opacity: 0.55; }

.fba-badge {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.58rem;
  padding: 0.15rem 0.45rem;
  border-radius: 3px;
  white-space: nowrap;
}
.fba-badge-urgent   { background: rgba(255,107,107,0.15); color: var(--red); }
.fba-badge-soon     { background: rgba(255,190,0,0.15);   color: var(--orange,#f0a500); }
.fba-badge-healthy  { background: rgba(81,207,102,0.15);  color: var(--green); }
.fba-badge-inactive { background: rgba(90,98,117,0.15);   color: var(--muted); }

.fba-qty-input {
  width: 62px;
  background: var(--s3);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 4px;
  padding: 0.2rem 0.35rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  text-align: center;
  outline: none;
}
.fba-qty-input:focus { border-color: var(--gold); }

.fba-inline-input {
  width: 60px;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  text-align: center;
  outline: none;
  padding: 0.1rem 0;
}
.fba-inline-input:focus { border-bottom-color: var(--gold); }

/* Settings collapse toggle */
.fba-settings-toggle {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  color: var(--muted);
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 0.3rem;
}
.fba-settings-toggle:hover { color: var(--gold); }

@media(max-width:768px) {
  .fba-settings-grid { grid-template-columns: repeat(2, 1fr); }
}


/* ══════════════════════════════════════════════════════════════
   FBA PLANNER STYLES
══════════════════════════════════════════════════════════════ */

/* ── Table ── */
.fba-table { width:100%; border-collapse:collapse; font-size:0.76rem; }
.fba-table tr:hover { background:rgba(255,255,255,0.03); }
.fba-row td { padding:0.3rem 0.35rem; border-bottom:1px solid rgba(255,255,255,0.04); vertical-align:middle; }
.fba-row-urgent td { border-left:2px solid var(--red); }
.fba-row-soon    td { border-left:2px solid var(--gold); }
.fba-row-healthy td { border-left:2px solid transparent; }
.fba-row-inactive td { border-left:2px solid transparent; opacity:0.6; }

/* ── Table headers ── */
.fba-th {
  font-family:var(--font-mono); font-size:0.58rem; font-weight:600;
  color:var(--muted); text-transform:uppercase; letter-spacing:0.04em;
  padding:0.55rem 0.4rem; text-align:center; white-space:nowrap;
  border-bottom:2px solid var(--border); background:var(--s2);
  position:sticky; top:0; z-index:2;
}
.fba-th-editable { color:rgba(94,234,212,0.7); }
.fba-th-highlight { color:var(--gold); background:rgba(212,168,67,0.06); }

/* ── Editable input cells ── */
.fba-cell-input {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 5px;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  padding: 0.3rem 0.4rem;
  width: 100%;
  min-width: 48px;
  text-align: center;
  transition: border-color 0.15s, background 0.15s;
  -moz-appearance: textfield;
}
.fba-cell-input::-webkit-inner-spin-button,
.fba-cell-input::-webkit-outer-spin-button { opacity: 0; }
.fba-cell-input:hover {
  border-color: rgba(94,234,212,0.35);
  background: rgba(94,234,212,0.05);
}
.fba-cell-input:focus {
  outline: none;
  border-color: var(--teal);
  background: rgba(94,234,212,0.1);
  box-shadow: 0 0 0 2px rgba(94,234,212,0.15);
}
.fba-cell-input[type="date"] {
  color-scheme: dark;
  width: 128px;
  font-size: 0.65rem;
  padding: 0.28rem 0.35rem;
}
.fba-cell-wide { width: 96px; min-width: 72px; }
.fba-cell-highlight {
  border-color: rgba(212,168,67,0.35);
  background: rgba(212,168,67,0.06);
  color: var(--gold);
  font-weight: 600;
}
.fba-cell-highlight:hover  { border-color: var(--gold); background: rgba(212,168,67,0.12); }
.fba-cell-highlight:focus  { border-color: var(--gold); box-shadow: 0 0 0 2px rgba(212,168,67,0.2); }

/* ── Product cell ── */
.fba-thumb {
  width: 36px; height: 36px;
  object-fit: cover; border-radius: 5px;
  border: 1px solid var(--border);
  display: block;
}
.fba-thumb-empty {
  width: 36px; height: 36px;
  background: var(--s3); border-radius: 5px;
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.5rem; color: var(--muted);
}
.fba-product-name  { font-size:0.75rem; font-weight:500; line-height:1.3; }
.fba-product-meta  { font-family:var(--font-mono); font-size:0.58rem; color:var(--teal); margin-top:0.1rem; }
.fba-status-pill   { display:inline-block; font-family:var(--font-mono); font-size:0.52rem; font-weight:600; padding:0.1rem 0.4rem; border-radius:99px; margin-top:0.15rem; }
.fba-status-active  { background:rgba(52,211,153,0.12); color:var(--green); border:1px solid rgba(52,211,153,0.25); }
.fba-status-testing { background:rgba(212,168,67,0.12); color:var(--gold); border:1px solid rgba(212,168,67,0.25); }
.fba-status-inactive{ background:rgba(255,255,255,0.05); color:var(--muted); border:1px solid var(--border); }

/* ── Urgency badges ── */
.fba-badge { font-family:var(--font-mono); font-size:0.6rem; font-weight:600; padding:0.2rem 0.55rem; border-radius:99px; white-space:nowrap; display:inline-block; }
.fba-badge-urgent  { background:rgba(255,107,107,0.15); color:var(--red);   border:1px solid rgba(255,107,107,0.3); }
.fba-badge-soon    { background:rgba(212,168,67,0.15);  color:var(--gold);  border:1px solid rgba(212,168,67,0.3); }
.fba-badge-healthy { background:rgba(52,211,153,0.12);  color:var(--green); border:1px solid rgba(52,211,153,0.25); }
.fba-badge-inactive{ background:rgba(255,255,255,0.05); color:var(--muted); border:1px solid var(--border); }

/* ── Utility ── */
.fba-td-center { text-align:center; }
.fba-td-right  { text-align:right; }
.fba-mono { font-family:var(--font-mono); }
.fba-muted { color:var(--muted); }
.fba-num   { text-align:right; font-family:var(--font-mono); }

/* ── Action buttons ── */
.fba-action-btn {
  font-family:var(--font-mono); font-size:0.62rem;
  padding:0.3rem 0.75rem; border-radius:5px; cursor:pointer; border:1px solid;
  white-space:nowrap;
}
.fba-btn-purple { background:rgba(132,94,247,0.12); color:var(--purple); border-color:rgba(132,94,247,0.3); }
.fba-btn-purple:hover { background:rgba(132,94,247,0.22); }
.fba-btn-muted  { background:rgba(255,255,255,0.04); color:var(--muted); border-color:var(--border); }
.fba-btn-muted:hover  { color:var(--text); border-color:var(--text); }

/* ── Box Planner ── */
.fba-box-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1rem;
  padding-top: 0.5rem;
}
.fba-box-layout {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding-top: 0.5rem;
}
.fba-box-card {
  background: linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255,255,255,0.02));
  border: 1px solid rgba(255,255,255,0.09);
  border-radius: 14px;
  padding: 1rem;
  box-shadow: 0 14px 34px rgba(0,0,0,0.18);
}
.fba-box-card.fba-box-card-focused {
  border-color: rgba(132,94,247,0.35);
  box-shadow: 0 16px 36px rgba(0,0,0,0.24);
}
.fba-box-card.fba-box-card-compact {
  padding: 0.85rem;
}
.fba-box-card.fba-box-over {
  border-color: var(--red);
  background: linear-gradient(180deg, rgba(255,107,107,0.08), rgba(255,255,255,0.02));
}
.fba-box-focus-shell {
  border: 1px solid rgba(255,255,255,0.09);
  border-radius: 16px;
  padding: 1rem;
  background: linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255,255,255,0.02));
  box-shadow: 0 14px 34px rgba(0,0,0,0.18);
}
.fba-box-focus-head {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: flex-start;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
}
.fba-box-focus-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text);
}
.fba-box-focus-sub {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  color: var(--muted);
  margin-top: 0.18rem;
}
.fba-box-focus-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 0.65rem;
  margin-bottom: 0.85rem;
}
.fba-box-focus-meta label {
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
  font-family: var(--font-mono);
  font-size: 0.58rem;
  color: var(--muted);
}
.fba-box-focus-meta input,
.fba-box-focus-meta select,
.fba-box-focus-meta textarea {
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.66rem;
  padding: 0.5rem 0.6rem;
}
.fba-box-focus-meta textarea {
  min-height: 84px;
  resize: vertical;
}
.fba-box-focus-meta-wide {
  grid-column: 1 / -1;
}
.fba-box-focus-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 0.5rem;
  margin-bottom: 0.85rem;
}
.fba-box-focus-stats div {
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.55rem 0.6rem;
}
.fba-box-focus-stats span {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.56rem;
  color: var(--muted);
  margin-bottom: 0.18rem;
}
.fba-box-focus-stats strong {
  display: block;
  font-size: 0.76rem;
  color: var(--text);
}
.fba-box-sheet-wrap {
  overflow: auto;
  border: 1px solid rgba(122, 129, 147, 0.28);
  border-radius: 10px;
  background: rgba(248, 249, 252, 0.96);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.4);
}
.fba-box-sheet-wrap-expanded {
  overflow-x: auto;
}
.fba-box-sheet {
  width: max-content;
  min-width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  border-spacing: 0;
  background: #fbfcfe;
}
.fba-box-sheet th,
.fba-box-sheet td {
  border: 1px solid rgba(122, 129, 147, 0.16);
  padding: 0.34rem 0.42rem;
  text-align: left;
  vertical-align: middle;
  box-sizing: border-box;
  background: rgba(255,255,255,0.98);
}
.fba-box-sheet tbody tr:nth-child(even) td {
  background: rgba(246, 248, 252, 0.98);
}
.fba-box-sheet th {
  position: sticky;
  top: 0;
  z-index: 3;
  font-family: var(--font-mono);
  font-size: 0.57rem;
  color: color-mix(in srgb, var(--text) 62%, white);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: #eef2f7;
}
.fba-box-sheet-tophead {
  left: 0;
  z-index: 4;
}
.fba-box-sheet-sticky,
.fba-box-sheet-sticky-2 {
  position: sticky;
  left: 0;
  z-index: 2;
  overflow: hidden;
  background: #f3f6fb !important;
}
.fba-box-sheet-sticky {
  width: 270px;
  min-width: 270px;
  max-width: 270px;
}
.fba-box-sheet-product-cell {
  width: 270px;
  max-width: 270px;
  background: color-mix(in srgb, var(--s2) 94%, transparent) !important;
}
.fba-box-sheet-product {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  width: 100%;
  min-width: 0;
}
.fba-box-sheet-product > div {
  flex: 1;
  min-width: 0;
}
.fba-box-sheet-thumb {
  width: 42px;
  height: 42px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--border);
  flex-shrink: 0;
}
.fba-box-sheet-name {
  display: block;
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1.35;
  color: var(--text);
  word-break: break-word;
  overflow-wrap: anywhere;
}
.fba-box-sheet-sub,
.fba-box-sheet-code {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.58rem;
  color: var(--muted);
}
.fba-box-sheet-code {
  color: var(--teal);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.fba-box-sheet-code-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.32rem;
  margin-top: 0.22rem;
}
.fba-box-sheet-code-row .fba-box-sheet-code {
  display: inline-flex;
  max-width: 100%;
  padding: 0.12rem 0.34rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: color-mix(in srgb, var(--s1) 92%, transparent);
}
.fba-box-sheet-sell {
  display: grid;
  gap: 0.22rem;
  min-width: 120px;
}
.fba-box-sheet-product-head {
  min-width: 220px;
  max-width: 220px;
  vertical-align: top;
}
.fba-box-sheet-header-card {
  display: grid;
  gap: 0.45rem;
  min-width: 0;
}
.fba-box-sheet-rowhead {
  min-width: 180px;
  max-width: 180px;
  background: #f3f6fb !important;
}
.fba-box-sheet-rowlabel {
  display: block;
  font-size: 0.64rem;
  font-weight: 700;
  color: var(--text);
}
.fba-box-sheet-rowhint {
  display: block;
  margin-top: 0.12rem;
  font-family: var(--font-mono);
  font-size: 0.5rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  text-transform: none;
  color: var(--muted);
}
.fba-box-sheet-metric {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  min-height: 30px;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}
.fba-box-sheet-metric.is-positive {
  color: var(--green);
}
.fba-box-sheet-metric.is-negative {
  color: var(--red);
}
.fba-box-sheet-cell-stack {
  display: grid;
  gap: 0.14rem;
}
.fba-box-sheet-header-card .fba-box-sheet-thumb {
  width: 42px;
  height: 42px;
}
.fba-box-sheet-expanded {
  min-width: 100%;
  table-layout: fixed;
}
.fba-box-sheet-expanded th,
.fba-box-sheet-expanded td {
  padding: 0.35rem;
}
.fba-box-sheet-expanded .fba-box-sheet-sticky,
.fba-box-sheet-expanded .fba-box-sheet-product-cell {
  min-width: 210px;
  width: 210px;
  max-width: 210px;
}
.fba-box-sheet-expanded .fba-box-sheet-thumb {
  width: 32px;
  height: 32px;
}
.fba-box-sheet-expanded .fba-box-sheet-product {
  gap: 0.45rem;
}
.fba-box-sheet-expanded .fba-box-sheet-name {
  font-size: 0.64rem;
}
.fba-box-sheet-expanded .fba-box-sheet-sub,
.fba-box-sheet-expanded .fba-box-sheet-code,
.fba-box-sheet-expanded .fba-box-sheet-money,
.fba-box-sheet-expanded .fba-box-sheet-input,
.fba-box-sheet-expanded th {
  font-size: 0.56rem;
}
.fba-box-sheet-expanded .fba-box-sheet-input {
  min-width: 52px;
  padding: 0.28rem 0.3rem;
}
.fba-box-sheet-expanded .fba-box-sheet-product-head {
  min-width: 180px;
  max-width: 180px;
}
.fba-box-sheet-expanded .fba-box-sheet-rowhead {
  min-width: 150px;
  max-width: 150px;
}
.fba-box-sheet-expanded .fba-box-sheet-date {
  min-width: 108px;
}
.fba-recon-bad {
  background: rgba(244,112,112,0.12);
  color: var(--red);
  border: 1px solid rgba(244,112,112,0.3);
}
.fba-box-sheet-input {
  width: 100%;
  min-width: 84px;
  background: #ffffff;
  border: 1px solid rgba(122, 129, 147, 0.22);
  border-radius: 4px;
  color: color-mix(in srgb, var(--text) 92%, black);
  font-family: var(--font-mono);
  font-size: 0.62rem;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
  padding: 0.26rem 0.32rem;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.45);
}
.fba-box-sheet-input:hover {
  border-color: rgba(75, 99, 145, 0.34);
}
.fba-box-sheet-input:focus {
  outline: none;
  border-color: rgba(57, 108, 217, 0.7);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.5), 0 0 0 1px rgba(57, 108, 217, 0.18);
}
.fba-box-sheet-input-sm {
  min-width: 58px;
}
.fba-box-sheet-date {
  min-width: 126px;
}
.fba-box-sheet-money {
  display: inline-block;
  min-width: 78px;
  text-align: right;
  font-family: var(--font-mono);
  font-size: 0.61rem;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}
.fba-box-sheet-empty {
  padding: 1rem !important;
  text-align: center !important;
  color: var(--muted);
  font-family: var(--font-mono);
}
.fba-box-focus-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 0.85rem;
}
.fba-box-header {
  display: flex; justify-content: space-between;
  align-items: flex-start; margin-bottom: 0.5rem;
  flex-wrap: wrap; gap: 0.3rem;
}
.fba-box-id    { font-family:var(--font-mono); font-size:0.7rem; font-weight:700; color:var(--purple); }
.fba-box-units { font-family:var(--font-mono); font-size:0.6rem; color:var(--muted); }
.fba-box-weight      { font-family:var(--font-mono); font-size:0.64rem; color:var(--text); }
.fba-box-weight.fba-weight-over { color:var(--red); font-weight:600; }
.fba-tare-label  { font-family:var(--font-mono); font-size:0.58rem; color:var(--muted); display:flex; align-items:center; gap:0.25rem; }
.fba-tare-input  { background:rgba(255,255,255,0.06); border:1px solid var(--border); border-radius:4px; color:var(--text); font-family:var(--font-mono); font-size:0.6rem; padding:0.15rem 0.3rem; width:46px; text-align:center; }
.fba-tare-input:focus { outline:none; border-color:var(--teal); }
.fba-bar-bg   { height:8px; background:rgba(255,255,255,0.06); border-radius:999px; margin-bottom:0.45rem; overflow:hidden; }
.fba-bar-fill { height:100%; border-radius:3px; transition:width 0.25s; }
.fba-box-capacity { font-family:var(--font-mono); font-size:0.58rem; color:var(--muted); margin-bottom:0.6rem; line-height:1.5; }
.fba-box-summary  { font-family:var(--font-mono); font-size:0.6rem; color:var(--muted); }
.fba-box-empty    { font-family:var(--font-mono); font-size:0.65rem; color:var(--muted); padding:0.75rem 0; text-align:center; }
.fba-box-add-row  { display:flex; gap:0.35rem; align-items:center; margin:0.15rem 0 0.55rem; }
.fba-box-add-input,
.fba-box-add-qty {
  background:rgba(255,255,255,0.06);
  border:1px solid var(--border);
  border-radius:4px;
  color:var(--text);
  font-family:var(--font-mono);
  font-size:0.62rem;
  padding:0.25rem 0.35rem;
}
.fba-box-add-input { flex:1; min-width:0; text-align:left; padding:0.55rem 0.7rem; font-size:0.68rem; background:rgba(255,255,255,0.08); }
.fba-box-add-qty   { width:52px; text-align:center; }
.fba-box-add-input:focus,
.fba-box-add-qty:focus { outline:none; border-color:var(--teal); }
.fba-box-search-shell {
  margin: 0.2rem 0 0.8rem;
}
.fba-box-search-head {
  display:flex;
  justify-content:space-between;
  gap:0.5rem;
  align-items:center;
  margin-bottom:0.35rem;
  flex-wrap:wrap;
}
.fba-box-search-label {
  font-size:0.62rem;
  font-weight:600;
  color:var(--text);
}
.fba-box-search-hint {
  font-family:var(--font-mono);
  font-size:0.56rem;
  color:var(--muted);
}
.fba-box-search-results {
  display:grid;
  gap:0.35rem;
  margin-top:0.35rem;
  max-height:260px;
  overflow:auto;
  padding:0.45rem;
  border:1px solid rgba(255,255,255,0.08);
  border-radius:10px;
  background:rgba(8,12,18,0.45);
}
.fba-box-search-results.is-hidden {
  display:none;
}
.fba-box-search-option {
  display:flex;
  align-items:center;
  gap:0.6rem;
  width:100%;
  border:1px solid rgba(255,255,255,0.08);
  background:rgba(255,255,255,0.04);
  color:var(--text);
  border-radius:10px;
  padding:0.45rem 0.55rem;
  text-align:left;
  cursor:pointer;
}
.fba-box-search-option:hover {
  border-color:rgba(94,234,212,0.25);
  background:rgba(94,234,212,0.07);
}
.fba-box-search-thumb {
  width:40px;
  height:40px;
  border-radius:8px;
  object-fit:cover;
  border:1px solid var(--border);
  flex-shrink:0;
}
.fba-box-search-main {
  display:grid;
  gap:0.16rem;
  min-width:0;
}
.fba-box-search-title {
  font-size:0.68rem;
  color:var(--text);
  line-height:1.3;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.fba-box-search-meta {
  font-family:var(--font-mono);
  font-size:0.55rem;
  color:var(--muted);
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.fba-box-search-empty {
  font-family:var(--font-mono);
  font-size:0.58rem;
  color:var(--muted);
  padding:0.35rem 0.15rem;
}
.fba-box-compact-list {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  margin-top: 0.55rem;
}
.fba-box-compact-item {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.35rem 0.45rem;
  background: var(--s1);
  border: 1px solid var(--border);
  border-radius: 5px;
  font-size: 0.66rem;
}
.fba-box-compact-item strong {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  color: var(--text);
}
.fba-box-compact-more {
  font-family: var(--font-mono);
  font-size: 0.58rem;
  color: var(--muted);
  text-align: right;
}
.fba-box-compact-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.4rem;
  margin-top: 0.55rem;
}
.fba-box-compact-stat {
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.45rem 0.5rem;
}
.fba-box-compact-stat span {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.54rem;
  color: var(--muted);
  margin-bottom: 0.18rem;
}
.fba-box-compact-stat strong {
  display: block;
  font-size: 0.68rem;
  color: var(--text);
  word-break: break-word;
}

/* ── Box items ── */
.fba-box-items { display:flex; flex-direction:column; gap:0.3rem; }
.fba-box-item {
  display: flex; align-items: center; gap: 0.4rem;
  padding: 0.45rem 0.5rem;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 8px;
}
.fba-box-thumb {
  width:28px; height:28px; object-fit:cover;
  border-radius:3px; border:1px solid var(--border); flex-shrink:0;
}
.fba-box-item-info { flex:1; min-width:0; }
.fba-box-item-name { font-size:0.7rem; font-weight:500; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.fba-box-item-asin { font-family:var(--font-mono); font-size:0.55rem; color:var(--teal); }
.fba-box-item-wt   { font-family:var(--font-mono); font-size:0.62rem; color:var(--muted); flex-shrink:0; white-space:nowrap; }
.fba-box-item-total{ font-family:var(--font-mono); font-size:0.62rem; color:var(--text); flex-shrink:0; min-width:46px; text-align:right; }

/* ── +/- qty buttons ── */
.fba-qty-btn {
  background: rgba(255,255,255,0.06); border:1px solid var(--border);
  border-radius:4px; color:var(--text); cursor:pointer;
  font-size:0.8rem; line-height:1; padding:0.15rem 0.4rem;
  font-family:var(--font-mono);
}
.fba-qty-btn:hover:not(:disabled) { background:rgba(255,255,255,0.12); border-color:var(--teal); }
.fba-qty-btn:disabled { opacity:0.3; cursor:not-allowed; }
.fba-box-qty {
  background: rgba(255,255,255,0.06); border:1px solid var(--border);
  border-radius:4px; color:var(--text); font-family:var(--font-mono);
  font-size:0.68rem; padding:0.15rem 0; text-align:center; width:34px;
}
.fba-box-qty:focus { outline:none; border-color:var(--gold); }
.fba-remove-btn {
  background:none; border:none; color:var(--muted); cursor:pointer;
  font-size:0.68rem; padding:0 0.2rem; flex-shrink:0;
}
.fba-remove-btn:hover { color:var(--red); }

/* ── Reconciliation ── */
.fba-recon-badge {
  font-family:var(--font-mono); font-size:0.58rem; font-weight:600;
  padding:0.15rem 0.5rem; border-radius:99px; white-space:nowrap;
  display:inline-block;
}
.fba-recon-ok    { background:rgba(52,211,153,0.12);  color:var(--green); border:1px solid rgba(52,211,153,0.25); }
.fba-recon-warn  { background:rgba(212,168,67,0.12);  color:var(--gold);  border:1px solid rgba(212,168,67,0.3); }
.fba-recon-error { background:rgba(255,107,107,0.12); color:var(--red);   border:1px solid rgba(255,107,107,0.3); }
.fba-recon-row-warn  { background:rgba(212,168,67,0.04); }
.fba-recon-row-error { background:rgba(255,107,107,0.04); }

@media(max-width:768px) {
  .fba-box-grid { grid-template-columns:1fr; }
  .fba-box-focus-head { flex-direction: column; }
  .fba-box-compact-stats { grid-template-columns: 1fr; }
  .fba-box-focus-actions { flex-direction: column; }
}

/* ═══════════════════════════════════════════════════════════
   FBA — EXCEL-LIKE TABLE (view/edit mode)
══════════════════════════════════════════════════════════ */
.fba-row-view { cursor: pointer; transition: background 0.1s; }
.fba-row-view:hover { background: rgba(255,255,255,0.045) !important; }
.fba-row-view:hover td { border-bottom-color: rgba(255,255,255,0.08); }
.fba-row-editing { background: rgba(212,168,67,0.06) !important; }
.fba-row-editing td { border-bottom-color: rgba(212,168,67,0.2) !important; border-top: 1px solid rgba(212,168,67,0.2); }

/* Urgency left-border accent */
.fba-row-urgent  td:first-child { border-left: 3px solid var(--red) !important; }
.fba-row-soon    td:first-child { border-left: 3px solid var(--gold) !important; }
.fba-row-healthy td:first-child { border-left: 3px solid rgba(52,211,153,0.4) !important; }
.fba-row-inactive td:first-child { border-left: 3px solid transparent !important; }
.fba-row-inactive { opacity: 0.6; }

/* Table cell helpers */
.fba-td-img     { width: 42px; text-align: center; padding: 0.2rem 0.3rem !important; }
.fba-td-product { min-width: 130px; max-width: 180px; padding: 0.4rem 0.5rem !important; }
.fba-td-center  { text-align: center; }
.fba-td-num     { text-align: right; font-family: var(--font-mono); font-size: 0.73rem; padding: 0.35rem 0.5rem !important; }
.fba-td-num.fba-muted { color: var(--muted); }
.fba-td-num.fba-zero  { color: var(--red); opacity: 0.8; }
.fba-muted { color: var(--muted); }

/* Product info in table */
.fba-product-name { font-size: 0.75rem; font-weight: 500; line-height: 1.3; }
.fba-product-asin { font-family: var(--font-mono); font-size: 0.57rem; color: var(--teal); margin-top: 0.1rem; }
.fba-edit-chip    { display: inline-block; font-family: var(--font-mono); font-size: 0.5rem; font-weight: 700; color: var(--gold); background: rgba(212,168,67,0.12); border: 1px solid rgba(212,168,67,0.3); border-radius: 99px; padding: 0.1rem 0.4rem; margin-top: 0.25rem; letter-spacing: 0.08em; }

/* Ship qty badge in view mode */
.fba-ship-badge { display: inline-block; font-family: var(--font-mono); font-size: 0.72rem; font-weight: 700; min-width: 28px; padding: 0.15rem 0.45rem; border-radius: 6px; background: rgba(255,255,255,0.05); color: var(--muted); border: 1px solid var(--border); text-align: center; }
.fba-ship-badge.fba-ship-has { background: rgba(212,168,67,0.12); color: var(--gold); border-color: rgba(212,168,67,0.3); }

/* Warning for missing sell price */
.fba-needs-price { font-family: var(--font-mono); font-size: 0.62rem; color: var(--red); font-weight: 600; }

/* Excel-style edit inputs */
.fba-xinput {
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 5px;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  padding: 0.3rem 0.4rem;
  width: 58px;
  text-align: right;
  transition: border-color 0.15s, background 0.15s;
}
.fba-xinput:focus {
  outline: none;
  border-color: var(--teal);
  background: rgba(94,234,212,0.06);
  box-shadow: 0 0 0 2px rgba(94,234,212,0.12);
}
.fba-xinput::placeholder { color: var(--muted); opacity: 0.5; }
.fba-xinput[type="text"]  { text-align: left; width: 90px; }
.fba-xinput[type="date"]  { text-align: left; width: 112px; }
.fba-xinput-wide  { width: 120px; }
.fba-xinput-qty   { width: 52px; background: rgba(212,168,67,0.1); border-color: rgba(212,168,67,0.3); color: var(--gold); text-align: center; font-weight: 700; font-size: 0.8rem; }
.fba-xinput-qty:focus { border-color: var(--gold); background: rgba(212,168,67,0.15); box-shadow: 0 0 0 2px rgba(212,168,67,0.18); }
.fba-xinput-sell  { background: rgba(94,234,212,0.07); border-color: rgba(94,234,212,0.25); color: var(--teal); }
.fba-xinput-sell:focus { border-color: var(--teal); box-shadow: 0 0 0 2px rgba(94,234,212,0.15); }
.fba-xinput::-webkit-inner-spin-button,
.fba-xinput::-webkit-outer-spin-button { opacity: 0.4; }

/* Extra fields row in edit mode */
.fba-edit-extra {
  display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: flex-end;
  padding: 0.6rem 0.5rem 0.5rem;
  background: rgba(212,168,67,0.04);
  border-top: 1px dashed rgba(212,168,67,0.15);
}
.fba-xfield { display: flex; flex-direction: column; gap: 0.2rem; font-family: var(--font-mono); font-size: 0.55rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }

/* Done button */
.fba-done-btn {
  align-self: flex-end;
  background: rgba(52,211,153,0.12);
  border: 1px solid rgba(52,211,153,0.3);
  border-radius: 6px;
  color: var(--green);
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0.35rem 0.8rem;
  transition: background 0.15s;
  white-space: nowrap;
}
.fba-done-btn:hover { background: rgba(52,211,153,0.22); }

/* Table header with tooltip indicator */
#fba-table th {
  font-family: var(--font-mono);
  font-size: 0.58rem;
  color: var(--muted);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.5rem 0.35rem;
  border-bottom: 2px solid var(--border);
  white-space: nowrap;
  cursor: help;
  user-select: none;
  position: relative;
}
#fba-table th:hover { color: var(--teal); }
#fba-table th::after { content: '?'; font-size: 0.45rem; opacity: 0; margin-left: 2px; vertical-align: super; }
#fba-table th:hover::after { opacity: 0.5; }

/* ═══════════════════════════════════════════════════════════
   FBA — TOOLTIP
══════════════════════════════════════════════════════════ */
.fba-tooltip {
  position: absolute;
  z-index: 9999;
  background: var(--s2);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
  max-width: 280px;
  min-width: 180px;
  padding: 0.6rem 0.75rem;
  pointer-events: none;
  transition: opacity 0.12s;
}
.fba-tip-label {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  font-weight: 700;
  color: var(--teal);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.35rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.3rem;
}
.fba-tip-body {
  font-size: 0.7rem;
  color: var(--text);
  line-height: 1.55;
  opacity: 0.85;
}

/* ═══════════════════════════════════════════════════════════
   FBA — ONBOARDING GUIDE BANNER
══════════════════════════════════════════════════════════ */
.fba-guide-banner {
  border: 1px solid rgba(94,234,212,0.2);
  border-radius: 10px;
  background: rgba(94,234,212,0.04);
  padding: 1rem 1.25rem;
  margin-bottom: 1.25rem;
}
.fba-guide-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.85rem;
}
.fba-guide-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--teal);
  letter-spacing: 0.02em;
}
.fba-guide-close {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.85rem;
  padding: 0.1rem 0.3rem;
  border-radius: 4px;
  transition: color 0.15s;
}
.fba-guide-close:hover { color: var(--text); }
.fba-guide-steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.65rem;
  margin-bottom: 0.85rem;
}
.fba-guide-step {
  display: flex;
  gap: 0.6rem;
  align-items: flex-start;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 0.6rem 0.75rem;
}
.fba-guide-num {
  width: 20px;
  height: 20px;
  min-width: 20px;
  background: rgba(94,234,212,0.15);
  border: 1px solid rgba(94,234,212,0.3);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  font-weight: 700;
  color: var(--teal);
  margin-top: 0.05rem;
}
.fba-guide-step-title { font-size: 0.72rem; font-weight: 600; color: var(--text); margin-bottom: 0.2rem; }
.fba-guide-step-desc  { font-size: 0.67rem; color: var(--muted); line-height: 1.5; }
.fba-guide-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  border-top: 1px solid var(--border);
  padding-top: 0.65rem;
  font-family: var(--font-mono);
  font-size: 0.6rem;
  color: var(--muted);
}
.fba-guide-dismiss-btn {
  background: rgba(94,234,212,0.1);
  border: 1px solid rgba(94,234,212,0.25);
  border-radius: 6px;
  color: var(--teal);
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 0.6rem;
  font-weight: 600;
  padding: 0.3rem 0.7rem;
  white-space: nowrap;
  transition: background 0.15s;
}
.fba-guide-dismiss-btn:hover { background: rgba(94,234,212,0.18); }

/* ═══════════════════════════════════════════════════════════
   FBA — SHIPMENT LEDGER
══════════════════════════════════════════════════════════ */
.fba-ledger-toolbar {
  display: flex;
  gap: 0.55rem;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 0.55rem;
}
.fba-ledger-path {
  flex: 1;
  min-width: 280px;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.66rem;
  padding: 0.55rem 0.7rem;
}
.fba-ledger-path:focus {
  outline: none;
  border-color: var(--purple);
  box-shadow: 0 0 0 2px rgba(132,94,247,0.12);
}
.fba-ledger-sub {
  font-family: var(--font-mono);
  font-size: 0.58rem;
  color: var(--muted);
  line-height: 1.6;
}
.fba-ledger-source-toggle {
  display: inline-flex;
  gap: 0.35rem;
  margin: 0.1rem 0 0.55rem;
  padding: 0.18rem;
  background: rgba(255,255,255,0.035);
  border: 1px solid var(--border);
  border-radius: 999px;
}
.fba-ledger-source-btn {
  border: none;
  background: transparent;
  color: var(--muted);
  padding: 0.42rem 0.8rem;
  border-radius: 999px;
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 0.58rem;
  transition: background 0.15s ease, color 0.15s ease;
}
.fba-ledger-source-btn.active {
  background: rgba(132,94,247,0.18);
  color: var(--text);
}
.fba-ledger-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.6rem;
  margin: 0.8rem 0;
}
.fba-ledger-kpi {
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.7rem 0.8rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}
.fba-ledger-kpi span {
  font-family: var(--font-mono);
  font-size: 0.56rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.fba-ledger-kpi strong {
  color: var(--text);
  font-size: 0.9rem;
}
.fba-ledger-grid {
  display: grid;
  gap: 0.9rem;
}
.fba-ledger-card {
  background: linear-gradient(180deg, rgba(132,94,247,0.04), rgba(255,255,255,0.02));
  border: 1px solid rgba(132,94,247,0.18);
  border-radius: 12px;
  padding: 0.95rem;
}
.fba-ledger-card.editing {
  border-color: rgba(62,205,196,0.3);
  box-shadow: 0 10px 30px rgba(0,0,0,0.18);
}
.fba-ledger-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.7rem;
  flex-wrap: wrap;
  margin-bottom: 0.55rem;
}
.fba-ledger-side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.45rem;
}
.fba-ledger-title {
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--text);
}
.fba-ledger-meta {
  font-family: var(--font-mono);
  font-size: 0.58rem;
  color: var(--muted);
  margin-top: 0.16rem;
}
.fba-ledger-badges {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
}
.fba-ledger-card-tools {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.fba-ledger-edit-btn,
.fba-ledger-inline-btn,
.fba-ledger-row-delete {
  border: 1px solid rgba(62,205,196,0.25);
  background: rgba(62,205,196,0.09);
  color: var(--teal);
  border-radius: 8px;
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 0.58rem;
  padding: 0.45rem 0.7rem;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.fba-ledger-edit-btn:hover,
.fba-ledger-inline-btn:hover,
.fba-ledger-row-delete:hover {
  background: rgba(62,205,196,0.15);
  border-color: rgba(62,205,196,0.4);
}
.fba-ledger-edit-btn.ghost {
  background: rgba(255,255,255,0.04);
  border-color: var(--border);
  color: var(--muted);
}
.fba-ledger-edit-btn[disabled],
.fba-ledger-row-delete[disabled] {
  opacity: 0.55;
  cursor: default;
}
.fba-ledger-edit-meta {
  font-family: var(--font-mono);
  font-size: 0.54rem;
  color: var(--muted);
}
.fba-ledger-meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 0.45rem 0.8rem;
  margin-bottom: 0.6rem;
  font-family: var(--font-mono);
  font-size: 0.6rem;
  color: var(--muted);
}
.fba-ledger-note {
  margin-bottom: 0.7rem;
  padding: 0.55rem 0.65rem;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.68rem;
  color: var(--text);
}
.fba-ledger-link-panel {
  margin-bottom: 0.7rem;
  padding: 0.7rem 0.75rem;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: 10px;
}
.fba-ledger-link-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
  margin-bottom: 0.5rem;
}
.fba-ledger-link-status {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.22rem 0.55rem;
  font-family: var(--font-mono);
  font-size: 0.56rem;
  letter-spacing: 0.04em;
  border: 1px solid var(--border);
}
.fba-ledger-link-status.linked {
  border-color: rgba(62,205,196,0.28);
  background: rgba(62,205,196,0.12);
  color: var(--teal);
}
.fba-ledger-link-status.warning {
  border-color: rgba(212,168,67,0.28);
  background: rgba(212,168,67,0.12);
  color: var(--gold);
}
.fba-ledger-link-status.neutral {
  color: var(--muted);
}
.fba-ledger-link-time {
  font-family: var(--font-mono);
  font-size: 0.54rem;
  color: var(--muted);
}
.fba-ledger-link-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0.4rem 0.75rem;
  font-family: var(--font-mono);
  font-size: 0.58rem;
  color: var(--muted);
}
.fba-ledger-history-wrap {
  margin-top: 0.65rem;
}
.fba-ledger-history-label {
  margin-bottom: 0.45rem;
  font-family: var(--font-mono);
  font-size: 0.54rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}
.fba-ledger-history {
  display: grid;
  gap: 0.45rem;
}
.fba-ledger-history-item {
  padding: 0.55rem 0.6rem;
  border-radius: 8px;
  background: rgba(255,255,255,0.025);
  border: 1px solid rgba(255,255,255,0.06);
}
.fba-ledger-history-compact {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.3rem 0.6rem;
}
.fba-ledger-history-head,
.fba-ledger-history-sub {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.fba-ledger-history-title {
  color: var(--text);
  font-size: 0.62rem;
  font-weight: 600;
}
.fba-ledger-history-time,
.fba-ledger-history-sub {
  font-family: var(--font-mono);
  font-size: 0.54rem;
  color: var(--muted);
}
.fba-ledger-history-fields {
  display: inline-flex;
  gap: 0.28rem;
  flex-wrap: wrap;
}
.fba-ledger-history-field {
  display: inline-flex;
  align-items: center;
  padding: 0.16rem 0.38rem;
  border-radius: 999px;
  background: rgba(132,94,247,0.12);
  border: 1px solid rgba(132,94,247,0.2);
  color: var(--text2);
}
.fba-ledger-history-empty,
.fba-ledger-field-note {
  font-family: var(--font-mono);
  font-size: 0.54rem;
  color: var(--muted);
}
.fba-ledger-field-note {
  line-height: 1.4;
}
.fba-ledger-edit-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 0.65rem 0.8rem;
  margin-top: 0.55rem;
}
.fba-ledger-field {
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
  font-family: var(--font-mono);
}
.fba-ledger-field.wide {
  width: 100%;
}
.fba-ledger-field span {
  font-size: 0.54rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.fba-ledger-note-editor {
  margin: 0.7rem 0 0.2rem;
}
.fba-ledger-input,
.fba-ledger-textarea {
  width: 100%;
  background: rgba(255,255,255,0.045);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.62rem;
  padding: 0.5rem 0.58rem;
}
.fba-ledger-input.compact {
  min-width: 92px;
}
.fba-ledger-input:focus,
.fba-ledger-textarea:focus {
  outline: none;
  border-color: rgba(62,205,196,0.45);
  box-shadow: 0 0 0 2px rgba(62,205,196,0.12);
}
.fba-ledger-textarea {
  min-height: 86px;
  resize: vertical;
}
.fba-ledger-edit-actions {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 0.55rem;
}
.fba-ledger-edit-row td {
  vertical-align: top;
}
.fba-ledger-table-wrap {
  overflow-x: auto;
}
.fba-ledger-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}
.fba-ledger-table th,
.fba-ledger-table td {
  padding: 0.45rem 0.5rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.68rem;
}
.fba-ledger-table th {
  font-family: var(--font-mono);
  font-size: 0.56rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  text-align: left;
}
.fba-ledger-num {
  text-align: right;
  font-family: var(--font-mono);
}
.fba-ledger-empty,
.fba-ledger-error {
  margin-top: 0.8rem;
  border-radius: 10px;
  padding: 0.9rem 1rem;
  font-family: var(--font-mono);
  font-size: 0.64rem;
}
.fba-ledger-empty {
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  color: var(--muted);
}
.fba-ledger-error {
  background: rgba(255,107,107,0.08);
  border: 1px solid rgba(255,107,107,0.22);
  color: var(--red);
}

@media(max-width:768px) {
  .fba-ledger-path {
    min-width: 100%;
  }
  .fba-ledger-source-toggle {
    width: 100%;
    justify-content: stretch;
  }
  .fba-ledger-source-btn {
    flex: 1;
    text-align: center;
  }
  .fba-ledger-card {
    padding: 0.8rem;
  }
  .fba-ledger-side {
    align-items: stretch;
    width: 100%;
  }
  .fba-ledger-card-tools {
    justify-content: stretch;
  }
}

/* ── SCOUT V2 POLISH ───────────────────────────────────────── */
.scout-tab-shell {
  background: linear-gradient(135deg, rgba(62,205,196,0.06), rgba(157,126,245,0.06));
}
.scout-tab-strip {
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
}
.scout-opportunity-intro {
  background: linear-gradient(130deg, rgba(62,205,196,0.06), rgba(212,168,67,0.05));
  border-color: rgba(62,205,196,0.24);
}
.scout-opportunity-grid,
.scout-pipeline-grid {
  display: grid;
  gap: 0.7rem;
}
.scout-opportunity-card {
  border-color: rgba(62,205,196,0.13);
  animation: scoutFadeIn 260ms ease both;
}
.scout-focus-badge {
  font-family: var(--font-mono);
  font-size: 0.58rem;
  color: var(--gold);
  background: rgba(212,168,67,0.1);
  border: 1px solid rgba(212,168,67,0.35);
  padding: 0.2rem 0.45rem;
  border-radius: 999px;
}
.scout-opportunity-metrics,
.scout-opportunity-action {
  font-family: var(--font-mono);
  font-size: 0.62rem;
}
.scout-opportunity-metrics {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 0.5rem;
}
.scout-opportunity-action {
  margin-top: 0.45rem;
  color: var(--text2);
}
.scout-research-form {
  display: flex;
  gap: 0.55rem;
  flex-wrap: wrap;
  align-items: center;
}
.scout-input {
  flex: 1;
  min-width: 220px;
  background: var(--s2);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 8px;
  padding: 0.5rem 0.65rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
}
.scout-input:focus {
  outline: none;
  border-color: rgba(62,205,196,0.45);
  box-shadow: 0 0 0 2px rgba(62,205,196,0.12);
}
.scout-loading-card,
.scout-empty {
  padding: 1rem;
  color: var(--muted);
}
.scout-loading-card {
  text-align: center;
  padding: 2rem;
}
.scout-research-card {
  border-color: rgba(157,126,245,0.22);
}
.scout-score-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
  margin-top: 0.8rem;
}
.scout-score-cell {
  border: 1px solid var(--border2);
  border-radius: 8px;
  padding: 0.45rem 0.5rem;
  background: rgba(255,255,255,0.02);
}

/* ── FBA SHIPMENT READY CARD POLISH ────────────────────────── */
.fba-ship-ready-card {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  width: 100%;
  background: linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255,255,255,0.02));
  border: 1px solid rgba(255,255,255,0.09);
  border-radius: 14px;
  padding: 1rem;
}
.fba-ship-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 0.6rem;
}
.fba-ship-title-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.18rem;
}
.fba-ship-kicker {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.fba-ship-title {
  font-family: var(--font-display);
  font-size: 1.05rem;
  color: var(--text);
  font-weight: 700;
}
.fba-ship-subtitle,
.fba-ship-meta,
.fba-ship-note {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  line-height: 1.45;
}
.fba-ship-subtitle,
.fba-ship-meta {
  color: var(--muted);
}
.fba-ship-section {
  padding: 0.8rem;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: 10px;
}
.fba-ship-section-title {
  font-family: var(--font-display);
  font-size: 0.9rem;
  color: var(--text);
  font-weight: 700;
}
.fba-ship-section-subtitle {
  margin-top: 0.18rem;
  font-family: var(--font-mono);
  font-size: 0.6rem;
  color: var(--muted);
  line-height: 1.45;
}
.fba-ship-status {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  padding: 0.25rem 0.5rem;
  border-radius: 999px;
}
.fba-ship-status-ready { border-color: rgba(69,217,124,0.3); }
.fba-ship-status-incomplete { border-color: rgba(248,150,60,0.3); }
.fba-ship-status-empty { border-color: var(--border); }
.fba-ship-chip-row {
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
}
.fba-ship-chip {
  padding: 0.26rem 0.5rem;
  background: var(--s2);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 0.62rem;
}
.fba-ship-queue {
  display: grid;
  gap: 0.8rem;
}
.fba-ship-queue-card {
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}
.fba-ship-queue-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.6rem;
  flex-wrap: wrap;
}
.fba-ship-queue-title {
  font-family: var(--font-display);
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text);
}
.fba-ship-queue-sub {
  margin-top: 0.15rem;
  font-family: var(--font-mono);
  font-size: 0.6rem;
  color: var(--muted);
}
.fba-ship-queue-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.55rem;
}
.fba-ship-queue-grid label {
  display: flex;
  flex-direction: column;
  gap: 0.26rem;
  font-family: var(--font-mono);
  font-size: 0.58rem;
  color: var(--muted);
}
.fba-shipment-form {
  padding: 0.8rem;
  background: var(--s2);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.fba-ship-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 0.55rem;
}
.fba-ship-field,
.fba-ship-notes {
  background: var(--s1);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 6px;
  font-family: var(--font-mono);
}
.fba-ship-field {
  padding: 0.42rem 0.55rem;
  font-size: 0.68rem;
}
.fba-ship-notes {
  width: 100%;
  min-height: 68px;
  padding: 0.45rem 0.55rem;
  font-size: 0.66rem;
  resize: vertical;
}
.fba-ship-field:focus,
.fba-ship-notes:focus {
  outline: none;
  border-color: rgba(62,205,196,0.45);
  box-shadow: 0 0 0 2px rgba(62,205,196,0.12);
}
.fba-ship-actions {
  display: flex;
  justify-content: flex-end;
}
.fba-ship-submit {
  background: rgba(212,168,67,0.12);
  color: var(--gold);
  border: 1px solid rgba(212,168,67,0.35);
  border-radius: 8px;
  padding: 0.45rem 1rem;
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 600;
  transition: all 0.15s;
}
.fba-ship-submit:hover {
  border-color: rgba(212,168,67,0.55);
  background: rgba(212,168,67,0.2);
}

@keyframes scoutFadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Table toolbar row (inactive toggle + hint) */
.fba-table-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.4rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.fba-inactive-hint {
  font-family: var(--font-mono);
  font-size: 0.58rem;
  color: var(--muted);
}

@media(max-width:768px) {
  .fba-guide-steps { grid-template-columns: 1fr; }
  .fba-edit-extra  { flex-direction: column; }
  .fba-xinput-wide { width: 100%; }
  .scout-score-grid { grid-template-columns: repeat(2, 1fr); }
  .fba-ship-grid { grid-template-columns: 1fr; }
}

/* ── AI CHAT WIDGET ──────────────────────────────────────────── */
.chat-fab {
  position: fixed; bottom: 1.5rem; right: 1.5rem; z-index: 500;
  width: 52px; height: 52px; border-radius: 50%;
  background: linear-gradient(135deg, var(--teal), var(--purple));
  border: none; color: #fff; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 16px rgba(0,0,0,0.3);
  transition: transform 0.2s, box-shadow 0.2s;
  will-change: left, top, transform;
  touch-action: none;
  user-select: none;
}
.chat-fab:hover { transform: scale(1.08); box-shadow: 0 6px 24px rgba(0,0,0,0.4); }
.chat-fab.open { transform: scale(0.9); opacity: 0.7; }

.azy-logo-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #fff;
  background: linear-gradient(135deg, #0ea5a4 0%, #1d4ed8 50%, #8b5cf6 100%);
  box-shadow: 0 2px 10px rgba(14, 165, 164, 0.35), inset 0 0 0 1px rgba(255,255,255,0.15);
}

.azy-logo-mark.small {
  width: 20px;
  height: 20px;
  border-radius: 6px;
  font-size: 0.52rem;
  margin-right: 0.42rem;
  vertical-align: middle;
}

.chat-panel {
  position: fixed; bottom: 5rem; right: 1.5rem; z-index: 500;
  width: 380px; max-height: 520px;
  background: var(--s1); border: 1px solid var(--border);
  border-radius: 16px; overflow: hidden;
  box-shadow: 0 8px 40px rgba(0,0,0,0.35);
  display: flex; flex-direction: column;
  transform: translateY(20px) scale(0.95);
  opacity: 0; pointer-events: none;
  transition: transform 0.25s ease, opacity 0.25s ease;
}
.chat-panel.open {
  transform: translateY(0) scale(1);
  opacity: 1; pointer-events: all;
}

.chat-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 0.75rem 1rem;
  background: linear-gradient(135deg, rgba(78,205,196,0.1), rgba(132,94,247,0.1));
  border-bottom: 1px solid var(--border);
  cursor: grab;
  touch-action: none;
}
.chat-dragging .chat-header { cursor: grabbing; }
.chat-dragging .chat-fab,
.chat-dragging .chat-panel { transition: none !important; }
.chat-header-title { font-family: var(--font-sans); font-size: 0.85rem; font-weight: 700; color: var(--text); display:flex; align-items:center; }
.chat-header-sub { font-family: var(--font-mono); font-size: 0.55rem; color: var(--muted); }
.chat-close {
  background: none; border: none; color: var(--muted); cursor: pointer;
  font-size: 0.9rem; padding: 0.2rem 0.4rem; border-radius: 4px;
}
.chat-close:hover { color: var(--text); }

.chat-messages {
  flex: 1; overflow-y: auto; padding: 1rem;
  display: flex; flex-direction: column; gap: 0.6rem;
  min-height: 280px; max-height: 350px;
}

.chat-msg {
  font-family: var(--font-sans); font-size: 0.78rem; line-height: 1.55;
  padding: 0.6rem 0.85rem; border-radius: 12px; max-width: 88%;
  word-wrap: break-word;
}
.chat-msg code {
  background: rgba(212,168,67,0.12); padding: 0.1rem 0.3rem;
  border-radius: 3px; font-family: var(--font-mono); font-size: 0.72rem;
}
.chat-msg-user {
  background: rgba(78,205,196,0.12); color: var(--text);
  border: 1px solid rgba(78,205,196,0.2); align-self: flex-end;
  border-bottom-right-radius: 4px;
}
.chat-msg-ai {
  background: var(--s2); color: var(--text);
  border: 1px solid var(--border); align-self: flex-start;
  border-bottom-left-radius: 4px;
}

.chat-input-row {
  display: flex; gap: 0.5rem; padding: 0.75rem;
  border-top: 1px solid var(--border); background: var(--s1);
}
.chat-input {
  flex: 1; background: var(--s2); border: 1px solid var(--border);
  color: var(--text); border-radius: 8px; padding: 0.5rem 0.75rem;
  font-family: var(--font-sans); font-size: 0.78rem; resize: none;
  line-height: 1.4; max-height: 80px;
}
.chat-input:focus { outline: none; border-color: var(--teal); }
.chat-input::placeholder { color: var(--muted); }
.chat-send {
  background: linear-gradient(135deg, var(--teal), var(--purple));
  border: none; color: #fff; cursor: pointer; border-radius: 8px;
  width: 38px; min-width: 38px; height: 38px;
  display: flex; align-items: center; justify-content: center;
  transition: opacity 0.2s;
}
.chat-send:hover { opacity: 0.85; }

@media(max-width:768px) {
  .chat-panel {
    width: calc(100vw - 1rem);
    right: 0.5rem;
    left: 0.5rem;
    bottom: 4.7rem;
    max-height: 72vh;
    border-radius: 18px;
    box-shadow: 0 16px 50px rgba(0,0,0,0.55);
  }
  .chat-messages { max-height: 52vh; }
  .chat-fab {
    bottom: calc(1rem + env(safe-area-inset-bottom));
    right: 1rem;
    width: 50px;
    height: 50px;
    box-shadow: 0 8px 28px rgba(0,0,0,0.45);
  }
  .appearance-switcher { font-size: 0.6rem; padding: 0.25rem 0.5rem; padding-right: 1.5rem; }
}

@media (max-width:900px) {
  .panel {
    padding: 0.85rem 0.75rem calc(5.6rem + env(safe-area-inset-bottom));
  }
  .page-header {
    margin-bottom: 1rem;
  }
  .orders-page-header {
    align-items: stretch;
  }
  .header-actions {
    flex-wrap: wrap;
    gap: 0.55rem;
  }
  .btn-refresh {
    padding: 0.48rem 0.82rem;
  }
  .orders-header-actions {
    width: 100%;
    justify-content: flex-start;
  }
  .btn-sync-minimal,
  .btn-view-toggle {
    min-height: 42px;
  }
  .orders-view-panel {
    margin-top: 0;
    padding: 0.75rem;
  }
  .orders-view-group,
  .orders-view-inline-tools {
    width: 100%;
  }
  .orders-view-presets {
    width: 100%;
  }
  .orders-view-group .btn,
  .orders-view-inline-tools .btn,
  .orders-view-select-wrap {
    width: 100%;
    justify-content: center;
  }
  .sync-meta {
    gap: 0.24rem;
    font-size: 0.56rem;
  }
  .sync-meta-summary {
    gap: 0.35rem;
  }
  .sync-meta-summary-item {
    padding: 0.16rem 0.42rem;
  }
  .sync-meta-detail {
    gap: 0.35rem 0.75rem;
  }
  .orders-filter-primary > select,
  .orders-filter-primary > button,
  .orders-filter-advanced > select,
  .orders-filter-advanced > input,
  .orders-filter-advanced > button {
    flex: 1 1 calc(50% - 0.35rem);
    min-width: 0;
  }
  .orders-filter-search {
    width: 100%;
    margin-left: 0;
  }
  .orders-filter-count {
    width: 100%;
    margin-left: 0 !important;
  }
  .stock-filter-group {
    width: 100%;
    min-width: 0;
  }
  .stock-filter-pills > button {
    flex: 1 1 calc(50% - 0.35rem);
    min-width: 0;
  }
  .page-title {
    letter-spacing: -0.01em;
    font-size: 1.5rem;
  }
  .card {
    border-radius: 14px;
    border-color: rgba(255,255,255,0.1);
    box-shadow: 0 10px 32px rgba(0,0,0,0.26);
  }
  .kpi {
    border-radius: 12px;
    border-color: rgba(255,255,255,0.1);
    box-shadow: 0 8px 24px rgba(0,0,0,0.22);
  }
  .mobile-nav {
    background: linear-gradient(180deg, rgba(11,14,26,0.92), rgba(7,9,17,0.97));
    border-top: 1px solid rgba(255,255,255,0.12);
    box-shadow: 0 -8px 24px rgba(0,0,0,0.35);
    padding-bottom: calc(0.35rem + env(safe-area-inset-bottom));
  }
  .mobile-nav-item {
    min-width: 52px;
    padding: 0.38rem 0.55rem;
    border-radius: 10px;
  }
  .mobile-nav-item.active {
    color: var(--gold2);
    background: rgba(233,187,58,0.1);
  }

  @media (max-width:768px) {
    .orders-page-header {
      gap: 0.8rem;
      margin-bottom: 0.8rem;
    }
    .orders-header-main {
      gap: 0.5rem;
    }
    .orders-sync-meta-inline .sync-meta-summary {
      gap: 0.28rem;
    }
    .orders-sync-meta-inline .sync-meta-summary-item {
      width: 100%;
      justify-content: flex-start;
      border-radius: 12px;
      padding: 0.28rem 0.5rem;
    }
    .orders-filter-primary {
      gap: 0.45rem;
      margin-bottom: 0.5rem !important;
    }
    .orders-filter-primary > select,
    .orders-filter-primary > button,
    .orders-filter-advanced > select,
    .orders-filter-advanced > input,
    .orders-filter-advanced > button {
      flex: 1 1 100%;
    }
    .orders-filter-search {
      order: -1;
    }
    .orders-filter-search input {
      width: 100% !important;
    }
    .orders-mobile-list {
      display: grid;
      gap: 0.75rem;
      margin-bottom: 0.85rem;
    }
    .orders-th-filter-btn {
      display: none;
    }
    .orders-table-card,
    .orders-column-note {
      display: none !important;
    }
    .orders-mobile-top,
    .orders-mobile-footer,
    .orders-mobile-product-line,
    .orders-mobile-metrics {
      flex-direction: column;
    }
    .orders-mobile-top-tags {
      justify-content: flex-start;
    }
    .orders-mobile-metrics {
      gap: 0.45rem;
    }
    .orders-mobile-metric {
      width: 100%;
    }
    .orders-mobile-actions {
      width: 100%;
      justify-content: flex-start;
    }
    .orders-mobile-toggle-btn,
    .orders-mobile-edit-btn {
      flex: 1 1 auto;
      justify-content: center;
      text-align: center;
    }
  .orders-mobile-detail-grid {
      grid-template-columns: 1fr;
    }
    .tracker-shipment-item-row {
      align-items: flex-start;
      max-width: 100%;
    }
    .tracker-shipment-item-copy {
      min-width: 0;
      max-width: calc(100% - 38px);
    }
  }
    .target-input-row {
      gap: 0.55rem;
      padding: 0.65rem 0.7rem;
      font-size: 0.64rem;
    }
    .target-input-row .target-input {
      width: 118px;
      padding: 0.34rem 0.55rem;
    }
}

/* Unified FBA palette override: calmer table and consistent urgency styling */
.fba-row-urgent,
.fba-row-soon,
.fba-row-healthy {
  background: rgba(255,255,255,0.02) !important;
}

.fba-row-urgent td:first-child,
.fba-row-soon td:first-child,
.fba-row-healthy td:first-child {
  border-left: 3px solid var(--border) !important;
}

.fba-badge-urgent,
.fba-badge-soon,
.fba-badge-healthy {
  background: rgba(255,255,255,0.06) !important;
  border: 1px solid var(--border) !important;
  color: var(--text) !important;
}

.fba-plan-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 0.9rem;
}

.fba-plan-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: linear-gradient(145deg, rgba(255,255,255,0.02), rgba(255,255,255,0.01));
  padding: 0.75rem;
}

.fba-plan-urgent { border-left: 3px solid var(--red); }
.fba-plan-soon { border-left: 3px solid var(--gold); }
.fba-plan-healthy { border-left: 3px solid var(--green); }
.fba-plan-inactive { border-left: 3px solid transparent; opacity: 0.72; }

.fba-plan-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
}

.fba-plan-product {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  min-width: 0;
}

.fba-plan-copy {
  min-width: 0;
}

.fba-plan-img {
  width: 72px;
  height: 72px;
  border-radius: 14px;
  object-fit: cover;
  border: 1px solid var(--border);
  background: var(--s2);
  flex-shrink: 0;
}

.fba-ledger-thumb {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  object-fit: cover;
  border: 1px solid var(--border);
  background: var(--s2);
  vertical-align: middle;
  margin-right: 6px;
}

.fba-ledger-history-search-wrap {
  position: relative;
  flex: 1;
  min-width: 200px;
}
.fba-ledger-history-search-wrap svg {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  opacity: 0.45;
}
.fba-ledger-history-search {
  width: 100%;
  padding: 0.5rem 0.75rem 0.5rem 2.2rem;
  background: var(--s2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 0.7rem;
  box-sizing: border-box;
  transition: border-color 0.15s;
}
.fba-ledger-history-search:focus {
  outline: none;
  border-color: var(--accent, #4a90d9);
}

.fba-plan-name {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
}

.fba-plan-meta {
  font-family: var(--font-mono);
  font-size: 0.58rem;
  color: var(--muted);
  line-height: 1.4;
}

.tracker-shipment-items {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 0.55rem 0.75rem;
  margin-top: 0.45rem;
}

.tracker-shipment-item-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  min-width: 0;
  max-width: 220px;
}

.tracker-shipment-item-thumb {
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  border-radius: 8px;
  overflow: hidden;
  background: var(--s2);
  border: 1px solid rgba(255,255,255,0.08);
  display: flex;
  align-items: center;
  justify-content: center;
}

.tracker-shipment-item-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.tracker-shipment-item-fallback {
  width: 100%;
  height: 100%;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 0.5rem;
  color: var(--muted);
}

.tracker-shipment-item-copy {
  min-width: 0;
  flex: 0 1 auto;
  display: flex;
  align-items: baseline;
  gap: 0.28rem;
  flex-wrap: nowrap;
}

.tracker-shipment-item-name,
.tracker-shipment-item-meta {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tracker-shipment-item-name {
  max-width: 118px;
  font-size: 0.6rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
}

.tracker-shipment-item-meta {
  display: none;
  font-family: var(--font-mono);
  font-size: 0.5rem;
  color: var(--muted);
  line-height: 1.2;
}

.tracker-shipment-item-qty {
  font-family: var(--font-mono);
  font-size: 0.52rem;
  color: var(--teal);
  white-space: nowrap;
}

.fba-plan-inputs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 0.45rem;
  margin-top: 0.65rem;
}

.fba-plan-inputs label {
  display: flex;
  flex-direction: column;
  gap: 0.18rem;
  font-family: var(--font-mono);
  font-size: 0.53rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.fba-plan-inputs input,
.fba-plan-inputs select {
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.66rem;
  padding: 0.32rem 0.42rem;
}

.fba-plan-inputs input:focus,
.fba-plan-inputs select:focus {
  outline: none;
  border-color: var(--gold);
}

.fba-plan-cost-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.35rem;
  margin-top: 0.65rem;
  font-family: var(--font-mono);
  font-size: 0.6rem;
}

.fba-plan-cost-grid div {
  padding: 0.28rem 0.45rem;
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 6px;
  background: rgba(255,255,255,0.02);
  color: var(--muted);
}

.fba-plan-cost-grid strong {
  color: var(--text);
  margin-left: 0.3rem;
}

/* ---------------------------------------
   JAPAN POST RATES PAGE
   -------------------------------------- */
.jppost-page {
  max-width: 1300px;
  margin: 0 auto;
}

.jppost-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.jppost-page-title {
  font-family: var(--font-sans);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--gold);
  letter-spacing: -0.01em;
}

.jppost-page-sub {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--muted);
  margin-top: 0.25rem;
}

/* Service tabs */
.jppost-tabs {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}

.jppost-tab {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  padding: 0.4rem 1rem;
  border-radius: var(--r-sm);
  border: 1px solid var(--border);
  background: var(--s2);
  color: var(--muted);
  cursor: pointer;
  transition: all 0.15s;
  letter-spacing: 0.02em;
}

.jppost-tab:hover {
  border-color: var(--gold);
  color: var(--gold);
}

.jppost-tab.active {
  background: rgba(212,168,67,0.12);
  border-color: var(--gold);
  color: var(--gold);
  font-weight: 700;
}

/* Two-column layout */
.jppost-body {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 1.25rem;
  align-items: start;
}

@media (max-width: 860px) {
  .jppost-body { grid-template-columns: 1fr; }
}

.jppost-col-left  { display: flex; flex-direction: column; }
.jppost-col-right { display: flex; flex-direction: column; }

/* Section title */
.jppost-section-title {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--text2);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 0.9rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--border);
}

/* Metadata grid */
.jppost-meta-grid {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin-bottom: 0.75rem;
}

.jppost-meta-cell {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem;
}

.jppost-meta-label {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  color: var(--muted);
  flex-shrink: 0;
}

.jppost-meta-val {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text);
  text-align: right;
}

/* Buttons */
.jppost-btn {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  padding: 0.35rem 0.8rem;
  border-radius: var(--r-sm);
  border: 1px solid var(--border);
  background: var(--s2);
  color: var(--text2);
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  transition: all 0.15s;
  letter-spacing: 0.03em;
}

.jppost-btn:hover   { border-color: var(--gold); color: var(--gold); }
.jppost-btn.active  { background: rgba(212,168,67,0.12); border-color: var(--gold); color: var(--gold); }
.jppost-btn-save    { background: rgba(62,205,196,0.1); border-color: var(--teal); color: var(--teal); font-weight: 700; }
.jppost-btn-save:hover { background: rgba(62,205,196,0.2); }
.jppost-btn-mark    { background: var(--s2); }
.jppost-btn-link    { background: var(--s1); }

/* Calculator */
.jppost-calc-card { }

.jppost-calc-row {
  display: flex;
  align-items: flex-end;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.jppost-input {
  display: block;
  margin-top: 0.3rem;
  padding: 0.4rem 0.6rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text);
  background: var(--s1);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  width: 110px;
  transition: border-color 0.15s;
  -moz-appearance: textfield;
}

.jppost-input::-webkit-outer-spin-button,
.jppost-input::-webkit-inner-spin-button { -webkit-appearance: none; }

.jppost-input:focus {
  outline: none;
  border-color: var(--gold);
}

.jppost-calc-result {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--muted);
  padding: 0.3rem 0;
  min-height: 1.5rem;
  transition: color 0.2s;
}

/* Rate table */
.jppost-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-mono);
  font-size: 0.72rem;
}

.jppost-th {
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  padding: 0.35rem 0.6rem;
  border-bottom: 1px solid var(--border);
  text-align: left;
  font-weight: 600;
}

.jppost-td {
  padding: 0.32rem 0.6rem;
  border-bottom: 1px solid rgba(255,255,255,0.03);
  color: var(--text);
  vertical-align: middle;
}

.jppost-td-num { text-align: right; }

.jppost-table tbody tr:hover .jppost-td {
  background: var(--s2);
}

/* Unverified banner */
.jppost-unverified-banner {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: #f0a500;
  background: rgba(240,165,0,0.08);
  border: 1px solid rgba(240,165,0,0.25);
  border-radius: var(--r-sm);
  padding: 0.55rem 0.75rem;
  margin-bottom: 0.75rem;
}

.jppost-unverified-banner a {
  color: #f0a500;
  text-decoration: underline;
}

/* Light theme overrides */
body.theme-light .jppost-tab         { background: #fff; color: #666; }
body.theme-light .jppost-table tbody tr:hover .jppost-td { background: #f8f8f8; }
body.theme-light .jppost-input       { background: #f8f8f8; color: #111; }

/* ═══════════════════════════════════════════════════════════════
   FBA PLANNER · 2026-04 World-Class Pass
═══════════════════════════════════════════════════════════════ */

/* Segmented control for ledger filters */
.fba-ledger-seg {
  display: inline-flex;
  background: rgba(255,255,255,0.035);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px;
  padding: 3px;
  gap: 2px;
}
.fba-ledger-seg-btn {
  background: transparent;
  border: 0;
  color: var(--muted);
  padding: 0.4rem 0.9rem;
  font-size: 0.68rem;
  font-weight: 500;
  border-radius: 7px;
  cursor: pointer;
  transition: all 0.15s ease;
  letter-spacing: 0.01em;
}
.fba-ledger-seg-btn:hover {
  color: var(--text);
  background: rgba(255,255,255,0.04);
}
.fba-ledger-seg-btn.active {
  background: rgba(255,255,255,0.08);
  color: var(--text);
  box-shadow: 0 1px 0 rgba(255,255,255,0.05) inset;
}

/* Chevron toggle on shipment card */
.fba-ledger-card-head {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}
.fba-ledger-card-head-main {
  flex: 1;
  min-width: 0;
}
.fba-ledger-chevron {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.07);
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s;
  margin-top: 2px;
}
.fba-ledger-chevron:hover {
  background: rgba(255,255,255,0.08);
  color: var(--text);
}

/* Product cell with thumbnail in ledger table */
.fba-ledger-prod-cell {
  display: flex;
  align-items: center;
  gap: 8px;
}
.fba-ledger-prod-cell span {
  flex: 1;
  min-width: 0;
  line-height: 1.3;
}
.fba-ledger-thumb-empty {
  background: linear-gradient(135deg, rgba(255,255,255,0.04), rgba(255,255,255,0.01));
  display: inline-block;
}

/* World-Class card base shared by Action Center + Shipment Queue */
.fba-wc-card {
  background: linear-gradient(180deg, rgba(255,255,255,0.025), rgba(255,255,255,0.008));
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px;
  padding: 0.95rem 1.05rem;
  box-shadow: 0 1px 0 rgba(255,255,255,0.04) inset, 0 8px 24px -12px rgba(0,0,0,0.5);
  margin-bottom: 1rem;
}
.fba-cockpit {
  max-width: none;
}
.fba-wc-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 0.7rem;
  flex-wrap: wrap;
}
.fba-wc-head-main { flex: 1; min-width: 0; }
.fba-wc-eyebrow {
  font-size: 0.55rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
  margin-bottom: 0.25rem;
}
.fba-wc-title {
  font-size: 0.96rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
  letter-spacing: -0.01em;
}
.fba-wc-sub {
  font-size: 0.66rem;
  color: var(--muted);
  margin-top: 0.35rem;
  line-height: 1.4;
}
.fba-wc-pill {
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  color: var(--muted);
  white-space: nowrap;
  flex-shrink: 0;
}
.fba-wc-pill.ok { color: var(--green); border-color: rgba(80,220,140,0.25); background: rgba(80,220,140,0.08); }
.fba-wc-pill.warn { color: var(--orange, #f0a500); border-color: rgba(240,165,0,0.3); background: rgba(240,165,0,0.08); }
.fba-wc-pill.bad { color: var(--red); border-color: rgba(255,100,100,0.3); background: rgba(255,100,100,0.08); }

/* Stat row inside wc cards */
.fba-wc-stat-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  border-top: 1px solid rgba(255,255,255,0.06);
  margin-top: 0.5rem;
}
.fba-wc-stat {
  padding: 0.72rem 0.68rem 0.62rem;
  border-right: 1px solid rgba(255,255,255,0.05);
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}
.fba-wc-stat:last-child { border-right: 0; }
.fba-wc-stat-val {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.1;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.fba-wc-stat-val.ok { color: var(--green); }
.fba-wc-stat-val.warn { color: var(--orange, #f0a500); }
.fba-wc-stat-val.bad { color: var(--red); }
.fba-wc-stat-lbl {
  font-size: 0.58rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 500;
}

/* Focus chip row (secondary urgent SKUs in Action Center) */
.fba-wc-focus-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.8rem;
}
.fba-wc-focus-chip {
  font-size: 0.62rem;
  color: var(--muted);
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.07);
  padding: 0.3rem 0.6rem;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s;
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.fba-wc-focus-chip:hover {
  background: rgba(255,255,255,0.07);
  color: var(--text);
  border-color: rgba(255,255,255,0.12);
}
.fba-wc-note {
  font-size: 0.6rem;
  color: var(--muted);
  padding: 0.5rem 0 0;
  font-family: var(--font-mono);
}

/* KPI cards clickable */
.kpi.kpi-clickable {
  cursor: pointer;
  border: 1px solid rgba(255,255,255,0.08);
  transition: transform 0.15s, border-color 0.15s, box-shadow 0.15s;
  text-align: left;
  font: inherit;
  color: inherit;
}
.kpi.kpi-clickable:hover {
  transform: translateY(-1px);
  border-color: rgba(255,255,255,0.18);
  box-shadow: 0 6px 18px -8px rgba(0,0,0,0.5);
}
.kpi.kpi-clickable.active {
  border-color: var(--accent, var(--gold));
  box-shadow: 0 0 0 1px var(--accent, var(--gold)), 0 6px 18px -8px rgba(0,0,0,0.5);
}

/* Unified section chevron + collapse */
.fba-section-chevron {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  flex-shrink: 0;
}
.fba-section-chevron:hover {
  background: rgba(255,255,255,0.09);
  color: var(--text);
  border-color: rgba(255,255,255,0.16);
}
.fba-wc-head-right {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  flex-shrink: 0;
}

/* When collapsed: hide everything in card except the title / head bar */
.card.fba-collapse-host.card-collapsed > *:not(.card-title),
.fba-wc-card.fba-collapse-host.card-collapsed > *:not(.fba-wc-head) {
  display: none !important;
}
.card.fba-collapse-host.card-collapsed { padding-bottom: 0.75rem; }
.fba-wc-card.fba-collapse-host.card-collapsed { padding-bottom: 1rem; }

.procurement-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(280px, 0.9fr);
  gap: 1rem;
  margin-bottom: 1rem;
}

.procurement-form {
  display: grid;
  gap: 0.9rem;
}

.procurement-section {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.95rem;
  background: rgba(255,255,255,0.018);
}

.procurement-section-head {
  display: flex;
  justify-content: space-between;
  gap: 0.8rem;
  align-items: flex-start;
  margin-bottom: 0.8rem;
}

.procurement-section-title {
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 700;
}

.procurement-section-sub {
  margin-top: 0.18rem;
  color: var(--muted);
  font-size: 0.68rem;
  line-height: 1.45;
}

.procurement-import-section {
  background:
    linear-gradient(180deg, rgba(62,205,196,0.08), rgba(62,205,196,0.02)),
    rgba(255,255,255,0.015);
  border-color: rgba(62,205,196,0.2);
}

.procurement-import-grid {
  display: grid;
  grid-template-columns: minmax(240px, 0.95fr) minmax(0, 1.15fr);
  gap: 0.85rem;
  align-items: stretch;
}

.procurement-import-actions {
  justify-content: flex-end;
}

.procurement-dropzone {
  display: grid;
  gap: 0.35rem;
  align-content: start;
  min-height: 152px;
  padding: 0.95rem;
  border: 1px dashed rgba(62,205,196,0.28);
  border-radius: 12px;
  background: rgba(7,18,24,0.34);
}

.procurement-dropzone-title {
  color: var(--text);
  font-size: 0.8rem;
  font-weight: 600;
}

.procurement-dropzone-sub {
  color: var(--muted);
  font-size: 0.67rem;
  line-height: 1.45;
}

.procurement-dropzone input[type="file"] {
  margin-top: 0.45rem;
}

.procurement-import-side {
  display: grid;
  gap: 0.7rem;
}

.procurement-import-status {
  min-height: 40px;
  padding: 0.72rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(255,255,255,0.02);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.66rem;
  line-height: 1.45;
}

.procurement-import-summary {
  min-height: 96px;
  padding: 0.85rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(255,255,255,0.02);
}

.procurement-import-summary.is-empty {
  display: grid;
  place-items: center;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.64rem;
}

.procurement-import-summary-top {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
  margin-bottom: 0.6rem;
}

.procurement-import-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.22rem 0.48rem;
  border-radius: 999px;
  border: 1px solid rgba(62,205,196,0.18);
  background: rgba(62,205,196,0.08);
  color: var(--teal);
  font-family: var(--font-mono);
  font-size: 0.58rem;
}

.procurement-import-list {
  margin: 0;
  padding-left: 1rem;
  color: var(--text2);
  font-size: 0.68rem;
  line-height: 1.5;
}

.procurement-import-list li + li {
  margin-top: 0.22rem;
}

.procurement-line-editor {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.9rem;
  background: rgba(255,255,255,0.015);
}

.procurement-form-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
}

.procurement-field {
  display: grid;
  gap: 0.32rem;
}

.procurement-field span {
  font-family: var(--font-mono);
  font-size: 0.61rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.procurement-field input,
.procurement-field select,
.procurement-field textarea,
.procurement-toolbar input,
.procurement-toolbar select {
  width: 100%;
  background: var(--s2);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 8px;
  padding: 0.56rem 0.7rem;
  font-family: var(--font-sans);
  font-size: 0.75rem;
}

.procurement-field textarea {
  resize: vertical;
  min-height: 88px;
}

.procurement-field-wide {
  grid-column: span 2;
}

.procurement-form-actions,
.procurement-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  align-items: center;
}

.procurement-toolbar {
  margin-bottom: 0.85rem;
}

.procurement-line-table-wrap {
  max-height: none;
}

.procurement-line-table,
.procurement-order-lines-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

.procurement-inline-input {
  width: 100%;
  min-width: 0;
  background: var(--s2);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 8px;
  padding: 0.45rem 0.55rem;
  font-size: 0.7rem;
}

.procurement-inline-input[readonly] {
  background: rgba(255,255,255,0.03);
  color: var(--text2);
}

.procurement-toolbar input {
  flex: 1 1 260px;
}

.procurement-toolbar select {
  flex: 0 0 auto;
  min-width: 150px;
}

.procurement-empty,
.procurement-empty-row {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.68rem;
}

.procurement-empty-row {
  padding: 1rem 0.75rem !important;
  text-align: center;
}

.procurement-supplier-card {
  background: linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0.01));
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.8rem 0.9rem;
}

.procurement-supplier-card + .procurement-supplier-card {
  margin-top: 0.75rem;
}

.procurement-mini-note {
  margin-top: 0.85rem;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.62rem;
  line-height: 1.55;
}

.procurement-supplier-top,
.procurement-supplier-meta,
.procurement-cell-stack {
  display: flex;
  justify-content: space-between;
  gap: 0.6rem;
}

.procurement-cell-stack {
  flex-direction: column;
  gap: 0.18rem;
}

.procurement-cell-stack span,
.procurement-supplier-top span,
.procurement-supplier-meta span {
  color: var(--muted);
  font-size: 0.66rem;
}

.procurement-supplier-money {
  margin: 0.42rem 0 0.22rem;
  color: var(--gold);
  font-family: var(--font-mono);
  font-size: 1rem;
  font-weight: 600;
}

.procurement-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.22rem 0.52rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 0.6rem;
  line-height: 1.1;
}

.procurement-pill-pending,
.procurement-pill-ordered {
  color: var(--gold);
  background: rgba(233,187,58,0.08);
  border-color: rgba(233,187,58,0.22);
}

.procurement-pill-partial,
.procurement-pill-shipped {
  color: var(--teal);
  background: rgba(62,205,196,0.08);
  border-color: rgba(62,205,196,0.22);
}

.procurement-pill-paid,
.procurement-pill-received {
  color: var(--green);
  background: rgba(69,217,124,0.08);
  border-color: rgba(69,217,124,0.22);
}

.procurement-link {
  color: var(--teal);
  text-decoration: none;
  border-bottom: 1px dotted rgba(62,205,196,0.3);
}

.procurement-link:hover {
  color: var(--text);
  border-bottom-color: rgba(62,205,196,0.6);
}

.procurement-note {
  max-width: 280px;
  color: var(--text2);
  white-space: normal;
}

.procurement-line-photo,
.procurement-order-line-photo {
  width: 58px;
  height: 58px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--s2);
  display: flex;
  align-items: center;
  justify-content: center;
}

.procurement-line-photo-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #fff;
}

.procurement-line-photo-fallback {
  padding: 0.35rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.54rem;
  line-height: 1.25;
}

.procurement-row-btn {
  width: 100%;
  min-width: 0;
}

.procurement-line-remove {
  width: 34px;
  height: 34px;
  padding: 0;
}

.procurement-orders-list {
  display: grid;
  gap: 0.85rem;
}

.procurement-order-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.95rem 1rem;
  background: linear-gradient(180deg, rgba(255,255,255,0.015), rgba(255,255,255,0.005));
}

.procurement-order-card.is-expanded {
  border-color: rgba(62,205,196,0.22);
  box-shadow: 0 12px 28px rgba(0,0,0,0.18);
}

.procurement-order-head,
.procurement-order-actions,
.procurement-order-title-row,
.procurement-order-metrics {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.procurement-order-head {
  justify-content: space-between;
  flex-wrap: wrap;
}

.procurement-order-main {
  display: grid;
  gap: 0.22rem;
}

.procurement-order-title-row strong {
  font-size: 0.95rem;
}

.procurement-order-sub {
  color: var(--muted);
  font-size: 0.68rem;
}

.procurement-order-metrics {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.procurement-order-metrics > div,
.procurement-order-meta {
  min-width: 110px;
  display: grid;
  gap: 0.15rem;
}

.procurement-order-metrics span,
.procurement-order-meta span {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.58rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.procurement-order-metrics strong,
.procurement-order-meta strong {
  color: var(--text);
  font-size: 0.74rem;
}

.procurement-order-actions {
  margin-top: 0.8rem;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.procurement-action-btn {
  min-width: 110px;
}

.procurement-action-placeholder {
  color: var(--muted);
  font-size: 0.68rem;
  padding: 0.35rem 0.15rem;
}

.procurement-order-body {
  margin-top: 0.95rem;
  display: grid;
  gap: 0.95rem;
}

.procurement-order-meta-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.7rem;
}

.procurement-order-meta {
  padding: 0.7rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(255,255,255,0.02);
}

.procurement-order-meta-wide {
  grid-column: span 2;
}

.procurement-order-lines-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 10px;
}

.procurement-order-lines-table th,
.procurement-order-lines-table td,
.procurement-line-table th,
.procurement-line-table td {
  padding: 0.62rem 0.55rem;
  border-bottom: 1px solid var(--border2);
  vertical-align: middle;
}

.procurement-preview-shell {
  width: min(1000px, 92vw);
}

.procurement-preview-body {
  min-height: 70vh;
  display: flex;
  align-items: stretch;
  justify-content: center;
}

.procurement-preview-frame {
  width: 100%;
  min-height: 70vh;
  border: none;
  border-radius: 10px;
  background: #fff;
}

.procurement-preview-image {
  max-width: 100%;
  max-height: 72vh;
  object-fit: contain;
  border-radius: 10px;
  background: #fff;
}

@media (max-width: 1280px) {
  .procurement-grid {
    grid-template-columns: 1fr;
  }

  .procurement-import-grid,
  .procurement-form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .procurement-order-meta-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .procurement-import-grid,
  .procurement-form-grid {
    grid-template-columns: 1fr;
  }

  .procurement-field-wide {
    grid-column: span 1;
  }

  .procurement-section-head {
    flex-direction: column;
  }

  .procurement-import-actions {
    width: 100%;
    justify-content: stretch;
  }

  .procurement-import-actions .btn {
    flex: 1 1 100%;
  }

  .procurement-toolbar select,
  .procurement-toolbar input {
    min-width: 0;
    width: 100%;
    flex: 1 1 100%;
  }

  .procurement-order-meta-grid {
    grid-template-columns: 1fr;
  }

  .procurement-order-meta-wide {
    grid-column: span 1;
  }
}

/* ═══════════════════════════════════════════════════════════════
   RECOMMENDATION CARD — proper layout (no more concatenated text)
═══════════════════════════════════════════════════════════════ */
.fba-plan-signal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 0.55rem;
  margin: 0.85rem 0 0.65rem;
}
.fba-plan-signal {
  background: rgba(255,255,255,0.025);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 8px;
  padding: 0.55rem 0.7rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
}
.fba-plan-signal span {
  font-size: 0.56rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 500;
}
.fba-plan-signal strong {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.1;
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
}
.fba-plan-signal.ok strong { color: var(--green); }
.fba-plan-signal.warn strong { color: var(--orange, #f0a500); }
.fba-plan-signal.danger strong { color: var(--red); }

.fba-plan-action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0.4rem 0 0.15rem;
}
.fba-plan-action-chip {
  font-size: 0.6rem;
  padding: 0.28rem 0.6rem;
  border-radius: 999px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.07);
  color: var(--muted);
  font-weight: 500;
  letter-spacing: 0.01em;
  white-space: nowrap;
}
.fba-plan-action-chip.score {
  background: rgba(212,168,67,0.1);
  color: var(--gold);
  border-color: rgba(212,168,67,0.3);
  font-weight: 600;
}
.fba-plan-action-chip.ok {
  background: rgba(80,220,140,0.1);
  color: var(--green);
  border-color: rgba(80,220,140,0.25);
}
.fba-plan-action-chip.warn {
  background: rgba(240,165,0,0.1);
  color: var(--orange, #f0a500);
  border-color: rgba(240,165,0,0.25);
}

/* Card layout upgrades */
.fba-plan-card {
  padding: 1rem 1rem 0.95rem;
  border-radius: 18px;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}
.fba-plan-card:hover {
  border-color: rgba(255,255,255,0.14);
  box-shadow: 0 10px 22px -14px rgba(0,0,0,0.65);
  transform: translateY(-1px);
}
.fba-plan-head-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  flex-shrink: 0;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.fba-plan-toggle {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 999px;
  color: var(--muted);
  padding: 0.28rem 0.38rem 0.28rem 0.72rem;
  font-size: 0.6rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}
.fba-plan-toggle:hover { background: rgba(255,255,255,0.09); color: var(--text); border-color: rgba(255,255,255,0.14); }
.fba-plan-toggle-icon {
  width: 1.15rem;
  height: 1.15rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.08);
  color: var(--text);
  font-size: 0.85rem;
  line-height: 1;
}
.fba-badge {
  font-size: 0.55rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  padding: 0.22rem 0.6rem;
  border-radius: 999px;
  text-transform: uppercase;
  white-space: nowrap;
}
.fba-badge-urgent { background: rgba(255,100,100,0.12); color: var(--red); border: 1px solid rgba(255,100,100,0.28); }
.fba-badge-soon { background: rgba(240,165,0,0.12); color: var(--orange, #f0a500); border: 1px solid rgba(240,165,0,0.28); }
.fba-badge-healthy { background: rgba(80,220,140,0.12); color: var(--green); border: 1px solid rgba(80,220,140,0.28); }
.fba-badge-inactive { background: rgba(255,255,255,0.04); color: var(--muted); border: 1px solid rgba(255,255,255,0.08); }

.fba-plan-details {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 0.2s ease, opacity 0.2s ease;
}
.fba-plan-details.expanded {
  max-height: 2000px;
  opacity: 1;
  margin-top: 0.45rem;
  padding-top: 0.8rem;
  border-top: 1px solid rgba(255,255,255,0.06);
}
.fba-plan-cost-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 0.4rem 0.9rem;
  font-size: 0.65rem;
  color: var(--muted);
  margin-top: 0.6rem;
}
.fba-plan-cost-grid strong {
  color: var(--text);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* Restore grid for recommendation card grid */
#fba-plan-cards {
  display: block;
  margin-top: 0.75rem;
  padding: 0;
  background: transparent;
}
.fba-plan-stack {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.fba-plan-card {
  background: linear-gradient(145deg, rgba(255,255,255,0.025), rgba(255,255,255,0.01));
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 18px;
  padding: 1rem 1.05rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.05),
    0 0 0 1px rgba(255,255,255,0.03),
    0 12px 28px -20px rgba(0,0,0,0.85);
}
.fba-plan-card .fba-plan-head {
  flex-wrap: nowrap;
}
.fba-plan-card .fba-plan-name {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.005em;
}
.fba-plan-card .fba-plan-meta {
  margin-top: 0.15rem;
}
.fba-plan-toolbar {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  padding: 1rem 1.05rem;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(233,187,58,0.06), transparent 30%),
    linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0.01));
  box-shadow: 0 1px 0 rgba(255,255,255,0.04) inset;
}
.fba-plan-toolbar-main {
  display: grid;
  grid-template-columns: minmax(220px, 1.6fr) minmax(180px, 0.7fr) auto;
  gap: 0.75rem;
  align-items: center;
}
.fba-plan-search,
.fba-plan-select {
  width: 100%;
  min-width: 0;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.045);
  color: var(--text);
  padding: 0.78rem 0.95rem;
  font: inherit;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
}
.fba-plan-search::placeholder {
  color: var(--muted);
}
.fba-plan-search:focus,
.fba-plan-select:focus {
  outline: none;
  border-color: rgba(233,187,58,0.45);
  box-shadow: 0 0 0 3px rgba(233,187,58,0.1);
}
.fba-plan-select {
  appearance: none;
  -webkit-appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 18px) calc(50% - 3px), calc(100% - 12px) calc(50% - 3px);
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
  padding-right: 2.2rem;
}
.fba-plan-toolbar .fba-action-btn {
  min-height: 46px;
  padding: 0.78rem 1rem;
  border-radius: 14px;
  font-size: 0.68rem;
  letter-spacing: 0.03em;
  background: rgba(255,255,255,0.035);
  border-color: rgba(255,255,255,0.08);
  color: var(--text2);
}
.fba-plan-toolbar .fba-action-btn:hover {
  color: var(--text);
  border-color: rgba(255,255,255,0.14);
  background: rgba(255,255,255,0.06);
}
.fba-plan-quickviews {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}
.fba-plan-quickview {
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.03);
  color: var(--text2);
  border-radius: 999px;
  padding: 0.45rem 0.8rem;
  font-size: 0.66rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}
.fba-plan-quickview:hover {
  color: var(--text);
  border-color: rgba(255,255,255,0.14);
  background: rgba(255,255,255,0.06);
}
.fba-plan-quickview.active {
  color: var(--text);
  border-color: rgba(233,187,58,0.32);
  background: linear-gradient(135deg, rgba(233,187,58,0.22), rgba(233,187,58,0.08));
  box-shadow: 0 0 0 1px rgba(233,187,58,0.16) inset;
}
.fba-plan-toolbar-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}
.fba-plan-summary-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.4rem 0.7rem;
  border-radius: 999px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  color: var(--muted);
  font-size: 0.62rem;
  letter-spacing: 0.03em;
}
.fba-plan-summary-pill.ok {
  color: var(--green);
  border-color: rgba(80,220,140,0.24);
  background: rgba(80,220,140,0.08);
}
.fba-plan-summary-pill.warn {
  color: var(--orange);
  border-color: rgba(240,165,0,0.26);
  background: rgba(240,165,0,0.08);
}
.fba-plan-empty {
  padding: 1.25rem;
  border-radius: 18px;
  border: 1px dashed rgba(255,255,255,0.12);
  color: var(--muted);
  background: rgba(255,255,255,0.02);
}
.fba-plan-justification {
  font-family: var(--font-mono);
  font-size: 0.56rem;
  line-height: 1.5;
  color: var(--muted);
  padding-top: 0.15rem;
}
@media (max-width: 1280px) {
  .fba-plan-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 980px) {
  .fba-plan-toolbar-main {
    grid-template-columns: 1fr;
  }
  .fba-plan-card .fba-plan-head {
    flex-wrap: wrap;
  }
  .fba-wc-stat-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 720px) {
  .fba-plan-grid {
    grid-template-columns: 1fr;
  }
  .fba-plan-search,
  .fba-plan-select {
    padding: 0.72rem 0.85rem;
  }
  .fba-wc-stat-row {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 768px) {
  .settings-ai-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .settings-ai-actions .btn {
    min-width: 0;
  }
}

@media (max-width: 720px) {
  .settings-ai-grid {
    grid-template-columns: 1fr;
  }
  .settings-ai-field-wide {
    grid-column: span 1;
  }
  .settings-ai-actions .btn {
    flex: 1 1 100%;
  }
}
.fba-ledger-admin-tools {
  margin-top: .55rem;
  color: var(--muted);
  font-size: .72rem;
}
.fba-ledger-admin-tools summary {
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  user-select: none;
}
.fba-ledger-admin-tools[open] .fba-ledger-toolbar {
  margin-top: .55rem;
}
.fba-ledger-edit-btn:disabled {
  cursor: not-allowed;
  opacity: .55;
}

/* ════════════════════════════════════════════════════════════
   MONTHLY COMMAND CENTER
   ════════════════════════════════════════════════════════════ */
.cc-panel { padding-top: 0 !important; }

/* Context bar */
.cc-bar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  background: var(--bg); border-bottom: 1px solid var(--border);
  padding: 10px 2rem; margin: 0 -2rem 1.5rem;
}
.cc-brand {
  font-family: var(--font-mono); font-size: 10px; font-weight: 700;
  letter-spacing: .12em; text-transform: uppercase; color: var(--teal);
}
.cc-sep { width: 1px; height: 18px; background: var(--border); flex-shrink: 0; }
.cc-spacer { flex: 1; }
.cc-month-nav {
  display: flex; align-items: center;
  background: var(--s2); border: 1px solid var(--border); border-radius: var(--r-sm); overflow: hidden;
}
.cc-month-nav button {
  background: none; border: none; color: var(--text2); cursor: pointer;
  padding: 5px 11px; font-size: 13px; font-weight: 700; transition: background .15s;
}
.cc-month-nav button:hover { background: var(--s3); }
#cc-month-label {
  padding: 5px 14px; font-family: var(--font-mono); font-size: 13px;
  font-weight: 700; color: var(--text);
  border-left: 1px solid var(--border); border-right: 1px solid var(--border); white-space: nowrap;
}
.cc-tg {
  display: flex; background: var(--s2); border: 1px solid var(--border);
  border-radius: var(--r-sm); overflow: hidden;
}
.cc-tg button {
  background: none; border: none; color: var(--text2); cursor: pointer;
  padding: 5px 13px; font-size: 11px; font-weight: 700; letter-spacing: .04em;
  text-transform: uppercase; transition: background .15s, color .15s; white-space: nowrap;
}
.cc-tg button.active { background: var(--s3); color: var(--text); }
.cc-tg button.cc-ksa.active { background: var(--gold); color: #07080d; }
.cc-tg button.cc-uae.active { background: var(--purple); color: #fff; }
.cc-freshness { font-family: var(--font-mono); font-size: 10px; color: var(--muted); white-space: nowrap; }
.cc-freshness span { color: var(--green); }
.cc-reset-btn {
  background: none; border: 1px solid var(--border); border-radius: var(--r-sm);
  color: var(--muted); font-size: 11px; font-weight: 600; padding: 5px 10px;
  cursor: pointer; font-family: var(--font-sans); transition: color .15s, border-color .15s;
}
.cc-reset-btn:hover { color: var(--text); border-color: var(--text2); }

/* Section labels */
.cc-section-label {
  font-family: var(--font-mono); font-size: 9.5px; font-weight: 700;
  letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-bottom: 10px;
}

/* AI Pulse */
.cc-ai-pulse {
  display: flex; gap: 12px; align-items: flex-start;
  background: linear-gradient(135deg, rgba(157,126,245,.05) 0%, rgba(62,205,196,.03) 100%);
  border: 1px solid rgba(157,126,245,.2); border-radius: var(--r-md);
  padding: 14px 18px; margin-bottom: 18px;
}
.cc-ai-orb {
  width: 32px; height: 32px; border-radius: 50%; flex-shrink: 0;
  background: radial-gradient(circle at 38% 35%, var(--purple), var(--teal));
  box-shadow: 0 0 14px rgba(157,126,245,.3);
  display: flex; align-items: center; justify-content: center; font-size: 15px;
}
.cc-ai-body { flex: 1; min-width: 0; }
.cc-ai-label {
  font-family: var(--font-mono); font-size: 10px; font-weight: 700;
  letter-spacing: .1em; text-transform: uppercase; color: var(--purple); margin-bottom: 5px;
}
.cc-ai-text { font-size: 13px; color: var(--text2); line-height: 1.6; }
.cc-ai-text strong { color: var(--text); }
.cc-ai-text .cc-ai-warn { color: var(--orange); font-weight: 600; }
.cc-ai-refresh {
  background: none; border: none; color: var(--purple); cursor: pointer;
  font-size: 11px; opacity: .7; margin-left: 6px; font-family: var(--font-mono);
}
.cc-ai-refresh:hover { opacity: 1; }

/* KPI Grid */
.cc-kpi-grid {
  display: grid; grid-template-columns: repeat(6,1fr); gap: 10px; margin-bottom: 20px;
}
@media (max-width: 1100px) { .cc-kpi-grid { grid-template-columns: repeat(3,1fr); } }
@media (max-width: 560px)  { .cc-kpi-grid { grid-template-columns: repeat(2,1fr); } }
.cc-kpi {
  background: var(--s1); border: 1px solid var(--border); border-radius: var(--r-md);
  padding: 14px 16px; position: relative; overflow: hidden; transition: border-color .2s;
}
.cc-kpi.cc-kpi-click { cursor: pointer; }
.cc-kpi.cc-kpi-click:hover { border-color: var(--teal); }
.cc-kpi.cc-kpi-risk  { border-color: rgba(248,150,60,.22); }
.cc-kpi.cc-kpi-risk:hover { border-color: var(--orange); }
.cc-kpi.cc-kpi-proj  { border-color: rgba(62,205,196,.18); }
.cc-kpi-lbl {
  font-family: var(--font-mono); font-size: 9.5px; font-weight: 700;
  letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px;
}
.cc-kpi-val {
  font-family: var(--font-mono); font-size: 1.45rem; font-weight: 600;
  line-height: 1.05; letter-spacing: -.025em; font-variant-numeric: tabular-nums; color: var(--text);
}
.cc-kpi-delta { font-family: var(--font-mono); font-size: 11px; margin-top: 5px; font-weight: 600; }
.cc-kpi-note  { font-size: 10px; color: var(--muted); margin-top: 3px; font-style: italic; }
.cc-delta-up  { color: var(--green); }
.cc-delta-dn  { color: var(--red); }
.cc-delta-neu { color: var(--muted); }
.cc-risk-pill {
  display: inline-block; background: rgba(248,150,60,.12); color: var(--orange);
  font-size: 9.5px; font-weight: 700; padding: 2px 7px; border-radius: 10px;
  letter-spacing: .04em; margin-top: 5px;
}
.cc-spark { display: flex; align-items: flex-end; gap: 2px; height: 22px; margin-top: 7px; }
.cc-spark span {
  flex: 1; border-radius: 2px 2px 0 0; min-height: 3px;
  background: var(--teal); opacity: .3;
}
.cc-spark span:last-child { opacity: 1; }

/* Signals */
.cc-signals {
  display: grid; grid-template-columns: repeat(auto-fill,minmax(210px,1fr));
  gap: 10px; margin-bottom: 20px;
}
.cc-signal {
  background: var(--s1); border: 1px solid var(--border); border-radius: var(--r-md);
  padding: 12px 14px; display: flex; gap: 10px; align-items: flex-start; transition: background .2s;
}
.cc-signal:hover { background: var(--s2); }
.cc-signal.cc-sig-fire  { border-color: rgba(62,205,196,.22); }
.cc-signal.cc-sig-warn  { border-color: rgba(248,150,60,.25); }
.cc-signal.cc-sig-dead  { border-color: rgba(244,112,112,.2); }
.cc-signal.cc-sig-tip   { border-color: rgba(157,126,245,.22); }
.cc-signal.cc-sig-stall { border-color: rgba(138,147,173,.15); }
.cc-sig-icon  { font-size: 18px; flex-shrink: 0; line-height: 1; margin-top: 1px; }
.cc-sig-body  { flex: 1; min-width: 0; }
.cc-sig-title { font-size: 12px; font-weight: 700; color: var(--text); line-height: 1.3; margin-bottom: 3px; }
.cc-sig-sub   { font-size: 11px; color: var(--text2); line-height: 1.4; }
.cc-sig-acts  { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.cc-sig-btn {
  font-size: 10px; font-weight: 700; padding: 3px 9px; border-radius: 5px;
  border: 1px solid var(--border); background: var(--s2); color: var(--text2);
  cursor: pointer; font-family: var(--font-sans); letter-spacing: .02em; transition: all .15s;
}
.cc-sig-btn:hover  { border-color: var(--teal); color: var(--teal); }
.cc-sig-btn.cc-ai  { border-color: rgba(157,126,245,.35); color: var(--purple); }
.cc-sig-btn.cc-ai:hover { background: rgba(157,126,245,.08); }
.cc-sig-btn.cc-urgent { border-color: rgba(248,150,60,.4); color: var(--orange); }
.cc-sig-btn.cc-urgent:hover { background: rgba(248,150,60,.08); }
.cc-sig-ai-out {
  margin-top: 8px; padding: 8px 10px;
  background: var(--s2); border-radius: 6px;
  font-size: 11.5px; color: var(--text2); line-height: 1.55;
  display: none; white-space: pre-wrap;
}

/* Chart card */
.cc-chart-card {
  background: var(--s1); border: 1px solid var(--border); border-radius: var(--r-md);
  padding: 18px 20px; margin-bottom: 14px;
}
.cc-chart-hdr {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 14px; flex-wrap: wrap; gap: 8px;
}
.cc-chart-title { font-size: 13px; font-weight: 700; color: var(--text); }
.cc-chart-ctrls { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cc-metric-tg button { font-size: 10.5px; }
.cc-metric-tg button.active { background: var(--s3); color: var(--text); }
.cc-prod-wrap { position: relative; }
.cc-prod-btn {
  display: flex; align-items: center; gap: 5px;
  background: var(--s2); border: 1px solid var(--border); border-radius: var(--r-sm);
  padding: 5px 11px; font-size: 11px; font-weight: 700; color: var(--text2);
  cursor: pointer; font-family: var(--font-sans); transition: border-color .15s; white-space: nowrap;
}
.cc-prod-btn:hover { border-color: var(--teal); }
.cc-prod-menu {
  position: absolute; top: calc(100% + 6px); right: 0; z-index: 99; min-width: 220px;
  background: var(--s2); border: 1px solid var(--border); border-radius: var(--r-md);
  padding: 8px 0; box-shadow: var(--shadow-md); max-height: 260px; overflow-y: auto;
}
.cc-prod-item {
  display: flex; align-items: center; gap: 8px; padding: 6px 14px;
  font-size: 12px; cursor: pointer; color: var(--text2); transition: background .12s; user-select: none;
}
.cc-prod-item:hover { background: var(--s3); color: var(--text); }
.cc-prod-item input[type=checkbox] { flex-shrink: 0; accent-color: var(--teal); cursor: pointer; }
.cc-chart-leg { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 10px; }
.cc-leg { display: flex; align-items: center; gap: 5px; font-size: 11px; color: var(--text2); }
.cc-leg-dot  { width: 8px; height: 8px; border-radius: 2px; flex-shrink: 0; }
.cc-leg-line { width: 16px; height: 0; border-top: 2px dashed var(--teal); flex-shrink: 0; }
.cc-chart-hint { margin-left: auto; font-size: 10px; color: var(--muted); }

/* Product table */
.cc-table-card {
  background: var(--s1); border: 1px solid var(--border); border-radius: var(--r-md);
  overflow: hidden; margin-bottom: 14px;
}
.cc-table-hdr {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px 12px; border-bottom: 1px solid var(--border2); flex-wrap: wrap; gap: 8px;
}
.cc-table-title { font-size: 13px; font-weight: 700; color: var(--text); }
.cc-table-sub   { font-size: 11px; color: var(--muted); margin-top: 2px; }
.cc-table { width: 100%; border-collapse: collapse; font-size: 11.5px; min-width: 840px; }
.cc-table th {
  padding: 8px 12px; text-align: left;
  font-family: var(--font-mono); font-size: 9.5px; font-weight: 700;
  letter-spacing: .08em; text-transform: uppercase; color: var(--muted);
  border-bottom: 1px solid var(--border2); white-space: nowrap;
}
.cc-table th.cc-th-sort { cursor: pointer; }
.cc-table th.cc-th-sort:hover { color: var(--text2); }
.cc-table th.cc-sorted { color: var(--teal); }
.cc-table td {
  padding: 9px 12px; border-bottom: 1px solid var(--border2); color: var(--text);
  font-family: var(--font-mono); font-variant-numeric: tabular-nums; white-space: nowrap;
  vertical-align: middle;
}
.cc-table tr:last-child td { border-bottom: none; }
.cc-table tr:hover td { background: var(--s2); }
.cc-table td.cc-td-name { font-family: var(--font-sans); font-weight: 600; font-size: 12px; max-width: 180px; overflow: hidden; text-overflow: ellipsis; }
.cc-mkt-ksa { color: var(--gold);   font-weight: 700; font-family: var(--font-mono); font-size: 11px; }
.cc-mkt-uae { color: var(--purple); font-weight: 700; font-family: var(--font-mono); font-size: 11px; }
.cc-hi  { color: var(--green); }
.cc-mid { color: var(--gold); }
.cc-lo  { color: var(--red); }
.cc-warn-txt { color: var(--orange); font-weight: 700; }
.cc-unknown  { color: var(--muted); font-style: italic; }
.cc-status {
  display: inline-flex; align-items: center; gap: 3px; font-size: 9.5px; font-weight: 700;
  padding: 2px 7px; border-radius: 10px; letter-spacing: .03em; font-family: var(--font-sans);
}
.cc-st-momentum    { background: rgba(69,217,124,.12);  color: var(--green); }
.cc-st-fading      { background: rgba(244,112,112,.12); color: var(--red); }
.cc-st-restock     { background: rgba(248,150,60,.12);  color: var(--orange); }
.cc-st-opportunity { background: rgba(157,126,245,.12); color: var(--purple); }
.cc-st-stalled     { background: rgba(138,147,173,.1);  color: var(--muted); }
.cc-st-fbm         { background: rgba(62,205,196,.08);  color: var(--teal); }
.cc-ai-prod-btn {
  font-size: 10px; font-weight: 700; padding: 3px 8px; border-radius: 5px;
  border: 1px solid rgba(157,126,245,.3); background: none; color: var(--purple);
  cursor: pointer; font-family: var(--font-sans); transition: all .15s; white-space: nowrap;
}


/* Review card */
.cc-review-card {
  background: var(--s1); border: 1px solid var(--border); border-radius: var(--r-md);
  padding: 18px 20px; margin-bottom: 14px;
}
.cc-review-hdr {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px; flex-wrap: wrap; gap: 8px;
}
.cc-review-title  { font-size: 13px; font-weight: 700; color: var(--text); }
.cc-review-saved  { font-family: var(--font-mono); font-size: 11px; color: var(--green); font-weight: 600; }
.cc-review-fields { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
@media (max-width: 700px) { .cc-review-fields { grid-template-columns: 1fr; } }
@media (max-width: 900px) {
  .cc-bar { margin: 0 -0.75rem 1.5rem; padding-left: 0.75rem; padding-right: 0.75rem; }
}
.cc-field-lbl {
  font-family: var(--font-mono); font-size: 9.5px; font-weight: 700;
  letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px;
}
.cc-field-ta {
  width: 100%; min-height: 72px; resize: vertical;
  background: var(--s2); border: 1px solid var(--border); border-radius: var(--r-sm);
  color: var(--text); font-family: var(--font-sans); font-size: 12.5px; line-height: 1.55;
  padding: 9px 12px; outline: none; box-sizing: border-box; transition: border-color .2s;
}
.cc-field-ta:focus { border-color: var(--gold); }
.cc-review-updated { font-family: var(--font-mono); font-size: 10px; color: var(--muted); margin-top: 10px; }

/* AI output inside signal or product row */
.cc-ai-inline-out {
  margin-top: 8px; padding: 8px 10px; background: var(--s2); border-radius: 6px;
  font-size: 11.5px; color: var(--text2); line-height: 1.55;
  white-space: pre-wrap; display: none;
}
.cc-ai-text .cc-ai-good { color: var(--green); font-weight: 600; }

/* Per-product AI button in table */

.cc-ai-prod-btn:hover   { background: rgba(157,126,245,.1); border-color: var(--purple); }
.cc-ai-prod-btn:disabled { opacity: .45; cursor: wait; }
.cc-prod-ai-row td { border-top: none !important; }
