/* ===================================
   Guide City Management System
   Professional Theme System
   =================================== */

/* ===================================
   CSS Custom Properties (Light Theme - Default)
   =================================== */
:root {
    /* Primary Brand Colors */
    --guide-primary: #3b82f6;
    --guide-primary-hover: #2563eb;
    --guide-primary-light: #dbeafe;
    --guide-primary-dark: #1d4ed8;
    
    /* Secondary Colors */
    --guide-secondary: #64748b;
    --guide-secondary-hover: #475569;
    --guide-secondary-light: #f1f5f9;
    
    /* Semantic Colors */
    --guide-success: #10b981;
    --guide-success-light: #d1fae5;
    --guide-warning: #f59e0b;
    --guide-warning-light: #fef3c7;
    --guide-danger: #ef4444;
    --guide-danger-light: #fee2e2;
    --guide-info: #06b6d4;
    --guide-info-light: #cffafe;
    
    /* Background Colors */
    --bg-body: #f8fafc;
    --bg-surface: #ffffff;
    --bg-surface-hover: #f1f5f9;
    --bg-surface-secondary: #f8fafc;
    --bg-elevated: #ffffff;
    --bg-overlay: rgba(0, 0, 0, 0.5);
    
    /* Text Colors */
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --text-inverse: #ffffff;
    --text-link: var(--guide-primary);
    --text-link-hover: var(--guide-primary-hover);
    
    /* Border Colors */
    --border-color: #e2e8f0;
    --border-color-strong: #cbd5e1;
    --border-color-light: #f1f5f9;
    
    /* Shadow */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    --shadow-glow: 0 0 20px rgba(59, 130, 246, 0.3);
    
    /* Navbar */
    --navbar-bg: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    --navbar-text: #ffffff;
    --navbar-link: rgba(255, 255, 255, 0.85);
    --navbar-link-hover: #ffffff;
    
    /* Sidebar */
    --sidebar-bg: #ffffff;
    --sidebar-border: var(--border-color);
    
    /* Input */
    --input-bg: #ffffff;
    --input-border: #e2e8f0;
    --input-focus-border: var(--guide-primary);
    --input-focus-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
    
    /* Card */
    --card-bg: #ffffff;
    --card-border: transparent;
    --card-header-bg: transparent;
    --card-header-border: var(--border-color-light);
    
    /* Table */
    --table-header-bg: #f8fafc;
    --table-row-hover: #f1f5f9;
    --table-border: var(--border-color-light);
    
    /* Scrollbar */
    --scrollbar-track: #f1f5f9;
    --scrollbar-thumb: #cbd5e1;
    --scrollbar-thumb-hover: #94a3b8;
    
    /* Citizen-alias vars (so --c-* works in admin layout too) */
    --c-accent: #2563eb;
    --c-accent-hover: #1d4ed8;
    --c-accent-light: #dbeafe;
    --c-accent-subtle: rgba(37, 99, 235, 0.08);
    --c-bg: #f8fafc;
    --c-surface: #ffffff;
    --c-surface-hover: #f1f5f9;
    --c-surface-secondary: #f1f5f9;
    --c-border: #e2e8f0;
    --c-border-light: #f1f5f9;
    --c-text: #0f172a;
    --c-text-secondary: #475569;
    --c-text-muted: #94a3b8;
    --c-shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
    --c-shadow-md: 0 4px 12px rgba(0,0,0,0.08);
    --c-shadow-lg: 0 8px 30px rgba(0,0,0,0.1);
    --c-radius: 12px;
    --c-radius-lg: 16px;
    --c-radius-full: 9999px;
    --c-nav-height: 60px;
    
    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-normal: 250ms ease;
    --transition-slow: 350ms ease;
    
    /* Border Radius */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;
}

/* ===================================
   Dark Theme
   =================================== */
[data-theme="dark"] {
    /* Primary Brand Colors */
    --guide-primary: #D17842;
    --guide-primary-hover: #BE6A3A;
    --guide-primary-light: #2a1f16;
    --guide-primary-dark: #E8956A;
    
    /* Secondary Colors */
    --guide-secondary: #8A8D92;
    --guide-secondary-hover: #AEAEAE;
    --guide-secondary-light: #1C2028;
    
    /* Semantic Colors */
    --guide-success: #34d399;
    --guide-success-light: #0a261a;
    --guide-warning: #fbbf24;
    --guide-warning-light: #2a1f0a;
    --guide-danger: #f87171;
    --guide-danger-light: #2a0f0f;
    --guide-info: #22d3ee;
    --guide-info-light: #0a1f26;
    
    /* Background Colors */
    --bg-body: #0C0F14;
    --bg-surface: #141921;
    --bg-surface-hover: #1C2028;
    --bg-surface-secondary: #111518;
    --bg-elevated: #1C2028;
    --bg-overlay: rgba(0, 0, 0, 0.75);
    
    /* Text Colors */
    --text-primary: #FFFFFF;
    --text-secondary: #AEAEAE;
    --text-muted: #52555A;
    --text-inverse: #0C0F14;
    --text-link: var(--guide-primary);
    --text-link-hover: var(--guide-primary-hover);
    
    /* Border Colors */
    --border-color: #21262E;
    --border-color-strong: #2E3440;
    --border-color-light: #171B22;
    
    /* Shadow */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.5), 0 2px 4px -2px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5), 0 4px 6px -4px rgba(0, 0, 0, 0.4);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.5), 0 8px 10px -6px rgba(0, 0, 0, 0.4);
    --shadow-glow: 0 0 20px rgba(209, 120, 66, 0.25);
    
    /* Navbar */
    --navbar-bg: linear-gradient(135deg, #141921 0%, #0C0F14 100%);
    --navbar-text: #FFFFFF;
    --navbar-link: rgba(255, 255, 255, 0.75);
    --navbar-link-hover: #D17842;
    
    /* Sidebar */
    --sidebar-bg: #141921;
    --sidebar-border: var(--border-color);
    
    /* Input */
    --input-bg: #141921;
    --input-border: #21262E;
    --input-focus-border: #D17842;
    --input-focus-shadow: 0 0 0 3px rgba(209, 120, 66, 0.2);
    
    /* Card */
    --card-bg: #141921;
    --card-border: #21262E;
    --card-header-bg: transparent;
    --card-header-border: #21262E;
    
    /* Table */
    --table-header-bg: #1C2028;
    --table-row-hover: #1C2028;
    --table-border: #21262E;
    
    /* Scrollbar */
    --scrollbar-track: #0C0F14;
    --scrollbar-thumb: #21262E;
    --scrollbar-thumb-hover: #2E3440;
    
    /* Citizen-alias vars for admin layout dark mode */
    --c-accent: #D17842;
    --c-accent-hover: #BE6A3A;
    --c-accent-light: rgba(209, 120, 66, 0.15);
    --c-accent-subtle: rgba(209, 120, 66, 0.08);
    --c-bg: #0C0F14;
    --c-surface: #141921;
    --c-surface-hover: #1C2028;
    --c-surface-secondary: #111518;
    --c-border: #21262E;
    --c-border-light: #171B22;
    --c-text: #FFFFFF;
    --c-text-secondary: #AEAEAE;
    --c-text-muted: #52555A;
    --c-shadow-sm: 0 1px 3px rgba(0,0,0,0.4);
    --c-shadow-md: 0 4px 12px rgba(0,0,0,0.5);
    --c-shadow-lg: 0 8px 30px rgba(0,0,0,0.6);
    --c-radius: 12px;
    --c-radius-lg: 16px;
    --c-radius-full: 9999px;
    --c-nav-height: 60px;
}

/* ===================================
   Base Styles
   =================================== */
*, *::before, *::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

html, body {
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-body);
    color: var(--text-primary);
    transition: background-color var(--transition-normal), color var(--transition-normal);
    line-height: 1.6;
    min-height: 100vh;
}

