/* ============================================================================
   SWAN ERP THEME — Fused from FIG + Swan AI Labs Brand Identity

   FIG Brand:       Teal #2BBCCC · Green #8DC63F · Orange #F7941D
   Swan AI Labs:    Navy #1B1B4B · Royal Blue #2D2D8E · Ice Blue #B0D4F1

   "Future. Inspire. Grow."
   ============================================================================ */

/* ──────────────────────────────────────────────────────────────────────────────
   1. ROOT CUSTOM PROPERTIES — DESIGN TOKENS
   ────────────────────────────────────────────────────────────────────────────── */

:root {
  /* ── Brand: FIG Palette ─────────────────────────────────────────────────── */
  --fig-teal:            #2BBCCC;
  --fig-teal-light:      #5DD4E0;
  --fig-teal-dark:       #1E9AAA;
  --fig-green:           #8DC63F;
  --fig-green-light:     #A8D96A;
  --fig-green-dark:      #6FA830;
  --fig-orange:          #F7941D;
  --fig-orange-light:    #FBAD4E;
  --fig-orange-dark:     #D97B0D;

  /* ── Brand: Swan AI Labs Palette ────────────────────────────────────────── */
  --swan-navy:           #1B1B4B;
  --swan-navy-deep:      #0E0E2E;
  --swan-navy-light:     #2A2A6A;
  --swan-royal:          #2D2D8E;
  --swan-royal-light:    #4A4AB8;
  --swan-ice:            #B0D4F1;
  --swan-ice-light:      #D4EAFF;
  --swan-electric:       #4169E1;
  --swan-electric-glow:  #6B8EFF;
  --swan-chain:          #5A6A9A;

  /* ── Neutrals ───────────────────────────────────────────────────────────── */
  --neutral-0:           #FFFFFF;
  --neutral-50:          #F8FAFC;
  --neutral-100:         #F1F5F9;
  --neutral-200:         #E2E8F0;
  --neutral-300:         #CBD5E1;
  --neutral-400:         #94A3B8;
  --neutral-500:         #64748B;
  --neutral-600:         #475569;
  --neutral-700:         #334155;
  --neutral-800:         #1E293B;
  --neutral-900:         #0F172A;
  --neutral-950:         #020617;

  /* ── Semantic Colors ────────────────────────────────────────────────────── */
  --color-success:       #22C55E;
  --color-success-glow:  rgba(34, 197, 94, 0.4);
  --color-warning:       var(--fig-orange);
  --color-warning-glow:  rgba(247, 148, 29, 0.4);
  --color-danger:        #EF4444;
  --color-danger-glow:   rgba(239, 68, 68, 0.4);
  --color-info:          var(--swan-electric);
  --color-info-glow:     rgba(65, 105, 225, 0.4);

  /* ── Gradients ──────────────────────────────────────────────────────────── */
  --gradient-primary:    linear-gradient(135deg, var(--fig-teal) 0%, var(--swan-electric) 100%);
  --gradient-accent:     linear-gradient(135deg, var(--fig-green) 0%, var(--fig-teal) 100%);
  --gradient-warm:       linear-gradient(135deg, var(--fig-orange) 0%, var(--fig-orange-light) 100%);
  --gradient-royal:      linear-gradient(135deg, var(--swan-navy) 0%, var(--swan-royal) 100%);
  --gradient-ice:        linear-gradient(135deg, var(--swan-ice) 0%, var(--swan-electric-glow) 100%);
  --gradient-dragon:     linear-gradient(135deg, var(--swan-navy-deep) 0%, var(--swan-royal) 50%, var(--swan-electric) 100%);
  --gradient-swan:       linear-gradient(135deg, var(--fig-teal) 0%, var(--swan-ice) 50%, var(--neutral-0) 100%);
  --gradient-yin-yang:   linear-gradient(135deg, var(--neutral-0) 0%, var(--swan-ice) 30%, var(--swan-royal) 70%, var(--swan-navy-deep) 100%);
  --gradient-hero:       linear-gradient(160deg, var(--swan-navy-deep) 0%, var(--swan-navy) 25%, var(--swan-royal) 50%, var(--fig-teal-dark) 75%, var(--fig-teal) 100%);
  --gradient-glow-teal:  radial-gradient(ellipse at center, rgba(43, 188, 204, 0.3) 0%, transparent 70%);
  --gradient-glow-blue:  radial-gradient(ellipse at center, rgba(65, 105, 225, 0.3) 0%, transparent 70%);
  --gradient-sidebar:    linear-gradient(180deg, var(--swan-navy-deep) 0%, var(--swan-navy) 40%, var(--swan-royal) 100%);
  --gradient-card-shine: linear-gradient(135deg, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0) 50%, rgba(255,255,255,0.05) 100%);
  --gradient-border:     linear-gradient(135deg, var(--fig-teal), var(--swan-electric), var(--fig-green));
  --gradient-text:       linear-gradient(135deg, var(--fig-teal) 0%, var(--swan-electric) 50%, var(--fig-green) 100%);
  --gradient-danger:     linear-gradient(135deg, #EF4444 0%, #DC2626 100%);
  --gradient-success:    linear-gradient(135deg, var(--fig-green) 0%, #22C55E 100%);

  /* ── Glow / Shadows ─────────────────────────────────────────────────────── */
  --glow-teal:           0 0 20px rgba(43, 188, 204, 0.5), 0 0 60px rgba(43, 188, 204, 0.2);
  --glow-teal-intense:   0 0 20px rgba(43, 188, 204, 0.6), 0 0 40px rgba(43, 188, 204, 0.4), 0 0 80px rgba(43, 188, 204, 0.2);
  --glow-blue:           0 0 20px rgba(65, 105, 225, 0.5), 0 0 60px rgba(65, 105, 225, 0.2);
  --glow-blue-intense:   0 0 20px rgba(65, 105, 225, 0.6), 0 0 40px rgba(65, 105, 225, 0.4), 0 0 80px rgba(65, 105, 225, 0.2);
  --glow-green:          0 0 20px rgba(141, 198, 63, 0.5), 0 0 60px rgba(141, 198, 63, 0.2);
  --glow-orange:         0 0 20px rgba(247, 148, 29, 0.5), 0 0 60px rgba(247, 148, 29, 0.2);
  --glow-danger:         0 0 20px rgba(239, 68, 68, 0.5), 0 0 60px rgba(239, 68, 68, 0.2);
  --glow-white:          0 0 20px rgba(255, 255, 255, 0.3), 0 0 60px rgba(255, 255, 255, 0.1);

  --shadow-xs:           0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-sm:           0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
  --shadow-md:           0 4px 6px rgba(0, 0, 0, 0.1), 0 2px 4px rgba(0, 0, 0, 0.06);
  --shadow-lg:           0 10px 15px rgba(0, 0, 0, 0.1), 0 4px 6px rgba(0, 0, 0, 0.05);
  --shadow-xl:           0 20px 25px rgba(0, 0, 0, 0.1), 0 10px 10px rgba(0, 0, 0, 0.04);
  --shadow-2xl:          0 25px 50px rgba(0, 0, 0, 0.25);
  --shadow-inner:        inset 0 2px 4px rgba(0, 0, 0, 0.06);
  --shadow-glow-primary: 0 4px 15px rgba(43, 188, 204, 0.3), 0 1px 3px rgba(0, 0, 0, 0.1);
  --shadow-glow-accent:  0 4px 15px rgba(141, 198, 63, 0.3), 0 1px 3px rgba(0, 0, 0, 0.1);

  /* ── Typography ─────────────────────────────────────────────────────────── */
  --font-sans:           'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --font-display:        'Plus Jakarta Sans', 'Inter', system-ui, sans-serif;
  --font-mono:           'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace;

  --text-xs:             0.75rem;    /* 12px */
  --text-sm:             0.875rem;   /* 14px */
  --text-base:           1rem;       /* 16px */
  --text-lg:             1.125rem;   /* 18px */
  --text-xl:             1.25rem;    /* 20px */
  --text-2xl:            1.5rem;     /* 24px */
  --text-3xl:            1.875rem;   /* 30px */
  --text-4xl:            2.25rem;    /* 36px */
  --text-5xl:            3rem;       /* 48px */
  --text-6xl:            3.75rem;    /* 60px */

  --leading-none:        1;
  --leading-tight:       1.25;
  --leading-snug:        1.375;
  --leading-normal:      1.5;
  --leading-relaxed:     1.625;

  --tracking-tighter:    -0.05em;
  --tracking-tight:      -0.025em;
  --tracking-normal:     0;
  --tracking-wide:       0.025em;
  --tracking-wider:      0.05em;
  --tracking-widest:     0.1em;

  /* ── Spacing Scale ──────────────────────────────────────────────────────── */
  --space-0:   0;
  --space-1:   0.25rem;    /* 4px */
  --space-2:   0.5rem;     /* 8px */
  --space-3:   0.75rem;    /* 12px */
  --space-4:   1rem;       /* 16px */
  --space-5:   1.25rem;    /* 20px */
  --space-6:   1.5rem;     /* 24px */
  --space-8:   2rem;       /* 32px */
  --space-10:  2.5rem;     /* 40px */
  --space-12:  3rem;       /* 48px */
  --space-16:  4rem;       /* 64px */
  --space-20:  5rem;       /* 80px */
  --space-24:  6rem;       /* 96px */

  /* ── Border Radius ──────────────────────────────────────────────────────── */
  --radius-none: 0;
  --radius-sm:   0.25rem;   /* 4px */
  --radius-md:   0.5rem;    /* 8px */
  --radius-lg:   0.75rem;   /* 12px */
  --radius-xl:   1rem;      /* 16px */
  --radius-2xl:  1.5rem;    /* 24px */
  --radius-full: 9999px;

  /* ── Transitions / Easing ───────────────────────────────────────────────── */
  --ease-default:     cubic-bezier(0.4, 0, 0.2, 1);
  --ease-in:          cubic-bezier(0.4, 0, 1, 1);
  --ease-out:         cubic-bezier(0, 0, 0.2, 1);
  --ease-in-out:      cubic-bezier(0.4, 0, 0.2, 1);
  --ease-bounce:      cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-elastic:     cubic-bezier(0.68, -0.55, 0.265, 1.55);
  --ease-snap:        cubic-bezier(0.55, 0.085, 0, 0.99);
  --ease-haptic:      cubic-bezier(0.25, 0.1, 0.25, 1);

  --duration-instant:  75ms;
  --duration-fast:     150ms;
  --duration-normal:   250ms;
  --duration-slow:     400ms;
  --duration-slower:   600ms;
  --duration-glacial:  1000ms;

  /* ── Z-Index Scale ──────────────────────────────────────────────────────── */
  --z-dropdown:   1000;
  --z-sticky:     1020;
  --z-fixed:      1030;
  --z-backdrop:   1040;
  --z-modal:      1050;
  --z-popover:    1060;
  --z-tooltip:    1070;
  --z-toast:      1080;

  /* ── Layout ─────────────────────────────────────────────────────────────── */
  --sidebar-width:       280px;
  --sidebar-collapsed:   72px;
  --header-height:       64px;
  --content-max-width:   1400px;
}


/* ──────────────────────────────────────────────────────────────────────────────
   2. DARK THEME (DEFAULT) — THE SWAN AI LABS EXPERIENCE
   ────────────────────────────────────────────────────────────────────────────── */

[data-theme="dark"],
:root {
  --bg-primary:        var(--swan-navy-deep);
  --bg-secondary:      var(--swan-navy);
  --bg-tertiary:       var(--swan-navy-light);
  --bg-surface:        rgba(27, 27, 75, 0.8);
  --bg-surface-hover:  rgba(42, 42, 106, 0.8);
  --bg-elevated:       rgba(45, 45, 142, 0.3);
  --bg-glass:          rgba(27, 27, 75, 0.6);
  --bg-input:          rgba(14, 14, 46, 0.8);
  --bg-overlay:        rgba(14, 14, 46, 0.85);

  --text-primary:      var(--neutral-50);
  --text-secondary:    var(--neutral-300);
  --text-tertiary:     var(--neutral-400);
  --text-muted:        var(--neutral-500);
  --text-inverse:      var(--neutral-900);
  --text-accent:       var(--fig-teal-light);
  --text-link:         var(--swan-electric-glow);

  --border-default:    rgba(90, 106, 154, 0.3);
  --border-hover:      rgba(90, 106, 154, 0.5);
  --border-focus:      var(--fig-teal);
  --border-active:     var(--swan-electric);

  --ring-focus:        0 0 0 3px rgba(43, 188, 204, 0.4);
  --ring-active:       0 0 0 3px rgba(65, 105, 225, 0.4);
  --ring-danger:       0 0 0 3px rgba(239, 68, 68, 0.4);

  color-scheme: dark;
}


/* ──────────────────────────────────────────────────────────────────────────────
   3. LIGHT THEME — THE FIG / GROWTH EXPERIENCE
   ────────────────────────────────────────────────────────────────────────────── */

[data-theme="light"] {
  --bg-primary:        var(--neutral-50);
  --bg-secondary:      var(--neutral-0);
  --bg-tertiary:       var(--neutral-100);
  --bg-surface:        var(--neutral-0);
  --bg-surface-hover:  var(--neutral-100);
  --bg-elevated:       var(--neutral-0);
  --bg-glass:          rgba(255, 255, 255, 0.8);
  --bg-input:          var(--neutral-0);
  --bg-overlay:        rgba(15, 23, 42, 0.6);

  --text-primary:      var(--neutral-900);
  --text-secondary:    var(--neutral-600);
  --text-tertiary:     var(--neutral-500);
  --text-muted:        var(--neutral-400);
  --text-inverse:      var(--neutral-0);
  --text-accent:       var(--fig-teal-dark);
  --text-link:         var(--swan-electric);

  --border-default:    var(--neutral-200);
  --border-hover:      var(--neutral-300);
  --border-focus:      var(--fig-teal);
  --border-active:     var(--swan-electric);

  --ring-focus:        0 0 0 3px rgba(43, 188, 204, 0.3);
  --ring-active:       0 0 0 3px rgba(65, 105, 225, 0.3);
  --ring-danger:       0 0 0 3px rgba(239, 68, 68, 0.3);

  --shadow-glow-primary: 0 4px 15px rgba(43, 188, 204, 0.15), 0 1px 3px rgba(0, 0, 0, 0.08);
  --glow-teal:         0 0 15px rgba(43, 188, 204, 0.25), 0 0 40px rgba(43, 188, 204, 0.1);
  --glow-blue:         0 0 15px rgba(65, 105, 225, 0.25), 0 0 40px rgba(65, 105, 225, 0.1);

  color-scheme: light;
}


/* ──────────────────────────────────────────────────────────────────────────────
   4. KEYFRAME ANIMATIONS
   ────────────────────────────────────────────────────────────────────────────── */

/* Haptic press — the "click" feeling */
@keyframes haptic-press {
  0%   { transform: scale(1); }
  40%  { transform: scale(0.95); }
  60%  { transform: scale(0.97); }
  80%  { transform: scale(0.96); }
  100% { transform: scale(1); }
}

/* Subtle pulse glow */
@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 10px rgba(43, 188, 204, 0.3); }
  50%      { box-shadow: 0 0 25px rgba(43, 188, 204, 0.6), 0 0 50px rgba(43, 188, 204, 0.2); }
}

