/* ============================================================
   orgnet.ai — Precision Core Design System
   ============================================================ */

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

/* ---------- CSS Custom Properties ---------- */
:root {
  /* ── Brand ── */
  --brand-blue: #0E8FCF;
  --brand-blue-hover: #007bb4;
  --brand-green: #2E9E6B;
  --brand-amber: #D98A1F;
  --brand-purple: #7B5FE0;
  --brand-grad-start: #00AEE0;
  --brand-grad-end: #1A72B8;

  /* ── Light Mode Surfaces ── */
  --surface: #f9f9ff;
  --surface-dim: #d3daef;
  --surface-bright: #f9f9ff;
  --surface-lowest: #ffffff;
  --surface-low: #f1f3ff;
  --surface-container: #e9edff;
  --surface-high: #e1e8fd;
  --surface-highest: #dce2f7;
  --background: #f9f9ff;

  /* ── Light Mode Text ── */
  --on-surface: #141b2b;
  --on-surface-variant: #3f4850;
  --on-background: #141b2b;
  --text-muted: #606878;

  /* ── Borders ── */
  --outline: #6f7881;
  --outline-variant: #bec7d1;
  --border: #E5E7EB;
  --border-light: #E3E6EC;

  /* ── Primary ── */
  --primary: #006290;
  --on-primary: #ffffff;
  --primary-container: #007bb4;
  --on-primary-container: #fcfcff;
  --primary-fixed: #cae6ff;

  /* ── Secondary ── */
  --secondary: #006c44;
  --on-secondary: #ffffff;
  --secondary-container: #8df8bd;

  /* ── Tertiary ── */
  --tertiary: #855000;
  --tertiary-container: #a76600;

  /* ── Error ── */
  --error: #ba1a1a;
  --error-container: #ffdad6;

  /* ── Dark Mode ── */
  --dark-bg: #0B0D12;
  --dark-surface: #141720;
  --dark-surface-high: #1D2230;
  --dark-border: #252B3C;
  --dark-text-primary: #E2E8F0;
  --dark-text-secondary: #94A3B8;
  --dark-text-tertiary: #64748B;
}

/* ── Anti-Glare Premium Dark Mode System ── */
html.dark,
body.dark-mode,
:root[data-theme="dark"] {
  --surface: #0B0D12;
  --surface-dim: #252B3C;
  --surface-bright: #141720;
  --surface-lowest: #080A0E;
  --surface-low: #10121A;
  --surface-container: #161A25;
  --surface-high: #1D2230;
  --surface-highest: #262D40;
  --background: #0B0D12;

  --on-surface: #E2E8F0;
  --on-surface-variant: #94A3B8;
  --on-background: #E2E8F0;
  --text-muted: #64748B;

  --outline: #475569;
  --outline-variant: #252B3C;
  --border: #252B3C;
  --border-light: #1D2230;

  --primary-fixed: #142840;
}

html.dark body,
body.dark-mode {
  background-color: #0B0D12 !important;
  color: #E2E8F0 !important;
}

html.dark .app-layout,
body.dark-mode .app-layout,
html.dark .app-main,
body.dark-mode .app-main {
  background: #0B0D12 !important;
  color: #E2E8F0 !important;
}

html.dark .app-topbar,
body.dark-mode .app-topbar {
  background: #141720 !important;
  border-color: #252B3C !important;
  color: #E2E8F0 !important;
}

html.dark .sidebar,
body.dark-mode .sidebar {
  background: #10121A !important;
  border-color: #252B3C !important;
}

html.dark .nav-item,
body.dark-mode .nav-item {
  color: #94A3B8 !important;
}

html.dark .nav-item:hover,
body.dark-mode .nav-item:hover {
  background: rgba(255, 255, 255, 0.05) !important;
  color: #F8FAFC !important;
}

html.dark .nav-item.active,
body.dark-mode .nav-item.active {
  background: rgba(14, 143, 207, 0.18) !important;
  color: #38BDF8 !important;
}

html.dark .card,
body.dark-mode .card,
html.dark section.card,
body.dark-mode section.card {
  background: #141720 !important;
  border-color: #252B3C !important;
  color: #E2E8F0 !important;
}

html.dark .modal-content,
body.dark-mode .modal-content,
html.dark .modal,
body.dark-mode .modal {
  background: #141720 !important;
  border-color: #252B3C !important;
  color: #E2E8F0 !important;
}

