/* ============================================================
   DEAL VAULT — DESIGN SYSTEM v3.0
   Premium Silver & Blue | Apple Liquid-Glass Aesthetic
   ============================================================ */

/* ── Google Fonts ── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=Space+Grotesk:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600&display=swap');

/* ============================================================
   1. DESIGN TOKENS
   ============================================================ */
:root {
  /* ── Primary Blue Palette ── */
  --blue-50:  #EFF6FF;
  --blue-100: #DBEAFE;
  --blue-200: #BFDBFE;
  --blue-300: #93C5FD;
  --blue-400: #60A5FA;
  --blue-500: #3B82F6;
  --blue-600: #2563EB;
  --blue-700: #1D4ED8;
  --blue-800: #1E40AF;
  --blue-900: #1E3A8A;
  --vault-blue: #1A56DB;
  --vault-blue-bright: #3B7BFF;
  --vault-blue-deep: #0F3EB1;
  --vault-blue-glow: rgba(26, 86, 219, 0.35);

  /* ── Silver Palette ── */
  --silver-50:  #F8FAFC;
  --silver-100: #F1F5F9;
  --silver-200: #E2E8F0;
  --silver-300: #CBD5E1;
  --silver-400: #94A3B8;
  --silver-500: #64748B;
  --silver-600: #475569;
  --silver-700: #334155;
  --silver-800: #1E293B;
  --silver-900: #0F172A;
  --silver-chrome: #C8D4E8;
  --silver-sheen: rgba(200, 212, 232, 0.6);

  /* ── Accent Colors ── */
  --teal: #0D9488;
  --teal-light: #14B8A6;
  --emerald: #10B981;
  --amber: #F59E0B;
  --rose: #F43F5E;
  --violet: #8B5CF6;
  --cyan: #06B6D4;

  /* ── Semantic Colors ── */
  --color-success: #10B981;
  --color-warning: #F59E0B;
  --color-danger:  #F43F5E;
  --color-info:    #3B82F6;

  /* ── Canvas & Surface ── */
  --canvas:     #070B14;
  --canvas-mid: #0A1020;
  --canvas-top: #0D1428;
  --card:       rgba(255, 255, 255, 0.05);
  --card-hover: rgba(255, 255, 255, 0.08);
  --surface:    rgba(15, 23, 42, 0.8);

  /* ── Text ── */
  --ink:        #F1F5F9;
  --ink-mid:    #94A3B8;
  --ink-muted:  #475569;
  --ink-inverse:#0F172A;

  /* ── Borders ── */
  --border:        rgba(148, 163, 184, 0.15);
  --border-hover:  rgba(59, 123, 255, 0.4);
  --border-active: rgba(59, 123, 255, 0.7);
  --border-glass:  rgba(255, 255, 255, 0.12);
  --border-silver: rgba(200, 212, 232, 0.2);

  /* ── Spacing Scale (8pt grid) ── */
  --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;
  --space-20: 80px;
  --space-24: 96px;
  --space-32: 128px;

  /* ── Border Radii ── */
  --radius-xs: 4px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-2xl:24px;
  --radius-3xl:32px;
  --radius-full:9999px;

  /* ── Typography ── */
  --font-sans:    'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-display: 'Space Grotesk', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono:    'JetBrains Mono', 'SF Mono', 'Fira Code', monospace;

  /* Type Scale */
  --text-xs:   11px;
  --text-sm:   13px;
  --text-base: 15px;
  --text-md:   16px;
  --text-lg:   18px;
  --text-xl:   20px;
  --text-2xl:  24px;
  --text-3xl:  30px;
  --text-4xl:  36px;
  --text-5xl:  48px;
  --text-6xl:  60px;
  --text-7xl:  72px;
  --text-8xl:  96px;

  /* ── Elevation / Shadows ── */
  --shadow-sm:   0 1px 3px rgba(0,0,0,0.4), 0 1px 2px rgba(0,0,0,0.3);
  --shadow-md:   0 4px 16px rgba(0,0,0,0.5), 0 2px 8px rgba(0,0,0,0.3);
  --shadow-lg:   0 8px 32px rgba(0,0,0,0.6), 0 4px 16px rgba(0,0,0,0.4);
  --shadow-xl:   0 20px 60px rgba(0,0,0,0.7), 0 8px 30px rgba(0,0,0,0.5);
  --shadow-2xl:  0 40px 100px rgba(0,0,0,0.8);
  --shadow-blue: 0 0 30px rgba(26, 86, 219, 0.4), 0 0 60px rgba(26, 86, 219, 0.15);
  --shadow-glow: 0 0 40px rgba(59, 123, 255, 0.3);
  --shadow-inset:inset 0 1px 0 rgba(255,255,255,0.1), inset 0 -1px 0 rgba(0,0,0,0.2);

  /* ── Transitions ── */
  --ease-spring:  cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-smooth:  cubic-bezier(0.4, 0, 0.2, 1);
  --ease-snap:    cubic-bezier(0.2, 0, 0, 1);
  --ease-out:     cubic-bezier(0, 0, 0.2, 1);
  --ease-in:      cubic-bezier(0.4, 0, 1, 1);
  --duration-fast:   150ms;
  --duration-base:   250ms;
  --duration-slow:   400ms;
  --duration-slower: 600ms;
  --duration-lazy:   800ms;

  /* ── Z-Index Scale ── */
  --z-below:   -1;
  --z-base:     0;
  --z-raised:   10;
  --z-dropdown: 100;
  --z-sticky:   200;
  --z-overlay:  300;
  --z-modal:    400;
  --z-toast:    500;
  --z-cursor:   9999;

  /* ── Layout ── */
  --sidebar-width: 260px;
  --topbar-height: 60px;
  --max-content:  1280px;
}

