/* Universal Box Sizing Fix */
*,
*::before,
*::after {
    box-sizing: border-box;
}

.year-filter {
    width: 150px;
    margin-left: 1rem;
}

.chart-canvas {
    max-height: 300px;
    width: 100%;
}

.prediction-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.prediction-content {
    text-align: center;
    padding: 2rem 0;
}

.prediction-value {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.prediction-label {
    opacity: 0.9;
    font-size: 1rem;
}

.prediction-growth {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.3);
}

.prediction-growth-label {
    font-size: 0.875rem;
    opacity: 0.9;
}

.prediction-growth-value {
    font-size: 1.5rem;
    font-weight: 600;
    margin-top: 0.25rem;
}

.analytics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.page-header {
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
    border: 1px solid var(--border-light);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.card-header {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

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

.card-icon {
    background: var(--primary-50);
    color: var(--primary-700);
    padding: 0.5rem;
    border-radius: 0.5rem;
    font-size: 1.5rem;
    align-self: flex-end;
}

.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-full);
    font-size: 0.85rem;
    font-weight: 600;
    margin-right: 0.5rem;
    transition: var(--transition);
}

.badge-active {
    background: var(--secondary-500);
    color: #fff;
}

.badge-inactive {
    background: var(--danger-500);
    color: #fff;
}

.app-container {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 280px;
    background: #fff !important;
    border-right: 1px solid var(--border-light);
    display: flex;
    flex-direction: column;
    transition: width 0.3s ease, transform 0.3s ease;
    height: 100vh;
    position: sticky;
    top: 0;
    z-index: 40;
    overflow-y: auto;
    overflow-x: hidden;
}

.main-content {
    flex: 1;
    padding: 2.5rem;
    background: linear-gradient(to bottom right, #f8fafc, #f1f5f9);
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

@media (min-width: 769px) {

    .mobile-menu-toggle,
    .mobile-menu-modal,
    .mobile-overlay {
        display: none;
    }
}

.analytics-section-title {
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--primary-600);
    margin-bottom: 1rem;
    margin-top: 2rem;
}

.card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
    border: 1px solid var(--border-light);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.card-header {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

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

.card-icon {
    background: var(--primary-50);
    color: var(--primary-700);
    padding: 0.5rem;
    border-radius: 0.5rem;
    font-size: 1.5rem;
    align-self: flex-end;
}

/* Analytics custom styles */
.page-header {
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.form-control {
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    border: 1px solid var(--border-light);
    background: var(--bg-card);
    color: var(--text-main);
    font-size: 1rem;
    outline: none;
    transition: var(--transition);
}

.form-control:focus {
    border-color: var(--primary-500);
    box-shadow: 0 0 0 2px var(--primary-100);
}

.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-full);
    font-size: 0.85rem;
    font-weight: 600;
    margin-right: 0.5rem;
    transition: var(--transition);
}

.badge-active {
    background: var(--secondary-500);
    color: #fff;
}

.badge-inactive {
    background: var(--danger-500);
    color: #fff;
}

:root {
    /* Modern Color Palette */
    --primary-50: #eef2ff;
    --primary-100: #e0e7ff;
    --primary-500: #6366f1;
    /* Indigo 500 */
    --primary-600: #4f46e5;
    /* Indigo 600 */
    --primary-700: #4338ca;
    /* Indigo 700 */

    --secondary-500: #10b981;
    /* Emerald 500 */
    --secondary-600: #059669;
    /* Emerald 600 */

    --danger-500: #ef4444;
    --danger-600: #dc2626;

    --bg-body: #f8fafc;
    /* Slate 50 */
    --bg-card: rgba(255, 255, 255, 0.8);
    --bg-glass: rgba(255, 255, 255, 0.7);

    --text-main: #1e293b;
    /* Slate 800 */
    --text-muted: #64748b;
    /* Slate 500 */
    --text-light: #94a3b8;
    /* Slate 400 */

    --border-light: rgba(226, 232, 240, 0.8);

    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);

    --radius-md: 0.75rem;
    --radius-lg: 1rem;
    align-items: center;
    justify-content: space-between;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--primary-600);
}

.nav-menu {
    list-style: none;
    padding: 0 1rem;
    margin: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.main-content {
    flex: 1;
    padding: 1rem;
    background: linear-gradient(to bottom right, #f8fafc, #f1f5f9);
    min-height: 100vh;
    width: 100%;
}

/* Components */
.card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 1rem;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
    border: 1px solid var(--border-light);
}

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

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    font-size: 0.85rem;
    gap: 0.5rem;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-600), var(--primary-500));
    color: white;
    box-shadow: 0 4px 6px -1px rgba(79, 70, 229, 0.2);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-700), var(--primary-600));
    box-shadow: 0 6px 8px -1px rgba(79, 70, 229, 0.3);
    transform: translateY(-1px);
}