html.dark aside,
body.dark-mode aside {
  background: rgba(20, 23, 32, 0.98) !important;
  border-color: #252B3C !important;
  color: #E2E8F0 !important;
}

html.dark input,
html.dark select,
html.dark textarea,
body.dark-mode input,
body.dark-mode select,
body.dark-mode textarea {
  background: #10121A !important;
  border-color: #282E3F !important;
  color: #E2E8F0 !important;
}

html.dark input::placeholder,
html.dark textarea::placeholder,
body.dark-mode input::placeholder,
body.dark-mode textarea::placeholder {
  color: #64748B !important;
}

html.dark .status-bar,
body.dark-mode .status-bar {
  background: #10121A !important;
  border-color: #252B3C !important;
}

html.dark table,
body.dark-mode table {
  background: #141720 !important;
  color: #E2E8F0 !important;
}

html.dark th,
body.dark-mode th {
  background: #10121A !important;
  color: #94A3B8 !important;
  border-color: #252B3C !important;
}

html.dark td,
body.dark-mode td {
  border-color: #252B3C !important;
  color: #CBD5E1 !important;
}

html.dark tr:hover,
body.dark-mode tr:hover {
  background: rgba(255, 255, 255, 0.03) !important;
}

/* ── Universal Overrides for Hardcoded Light Inline Styles in Dark Mode ── */
html.dark [style*="background:#FFFFFF"],
html.dark [style*="background:#ffffff"],
html.dark [style*="background: #FFFFFF"],
html.dark [style*="background: #ffffff"],
html.dark [style*="background:#F8FAFC"],
html.dark [style*="background:#f8fafc"],
html.dark [style*="background: #F8FAFC"],
html.dark [style*="background: #f8fafc"],
html.dark [style*="background:#F1F5F9"],
html.dark [style*="background:#f1f5f9"],
html.dark [style*="background: #F1F5F9"],
html.dark [style*="background: #f1f5f9"],
html.dark [style*="background:white"],
html.dark [style*="background: white"],
html.dark [style*="background-color:#ffffff"],
html.dark [style*="background-color: #ffffff"],
html.dark [style*="background-color:#FFFFFF"],
html.dark [style*="background-color: #FFFFFF"],
html.dark [style*="background-color:white"],
html.dark [style*="background-color: white"],
body.dark-mode [style*="background:#FFFFFF"],
body.dark-mode [style*="background:#ffffff"],
body.dark-mode [style*="background: #FFFFFF"],
body.dark-mode [style*="background: #ffffff"],
body.dark-mode [style*="background:#F8FAFC"],
body.dark-mode [style*="background:#f8fafc"],
body.dark-mode [style*="background: #F8FAFC"],
body.dark-mode [style*="background: #f8fafc"],
body.dark-mode [style*="background:#F1F5F9"],
body.dark-mode [style*="background:#f1f5f9"],
body.dark-mode [style*="background: #F1F5F9"],
body.dark-mode [style*="background: #f1f5f9"],
body.dark-mode [style*="background:white"],
body.dark-mode [style*="background: white"] {
  background-color: #141720 !important;
  color: #E2E8F0 !important;
  border-color: #252B3C !important;
}

html.dark [style*="background:#efeae2"],
html.dark [style*="background: #efeae2"],
body.dark-mode [style*="background:#efeae2"],
body.dark-mode [style*="background: #efeae2"] {
  background-color: #0D1418 !important;
}

html.dark [style*="color:#334155"],
html.dark [style*="color: #334155"],
html.dark [style*="color:#141b2b"],
html.dark [style*="color: #141b2b"],
html.dark [style*="color:#0f172a"],
html.dark [style*="color: #0f172a"],
html.dark [style*="color:#1e293b"],
html.dark [style*="color: #1e293b"],
html.dark [style*="color:#475569"],
html.dark [style*="color: #475569"],
html.dark [style*="color:#333"],
html.dark [style*="color: #333"],
body.dark-mode [style*="color:#334155"],
body.dark-mode [style*="color: #334155"],
body.dark-mode [style*="color:#141b2b"],
body.dark-mode [style*="color: #141b2b"],
body.dark-mode [style*="color:#0f172a"],
body.dark-mode [style*="color: #0f172a"],
body.dark-mode [style*="color:#1e293b"],
body.dark-mode [style*="color: #1e293b"],
body.dark-mode [style*="color:#475569"],
body.dark-mode [style*="color: #475569"],
body.dark-mode [style*="color:#333"],
body.dark-mode [style*="color: #333"] {
  color: #CBD5E1 !important;
}

