/* ============================================================================
   Device Portal — custom overrides on top of the Silicon UI Kit (Bootstrap 5).
   Kept intentionally small; Silicon provides the bulk of the styling.
   Template consumers append page-specific rules here.
   ============================================================================ */

/* --- Base font: Google Sans (applies globally via Bootstrap variable) ------ */
:root {
    --bs-body-font-family: "Google Sans", sans-serif;
}
body {
    font-family: "Google Sans", sans-serif;
    font-optical-sizing: auto;
    font-variation-settings: "GRAD" 0;
}

/* --- Authentication background (subtle) ----------------------------------- */
.authentication-bg {
    background-color: #f6f8fb;
    background-image: linear-gradient(135deg, #f6f8fb 0%, #eef2f7 100%);
}

/* Login card sits comfortably centered with a little breathing room. */
.authentication-bg .card {
    border: 0;
    box-shadow: 0 0.5rem 1.5rem rgba(0, 0, 0, 0.06);
}

/* Left-aligned icon inside the auth inputs. */
.input-custom-icon .form-control {
    padding-left: 2.4rem;
}
.input-custom-icon .bx {
    font-size: 1.15rem;
    color: #9aa6b2;
}

/* --- Spinner utility ------------------------------------------------------ */
.spinner-portal {
    width: 3rem;
    height: 3rem;
}

/* ============================================================================
   Admin UI (Phase 8) — users + audit pages
   ============================================================================ */

/* Audit "Content" cell: long JSON should wrap rather than stretch the table. */
#audit-tbody code {
    word-break: break-all;
    white-space: normal;
}

/* Users table action column: keep the icon buttons on one row. */
#users-tbody .text-nowrap {
    column-gap: 0.15rem;
}

/* ============================================================================
   Mobile navigation drawer (offcanvas) — layout glue only.
   Makes the offcanvas a full-height flex column so the profile footer anchors
   to the bottom. The footer is a direct child of .offcanvas (outside the
   scrollable .offcanvas-body), so it is always pinned and does not need
   margin-top: auto. No colors/fonts/shadows are added here.
   ============================================================================ */
.offcanvas.offcanvas-end.portal-drawer {
    display: flex;
    flex-direction: column;
}
.portal-drawer .offcanvas-body {
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}
.portal-drawer .portal-drawer-footer {
    flex-shrink: 0;
}

/* ============================================================================
   Dashboard reference components
   ============================================================================ */
.dashboard-reference .dashboard-chart {
    width: 100%;
    height: 19rem;
}
.dashboard-reference .dashboard-heatmap {
    height: 18rem;
}

@media (max-width: 575.98px) {
    .dashboard-reference .dashboard-chart {
        height: 17rem;
    }
    .dashboard-reference .dashboard-heatmap {
        height: 20rem;
    }
}

/* ============================================================================
   Leaflet map fix
   ============================================================================ */
/* Fix Leaflet tile rendering: Silicon theme sets img{height:auto} globally,
   which collapses Leaflet's 256px tile images. Restore Leaflet's expected sizing. */
.leaflet-container img { height: auto; max-width: none; }
.leaflet-container .leaflet-tile { width: 256px; height: 256px; }
