/* ==========================================================================
   VillageDataHome — Core Design System & Stylesheet
   Domain: https://villagedatahome.online
   ========================================================================== */

:root {
    /* Color Palette - Light Mode */
    --bg-body: #f8fafc;
    --bg-surface: #ffffff;
    --bg-card: #ffffff;
    --bg-card-hover: #fcfdfe;
    --bg-input: #ffffff;
    --bg-subtle: #f1f5f9;
    --bg-header: rgba(255, 255, 255, 0.92);

    --text-primary: #0f172a;
    --text-secondary: #334155;
    --text-muted: #64748b;
    --text-inverse: #ffffff;

    --border-color: #e2e8f0;
    --border-focus: #10b981;

    --primary: #059669;
    --primary-light: #d1fae5;
    --primary-hover: #047857;
    --primary-glow: rgba(5, 150, 105, 0.2);

    --accent: #2563eb;
    --accent-light: #dbeafe;
    --accent-hover: #1d4ed8;

    --success: #16a34a;
    --success-bg: #dcfce7;
    --warning: #d97706;
    --warning-bg: #fef3c7;
    --danger: #dc2626;
    --danger-bg: #fee2e2;
    --info: #0284c7;
    --info-bg: #e0f2fe;

    /* Shadows & Radii */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;

    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.05);

    --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --font-sans: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
}

[data-theme="dark"] {
    /* Color Palette - Dark Mode */
    --bg-body: #0b1120;
    --bg-surface: #111a2e;
    --bg-card: #152238;
    --bg-card-hover: #1a2942;
    --bg-input: #111c30;
    --bg-subtle: #19263f;
    --bg-header: rgba(17, 26, 46, 0.92);

    --text-primary: #f8fafc;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;
    --text-inverse: #0f172a;

    --border-color: #24344d;
    --border-focus: #34d399;

    --primary: #10b981;
    --primary-light: rgba(16, 185, 129, 0.15);
    --primary-hover: #059669;
    --primary-glow: rgba(16, 185, 129, 0.25);

    --accent: #3b82f6;
    --accent-light: rgba(59, 130, 246, 0.15);
    --accent-hover: #60a5fa;

    --success: #22c55e;
    --success-bg: rgba(34, 197, 94, 0.15);
    --warning: #f59e0b;
    --warning-bg: rgba(245, 158, 11, 0.15);
    --danger: #ef4444;
    --danger-bg: rgba(239, 68, 68, 0.15);
    --info: #38bdf8;
    --info-bg: rgba(56, 189, 248, 0.15);

    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.35);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.45);
    --shadow-xl: 0 20px 35px rgba(0, 0, 0, 0.6);
}

/* ==========================================================================
   Base & Reset
   ========================================================================== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-sans);
    background-color: var(--bg-body);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    transition: background-color 0.3s ease, color 0.3s ease;
}

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

a:hover {
    color: var(--primary-hover);
}

img, svg {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Containers */
.container {
    width: 100%;
    max-width: 1240px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 1.25rem;
    padding-right: 1.25rem;
}

.site-wrapper {
    flex: 1 0 auto;
    display: flex;
    flex-direction: column;
}

/* ==========================================================================
   Header & Navigation
   ========================================================================== */
.navbar-wrapper {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: var(--bg-header);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    transition: var(--transition);
}

.navbar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 72px;
}

.navbar-brand {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: var(--text-primary);
}

.brand-logo {
    height: 42px;
    width: auto;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 1.75rem;
}

.nav-link {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-secondary);
    padding: 0.5rem 0.25rem;
    position: relative;
}

.nav-link:hover, .nav-link.active {
    color: var(--primary);
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--primary);
    border-radius: var(--radius-full);
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Theme Toggle */
.theme-toggle-btn {
    background: var(--bg-subtle);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.05rem;
    transition: var(--transition);
}

.theme-toggle-btn:hover {
    background: var(--bg-card-hover);
    color: var(--primary);
    transform: rotate(15deg);
}

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

