:root {
    /* ================= CORE PALETTE ================= */
    --rms-bg: #f4f6fb;
    --rms-surface: #ffffff;
    --rms-dark: #111827;
    --rms-muted: #6b7280;

    --rms-primary: #1f2937;
    --rms-accent: #2563eb;

    --rms-success: #16a34a;
    --rms-warning: #f59e0b;
    --rms-danger: #dc2626;
    --rms-info: #0ea5e9;

    --rms-border: #e5e7eb;

    /* ================= SHADOWS ================= */
    --shadow-sm: 0 2px 10px rgba(0,0,0,0.05);
    --shadow-md: 0 6px 18px rgba(0,0,0,0.08);
    --shadow-lg: 0 12px 30px rgba(0,0,0,0.12);

    /* ================= RADIUS ================= */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --mobile-topbar-height: 64px;
}


/* ================= GLOBAL RESET ================= */
* {
    box-sizing: border-box;
}

body {
    background: linear-gradient(180deg, #f4f6fb 0%, #f8fafc 100%);
    font-family: "Segoe UI", Roboto, Arial, sans-serif;
    margin: 0;
    padding: 0;
    color: var(--rms-dark);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    text-decoration: none;
    color: inherit;
    -webkit-tap-highlight-color: transparent;
}

img {
    max-width: 100%;
}

/* ================= LAYOUT ================= */
.main-content {
    min-height: 100vh;
}



.page-header {
    margin: 10px 0 25px;
}

.page-header h4 {
    font-weight: 700;
    font-size: 1.35rem;
    margin: 0;
    color: var(--rms-dark);
}

.flex-grow-1 {
    padding-top: 10px;
}

/* ================= DASHBOARD WELCOME (FIX YOU REQUESTED) ================= */
.dashboard-welcome {
    background: linear-gradient(135deg, #ffffff, #f8fafc);
    border: 1px solid var(--rms-border);
    border-radius: 14px;
    padding: 14px 18px;
    box-shadow: var(--shadow-sm);
}

/* ================= NAVBAR ================= */
.navbar {
    padding: 0.75rem 1rem;
    backdrop-filter: blur(10px);
}

.navbar-brand {
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: 0.3px;
}

/* ================= SIDEBAR ================= */
.bg-dark {
    background: #0f172a !important;
    border-right: 1px solid rgba(255,255,255,0.06);
}

.bg-dark h5 {
    font-weight: 700;
    letter-spacing: 0.6px;
    color: #e2e8f0;
}

.nav-link {
    border-radius: 4px;
    padding: 4px 5px;
    font-size: 0.92rem;
    transition: all 0.2s ease;
    color: #cbd5e1 !important;
}

.nav-link:hover {
    background: rgba(255,255,255,0.06);
    transform: translateX(4px);
    color: #fff !important;
}

.nav-link.active {
    background: var(--rms-accent);
    color: #fff !important;
}

/* ================= CARDS ================= */
.card {
    border-radius: var(--radius-md);
    border: 1px solid var(--rms-border);
    background: var(--rms-surface);
    box-shadow: var(--shadow-sm);
    transition: 0.2s ease;
}

.card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.card-body {
    padding: 18px;
}

.card h5 {
    font-weight: 600;
    margin-bottom: 10px;
}

/* ================= DASHBOARD CARDS ================= */
.dashboard-card {
    border-radius: 14px;
    padding: 18px 12px;
    text-align: center;
    background: #ffffff;
    border: 1px solid var(--rms-border);
    transition: all 0.25s ease-in-out;
    min-height: 95px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    will-change: transform;
}

.dashboard-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.08);
    border-color: var(--rms-accent);
}

.dashboard-card i {
    font-size: 1.7rem;
    margin-bottom: 6px;
    color: var(--rms-accent);
}

.dashboard-card p {
    font-size: 0.85rem;
    margin: 0;
    font-weight: 500;
    color: var(--rms-dark);
}

/* ================= STAT CARDS ================= */
.stat-card {
    border-radius: 16px;
    padding: 16px;
    background: linear-gradient(145deg, #ffffff, #f9fafb);
    border: 1px solid var(--rms-border);
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    transition: all 0.25s ease-in-out;
    will-change: transform;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 25px rgba(0,0,0,0.10);
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--rms-dark);
}

.stat-label {
    font-size: 0.85rem;
    color: var(--rms-muted);
}

.stat-icon {
    font-size: 2rem;
    opacity: 0.9;
    color: var(--rms-accent);
}

