/* ═══════════════════════════════════════════════════════════════════════════
   CLARTÉ DESIGN SYSTEM — global.css
   Liquid Glass (WWDC25) · Shared foundation for all dashboard pages.
   Import ONCE per page.
   ═══════════════════════════════════════════════════════════════════════════ */

/* Mission Control reskin — brand display font (187N). Falls back to system if offline. */
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@300;400;500;600;700&family=Saira+Condensed:wght@500;600;700&family=Playfair+Display:ital,wght@1,400;1,500;1,600&display=swap');

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

/* ─── Design Tokens ──────────────────────────────────────────────────────── */
:root {
  /* Surfaces */
  --bg:           #000000;
  --surface:      #1C1C1E;
  --card:         #2C2C2E;
  --hover:        #3A3A3C;
  --border:       rgba(255,255,255,0.08);

  /* ─── Liquid Glass — core system ─────────────────────────────────────── */
  --lg-fill:        rgba(255,255,255,0.06);
  --lg-fill-hover:  rgba(255,255,255,0.09);
  --lg-fill-active: rgba(255,255,255,0.12);

  --lg-border:      rgba(255,255,255,0.14);
  --lg-border-top:  rgba(255,255,255,0.22);
  --lg-border-bot:  rgba(0,0,0,0.35);

  --lg-blur:        blur(40px) saturate(200%) brightness(1.05);
  --lg-blur-heavy:  blur(60px) saturate(220%) brightness(1.08);

  --lg-shadow:
    0 0 0 0.5px rgba(0,0,0,0.55),
    0 8px 32px rgba(0,0,0,0.48),
    0 2px 8px rgba(0,0,0,0.32),
    inset 0 1px 0 rgba(255,255,255,0.10),
    inset 0 -1px 0 rgba(0,0,0,0.22);

  --lg-shadow-sm:
    0 0 0 0.5px rgba(0,0,0,0.45),
    0 4px 16px rgba(0,0,0,0.38),
    inset 0 1px 0 rgba(255,255,255,0.08),
    inset 0 -1px 0 rgba(0,0,0,0.18);

  /* Specular highlight */
  --lg-specular: linear-gradient(
    180deg,
    rgba(255,255,255,0.18) 0%,
    rgba(255,255,255,0.06) 30%,
    rgba(255,255,255,0.00) 60%,
    rgba(0,0,0,0.06) 100%
  );

  /* Edge highlight — lichtinval van boven-links */
  --lg-edge: linear-gradient(
    135deg,
    rgba(255,255,255,0.22) 0%,
    rgba(255,255,255,0.00) 50%
  );

  /* Tint varianten per context */
  --lg-tint-neutral: rgba(120,120,140,0.08);
  --lg-tint-warm:    rgba(181,149,90,0.06);
  --lg-tint-cool:    rgba(80,120,180,0.06);

  /* Refractie simulatie */
  --lg-refract-light: rgba(255,255,255,0.04);
  --lg-refract-dark:  rgba(0,0,0,0.08);

  /* Legacy glass aliases */
  --glass-bg:         rgba(28,28,30,0.72);
  --glass-border:     rgba(255,255,255,0.06);
  --glass-border-top: rgba(255,255,255,0.14);
  --glass-blur:       blur(32px) saturate(180%) brightness(1.04);
  --glass-inset:      inset 0 1px 0 rgba(255,255,255,0.07);

  /* Gold accent */
  --gold:             #B5955A;
  --gold-bright:      #c9a96e;
  --gold-dim:         #8a6f3c;
  --gold-glow:        rgba(181,149,90,0.35);
  --gold-fill:        rgba(181,149,90,0.12);
  --gold-fill-strong: rgba(181,149,90,0.22);

  /* Legacy aliases */
  --accent-brass: #B5955A;
  --accent-burg:  #B5955A;

  /* iOS semantic */
  --ios-blue:    #0a84ff;
  --ios-green:   #46d38a;
  --ios-orange:  #c9a86b;
  --ios-red:     #ce7a72;

  /* Legacy status aliases */
  --alert-red:    #CE7A72;
  --alert-amber:  #C9A86B;
  --alert-green:  #46D38A;
  --alert-blue:   #64D2FF;
  --alert-purple: #BF5AF2;

  /* Shadows */
  --shadow-sm:   0 1px 3px rgba(0,0,0,0.35), 0 1px 2px rgba(0,0,0,0.25);
  --shadow-md:   0 4px 14px rgba(0,0,0,0.40), 0 2px 4px rgba(0,0,0,0.28);
  --shadow-lg:   0 8px 32px rgba(0,0,0,0.50), 0 4px 8px rgba(0,0,0,0.32);
  --shadow-card: 0 2px 8px rgba(0,0,0,0.35), inset 0 0.5px 0 rgba(255,255,255,0.06);
  --shadow-ring: 0 0 0 0.5px rgba(0,0,0,0.55);
  --glow-gold:   0 0 14px rgba(181,149,90,0.4), 0 0 32px rgba(181,149,90,0.14);

  /* Radii */
  --r-xs:   6px;
  --r-sm:   8px;
  --r-md:   10px;
  --r-lg:   14px;
  --r-xl:   18px;
  --r-2xl:  24px;
  --r-full: 9999px;

  /* Typography */
  --fs-micro: 9px;
  --fs-label: 10px;
  --fs-xs:    11px;
  --fs-sm:    13px;
  --fs-base:  15px;
  --fs-md:    17px;
  --fs-lg:    21px;
  --fs-xl:    26px;
  --fs-2xl:   32px;
  --ls-tight: -0.01em;
  --lh-body:  1.47;

  /* Text hierarchy */
  --text-primary:   rgba(255,255,255,0.90);
  --text-secondary: rgba(255,255,255,0.55);
  --text-tertiary:  rgba(255,255,255,0.32);
  --text-disabled:  rgba(255,255,255,0.18);

  /* Legacy text aliases */
  --text-1: #F5F5F7;
  --text-2: #98989D;
  --text-3: #636366;

  /* Spacing (4px base unit) */
  --sp-1:  4px;
  --sp-2:  8px;
  --sp-3:  12px;
  --sp-4:  16px;
  --sp-5:  20px;
  --sp-6:  24px;
  --sp-8:  32px;
  --sp-10: 40px;
  --sp-12: 48px;

  /* Transitions — Apple easing */
  --t-fast:   0.15s cubic-bezier(0.25, 0.1, 0.25, 1);
  --t-base:   0.25s cubic-bezier(0.25, 0.1, 0.25, 1);
  --t-slow:   0.40s cubic-bezier(0.25, 0.1, 0.25, 1);
  --t-spring: 0.50s cubic-bezier(0.34, 1.56, 0.64, 1);

  /* Dividers */
  --divide-subtle:  rgba(255,255,255,0.05);
  --divide-default: rgba(255,255,255,0.08);

  /* Sidebar */
  --sidebar-w:     256px;
  --sidebar-w-min:  56px;
}

