/* ==========================================================================
   Lumina Theme System - Complete CSS Design System
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Design System Tokens & Themes
   -------------------------------------------------------------------------- */
:root {
  /* Default Accent Colors (Indigo) */
  --accent-h: 239;
  --accent-s: 84%;
  --accent-l: 67%;
  --accent-color: hsl(var(--accent-h), var(--accent-s), var(--accent-l));
  --accent-glow: hsla(var(--accent-h), var(--accent-s), var(--accent-l), 0.35);
  --accent-hover: hsl(var(--accent-h), var(--accent-s), calc(var(--accent-l) - 8%));
  
  --success-color: #10b981;
  --info-color: #06b6d4;
  --warning-color: #f59e0b;

  --font-main: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-code: 'Fira Code', monospace;

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;

  --transition-fast: 0.2s ease;
  --transition-smooth: 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-bounce: 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Accent Color Variations */
html[data-accent="emerald"] {
  --accent-h: 160;
  --accent-s: 84%;
  --accent-l: 39%;
}
html[data-accent="rose"] {
  --accent-h: 343;
  --accent-s: 87%;
  --accent-l: 60%;
}
html[data-accent="amber"] {
  --accent-h: 38;
  --accent-s: 92%;
  --accent-l: 50%;
}
html[data-accent="cyan"] {
  --accent-h: 189;
  --accent-s: 94%;
  --accent-l: 43%;
}
html[data-accent="violet"] {
  --accent-h: 263;
  --accent-s: 90%;
  --accent-l: 66%;
}

/* --- Dark Theme Palette (Default) --- */
html[data-theme="dark"] {
  --bg-app: #0b0f19;
  --bg-navbar: rgba(15, 23, 42, 0.75);
  --bg-card: rgba(18, 26, 47, 0.7);
  --bg-card-solid: #131b2e;
  --bg-card-hover: rgba(28, 40, 70, 0.8);
  --bg-input: rgba(10, 16, 30, 0.6);
  --bg-glass: rgba(15, 23, 42, 0.65);
  
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  
  --border-color: rgba(255, 255, 255, 0.08);
  --border-highlight: rgba(255, 255, 255, 0.15);
  
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.6);

  --glow-bg-1: hsla(var(--accent-h), var(--accent-s), var(--accent-l), 0.15);
  --glow-bg-2: rgba(14, 165, 233, 0.12);
  
  --code-bg: #0d1117;
  --code-text: #c9d1d9;
}

/* --- Light Theme Palette --- */
html[data-theme="light"] {
  --bg-app: #f4f6fb;
  --bg-navbar: rgba(255, 255, 255, 0.85);
  --bg-card: rgba(255, 255, 255, 0.85);
  --bg-card-solid: #ffffff;
  --bg-card-hover: rgba(255, 255, 255, 0.98);
  --bg-input: #ffffff;
  --bg-glass: rgba(255, 255, 255, 0.75);
  
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  
  --border-color: rgba(0, 0, 0, 0.08);
  --border-highlight: rgba(0, 0, 0, 0.15);
  
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 8px 24px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 16px 40px rgba(15, 23, 42, 0.12);

  --glow-bg-1: hsla(var(--accent-h), var(--accent-s), var(--accent-l), 0.18);
  --glow-bg-2: rgba(56, 189, 248, 0.15);
  
  --code-bg: #f8fafc;
  --code-text: #1e293b;
}

/* --------------------------------------------------------------------------
   2. Reset & Base Layout
   -------------------------------------------------------------------------- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  width: 100%;
  min-height: 100vh;
  font-family: var(--font-main);
  background-color: var(--bg-app);
  color: var(--text-primary);
  transition: background-color var(--transition-smooth), color var(--transition-smooth);
  overflow-x: hidden;
}

/* Background Glow Effects */
.bg-glow-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.bg-glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
  transition: background var(--transition-smooth);
}

.bg-glow-1 {
  top: -150px;
  right: -100px;
  width: 550px;
  height: 550px;
  background: var(--glow-bg-1);
}

.bg-glow-2 {
  bottom: -150px;
  left: -100px;
  width: 600px;
  height: 600px;
  background: var(--glow-bg-2);
}

#app {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.main-container {
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 5rem;
  display: flex;
  flex-direction: column;
  gap: 4rem;
}

/* --------------------------------------------------------------------------
   3. Navigation Header
   -------------------------------------------------------------------------- */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg-navbar);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-color);
  transition: background var(--transition-smooth), border-color var(--transition-smooth);
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.brand-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--accent-color), var(--accent-hover));
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 14px var(--accent-glow);
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-name {
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
}

