/* ========================================
   GreenAdmin Theme System
   Supports: Light, Dark, Mix modes
   + Multiple Tailwind-inspired color palettes
   ======================================== */

/* ========================================
   Color Palettes (Tailwind-inspired)
   Each palette defines primary colors
   ======================================== */

/* Green (Default) */
[data-color="green"], :root {
  --ga-primary: #22c55e;
  --ga-primary-dark: #16a34a;
  --ga-primary-rgb: 34, 197, 94;
  --ga-primary-50: #f0fdf4;
  --ga-primary-100: #dcfce7;
  --ga-primary-200: #bbf7d0;
  --ga-primary-400: #4ade80;
  --ga-primary-600: #16a34a;
  --ga-primary-700: #15803d;
  --ga-primary-gradient: linear-gradient(135deg, #22c55e, #16a34a);
}

/* Blue */
[data-color="blue"] {
  --ga-primary: #3b82f6;
  --ga-primary-dark: #2563eb;
  --ga-primary-rgb: 59, 130, 246;
  --ga-primary-50: #eff6ff;
  --ga-primary-100: #dbeafe;
  --ga-primary-200: #bfdbfe;
  --ga-primary-400: #60a5fa;
  --ga-primary-600: #2563eb;
  --ga-primary-700: #1d4ed8;
  --ga-primary-gradient: linear-gradient(135deg, #3b82f6, #2563eb);
}

/* Purple / Violet */
[data-color="purple"] {
  --ga-primary: #8b5cf6;
  --ga-primary-dark: #7c3aed;
  --ga-primary-rgb: 139, 92, 246;
  --ga-primary-50: #f5f3ff;
  --ga-primary-100: #ede9fe;
  --ga-primary-200: #ddd6fe;
  --ga-primary-400: #a78bfa;
  --ga-primary-600: #7c3aed;
  --ga-primary-700: #6d28d9;
  --ga-primary-gradient: linear-gradient(135deg, #8b5cf6, #7c3aed);
}

/* Red / Rose */
[data-color="red"] {
  --ga-primary: #ef4444;
  --ga-primary-dark: #dc2626;
  --ga-primary-rgb: 239, 68, 68;
  --ga-primary-50: #fef2f2;
  --ga-primary-100: #fee2e2;
  --ga-primary-200: #fecaca;
  --ga-primary-400: #f87171;
  --ga-primary-600: #dc2626;
  --ga-primary-700: #b91c1c;
  --ga-primary-gradient: linear-gradient(135deg, #ef4444, #dc2626);
}

/* Orange */
[data-color="orange"] {
  --ga-primary: #f97316;
  --ga-primary-dark: #ea580c;
  --ga-primary-rgb: 249, 115, 22;
  --ga-primary-50: #fff7ed;
  --ga-primary-100: #ffedd5;
  --ga-primary-200: #fed7aa;
  --ga-primary-400: #fb923c;
  --ga-primary-600: #ea580c;
  --ga-primary-700: #c2410c;
  --ga-primary-gradient: linear-gradient(135deg, #f97316, #ea580c);
}

/* Teal */
[data-color="teal"] {
  --ga-primary: #14b8a6;
  --ga-primary-dark: #0d9488;
  --ga-primary-rgb: 20, 184, 166;
  --ga-primary-50: #f0fdfa;
  --ga-primary-100: #ccfbf1;
  --ga-primary-200: #99f6e4;
  --ga-primary-400: #2dd4bf;
  --ga-primary-600: #0d9488;
  --ga-primary-700: #0f766e;
  --ga-primary-gradient: linear-gradient(135deg, #14b8a6, #0d9488);
}

/* Indigo */
[data-color="indigo"] {
  --ga-primary: #6366f1;
  --ga-primary-dark: #4f46e5;
  --ga-primary-rgb: 99, 102, 241;
  --ga-primary-50: #eef2ff;
  --ga-primary-100: #e0e7ff;
  --ga-primary-200: #c7d2fe;
  --ga-primary-400: #818cf8;
  --ga-primary-600: #4f46e5;
  --ga-primary-700: #4338ca;
  --ga-primary-gradient: linear-gradient(135deg, #6366f1, #4f46e5);
}

/* Rose / Pink */
[data-color="rose"] {
  --ga-primary: #f43f5e;
  --ga-primary-dark: #e11d48;
  --ga-primary-rgb: 244, 63, 94;
  --ga-primary-50: #fff1f2;
  --ga-primary-100: #ffe4e6;
  --ga-primary-200: #fecdd3;
  --ga-primary-400: #fb7185;
  --ga-primary-600: #e11d48;
  --ga-primary-700: #be123c;
  --ga-primary-gradient: linear-gradient(135deg, #f43f5e, #e11d48);
}

/* Amber */
[data-color="amber"] {
  --ga-primary: #f59e0b;
  --ga-primary-dark: #d97706;
  --ga-primary-rgb: 245, 158, 11;
  --ga-primary-50: #fffbeb;
  --ga-primary-100: #fef3c7;
  --ga-primary-200: #fde68a;
  --ga-primary-400: #fbbf24;
  --ga-primary-600: #d97706;
  --ga-primary-700: #b45309;
  --ga-primary-gradient: linear-gradient(135deg, #f59e0b, #d97706);
}

/* Cyan */
[data-color="cyan"] {
  --ga-primary: #06b6d4;
  --ga-primary-dark: #0891b2;
  --ga-primary-rgb: 6, 182, 212;
  --ga-primary-50: #ecfeff;
  --ga-primary-100: #cffafe;
  --ga-primary-200: #a5f3fc;
  --ga-primary-400: #22d3ee;
  --ga-primary-600: #0891b2;
  --ga-primary-700: #0e7490;
  --ga-primary-gradient: linear-gradient(135deg, #06b6d4, #0891b2);
}

/* Emerald */
[data-color="emerald"] {
  --ga-primary: #10b981;
  --ga-primary-dark: #059669;
  --ga-primary-rgb: 16, 185, 129;
  --ga-primary-50: #ecfdf5;
  --ga-primary-100: #d1fae5;
  --ga-primary-200: #a7f3d0;
  --ga-primary-400: #34d399;
  --ga-primary-600: #059669;
  --ga-primary-700: #047857;
  --ga-primary-gradient: linear-gradient(135deg, #10b981, #059669);
}

/* Sky */
[data-color="sky"] {
  --ga-primary: #0ea5e9;
  --ga-primary-dark: #0284c7;
  --ga-primary-rgb: 14, 165, 233;
  --ga-primary-50: #f0f9ff;
  --ga-primary-100: #e0f2fe;
  --ga-primary-200: #bae6fd;
  --ga-primary-400: #38bdf8;
  --ga-primary-600: #0284c7;
  --ga-primary-700: #0369a1;
  --ga-primary-gradient: linear-gradient(135deg, #0ea5e9, #0284c7);
}

/* Fuchsia */
[data-color="fuchsia"] {
  --ga-primary: #d946ef;
  --ga-primary-dark: #c026d3;
  --ga-primary-rgb: 217, 70, 239;
  --ga-primary-50: #fdf4ff;
  --ga-primary-100: #fae8ff;
  --ga-primary-200: #f5d0fe;
  --ga-primary-400: #e879f9;
  --ga-primary-600: #c026d3;
  --ga-primary-700: #a21caf;
  --ga-primary-gradient: linear-gradient(135deg, #d946ef, #c026d3);
}

/* Pink */
[data-color="pink"] {
  --ga-primary: #ec4899;
  --ga-primary-dark: #db2777;
  --ga-primary-rgb: 236, 72, 153;
  --ga-primary-50: #fdf2f8;
  --ga-primary-100: #fce7f3;
  --ga-primary-200: #fbcfe8;
  --ga-primary-400: #f472b6;
  --ga-primary-600: #db2777;
  --ga-primary-700: #be185d;
  --ga-primary-gradient: linear-gradient(135deg, #ec4899, #db2777);
}

/* Lime */
[data-color="lime"] {
  --ga-primary: #84cc16;
  --ga-primary-dark: #65a30d;
  --ga-primary-rgb: 132, 204, 22;
  --ga-primary-50: #f7fee7;
  --ga-primary-100: #ecfccb;
  --ga-primary-200: #d9f99d;
  --ga-primary-400: #a3e635;
  --ga-primary-600: #65a30d;
  --ga-primary-700: #4d7c0f;
  --ga-primary-gradient: linear-gradient(135deg, #84cc16, #65a30d);
}

/* Yellow */
[data-color="yellow"] {
  --ga-primary: #eab308;
  --ga-primary-dark: #ca8a04;
  --ga-primary-rgb: 234, 179, 8;
  --ga-primary-50: #fefce8;
  --ga-primary-100: #fef9c3;
  --ga-primary-200: #fef08a;
  --ga-primary-400: #facc15;
  --ga-primary-600: #ca8a04;
  --ga-primary-700: #a16207;
  --ga-primary-gradient: linear-gradient(135deg, #eab308, #ca8a04);
}

/* Slate */
[data-color="slate"] {
  --ga-primary: #64748b;
  --ga-primary-dark: #475569;
  --ga-primary-rgb: 100, 116, 139;
  --ga-primary-50: #f8fafc;
  --ga-primary-100: #f1f5f9;
  --ga-primary-200: #e2e8f0;
  --ga-primary-400: #94a3b8;
  --ga-primary-600: #475569;
  --ga-primary-700: #334155;
  --ga-primary-gradient: linear-gradient(135deg, #64748b, #475569);
}

/* Stone */
[data-color="stone"] {
  --ga-primary: #78716c;
  --ga-primary-dark: #57534e;
  --ga-primary-rgb: 120, 113, 108;
  --ga-primary-50: #fafaf9;
  --ga-primary-100: #f5f5f4;
  --ga-primary-200: #e7e5e4;
  --ga-primary-400: #a8a29e;
  --ga-primary-600: #57534e;
  --ga-primary-700: #44403c;
  --ga-primary-gradient: linear-gradient(135deg, #78716c, #57534e);
}

/* ========================================
   MODE: Full Light
   Light sidebar + Light content
   ======================================== */
[data-theme="light"] {
  --ga-body-bg: #f1f5f9;
  --ga-card-bg: #ffffff;
  --ga-border: #e2e8f0;
  --ga-text: #1e293b;
  --ga-text-secondary: #64748b;
  --ga-text-muted: #94a3b8;
  --ga-shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --ga-shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
  --ga-shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -2px rgba(0,0,0,0.1);
  --ga-shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -4px rgba(0,0,0,0.1);

  --ga-sidebar-bg: #ffffff;
  --ga-sidebar-text: #334155;
  --ga-sidebar-hover: rgba(0, 0, 0, 0.04);
  --ga-sidebar-active: rgba(var(--ga-primary-rgb), 0.1);
  --ga-sidebar-border: #e2e8f0;
  --ga-sidebar-label-color: #94a3b8;
  --ga-sidebar-brand-color: #1e293b;
  --ga-sidebar-submenu-border: rgba(0,0,0,0.08);
  --ga-sidebar-submenu-dot: rgba(0,0,0,0.2);
  --ga-sidebar-submenu-dot-hover: rgba(0,0,0,0.5);
  --ga-sidebar-footer-border: #e2e8f0;
  --ga-sidebar-user-name-color: #1e293b;
  --ga-sidebar-user-role-color: #94a3b8;
}

/* ========================================
   MODE: Mix (Dark sidebar + Light content)
   This is the classic admin look
   ======================================== */
[data-theme="mix"] {
  --ga-body-bg: #f1f5f9;
  --ga-card-bg: #ffffff;
  --ga-border: #e2e8f0;
  --ga-text: #1e293b;
  --ga-text-secondary: #64748b;
  --ga-text-muted: #94a3b8;
  --ga-shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --ga-shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
  --ga-shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -2px rgba(0,0,0,0.1);
  --ga-shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -4px rgba(0,0,0,0.1);

  --ga-sidebar-bg: #1c2434;
  --ga-sidebar-text: #dee4ee;
  --ga-sidebar-hover: rgba(255, 255, 255, 0.06);
  --ga-sidebar-active: rgba(var(--ga-primary-rgb), 0.15);
  --ga-sidebar-border: rgba(255,255,255,0.08);
  --ga-sidebar-label-color: rgba(255,255,255,0.35);
  --ga-sidebar-brand-color: #ffffff;
  --ga-sidebar-submenu-border: rgba(255,255,255,0.08);
  --ga-sidebar-submenu-dot: rgba(255,255,255,0.25);
  --ga-sidebar-submenu-dot-hover: rgba(255,255,255,0.6);
  --ga-sidebar-footer-border: rgba(255,255,255,0.08);
  --ga-sidebar-user-name-color: #ffffff;
  --ga-sidebar-user-role-color: rgba(255,255,255,0.5);
}

/* ========================================
   MODE: Full Dark
   Dark sidebar + Dark content
   ======================================== */
[data-theme="dark"] {
  --ga-body-bg: #1e293b;
  --ga-card-bg: #334155;
  --ga-border: #475569;
  --ga-text: #f1f5f9;
  --ga-text-secondary: #cbd5e1;
  --ga-text-muted: #94a3b8;
  --ga-shadow-sm: 0 1px 2px rgba(0,0,0,0.2);
  --ga-shadow: 0 1px 3px rgba(0,0,0,0.3);
  --ga-shadow-md: 0 4px 6px rgba(0,0,0,0.3);
  --ga-shadow-lg: 0 10px 15px rgba(0,0,0,0.3);

  --ga-sidebar-bg: #0f172a;
  --ga-sidebar-text: #dee4ee;
  --ga-sidebar-hover: rgba(255, 255, 255, 0.06);
  --ga-sidebar-active: rgba(var(--ga-primary-rgb), 0.15);
  --ga-sidebar-border: rgba(255,255,255,0.06);
  --ga-sidebar-label-color: rgba(255,255,255,0.3);
  --ga-sidebar-brand-color: #ffffff;
  --ga-sidebar-submenu-border: rgba(255,255,255,0.06);
  --ga-sidebar-submenu-dot: rgba(255,255,255,0.2);
  --ga-sidebar-submenu-dot-hover: rgba(255,255,255,0.5);
  --ga-sidebar-footer-border: rgba(255,255,255,0.06);
  --ga-sidebar-user-name-color: #ffffff;
  --ga-sidebar-user-role-color: rgba(255,255,255,0.45);
}

/* ========================================
   MODE: Midnight
   Near-black surfaces for OLED screens and low-light work
   ======================================== */
[data-theme="midnight"] {
  --ga-body-bg: #050810;
  --ga-card-bg: #0c1220;
  --ga-border: #1c2740;
  --ga-text: #e8edf7;
  --ga-text-secondary: #a7b4cc;
  --ga-text-muted: #6b7a96;
  --ga-shadow-sm: 0 1px 2px rgba(0,0,0,0.5);
  --ga-shadow: 0 1px 3px rgba(0,0,0,0.6);
  --ga-shadow-md: 0 4px 10px rgba(0,0,0,0.6);
  --ga-shadow-lg: 0 12px 28px rgba(0,0,0,0.7);

  --ga-sidebar-bg: #030509;
  --ga-sidebar-text: #c8d3e6;
  --ga-sidebar-hover: rgba(255, 255, 255, 0.05);
  --ga-sidebar-active: rgba(var(--ga-primary-rgb), 0.18);
  --ga-sidebar-border: rgba(255,255,255,0.05);
  --ga-sidebar-label-color: rgba(255,255,255,0.28);
  --ga-sidebar-brand-color: #ffffff;
  --ga-sidebar-submenu-border: rgba(255,255,255,0.05);
  --ga-sidebar-submenu-dot: rgba(255,255,255,0.18);
  --ga-sidebar-submenu-dot-hover: rgba(255,255,255,0.45);
  --ga-sidebar-footer-border: rgba(255,255,255,0.05);
  --ga-sidebar-user-name-color: #ffffff;
  --ga-sidebar-user-role-color: rgba(255,255,255,0.4);
}

[data-theme="midnight"] .ga-alert-success { color: #6ee7b7; }
[data-theme="midnight"] .ga-alert-warning { color: #fcd34d; }
[data-theme="midnight"] .ga-alert-danger { color: #fca5a5; }
[data-theme="midnight"] .ga-alert-info { color: #93c5fd; }

/* ========================================
   Density
   Compact is the default. Comfortable loosens the shared spacing scale
   plus the components whose padding is not variable-driven.
   ======================================== */
[data-density="comfortable"] {
  --ga-font-size-base: 0.95rem;
  --ga-line-height: 1.6;
  --ga-content-pad: 26px;
  --ga-space-1: 0.25rem;
  --ga-space-2: 0.5rem;
  --ga-space-3: 1rem;
  --ga-space-4: 1.5rem;
  --ga-space-5: 3rem;
  --sidebar-width: 276px;
  --sidebar-collapsed: 78px;
  --header-height: 62px;
}

[data-density="comfortable"] .ga-card-header { padding: 16px 20px; }
[data-density="comfortable"] .ga-card-body { padding: 20px; }
[data-density="comfortable"] .ga-card-title { font-size: 1rem; }
[data-density="comfortable"] .ga-stat-card { padding: 20px 24px; gap: 16px; }
[data-density="comfortable"] .ga-stat-value { font-size: 1.5rem; }
[data-density="comfortable"] .ga-page-title { font-size: 1.5rem; }
[data-density="comfortable"] .ga-nav-item { padding: 9px 12px; font-size: 0.875rem; gap: 10px; }
[data-density="comfortable"] .ga-submenu .ga-nav-item { padding: 7px 12px 7px 16px; font-size: 0.825rem; }
[data-density="comfortable"] .ga-table thead th { padding: 12px 16px; font-size: 0.8rem; }
[data-density="comfortable"] .ga-table tbody td { padding: 14px 16px; font-size: 0.9rem; }
[data-density="comfortable"] .ga-form-control { padding: 10px 14px; font-size: 0.9rem; }
[data-density="comfortable"] .ga-form-group { margin-bottom: 20px; }
[data-density="comfortable"] .ga-btn { padding: 8px 18px; font-size: 0.875rem; }
[data-density="comfortable"] .ga-footer { padding: 20px 24px; font-size: 0.8rem; }
[data-density="comfortable"] .table { --bs-table-cell-padding-y: 0.5rem; --bs-table-cell-padding-x: 0.75rem; font-size: 0.875rem; }
[data-density="comfortable"] .form-control,
[data-density="comfortable"] .form-select { padding: 0.45rem 0.75rem; font-size: 0.875rem; }
[data-density="comfortable"] .btn { --bs-btn-padding-y: 0.4rem; --bs-btn-padding-x: 0.85rem; --bs-btn-font-size: 0.875rem; }

/* ========================================
   Corner radius
   ======================================== */
[data-radius="sharp"] {
  --ga-radius: 2px;
  --ga-radius-lg: 3px;
  --bs-border-radius: 2px;
  --bs-border-radius-sm: 2px;
  --bs-border-radius-lg: 3px;
  --bs-border-radius-xl: 4px;
}

[data-radius="normal"] {
  --ga-radius: 8px;
  --ga-radius-lg: 12px;
  --bs-border-radius: 6px;
  --bs-border-radius-sm: 4px;
  --bs-border-radius-lg: 8px;
  --bs-border-radius-xl: 12px;
}

[data-radius="round"] {
  --ga-radius: 14px;
  --ga-radius-lg: 20px;
  --bs-border-radius: 12px;
  --bs-border-radius-sm: 9px;
  --bs-border-radius-lg: 16px;
  --bs-border-radius-xl: 22px;
}

[data-radius="sharp"] .ga-card,
[data-radius="sharp"] .card,
[data-radius="sharp"] .ga-stat-card { border-radius: var(--ga-radius-lg); }
[data-radius="round"] .ga-card,
[data-radius="round"] .card,
[data-radius="round"] .ga-stat-card { border-radius: var(--ga-radius-lg); }

/* ========================================
   Additional sidebar styling for light mode
   (admin.css uses CSS variables for all sidebar colors,
    these add new rules not in admin.css)
   ======================================== */

/* Light mode sidebar gets a right border for visual separation */
[data-theme="light"] .ga-sidebar {
  border-right: 1px solid var(--ga-sidebar-border);
  box-shadow: 1px 0 3px rgba(0,0,0,0.04);
}

/* Avatars match the active primary color */
.ga-sidebar-avatar {
  background: linear-gradient(135deg, var(--ga-primary), var(--ga-primary-dark)) !important;
}

.ga-header-avatar {
  background: linear-gradient(135deg, var(--ga-primary), var(--ga-primary-dark)) !important;
}

.ga-profile-avatar {
  background: linear-gradient(135deg, var(--ga-primary), var(--ga-primary-dark)) !important;
}

.ga-profile-cover {
  background: linear-gradient(135deg, #1c2434 0%, var(--ga-primary-dark) 50%, var(--ga-primary) 100%) !important;
}

/* ========================================
   Dark mode overrides for alert text
   ======================================== */
[data-theme="dark"] .ga-alert-success { color: #6ee7b7; }
[data-theme="dark"] .ga-alert-warning { color: #fcd34d; }
[data-theme="dark"] .ga-alert-danger { color: #fca5a5; }
[data-theme="dark"] .ga-alert-info { color: #93c5fd; }

/* ========================================
   Theme Customizer Panel
   Opened from the header settings button (no floating action button).
   ======================================== */

/* Panel overlay */
.ga-theme-overlay {
  position: fixed;
  inset: 0;
  background: rgba(8, 12, 20, 0.45);
  z-index: 1080;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  backdrop-filter: blur(3px);
}

.ga-theme-overlay.open {
  opacity: 1;
  visibility: visible;
}

/* Panel drawer */
.ga-theme-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: 320px;
  max-width: 92vw;
  height: 100vh;
  background: var(--ga-card-bg);
  z-index: 1090;
  transform: translateX(102%);
  transition: transform 0.38s cubic-bezier(0.32, 0.72, 0, 1);
  display: flex;
  flex-direction: column;
  box-shadow: -18px 0 48px rgba(0, 0, 0, 0.22);
  border-left: 1px solid var(--ga-border);
}

.ga-theme-panel.open {
  transform: translateX(0);
}

/* Header */
.ga-theme-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--ga-border);
  flex-shrink: 0;
}

.ga-theme-panel-title {
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--ga-text);
  display: flex;
  align-items: center;
  gap: 9px;
  letter-spacing: -0.01em;
}

.ga-theme-panel-title-icon {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: var(--ga-primary-gradient, var(--ga-primary));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.ga-theme-panel-title-icon svg { width: 14px; height: 14px; }

.ga-theme-panel-subtitle {
  display: block;
  font-size: 0.63rem;
  font-weight: 500;
  color: var(--ga-text-muted);
  letter-spacing: 0;
  margin-top: 1px;
}

.ga-theme-panel-close {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: var(--ga-body-bg);
  color: var(--ga-text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  flex-shrink: 0;
}

.ga-theme-panel-close:hover {
  background: rgba(var(--ga-primary-rgb), 0.1);
  border-color: rgba(var(--ga-primary-rgb), 0.25);
  color: var(--ga-primary);
}

.ga-theme-panel-close svg { width: 15px; height: 15px; }

/* Body */
.ga-theme-panel-body {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 16px;
}

.ga-theme-panel-body::-webkit-scrollbar { width: 4px; }
.ga-theme-panel-body::-webkit-scrollbar-thumb { background: var(--ga-border); border-radius: 4px; }

/* Live summary */
.ga-theme-current {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: linear-gradient(135deg, rgba(var(--ga-primary-rgb), 0.1), rgba(var(--ga-primary-rgb), 0.02));
  border: 1px solid rgba(var(--ga-primary-rgb), 0.2);
  border-radius: 10px;
  margin-bottom: 18px;
}

.ga-theme-current-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--ga-primary);
  flex-shrink: 0;
  box-shadow: 0 0 0 3px rgba(var(--ga-primary-rgb), 0.2);
  animation: ga-dot-pulse 2.4s ease-in-out infinite;
}

@keyframes ga-dot-pulse {
  0%, 100% { box-shadow: 0 0 0 3px rgba(var(--ga-primary-rgb), 0.2); }
  50% { box-shadow: 0 0 0 6px rgba(var(--ga-primary-rgb), 0.06); }
}

.ga-theme-current-text {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--ga-text-secondary);
  line-height: 1.45;
}

.ga-theme-current-text strong {
  color: var(--ga-primary);
  text-transform: capitalize;
}

/* Sections */
.ga-theme-section { margin-bottom: 20px; }
.ga-theme-section:last-child { margin-bottom: 0; }

.ga-theme-section-label {
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--ga-text-muted);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.ga-theme-section-label svg { width: 12px; height: 12px; }

.ga-theme-section-label .ga-theme-section-value {
  margin-left: auto;
  text-transform: capitalize;
  letter-spacing: 0;
  font-size: 0.64rem;
  color: var(--ga-primary);
}

/* Mode selector cards.
   Flex rather than grid so an incomplete last row stays centred. */
.ga-mode-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.ga-mode-card {
  flex: 0 0 calc((100% - 16px) / 3);
  border: 1.5px solid var(--ga-border);
  border-radius: 10px;
  padding: 7px 6px 8px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, transform 0.2s;
  background: var(--ga-card-bg);
  position: relative;
  font-family: inherit;
  display: block;
}

.ga-mode-card:hover {
  border-color: rgba(var(--ga-primary-rgb), 0.55);
  transform: translateY(-1px);
}

.ga-mode-card:focus-visible,
.ga-color-swatch:focus-visible,
.ga-seg-btn:focus-visible,
.ga-theme-reset-btn:focus-visible,
.ga-theme-panel-close:focus-visible {
  outline: 2px solid var(--ga-primary);
  outline-offset: 2px;
}

.ga-mode-card[aria-checked="true"] {
  border-color: var(--ga-primary);
  background: rgba(var(--ga-primary-rgb), 0.07);
}

.ga-mode-card[aria-checked="true"]::after {
  content: '';
  position: absolute;
  top: -5px;
  right: -5px;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: var(--ga-primary);
  border: 2px solid var(--ga-card-bg);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='4'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E");
  background-size: 9px;
  background-repeat: no-repeat;
  background-position: center;
}

/* Mini preview inside mode card */
.ga-mode-preview {
  width: 100%;
  height: 34px;
  border-radius: 6px;
  margin-bottom: 6px;
  display: flex;
  overflow: hidden;
  border: 1px solid rgba(128, 128, 128, 0.22);
}

.ga-mode-preview-sidebar { width: 32%; flex-shrink: 0; }
.ga-mode-preview-content { flex: 1; display: flex; flex-direction: column; }
.ga-mode-preview-header { height: 32%; }
.ga-mode-preview-body { flex: 1; }

/* Light preview */
.ga-mode-card[data-mode="light"] .ga-mode-preview-sidebar { background: #f8fafc; }
.ga-mode-card[data-mode="light"] .ga-mode-preview-header { background: #ffffff; }
.ga-mode-card[data-mode="light"] .ga-mode-preview-body { background: #f1f5f9; }

/* Dark preview */
.ga-mode-card[data-mode="dark"] .ga-mode-preview-sidebar { background: #0f172a; }
.ga-mode-card[data-mode="dark"] .ga-mode-preview-header { background: #334155; }
.ga-mode-card[data-mode="dark"] .ga-mode-preview-body { background: #1e293b; }

/* Mix preview */
.ga-mode-card[data-mode="mix"] .ga-mode-preview-sidebar { background: #1c2434; }
.ga-mode-card[data-mode="mix"] .ga-mode-preview-header { background: #ffffff; }
.ga-mode-card[data-mode="mix"] .ga-mode-preview-body { background: #f1f5f9; }

/* Midnight preview */
.ga-mode-card[data-mode="midnight"] .ga-mode-preview-sidebar { background: #030509; }
.ga-mode-card[data-mode="midnight"] .ga-mode-preview-header { background: #0c1220; }
.ga-mode-card[data-mode="midnight"] .ga-mode-preview-body { background: #050810; }

/* System preview: split light / dark */
.ga-mode-card[data-mode="system"] .ga-mode-preview-sidebar {
  background: linear-gradient(180deg, #f8fafc 50%, #0f172a 50%);
}
.ga-mode-card[data-mode="system"] .ga-mode-preview-header {
  background: linear-gradient(90deg, #ffffff 50%, #334155 50%);
}
.ga-mode-card[data-mode="system"] .ga-mode-preview-body {
  background: linear-gradient(90deg, #f1f5f9 50%, #1e293b 50%);
}

.ga-mode-label {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--ga-text-secondary);
}

.ga-mode-card[aria-checked="true"] .ga-mode-label { color: var(--ga-primary); }

.ga-mode-hint {
  display: block;
  font-size: 0.62rem;
  font-weight: 500;
  color: var(--ga-text-muted);
  margin-top: 1px;
}

/* Color palette grid */
.ga-color-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
}

.ga-color-swatch {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  border-radius: 9px;
  cursor: pointer;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.2s;
  border: none;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ga-color-swatch::before {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 12px;
  border: 2px solid transparent;
  transition: border-color 0.2s;
}

.ga-color-swatch:hover {
  transform: scale(1.14);
  box-shadow: 0 5px 14px rgba(0, 0, 0, 0.22);
  z-index: 1;
}

.ga-color-swatch[aria-checked="true"]::before { border-color: var(--ga-text); }

.ga-color-swatch[aria-checked="true"]::after {
  content: '';
  width: 13px;
  height: 13px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.5'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.45));
}

.ga-color-swatch[data-color="lime"]     { background: linear-gradient(135deg, #84cc16, #65a30d); }
.ga-color-swatch[data-color="green"]    { background: linear-gradient(135deg, #22c55e, #16a34a); }
.ga-color-swatch[data-color="emerald"]  { background: linear-gradient(135deg, #10b981, #059669); }
.ga-color-swatch[data-color="teal"]     { background: linear-gradient(135deg, #14b8a6, #0d9488); }
.ga-color-swatch[data-color="cyan"]     { background: linear-gradient(135deg, #06b6d4, #0891b2); }
.ga-color-swatch[data-color="sky"]      { background: linear-gradient(135deg, #0ea5e9, #0284c7); }
.ga-color-swatch[data-color="blue"]     { background: linear-gradient(135deg, #3b82f6, #2563eb); }
.ga-color-swatch[data-color="indigo"]   { background: linear-gradient(135deg, #6366f1, #4f46e5); }
.ga-color-swatch[data-color="purple"]   { background: linear-gradient(135deg, #8b5cf6, #7c3aed); }
.ga-color-swatch[data-color="fuchsia"]  { background: linear-gradient(135deg, #d946ef, #c026d3); }
.ga-color-swatch[data-color="pink"]     { background: linear-gradient(135deg, #ec4899, #db2777); }
.ga-color-swatch[data-color="rose"]     { background: linear-gradient(135deg, #f43f5e, #e11d48); }
.ga-color-swatch[data-color="red"]      { background: linear-gradient(135deg, #ef4444, #dc2626); }
.ga-color-swatch[data-color="orange"]   { background: linear-gradient(135deg, #f97316, #ea580c); }
.ga-color-swatch[data-color="amber"]    { background: linear-gradient(135deg, #f59e0b, #d97706); }
.ga-color-swatch[data-color="yellow"]   { background: linear-gradient(135deg, #eab308, #ca8a04); }
.ga-color-swatch[data-color="slate"]    { background: linear-gradient(135deg, #64748b, #475569); }
.ga-color-swatch[data-color="stone"]    { background: linear-gradient(135deg, #78716c, #57534e); }

/* Segmented control (density / radius) */
.ga-seg {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 3px;
  padding: 3px;
  background: var(--ga-body-bg);
  border: 1px solid var(--ga-border);
  border-radius: 9px;
}

.ga-seg-btn {
  border: none;
  background: transparent;
  color: var(--ga-text-secondary);
  font-family: inherit;
  font-size: 0.64rem;
  font-weight: 600;
  padding: 6px 4px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}

.ga-seg-btn svg { width: 12px; height: 12px; flex-shrink: 0; }

.ga-seg-btn:hover { color: var(--ga-text); }

.ga-seg-btn[aria-checked="true"] {
  background: var(--ga-card-bg);
  color: var(--ga-primary);
  box-shadow: var(--ga-shadow-sm);
}

/* Panel footer */
.ga-theme-panel-footer {
  padding: 12px 16px;
  border-top: 1px solid var(--ga-border);
  flex-shrink: 0;
}

.ga-theme-reset-btn {
  width: 100%;
  padding: 9px 15px;
  border-radius: 9px;
  border: 1px solid var(--ga-border);
  background: var(--ga-body-bg);
  color: var(--ga-text-secondary);
  font-size: 0.7rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  transition: all 0.2s;
  font-family: inherit;
}

.ga-theme-reset-btn:hover {
  border-color: var(--ga-primary);
  color: var(--ga-primary);
  background: rgba(var(--ga-primary-rgb), 0.06);
}

.ga-theme-reset-btn svg { width: 13px; height: 13px; }

/* ========================================
   Smooth transitions when changing themes
   ======================================== */
html.ga-theme-transitioning,
html.ga-theme-transitioning *,
html.ga-theme-transitioning *::before,
html.ga-theme-transitioning *::after {
  transition: background-color 0.35s ease,
              color 0.35s ease,
              border-color 0.35s ease,
              box-shadow 0.35s ease !important;
}

@media (prefers-reduced-motion: reduce) {
  .ga-theme-panel,
  .ga-theme-overlay,
  .ga-color-swatch,
  .ga-mode-card { transition: none; }
  .ga-theme-current-dot { animation: none; }
}

/* ========================================
   Responsive
   ======================================== */
@media (max-width: 640px) {
  .ga-theme-panel {
    width: 100%;
    max-width: 100%;
  }

  .ga-color-grid {
    grid-template-columns: repeat(6, 1fr);
    gap: 7px;
  }
}