/* ─── Base ────────────────────────────────────────────────────────────────── */
html, body {
  height: 100%;
  overflow: hidden;
}
body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", sans-serif;
  font-size: var(--fs-base);
  color: var(--text-primary);
  letter-spacing: var(--ls-tight);
  line-height: var(--lh-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background:
    radial-gradient(ellipse 80% 50% at 10% 5%,
      rgba(60, 30, 100, 0.50) 0%, transparent 55%),
    radial-gradient(ellipse 60% 50% at 90% 90%,
      rgba(20, 50, 100, 0.45) 0%, transparent 50%),
    radial-gradient(ellipse 50% 40% at 50% 40%,
      rgba(40, 20, 70, 0.30) 0%, transparent 55%),
    radial-gradient(ellipse 40% 35% at 70% 20%,
      rgba(100, 60, 30, 0.18) 0%, transparent 50%),
    #08080C;
}

h1, h2, h3 { font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", sans-serif; }

.hidden { display: none !important; }

/* ─── Scrollbar ──────────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.10);
  border-radius: var(--r-full);
}
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.18); }

/* ─── Liquid Glass base class ────────────────────────────────────────────── */
.liquid-glass {
  position: relative;
  background: var(--lg-fill);
  backdrop-filter: var(--lg-blur);
  -webkit-backdrop-filter: var(--lg-blur);
  border-radius: var(--r-xl);
  border: 1px solid var(--lg-border);
  border-top-color: var(--lg-border-top);
  border-bottom-color: var(--lg-border-bot);
  box-shadow: var(--lg-shadow);
  overflow: hidden;
  isolation: isolate;
}

/* Specular highlight laag */
.liquid-glass::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--lg-specular);
  border-radius: inherit;
  pointer-events: none;
  z-index: 0;
}