html.dark [style*="color:#64748B"],
html.dark [style*="color: #64748B"],
html.dark [style*="color:#606878"],
html.dark [style*="color: #606878"],
body.dark-mode [style*="color:#64748B"],
body.dark-mode [style*="color: #64748B"],
body.dark-mode [style*="color:#606878"],
body.dark-mode [style*="color: #606878"] {
  color: #94A3B8 !important;
}

html.dark [style*="border:1px solid #E2E8F0"],
html.dark [style*="border: 1px solid #E2E8F0"],
html.dark [style*="border-bottom:1px solid #E2E8F0"],
html.dark [style*="border-bottom: 1px solid #E2E8F0"],
html.dark [style*="border-top:1px solid #E2E8F0"],
html.dark [style*="border-top: 1px solid #E2E8F0"],
body.dark-mode [style*="border:1px solid #E2E8F0"],
body.dark-mode [style*="border: 1px solid #E2E8F0"],
body.dark-mode [style*="border-bottom:1px solid #E2E8F0"],
body.dark-mode [style*="border-bottom: 1px solid #E2E8F0"],
body.dark-mode [style*="border-top:1px solid #E2E8F0"],
body.dark-mode [style*="border-top: 1px solid #E2E8F0"] {
  border-color: #252B3C !important;
}

:root {
  /* ── Typography ── */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;

  /* ── Spacing (4px grid) ── */
  --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;
  --sp-16: 64px;
  --sp-20: 80px;
  --sp-24: 96px;
  --gutter: 24px;
  --margin-mobile: 16px;
  --margin-desktop: 32px;

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

  /* ── Shadows ── */
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.08), 0 2px 4px -2px rgba(0,0,0,0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.08), 0 4px 6px -4px rgba(0,0,0,0.05);
  --shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.08), 0 8px 10px -6px rgba(0,0,0,0.04);
  --shadow-2xl: 0 25px 50px -12px rgba(0,0,0,0.15);

  /* ── Transitions ── */
  --transition-fast: 150ms ease;
  --transition: 200ms ease;
  --transition-slow: 300ms ease;
  --transition-bounce: 500ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

html, body {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

section[id] {
  scroll-margin-top: 96px;
}

body {
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 20px;
  color: var(--on-surface);
  background: var(--background);
  min-height: 100vh;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { cursor: pointer; font-family: inherit; border: none; background: none; }
input, select, textarea { font-family: inherit; }
ul, ol { list-style: none; }

/* ---------- Scrollbar ---------- */
.no-scrollbar::-webkit-scrollbar { display: none !important; width: 0 !important; height: 0 !important; }
.no-scrollbar { -ms-overflow-style: none !important; scrollbar-width: none !important; }
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--surface-highest); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--outline-variant); }

/* ---------- Typography ---------- */
.text-display-lg { font-size: 80px; line-height: 88px; font-weight: 900; letter-spacing: -0.04em; }
.text-display-md { font-size: 64px; line-height: 72px; font-weight: 800; letter-spacing: -0.03em; }
.text-headline-xl { font-size: 36px; line-height: 44px; font-weight: 600; letter-spacing: -0.02em; }
.text-headline-lg { font-size: 24px; line-height: 32px; font-weight: 600; letter-spacing: -0.015em; }
.text-headline-lg-mobile { font-size: 20px; line-height: 28px; font-weight: 600; }
.text-headline-md { font-size: 18px; line-height: 28px; font-weight: 600; }
.text-body-lg { font-size: 16px; line-height: 24px; font-weight: 400; }
.text-body-md { font-size: 14px; line-height: 20px; font-weight: 400; }
.text-label-md { font-size: 14px; line-height: 16px; font-weight: 500; }
.text-label-sm { font-size: 12px; line-height: 16px; font-weight: 500; letter-spacing: 0.01em; }
.text-code { font-family: var(--font-mono); font-size: 13px; line-height: 20px; font-weight: 400; }

/* Landing-specific display sizes */
.text-display-lg-landing { font-size: 80px; line-height: 88px; font-weight: 900; letter-spacing: -0.04em; }
.text-headline-xl-landing { font-size: 48px; line-height: 56px; font-weight: 700; letter-spacing: -0.02em; }
.text-headline-lg-landing { font-size: 40px; line-height: 48px; font-weight: 700; letter-spacing: -0.015em; }
.text-body-lg-landing { font-size: 22px; line-height: 32px; font-weight: 400; }
.text-body-md-landing { font-size: 18px; line-height: 28px; font-weight: 400; }

