@import url('https://fonts.googleapis.com/css2?family=DM+Mono:wght@400;500&family=Electrolize&family=Space+Grotesk:wght@400;500;600;700&display=swap');

:root {
    --bg: #061019;
    --bg-soft: #091825;
    --panel: rgba(12, 31, 45, .83);
    --panel-strong: #0d2433;
    --line: rgba(117, 211, 239, .16);
    --line-bright: rgba(99, 223, 255, .5);
    --text: #e6f6fa;
    --muted: #7895a5;
    --cyan: #5fe7ff;
    --mint: #6cf6c6;
    --violet: #c794ff;
    --amber: #ffd067;
    --danger: #ff7f9c;
}

/* Time-based theme and shared controls */
.theme-switcher {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 3px;
    border: 1px solid var(--line);
    background: color-mix(in srgb, var(--panel) 84%, transparent);
}

.theme-switcher button {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    border: 0;
    padding: 7px 8px;
    color: var(--muted);
    background: transparent;
    cursor: pointer;
    font: 500 9px 'DM Mono', monospace;
    letter-spacing: .03em;
}

.theme-switcher button:hover,
.theme-switcher button.is-active {
    color: var(--bg);
    background: var(--cyan);
}

.theme-switcher button span {
    font-size: 14px;
    line-height: 1;
}

.theme-switcher button b {
    font-weight: 500;
}

.auth-topline,
.topbar-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.topbar-actions {
    align-items: center;
}

/* Match the KSB Maju card stack and its isometric motion. */
.login-card {
    position: absolute;
    z-index: 1;
    top: 24%;
    left: 50%;
    width: min(400px, 42vw);
    height: 250px;
    margin: auto;
    padding: 40px;
    border-radius: 15px;
    background: rgb(92, 145, 237);
    transform-style: preserve-3d;
    transform: translateX(-50%);
    transition: all 2s ease;
    animation: login-card-isometric 7s infinite;
}

.login-card-layer {
    position: absolute;
    inset: 0;
    border: 2px solid rgba(92, 145, 237, .5);
    border-radius: 15px;
    background: rgba(92, 145, 237, .6);
    transform-style: preserve-3d;
}

.login-card .layer-back {
    background-color: rgba(92, 145, 237, .6);
    background-image: url('../images/atm-ksb-maju.jpg');
    background-position: 50% center;
    background-size: cover;
    transform: translateZ(30px);
}

.login-card .layer-middle {
    background: rgba(92, 145, 237, .4);
    transform: translateZ(60px);
}

.login-card .layer-front {
    background: rgba(92, 145, 237, .2);
    transform: translateZ(90px);
}

@keyframes login-card-isometric {
    0%, 100% { transform: translateX(-50%) rotateX(0deg) rotateY(0deg) rotate(0deg); }
    50% { transform: translateX(-50%) rotateX(60deg) rotateY(0deg) rotate(-45deg); }
}

html[data-theme="light"] .auth-page {
    background: var(--bg);
}

html[data-theme="light"] .auth-visual {
    background: radial-gradient(circle at 50% 45%, #d5f2fa 0, #dfeef2 34%, #c6dce3 78%);
}

html[data-theme="light"] .visual-grid {
    opacity: .22;
    background-image: linear-gradient(rgba(8, 125, 158, .22) 1px, transparent 1px), linear-gradient(90deg, rgba(8, 125, 158, .22) 1px, transparent 1px);
}

html[data-theme="light"] .sidebar {
    background: #ffffff;
}

html[data-theme="light"] .operator-chip,
html[data-theme="light"] .auth-form input,
html[data-theme="light"] .map-metrics div {
    background: rgba(255, 255, 255, .72);
}

html[data-theme="light"] .map-stage {
    background: radial-gradient(circle at 48% 48%, rgba(126, 206, 222, .34), transparent 55%), rgba(219, 239, 244, .82);
    background-image: linear-gradient(rgba(8, 125, 158, .09) 1px, transparent 1px), linear-gradient(90deg, rgba(8, 125, 158, .09) 1px, transparent 1px), radial-gradient(circle at 48% 48%, rgba(126, 206, 222, .34), transparent 55%);
}

html[data-theme="light"] .map-detail {
    background: linear-gradient(145deg, rgba(255, 255, 255, .95), rgba(227, 242, 246, .96));
}

html[data-theme="light"] .coverage-card {
    background: rgba(255, 255, 255, .78);
}

html[data-theme="light"] .map-villages span {
    color: #476b78;
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
    }
}

@media (max-width: 760px) {
    .auth-topline,
    .topbar-actions {
        align-items: flex-start;
        flex-direction: column;
    }

    .theme-switcher {
        align-self: flex-end;
    }

    .topbar-actions,
    .topbar-actions .operator-chip {
        width: 100%;
    }

    .login-card {
        width: min(54vw, 320px);
    }
}

html[data-theme="light"] {
    color-scheme: light;
    --bg: #edf6fa;
    --bg-soft: #f7fbfd;
    --panel: rgba(255, 255, 255, .9);
    --panel-strong: #ffffff;
    --line: rgba(23, 104, 130, .2);
    --line-bright: rgba(4, 133, 166, .48);
    --text: #061019;
    --muted: #234857;
    --cyan: #087d9e;
    --mint: #0b9975;
    --violet: #7654b5;
    --amber: #a66f00;
    --danger: #b23d5e;
}

html[data-theme="dark"] {
    color-scheme: dark;
    --text: #edf6fa;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    color: var(--text);
    background: var(--bg);
    font-family: 'Space Grotesk', sans-serif;
    transition: color .2s ease, background-color .2s ease;
}

body.font-siaga {
    font-family: 'Space Grotesk', sans-serif;
}

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

button,
input,
select {
    font: inherit;
}

.muted {
    color: var(--muted);
    line-height: 1.7;
}

.eyebrow {
    color: var(--cyan);
    font: 500 10px/1 'DM Mono', monospace;
    letter-spacing: .17em;
    text-transform: uppercase;
}

.brand-lockup {
    display: flex;
    align-items: center;
    gap: 11px;
    color: var(--text);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: .08em;
}

.brand-lockup b {
    color: var(--cyan);
    font-weight: 600;
}

.brand-mark {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border: 1px solid var(--cyan);
    color: var(--cyan);
    font: 500 12px 'DM Mono', monospace;
    box-shadow: 0 0 20px rgba(95, 231, 255, .25);
}

.flash-stack {
    position: fixed;
    z-index: 10;
    top: 18px;
    right: 18px;
    display: grid;
    gap: 8px;
}

.flash {
    padding: 12px 16px;
    border: 1px solid var(--danger);
    background: #241a2a;
    color: #ffd9e3;
    font-size: 13px;
}