/* Ripple expanding outward */
@keyframes ripple-expand {
  0%   { transform: scale(0); opacity: 0.6; }
  100% { transform: scale(4); opacity: 0; }
}

/* Border gradient spin */
@keyframes gradient-rotate {
  0%   { --gradient-angle: 0deg; }
  100% { --gradient-angle: 360deg; }
}

/* Shimmer highlight across surface */
@keyframes shimmer {
  0%   { background-position: -200% center; }
  100% { background-position: 200% center; }
}

/* Smooth fade in + rise */
@keyframes fade-in-up {
  0%   { opacity: 0; transform: translateY(12px); }
  100% { opacity: 1; transform: translateY(0); }
}

/* Slide in from left */
@keyframes slide-in-left {
  0%   { opacity: 0; transform: translateX(-20px); }
  100% { opacity: 1; transform: translateX(0); }
}

/* Slide in from right */
@keyframes slide-in-right {
  0%   { opacity: 0; transform: translateX(20px); }
  100% { opacity: 1; transform: translateX(0); }
}

/* Scale bounce in */
@keyframes scale-in {
  0%   { opacity: 0; transform: scale(0.9); }
  50%  { transform: scale(1.02); }
  100% { opacity: 1; transform: scale(1); }
}

/* Toast slide in */
@keyframes toast-in {
  0%   { opacity: 0; transform: translateX(100%) scale(0.95); }
  100% { opacity: 1; transform: translateX(0) scale(1); }
}