/* Edge glow — boven-links lichtreflectie */
.liquid-glass::after {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--lg-edge);
  border-radius: inherit;
  pointer-events: none;
  z-index: 0;
  opacity: 0.6;
}

/* Content boven pseudo-layers */
.liquid-glass > * {
  position: relative;
  z-index: 1;
}

/* Heavy variant — modals, panels, sidebar */
.liquid-glass-heavy {
  background: rgba(255,255,255,0.08);
  backdrop-filter: var(--lg-blur-heavy);
  -webkit-backdrop-filter: var(--lg-blur-heavy);
  box-shadow: var(--lg-shadow);
}

/* Subtle variant — kaarten, chips, badges */
.liquid-glass-subtle {
  background: var(--lg-fill);
  backdrop-filter: blur(24px) saturate(160%);
  -webkit-backdrop-filter: blur(24px) saturate(160%);
  box-shadow: var(--lg-shadow-sm);
}

/* Warm tint — gold-accent contexten */
.liquid-glass-warm {
  background: linear-gradient(
    135deg,
    rgba(181,149,90,0.08) 0%,
    rgba(255,255,255,0.04) 100%
  );
  border-color: rgba(181,149,90,0.20);
  border-top-color: rgba(181,149,90,0.32);
}

/* Interactive — knoppen, nav items */
.liquid-glass-interactive {
  background: var(--lg-fill);
  backdrop-filter: blur(28px) saturate(180%);
  -webkit-backdrop-filter: blur(28px) saturate(180%);
  border: 1px solid var(--lg-border);
  border-top-color: var(--lg-border-top);
  box-shadow: var(--lg-shadow-sm);
  transition:
    background var(--t-fast),
    border-color var(--t-fast),
    box-shadow var(--t-fast),
    transform 0.1s var(--t-spring);
  cursor: pointer;
}

.liquid-glass-interactive:hover {
  background: var(--lg-fill-hover);
  border-color: rgba(255,255,255,0.18);
  border-top-color: rgba(255,255,255,0.28);
  box-shadow:
    0 0 0 0.5px rgba(0,0,0,0.5),
    0 10px 40px rgba(0,0,0,0.52),
    inset 0 1px 0 rgba(255,255,255,0.14),
    inset 0 -1px 0 rgba(0,0,0,0.2);
}

.liquid-glass-interactive:active {
  background: var(--lg-fill-active);
  transform: scale(0.97);
  box-shadow: var(--lg-shadow-sm);
}

/* Utility aliases */
.glass {
  background: var(--lg-fill);
  backdrop-filter: var(--lg-blur);
  -webkit-backdrop-filter: var(--lg-blur);
  border: 1px solid var(--lg-border);
  border-top-color: var(--lg-border-top);
  box-shadow: var(--lg-shadow-sm);
  isolation: isolate;
}

.glass-chip {
  background: rgba(255,255,255,0.07);
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  border: 1px solid var(--lg-border);
  border-top-color: rgba(255,255,255,0.12);
  border-radius: var(--r-full);
  padding: 4px 12px;
  font-size: var(--fs-xs);
  font-weight: 500;
  color: var(--text-secondary);
  box-shadow: var(--lg-shadow-sm);
}

/* ─── Shell (sidebar + main grid) ────────────────────────────────────────── */
.shell {
  display: grid;
  grid-template-columns: auto 1fr;
  height: 100vh;
}

/* ─── Sidebar — Liquid Glass ─────────────────────────────────────────────── */
.sidebar {
  background: rgba(18,18,22,0.78);
  backdrop-filter: var(--lg-blur-heavy);
  -webkit-backdrop-filter: var(--lg-blur-heavy);
  border-right: 0.5px solid var(--lg-border);
  box-shadow:
    1px 0 0 rgba(255,255,255,0.04),
    var(--lg-shadow);
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow-y: auto;
  width: var(--sidebar-w);
  transition: width 0.25s cubic-bezier(0.25, 0.1, 0.25, 1);
}

.sidebar::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(255,255,255,0.06) 0%,
    rgba(255,255,255,0.02) 30%,
    transparent 100%
  );
  pointer-events: none;
  z-index: 0;
}

