/* -------------------------------
   Base Typography and Colors
--------------------------------*/
html {
    font-size: 14px;
}

@media (min-width: 768px) {
    html {
        font-size: 16px;
    }
}

body {
    font-family: 'Segoe UI', Arial, sans-serif;
    background-color: #f8f9fa;
    margin: 0;
}

/* -------------------------------
   Navbar (Top Bar)
--------------------------------*/
.navbar {
    height: 56px;
    z-index: 1000;
}

/* -------------------------------
   Sidebar
--------------------------------*/
.sidebar {
    position: fixed;
    top: 56px; /* aligns below the navbar */
    bottom: 0;
    left: 0;
    z-index: 100; /* behind navbar */
    padding: 0;
    overflow-x: hidden;
    overflow-y: auto;
    border-right: 1px solid #dee2e6;
    background-color: #f8f9fa;
    width: 240px;
}

    .sidebar .nav-link {
        color: #333;
        padding: 0.75rem 1rem;
        display: flex;
        align-items: center;
        gap: 8px;
    }

        .sidebar .nav-link:hover {
            background-color: #e9ecef;
            color: #000;
        }

        .sidebar .nav-link.active {
            background-color: #0d6efd;
            color: #fff !important;
            font-weight: 500;
        }

/* -------------------------------
   Main Content
--------------------------------*/
main {
    margin-left: 240px; /* width of sidebar */
    padding: 1.5rem;
    padding-top: 2rem;
}

@media (max-width: 991.98px) {
    main {
        margin-left: 0;
    }
}

/* -------------------------------
   Utility: Buttons and Focus Styles
--------------------------------*/
.btn:focus,
.btn:active:focus,
.btn-link.nav-link:focus,
.form-control:focus,
.form-check-input:focus {
    box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

/* -------------------------------
   Footer (optional)
--------------------------------*/
footer {
    border-top: 1px solid #dee2e6;
    background-color: #fff;
    padding: 0.5rem 0;
    text-align: center;
    color: #6c757d;
    position: fixed;
    bottom: 0;
    width: 100%;
}

/* Sidebar transitions for smooth open/close on mobile */
.sidebar.collapse {
    transition: all 0.3s ease;
}

@media (max-width: 767.98px) {
    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
        top: 0;
        border-right: none;
    }

    main {
        margin-left: 0 !important;
    }
}
.navbar,
.navbar.sticky-top {
    overflow: visible !important;
}
    .navbar .dropdown-menu {
        position: absolute !important;
        top: 100% !important;
        right: 0;
        left: auto;
        transform: none !important;
        margin-top: 0 !important;
        z-index: 2000 !important;
    }
.modal-body {
    overflow: visible !important;
}

#customRangePicker {
    position: relative !important;
    z-index: 9999 !important;
    /* Mobile improvements */
    @media (max-width: 576px) {
        .kpi-card {
            margin-bottom: 12px;
        }
    }
    /* --- MOBILE OPTIMIZATION --- */
    @media (max-width: 768px) {
        h3 {
            font-size: 1.4rem;
        }