/* ================= LISTS ================= */
.list-card {
    border-radius: 16px;
    background: #fff;
    border: 1px solid var(--rms-border);
    box-shadow: 0 4px 12px rgba(0,0,0,0.04);
}

.list-group-item {
    border: none;
    padding: 14px 10px;
    border-bottom: 1px solid #f1f5f9;
    transition: background 0.2s ease;
}

.list-group-item:hover {
    background: #f9fafb;
}

.list-group-item:last-child {
    border-bottom: none;
}

/* ================= TABLE ================= */
.table {
    margin-bottom: 0;
}

.table th {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--rms-muted);
    background: #f9fafb;
}

.table td {
    vertical-align: middle;
}

/* ================= FORMS ================= */
.form-control,
.form-select {
    border-radius: var(--radius-sm);
    border: 1px solid var(--rms-border);
    padding: 10px 12px;
    transition: 0.2s ease-in-out;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--rms-accent);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

/* ================= BUTTONS ================= */
.btn {
    border-radius: var(--radius-sm);
    font-weight: 500;
    transition: 0.2s ease-in-out;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn-primary {
    background: var(--rms-accent);
    border: none;
}

.btn-primary:hover {
    background: #1d4ed8;
}

.btn-dark {
    background: var(--rms-primary);
    border: none;
}

.btn-dark:hover {
    background: #000;
}

/* ================= BADGES ================= */
.badge {
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.3px;
}

.badge-success { background: var(--rms-success); }
.badge-warning { background: var(--rms-warning); }
.badge-danger  { background: var(--rms-danger); }
.badge-info    { background: var(--rms-info); }

/* ================= ALERTS ================= */
.alert {
    border-radius: var(--radius-sm);
    border: none;
    box-shadow: var(--shadow-sm);
}

/* ================= AUTH ================= */
.auth-container {
    min-height: 85vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.auth-card {
    width: 100%;
    max-width: 420px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--rms-border);
    box-shadow: var(--shadow-md);
    background: var(--rms-surface);
}

.auth-icon {
    font-size: 3rem;
    color: var(--rms-accent);
}

/* ================= UTILITIES ================= */
.text-muted {
    color: var(--rms-muted) !important;
}

html {
    scroll-behavior: smooth;
}

/* ================= MOBILE ================= */
@media (max-width: 768px) {


    .dashboard-card {
        min-height: 85px;
        padding: 14px 10px;
    }

    .stat-card {
        padding: 14px;
    }

    .stat-value {
        font-size: 1.3rem;
    }

    .stat-icon {
        font-size: 1.6rem;
    }

    .page-header h4 {
        font-size: 1.1rem;
    }

    .nav-link:hover {
        transform: none;
        padding-left: 12px;
    }

    .flex-grow-1 {
        padding-top: 0;
    }
}

/* ================= LARGE SCREENS ================= */

/* ================= DASHBOARD GRID POLISH ================= */
.row.g-3 > div {
    display: flex;
}

.row.g-3 > div > a {
    width: 100%;
}

/* ================= KPI CARD IMPROVEMENTS ================= */
.stat-card {
    position: relative;
    overflow: hidden;
}

.stat-card::after {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    width: 60px;
    height: 60px;
    background: rgba(37, 99, 235, 0.08);
    border-bottom-left-radius: 100%;
}

/* subtle color variants for future use */
.stat-success { border-left: 4px solid var(--rms-success); }
.stat-warning { border-left: 4px solid var(--rms-warning); }
.stat-danger  { border-left: 4px solid var(--rms-danger); }
.stat-info    { border-left: 4px solid var(--rms-info); }

/* ================= SECTION SEPARATORS ================= */
.section-divider {
    height: 1px;
    background: linear-gradient(to right, transparent, var(--rms-border), transparent);
    margin: 25px 0;
}

/* ================= QUICK ACTIONS ENHANCEMENT ================= */
.dashboard-card {
    position: relative;
    overflow: hidden;
}

.dashboard-card::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(120deg, transparent, rgba(37,99,235,0.06), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.dashboard-card:hover::before {
    opacity: 1;
}

/* ================= ICON BACKGROUND STYLE ================= */
.dashboard-card i,
.stat-icon {
    background: rgba(37, 99, 235, 0.08);
    padding: 10px;
    border-radius: 12px;
}

/* ================= PAGE HEADER ENHANCEMENT ================= */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.page-header p {
    margin: 0;
    font-size: 0.85rem;
}

/* ================= SOFT CARD GROUP ================= */
.card-group-soft {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}

.card-group-soft .card {
    flex: 1 1 300px;
}

/* ================= EMPTY STATE ================= */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--rms-muted);
}