/* Auth Buttons */
.auth-buttons {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* User Pill & Dropdown */
.user-dropdown-wrapper {
    position: relative;
}

.user-pill-btn {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    background: var(--bg-subtle);
    border: 1px solid var(--border-color);
    padding: 0.4rem 0.85rem 0.4rem 0.4rem;
    border-radius: var(--radius-full);
    cursor: pointer;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    transition: var(--transition);
}

.user-pill-btn:hover {
    background: var(--bg-card);
    border-color: var(--primary);
}

.user-avatar-initial {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
}

.dropdown-arrow {
    font-size: 0.7rem;
    color: var(--text-muted);
    transition: transform 0.2s ease;
}

.user-dropdown-menu {
    position: absolute;
    right: 0;
    top: calc(100% + 10px);
    width: 250px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    padding: 0.6rem;
    display: none;
    z-index: 1050;
    animation: fadeInDropdown 0.2s ease forwards;
}

.user-dropdown-menu.show {
    display: block;
}

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

.dropdown-header {
    padding: 0.6rem 0.75rem;
}

.user-meta-name {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--text-primary);
}

.user-meta-email {
    font-size: 0.8rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 0.35rem;
}

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

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.55rem 0.75rem;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 0.88rem;
    font-weight: 500;
    transition: var(--transition);
}

.dropdown-item:hover {
    background: var(--bg-subtle);
    color: var(--primary);
}

.dropdown-item.text-danger:hover {
    background: var(--danger-bg);
    color: var(--danger);
}

.mobile-toggle-btn {
    display: none;
    background: transparent;
    border: none;
    font-size: 1.35rem;
    color: var(--text-primary);
    cursor: pointer;
    padding: 0.25rem;
}

.mobile-toggle-btn .close-icon {
    display: none;
}

/* ==========================================================================
   Buttons & Badges
   ========================================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-family: inherit;
    font-size: 0.92rem;
    font-weight: 600;
    line-height: 1;
    padding: 0.7rem 1.4rem;
    border-radius: var(--radius-md);
    border: 1px solid transparent;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    white-space: nowrap;
}

.btn-sm {
    padding: 0.45rem 0.9rem;
    font-size: 0.82rem;
    border-radius: var(--radius-sm);
}

.btn-lg {
    padding: 0.9rem 1.8rem;
    font-size: 1.05rem;
    border-radius: var(--radius-lg);
}

.btn-primary {
    background: var(--primary);
    color: #ffffff;
    box-shadow: 0 2px 4px var(--primary-glow);
}

.btn-primary:hover {
    background: var(--primary-hover);
    color: #ffffff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px var(--primary-glow);
}

.btn-outline {
    background: transparent;
    border-color: var(--border-color);
    color: var(--text-primary);
}

.btn-outline:hover {
    background: var(--bg-subtle);
    border-color: var(--text-muted);
    color: var(--text-primary);
    transform: translateY(-1px);
}

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

.btn-outline-primary:hover {
    background: var(--primary);
    color: #ffffff;
}

.btn-danger {
    background: var(--danger);
    color: #ffffff;
}

.btn-danger:hover {
    background: #b91c1c;
    color: #ffffff;
}

.btn-block {
    width: 100%;
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.25rem 0.65rem;
    font-size: 0.75rem;
    font-weight: 700;
    border-radius: var(--radius-full);
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.badge-verified {
    background: var(--success-bg);
    color: var(--success);
    border: 1px solid rgba(22, 163, 74, 0.2);
}

.badge-pending {
    background: var(--warning-bg);
    color: var(--warning);
    border: 1px solid rgba(217, 119, 6, 0.2);
}

.badge-unverified {
    background: var(--danger-bg);
    color: var(--danger);
    border: 1px solid rgba(220, 38, 38, 0.2);
}

.badge-admin {
    background: var(--accent-light);
    color: var(--accent);
}

.badge-user {
    background: var(--bg-subtle);
    color: var(--text-muted);
}

.data-na {
    display: inline-block;
    padding: 0.2rem 0.55rem;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-muted);
    background: var(--bg-subtle);
    border-radius: var(--radius-sm);
    font-style: italic;
}

/* ==========================================================================
   Alerts & Notifications
   ========================================================================== */