.sidebar > * { position: relative; z-index: 1; }

.sidebar.collapsed {
  width: var(--sidebar-w-min);
  min-width: var(--sidebar-w-min);
}

/* Logo */
.sidebar-logo {
  padding: var(--sp-5) var(--sp-6);
  border-bottom: 0.5px solid var(--lg-border);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}
.sidebar-logo img {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  filter: invert(1);
  opacity: 0.9;
  object-fit: contain;
}
.sidebar-logo .brand-name {
  font-size: var(--fs-sm);
  letter-spacing: 2px;
  color: var(--text-primary);
  font-family: Georgia, serif;
  line-height: 1;
}
.sidebar-logo .brand-sub {
  font-size: var(--fs-micro);
  letter-spacing: 2px;
  color: var(--text-tertiary);
  margin-top: 2px;
}

/* Navigation */
.nav { flex: 1; padding: var(--sp-3) 0; }

.nav-section {
  padding: var(--sp-5) var(--sp-6) var(--sp-2);
  font-size: var(--fs-micro);
  font-weight: 600;
  letter-spacing: 1.5px;
  color: var(--text-tertiary);
  text-transform: uppercase;
}
.nav-section:first-child { padding-top: var(--sp-3); }

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 14px;
  margin: 2px 12px;
  color: var(--text-secondary);
  font-size: var(--fs-sm);
  text-decoration: none;
  border: none;
  border-radius: var(--r-md);
  transition: background var(--t-fast), color var(--t-fast), box-shadow var(--t-fast);
  white-space: nowrap;
}
.nav-item:hover {
  background: rgba(255,255,255,0.08);
  color: var(--text-primary);
}
.nav-item.active {
  background: rgba(255,255,255,0.12);
  color: var(--text-primary);
  box-shadow:
    0 0 0 0.5px rgba(255,255,255,0.10),
    0 2px 8px rgba(0,0,0,0.3),
    inset 0 1px 0 rgba(255,255,255,0.10),
    inset 0 -1px 0 rgba(0,0,0,0.15);
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
}

.nav-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  opacity: 0.5;
}
.nav-item.active .nav-icon,
.nav-item:hover .nav-icon { opacity: 1; }

.nav-item.nav-sub {
  padding-left: 36px;
  font-size: 12px;
  margin-top: -2px;
  color: var(--text-tertiary);
}
.nav-item.nav-sub .nav-icon { width: 12px; height: 12px; }
.nav-item.nav-sub:hover { color: var(--text-primary); }

/* Sidebar footer */
.sidebar-footer {
  padding: var(--sp-4) var(--sp-6);
  border-top: 0.5px solid var(--lg-border);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.user-label {
  font-size: var(--fs-xs);
  color: var(--text-tertiary);
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
  letter-spacing: 0.02em;
}
.logout-btn, .btn-logout {
  font-family: inherit;
  font-size: var(--fs-sm);
  color: var(--text-secondary);
  background: rgba(255,255,255,0.07);
  border: 1px solid var(--lg-border);
  border-top-color: rgba(255,255,255,0.10);
  border-radius: var(--r-sm);
  padding: 6px var(--sp-3);
  cursor: pointer;
  box-shadow: var(--lg-shadow-sm);
  transition: background var(--t-fast), color var(--t-fast);
}
.logout-btn:hover, .btn-logout:hover {
  background: rgba(255,255,255,0.11);
  color: var(--text-primary);
}

/* ─── Main content area ──────────────────────────────────────────────────── */
.main {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
  background: transparent;
  color: var(--text-primary);
}

/* ─── Topbar — Liquid Glass ──────────────────────────────────────────────── */
.topbar {
  background: rgba(12,12,16,0.82);
  backdrop-filter: var(--lg-blur-heavy);
  -webkit-backdrop-filter: var(--lg-blur-heavy);
  border-bottom: 0.5px solid var(--lg-border);
  box-shadow:
    0 1px 0 rgba(255,255,255,0.05),
    0 4px 20px rgba(0,0,0,0.4);
  padding: 14px var(--sp-8);
  position: relative;
  isolation: isolate;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.topbar::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 0.5px;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255,255,255,0.08) 20%,
    rgba(255,255,255,0.08) 80%,
    transparent
  );
  pointer-events: none;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
}
.topbar-right {
  display: flex;
  align-items: center;
  gap: var(--sp-5);
}
.topbar-brand {
  font-size: var(--fs-sm);
  letter-spacing: 3px;
  color: var(--text-primary);
  font-family: Georgia, serif;
}
.topbar-sub {
  font-size: var(--fs-xs);
  color: var(--text-secondary);
  letter-spacing: 2px;
}
.topbar-meta {
  font-size: var(--fs-xs);
  color: var(--text-secondary);
}
.topbar-clock {
  font-size: var(--fs-sm);
  color: var(--gold);
  letter-spacing: 2px;
  font-variant-numeric: tabular-nums;
}