@media (max-width: 768px) {
  .text-display-lg { font-size: 48px; line-height: 56px; }
  .text-display-md { font-size: 40px; line-height: 48px; }
  .text-display-lg-landing { font-size: 48px; line-height: 56px; }
  .text-headline-xl-landing { font-size: 32px; line-height: 40px; }
  .text-headline-lg-landing { font-size: 28px; line-height: 36px; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  padding: 0 var(--sp-4);
  height: 36px;
  font-size: 14px;
  font-weight: 500;
  border-radius: var(--radius-md);
  transition: all var(--transition);
  white-space: nowrap;
}

.btn-primary {
  background: var(--brand-blue);
  color: white;
  box-shadow: var(--shadow-sm);
}
.btn-primary:hover { background: var(--brand-blue-hover); }
.btn-primary:active { transform: scale(0.97); }

.btn-secondary {
  background: white;
  color: var(--on-surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}
.btn-secondary:hover { background: var(--surface-low); }

.btn-ghost {
  background: transparent;
  color: var(--brand-blue);
}
.btn-ghost:hover { background: var(--brand-blue); color: white; }

.btn-outline-primary {
  background: transparent;
  color: var(--brand-blue);
  border: 2px solid var(--brand-blue);
}
.btn-outline-primary:hover { background: var(--brand-blue); color: white; }

.btn-lg {
  height: 44px;
  font-size: 14px;
  padding: 0 var(--sp-6);
  border-radius: var(--radius-lg);
}

.btn-xl {
  height: 52px;
  font-size: 18px;
  font-weight: 700;
  padding: 0 var(--sp-8);
  border-radius: var(--radius-2xl);
}

/* ---------- Inputs ---------- */
.input {
  width: 100%;
  height: 36px;
  padding: 0 12px;
  background: #F7F8FA;
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  font-size: 14px;
  color: var(--on-surface);
  outline: none;
  transition: all var(--transition);
}
.input::placeholder { color: var(--outline-variant); }
.input:focus {
  border-color: var(--brand-blue);
  box-shadow: 0 0 0 2px rgba(14, 143, 207, 0.15);
}

.input-mono {
  font-family: var(--font-mono);
  font-size: 13px;
}

.input-dark {
  background: var(--dark-surface-high);
  border-color: var(--dark-border);
  color: var(--dark-text-primary);
}
.input-dark:focus {
  border-color: var(--brand-blue);
  box-shadow: 0 0 0 2px rgba(14, 143, 207, 0.2);
}
.input-dark::placeholder { color: var(--dark-text-tertiary); }

.label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--on-surface);
  margin-bottom: 6px;
}

/* ---------- Cards ---------- */
.card {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.card-dark {
  background: var(--dark-surface);
  border: 1px solid var(--dark-border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-2xl);
}

/* ---------- Badges / Action Codes ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: var(--radius);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  white-space: nowrap;
}

.badge-green {
  background: rgba(46, 158, 107, 0.1);
  color: var(--brand-green);
  border: 1px solid rgba(46, 158, 107, 0.3);
}
.badge-amber {
  background: rgba(217, 138, 31, 0.1);
  color: var(--brand-amber);
  border: 1px solid rgba(217, 138, 31, 0.3);
}
.badge-blue {
  background: rgba(14, 143, 207, 0.1);
  color: var(--brand-blue);
  border: 1px solid rgba(14, 143, 207, 0.3);
}
.badge-purple {
  background: rgba(123, 95, 224, 0.1);
  color: var(--brand-purple);
  border: 1px solid rgba(123, 95, 224, 0.3);
}
.badge-gray {
  background: rgba(107, 114, 128, 0.1);
  color: #6B7280;
  border: 1px solid rgba(107, 114, 128, 0.3);
}

/* ---------- Sidebar Nav ---------- */
.sidebar {
  width: 240px;
  height: 100vh;
  position: fixed;
  left: 0;
  top: 0;
  display: flex;
  flex-direction: column;
  padding: var(--sp-4);
  gap: var(--sp-2);
  background: white;
  border-right: 1px solid var(--surface-dim);
  z-index: 30;
  flex-shrink: 0;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  border-radius: var(--radius-lg);
  color: var(--on-surface-variant);
  font-size: 14px;
  font-weight: 500;
  transition: all var(--transition-fast);
}
.sidebar-link:hover { background: var(--surface-container); }
.sidebar-link.active {
  background: rgba(0, 123, 180, 0.08);
  color: var(--primary);
  font-weight: 700;
  border-left: 2px solid var(--primary);
}

/* ---------- Top Nav (Public) ---------- */
.topnav-public {
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 50;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(190, 199, 209, 0.3);
  transition: all var(--transition-slow);
}

/* ---------- Top Nav (App) ---------- */
.topnav-app {
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--sp-6);
  background: white;
  border-bottom: 1px solid var(--surface-dim);
  flex-shrink: 0;
}