/* ============================================================
   2. RESET & BASE
   ============================================================ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  color: var(--ink);
  background: var(--canvas);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.6;
}

/* Selection */
::selection {
  background: rgba(59, 123, 255, 0.3);
  color: #fff;
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.25);
  border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover { background: rgba(148, 163, 184, 0.45); }

/* ============================================================
   3. TYPOGRAPHY
   ============================================================ */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  color: var(--ink);
  line-height: 1.2;
  letter-spacing: -0.02em;
}

h1 { font-size: var(--text-5xl); font-weight: 800; }
h2 { font-size: var(--text-4xl); font-weight: 700; }
h3 { font-size: var(--text-3xl); font-weight: 600; }
h4 { font-size: var(--text-2xl); font-weight: 600; }
h5 { font-size: var(--text-xl);  font-weight: 600; }
h6 { font-size: var(--text-lg);  font-weight: 600; }

p { line-height: 1.7; color: var(--ink-mid); }
a { color: var(--vault-blue-bright); text-decoration: none; transition: color var(--duration-fast) var(--ease-smooth); }
a:hover { color: #fff; }

code, pre {
  font-family: var(--font-mono);
  font-size: 0.9em;
  background: rgba(255,255,255,0.05);
  border-radius: var(--radius-sm);
}
code { padding: 2px 6px; }
pre  { padding: var(--space-4); overflow-x: auto; }

/* ── Text Utilities ── */
.text-xs     { font-size: var(--text-xs); }
.text-sm     { font-size: var(--text-sm); }
.text-base   { font-size: var(--text-base); }
.text-lg     { font-size: var(--text-lg); }
.text-xl     { font-size: var(--text-xl); }
.text-2xl    { font-size: var(--text-2xl); }
.text-3xl    { font-size: var(--text-3xl); }
.text-gradient {
  background: linear-gradient(135deg, #fff 0%, var(--silver-chrome) 40%, var(--vault-blue-bright) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.text-blue-gradient {
  background: linear-gradient(135deg, var(--vault-blue-bright) 0%, var(--cyan) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.text-muted  { color: var(--ink-mid) !important; }
.text-dim    { color: var(--ink-muted) !important; }
.text-white  { color: #fff !important; }
.text-blue   { color: var(--vault-blue-bright) !important; }
.font-light  { font-weight: 300; }
.font-normal { font-weight: 400; }
.font-medium { font-weight: 500; }
.font-semi   { font-weight: 600; }
.font-bold   { font-weight: 700; }
.font-black  { font-weight: 900; }
.tracking-tight  { letter-spacing: -0.04em; }
.tracking-normal { letter-spacing: 0; }
.tracking-wide   { letter-spacing: 0.05em; }
.tracking-wider  { letter-spacing: 0.1em; }
.uppercase       { text-transform: uppercase; }

/* ============================================================
   4. LAYOUT UTILITIES
   ============================================================ */
.container { width: 100%; max-width: var(--max-content); margin: 0 auto; padding: 0 var(--space-8); }
.flex      { display: flex; }
.flex-col  { display: flex; flex-direction: column; }
.items-center  { align-items: center; }
.items-start   { align-items: flex-start; }
.items-end     { align-items: flex-end; }
.justify-center{ justify-content: center; }
.justify-between{ justify-content: space-between; }
.justify-end   { justify-content: flex-end; }
.gap-1  { gap: var(--space-1); }
.gap-2  { gap: var(--space-2); }
.gap-3  { gap: var(--space-3); }
.gap-4  { gap: var(--space-4); }
.gap-6  { gap: var(--space-6); }
.gap-8  { gap: var(--space-8); }
.grid   { display: grid; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--space-6); }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-6); }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--space-6); }
.w-full  { width: 100%; }
.h-full  { height: 100%; }
.min-h-screen { min-height: 100vh; }
.relative { position: relative; }
.absolute { position: absolute; }
.fixed    { position: fixed; }
.inset-0  { inset: 0; }
.overflow-hidden { overflow: hidden; }
.overflow-auto   { overflow: auto; }
.hidden  { display: none !important; }
.block   { display: block; }
.inline  { display: inline; }
.inline-flex { display: inline-flex; }

