@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
    /* Colors */
    --primary: #1E5BB8;
    --primary-hover: #164a99;
    --primary-light: #e8f1fd;
    --secondary: #10b981;
    --background: #F5F7FB;
    --surface: #ffffff;
    --text: #1a202c;
    --text-light: #718096;
    --text-muted: #a0aec0;
    --border: #e2e8f0;
    --error: #ef4444;
    --success: #10b981;
    --warning: #f59e0b;

    /* Sidebar Gradient */
    --sidebar-gradient-start: #1E3A8A;
    --sidebar-gradient-end: #2563EB;
    --sidebar-text: #cbd5e0;
    --sidebar-text-active: #ffffff;

    /* Shadows */
    --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.08);
    --shadow: 0 4px 12px 0 rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 10px 24px 0 rgba(0, 0, 0, 0.1);
    --radius: 14px;
    --radius-sm: 8px;
}



/* Smooth transition for theme changes */
body,
.sidebar,
.main-content,
.top-header,
.table-container,
.kpi-card,
.widget-card,
.nav-item,
.data-table th,
.data-table td {
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

body {
    background-color: var(--background);
    color: var(--text);
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* Toast */
.toast {
    position: fixed;
    top: 24px;
    right: 24px;
    padding: 16px 24px;
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    z-index: 1000;
    animation: slideIn 0.3s ease-out;
    display: flex;
    align-items: center;
    font-weight: 500;
    border-left: 4px solid var(--primary);
}

.toast-success {
    border-left-color: var(--success);
}

.toast-error {
    border-left-color: var(--error);
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Common Components */
button {
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    border: none;
    border-radius: var(--radius);
    transition: all 0.2s;
    padding: 10px 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-primary {
    background-color: var(--primary);
    color: white;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
}

/* Layout */
.app-container {
    display: flex;
    min-height: 100vh;
    position: relative;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background: linear-gradient(180deg, var(--sidebar-gradient-start) 0%, var(--sidebar-gradient-end) 100%);
    color: var(--sidebar-text);
    padding: 0;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.05);
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    overflow-y: auto;
    z-index: 100;
}

/* Hide scrollbar but keep functionality */
.sidebar::-webkit-scrollbar {
    width: 4px;
}

.sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
}

.sidebar .logo {
    padding: 24px;
    margin-bottom: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
}

.sidebar .logo h2 {
    color: white;
    font-size: 20px;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.sidebar nav {
    padding: 12px 16px;
    flex: 1;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    color: var(--sidebar-text);
    text-decoration: none;
    transition: all 0.3s ease;
    border-radius: 10px;
    font-weight: 500;
    font-size: 14px;
    margin-bottom: 4px;
    position: relative;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--sidebar-text-active);
    transform: scale(1.05);
    font-weight: 600;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
    letter-spacing: 0.5px;
}

.nav-item.active {
    background: rgba(255, 255, 255, 0.15);
    color: var(--sidebar-text-active);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.nav-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 24px;
    background: white;
    border-radius: 0 4px 4px 0;
}

/* Sidebar User Section */
.sidebar-user-section {
    margin-top: auto;
    padding: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
}

.user-avatar {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.user-details {
    flex: 1;
}

.user-name {
    color: white;
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 2px;
}

.user-role {
    color: rgba(255, 255, 255, 0.7);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sidebar-logout-btn {
    width: 100%;
    padding: 10px;
    background: rgba(239, 68, 68, 0.9);
    color: white;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 13px;
}

.sidebar-logout-btn:hover {
    background: rgba(239, 68, 68, 1);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    background: var(--background);
    margin-left: 0;
    width: 100%;
    min-height: 100vh;
    transition: margin-left 0.3s ease, width 0.3s ease;
}

/* Sidebar Hidden State */
body.sidebar-hidden .sidebar {
    transform: translateX(-260px);
}

body.sidebar-hidden .main-content {
    margin-left: 0;
    width: 100%;
}

.top-header {
    background: var(--surface);
    padding: 16px 32px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 16px;
    flex: 1;
    /* Ensure balanced width */
}

.header-right {
    display: flex;
    align-items: center;
    gap: 16px;
    flex: 1;
    /* Ensure balanced width */
    justify-content: flex-end;
    /* Push content to right */
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--background);
    padding: 8px 16px;
    border-radius: 24px;
    font-size: 14px;
}

.user-role-badge {
    background: var(--primary-light);
    color: var(--primary);
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.user-info b {
    color: var(--text);
    font-weight: 600;
}

/* Logout Button in Header */
.logout-btn-header {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--error);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.logout-btn-header:hover {
    background: #dc2626;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(239, 68, 68, 0.3);
}

.logout-btn-header svg {
    width: 20px;
    height: 20px;
}

/* Page Content */
#page-content {
    padding: 32px;
    max-width: 1600px;
    margin: 0 auto;
    width: 100%;
}

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

.page-header h1 {
    font-size: 28px;
    font-weight: 700;
    color: var(--text);
    margin: 0;
}

.fy-selector {
    background: var(--surface);
    border: 1px solid var(--border);
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    color: var(--primary);
    cursor: pointer;
    transition: all 0.2s;
}

.fy-selector:hover {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

/* Cards & Tables */
.table-container {
    background: var(--surface);
    padding: 24px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

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

.text-center {
    text-align: center !important;
}

/* Hide print-only elements on screen */
.print-only-header {
    display: none;
}

.data-table th {
    background-color: #f8fafc;
    padding: 12px 16px;
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--text-light);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
    /* Added nowrap */
}

.data-table td {
    padding: 12px 16px;
    /* Changed from 16px to 12px 16px */
    border-bottom: 1px solid var(--border);
    color: var(--text);
    white-space: nowrap;
    /* Added nowrap */
}

.action-buttons {
    display: flex;
    gap: 8px;
    align-items: center;
}

.action-buttons button {
    padding: 4px 10px;
    font-size: 12px;
    border-radius: 4px;
    cursor: pointer;
    border: 1px solid transparent;
}

.edit-btn {
    background: #e0f2fe;
    color: #0369a1;
    border-color: #bae6fd;
}

.delete-btn {
    background: #fef2f2;
    color: #ef4444;
    border-color: #fee2e2;
}

.delete-btn:hover {
    background: #fee2e2;
}

.edit-btn:hover {
    background: #bae6fd;
}

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

.data-table tr:hover td {
    background-color: #f8fafc;
}

/* Forms */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 14px;
    transition: 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Badges */
.status-badge {
    padding: 4px 10px;
    border-radius: 9999px;
    font-size: 12px;
    font-weight: 500;
}

.status-badge.paid {
    background-color: #dcfce7;
    color: #166534;
}

.status-badge.unpaid {
    background-color: #fee2e2;
    color: #991b1b;
}

.status-badge.partial {
    background-color: #fef3c7;
    color: #92400e;
}

.status-badge.receipt {
    background-color: #dcfce7;
    color: #166534;
}

.status-badge.payment {
    background-color: #e0f2fe;
    color: #0369a1;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(4px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: var(--surface);
    padding: 32px;
    border-radius: 12px;
    width: 100%;
    max-width: 500px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    transform: scale(1);
    animation: modalPop 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalPop {
    from {
        opacity: 0;
        transform: scale(0.95);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.close {
    float: right;
    font-size: 24px;
    color: var(--text-light);
    cursor: pointer;
}

.close:hover {
    color: var(--text);
}

/* Dashboard High-Fidelity CSS */

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

.fy-selector {
    background: var(--white);
    border: 1px solid var(--border);
    padding: 8px 16px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 500;
    color: var(--primary);
    cursor: pointer;
}

/* KPI Row */
.kpi-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    /* 6 cols on large screens */
    gap: 16px;
    margin-bottom: 24px;
}

.kpi-card {
    background: var(--surface);
    padding: 20px;
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 140px;
}

.kpi-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 5px;
}

.kpi-label {
    font-size: 13px;
    color: var(--text-light);
    font-weight: 500;
}

.kpi-icon {
    color: var(--primary);
}

.kpi-value {
    font-size: 20px;
    font-weight: 700;
    color: var(--text);
    margin: 8px 0;
}

.kpi-trend {
    font-size: 11px;
    color: var(--text-light);
}

.kpi-trend span {
    font-weight: 600;
}

.kpi-trend span.up {
    color: var(--success);
}

.kpi-trend span.down {
    color: var(--error);
}

/* Main Chart */
.chart-container-large {
    position: relative;
    height: 300px;
    width: 100%;
}

.mb-32 {
    margin-bottom: 24px;
}

.h-auto {
    height: auto;
}

/* Bottom Grid Complex */
.bottom-complex-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    /* 50% 25% 25% approx */
    gap: 24px;
}

@media (max-width: 1280px) {
    .bottom-complex-grid {
        grid-template-columns: 1fr 1fr;
    }

    .gst-panel {
        grid-column: span 2;
    }
}

@media (max-width: 768px) {
    .bottom-complex-grid {
        grid-template-columns: 1fr;
    }

    .gst-panel {
        grid-column: span 1;
    }
}

.widget-card {
    background: var(--surface);
    border-radius: 12px;
    padding: 24px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
}

.widget-header h3 {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 16px;
}

/* GST Layout */
.gst-layout {
    display: flex;
    gap: 24px;
}

.gst-cards-grid {
    flex: 1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.gst-mini-card {
    background: #f8fafc;
    border-radius: 8px;
    padding: 12px;
    border: 1px solid var(--border);
}

.gst-label {
    font-size: 11px;
    color: var(--text-light);
    margin-bottom: 4px;
}

.gst-val {
    font-size: 16px;
    font-weight: 700;
    color: var(--text);
}

.gst-trend {
    font-size: 10px;
    margin-top: 4px;
}

.gst-chart-section {
    flex: 0 0 200px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.chart-wrapper-doughnut {
    width: 140px;
    height: 140px;
    position: relative;
}

/* Vendor List */
.vendor-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
}

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

.v-name {
    font-weight: 500;
    color: var(--text);
}

.v-amt {
    font-weight: 600;
    color: var(--text);
}

.v-days {
    font-size: 11px;
    color: var(--text-light);
    background: #f1f5f9;
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 8px;
}

/* Quick Actions */
.quick-actions-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.action-btn {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 10px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s;
    background: #2563eb;
    color: white;
}

.action-btn:hover {
    background: #1d4ed8;
}

.icon-box {
    width: 24px;
    height: 24px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
    font-weight: 700;
}

/* Sidebar Customers Widget */
.sidebar-widget {
    margin: 24px 16px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 16px;
    color: white;
}

.sb-widget-title {
    font-size: 12px;
    opacity: 0.7;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.cust-item {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
    font-size: 12px;
}

.cust-icon {
    width: 20px;
    height: 20px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 8px;
    font-size: 10px;
}

.cust-name {
    flex: 1;
}

.cust-val {
    font-weight: 600;
    opacity: 0.9;
}

/* Theme Toggle Button */
.theme-toggle {
    position: relative;
    width: 60px;
    height: 32px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50px;
    cursor: pointer;
    border: none;
    overflow: hidden;
    transition: all 0.4s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.theme-toggle:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.theme-toggle-inner {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 6px;
}

.theme-icon {
    font-size: 16px;
    z-index: 2;
    transition: all 0.4s ease;
}

.theme-toggle .sun {
    transform: translateX(0) rotate(0deg);
    opacity: 1;
}

.theme-toggle .moon {
    transform: translateX(10px) rotate(180deg);
    opacity: 0;
}

.theme-toggle .cloud {
    position: absolute;
    font-size: 20px;
    left: -30px;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0;
    transition: all 0.6s ease;
    z-index: 3;
}

.theme-slider {
    position: absolute;
    width: 24px;
    height: 24px;
    background: white;
    border-radius: 50%;
    top: 4px;
    left: 4px;
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.27, 1.55);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

/* Dark theme state */
[data-theme="dark"] .theme-toggle {
    background: linear-gradient(135deg, #1e3a8a 0%, #0f172a 100%);
}

[data-theme="dark"] .theme-toggle .sun {
    transform: translateX(-10px) rotate(-180deg);
    opacity: 0;
}

[data-theme="dark"] .theme-toggle .moon {
    transform: translateX(0) rotate(0deg);
    opacity: 1;
}

[data-theme="dark"] .theme-toggle .cloud {
    left: 8px;
    opacity: 1;
    animation: cloudFloat 0.6s ease;
}

[data-theme="dark"] .theme-slider {
    left: 32px;
}

@keyframes cloudFloat {
    0% {
        left: -30px;
        opacity: 0;
    }

    50% {
        opacity: 1;
    }

    100% {
        left: 8px;
        opacity: 1;
    }
}

/* ==================== HEADER NAVIGATION (GLOBAL) ==================== */
.header-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: auto;
    /* Changed from flex: 1 */
    margin: 0 20px;
}

.header-nav-item {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-light);
    /* Using text-light from style.css var */
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    padding: 10px 16px;
    border-radius: 9999px;
    transition: all 0.2s ease;
    position: relative;
    cursor: pointer;
}

.header-nav-item:hover {
    color: var(--primary);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
    transform: translateY(-1px);
}

.header-nav-item.active {
    color: var(--primary);
    background: var(--primary-light);
    font-weight: 600;
}

.header-nav-item img {
    height: 18px;
    width: auto;
}

/* Dropdown Container */
.nav-dropdown {
    position: relative;
    display: flex;
    align-items: center;
    height: 100%;
    /* Ensure full height for hover area */
}

/* Dropdown Content */
.dropdown-content {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    min-width: 200px;
    background-color: var(--surface);
    box-shadow: var(--shadow-lg);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    padding: 6px;
    z-index: 9999;
    animation: fadeIn 0.2s ease-in-out;
    transform-origin: top right;
}

/* Transparent bridge to prevent closing when moving mouse */
.dropdown-content::before {
    content: "";
    display: block;
    position: absolute;
    top: -10px;
    /* Covers the gap */
    left: 0;
    width: 100%;
    height: 10px;
}

/* HOVER STATE - CRITICAL */
.nav-dropdown:hover .dropdown-content {
    display: block;
}

.dropdown-item {
    display: block;
    padding: 10px 16px;
    color: var(--text-light);
    text-decoration: none;
    font-size: 14px;
    border-radius: var(--radius-sm);
    transition: all 0.2s;
    margin-bottom: 2px;
}

.dropdown-item:hover {
    background-color: var(--background);
    color: var(--primary);
    transform: translateX(2px);
}

.dropdown-item.active {
    color: var(--primary);
    background: var(--primary-light);
    font-weight: 600;
}

.dropdown-trigger {
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
}

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

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==================== HEADER NAVIGATION (GLOBAL) ==================== */
.header-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    /* Center the navigation */
    gap: 8px;
    /* Reduced gap, using padding on items instead */
    width: auto;
    /* Take necessary space */
    margin: 0 20px;
}

.header-nav-item {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-light);
    /* Using text-light from style.css var */
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    padding: 10px 16px;
    /* Larger click area */
    border-radius: 9999px;
    /* Pill shape */
    transition: all 0.2s ease;
    position: relative;
    cursor: pointer;
}

.header-nav-item:hover {
    color: var(--primary);
    background: var(--surface);
    /* Or a light gray if surface is white */
    box-shadow: var(--shadow-sm);
    transform: translateY(-1px);
}

.header-nav-item.active {
    color: var(--primary);
    background: var(--primary-light);
    font-weight: 600;
}

/* Home Icon specific styling */
.header-nav-item img {
    height: 18px;
    width: auto;
}

/* Dropdown Container */
.nav-dropdown {
    position: relative;
    display: flex;
    align-items: center;
}

/* Dropdown Content */
.dropdown-content {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 200px;
    background-color: var(--surface);
    box-shadow: var(--shadow-lg);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    padding: 6px;
    z-index: 1000;
    animation: fadeIn 0.2s ease-in-out;
    transform-origin: top right;
}

.nav-dropdown:hover .dropdown-content {
    display: block;
}

/* Dropdown Items */
.dropdown-item {
    display: block;
    padding: 10px 16px;
    color: var(--text-light);
    text-decoration: none;
    font-size: 14px;
    border-radius: var(--radius-sm);
    transition: all 0.2s;
    margin-bottom: 2px;
}

.dropdown-item:hover {
    background-color: var(--background);
    color: var(--primary);
    transform: translateX(2px);
}

.dropdown-item.active {
    color: var(--primary);
    background: var(--primary-light);
    font-weight: 600;
}

/* Dropdown trigger styling */
.dropdown-trigger {
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    /* Inherits .header-nav-item styles */
}

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

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Auto-Refresh Controls */
.auto-refresh-control {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 8px 16px;
    background: var(--background);
    border-radius: 24px;
    border: 1px solid var(--border);
}

.auto-refresh-info {
    display: flex;
    align-items: center;
    gap: 8px;
}

.refresh-icon {
    width: 18px;
    height: 18px;
    color: var(--text-light);
    transition: transform 0.3s ease;
}

.refresh-icon.spinning {
    animation: spin 0.8s linear;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.last-updated {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
    min-width: 120px;
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #cbd5e0;
    transition: .3s;
    border-radius: 24px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .3s;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.toggle-switch input:checked+.toggle-slider {
    background-color: var(--primary);
}

.toggle-switch input:checked+.toggle-slider:before {
    transform: translateX(20px);
}

.toggle-switch input:focus+.toggle-slider {
    box-shadow: 0 0 0 3px var(--primary-light);
}

/* Refreshing pulse effect */
@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.7;
    }
}

.refreshing {
    animation: pulse 1.5s ease-in-out infinite;
}