/* Dryva — application styles layered on Bootstrap 5. */
:root {
    --dryva-sidebar-width: 256px;
    --dryva-sidebar-bg: #111827;
    --dryva-sidebar-fg: #cbd5e1;
    --dryva-sidebar-muted: #64748b;
    --dryva-sidebar-active-bg: rgba(59, 130, 246, 0.16);
    --dryva-sidebar-active-fg: #ffffff;
    --dryva-body-bg: #f4f6f9;
}

html, body { height: 100%; }
body.app-body { background: var(--dryva-body-bg); }

.skip-link { position: absolute; top: .5rem; left: .5rem; z-index: 2000; background: #fff; padding: .5rem 1rem; border-radius: .375rem; }

/* ---------- Shell ---------- */
.app-shell { display: flex; min-height: 100vh; }
.app-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.app-content { flex: 1 1 auto; padding: 1.5rem; }
.app-navbar { position: sticky; top: 0; z-index: 1020; min-height: 60px; }
.app-footer { display: flex; justify-content: space-between; padding: .75rem 1.5rem; background: var(--bs-body-bg); }

/* ---------- Sidebar ---------- */
.app-sidebar {
    background: var(--dryva-sidebar-bg);
    color: var(--dryva-sidebar-fg);
    width: var(--dryva-sidebar-width);
}
/* Bootstrap makes .offcanvas-lg transparent (!important) at lg and up, which put the light sidebar text on the
   light page. Browsers with forced dark mode (e.g. Edge) hid the problem. */
.app-sidebar.offcanvas-lg { background-color: var(--dryva-sidebar-bg) !important; }
@media (min-width: 992px) {
    .app-sidebar {
        position: sticky;
        top: 0;
        height: 100vh;
        flex: 0 0 var(--dryva-sidebar-width);
        overflow-y: auto;
    }
}
@media (max-width: 991.98px) {
    .app-sidebar.offcanvas-lg { --bs-offcanvas-width: var(--dryva-sidebar-width); --bs-offcanvas-bg: var(--dryva-sidebar-bg); }
}
.sidebar-brand { display: flex; align-items: center; justify-content: space-between; height: 60px; padding: 0 1.25rem; border-bottom: 1px solid rgba(255, 255, 255, .06); }
.sidebar-nav { padding: 1rem .75rem; }
.sidebar-heading { font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; color: var(--dryva-sidebar-muted); padding: .75rem .75rem .35rem; }
.sidebar-nav .nav-link { display: flex; align-items: center; gap: .75rem; color: var(--dryva-sidebar-fg); border-radius: .5rem; padding: .55rem .75rem; margin-bottom: .15rem; }
.sidebar-nav .nav-link:hover, .sidebar-nav .nav-link:focus-visible { background: rgba(255, 255, 255, .06); color: #fff; }
.sidebar-nav .nav-link.active { background: var(--dryva-sidebar-active-bg); color: var(--dryva-sidebar-active-fg); font-weight: 600; }
.sidebar-nav .nav-link .bi { font-size: 1.1rem; }

/* ---------- Cards & widgets ---------- */
.card { border: 0; box-shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .08); }
.stat-icon { width: 48px; height: 48px; border-radius: .75rem; display: inline-flex; align-items: center; justify-content: center; font-size: 1.4rem; flex: 0 0 48px; }
.chart-box { position: relative; height: 260px; }
.chart-box-lg { height: 340px; }

/* ---------- Reports ---------- */
.report-card { transition: border-color .15s, box-shadow .15s; }
.report-card:hover, .report-card:focus-visible { border-color: var(--bs-primary); box-shadow: 0 .25rem .75rem rgba(13, 110, 253, .12); }
.report-card-icon { flex: 0 0 2.75rem; height: 2.75rem; border-radius: .75rem; display: flex; align-items: center; justify-content: center; font-size: 1.35rem; color: var(--bs-primary); background: var(--bs-primary-bg-subtle); }
.vehicle-icon { width: 1.25rem; height: 1.25rem; vertical-align: -.2rem; }
[data-bs-theme="dark"] .vehicle-icon { filter: invert(1); }

/* ---------- Avatars ---------- */
.avatar { border-radius: 50%; object-fit: cover; display: inline-flex; align-items: center; justify-content: center; }
.avatar-sm { width: 32px; height: 32px; font-size: .8rem; }
.avatar-lg { width: 72px; height: 72px; font-size: 1.4rem; }
.avatar-initials { background: var(--bs-primary-bg-subtle); color: var(--bs-primary-text-emphasis); font-weight: 600; }

/* ---------- Tables ---------- */
.table .thumb { width: 36px; height: 36px; border-radius: .375rem; object-fit: cover; }
div.dt-container .dt-buttons .btn { font-size: .8rem; }
.dt-container .dt-search input { min-width: 220px; }

/* ---------- Forms ---------- */
.product-preview { max-height: 160px; width: 100%; object-fit: contain; background: var(--bs-tertiary-bg); }
.person-photo { width: 100%; max-width: 220px; aspect-ratio: 1; object-fit: cover; background: var(--bs-tertiary-bg); }
.currency-input { max-width: 5.5rem; }
.invalid-feedback:empty { display: none !important; }

/* ---------- Notifications ---------- */
.notifications-menu { width: 340px; max-width: 90vw; }
.list-group-item.unread { background: var(--bs-primary-bg-subtle); }

/* ---------- Loading overlay ---------- */
.loading-overlay { position: fixed; inset: 0; background: rgba(255, 255, 255, .6); display: flex; align-items: center; justify-content: center; z-index: 2100; }
.loading-overlay[hidden] { display: none; }

/* ---------- Auth & error pages ---------- */
body.auth-body { background: linear-gradient(135deg, #eef2ff 0%, #f8fafc 60%); }
.auth-wrapper { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 1.5rem; }
.auth-card { width: 100%; max-width: 420px; }
.error-card { width: 100%; max-width: 560px; }
.error-details { max-height: 320px; overflow: auto; white-space: pre-wrap; }

@media (max-width: 575.98px) {
    .app-content { padding: 1rem; }
    .app-footer { padding: .75rem 1rem; }
}
.live-map { height: 60vh; min-height: 360px; border-radius: var(--bs-card-inner-border-radius); }
/* Live map: vehicle icons tinted with CSS masks (the SVGs are single-colour shapes). */
.vehicle-glyph { display: inline-block; width: 1.1em; height: 1.1em; vertical-align: -0.2em; background-color: var(--vehicle-colour, currentColor); -webkit-mask: var(--vehicle-glyph) center / contain no-repeat; mask: var(--vehicle-glyph) center / contain no-repeat; }
.vehicle-bus { --vehicle-glyph: url("../images/vehicles/bus.svg"); --vehicle-colour: #e65100; }
.vehicle-tricycle { --vehicle-glyph: url("../images/vehicles/tricycle.svg"); --vehicle-colour: #2e7d32; }
.vehicle-bike { --vehicle-glyph: url("../images/vehicles/bike.svg"); --vehicle-colour: #0d47a1; }
.vehicle-marker { position: relative; display: flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 50%; background: #fff; border: 3px solid var(--vehicle-colour); box-shadow: 0 2px 6px rgba(0, 0, 0, .35); cursor: pointer; }
.vehicle-marker .vehicle-glyph { width: 26px; height: 26px; }
.vehicle-marker::after { content: ""; position: absolute; bottom: -9px; left: 50%; transform: translateX(-50%); border: 6px solid transparent; border-top-color: var(--vehicle-colour); border-bottom-width: 0; }
.vehicle-marker.is-stale { opacity: .55; }
.vehicle-cluster { display: flex; align-items: center; justify-content: center; min-width: 42px; height: 42px; padding: 0 .4rem; border-radius: 21px; background: var(--vehicle-colour, #546e7a); color: #fff; font-weight: 700; font-size: .95rem; border: 3px solid #fff; box-shadow: 0 0 0 4px color-mix(in srgb, var(--vehicle-colour, #546e7a) 35%, transparent), 0 2px 6px rgba(0, 0, 0, .35); cursor: pointer; }
