/* ============================================================
   THE REAL ORBIT - DESIGN SYSTEM v1.0
   File: assets/css/tro.css
   ============================================================ */

/* ---------- FONTS ---------- */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&family=Space+Grotesk:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500;600&display=swap');

/* ============================================================
   DESIGN TOKENS (CSS Custom Properties)
   ============================================================ */
:root {
  /* Light (Default) Theme - Clean & Minimal */
  --bg-primary: #FFFFFF;
  --bg-secondary: #F8FAFC;
  --bg-tertiary: #F1F5F9;
  --bg-elevated: #FFFFFF;
  --bg-overlay: rgba(15, 23, 42, 0.45);

  --surface-1: #FFFFFF;
  --surface-2: #F8FAFC;
  --surface-3: #F1F5F9;
  --surface-glass: rgba(255, 255, 255, 0.72);

  --border-subtle: #E2E8F0;
  --border-default: #CBD5E1;
  --border-strong: #94A3B8;

  --text-primary: #0F172A;
  --text-secondary: #334155;
  --text-tertiary: #64748B;
  --text-muted: #94A3B8;
  --text-inverse: #FFFFFF;

  --accent-primary: #0EA5E9;       /* Sky blue — primary brand */
  --accent-primary-hover: #0284C7;
  --accent-primary-soft: #E0F2FE;
  --accent-secondary: #6366F1;     /* Indigo */
  --accent-tertiary: #10B981;      /* Emerald */

  --brand-gradient: linear-gradient(135deg, #0EA5E9 0%, #6366F1 50%, #8B5CF6 100%);
  --brand-gradient-soft: linear-gradient(135deg, #E0F2FE 0%, #EEF2FF 50%, #F5F3FF 100%);

  --success: #10B981;
  --success-soft: #D1FAE5;
  --warning: #F59E0B;
  --warning-soft: #FEF3C7;
  --danger: #EF4444;
  --danger-soft: #FEE2E2;
  --info: #3B82F6;
  --info-soft: #DBEAFE;

  /* Shadows */
  --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.06), 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 4px 6px -1px rgba(15, 23, 42, 0.07), 0 2px 4px -2px rgba(15, 23, 42, 0.04);
  --shadow-lg: 0 10px 15px -3px rgba(15, 23, 42, 0.08), 0 4px 6px -4px rgba(15, 23, 42, 0.05);
  --shadow-xl: 0 20px 25px -5px rgba(15, 23, 42, 0.08), 0 10px 10px -5px rgba(15, 23, 42, 0.04);
  --shadow-2xl: 0 25px 50px -12px rgba(15, 23, 42, 0.18);
  --shadow-glow: 0 0 40px rgba(14, 165, 233, 0.18);
  --shadow-glow-lg: 0 0 80px rgba(99, 102, 241, 0.22);

  /* Radii */
  --radius-xs: 4px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-2xl: 28px;
  --radius-full: 9999px;

  /* Spacing */
  --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;

  /* Typography */
  --font-display: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-body: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-accent: 'Space Grotesk', sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;
  --font-numeric: 'Space Grotesk', sans-serif;

  /* Transitions */
  --t-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --t-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
  --t-slow: 400ms cubic-bezier(0.4, 0, 0.2, 1);
  --t-spring: 500ms cubic-bezier(0.34, 1.56, 0.64, 1);
  --t-ease: cubic-bezier(0.4, 0, 0.2, 1);

  /* Layout */
  --header-h: 72px;
  --sidebar-w: 272px;
  --sidebar-w-collapsed: 72px;
  --container-max: 1280px;
}

/* ============================================================
   THEME VARIATIONS (toggle via [data-theme])
   ============================================================ */

/* DARK (Deep Midnight) */
[data-theme="dark"] {
  --bg-primary: #0B1220;
  --bg-secondary: #111827;
  --bg-tertiary: #1F2937;
  --bg-elevated: #1F2937;

  --surface-1: #111827;
  --surface-2: #1F2937;
  --surface-3: #374151;
  --surface-glass: rgba(31, 41, 55, 0.72);

  --border-subtle: #1F2937;
  --border-default: #374151;
  --border-strong: #4B5563;

  --text-primary: #F9FAFB;
  --text-secondary: #E5E7EB;
  --text-tertiary: #9CA3AF;
  --text-muted: #6B7280;
  --text-inverse: #0F172A;

  --accent-primary-soft: rgba(14, 165, 233, 0.15);
  --success-soft: rgba(16, 185, 129, 0.15);
  --warning-soft: rgba(245, 158, 11, 0.15);
  --danger-soft: rgba(239, 68, 68, 0.15);
  --info-soft: rgba(59, 130, 246, 0.15);

  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.5);
}

