:root {
    --bss-blue-900: #06162b;
    --bss-blue-700: #0c3563;
    --bss-blue-500: #0f5aa5;
    --bss-blue-100: #d8e8ff;
    --bss-white: #ffffff;
    --bss-slate-100: #f4f7fb;
    --bss-slate-300: #d6dfea;
    --bss-slate-600: #5a6a80;
    --bss-black: #0e1320;
    --bss-critical: #c92a2a;
    --bss-high: #e67700;
}

body {
    font-family: 'Barlow', 'Segoe UI', sans-serif;
    background: linear-gradient(160deg, #f8fbff 0%, #eef4fc 55%, #f9fbfe 100%);
    color: var(--bss-black);
}

.auth-page {
    background:
        radial-gradient(circle at 12% 18%, rgba(15, 90, 165, 0.24), transparent 24%),
        radial-gradient(circle at 80% 82%, rgba(6, 22, 43, 0.24), transparent 26%),
        linear-gradient(135deg, #e3eeff 0%, #eef5ff 50%, #f8fbff 100%);
}

.login-shell {
    max-width: 980px;
    background: var(--bss-white);
    border: 1px solid rgba(12, 53, 99, 0.12);
}

.login-brand-panel {
    background: linear-gradient(150deg, #04142a 0%, #0b2f59 58%, #0f5aa5 100%);
    color: var(--bss-white);
    min-height: 320px;
}

.app-shell .sidebar {
    width: 280px;
    background: linear-gradient(185deg, #071727 0%, #0b2a48 58%, #0f5aa5 100%);
    border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.brand-logo {
    width: 100%;
    max-width: 220px;
    border-radius: 14px;
    padding: 0.35rem;
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.22);
}

.login-logo {
    width: 100%;
    max-width: 260px;
    border-radius: 14px;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.24);
}

.sidebar-nav .nav-link {
    color: rgba(255, 255, 255, 0.82);
    border-radius: 10px;
    padding: 0.6rem 0.7rem;
}

.sidebar-nav .nav-link:hover,
.sidebar-nav .nav-link.active {
    color: var(--bss-white);
    background: rgba(255, 255, 255, 0.12);
}

.content-area {
    background: rgba(255, 255, 255, 0.64);
    backdrop-filter: blur(3px);
}

.top-bar {
    border-bottom: 1px solid var(--bss-slate-300);
    background: rgba(255, 255, 255, 0.92);
}

.metric-card {
    border: 1px solid var(--bss-slate-300);
    background: var(--bss-white);
    border-radius: 16px;
    padding: 1rem;
    min-height: 112px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.metric-label {
    margin: 0;
    color: var(--bss-slate-600);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-size: 0.77rem;
}

.metric-value {
    margin: 0;
    font-size: 2rem;
    font-weight: 700;
    line-height: 1;
}

.metric-priority-critical {
    border-color: rgba(201, 42, 42, 0.35);
    box-shadow: inset 0 0 0 1px rgba(201, 42, 42, 0.08);
}

.metric-priority-high {
    border-color: rgba(230, 119, 0, 0.35);
}

.panel-card {
    border: 1px solid var(--bss-slate-300);
    border-radius: 16px;
    padding: 1rem;
    background: var(--bss-white);
}

.dashboard-alert {
    border-radius: 999px;
}

.site-map {
    width: 100%;
    height: 300px;
    border-radius: 12px;
    border: 1px solid var(--bss-slate-300);
}

.dispatch-map {
    position: relative;
    min-height: 280px;
    overflow: hidden;
    border: 1px solid var(--bss-slate-300);
    border-radius: 12px;
    background-color: #eef4f2;
    background-image: linear-gradient(rgba(255, 255, 255, 0.75) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, 0.75) 1px, transparent 1px);
    background-size: 40px 40px;
}

.dispatch-marker {
    position: absolute;
    transform: translate(-50%, -50%);
    padding: 0.35rem 0.5rem;
    border: 2px solid var(--bss-white);
    border-radius: 999px;
    color: var(--bss-white);
    font-size: 0.7rem;
    font-weight: 700;
    text-decoration: none;
    box-shadow: 0 2px 8px rgba(24, 33, 41, 0.25);
}

.dispatch-marker-live {
    background: #198754;
}

.dispatch-marker-stale {
    background: #fd7e14;
}

@media (max-width: 991px) {
    .app-shell .sidebar {
        width: 86px;
        padding-left: 0.7rem;
        padding-right: 0.7rem;
    }

    .sidebar .brand-block h1,
    .sidebar .brand-block p,
    .sidebar .nav-link {
        font-size: 0;
    }

    .sidebar .brand-logo {
        margin: 0 auto;
        max-width: 58px;
        padding: 0.25rem;
        border-radius: 12px;
    }

    .sidebar .nav-link i {
        font-size: 1.1rem;
        margin-right: 0;
    }
}

@media (max-width: 767px) {
    .auth-page main {
        align-items: flex-start !important;
    }

    .login-shell {
        margin-block: 0.5rem;
    }

    .login-brand-panel {
        min-height: 0;
        padding: 1.25rem !important;
    }

    .login-brand-panel .login-logo {
        max-width: 112px;
    }

    .login-brand-panel p.text-white-50.mb-0 {
        display: none;
    }

    .login-brand-panel .display-6 {
        font-size: 1.75rem;
    }

    .login-brand-panel .lead {
        margin-bottom: 0.75rem !important;
    }

    .login-shell > section:not(.login-brand-panel),
    .login-shell > div:not(.login-brand-panel) {
        padding: 1.25rem !important;
    }

    .app-layout {
        flex-direction: column;
    }

    .app-shell .sidebar {
        width: 100%;
        padding: 0.65rem 0.75rem !important;
    }

    .sidebar .brand-block {
        display: none;
    }

    .sidebar-nav {
        flex-wrap: nowrap;
        flex-direction: row !important;
        gap: 0.25rem !important;
        overflow-x: auto;
        overscroll-behavior-x: contain;
        scrollbar-width: none;
        padding-bottom: 0.15rem;
    }

    .sidebar-nav::-webkit-scrollbar {
        display: none;
    }

    .sidebar-nav .nav-link {
        flex: 0 0 auto;
        font-size: 0.9rem;
        padding: 0.55rem 0.7rem;
        white-space: nowrap;
    }

    .sidebar-nav .nav-link i {
        font-size: 1rem;
        margin-right: 0.4rem !important;
    }

    .content-area {
        min-width: 0;
        width: 100%;
    }

    .top-bar {
        flex-wrap: wrap;
        gap: 0.75rem;
    }

    .top-bar > div:first-child {
        min-width: 0;
    }

    .top-bar > div:last-child {
        gap: 0.5rem !important;
    }

    .top-bar .text-end {
        min-width: 0;
    }

    .top-bar .text-end p {
        overflow-wrap: anywhere;
    }

    .dashboard-alert {
        border-radius: 0.75rem;
    }

    .metric-card {
        min-height: 100px;
        padding: 0.75rem;
    }

    .metric-label {
        font-size: 0.68rem;
    }

    .metric-value {
        font-size: 1.65rem;
    }
}