a {
    color: var(--text-link);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--text-link-hover);
}

/* ===================================
   Typography — Modern compact scale (X / Facebook style)
   =================================== */
body {
    font-size: 14px;
}

h1, h2, h3, h4, h5, h6 {
    color: var(--text-primary);
    font-weight: 600;
    line-height: 1.3;
}

h1 { font-size: 1.35rem; } /* ~19px */
h2 { font-size: 1.25rem; } /* ~17.5px */
h3 { font-size: 1.1rem; }  /* ~15.4px */
h4 { font-size: 1rem; }    /* 14px */
h5 { font-size: 0.92rem; } /* ~13px */
h6 { font-size: 0.85rem; } /* ~12px */

/* Tame Bootstrap display-* classes for headings */
.display-1 { font-size: 2.5rem; }
.display-2 { font-size: 2rem; }
.display-3 { font-size: 1.75rem; }
.display-4 { font-size: 1.5rem; }
.display-5 { font-size: 1.25rem; }
.display-6 { font-size: 1.1rem; }

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

.text-muted {
    color: var(--text-muted) !important;
}

.text-secondary {
    color: var(--text-secondary) !important;
}

/* Compact form controls */
.form-control, .form-select {
    font-size: 0.875rem;
}

.btn {
    font-size: 0.875rem;
}

/* Compact table text */
.table {
    font-size: 0.875rem;
}

/* Compact modal titles */
.modal-title {
    font-size: 1.05rem;
}

/* Bootstrap utility dark mode overrides */
[data-theme="dark"] .bg-light {
    background-color: var(--bg-surface-hover) !important;
}

[data-theme="dark"] .bg-white {
    background-color: var(--bg-surface) !important;
}

[data-theme="dark"] .border-bottom {
    border-color: var(--border-color) !important;
}

[data-theme="dark"] .border-top {
    border-color: var(--border-color) !important;
}

[data-theme="dark"] .shadow-sm {
    box-shadow: var(--shadow-sm) !important;
}

[data-theme="dark"] .text-dark {
    color: var(--text-primary) !important;
}

[data-theme="dark"] .text-muted {
    color: var(--text-muted) !important;
}

[data-theme="dark"] .table-light {
    --bs-table-bg: var(--table-header-bg) !important;
    --bs-table-color: var(--text-secondary) !important;
    background-color: var(--table-header-bg) !important;
    color: var(--text-secondary) !important;
}

[data-theme="dark"] .table-light th {
    background-color: var(--table-header-bg) !important;
    color: var(--text-secondary) !important;
}

[data-theme="dark"] .text-body {
    color: var(--text-primary) !important;
}

[data-theme="dark"] .card {
    background-color: var(--card-bg);
    border-color: var(--card-border);
}

[data-theme="dark"] .form-control,
[data-theme="dark"] .form-select {
    background-color: var(--input-bg);
    border-color: var(--input-border);
    color: var(--text-primary);
}

[data-theme="dark"] .form-control:focus,
[data-theme="dark"] .form-select:focus {
    background-color: var(--input-bg);
    border-color: var(--input-focus-border);
    color: var(--text-primary);
    box-shadow: var(--input-focus-shadow);
}

[data-theme="dark"] .form-label {
    color: var(--text-secondary);
}

[data-theme="dark"] .btn-outline-secondary {
    color: var(--text-secondary);
    border-color: var(--border-color);
}

[data-theme="dark"] .btn-outline-secondary:hover {
    background-color: var(--bg-surface-hover);
    color: var(--text-primary);
    border-color: var(--border-color-strong);
}

/* ===================================
   Navbar
   =================================== */
.navbar {
    background: var(--navbar-bg);
    box-shadow: var(--shadow-lg);
    padding: 0.75rem 1rem;
    position: sticky;
    top: 0;
    z-index: 1030;
    backdrop-filter: blur(10px);
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.5rem;
    color: var(--navbar-text) !important;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.navbar-brand i {
    font-size: 1.75rem;
}

.navbar-nav .nav-link {
    color: var(--navbar-link) !important;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.navbar-nav .nav-link:hover,
.navbar-nav .nav-link.active {
    color: var(--navbar-link-hover) !important;
    background: rgba(255, 255, 255, 0.1);
}

.navbar-toggler {
    border: none;
    padding: 0.5rem;
}

.navbar-toggler:focus {
    box-shadow: none;
}

.navbar-toggler-icon {
    filter: invert(1);
}

/* ===================================
   Theme Toggle Button
   =================================== */
.theme-toggle {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-full);
    color: var(--navbar-text);
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
    font-size: 1.1rem;
}

.theme-toggle:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(15deg);
}

.theme-toggle i {
    transition: transform var(--transition-normal);
}

[data-theme="dark"] .theme-toggle .bi-sun-fill {
    display: inline-block;
}

[data-theme="dark"] .theme-toggle .bi-moon-fill {
    display: none;
}

.theme-toggle .bi-sun-fill {
    display: none;
}

.theme-toggle .bi-moon-fill {
    display: inline-block;
}

/* ===================================
   Cards
   =================================== */
.card {
    background-color: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    transition: all var(--transition-normal);
    overflow: hidden;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
}

.card-header {
    background-color: var(--card-header-bg);
    border-bottom: 1px solid var(--card-header-border);
    padding: 1rem 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
}

.card-body {
    padding: 1.25rem;
    color: var(--text-primary);
}

.card-footer {
    background-color: var(--card-header-bg);
    border-top: 1px solid var(--card-header-border);
    padding: 1rem 1.25rem;
}

.card-title {
    color: var(--text-primary);
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.card-text {
    color: var(--text-secondary);
}

/* Feature Cards */
.feature-card {
    text-align: center;
    padding: 2rem;
}

.feature-card .feature-icon {
    width: 80px;
    height: 80px;
    border-radius: var(--radius-xl);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    font-size: 2rem;
    background: linear-gradient(135deg, var(--guide-primary-light) 0%, rgba(59, 130, 246, 0.1) 100%);
    color: var(--guide-primary);
}

[data-theme="dark"] .feature-card .feature-icon {
    background: linear-gradient(135deg, var(--guide-primary-light) 0%, rgba(96, 165, 250, 0.2) 100%);
}

/* Stat Cards */
.stat-card {
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 100px;
    height: 100px;
    background: linear-gradient(135deg, transparent 50%, rgba(59, 130, 246, 0.1) 100%);
    border-radius: 0 0 0 100%;
}

.stat-card .stat-icon {
    font-size: 2.5rem;
    opacity: 0.15;
    position: absolute;
    right: 1rem;
    top: 1rem;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
}

.stat-label {
    color: var(--text-secondary);
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ===================================
   Buttons
   =================================== */
.btn {
    border-radius: var(--radius-md);
    font-weight: 500;
    padding: 0.625rem 1.25rem;
    transition: all var(--transition-fast);
    border: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary {
    background: linear-gradient(135deg, var(--guide-primary) 0%, var(--guide-primary-dark) 100%);
    color: white;
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--guide-primary-hover) 0%, var(--guide-primary-dark) 100%);
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow);
    color: white;
}

.btn-secondary {
    background-color: var(--guide-secondary);
    color: white;
}

.btn-secondary:hover {
    background-color: var(--guide-secondary-hover);
    color: white;
}

.btn-success {
    background: linear-gradient(135deg, var(--guide-success) 0%, #059669 100%);
    color: white;
}

.btn-success:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    color: white;
}