/* EMERALD (Financial Green) */
[data-theme="emerald"] {
  --bg-primary: #F0FDF4;
  --bg-secondary: #DCFCE7;
  --bg-tertiary: #BBF7D0;
  --surface-1: #FFFFFF;
  --surface-2: #F0FDF4;
  --accent-primary: #059669;
  --accent-primary-hover: #047857;
  --accent-primary-soft: #D1FAE5;
  --accent-secondary: #0891B2;
  --brand-gradient: linear-gradient(135deg, #059669 0%, #10B981 50%, #14B8A6 100%);
  --border-subtle: #BBF7D0;
  --border-default: #86EFAC;
}

/* SUNSET (Warm Orange) */
[data-theme="sunset"] {
  --bg-primary: #FFF7ED;
  --bg-secondary: #FFEDD5;
  --surface-1: #FFFFFF;
  --surface-2: #FFF7ED;
  --accent-primary: #EA580C;
  --accent-primary-hover: #C2410C;
  --accent-primary-soft: #FFEDD5;
  --accent-secondary: #DC2626;
  --brand-gradient: linear-gradient(135deg, #EA580C 0%, #F59E0B 50%, #DC2626 100%);
  --border-subtle: #FED7AA;
  --border-default: #FDBA74;
}

/* ROYAL (Luxe Purple) */
[data-theme="royal"] {
  --bg-primary: #FAF5FF;
  --bg-secondary: #F3E8FF;
  --surface-1: #FFFFFF;
  --surface-2: #FAF5FF;
  --accent-primary: #7C3AED;
  --accent-primary-hover: #6D28D9;
  --accent-primary-soft: #EDE9FE;
  --accent-secondary: #C026D3;
  --brand-gradient: linear-gradient(135deg, #7C3AED 0%, #9333EA 50%, #C026D3 100%);
  --border-subtle: #E9D5FF;
  --border-default: #D8B4FE;
}

/* ============================================================
   RESET + BASE
   ============================================================ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}
body {
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.6;
  color: var(--text-primary);
  background: var(--bg-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: 'cv11', 'ss01';
  transition: background var(--t-base), color var(--t-base);
  min-height: 100vh;
}
img, svg, video { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, textarea, select { font-family: inherit; font-size: inherit; color: inherit; }
a { color: var(--accent-primary); text-decoration: none; transition: color var(--t-fast); }
a:hover { color: var(--accent-primary-hover); }

/* Selection */
::selection { background: var(--accent-primary); color: white; }

/* Scrollbar */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg-secondary); }
::-webkit-scrollbar-thumb { background: var(--border-default); border-radius: 5px; border: 2px solid var(--bg-secondary); }
::-webkit-scrollbar-thumb:hover { background: var(--border-strong); }

/* ============================================================
   TYPOGRAPHY
   ============================================================ */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}
h1 { font-size: clamp(2rem, 4vw + 1rem, 3.75rem); font-weight: 800; letter-spacing: -0.035em; }
h2 { font-size: clamp(1.75rem, 2.5vw + 1rem, 2.75rem); letter-spacing: -0.025em; }
h3 { font-size: clamp(1.5rem, 1.5vw + 1rem, 2rem); }
h4 { font-size: 1.5rem; }
h5 { font-size: 1.25rem; }
h6 { font-size: 1rem; }
p { line-height: 1.65; color: var(--text-secondary); }
.text-mono { font-family: var(--font-mono); }
.text-display { font-family: var(--font-display); }
.text-accent { font-family: var(--font-accent); }
.numeric { font-family: var(--font-numeric); font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }

.text-xs { font-size: 0.75rem; }
.text-sm { font-size: 0.875rem; }
.text-base { font-size: 1rem; }
.text-lg { font-size: 1.125rem; }
.text-xl { font-size: 1.25rem; }
.text-2xl { font-size: 1.5rem; }
.text-3xl { font-size: 1.875rem; }
.text-4xl { font-size: 2.25rem; }

.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }
.font-extrabold { font-weight: 800; }

.text-muted { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }
.text-primary-color { color: var(--accent-primary); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }

.gradient-text {
  background: var(--brand-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
}

/* ============================================================
   LAYOUT UTILITIES
   ============================================================ */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--space-6);
}
.container-sm { max-width: 720px; margin: 0 auto; padding: 0 var(--space-6); }
.container-md { max-width: 960px; margin: 0 auto; padding: 0 var(--space-6); }

.flex { display: flex; }
.inline-flex { display: inline-flex; }
.grid { display: grid; }
.hidden { display: none; }
.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; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.flex-1 { flex: 1 1 0%; }
.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); }

.w-full { width: 100%; }
.h-full { height: 100%; }
.text-center { text-align: center; }
.text-right { text-align: right; }

.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); }

/* Grid utilities */
.grid-cols-1 { grid-template-columns: 1fr; }
.grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid-cols-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 1024px) {
  .grid-cols-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-cols-3 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .grid-cols-4, .grid-cols-3, .grid-cols-2 { grid-template-columns: 1fr; }
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 12px 22px;
  font-family: var(--font-display);
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--t-base);
  white-space: nowrap;
  user-select: none;
  position: relative;
  overflow: hidden;
  letter-spacing: -0.01em;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary {
  background: var(--accent-primary);
  color: white;
  box-shadow: var(--shadow-sm), 0 0 0 0 var(--accent-primary-soft);
}
.btn-primary:hover:not(:disabled) {
  background: var(--accent-primary-hover);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md), 0 0 0 4px var(--accent-primary-soft);
}
.btn-primary:active { transform: translateY(0); }
.btn-gradient {
  background: var(--brand-gradient);
  color: white;
  box-shadow: var(--shadow-md), var(--shadow-glow);
}
.btn-gradient:hover:not(:disabled) {
  transform: translateY(-2px) scale(1.015);
  box-shadow: var(--shadow-lg), var(--shadow-glow-lg);
}
.btn-outline {
  background: transparent;
  color: var(--text-primary);
  border-color: var(--border-default);
}
.btn-outline:hover:not(:disabled) {
  background: var(--surface-2);
  border-color: var(--border-strong);
  transform: translateY(-1px);
}
.btn-ghost { background: transparent; color: var(--text-secondary); }
.btn-ghost:hover:not(:disabled) { background: var(--surface-2); color: var(--text-primary); }
.btn-danger { background: var(--danger); color: white; }
.btn-danger:hover:not(:disabled) { background: #DC2626; }
.btn-success { background: var(--success); color: white; }
.btn-success:hover:not(:disabled) { background: #059669; }

.btn-sm { padding: 8px 14px; font-size: 0.8125rem; border-radius: var(--radius-sm); }
.btn-lg { padding: 16px 28px; font-size: 1rem; border-radius: var(--radius-lg); }
.btn-xl { padding: 18px 32px; font-size: 1.0625rem; border-radius: var(--radius-lg); }
.btn-block { width: 100%; }
.btn-icon { padding: 10px; aspect-ratio: 1; }

/* Shine effect on gradient buttons */
.btn-gradient::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent 30%, rgba(255,255,255,0.3) 50%, transparent 70%);
  transform: translateX(-120%);
  transition: transform var(--t-slow);
}
.btn-gradient:hover::before { transform: translateX(120%); }

/* ============================================================
   CARDS
   ============================================================ */
.card {
  background: var(--surface-1);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  transition: all var(--t-base);
}
.card-hover:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  border-color: var(--border-default);
}
.card-glass {
  background: var(--surface-glass);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.3);
}
.card-gradient {
  background: var(--brand-gradient);
  color: white;
  border: none;
  position: relative;
  overflow: hidden;
}
.card-gradient::before {
  content: '';
  position: absolute;
  top: -50%; right: -30%;
  width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(255,255,255,0.18) 0%, transparent 60%);
  border-radius: 50%;
}
.card-padded { padding: var(--space-8); }
.card-compact { padding: var(--space-4); }

