/* ═══════════════════════════════════════════════════════════════
   DAR Media — Design System v4.0 "Glass"
   Apple visionOS + Starlink inspired
   ═══════════════════════════════════════════════════════════════ */

/* ── Reset ── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

/* ── Design Tokens ── */
:root {
  /* Background — Deep with subtle warmth */
  --bg-deep:    #000000;
  --bg:         #050505;
  --bg-raised:  #0a0a0a;
  --bg-surface: rgba(255,255,255,0.04);
  --bg-card:    rgba(255,255,255,0.05);
  --bg-hover:   rgba(255,255,255,0.08);

  /* Glass — The core of the design */
  --glass:         rgba(255,255,255,0.06);
  --glass-strong:  rgba(255,255,255,0.10);
  --glass-hover:   rgba(255,255,255,0.09);
  --glass-border:  rgba(255,255,255,0.08);
  --glass-blur:    20px;

  /* Border — Almost invisible */
  --border:        rgba(255,255,255,0.07);
  --border-subtle: rgba(255,255,255,0.04);
  --border-focus:  rgba(255,255,255,0.25);

  /* Text — Clean white hierarchy */
  --text:          rgba(255,255,255,0.95);
  --text-secondary: rgba(255,255,255,0.55);
  --text-muted:    rgba(255,255,255,0.35);
  --text-dim:      rgba(255,255,255,0.20);
  --text-faint:    rgba(255,255,255,0.12);

  /* Accent — Soft sky blue */
  --accent:       #38bdf8;
  --accent-hover: #7dd3fc;
  --accent-dim:   rgba(56,189,248,0.12);
  --accent-glow:  rgba(56,189,248,0.08);

  /* Legacy compat */
  --teal:     #38bdf8;
  --teal-dim: rgba(56,189,248,0.08);

  /* Semantic — Soft, pastel-ish */
  --emerald:  #34d399;
  --amber:    #fbbf24;
  --red:      #fb7185;
  --violet:   #a78bfa;
  --blue:     #60a5fa;
  --pink:     #f472b6;

  --success:    #34d399;
  --success-bg: rgba(52,211,153,0.10);
  --warning:    #fbbf24;
  --warning-bg: rgba(251,191,36,0.10);
  --danger:     #fb7185;
  --danger-bg:  rgba(251,113,133,0.10);
  --info:       #60a5fa;
  --info-bg:    rgba(96,165,250,0.10);

  /* Spacing — Generous */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;
  --space-16: 64px;

  /* Border Radius — Bubble-like, very rounded */
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  /* Typography */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', 'Fira Code', monospace;

  /* Font Sizes */
  --text-xs:  11px;
  --text-sm:  13px;
  --text-base: 15px;
  --text-lg:  17px;
  --text-xl:  20px;
  --text-2xl: 26px;
  --text-3xl: 32px;

  /* Font Weights */
  --weight-normal: 400;
  --weight-medium: 500;
  --weight-semibold: 600;
  --weight-bold: 700;
  --weight-extrabold: 800;
  --weight-black: 900;

  /* Shadows — Soft, diffused */
  --shadow-sm:  0 2px 8px rgba(0,0,0,0.2);
  --shadow-md:  0 8px 32px rgba(0,0,0,0.3);
  --shadow-lg:  0 24px 64px rgba(0,0,0,0.4);
  --shadow-glow-teal: 0 0 40px rgba(56,189,248,0.06);
  --shadow-glow-violet: 0 0 40px rgba(167,139,250,0.06);
  --shadow-float: 0 8px 40px rgba(0,0,0,0.3), 0 0 0 1px rgba(255,255,255,0.05);

  /* Transitions */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --duration-fast: 150ms;
  --duration-normal: 250ms;
  --duration-slow: 400ms;

  /* Z-Index Scale */
  --z-base:     1;
  --z-dropdown: 10;
  --z-sticky:   20;
  --z-overlay:  30;
  --z-modal:    50;
  --z-toast:    60;
}