/* Spacing */
.p-0  { padding: 0 !important; }
.p-2  { padding: var(--space-2); }
.p-4  { padding: var(--space-4); }
.p-6  { padding: var(--space-6); }
.p-8  { padding: var(--space-8); }
.px-4 { padding-left: var(--space-4); padding-right: var(--space-4); }
.px-6 { padding-left: var(--space-6); padding-right: var(--space-6); }
.py-2 { padding-top: var(--space-2); padding-bottom: var(--space-2); }
.py-4 { padding-top: var(--space-4); padding-bottom: var(--space-4); }
.mt-2 { margin-top: var(--space-2); }
.mt-4 { margin-top: var(--space-4); }
.mt-6 { margin-top: var(--space-6); }
.mt-8 { margin-top: var(--space-8); }
.mb-2 { margin-bottom: var(--space-2); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-6 { margin-bottom: var(--space-6); }
.mb-8 { margin-bottom: var(--space-8); }
.mx-auto { margin-left: auto; margin-right: auto; }

/* ============================================================
   5. BUTTON SYSTEM
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 11px 24px;
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  font-weight: 600;
  letter-spacing: 0.01em;
  border: none;
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all var(--duration-base) var(--ease-spring);
  white-space: nowrap;
  text-decoration: none;
  position: relative;
  overflow: hidden;
  min-height: 44px;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

.btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0);
  transition: background var(--duration-fast) var(--ease-smooth);
  border-radius: inherit;
}
.btn:hover::before { background: rgba(255,255,255,0.06); }
.btn:active { transform: scale(0.97); }

/* Primary */
.btn-primary {
  background: linear-gradient(135deg, var(--vault-blue) 0%, var(--vault-blue-bright) 100%);
  color: #fff;
  box-shadow: 0 4px 20px rgba(26,86,219,0.45), var(--shadow-inset);
  border: 1px solid rgba(255,255,255,0.15);
}
.btn-primary:hover {
  box-shadow: 0 6px 30px rgba(26,86,219,0.65), var(--shadow-inset);
  transform: translateY(-1px);
}

/* Secondary (glass) */
.btn-secondary {
  background: rgba(255,255,255,0.07);
  color: var(--ink);
  border: 1px solid var(--border-glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.btn-secondary:hover {
  background: rgba(255,255,255,0.12);
  border-color: var(--border-hover);
  color: #fff;
}

/* Ghost */
.btn-ghost {
  background: transparent;
  color: var(--ink-mid);
  border: 1px solid transparent;
}
.btn-ghost:hover {
  background: rgba(255,255,255,0.06);
  color: var(--ink);
  border-color: var(--border-glass);
}

/* Danger */
.btn-danger {
  background: linear-gradient(135deg, #be123c, var(--rose));
  color: #fff;
  box-shadow: 0 4px 20px rgba(244, 63, 94, 0.35);
}

/* Success */
.btn-success {
  background: linear-gradient(135deg, #059669, var(--emerald));
  color: #fff;
  box-shadow: 0 4px 20px rgba(16, 185, 129, 0.35);
}

/* Sizes */
.btn-xs { padding: 6px 12px; font-size: var(--text-xs); min-height: 28px; border-radius: var(--radius-sm); }
.btn-sm { padding: 8px 16px; font-size: var(--text-xs); min-height: 36px; border-radius: var(--radius-md); }
.btn-lg { padding: 14px 32px; font-size: var(--text-md); min-height: 52px; border-radius: var(--radius-xl); }
.btn-xl { padding: 18px 40px; font-size: var(--text-lg); min-height: 60px; border-radius: var(--radius-2xl); }
.btn-icon { padding: 10px; width: 44px; height: 44px; }
.btn-icon-sm { padding: 7px; width: 34px; height: 34px; border-radius: var(--radius-md); }
.btn-full { width: 100%; }

/* Disabled */
.btn:disabled, .btn[disabled] {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}

/* Loading spinner */
.btn.loading::after {
  content: '';
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  margin-left: var(--space-2);
}

/* ============================================================
   6. FORM ELEMENTS
   ============================================================ */
.form-group { display: flex; flex-direction: column; gap: var(--space-2); }

.form-label {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--ink-mid);
  letter-spacing: 0.01em;
}

.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 11px 16px;
  font-family: var(--font-sans);
  font-size: var(--text-base);
  color: var(--ink);
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  outline: none;
  transition: all var(--duration-base) var(--ease-smooth);
  min-height: 44px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.form-input::placeholder, .form-textarea::placeholder { color: var(--ink-muted); }

.form-input:hover, .form-select:hover, .form-textarea:hover {
  border-color: var(--border-silver);
  background: rgba(255,255,255,0.08);
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--vault-blue-bright);
  background: rgba(255,255,255,0.09);
  box-shadow: 0 0 0 3px rgba(59,123,255,0.15);
}

.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' viewBox='0 0 24 24'%3E%3Cpath stroke='%2394A3B8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 40px;
  cursor: pointer;
}

.form-textarea { resize: vertical; min-height: 100px; line-height: 1.6; }

.form-error {
  font-size: var(--text-xs);
  color: var(--rose);
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ── Checkbox & Radio ── */
.form-check {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  cursor: pointer;
}
.form-check input[type="checkbox"],
.form-check input[type="radio"] {
  width: 18px; height: 18px;
  accent-color: var(--vault-blue-bright);
  cursor: pointer;
}

/* ============================================================
   7. BADGE / CHIP SYSTEM
   ============================================================ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  font-size: var(--text-xs);
  font-weight: 600;
  border-radius: var(--radius-full);
  white-space: nowrap;
  letter-spacing: 0.02em;
}

.badge-blue    { background: rgba(59,123,255,0.15); color: #93C5FD; border: 1px solid rgba(59,123,255,0.25); }
.badge-green   { background: rgba(16,185,129,0.15); color: #6EE7B7; border: 1px solid rgba(16,185,129,0.25); }
.badge-amber   { background: rgba(245,158,11,0.15); color: #FCD34D; border: 1px solid rgba(245,158,11,0.25); }
.badge-red     { background: rgba(244,63,94,0.15);  color: #FDA4AF; border: 1px solid rgba(244,63,94,0.25);  }
.badge-violet  { background: rgba(139,92,246,0.15); color: #C4B5FD; border: 1px solid rgba(139,92,246,0.25); }
.badge-silver  { background: rgba(200,212,232,0.1); color: var(--silver-chrome); border: 1px solid var(--border-silver); }
.badge-dot::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

/* ============================================================
   8. APP LAYOUT
   ============================================================ */
.app-layout {
  display: flex;
  height: 100vh;
  overflow: hidden;
  background: var(--canvas);
}

/* ── Sidebar ── */
.sidebar {
  width: var(--sidebar-width);
  height: 100vh;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  border-right: 1px solid var(--border);
  overflow: hidden;
  transition: width var(--duration-slow) var(--ease-snap);
  position: relative;
  z-index: var(--z-sticky);
}

.sidebar.collapsed { width: 64px; }

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-5) var(--space-5);
  border-bottom: 1px solid var(--border);
  height: var(--topbar-height);
  flex-shrink: 0;
}

.logo-mark {
  width: 32px; height: 32px;
  background: linear-gradient(135deg, var(--vault-blue), var(--vault-blue-bright));
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 800;
  color: #fff;
  flex-shrink: 0;
  box-shadow: 0 4px 16px rgba(26,86,219,0.4);
}

.logo-text {
  font-size: var(--text-base);
  font-weight: 700;
  letter-spacing: -0.02em;
  white-space: nowrap;
  overflow: hidden;
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: var(--space-4) var(--space-3);
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.nav-section-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-muted);
  padding: var(--space-4) var(--space-3) var(--space-2);
  white-space: nowrap;
  overflow: hidden;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: 10px var(--space-3);
  border-radius: var(--radius-md);
  color: var(--ink-mid);
  font-size: var(--text-sm);
  font-weight: 500;
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-smooth);
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  position: relative;
  min-height: 40px;
}