/* Auth */
.auth-page {
    min-height: 100vh;
    background: #061019;
}

.auth-shell {
    display: grid;
    min-height: 100vh;
    grid-template-columns: minmax(360px, .8fr) 1.2fr;
}

.auth-panel {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    width: min(100%, 540px);
    padding: 42px clamp(28px, 7vw, 100px);
}

.auth-copy {
    margin: auto 0 44px;
    max-width: 420px;
}

.auth-copy h1 {
    margin: 18px 0 16px;
    font-size: clamp(34px, 4vw, 58px);
    line-height: 1.03;
    letter-spacing: -.055em;
}

.auth-copy p {
    max-width: 360px;
}

.auth-form {
    display: grid;
    gap: 10px;
    max-width: 420px;
}

.auth-form label {
    margin-top: 12px;
    color: #aac3cd;
    font-size: 12px;
}

.auth-form input {
    border: 1px solid var(--line);
    outline: 0;
    padding: 15px 16px;
    color: var(--text);
    background: rgba(16, 37, 52, .72);
    transition: .2s border-color, .2s box-shadow;
}

.auth-form input:focus {
    border-color: var(--cyan);
    box-shadow: 0 0 0 3px rgba(95, 231, 255, .1);
}

.primary-button {
    margin-top: 18px;
    border: 1px solid var(--cyan);
    padding: 15px 18px;
    color: #061019;
    background: var(--cyan);
    cursor: pointer;
    font-weight: 700;
    text-align: left;
}

.primary-button span {
    float: right;
    font-size: 20px;
    line-height: 12px;
}

.auth-footnote {
    margin-top: 18px;
    color: var(--muted);
    font: 11px 'DM Mono', monospace;
}

.auth-visual {
    position: relative;
    overflow: hidden;
    background: radial-gradient(circle at 50% 45%, #123d52 0, #071522 33%, #050d15 76%);
}

.visual-grid {
    position: absolute;
    inset: -50%;
    opacity: .34;
    background-image: linear-gradient(rgba(95, 231, 255, .13) 1px, transparent 1px), linear-gradient(90deg, rgba(95, 231, 255, .13) 1px, transparent 1px);
    background-size: 44px 44px;
    transform: perspective(500px) rotateX(62deg) translateY(170px);
}

.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(1px);
}

.orb-a {
    width: 280px;
    height: 280px;
    top: 27%;
    left: 42%;
    border: 1px solid rgba(95, 231, 255, .62);
    box-shadow: 0 0 80px rgba(95, 231, 255, .32), inset 0 0 60px rgba(95, 231, 255, .25);
}

.orb-b {
    width: 90px;
    height: 90px;
    top: 43%;
    left: 56%;
    background: var(--cyan);
    box-shadow: 0 0 90px 30px rgba(95, 231, 255, .5);
}

.signal-ring {
    position: absolute;
    border: 1px solid rgba(108, 246, 198, .35);
    border-radius: 50%;
}

.ring-a {
    width: 480px;
    height: 480px;
    top: 12%;
    left: 24%;
}

.ring-b {
    width: 700px;
    height: 700px;
    top: -2%;
    left: 5%;
    border-color: rgba(199, 148, 255, .15);
}

.visual-content {
    position: absolute;
    left: 12%;
    bottom: 13%;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--mint);
    font: 500 10px 'DM Mono', monospace;
    letter-spacing: .12em;
}

.status-pill i,
.live-indicator i {
    display: inline-block;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: currentColor;
    box-shadow: 0 0 12px currentColor;
}

.visual-content h2 {
    margin: 22px 0 38px;
    font-size: clamp(46px, 6vw, 92px);
    line-height: .94;
    letter-spacing: -.08em;
}

.visual-content h2 em {
    color: var(--cyan);
    font-style: normal;
}

.mini-readout {
    display: grid;
    gap: 8px;
    color: var(--muted);
    font: 10px 'DM Mono', monospace;
}

.mini-readout strong {
    color: var(--text);
    font: 500 42px 'DM Mono', monospace;
}

.mini-readout small {
    color: var(--cyan);
    font-size: 10px;
}

/* Dashboard */
.dashboard-page {
    min-height: 100vh;
    background-color: var(--bg);
    background-image: linear-gradient(rgba(95, 231, 255, .025) 1px, transparent 1px), linear-gradient(90deg, rgba(95, 231, 255, .025) 1px, transparent 1px);
    background-size: 30px 30px;
}

.dashboard-shell {
    display: flex;
    min-width: 0;
    min-height: 100vh;
}

.sidebar {
    position: sticky;
    top: 0;
    display: flex;
    flex: 0 0 235px;
    flex-direction: column;
    height: 100vh;
    padding: 34px 22px;
    border-right: 1px solid var(--line);
    background: #05111b;
}

.sidebar-label {
    margin: 72px 0 18px 12px;
    color: #547181;
    font: 10px 'DM Mono', monospace;
    letter-spacing: .16em;
}

.side-nav {
    display: grid;
    gap: 5px;
}

.side-nav a {
    display: flex;
    align-items: center;
    gap: 13px;
    padding: 12px;
    border-left: 2px solid transparent;
    color: var(--muted);
    font-size: 13px;
    transition: .2s;
}

.side-nav a span {
    color: var(--cyan);
    font-size: 19px;
}

.side-nav a .side-nav-text {
    color: var(--muted);
    font-size: 13px;
}

.side-nav a.active .side-nav-text,
.side-nav a:hover .side-nav-text {
    color: var(--text);
}

.side-nav a:hover,
.side-nav a.active {
    border-color: var(--cyan);
    color: var(--text);
    background: linear-gradient(90deg, rgba(95, 231, 255, .12), transparent);
}

.sidebar-bottom {
    display: grid;
    gap: 22px;
    margin-top: auto;
}

.live-indicator {
    color: var(--mint);
    font: 10px 'DM Mono', monospace;
    letter-spacing: .12em;
}

.logout-link {
    display: flex;
    justify-content: space-between;
    color: var(--muted);
    font-size: 12px;
}

.logout-form {
    margin: 0;
}

.logout-link {
    width: 100%;
    border: 0;
    padding: 0;
    background: transparent;
    cursor: pointer;
    text-align: left;
}

.dashboard-main {
    width: min(100%, 1550px);
    min-width: 0;
    margin: 0 auto;
    padding: 40px clamp(22px, 4vw, 70px) 25px;
}

.topbar {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
}

.topbar h1 {
    margin: 16px 0 0;
    font-size: clamp(28px, 4vw, 54px);
    letter-spacing: -.065em;
    line-height: 1;
}

.topbar h1 span {
    color: var(--muted);
    font-weight: 400;
}