.flash-messages-container {
    width: 100%;
    max-width: 1240px;
    margin: 1.25rem auto 0;
    padding: 0 1.25rem;
}

.alert {
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
    padding: 0.95rem 1.25rem;
    border-radius: var(--radius-md);
    margin-bottom: 1rem;
    font-size: 0.92rem;
    position: relative;
    border: 1px solid transparent;
}

.alert-icon {
    font-size: 1.15rem;
    margin-top: 2px;
}

.alert-content {
    flex: 1;
}

.alert-close {
    background: transparent;
    border: none;
    font-size: 1.25rem;
    line-height: 1;
    color: inherit;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.2s;
}

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

.alert-success {
    background: var(--success-bg);
    color: var(--success);
    border-color: rgba(22, 163, 74, 0.25);
}

.alert-danger {
    background: var(--danger-bg);
    color: var(--danger);
    border-color: rgba(220, 38, 38, 0.25);
}

.alert-warning {
    background: var(--warning-bg);
    color: var(--warning);
    border-color: rgba(217, 119, 6, 0.25);
}

.alert-info {
    background: var(--info-bg);
    color: var(--info);
    border-color: rgba(2, 132, 199, 0.25);
}

/* Toast System */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.toast {
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-xl);
    border-radius: var(--radius-md);
    padding: 0.85rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 280px;
    max-width: 420px;
    pointer-events: auto;
    animation: toastSlideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

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

/* ==========================================================================
   Hero & Homepage Sections
   ========================================================================== */
.hero-section {
    position: relative;
    padding: 4.5rem 0 3.5rem;
    background: radial-gradient(circle at 50% 10%, var(--primary-light) 0%, transparent 55%),
                radial-gradient(circle at 90% 20%, var(--accent-light) 0%, transparent 40%);
    border-bottom: 1px solid var(--border-color);
    text-align: center;
}

.hero-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    padding: 0.4rem 1rem;
    border-radius: var(--radius-full);
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-sm);
}

.hero-title {
    font-size: 2.85rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.18;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

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

.hero-subtitle {
    font-size: 1.18rem;
    color: var(--text-muted);
    max-width: 680px;
    margin: 0 auto 2.25rem;
    font-weight: 400;
}

/* Main Search Box */
.main-search-wrapper {
    max-width: 760px;
    margin: 0 auto 1.5rem;
    position: relative;
}

.search-input-group {
    display: flex;
    align-items: center;
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 0.4rem 0.5rem 0.4rem 1.4rem;
    box-shadow: var(--shadow-xl);
    transition: var(--transition);
}

.search-input-group:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-glow), var(--shadow-xl);
}

.search-icon {
    font-size: 1.25rem;
    color: var(--text-muted);
    margin-right: 0.75rem;
}

.main-search-input {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    font-family: inherit;
    font-size: 1.05rem;
    color: var(--text-primary);
    padding: 0.6rem 0;
}

.main-search-input::placeholder {
    color: var(--text-muted);
    font-weight: 400;
}

/* Autocomplete live suggestions */
.search-suggestions-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    max-height: 340px;
    overflow-y: auto;
    z-index: 1020;
    display: none;
    text-align: left;
}

.suggestion-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
    transition: var(--transition);
}

.suggestion-item:last-child {
    border-bottom: none;
}

.suggestion-item:hover {
    background: var(--bg-subtle);
    color: var(--primary);
}

.suggestion-primary {
    font-weight: 600;
    font-size: 0.95rem;
}