/* ---------- Auth Layout (Split) ---------- */
.auth-layout {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

.auth-left {
  width: 50%;
  background: white;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 0 96px;
  overflow-y: auto;
}

.auth-right {
  width: 50%;
  background: var(--dark-bg);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 48px 80px;
  position: relative;
  overflow: hidden;
  border-left: 1px solid var(--dark-border);
}

@media (max-width: 768px) {
  .auth-left { width: 100%; padding: 0 var(--margin-mobile); }
  .auth-right { display: none; }
}

/* ---------- Onboarding Layout ---------- */
.onboarding-layout {
  background: var(--dark-bg);
  color: var(--dark-text-primary);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.onboarding-header {
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 50;
  background: rgba(24, 27, 36, 0.9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--dark-border);
  height: 56px;
}

.onboarding-stepper {
  position: fixed;
  top: 56px;
  width: 100%;
  z-index: 40;
  background: var(--dark-bg);
  border-bottom: 1px solid var(--dark-border);
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.onboarding-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 50;
  background: var(--dark-surface);
  border-top: 1px solid var(--dark-border);
  padding: var(--sp-4) var(--sp-6);
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

/* ---------- App Layout ---------- */
.app-layout {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

.app-main {
  margin-left: 240px;
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
  background: var(--surface);
}

.app-canvas {
  flex: 1;
  overflow-y: auto;
  padding: var(--sp-4);
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
}

/* ---------- Status Bar ---------- */
.status-bar {
  height: 28px;
  background: var(--surface-container);
  border-top: 1px solid var(--surface-dim);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--sp-4);
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--on-surface-variant);
  flex-shrink: 0;
}

/* ---------- KPI Card ---------- */
.kpi-card {
  background: white;
  border: 1px solid var(--surface-dim);
  border-radius: var(--radius);
  padding: var(--sp-4);
  display: flex;
  flex-direction: column;
  transition: background var(--transition);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
}
.kpi-card:hover { background: var(--surface-low); }

.sparkline { display: flex; align-items: flex-end; height: 24px; gap: 2px; }
.sparkline-bar { width: 4px; border-radius: 1px 1px 0 0; background: var(--surface-highest); }
.sparkline-bar.active { background: var(--primary); }
.sparkline-bar.archived { background: var(--outline-variant); }
.sparkline-bar.forwarded { background: #fcd34d; }

/* ---------- Table ---------- */
.data-table {
  width: 100%;
  text-align: left;
  border-collapse: collapse;
}
.data-table th {
  padding: 12px 16px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--on-surface-variant);
  border-bottom: 1px solid var(--surface-dim);
}
.data-table td {
  padding: 12px 16px;
  font-size: 13px;
  border-bottom: 1px solid var(--surface-dim);
}
.data-table tbody tr {
  transition: background var(--transition-fast);
  cursor: pointer;
}
.data-table tbody tr:hover { background: var(--surface-low); }

/* ---------- PIN Input ---------- */
.pin-input {
  width: 44px;
  height: 48px;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 24px;
  font-weight: 700;
  border: 1px solid var(--outline-variant);
  border-radius: var(--radius-lg);
  background: var(--surface);
  color: var(--on-surface);
  outline: none;
  transition: all var(--transition);
}
.pin-input:focus {
  border-color: var(--brand-blue);
  box-shadow: 0 0 0 3px rgba(14, 143, 207, 0.15);
}

/* ---------- Divider ---------- */
.divider {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  color: var(--outline);
  font-size: 12px;
}
.divider::before, .divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border-light);
}