.brand-tag {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
}

.nav-controls {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

/* Accent Color Picker */
.accent-picker {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--bg-card);
  padding: 0.35rem 0.5rem;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-color);
}

.accent-btn {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background-color: var(--color);
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform var(--transition-fast), border-color var(--transition-fast);
}

.accent-btn:hover {
  transform: scale(1.2);
}

.accent-btn.active {
  border-color: var(--text-primary);
  transform: scale(1.15);
}

/* Icon Buttons */
.icon-control-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.icon-control-btn:hover {
  color: var(--text-primary);
  border-color: var(--border-highlight);
  background: var(--bg-card-hover);
}

.hidden {
  display: none !important;
}

/* --------------------------------------------------------------------------
   4. Hero Section
   -------------------------------------------------------------------------- */
.hero-section {
  text-align: center;
  max-width: 800px;
  margin: 1rem auto 0;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 1rem;
  background: rgba(var(--accent-h), var(--accent-s), var(--accent-l), 0.1);
  border: 1px solid var(--accent-glow);
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent-color);
  margin-bottom: 1.25rem;
}

.badge-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--accent-color);
  box-shadow: 0 0 10px var(--accent-color);
  animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.3); opacity: 0.6; }
}

.hero-title {
  font-size: 2.75rem;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.03em;
  margin-bottom: 1.25rem;
}

.gradient-text {
  background: linear-gradient(135deg, var(--text-primary), var(--accent-color));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-desc {
  font-size: 1.1rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 2rem;
}

.hero-status-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2rem;
  padding: 0.85rem 1.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow-sm);
}

.status-item {
  font-size: 0.88rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.status-label {
  color: var(--text-muted);
}

.status-value {
  font-weight: 600;
  color: var(--text-primary);
}

.status-value.highlight {
  color: var(--accent-color);
}

/* --------------------------------------------------------------------------
   5. Section Header Component
   -------------------------------------------------------------------------- */
.section-header {
  margin-bottom: 1.75rem;
}

.section-title {
  font-size: 1.4rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--text-primary);
  margin-bottom: 0.35rem;
}

.section-title svg {
  color: var(--accent-color);
}

.section-subtitle {
  font-size: 0.95rem;
  color: var(--text-secondary);
}

/* --------------------------------------------------------------------------
   6. Toggle Switch Gallery (5 Distinct Designs)
   -------------------------------------------------------------------------- */
.toggles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.5rem;
}

.toggle-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 1.5rem;
  transition: all var(--transition-smooth);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(10px);
}

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

.toggle-card-header .toggle-tag {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent-color);
  display: block;
  margin-bottom: 0.35rem;
}

.toggle-card-header h3 {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 0.4rem;
}

.toggle-card-header p {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.toggle-card-preview {
  min-height: 90px;
  background: rgba(0, 0, 0, 0.05);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  border: 1px dashed var(--border-color);
}

html[data-theme="dark"] .toggle-card-preview {
  background: rgba(255, 255, 255, 0.02);
}

.toggle-card-footer {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-weight: 600;
  text-align: center;
}

/* === STYLE 1: Celestial Sun & Moon Switch === */
.celestial-switch {
  position: relative;
  display: inline-block;
  width: 70px;
  height: 36px;
  cursor: pointer;
}

.celestial-switch.lg {
  width: 86px;
  height: 44px;
}

.celestial-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.celestial-slider {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: linear-gradient(135deg, #38bdf8, #0284c7);
  border-radius: var(--radius-full);
  transition: background var(--transition-smooth), box-shadow var(--transition-smooth);
  overflow: hidden;
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.2);
}

.celestial-switch input:checked + .celestial-slider {
  background: linear-gradient(135deg, #0f172a, #1e1b4b);
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.5);
}

/* Celestial Orb (Sun / Moon) */
.celestial-orb {
  position: absolute;
  left: 4px;
  top: 4px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #fde047;
  box-shadow: 0 0 10px rgba(253, 224, 71, 0.8);
  transition: transform var(--transition-bounce), background var(--transition-smooth), box-shadow var(--transition-smooth);
  z-index: 2;
}

.celestial-switch.lg .celestial-orb {
  width: 36px;
  height: 36px;
}

.celestial-switch input:checked + .celestial-slider .celestial-orb {
  transform: translateX(34px);
  background: #e2e8f0;
  box-shadow: 0 0 12px rgba(226, 232, 240, 0.5);
}

.celestial-switch.lg input:checked + .celestial-slider .celestial-orb {
  transform: translateX(42px);
}

/* Sun Rays */
.sun-rays {
  position: absolute;
  inset: -2px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(253,224,71,0.4) 0%, rgba(253,224,71,0) 70%);
  opacity: 1;
  transition: opacity var(--transition-smooth);
}