/* ── Base Styles ── */
body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  letter-spacing: -0.01em;
}

/* Ambient background mesh — gives depth like Starlink */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 10% 20%, rgba(56,189,248,0.04) 0%, transparent 60%),
    radial-gradient(ellipse 60% 80% at 90% 80%, rgba(167,139,250,0.03) 0%, transparent 60%),
    radial-gradient(ellipse 50% 50% at 50% 50%, rgba(255,255,255,0.01) 0%, transparent 100%);
  pointer-events: none;
  z-index: 0;
}

.mono { font-family: var(--font-mono); letter-spacing: -0.02em; }

/* ── Focus Styles ── */
:focus-visible {
  outline: 2px solid rgba(56,189,248,0.5);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* ── Scrollbar — Invisible until hover ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.08); border-radius: var(--radius-full); }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.15); }

/* ── Button Base ── */
button { cursor: pointer; font-family: inherit; }

/* ── Animations ── */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInScale {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-12px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Icon spin animation utility */
.spin-icon { animation: spin .6s linear infinite; }

@keyframes barGrow {
  from { height: 0; }
  to { height: var(--h); }
}

@keyframes funnelGrow {
  from { height: 0; opacity: 0; }
  to { height: var(--h); opacity: 1; }
}

@keyframes breathe {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 0.8; }
}

/* ── Utility Classes ── */
.fade-in { animation: fadeIn 0.5s var(--ease-out) both; }
.fade-in-scale { animation: fadeInScale 0.5s var(--ease-out) both; }
.slide-up { animation: slideUp 0.6s var(--ease-out) both; }

.d1 { animation-delay: 0.05s; }
.d2 { animation-delay: 0.1s; }
.d3 { animation-delay: 0.15s; }
.d4 { animation-delay: 0.2s; }
.d5 { animation-delay: 0.25s; }
.d6 { animation-delay: 0.3s; }

