/* ============================================================================
   CarRent Pro — Design System v2.0
   6 Professional Enterprise Themes | Production Ready 2026
   ============================================================================ */

/* ============================================================================
   THEME 1: Neo Glass — Glassmorphism Blue-Violet
   Inspired by: Linear, Vercel, Raycast
   ============================================================================ */
:root,
[data-theme="neo-glass"] {
    /* Base */
    --bg-base:             #0f0f1a;
    --bg-gradient:         linear-gradient(135deg, #0f0f1a 0%, #141428 50%, #0d0d20 100%);
    --surface:             rgba(255,255,255,0.06);
    --surface-elevated:    rgba(255,255,255,0.10);
    --surface-soft:        rgba(255,255,255,0.04);
    --surface-border:      rgba(255,255,255,0.10);

    /* Primary */
    --primary:             #818cf8;
    --primary-hover:       #a5b4fc;
    --primary-soft:        rgba(129,140,248,0.15);
    --primary-rgb:         129, 140, 248;

    /* Accent */
    --accent:              #c084fc;
    --accent-soft:         rgba(192,132,252,0.15);

    /* Text */
    --text-main:           #f1f5f9;
    --text-secondary:      #94a3b8;
    --text-muted:          #64748b;
    --text-inverse:        #0f0f1a;

    /* Semantic */
    --success:             #34d399;
    --success-soft:        rgba(52,211,153,0.15);
    --warning:             #fbbf24;
    --warning-soft:        rgba(251,191,36,0.15);
    --danger:              #f87171;
    --danger-soft:         rgba(248,113,113,0.15);
    --info:                #38bdf8;
    --info-soft:           rgba(56,189,248,0.15);

    /* Border */
    --border:              rgba(255,255,255,0.10);
    --border-strong:       rgba(255,255,255,0.20);

    /* Sidebar */
    --sidebar-bg:          rgba(15,15,26,0.95);
    --sidebar-border:      rgba(255,255,255,0.08);
    --sidebar-active-bg:   rgba(129,140,248,0.20);
    --sidebar-active-fg:   #818cf8;
    --sidebar-hover-bg:    rgba(255,255,255,0.06);
    --sidebar-text:        #94a3b8;
    --sidebar-icon:        #64748b;

    /* Navbar */
    --navbar-bg:           rgba(15,15,26,0.80);
    --navbar-border:       rgba(255,255,255,0.08);

    /* Card */
    --card-bg:             rgba(255,255,255,0.06);
    --card-border:         rgba(255,255,255,0.10);
    --card-shadow:         0 8px 32px rgba(0,0,0,0.4);
    --card-hover-shadow:   0 16px 48px rgba(0,0,0,0.5);

    /* Form */
    --input-bg:            rgba(255,255,255,0.06);
    --input-border:        rgba(255,255,255,0.12);
    --input-focus-border:  #818cf8;
    --input-text:          #f1f5f9;
    --input-placeholder:   #64748b;

    /* Badge */
    --badge-primary-bg:    rgba(129,140,248,0.20);
    --badge-primary-text:  #818cf8;

    /* Scrollbar */
    --scrollbar-track:     rgba(255,255,255,0.04);
    --scrollbar-thumb:     rgba(255,255,255,0.15);

    /* Radius */
    --radius-sm:           6px;
    --radius-md:           10px;
    --radius-lg:           16px;
    --radius-xl:           24px;
    --radius-full:         9999px;

    /* Shadows */
    --shadow-sm:           0 2px 8px rgba(0,0,0,0.3);
    --shadow-md:           0 4px 16px rgba(0,0,0,0.4);
    --shadow-lg:           0 8px 32px rgba(0,0,0,0.5);
    --shadow-glow:         0 0 20px rgba(129,140,248,0.3);

    /* Backdrop */
    --glass-blur:          blur(20px) saturate(180%);
    --glass-border:        rgba(255,255,255,0.12);

    /* Transitions */
    --transition-fast:     150ms cubic-bezier(0.4,0,0.2,1);
    --transition-base:     200ms cubic-bezier(0.4,0,0.2,1);
    --transition-slow:     300ms cubic-bezier(0.4,0,0.2,1);

    /* Typography */
    --font-body:           'Inter', 'Cairo', system-ui, sans-serif;
    --font-mono:           'JetBrains Mono', 'Fira Code', monospace;
}

/* ============================================================================
   THEME 2: Midnight Pro — Dark Professional
   Inspired by: GitHub Dark, Stripe Dashboard, Supabase
   ============================================================================ */
[data-theme="midnight-pro"] {
    --bg-base:             #0d1117;
    --bg-gradient:         linear-gradient(135deg, #0d1117 0%, #161b22 100%);
    --surface:             #161b22;
    --surface-elevated:    #21262d;
    --surface-soft:        #0d1117;
    --surface-border:      #30363d;

    --primary:             #58a6ff;
    --primary-hover:       #79b8ff;
    --primary-soft:        rgba(88,166,255,0.15);
    --primary-rgb:         88, 166, 255;

    --accent:              #bc8cff;
    --accent-soft:         rgba(188,140,255,0.15);

    --text-main:           #e6edf3;
    --text-secondary:      #8b949e;
    --text-muted:          #6e7681;
    --text-inverse:        #0d1117;

    --success:             #3fb950;
    --success-soft:        rgba(63,185,80,0.15);
    --warning:             #d29922;
    --warning-soft:        rgba(210,153,34,0.15);
    --danger:              #f85149;
    --danger-soft:         rgba(248,81,73,0.15);
    --info:                #58a6ff;
    --info-soft:           rgba(88,166,255,0.15);

    --border:              #30363d;
    --border-strong:       #484f58;

    --sidebar-bg:          #161b22;
    --sidebar-border:      #30363d;
    --sidebar-active-bg:   rgba(88,166,255,0.15);
    --sidebar-active-fg:   #58a6ff;
    --sidebar-hover-bg:    rgba(255,255,255,0.05);
    --sidebar-text:        #8b949e;
    --sidebar-icon:        #6e7681;

    --navbar-bg:           #161b22;
    --navbar-border:       #30363d;

    --card-bg:             #161b22;
    --card-border:         #30363d;
    --card-shadow:         0 4px 16px rgba(0,0,0,0.4);
    --card-hover-shadow:   0 8px 24px rgba(0,0,0,0.5);

    --input-bg:            #0d1117;
    --input-border:        #30363d;
    --input-focus-border:  #58a6ff;
    --input-text:          #e6edf3;
    --input-placeholder:   #6e7681;

    --badge-primary-bg:    rgba(88,166,255,0.15);
    --badge-primary-text:  #58a6ff;

    --scrollbar-track:     #0d1117;
    --scrollbar-thumb:     #30363d;

    --radius-sm:           6px;
    --radius-md:           8px;
    --radius-lg:           12px;
    --radius-xl:           20px;
    --radius-full:         9999px;

    --shadow-sm:           0 1px 4px rgba(0,0,0,0.4);
    --shadow-md:           0 4px 12px rgba(0,0,0,0.5);
    --shadow-lg:           0 8px 24px rgba(0,0,0,0.6);
    --shadow-glow:         0 0 16px rgba(88,166,255,0.25);

    --glass-blur:          blur(12px);
    --glass-border:        #30363d;

    --transition-fast:     120ms cubic-bezier(0.4,0,0.2,1);
    --transition-base:     200ms cubic-bezier(0.4,0,0.2,1);
    --transition-slow:     280ms cubic-bezier(0.4,0,0.2,1);

    --font-body:           'Inter', 'Cairo', system-ui, sans-serif;
    --font-mono:           'JetBrains Mono', 'Fira Code', monospace;
}

/* ============================================================================
   THEME 3: Soft Minimal — Clean White
   Inspired by: Notion, Linear Light, Clerk
   ============================================================================ */
[data-theme="soft-minimal"] {
    --bg-base:             #f8fafc;
    --bg-gradient:         linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    --surface:             #ffffff;
    --surface-elevated:    #ffffff;
    --surface-soft:        #f8fafc;
    --surface-border:      #e2e8f0;

    --primary:             #6366f1;
    --primary-hover:       #4f46e5;
    --primary-soft:        #eef2ff;
    --primary-rgb:         99, 102, 241;

    --accent:              #8b5cf6;
    --accent-soft:         #f5f3ff;

    --text-main:           #0f172a;
    --text-secondary:      #475569;
    --text-muted:          #94a3b8;
    --text-inverse:        #ffffff;

    --success:             #10b981;
    --success-soft:        #ecfdf5;
    --warning:             #f59e0b;
    --warning-soft:        #fffbeb;
    --danger:              #ef4444;
    --danger-soft:         #fef2f2;
    --info:                #3b82f6;
    --info-soft:           #eff6ff;

    --border:              #e2e8f0;
    --border-strong:       #cbd5e1;

    --sidebar-bg:          #ffffff;
    --sidebar-border:      #f1f5f9;
    --sidebar-active-bg:   #eef2ff;
    --sidebar-active-fg:   #6366f1;
    --sidebar-hover-bg:    #f8fafc;
    --sidebar-text:        #64748b;
    --sidebar-icon:        #94a3b8;

    --navbar-bg:           #ffffff;
    --navbar-border:       #f1f5f9;

    --card-bg:             #ffffff;
    --card-border:         #e2e8f0;
    --card-shadow:         0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    --card-hover-shadow:   0 4px 12px rgba(0,0,0,0.08);

    --input-bg:            #ffffff;
    --input-border:        #e2e8f0;
    --input-focus-border:  #6366f1;
    --input-text:          #0f172a;
    --input-placeholder:   #94a3b8;

    --badge-primary-bg:    #eef2ff;
    --badge-primary-text:  #6366f1;

    --scrollbar-track:     #f1f5f9;
    --scrollbar-thumb:     #cbd5e1;

    --radius-sm:           6px;
    --radius-md:           10px;
    --radius-lg:           16px;
    --radius-xl:           24px;
    --radius-full:         9999px;

    --shadow-sm:           0 1px 2px rgba(0,0,0,0.05);
    --shadow-md:           0 4px 8px rgba(0,0,0,0.06);
    --shadow-lg:           0 8px 24px rgba(0,0,0,0.08);
    --shadow-glow:         0 0 16px rgba(99,102,241,0.15);

    --glass-blur:          blur(8px);
    --glass-border:        #e2e8f0;

    --transition-fast:     100ms ease;
    --transition-base:     180ms ease;
    --transition-slow:     250ms ease;

    --font-body:           'Inter', 'Cairo', system-ui, sans-serif;
    --font-mono:           'JetBrains Mono', monospace;
}

/* ============================================================================
   THEME 4: Cyber Neon — Dark with Neon Accents
   Inspired by: Cyberpunk aesthetic, terminal UIs
   ============================================================================ */
[data-theme="cyber-neon"] {
    --bg-base:             #020408;
    --bg-gradient:         linear-gradient(135deg, #020408 0%, #060d18 50%, #030810 100%);
    --surface:             #060d18;
    --surface-elevated:    #0a1628;
    --surface-soft:        #030810;
    --surface-border:      rgba(0,255,200,0.12);

    --primary:             #00ffc8;
    --primary-hover:       #00e6b4;
    --primary-soft:        rgba(0,255,200,0.10);
    --primary-rgb:         0, 255, 200;

    --accent:              #ff00aa;
    --accent-soft:         rgba(255,0,170,0.10);

    --text-main:           #e0f8f4;
    --text-secondary:      #7ec8be;
    --text-muted:          #4a8880;
    --text-inverse:        #020408;

    --success:             #00ffc8;
    --success-soft:        rgba(0,255,200,0.12);
    --warning:             #ffcc00;
    --warning-soft:        rgba(255,204,0,0.12);
    --danger:              #ff3366;
    --danger-soft:         rgba(255,51,102,0.12);
    --info:                #00aaff;
    --info-soft:           rgba(0,170,255,0.12);

    --border:              rgba(0,255,200,0.12);
    --border-strong:       rgba(0,255,200,0.25);

    --sidebar-bg:          #060d18;
    --sidebar-border:      rgba(0,255,200,0.10);
    --sidebar-active-bg:   rgba(0,255,200,0.12);
    --sidebar-active-fg:   #00ffc8;
    --sidebar-hover-bg:    rgba(0,255,200,0.06);
    --sidebar-text:        #7ec8be;
    --sidebar-icon:        #4a8880;

    --navbar-bg:           rgba(6,13,24,0.95);
    --navbar-border:       rgba(0,255,200,0.10);

    --card-bg:             #060d18;
    --card-border:         rgba(0,255,200,0.12);
    --card-shadow:         0 4px 24px rgba(0,0,0,0.6), 0 0 1px rgba(0,255,200,0.2);
    --card-hover-shadow:   0 8px 32px rgba(0,0,0,0.7), 0 0 8px rgba(0,255,200,0.15);

    --input-bg:            rgba(6,13,24,0.8);
    --input-border:        rgba(0,255,200,0.15);
    --input-focus-border:  #00ffc8;
    --input-text:          #e0f8f4;
    --input-placeholder:   #4a8880;

    --badge-primary-bg:    rgba(0,255,200,0.12);
    --badge-primary-text:  #00ffc8;

    --scrollbar-track:     #030810;
    --scrollbar-thumb:     rgba(0,255,200,0.20);

    --radius-sm:           4px;
    --radius-md:           8px;
    --radius-lg:           12px;
    --radius-xl:           18px;
    --radius-full:         9999px;

    --shadow-sm:           0 2px 8px rgba(0,0,0,0.5);
    --shadow-md:           0 4px 16px rgba(0,0,0,0.6);
    --shadow-lg:           0 8px 32px rgba(0,0,0,0.7);
    --shadow-glow:         0 0 24px rgba(0,255,200,0.25);

    --glass-blur:          blur(20px) saturate(200%);
    --glass-border:        rgba(0,255,200,0.12);

    --transition-fast:     120ms linear;
    --transition-base:     180ms cubic-bezier(0.4,0,0.2,1);
    --transition-slow:     280ms cubic-bezier(0.4,0,0.2,1);

    --font-body:           'Inter', 'Cairo', system-ui, sans-serif;
    --font-mono:           'JetBrains Mono', 'Fira Code', monospace;
}

/* ============================================================================
   THEME 5: Enterprise Classic — Corporate Blue
   Inspired by: Salesforce, SAP, Microsoft, traditional SaaS
   ============================================================================ */
[data-theme="enterprise-classic"] {
    --bg-base:             #f5f7fa;
    --bg-gradient:         linear-gradient(180deg, #f5f7fa 0%, #eef1f6 100%);
    --surface:             #ffffff;
    --surface-elevated:    #ffffff;
    --surface-soft:        #f5f7fa;
    --surface-border:      #dde2ed;

    --primary:             #0052cc;
    --primary-hover:       #0747a6;
    --primary-soft:        #e9f0fc;
    --primary-rgb:         0, 82, 204;

    --accent:              #0065ff;
    --accent-soft:         #deebff;

    --text-main:           #172b4d;
    --text-secondary:      #42526e;
    --text-muted:          #8993a4;
    --text-inverse:        #ffffff;

    --success:             #006644;
    --success-soft:        #e3fcef;
    --warning:             #ff8b00;
    --warning-soft:        #fffae6;
    --danger:              #de350b;
    --danger-soft:         #ffebe6;
    --info:                #0065ff;
    --info-soft:           #deebff;

    --border:              #dde2ed;
    --border-strong:       #b3bac5;

    --sidebar-bg:          #0052cc;
    --sidebar-border:      rgba(255,255,255,0.15);
    --sidebar-active-bg:   rgba(255,255,255,0.20);
    --sidebar-active-fg:   #ffffff;
    --sidebar-hover-bg:    rgba(255,255,255,0.12);
    --sidebar-text:        rgba(255,255,255,0.80);
    --sidebar-icon:        rgba(255,255,255,0.60);

    --navbar-bg:           #ffffff;
    --navbar-border:       #dde2ed;

    --card-bg:             #ffffff;
    --card-border:         #dde2ed;
    --card-shadow:         0 1px 4px rgba(23,43,77,0.08);
    --card-hover-shadow:   0 4px 12px rgba(23,43,77,0.12);

    --input-bg:            #ffffff;
    --input-border:        #dde2ed;
    --input-focus-border:  #0052cc;
    --input-text:          #172b4d;
    --input-placeholder:   #8993a4;

    --badge-primary-bg:    #e9f0fc;
    --badge-primary-text:  #0052cc;

    --scrollbar-track:     #f5f7fa;
    --scrollbar-thumb:     #b3bac5;

    --radius-sm:           4px;
    --radius-md:           6px;
    --radius-lg:           8px;
    --radius-xl:           12px;
    --radius-full:         9999px;

    --shadow-sm:           0 1px 2px rgba(23,43,77,0.06);
    --shadow-md:           0 2px 8px rgba(23,43,77,0.10);
    --shadow-lg:           0 4px 16px rgba(23,43,77,0.12);
    --shadow-glow:         0 0 12px rgba(0,82,204,0.20);

    --glass-blur:          blur(8px);
    --glass-border:        #dde2ed;

    --transition-fast:     100ms ease;
    --transition-base:     160ms ease;
    --transition-slow:     240ms ease;

    --font-body:           'Inter', 'Cairo', system-ui, sans-serif;
    --font-mono:           'Consolas', monospace;
}

/* ============================================================================
   THEME 6: Luxury Gold — Premium Warm
   Inspired by: High-end SaaS, luxury brands
   ============================================================================ */
[data-theme="luxury-gold"] {
    --bg-base:             #faf7f0;
    --bg-gradient:         linear-gradient(135deg, #fef9f0 0%, #fdf4e7 50%, #faf0e4 100%);
    --surface:             #ffffff;
    --surface-elevated:    #ffffff;
    --surface-soft:        #fff8ee;
    --surface-border:      #e8dece;

    --primary:             #b8860b;
    --primary-hover:       #8b6508;
    --primary-soft:        #fdf3dc;
    --primary-rgb:         184, 134, 11;

    --accent:              #d4a017;
    --accent-soft:         #fef9e7;

    --text-main:           #1a1409;
    --text-secondary:      #5c4a1e;
    --text-muted:          #9b8560;
    --text-inverse:        #ffffff;

    --success:             #2d7a3a;
    --success-soft:        #ecf8ee;
    --warning:             #d97706;
    --warning-soft:        #fffbeb;
    --danger:              #c0392b;
    --danger-soft:         #fdf2f0;
    --info:                #1a6fa8;
    --info-soft:           #e8f4fc;

    --border:              #e8dece;
    --border-strong:       #d4c4a8;

    --sidebar-bg:          #fef9f0;
    --sidebar-border:      #e8dece;
    --sidebar-active-bg:   #fdf3dc;
    --sidebar-active-fg:   #8b6508;
    --sidebar-hover-bg:    #fef6e4;
    --sidebar-text:        #7c6430;
    --sidebar-icon:        #9b8560;

    --navbar-bg:           #ffffff;
    --navbar-border:       #e8dece;

    --card-bg:             #ffffff;
    --card-border:         #e8dece;
    --card-shadow:         0 2px 8px rgba(184,134,11,0.06);
    --card-hover-shadow:   0 8px 24px rgba(184,134,11,0.12);

    --input-bg:            #ffffff;
    --input-border:        #e8dece;
    --input-focus-border:  #b8860b;
    --input-text:          #1a1409;
    --input-placeholder:   #9b8560;

    --badge-primary-bg:    #fdf3dc;
    --badge-primary-text:  #8b6508;

    --scrollbar-track:     #faf7f0;
    --scrollbar-thumb:     #d4c4a8;

    --radius-sm:           8px;
    --radius-md:           12px;
    --radius-lg:           18px;
    --radius-xl:           28px;
    --radius-full:         9999px;

    --shadow-sm:           0 1px 4px rgba(184,134,11,0.06);
    --shadow-md:           0 4px 12px rgba(184,134,11,0.08);
    --shadow-lg:           0 8px 24px rgba(184,134,11,0.12);
    --shadow-glow:         0 0 20px rgba(184,134,11,0.20);

    --glass-blur:          blur(12px);
    --glass-border:        #e8dece;

    --transition-fast:     150ms cubic-bezier(0.4,0,0.2,1);
    --transition-base:     220ms cubic-bezier(0.4,0,0.2,1);
    --transition-slow:     320ms cubic-bezier(0.4,0,0.2,1);

    --font-body:           'Inter', 'Cairo', system-ui, sans-serif;
    --font-mono:           'JetBrains Mono', monospace;
}

/* ============================================================================
   LEGACY THEMES — backward compat
   ============================================================================ */
[data-theme="warm-luxury"] {
    --bg-base:             #faf7f0;
    --bg-gradient:         linear-gradient(135deg, #fef9f0 0%, #fdf4e7 50%, #faf0e4 100%);
    --surface:             #ffffff;
    --surface-elevated:    #ffffff;
    --surface-soft:        #fff8ee;
    --surface-border:      #e8dece;
    --primary:             #c58a2b;
    --primary-hover:       #a66a16;
    --primary-soft:        #fff0d8;
    --primary-rgb:         197, 138, 43;
    --accent:              #a66a16;
    --accent-soft:         #fef8ec;
    --text-main:           #1f2937;
    --text-secondary:      #4b5563;
    --text-muted:          #6b7280;
    --text-inverse:        #ffffff;
    --success:             #22c55e;
    --success-soft:        #f0fdf4;
    --warning:             #f59e0b;
    --warning-soft:        #fffbeb;
    --danger:              #ef4444;
    --danger-soft:         #fef2f2;
    --info:                #3b82f6;
    --info-soft:           #eff6ff;
    --border:              #e8ded0;
    --border-strong:       #d4c4a8;
    --sidebar-bg:          #fbf3e7;
    --sidebar-border:      #e8dece;
    --sidebar-active-bg:   #f3d19a;
    --sidebar-active-fg:   #7c5410;
    --sidebar-hover-bg:    #fff0d8;
    --sidebar-text:        #6b7280;
    --sidebar-icon:        #9ca3af;
    --navbar-bg:           #ffffff;
    --navbar-border:       #e8ded0;
    --card-bg:             #ffffff;
    --card-border:         #e8ded0;
    --card-shadow:         0 4px 12px rgba(165,116,39,0.08);
    --card-hover-shadow:   0 12px 24px rgba(165,116,39,0.14);
    --input-bg:            #ffffff;
    --input-border:        #e8ded0;
    --input-focus-border:  #c58a2b;
    --input-text:          #1f2937;
    --input-placeholder:   #9ca3af;
    --badge-primary-bg:    #fff0d8;
    --badge-primary-text:  #92400e;
    --scrollbar-track:     #faf7f0;
    --scrollbar-thumb:     #e8ded0;
    --radius-sm:           8px;
    --radius-md:           12px;
    --radius-lg:           16px;
    --radius-xl:           24px;
    --radius-full:         9999px;
    --shadow-sm:           0 2px 6px rgba(165,116,39,0.06);
    --shadow-md:           0 4px 12px rgba(165,116,39,0.08);
    --shadow-lg:           0 8px 24px rgba(165,116,39,0.12);
    --shadow-glow:         0 0 16px rgba(197,138,43,0.20);
    --glass-blur:          blur(12px);
    --glass-border:        #e8ded0;
    --transition-fast:     150ms ease;
    --transition-base:     200ms ease;
    --transition-slow:     300ms ease;
    --font-body:           'Inter', 'Cairo', system-ui, sans-serif;
    --font-mono:           'JetBrains Mono', monospace;
}

[data-theme="orange-active"] {
    --bg-base:             #F8F9FA;
    --bg-gradient:         linear-gradient(160deg, #F8F9FA 0%, #F3F4F6 100%);
    --surface:             #ffffff;
    --surface-elevated:    #ffffff;
    --surface-soft:        #F3F4F6;
    --surface-border:      #E5E7EB;
    --primary:             #EA580C;
    --primary-hover:       #C2410C;
    --primary-soft:        #FFF7ED;
    --primary-rgb:         234, 88, 12;
    --accent:              #C2410C;
    --accent-soft:         #FFEDD5;
    --text-main:           #111827;
    --text-secondary:      #374151;
    --text-muted:          #6B7280;
    --text-inverse:        #ffffff;
    --success:             #16A34A;
    --success-soft:        #F0FDF4;
    --warning:             #D97706;
    --warning-soft:        #FFFBEB;
    --danger:              #DC2626;
    --danger-soft:         #FEF2F2;
    --info:                #2563EB;
    --info-soft:           #EFF6FF;
    --border:              #E5E7EB;
    --border-strong:       #D1D5DB;
    --sidebar-bg:          #ffffff;
    --sidebar-border:      #EEEFF1;
    --sidebar-active-bg:   #FEE4C8;
    --sidebar-active-fg:   #9A3412;
    --sidebar-hover-bg:    #F5F5F5;
    --sidebar-text:        #52525B;
    --sidebar-icon:        #A1A1AA;
    --navbar-bg:           #ffffff;
    --navbar-border:       #F3F4F6;
    --card-bg:             #ffffff;
    --card-border:         #E5E7EB;
    --card-shadow:         0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    --card-hover-shadow:   0 4px 12px rgba(0,0,0,0.08), 0 2px 6px rgba(0,0,0,0.04);
    --input-bg:            #ffffff;
    --input-border:        #D1D5DB;
    --input-focus-border:  #EA580C;
    --input-text:          #111827;
    --input-placeholder:   #9CA3AF;
    --badge-primary-bg:    #FFEDD5;
    --badge-primary-text:  #C2410C;
    --scrollbar-track:     #F9FAFB;
    --scrollbar-thumb:     #E5E7EB;
    --radius-sm:           6px;
    --radius-md:           10px;
    --radius-lg:           14px;
    --radius-xl:           20px;
    --radius-full:         9999px;
    --shadow-sm:           0 1px 2px rgba(0,0,0,0.05);
    --shadow-md:           0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    --shadow-lg:           0 4px 12px rgba(0,0,0,0.08), 0 2px 6px rgba(0,0,0,0.04);
    --shadow-glow:         0 0 0 3px rgba(234,88,12,0.15);
    --glass-blur:          blur(12px);
    --glass-border:        #E5E7EB;
    --transition-fast:     150ms ease;
    --transition-base:     200ms ease;
    --transition-slow:     300ms ease;
    --font-body:           'Cairo', 'Inter', system-ui, sans-serif;
    --font-mono:           'JetBrains Mono', monospace;
}

[data-theme="green-business"] {
    --bg-base:             #f6fbf7;
    --bg-gradient:         linear-gradient(135deg, #f0fdf4 0%, #ecfdf5 50%, #f0faf4 100%);
    --surface:             #ffffff;
    --surface-elevated:    #ffffff;
    --surface-soft:        #ecfdf3;
    --surface-border:      #cdeedb;
    --primary:             #22a06b;
    --primary-hover:       #166534;
    --primary-soft:        #dff8ea;
    --primary-rgb:         34, 160, 107;
    --accent:              #166534;
    --accent-soft:         #dcfce7;
    --text-main:           #1f2937;
    --text-secondary:      #4b5563;
    --text-muted:          #6b7280;
    --text-inverse:        #ffffff;
    --success:             #22a06b;
    --success-soft:        #ecfdf5;
    --warning:             #f59e0b;
    --warning-soft:        #fffbeb;
    --danger:              #ef4444;
    --danger-soft:         #fef2f2;
    --info:                #3b82f6;
    --info-soft:           #eff6ff;
    --border:              #cdeedb;
    --border-strong:       #bbf7d0;
    --sidebar-bg:          #f0faf4;
    --sidebar-border:      #cdeedb;
    --sidebar-active-bg:   #bbf7d0;
    --sidebar-active-fg:   #14532d;
    --sidebar-hover-bg:    #dff8ea;
    --sidebar-text:        #6b7280;
    --sidebar-icon:        #9ca3af;
    --navbar-bg:           #ffffff;
    --navbar-border:       #cdeedb;
    --card-bg:             #ffffff;
    --card-border:         #cdeedb;
    --card-shadow:         0 4px 12px rgba(34,160,107,0.08);
    --card-hover-shadow:   0 12px 24px rgba(34,160,107,0.14);
    --input-bg:            #ffffff;
    --input-border:        #cdeedb;
    --input-focus-border:  #22a06b;
    --input-text:          #1f2937;
    --input-placeholder:   #9ca3af;
    --badge-primary-bg:    #dff8ea;
    --badge-primary-text:  #166534;
    --scrollbar-track:     #f6fbf7;
    --scrollbar-thumb:     #cdeedb;
    --radius-sm:           8px;
    --radius-md:           12px;
    --radius-lg:           16px;
    --radius-xl:           24px;
    --radius-full:         9999px;
    --shadow-sm:           0 2px 6px rgba(34,160,107,0.06);
    --shadow-md:           0 4px 12px rgba(34,160,107,0.08);
    --shadow-lg:           0 8px 24px rgba(34,160,107,0.12);
    --shadow-glow:         0 0 16px rgba(34,160,107,0.20);
    --glass-blur:          blur(12px);
    --glass-border:        #cdeedb;
    --transition-fast:     150ms ease;
    --transition-base:     200ms ease;
    --transition-slow:     300ms ease;
    --font-body:           'Inter', 'Cairo', system-ui, sans-serif;
    --font-mono:           'JetBrains Mono', monospace;
}

/* ============================================================================
   GLOBAL RESETS & BASE STYLES
   ============================================================================ */
*, *::before, *::after {
    box-sizing: border-box;
}

html {
    font-family: var(--font-body);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

body {
    background: var(--bg-gradient) !important;
    background-attachment: fixed !important;
    color: var(--text-main) !important;
    font-family: var(--font-body);
    line-height: 1.6;
    min-height: 100vh;
}

h1, h2, h3, h4, h5, h6 {
    color: var(--text-main);
    letter-spacing: -0.025em;
    font-weight: 600;
    line-height: 1.3;
}

/* ============================================================================
   TYPOGRAPHY SCALE — SaaS Product Hierarchy
   ============================================================================ */

/* Page title — used once per page */
.ds-page-title {
    font-size: 1.375rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    color: var(--text-main);
    line-height: 1.25;
}

/* Section title — card/widget header */
.ds-section-title {
    font-size: 0.875rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    color: var(--text-main);
}

/* Label — small descriptive text above/below values */
.ds-label {
    font-size: 0.6875rem;
    font-weight: 500;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-muted);
}

/* Metric — the hero number in KPI cards */
.ds-metric {
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -0.04em;
    color: var(--text-main);
    line-height: 1;
}

/* Submetric — secondary number */
.ds-submetric {
    font-size: 1.125rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    color: var(--text-main);
}

/* Caption — the smallest text */
.ds-caption {
    font-size: 0.6875rem;
    font-weight: 400;
    color: var(--text-muted);
}

/* Mono — numbers/codes that need monospace */
.ds-mono {
    font-family: var(--font-mono);
    font-size: 0.8125rem;
    letter-spacing: -0.01em;
}

/* ============================================================================
   SPACING RHYTHM — 4pt grid
   ============================================================================ */
.ds-page-gap { gap: 1.5rem; }
.ds-section-gap { gap: 1.25rem; }
.ds-card-gap { gap: 1rem; }
.ds-tight-gap { gap: 0.5rem; }

.ds-page-p { padding: 2rem; }
.ds-card-p { padding: 1.25rem; }
.ds-card-p-sm { padding: 1rem; }
.ds-card-p-xs { padding: 0.75rem; }

/* ============================================================================
   SURFACE HIERARCHY — elevation system
   ============================================================================ */
/* Level 0: page background */
.ds-surface-0 { background: var(--bg-base); }
/* Level 1: primary cards */
.ds-surface-1 {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    box-shadow: var(--card-shadow);
}
/* Level 2: elevated panels / modals */
.ds-surface-2 {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    box-shadow: var(--card-hover-shadow);
}
/* Level 3: tooltips / command palette */
.ds-surface-3 {
    background: var(--card-bg);
    border: 1px solid var(--border-strong);
    box-shadow: 0 20px 60px rgba(0,0,0,0.12), 0 8px 24px rgba(0,0,0,0.08);
}

/* ============================================================================
   MOTION — micro-interaction system
   ============================================================================ */
.ds-interactive {
    transition:
        transform     var(--transition-fast),
        box-shadow    var(--transition-fast),
        background    var(--transition-fast),
        border-color  var(--transition-fast);
}
.ds-interactive:hover { transform: translateY(-1px); }

/* ============================================================================
   SCROLLBAR
   ============================================================================ */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--scrollbar-track); }
::-webkit-scrollbar-thumb {
    background: var(--scrollbar-thumb);
    border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover { opacity: 0.8; }

/* ============================================================================
   SIDEBAR — legacy reset (new styles in ds-sidebar v3 section below)
   ============================================================================ */
aside,
#sidebar {
    background: var(--sidebar-bg) !important;
}

/* ============================================================================
   NAVBAR
   ============================================================================ */
header,
nav[class*="navbar"],
.navbar,
[class*="top-nav"],
body > div.flex > div.flex-1 > header {
    background: var(--navbar-bg) !important;
    border-color: var(--navbar-border) !important;
    border-bottom: 1px solid var(--navbar-border) !important;
}

/* ============================================================================
   CARDS
   ============================================================================ */
.card,
[class*="bg-white"]:not(body):not(aside):not(nav):not(header),
.rounded-xl.bg-white,
.rounded-2xl.bg-white,
.rounded-lg.bg-white {
    background: var(--card-bg) !important;
    border-color: var(--card-border) !important;
    color: var(--text-main) !important;
}

/* Card shadow system */
.shadow-sm  { box-shadow: var(--shadow-sm) !important; }
.shadow     { box-shadow: var(--shadow-md) !important; }
.shadow-md  { box-shadow: var(--shadow-md) !important; }
.shadow-lg  { box-shadow: var(--shadow-lg) !important; }

/* ============================================================================
   BUTTONS — Primary
   ============================================================================ */
.btn-primary,
button[class*="bg-blue-6"],
button[class*="bg-blue-7"],
button[class*="bg-primary-6"],
button[class*="bg-primary-7"],
button[class*="bg-indigo-6"],
button[class*="bg-indigo-7"],
a.btn[class*="bg-blue-6"],
a.btn[class*="bg-primary-6"] {
    background-color: var(--primary) !important;
    color: var(--text-inverse) !important;
    border-radius: var(--radius-md) !important;
    transition: all var(--transition-base) !important;
    font-weight: 600 !important;
}

button[class*="bg-blue-6"]:hover,
button[class*="bg-primary-6"]:hover,
button[class*="bg-indigo-6"]:hover,
.btn-primary:hover {
    background-color: var(--primary-hover) !important;
    box-shadow: var(--shadow-glow) !important;
    transform: translateY(-1px) !important;
}

/* Gradient buttons */
.bg-gradient-to-r.from-blue-600,
.bg-gradient-to-r.from-primary-600,
.bg-gradient-to-r.from-indigo-600,
.bg-gradient-to-br.from-blue-600,
.bg-gradient-to-r[class*="primary"] {
    background-image: linear-gradient(135deg, var(--primary), var(--primary-hover)) !important;
    color: var(--text-inverse) !important;
    border-radius: var(--radius-md) !important;
}

/* Fix inline hardcoded primary colors */
.bg-primary-600, .from-primary-600 {
    background-color: var(--primary) !important;
}
.bg-primary-700, .to-primary-700 {
    background-color: var(--primary-hover) !important;
}
.text-primary-600 { color: var(--primary) !important; }
.text-primary-700 { color: var(--primary-hover) !important; }
.hover\:text-primary-700:hover { color: var(--primary-hover) !important; }
.hover\:bg-primary-700:hover { background-color: var(--primary-hover) !important; }
.border-primary-600 { border-color: var(--primary) !important; }
.ring-primary-600 { --tw-ring-color: var(--primary) !important; }

/* ============================================================================
   FORMS
   ============================================================================ */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
input[type="time"],
input[type="tel"],
input[type="url"],
input[type="search"],
select,
textarea {
    background-color: var(--input-bg) !important;
    border-color: var(--input-border) !important;
    color: var(--input-text) !important;
    border-radius: var(--radius-md) !important;
    transition: all var(--transition-fast) !important;
}

input::placeholder,
textarea::placeholder,
select::placeholder {
    color: var(--input-placeholder) !important;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--input-focus-border) !important;
    box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.15) !important;
    outline: none !important;
}

/* ============================================================================
   SELECT2 — themed
   ============================================================================ */
.select2-container--default .select2-selection--single {
    border: 1px solid var(--input-border) !important;
    border-radius: var(--radius-md) !important;
    height: 3rem !important;
    padding: 0.5rem 1rem !important;
    background-color: var(--input-bg) !important;
    transition: all var(--transition-fast) !important;
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: 2rem !important;
    padding-right: 0 !important;
    color: var(--input-text) !important;
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 3rem !important;
    left: 1rem !important;
    right: auto !important;
}

.select2-container { width: 100% !important; }

.select2-dropdown {
    border-radius: var(--radius-md) !important;
    border-color: var(--input-border) !important;
    background-color: var(--surface) !important;
    box-shadow: var(--shadow-lg) !important;
    overflow: hidden;
}

.select2-results__option {
    color: var(--text-main) !important;
    background: transparent !important;
    transition: all var(--transition-fast) !important;
}

.select2-results__option--highlighted {
    background-color: var(--primary-soft) !important;
    color: var(--primary) !important;
}

.select2-search--dropdown .select2-search__field {
    border: 1px solid var(--input-border) !important;
    border-radius: var(--radius-sm) !important;
    padding: 0.5rem !important;
    background-color: var(--input-bg) !important;
    color: var(--input-text) !important;
}

/* ============================================================================
   KPI CARDS — Three SaaS variants
   ============================================================================ */

/* ── Base ─────────────────────────────────────────────────────────────────── */
.kpi-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-lg);
    padding: 1.25rem 1.375rem;
    box-shadow: var(--card-shadow);
    position: relative;
    overflow: hidden;
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}
.kpi-card:hover {
    transform: translateY(-1px);
    box-shadow: var(--card-hover-shadow);
}

/* Icon badge */
.kpi-icon {
    width: 36px; height: 36px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* The hero number */
.kpi-value {
    font-size: 1.875rem;
    font-weight: 800;
    letter-spacing: -0.04em;
    color: var(--text-main);
    line-height: 1;
}

/* Field label */
.kpi-label {
    font-size: 0.6875rem;
    font-weight: 500;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--text-muted);
}

/* Trend chip */
.kpi-trend {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 0.6875rem;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 100px;
}
.kpi-trend-up   { background: var(--success-soft); color: var(--success); }
.kpi-trend-down { background: var(--danger-soft);  color: var(--danger); }
.kpi-trend-flat { background: var(--surface-soft); color: var(--text-muted); }

/* Footer divider */
.kpi-footer {
    margin-top: 0.875rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* ── Variant A: Linear-style ──────────────────────────────────────────────
   Icon top-right, label above number, ultra-compact, muted surface
   Best for: dense dashboards, many metrics, analytics-heavy layouts      */
.kpi-card.kpi-linear {
    padding: 1rem 1.25rem;
}
.kpi-card.kpi-linear .kpi-inner {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
}
.kpi-card.kpi-linear .kpi-icon {
    width: 32px; height: 32px;
    border-radius: var(--radius-sm);
    margin-top: 2px;
}
.kpi-card.kpi-linear .kpi-value {
    font-size: 1.625rem;
}

/* ── Variant B: Stripe-style ──────────────────────────────────────────────
   Borderless top accent, number dominates, clean white surface
   Best for: financial metrics, revenue, payments contexts               */
.kpi-card.kpi-stripe {
    border-top: 3px solid var(--primary);
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    padding: 1.125rem 1.375rem;
}
.kpi-card.kpi-stripe .kpi-value {
    font-size: 2.25rem;
    color: var(--text-main);
}
.kpi-card.kpi-stripe .kpi-label {
    font-size: 0.75rem;
    letter-spacing: 0.04em;
}

/* ── Variant C: Vercel-style ──────────────────────────────────────────────
   Full-bleed subtle bg, icon inline with label, number center stage
   Best for: deployment/status metrics, clean overview pages            */
.kpi-card.kpi-vercel {
    background: var(--surface-soft);
    border-color: transparent;
    box-shadow: none;
}
.kpi-card.kpi-vercel:hover {
    background: var(--card-bg);
    border-color: var(--border);
    box-shadow: var(--card-shadow);
}

/* ============================================================================
   BADGES
   ============================================================================ */
.badge-primary {
    background: var(--badge-primary-bg) !important;
    color: var(--badge-primary-text) !important;
    border-radius: var(--radius-full) !important;
    font-weight: 600 !important;
    font-size: 0.75rem !important;
    padding: 0.2em 0.75em !important;
}

/* Status badges */
.badge-success {
    background: var(--success-soft) !important;
    color: var(--success) !important;
    border-radius: var(--radius-full) !important;
    font-weight: 600 !important;
    font-size: 0.75rem !important;
    padding: 0.2em 0.75em !important;
}

.badge-warning {
    background: var(--warning-soft) !important;
    color: var(--warning) !important;
    border-radius: var(--radius-full) !important;
    font-weight: 600 !important;
    font-size: 0.75rem !important;
    padding: 0.2em 0.75em !important;
}

.badge-danger {
    background: var(--danger-soft) !important;
    color: var(--danger) !important;
    border-radius: var(--radius-full) !important;
    font-weight: 600 !important;
    font-size: 0.75rem !important;
    padding: 0.2em 0.75em !important;
}

/* ============================================================================
   ALERTS — Session Messages
   ============================================================================ */
.alert-success {
    background: var(--success-soft) !important;
    border-color: var(--success) !important;
    color: var(--success) !important;
}

.alert-error,
.alert-danger {
    background: var(--danger-soft) !important;
    border-color: var(--danger) !important;
    color: var(--danger) !important;
}

.alert-warning {
    background: var(--warning-soft) !important;
    border-color: var(--warning) !important;
    color: var(--warning) !important;
}

/* ============================================================================
   HERO BANNER
   ============================================================================ */
.hero-banner {
    background: linear-gradient(135deg, var(--primary-soft), var(--surface-soft)) !important;
    border: 1px solid var(--border) !important;
    border-radius: var(--radius-lg) !important;
    padding: 2rem;
    margin-bottom: 1.5rem;
    position: relative;
    overflow: hidden;
}

.hero-banner::after {
    content: '';
    position: absolute;
    top: -50%; right: -10%;
    width: 300px; height: 300px;
    background: radial-gradient(circle, rgba(var(--primary-rgb), 0.08) 0%, transparent 70%);
    pointer-events: none;
}

/* ============================================================================
   THEME SWITCHER
   ============================================================================ */
.theme-card-option {
    cursor: pointer;
    border: 2px solid var(--border) !important;
    border-radius: var(--radius-lg) !important;
    padding: 1rem;
    background: var(--card-bg) !important;
    transition: all var(--transition-base) !important;
    position: relative;
}

.theme-card-option:hover {
    border-color: var(--primary) !important;
    transform: translateY(-2px);
    box-shadow: var(--card-hover-shadow) !important;
}

.theme-card-option.active {
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.18) !important;
}

.theme-card-option.active::after {
    content: '✓';
    position: absolute;
    top: 8px; left: 8px;
    background: var(--primary);
    color: var(--text-inverse);
    width: 28px; height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 16px;
}

.theme-preview {
    height: 80px;
    border-radius: var(--radius-md);
    margin-bottom: 12px;
    display: grid;
    grid-template-columns: 30% 1fr;
    gap: 4px;
    padding: 6px;
}

.theme-preview .tp-sidebar { border-radius: 6px; }
.theme-preview .tp-content {
    border-radius: 6px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 6px;
}
.theme-preview .tp-bar { height: 6px; border-radius: 3px; }

/* ============================================================================
   LINKS
   ============================================================================ */
a:not([class*="bg-"]):not([class*="text-white"]):not(.btn):not([class*="sidebar"]):hover {
    color: var(--primary);
}

/* ============================================================================
   DARK TEXT FIXES — ensure visibility
   ============================================================================ */
.text-gray-900, .text-gray-800 { color: var(--text-main) !important; }
.text-gray-700, .text-gray-600 { color: var(--text-secondary) !important; }
.text-gray-500, .text-gray-400 { color: var(--text-muted) !important; }

/* ============================================================================
   TABLES — SaaS Data Grid
   ============================================================================ */
table {
    width: 100%;
    border-collapse: collapse;
}
thead th {
    background: var(--surface-soft) !important;
    color: var(--text-muted) !important;
    font-weight: 600;
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 0.625rem 1rem !important;
    border-bottom: 1px solid var(--border) !important;
    white-space: nowrap;
}
tbody tr {
    border-bottom: 1px solid var(--border) !important;
    transition: background var(--transition-fast);
}
tbody tr:hover {
    background: var(--surface-soft) !important;
}
tbody td {
    color: var(--text-main) !important;
    padding: 0.75rem 1rem !important;
    font-size: 0.875rem;
    vertical-align: middle;
}
/* Row action reveal on hover */
tbody tr .row-actions {
    opacity: 0;
    transition: opacity var(--transition-fast);
}
tbody tr:hover .row-actions {
    opacity: 1;
}
/* Table wrapper card */
.ds-table-wrapper {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--card-shadow);
    overflow: hidden;
}
.ds-table-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}
.ds-table-footer {
    padding: 0.75rem 1.25rem;
    border-top: 1px solid var(--border);
    background: var(--surface-soft);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}