.suggestion-meta {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Cascading Selector Card */
.cascading-selector-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 1.75rem;
    box-shadow: var(--shadow-lg);
    max-width: 1040px;
    margin: 2rem auto 0;
    text-align: left;
}

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

.selector-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.selector-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    align-items: flex-end;
}

/* Form Controls */
.form-group {
    margin-bottom: 1.1rem;
}

.form-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.4rem;
}

.form-control {
    width: 100%;
    padding: 0.65rem 0.95rem;
    font-family: inherit;
    font-size: 0.92rem;
    color: var(--text-primary);
    background-color: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    transition: var(--transition);
    outline: none;
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

.form-row {
    display: flex;
    gap: 1rem;
}

.col-half {
    flex: 1;
}

/* Cards & Metrics */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.25rem;
    margin: 2rem 0;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-md);
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    background: var(--primary-light);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    flex-shrink: 0;
}

.stat-content {
    flex: 1;
}

.stat-label {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.35rem;
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1.1;
}

/* ==========================================================================
   Tables & Data Presentation
   ========================================================================== */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    background: var(--bg-card);
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
    text-align: left;
}

.table th {
    background: var(--bg-subtle);
    color: var(--text-secondary);
    font-weight: 700;
    padding: 0.85rem 1rem;
    border-bottom: 2px solid var(--border-color);
    white-space: nowrap;
}

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

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

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

/* ==========================================================================
   Map & Charts Containers
   ========================================================================== */
.village-map-container {
    width: 100%;
    height: 380px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    overflow: hidden;
    margin: 1.5rem 0;
    box-shadow: var(--shadow-md);
}

.chart-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-md);
    margin-bottom: 1.5rem;
}

.chart-wrapper {
    position: relative;
    height: 300px;
    width: 100%;
}

/* ==========================================================================
   Auth Forms (Single Login & Registration)
   ========================================================================== */