/* ---------- Checkbox ---------- */
.checkbox-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}
.checkbox-wrapper input[type="checkbox"] {
  width: 16px;
  height: 16px;
  border-radius: var(--radius);
  border: 1px solid var(--outline-variant);
  accent-color: var(--brand-blue);
  cursor: pointer;
}

/* ---------- Animations ---------- */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-15px); }
}
@keyframes ping {
  75%, 100% { transform: scale(2); opacity: 0; }
}
@keyframes pulse {
  50% { opacity: 0.5; }
}
@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}
@keyframes gradient-x {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}
.animate-gradient-x {
  background-size: 200% auto;
  animation: gradient-x 3s linear infinite;
}
@keyframes iconSway {
  0%, 100% { transform: rotate(0deg); }
  50% { transform: rotate(15deg); }
}

.animate-fade-in-up { animation: fadeInUp 0.8s ease-out forwards; }
.animate-fade-in-up-delay-1 { animation: fadeInUp 0.8s ease-out 0.2s forwards; opacity: 0; }
.animate-fade-in-up-delay-2 { animation: fadeInUp 0.8s ease-out 0.4s forwards; opacity: 0; }
.animate-float { animation: float 6s ease-in-out infinite; }
.animate-ping { animation: ping 1s cubic-bezier(0, 0, 0.2, 1) infinite; }
.animate-pulse { animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite; }

/* ---------- Utility ---------- */
.font-mono { font-family: var(--font-mono); }
.font-sans { font-family: var(--font-sans); }
.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }
.font-medium { font-weight: 500; }

.text-brand { color: var(--brand-blue); }
.text-muted { color: var(--on-surface-variant); }
.text-success { color: var(--brand-green); }
.text-warning { color: var(--brand-amber); }
.text-error { color: var(--error); }

.bg-brand { background: var(--brand-blue); }

.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* ---------- Material Symbols Override ---------- */
.material-symbols-outlined {
  font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}
.icon-filled {
  font-variation-settings: 'FILL' 1;
}

/* ---------- Gradient Logo ---------- */
.gradient-logo {
  background: linear-gradient(135deg, var(--brand-grad-start), var(--brand-grad-end));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ---------- Glass Effect ---------- */
.glass {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

/* ---------- Interactive Modal & Toast System ---------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 17, 23, 0.65);
  backdrop-filter: blur(6px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: fadeIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-content {
  background: #ffffff;
  border: 1px solid var(--surface-dim);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-2xl);
  width: 100%;
  max-width: 480px;
  overflow: hidden;
  animation: slideUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast-message {
  background: #1e293b;
  color: #f8fafc;
  padding: 12px 18px;
  border-radius: var(--radius-lg);
  font-size: 13px;
  font-weight: 500;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.2);
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  pointer-events: auto;
  animation: slideInRight 0.25s ease forwards;
}

.toast-success {
  border-left: 4px solid var(--brand-green);
}

.toast-error {
  border-left: 4px solid var(--error);
}

.toast-info {
  border-left: 4px solid var(--brand-blue);
}

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

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

/* ══════════════════════════════════════════════════════════════
   Custom Visible Scrollbars (Drawer & App Containers)
   ══════════════════════════════════════════════════════════════ */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--surface-low);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* Dedicated Right Drawer Scrollbar Styling (Subtle & Clean) */
.drawer-scrollable {
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 0, 0, 0.2) transparent;
}

.drawer-scrollable::-webkit-scrollbar {
  width: 6px;
}

.drawer-scrollable::-webkit-scrollbar-track {
  background: transparent;
}

.drawer-scrollable::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.18);
  border-radius: 999px;
}

.drawer-scrollable::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.35);
}

/* Explicit Custom Scrollbar for Main Panels and Powers Matrix */
.custom-scrollbar,
.has-scrollbar {
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #94a3b8 #f1f5f9;
}

.custom-scrollbar::-webkit-scrollbar,
.has-scrollbar::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

.custom-scrollbar::-webkit-scrollbar-track,
.has-scrollbar::-webkit-scrollbar-track {
  background: #f1f5f9;
  border-radius: 4px;
}

.custom-scrollbar::-webkit-scrollbar-thumb,
.has-scrollbar::-webkit-scrollbar-thumb {
  background: #94a3b8;
  border-radius: 4px;
  border: 2px solid #f1f5f9;
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover,
.has-scrollbar::-webkit-scrollbar-thumb:hover {
  background: #0284c7;
}