.empty-state i {
    font-size: 2.5rem;
    margin-bottom: 10px;
    opacity: 0.6;
}

/* ================= HOVER FEEDBACK (SUBTLE) ================= */
a .stat-card:active,
a .dashboard-card:active {
    transform: scale(0.98);
}

/* ================= SCROLLBAR CLEAN ================= */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

/* ================= FADE-IN ANIMATION ================= */
.fade-in {
    animation: fadeIn 0.4s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}


/* ================= ENHANCED FORM CONTAINER ================= */
.form-card {
    border-radius: var(--radius-lg);
    border: 1px solid var(--rms-border);
    background: linear-gradient(145deg, #ffffff, #f9fafb);
    box-shadow: var(--shadow-md);
    padding: 24px;
}

/* ================= FORM SECTION TITLE ================= */
.form-section-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--rms-muted);
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ================= READONLY FIELDS ================= */
.form-control[readonly] {
    background-color: #f9fafb;
    border-style: dashed;
    color: var(--rms-muted);
    font-weight: 500;
}

/* ================= LABEL STYLING ================= */
.form-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--rms-dark);
    margin-bottom: 4px;
}

/* ================= INPUT ENHANCEMENT ================= */
.form-control,
.form-select {
    font-size: 0.9rem;
    padding: 11px 12px;
}

/* smoother focus */
.form-control:focus,
.form-select:focus {
    transform: scale(1.01);
}

/* ================= FILE INPUT ================= */
input[type="file"].form-control {
    padding: 8px;
    font-size: 0.85rem;
    background: #f9fafb;
    cursor: pointer;
}

/* ================= FORM GRID SPACING ================= */
.form-grid {
    row-gap: 18px;
}

/* ================= SUBMIT BUTTON POLISH ================= */
.form-submit {
    min-width: 160px;
    padding: 10px 16px;
    font-size: 0.9rem;
    border-radius: 10px;
    box-shadow: var(--shadow-sm);
}

.form-submit:hover {
    box-shadow: var(--shadow-md);
}

/* ================= DIVIDER ================= */
.form-divider {
    height: 1px;
    background: linear-gradient(to right, transparent, var(--rms-border), transparent);
    margin: 20px 0;
}

/* ================= HELPER TEXT ================= */
.form-text {
    font-size: 0.75rem;
    color: var(--rms-muted);
}

/* ================= ERROR STATES ================= */
.text-danger.small {
    font-size: 0.75rem;
    margin-top: 4px;
}

/* ================= SMOOTH FORM ANIMATION ================= */
.form-card {
    animation: fadeIn 0.3s ease-in-out;
}



/* ================= REPORT PAGE WRAPPER ================= */
.report-container {
    max-width: 1400px;
    margin: 0 auto;
    padding-bottom: 40px;
}

/* ================= REPORT HEADERS ================= */
.report-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 18px;
}

.report-header h4 {
    font-weight: 700;
    font-size: 1.25rem;
    margin: 0;
}

/* ================= KPI GRID IMPROVEMENTS ================= */
.kpi-grid .card {
    height: 100%;
    min-height: 110px;
}

.kpi-grid h6 {
    font-size: 0.82rem;
    color: var(--rms-muted);
    margin-bottom: 6px;
}

.kpi-grid h4 {
    font-size: 1.4rem;
    font-weight: 800;
}

/* ================= CHART CONTAINERS ================= */
canvas {
    width: 100% !important;
    height: auto !important;
}

/* FIX: chart height consistency */
.chart-container {
    position: relative;
    height: 320px;
}

@media (max-width: 768px) {
    .chart-container {
        height: 240px;
    }
}

/* ================= REPORT CARDS ================= */
.report-card {
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    transition: all 0.2s ease;
}

.report-card:hover {
    box-shadow: var(--shadow-md);
}