/* Breathing glow for active/live indicators */
@keyframes breathe {
  0%, 100% { opacity: 0.4; transform: scale(1); }
  50%      { opacity: 1; transform: scale(1.1); }
}

/* Spinner rotation */
@keyframes spin {
  0%   { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Float up and down */
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-6px); }
}

/* Chain link shimmer (for Swan AI Labs border motif) */
@keyframes chain-shimmer {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}


/* ──────────────────────────────────────────────────────────────────────────────
   5. BASE RESET & GLOBALS
   ────────────────────────────────────────────────────────────────────────────── */

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

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

body {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  color: var(--text-primary);
  background: var(--bg-primary);
  min-height: 100vh;
  transition: background-color var(--duration-slow) var(--ease-default),
              color var(--duration-slow) var(--ease-default);
}

::selection {
  background: rgba(43, 188, 204, 0.3);
  color: var(--text-primary);
}

:focus-visible {
  outline: none;
  box-shadow: var(--ring-focus);
}

a {
  color: var(--text-link);
  text-decoration: none;
  transition: color var(--duration-fast) var(--ease-default);
}
a:hover {
  color: var(--fig-teal-light);
  text-decoration: underline;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: var(--leading-tight);
  color: var(--text-primary);
}

/* Gradient text utility */
.text-gradient {
  background: var(--gradient-text);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}