.auth-page {
    padding: 3.5rem 0;
    min-height: calc(100vh - 144px);
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-card {
    width: 100%;
    max-width: 480px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 2.5rem 2.25rem;
    box-shadow: var(--shadow-xl);
}

.auth-header {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-title {
    font-size: 1.85rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.auth-subtitle {
    font-size: 0.92rem;
    color: var(--text-muted);
}

.auth-footer {
    text-align: center;
    margin-top: 1.75rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--border-color);
    font-size: 0.88rem;
    color: var(--text-muted);
}

/* ==========================================================================
   Dashboard Layout (User & Common)
   ========================================================================== */
.dashboard-layout {
    display: flex;
    min-height: calc(100vh - 72px);
}

.dashboard-sidebar {
    width: 270px;
    background: var(--bg-surface);
    border-right: 1px solid var(--border-color);
    padding: 1.75rem 1.25rem;
    flex-shrink: 0;
    transition: var(--transition);
}

.sidebar-user-card {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding-bottom: 1.25rem;
    margin-bottom: 1.25rem;
    border-bottom: 1px solid var(--border-color);
}

.sidebar-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    font-weight: 800;
}

.sidebar-user-name {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
    margin-bottom: 0.25rem;
}

.sidebar-section-title {
    font-size: 0.72rem;
    font-weight: 800;
    color: var(--text-muted);
    letter-spacing: 0.8px;
    text-transform: uppercase;
    margin: 1.25rem 0 0.5rem 0.5rem;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 0.85rem;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 600;
    transition: var(--transition);
}

.sidebar-link:hover {
    background: var(--bg-subtle);
    color: var(--primary);
}

.sidebar-link.active {
    background: var(--primary-light);
    color: var(--primary);
    font-weight: 700;
}

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

.dashboard-main {
    flex: 1;
    padding: 2rem 2.25rem;
    background: var(--bg-body);
    overflow-x: hidden;
}

/* ==========================================================================
   Modals & Error Pages
   ========================================================================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 1.25rem;
}

.modal-overlay.show {
    display: flex;
}

.modal-dialog {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 600px;
    box-shadow: var(--shadow-xl);
    overflow: hidden;
    animation: modalScaleIn 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

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

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

.modal-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.modal-close {
    background: transparent;
    border: none;
    font-size: 1.5rem;
    line-height: 1;
    color: var(--text-muted);
    cursor: pointer;
}

.modal-body {
    padding: 1.5rem 1.75rem;
    max-height: 75vh;
    overflow-y: auto;
}

.modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.75rem;
    padding: 1.25rem 1.75rem;
    border-top: 1px solid var(--border-color);
    background: var(--bg-subtle);
}

/* Error Pages */
.error-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.error-card {
    text-align: center;
    max-width: 520px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 3.5rem 2.5rem;
    box-shadow: var(--shadow-xl);
}

.error-badge {
    font-size: 4.5rem;
    font-weight: 900;
    line-height: 1;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 1rem;
}

.error-icon {
    font-size: 2.75rem;
    color: var(--text-muted);
    margin-bottom: 1.25rem;
}

.error-card h1 {
    font-size: 1.65rem;
    font-weight: 800;
    margin-bottom: 0.75rem;
}

.error-card p {
    color: var(--text-muted);
    margin-bottom: 2rem;
}

.error-actions {
    display: flex;
    justify-content: center;
    gap: 1rem;
}

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer {
    background: var(--bg-surface);
    border-top: 1px solid var(--border-color);
    padding: 4rem 0 2rem;
    margin-top: auto;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1.5fr;
    gap: 2.5rem;
    margin-bottom: 3rem;
}

.brand-col .footer-logo {
    height: 42px;
    margin-bottom: 1rem;
}

.footer-desc {
    font-size: 0.88rem;
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 1.25rem;
}

.verification-notice {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    background: var(--bg-subtle);
    border: 1px solid var(--border-color);
    padding: 0.65rem 0.85rem;
    border-radius: var(--radius-md);
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.verification-notice i {
    color: var(--primary);
    font-size: 1rem;
    margin-top: 2px;
}

.footer-heading {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1.25rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.footer-links {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.footer-links a {
    color: var(--text-muted);
    font-size: 0.88rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.footer-links a:hover {
    color: var(--primary);
    transform: translateX(3px);
}

.hierarchy-pill {
    display: inline-block;
    padding: 0.25rem 0.65rem;
    background: var(--bg-subtle);
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.footer-badge-wrap {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 1rem;
}

.footer-bottom {
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.82rem;
    color: var(--text-muted);
}

.footer-sublinks {
    display: flex;
    gap: 1.25rem;
}

.footer-sublinks a {
    color: var(--text-muted);
}

.footer-sublinks a:hover {
    color: var(--primary);
}

/* ==========================================================================
   Responsive Breakpoints
   ========================================================================== */
@media (max-width: 992px) {
    .footer-grid {
        grid-template-columns: 1fr 1fr;
    }
    .dashboard-layout {
        flex-direction: column;
    }
    .dashboard-sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
    }
}

@media (max-width: 768px) {
    .nav-menu {
        position: fixed;
        top: 72px;
        left: 0;
        right: 0;
        background: var(--bg-surface);
        border-bottom: 1px solid var(--border-color);
        padding: 1.5rem;
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
        display: none;
        box-shadow: var(--shadow-xl);
    }
    .nav-menu.open {
        display: flex;
    }
    .mobile-toggle-btn {
        display: inline-flex;
    }
    .mobile-toggle-btn.open .hamburger-icon {
        display: none;
    }
    .mobile-toggle-btn.open .close-icon {
        display: inline-block;
    }
    .hero-title {
        font-size: 2.15rem;
    }
    .hero-subtitle {
        font-size: 1rem;
    }
    .footer-grid {
        grid-template-columns: 1fr;
    }
    .footer-bottom {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    .dashboard-main {
        padding: 1.5rem 1rem;
    }
}