.celestial-switch input:checked + .celestial-slider .sun-rays {
  opacity: 0;
}

/* Moon Craters */
.moon-craters {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  opacity: 0;
  transition: opacity var(--transition-smooth);
}

.moon-craters::before,
.moon-craters::after {
  content: '';
  position: absolute;
  background: #cbd5e1;
  border-radius: 50%;
}

.moon-craters::before {
  width: 7px;
  height: 7px;
  top: 6px;
  left: 8px;
}

.moon-craters::after {
  width: 5px;
  height: 5px;
  bottom: 6px;
  right: 7px;
}

.celestial-switch input:checked + .celestial-slider .moon-craters {
  opacity: 1;
}

/* Sky Decoration (Clouds & Stars) */
.celestial-sky {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.cloud {
  position: absolute;
  background: rgba(255, 255, 255, 0.85);
  border-radius: 10px;
  transition: transform var(--transition-bounce), opacity var(--transition-smooth);
}

.cloud-1 {
  width: 20px;
  height: 8px;
  right: 8px;
  top: 10px;
}

.cloud-2 {
  width: 14px;
  height: 6px;
  right: 18px;
  bottom: 8px;
}

.celestial-switch input:checked + .celestial-slider .cloud {
  transform: translateY(-20px);
  opacity: 0;
}

.star {
  position: absolute;
  color: #fef08a;
  font-size: 8px;
  opacity: 0;
  transform: scale(0);
  transition: transform var(--transition-bounce), opacity var(--transition-smooth);
}

.star-1 { top: 6px; left: 10px; }
.star-2 { bottom: 8px; left: 24px; font-size: 7px; }
.star-3 { top: 8px; left: 34px; font-size: 6px; }

.celestial-switch input:checked + .celestial-slider .star {
  opacity: 1;
  transform: scale(1);
}

/* === STYLE 2: Segmented Pill Control === */
.segmented-control {
  position: relative;
  display: flex;
  background: var(--bg-card-solid);
  padding: 4px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-color);
  width: 100%;
  max-width: 280px;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
}

.segmented-glider {
  position: absolute;
  top: 4px;
  bottom: 4px;
  width: calc(33.333% - 3px);
  background: var(--accent-color);
  border-radius: var(--radius-full);
  transition: transform var(--transition-bounce);
  box-shadow: 0 2px 8px var(--accent-glow);
  z-index: 1;
}

.segmented-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.5rem 0.75rem;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  position: relative;
  z-index: 2;
  transition: color var(--transition-fast);
}

.segmented-btn.active {
  color: #ffffff;
}

/* === STYLE 3: Neumorphic Tactile Push Button === */
.tactile-btn {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  border: none;
  background: var(--bg-card-solid);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  box-shadow: 
    6px 6px 16px rgba(0, 0, 0, 0.15),
    -6px -6px 16px rgba(255, 255, 255, 0.05);
  transition: all var(--transition-fast);
}

html[data-theme="dark"] .tactile-btn {
  box-shadow: 
    6px 6px 18px rgba(0, 0, 0, 0.5),
    -4px -4px 14px rgba(255, 255, 255, 0.03);
}

.tactile-btn:active {
  box-shadow: 
    inset 4px 4px 10px rgba(0, 0, 0, 0.3),
    inset -4px -4px 10px rgba(255, 255, 255, 0.05);
  transform: scale(0.96);
}

.tactile-inner {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
}

.led-indicator {
  position: absolute;
  top: 8px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-color);
  box-shadow: 0 0 8px var(--accent-color);
  transition: background var(--transition-smooth), box-shadow var(--transition-smooth);
}

.tactile-icon-wrap {
  position: relative;
  width: 24px;
  height: 24px;
  margin-top: 6px;
}

.tactile-icon-wrap svg {
  position: absolute;
  inset: 0;
  transition: transform var(--transition-bounce), opacity var(--transition-smooth);
}