/* Sticky table header */
.ds-table-sticky thead {
    position: sticky;
    top: 0;
    z-index: 2;
}
/* Empty state */
.ds-table-empty {
    padding: 3rem 1.5rem;
    text-align: center;
    color: var(--text-muted);
}
.ds-table-empty svg {
    margin: 0 auto 0.75rem;
    opacity: 0.3;
}
/* Loading skeleton */
@keyframes ds-shimmer {
    0%   { background-position: -400px 0; }
    100% { background-position: 400px 0; }
}
.ds-skeleton {
    background: linear-gradient(90deg,
        var(--surface-soft) 25%,
        var(--border) 37%,
        var(--surface-soft) 63%
    );
    background-size: 400px 100%;
    animation: ds-shimmer 1.4s ease infinite;
    border-radius: var(--radius-sm);
    height: 0.75rem;
}

/* ============================================================================
   SEARCH — SaaS Search UX
   ============================================================================ */
.ds-search {
    position: relative;
    display: flex;
    align-items: center;
}
.ds-search-icon {
    position: absolute;
    right: 0.75rem;
    pointer-events: none;
    color: var(--text-muted);
    width: 15px; height: 15px;
}
[dir="ltr"] .ds-search-icon {
    right: auto; left: 0.75rem;
}
.ds-search input {
    width: 100%;
    padding: 0.5rem 0.75rem 0.5rem 2.25rem !important;
    font-size: 0.8125rem !important;
    background: var(--surface-soft) !important;
    border: 1px solid transparent !important;
    border-radius: var(--radius-full) !important;
    color: var(--text-main) !important;
    transition: all var(--transition-fast) !important;
}
[dir="rtl"] .ds-search input {
    padding: 0.5rem 2.25rem 0.5rem 0.75rem !important;
}
.ds-search input::placeholder { color: var(--text-muted) !important; }
.ds-search input:focus {
    background: var(--card-bg) !important;
    border-color: var(--input-focus-border) !important;
    box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.12) !important;
    outline: none !important;
}
/* Keyboard hint */
.ds-search-kbd {
    position: absolute;
    left: 0.5rem;
    display: flex;
    align-items: center;
    gap: 2px;
    pointer-events: none;
    opacity: 0;
    transition: opacity var(--transition-fast);
}
.ds-search:focus-within .ds-search-kbd { opacity: 0; }
.ds-search-kbd kbd {
    font-size: 0.625rem;
    font-family: var(--font-mono);
    background: var(--border);
    color: var(--text-muted);
    padding: 1px 4px;
    border-radius: 3px;
    border: 1px solid var(--border-strong);
}