.btn-secondary {
    background: white;
    color: var(--text-main);
    border: 1px solid var(--border-light);
}

.btn-secondary:hover {
    background: var(--primary-50);
    border-color: var(--primary-100);
    color: var(--primary-700);
}

.btn-secondary.active {
    background: var(--primary-600);
    color: white;
    border-color: var(--primary-600);
}

.btn-danger {
    background: var(--danger-500);
    color: white;
}

.btn-danger:hover {
    background: var(--danger-600);
}

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

/* Forms */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-main);
    font-size: 0.95rem;
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    font-size: 1rem;
    border-radius: var(--radius-lg);
    padding: 1rem;
    margin-bottom: 1.5rem;
    border: 1px solid var(--border-light);
}

.filter-row {
    display: grid;
    grid-template-columns: 2fr 1fr 1.5fr 1.5fr 1fr;
    gap: 1rem;
    align-items: end;
}

.filter-actions {

    .table {
        width: 100%;
        border-collapse: collapse;
        background: white;
    }

    .table th {
        background: var(--primary-50);
        color: var(--primary-700);
        font-weight: 600;
        text-transform: uppercase;
        font-size: 0.75rem;
        letter-spacing: 0.05em;
        padding: 1rem 1.5rem;
        text-align: left;
    }

    .table td {
        padding: 1rem 1.5rem;
        border-bottom: 1px solid var(--border-light);
        color: var(--text-main);
    }

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


    .justify-between {
        justify-content: space-between;
    }

    .gap-2 {
        gap: 0.5rem;
    }

    .mb-4 {
        margin-bottom: 1rem;
    }

    .mt-4 {
        margin-top: 1rem;
    }

    .text-right {
        text-align: right;
    }

    .w-full {
        width: 100%;
    }


    /* Filter Tabs */
    .filter-tabs {
        display: flex;
        gap: 0.5rem;
        margin-bottom: 1.5rem;
        border-bottom: 2px solid var(--border-light);
    }

    .filter-tab {
        padding: 0.75rem 1.5rem;
        text-decoration: none;
        color: var(--text-muted);
        border-bottom: 2px solid transparent;
        margin-bottom: -2px;
        transition: all 0.2s ease;
        display: flex;
        align-items: center;
        gap: 0.5rem;
    }

    .filter-tab:hover {
        color: var(--primary-600);
    }

    .filter-tab.active {
        color: var(--primary-600);
        border-bottom-color: var(--primary-600);
        font-weight: 600;
    }

    /* Warning Button */
    .btn-warning {
        background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
        color: white;
    }

    .btn-warning:hover {
        background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
        transform: translateY(-1px);
        box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
    }

    /* Alert Messages */
    .alert {
        padding: 1rem 1.5rem;
        border-radius: 8px;
        margin-bottom: 1.5rem;
        display: flex;
        --primary-50: rgba(79, 70, 229, 0.1);
        --primary-100: rgba(79, 70, 229, 0.2);
        --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
        --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4);
    }

    /* Dark Mode Styles */
    [data-theme="dark"] {
        --bg-body: #0f172a;
        --bg-card: rgba(30, 41, 59, 0.8);
        --text-main: #f1f5f9;
        --text-muted: #94a3b8;
        --text-light: #64748b;
        --border-light: rgba(51, 65, 85, 0.8);
    }

    [data-theme="dark"] body {
        background: #0f172a;
        color: #f1f5f9;
    }

    [data-theme="dark"] .sidebar {
        background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
        border-right-color: #334155;
    }

    [data-theme="dark"] .sidebar-header {
        border-bottom-color: #334155;
    }

    [data-theme="dark"] .nav-brand {
        color: #f1f5f9;
    }

    [data-theme="dark"] .nav-link {
        color: #94a3b8;
    }

    [data-theme="dark"] .nav-link:hover {
        background: rgba(99, 102, 241, 0.15);
        color: #818cf8;
    }

    [data-theme="dark"] .nav-link.active {
        background: rgba(99, 102, 241, 0.2);
        color: #818cf8;
    }

    [data-theme="dark"] .sidebar-footer {
        border-top-color: #334155;
    }

    [data-theme="dark"] .user-info {
        color: #94a3b8 !important;
    }

    [data-theme="dark"] .dark-mode-toggle {
        background: rgba(99, 102, 241, 0.1);
        border-color: rgba(99, 102, 241, 0.2);
    }

    [data-theme="dark"] .main-content {
        background: linear-gradient(to bottom right, #0f172a, #1e293b);
    }

    [data-theme="dark"] .card {
        background: rgba(30, 41, 59, 0.8);
        border-color: #334155;
        color: #f1f5f9;
    }

    [data-theme="dark"] .form-control {
        background: #1e293b;
        border-color: #334155;
        color: #f1f5f9;
    }

    [data-theme="dark"] .form-control:focus {
        border-color: var(--primary-500);
        background: #0f172a;
    }

    [data-theme="dark"] .form-label {
        color: #e2e8f0;
    }

    [data-theme="dark"] .table {
        background: transparent;
    }

    [data-theme="dark"] .table th {
        background: rgba(30, 41, 59, 0.9);
        color: #e2e8f0;
        border-bottom-color: #334155;
    }

    [data-theme="dark"] .table td {
        color: #cbd5e1;
        border-bottom-color: #334155;
    }

    [data-theme="dark"] .table tr:hover td {
        background: rgba(51, 65, 85, 0.3);
    }

    [data-theme="dark"] .btn-secondary {
        background: transparent;
        border-color: #475569;
        color: #f1f5f9;
    }

    [data-theme="dark"] .btn-secondary:hover {
        background: #475569;
        border-color: #64748b;
    }

    [data-theme="dark"] .alert {
        background: rgba(30, 41, 59, 0.6);
        border-color: #334155;
        color: #e2e8f0;
    }

    [data-theme="dark"] h1,
    [data-theme="dark"] h2,
    [data-theme="dark"] h3,
    [data-theme="dark"] h4 {
        color: #f1f5f9;
    }

    [data-theme="dark"] .section-title {
        color: #f1f5f9;
    }

    [data-theme="dark"] .text-muted {
        color: #94a3b8 !important;
    }

    /* Dark mode for settings tabs */
    [data-theme="dark"] .tabs-container {
        background: rgba(30, 41, 59, 0.8);
        border-color: #334155;
    }

    [data-theme="dark"] .tabs-nav {
        background: rgba(30, 41, 59, 0.9);
        border-bottom-color: #334155;
    }

    [data-theme="dark"] .tab-btn {
        color: #94a3b8;
    }

    [data-theme="dark"] .tab-btn:hover {
        color: #818cf8;
        background: rgba(99, 102, 241, 0.1);
    }

    [data-theme="dark"] .tab-btn.active {
        color: #818cf8;
        font-weight: 700;
        border-bottom-color: #818cf8;
    }

    [data-theme="dark"] .tab-content-wrapper {
        background: rgba(30, 41, 59, 0.8);
    }

    /* Dark mode improvements */
    [data-theme="dark"] select.form-control {
        background: #1e293b;
        border-color: #334155;
        color: #f1f5f9;
    }

    [data-theme="dark"] select.form-control option {
        background: #1e293b;
        color: #f1f5f9;
    }

    [data-theme="dark"] textarea.form-control {
        background: #1e293b;
        border-color: #334155;
        color: #f1f5f9;
    }

    [data-theme="dark"] .filter-form {
        background: rgba(30, 41, 59, 0.8);
        border-color: #334155;
    }

    [data-theme="dark"] small,
    [data-theme="dark"] .text-sm {
        color: #94a3b8 !important;
    }

    /* Dark mode for alerts and special backgrounds */
    [data-theme="dark"] .alert-warning {
        background: rgba(120, 53, 15, 0.3) !important;
        color: #fbbf24 !important;
        border-color: #92400e;
    }

    [data-theme="dark"] .alert-success {
        background: rgba(6, 95, 70, 0.3) !important;
        color: #34d399 !important;
        border-color: #065f46;
    }

    [data-theme="dark"] .alert-info {
        background: rgba(30, 64, 175, 0.3) !important;
        color: #93c5fd !important;
        border-color: #1e40af;
    }

    /* Dark mode for stat cards */
    [data-theme="dark"] .stat-card {
        background: rgba(30, 41, 59, 0.6);
        border-left-color: currentColor !important;
    }

    /* Dark mode for toggle switches */
    [data-theme="dark"] .slider {
        background-color: #475569;
    }

    [data-theme="dark"] .slider:before {
        background-color: #e2e8f0;
    }

    /* Dark mode for chart tabs */
    [data-theme="dark"] .chart-tab {
        color: #94a3b8;
    }

    [data-theme="dark"] .chart-tab:hover {
        color: #818cf8;
        background: rgba(99, 102, 241, 0.1);
    }

    [data-theme="dark"] .chart-tab.active {
        background: #4f46e5;
        color: white;
    }

    /* User Info Section in Sidebar */
    .sidebar-footer {
        margin-top: auto;
        padding-top: 1rem;
        border-top: 1px solid var(--border-light);
    }

    .alert-error {
        background: rgba(239, 68, 68, 0.1);
        border: 1px solid var(--danger-500);
        color: var(--danger-700);
    }

    /* Dark Mode Toggle Switch */
    .dark-mode-toggle {
        padding: 0.75rem;
        background: rgba(99, 102, 241, 0.05);
        border-radius: var(--radius-md);
        border: 1px solid rgba(99, 102, 241, 0.1);
    }

    .toggle-switch {
        display: flex;
        align-items: center;
        gap: 0.75rem;
        cursor: pointer;
        user-select: none;
    }

    .toggle-switch input[type="checkbox"] {
        position: relative;
        width: 44px;
        height: 24px;
        appearance: none;
        background: #cbd5e1;
        border-radius: 12px;
        cursor: pointer;
        transition: all 0.3s ease;
        flex-shrink: 0;
    }

    .toggle-switch input[type="checkbox"]:checked {
        background: var(--primary-600);
    }

    .toggle-switch input[type="checkbox"]::before {
        content: '';
        position: absolute;
        width: 18px;
        height: 18px;
        border-radius: 50%;
        background: white;
        top: 3px;
        left: 3px;
        transition: all 0.3s ease;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    }

    .toggle-switch input[type="checkbox"]:checked::before {
        transform: translateX(20px);
    }

    .toggle-label {
        display: flex;
        align-items: center;
        gap: 0.5rem;
        font-size: 0.875rem;
        font-weight: 500;
        color: var(--text-color);
    }

    .toggle-label i {
        font-size: 1rem;
        color: var(--primary-600);
    }

    .toggle-text {
        display: inline;
    }

    /* Global Search */
    .global-search {
        padding: 0 1rem 1rem 1rem;
        position: relative;
    }

    .search-input-wrapper {
        position: relative;
        display: flex;
        align-items: center;
    }

    .search-input-wrapper i {
        position: absolute;
        left: 0.75rem;
        color: var(--text-muted);
        font-size: 0.875rem;
    }

    .search-input-wrapper input {
        width: 100%;
        padding: 0.625rem 2.5rem 0.625rem 2.25rem;
        border: 1px solid var(--border-light);
        border-radius: var(--radius-md);
        font-size: 0.875rem;
        background: white;
        transition: all 0.2s ease;
    }

    .search-input-wrapper input:focus {
        outline: none;
        border-color: var(--primary-500);
        box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
    }

    .search-shortcut {
        position: absolute;
        right: 0.5rem;
        padding: 0.125rem 0.375rem;
        background: var(--bg-body);
        border: 1px solid var(--border-light);
        border-radius: 0.25rem;
        font-size: 0.625rem;
        font-family: monospace;
        color: var(--text-muted);
        pointer-events: none;
    }

    .search-results {
        position: absolute;
        top: calc(100% + 0.5rem);
        left: 1rem;
        right: 1rem;
        background: white;
        border: 1px solid var(--border-light);
        border-radius: var(--radius-md);
        box-shadow: var(--shadow-xl);
        max-height: 450px;
        overflow-y: auto;
        z-index: 1000;
    }

    .search-result-item {
        display: flex;
        align-items: center;
        gap: 0.75rem;
        padding: 0.875rem;
        border-bottom: 1px solid var(--border-light);
        cursor: pointer;
        transition: all 0.2s ease;
        text-decoration: none;
        color: inherit;
    }

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

    .search-result-item:hover {
        background: linear-gradient(135deg, rgba(99, 102, 241, 0.05) 0%, rgba(168, 85, 247, 0.05) 100%);
        transform: translateX(2px);
    }

    .search-result-avatar {
        width: 40px;
        height: 40px;
        border-radius: var(--radius-full);
        object-fit: cover;
        flex-shrink: 0;
        border: 2px solid var(--border-light);
    }

    .search-result-icon {
        width: 40px;
        height: 40px;
        border-radius: var(--radius-full);
        display: flex;
        align-items: center;
        justify-content: center;
        color: white;
        font-size: 1rem;
        flex-shrink: 0;
    }

    .search-result-content {
        flex: 1;
        min-width: 0;
    }

    .search-result-header {
        display: flex;
        align-items: center;
        gap: 0.5rem;
        margin-bottom: 0.25rem;
    }

    .search-result-type {
        display: inline-flex;
        align-items: center;
        gap: 0.25rem;
        padding: 0.125rem 0.5rem;
        border-radius: var(--radius-full);
        font-size: 0.625rem;
        font-weight: 600;
        color: white;
    }

    .search-result-badge {
        display: inline-block;
        padding: 0.125rem 0.5rem;
        border-radius: var(--radius-full);
        font-size: 0.625rem;
        font-weight: 500;
        color: white;
    }

    .status-indicator {
        width: 8px;
        height: 8px;
        border-radius: 50%;
        display: inline-block;
    }

    .status-indicator.status-active {
        background: var(--success-500);
    }

    .status-indicator.status-inactive {
        background: var(--text-muted);
    }

    .status-indicator.status-pending {
        background: var(--warning-500);
    }

    .search-result-title {
        font-weight: 600;
        color: var(--text-main);
        font-size: 0.875rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .search-result-title mark {
        background: rgba(251, 191, 36, 0.3);
        color: inherit;
        padding: 0.125rem 0;
        border-radius: 2px;
    }

    .search-result-subtitle {
        font-size: 0.75rem;
        color: var(--text-muted);
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .search-result-subtitle mark {
        background: rgba(251, 191, 36, 0.3);
        color: inherit;
        padding: 0.125rem 0;
        border-radius: 2px;
    }

    .search-no-results {
        padding: 3rem 2rem;
        text-align: center;
        color: var(--text-muted);
    }

    .search-no-results i {
        font-size: 3rem;
        margin-bottom: 1rem;
        opacity: 0.5;
    }

    .search-no-results {
        padding: 2rem;
        text-align: center;
        color: var(--text-muted);
    }

    /* ============================================
   RESPONSIVE DESIGN - MOBILE & TABLET
   ============================================ */

    /* Tablet (≤1024px) */


    /* Mobile (≤768px) */
    @media (max-width: 768px) {
        .sidebar {
            position: fixed !important;
            left: -280px;
            width: 280px;
            height: 100vh;
            top: 0;
            transition: left 0.3s ease;
            z-index: 1001 !important;
            background: white !important;
            box-shadow: 2px 0 8px rgba(0, 0, 0, 0.15);
            overflow-y: auto;
            overflow-x: hidden;
        }

        .sidebar.mobile-open {
            left: 0 !important;
        }

        .sidebar span,
        .sidebar-footer .user-info,
        .global-search {
            display: block !important;
        }

        .nav-link {
            justify-content: flex-start;
            padding: 0.875rem 1rem;
        }

        .nav-link i {
            margin-right: 0.875rem;
            font-size: 1rem;
        }

        .main-content {
            margin-left: 0;
            padding: 1rem;
        }

        /* Mobile menu toggle button */
        .mobile-menu-toggle {
            position: fixed;
            top: 1rem;
            left: 1rem;
            z-index: 1002;
            width: 40px;
            height: 40px;
            background: var(--primary-600);
            color: white;
            border: none;
            border-radius: var(--radius-md);
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            box-shadow: var(--shadow-md);
        }

        /* Mobile overlay */
        .mobile-overlay {
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: rgba(0, 0, 0, 0.5);
            z-index: 998;
            display: none;
        }

        .mobile-overlay.active {
            display: block;
        }

        /* Mobile Menu Modal */
        .mobile-menu-modal {
            position: fixed;
            top: 0;
            left: -100%;
            width: 80%;
            max-width: 300px;
            height: 100vh;
            background: white;
            z-index: 999;
            transition: left 0.3s ease;
            overflow-y: auto;
            box-shadow: 2px 0 10px rgba(0, 0, 0, 0.2);
        }

        .mobile-menu-modal.active {
            left: 0;
        }

        .mobile-menu-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 1rem;
            border-bottom: 1px solid var(--border-light);
            background: var(--primary-600);
            color: white;
        }

        .mobile-menu-header h3 {
            margin: 0;
            font-size: 1.25rem;
            color: white;
        }

        .mobile-menu-close {
            background: none;
            border: none;
            color: white;
            font-size: 1.5rem;
            cursor: pointer;
            padding: 0.5rem;
        }

        .mobile-menu-content {
            padding: 0.5rem 0;
        }

        .mobile-menu-item {
            display: flex;
            align-items: center;
            padding: 1rem 1.5rem;
            color: var(--text-main);
            text-decoration: none;
            transition: background 0.2s;
            border-left: 3px solid transparent;
        }

        .mobile-menu-item:hover {
            background: var(--primary-50);
            border-left-color: var(--primary-600);
        }

        .mobile-menu-item i {
            margin-right: 0.75rem;
            width: 20px;
            color: var(--primary-600);
        }

        /* Responsive tables */
        .table {
            display: block;
            overflow-x: auto;
            white-space: nowrap;
        }

        /* Responsive cards grid */
        .stats-grid,
        .expense-stats {
            grid-template-columns: 1fr !important;
        }

        /* Responsive forms */
        .form-group {
            grid-column: span 2 !important;
        }

        /* Hide less important columns on mobile */
        .table td:nth-child(n+4),
        .table th:nth-child(n+4) {
            display: none;
        }
    }

    /* Small Mobile (≤480px) */
    @media (max-width: 480px) {
        h1 {
            font-size: 1.5rem !important;
        }

        h2 {
            font-size: 1.25rem !important;
        }

        .btn {
            padding: 0.625rem 1rem;
            font-size: 0.875rem;
        }

        .card {
            padding: 1rem;
        }

        /* Stack action buttons vertically */
        .btn-group {
            flex-direction: column;
            width: 100%;
        }

        .btn-group .btn {
            width: 100%;
            margin-bottom: 0.5rem;
        }
    }

    /* ============================================
   NOTIFICATIONS SYSTEM
   ============================================ */

    .notifications-bell {
        position: relative;
    }

    .btn-notification {
        display: flex;
        align-items: center;
        gap: 0.5rem;
        width: 100%;
        padding: 0.625rem 0.875rem;
        background: var(--bg-glass);
        border: 1px solid var(--border-light);
        border-radius: var(--radius-md);
        color: var(--text-main);
        cursor: pointer;
        transition: var(--transition);
        font-size: 0.875rem;
        font-weight: 500;
        position: relative;
    }

    .btn-notification:hover {
        background: var(--primary-50);
        border-color: var(--primary-500);
        color: var(--primary-600);
        transform: translateY(-1px);
        box-shadow: var(--shadow-sm);
    }

    .btn-notification i {
        font-size: 1rem;
    }

    .notification-badge {
        position: absolute;
        top: -4px;
        right: -4px;
        background: var(--danger-500);
        color: white;
        font-size: 0.65rem;
        font-weight: 700;
        padding: 0.15rem 0.4rem;
        border-radius: var(--radius-full);
        min-width: 1.25rem;
        text-align: center;
        box-shadow: 0 2px 4px rgba(239, 68, 68, 0.3);
        animation: pulse 2s infinite;
    }

    @keyframes pulse {

        0%,
        100% {
            opacity: 1;
            transform: scale(1);
        }

        50% {
            opacity: 0.8;
            transform: scale(1.05);
        }
    }

    .notifications-dropdown {
        position: absolute;
        bottom: calc(100% + 0.5rem);
        left: 0;
        width: 380px;
        max-height: 500px;
        background: var(--bg-card);
        border: 1px solid var(--border-light);
        border-radius: var(--radius-lg);
        box-shadow: var(--shadow-lg);
        overflow: hidden;
        z-index: 1000;
        backdrop-filter: blur(10px);
    }

    .notifications-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 1rem 1.25rem;
        border-bottom: 1px solid var(--border-light);
        background: var(--bg-glass);
    }

    .notifications-header h3 {
        margin: 0;
        font-size: 1rem;
        font-weight: 700;
        color: var(--text-main);
    }

    .btn-link-small {
        background: none;
        border: none;
        color: var(--primary-600);
        font-size: 0.8125rem;
        font-weight: 600;
        cursor: pointer;
        transition: var(--transition);
    }

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

    .notifications-list {
        max-height: 360px;
        overflow-y: auto;
    }

    .notification-item {
        display: flex;
        gap: 0.875rem;
        padding: 0.875rem 1.25rem;
        border-bottom: 1px solid var(--border-light);
        cursor: pointer;
        transition: var(--transition);
        position: relative;
    }

    .notification-item:hover {
        background: var(--primary-50);
    }

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

    .notification-item.unread {
        background: rgba(99, 102, 241, 0.03);
    }

    .notification-item.unread:hover {
        background: rgba(99, 102, 241, 0.08);
    }

    .notification-icon {
        flex-shrink: 0;
        width: 2.5rem;
        height: 2.5rem;
        display: flex;
        align-items: center;
        justify-content: center;
        background: var(--primary-100);
        color: var(--primary-600);
        border-radius: var(--radius-md);
        font-size: 1.125rem;
    }

    .notification-content {
        flex: 1;
        min-width: 0;
    }

    .notification-title {
        font-weight: 600;
        font-size: 0.875rem;
        color: var(--text-main);
        margin-bottom: 0.25rem;
    }

    .notification-message {
        font-size: 0.8125rem;
        color: var(--text-muted);
        line-height: 1.4;
        overflow: hidden;
        text-overflow: ellipsis;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        line-clamp: 2;
        -webkit-box-orient: vertical;
    }

    .notification-time {
        font-size: 0.75rem;
        color: var(--text-light);
        margin-top: 0.25rem;
    }

    .notification-dot {
        position: absolute;
        top: 50%;
        right: 1rem;
        transform: translateY(-50%);
        width: 8px;
        height: 8px;
        background: var(--primary-500);
        border-radius: 50%;
        animation: pulse 2s infinite;
    }

    .notification-loading,
    .notification-empty,
    .notification-error {
        padding: 2rem;
        text-align: center;
        color: var(--text-muted);
        font-size: 0.875rem;
    }

    .notification-empty i {
        font-size: 2rem;
        margin-bottom: 0.5rem;
        color: var(--secondary-500);
        display: block;
    }

    .notification-loading i {
        font-size: 1.5rem;
        color: var(--primary-500);
    }

    .notification-error {
        color: var(--danger-500);
    }

    .notifications-footer {
        padding: 0.75rem 1.25rem;
        border-top: 1px solid var(--border-light);
        text-align: center;
        background: var(--bg-glass);
    }

    .notifications-footer .btn-link {
        color: var(--primary-600);
        font-weight: 600;
        font-size: 0.875rem;
        text-decoration: none;
        display: inline-flex;
        align-items: center;
        gap: 0.375rem;
        transition: var(--transition);
    }

    .notifications-footer .btn-link:hover {
        color: var(--primary-700);
        gap: 0.625rem;
    }

    /* Dark Mode for Notifications */
    [data-theme="dark"] .btn-notification {
        background: rgba(51, 65, 85, 0.5);
        border-color: rgba(100, 116, 139, 0.3);
        color: var(--text-main);
    }

    [data-theme="dark"] .btn-notification:hover {
        background: rgba(99, 102, 241, 0.15);
        border-color: var(--primary-500);
        color: var(--primary-400);
    }

    [data-theme="dark"] .notifications-dropdown {
        background: rgba(30, 41, 59, 0.95);
        border-color: rgba(100, 116, 139, 0.3);
    }

    [data-theme="dark"] .notifications-header,
    [data-theme="dark"] .notifications-footer {
        background: rgba(51, 65, 85, 0.5);
        border-color: rgba(100, 116, 139, 0.3);
    }

    [data-theme="dark"] .notification-item {
        border-color: rgba(100, 116, 139, 0.2);
    }

    [data-theme="dark"] .notification-item:hover {
        background: rgba(99, 102, 241, 0.1);
    }

    [data-theme="dark"] .notification-item.unread {
        background: rgba(99, 102, 241, 0.08);
    }

    [data-theme="dark"] .notification-icon {
        background: rgba(99, 102, 241, 0.15);
        color: var(--primary-400);
    }

    /* Export Dropdown */
    .dropdown {
        display: inline-block;
        position: relative;
    }

    .dropdown-toggle {
        cursor: pointer;
    }

    .dropdown-menu {
        position: absolute;
        top: calc(100% + 0.5rem);
        right: 0;
        min-width: 200px;
        background: var(--bg-card);
        border: 1px solid var(--border-light);
        border-radius: var(--radius-md);
        box-shadow: var(--shadow-lg);
        padding: 0.5rem 0;
        z-index: 1000;
        backdrop-filter: blur(10px);
    }

    .dropdown-item {
        display: flex;
        align-items: center;
        gap: 0.75rem;
        padding: 0.625rem 1rem;
        color: var(--text-main);
        text-decoration: none;
        font-size: 0.875rem;
        transition: var(--transition);
    }

    .dropdown-item:hover {
        background: var(--primary-50);
        color: var(--primary-700);
    }

    .dropdown-item i {
        width: 1.25rem;
        font-size: 1rem;
    }

    [data-theme="dark"] .dropdown-menu {
        background: rgba(30, 41, 59, 0.95);
        border-color: rgba(100, 116, 139, 0.3);
    }

    [data-theme="dark"] .dropdown-item:hover {
        background: rgba(99, 102, 241, 0.1);
        color: var(--primary-400);
    }

    /* Responsive Notifications */
    @media (max-width: 768px) {
        .notifications-dropdown {
            width: calc(100vw - 2rem);
            left: 50%;
            transform: translateX(-50%);
        }

        .notification-text {
            display: none;
        }

        .btn-notification {
            justify-content: center;
        }

        .dropdown-menu {
            right: auto;
            left: 0;
        }
    }

    /* ============================================
   Avatar System
   ============================================ */
    .avatar {
        position: relative;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        border-radius: 50%;
        overflow: hidden;
        flex-shrink: 0;
    }

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

    .avatar-initials {
        font-weight: 600;
        color: white;
        user-select: none;
    }

    .avatar-xs {
        width: 24px;
        height: 24px;
        font-size: 0.625rem;
    }

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

    .avatar-md {
        width: 40px;
        height: 40px;
        font-size: 0.875rem;
    }

    .avatar-lg {
        width: 48px;
        height: 48px;
        font-size: 1rem;
    }

    .avatar-xl {
        width: 64px;
        height: 64px;
        font-size: 1.25rem;
    }

    .avatar-2xl {
        width: 96px;
        height: 96px;
        font-size: 1.875rem;
    }

    .avatar-3xl {
        width: 128px;
        height: 128px;
        font-size: 2.5rem;
    }

    .avatar-status {
        position: absolute;
        bottom: 0;
        right: 0;
        width: 25%;
        height: 25%;
        border-radius: 50%;
        border: 2px solid white;
    }

    .avatar-status-active {
        background: var(--success-500);
    }

    .avatar-status-inactive {
        background: var(--text-muted);
    }

    .avatar-group {
        display: flex;
        align-items: center;
    }

    .avatar-group .avatar {
        margin-left: -0.5rem;
        border: 2px solid white;
        transition: transform 0.2s ease;
    }

    .avatar-group .avatar:first-child {
        margin-left: 0;
    }

    .avatar-group .avatar:hover {
        transform: translateY(-2px);
        z-index: 1;
    }

    .avatar-upload {
        position: relative;
        display: inline-block;
    }

    .avatar-upload input[type="file"] {
        display: none;
    }

    .avatar-upload-btn {
        position: absolute;
        bottom: 0;
        right: 0;
        width: 32px;
        height: 32px;
        background: var(--primary-600);
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        transition: all 0.2s ease;
        border: 2px solid white;
        color: white;
    }

    .avatar-upload-btn:hover {
        background: var(--primary-700);
        transform: scale(1.1);
    }

    .avatar-upload-btn i {
        font-size: 0.75rem;
    }

    /* Map and geolocation styles */
    #map {
        z-index: 1;
    }

    .leaflet-popup-content {
        margin: 10px;
    }

    @media (max-width: 768px) {
        #map {
            height: 400px !important;
        }

        .btn-sm {
            padding: 0.25rem 0.5rem;
            font-size: 0.75rem;
        }

        /* Make GPS button more visible on mobile */
        #getLocationBtn {
            font-size: 0.85rem;
            padding: 0.4rem 0.6rem;
        }

        /* Improve touch targets for mobile */
        .nav-link {
            padding: 0.75rem 1rem;
            min-height: 44px;
        }
    }