html[data-theme="light"] .sun-icon { opacity: 1; transform: scale(1) rotate(0deg); color: #f59e0b; }
html[data-theme="light"] .moon-icon { opacity: 0; transform: scale(0.5) rotate(-90deg); }

html[data-theme="dark"] .sun-icon { opacity: 0; transform: scale(0.5) rotate(90deg); }
html[data-theme="dark"] .moon-icon { opacity: 1; transform: scale(1) rotate(0deg); color: var(--accent-color); }

/* === STYLE 4: Minimalist Icon Morph === */
.icon-morph-btn {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  border: 1px solid var(--border-color);
  background: var(--bg-card-solid);
  color: var(--text-primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-smooth);
}

.icon-morph-btn:hover {
  border-color: var(--accent-color);
  box-shadow: 0 0 16px var(--accent-glow);
  transform: scale(1.05);
}

.morph-icon-container {
  position: relative;
  width: 28px;
  height: 28px;
}

.morph-icon-container svg {
  position: absolute;
  inset: 0;
  transition: transform var(--transition-bounce), opacity var(--transition-smooth);
}

html[data-theme="light"] .morph-sun { opacity: 1; transform: rotate(0deg) scale(1); color: #f59e0b; }
html[data-theme="light"] .morph-moon { opacity: 0; transform: rotate(180deg) scale(0.2); }

html[data-theme="dark"] .morph-sun { opacity: 0; transform: rotate(-180deg) scale(0.2); }
html[data-theme="dark"] .morph-moon { opacity: 1; transform: rotate(0deg) scale(1); color: var(--accent-color); }

/* === STYLE 5: Cyber Neon Switch === */
.cyber-switch {
  position: relative;
  display: inline-block;
  width: 120px;
  height: 40px;
  cursor: pointer;
}

.cyber-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.cyber-track {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.8);
  border: 1.5px solid var(--border-highlight);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.5);
  transition: border-color var(--transition-smooth), box-shadow var(--transition-smooth);
}

.cyber-label {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  transition: color var(--transition-smooth);
  z-index: 1;
}