.nav-item:hover {
  background: rgba(255,255,255,0.06);
  color: var(--ink);
}

.nav-item.active {
  background: rgba(26,86,219,0.18);
  color: var(--vault-blue-bright);
  font-weight: 600;
}

.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0; top: 20%; bottom: 20%;
  width: 3px;
  background: var(--vault-blue-bright);
  border-radius: 0 3px 3px 0;
}

.nav-item i, .nav-item svg {
  width: 18px;
  font-size: 16px;
  flex-shrink: 0;
  text-align: center;
}

.nav-item .nav-badge {
  margin-left: auto;
  background: var(--vault-blue);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: var(--radius-full);
  flex-shrink: 0;
}

.sidebar-footer {
  padding: var(--space-4) var(--space-3);
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

/* ── Main Content Area ── */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
}

/* ── Top Bar ── */
.topbar {
  height: var(--topbar-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-6);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  gap: var(--space-4);
  position: relative;
  z-index: var(--z-raised);
}

.topbar-search {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 8px 14px;
  cursor: pointer;
  transition: all var(--duration-base) var(--ease-smooth);
  min-width: 220px;
}
.topbar-search:hover {
  background: rgba(255,255,255,0.1);
  border-color: var(--border-silver);
}
.topbar-search input {
  background: transparent;
  border: none;
  outline: none;
  color: var(--ink);
  font-size: var(--text-sm);
  width: 100%;
}
.topbar-search input::placeholder { color: var(--ink-muted); }

.topbar-actions { display: flex; align-items: center; gap: var(--space-2); }

.topbar-avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--vault-blue), var(--vault-blue-bright));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-sm);
  font-weight: 700;
  color: #fff;
  cursor: pointer;
  border: 2px solid rgba(255,255,255,0.1);
  transition: all var(--duration-fast) var(--ease-spring);
}
.topbar-avatar:hover {
  border-color: var(--vault-blue-bright);
  transform: scale(1.05);
}

/* Page content scroll */
.page-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: var(--space-8);
}

/* ============================================================
   9. CARD SYSTEM
   ============================================================ */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: var(--space-6);
  transition: all var(--duration-base) var(--ease-smooth);
}

.card-hover:hover {
  background: var(--card-hover);
  border-color: var(--border-silver);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-5);
}

.card-title {
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.01em;
}

.card-subtitle {
  font-size: var(--text-sm);
  color: var(--ink-mid);
  margin-top: 2px;
}

/* Stat Card */
.stat-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: var(--space-6);
  position: relative;
  overflow: hidden;
  transition: all var(--duration-base) var(--ease-smooth);
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--vault-blue-bright), transparent);
  opacity: 0;
  transition: opacity var(--duration-base) var(--ease-smooth);
}

.stat-card:hover { border-color: var(--border-silver); }
.stat-card:hover::before { opacity: 1; }

.stat-icon {
  width: 44px; height: 44px;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-xl);
  margin-bottom: var(--space-4);
}

.stat-value {
  font-size: var(--text-3xl);
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--ink);
  line-height: 1;
}

.stat-label {
  font-size: var(--text-sm);
  color: var(--ink-mid);
  margin-top: var(--space-1);
}

.stat-change {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: var(--text-xs);
  font-weight: 600;
  margin-top: var(--space-2);
}
.stat-change.up   { color: var(--emerald); }
.stat-change.down { color: var(--rose); }

/* ============================================================
   10. TABLE SYSTEM
   ============================================================ */
.table-wrap {
  width: 100%;
  overflow-x: auto;
  border-radius: var(--radius-xl);
  border: 1px solid var(--border);
}

table {
  width: 100%;
  border-collapse: collapse;
}

thead tr {
  border-bottom: 1px solid var(--border);
}

th {
  padding: 12px var(--space-4);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-muted);
  text-align: left;
  white-space: nowrap;
}

td {
  padding: 14px var(--space-4);
  font-size: var(--text-sm);
  color: var(--ink-mid);
  border-bottom: 1px solid var(--border);
  transition: background var(--duration-fast) var(--ease-smooth);
}

tbody tr:hover td { background: rgba(255,255,255,0.03); }
tbody tr:last-child td { border-bottom: none; }

/* ============================================================
   11. MODAL SYSTEM
   ============================================================ */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(7,11,20,0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: var(--z-modal);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
  opacity: 0;
  transition: opacity var(--duration-base) var(--ease-smooth);
}
.modal-backdrop.show { opacity: 1; }

.modal-box {
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  border-radius: var(--radius-2xl);
  padding: var(--space-8);
  position: relative;
  transform: scale(0.95) translateY(20px);
  transition: transform var(--duration-slow) var(--ease-spring);
  box-shadow: var(--shadow-2xl);
}
.modal-backdrop.show .modal-box {
  transform: scale(1) translateY(0);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-6);
}

.modal-title {
  font-size: var(--text-xl);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.modal-close {
  width: 32px; height: 32px;
  border-radius: var(--radius-md);
  background: rgba(255,255,255,0.06);
  border: none;
  color: var(--ink-mid);
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--duration-fast) var(--ease-smooth);
}
.modal-close:hover { background: rgba(255,255,255,0.12); color: var(--ink); }

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-3);
  margin-top: var(--space-6);
  padding-top: var(--space-6);
  border-top: 1px solid var(--border);
}

/* ============================================================
   12. TAB SYSTEM
   ============================================================ */
.tab-bar {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  border-bottom: 1px solid var(--border);
  padding: 0 var(--space-6);
  overflow-x: auto;
  scrollbar-width: none;
  flex-shrink: 0;
}
.tab-bar::-webkit-scrollbar { display: none; }