/* ============================================================================
   NAVBAR — Product-Grade Top Bar
   ============================================================================ */
.ds-navbar {
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    background: var(--navbar-bg);
    border-bottom: 1px solid var(--navbar-border);
    position: sticky;
    top: 0;
    z-index: 30;
}
.ds-navbar-start {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
}
.ds-navbar-end {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}
.ds-nav-btn {
    width: 34px; height: 34px;
    border-radius: var(--radius-md);
    display: flex; align-items: center; justify-content: center;
    color: var(--text-muted);
    background: transparent;
    border: none;
    cursor: pointer;
    transition: background var(--transition-fast), color var(--transition-fast);
    position: relative;
}
.ds-nav-btn:hover {
    background: var(--surface-soft);
    color: var(--text-main);
}
.ds-nav-btn-badge {
    position: absolute;
    top: 4px; left: 4px;
    min-width: 15px; height: 15px;
    border-radius: 100px;
    font-size: 9px;
    font-weight: 700;
    color: #fff;
    display: flex; align-items: center; justify-content: center;
    padding: 0 3px;
    line-height: 1;
    border: 1.5px solid var(--navbar-bg);
}
/* Page title in navbar */
.ds-navbar-title {
    font-size: 0.9375rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
/* Breadcrumb */
.ds-breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.8125rem;
    color: var(--text-muted);
}
.ds-breadcrumb-sep {
    width: 14px; height: 14px;
    opacity: 0.4;
}
.ds-breadcrumb a:hover { color: var(--text-main); }
.ds-breadcrumb .current { color: var(--text-main); font-weight: 500; }

