/* MeterReading Back-Office — global styles */

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.nav-link.active {
    background: rgba(255, 193, 7, 0.15);
    border-radius: 6px;
    color: #ffc107 !important;
}

.table th {
    font-size: 0.8rem;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

code {
    background: #f0f0f0;
    padding: 1px 5px;
    border-radius: 3px;
    font-size: 0.85em;
}

.dashboard-card {
    cursor: pointer;
    transition: transform 0.08s ease, box-shadow 0.08s ease;
}

.dashboard-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.12) !important;
}

/* ─── App shell layout ──────────────────────────────────────────────────────
   Desktop: sidebar is a flex column next to the main content.
   Mobile:  sidebar slides in from the left as an off-canvas drawer and a
   hamburger top bar takes its place inline with the content.
*/
.app-shell {
    display: flex;
    min-height: 100vh;
    width: 100%;
}

.app-sidebar {
    width: 240px;
    min-width: 240px;
    display: flex;
    flex-direction: column;
}

.app-main {
    flex-grow: 1;
    overflow-x: hidden;
    overflow-y: auto;
}

.app-topbar {
    display: none;
    align-items: center;
    padding: 0.5rem 0.75rem;
    background: #212529;
    color: #fff;
    position: sticky;
    top: 0;
    z-index: 1040;
}

.app-backdrop {
    display: none;
}

@media (max-width: 991.98px) {
    .app-shell {
        flex-direction: column;
    }

    .app-topbar {
        display: flex;
    }

    .app-sidebar {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        z-index: 1050;
        transform: translateX(-100%);
        transition: transform 0.18s ease-out;
        box-shadow: 0 0 1rem rgba(0, 0, 0, 0.25);
    }

    .app-shell.sidebar-open .app-sidebar {
        transform: translateX(0);
    }

    .app-shell.sidebar-open .app-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.45);
        z-index: 1045;
    }

    .app-main {
        width: 100%;
    }
}

/* Sidebar nav links are compact enough to fit on narrow screens without
   wrapping; the drawer widens slightly on the smallest phones so labels
   like "Billing Export" stay on one line. */
@media (max-width: 360px) {
    .app-sidebar {
        width: 85vw;
        min-width: 0;
    }
}

/* Long tables — let them scroll horizontally on mobile instead of overflowing
   the viewport. Most admin pages already wrap tables in .table-responsive,
   this protects any that don't. */
@media (max-width: 767.98px) {
    .table {
        font-size: 0.9rem;
    }

    .modal-dialog {
        margin: 0.5rem;
    }

    /* Stat cards shrink gracefully. */
    .card .fs-3 {
        font-size: 1.5rem !important;
    }
}

/* Ensure modals never exceed viewport height on mobile. */
.modal-content {
    max-height: 95vh;
    overflow-y: auto;
}
