/* ========== DESIGN SYSTEM – CSS VARIABLES ========== */
:root {
  /* Core Colors – Light Theme */
  --background: rgba(255,255,255,0.95);
  --foreground: #2d3748;
  --card: rgba(255,255,255,0.95);
  --card-foreground: #2d3748;
  --popover: rgba(255,255,255,0.95);
  --popover-foreground: #2d3748;

  /* Primary & Secondary */
  --primary: #ED8936;
  --primary-foreground: #ffffff;
  --secondary: #f8f9fa;
  --secondary-foreground: #4a5568;
  --muted: #f8f9fa;
  --muted-foreground: #718096;
  --accent: rgba(237,137,54,0.1);
  --accent-foreground: #92400e;

  /* Status Colors */
  --destructive: #ef4444;
  --destructive-foreground: #ffffff;
  --success: #10b981;
  --success-foreground: #ffffff;
  --warning: #f59e0b;
  --warning-foreground: #000000;
  --info: #3b82f6;
  --info-foreground: #ffffff;

  /* UI Elements */
  --border: rgba(0,0,0,0.08);
  --input: rgba(0,0,0,0.08);
  --ring: #ED8936;

  /* Sidebar Specific */
  --sidebar: rgba(255,255,255,0.95);
  --sidebar-foreground: #2d3748;
  --sidebar-primary: #ED8936;
  --sidebar-primary-foreground: #ffffff;
  --sidebar-accent: rgba(237,137,54,0.1);
  --sidebar-accent-foreground: #92400e;
  --sidebar-border: rgba(0,0,0,0.08);
  --sidebar-ring: #ED8936;

  /* Additional Colors */
  --accent-light: #FEF3E2;
  --accent-medium: #FAB12F;
  --accent-dark: #FA812F;

  --danger-light: #FEE2E2;
  --danger-medium: #EF4444;
  --danger-dark: #DD0303;

  --success-light: #D1FAE5;
  --success-medium: #10B981;
  --success-dark: #047857;

  --info-light: #DBEAFE;
  --info-medium: #3B82F6;
  --info-dark: #1E40AF;

  --warning-light: #FEFCE8;
  --warning-medium: #F59E0B;
  --warning-dark: #B45309;

  --neutral-light: #F3F4F6;
  --neutral-medium: #D1D5DB;
  --neutral-dark: #4B5563;

  /* Background Variants */
  --background-light: #FFFFFF;
  --background-medium: #F9FAFB;
  --background-dark: #E5E7EB;

  /* Text Variants */
  --text-light: #6B7280;
  --text-medium: #374151;
  --text-dark: #1F2937;

  /* Typography */
  --font-sans: system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-serif: Source Serif 4, serif;
  --font-mono: JetBrains Mono, monospace;

  /* Layout */
  --radius: 12px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 28px;
  --spacing: 0.25rem;

  /* Shadows */
  --shadow-xs: 0 1px 2px rgba(0,0,0,0.05);
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.1);
  --shadow: 0 4px 6px rgba(0,0,0,0.1), 0 2px 4px rgba(0,0,0,0.1);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.1), 0 2px 4px rgba(0,0,0,0.1);
  --shadow-lg: 4px 0 20px rgba(0,0,0,0.15);
  --shadow-xl: 0 8px 30px rgba(0,0,0,0.15);
  --shadow-2xl: 0 25px 50px rgba(0,0,0,0.25);

  /* Sidebar Layout */
  --sidebar-width-expanded: 280px;
  --sidebar-width-collapsed: 100px;
  --header-height: 70px;
}

/* ========== DARK THEME ========== */
[data-theme="dark"], .dark {
  --background: rgba(0,0,0,0.74);
  --foreground: #ffffff;
  --card: rgba(34,41,57,0.70);
  --card-foreground: #ffffff;
  --popover: rgba(34,41,57,0.90);
  --popover-foreground: #ffffff;

  --primary: #ED8936;
  --primary-foreground: #ffffff;
  --secondary: rgba(0,0,0,0.74);
  --secondary-foreground: #ffffff;
  --muted: rgba(34,41,57,0.70);
  --muted-foreground: #ffffff;
  --accent: rgba(255,255,255,0.1);
  --accent-foreground: #ffffff;

  --destructive: #ef4444;
  --destructive-foreground: #ffffff;
  --success: #10B981;
  --success-foreground: #ffffff;
  --warning: #f59e0b;
  --warning-foreground: #000000;
  --info: #3B82F6;
  --info-foreground: #ffffff;

  --border: rgba(255,255,255,0.1);
  --input: rgba(255,255,255,0.1);
  --ring: #ED8936;

  --sidebar: rgba(34,41,57,0.70);
  --sidebar-foreground: #ffffff;
  --sidebar-primary: #ED8936;
  --sidebar-primary-foreground: #ffffff;
  --sidebar-accent: rgba(255,255,255,0.1);
  --sidebar-accent-foreground: #ffffff;
  --sidebar-border: rgba(255,255,255,0.1);
  --sidebar-ring: #ED8936;

  --accent-light: #FEF3E2;
  --accent-medium: #FAB12F;
  --accent-dark: #FA812F;

  --danger-light: #FEE2E2;
  --danger-medium: #EF4444;
  --danger-dark: #DD0303;

  --success-light: #D1FAE5;
  --success-medium: #10B981;
  --success-dark: #047857;

  --info-light: #DBEAFE;
  --info-medium: #3B82F6;
  --info-dark: #1E40AF;

  --warning-light: #FEFCE8;
  --warning-medium: #F59E0B;
  --warning-dark: #B45309;

  --neutral-light: #F3F4F6;
  --neutral-medium: #D1D5DB;
  --neutral-dark: #4B5563;
}