/* ============================================================================
   SIDEBAR v3.0 — Modern SaaS Workspace Navigation
   Inspired by: Linear, Notion, Raycast, GitHub, Vercel
   ============================================================================ */

/* ── CSS variables ──────────────────────────────────────────────────────── */
:root {
    --sidebar-w:      256px;
    --sidebar-mini-w:  64px;
}

/* ── Core shell ─────────────────────────────────────────────────────────── */
.ds-sidebar {
    background: var(--sidebar-bg);
    border-left: 1px solid var(--sidebar-border);
    width: var(--sidebar-w);
    display: flex;
    flex-direction: column;
    transition:
        transform 0.22s cubic-bezier(0.4, 0, 0.2, 1),
        width    0.22s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform, width;
}
[dir="ltr"] .ds-sidebar {
    border-left: none;
    border-right: 1px solid var(--sidebar-border);
}

/* ── Mini (icon-only) mode ──────────────────────────────────────────────── */
.ds-sidebar-mini { width: var(--sidebar-mini-w) !important; }

.ds-sidebar-mini .ds-nav-item-text,
.ds-sidebar-mini .ds-nav-badge,
.ds-sidebar-mini .ds-sidebar-logo-info,
.ds-sidebar-mini .ds-sidebar-user-info,
.ds-sidebar-mini .ds-sidebar-user-chevron {
    opacity: 0;
    max-width: 0;
    overflow: hidden;
    pointer-events: none;
    transition: opacity 0.15s, max-width 0.22s;
}
.ds-sidebar-mini .ds-nav-group-label { opacity: 0; height: 0; overflow: hidden; padding: 0; margin: 0; }
.ds-sidebar-mini .ds-nav-item { justify-content: center; padding: 0.5625rem; }
.ds-sidebar-mini .ds-nav-item.active::after { display: none; }
.ds-sidebar-mini .ds-sidebar-logo { justify-content: center; padding: 0 1rem; }
.ds-sidebar-mini .ds-sidebar-user-inner { justify-content: center; padding: 0.5625rem; }
.ds-sidebar-mini .ds-nav-section + .ds-nav-section { padding-top: 0.5rem; margin-top: 0.25rem; }