.tab-btn {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: 14px 16px;
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--ink-muted);
  border: none;
  background: none;
  cursor: pointer;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: all var(--duration-fast) var(--ease-smooth);
  position: relative;
}

.tab-btn:hover { color: var(--ink-mid); }

.tab-btn.active {
  color: var(--vault-blue-bright);
  font-weight: 600;
  border-bottom-color: var(--vault-blue-bright);
}

.tab-content { display: none; }
.tab-content.active { display: block; }

/* ============================================================
   13. PAGE HEADER
   ============================================================ */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: var(--space-8);
  gap: var(--space-4);
  flex-wrap: wrap;
}

.page-title {
  font-size: var(--text-3xl);
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--ink);
}

.page-subtitle {
  font-size: var(--text-base);
  color: var(--ink-mid);
  margin-top: var(--space-1);
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  color: var(--ink-muted);
  margin-bottom: var(--space-4);
}
.breadcrumb a { color: var(--ink-mid); }
.breadcrumb a:hover { color: var(--vault-blue-bright); }
.breadcrumb-sep { opacity: 0.4; }

/* ============================================================
   14. ACTIVITY FEED
   ============================================================ */
.activity-item {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--border);
  transition: all var(--duration-fast);
  cursor: pointer;
}
.activity-item:hover { padding-left: var(--space-2); }
.activity-item:last-child { border-bottom: none; }

.activity-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 6px;
}

.activity-content { flex: 1; min-width: 0; }
.activity-text { font-size: var(--text-sm); color: var(--ink-mid); line-height: 1.5; }
.activity-text strong { color: var(--ink); font-weight: 600; }
.activity-time { font-size: var(--text-xs); color: var(--ink-muted); margin-top: 2px; }

/* ============================================================
   15. AVATAR SYSTEM
   ============================================================ */
.avatar {
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
  background: linear-gradient(135deg, var(--vault-blue), var(--vault-blue-bright));
}
.avatar-xs  { width: 24px; height: 24px; font-size: 10px; }
.avatar-sm  { width: 32px; height: 32px; font-size: 12px; }
.avatar-md  { width: 40px; height: 40px; font-size: 14px; }
.avatar-lg  { width: 56px; height: 56px; font-size: 20px; }
.avatar-xl  { width: 72px; height: 72px; font-size: 26px; }

/* ============================================================
   16. PROGRESS
   ============================================================ */
.progress-bar {
  width: 100%;
  height: 6px;
  background: rgba(255,255,255,0.08);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: var(--radius-full);
  background: linear-gradient(90deg, var(--vault-blue), var(--vault-blue-bright));
  transition: width var(--duration-slower) var(--ease-snap);
  position: relative;
}

.progress-fill::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.3) 50%, transparent 100%);
  animation: shimmer 2s infinite;
}

/* ============================================================
   17. DROPDOWN / MENU
   ============================================================ */
.dropdown {
  position: relative;
  display: inline-flex;
}

.dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 200px;
  border-radius: var(--radius-xl);
  border: 1px solid var(--border-glass);
  padding: var(--space-2);
  z-index: var(--z-dropdown);
  opacity: 0;
  transform: scale(0.96) translateY(-8px);
  transition: all var(--duration-base) var(--ease-spring);
  pointer-events: none;
  box-shadow: var(--shadow-xl);
}

.dropdown-menu.show {
  opacity: 1;
  transform: scale(1) translateY(0);
  pointer-events: all;
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: 9px 14px;
  font-size: var(--text-sm);
  color: var(--ink-mid);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-smooth);
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}
.dropdown-item:hover { background: rgba(255,255,255,0.06); color: var(--ink); }
.dropdown-item.danger:hover { background: rgba(244,63,94,0.1); color: var(--rose); }
.dropdown-sep { height: 1px; background: var(--border); margin: var(--space-2) 0; }

/* ============================================================
   18. TOAST SYSTEM
   ============================================================ */
#toast-container {
  position: fixed;
  bottom: var(--space-6);
  right: var(--space-6);
  z-index: var(--z-toast);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: 14px 18px;
  border-radius: var(--radius-xl);
  font-size: var(--text-sm);
  font-weight: 500;
  pointer-events: all;
  transform: translateX(120%);
  transition: transform var(--duration-slow) var(--ease-spring);
  max-width: 360px;
  min-width: 280px;
  box-shadow: var(--shadow-xl);
  border: 1px solid var(--border-glass);
  cursor: pointer;
}

.toast.show { transform: translateX(0); }
.toast.hide { transform: translateX(120%); }

.toast-icon { font-size: 18px; flex-shrink: 0; }
.toast-msg  { flex: 1; color: var(--ink); }

.toast.success .toast-icon { color: var(--emerald); }
.toast.error   .toast-icon { color: var(--rose); }
.toast.warning .toast-icon { color: var(--amber); }
.toast.info    .toast-icon { color: var(--vault-blue-bright); }

/* ============================================================
   19. EMPTY STATE
   ============================================================ */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--space-16) var(--space-8);
  gap: var(--space-4);
}

.empty-icon {
  width: 72px; height: 72px;
  border-radius: var(--radius-2xl);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border-glass);
  margin-bottom: var(--space-2);
}

.empty-title {
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--ink);
}

.empty-subtitle {
  font-size: var(--text-sm);
  color: var(--ink-muted);
  max-width: 360px;
}

/* ============================================================
   20. ANIMATIONS
   ============================================================ */
@keyframes spin {
  to { transform: rotate(360deg); }
}

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

@keyframes shimmer {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(200%); }
}

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

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.92); }
  to   { opacity: 1; transform: scale(1); }
}

@keyframes slideInRight {
  from { transform: translateX(100%); opacity: 0; }
  to   { transform: translateX(0); opacity: 1; }
}

@keyframes slideInLeft {
  from { transform: translateX(-100%); opacity: 0; }
  to   { transform: translateX(0); opacity: 1; }
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-12px); }
}