.operator-chip {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px 8px 8px;
    border: 1px solid var(--line);
    background: rgba(11, 30, 43, .65);
}

.operator-chip strong,
.operator-chip small {
    display: block;
}

.operator-chip strong {
    font-size: 12px;
}

.operator-chip small {
    margin-top: 3px;
    color: var(--muted);
    font: 10px 'DM Mono', monospace;
}

.avatar {
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    color: var(--bg);
    background: var(--cyan);
    font-weight: 700;
}

.signal-banner {
    display: flex;
    justify-content: space-between;
    align-items: end;
    margin-top: 44px;
    padding: 28px 30px;
    border: 1px solid var(--line-bright);
    background: linear-gradient(115deg, rgba(21, 69, 88, .65), rgba(9, 24, 36, .7));
    box-shadow: 0 0 40px rgba(95, 231, 255, .08);
}

.signal-banner h2 {
    margin: 17px 0 7px;
    font-size: clamp(21px, 3vw, 34px);
    letter-spacing: -.05em;
}

.signal-banner p {
    margin: 0;
    color: var(--muted);
    font: 11px 'DM Mono', monospace;
}

.banner-number {
    text-align: right;
}

.banner-number small {
    display: block;
    color: var(--cyan);
    font: 10px 'DM Mono', monospace;
}

.banner-number strong {
    color: var(--text);
    font: 500 clamp(42px, 5vw, 76px) 'DM Mono', monospace;
    letter-spacing: -.1em;
}

.metric-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 13px;
    margin-top: 13px;
}

.metric-card {
    position: relative;
    min-height: 154px;
    padding: 19px;
    overflow: hidden;
    border: 1px solid var(--line);
    background: var(--panel);
}

.metric-card::after {
    position: absolute;
    right: -20px;
    bottom: -44px;
    width: 130px;
    height: 130px;
    border: 1px solid currentColor;
    border-radius: 50%;
    opacity: .18;
    content: '';
}

.metric-card.cyan {
    color: var(--cyan);
}

.metric-card.mint {
    color: var(--mint);
}

.metric-card.violet {
    color: var(--violet);
}

.metric-card.amber {
    color: var(--amber);
}

.metric-icon {
    display: grid;
    place-items: center;
    width: 31px;
    height: 31px;
    margin-bottom: 22px;
    border: 1px solid currentColor;
    font: 500 12px 'DM Mono', monospace;
}

.metric-card span,
.metric-card small {
    display: block;
    color: var(--muted);
    font-size: 11px;
}

.metric-card strong {
    display: block;
    margin: 6px 0 4px;
    color: var(--text);
    font: 500 36px 'DM Mono', monospace;
    letter-spacing: -.08em;
}

.toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    margin: 38px 0 13px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--line);
}

.toolbar p {
    margin: 7px 0 0;
    color: var(--muted);
    font-size: 12px;
}

.filter-form {
    display: flex;
    align-items: center;
    gap: 8px;
}

.filter-form select,
.filter-form button {
    border: 1px solid var(--line);
    padding: 10px 13px;
    color: var(--text);
    background: var(--panel-strong);
    font-size: 12px;
}

.filter-form button {
    border-color: var(--cyan);
    color: var(--cyan);
    cursor: pointer;
}

.filter-form a {
    color: var(--muted);
    font-size: 11px;
}

.content-grid {
    display: grid;
    grid-template-columns: 1.4fr .8fr;
    gap: 13px;
}

.panel {
    border: 1px solid var(--line);
    background: var(--panel);
}

.panel-heading {
    display: flex;
    justify-content: space-between;
    align-items: start;
    gap: 15px;
    padding: 21px 22px;
    border-bottom: 1px solid var(--line);
}

.panel-heading h3 {
    margin: 9px 0 0;
    font-size: 17px;
    letter-spacing: -.035em;
}

.panel-code,
.priority-count {
    color: var(--muted);
    font: 10px 'DM Mono', monospace;
}

.region-visual {
    display: grid;
    grid-template-columns: 200px 1fr;
    align-items: center;
    gap: 25px;
    min-height: 285px;
    padding: 24px;
}

.radar {
    position: relative;
    display: grid;
    place-items: center;
    width: 175px;
    height: 175px;
    margin: auto;
    border: 1px solid var(--cyan);
    border-radius: 50%;
    color: var(--cyan);
    background: radial-gradient(circle, rgba(95, 231, 255, .25), transparent 62%);
    box-shadow: 0 0 45px rgba(95, 231, 255, .16);
    font: 500 18px 'DM Mono', monospace;
}

.radar::before,
.radar::after {
    position: absolute;
    border: 1px solid rgba(95, 231, 255, .3);
    border-radius: 50%;
    content: '';
}

.radar::before {
    inset: 22px;
}

.radar::after {
    inset: 48px;
}

.radar span {
    position: absolute;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--mint);
    box-shadow: 0 0 15px var(--mint);
}

.radar span:nth-child(1) {
    top: 26%;
    left: 26%;
}

.radar span:nth-child(2) {
    right: 24%;
    bottom: 28%;
    background: var(--violet);
    box-shadow: 0 0 15px var(--violet);
}

.radar span:nth-child(3) {
    top: 47%;
    right: 16%;
}

.region-list {
    display: grid;
    gap: 14px;
}

.map-panel {
    grid-column: 1 / -1;
    overflow: hidden;
}

.map-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) minmax(235px, .7fr);
    min-height: 430px;
}

.map-stage {
    position: relative;
    min-width: 0;
    padding: 22px;
    background: radial-gradient(circle at 48% 48%, rgba(22, 82, 111, .28), transparent 55%), rgba(4, 18, 29, .78);
    background-image: linear-gradient(rgba(95, 231, 255, .045) 1px, transparent 1px), linear-gradient(90deg, rgba(95, 231, 255, .045) 1px, transparent 1px), radial-gradient(circle at 48% 48%, rgba(22, 82, 111, .28), transparent 55%);
    background-size: 28px 28px, 28px 28px, auto;
}

.map-stage::before,
.map-stage::after {
    position: absolute;
    border: 1px solid rgba(95, 231, 255, .2);
    border-radius: 50%;
    content: '';
    pointer-events: none;
}

.map-stage::before {
    inset: 12% 19%;
}

.map-stage::after {
    inset: 20% 27%;
    border-color: rgba(108, 246, 198, .13);
}

.map-status {
    position: absolute;
    z-index: 1;
    top: 19px;
    left: 22px;
    color: var(--muted);
    font: 10px 'DM Mono', monospace;
    letter-spacing: .03em;
}

.map-stage svg {
    position: relative;
    z-index: 1;
    display: block;
    width: 100%;
    height: 390px;
    margin-top: 8px;
}

