body {
    background: #f4f6f9;
}

/* Khmer script needs a Khmer-capable font and a little more line height for its stacked vowels */
body.lang-km {
    font-family: 'Kantumruy Pro', system-ui, -apple-system, 'Segoe UI', sans-serif;
    line-height: 1.65;
}

body.lang-km .btn,
body.lang-km .badge,
body.lang-km .form-control,
body.lang-km .form-select {
    line-height: 1.6;
}

@media (min-width: 992px) {
    .sidebar {
        width: 250px;
        min-height: 100vh;
        position: sticky;
        top: 0;
        flex-shrink: 0;
    }
}

.sidebar .nav-link {
    border-radius: .375rem;
    margin-bottom: 2px;
}

.sidebar .nav-link:not(.active):hover {
    background: rgba(255, 255, 255, .1);
}

.collapse-toggle .bi-chevron-up {
    display: inline-block;
    transition: transform .2s;
}

.collapse-toggle[aria-expanded="false"] .bi-chevron-up {
    transform: rotate(180deg);
}

.collapse-toggle[aria-expanded="true"] .when-closed,
.collapse-toggle[aria-expanded="false"] .when-open {
    display: none;
}

.min-vw-0 {
    min-width: 0;
}

.stat-card .stat-icon {
    font-size: 2rem;
    opacity: .3;
}

.card {
    border: 0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .08);
}

.table td, .table th {
    vertical-align: middle;
    white-space: nowrap;
}

.offline-banner {
    position: fixed;
    left: 50%;
    bottom: calc(16px + env(safe-area-inset-bottom));
    transform: translateX(-50%);
    z-index: 1080;
    max-width: calc(100% - 32px);
    padding: .6rem 1rem;
    border-radius: .5rem;
    background: #212529;
    color: #fff;
    font-size: .9rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, .25);
}

/* Installed app (standalone window): respect phone notches */
@media (display-mode: standalone) {
    body {
        padding-top: env(safe-area-inset-top);
    }
}

.summary-table thead th {
    border-bottom: 1px solid #adb5bd;
}

@media print {
    body {
        background: #fff;
    }

    .sidebar, .navbar, .no-print, .alert, .btn {
        display: none !important;
    }

    main {
        padding: 0 !important;
    }

    .card {
        box-shadow: none;
    }

    a {
        color: inherit;
        text-decoration: none;
    }
}

.login-wrap {
    min-height: 100vh;
}
