/* ==========================================================================
   main.css – ENHANCED GLASS-MORPHISM + FIXED SIDEBAR + GLOBAL THEME CONTROL
   ========================================================================== */

/* -------------------------------
   ROOT VARIABLES – GLOBAL THEME
   ------------------------------- */
   :root {
    /* Core Colors */
    --bg: #f0f4ff;
    --text: #0f172a;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --card: #ffffff;
    
    /* Brand Colors */
    --primary: #6f5ce6;
    --primary-light: #8b5cf6;
    --primary-dark: #4834d4;
    --secondary: #7209b7;
    --accent: #6f5ce6;
    --accent-2: #4834d4;
    
    /* Status Colors */
    --success: #10b981;
    --success-dark: #059669;
    --danger: #ef4444;
    --danger-dark: #dc2626;
    --warning: #f59e0b;
    --warning-dark: #d97706;
    --info: #3b82f6;
    --info-dark: #2563eb;
    
    /* Glass Effects */
    --glass: rgba(255, 255, 255, 0.65);
    --glass-dark: rgba(15, 23, 42, 0.75);
    --glass-border: rgba(255, 255, 255, 0.6);
    --glass-blur: blur(12px);
    
    /* Layout */
    --header-h: 68px;
    --sidebar-w: 220px;
    --content-top: 169px;
    --radius: 10px;
    --radius-sm: 8px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    
    /* Shadows */
    --shadow-sm: 0 2px 2px rgba(204, 204, 204, 0.213);
    --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.12);
    --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.18);
    --shadow-hover: 0 12px 35px rgba(0, 0, 0, 0.2);
    
    /* Transitions */
    --transition: all 0.32s cubic-bezier(0.2, 0.9, 0.3, 1);
    --transition-fast: all 0.15s ease;
    --transition-slow: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    
    /* Gradients */
    --bg-gradient: linear-gradient(135deg, #f5f3ff 0%, #dfdbef 100%);
    --primary-gradient: linear-gradient(135deg, #4361ee 0%, #3a0ca3 100%);
    
    /* Typography */
    --font: 'Inter', 'Roboto', system-ui, -apple-system, sans-serif;
  }
  
  .dark-mode {
    /* Background and Glass Variables - NEUTRAL DARK */
    --bg-gradient: linear-gradient(
      135deg,
      #0f172a 0%,  /* slate-900 */
      #1e293b 50%, /* slate-800 */
      #334155 100% /* slate-700 */
    );
    --bg: #0f172a;
    
    /* Color Variables */
    --card: #1e293b;
    --text: #f8fafc;
    --text-muted: #94a3b8;
    --border: #334155;
    
    /* Brand Colors - Adjusted for dark mode */
    --primary: #8b5cf6;
    --primary-light: #a78bfa;
    --primary-dark: #7c3aed;
    --accent: #8b5cf6;
    --accent-2: #7c3aed;
    
    /* Status Colors - Adjusted for dark mode */
    --success: #34d399;
    --success-dark: #10b981;
    --danger: #f87171;
    --danger-dark: #ef4444;
    --warning: #fbbf24;
    --warning-dark: #f59e0b;
    --info: #60a5fa;
    --info-dark: #3b82f6;
    
    /* Glass Effects */
    --glass: rgba(30, 41, 59, 0.95);
    --glass-dark: rgba(15, 23, 42, 0.85);
    --glass-border: rgba(255, 255, 255, 0.12);
    
    /* Shadows */
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.6);
    --shadow-hover: 0 12px 35px rgba(0, 0, 0, 0.7);
  }
  /* -------------------------------
     GLOBAL RESET & BASE
     ------------------------------- */
  *, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
  }
  
  html {
    font-family: var(--font);
    font-size: 16px;
    scroll-behavior: smooth;
  }
  
  body {
    background: var(--bg-gradient);
    background-attachment: fixed;
    color: var(--text);
    min-height: 100vh;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    opacity: 0;
    transform: translateY(6px);
    transition: opacity var(--transition), transform var(--transition), background 0.5s ease;
    transform: translateZ(0);
    backface-visibility: hidden;
  }
  
  body.loaded {
    opacity: 1;
    transform: none;
  }
  
  /* Hardware Acceleration */
  .site-header,
  .sidebar,
  .metric-card,
  .btn {
    transform: translateZ(0);
    backface-visibility: hidden;
    perspective: 1000;
  }
  
  /* -------------------------------
     Header
     ------------------------------- */
  .site-header {
    height: var(--header-h);
    background: var(--glass);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    box-shadow: var(--shadow-sm);
    isolation: isolate;
    transition: background-color 0.3s ease, border-color 0.3s ease;
  }
  
  .dark-mode .site-header {
    background: var(--glass-dark);
    border-bottom-color: rgba(255, 255, 255, 0.08);
  }
  
  .site-header-inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    gap: 0.75rem;
  }
  
  .brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 700;
    font-size: 1.4rem;
    color: var(--text);
    text-decoration: none;
  }
  
  .brand i {
    color: var(--accent);
    font-size: 1.5rem;
    animation: float 6s ease-in-out infinite;
  }
  
  .logo-img {
    height: 62px;
    width: auto;
    display: block;
    background-color: transparent !important;
  }
  
  /* -------------------------------
     Toggles
     ------------------------------- */
  .theme-toggle {
    font-size: 1.5rem;
    background: none;
    border: none;
    cursor: pointer;
    position: relative;
    width: 2rem;
    height: 2rem;
    color: var(--text);
    transition: transform 0.3s ease;
  }
  
  .theme-toggle i {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    text-align: center;
    line-height: 2rem;
    transition: transform 0.5s ease, opacity 0.5s ease;
  }
  
  /* Default Light Mode */
  body:not(.dark-mode) .theme-toggle .light-icon {
    opacity: 1;
    transform: rotate(0deg) scale(1);
  }
  body:not(.dark-mode) .theme-toggle .dark-icon {
    opacity: 0;
    transform: rotate(-90deg) scale(0);
  }
  
  /* Dark Mode */
  body.dark-mode .theme-toggle .light-icon {
    opacity: 0;
    transform: rotate(90deg) scale(0);
  }
  body.dark-mode .theme-toggle .dark-icon {
    opacity: 1;
    transform: rotate(0deg) scale(1);
  }
  
  .theme-toggle:hover {
    transform: scale(1.2);
  }
  
  .theme-toggle:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
  }
  
  .mobile-toggle {
    display: none;
    background: transparent;
    border: none;
    font-size: 1.5rem;
    color: var(--text);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: var(--radius-sm);
    transition: var(--transition);
  }
  
  .mobile-toggle:hover {
    background: rgba(0,0,0,0.05);
    transform: scale(1.1);
  }
  
  .dark-mode .mobile-toggle:hover {
    background: rgba(255,255,255,0.1);
  }
  
  .mobile-toggle:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
  }
  
  /* -------------------------------
     Layout
     ------------------------------- */
  .layout {
    display: flex;
    gap: 1.5rem;
    max-width: 1280px;
    margin: 0 auto;
    padding: var(--content-top) 1rem 2rem;
    min-height: calc(100vh - var(--header-h));
  }
  
  /* -------------------------------
     Sidebar
     ------------------------------- */
  .sidebar {
    width: var(--sidebar-w);
    flex: 0 0 var(--sidebar-w);
    background: var(--glass);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    padding: 1.5rem;
    box-shadow: var(--shadow-md);
    position: fixed;
    top: var(--header-h);
    left: 0;
    height: calc(100vh - var(--header-h));
    overflow-y: auto;
    border-right: 1px solid var(--glass-border);
    border-radius: 0;
    z-index: 1001;
    transition: transform 0.3s ease, opacity 0.3s ease, background-color 0.3s ease;
    isolation: isolate;
  }
  
  .dark-mode .sidebar {
    background: var(--glass-dark);
  }
  
  .main {
    flex: 1;
    margin-left: var(--sidebar-w);
  }
  
  /* -------------------------------
     Overlay
     ------------------------------- */
  .sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.25);
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
  }
  
  .sidebar-overlay.active {
    opacity: 1;
    pointer-events: auto;
  }
  
  /* -------------------------------
     Profile & Nav
     ------------------------------- */
  .profile {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
  }
  
  .avatar {
    width: 48px;
    height: 48px;
    background: var(--primary-gradient);
    color: white;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.1rem;
    box-shadow: 0 4px 12px rgba(111, 92, 230, 0.3);
    position: relative;
    overflow: hidden;
  }
  
  .avatar::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transform: rotate(45deg);
    transition: var(--transition-slow);
  }
  
  .profile:hover .avatar::after {
    transform: rotate(45deg) translate(50%, 50%);
  }
  
  .profile-info .name { font-weight: 600; }
  .profile-info .role { font-size: 0.8rem; color: var(--text-muted); }
  
  .nav-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
  }
  
  .nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    color: var(--text);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
  }
  
  .nav-link i { width: 20px; text-align: center; color: var(--accent); transition: var(--transition); }
  
  .nav-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--accent);
    transform: scaleY(0);
    transition: transform 0.3s ease;
  }
  
  .nav-link:hover {
    background: rgba(111, 92, 230, 0.1);
    transform: translateX(4px);
  }
  
  .nav-link:hover i { transform: scale(1.2); }
  
  .nav-link.active {
    background: linear-gradient(90deg, var(--accent), var(--accent-2));
    color: white;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(111, 92, 230, 0.3);
  }
  
  .nav-link.active i { color: white; }
  .nav-link.active::before { transform: scaleY(1); }
  
  .nav-link.logout {
    background: linear-gradient(90deg, #ff6b6b, #d63031);
    color: white;
    margin-top: 1rem;
  }
  
  .nav-link:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
  }
  
  /* Scrollbar */
  .sidebar::-webkit-scrollbar { width: 6px; }
  .sidebar::-webkit-scrollbar-track { background: transparent; }
  .sidebar::-webkit-scrollbar-thumb {
    background: rgba(0,0,0,0.2);
    border-radius: 3px;
  }
  .dark-mode .sidebar::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.2);
  }
  
  /* -------------------------------
     DASHBOARD ENHANCEMENTS
     ------------------------------- */
  .dashboard-container {
    display: flex;
    min-height: 100vh;
    background: var(--bg);
    position: relative;
  }
  
  .main-content {
    flex: 1;
    max-width: 1400px;
    padding: var(--space-xl);
    margin: 0 auto;
    width: 100%;
    position: relative;
  }
  
  .main-content::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 300px;
    opacity: 0.03;
    z-index: -1;
    pointer-events: none;
  }
  
  /* Enhanced Header */
  .header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 2rem;
    background: var(--glass);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    border: 1px solid var(--glass-border);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
  }
  
  .header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--primary-gradient);
    opacity: 0;
    transition: var(--transition);
  }
  
  .header:hover {
    box-shadow: var(--shadow-hover);
    transform: translateY(-2px);
  }
  
  .header:hover::before {
    opacity: 1;
  }
  
  .header-title h1 {
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    font-weight: 800;
    color: var(--text);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
  }
  
  .header-title p {
    color: var(--text-muted);
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.25rem;
    font-weight: 500;
  }
  
  /* Enhanced User Profile */
  .user-profile {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.5rem;
    background: var(--card);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
  }
  
  .user-profile::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(67, 97, 238, 0.1), transparent);
    transition: var(--transition-slow);
  }
  
  .user-profile:hover::before {
    left: 100%;
  }
  
  .user-profile:hover {
    background: var(--bg);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
  }
  
  .profile-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
  }
  
  /* Enhanced Metrics Grid */
  .metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
  }
  
  .metric-card {
    background: var(--glass);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    border: 1px solid var(--glass-border);
    cursor: pointer;
  }
  
  .metric-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--primary-gradient);
    transform: scaleX(0);
    transition: var(--transition);
  }
  
  .metric-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-hover);
  }
  
  .metric-card:hover::before {
    transform: scaleX(1);
  }
  
  /* Enhanced Card Header */
  .card-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
  }
  
  .card-icon {
    width: 56px;
    height: 56px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
    position: relative;
    overflow: hidden;
  }
  
  .card-icon::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transform: rotate(45deg);
    transition: var(--transition-slow);
  }
  
  .metric-card:hover .card-icon::before {
    transform: rotate(45deg) translate(50%, 50%);
  }
  
  .metric-card.primary .card-icon {
    background: var(--primary-gradient);
  }
  
  .metric-card.success .card-icon {
    background: linear-gradient(135deg, var(--success), var(--success-dark));
  }
  
  .metric-card.warning .card-icon {
    background: linear-gradient(135deg, var(--warning), var(--warning-dark));
  }
  
  .metric-card.info .card-icon {
    background: linear-gradient(135deg, var(--info), var(--info-dark));
  }
  
  .card-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-muted);
    margin: 0;
    flex: 1;
  }
  
  /* Enhanced Metric Values */
  .metric-value {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--text);
    margin-bottom: 0.5rem;
    line-height: 1;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
  }
  
  .metric-trend {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-weight: 600;
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
    border: 1px solid rgba(16, 185, 129, 0.2);
  }
  
  .metric-trend.down {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.2);
  }
  
  .metric-details {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 1rem;
  }
  
  .metric-details p {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
    font-size: 0.95rem;
    color: var(--text-muted);
    transition: var(--transition);
  }
  
  .metric-card:hover .metric-details p {
    color: var(--text);
  }
  
  .metric-details i {
    color: var(--primary);
    width: 16px;
    transition: var(--transition);
  }
  
  .metric-card:hover .metric-details i {
    transform: scale(1.2);
  }
  
  /* Dashboard Grid */
  .dashboard-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1.5rem;
  }
  
  .left-column,
  .right-column {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
  }
  
  /* Enhanced Section Cards */
  .appointments-section,
  .notifications,
  .performance-metrics,
  .messages-card,
  .delivery-health,
  .chart-card {
    background: var(--glass);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--glass-border);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
  }
  
  .appointments-section::before,
  .notifications::before,
  .performance-metrics::before,
  .messages-card::before,
  .delivery-health::before,
  .chart-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--primary-gradient);
    opacity: 0;
    transition: var(--transition);
  }
  
  .appointments-section:hover::before,
  .notifications:hover::before,
  .performance-metrics:hover::before,
  .messages-card:hover::before,
  .delivery-health:hover::before,
  .chart-card:hover::before {
    opacity: 1;
  }
  
  .appointments-section:hover,
  .notifications:hover,
  .performance-metrics:hover,
  .messages-card:hover,
  .delivery-health:hover,
  .chart-card:hover {
    box-shadow: var(--shadow-hover);
    transform: translateY(-2px);
  }
  .alert-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 9999;
  }
  .alert {
    background: #fef3c7; /* light yellow for warnings */
    color: #92400e;
    border: 1px solid #fcd34d;
    margin-bottom: 0.5rem;
  }
  .alert.success { background: #d1fae5; color: #065f46; }
  .alert.error { background: #fee2e2; color: #991b1b; }
  .alert.info { background: #e0f2fe; color: #0369a1; }
  
  /* Enhanced Section Headers */
  .section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
  }
  
  .section-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
  }
  
  .section-title i {
    color: var(--primary);
    font-size: 1.1em;
  }
  
  .section-actions {
    display: flex;
    gap: 0.5rem;
  }
  
  /* -------------------------------
     GLOBAL BUTTONS
     ------------------------------- */
  .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    min-height: 48px;
    min-width: 120px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 1rem;
    text-decoration: none;
    border: none;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    cursor: pointer;
    white-space: nowrap;
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
    line-height: 1.4;
  }
  
  .btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: var(--transition-slow);
  }
  
  .btn:hover::before {
    left: 100%;
  }
  
  /* Button Variants */
  .btn-primary {
    background: var(--primary-gradient);
    color: white;
    box-shadow: 0 6px 20px rgba(67, 97, 238, 0.3);
  }
  
  .btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(67, 97, 238, 0.4);
  }
  
  .btn-success {
    background: linear-gradient(135deg, var(--success), var(--success-dark));
    color: white;
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.3);
  }
  
  .btn-success:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(16, 185, 129, 0.4);
  }
  
  .btn-warning {
    background: linear-gradient(135deg, var(--warning), var(--warning-dark));
    color: white;
    box-shadow: 0 6px 20px rgba(245, 158, 11, 0.3);
  }
  
  .btn-warning:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(245, 158, 11, 0.4);
  }
  
  .btn-danger {
    background: linear-gradient(135deg, var(--danger), var(--danger-dark));
    color: white;
    box-shadow: 0 6px 20px rgba(239, 68, 68, 0.3);
  }
  
  .btn-danger:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(239, 68, 68, 0.4);
  }
  
  .btn-outline {
    background: transparent;
    border: 1.5px solid var(--accent);
    color: var(--accent);
  }
  
  .btn-outline:hover {
    background: var(--accent);
    color: white;
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(111, 92, 230, 0.35);
  }
  
  .btn-secondary {
    background: #94a3b8;
    color: white;
  }
  
  .btn-secondary:hover {
    background: #64748b;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(100, 116, 139, 0.3);
  }
  
  .btn-view {
    background: transparent;
    color: #2f2f2f;
    min-width: auto;
    padding: 0.45rem 0.9rem;
    font-size: 0.85rem;
    min-height: 36px;
    box-shadow: none;
    border: none;
  }
  
  .btn-view:hover {
    color: var(--success);
    transform: translateY(-3px);
  }
  
  .dark-mode .btn-view {
    color: #e2e8f0;
  }
  
  .dark-mode .btn-view:hover {
    color: var(--success);
  }
  
  .btn-sm {
    padding: 0.45rem 0.9rem;
    min-height: 36px;
    font-size: 0.85rem;
    min-width: auto;
  }
  
  .btn:disabled,
  .btn[disabled] {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: var(--shadow-sm) !important;
  }
  
  .btn:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
  }
  
  /* -------------------------------
     Footer
     ------------------------------- */
  .site-footer {
    background-color: #f8f9fa;
    color: #111827;
    width: 100%;
    padding: 1rem 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
  }
  
  .site-footer-inner {
    max-width: 1200px;
    width: 100%;
    text-align: center;
  }
  
  .dark-mode .site-footer {
    background: rgba(30, 41, 59, 0.85);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: #cbd5e1;
  }
  
  /* -------------------------------
     Cookie Banner
     ------------------------------- */
  /* static/css/cookie-banner.css */