.map-shape {
    fill: color-mix(in srgb, var(--cyan) calc(16% + var(--map-intensity) * 54%), #0a2437);
    stroke: rgba(95, 231, 255, .78);
    stroke-width: .8;
    vector-effect: non-scaling-stroke;
    cursor: pointer;
    outline: 0;
    transition: fill .2s ease, stroke .2s ease, filter .2s ease;
}

.map-shape:hover,
.map-shape:focus-visible,
.map-shape.selected {
    fill: color-mix(in srgb, var(--mint) calc(26% + var(--map-intensity) * 58%), #103849);
    stroke: var(--mint);
    stroke-width: 1.8;
    filter: drop-shadow(0 0 6px rgba(108, 246, 198, .65));
}

.map-shape:hover,
.map-shape:focus-visible {
    stroke-dasharray: 4 2;
    filter: drop-shadow(0 0 9px rgba(95, 231, 255, .9));
}

.map-tooltip {
    position: absolute;
    z-index: 4;
    display: grid;
    width: min(210px, calc(100% - 24px));
    gap: 6px;
    padding: 12px 14px;
    border: 1px solid var(--cyan);
    color: var(--text);
    background: color-mix(in srgb, var(--panel-strong) 90%, var(--cyan) 10%);
    box-shadow: 0 0 0 1px rgba(95, 231, 255, .12), 0 0 26px rgba(95, 231, 255, .28);
    pointer-events: none;
    backdrop-filter: blur(10px);
    transform: translateZ(0);
}

.map-tooltip::before,
.map-tooltip::after {
    position: absolute;
    content: '';
    pointer-events: none;
}

.map-tooltip::before {
    inset: 4px;
    border: 1px solid rgba(108, 246, 198, .18);
}

.map-tooltip::after {
    right: 10px;
    bottom: 7px;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--mint);
    box-shadow: 0 0 10px var(--mint);
}

.map-tooltip > * {
    position: relative;
    z-index: 1;
}

.map-tooltip > span:first-child {
    color: var(--cyan);
    font: 500 8px 'DM Mono', monospace;
    letter-spacing: .13em;
}

.map-tooltip > strong {
    font: 600 15px 'Electrolize', 'Space Grotesk', sans-serif;
}

.map-tooltip > div {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    color: var(--muted);
    font: 10px 'DM Mono', monospace;
}

.map-tooltip > b {
    color: var(--mint);
    font: 500 10px 'DM Mono', monospace;
}

.map-legend {
    position: absolute;
    right: 22px;
    bottom: 20px;
    z-index: 1;
    display: flex;
    gap: 11px;
    color: var(--muted);
    font: 9px 'DM Mono', monospace;
}

.map-legend span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.map-legend i {
    display: inline-block;
    width: 9px;
    height: 9px;
    border: 1px solid var(--cyan);
}

.legend-low { background: rgba(95, 231, 255, .18); }
.legend-mid { background: rgba(95, 231, 255, .46); }
.legend-high { background: rgba(95, 231, 255, .75); }

.map-detail {
    display: flex;
    flex-direction: column;
    min-width: 0;
    padding: 27px 24px;
    border-left: 1px solid var(--line);
    background: linear-gradient(145deg, rgba(13, 36, 51, .9), rgba(6, 19, 30, .9));
}

.map-detail h4 {
    margin: 12px 0 6px;
    color: var(--text);
    font-size: clamp(20px, 2.2vw, 30px);
    letter-spacing: -.06em;
}

.map-detail p {
    min-height: 17px;
    margin: 0;
    color: var(--muted);
    font: 10px 'DM Mono', monospace;
}

.map-total {
    display: grid;
    gap: 3px;
    margin: 30px 0 21px;
    padding-bottom: 17px;
    border-bottom: 1px solid var(--line);
}

.map-total strong {
    color: var(--cyan);
    font: 500 46px/.9 'DM Mono', monospace;
    letter-spacing: -.1em;
    text-shadow: 0 0 20px rgba(95, 231, 255, .35);
}

.map-total span {
    color: var(--muted);
    font: 9px 'DM Mono', monospace;
    letter-spacing: .14em;
}

.map-metrics {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 7px;
}

.map-metrics div {
    display: grid;
    gap: 7px;
    padding: 10px 8px;
    border: 1px solid var(--line);
    background: rgba(5, 17, 27, .45);
}

.map-metrics span {
    color: var(--muted);
    font: 9px 'DM Mono', monospace;
}

.map-metrics strong {
    color: var(--text);
    font: 500 18px 'DM Mono', monospace;
}

.map-villages {
    display: grid;
    gap: 10px;
    margin-top: 25px;
}

.map-villages > div {
    display: grid;
    gap: 5px;
    max-height: 145px;
    overflow: auto;
    padding-right: 4px;
}

.map-villages span {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    padding: 5px 0;
    border-bottom: 1px solid rgba(117, 211, 239, .08);
    color: #a6c5cd;
    font-size: 11px;
}

.map-villages span b {
    color: var(--mint);
    font: 500 10px 'DM Mono', monospace;
}

.map-villages small {
    color: var(--muted);
    font: 10px 'DM Mono', monospace;
}

.region-row {
    display: grid;
    grid-template-columns: 24px 95px 1fr 33px;
    align-items: center;
    gap: 8px;
    font-size: 11px;
}

.region-row>span {
    color: #557787;
    font: 10px 'DM Mono', monospace;
}

.region-row strong {
    white-space: nowrap;
    font-weight: 500;
}

.region-row>b {
    color: var(--cyan);
    font: 500 11px 'DM Mono', monospace;
    text-align: right;
}

.bar {
    height: 6px;
    overflow: hidden;
    background: rgba(95, 231, 255, .08);
}

.bar i {
    display: block;
    height: 100%;
    min-width: 2px;
    background: linear-gradient(90deg, var(--cyan), var(--mint));
    box-shadow: 0 0 10px var(--cyan);
}

.mix-panel {
    min-height: 350px;
}

.donut {
    display: grid;
    place-items: center;
    width: 176px;
    height: 176px;
    margin: 29px auto 22px;
    border-radius: 50%;
    background: conic-gradient(var(--violet) 0 var(--odgj), var(--cyan) var(--odgj) 360deg);
    box-shadow: 0 0 40px rgba(199, 148, 255, .1);
}

.donut::before {
    width: 125px;
    height: 125px;
    border-radius: 50%;
    background: var(--bg-soft);
    content: '';
}

.donut>div {
    position: absolute;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.donut strong {
    font: 500 27px 'DM Mono', monospace;
}

.donut span {
    color: var(--muted);
    font: 9px 'DM Mono', monospace;
    letter-spacing: .14em;
}

.legend-list {
    display: grid;
    gap: 10px;
    padding: 0 34px 24px;
}

.legend-list div {
    display: grid;
    grid-template-columns: 13px 1fr auto;
    align-items: center;
    gap: 9px;
    color: var(--muted);
    font-size: 12px;
}

.legend-list b {
    color: var(--text);
    font: 500 12px 'DM Mono', monospace;
}

.dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.cyan-dot {
    background: var(--cyan);
    box-shadow: 0 0 9px var(--cyan);
}

.violet-dot {
    background: var(--violet);
    box-shadow: 0 0 9px var(--violet);
}

.table-panel {
    grid-column: 1 / -1;
}

.case-table {
    overflow-x: auto;
}

.case-head,
.case-row {
    display: grid;
    grid-template-columns: 1.1fr .6fr 1.6fr .5fr;
    gap: 16px;
    min-width: 600px;
    padding: 13px 22px;
}

.case-head {
    color: var(--muted);
    font: 10px 'DM Mono', monospace;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.case-row {
    border-top: 1px solid rgba(117, 211, 239, .08);
    color: #b4d0d8;
    font-size: 12px;
}

.case-row .mono {
    color: var(--cyan);
    font: 10px 'DM Mono', monospace;
}

.severity {
    color: var(--danger);
    font: 10px 'DM Mono', monospace;
}

.empty-state {
    padding: 30px 22px;
    color: var(--muted);
}

.privacy-note {
    margin: 0;
    padding: 0 22px 18px;
    color: #587684;
    font: 10px 'DM Mono', monospace;
}

.village-panel {
    margin-top: 13px;
}

.coverage-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1px;
    background: var(--line);
}

.coverage-card {
    min-height: 145px;
    padding: 17px;
    background: rgba(9, 26, 39, .92);
}

.coverage-card.muted-card {
    opacity: .55;
}

.coverage-top {
    display: flex;
    justify-content: space-between;
    gap: 10px;
}

.coverage-top strong {
    font-size: 13px;
}

.coverage-top b {
    color: var(--cyan);
    font: 500 17px 'DM Mono', monospace;
}

.coverage-card small {
    display: block;
    margin-top: 6px;
    color: var(--muted);
    font: 9px 'DM Mono', monospace;
}

.village-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 15px;
}

.village-tags span {
    padding: 4px 6px;
    border: 1px solid rgba(117, 211, 239, .14);
    color: #8eb1bd;
    font: 9px 'DM Mono', monospace;
}

.village-tags b {
    color: var(--mint);
}

.dashboard-footer {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    padding: 20px 0 4px;
    color: #567584;
    font: 9px 'DM Mono', monospace;
    letter-spacing: .08em;
}

/* Cruip-style collapsible navigation */
.sidebar-header {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 10px;
}

.sidebar-header .brand-lockup {
    min-width: 0;
}

.sidebar-toggle,
.side-nav-group-toggle,
.mobile-menu-button,
.map-back-button {
    border: 0;
    color: inherit;
    background: transparent;
    cursor: pointer;
}

.sidebar-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 7px;
    border: 1px solid var(--line);
    color: var(--muted);
    font: 10px 'DM Mono', monospace;
}