@keyframes glow-pulse {
  0%, 100% { box-shadow: 0 0 20px rgba(26,86,219,0.3); }
  50% { box-shadow: 0 0 40px rgba(26,86,219,0.6), 0 0 80px rgba(26,86,219,0.2); }
}

/* ── Animation Classes ── */
.animate-fadeInUp  { animation: fadeInUp 0.6s var(--ease-spring) both; }
.animate-fadeIn    { animation: fadeIn 0.4s var(--ease-smooth) both; }
.animate-scaleIn   { animation-name: scaleIn; animation-duration: 0.4s; animation-timing-function: var(--ease-spring); animation-fill-mode: both; }
.animate-float     { animation: float 4s ease-in-out infinite; }
.animate-pulse     { animation: pulse 2s ease-in-out infinite; }
.animate-spin      { animation: spin 1s linear infinite; }
.animate-glow      { animation: glow-pulse 3s ease-in-out infinite; }

/* Stagger delays */
.delay-100 { animation-delay: 100ms; }
.delay-200 { animation-delay: 200ms; }
.delay-300 { animation-delay: 300ms; }
.delay-400 { animation-delay: 400ms; }
.delay-500 { animation-delay: 500ms; }
.delay-600 { animation-delay: 600ms; }
.delay-700 { animation-delay: 700ms; }
.delay-800 { animation-delay: 800ms; }

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

/* ============================================================
   21. RESPONSIVE BREAKPOINTS
   ============================================================ */
@media (max-width: 1200px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 900px) {
  :root { --sidebar-width: 0px; }
  .sidebar { display: none; }
  .sidebar.mobile-open {
    display: flex;
    position: fixed;
    left: 0; top: 0; bottom: 0;
    width: 280px;
    z-index: var(--z-overlay);
  }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .grid-2 { grid-template-columns: 1fr; }
  .page-scroll { padding: var(--space-4); }
  .page-header { flex-direction: column; }
}

@media (max-width: 600px) {
  .grid-3 { grid-template-columns: 1fr; }
  .grid-4 { grid-template-columns: 1fr; }
  .tab-btn { padding: 12px 10px; }
  h1 { font-size: var(--text-4xl); }
  h2 { font-size: var(--text-3xl); }
}

/* ============================================================
   22. LIGHT MODE — COMPLETE VARIABLE OVERRIDE
   Append this at the very end of design-system.css
   ============================================================ */
body.light-mode,
html.light-mode body {
  --canvas: #F0F4F8;
  --canvas-mid: #E8EDF4;
  --canvas-top: #FFFFFF;
  --ink: #1E293B !important;
  --ink-mid: #475569 !important;
  --ink-muted: #64748B !important;
  --ink-inverse: #F1F5F9;
  --card: rgba(255,255,255,0.7);
  --card-hover: rgba(255,255,255,0.9);
  --surface: rgba(255,255,255,0.85);
  --border: rgba(0,0,0,0.08);
  --border-hover: rgba(26,86,219,0.3);
  --border-active: rgba(26,86,219,0.5);
  --border-glass: rgba(0,0,0,0.06);
  --border-silver: rgba(0,0,0,0.12);
  --silver-chrome: #475569;
  --silver-sheen: rgba(30,41,59,0.15);
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.10);
  --shadow-xl: 0 20px 60px rgba(0,0,0,0.12);
  --shadow-2xl: 0 40px 100px rgba(0,0,0,0.15);
  background: #F0F4F8 !important;
  color: #1E293B !important;
}

/* Force headings dark */
body.light-mode h1, body.light-mode h2,
body.light-mode h3, body.light-mode h4,
body.light-mode h5, body.light-mode h6 {
  color: #0F172A !important;
}