.btn-danger {
    background: linear-gradient(135deg, var(--guide-danger) 0%, #dc2626 100%);
    color: white;
}

.btn-danger:hover {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    color: white;
}

.btn-warning {
    background: linear-gradient(135deg, var(--guide-warning) 0%, #d97706 100%);
    color: white;
}

.btn-info {
    background: linear-gradient(135deg, var(--guide-info) 0%, #0891b2 100%);
    color: white;
}

.btn-outline-primary {
    background: transparent;
    border: 2px solid var(--guide-primary);
    color: var(--guide-primary);
}

.btn-outline-primary:hover {
    background: var(--guide-primary);
    color: white;
}

.btn-outline-secondary {
    background: transparent;
    border: 2px solid var(--border-color-strong);
    color: var(--text-secondary);
}

.btn-outline-secondary:hover {
    background: var(--bg-surface-hover);
    border-color: var(--guide-secondary);
    color: var(--text-primary);
}

.btn-light {
    background: var(--bg-surface);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-light:hover {
    background: var(--bg-surface-hover);
    color: var(--text-primary);
}

.btn-link {
    background: none;
    color: var(--text-link);
    padding: 0;
}

.btn-link:hover {
    color: var(--text-link-hover);
    text-decoration: underline;
}

.btn-sm {
    padding: 0.375rem 0.875rem;
    font-size: 0.875rem;
}

.btn-lg {
    padding: 0.875rem 1.75rem;
    font-size: 1.125rem;
}

/* Icon Buttons */
.btn-icon {
    width: 40px;
    height: 40px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-full);
}

.btn-icon.btn-sm {
    width: 32px;
    height: 32px;
}

/* ===================================
   Forms
   =================================== */
.form-control,
.form-select {
    background-color: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    padding: 0.75rem 1rem;
    transition: all var(--transition-fast);
}

.form-control:focus,
.form-select:focus {
    background-color: var(--input-bg);
    border-color: var(--input-focus-border);
    box-shadow: var(--input-focus-shadow);
    color: var(--text-primary);
}

.form-control::placeholder {
    color: var(--text-muted);
}

.form-label {
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.form-text {
    color: var(--text-muted);
    font-size: 0.875rem;
}

.input-group-text {
    background-color: var(--bg-surface-secondary);
    border: 1px solid var(--input-border);
    color: var(--text-secondary);
}

/* Form floating labels */
.form-floating > .form-control,
.form-floating > .form-select {
    padding: 1rem 0.75rem;
}

.form-floating > label {
    color: var(--text-muted);
}

/* Checkboxes and Radios */
.form-check-input {
    background-color: var(--input-bg);
    border-color: var(--input-border);
}

.form-check-input:checked {
    background-color: var(--guide-primary);
    border-color: var(--guide-primary);
}

.form-check-input:focus {
    box-shadow: var(--input-focus-shadow);
    border-color: var(--guide-primary);
}

.form-check-label {
    color: var(--text-primary);
}

/* Form Validation */
.valid.modified:not([type=checkbox]) {
    border-color: var(--guide-success);
}

.invalid {
    border-color: var(--guide-danger);
}

.validation-message {
    color: var(--guide-danger);
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

/* ===================================
   Tables
   =================================== */
.table {
    --bs-table-bg: var(--card-bg);
    --bs-table-color: var(--text-primary);
    --bs-table-border-color: var(--table-border);
    --bs-table-hover-bg: var(--table-row-hover);
    --bs-table-hover-color: var(--text-primary);
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-bottom: 0;
}

.table thead th {
    background-color: var(--table-header-bg);
    color: var(--text-secondary);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
    padding: 1rem;
    border-bottom: 1px solid var(--table-border);
}

.table tbody td {
    padding: 1rem;
    vertical-align: middle;
    border-bottom: 1px solid var(--table-border);
}

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

.table-hover tbody tr:hover {
    background-color: var(--table-row-hover);
}

/* Table wrapper for responsiveness */
.table-responsive {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    overflow: hidden;
}

/* ===================================
   Badges
   =================================== */
.badge {
    font-weight: 500;
    padding: 0.5em 0.875em;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    letter-spacing: 0.3px;
}

.badge.bg-primary {
    background-color: var(--guide-primary) !important;
}

.badge.bg-secondary {
    background-color: var(--guide-secondary) !important;
}

.badge.bg-success {
    background-color: var(--guide-success) !important;
}

.badge.bg-danger {
    background-color: var(--guide-danger) !important;
}

.badge.bg-warning {
    background-color: var(--guide-warning) !important;
    color: var(--text-inverse);
}

.badge.bg-info {
    background-color: var(--guide-info) !important;
}

/* Soft badges */
.badge-soft-primary {
    background-color: var(--guide-primary-light);
    color: var(--guide-primary);
}

.badge-soft-success {
    background-color: var(--guide-success-light);
    color: var(--guide-success);
}

.badge-soft-warning {
    background-color: var(--guide-warning-light);
    color: var(--guide-warning);
}

.badge-soft-danger {
    background-color: var(--guide-danger-light);
    color: var(--guide-danger);
}

.badge-soft-info {
    background-color: var(--guide-info-light);
    color: var(--guide-info);
}

/* ===================================
   Alerts
   =================================== */
.alert {
    border-radius: var(--radius-md);
    border: none;
    padding: 1rem 1.25rem;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.alert-primary {
    background-color: var(--guide-primary-light);
    color: var(--guide-primary);
}

.alert-success {
    background-color: var(--guide-success-light);
    color: var(--guide-success);
}

.alert-warning {
    background-color: var(--guide-warning-light);
    color: var(--guide-warning);
}

.alert-danger {
    background-color: var(--guide-danger-light);
    color: var(--guide-danger);
}

.alert-info {
    background-color: var(--guide-info-light);
    color: var(--guide-info);
}

.alert-dismissible .btn-close {
    filter: none;
    opacity: 0.5;
}

.alert-dismissible .btn-close:hover {
    opacity: 1;
}

/* ===================================
   Modals
   =================================== */
.modal-content {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
}

.modal-header {
    border-bottom: 1px solid var(--border-color);
    padding: 1.25rem 1.5rem;
}

.modal-title {
    color: var(--text-primary);
    font-weight: 600;
}

.modal-body {
    padding: 1.5rem;
    color: var(--text-primary);
}

.modal-footer {
    border-top: 1px solid var(--border-color);
    padding: 1.25rem 1.5rem;
    gap: 0.5rem;
}

.modal-backdrop {
    background-color: var(--bg-overlay);
}

.btn-close {
    filter: var(--text-primary);
}

[data-theme="dark"] .btn-close {
    filter: invert(1);
}

/* ===================================
   Dropdowns
   =================================== */
.dropdown-menu {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    padding: 0.5rem;
}

.dropdown-item {
    color: var(--text-primary);
    border-radius: var(--radius-sm);
    padding: 0.625rem 1rem;
    transition: all var(--transition-fast);
}

.dropdown-item:hover,
.dropdown-item:focus {
    background-color: var(--bg-surface-hover);
    color: var(--text-primary);
}

.dropdown-item.active,
.dropdown-item:active {
    background-color: var(--guide-primary);
    color: white;
}

.dropdown-divider {
    border-color: var(--border-color);
    margin: 0.5rem 0;
}

.dropdown-header {
    color: var(--text-muted);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ===================================
   Pagination
   =================================== */
.pagination {
    gap: 0.25rem;
}

.page-link {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    border-radius: var(--radius-sm);
    padding: 0.5rem 0.875rem;
    transition: all var(--transition-fast);
}

.page-link:hover {
    background-color: var(--bg-surface-hover);
    border-color: var(--guide-primary);
    color: var(--guide-primary);
}

.page-item.active .page-link {
    background-color: var(--guide-primary);
    border-color: var(--guide-primary);
    color: white;
}

.page-item.disabled .page-link {
    background-color: var(--bg-surface-secondary);
    border-color: var(--border-color);
    color: var(--text-muted);
}

/* ===================================
   Breadcrumbs
   =================================== */
.breadcrumb {
    background: transparent;
    padding: 0;
    margin-bottom: 1rem;
}

.breadcrumb-item {
    color: var(--text-secondary);
}

.breadcrumb-item a {
    color: var(--text-link);
}

.breadcrumb-item.active {
    color: var(--text-primary);
}

.breadcrumb-item + .breadcrumb-item::before {
    color: var(--text-muted);
}

/* ===================================
   Tabs & Nav Pills
   =================================== */
.nav-tabs {
    border-bottom: 2px solid var(--border-color);
    gap: 0.25rem;
}

.nav-tabs .nav-link {
    color: var(--text-secondary);
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    padding: 0.75rem 1.25rem;
    font-weight: 500;
    transition: all var(--transition-fast);
}

.nav-tabs .nav-link:hover {
    color: var(--guide-primary);
    border-bottom-color: var(--guide-primary-light);
}

.nav-tabs .nav-link.active {
    color: var(--guide-primary);
    border-bottom-color: var(--guide-primary);
    background: transparent;
}

.nav-pills {
    gap: 0.5rem;
}

.nav-pills .nav-link {
    color: var(--text-secondary);
    background: transparent;
    border-radius: var(--radius-full);
    padding: 0.5rem 1.25rem;
    font-weight: 500;
    transition: all var(--transition-fast);
}

.nav-pills .nav-link:hover {
    background: var(--bg-surface-hover);
    color: var(--text-primary);
}

.nav-pills .nav-link.active {
    background: var(--guide-primary);
    color: white;
}

/* ===================================
   Progress Bars
   =================================== */
.progress {
    background-color: var(--bg-surface-secondary);
    border-radius: var(--radius-full);
    height: 0.75rem;
    overflow: hidden;
}

.progress-bar {
    background: linear-gradient(90deg, var(--guide-primary) 0%, var(--guide-primary-hover) 100%);
    border-radius: var(--radius-full);
    transition: width var(--transition-slow);
}

/* ===================================
   List Groups
   =================================== */
.list-group {
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.list-group-item {
    background-color: var(--card-bg);
    border-color: var(--border-color);
    color: var(--text-primary);
    padding: 1rem 1.25rem;
    transition: all var(--transition-fast);
}

.list-group-item:first-child {
    border-top-left-radius: var(--radius-lg);
    border-top-right-radius: var(--radius-lg);
}

.list-group-item:last-child {
    border-bottom-left-radius: var(--radius-lg);
    border-bottom-right-radius: var(--radius-lg);
}

.list-group-item-action:hover {
    background-color: var(--bg-surface-hover);
}

.list-group-item.active {
    background-color: var(--guide-primary);
    border-color: var(--guide-primary);
}

/* ===================================
   Avatars
   =================================== */
.avatar {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    background: linear-gradient(135deg, var(--guide-primary) 0%, var(--guide-primary-dark) 100%);
    color: white;
    flex-shrink: 0;
}

.avatar-sm {
    width: 32px;
    height: 32px;
    font-size: 0.75rem;
}

.avatar-lg {
    width: 56px;
    height: 56px;
    font-size: 1.25rem;
}

.avatar-xl {
    width: 80px;
    height: 80px;
    font-size: 1.75rem;
}

.avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: inherit;
}

/* ===================================
   Hero Section
   =================================== */
.hero-section {
    background: linear-gradient(135deg, var(--guide-primary) 0%, var(--guide-primary-dark) 100%);
    color: white;
    padding: 4rem 0;
    border-radius: var(--radius-xl);
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 50%;
    height: 100%;
    background: url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='50' cy='50' r='40' fill='rgba(255,255,255,0.1)'/%3E%3C/svg%3E") repeat;
    opacity: 0.3;
}

.hero-section .display-4 {
    font-weight: 700;
}

.rounded-4 {
    border-radius: var(--radius-xl) !important;
}

/* ===================================
   Empty States
   =================================== */
.empty-state {
    text-align: center;
    padding: 3rem 2rem;
    color: var(--text-muted);
}

.empty-state i {
    font-size: 4rem;
    opacity: 0.3;
    margin-bottom: 1rem;
}

.empty-state h4 {
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.empty-state p {
    color: var(--text-muted);
    max-width: 400px;
    margin: 0 auto 1.5rem;
}

/* ===================================
   Loading States
   =================================== */
.loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    gap: 1rem;
}

.spinner-border {
    width: 3rem;
    height: 3rem;
    color: var(--guide-primary);
}

.loading-text {
    color: var(--text-muted);
    font-size: 0.875rem;
}

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

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

/* ===================================
   Custom Scrollbar
   =================================== */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--scrollbar-track);
    border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb {
    background: var(--scrollbar-thumb);
    border-radius: var(--radius-full);
    border: 2px solid var(--scrollbar-track);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--scrollbar-thumb-hover);
}

/* Firefox scrollbar */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
}

/* ===================================
   Animations
   =================================== */
@keyframes fadeIn {
    from { 
        opacity: 0; 
        transform: translateY(20px); 
    }
    to { 
        opacity: 1; 
        transform: translateY(0); 
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes pulse {
    0%, 100% { 
        opacity: 1; 
    }
    50% { 
        opacity: 0.5; 
    }
}

.fade-in {
    animation: fadeIn 0.4s ease-out;
}

.fade-in-up {
    animation: fadeInUp 0.5s ease-out;
}

.scale-in {
    animation: scaleIn 0.3s ease-out;
}

/* Staggered animations */
.stagger-1 { animation-delay: 0.1s; }
.stagger-2 { animation-delay: 0.2s; }
.stagger-3 { animation-delay: 0.3s; }
.stagger-4 { animation-delay: 0.4s; }
.stagger-5 { animation-delay: 0.5s; }

/* ===================================
   Utility Classes
   =================================== */
.bg-surface {
    background-color: var(--bg-surface) !important;
}

.bg-surface-secondary {
    background-color: var(--bg-surface-secondary) !important;
}

.border-light-custom {
    border-color: var(--border-color) !important;
}

.text-primary-custom {
    color: var(--guide-primary) !important;
}

.hover-lift {
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.hover-lift:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.glass-effect {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

[data-theme="dark"] .glass-effect {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* ===================================
   Blazor Error UI
   =================================== */
#blazor-error-ui {
    background: var(--guide-warning-light);
    bottom: 0;
    box-shadow: var(--shadow-lg);
    display: none;
    left: 0;
    padding: 1rem 1.5rem;
    position: fixed;
    width: 100%;
    z-index: 1050;
    border-top: 3px solid var(--guide-warning);
    color: var(--text-primary);
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 1.5rem;
    top: 1rem;
    font-size: 1.25rem;
    opacity: 0.7;
    transition: opacity var(--transition-fast);
}

#blazor-error-ui .dismiss:hover {
    opacity: 1;
}

.blazor-error-boundary {
    background: linear-gradient(135deg, var(--guide-danger) 0%, #dc2626 100%);
    padding: 2rem;
    color: white;
    border-radius: var(--radius-lg);
    margin: 1rem;
    box-shadow: var(--shadow-lg);
}

.blazor-error-boundary::after {
    content: "An error has occurred. Please refresh the page.";
}

/* ===================================
   Responsive Adjustments
   =================================== */
@media (max-width: 992px) {
    .navbar-collapse {
        background: var(--card-bg);
        padding: 1rem;
        border-radius: var(--radius-md);
        margin-top: 0.5rem;
        box-shadow: var(--shadow-lg);
    }
    
    .navbar-nav .nav-link {
        color: var(--text-primary) !important;
        padding: 0.75rem 1rem;
    }
    
    .navbar-nav .nav-link:hover {
        background: var(--bg-surface-hover);
    }
}

@media (max-width: 768px) {
    .card {
        margin-bottom: 1rem;
    }
    
    .display-4 {
        font-size: 1.75rem;
    }
    
    .display-5 {
        font-size: 1.5rem;
    }
    
    .hero-section {
        padding: 2.5rem 1.5rem;
    }
    
    .stat-value {
        font-size: 1.5rem;
    }
    
    .btn {
        width: 100%;
        justify-content: center;
    }
    
    .btn-group .btn {
        width: auto;
    }
}

@media (max-width: 576px) {
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    .table-responsive {
        font-size: 0.875rem;
    }
}

/* ===================================
   Sidebar Layout System - Orlando Style
   =================================== */

/* App Layout Container */
.app-layout {
    display: flex;
    min-height: 100vh;
    background: linear-gradient(180deg, #0f1729 0%, #1a1040 70%);
    margin: 0;
    padding: 0;
    overflow-x: clip;
}

[data-theme="dark"] .app-layout {
    background: linear-gradient(180deg, #080e1e 0%, #110a2e 70%);
}

/* Sidebar */
.sidebar {
    width: 240px;
    background: rgba(255, 255, 255, 0.05);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 1040;
    transition: all 0.3s ease;
    overflow: hidden;
    border-right: 1px solid rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] .sidebar {
    background: rgba(255, 255, 255, 0.03);
    border-right-color: rgba(255, 255, 255, 0.06);
}

.sidebar.collapsed {
    width: 72px;
}

.sidebar.collapsed .brand-text,
.sidebar.collapsed .nav-section-title,
.sidebar.collapsed .nav-link span,
.sidebar.collapsed .user-details {
    opacity: 0;
    visibility: hidden;
    width: 0;
}

.sidebar.collapsed .sidebar-brand {
    justify-content: center;
}

.sidebar.collapsed .nav-link {
    justify-content: center;
    padding: 0.75rem;
}

.sidebar.collapsed .user-info {
    justify-content: center;
}

/* Sidebar Header */
.sidebar-header {
    padding: 1rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 64px;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: #ffffff;
}

.sidebar-brand .brand-icon {
    font-size: 1.5rem;
    color: #ffffff;
}

.sidebar-brand .brand-text {
    font-size: 1.25rem;
    font-weight: 700;
    color: #ffffff;
    white-space: nowrap;
    transition: all 0.3s ease;
}

.sidebar-toggle,
.sidebar-close {
    width: 28px;
    height: 28px;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.sidebar-toggle:hover,
.sidebar-close:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #ffffff;
}

/* Sidebar Navigation */
.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0.5rem 0;
}

.nav-section {
    margin-bottom: 0.5rem;
}

.nav-section-title {
    display: none; /* Hidden like in Orlando design */
}

.nav-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.nav-item {
    margin: 2px 0.75rem;
}

.nav-item .nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 1rem;
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    cursor: pointer;
    white-space: nowrap;
}

.nav-item .nav-link i:first-child {
    font-size: 1.1rem;
    width: 20px;
    text-align: center;
    flex-shrink: 0;
}

.nav-item .nav-link span {
    flex: 1;
    transition: all 0.3s ease;
}

.nav-item .nav-link:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

.nav-item .nav-link.active {
    background: rgba(234, 88, 12, 0.3);
    color: #fb923c;
    font-weight: 600;
}

/* Collapsible Sub-menus */
.nav-item.has-submenu .submenu-toggle {
    justify-content: space-between;
}

.nav-item.has-submenu .submenu-arrow {
    font-size: 0.75rem;
    transition: transform 0.3s ease;
    margin-left: auto;
}

.nav-item.has-submenu.expanded .submenu-arrow {
    transform: rotate(180deg);
}

.nav-submenu {
    list-style: none;
    padding: 0;
    margin: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.nav-submenu.show {
    max-height: 200px;
}

.nav-submenu .nav-item {
    margin: 2px 0.5rem 2px 1.5rem;
}

.nav-submenu .nav-link {
    font-size: 0.85rem;
    padding: 0.5rem 0.75rem;
    color: rgba(255, 255, 255, 0.6);
}

.nav-submenu .nav-link:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.08);
}

.nav-submenu .nav-link.active {
    background: rgba(234, 88, 12, 0.25);
    color: #fb923c;
}

.nav-submenu .nav-link i {
    font-size: 0.9rem;
}

/* Hide sub-menus when sidebar collapsed */
.sidebar.collapsed .nav-submenu,
.sidebar.collapsed .submenu-arrow {
    display: none;
}

/* Sidebar Footer */
.sidebar-footer {
    padding: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    transition: all 0.3s ease;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.user-details {
    overflow: hidden;
    transition: all 0.3s ease;
}

.user-name {
    display: block;
    font-weight: 600;
    font-size: 0.85rem;
    color: #ffffff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

[data-theme="dark"] .user-name {
    color: #ffffff;
}

.user-role {
    display: block;
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.6);
}

/* Main Area */
.main-area {
    flex: 1;
    margin-left: 240px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-width: 0;
    transition: margin-left 0.3s ease;
    background: var(--bg-body);
}

[data-theme="dark"] .main-area {
    background: var(--bg-body);
}

.main-area.sidebar-collapsed {
    margin-left: 72px;
}

/* Top Header */
.top-header {
    height: 64px;
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    position: sticky;
    top: 0;
    z-index: 1020;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.mobile-menu-btn {
    width: 40px;
    height: 40px;
    border: none;
    background: transparent;
    color: var(--text-primary);
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.mobile-menu-btn:hover {
    background: var(--bg-surface-hover);
}

.header-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.mobile-backend-nav {
    display: none;
}

.mobile-backend-link {
    border: none;
    background: none;
    color: var(--text-secondary);
    text-decoration: none;
}

.header-icon-btn {
    width: 40px;
    height: 40px;
    border: none;
    background: var(--bg-surface-hover);
    color: var(--text-secondary);
    font-size: 1.1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
    text-decoration: none;
    position: relative;
}

.header-icon-btn:hover {
    background: var(--border-color);
    color: var(--text-primary);
}

/* Theme toggle icons */
.header-icon-btn .light-icon {
    display: block;
}

.header-icon-btn .dark-icon {
    display: none;
}

[data-theme="dark"] .header-icon-btn .light-icon {
    display: none;
}

[data-theme="dark"] .header-icon-btn .dark-icon {
    display: block;
}

.badge-dot {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ef4444;
}

/* User Menu */
.header-user-menu {
    position: relative;
}

.user-menu-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0.75rem 0.35rem 0.35rem;
    border: none;
    background: var(--bg-surface-hover);
    border-radius: 50px;
    color: var(--text-primary);
    cursor: pointer;
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.user-menu-btn:hover {
    background: var(--border-color);
}

.user-avatar-sm {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.85rem;
}

.user-menu-name {
    margin-left: 0.25rem;
}

.user-menu-btn i {
    font-size: 0.7rem;
    color: var(--text-muted);
}

/* User Menu Dropdown */
.user-menu-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 240px;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: var(--shadow-xl);
    padding: 0.5rem 0;
    z-index: 1050;
    animation: slideDown 0.2s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.dropdown-user-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
}

.user-avatar-lg {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 1.1rem;
}

.user-menu-fullname {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-primary);
}

.user-menu-role {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.dropdown-divider {
    height: 1px;
    background: var(--border-color);
    margin: 0.5rem 0;
}

.dropdown-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 1rem;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    cursor: pointer;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    transition: all 0.2s ease;
}

.dropdown-link:hover {
    background: var(--bg-surface-hover);
    color: var(--text-primary);
}

.dropdown-link.logout-btn {
    color: #ef4444;
}

.dropdown-link.logout-btn:hover {
    background: rgba(239, 68, 68, 0.08);
    color: #dc2626;
}

.dropdown-link i {
    font-size: 1rem;
    width: 20px;
    text-align: center;
}

/* Page Content */
.page-content {
    flex: 1;
    padding: 1.5rem;
    min-width: 0;
}

.page-content > * {
    min-width: 0;
}

.page-content .container,
.page-content .container-fluid {
    max-width: 100%;
}

.page-content .table-responsive {
    -webkit-overflow-scrolling: touch;
}

/* Page Footer */
.page-footer {
    padding: 1rem 1.5rem;
    background: var(--bg-surface);
    border-top: 1px solid var(--border-color);
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.gov-disclaimer-block {
    margin-top: 0.6rem;
    padding-top: 0.6rem;
    border-top: 1px solid var(--border-color);
    font-size: 0.76rem;
    line-height: 1.45;
    color: var(--text-muted);
}

.gov-disclaimer-block p {
    margin: 0.2rem 0;
}

.gov-disclaimer-block a {
    color: var(--guide-primary);
    text-decoration: underline;
}

.gov-disclaimer-block a:hover {
    color: var(--guide-primary-dark);
}

/* Mobile Overlay */
.mobile-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1035;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* ===================================
   Citizen Layout — Modern Clean Design
   Dual-mode: Light + Dark
   =================================== */

/* ── Design Tokens (Citizen-only) ── */
.citizen-layout {
    --c-accent: #2563eb;
    --c-accent-hover: #1d4ed8;
    --c-accent-light: #dbeafe;
    --c-accent-subtle: rgba(37, 99, 235, 0.08);
    --c-bg: #f8fafc;
    --c-surface: #ffffff;
    --c-surface-hover: #f1f5f9;
    --c-surface-secondary: #f1f5f9;
    --c-border: #e2e8f0;
    --c-border-light: #f1f5f9;
    --c-text: #0f172a;
    --c-text-secondary: #475569;
    --c-text-muted: #94a3b8;
    --c-shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
    --c-shadow-md: 0 4px 12px rgba(0,0,0,0.08);
    --c-shadow-lg: 0 8px 30px rgba(0,0,0,0.1);
    --c-radius: 12px;
    --c-radius-lg: 16px;
    --c-radius-full: 9999px;
    --c-nav-height: 60px;
}

[data-theme="dark"] .citizen-layout {
    --c-accent: #D17842;
    --c-accent-hover: #BE6A3A;
    --c-accent-light: rgba(209, 120, 66, 0.15);
    --c-accent-subtle: rgba(209, 120, 66, 0.08);
    --c-bg: #0C0F14;
    --c-surface: #141921;
    --c-surface-hover: #1C2028;
    --c-surface-secondary: #111518;
    --c-border: #21262E;
    --c-border-light: #171B22;
    --c-text: #FFFFFF;
    --c-text-secondary: #AEAEAE;
    --c-text-muted: #52555A;
    --c-shadow-sm: 0 1px 3px rgba(0,0,0,0.4);
    --c-shadow-md: 0 4px 12px rgba(0,0,0,0.5);
    --c-shadow-lg: 0 8px 30px rgba(0,0,0,0.6);
}

/* ── Root Layout ── */
.citizen-layout {
    min-height: 100vh;
    background: var(--c-bg);
    display: flex;
    flex-direction: column;
    color: var(--c-text);
}

/* ══════════════════════════════════════════
   Top Navbar — Clean + Floating
   ══════════════════════════════════════════ */
.citizen-navbar {
    position: sticky;
    top: 0;
    z-index: 1040;
    background: var(--c-surface);
    border-bottom: 1px solid var(--c-border);
    height: var(--c-nav-height);
    flex-shrink: 0;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

/* Slight transparency for glassmorphism */
.citizen-navbar {
    background: rgba(255,255,255,0.85);
}
[data-theme="dark"] .citizen-navbar {
    background: rgba(30,41,59,0.85);
    border-color: var(--c-border);
}

.citizen-navbar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 20px;
    gap: 12px;
}

/* ── Left: Brand ── */
.citizen-nav-left {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.citizen-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none !important;
}

.citizen-brand:hover { text-decoration: none !important; }

.citizen-brand i {
    font-size: 26px;
    color: var(--c-accent);
}

.citizen-brand-text {
    font-size: 18px;
    font-weight: 700;
    color: var(--c-text);
    letter-spacing: -0.3px;
}

@media (max-width: 767.98px) {
    .citizen-brand-text { display: none; }
}

/* ── Center: Navigation Tabs ── */
.citizen-nav-center {
    align-items: center;
    justify-content: center;
    flex: 1;
    height: 100%;
    gap: 2px;
}

.citizen-nav-tab {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 100%;
    min-width: 48px;
    padding: 0 20px;
    color: var(--c-text-muted);
    text-decoration: none !important;
    border-bottom: 2px solid transparent;
    transition: color 0.15s ease, background 0.15s ease;
    border-radius: 8px 8px 0 0;
}

.citizen-nav-tab i { font-size: 20px; }

.citizen-tab-label {
    font-size: 14px;
    font-weight: 500;
}

@media (max-width: 1199.98px) {
    .citizen-tab-label { display: none; }
    .citizen-nav-tab { padding: 0 24px; }
}

.citizen-nav-tab:hover {
    color: var(--c-accent);
    background: var(--c-accent-subtle);
    text-decoration: none !important;
    border-bottom-color: transparent;
    border-radius: 8px;
}

.citizen-nav-tab.active {
    color: var(--c-accent);
    border-bottom-color: var(--c-accent);
    background: transparent;
    border-radius: 0;
    font-weight: 600;
}

.citizen-nav-tab.active:hover {
    background: transparent;
    border-radius: 0;
}

/* ── Right: Actions ── */
.citizen-nav-right {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.citizen-icon-btn {
    width: 38px;
    height: 38px;
    border-radius: var(--c-radius-full);
    border: none;
    background: var(--c-surface-secondary);
    color: var(--c-text-secondary);
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
    padding: 0;
}

.citizen-icon-btn:hover {
    background: var(--c-border);
    color: var(--c-text);
}

/* Theme toggle */
.citizen-icon-btn .light-icon { display: block; }
.citizen-icon-btn .dark-icon { display: none; }
[data-theme="dark"] .citizen-icon-btn .light-icon { display: none; }
[data-theme="dark"] .citizen-icon-btn .dark-icon { display: block; }

/* ── User Menu ── */
.citizen-user-menu { position: relative; }

.citizen-user-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px 4px 4px;
    border: none;
    background: transparent;
    cursor: pointer;
    border-radius: var(--c-radius-full);
    transition: background 0.15s ease;
}

.citizen-user-btn:hover { background: var(--c-surface-secondary); }

.citizen-avatar-sm {
    width: 34px;
    height: 34px;
    border-radius: var(--c-radius-full);
    background: var(--c-accent);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    flex-shrink: 0;
}

.citizen-caret {
    font-size: 10px;
    color: var(--c-text-muted);
}

/* ── User Dropdown ── */
.citizen-user-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 280px;
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--c-radius);
    box-shadow: var(--c-shadow-lg);
    padding: 6px 0;
    z-index: 1050;
    animation: citizenDropdownIn 0.15s ease;
}

@media (max-width: 767.98px) {
    .citizen-user-dropdown {
        position: fixed;
        top: var(--c-nav-height);
        right: 8px;
        left: auto;
        width: calc(100vw - 16px);
        max-width: 300px;
    }
}

@keyframes citizenDropdownIn {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: translateY(0); }
}

.citizen-dropdown-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
}

.citizen-dropdown-avatar {
    width: 44px;
    height: 44px;
    border-radius: var(--c-radius-full);
    background: var(--c-accent);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 17px;
    flex-shrink: 0;
}

.citizen-dropdown-name {
    font-weight: 600;
    font-size: 15px;
    color: var(--c-text);
}

.citizen-dropdown-role {
    font-size: 13px;
    color: var(--c-text-muted);
    margin-top: 1px;
}

.citizen-dropdown-divider {
    height: 1px;
    background: var(--c-border);
    margin: 4px 12px;
}

.citizen-dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    color: var(--c-text);
    text-decoration: none !important;
    font-size: 14px;
    font-weight: 500;
    transition: background 0.1s ease;
    cursor: pointer;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
}

.citizen-dropdown-item:hover {
    background: var(--c-surface-hover);
    color: var(--c-text);
}

.citizen-dropdown-item i {
    font-size: 17px;
    color: var(--c-text-muted);
    width: 20px;
    text-align: center;
}

.citizen-logout-btn { color: #ef4444 !important; }
.citizen-logout-btn i { color: #ef4444 !important; }
.citizen-logout-btn:hover { background: rgba(239,68,68,0.08) !important; }

/* ══════════════════════════════════════════
   Mobile Bottom Navigation
   ══════════════════════════════════════════ */
.citizen-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1040;
    background: var(--c-surface);
    border-top: 1px solid var(--c-border);
    align-items: center;
    justify-content: space-around;
    height: 56px;
    padding-bottom: env(safe-area-inset-bottom, 0px);
}

.citizen-bottom-nav:not(.d-none) { display: flex; }
@media (min-width: 992px) { .citizen-bottom-nav { display: none !important; } }

.citizen-bottom-tab {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    height: 100%;
    gap: 2px;
    color: var(--c-text-muted);
    text-decoration: none !important;
    font-size: 10px;
    font-weight: 600;
    transition: color 0.15s ease;
    position: relative;
}

.citizen-bottom-tab i { font-size: 22px; }

.citizen-bottom-tab.active { color: var(--c-accent); }

.citizen-bottom-tab.active::before {
    content: '';
    position: absolute;
    top: 0;
    left: 25%;
    right: 25%;
    height: 3px;
    background: var(--c-accent);
    border-radius: 0 0 3px 3px;
}

/* ══════════════════════════════════════════
   Citizen Content Area
   ══════════════════════════════════════════ */
.citizen-content {
    flex: 1;
    padding: 0 16px 72px; /* no top padding - pages control it */
}

@media (min-width: 992px) {
    .citizen-content {
        max-width: 1280px;
        margin: 0 auto;
        width: 100%;
        padding: 0 24px 24px;
    }
}

/* ══════════════════════════════════════════
   Citizen Card System
   ══════════════════════════════════════════ */
.citizen-layout .post-card,
.citizen-layout .my-requests-widget,
.citizen-layout .request-card,
.citizen-layout .step-card,
.citizen-layout .profile-section {
    background: var(--c-surface);
    border-radius: var(--c-radius);
    border: 1px solid var(--c-border);
    box-shadow: var(--c-shadow-sm);
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.citizen-layout .post-card:hover {
    box-shadow: var(--c-shadow-md);
}

.citizen-layout .request-card:hover {
    box-shadow: var(--c-shadow-md);
    transform: translateY(-1px);
}

/* ── Accent Color Overrides ── */
.citizen-layout .post-avatar {
    background: var(--c-accent);
}

.citizen-layout .post-action-btn.liked { color: var(--c-accent); }

.citizen-layout .comment-send-btn { background: var(--c-accent); }
.citizen-layout .comment-send-btn:hover:not(:disabled) { background: var(--c-accent-hover); }
.citizen-layout .comment-input:focus { box-shadow: 0 0 0 2px var(--c-accent); }

.citizen-layout .btn-primary {
    background: var(--c-accent);
    border-color: var(--c-accent);
    border-radius: 8px;
    font-weight: 600;
}
.citizen-layout .btn-primary:hover {
    background: var(--c-accent-hover);
    border-color: var(--c-accent-hover);
}

.citizen-layout .btn-outline-primary {
    color: var(--c-accent);
    border-color: var(--c-accent);
    border-radius: 8px;
    font-weight: 500;
}
.citizen-layout .btn-outline-primary:hover {
    background: var(--c-accent);
    border-color: var(--c-accent);
    color: #fff;
}

/* ── Alert Overrides ── */
.citizen-layout .emergency-banner {
    border-radius: var(--c-radius);
    box-shadow: 0 2px 12px rgba(220, 38, 38, 0.2);
}

.citizen-layout .alert-feed-card {
    border-radius: var(--c-radius);
    border: 1px solid var(--c-border);
    box-shadow: var(--c-shadow-sm);
}

/* ── Post Action Buttons ── */
.citizen-layout .post-action-btn {
    border-radius: 8px;
    font-weight: 500;
    font-size: 14px;
}
.citizen-layout .post-action-btn:hover {
    background: var(--c-surface-hover);
}

/* ── FAB ── */
.citizen-layout .fab-submit {
    background: var(--c-accent);
    bottom: 72px;
    box-shadow: 0 4px 16px rgba(37, 99, 235, 0.35);
    border-radius: 16px;
    width: 54px;
    height: 54px;
}
.citizen-layout .fab-submit:hover {
    box-shadow: 0 6px 24px rgba(37, 99, 235, 0.45);
    transform: scale(1.05);
}

/* ── Filter Chips ── */
.citizen-layout .filter-chip.active {
    background: var(--c-accent);
    border-color: var(--c-accent);
    color: #fff;
}
.citizen-layout .filter-chip:hover {
    border-color: var(--c-accent);
    color: var(--c-accent);
}

/* ── Profile Hero ── */
.citizen-layout .profile-hero {
    background: linear-gradient(135deg, var(--c-accent) 0%, #60a5fa 100%);
    border-radius: var(--c-radius) var(--c-radius) 0 0;
}

/* ── Stepper ── */
.citizen-layout .step-circle.active {
    background: var(--c-accent);
    border-color: var(--c-accent);
    box-shadow: 0 0 0 4px var(--c-accent-light);
}
.citizen-layout .step-connector.active { background: var(--c-accent); }

/* ── Category / Selection Cards ── */
.citizen-layout .category-card.selected,
.citizen-layout .category-card:hover { border-color: var(--c-accent); }

/* ── Spinner ── */
.citizen-layout .spinner-border.text-primary { color: var(--c-accent) !important; }

/* ── Links inside citizen layout ── */
.citizen-layout .text-primary,
.citizen-layout a.text-primary { color: var(--c-accent) !important; }

/* ── Welcome Card ── */
.citizen-layout .welcome-card {
    background: linear-gradient(135deg, var(--c-accent) 0%, #60a5fa 100%);
    border-radius: var(--c-radius);
    border: none;
    box-shadow: 0 2px 12px rgba(37, 99, 235, 0.2);
}

/* ══════════════════════════════════════════
   Citizen Mobile Responsive
   ══════════════════════════════════════════ */

/* ── Small phones (≤ 480px) ── */
@media (max-width: 480px) {
    .citizen-content {
        padding: 0 10px 80px;
    }

    .citizen-layout .profile-hero {
        padding: 20px 16px !important;
    }

    .citizen-layout .profile-hero .row {
        text-align: center;
    }

    .citizen-layout .profile-hero .col-auto,
    .citizen-layout .profile-hero .col {
        flex: 0 0 100%;
        max-width: 100%;
    }

    .citizen-layout .profile-avatar {
        width: 80px;
        height: 80px;
        margin: 0 auto 12px;
    }

    .citizen-layout .profile-avatar-initials {
        font-size: 1.8rem;
    }

    .citizen-layout .profile-hero h1 {
        font-size: 1.4rem !important;
        justify-content: center;
    }

    .citizen-layout .profile-hero .d-flex.align-items-center.gap-3 {
        justify-content: center;
        flex-wrap: wrap;
    }

    .citizen-layout .profile-hero .opacity-85 {
        justify-content: center;
    }

    .citizen-layout .profile-hero .d-flex.flex-wrap.gap-2 {
        justify-content: center;
    }

    .citizen-layout .role-badge {
        font-size: 11px;
        padding: 4px 10px;
    }

    .citizen-layout .stat-value {
        font-size: 22px;
    }

    .citizen-layout .stat-icon {
        width: 36px;
        height: 36px;
        font-size: 15px;
    }

    .citizen-layout .info-item {
        padding: 10px 0;
    }

    .citizen-layout .info-value {
        font-size: 14px;
    }
}

/* ── Mobile (≤ 767px) ── */
@media (max-width: 767.98px) {
    .citizen-content {
        padding: 0 12px 80px;
    }

    /* Profile hero stacks vertically */
    .citizen-layout .profile-hero {
        text-align: center;
        padding: 24px 16px !important;
    }

    .citizen-layout .profile-hero .row {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .citizen-layout .profile-hero .col-auto {
        margin-bottom: 12px;
    }

    .citizen-layout .profile-hero .col {
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .citizen-layout .profile-hero h1 {
        font-size: 1.5rem !important;
    }

    .citizen-layout .profile-hero .col-12.col-md-auto {
        margin-top: 12px !important;
    }

    .citizen-layout .profile-avatar {
        width: 90px;
        height: 90px;
    }

    .citizen-layout .profile-avatar-initials {
        font-size: 2rem;
    }

    /* Profile sections better mobile spacing */
    .citizen-layout .profile-section .card-body {
        padding: 16px !important;
    }

    .citizen-layout .profile-section-header {
        padding: 12px 16px;
    }

    /* Stats cards in profile */
    .citizen-layout .stat-card {
        padding: 12px;
    }

    /* Fix form controls on mobile */
    .citizen-layout .form-control-lg {
        font-size: 14px;
        padding: 10px 14px;
    }

    /* Feed: Post cards tighter */
    .citizen-layout .post-card .post-header {
        padding: 12px 14px 6px;
    }

    .citizen-layout .post-card .post-body {
        padding: 4px 14px 8px;
    }

    .citizen-layout .post-card .post-actions {
        margin: 0 14px;
    }

    .citizen-layout .post-card .post-stats {
        padding: 6px 14px 2px;
    }

    .citizen-layout .post-card .comments-section {
        padding: 8px 14px 12px;
    }

    /* Quick action bar */
    .citizen-layout .quick-action-bar {
        padding: 10px 12px;
        gap: 10px;
    }

    .citizen-layout .quick-action-bar .post-avatar {
        width: 34px !important;
        height: 34px !important;
        font-size: 13px !important;
    }

    .citizen-layout .quick-action-input {
        padding: 8px 14px;
        font-size: 13px;
    }

    /* Feed tabs */
    .citizen-layout .feed-tab {
        padding: 10px 14px;
        font-size: 13px;
    }

    /* Emergency banner */
    .citizen-layout .emergency-banner {
        padding: 12px !important;
    }

    .citizen-layout .emergency-banner h6 {
        font-size: 14px;
    }

    /* Alert cards */
    .citizen-layout .alert-feed-card {
        padding: 12px !important;
    }

    /* FAB positioning above bottom nav */
    .citizen-layout .fab-submit {
        bottom: 68px;
        right: 16px;
        width: 50px;
        height: 50px;
        font-size: 20px;
    }

    /* My requests page tweaks */
    .citizen-layout .request-card {
        padding: 12px !important;
    }

    /* Submit request page */
    .citizen-layout .step-card {
        padding: 16px !important;
    }

    .citizen-layout .container-fluid {
        padding-left: 0 !important;
        padding-right: 0 !important;
    }
}

/* ── Tablet (≤ 991px) ── */
@media (max-width: 991.98px) {
    /* Profile: force single column even on tablets */
    .citizen-layout .profile-hero .col-12.col-md-auto {
        text-align: center;
    }

    /* Password form stacks on tablet */
    .citizen-layout .password-section .col-md-4 {
        flex: 0 0 100%;
        max-width: 100%;
    }
}

/* ── Safe area for iOS bottom bar ── */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
    .citizen-content {
        padding-bottom: calc(80px + env(safe-area-inset-bottom));
    }

    @media (min-width: 992px) {
        .citizen-content {
            padding-bottom: 24px;
        }
    }
}

/* ===================================
   Public Layout (Not Logged In)
   =================================== */

.public-layout {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--bg-body);
}

.public-header {
    height: 64px;
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 1020;
}

.public-header .header-container {
    max-width: 1200px;
    margin: 0 auto;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
}

.public-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    color: var(--text-primary);
    font-size: 1.25rem;
    font-weight: 700;
}

.public-brand i {
    color: var(--guide-primary);
}

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

.login-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--guide-primary);
    color: white;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.login-btn:hover {
    background: var(--guide-primary-dark);
    color: white;
}

.public-content {
    flex: 1;
    padding: 2rem 1.5rem;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

.public-footer {
    padding: 1rem 0;
    background: var(--bg-surface);
    border-top: 1px solid var(--border-color);
}

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

.public-footer .footer-links {
    display: flex;
    gap: 1.5rem;
}

.public-footer .footer-links a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.2s ease;
}

.public-footer .footer-links a:hover {
    color: var(--guide-primary);
}

/* ===================================
   Mobile Responsive
   =================================== */

@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.mobile-open {
        transform: translateX(0);
    }
    
    .main-area {
        margin-left: 0 !important;
    }
    
    .main-area.sidebar-collapsed {
        margin-left: 0;
    }

    .mobile-backend-nav {
        position: sticky;
        top: 64px;
        z-index: 1015;
        display: grid;
        grid-template-columns: repeat(5, minmax(0, 1fr));
        gap: 0.5rem;
        padding: 0.75rem 1rem;
        background: color-mix(in srgb, var(--bg-surface) 92%, transparent);
        border-bottom: 1px solid var(--border-color);
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
    }

    .mobile-backend-link {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 0.3rem;
        min-height: 56px;
        padding: 0.55rem 0.35rem;
        border-radius: 14px;
        background: var(--bg-surface-hover);
        color: var(--text-secondary);
        font-size: 0.72rem;
        font-weight: 600;
        transition: background var(--transition-fast), color var(--transition-fast), transform var(--transition-fast);
        text-align: center;
    }

    .mobile-backend-link i {
        font-size: 1rem;
    }

    .mobile-backend-link.active,
    .mobile-backend-link:hover,
    .mobile-backend-menu:hover {
        background: var(--guide-primary-light);
        color: var(--guide-primary-dark);
        transform: translateY(-1px);
    }

    [data-theme="dark"] .mobile-backend-link.active,
    [data-theme="dark"] .mobile-backend-link:hover,
    [data-theme="dark"] .mobile-backend-menu:hover {
        background: rgba(209, 120, 66, 0.16);
        color: var(--guide-primary);
    }

    .page-content {
        padding-top: 1.25rem;
    }

    .page-content .table-responsive {
        margin-inline: -0.25rem;
        padding-bottom: 0.25rem;
    }

    .page-content .table-responsive > .table {
        min-width: 640px;
    }
}

@media (max-width: 767.98px) {
    .top-header {
        padding: 0.75rem 1rem;
    }

    .header-right {
        gap: 0.375rem;
    }

    .header-icon-btn {
        width: 38px;
        height: 38px;
    }

    .user-menu-btn {
        padding: 0.25rem;
        border-radius: 9999px;
    }

    .user-menu-btn i {
        display: none;
    }

    .user-menu-dropdown {
        position: fixed;
        top: 124px;
        right: 12px;
        left: 12px;
        min-width: 0;
        width: auto;
        max-width: calc(100vw - 24px);
    }

    .mobile-backend-nav {
        top: 64px;
        gap: 0.4rem;
        padding: 0.65rem 0.75rem;
    }

    .mobile-backend-link {
        min-height: 52px;
        padding: 0.5rem 0.25rem;
        font-size: 0.68rem;
    }

    .page-content {
        padding: 1rem 0.875rem 1.25rem;
    }

    .page-content .card,
    .page-content .table-responsive {
        border-radius: 12px;
    }
    
    .public-content {
        padding: 1rem;
    }
    
    .public-footer .footer-container {
        flex-direction: column;
        gap: 0.75rem;
        text-align: center;
    }
}