/* Tooltip in mini mode */
.ds-sidebar-mini .ds-nav-item { position: relative; }
.ds-sidebar-mini .ds-nav-item:hover::before {
    content: attr(data-label);
    position: absolute;
    right: calc(100% + 10px);
    top: 50%;
    transform: translateY(-50%);
    background: var(--card-bg);
    color: var(--text-main);
    font-size: 0.75rem;
    font-weight: 500;
    padding: 5px 12px;
    border-radius: var(--radius-md);
    white-space: nowrap;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--card-border);
    pointer-events: none;
    z-index: 200;
    letter-spacing: 0;
}
[dir="ltr"] .ds-sidebar-mini .ds-nav-item:hover::before {
    right: auto;
    left: calc(100% + 10px);
}

/* ── Logo bar ───────────────────────────────────────────────────────────── */
.ds-sidebar-logo {
    height: 56px;
    padding: 0 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border-bottom: 1px solid var(--sidebar-border);
    flex-shrink: 0;
    overflow: hidden;
}
.ds-sidebar-logo-mark {
    width: 30px; height: 30px;
    border-radius: var(--radius-md);
    display: flex; align-items: center; justify-content: center;
    background: var(--primary);
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(var(--primary-rgb), 0.30);
    transition: box-shadow var(--transition-fast);
}
.ds-sidebar-logo-mark:hover { box-shadow: 0 4px 12px rgba(var(--primary-rgb), 0.45); }
.ds-sidebar-logo-info {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    transition: opacity 0.22s, max-width 0.22s;
    max-width: 180px;
}
.ds-sidebar-logo-text {
    font-size: 0.9375rem;
    font-weight: 700;
    letter-spacing: -0.025em;
    color: var(--text-main);
    white-space: nowrap;
    line-height: 1.2;
}
.ds-sidebar-logo-sub {
    font-size: 0.625rem;
    font-weight: 500;
    color: var(--text-muted);
    letter-spacing: 0.02em;
    white-space: nowrap;
}