/* ─── Page header ────────────────────────────────────────────────────────── */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  padding: var(--sp-8) var(--sp-8) var(--sp-4);
}
.page-header h1 {
  font-size: var(--fs-2xl);
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}
.page-sub {
  font-size: var(--fs-sm);
  color: var(--text-tertiary);
  margin-top: 3px;
}
.header-right {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
}

/* ─── Buttons ────────────────────────────────────────────────────────────── */
.btn {
  font-family: inherit;
  font-size: var(--fs-label);
  font-weight: 500;
  padding: 8px var(--sp-4);
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: background var(--t-fast), opacity var(--t-fast), transform 0.08s;
  letter-spacing: 0.5px;
  border: none;
}
.btn:hover { opacity: 0.85; }
.btn:active:not(:disabled) { transform: scale(0.97); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* Glass button */
.btn-glass {
  position: relative;
  background: rgba(255,255,255,0.08);
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  border: 1px solid var(--lg-border);
  border-top-color: var(--lg-border-top);
  border-bottom-color: rgba(0,0,0,0.28);
  border-radius: var(--r-sm);
  padding: 8px 16px;
  color: var(--text-primary);
  font-size: var(--fs-label);
  font-weight: 500;
  font-family: inherit;
  box-shadow: var(--lg-shadow-sm);
  cursor: pointer;
  overflow: hidden;
  isolation: isolate;
  transition:
    background var(--t-fast),
    border-color var(--t-fast),
    transform 0.08s var(--t-spring);
}

.btn-glass::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 50%;
  background: linear-gradient(
    180deg,
    rgba(255,255,255,0.10) 0%,
    rgba(255,255,255,0.00) 100%
  );
  border-radius: inherit;
  pointer-events: none;
}

.btn-glass:hover {
  background: rgba(255,255,255,0.12);
  border-top-color: rgba(255,255,255,0.28);
}

.btn-glass:active {
  transform: scale(0.97);
  background: rgba(255,255,255,0.06);
}

/* Gold primary */
.btn-brass, .btn-primary {
  background: linear-gradient(145deg, var(--gold-bright) 0%, var(--gold) 100%);
  border: 1px solid rgba(181,149,90,0.4);
  border-top-color: rgba(210,180,120,0.6);
  border-bottom-color: rgba(100,75,30,0.5);
  color: rgba(0,0,0,0.78);
  font-weight: 700;
  box-shadow:
    0 0 0 0.5px rgba(0,0,0,0.4),
    0 4px 16px rgba(181,149,90,0.4),
    0 1px 4px rgba(0,0,0,0.3),
    inset 0 1px 0 rgba(255,255,255,0.25),
    inset 0 -1px 0 rgba(0,0,0,0.15);
}
.btn-brass:hover, .btn-primary:hover { opacity: 0.88; }

.btn-burg {
  background: rgba(181,149,90,0.18);
  border: 1px solid rgba(192,57,79,0.3);
  color: #C0394F;
}
.btn-burg:hover { background: rgba(181,149,90,0.3); }

.btn-ghost, .btn-secondary {
  background: rgba(255,255,255,0.07);
  color: var(--text-secondary);
  border: 1px solid var(--lg-border);
  border-top-color: var(--lg-border-top);
  box-shadow: var(--lg-shadow-sm);
}
.btn-ghost:hover, .btn-secondary:hover {
  background: rgba(255,255,255,0.11);
  color: var(--text-primary);
}

.btn-green {
  background: rgba(48,209,88,0.15);
  border: 1px solid rgba(48,209,88,0.3);
  color: var(--alert-green);
}
.btn-red {
  background: rgba(255,69,58,0.1);
  border: 1px solid rgba(255,69,58,0.25);
  color: var(--alert-red);
}