/* ── Skeleton Loading ── */
.skeleton {
  background: linear-gradient(90deg, rgba(255,255,255,0.03) 25%, rgba(255,255,255,0.06) 50%, rgba(255,255,255,0.03) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.8s infinite;
  border-radius: var(--radius-md);
}

/* ══════════════════════════════════════
   COMPONENTS — Frosted Glass Style
   ══════════════════════════════════════ */

/* ── Card — Floating glass bubble ── */
.dar-card {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  transition: all var(--duration-normal) var(--ease-out);
  box-shadow: 0 2px 16px rgba(0,0,0,0.15);
}
.dar-card:hover {
  background: var(--glass-hover);
  border-color: rgba(255,255,255,0.10);
}
.dar-card-interactive {
  cursor: pointer;
}
.dar-card-interactive:hover {
  border-color: rgba(56,189,248,0.2) !important;
  transform: translateY(-3px);
  box-shadow: var(--shadow-float), var(--shadow-glow-teal);
}

/* ── Badge — Glass pill ── */
.dar-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: 10px;
  font-weight: var(--weight-semibold);
  letter-spacing: 0.3px;
  white-space: nowrap;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.dar-badge-success { background: var(--success-bg); color: var(--success); }
.dar-badge-warning { background: var(--warning-bg); color: var(--warning); }
.dar-badge-danger { background: var(--danger-bg); color: var(--danger); }
.dar-badge-info { background: var(--info-bg); color: var(--info); }
.dar-badge-neutral { background: rgba(255,255,255,0.06); color: var(--text-secondary); }

/* ── Button — Glass buttons ── */
.dar-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  border: none;
  transition: all var(--duration-normal) var(--ease-out);
  text-decoration: none;
  white-space: nowrap;
}
.dar-btn-primary {
  background: rgba(255,255,255,0.95);
  color: #000;
  box-shadow: 0 2px 12px rgba(255,255,255,0.1);
}
.dar-btn-primary:hover {
  background: #fff;
  transform: translateY(-1px);
  box-shadow: 0 4px 24px rgba(255,255,255,0.15);
}
.dar-btn-secondary {
  background: var(--glass);
  color: var(--text-secondary);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.dar-btn-secondary:hover {
  background: var(--glass-strong);
  color: var(--text);
}
.dar-btn-ghost {
  background: transparent;
  color: var(--text-muted);
  padding: 8px 14px;
}
.dar-btn-ghost:hover {
  color: var(--accent);
  background: var(--accent-dim);
  border-radius: var(--radius-md);
}

/* ── Pill/Tab — Glass pills ── */
.dar-pill {
  padding: 8px 18px;
  border-radius: var(--radius-full);
  border: 1px solid rgba(255,255,255,0.06);
  background: rgba(255,255,255,0.04);
  color: var(--text-muted);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  transition: all var(--duration-fast) var(--ease-out);
  cursor: pointer;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.dar-pill:hover {
  background: rgba(255,255,255,0.08);
  color: var(--text-secondary);
}
.dar-pill-active {
  background: rgba(255,255,255,0.95);
  border-color: transparent;
  color: #000;
  box-shadow: 0 2px 12px rgba(255,255,255,0.08);
}
.dar-pill-active:hover {
  background: #fff;
}

/* ── Tab Navigation ── */
.dar-tab {
  padding: 12px 20px;
  font-size: 13px;
  font-weight: var(--weight-medium);
  color: var(--text-muted);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  transition: all var(--duration-fast) ease;
  white-space: nowrap;
  cursor: pointer;
}
.dar-tab:hover {
  color: var(--text-secondary);
}
.dar-tab-active {
  color: var(--text);
  border-bottom-color: var(--text);
}

/* ── KPI Card — Floating glass metric ── */
.dar-kpi {
  background: var(--glass);
  border-radius: var(--radius-lg);
  padding: 20px 22px;
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  transition: all var(--duration-normal) var(--ease-out);
}
.dar-kpi:hover {
  background: var(--glass-hover);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}
.dar-kpi-label {
  font-size: 10px;
  color: var(--text-dim);
  font-weight: var(--weight-semibold);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 10px;
}
.dar-kpi-value {
  font-family: var(--font-mono);
  font-size: 26px;
  font-weight: var(--weight-bold);
  line-height: 1.1;
  letter-spacing: -0.04em;
}

/* ── Table — Clean minimal ── */
.dar-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 600px;
}
.dar-table thead {
  background: rgba(0,0,0,0.3);
}
.dar-table th {
  padding: 14px 18px;
  font-size: 10px;
  font-weight: var(--weight-semibold);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  border-bottom: 1px solid var(--border);
  text-align: left;
}
.dar-table td {
  padding: 14px 18px;
  font-size: 13px;
  border-bottom: 1px solid var(--border-subtle);
}
.dar-table tbody tr {
  transition: background var(--duration-fast) ease;
}
.dar-table tbody tr:hover {
  background: rgba(255,255,255,0.03) !important;
}

/* ── Modal / Overlay — Frosted ── */
.dar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(24px) saturate(1.2);
  -webkit-backdrop-filter: blur(24px) saturate(1.2);
  z-index: var(--z-modal);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.3s ease-out;
}
.dar-modal {
  background: rgba(20,20,22,0.85);
  backdrop-filter: blur(40px) saturate(1.5);
  -webkit-backdrop-filter: blur(40px) saturate(1.5);
  border-radius: var(--radius-xl);
  border: 1px solid rgba(255,255,255,0.08);
  width: 100%;
  max-height: 90vh;
  overflow: auto;
  animation: fadeInScale 0.4s var(--ease-out);
  box-shadow: var(--shadow-lg), 0 0 0 1px rgba(255,255,255,0.05);
}