/* ── Nav scroll area ────────────────────────────────────────────────────── */
.ds-sidebar-nav {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0.375rem 0.5rem 1rem;
    scrollbar-width: thin;
    scrollbar-color: var(--scrollbar-thumb) transparent;
}
.ds-sidebar-nav::-webkit-scrollbar { width: 3px; }
.ds-sidebar-nav::-webkit-scrollbar-track { background: transparent; }
.ds-sidebar-nav::-webkit-scrollbar-thumb {
    background: var(--scrollbar-thumb);
    border-radius: 99px;
}

/* ── Section block ──────────────────────────────────────────────────────── */
.ds-nav-section { margin-bottom: 0.125rem; }
.ds-nav-section + .ds-nav-section {
    margin-top: 0.375rem;
    padding-top: 0.375rem;
    border-top: 1px solid var(--sidebar-border);
}

/* ── Group label ────────────────────────────────────────────────────────── */
.ds-nav-group-label {
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    color: var(--text-muted);
    opacity: 0.55;
    padding: 0.5rem 0.75rem 0.1875rem;
    white-space: nowrap;
    overflow: hidden;
    user-select: none;
    transition: opacity 0.18s, height 0.22s, padding 0.22s;
}

/* ── Nav item ───────────────────────────────────────────────────────────── */
.ds-nav-item {
    display: flex;
    align-items: center;
    gap: 0.6875rem;
    padding: 0.5625rem 0.75rem;
    border-radius: var(--radius-md);
    font-size: 0.8125rem;
    font-weight: 450;
    color: var(--sidebar-text);
    text-decoration: none;
    transition:
        background var(--transition-fast),
        color     var(--transition-fast);
    position: relative;
    cursor: pointer;
    overflow: hidden;
    margin-bottom: 1px;
    min-height: 36px;
}
.ds-nav-item:hover {
    background: var(--sidebar-hover-bg);
    color: var(--text-secondary);
    text-decoration: none;
}
.ds-nav-item:hover .ds-nav-icon {
    color: var(--text-secondary);
    opacity: 1;
}