/* ──────────────────────────────────────────────────────────────────────────────
   6. BUTTONS — GRADIENT HAPTIC SYSTEM
   ────────────────────────────────────────────────────────────────────────────── */

.btn {
  /* Base structure */
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-6);
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  font-weight: 600;
  line-height: var(--leading-normal);
  letter-spacing: var(--tracking-wide);
  text-transform: none;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  border: 1px solid transparent;
  border-radius: var(--radius-lg);
  overflow: hidden;
  isolation: isolate;

  /* Smooth transitions for everything */
  transition:
    transform var(--duration-fast) var(--ease-haptic),
    box-shadow var(--duration-normal) var(--ease-default),
    background var(--duration-normal) var(--ease-default),
    border-color var(--duration-fast) var(--ease-default),
    opacity var(--duration-fast) var(--ease-default);

  /* Touch optimization */
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

/* ── Ripple Effect ──────────────────────────────────────────────────────── */
.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle, rgba(255,255,255,0.3) 0%, transparent 70%);
  transform: scale(0);
  opacity: 0;
  border-radius: inherit;
  pointer-events: none;
  z-index: 1;
}

.btn:active::after {
  animation: ripple-expand 0.5s var(--ease-out) forwards;
}

/* ── Haptic Press Effect ────────────────────────────────────────────────── */
.btn:active {
  animation: haptic-press 0.3s var(--ease-haptic);
}

/* ── Hover lift effect ──────────────────────────────────────────────────── */
.btn:hover:not(:disabled) {
  transform: translateY(-1px);
}
.btn:active:not(:disabled) {
  transform: translateY(0.5px) scale(0.98);
}

/* ── Focus ring ─────────────────────────────────────────────────────────── */
.btn:focus-visible {
  box-shadow: var(--ring-focus);
}

/* ── Disabled state ─────────────────────────────────────────────────────── */
.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
  animation: none !important;
  box-shadow: none !important;
}


/* ─── BUTTON VARIANT: Primary (Teal → Blue gradient) ─────────────────── */
.btn-primary {
  background: var(--gradient-primary);
  color: var(--neutral-0);
  border-color: transparent;
  box-shadow: var(--shadow-md), 0 0 0 1px rgba(43, 188, 204, 0.1);
}
.btn-primary:hover:not(:disabled) {
  box-shadow: var(--glow-teal), var(--shadow-lg);
}
.btn-primary:active:not(:disabled) {
  box-shadow: var(--shadow-sm), inset 0 2px 4px rgba(0,0,0,0.2);
}

/* ─── BUTTON VARIANT: Secondary (Surface glass) ──────────────────────── */
.btn-secondary {
  background: var(--bg-surface);
  color: var(--text-primary);
  border-color: var(--border-default);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.btn-secondary:hover:not(:disabled) {
  background: var(--bg-surface-hover);
  border-color: var(--fig-teal);
  box-shadow: 0 0 15px rgba(43, 188, 204, 0.15);
}
.btn-secondary:active:not(:disabled) {
  background: var(--bg-elevated);
}

/* ─── BUTTON VARIANT: Accent (Green → Teal gradient) ─────────────────── */
.btn-accent {
  background: var(--gradient-accent);
  color: var(--neutral-0);
  border-color: transparent;
  box-shadow: var(--shadow-md);
}
.btn-accent:hover:not(:disabled) {
  box-shadow: var(--glow-green), var(--shadow-lg);
}

/* ─── BUTTON VARIANT: Warm (Orange gradient — FIG brand) ─────────────── */
.btn-warm {
  background: var(--gradient-warm);
  color: var(--neutral-0);
  border-color: transparent;
  box-shadow: var(--shadow-md);
}
.btn-warm:hover:not(:disabled) {
  box-shadow: var(--glow-orange), var(--shadow-lg);
}

/* ─── BUTTON VARIANT: Royal (Deep navy → Royal gradient) ─────────────── */
.btn-royal {
  background: var(--gradient-royal);
  color: var(--neutral-0);
  border-color: rgba(90, 106, 154, 0.4);
  box-shadow: var(--shadow-md);
}
.btn-royal:hover:not(:disabled) {
  box-shadow: var(--glow-blue), var(--shadow-lg);
  border-color: var(--swan-electric);
}

/* ─── BUTTON VARIANT: Ghost (Transparent with hover) ─────────────────── */
.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border-color: transparent;
}
.btn-ghost:hover:not(:disabled) {
  background: var(--bg-surface-hover);
  color: var(--text-primary);
  border-color: var(--border-default);
}