/* ─── Status pill ────────────────────────────────────────────────────────── */
.status-live {
  font-size: var(--fs-label);
  padding: 4px 10px;
  border-radius: var(--r-sm);
  background: rgba(48,209,88,0.12);
  border: 0.5px solid var(--alert-green);
  color: var(--alert-green);
  letter-spacing: 1px;
}

.status-dot-live {
  animation: liquidPulse 2.4s ease-in-out infinite;
}

/* ─── Cards — Liquid Glass ───────────────────────────────────────────────── */
.card,
.metric-card {
  position: relative;
  background: rgba(255,255,255,0.065);
  backdrop-filter: blur(40px) saturate(200%) brightness(1.05);
  -webkit-backdrop-filter: blur(40px) saturate(200%) brightness(1.05);
  border: 1px solid var(--lg-border);
  border-top-color: var(--lg-border-top);
  border-bottom-color: rgba(0,0,0,0.25);
  border-radius: var(--r-xl);
  padding: var(--sp-5) var(--sp-6);
  box-shadow: var(--lg-shadow-sm);
  overflow: hidden;
  isolation: isolate;
  transition:
    transform var(--t-base),
    box-shadow var(--t-base),
    border-color var(--t-base);
}

/* Specular top edge */
.card::before,
.metric-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(
    90deg,
    rgba(255,255,255,0.0) 0%,
    rgba(255,255,255,0.15) 30%,
    rgba(255,255,255,0.15) 70%,
    rgba(255,255,255,0.0) 100%
  );
  pointer-events: none;
}

.card > *,
.metric-card > * {
  position: relative;
  z-index: 1;
}

.metric-card.clickable { cursor: pointer; }
.metric-card.clickable:hover,
.card.clickable:hover {
  transform: translateY(-2px);
  border-color: rgba(181,149,90,0.25);
  border-top-color: rgba(181,149,90,0.40);
  box-shadow:
    0 0 0 0.5px rgba(0,0,0,0.5),
    0 12px 40px rgba(0,0,0,0.52),
    0 4px 12px rgba(0,0,0,0.3),
    inset 0 1px 0 rgba(255,255,255,0.10),
    0 0 20px rgba(181,149,90,0.08);
}

/* ─── Tables ─────────────────────────────────────────────────────────────── */
.cmd-table { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
.cmd-table th {
  text-align: left;
  padding: 8px var(--sp-3);
  font-size: var(--fs-micro);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  border-bottom: 0.5px solid var(--divide-default);
}
.cmd-table td {
  padding: 12px var(--sp-4);
  border-bottom: 0.5px solid var(--divide-subtle);
  color: var(--text-secondary);
}
.cmd-table tr:last-child td { border-bottom: none; }
.cmd-table tr { cursor: pointer; transition: background var(--t-fast); }
.cmd-table tr:hover { background: var(--hover); }
.cmd-table .priority-hot  { color: var(--alert-red); }
.cmd-table .priority-warm { color: var(--alert-amber); }
.cmd-table .priority-cold { color: var(--text-tertiary); }

/* ─── Panels — Liquid Glass ──────────────────────────────────────────────── */
.panel-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--t-base);
  z-index: 99;
}
.panel-overlay.open { opacity: 1; pointer-events: all; }

.panel {
  position: fixed;
  top: 0;
  right: 0;
  height: 100vh;
  background: rgba(20,20,26,0.85);
  backdrop-filter: var(--lg-blur-heavy);
  -webkit-backdrop-filter: var(--lg-blur-heavy);
  border-left: 1px solid var(--lg-border);
  border-top-color: var(--lg-border-top);
  box-shadow:
    0 0 0 0.5px rgba(0,0,0,0.6),
    0 24px 80px rgba(0,0,0,0.65),
    0 8px 24px rgba(0,0,0,0.4),
    inset 0 1px 0 rgba(255,255,255,0.09),
    inset 0 -1px 0 rgba(0,0,0,0.3);
  transform: translateX(100%);
  transition: transform 0.35s cubic-bezier(0.25, 0.1, 0.25, 1);
  z-index: 100;
  display: flex;
  flex-direction: column;
  font-family: inherit;
  overflow: hidden;
  isolation: isolate;
}