/* Active state */
.ds-nav-item.active {
    background: var(--sidebar-active-bg);
    color: var(--sidebar-active-fg);
    font-weight: 600;
}
.ds-nav-item.active .ds-nav-icon {
    color: var(--sidebar-active-fg);
    opacity: 1;
}
/* Accent edge — right for RTL */
.ds-nav-item.active::after {
    content: '';
    position: absolute;
    right: 0;
    top: 18%;
    height: 64%;
    width: 3px;
    background: var(--primary);
    border-radius: 3px 0 0 3px;
}
[dir="ltr"] .ds-nav-item.active::after {
    right: auto;
    left: 0;
    border-radius: 0 3px 3px 0;
}

/* Danger variant */
.ds-nav-item.ds-nav-danger { color: var(--danger); }
.ds-nav-item.ds-nav-danger .ds-nav-icon { color: var(--danger); }
.ds-nav-item.ds-nav-danger:hover { background: var(--danger-soft); color: var(--danger); }
.ds-nav-item.ds-nav-danger.active { background: var(--danger-soft); color: var(--danger); }
.ds-nav-item.ds-nav-danger.active::after { background: var(--danger); }

/* ── Item text (for mini-mode hide) ────────────────────────────────────── */
.ds-nav-item-text {
    flex: 1;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    max-width: 160px;
    transition: opacity 0.15s, max-width 0.22s;
}

/* ── Icon ───────────────────────────────────────────────────────────────── */
.ds-nav-icon {
    width: 18px; height: 18px;
    flex-shrink: 0;
    color: var(--sidebar-icon);
    transition: color var(--transition-fast), opacity var(--transition-fast);
    opacity: 0.65;
}

/* ── Badge ──────────────────────────────────────────────────────────────── */
.ds-nav-badge {
    font-size: 0.5625rem;
    font-weight: 700;
    min-width: 17px; height: 17px;
    border-radius: 100px;
    display: flex; align-items: center; justify-content: center;
    padding: 0 4px;
    line-height: 1;
    flex-shrink: 0;
    max-width: 40px;
    transition: opacity 0.15s, max-width 0.22s;
}