/* ─── BUTTON VARIANT: Danger ─────────────────────────────────────────── */
.btn-danger {
  background: var(--gradient-danger);
  color: var(--neutral-0);
  border-color: transparent;
  box-shadow: var(--shadow-md);
}
.btn-danger:hover:not(:disabled) {
  box-shadow: var(--glow-danger), var(--shadow-lg);
}

/* ─── BUTTON VARIANT: Outline with gradient border ───────────────────── */
.btn-outline-gradient {
  background: var(--bg-primary);
  color: var(--text-primary);
  border: 2px solid transparent;
  background-clip: padding-box;
  position: relative;
}
.btn-outline-gradient::before {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: inherit;
  background: var(--gradient-border);
  z-index: -1;
  transition: opacity var(--duration-normal) var(--ease-default);
}
.btn-outline-gradient:hover:not(:disabled) {
  box-shadow: var(--glow-teal);
}
.btn-outline-gradient:hover:not(:disabled)::before {
  opacity: 0.8;
}

/* ─── BUTTON VARIANT: Glow pulse (attention-grabbing CTA) ────────────── */
.btn-glow {
  background: var(--gradient-primary);
  color: var(--neutral-0);
  border-color: transparent;
  animation: pulse-glow 3s var(--ease-in-out) infinite;
}
.btn-glow:hover:not(:disabled) {
  animation: none;
  box-shadow: var(--glow-teal-intense);
}

/* ── Button Sizes ───────────────────────────────────────────────────────── */
.btn-xs {
  padding: var(--space-1) var(--space-3);
  font-size: var(--text-xs);
  border-radius: var(--radius-md);
}
.btn-sm {
  padding: var(--space-2) var(--space-4);
  font-size: var(--text-sm);
  border-radius: var(--radius-md);
}
.btn-lg {
  padding: var(--space-4) var(--space-8);
  font-size: var(--text-lg);
  border-radius: var(--radius-xl);
}
.btn-xl {
  padding: var(--space-5) var(--space-10);
  font-size: var(--text-xl);
  border-radius: var(--radius-xl);
  letter-spacing: var(--tracking-wider);
}

/* ── Icon button ────────────────────────────────────────────────────────── */
.btn-icon {
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: var(--radius-lg);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.btn-icon.btn-sm { width: 32px; height: 32px; }
.btn-icon.btn-lg { width: 48px; height: 48px; }

/* ── Full width ─────────────────────────────────────────────────────────── */
.btn-full { width: 100%; }

/* ── Button group ───────────────────────────────────────────────────────── */
.btn-group {
  display: inline-flex;
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.btn-group .btn {
  border-radius: 0;
  border-right-width: 0;
}
.btn-group .btn:first-child { border-radius: var(--radius-lg) 0 0 var(--radius-lg); }
.btn-group .btn:last-child  { border-radius: 0 var(--radius-lg) var(--radius-lg) 0; border-right-width: 1px; }


/* ──────────────────────────────────────────────────────────────────────────────
   7. CARDS — GLASSMORPHIC SURFACES
   ────────────────────────────────────────────────────────────────────────────── */

.card {
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-xl);
  padding: var(--space-6);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: var(--shadow-md);
  transition:
    transform var(--duration-normal) var(--ease-default),
    box-shadow var(--duration-normal) var(--ease-default),
    border-color var(--duration-normal) var(--ease-default);
  position: relative;
  overflow: hidden;
}

/* Subtle shine overlay */
.card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--gradient-card-shine);
  pointer-events: none;
  border-radius: inherit;
}

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

/* Card with glow on hover */
.card-glow:hover {
  box-shadow: var(--shadow-glow-primary);
  border-color: var(--fig-teal);
}

/* Card with gradient top border */
.card-gradient-top {
  border-top: 3px solid transparent;
  border-image: var(--gradient-border) 1;
  border-image-slice: 1;
}

/* Card header / body / footer */
.card-header {
  padding-bottom: var(--space-4);
  border-bottom: 1px solid var(--border-default);
  margin-bottom: var(--space-4);
}
.card-title {
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--text-primary);
}
.card-subtitle {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  margin-top: var(--space-1);
}
.card-body {
  color: var(--text-secondary);
  font-size: var(--text-sm);
  line-height: var(--leading-relaxed);
}
.card-footer {
  padding-top: var(--space-4);
  border-top: 1px solid var(--border-default);
  margin-top: var(--space-4);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-3);
}

/* Stat card */
.card-stat {
  text-align: center;
  padding: var(--space-8) var(--space-6);
}
.card-stat .stat-value {
  font-family: var(--font-display);
  font-size: var(--text-4xl);
  font-weight: 800;
  line-height: 1;
  margin-bottom: var(--space-2);
}
.card-stat .stat-label {
  font-size: var(--text-sm);
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wider);
}
.card-stat .stat-change {
  font-size: var(--text-xs);
  font-weight: 600;
  margin-top: var(--space-2);
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-full);
}
.card-stat .stat-change.up {
  color: var(--fig-green);
  background: rgba(141, 198, 63, 0.1);
}
.card-stat .stat-change.down {
  color: var(--color-danger);
  background: rgba(239, 68, 68, 0.1);
}