/* ============================================================
   FORMS
   ============================================================ */
.form-group { margin-bottom: var(--space-5); }
.form-label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: var(--space-2);
  letter-spacing: 0.01em;
}
.form-label .required { color: var(--danger); }

.form-input, .form-textarea, .form-select {
  width: 100%;
  padding: 12px 16px;
  background: var(--surface-1);
  border: 1.5px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 0.9375rem;
  font-family: var(--font-body);
  transition: all var(--t-fast);
}
.form-input:hover, .form-textarea:hover, .form-select:hover { border-color: var(--border-default); }
.form-input:focus, .form-textarea:focus, .form-select:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px var(--accent-primary-soft);
  background: var(--surface-1);
}
.form-input::placeholder { color: var(--text-muted); }
.form-textarea { resize: vertical; min-height: 100px; }

.form-input-icon { position: relative; }
.form-input-icon .form-input { padding-left: 44px; }
.form-input-icon .icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}
.form-help { font-size: 0.75rem; color: var(--text-muted); margin-top: 6px; }
.form-error { font-size: 0.75rem; color: var(--danger); margin-top: 6px; font-weight: 500; }
.form-input.has-error { border-color: var(--danger); }
.form-input.has-error:focus { box-shadow: 0 0 0 3px var(--danger-soft); }

/* File upload */
.file-drop {
  border: 2px dashed var(--border-default);
  border-radius: var(--radius-lg);
  padding: var(--space-8);
  text-align: center;
  cursor: pointer;
  transition: all var(--t-base);
  background: var(--surface-2);
}
.file-drop:hover, .file-drop.dragging {
  border-color: var(--accent-primary);
  background: var(--accent-primary-soft);
}

/* Checkbox & Radio */
.checkbox {
  appearance: none;
  width: 20px; height: 20px;
  border: 2px solid var(--border-default);
  border-radius: 6px;
  cursor: pointer;
  transition: all var(--t-fast);
  position: relative;
}
.checkbox:checked {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
}
.checkbox:checked::after {
  content: '';
  position: absolute;
  left: 5px; top: 1px;
  width: 6px; height: 10px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

/* ============================================================
   BADGES & CHIPS
   ============================================================ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: var(--radius-full);
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.badge-success { background: var(--success-soft); color: var(--success); }
.badge-warning { background: var(--warning-soft); color: var(--warning); }
.badge-danger { background: var(--danger-soft); color: var(--danger); }
.badge-info { background: var(--info-soft); color: var(--info); }
.badge-primary { background: var(--accent-primary-soft); color: var(--accent-primary); }
.badge-outline { background: transparent; border: 1px solid var(--border-default); color: var(--text-secondary); }
.badge-dot::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
  display: inline-block;
}

/* ============================================================
   TABLES
   ============================================================ */
.table-wrap {
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--surface-1);
}
.table-scroll { overflow-x: auto; }
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}
.table th {
  padding: 14px 16px;
  text-align: left;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border-subtle);
  white-space: nowrap;
}
.table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  vertical-align: middle;
}
.table tr:last-child td { border-bottom: none; }
.table tr:hover td { background: var(--surface-2); }
.table .numeric { color: var(--text-primary); font-weight: 600; }

/* ============================================================
   ALERTS
   ============================================================ */