.panel::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255,255,255,0.14) 20%,
    rgba(255,255,255,0.14) 80%,
    transparent
  );
  pointer-events: none;
}

.panel > * {
  position: relative;
  z-index: 1;
}

.panel.open { transform: translateX(0); }
.panel-sm { width: 320px; }
.panel-md { width: 420px; }
.panel-lg { width: 740px; }

.panel-header {
  padding: var(--sp-4) 18px;
  border-bottom: 0.5px solid var(--lg-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}
.panel-body {
  flex: 1;
  overflow-y: auto;
  padding: var(--sp-4) 18px;
}
.panel-close {
  background: none;
  border: none;
  color: var(--text-tertiary);
  font-size: 16px;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  font-family: inherit;
}
.panel-close:hover { color: var(--text-primary); }

/* ─── Labels & badges ────────────────────────────────────────────────────── */
.label {
  font-size: var(--fs-micro);
  color: var(--text-tertiary);
  letter-spacing: 1.5px;
  text-transform: uppercase;
  font-weight: 500;
}
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: var(--r-full);
  font-size: var(--fs-micro);
  font-weight: 600;
  letter-spacing: 0.03em;
}
.badge-green  { background: rgba(48,209,88,0.14);   color: var(--ios-green); }
.badge-amber  { background: rgba(255,159,10,0.14);  color: var(--ios-orange); }
.badge-red    { background: rgba(255,69,58,0.14);   color: var(--ios-red); }
.badge-blue   { background: rgba(10,132,255,0.15);  color: var(--ios-blue); }
.badge-purple { background: rgba(191,90,242,0.1);   color: var(--alert-purple); }
.badge-brass, .badge-gold {
  background: var(--gold-fill);
  color: var(--gold-bright);
}
.badge-orange { background: rgba(255,159,10,0.14);  color: var(--ios-orange); }

/* ─── Form inputs ────────────────────────────────────────────────────────── */
.input {
  width: 100%;
  padding: 10px 14px;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--lg-border);
  border-top-color: rgba(255,255,255,0.10);
  border-radius: var(--r-md);
  color: var(--text-primary);
  font-size: var(--fs-sm);
  font-family: inherit;
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.25), var(--shadow-ring);
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.input::placeholder { color: var(--text-disabled); }
.input:focus {
  outline: none;
  border-color: rgba(181,149,90,0.45);
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.2), 0 0 0 3px rgba(181,149,90,0.12);
}

/* ─── Animations ─────────────────────────────────────────────────────────── */
@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 0.4; }
  50% { transform: scale(1.8); opacity: 0; }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes cardEntrance {
  from { opacity: 0; transform: translateY(12px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes panelEntrance {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.96);
    backdrop-filter: blur(0px);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
    backdrop-filter: var(--lg-blur-heavy);
  }
}
@keyframes glassReveal {
  from {
    opacity: 0;
    transform: scale(0.98);
    backdrop-filter: blur(0px);
  }
  to {
    opacity: 1;
    transform: scale(1);
    backdrop-filter: var(--lg-blur);
  }
}
@keyframes liquidPulse {
  0%, 100% {
    box-shadow: 0 0 0 0 currentColor;
    opacity: 1;
  }
  50% {
    box-shadow: 0 0 0 5px transparent;
    opacity: 0.8;
  }
}

.pulse-wrap {
  position: relative;
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 7px;
  flex-shrink: 0;
}
.pulse-outer {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  animation: pulse 2s infinite;
  opacity: 0.4;
}
.pulse-inner {
  position: absolute;
  inset: 1px;
  border-radius: 50%;
}

/* Staggered card entrance */
.stagger-enter > * {
  animation: cardEntrance 0.4s cubic-bezier(0.25, 0.1, 0.25, 1) both;
}
.stagger-enter > *:nth-child(1) { animation-delay: 0.00s; }
.stagger-enter > *:nth-child(2) { animation-delay: 0.05s; }
.stagger-enter > *:nth-child(3) { animation-delay: 0.10s; }
.stagger-enter > *:nth-child(4) { animation-delay: 0.15s; }
.stagger-enter > *:nth-child(5) { animation-delay: 0.20s; }
.stagger-enter > *:nth-child(6) { animation-delay: 0.25s; }
.stagger-enter > *:nth-child(7) { animation-delay: 0.30s; }
.stagger-enter > *:nth-child(8) { animation-delay: 0.35s; }

/* Respect motion preferences — slow down, don't kill */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 3s !important;
    transition-duration: 0.5s !important;
  }
}