/* Paragraphs */
body.light-mode p { color: #475569 !important; }

/* Links */
body.light-mode a:hover { color: #1A56DB; }

/* Nav sidebar */
body.light-mode .nav-item { color: #475569; }
body.light-mode .nav-item:hover { color: #1E293B; background: rgba(0,0,0,0.04); }
body.light-mode .nav-item.active { color: #1A56DB; background: rgba(26,86,219,0.08); }
body.light-mode .nav-section-label { color: #64748B; }

/* Cards & surfaces */
body.light-mode .card,
body.light-mode .stat-card { background: rgba(255,255,255,0.7); border-color: rgba(0,0,0,0.08); }
body.light-mode .card-title { color: #1E293B; }
body.light-mode .stat-value { color: #0F172A; }
body.light-mode .stat-label { color: #475569; }

/* Tables */
body.light-mode td { color: #475569; }
body.light-mode th { color: #64748B; }
body.light-mode tbody tr:hover td { background: rgba(0,0,0,0.02); }

/* Forms */
body.light-mode .form-input,
body.light-mode .form-select,
body.light-mode .form-textarea {
  color: #1E293B; background: rgba(255,255,255,0.8);
  border-color: rgba(0,0,0,0.12);
}
body.light-mode .form-label { color: #475569; }

/* Buttons */
body.light-mode .btn-secondary { color: #1E293B; background: rgba(0,0,0,0.04); border-color: rgba(0,0,0,0.1); }
body.light-mode .btn-secondary:hover { color: #0F172A; background: rgba(0,0,0,0.08); }
body.light-mode .btn-ghost { color: #475569; }
body.light-mode .btn-ghost:hover { color: #1E293B; background: rgba(0,0,0,0.04); }

/* Toasts */
body.light-mode .toast { background: rgba(255,255,255,0.95); border-color: rgba(0,0,0,0.08); }
body.light-mode .toast .toast-msg { color: #1E293B; }

/* Badges */
body.light-mode .badge-silver { color: #475569; background: rgba(0,0,0,0.05); }
body.light-mode .badge-blue { color: #1D4ED8; background: rgba(59,123,255,0.08); }

/* Dropdowns */
body.light-mode .dropdown-menu { background: #fff; border-color: rgba(0,0,0,0.08); }
body.light-mode .dropdown-item { color: #475569; }
body.light-mode .dropdown-item:hover { color: #1E293B; background: rgba(0,0,0,0.04); }

/* Modal */
body.light-mode .modal-box { background: #fff; }
body.light-mode .modal-title { color: #0F172A; }
body.light-mode .modal-close { background: rgba(0,0,0,0.05); color: #475569; }

/* Tab bar */
body.light-mode .tab-btn { color: #64748B; }
body.light-mode .tab-btn:hover { color: #475569; }
body.light-mode .tab-btn.active { color: #1A56DB; }

/* Scrollbar */
body.light-mode ::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.15); }
body.light-mode ::-webkit-scrollbar-thumb:hover { background: rgba(0,0,0,0.25); }

/* App layout */
body.light-mode .app-layout { background: #F0F4F8; }
body.light-mode .main-content { background: #F0F4F8; }
body.light-mode .page-scroll { background: #F0F4F8; }

/* Topbar */
body.light-mode .topbar {
  background: rgba(255,255,255,0.97) !important;
  border-bottom-color: rgba(0,0,0,0.07) !important;
  box-shadow: 0 1px 0 rgba(0,0,0,0.06), 0 4px 16px rgba(0,0,0,0.06) !important;
}
body.light-mode .topbar-btn {
  background: rgba(0,0,0,0.04) !important;
  border-color: rgba(0,0,0,0.08) !important;
  color: #475569 !important;
}
body.light-mode .topbar-btn:hover { background: rgba(0,0,0,0.07) !important; color: #1E293B !important; }
body.light-mode .topbar-search { background: rgba(0,0,0,0.04) !important; border-color: rgba(0,0,0,0.08) !important; }
body.light-mode .topbar-search input { color: #475569 !important; }
body.light-mode .topbar-search input::placeholder { color: #94A3B8 !important; }

/* Tab bars */
body.light-mode .tab-bar { background: rgba(255,255,255,0.95) !important; border-bottom-color: rgba(0,0,0,0.07) !important; }
body.light-mode .tab-btn { color: #64748B !important; }
body.light-mode .tab-btn:hover { color: #1E293B !important; }
body.light-mode .tab-btn.active { color: #1A56DB !important; border-bottom-color: #1A56DB !important; }

/* Glass panels */
body.light-mode .glass-panel { background: rgba(255,255,255,0.92) !important; border-color: rgba(0,0,0,0.07) !important; box-shadow: 0 2px 12px rgba(0,0,0,0.06) !important; }
body.light-mode .glass-panel::before { background: linear-gradient(90deg, transparent, rgba(0,0,0,0.03), transparent) !important; }

/* Panel titles */
body.light-mode .panel-title { color: #1E293B !important; }
body.light-mode .panel-action { color: #1A56DB !important; }

/* Banners */
body.light-mode .entity-banner,
body.light-mode .proj-banner { background: rgba(255,255,255,0.88) !important; border-bottom-color: rgba(0,0,0,0.07) !important; }

/* Modals */
body.light-mode .modal-box { background: rgba(255,255,255,0.99) !important; border-color: rgba(0,0,0,0.1) !important; }
body.light-mode .modal-overlay { background: rgba(240,244,250,0.88) !important; }

/* Forms (extended) */
body.light-mode .form-input, body.light-mode .form-select, body.light-mode .form-textarea {
  background: rgba(0,0,0,0.04) !important; border-color: rgba(0,0,0,0.1) !important; color: #0F172A !important;
}
body.light-mode .form-input:focus, body.light-mode .form-select:focus, body.light-mode .form-textarea:focus {
  border-color: #1A56DB !important; background: #fff !important;
}
body.light-mode .form-label { color: #475569 !important; }

/* Buttons (extended) */
body.light-mode .btn-secondary { background: rgba(0,0,0,0.05) !important; border-color: rgba(0,0,0,0.1) !important; color: #1E293B !important; }
body.light-mode .btn-secondary:hover { background: rgba(0,0,0,0.09) !important; }
body.light-mode .btn-ghost { color: #475569 !important; }
body.light-mode .btn-ghost:hover { background: rgba(0,0,0,0.05) !important; color: #0F172A !important; }

/* KPI cards */
body.light-mode .kpi-card { background: rgba(255,255,255,0.92) !important; border-color: rgba(0,0,0,0.07) !important; }
body.light-mode .kpi-lbl { color: #64748B !important; }
body.light-mode .kpi-val { color: #0F172A !important; }
body.light-mode .kpi-sub { color: #94A3B8 !important; }

/* Stat cards */
body.light-mode .stat-c { background: rgba(255,255,255,0.92) !important; border-color: rgba(0,0,0,0.07) !important; }
body.light-mode .stat-c-val { color: #0F172A !important; }
body.light-mode .stat-c-lbl { color: #64748B !important; }

/* Activity */
body.light-mode .act-text { color: #475569 !important; }
body.light-mode .act-text strong { color: #1E293B !important; }
body.light-mode .act-time { color: #94A3B8 !important; }
body.light-mode .act-item { border-bottom-color: rgba(0,0,0,0.05) !important; }

/* Project cards */
body.light-mode .proj-card { background: rgba(255,255,255,0.92) !important; border-color: rgba(0,0,0,0.07) !important; }
body.light-mode .proj-name { color: #1E293B !important; }
body.light-mode .proj-entity { color: #64748B !important; }
body.light-mode .proj-prog-bar { background: rgba(0,0,0,0.07) !important; }

/* Quick actions */
body.light-mode .quick-action { background: rgba(255,255,255,0.9) !important; border-color: rgba(0,0,0,0.07) !important; }
body.light-mode .quick-action span { color: #475569 !important; }
body.light-mode .quick-action:hover span { color: #1E293B !important; }

/* AI insights */
body.light-mode .ai-insight { background: rgba(26,86,219,0.05) !important; border-color: rgba(26,86,219,0.15) !important; }
body.light-mode .ai-insight-text { color: #475569 !important; }
body.light-mode .ai-insight-text strong { color: #1A56DB !important; }

/* Entity/compliance rows */
body.light-mode .compliance-item { border-color: rgba(0,0,0,0.07) !important; }
body.light-mode .compliance-text { color: #475569 !important; }
body.light-mode .hr-row { border-color: rgba(0,0,0,0.07) !important; }
body.light-mode .hr-name { color: #1E293B !important; }
body.light-mode .hr-title { color: #64748B !important; }

/* Entity table */
body.light-mode .entity-row { background: rgba(255,255,255,0.88) !important; border-color: rgba(0,0,0,0.07) !important; }
body.light-mode .entity-row:hover { background: #fff !important; border-color: rgba(26,86,219,0.2) !important; }
body.light-mode .entity-name { color: #1E293B !important; }
body.light-mode .entity-type { color: #64748B !important; }
body.light-mode .entity-leader { color: #94A3B8 !important; }

/* Kanban */
body.light-mode .kanban-card { background: rgba(255,255,255,0.92) !important; border-color: rgba(0,0,0,0.07) !important; }
body.light-mode .kanban-card-name { color: #1E293B !important; }
body.light-mode .kanban-card-entity { color: #64748B !important; }
body.light-mode .kanban-header { color: #64748B !important; }
body.light-mode .kanban-add { border-color: rgba(0,0,0,0.12) !important; color: #94A3B8 !important; }

/* Greetings */
body.light-mode .greeting { color: #0F172A !important; }
body.light-mode .greeting-sub { color: #64748B !important; }

/* Alert banner */
body.light-mode .alert-banner { background: rgba(245,158,11,0.07) !important; border-color: rgba(245,158,11,0.2) !important; }

/* Proj nav items in sidebar */
body.light-mode .proj-nav-item { color: #64748B !important; }
body.light-mode .proj-nav-item:hover { color: #0F172A !important; }

/* Entity banner badges */
body.light-mode .entity-sub { color: #64748B !important; }

/* Map panel text */
body.light-mode #portfolio-map-panel { background: rgba(255,255,255,0.99) !important; border-left-color: rgba(0,0,0,0.08) !important; }

/* Portal page */
body.light-mode .portal-card { background: rgba(255,255,255,0.92) !important; border-color: rgba(0,0,0,0.07) !important; }

/* Settings */
body.light-mode .settings-section { background: rgba(255,255,255,0.92) !important; border-color: rgba(0,0,0,0.07) !important; }

/* VDR folder/file class system */
.vdr-folder-label {
  color: var(--ink-mid);
  font-weight: 500;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: color 0.15s;
}
.vdr-folder-label.is-selected { color: var(--vault-blue-bright); font-weight: 600; }
body.light-mode .vdr-folder-label { color: #475569; }
body.light-mode .vdr-folder-label.is-selected { color: #1A56DB; }

.vdr-folder-row {
  display: flex; align-items: center; gap: 6px;
  border-radius: 8px; cursor: pointer;
  transition: background 0.15s;
  border-left: 2px solid transparent;
  position: relative;
}
.vdr-folder-row:hover { background: rgba(255,255,255,0.05); }
body.light-mode .vdr-folder-row:hover { background: rgba(0,0,0,0.04); }
.vdr-folder-row.is-selected { background: rgba(59,123,255,0.12); border-left-color: #3B7BFF; }
body.light-mode .vdr-folder-row.is-selected { background: rgba(26,86,219,0.10); border-left-color: #1A56DB; }

.vdr-folder-arrow {
  color: var(--ink-muted); font-size: 10px; width: 16px;
  text-align: center; flex-shrink: 0; display: inline-block;
  transition: transform 0.2s, color 0.15s; cursor: pointer;
}
.vdr-folder-arrow.is-collapsed { transform: rotate(-90deg); }
body.light-mode .vdr-folder-arrow { color: rgba(30,41,59,0.5); }

.vdr-folder-badge {
  font-size: 10px; padding: 1px 7px;
  background: rgba(59,123,255,0.15); color: #7BB3FF;
  border-radius: 10px; margin-left: auto; flex-shrink: 0;
}
body.light-mode .vdr-folder-badge { background: rgba(26,86,219,0.12); color: #1A56DB; }

.vdr-folder-delete {
  font-size: 13px; cursor: pointer; opacity: 0;
  transition: opacity 0.15s; flex-shrink: 0;
  margin-left: 4px; color: rgba(248,113,113,0.7);
}
.vdr-folder-row:hover .vdr-folder-delete { opacity: 0.8; }
body.light-mode .vdr-folder-delete { color: #DC2626; }
body.light-mode .vdr-folder-item { color: #475569 !important; }
body.light-mode .vdr-file-row { border-color: rgba(0,0,0,0.07) !important; }

/* Sidebar background */
body.light-mode .sidebar { background: rgba(248,250,252,0.99) !important; border-right-color: rgba(0,0,0,0.07) !important; }

/* Map canvas */
body.light-mode canvas { background: transparent; }

/* Slide-overs */
body.light-mode .slide-over { background: rgba(255,255,255,0.99) !important; border-left-color: rgba(0,0,0,0.08) !important; }

/* ── NUCLEAR: override ANY inline white color on any element ── */
body.light-mode [style*="color: #fff"],
body.light-mode [style*="color:#fff"],
body.light-mode [style*="color: rgb(255"],
body.light-mode [style*="color:rgb(255"],
body.light-mode [style*="color: rgba(255"],
body.light-mode [style*="color:rgba(255"] {
  color: #1E293B !important;
}

/* ============================================================
   23. LOGO MARK (SVG variant)
   ============================================================ */
.logo-mark {
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.logo-mark svg { display: block; }