.alert {
  display: flex;
  gap: var(--space-3);
  padding: 14px 18px;
  border-radius: var(--radius-md);
  border-left: 4px solid;
  font-size: 0.875rem;
  margin-bottom: var(--space-4);
}
.alert-success { background: var(--success-soft); border-color: var(--success); color: var(--success); }
.alert-warning { background: var(--warning-soft); border-color: var(--warning); color: #B45309; }
.alert-danger { background: var(--danger-soft); border-color: var(--danger); color: var(--danger); }
.alert-info { background: var(--info-soft); border-color: var(--info); color: var(--info); }

/* ============================================================
   MODAL
   ============================================================ */
.modal-backdrop {
  position: fixed; inset: 0;
  background: var(--bg-overlay);
  backdrop-filter: blur(6px);
  z-index: 1000;
  display: flex; align-items: center; justify-content: center;
  padding: var(--space-4);
  animation: fadeIn 200ms ease;
}
.modal {
  background: var(--surface-1);
  border-radius: var(--radius-xl);
  max-width: 520px;
  width: 100%;
  max-height: 90vh;
  overflow: auto;
  box-shadow: var(--shadow-2xl);
  animation: slideUp 300ms var(--t-ease);
}
.modal-header {
  padding: var(--space-6);
  border-bottom: 1px solid var(--border-subtle);
  display: flex; justify-content: space-between; align-items: center;
}
.modal-body { padding: var(--space-6); }
.modal-footer {
  padding: var(--space-4) var(--space-6);
  border-top: 1px solid var(--border-subtle);
  display: flex; justify-content: flex-end; gap: var(--space-3);
}

/* ============================================================
   ANIMATIONS (3D transitions, reveals)
   ============================================================ */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeOut { from { opacity: 1; } to { opacity: 0; } }
@keyframes slideUp {
  from { opacity: 0; transform: translateY(24px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes slideDown {
  from { opacity: 0; transform: translateY(-16px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes slideInLeft {
  from { opacity: 0; transform: translateX(-24px); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes slideInRight {
  from { opacity: 0; transform: translateX(24px); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.9); }
  to { opacity: 1; transform: scale(1); }
}
@keyframes float {
  0%, 100% { transform: translateY(0) rotate(0); }
  50% { transform: translateY(-8px) rotate(0.5deg); }
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.55; }
}
@keyframes pulseRing {
  0% { box-shadow: 0 0 0 0 rgba(14, 165, 233, 0.4); }
  70% { box-shadow: 0 0 0 14px rgba(14, 165, 233, 0); }
  100% { box-shadow: 0 0 0 0 rgba(14, 165, 233, 0); }
}
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes shimmer {
  0% { background-position: -1000px 0; }
  100% { background-position: 1000px 0; }
}
@keyframes orbit {
  from { transform: rotate(0deg) translateX(var(--orbit-r)) rotate(0deg); }
  to { transform: rotate(360deg) translateX(var(--orbit-r)) rotate(-360deg); }
}
@keyframes tilt3d {
  0%, 100% { transform: perspective(1000px) rotateX(0) rotateY(0); }
  25% { transform: perspective(1000px) rotateX(2deg) rotateY(-3deg); }
  75% { transform: perspective(1000px) rotateX(-2deg) rotateY(3deg); }
}
@keyframes glow {
  0%, 100% { box-shadow: 0 0 20px rgba(14, 165, 233, 0.3); }
  50% { box-shadow: 0 0 40px rgba(99, 102, 241, 0.5); }
}

.fade-in { animation: fadeIn 400ms var(--t-ease) both; }
.slide-up { animation: slideUp 500ms var(--t-ease) both; }
.scale-in { animation: scaleIn 400ms var(--t-spring) both; }
.float-anim { animation: float 4s ease-in-out infinite; }
.pulse-anim { animation: pulse 2s ease-in-out infinite; }
.tilt-anim { animation: tilt3d 6s ease-in-out infinite; transform-style: preserve-3d; }

/* Staggered reveal */
.stagger > * { animation: slideUp 500ms var(--t-ease) both; }
.stagger > *:nth-child(1) { animation-delay: 0ms; }
.stagger > *:nth-child(2) { animation-delay: 80ms; }
.stagger > *:nth-child(3) { animation-delay: 160ms; }
.stagger > *:nth-child(4) { animation-delay: 240ms; }
.stagger > *:nth-child(5) { animation-delay: 320ms; }
.stagger > *:nth-child(6) { animation-delay: 400ms; }
.stagger > *:nth-child(7) { animation-delay: 480ms; }
.stagger > *:nth-child(8) { animation-delay: 560ms; }

/* 3D card hover */
.card-3d {
  transform-style: preserve-3d;
  perspective: 1000px;
  transition: transform var(--t-slow);
}
.card-3d:hover {
  transform: perspective(1000px) rotateX(-4deg) rotateY(4deg) translateY(-4px);
  box-shadow: -12px 16px 32px rgba(14, 165, 233, 0.15), var(--shadow-xl);
}

/* Shimmer loading */
.skeleton {
  background: linear-gradient(90deg, var(--surface-2) 0%, var(--surface-3) 50%, var(--surface-2) 100%);
  background-size: 1000px 100%;
  animation: shimmer 2s infinite linear;
  border-radius: var(--radius-sm);
}

/* Spinner */
.spinner {
  width: 20px; height: 20px;
  border: 2px solid var(--border-subtle);
  border-top-color: var(--accent-primary);
  border-radius: 50%;
  animation: spin 600ms linear infinite;
  display: inline-block;
}
.spinner-lg { width: 40px; height: 40px; border-width: 3px; }

/* ============================================================
   UTILITIES
   ============================================================ */
.divider { height: 1px; background: var(--border-subtle); margin: var(--space-6) 0; }
.rounded-full { border-radius: var(--radius-full); }
.shadow-sm { box-shadow: var(--shadow-sm); }
.shadow-md { box-shadow: var(--shadow-md); }
.shadow-lg { box-shadow: var(--shadow-lg); }
.overflow-hidden { overflow: hidden; }
.relative { position: relative; }
.absolute { position: absolute; }

/* Avatar */
.avatar {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--brand-gradient);
  color: white;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.875rem;
  overflow: hidden;
  flex-shrink: 0;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-sm { width: 32px; height: 32px; font-size: 0.75rem; }
.avatar-lg { width: 64px; height: 64px; font-size: 1.25rem; }
.avatar-xl { width: 96px; height: 96px; font-size: 2rem; }

/* Progress */
.progress {
  width: 100%;
  height: 8px;
  background: var(--surface-3);
  border-radius: var(--radius-full);
  overflow: hidden;
}
.progress-bar {
  height: 100%;
  background: var(--brand-gradient);
  border-radius: var(--radius-full);
  transition: width 800ms var(--t-ease);
}

/* Stat card base */
.stat {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.stat-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.stat-value {
  font-family: var(--font-numeric);
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.stat-change {
  font-size: 0.8125rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.stat-change.up { color: var(--success); }
.stat-change.down { color: var(--danger); }

/* Theme switcher button */
.theme-switcher {
  display: inline-flex;
  gap: 6px;
  padding: 6px;
  background: var(--surface-2);
  border-radius: var(--radius-full);
  border: 1px solid var(--border-subtle);
}
.theme-dot {
  width: 28px; height: 28px;
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all var(--t-fast);
  position: relative;
}
.theme-dot.active { border-color: var(--text-primary); transform: scale(1.1); }
.theme-dot[data-theme-set="light"] { background: linear-gradient(135deg, #FFFFFF, #F1F5F9); border: 1px solid #CBD5E1; }
.theme-dot[data-theme-set="dark"] { background: linear-gradient(135deg, #0B1220, #1F2937); }
.theme-dot[data-theme-set="emerald"] { background: linear-gradient(135deg, #059669, #10B981); }
.theme-dot[data-theme-set="sunset"] { background: linear-gradient(135deg, #EA580C, #F59E0B); }
.theme-dot[data-theme-set="royal"] { background: linear-gradient(135deg, #7C3AED, #C026D3); }

/* Background decorations */
.bg-grid {
  background-image:
    linear-gradient(to right, var(--border-subtle) 1px, transparent 1px),
    linear-gradient(to bottom, var(--border-subtle) 1px, transparent 1px);
  background-size: 48px 48px;
}
.bg-dots {
  background-image: radial-gradient(var(--border-default) 1px, transparent 1px);
  background-size: 24px 24px;
}
.bg-gradient-mesh {
  background:
    radial-gradient(at 20% 20%, var(--accent-primary-soft) 0px, transparent 50%),
    radial-gradient(at 80% 30%, rgba(99, 102, 241, 0.08) 0px, transparent 50%),
    radial-gradient(at 50% 80%, rgba(16, 185, 129, 0.06) 0px, transparent 50%);
}

/* Hide scrollbar utility */
.no-scrollbar::-webkit-scrollbar { display: none; }
.no-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }

/* Mobile: hide desktop, show mobile */
.show-mobile { display: none; }
@media (max-width: 768px) {
  .show-mobile { display: block; }
  .hide-mobile { display: none; }
  .container { padding: 0 var(--space-4); }
}

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

/* Print */
@media print {
  body { background: white; color: black; }
  .no-print { display: none !important; }
}