/* ========== BASE STYLES ========== */
* {
  border-color: var(--border);
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

body {
  background-color: var(--background);
  color: var(--foreground);
  font-family: var(--font-sans);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ========== BOOTSTRAP OVERRIDES ========== */
/* Cards */
.card {
  background-color: var(--card) !important;
  color: var(--card-foreground) !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius-lg) !important;
  box-shadow: var(--shadow-sm) !important;
  transition: all 0.2s ease;
}
.card:hover {
  box-shadow: var(--shadow-md) !important;
  transform: translateY(-1px);
}
.card-header {
  background-color: var(--muted) !important;
  color: var(--muted-foreground) !important;
  border-bottom: 1px solid var(--border) !important;
  font-weight: 600;
}
.card-body { color: var(--card-foreground) !important; }
.card-footer {
  background-color: var(--muted) !important;
  border-top: 1px solid var(--border) !important;
}

/* Buttons */
.btn {
  border-radius: var(--radius) !important;
  font-weight: 500;
  transition: all 0.2s ease;
}
.btn-primary {
  background-color: var(--primary) !important;
  color: var(--primary-foreground) !important;
  border-color: var(--primary) !important;
}
.btn-primary:hover {
  background-color: var(--accent) !important;
  color: var(--accent-foreground) !important;
  border-color: var(--accent) !important;
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}
.btn-secondary {
  background-color: var(--secondary) !important;
  color: var(--secondary-foreground) !important;
  border-color: var(--secondary) !important;
}
.btn-success {
  background-color: var(--success) !important;
  color: var(--success-foreground) !important;
  border-color: var(--success) !important;
}
.btn-danger {
  background-color: var(--destructive) !important;
  color: var(--destructive-foreground) !important;
  border-color: var(--destructive) !important;
}
.btn-warning {
  background-color: var(--warning) !important;
  color: var(--warning-foreground) !important;
  border-color: var(--warning) !important;
}
.btn-info {
  background-color: var(--info) !important;
  color: var(--info-foreground) !important;
  border-color: var(--info) !important;
}

/* Form Controls */
.form-control, .form-select {
  background-color: var(--background) !important;
  color: var(--foreground) !important;
  border: 1px solid var(--input) !important;
  border-radius: var(--radius) !important;
  transition: all 0.2s ease;
}
.form-control:focus, .form-select:focus {
  border-color: var(--ring) !important;
  box-shadow: 0 0 0 2px rgba(237,137,54,0.2) !important;
}

/* Tables */
.table {
  color: var(--foreground) !important;
}
.table > :not(caption) > * > * {
  border-bottom-color: var(--border) !important;
}
.table-striped > tbody > tr:nth-of-type(odd) > td,
.table-striped > tbody > tr:nth-of-type(odd) > th {
  background-color: var(--muted) !important;
}
.table-hover > tbody > tr:hover > td,
.table-hover > tbody > tr:hover > th {
  background-color: var(--accent) !important;
}

/* Modals */
.modal-content {
  background-color: var(--card) !important;
  color: var(--card-foreground) !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius-lg) !important;
  box-shadow: var(--shadow-xl) !important;
}
.modal-header { border-bottom: 1px solid var(--border) !important; }
.modal-footer { border-top: 1px solid var(--border) !important; }

/* Alerts */
.alert {
  border-radius: var(--radius) !important;
  border: 1px solid transparent;
}
.alert-success {
  background-color: rgba(16,185,129,0.1) !important;
  color: var(--success) !important;
  border-color: var(--success) !important;
}
.alert-danger {
  background-color: rgba(239,68,68,0.1) !important;
  color: var(--destructive) !important;
  border-color: var(--destructive) !important;
}
.alert-warning {
  background-color: rgba(245,158,11,0.1) !important;
  color: var(--warning) !important;
  border-color: var(--warning) !important;
}
.alert-info {
  background-color: rgba(59,130,246,0.1) !important;
  color: var(--info) !important;
  border-color: var(--info) !important;
}

/* Badges */
.badge {
  border-radius: var(--radius-sm) !important;
  font-weight: 500;
}
.badge.bg-primary { background-color: var(--primary) !important; color: var(--primary-foreground) !important; }
.badge.bg-success { background-color: var(--success) !important; color: var(--success-foreground) !important; }
.badge.bg-danger  { background-color: var(--destructive) !important; color: var(--destructive-foreground) !important; }

/* Dropdowns */
.dropdown-menu {
  background-color: var(--popover) !important;
  color: var(--popover-foreground) !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius-lg) !important;
  box-shadow: var(--shadow-lg) !important;
}
.dropdown-item:hover, .dropdown-item:focus {
  background-color: var(--accent) !important;
  color: var(--accent-foreground) !important;
}

/* Header section for all pages */
.header-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 1.5rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
}

.dashboard-title {
    color: var(--foreground);
    font-size: 1.75rem;
    font-weight: 700;
    display: flex;
    align-items: center;
}

.dashboard-title i {
    color: var(--primary);
}

/* Main wrapper for all content */
.main-wrapper {
    flex: 1;
    padding: 1.5rem;
    overflow: hidden;
}

.main-content-container {
    /* Same visual properties as header/sidebar */
    background: var(--sidebar); 
    border: 1px solid var(--sidebar-border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(12px);
    
    /* Layout properties */
    height: 100%;
    padding: 2rem;
    overflow-y: auto;
    overflow-x: hidden;
    
    /* Smooth transitions like header/sidebar */
    transition: background-color 0.2s, border-color 0.2s;
    color: var(--sidebar-foreground);
}


/* Custom Scrollbars */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--muted); border-radius: var(--radius-sm); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: var(--radius-sm); }
::-webkit-scrollbar-thumb:hover { background: var(--muted-foreground); }

/* Dark Mode Transitions */
* {
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