.sidebar-toggle:hover,
.side-nav-group-toggle:hover,
.map-back-button:hover {
    color: var(--cyan);
}

.sidebar-toggle > span:first-child {
    color: var(--cyan);
    font-size: 20px;
    line-height: .7;
}

.sidebar.is-collapsed {
    flex-basis: 78px;
    width: 78px;
    padding-right: 12px;
    padding-left: 12px;
}

.sidebar.is-expanded {
    flex-basis: 235px;
    width: 235px;
}

.sidebar.is-collapsed .brand-wordmark,
.sidebar.is-collapsed .sidebar-label,
.sidebar.is-collapsed .side-nav-text,
.sidebar.is-collapsed .side-nav-chevron,
.sidebar.is-collapsed .sidebar-toggle-label,
.sidebar.is-collapsed .logout-label,
.sidebar.is-collapsed .side-nav-children {
    display: none;
}

.sidebar.is-collapsed .sidebar-header {
    display: flex;
    justify-content: center;
}

.sidebar.is-collapsed .sidebar-toggle {
    position: absolute;
    top: 77px;
    right: 17px;
    padding: 0;
    border: 0;
}

.sidebar.is-collapsed .sidebar-toggle > span:first-child {
    font-size: 25px;
}

.sidebar.is-collapsed .sidebar-label {
    margin-top: 72px;
}

.sidebar.is-collapsed .side-nav a,
.sidebar.is-collapsed .side-nav-group-toggle {
    justify-content: center;
    padding-right: 0;
    padding-left: 0;
}

.sidebar.is-collapsed .live-indicator {
    font-size: 0;
    text-align: center;
}

.sidebar.is-collapsed .live-indicator i {
    width: 8px;
    height: 8px;
}

.side-nav-group {
    border-left: 2px solid transparent;
}

.side-nav-group.is-open {
    border-color: var(--cyan);
    background: linear-gradient(90deg, rgba(95, 231, 255, .12), transparent);
}

.side-nav-group-toggle {
    display: flex;
    align-items: center;
    width: 100%;
    gap: 13px;
    padding: 12px;
    color: var(--muted);
    font-size: 13px;
    text-align: left;
}

.side-nav-group-toggle > span:first-child {
    color: var(--cyan);
    font-size: 19px;
}

.side-nav-chevron {
    margin-left: auto;
    color: var(--muted);
    transition: transform .2s ease;
}

.side-nav-group.is-open .side-nav-chevron {
    transform: rotate(180deg);
}

.side-nav-children {
    display: grid;
    gap: 2px;
    padding: 0 9px 9px 47px;
}

.side-nav-children a {
    display: block;
    padding: 7px 8px;
    border: 0;
    color: var(--muted);
    font: 10px 'DM Mono', monospace;
    letter-spacing: .04em;
}

.side-nav-children a:hover {
    color: var(--text);
    background: rgba(95, 231, 255, .08);
}

.mobile-menu-button {
    display: none;
    padding: 8px 11px;
    border: 1px solid var(--line);
    color: var(--cyan);
}

.sidebar-overlay {
    display: none;
}

.map-heading-actions {
    display: grid;
    justify-items: end;
    gap: 8px;
}

.map-back-button {
    padding: 5px 8px;
    border: 1px solid var(--line);
    color: var(--cyan);
    font: 9px 'DM Mono', monospace;
}

.map-metrics {
    grid-template-columns: repeat(4, 1fr);
}

.map-shape {
    fill: rgba(95, 231, 255, calc(.16 + var(--map-intensity) * .54));
}