.cyber-label.left { color: #f59e0b; }

.cyber-switch input:checked + .cyber-track {
  border-color: var(--accent-color);
  box-shadow: inset 0 0 12px var(--accent-glow), 0 0 15px var(--accent-glow);
}

.cyber-switch input:checked + .cyber-track .cyber-label.right {
  color: var(--accent-color);
}

.cyber-thumb {
  position: absolute;
  top: 4px;
  left: 4px;
  width: 52px;
  height: 30px;
  background: var(--bg-card-solid);
  border: 1px solid var(--border-highlight);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform var(--transition-bounce), background var(--transition-smooth);
  z-index: 2;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.cyber-thumb-line {
  width: 14px;
  height: 3px;
  background: #f59e0b;
  border-radius: 2px;
  box-shadow: 0 0 6px #f59e0b;
  transition: background var(--transition-smooth), box-shadow var(--transition-smooth);
}

.cyber-switch input:checked + .cyber-track .cyber-thumb {
  transform: translateX(58px);
  background: var(--accent-color);
}

.cyber-switch input:checked + .cyber-track .cyber-thumb-line {
  background: #ffffff;
  box-shadow: 0 0 8px #ffffff;
}

/* --------------------------------------------------------------------------
   7. UI Component Showcase (Dashboard Grid)
   -------------------------------------------------------------------------- */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

/* Metric Cards */
.metric-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  transition: all var(--transition-smooth);
  backdrop-filter: blur(10px);
}

.metric-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.metric-title {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.metric-badge {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-full);
}

.metric-badge.positive {
  background: rgba(16, 185, 129, 0.12);
  color: var(--success-color);
}

.metric-badge.neutral {
  background: rgba(148, 163, 184, 0.12);
  color: var(--text-muted);
}

.metric-value {
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.metric-sub {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.sparkline-chart {
  width: 100%;
  height: 36px;
}

/* Main Dashboard Widget (Glassmorphism) */
.glass-card.main-dash-widget {
  grid-column: span 2;
  background: var(--bg-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  box-shadow: var(--shadow-md);
  transition: all var(--transition-smooth);
}

.glass-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 1rem;
}

.widget-title-group h3 {
  font-size: 1.2rem;
  font-weight: 700;
}

.widget-title-group .sub-text {
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.widget-actions {
  display: flex;
  gap: 0.6rem;
}

/* Form Styles */
.interactive-form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.form-group.full-width {
  grid-column: span 2;
}

.form-group label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.form-group input[type="text"],
.form-group select {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-md);
  font-family: var(--font-main);
  font-size: 0.9rem;
  outline: none;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-group input[type="text"]:focus,
.form-group select:focus {
  border-color: var(--accent-color);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.checkbox-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  margin-top: 0.25rem;
}

.custom-checkbox {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.88rem;
  color: var(--text-primary);
  cursor: pointer;
  user-select: none;
}

.custom-checkbox input {
  display: none;
}

.checkmark {
  width: 18px;
  height: 18px;
  border-radius: 4px;
  border: 1.5px solid var(--border-highlight);
  background: var(--bg-input);
  position: relative;
  transition: all var(--transition-fast);
}

.custom-checkbox input:checked + .checkmark {
  background: var(--accent-color);
  border-color: var(--accent-color);
}

.checkmark::after {
  content: '';
  position: absolute;
  left: 5px;
  top: 2px;
  width: 4px;
  height: 8px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.custom-checkbox input:checked + .checkmark::after {
  opacity: 1;
}

/* Button UI Components */
.btn-primary {
  background: var(--accent-color);
  color: #ffffff;
  border: none;
  padding: 0.55rem 1.1rem;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  box-shadow: 0 4px 12px var(--accent-glow);
  transition: all var(--transition-fast);
}

.btn-primary:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
}

.btn-ghost {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  padding: 0.55rem 1.1rem;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-ghost:hover {
  border-color: var(--border-highlight);
  color: var(--text-primary);
  background: var(--bg-card-hover);
}

/* Data Table Card */
.data-card {
  grid-column: span 1;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  backdrop-filter: blur(10px);
}

.data-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.data-card-header h3 {
  font-size: 1.1rem;
  font-weight: 700;
}

.badge-count {
  font-size: 0.75rem;
  font-weight: 700;
  background: var(--bg-card-solid);
  border: 1px solid var(--border-color);
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-full);
  color: var(--text-secondary);
}

.table-container {
  overflow-x: auto;
}

.custom-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}

.custom-table th {
  text-align: left;
  padding: 0.6rem 0.5rem;
  color: var(--text-muted);
  font-weight: 600;
  border-bottom: 1px solid var(--border-color);
}

.custom-table td {
  padding: 0.75rem 0.5rem;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-secondary);
}

.custom-table tr:last-child td {
  border-bottom: none;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  color: var(--text-primary);
}

.user-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.status-chip {
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-full);
  font-weight: 700;
  font-size: 0.72rem;
}

.chip-success {
  background: rgba(16, 185, 129, 0.12);
  color: var(--success-color);
}

.chip-info {
  background: rgba(6, 182, 212, 0.12);
  color: var(--info-color);
}

/* --------------------------------------------------------------------------
   8. Developer Code Generator Box
   -------------------------------------------------------------------------- */
.code-box {
  background: var(--code-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
}

.code-box-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(0, 0, 0, 0.2);
  padding: 0.75rem 1.25rem;
  border-bottom: 1px solid var(--border-color);
}

.code-tabs {
  display: flex;
  gap: 0.5rem;
}

.code-tab {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 0.4rem 0.85rem;
  font-size: 0.82rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.code-tab:hover {
  color: var(--text-primary);
}

.code-tab.active {
  background: var(--bg-card);
  color: var(--accent-color);
}

.copy-btn {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.copy-btn:hover {
  color: var(--text-primary);
  border-color: var(--accent-color);
}

.code-box-body pre {
  padding: 1.25rem 1.5rem;
  overflow-x: auto;
  font-family: var(--font-code);
  font-size: 0.88rem;
  line-height: 1.6;
  color: var(--code-text);
}

/* --------------------------------------------------------------------------
   9. Toast Notification
   -------------------------------------------------------------------------- */
.toast-container {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  z-index: 1000;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  background: var(--bg-card-solid);
  border: 1px solid var(--accent-glow);
  color: var(--text-primary);
  padding: 0.85rem 1.25rem;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  font-size: 0.88rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  animation: toast-in 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(20px) scale(0.9); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.toast-out {
  animation: toast-out 0.25s forwards;
}

@keyframes toast-out {
  to { opacity: 0; transform: translateY(10px) scale(0.95); }
}

/* --------------------------------------------------------------------------
   10. Footer & Responsive Layout
   -------------------------------------------------------------------------- */
.footer {
  border-top: 1px solid var(--border-color);
  padding: 2rem 1.5rem;
  background: var(--bg-card);
  margin-top: auto;
}

.footer-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.footer-links {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.footer-links a {
  color: var(--text-secondary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

.footer-links a:hover {
  color: var(--accent-color);
}

/* Responsive Media Queries */
@media (max-width: 992px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
  
  .glass-card.main-dash-widget {
    grid-column: span 1;
  }
}

@media (max-width: 768px) {
  .hero-title {
    font-size: 2rem;
  }
  
  .nav-container {
    flex-direction: column;
    gap: 1rem;
  }
  
  .hero-status-bar {
    flex-direction: column;
    gap: 0.5rem;
    align-items: flex-start;
  }
  
  .toggles-grid {
    grid-template-columns: 1fr;
  }

  .interactive-form-grid {
    grid-template-columns: 1fr;
  }

  .form-group.full-width {
    grid-column: span 1;
  }
}