.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid #e5e7eb;
  padding: 1.25rem 1rem;
  z-index: 9999;
  box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.08);
  font-family: 'Inter', system-ui, sans-serif;
  transition: transform 0.3s ease;
  transform: translateY(100%);
}

.cookie-banner.visible {
  transform: translateY(0);
}

.cookie-content {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.95rem;
  color: #374151;
}

.cookie-content p {
  margin: 0;
  line-height: 1.5;
}

.cookie-content a {
  color: #10b981;
  font-weight: 600;
  text-decoration: underline;
}

.cookie-buttons {
  display: flex;
  gap: 0.75rem;
  flex-shrink: 0;
}

.cookie-buttons .btn {
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.cookie-buttons .btn-success {
  background: #10b981;
  color: white;
  border: none;
}

.cookie-buttons .btn-success:hover {
  background: #059669;
}

.cookie-buttons .btn-outline {
  background: transparent;
  color: #374151;
  border: 1.5px solid #d1d5db;
}

.cookie-buttons .btn-outline:hover {
  background: #f3f4f6;
  border-color: #9ca3af;
}

@media (max-width: 640px) {
  .cookie-content {
    flex-direction: column;
    text-align: center;
  }
  .cookie-buttons {
    width: 100%;
    justify-content: center;
  }
}
  
  /* -------------------------------
     Messages & Alerts
     ------------------------------- */
  .messages {
    max-width: 600px;
    margin: 1rem auto;
    z-index: 9999;
    position: fixed;
    top: 1rem;
    right: 1rem;
  }
  
  .message {
    padding: 0.75rem 1rem;
    margin-bottom: 0.5rem;
    border-radius: 8px;
    font-size: 0.95rem;
    opacity: 1;
    transition: opacity 0.6s ease, transform 0.3s ease;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
  }
  
  .message.success { background: #d1fae5; color: #065f46; }
  .message.error { background: #fee2e2; color: #991b1b; }
  .message.warning { background: #fffbeb; color: #92400e; }
  .message.info { background: #dbeafe; color: #1e40af; }
  
  .message.fade-out { opacity: 0; transform: translateY(-20px); }
  
  .delivery-alert {
    background: rgba(239, 68, 68, 0.1);
    border-bottom: 1px solid rgba(239, 68, 68, 0.2);
    font-size: 0.85rem;
  }
  
  .dark-mode .delivery-alert {
    background: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.4);
  }
  
  .trial-urgent {
    font-size: 0.8rem;
    border-bottom: 1px dashed #f59e0b;
  }
  
  .badge {
    font-size: 0.7rem;
    padding: 0.25em 0.5em;
    border-radius: 0.5rem;
    font-weight: 600;
  }
  
  /* -------------------------------
     Animations
     ------------------------------- */
  @keyframes float {
    0%,100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
  }
  
  @keyframes pulse {
    0%,100% { opacity: 1; }
    50% { opacity: 0.7; }
  }
  
  @keyframes shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
  }
  
  /* -------------------------------
     RESPONSIVE DESIGN
     ------------------------------- */
  
  /* Tablet (901px – 1024px) */
  @media (min-width: 901px) and (max-width: 1024px) {
    .sidebar {
      width: 200px;
      flex: 0 0 200px;
    }
    .main {
      margin-left: 200px;
    }
  }
  
  /* Mobile (max-width: 900px) */
  @media (max-width: 900px) {
    .layout {
      padding: calc(var(--header-h) + 1rem) 1rem 2rem;
      flex-direction: column;
    }
    
    .main {
      margin-left: 0;
    }
    
    .sidebar {
      position: fixed;
      top: var(--header-h);
      left: 0;
      width: min(85vw, 320px);
      max-width: 320px;
      height: calc(100vh - var(--header-h));
      border-radius: 0 var(--radius) var(--radius) 0;
      transform: translateX(-105%);
      opacity: 0;
      pointer-events: none;
      transition: transform 0.32s ease, opacity 0.32s ease;
    }
    
    .sidebar.open {
      transform: translateX(0);
      opacity: 1;
      pointer-events: auto;
    }
    
    .mobile-toggle {
      display: inline-flex;
    }
    
    .metrics-grid {
      grid-template-columns: 1fr;
      gap: 1rem;
    }
    
    .dashboard-grid {
      grid-template-columns: 1fr;
      gap: 1rem;
    }
    
    .header {
      flex-direction: column;
      gap: 1rem;
      text-align: center;
    }
    
    .user-profile {
      flex-direction: column;
      text-align: center;
      width: 100%;
    }
    
    .profile-actions {
      flex-direction: column;
      width: 100%;
    }
    
    .profile-actions .btn {
      width: 100%;
      justify-content: center;
    }
  }
  
  /* Small Tablet (max-width: 768px) */
  @media (max-width: 768px) {
    .site-header-inner {
      padding: 0 0.75rem;
    }
    
    .brand {
      font-size: 1.2rem;
    }
    
    .logo-img {
      height: 52px;
    }
    
    .sidebar {
      width: min(80vw, 300px);
      max-width: 300px;
    }
    
    .site-footer {
      padding: 1rem;
    }
  }
  
  /* Mobile Small (max-width: 480px) */
  @media (max-width: 480px) {
    .sidebar {
      width: 100vw;
      max-width: none;
      border-radius: 0;
      border-right: none;
    }
    
    .btn {
      width: 100%;
      min-width: 0;
    }
    
    .site-footer {
      padding: 0.75rem;
      font-size: 0.8rem;
    }
    
    .header-title h1 {
      font-size: 1.5rem;
    }
  }
  
  /* -------------------------------
     ACCESSIBILITY & PERFORMANCE
     ------------------------------- */
  
  /* Reduced motion */
  @media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
      animation: none !important;
      transition: none !important;
    }
    
    .metric-card:hover,
    .btn:hover,
    .nav-link:hover {
      transform: none;
    }
    
    .avatar::after,
    .card-icon::before,
    .btn::before {
      display: none;
    }
  }
  
  /* High contrast */
  @media (prefers-contrast: high) {
    :root {
      --glass: var(--card);
      --glass-border: var(--border);
    }
    
    .site-header,
    .sidebar {
      backdrop-filter: none;
      -webkit-backdrop-filter: none;
      background: var(--card);
    }
    
    .metric-card,
    .appointments-section,
    .notifications,
    .performance-metrics,
    .messages-card,
    .delivery-health,
    .chart-card {
      border: 2px solid var(--border);
    }
  }
  
  /* Low performance devices */
  @media (prefers-reduced-motion: reduce), (update: slow) {
    .site-header,
    .sidebar {
      backdrop-filter: blur(4px);
      -webkit-backdrop-filter: blur(4px);
    }
  }
  
  /* Desktop layout for cookie banner */
  @media (min-width: 768px) {
    #cookie-banner .container {
      flex-direction: row;
      justify-content: space-between;
      text-align: left;
    }
  }
  
  /* Table responsive */
  @media (max-width: 580px) {
    .table-wrapper {
      overflow-x: auto;
    }
  }