/* ──────────────────────────────────────────────────────────────────────────────
   8. FORM INPUTS
   ────────────────────────────────────────────────────────────────────────────── */

.input-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.input-label {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: var(--tracking-wide);
}

.input {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  color: var(--text-primary);
  background: var(--bg-input);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  outline: none;
  transition:
    border-color var(--duration-fast) var(--ease-default),
    box-shadow var(--duration-fast) var(--ease-default),
    background var(--duration-fast) var(--ease-default);
}
.input::placeholder {
  color: var(--text-muted);
}
.input:hover {
  border-color: var(--border-hover);
  background: var(--bg-surface-hover);
}
.input:focus {
  border-color: var(--border-focus);
  box-shadow: var(--ring-focus), 0 0 15px rgba(43, 188, 204, 0.1);
}

/* Input with glow focus */
.input-glow:focus {
  box-shadow: var(--ring-focus), var(--glow-teal);
}

/* Select dropdown */
.select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%2394A3B8' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right var(--space-4) center;
  padding-right: var(--space-10);
}

/* Textarea */
.textarea {
  resize: vertical;
  min-height: 100px;
}

/* Checkbox / Radio base */
.checkbox,
.radio {
  appearance: none;
  width: 20px;
  height: 20px;
  border: 2px solid var(--border-default);
  background: var(--bg-input);
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-haptic);
  flex-shrink: 0;
}
.checkbox { border-radius: var(--radius-sm); }
.radio    { border-radius: var(--radius-full); }

.checkbox:checked,
.radio:checked {
  background: var(--fig-teal);
  border-color: var(--fig-teal);
  box-shadow: 0 0 10px rgba(43, 188, 204, 0.3);
}
.checkbox:checked {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='white' viewBox='0 0 16 16'%3E%3Cpath d='M13.854 3.646a.5.5 0 0 1 0 .708l-7 7a.5.5 0 0 1-.708 0l-3.5-3.5a.5.5 0 1 1 .708-.708L6.5 10.293l6.646-6.647a.5.5 0 0 1 .708 0z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
}
.radio:checked {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8'%3E%3Ccircle cx='4' cy='4' r='4' fill='white'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
}

/* Toggle switch */
.toggle {
  position: relative;
  width: 48px;
  height: 26px;
  appearance: none;
  background: var(--neutral-600);
  border-radius: var(--radius-full);
  cursor: pointer;
  border: none;
  transition: background var(--duration-normal) var(--ease-default);
}
.toggle::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  background: var(--neutral-0);
  border-radius: var(--radius-full);
  box-shadow: var(--shadow-sm);
  transition: transform var(--duration-normal) var(--ease-bounce);
}
.toggle:checked {
  background: var(--gradient-primary);
  box-shadow: 0 0 12px rgba(43, 188, 204, 0.3);
}
.toggle:checked::after {
  transform: translateX(22px);
}


/* ──────────────────────────────────────────────────────────────────────────────
   9. NAVIGATION — SIDEBAR & HEADER
   ────────────────────────────────────────────────────────────────────────────── */

.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-width);
  height: 100vh;
  background: var(--gradient-sidebar);
  border-right: 1px solid rgba(90, 106, 154, 0.2);
  display: flex;
  flex-direction: column;
  z-index: var(--z-fixed);
  transition: width var(--duration-slow) var(--ease-default);
  overflow: hidden;
}

.sidebar-brand {
  padding: var(--space-5) var(--space-6);
  display: flex;
  align-items: center;
  gap: var(--space-3);
  border-bottom: 1px solid rgba(90, 106, 154, 0.2);
}
.sidebar-brand img {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-lg);
  object-fit: contain;
}
.sidebar-brand-name {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--neutral-0);
  white-space: nowrap;
}

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

.nav-section-title {
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: var(--tracking-widest);
  color: var(--swan-chain);
  padding: var(--space-4) var(--space-3) var(--space-2);
}

.nav-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-lg);
  color: var(--neutral-300);
  font-size: var(--text-sm);
  font-weight: 500;
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-default);
  white-space: nowrap;
  position: relative;
  overflow: hidden;
}
.nav-item:hover {
  background: rgba(43, 188, 204, 0.1);
  color: var(--neutral-0);
}
.nav-item.active {
  background: rgba(43, 188, 204, 0.15);
  color: var(--fig-teal-light);
  box-shadow: inset 3px 0 0 var(--fig-teal);
}
.nav-item.active::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(43, 188, 204, 0.08), transparent);
  pointer-events: none;
}
.nav-item .nav-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  opacity: 0.7;
}
.nav-item:hover .nav-icon,
.nav-item.active .nav-icon {
  opacity: 1;
}

/* Header bar */
.header {
  height: var(--header-height);
  background: var(--bg-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-default);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-6);
  position: sticky;
  top: 0;
  z-index: var(--z-sticky);
}
.header-title {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 700;
}
.header-actions {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}


/* ──────────────────────────────────────────────────────────────────────────────
   10. BADGES & TAGS
   ────────────────────────────────────────────────────────────────────────────── */