/* ============================================
   Social Media Sharing Styles
   ============================================ */

.social-share-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
}

.social-share-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    border: none;
    border-radius: 0.375rem;
    color: white;
    font-weight: 500;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.social-share-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
    opacity: 0.9;
}

.social-share-btn:active {
    transform: translateY(0);
}

.social-share-btn i {
    font-size: 1rem;
}

/* Size variants */
.social-share-small .social-share-btn {
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
}

.social-share-small .social-share-btn i {
    font-size: 0.875rem;
}

.social-share-large .social-share-btn {
    padding: 0.875rem 1.75rem;
    font-size: 1rem;
}

.social-share-large .social-share-btn i {
    font-size: 1.25rem;
}

/* Icon-only variant */
.social-share-icon-only .social-share-btn {
    padding: 0.625rem;
    width: 2.5rem;
    height: 2.5rem;
    justify-content: center;
}

.social-share-icon-only .social-share-btn span {
    display: none;
}

/* Platform-specific colors */
.social-share-facebook {
    background-color: #1877f2;
}

.social-share-twitter {
    background-color: #1da1f2;
}

.social-share-linkedin {
    background-color: #0077b5;
}

.social-share-whatsapp {
    background-color: #25d366;
}

.social-share-telegram {
    background-color: #0088cc;
}

.social-share-copy {
    background-color: #6c757d;
}

/* Toast notifications */
.social-share-toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: white;
    padding: 1rem 1.5rem;
    border-radius: 0.5rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    z-index: 9999;
    opacity: 0;
    transform: translateY(1rem);
    transition: all 0.3s ease;
}

.social-share-toast.show {
    opacity: 1;
    transform: translateY(0);
}

.social-share-toast i {
    font-size: 1.25rem;
}

.social-share-toast-success {
    border-left: 4px solid #22c55e;
}

.social-share-toast-success i {
    color: #22c55e;
}

.social-share-toast-error {
    border-left: 4px solid #ef4444;
}

.social-share-toast-error i {
    color: #ef4444;
}

/* Responsive */
@media (max-width: 768px) {
    .social-share-buttons {
        gap: 0.5rem;
    }
    
    .social-share-btn {
        padding: 0.5rem 1rem;
        font-size: 0.813rem;
    }
    
    .social-share-toast {
        bottom: 1rem;
        right: 1rem;
        left: 1rem;
    }
}