/* ── Header — Floating glass bar ── */
.dar-header {
  padding: 16px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
  background: rgba(10,10,10,0.7);
  backdrop-filter: blur(24px) saturate(1.3);
  -webkit-backdrop-filter: blur(24px) saturate(1.3);
  position: sticky;
  top: 0;
  z-index: var(--z-sticky);
}

/* ── Section Header ── */
.dar-section-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-subtle);
  font-size: var(--text-sm);
  font-weight: var(--weight-bold);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* ── Empty State ── */
.dar-empty {
  text-align: center;
  padding: 80px 24px;
  color: var(--text-dim);
}
.dar-empty svg { margin-bottom: 16px; opacity: 0.25; }
.dar-empty p { font-size: var(--text-sm); color: var(--text-muted); }

/* ── Footer ── */
.dar-footer {
  padding: 20px 28px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  color: var(--text-dim);
  margin-top: 48px;
}
.dar-footer a {
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: var(--weight-medium);
  transition: color var(--duration-fast) ease;
}
.dar-footer a:hover { color: var(--text); }

/* ── Spinner ── */
.dar-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255,255,255,0.08);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* ── Status Dot — Glowing ── */
.dar-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.dar-dot-success { background: var(--success); box-shadow: 0 0 10px rgba(52,211,153,0.5); }
.dar-dot-warning { background: var(--warning); box-shadow: 0 0 10px rgba(251,191,36,0.5); }
.dar-dot-danger { background: var(--danger); box-shadow: 0 0 10px rgba(251,113,133,0.5); }

/* ── Responsive ── */
@media (max-width: 768px) {
  :root {
    --text-xs: 10px;
    --text-sm: 12px;
    --text-base: 14px;
    --glass-blur: 12px;
  }
  .hide-mobile { display: none !important; }
  .dar-header { padding: 12px 16px; }
}

@media (max-width: 480px) {
  .dar-kpi { padding: 14px 12px; }
  .dar-kpi-value { font-size: 20px; }
}

/* ── Reduced Motion ── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  body::before { display: none; }
}

/* ══════════════════════════════════════
   PLATFORM LAYOUT — Sidebar + Topbar
   ══════════════════════════════════════ */

:root {
  /* Dashboard compat tokens */
  --bg2: #0a0a0a;
  --card: rgba(255,255,255,0.04);
  --card2: rgba(255,255,255,0.05);
  --border2: rgba(255,255,255,0.04);
  --text2: rgba(255,255,255,0.55);
  --muted: rgba(255,255,255,0.20);
  --dim: rgba(255,255,255,0.12);
  --dimmer: rgba(255,255,255,0.12);
  --sidebar-w: 228px;
  --sidebar-collapsed: 64px;
  --topbar-h: 56px;
}

body {
  overflow-x: hidden;
}
body::before {
  background:
    radial-gradient(ellipse 80% 60% at 5% 10%, rgba(56,189,248,0.08) 0%, transparent 50%),
    radial-gradient(ellipse 70% 60% at 90% 85%, rgba(167,139,250,0.07) 0%, transparent 50%),
    radial-gradient(ellipse 50% 40% at 50% 50%, rgba(56,189,248,0.03) 0%, transparent 60%);
  animation: ambientShift 30s ease-in-out infinite alternate;
}
@keyframes ambientShift {
  0%   { opacity: .9; filter: hue-rotate(0deg); }
  50%  { opacity: 1;  filter: hue-rotate(8deg); }
  100% { opacity: .9; filter: hue-rotate(-5deg); }
}

input, select { font-family: inherit; }

/* ── Glass Overrides ── */
[style*="background:var(--card)"],[style*="background: var(--card)"] {
  background: rgba(255,255,255,0.04) !important;
  backdrop-filter: blur(20px) !important; -webkit-backdrop-filter: blur(20px) !important;
  border-color: rgba(255,255,255,0.07) !important;
  border-radius: 20px !important;
}
[style*="background:var(--card2)"],[style*="background: var(--card2)"] {
  background: rgba(255,255,255,0.03) !important;
  backdrop-filter: blur(16px) !important; -webkit-backdrop-filter: blur(16px) !important;
  border-radius: 16px !important;
}
[style*="borderTop:\"3px"],[style*="border-top:3px"] { border-top: none !important; }