.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-1) var(--space-3);
  font-size: var(--text-xs);
  font-weight: 600;
  border-radius: var(--radius-full);
  letter-spacing: var(--tracking-wide);
  white-space: nowrap;
}
.badge-primary {
  background: rgba(43, 188, 204, 0.15);
  color: var(--fig-teal-light);
  border: 1px solid rgba(43, 188, 204, 0.3);
}
.badge-success {
  background: rgba(34, 197, 94, 0.15);
  color: var(--color-success);
  border: 1px solid rgba(34, 197, 94, 0.3);
}
.badge-warning {
  background: rgba(247, 148, 29, 0.15);
  color: var(--fig-orange-light);
  border: 1px solid rgba(247, 148, 29, 0.3);
}
.badge-danger {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
}
.badge-royal {
  background: rgba(65, 105, 225, 0.15);
  color: var(--swan-electric-glow);
  border: 1px solid rgba(65, 105, 225, 0.3);
}

/* Dot indicator on badges */
.badge-dot::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: var(--radius-full);
  background: currentColor;
  animation: breathe 2s ease-in-out infinite;
}


/* ──────────────────────────────────────────────────────────────────────────────
   11. ALERTS / NOTIFICATIONS
   ────────────────────────────────────────────────────────────────────────────── */

.alert {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-5);
  border-radius: var(--radius-lg);
  border: 1px solid transparent;
  font-size: var(--text-sm);
  animation: fade-in-up var(--duration-normal) var(--ease-out);
}
.alert-info {
  background: rgba(65, 105, 225, 0.1);
  border-color: rgba(65, 105, 225, 0.3);
  color: var(--swan-electric-glow);
}
.alert-success {
  background: rgba(34, 197, 94, 0.1);
  border-color: rgba(34, 197, 94, 0.3);
  color: var(--color-success);
}
.alert-warning {
  background: rgba(247, 148, 29, 0.1);
  border-color: rgba(247, 148, 29, 0.3);
  color: var(--fig-orange-light);
}
.alert-danger {
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.3);
  color: #f87171;
}

/* Toast notifications */
.toast {
  position: fixed;
  bottom: var(--space-6);
  right: var(--space-6);
  min-width: 320px;
  max-width: 480px;
  padding: var(--space-4) var(--space-5);
  background: var(--bg-surface);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-2xl);
  z-index: var(--z-toast);
  animation: toast-in var(--duration-slow) var(--ease-bounce);
}


/* ──────────────────────────────────────────────────────────────────────────────
   12. TABLES
   ────────────────────────────────────────────────────────────────────────────── */

.table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius-xl);
  border: 1px solid var(--border-default);
  background: var(--bg-surface);
  backdrop-filter: blur(12px);
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
}
.table th {
  padding: var(--space-3) var(--space-4);
  text-align: left;
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: var(--tracking-wider);
  color: var(--text-tertiary);
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border-default);
  white-space: nowrap;
}
.table td {
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border-default);
  color: var(--text-secondary);
  transition: background var(--duration-fast) var(--ease-default);
}
.table tbody tr:hover td {
  background: var(--bg-surface-hover);
}
.table tbody tr:last-child td {
  border-bottom: none;
}


/* ──────────────────────────────────────────────────────────────────────────────
   13. PROGRESS BARS & LOADING
   ────────────────────────────────────────────────────────────────────────────── */

.progress {
  width: 100%;
  height: 8px;
  background: var(--bg-elevated);
  border-radius: var(--radius-full);
  overflow: hidden;
  position: relative;
}
.progress-bar {
  height: 100%;
  border-radius: var(--radius-full);
  background: var(--gradient-primary);
  transition: width var(--duration-slow) var(--ease-out);
  position: relative;
}
.progress-bar::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
  background-size: 200% 100%;
  animation: shimmer 2s infinite;
}

/* Circular spinner */
.spinner {
  width: 24px;
  height: 24px;
  border: 3px solid var(--border-default);
  border-top-color: var(--fig-teal);
  border-radius: var(--radius-full);
  animation: spin 0.8s linear infinite;
}
.spinner-lg { width: 40px; height: 40px; border-width: 4px; }

/* Skeleton loading */
.skeleton {
  background: linear-gradient(90deg, var(--bg-elevated) 25%, var(--bg-surface-hover) 50%, var(--bg-elevated) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-md);
}
.skeleton-text { height: 14px; margin-bottom: var(--space-2); }
.skeleton-heading { height: 24px; width: 60%; margin-bottom: var(--space-3); }
.skeleton-avatar { width: 40px; height: 40px; border-radius: var(--radius-full); }


/* ──────────────────────────────────────────────────────────────────────────────
   14. MODALS & DIALOGS
   ────────────────────────────────────────────────────────────────────────────── */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: var(--bg-overlay);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: var(--z-backdrop);
  animation: fade-in-up var(--duration-fast) var(--ease-out);
}

.modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 90%;
  max-width: 540px;
  max-height: 85vh;
  overflow-y: auto;
  background: var(--bg-surface);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-2xl);
  box-shadow: var(--shadow-2xl), var(--glow-blue);
  z-index: var(--z-modal);
  animation: scale-in var(--duration-normal) var(--ease-bounce);
}
.modal-header {
  padding: var(--space-6);
  border-bottom: 1px solid var(--border-default);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.modal-title {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 700;
}
.modal-body {
  padding: var(--space-6);
}
.modal-footer {
  padding: var(--space-4) var(--space-6);
  border-top: 1px solid var(--border-default);
  display: flex;
  justify-content: flex-end;
  gap: var(--space-3);
}


/* ──────────────────────────────────────────────────────────────────────────────
   15. TOOLTIPS & POPOVERS
   ────────────────────────────────────────────────────────────────────────────── */

.tooltip {
  position: relative;
}
.tooltip::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  padding: var(--space-2) var(--space-3);
  background: var(--neutral-800);
  color: var(--neutral-0);
  font-size: var(--text-xs);
  font-weight: 500;
  border-radius: var(--radius-md);
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition:
    opacity var(--duration-fast) var(--ease-default),
    transform var(--duration-fast) var(--ease-default);
  z-index: var(--z-tooltip);
}
.tooltip:hover::after {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}