/* ── User section ───────────────────────────────────────────────────────── */
.ds-sidebar-user {
    padding: 0.5rem 0.5rem 0.625rem;
    border-top: 1px solid var(--sidebar-border);
    flex-shrink: 0;
}
.ds-sidebar-user-inner {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.5625rem 0.75rem;
    border-radius: var(--radius-md);
    cursor: pointer;
    overflow: hidden;
    transition: background var(--transition-fast);
    min-height: 44px;
}
.ds-sidebar-user-inner:hover { background: var(--sidebar-hover-bg); }
.ds-sidebar-avatar {
    width: 30px; height: 30px;
    border-radius: var(--radius-sm);
    background: var(--primary);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    letter-spacing: -0.01em;
    box-shadow: 0 1px 4px rgba(var(--primary-rgb), 0.30);
}
.ds-sidebar-user-info {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    max-width: 160px;
    transition: opacity 0.15s, max-width 0.22s;
}
.ds-sidebar-user-name {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}
.ds-sidebar-user-role {
    font-size: 0.625rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.4;
}
.ds-sidebar-user-chevron {
    flex-shrink: 0;
    color: var(--text-muted);
    opacity: 0.5;
    transition: opacity 0.15s, max-width 0.22s;
    max-width: 20px;
}
.ds-sidebar-user-inner:hover .ds-sidebar-user-chevron { opacity: 0.8; }

/* ============================================================================
   GLASS MORPHISM UTILITIES
   ============================================================================ */
.glass {
    background: var(--surface) !important;
    backdrop-filter: var(--glass-blur) !important;
    -webkit-backdrop-filter: var(--glass-blur) !important;
    border: 1px solid var(--glass-border) !important;
}

/* ============================================================================
   CYBER NEON SPECIAL EFFECTS
   ============================================================================ */
[data-theme="cyber-neon"] .kpi-card,
[data-theme="cyber-neon"] .card,
[data-theme="cyber-neon"] [class*="rounded-"][class*="bg-"] {
    border-color: rgba(0,255,200,0.12) !important;
}

[data-theme="cyber-neon"] .kpi-card:hover {
    box-shadow: 0 8px 32px rgba(0,0,0,0.7), 0 0 16px rgba(0,255,200,0.12) !important;
}

[data-theme="cyber-neon"] input:focus,
[data-theme="cyber-neon"] select:focus,
[data-theme="cyber-neon"] textarea:focus {
    box-shadow: 0 0 0 2px rgba(0,255,200,0.25), 0 0 12px rgba(0,255,200,0.10) !important;
}

[data-theme="cyber-neon"] button[class*="bg-blue-6"]:hover,
[data-theme="cyber-neon"] button[class*="bg-primary-6"]:hover {
    box-shadow: 0 0 20px rgba(0,255,200,0.30) !important;
}

/* ============================================================================
   NEO GLASS SPECIAL EFFECTS
   ============================================================================ */
[data-theme="neo-glass"] aside,
[data-theme="neo-glass"] #sidebar,
[data-theme="neo-glass"] .sidebar {
    backdrop-filter: var(--glass-blur) !important;
    -webkit-backdrop-filter: var(--glass-blur) !important;
}

[data-theme="neo-glass"] .kpi-card,
[data-theme="neo-glass"] .card,
[data-theme="neo-glass"] [class*="rounded-"][class*="bg-white"] {
    backdrop-filter: blur(12px) !important;
    -webkit-backdrop-filter: blur(12px) !important;
    background: rgba(255,255,255,0.06) !important;
    border-color: rgba(255,255,255,0.10) !important;
    color: var(--text-main) !important;
}

[data-theme="neo-glass"] h1,
[data-theme="neo-glass"] h2,
[data-theme="neo-glass"] h3,
[data-theme="neo-glass"] h4,
[data-theme="neo-glass"] p,
[data-theme="neo-glass"] span:not([class*="bg-"]),
[data-theme="neo-glass"] td,
[data-theme="neo-glass"] th {
    color: var(--text-main) !important;
}

/* ============================================================================
   ENTERPRISE CLASSIC — Colored Sidebar
   ============================================================================ */
[data-theme="enterprise-classic"] aside,
[data-theme="enterprise-classic"] #sidebar,
[data-theme="enterprise-classic"] .sidebar {
    background: var(--sidebar-bg) !important;
}

[data-theme="enterprise-classic"] aside nav a,
[data-theme="enterprise-classic"] #sidebar nav a {
    color: var(--sidebar-text) !important;
}

[data-theme="enterprise-classic"] aside nav a svg,
[data-theme="enterprise-classic"] #sidebar nav a svg {
    color: var(--sidebar-icon) !important;
    stroke: var(--sidebar-icon) !important;
}

[data-theme="enterprise-classic"] aside nav a:hover,
[data-theme="enterprise-classic"] #sidebar nav a:hover {
    background: var(--sidebar-hover-bg) !important;
    color: #ffffff !important;
}

[data-theme="enterprise-classic"] aside nav a.bg-blue-50,
[data-theme="enterprise-classic"] aside nav a.bg-primary-50,
[data-theme="enterprise-classic"] aside nav a.bg-blue-100 {
    background: var(--sidebar-active-bg) !important;
    color: var(--sidebar-active-fg) !important;
}

/* ============================================================================
   MIDNIGHT PRO — Tweaks
   ============================================================================ */
[data-theme="midnight-pro"] [class*="bg-white"] {
    background: var(--card-bg) !important;
    color: var(--text-main) !important;
}

[data-theme="midnight-pro"] .text-gray-900,
[data-theme="midnight-pro"] .text-gray-800 { color: var(--text-main) !important; }
[data-theme="midnight-pro"] .text-gray-600,
[data-theme="midnight-pro"] .text-gray-700 { color: var(--text-secondary) !important; }
[data-theme="midnight-pro"] .text-gray-400,
[data-theme="midnight-pro"] .text-gray-500 { color: var(--text-muted) !important; }

[data-theme="midnight-pro"] thead th {
    background: var(--surface-elevated) !important;
}

[data-theme="midnight-pro"] body {
    background: var(--bg-base) !important;
}

/* ============================================================================
   FOCUS / ACCESSIBILITY
   ============================================================================ */
:focus-visible {
    outline: 2px solid var(--primary) !important;
    outline-offset: 2px !important;
}

/* Remove default focus outline for mouse users */
:focus:not(:focus-visible) {
    outline: none !important;
}

/* ============================================================================
   RTL FIXES
   ============================================================================ */
[dir="rtl"] .kpi-card::before {
    right: 0; left: auto;
}

[dir="rtl"] aside,
[dir="rtl"] #sidebar {
    border-right: none !important;
    border-left: 1px solid var(--sidebar-border) !important;
}

/* ============================================================================
   LOADING SKELETONS
   ============================================================================ */
.skeleton {
    background: linear-gradient(
        90deg,
        var(--surface-soft) 25%,
        var(--border) 50%,
        var(--surface-soft) 75%
    );
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: var(--radius-sm);
}

@keyframes skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ============================================================================
   TAILWIND DARK MODE BRIDGE
   The Tailwind .dark class can coexist with our theme system.
   These ensure bg-white, text-gray-X etc work inside dark themes.
   ============================================================================ */
[data-theme="neo-glass"] .dark\:bg-gray-800,
[data-theme="midnight-pro"] .dark\:bg-gray-800,
[data-theme="cyber-neon"] .dark\:bg-gray-800 {
    background-color: var(--surface-elevated) !important;
}

[data-theme="neo-glass"] .dark\:bg-gray-900,
[data-theme="midnight-pro"] .dark\:bg-gray-900,
[data-theme="cyber-neon"] .dark\:bg-gray-900 {
    background-color: var(--bg-base) !important;
}

/* ============================================================================
   BUTTON CONTRAST SAFETY — override inline hardcoded
   ============================================================================ */
button, .btn, a[class*="bg-"] { font-weight: 600; }

.bg-blue-600, .bg-green-600, .bg-red-600,
.bg-yellow-600, .bg-purple-600, .bg-indigo-600 {
    color: #ffffff !important;
}

.bg-blue-600 svg, .bg-green-600 svg, .bg-red-600 svg,
.bg-yellow-600 svg, .bg-purple-600 svg, .bg-indigo-600 svg {
    color: currentColor !important;
}