.map-shape.village-shape {
    stroke-width: .55;
}

.map-shape.village-shape:hover,
.map-shape.village-shape:focus-visible,
.map-shape.village-shape.selected {
    stroke-width: 1.5;
}

.amber-dot {
    background: var(--amber);
    box-shadow: 0 0 9px var(--amber);
}

@media (max-width: 1050px) {
    .sidebar {
        flex-basis: 190px;
    }

    .region-visual {
        grid-template-columns: 1fr;
    }

    .radar {
        width: 145px;
        height: 145px;
    }

    .coverage-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .map-layout {
        grid-template-columns: 1fr;
    }

    .map-detail {
        border-top: 1px solid var(--line);
        border-left: 0;
    }

    .map-villages > div {
        max-height: none;
    }
}

@media (max-width: 760px) {
    .auth-shell {
        grid-template-columns: 1fr;
    }

    .auth-panel {
        min-height: 100vh;
        width: 100%;
    }

    .auth-visual {
        display: none;
    }

    .sidebar,
    .sidebar.is-collapsed,
    .sidebar.is-expanded {
        position: fixed;
        z-index: 50;
        top: 0;
        left: 0;
        width: 235px;
        min-width: 235px;
        height: 100dvh;
        padding: 22px;
        transform: translateX(-105%);
        transition: transform .2s ease;
    }

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

    .sidebar.is-collapsed .brand-wordmark,
    .sidebar.is-collapsed .sidebar-label,
    .sidebar.is-collapsed .side-nav-text,
    .sidebar.is-collapsed .sidebar-toggle-label,
    .sidebar.is-collapsed .logout-label,
    .sidebar.is-collapsed .side-nav-chevron,
    .sidebar.is-collapsed .side-nav-children {
        display: inline;
    }

    .sidebar.is-collapsed .sidebar-header {
        display: grid;
    }

    .sidebar.is-collapsed .sidebar-toggle {
        position: static;
        padding: 6px 7px;
        border: 1px solid var(--line);
    }

    .sidebar-overlay {
        position: fixed;
        z-index: 40;
        inset: 0;
        display: block;
        visibility: hidden;
        opacity: 0;
        background: rgba(3, 10, 16, .72);
        transition: opacity .2s ease, visibility .2s ease;
    }

    .sidebar-overlay.is-visible {
        visibility: visible;
        opacity: 1;
    }

    .dashboard-main {
        width: 100%;
        overflow: hidden;
        padding: 26px 15px;
    }

    .topbar {
        align-items: start;
        flex-direction: column;
    }

    .mobile-menu-button {
        display: inline-block;
    }

    .topbar h1 {
        font-size: 32px;
    }

    .topbar h1 span {
        display: block;
    }

    .operator-chip {
        align-self: stretch;
    }

    .signal-banner {
        align-items: start;
        flex-direction: column;
        gap: 22px;
    }

    .banner-number {
        text-align: left;
    }

    .metric-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .map-metrics {
        grid-template-columns: repeat(2, 1fr);
    }

    .content-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .table-panel {
        grid-column: auto;
    }

    .toolbar {
        align-items: start;
        flex-direction: column;
    }

    .filter-form {
        flex-wrap: wrap;
    }

    .coverage-grid {
        grid-template-columns: 1fr;
    }

    .map-stage {
        padding: 16px 10px;
    }

    .map-stage svg {
        height: 290px;
        margin-top: 20px;
    }

    .map-status {
        top: 15px;
        left: 10px;
    }

    .map-legend {
        right: 10px;
        bottom: 13px;
        gap: 6px;
        font-size: 8px;
    }

    .map-detail {
        padding: 22px 17px;
    }

    .dashboard-footer {
        flex-direction: column;
    }
}

.brand-lockup,
.auth-copy h1,
.topbar h1,
.panel-heading h3,
.map-detail h4,
.side-nav a,
.side-nav-group-toggle {
    font-family: 'Electrolize', 'Space Grotesk', sans-serif;
}

.auth-copy h1,
.topbar h1 {
    font-weight: 600;
}

/* Light-mode map colors need a darker ramp than the dark-mode defaults. */
html[data-theme="light"] .map-stage {
    background: radial-gradient(circle at 48% 48%, rgba(154, 211, 222, .28), transparent 55%), #d7eaef;
    background-image: linear-gradient(rgba(8, 125, 158, .12) 1px, transparent 1px), linear-gradient(90deg, rgba(8, 125, 158, .12) 1px, transparent 1px), radial-gradient(circle at 48% 48%, rgba(154, 211, 222, .28), transparent 55%);
}

html[data-theme="light"] .map-stage::before {
    border-color: rgba(8, 125, 158, .28);
}

html[data-theme="light"] .map-stage::after {
    border-color: rgba(0, 121, 95, .22);
}