/* ──────────────────────────────────────────────────────────────────────────────
   16. AVATARS & USER ELEMENTS
   ────────────────────────────────────────────────────────────────────────────── */

.avatar {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  object-fit: cover;
  border: 2px solid var(--border-default);
  transition: border-color var(--duration-fast) var(--ease-default),
              box-shadow var(--duration-fast) var(--ease-default);
}
.avatar:hover {
  border-color: var(--fig-teal);
  box-shadow: var(--glow-teal);
}
.avatar-sm { width: 32px; height: 32px; }
.avatar-lg { width: 56px; height: 56px; }
.avatar-xl { width: 80px; height: 80px; }

.avatar-group {
  display: flex;
}
.avatar-group .avatar {
  margin-left: -8px;
  border: 2px solid var(--bg-primary);
}
.avatar-group .avatar:first-child { margin-left: 0; }


/* ──────────────────────────────────────────────────────────────────────────────
   17. TABS
   ────────────────────────────────────────────────────────────────────────────── */

.tabs {
  display: flex;
  border-bottom: 1px solid var(--border-default);
  gap: var(--space-1);
}
.tab {
  padding: var(--space-3) var(--space-5);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-tertiary);
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-default);
  background: none;
  border-top: none;
  border-left: none;
  border-right: none;
}
.tab:hover {
  color: var(--text-primary);
  background: var(--bg-surface-hover);
}
.tab.active {
  color: var(--fig-teal);
  border-bottom-color: var(--fig-teal);
}


/* ──────────────────────────────────────────────────────────────────────────────
   18. DROPDOWN MENUS
   ────────────────────────────────────────────────────────────────────────────── */

.dropdown {
  position: relative;
  display: inline-block;
}
.dropdown-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  min-width: 200px;
  background: var(--bg-surface);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  padding: var(--space-2);
  z-index: var(--z-dropdown);
  animation: fade-in-up var(--duration-fast) var(--ease-out);
}
.dropdown-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-sm);
  color: var(--text-secondary);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-default);
}
.dropdown-item:hover {
  background: var(--bg-surface-hover);
  color: var(--text-primary);
}
.dropdown-divider {
  height: 1px;
  background: var(--border-default);
  margin: var(--space-2) 0;
}


/* ──────────────────────────────────────────────────────────────────────────────
   19. BREADCRUMBS
   ────────────────────────────────────────────────────────────────────────────── */

.breadcrumb {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  color: var(--text-tertiary);
}
.breadcrumb-item {
  color: var(--text-tertiary);
  transition: color var(--duration-fast) var(--ease-default);
}
.breadcrumb-item:hover { color: var(--text-primary); }
.breadcrumb-item.active { color: var(--text-primary); font-weight: 600; }
.breadcrumb-sep { color: var(--text-muted); }


/* ──────────────────────────────────────────────────────────────────────────────
   20. SPECIAL EFFECTS & UTILITIES
   ────────────────────────────────────────────────────────────────────────────── */

/* Animated gradient border wrapper */
.gradient-border-wrap {
  position: relative;
  padding: 2px;
  border-radius: var(--radius-xl);
  background: linear-gradient(var(--gradient-angle, 135deg), var(--fig-teal), var(--swan-electric), var(--fig-green), var(--fig-orange), var(--fig-teal));
  background-size: 400% 400%;
  animation: chain-shimmer 6s ease infinite;
}
.gradient-border-wrap > * {
  background: var(--bg-primary);
  border-radius: calc(var(--radius-xl) - 2px);
}

/* Glass panel */
.glass {
  background: var(--bg-glass);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid var(--border-default);
}

/* Glow text */
.text-glow {
  text-shadow: 0 0 10px rgba(43, 188, 204, 0.5), 0 0 30px rgba(43, 188, 204, 0.2);
}

/* Floating animation */
.float { animation: float 3s ease-in-out infinite; }

/* Fade in animation classes */
.animate-fade-in     { animation: fade-in-up var(--duration-normal) var(--ease-out) both; }
.animate-slide-left  { animation: slide-in-left var(--duration-normal) var(--ease-out) both; }
.animate-slide-right { animation: slide-in-right var(--duration-normal) var(--ease-out) both; }
.animate-scale-in    { animation: scale-in var(--duration-normal) var(--ease-bounce) both; }

/* Staggered animation delays */
.delay-1 { animation-delay: 50ms; }
.delay-2 { animation-delay: 100ms; }
.delay-3 { animation-delay: 150ms; }
.delay-4 { animation-delay: 200ms; }
.delay-5 { animation-delay: 250ms; }
.delay-6 { animation-delay: 300ms; }

/* Divider with gradient */
.divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border-default), transparent);
  border: none;
  margin: var(--space-6) 0;
}

/* Scrollbar styling */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--neutral-600);
  border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--neutral-500);
}

/* Focus ring removal on mouse, keep for keyboard */
:focus:not(:focus-visible) {
  outline: none;
  box-shadow: none;
}


/* ──────────────────────────────────────────────────────────────────────────────
   21. RESPONSIVE / MEDIA QUERIES
   ────────────────────────────────────────────────────────────────────────────── */

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform var(--duration-slow) var(--ease-default);
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .modal {
    width: 95%;
    max-height: 90vh;
  }
  .btn-xl {
    padding: var(--space-4) var(--space-6);
    font-size: var(--text-lg);
  }
}

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