/* ================= TABLE RESPONSIVENESS ================= */
.table-responsive {
    border-radius: var(--radius-md);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* make tables more readable on mobile */
@media (max-width: 768px) {
    .table {
        font-size: 0.85rem;
    }

    .table th, .table td {
        white-space: nowrap;
        padding: 10px 8px;
    }
}

/* ================= FILTER BAR ================= */
.report-filters {
    background: #fff;
    border: 1px solid var(--rms-border);
    border-radius: var(--radius-md);
    padding: 14px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 20px;
}

.report-filters .form-control,
.report-filters .form-select {
    font-size: 0.85rem;
}

/* stack filters on mobile */
@media (max-width: 768px) {
    .report-filters .row > div {
        margin-bottom: 10px;
    }
}

/* ================= BADGES IN REPORTS ================= */
.report-badge {
    font-size: 0.7rem;
    padding: 5px 9px;
    border-radius: 999px;
}

/* ================= LIST CARDS IN REPORTS ================= */
.report-list-card {
    padding: 14px;
    border-radius: 12px;
    border: 1px solid var(--rms-border);
    background: #fff;
    box-shadow: var(--shadow-sm);
    transition: 0.2s ease;
}

.report-list-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* ================= MOBILE REPORT OPTIMIZATION ================= */
@media (max-width: 768px) {


    /* KPI cards become tighter */
    .kpi-grid .card-body {
        padding: 12px;
    }

    .kpi-grid h4 {
        font-size: 1.2rem;
    }

    /* stack KPI cards properly */
    .row.g-3 > div,
    .row.g-4 > div {
        flex: 1 1 100%;
    }

    /* charts full width spacing fix */
    .chart-container {
        margin-bottom: 20px;
    }

    /* make report headers stack */
    .report-header {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* ================= DARK-LIKE DEPTH FOR REPORT SECTIONS ================= */
.report-section {
    background: linear-gradient(145deg, #ffffff, #f8fafc);
    border: 1px solid var(--rms-border);
    border-radius: var(--radius-md);
    padding: 16px;
    box-shadow: var(--shadow-sm);
}

/* ================= CHART LEGEND IMPROVEMENT (CHART.JS) ================= */
.chart-legend {
    font-size: 0.8rem;
    color: var(--rms-muted);
}

/* ================= SCROLL FIX FOR LONG TABLES ================= */
.table-scroll {
    overflow-x: auto;
    max-width: 100%;
}

/* ================= KPI NUMBER EMPHASIS ================= */
.kpi-value {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--rms-dark);
}

.kpi-label {
    font-size: 0.8rem;
    color: var(--rms-muted);
}

/* ================= REPORT SECTION SPACING ================= */
.report-section + .report-section {
    margin-top: 18px;
}

/* ================= PRINT FRIENDLY REPORTS ================= */
@media print {
    body {
        background: #fff;
    }

    .bg-dark,
    .nav,
    .btn {
        display: none !important;
    }

    .card {
        box-shadow: none !important;
        border: 1px solid #ddd !important;
    }

    canvas {
        max-height: 300px !important;
    }
}

/* ================= ACTIVE NAV IMPROVEMENT ================= */
.nav-link.active {
    background: linear-gradient(135deg, var(--rms-accent), #1d4ed8);
    color: #fff !important;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
    font-weight: 600;
}

/* subtle left indicator */
.nav-link.active::before {
    content: "";
    position: absolute;
    left: -12px;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 60%;
    background: var(--rms-accent);
    border-radius: 4px;
}

/* make nav items relative for indicator */
.nav-item {
    position: relative;
}

/* ================= SIDEBAR ENHANCEMENT ================= */
.bg-dark {
    backdrop-filter: blur(14px);
    overflow-y: auto;
    scrollbar-width: thin;
}

.bg-dark .nav-link {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ================= NAV LINK ================= */
.nav-link {
    border-radius: 10px;
    padding: 7px 10px;
    font-size: 0.9rem;
    line-height: 1.2;
    transition: all 0.2s ease;
}

.nav-link:hover {
    background: rgba(255,255,255,0.08);
    transform: translateX(4px);
}

.nav-link i {
    transition: transform 0.2s ease;
}

.nav-link:hover i {
    transform: scale(1.15);
}

/* ================= PAGE TRANSITIONS ================= */
.page-container {
    animation: fadeIn 0.3s ease-in-out;
}

/* ================= MOBILE NAV (BOTTOM BAR) ================= */
@media (max-width: 768px) {

    .flex-grow-1 {
        margin-left: 0 !important;
    }

    .mobile-nav {
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        background: #0f172a;
        border-top: 1px solid rgba(255,255,255,0.08);
        display: flex;
        justify-content: space-around;
        padding: 8px 0;
        z-index: 1000; /* lower than sidebar */
    }

    .mobile-nav a {
        color: #cbd5e1;
        font-size: 0.7rem;
        text-align: center;
        flex: 1;
        padding: 6px 4px;
        border-radius: 8px;
        transition: 0.2s ease;
    }

    .mobile-nav a i {
        display: block;
        font-size: 1.2rem;
        margin-bottom: 2px;
    }

    .mobile-nav a.active {
        background: var(--rms-accent);
        color: #fff;
    }

    body {
        padding-bottom: 65px;
    }
}

/* ================= TOUCH OPTIMIZATION ================= */
@media (max-width: 768px) {

    .btn,
    .form-control,
    .form-select {
        min-height: 42px;
    }

    .nav-link {
        padding: 12px;
        font-size: 0.95rem;
    }

    .dashboard-card {
        border-radius: 16px;
    }
}

/* ================= CLICK FEEDBACK ================= */
a:active {
    transform: scale(0.97);
}

/* ================= PROFILE LINK ================= */
.nav-profile {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid rgba(255,255,255,0.08);
}

/* ================= SMALL SCREEN HEADER ================= */
@media (max-width: 768px) {

    .dashboard-welcome {
        padding: 10px 12px;
    }

    .page-header {
        align-items: flex-start;
    }
}

/* ================= SIDEBAR SYSTEM ================= */
.sidebar {
    width: 260px;
    min-height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1200; /* ABOVE overlay */
    transition: transform 0.3s ease;
    overflow-y: auto;
}

/* DESKTOP */
@media (min-width: 769px) {
    .sidebar {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 260px;
    }
}

/* MOBILE */
@media (max-width: 768px) {

    .sidebar {
        top: calc(var(--mobile-topbar-height) + 12px);
        height: calc(100vh - var(--mobile-topbar-height) - 12px);
        border-top-right-radius: 14px;
        transform: translateX(-100%);
    }

    .sidebar.active {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0 !important;
        padding-top: calc(var(--mobile-topbar-height) + 16px);
    }

}

/* ================= SIDEBAR NAV SPACING ================= */
.sidebar .nav.flex-column {
    gap: 4px;
}

/* ================= TOP BAR ================= */
.mobile-topbar {
    position: fixed;
    top: 12px;
    left: 12px;
    right: 12px;
    height: var(--mobile-topbar-height);
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(12px);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 14px;
    z-index: 1300; /* highest */
    box-shadow: var(--shadow-md);
}

/* ================= MENU BUTTON ================= */
.menu-btn {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: rgba(255,255,255,0.08);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

.menu-btn i {
    font-size: 1.4rem;
    color: #fff;
}

/* ================= OVERLAY ================= */
#sidebarOverlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 1100;
    opacity: 0;
    pointer-events: none;
    transition: 0.2s ease;
}

#sidebarOverlay.active {
    opacity: 1;
    pointer-events: all;
}

/* ================= CONTENT FIX ================= */
html, body {
    max-width: 100%;
    overflow-x: hidden;
}

/* ================= FOOTER ================= */
.app-footer {
    margin-top: auto;
    padding: 16px 10px;
    border-top: 1px solid var(--rms-border);
    font-size: 0.85rem;
    color: var(--rms-muted);
}

/* ================= LAYOUT ================= */
.main-content {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.page-container {
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* ================= MOBILE GRID ================= */
@media (max-width: 768px) {

    .row.g-3 {
        --bs-gutter-x: 10px;
        --bs-gutter-y: 10px;
    }

    .row > [class*="col-6"] {
        padding-left: 5px;
        padding-right: 5px;
    }

    .dashboard-card {
        padding: 12px 8px;
        border-radius: 12px;
    }

    .dashboard-card i {
        font-size: 1.2rem;
        margin-bottom: 4px;
    }

    .dashboard-card p {
        font-size: 0.75rem;
        line-height: 1.2;
    }

    .stat-card {
        padding: 12px;
        border-radius: 12px;
    }

    .stat-value {
        font-size: 0.95rem;
    }

    .stat-label {
        font-size: 0.7rem;
    }
}

/* ================= MOBILE KPI LAYOUT FIX ================= */
@media (max-width: 768px) {

    /* RESET default behavior */
    .row.g-3 > div {
        flex: 0 0 auto;
        width: 100%;
    }

    /* 1st KPI - full width */
    .row.g-3 > div:nth-child(1) {
        width: 100%;
    }

    /* 2nd & 3rd KPI - side by side */
    .row.g-3 > div:nth-child(2),
    .row.g-3 > div:nth-child(3) {
        width: 50%;
    }

    /* 4th KPI - full width */
    .row.g-3 > div:nth-child(4) {
        width: 100%;
    }
}

.page-container {
    width: 100%;
    min-height: 100vh;
    padding: 90px 20px 50px; /* desktop default (accounts for sidebar + topbar) */
    box-sizing: border-box;
}

/* MOBILE */
@media (max-width: 768px) {
    .page-container {
        padding: calc(var(--mobile-topbar-height) + 20px) 12px 30px;
    }
}

/* LARGE SCREENS */
@media (min-width: 1200px) {
    .page-container {
        padding: 100px 40px 60px;
    }
}