input, select, textarea {
  background: rgba(255,255,255,0.05) !important;
  border: 1px solid rgba(255,255,255,0.08) !important;
  border-radius: 12px !important;
  color: var(--text) !important;
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  transition: all .2s ease !important;
}
input:focus, select:focus, textarea:focus {
  border-color: rgba(56,189,248,0.4) !important;
  box-shadow: 0 0 20px rgba(56,189,248,0.08) !important;
  outline: none !important;
}

.main-content > div > div { position: relative; z-index: 1; }
[style*="borderRadius:22"] { border-radius: 24px !important; }
[style*="borderRadius:14"] { border-radius: 20px !important; }
[style*="borderRadius:18"] { border-radius: 18px !important; }

/* ── Sidebar ── */
.sidebar {
  position: fixed; left: 0; top: 0; bottom: 0; width: var(--sidebar-w);
  background: rgba(8,8,10,0.85);
  backdrop-filter: blur(24px) saturate(1.2); -webkit-backdrop-filter: blur(24px) saturate(1.2);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column; z-index: 300;
  transition: transform .25s cubic-bezier(.4,0,.2,1);
}
.sidebar-logo {
  padding: 16px 18px; display: flex; align-items: center; gap: 10px;
  border-bottom: 1px solid var(--border); min-height: var(--topbar-h);
}
.sidebar-logo img { width: 32px; height: 32px; border-radius: 8px; object-fit: cover; }
.sidebar-logo-text { font-weight: 900; font-size: 13px; letter-spacing: .3px; }
.sidebar-logo-text span { color: var(--accent); }
.sidebar-nav { flex: 1; padding: 12px 8px; display: flex; flex-direction: column; gap: 2px; overflow-y: auto; }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 10px;
  font-size: 12px; font-weight: 600; color: var(--muted);
  background: transparent; border: none; width: 100%; text-align: left;
  transition: all .15s; position: relative;
}
.nav-item:hover { background: rgba(255,255,255,0.05); color: var(--text2); border-radius: 14px; }
.nav-item.active {
  background: rgba(255,255,255,0.08); color: var(--text);
  border: 1px solid rgba(255,255,255,0.10); border-radius: 14px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.2);
}
.nav-item.active::before {
  content: ''; position: absolute; left: 0; top: 50%; transform: translateY(-50%);
  width: 3px; height: 18px; background: var(--teal); border-radius: 0 3px 3px 0;
}
.nav-icon { font-size: 16px; width: 22px; text-align: center; flex-shrink: 0; }
.nav-label { white-space: nowrap; overflow: hidden; }
.sidebar-footer {
  padding: 14px 16px; border-top: 1px solid rgba(255,255,255,0.05);
  font-size: 9px; color: rgba(255,255,255,0.15); text-align: center;
}

/* ── Sidebar overlay (mobile) ── */
.sidebar-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.7);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); z-index: 290;
  opacity: 0; pointer-events: none; transition: opacity .25s;
}
.sidebar-overlay.show { opacity: 1; pointer-events: auto; }

/* ── Topbar ── */
.topbar {
  position: fixed; top: 0; left: var(--sidebar-w); right: 0; height: var(--topbar-h);
  background: rgba(8,8,10,0.7);
  backdrop-filter: blur(24px) saturate(1.2); -webkit-backdrop-filter: blur(24px) saturate(1.2);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; padding: 0 24px; gap: 14px; z-index: 250;
  transition: left .25s cubic-bezier(.4,0,.2,1);
}
.topbar-burger {
  display: none; background: none; border: none; color: var(--text2);
  font-size: 20px; padding: 4px; margin-right: 4px;
}
.topbar-title { font-size: 14px; font-weight: 800; color: var(--text); white-space: nowrap; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }

/* ── Main content area ── */
.main {
  margin-left: var(--sidebar-w); padding-top: var(--topbar-h); min-height: 100vh;
  transition: margin-left .25s cubic-bezier(.4,0,.2,1);
  position: relative; z-index: 1;
}
.main-inner { padding: 24px 28px; max-width: 1400px; margin: 0 auto; }

/* ── Shared dashboard components ── */
.kpi-card {
  background: rgba(255,255,255,0.04); border-radius: 20px; padding: 18px 20px;
  border: 1px solid rgba(255,255,255,0.06); position: relative; overflow: hidden;
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  transition: all .25s cubic-bezier(.16,1,.3,1);
}
.kpi-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent, var(--teal)), transparent); opacity: 0.4;
}
.kpi-card:hover { transform: translateY(-2px); box-shadow: 0 8px 32px rgba(0,0,0,0.25), 0 0 0 1px rgba(255,255,255,0.06); background: rgba(255,255,255,0.06); }
.kpi-label { font-size: 10px; color: rgba(255,255,255,0.30); font-weight: 600; text-transform: uppercase; letter-spacing: .8px; margin-bottom: 8px; }
.kpi-value { font-size: 22px; font-weight: 700; font-family: var(--font-mono); letter-spacing: -0.03em; }
.kpi-sub { font-size: 10px; color: rgba(255,255,255,0.25); margin-top: 4px; }

.badge { font-size: 9px; font-weight: 600; padding: 3px 10px; border-radius: 20px; white-space: nowrap; }
.card { background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.06); border-radius: 20px; overflow: hidden; backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); }
.card-header { padding: 14px 20px; border-bottom: 1px solid rgba(255,255,255,0.06); display: flex; align-items: center; justify-content: space-between; gap: 8px; }

.btn {
  padding: 8px 16px; border-radius: 8px; border: none; font-weight: 700; font-size: 11px;
  transition: all .15s; display: inline-flex; align-items: center; gap: 6px;
}
.btn-teal { background: var(--teal); color: #fff; }
.btn-teal:hover { filter: brightness(1.1); transform: translateY(-1px); }
.btn-ghost { background: transparent; border: 1px solid var(--border); color: var(--muted); }
.btn-ghost:hover { border-color: var(--text2); color: var(--text2); }

.pill-tabs { display: flex; gap: 3px; flex-wrap: wrap; }
.pill-tab {
  padding: 6px 14px; border-radius: 8px; border: 1px solid var(--border);
  background: transparent; color: var(--muted); font-size: 11px; font-weight: 600;
  transition: all .15s;
}
.pill-tab:hover { border-color: var(--text2); color: var(--text2); }
.pill-tab.active { background: var(--teal); color: #fff; border-color: var(--teal); }

.week-nav { display: flex; align-items: center; gap: 4px; }
.week-btn {
  background: #1c1c1f; border: none; color: var(--text2);
  width: 28px; height: 28px; border-radius: 6px; font-size: 14px;
  display: flex; align-items: center; justify-content: center; transition: all .15s;
}
.week-btn:hover { background: var(--border); color: var(--text); }
.week-select {
  background: #1c1c1f; border: 1px solid var(--border); color: var(--text2);
  border-radius: 6px; padding: 4px 8px; font-size: 11px; font-weight: 600;
  max-width: 160px;
}

.buyer-pills { display: flex; gap: 3px; }
.buyer-pill {
  padding: 4px 10px; border-radius: 16px; border: none; font-size: 10px; font-weight: 700;
  transition: all .15s;
}

/* ── Platform Responsive ── */
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .topbar { left: 0 !important; }
  .topbar-burger { display: block; }
  .main { margin-left: 0 !important; }
  .main-inner { padding: 16px 12px; }
  .kpi-value { font-size: 16px; }
}
@media (min-width: 769px) {
  .sidebar-overlay { display: none !important; }
}