html[data-theme="light"] .map-shape {
    fill: color-mix(in srgb, #087d9e calc(32% + var(--map-intensity) * 36%), #c1e1e8);
    stroke: #087d9e;
    stroke-width: 1.05;
}

html[data-theme="light"] .map-shape:hover,
html[data-theme="light"] .map-shape:focus-visible,
html[data-theme="light"] .map-shape.selected {
    fill: color-mix(in srgb, #00795f calc(48% + var(--map-intensity) * 36%), #a9d8d0);
    stroke: #006b62;
    stroke-width: 2;
    filter: drop-shadow(0 0 8px rgba(0, 121, 95, .55));
}

html[data-theme="light"] .map-shape:hover,
html[data-theme="light"] .map-shape:focus-visible {
    stroke: #006b62;
    stroke-dasharray: 4 2;
    filter: drop-shadow(0 0 11px rgba(8, 125, 158, .7));
}

html[data-theme="light"] .map-shape.village-shape {
    stroke-width: .9;
}

html[data-theme="light"] .legend-low {
    background: #c1e1e8;
}

html[data-theme="light"] .legend-mid {
    background: #54b6c8;
}

html[data-theme="light"] .legend-high {
    background: #087d9e;
}

/* Dashboard navigation and operator dropdown */
.sidebar-header .brand-lockup,
.brand-wordmark {
    min-width: max-content;
    white-space: nowrap;
}

.sidebar-bottom {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: auto;
    min-height: 30px;
}

.sidebar-bottom .sidebar-toggle {
    position: static !important;
    top: auto;
    right: auto;
    justify-content: flex-start;
    width: 100%;
}

.sidebar.is-collapsed .sidebar-bottom .sidebar-toggle {
    justify-content: center;
    padding: 0;
    border: 0;
}

.topbar-kicker {
    display: flex;
    align-items: center;
    gap: 18px;
}

.topbar-kicker > p {
    margin: 0;
}

.topbar-kicker .live-indicator {
    white-space: nowrap;
}

.user-menu {
    position: relative;
}

.operator-chip {
    position: relative;
    min-width: 205px;
    color: var(--text);
    cursor: pointer;
    font: inherit;
    text-align: left;
}

.user-menu-chevron {
    margin-left: auto;
    color: var(--muted);
    font-size: 15px;
    transition: transform .2s ease;
}

.user-menu [aria-expanded="true"] .user-menu-chevron {
    transform: rotate(180deg);
}

[x-cloak] {
    display: none !important;
}

.user-menu-dropdown {
    position: absolute;
    z-index: 30;
    top: calc(100% + 8px);
    right: 0;
    display: grid;
    width: 220px;
    gap: 8px;
    padding: 15px;
    border: 1px solid var(--line-bright);
    color: var(--text);
    background: var(--panel-strong);
    box-shadow: 0 18px 40px rgba(0, 0, 0, .24), 0 0 24px rgba(95, 231, 255, .12);
}

.user-menu-dropdown > strong {
    font-size: 13px;
}

.dropdown-logout {
    display: flex;
    justify-content: space-between;
    width: 100%;
    margin-top: 6px;
    border: 0;
    border-top: 1px solid var(--line);
    padding: 12px 0 0;
    color: var(--danger);
    background: transparent;
    cursor: pointer;
    font: 500 11px 'DM Mono', monospace;
    text-align: left;
}

html[data-theme="light"] .user-menu-dropdown {
    box-shadow: 0 18px 40px rgba(23, 74, 89, .16), 0 0 24px rgba(8, 125, 158, .12);
}

@media (max-width: 760px) {
    .topbar-kicker {
        align-items: flex-start;
        flex-direction: column;
        gap: 8px;
    }

    .topbar-actions,
    .user-menu,
    .operator-chip {
        width: 100%;
    }

    .user-menu-dropdown {
        right: auto;
        left: 0;
        width: 100%;
    }
}

.auth-form label {
    color: var(--muted);
}

.auth-form input {
    color: var(--text);
    -webkit-text-fill-color: var(--text);
    caret-color: var(--cyan);
}

.auth-form input::placeholder {
    color: var(--muted);
    opacity: 1;
}

html[data-theme="dark"] .auth-form input {
    border-color: rgba(95, 231, 255, .3);
    background: #0d2230;
}

html[data-theme="dark"] .auth-form input:focus {
    border-color: var(--cyan);
    background: #102b3a;
}

html[data-theme="light"] .auth-form input {
    border-color: rgba(6, 16, 25, .34);
    background: #ffffff;
}

html[data-theme="light"] .auth-form input:focus {
    border-color: #087d9e;
    background: #ffffff;
}

.auth-form input:-webkit-autofill,
.auth-form input:-webkit-autofill:hover,
.auth-form input:-webkit-autofill:focus {
    -webkit-text-fill-color: var(--text);
    box-shadow: 0 0 0 1000px var(--panel-strong) inset;
}

/* Keep the collapsed navigation rhythm aligned with the expanded sidebar. */
@media (min-width: 761px) {
    .sidebar.is-collapsed .side-nav {
        margin-top: 72px;
    }
}

/* Source filters use the same compact command-menu language as the account menu. */
.filter-dropdown {
    position: relative;
}

.filter-dropdown-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    min-width: 178px;
    border: 1px solid var(--line-bright);
    padding: 12px 13px;
    color: var(--text);
    background: var(--panel-strong);
    cursor: pointer;
    font: 12px 'DM Mono', monospace;
    text-align: left;
}

.filter-dropdown-trigger:hover,
.filter-dropdown-trigger:focus-visible {
    border-color: var(--cyan);
    color: var(--cyan);
    outline: none;
    box-shadow: 0 0 18px rgba(95, 231, 255, .12);
}

.filter-dropdown-chevron {
    color: var(--muted);
    font-size: 15px;
    line-height: .7;
    transition: transform .2s ease;
}

.filter-dropdown-trigger[aria-expanded="true"] .filter-dropdown-chevron {
    transform: rotate(180deg);
}

.filter-dropdown-menu {
    position: absolute;
    z-index: 30;
    top: calc(100% + 8px);
    right: 0;
    display: grid;
    width: 190px;
    gap: 3px;
    padding: 7px;
    border: 1px solid var(--line-bright);
    background: var(--panel-strong);
    box-shadow: 0 18px 40px rgba(0, 0, 0, .24), 0 0 24px rgba(95, 231, 255, .12);
}

.filter-dropdown-menu a {
    display: block;
    padding: 10px 11px;
    color: var(--muted);
    font: 11px 'DM Mono', monospace;
    text-decoration: none;
    transition: .2s ease;
}

.filter-dropdown-menu a:hover,
.filter-dropdown-menu a:focus-visible,
.filter-dropdown-menu a[aria-current="true"] {
    color: var(--text);
    background: linear-gradient(90deg, rgba(95, 231, 255, .14), transparent);
    outline: none;
}

.filter-dropdown-menu a[aria-current="true"] {
    color: var(--cyan);
}

.filter-reset {
    border: 1px solid var(--cyan);
    padding: 11px 13px;
    color: var(--cyan);
    font: 11px 'DM Mono', monospace;
    text-decoration: none;
    transition: .2s ease;
}

.filter-reset:hover,
.filter-reset:focus-visible {
    color: var(--panel-strong);
    background: var(--cyan);
    outline: none;
}

html[data-theme="light"] .filter-dropdown-menu {
    box-shadow: 0 18px 40px rgba(23, 74, 89, .16), 0 0 24px rgba(8, 125, 158, .12);
}

@media (max-width: 1180px) and (min-width: 761px) {
    .metric-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

/* Mobile keeps the menu, theme, and account controls in one header row. */
.topbar-mobile-controls {
    display: flex;
    align-items: center;
    gap: 16px;
}

/* Map severity ramp: low yellow, medium orange, high red. */
.map-shape.map-low {
    fill: #f6d365;
    stroke: #a97800;
}

.map-shape.map-mid {
    fill: #f08a24;
    stroke: #a94f00;
}

.map-shape.map-high {
    fill: #d93636;
    stroke: #8f1f2a;
}

.map-shape.map-low:hover,
.map-shape.map-low:focus-visible,
.map-shape.map-low.selected,
.map-shape.map-mid:hover,
.map-shape.map-mid:focus-visible,
.map-shape.map-mid.selected,
.map-shape.map-high:hover,
.map-shape.map-high:focus-visible,
.map-shape.map-high.selected {
    stroke: #fff4c2;
    stroke-width: 2;
    stroke-dasharray: 4 2;
    filter: drop-shadow(0 0 9px rgba(255, 198, 61, .72));
}

.map-shape.map-low:hover,
.map-shape.map-low:focus-visible {
    fill: #ffe49a;
}

.map-shape.map-mid:hover,
.map-shape.map-mid:focus-visible {
    fill: #ffad52;
}

.map-shape.map-high:hover,
.map-shape.map-high:focus-visible {
    fill: #f05b55;
}

.legend-low {
    border-color: #a97800;
    background: #f6d365;
}

.legend-mid {
    border-color: #a94f00;
    background: #f08a24;
}

.legend-high {
    border-color: #8f1f2a;
    background: #d93636;
}

html[data-theme="light"] .map-shape.map-low {
    fill: #f6d365;
    stroke: #a97800;
}

html[data-theme="light"] .map-shape.map-mid {
    fill: #f08a24;
    stroke: #a94f00;
}

html[data-theme="light"] .map-shape.map-high {
    fill: #d93636;
    stroke: #8f1f2a;
}

html[data-theme="light"] .map-shape.map-low:hover,
html[data-theme="light"] .map-shape.map-low:focus-visible {
    fill: #ffe49a;
}

html[data-theme="light"] .map-shape.map-mid:hover,
html[data-theme="light"] .map-shape.map-mid:focus-visible {
    fill: #ffad52;
}

html[data-theme="light"] .map-shape.map-high:hover,
html[data-theme="light"] .map-shape.map-high:focus-visible {
    fill: #f05b55;
}

html[data-theme="light"] .map-shape.map-low.selected,
html[data-theme="light"] .map-shape.map-mid.selected,
html[data-theme="light"] .map-shape.map-high.selected,
html[data-theme="light"] .map-shape.map-low:hover,
html[data-theme="light"] .map-shape.map-low:focus-visible,
html[data-theme="light"] .map-shape.map-mid:hover,
html[data-theme="light"] .map-shape.map-mid:focus-visible,
html[data-theme="light"] .map-shape.map-high:hover,
html[data-theme="light"] .map-shape.map-high:focus-visible {
    stroke: #713e00;
    filter: drop-shadow(0 0 9px rgba(207, 102, 22, .5));
}

html[data-theme="light"] .map-shape.map-low.selected {
    fill: #f6d365;
}

html[data-theme="light"] .map-shape.map-mid.selected {
    fill: #f08a24;
}

html[data-theme="light"] .map-shape.map-high.selected {
    fill: #d93636;
}

html[data-theme="light"] .legend-low {
    border-color: #a97800;
    background: #f6d365;
}

html[data-theme="light"] .legend-mid {
    border-color: #a94f00;
    background: #f08a24;
}

html[data-theme="light"] .legend-high {
    border-color: #8f1f2a;
    background: #d93636;
}

.map-village-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
    border: 1px solid transparent;
    border-bottom-color: rgba(117, 211, 239, .08);
    padding: 7px 6px;
    color: #a6c5cd;
    background: transparent;
    cursor: pointer;
    font: 11px 'Space Grotesk', sans-serif;
    text-align: left;
    transition: .2s ease;
}

.map-village-item span,
.map-village-item b {
    display: block;
    border: 0;
    padding: 0;
}

.map-village-item b {
    color: var(--mint);
    font: 500 10px 'DM Mono', monospace;
}

.map-village-item:hover,
.map-village-item:focus-visible,
.map-village-item.is-selected {
    border-color: rgba(255, 174, 70, .55);
    color: var(--text);
    background: linear-gradient(90deg, rgba(240, 138, 36, .22), transparent);
    outline: none;
    box-shadow: 0 0 14px rgba(240, 138, 36, .12);
}

@media (max-width: 760px) {
    .topbar {
        align-items: stretch;
        flex-direction: column;
        gap: 18px;
    }

    .topbar-heading {
        order: 1;
    }

    .topbar-mobile-controls {
        order: 0;
        justify-content: space-between;
        width: 100%;
    }

    .topbar-mobile-controls .topbar-actions {
        display: flex;
        align-items: center;
        justify-content: flex-end;
        flex-direction: row;
        flex-wrap: nowrap;
        width: auto;
        gap: 8px;
    }

    .topbar-mobile-controls .theme-switcher {
        align-self: auto;
    }

    .topbar-mobile-controls .user-menu {
        width: auto;
    }

    .topbar-mobile-controls .user-menu-dropdown {
        right: 0;
        left: auto;
        width: 220px;
    }

    .topbar-mobile-controls .operator-chip {
        justify-content: center;
        width: 44px;
        min-width: 44px;
        height: 44px;
        padding: 6px;
    }

    .topbar-mobile-controls .operator-chip > div:not(.avatar) {
        display: none;
    }

    .topbar-mobile-controls .user-menu-chevron {
        display: none;
    }

    .topbar-mobile-controls .theme-switcher button {
        padding: 7px 8px;
    }
}

/* Mosaic-style site header: controls stay in the header, page title stays below it. */
.topbar {
    position: sticky;
    z-index: 20;
    top: 0;
    display: flex;
    align-items: center;
    min-height: 64px;
    margin: -40px 0 0;
    padding: 12px 0;
    border-bottom: 1px solid var(--line);
    background: rgba(5, 17, 27, .9);
    backdrop-filter: none;
}

html[data-theme="light"] .topbar {
    background: rgba(255, 255, 255, .86);
}

.topbar-mobile-controls {
    justify-content: flex-end;
    width: 100%;
}

.topbar-heading {
    margin-top: 18px;
}

.topbar-heading h1 {
    margin: 16px 0 0;
    color: var(--text);
    font-family: 'Electrolize', 'Space Grotesk', sans-serif;
    font-size: clamp(28px, 4vw, 54px);
    font-weight: 600;
    letter-spacing: -.065em;
    line-height: 1;
}

.topbar-heading h1 span {
    color: var(--muted);
    font-weight: 400;
}

.dashboard-content {
    flex: 1 1 auto;
    min-width: 0;
}

.dashboard-content > .topbar {
    width: 100%;
    margin: 0;
    padding: 12px clamp(22px, 4vw, 70px);
    background: #05111b;
}

html[data-theme="light"] .dashboard-content > .topbar {
    background: #ffffff;
}

.dashboard-content > .dashboard-main {
    padding-top: 0;
}

@media (max-width: 760px) {
    .dashboard-content > .topbar {
        align-items: center;
        flex-direction: row;
        min-height: 64px;
        margin: 0;
        padding: 10px 15px;
    }

    .dashboard-content > .dashboard-main {
        padding: 0 15px 26px;
        overflow: visible;
    }

    .topbar-mobile-controls {
        justify-content: space-between;
    }

    .topbar-heading {
        margin-top: 12px;
    }
}