/* ─── Mobile — reduced blur for performance ──────────────────────────────── */
@media (max-width: 768px) {
  .sidebar, .topbar {
    backdrop-filter: blur(20px) saturate(160%);
    -webkit-backdrop-filter: blur(20px) saturate(160%);
  }
  .card, .metric-card {
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
  }
}

/* ─── Dividers ───────────────────────────────────────────────────────────── */
hr, .divider {
  border: none;
  height: 0.5px;
  background: var(--divide-subtle);
  margin: var(--sp-3) 0;
}

/* ─── Utility ────────────────────────────────────────────────────────────── */
.serif { font-family: 'Playfair Display', Georgia, serif; }
.mono  { font-variant-numeric: tabular-nums; }
.truncate { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.text-2 { color: var(--text-secondary); }
.text-3 { color: var(--text-tertiary); }
.text-brass { color: var(--gold); }

/* ════════════════════════════════════════════════════════════════════════════
   MISSION CONTROL — 187N reskin override  (appended; loads on every page)
   Remaps the existing design tokens to the command-center look:
   near-black flat surfaces · brass emphasis · green = system-live (no neon red).
   Token-level only — markup & page JS untouched. Revert: delete this block
   + the @import at the top of this file.
   ════════════════════════════════════════════════════════════════════════════ */
:root {
  /* Surfaces → 187N near-black */
  --bg:            #000000;
  --surface:       #040405;
  --card:          #08080A;
  --hover:         rgba(245,245,247,0.05);
  --border:        rgba(245,245,247,0.12);

  /* Flatten Liquid Glass → solid near-black, hairline edges, no blur */
  --lg-fill:        #050506;
  --lg-fill-hover:  #0B0B0D;
  --lg-fill-active: #101013;
  --lg-border:      rgba(245,245,247,0.12);
  --lg-border-top:  rgba(245,245,247,0.20);
  --lg-border-bot:  rgba(0,0,0,0.45);
  --lg-blur:        saturate(110%);
  --lg-blur-heavy:  saturate(115%);
  --lg-shadow:      0 1px 0 rgba(255,255,255,0.03) inset, 0 18px 50px -28px rgba(0,0,0,0.9);
  --lg-shadow-sm:   0 1px 0 rgba(255,255,255,0.03) inset, 0 10px 30px -22px rgba(0,0,0,0.85);
  --glass-bg:       #060607;
  --glass-border:   rgba(245,245,247,0.10);
  --glass-blur:     saturate(110%);

  /* Brass stays the one brand accent (already #B5955A) */

  /* A (mc.css) token aliases → command-center snippets paste cleanly into any page */
  --accent:      #B5955A;
  --canvas:      #000000;
  --surface-1:   #040405;
  --surface-2:   #08080A;
  --shell:       #060607;
  --live:        #46D38A;
  --radius:      16px;
  --radius-sm:   10px;

  /* Status → 187N: green = live/up, softened amber-red for true errors (no neon) */
  --ios-green:   #46D38A;
  --alert-green: #46D38A;
  --ios-red:     #CE7A72;
  --alert-red:   #CE7A72;
  --ios-orange:  #C9A86B;
  --alert-amber: #C9A86B;

  /* Text → 187N muted whites */
  --text-2:          rgba(245,245,247,0.62);
  --text-3:          rgba(245,245,247,0.42);
  --text-secondary:  rgba(245,245,247,0.62);
  --text-tertiary:   rgba(245,245,247,0.40);
}

body {
  font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', sans-serif;
  background-color: #000;
  background-image:
    radial-gradient(1100px 620px at 82% -8%, rgba(181,149,90,0.07), transparent 60%),
    radial-gradient(820px 520px at -5% 8%, rgba(245,245,247,0.035), transparent 55%);
  background-attachment: fixed;
}
h1, h2, h3 { font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, sans-serif; }

/* Tabular condensed numerals where the app already opts in via .mono / .tabular */
.mono, .tabular, .stat-num { font-family: 'Saira Condensed', 'Montserrat', sans-serif; font-variant-numeric: tabular-nums; }
