* {
    box-sizing: border-box;
}

:root {
    --primary: #1E3A8A;
    --primary-hover: #172f73;
    --secondary: #3B82F6;
    --accent: #F59E0B;
    --background: #EEF4FB;
    --surface: #FFFFFF;
    --surface-alt: #F1F5F9;
    --text: #1F2937;
    --muted: #6B7280;
    --border: #D1D5DB;
    --border-soft: #E5E7EB;
    --success: #15803D;
    --warning: #B45309;
    --danger: #B91C1C;
    --neutral: #64748B;
    --shadow: 0 8px 22px rgba(31, 41, 55, .07);
    --radius: 10px;
    --container: 1200px;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background: var(--background);
    color: var(--text);
    font-family: Inter, Poppins, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 15px;
    line-height: 1.6;
}

a {
    color: inherit;
}

button,
input,
select {
    font: inherit;
}

.site-header {
    background: rgba(255, 255, 255, .97);
    border-bottom: 1px solid var(--border-soft);
    position: sticky;
    top: 0;
    z-index: 50;
}

.header-inner {
    align-items: center;
    display: flex;
    gap: 24px;
    justify-content: space-between;
    margin: 0 auto;
    max-width: var(--container);
    min-height: 76px;
    padding: 0 24px;
}

.brand {
    align-items: center;
    color: var(--text);
    display: inline-flex;
    gap: 12px;
    text-decoration: none;
}

.brand-mark {
    align-items: center;
    background: var(--primary);
    border-radius: 10px;
    color: #fff;
    display: inline-flex;
    font-size: 14px;
    font-weight: 800;
    height: 44px;
    justify-content: center;
    overflow: hidden;
    position: relative;
    width: 44px;
}

.brand-mark img {
    display: block;
    height: 100%;
    object-fit: cover;
    object-position: center top;
    width: 100%;
}

.brand strong {
    display: block;
    font-size: 16px;
    font-weight: 800;
    line-height: 1.2;
}

.brand small {
    color: var(--muted);
    display: block;
    font-size: 12px;
}

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

.nav a,
.button,
button {
    align-items: center;
    background: var(--primary);
    border: 1px solid var(--primary);
    border-radius: 8px;
    color: #fff;
    cursor: pointer;
    display: inline-flex;
    gap: 8px;
    font-weight: 700;
    justify-content: center;
    min-height: 42px;
    padding: 10px 16px;
    text-decoration: none;
    transition: background .18s ease, border-color .18s ease, color .18s ease;
    white-space: nowrap;
}

.nav a:hover,
.button:hover,
button:hover {
    background: var(--primary-hover);
    border-color: var(--primary-hover);
}

.nav .link,
.button.secondary {
    background: transparent;
    border-color: transparent;
    color: var(--text);
}

.nav .link:hover,
.nav .link.active {
    color: var(--primary);
}

.button.secondary {
    border-color: var(--border);
}

.button.light {
    background: #fff;
    border-color: #fff;
    color: var(--primary);
}

.button.ghost {
    background: rgba(255, 255, 255, .12);
    border-color: rgba(255, 255, 255, .4);
    color: #fff;
}

.nav-check,
.nav-toggle,
.sidebar-check,
.sidebar-toggle {
    display: none;
}

.section,
.hero-inner {
    margin: 0 auto;
    max-width: var(--container);
    padding-left: 24px;
    padding-right: 24px;
}

.hero {
    background: #fff;
    border-bottom: 1px solid var(--border-soft);
}

.hero-inner {
    align-items: center;
    display: grid;
    gap: 56px;
    grid-template-columns: minmax(0, 1fr) minmax(360px, .9fr);
    min-height: 560px;
    padding-bottom: 64px;
    padding-top: 64px;
}

.eyebrow {
    color: var(--secondary);
    display: inline-flex;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 1.5px;
    margin-bottom: 12px;
    text-transform: uppercase;
}

.hero h1,
.dashboard-topbar h1 {
    color: var(--primary);
    font-size: 32px;
    font-weight: 800;
    line-height: 1.25;
    margin: 0;
}

.hero p {
    color: var(--muted);
    font-size: 16px;
    line-height: 1.7;
    margin: 16px 0 0;
    max-width: 620px;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 28px;
}

.hero-visual img {
    aspect-ratio: 16 / 10;
    border-radius: 12px;
    box-shadow: var(--shadow);
    display: block;
    object-fit: cover;
    width: 100%;
}

.hero-mini-stats {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-top: 14px;
}

.hero-mini-stats span {
    background: var(--surface-alt);
    border: 1px solid var(--border-soft);
    border-radius: 10px;
    color: var(--muted);
    display: grid;
    font-size: 12px;
    padding: 12px;
}

.hero-mini-stats strong {
    color: var(--primary);
    font-size: 20px;
    line-height: 1.2;
}

.section {
    padding-bottom: 40px;
    padding-top: 40px;
}

.public-page main > .section:nth-of-type(even) {
    background: rgba(255, 255, 255, .42);
    border-radius: 18px;
}

.public-page main > .section:nth-of-type(odd) {
    background: rgba(239, 246, 255, .38);
    border-radius: 18px;
}

.summary-strip {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.summary-card,
.metric-card,
.district-card,
.panel {
    background: var(--surface);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.summary-card {
    border-left: 4px solid var(--primary);
    display: flex;
    justify-content: space-between;
    min-height: 96px;
    padding: 18px;
}

.summary-card span,
.metric-card span {
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.summary-card strong,
.metric-card strong {
    color: var(--text);
    font-size: 30px;
    line-height: 1;
}

.summary-card.low,
.metric-card.low {
    border-left-color: var(--success);
}

.summary-card.medium,
.metric-card.medium {
    border-left-color: var(--warning);
}

.summary-card.high,
.metric-card.high {
    border-left-color: var(--danger);
}

.summary-card.unknown {
    border-left-color: var(--neutral);
}

.section-title,
.panel-heading {
    align-items: flex-start;
    display: flex;
    gap: 16px;
    justify-content: space-between;
    margin-bottom: 16px;
}

.section-title h2,
.panel h2,
.panel h3,
.district-card h3 {
    margin: 0;
}

.section-title h2,
.panel h2 {
    color: var(--text);
    font-size: 24px;
    font-weight: 700;
}

.panel h3 {
    font-size: 18px;
}

.muted {
    color: var(--muted);
}

.section-meta {
    background: #EFF6FF;
    border: 1px solid #BFDBFE;
    border-radius: 999px;
    color: var(--primary);
    font-size: 12px;
    font-weight: 700;
    padding: 6px 10px;
}

.grid,
.admin-grid {
    display: grid;
    gap: 16px;
}

.map-layout {
    display: grid;
    gap: 16px;
    grid-template-columns: minmax(0, 1fr) 300px;
}

.map-shell {
    background: var(--surface);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

#risk-map,
#admin-map {
    height: 560px;
    width: 100%;
}

.panel {
    padding: 20px;
}

.insight-panel {
    align-self: start;
}

.legend,
.watch-list,
dl {
    display: grid;
    gap: 10px;
}

.legend {
    margin-top: 14px;
}

.legend-item,
.stat-row,
dl div {
    align-items: center;
    display: flex;
    gap: 12px;
    justify-content: space-between;
}

.legend-item span:first-child {
    align-items: center;
    display: inline-flex;
    gap: 8px;
}

.dot {
    border-radius: 999px;
    display: inline-block;
    height: 10px;
    width: 10px;
}

.risk-low {
    background: var(--success);
}

.risk-medium {
    background: var(--warning);
}

.risk-high {
    background: var(--danger);
}

.risk-unknown {
    background: var(--neutral);
}

.insight-note {
    background: var(--surface-alt);
    border: 1px solid var(--border-soft);
    border-radius: 8px;
    display: grid;
    gap: 4px;
    margin-top: 16px;
    padding: 12px;
}

.insight-note strong {
    font-size: 13px;
}

.insight-note span {
    color: var(--muted);
    font-size: 13px;
}

.district-grid {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.district-card {
    display: grid;
    gap: 16px;
    min-height: 170px;
    padding: 18px;
}

.district-card h3 {
    font-size: 17px;
    margin-top: 10px;
}

dl {
    margin: 0;
}

dt {
    color: var(--muted);
    font-size: 13px;
}

dd {
    font-weight: 700;
    margin: 0;
}

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

table {
    border-collapse: collapse;
    width: 100%;
}

.table-wrap table {
    min-width: 760px;
}

th,
td {
    border-bottom: 1px solid var(--border-soft);
    padding: 12px;
    text-align: left;
    vertical-align: top;
}

th {
    background: var(--surface-alt);
    color: var(--text);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

tbody tr:nth-child(even) td {
    background: #FCFCFD;
}

.badge {
    border-radius: 999px;
    color: #fff;
    display: inline-flex;
    font-size: 12px;
    font-weight: 700;
    padding: 4px 10px;
}

.badge.risk-rendah,
.badge.risk-low {
    background: var(--success);
}

.badge.risk-sedang,
.badge.risk-medium {
    background: var(--warning);
}

.badge.risk-tinggi,
.badge.risk-high {
    background: var(--danger);
}

.badge.risk-belum-ada-data,
.badge.risk-unknown {
    background: var(--neutral);
}

.form-grid {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.form-grid .full {
    grid-column: 1 / -1;
}

label {
    color: var(--text);
    display: grid;
    font-size: 14px;
    font-weight: 700;
    gap: 6px;
}

input,
select {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text);
    min-height: 42px;
    padding: 10px 12px;
    width: 100%;
}

input:focus,
select:focus {
    border-color: var(--secondary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, .18);
    outline: none;
}

.form-actions {
    align-items: center;
    display: flex;
    justify-content: flex-end;
}

.alert {
    border-radius: 8px;
    font-weight: 700;
    margin-bottom: 16px;
    padding: 12px 14px;
}

.alert.success {
    background: #ECFDF5;
    border: 1px solid #BBF7D0;
    color: #14532D;
}

.alert.error {
    background: #FEF2F2;
    border: 1px solid #FECACA;
    color: #7F1D1D;
}

.footer {
    align-items: center;
    background: #E5E7EB;
    color: var(--muted);
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
    margin-top: 40px;
    padding: 24px;
    text-align: center;
}

.leaflet-container {
    font-family: inherit;
}

.leaflet-interactive:focus {
    outline: none;
}

.leaflet-tooltip.district-label {
    background: rgba(255, 255, 255, .92);
    border: 0;
    border-radius: 999px;
    box-shadow: 0 3px 10px rgba(15, 23, 42, .16);
    color: #334155;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: .1px;
    padding: 4px 9px;
    pointer-events: none;
    text-shadow: none;
    white-space: nowrap;
}

.leaflet-tooltip.district-label::before {
    display: none;
}

.map-popup {
    min-width: 230px;
}

.map-popup strong {
    display: block;
    font-size: 15px;
    margin-bottom: 8px;
}

.map-popup table td {
    border-bottom: 1px solid var(--border-soft);
    padding: 6px 4px;
}

.map-popup table td:first-child {
    color: var(--muted);
}

.map-popup table td:last-child {
    font-weight: 700;
    text-align: right;
}

.login-page {
    align-items: center;
    background: var(--background);
    display: grid;
    min-height: 100vh;
    padding: 24px;
}

.login-panel {
    margin: 0 auto;
    max-width: 420px;
    padding: 24px;
    width: 100%;
}

.login-panel h1 {
    color: var(--primary);
    font-size: 28px;
    margin: 28px 0 8px;
}

.admin-page {
    background: var(--background);
}

.admin-shell {
    display: grid;
    gap: 24px;
    grid-template-columns: 260px minmax(0, 1fr);
    margin: 0 auto;
    max-width: 1440px;
    min-height: 100vh;
    padding: 24px;
}

.sidebar {
    background: #111827;
    border-radius: 12px;
    color: #E5E7EB;
    display: flex;
    flex-direction: column;
    gap: 24px;
    min-height: calc(100vh - 48px);
    padding: 20px;
    position: sticky;
    top: 24px;
}

.admin-brand,
.admin-brand small,
.admin-brand strong {
    color: #fff;
}

.admin-brand .brand-mark {
    background: var(--primary);
}

.sidebar-nav {
    display: grid;
    gap: 8px;
}

.sidebar-nav a {
    align-items: center;
    border-radius: 8px;
    color: #D1D5DB;
    display: flex;
    gap: 10px;
    font-weight: 700;
    padding: 11px 12px;
    text-decoration: none;
}

.sidebar-nav i {
    color: #93C5FD;
    width: 18px;
}

.sidebar-nav a.active,
.sidebar-nav a:hover {
    background: var(--primary);
    color: #fff;
}

.sidebar-nav a.active i,
.sidebar-nav a:hover i {
    color: #fff;
}

.sidebar-user {
    border-top: 1px solid rgba(255, 255, 255, .12);
    display: grid;
    gap: 8px;
    margin-top: auto;
    padding-top: 16px;
}

.sidebar-user span {
    color: #fff;
    font-weight: 800;
}

.sidebar-user a {
    color: #BFDBFE;
    font-weight: 700;
    text-decoration: none;
}

.admin-main {
    min-width: 0;
}

.dashboard-topbar {
    align-items: center;
    display: flex;
    gap: 16px;
    justify-content: space-between;
    margin-bottom: 16px;
}

.dashboard-topbar h1 {
    color: var(--text);
    font-size: 30px;
}

.dashboard-section {
    margin-bottom: 24px;
}

.dashboard-hero {
    background: var(--primary);
    border-radius: 12px;
    color: #fff;
    display: grid;
    gap: 24px;
    grid-template-columns: minmax(0, 1fr) 280px;
    margin-bottom: 24px;
    padding: 24px;
}

.dashboard-hero .eyebrow {
    color: #BFDBFE;
}

.dashboard-hero h2 {
    font-size: 24px;
    line-height: 1.4;
    margin: 0;
    max-width: 720px;
}

.dashboard-hero p {
    color: #DBEAFE;
    margin: 10px 0 0;
    max-width: 760px;
}

.dashboard-hero aside {
    background: rgba(255, 255, 255, .10);
    border: 1px solid rgba(255, 255, 255, .18);
    border-radius: 10px;
    padding: 18px;
}

.dashboard-hero aside span {
    color: #BFDBFE;
    display: block;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.dashboard-hero aside strong {
    display: block;
    font-size: 38px;
    line-height: 1;
    margin: 10px 0;
}

.dashboard-hero aside p {
    margin: 0;
}

.metric-grid {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.metric-card {
    border-left: 4px solid var(--primary);
    display: grid;
    gap: 8px;
    min-height: 128px;
    padding: 18px;
}

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

.input-grid {
    grid-template-columns: minmax(0, 1.35fr) minmax(260px, .65fr);
}

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

.watch-list span {
    background: #FEF2F2;
    border: 1px solid #FECACA;
    border-radius: 8px;
    color: #7F1D1D;
    font-weight: 700;
    padding: 10px 12px;
}

@media (max-width: 1100px) {
    .hero-inner,
    .map-layout,
    .dashboard-hero,
    .input-grid,
    .chart-grid,
    .data-grid {
        grid-template-columns: 1fr;
    }

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

    .admin-shell {
        grid-template-columns: 1fr;
    }

    .sidebar {
        min-height: auto;
        position: static;
    }

    .sidebar-toggle {
        align-items: center;
        background: rgba(255, 255, 255, .08);
        border: 1px solid rgba(255, 255, 255, .16);
        border-radius: 8px;
        color: #fff;
        cursor: pointer;
        display: flex;
        gap: 10px;
        font-weight: 700;
        padding: 10px 12px;
    }

    .sidebar-nav {
        display: none;
    }

    .sidebar-check:checked ~ .sidebar .sidebar-nav {
        display: grid;
    }
}

@media (max-width: 760px) {
    .header-inner,
    .dashboard-topbar,
    .section-title,
    .panel-heading {
        align-items: stretch;
        flex-direction: column;
    }

    .header-inner {
        min-height: 68px;
        position: relative;
    }

    .nav-toggle {
        cursor: pointer;
        display: grid;
        gap: 5px;
        margin-left: auto;
        padding: 8px;
    }

    .nav-toggle span {
        background: var(--text);
        border-radius: 999px;
        display: block;
        height: 2px;
        width: 22px;
    }

    .nav {
        background: #fff;
        border-top: 1px solid var(--border-soft);
        display: none;
        flex-direction: column;
        left: 0;
        padding: 12px 24px 18px;
        position: absolute;
        right: 0;
        top: 68px;
    }

    .nav-check:checked ~ .nav {
        display: flex;
    }

    .nav a {
        width: 100%;
    }

    .hero-inner {
        gap: 32px;
        min-height: auto;
        padding-bottom: 40px;
        padding-top: 40px;
    }

    .hero h1 {
        font-size: 30px;
    }

    .hero-mini-stats,
    .metric-grid,
    .summary-strip,
    .district-grid,
    .form-grid {
        grid-template-columns: 1fr;
    }

    .section,
    .hero-inner,
    .header-inner {
        padding-left: 16px;
        padding-right: 16px;
    }

    .admin-shell {
        padding: 16px;
    }

    #risk-map,
    #admin-map {
        height: 430px;
    }

    .table-wrap table {
        min-width: 720px;
    }
}

/* Responsive hardening for very small phones, tablets, and wide desktop screens. */
html,
body {
    max-width: 100%;
    overflow-x: hidden;
}

img,
canvas,
svg,
video {
    max-width: 100%;
}

canvas {
    display: block;
}

.hero-copy,
.hero-visual,
.panel,
.district-card,
.summary-card,
.metric-card,
.admin-main,
.map-shell,
.table-wrap {
    min-width: 0;
}

.section,
.hero-inner,
.header-inner {
    width: 100%;
}

.brand {
    min-width: 0;
}

.brand strong,
.hero h1,
.dashboard-topbar h1,
.dashboard-hero h2,
.district-card h3 {
    overflow-wrap: anywhere;
}

.nav {
    flex-wrap: wrap;
    justify-content: flex-end;
}

.hero-inner {
    grid-template-columns: minmax(0, 1fr) minmax(300px, .9fr);
}

.hero-mini-stats {
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
}

.summary-strip {
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}

.district-grid {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.metric-grid {
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}

.map-layout {
    grid-template-columns: minmax(0, 1fr) minmax(260px, 300px);
}

.table-wrap {
    -webkit-overflow-scrolling: touch;
}

@media (min-width: 1441px) {
    :root {
        --container: 1280px;
    }

    .admin-shell {
        max-width: 1520px;
    }
}

@media (max-width: 980px) {
    .header-inner {
        align-items: flex-start;
        flex-direction: column;
        gap: 14px;
        padding-bottom: 14px;
        padding-top: 14px;
    }

    .nav {
        justify-content: flex-start;
        width: 100%;
    }

    .nav a {
        min-height: 40px;
    }

    .hero-inner {
        gap: 36px;
        min-height: auto;
    }

    .hero-visual {
        order: -1;
    }

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

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

    .insight-panel h3,
    .insight-panel .legend {
        grid-column: 1 / -1;
    }
}

@media (max-width: 760px) {
    .header-inner {
        gap: 0;
    }

    .brand {
        max-width: calc(100% - 52px);
    }

    .brand-mark {
        flex: 0 0 40px;
        height: 40px;
        width: 40px;
    }

    .brand strong {
        font-size: 14px;
    }

    .brand small {
        font-size: 11px;
    }

    .nav {
        box-shadow: 0 10px 24px rgba(31, 41, 55, .08);
        padding: 12px 16px 18px;
    }

    .hero p {
        font-size: 15px;
    }

    .hero-actions,
    .form-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .hero-actions .button,
    .form-actions button {
        width: 100%;
    }

    .sidebar {
        border-radius: 10px;
        gap: 16px;
        padding: 16px;
    }

    .dashboard-hero {
        padding: 18px;
    }

    .dashboard-hero h2,
    .section-title h2,
    .panel h2 {
        font-size: 22px;
    }

    .dashboard-topbar h1 {
        font-size: 26px;
    }

    .table-wrap table {
        min-width: 680px;
    }
}

@media (max-width: 560px) {
    body {
        font-size: 14px;
    }

    .section {
        padding-bottom: 28px;
        padding-top: 28px;
    }

    .hero-inner {
        padding-bottom: 32px;
        padding-top: 32px;
    }

    .hero h1 {
        font-size: 28px;
    }

    .summary-card,
    .metric-card,
    .district-card,
    .panel {
        padding: 16px;
    }

    .summary-card,
    .metric-card {
        min-height: auto;
    }

    .summary-card strong,
    .metric-card strong {
        font-size: 26px;
    }

    .insight-panel {
        grid-template-columns: 1fr;
    }

    .dashboard-hero aside {
        padding: 14px;
    }

    .dashboard-hero aside strong {
        font-size: 32px;
    }

    #risk-map,
    #admin-map {
        height: 360px;
    }
}

@media (max-width: 420px) {
    .section,
    .hero-inner,
    .header-inner {
        padding-left: 12px;
        padding-right: 12px;
    }

    .admin-shell,
    .login-page {
        padding: 12px;
    }

    .hero h1 {
        font-size: 26px;
    }

    .eyebrow {
        font-size: 11px;
        letter-spacing: 1px;
    }

    .nav {
        top: 64px;
    }

    .table-wrap table {
        min-width: 620px;
    }

    th,
    td {
        padding: 10px;
    }

    #risk-map,
    #admin-map {
        height: 320px;
    }
}

/* Concept refresh: institutional landing page and light admin console. */
.public-page {
    background:
        radial-gradient(circle at 8% 12%, rgba(59, 130, 246, .12), transparent 30%),
        linear-gradient(180deg, #EEF4FB 0%, #F8FAFC 48%, #EAF2FB 100%);
}

.public-page .site-header {
    background: rgba(248, 250, 252, .96);
    border-bottom: 1px solid #EEF2F7;
}

.public-page .header-inner {
    max-width: 1520px;
    min-height: 92px;
}

.public-page .brand-mark {
    border-radius: 999px;
}

.public-page .brand strong {
    color: #111827;
    font-size: 20px;
    letter-spacing: .2px;
}

.public-page .brand small {
    display: none;
}

.public-page .nav {
    gap: 18px;
}

.public-page .nav .link {
    color: #475569;
    font-size: 17px;
    font-weight: 700;
}

.public-page .nav > a:last-child {
    background: #0284C7;
    border-color: #0284C7;
    border-radius: 12px;
    box-shadow: 0 12px 26px rgba(2, 132, 199, .18);
    min-height: 52px;
    padding: 0 30px;
}

.public-ticker {
    background: #EAF2FB;
    border-bottom: 1px solid #E5E7EB;
    color: #0369A1;
    font-size: 16px;
    font-weight: 800;
    letter-spacing: 1.5px;
    overflow: hidden;
    padding: 13px 0;
    text-transform: uppercase;
    white-space: nowrap;
}

.ticker-track {
    animation: ticker 32s linear infinite;
    display: inline-flex;
    gap: 28px;
    min-width: max-content;
}

.ticker-track span::after {
    content: "\2022";
    margin-left: 28px;
}

@keyframes ticker {
    from {
        transform: translateX(0);
    }
    to {
        transform: translateX(-50%);
    }
}

.public-page .hero {
    background:
        linear-gradient(90deg, rgba(17, 24, 39, .74), rgba(17, 24, 39, .42)),
        url("https://images.unsplash.com/photo-1547683905-f686c993aae5?auto=format&fit=crop&w=1800&q=80") center/cover;
    border-bottom: 0;
    color: #fff;
}

.public-page .hero-inner {
    display: flex;
    min-height: 690px;
    max-width: 1520px;
    overflow: hidden;
    padding-bottom: 120px;
    padding-top: 120px;
}

.public-page .hero-copy {
    align-self: end;
    margin-left: 0;
    max-width: 820px;
    min-width: 0;
}

.public-page .hero .eyebrow {
    color: #BFDBFE;
}

.public-page .hero h1 {
    color: #fff;
    font-size: clamp(42px, 6vw, 82px);
    line-height: 1.05;
}

.public-page .hero p {
    color: rgba(255, 255, 255, .9);
    font-size: clamp(18px, 2.1vw, 28px);
    max-width: 880px;
}

.public-page .hero .button.secondary {
    background: rgba(255, 255, 255, .12);
    border-color: rgba(255, 255, 255, .45);
    color: #fff;
}

.public-page .hero-actions {
    justify-content: flex-start;
    margin-left: 0;
    padding-left: 0;
}

.public-page .hero-actions .button {
    max-width: 100%;
}

.landing-services {
    background: rgba(255, 255, 255, .92);
    border: 1px solid #E5E7EB;
    border-radius: 24px;
    box-shadow: 0 24px 50px rgba(15, 23, 42, .11);
    display: grid;
    gap: 18px;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-top: -60px;
    padding: 34px 42px;
    position: relative;
    z-index: 5;
}

.service-card {
    align-items: center;
    color: #334155;
    display: grid;
    gap: 8px;
    justify-items: center;
    min-height: 130px;
    padding: 18px;
    text-align: center;
    text-decoration: none;
}

.service-card span {
    align-items: center;
    background: #E0F2FE;
    border-radius: 999px;
    color: #0284C7;
    display: inline-flex;
    font-size: 24px;
    height: 70px;
    justify-content: center;
    width: 70px;
}

.service-card strong {
    color: #1F2937;
    font-size: 17px;
}

.service-card small {
    color: #64748B;
}

.admin-page {
    background:
        radial-gradient(circle at top right, rgba(59, 130, 246, .14), transparent 28%),
        linear-gradient(180deg, #EAF2FB 0%, #F3F6FA 42%, #E9EFF7 100%);
}

.admin-shell {
    background: transparent;
    display: grid;
    gap: 0;
    grid-template-columns: 320px minmax(0, 1fr);
    max-width: none;
    min-height: 100vh;
    padding: 0;
}

.admin-page .sidebar {
    background: #fff;
    border-radius: 0;
    border-right: 1px solid #E5E7EB;
    box-shadow: 8px 0 24px rgba(15, 23, 42, .04);
    color: #1F2937;
    gap: 22px;
    min-height: 100vh;
    padding: 28px 20px;
    position: sticky;
    top: 0;
}

.admin-brand,
.admin-brand small,
.admin-brand strong {
    color: #111827;
}

.admin-brand .brand-mark {
    background: #EFF6FF;
    border: 1px solid #BFDBFE;
    color: #1E3A8A;
}

.admin-page .sidebar-user {
    background: #F5F3FF;
    border: 0;
    border-radius: 22px;
    margin-top: 10px;
    order: 2;
    padding: 20px;
}

.admin-page .sidebar-user span {
    color: #111827;
}

.admin-page .sidebar-user a {
    color: #7C3AED;
}

.admin-page .sidebar-nav {
    gap: 10px;
    order: 3;
}

.admin-page .sidebar-nav a {
    border-radius: 14px;
    color: #64748B;
    font-size: 18px;
    padding: 15px 18px;
}

.admin-page .sidebar-nav i {
    color: #64748B;
}

.admin-page .sidebar-nav a.active,
.admin-page .sidebar-nav a:hover {
    background: #EAF6FF;
    color: #0284C7;
}

.admin-page .sidebar-nav a.active i,
.admin-page .sidebar-nav a:hover i {
    color: #0284C7;
}

.admin-main {
    padding: 0 30px 30px;
}

.dashboard-topbar {
    align-items: center;
    background: rgba(255, 255, 255, .9);
    border-bottom: 1px solid #E5E7EB;
    height: 92px;
    margin: 0 -30px 32px;
    padding: 0 30px;
}

.breadcrumb {
    align-items: center;
    color: #64748B;
    display: flex;
    gap: 10px;
    font-size: 17px;
}

.breadcrumb strong {
    color: #111827;
}

.topbar-user {
    align-items: center;
    display: flex;
    gap: 12px;
}

.topbar-user span {
    align-items: center;
    background: #8B5CF6;
    border-radius: 999px;
    color: #fff;
    display: inline-flex;
    font-weight: 800;
    height: 40px;
    justify-content: center;
    width: 40px;
}

.topbar-user strong {
    color: #111827;
    font-size: 18px;
}

.admin-page-title {
    align-items: center;
    background: rgba(255, 255, 255, .58);
    border: 1px solid rgba(226, 232, 240, .9);
    border-radius: 16px;
    display: flex;
    gap: 16px;
    justify-content: space-between;
    margin-bottom: 28px;
    padding: 22px 24px;
}

.admin-page-title h1 {
    color: #0F172A;
    font-size: 32px;
    line-height: 1.2;
    margin: 0;
}

.admin-page-title p {
    color: #64748B;
    font-size: 20px;
    margin: 8px 0 0;
}

.admin-page .metric-grid {
    gap: 20px;
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.admin-page .metric-card {
    border-left: 0;
    border-radius: 16px;
    min-height: 186px;
    padding: 26px;
}

.admin-page .metric-card::before {
    align-items: center;
    background: #E0F2FE;
    border-radius: 999px;
    color: #0284C7;
    content: "";
    display: inline-flex;
    height: 54px;
    justify-content: center;
    margin-bottom: 16px;
    width: 54px;
}

.admin-page .metric-card.low::before {
    background: #DCFCE7;
    color: #16A34A;
}

.admin-page .metric-card.medium::before {
    background: #FEF3C7;
    color: #D97706;
}

.admin-page .metric-card.high::before {
    background: #FEE2E2;
    color: #DC2626;
}

.admin-page .metric-card strong {
    font-size: 34px;
}

.admin-page .panel {
    border-radius: 16px;
    padding: 28px;
}

.admin-page .data-grid {
    grid-template-columns: 1fr 1fr;
}

@media (max-width: 1200px) {
    .landing-services,
    .admin-page .metric-grid,
    .admin-page .data-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 980px) {
    .public-page .header-inner {
        min-height: 76px;
    }

    .public-page .hero-inner {
        min-height: 560px;
        padding-bottom: 86px;
        padding-top: 86px;
    }

    .landing-services {
        margin-top: -42px;
    }

    .admin-shell {
        grid-template-columns: 1fr;
    }

    .admin-page .sidebar {
        min-height: auto;
        position: static;
    }

    .dashboard-topbar {
        margin-left: -16px;
        margin-right: -16px;
        padding-left: 16px;
        padding-right: 16px;
    }

    .admin-main {
        padding: 0 16px 24px;
    }
}

@media (max-width: 760px) {
    .public-page .header-inner {
        flex-direction: row;
    }

    .public-page .brand strong {
        font-size: 16px;
    }

    .public-ticker {
        font-size: 13px;
        padding: 10px 0;
    }

    .public-page .hero-inner {
        min-height: 500px;
        padding-bottom: 70px;
        padding-top: 70px;
    }

    .landing-services,
    .admin-page .metric-grid,
    .admin-page .data-grid {
        grid-template-columns: 1fr;
    }

    .landing-services {
        border-radius: 18px;
        padding: 20px;
    }

    .admin-page-title {
        align-items: stretch;
        flex-direction: column;
    }

    .admin-page-title h1 {
        font-size: 28px;
    }

    .admin-page-title p {
        font-size: 16px;
    }

    .dashboard-topbar {
        height: auto;
        min-height: 74px;
        padding-bottom: 14px;
        padding-top: 14px;
    }
}

@media (max-width: 480px) {
    .public-page .hero h1 {
        font-size: 34px;
    }

    .public-page .hero p {
        font-size: 16px;
    }

    .service-card {
        min-height: auto;
        padding: 12px;
    }

    .service-card span {
        height: 56px;
        width: 56px;
    }

    .topbar-user strong {
        display: none;
    }
}

/* Final responsive pass: hamburger navigation, collapsible admin sidebar, and stable mobile layouts. */
@media (max-width: 1024px) {
    .public-page .header-inner {
        align-items: center;
        flex-direction: row;
        gap: 12px;
        min-height: 74px;
        padding-bottom: 10px;
        padding-top: 10px;
        position: relative;
    }

    .public-page .brand {
        max-width: calc(100% - 54px);
    }

    .public-page .nav-toggle {
        align-items: center;
        border: 1px solid #D1D5DB;
        border-radius: 10px;
        cursor: pointer;
        display: grid;
        flex: 0 0 44px;
        gap: 5px;
        height: 44px;
        justify-content: center;
        margin-left: auto;
        width: 44px;
    }

    .public-page .nav-toggle span {
        background: #1F2937;
        border-radius: 999px;
        display: block;
        height: 2px;
        width: 22px;
    }

    .public-page .nav {
        background: rgba(255, 255, 255, .98);
        border: 1px solid #E5E7EB;
        border-radius: 14px;
        box-shadow: 0 18px 38px rgba(15, 23, 42, .12);
        display: none;
        gap: 6px;
        left: 16px;
        padding: 12px;
        position: absolute;
        right: 16px;
        top: calc(100% + 8px);
        z-index: 80;
    }

    .public-page .nav-check:checked ~ .nav {
        display: grid;
    }

    .public-page .nav a,
    .public-page .nav > a:last-child {
        border-radius: 10px;
        box-shadow: none;
        justify-content: flex-start;
        min-height: 44px;
        padding: 10px 14px;
        width: 100%;
    }

    .public-page .nav .link {
        background: #fff;
    }

    .public-page .nav .link.active,
    .public-page .nav .link:hover {
        background: #EFF6FF;
    }

    .public-page .hero-inner {
        min-height: 520px;
        padding-bottom: 82px;
        padding-top: 82px;
    }

    .landing-services {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        margin-left: 16px;
        margin-right: 16px;
        width: auto;
    }

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

    .admin-shell {
        grid-template-columns: 1fr;
    }

    .admin-page .sidebar {
        border-bottom: 1px solid #E5E7EB;
        border-right: 0;
        display: grid;
        gap: 14px;
        grid-template-columns: 1fr auto;
        min-height: auto;
        padding: 16px;
        position: sticky;
        top: 0;
        z-index: 70;
    }

    .admin-page .sidebar .brand {
        grid-column: 1 / 2;
    }

    .admin-page .sidebar-toggle {
        align-items: center;
        align-self: center;
        background: #EFF6FF;
        border: 1px solid #BFDBFE;
        border-radius: 10px;
        color: #1E3A8A;
        cursor: pointer;
        display: inline-flex;
        font-weight: 800;
        gap: 8px;
        grid-column: 2 / 3;
        min-height: 42px;
        padding: 9px 12px;
    }

    .admin-page .sidebar-user,
    .admin-page .sidebar-nav {
        grid-column: 1 / -1;
    }

    .admin-page .sidebar-nav {
        display: none;
    }

    .sidebar-check:checked ~ .sidebar .sidebar-nav {
        display: grid;
    }

    .admin-main {
        padding: 0 18px 24px;
    }

    .dashboard-topbar {
        margin-left: -18px;
        margin-right: -18px;
        padding-left: 18px;
        padding-right: 18px;
    }

    .admin-page .metric-grid,
    .admin-page .data-grid,
    .chart-grid,
    .input-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 760px) {
    .public-page .hero-inner {
        min-height: 460px;
        padding-bottom: 64px;
        padding-top: 64px;
    }

    .public-page .hero-actions {
        align-items: stretch;
        flex-direction: column;
        max-width: 360px;
    }

    .landing-services,
    .summary-strip,
    .district-grid,
    .admin-page .metric-grid,
    .admin-page .data-grid,
    .chart-grid,
    .input-grid,
    .form-grid {
        grid-template-columns: 1fr;
    }

    .landing-services {
        margin-left: 12px;
        margin-right: 12px;
        padding: 16px;
    }

    .service-card {
        grid-template-columns: 56px minmax(0, 1fr);
        justify-items: start;
        text-align: left;
    }

    .service-card span {
        grid-row: span 2;
        height: 52px;
        width: 52px;
    }

    .admin-page .sidebar {
        border-radius: 0;
        margin-left: -16px;
        margin-right: -16px;
    }

    .admin-page .sidebar-user {
        padding: 14px;
    }

    .admin-page-title {
        padding: 18px;
    }

    .panel,
    .admin-page .panel {
        padding: 18px;
    }

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

    #risk-map,
    #admin-map {
        height: 420px;
    }
}

@media (max-width: 520px) {
    .public-page .brand strong {
        font-size: 14px;
    }

    .public-page .brand-mark {
        height: 38px;
        width: 38px;
    }

    .public-page .nav {
        left: 10px;
        right: 10px;
    }

    .public-page .hero h1 {
        font-size: 30px;
    }

    .public-page .hero p {
        font-size: 15px;
    }

    .public-page .hero-inner {
        min-height: 420px;
        padding-bottom: 48px;
        padding-top: 48px;
    }

    .public-ticker {
        font-size: 12px;
    }

    .admin-main {
        padding: 0 12px 20px;
    }

    .dashboard-topbar {
        margin-left: -12px;
        margin-right: -12px;
        padding-left: 12px;
        padding-right: 12px;
    }

    .breadcrumb {
        font-size: 14px;
    }

    .topbar-user span {
        height: 34px;
        width: 34px;
    }

    .admin-page-title h1 {
        font-size: 24px;
    }

    .admin-page-title p {
        font-size: 14px;
    }

    #risk-map,
    #admin-map {
        height: 340px;
    }
}

/* Login page polish */
.login-page {
    background:
        radial-gradient(circle at 18% 12%, rgba(59, 130, 246, .18), transparent 30%),
        linear-gradient(135deg, #EAF2FB 0%, #F8FAFC 48%, #E2EAF5 100%);
    padding: 24px;
}

.login-shell {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) 440px;
    margin: 0 auto;
    max-width: 1100px;
    min-height: min(720px, calc(100vh - 48px));
    width: 100%;
}

.login-visual {
    background:
        linear-gradient(135deg, rgba(30, 58, 138, .94), rgba(2, 132, 199, .82)),
        url("https://images.unsplash.com/photo-1547683905-f686c993aae5?auto=format&fit=crop&w=1200&q=80") center/cover;
    border-radius: 22px 0 0 22px;
    color: #fff;
    display: grid;
    gap: 32px;
    padding: 38px;
}

.login-visual .brand strong,
.login-visual .brand small {
    color: #fff;
}

.login-visual .brand-mark {
    background: rgba(255, 255, 255, .14);
    border: 1px solid rgba(255, 255, 255, .32);
}

.login-visual .eyebrow {
    color: #BFDBFE;
}

.login-visual h1 {
    font-size: 34px;
    line-height: 1.25;
    margin: 0;
    max-width: 560px;
}

.login-visual p {
    color: rgba(255, 255, 255, .86);
    font-size: 16px;
    line-height: 1.7;
    margin: 14px 0 0;
    max-width: 560px;
}

.login-info-grid {
    align-self: end;
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.login-info-grid span {
    background: rgba(255, 255, 255, .12);
    border: 1px solid rgba(255, 255, 255, .2);
    border-radius: 12px;
    color: #DBEAFE;
    display: grid;
    font-size: 13px;
    padding: 14px;
}

.login-info-grid strong {
    color: #fff;
    font-size: 22px;
}

.login-panel {
    align-content: center;
    border-radius: 0 22px 22px 0;
    box-shadow: 0 24px 60px rgba(15, 23, 42, .13);
    display: grid;
    margin: 0;
    max-width: none;
    padding: 42px;
}

.login-panel-head {
    display: grid;
    gap: 14px;
    margin-bottom: 24px;
}

.login-back-link {
    margin-bottom: 18px;
}

.login-back-link .button.secondary {
    width: 100%;
}

.login-icon {
    align-items: center;
    background: #EFF6FF;
    border: 1px solid #BFDBFE;
    border-radius: 14px;
    color: #1E3A8A;
    display: inline-flex;
    font-weight: 900;
    height: 54px;
    justify-content: center;
    overflow: hidden;
    width: 54px;
}

.login-icon img {
    display: block;
    height: 100%;
    object-fit: cover;
    object-position: center top;
    width: 54px;
}

.login-panel h2 {
    color: #111827;
    font-size: 28px;
    line-height: 1.2;
    margin: 0 0 6px;
}

.login-panel form .grid {
    gap: 16px;
}

.login-panel button {
    margin-top: 4px;
    width: 100%;
}

.login-footnote {
    background: #F8FAFC;
    border: 1px solid #E5E7EB;
    border-radius: 12px;
    color: #64748B;
    display: grid;
    gap: 3px;
    margin-top: 20px;
    padding: 12px 14px;
}

.login-footnote strong {
    color: #1F2937;
}

@media (max-width: 900px) {
    .login-shell {
        grid-template-columns: 1fr;
        max-width: 520px;
    }

    .login-visual {
        border-radius: 20px 20px 0 0;
        min-height: 330px;
        padding: 28px;
    }

    .login-panel {
        border-radius: 0 0 20px 20px;
        padding: 30px;
    }
}

@media (max-width: 520px) {
    .login-page {
        padding: 12px;
    }

    .login-visual {
        gap: 24px;
        min-height: auto;
        padding: 22px;
    }

    .login-visual h1 {
        font-size: 26px;
    }

    .login-info-grid {
        grid-template-columns: 1fr;
    }

    .login-panel {
        padding: 22px;
    }

    .login-panel h2 {
        font-size: 24px;
    }
}

/* Public landing content refinement */
.public-overview {
    align-items: center;
    display: grid;
    gap: 28px;
    grid-template-columns: minmax(0, 1fr) minmax(320px, .8fr);
}

.overview-copy {
    background: rgba(255, 255, 255, .74);
    border: 1px solid rgba(226, 232, 240, .88);
    border-radius: 18px;
    padding: 28px;
}

.overview-copy h2 {
    color: #0F172A;
    font-size: 28px;
    line-height: 1.3;
    margin: 0 0 12px;
}

.overview-copy p {
    color: #64748B;
    font-size: 16px;
    line-height: 1.75;
    margin: 0;
}

.overview-stats {
    display: grid;
    gap: 14px;
}

.overview-stats article {
    background: #fff;
    border: 1px solid #E5E7EB;
    border-left: 4px solid #0284C7;
    border-radius: 14px;
    box-shadow: 0 10px 28px rgba(15, 23, 42, .06);
    display: flex;
    justify-content: space-between;
    padding: 20px;
}

.overview-stats strong {
    color: #0F172A;
    font-size: 32px;
    line-height: 1;
}

.overview-stats span {
    color: #64748B;
    font-weight: 700;
    text-align: right;
}

.guide-section {
    background: rgba(255, 255, 255, .48);
    border-radius: 18px;
}

.guide-grid {
    display: grid;
    gap: 18px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.guide-grid article {
    background: #fff;
    border: 1px solid #E5E7EB;
    border-radius: 16px;
    box-shadow: 0 10px 28px rgba(15, 23, 42, .06);
    padding: 22px;
}

.guide-grid span {
    align-items: center;
    background: #EFF6FF;
    border-radius: 999px;
    color: #1E3A8A;
    display: inline-flex;
    font-weight: 900;
    height: 38px;
    justify-content: center;
    margin-bottom: 14px;
    width: 38px;
}

.guide-grid h3 {
    color: #0F172A;
    font-size: 18px;
    margin: 0 0 8px;
}

.guide-grid p {
    color: #64748B;
    margin: 0;
}

.history-section {
    background: rgba(255, 255, 255, .48);
    border-radius: 18px;
}

.period-filter label {
    min-width: 230px;
}

.period-filter select {
    background: #fff;
}

.map-period-toolbar {
    align-items: center;
    display: flex;
    gap: 14px;
    justify-content: space-between;
    margin: 0 0 18px;
}

.period-button-panel {
    display: flex;
    flex: 1 1 auto;
    gap: 10px;
    min-width: 0;
    overflow-x: auto;
    padding: 2px 2px 6px;
    scrollbar-width: thin;
}

.period-button {
    align-items: center;
    background: rgba(255, 255, 255, .82);
    border: 1px solid #CBD5E1;
    border-radius: 999px;
    color: #334155;
    cursor: pointer;
    display: inline-flex;
    flex: 0 0 auto;
    font: inherit;
    font-size: 14px;
    font-weight: 800;
    justify-content: center;
    min-height: 40px;
    padding: 9px 16px;
    transition: background .18s ease, border-color .18s ease, box-shadow .18s ease, color .18s ease;
    white-space: nowrap;
}

.period-button:hover,
.period-button:focus-visible {
    background: #EFF6FF;
    border-color: #93C5FD;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, .13);
    color: #1E3A8A;
    outline: none;
}

.period-button.active {
    background: #1E3A8A;
    border-color: #1E3A8A;
    box-shadow: 0 10px 22px rgba(30, 58, 138, .18);
    color: #fff;
}

.map-live-status {
    align-items: center;
    background: rgba(219, 234, 254, .72);
    border: 1px solid #BFDBFE;
    border-radius: 999px;
    color: #1E3A8A;
    display: inline-flex;
    flex: 0 0 auto;
    font-size: 13px;
    font-weight: 800;
    min-height: 36px;
    padding: 8px 12px;
    white-space: nowrap;
}

.inline-form {
    margin: 0;
}

.small-button {
    font-size: 13px;
    min-height: 34px;
    padding: 6px 10px;
}

@media (max-width: 900px) {
    .public-overview,
    .guide-grid {
        grid-template-columns: 1fr;
    }

    .overview-stats {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .overview-copy,
    .guide-grid article {
        padding: 18px;
    }

    .overview-copy h2 {
        font-size: 24px;
    }

    .overview-stats {
        grid-template-columns: 1fr;
    }

    .overview-stats article {
        align-items: center;
    }

    .period-filter,
    .period-filter label {
        width: 100%;
    }

    .map-period-toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .period-button-panel {
        margin-left: -2px;
        margin-right: -2px;
        width: 100%;
    }

    .period-button {
        font-size: 13px;
        min-height: 38px;
        padding: 8px 13px;
    }

    .map-live-status {
        border-radius: 10px;
        justify-content: center;
        white-space: normal;
    }
}

/* Admin dashboard refinement */
.admin-page .sidebar-nav a {
    font-size: 16px;
    padding: 13px 16px;
}

.admin-page .sidebar-user {
    border-radius: 18px;
    padding: 18px;
}

.admin-page .sidebar-user span {
    font-size: 15px;
}

.dashboard-topbar {
    height: 82px;
    margin-bottom: 24px;
}

.breadcrumb {
    font-size: 15px;
}

.topbar-user strong {
    font-size: 16px;
}

.admin-page-title {
    margin-bottom: 22px;
    padding: 20px 22px;
}

.admin-page-title h1 {
    font-size: 30px;
}

.admin-page-title p {
    font-size: 16px;
    margin-top: 6px;
    max-width: 760px;
}

.admin-page .metric-grid {
    gap: 16px;
}

.dashboard-status-strip {
    align-items: stretch;
    background:
        linear-gradient(135deg, rgba(30, 58, 138, .98), rgba(37, 99, 235, .9));
    border: 1px solid rgba(191, 219, 254, .4);
    border-radius: 18px;
    box-shadow: 0 18px 36px rgba(30, 58, 138, .12);
    color: #fff;
    display: grid;
    gap: 24px;
    grid-template-columns: minmax(0, 1.2fr) minmax(320px, .8fr);
    padding: 24px;
}

.dashboard-status-strip .panel-kicker,
.dashboard-status-strip h2,
.dashboard-status-strip p {
    color: inherit;
}

.status-strip-copy {
    display: grid;
    gap: 12px;
}

.status-strip-copy h2 {
    font-size: 28px;
    line-height: 1.25;
    margin: 0;
}

.status-strip-copy p {
    color: rgba(255, 255, 255, .82);
    font-size: 15px;
    line-height: 1.75;
    margin: 0;
    max-width: 720px;
}

.status-strip-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 2px;
}

.status-strip-actions .button.secondary {
    background: rgba(255, 255, 255, .12);
    border-color: rgba(255, 255, 255, .22);
    color: #fff;
}

.status-strip-actions .button.secondary:hover {
    background: rgba(255, 255, 255, .18);
    border-color: rgba(255, 255, 255, .28);
}

.status-strip-grid {
    display: grid;
    gap: 12px;
}

.status-strip-item {
    background: rgba(255, 255, 255, .12);
    border: 1px solid rgba(255, 255, 255, .18);
    border-radius: 14px;
    display: grid;
    gap: 5px;
    padding: 14px 16px;
}

.status-strip-item span {
    color: #DBEAFE;
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.status-strip-item strong {
    color: #fff;
    font-size: 18px;
    line-height: 1.3;
}

.status-strip-item small {
    color: rgba(255, 255, 255, .78);
    font-size: 12px;
    line-height: 1.55;
}

.admin-page .metric-card {
    gap: 6px;
    min-height: 154px;
    padding: 22px;
}

.metric-card-head {
    align-items: center;
    display: flex;
    gap: 10px;
    margin-bottom: 4px;
}

.admin-page .metric-card::before {
    content: none;
    display: none;
}

.metric-card-tag {
    background: #F8FAFC;
    border: 1px solid #E5E7EB;
    border-radius: 999px;
    color: #64748B;
    display: inline-flex;
    font-size: 12px;
    font-weight: 800;
    min-height: 30px;
    padding: 6px 10px;
}

.admin-page .metric-card::before,
.metric-card-icon {
    height: 46px;
    width: 46px;
}

.metric-card-icon {
    align-items: center;
    background: #E0F2FE;
    border-radius: 999px;
    color: #0284C7;
    display: inline-flex;
    flex: 0 0 46px;
    font-size: 16px;
    justify-content: center;
}

.admin-page .metric-card.low .metric-card-icon {
    background: #DCFCE7;
    color: #16A34A;
}

.admin-page .metric-card.medium .metric-card-icon {
    background: #FEF3C7;
    color: #D97706;
}

.admin-page .metric-card.high .metric-card-icon {
    background: #FEE2E2;
    color: #DC2626;
}

.admin-page .metric-card strong {
    font-size: 30px;
}

.admin-page .metric-card small {
    font-size: 13px;
}

.dashboard-analytics-grid {
    align-items: start;
    gap: 18px;
    grid-template-columns: minmax(340px, .92fr) minmax(420px, 1.08fr);
}

.admin-page .panel {
    padding: 24px;
}

.analytics-panel {
    display: grid;
    gap: 18px;
}

.panel-heading.compact {
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 0;
}

.panel-heading-copy {
    display: grid;
    gap: 4px;
}

.panel-kicker {
    color: #3B82F6;
    display: inline-flex;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.panel-subtitle {
    color: #64748B;
    font-size: 14px;
    line-height: 1.65;
    margin: 0;
}

.chart-meta {
    align-items: center;
    background: #EFF6FF;
    border: 1px solid #BFDBFE;
    border-radius: 999px;
    color: #1E3A8A;
    display: inline-flex;
    flex: 0 0 auto;
    font-size: 12px;
    font-weight: 800;
    min-height: 34px;
    padding: 7px 11px;
    white-space: nowrap;
}

.risk-panel-layout {
    align-items: center;
    display: grid;
    gap: 18px;
    grid-template-columns: 220px minmax(0, 1fr);
}

.chart-shell {
    position: relative;
    width: 100%;
}

.chart-shell-sm {
    height: 210px;
    margin: 0 auto;
    max-width: 220px;
}

.chart-shell-md {
    height: 250px;
}

.chart-shell canvas {
    height: 100% !important;
    width: 100% !important;
}

.risk-summary-list {
    display: grid;
    gap: 10px;
}

.risk-summary-item,
.trend-chip {
    background: #F8FAFC;
    border: 1px solid #E5E7EB;
    border-radius: 12px;
    padding: 12px 14px;
}

.risk-summary-item {
    display: grid;
    gap: 4px;
}

.risk-summary-item-low {
    border-color: rgba(21, 128, 61, .16);
}

.risk-summary-item-medium {
    border-color: rgba(217, 119, 6, .16);
}

.risk-summary-item-high {
    border-color: rgba(185, 28, 28, .16);
}

.risk-summary-item-unknown {
    border-color: rgba(100, 116, 139, .16);
}

.risk-summary-item > span {
    align-items: center;
    color: #334155;
    display: inline-flex;
    gap: 8px;
    font-size: 13px;
    font-weight: 700;
}

.risk-summary-item strong {
    color: #0F172A;
    font-size: 24px;
    line-height: 1;
}

.risk-summary-item small,
.trend-chip span {
    color: #64748B;
    font-size: 12px;
}

.risk-summary-progress {
    background: #E2E8F0;
    border-radius: 999px;
    height: 6px;
    margin-top: 4px;
    overflow: hidden;
}

.risk-summary-progress span {
    background: #1E3A8A;
    border-radius: inherit;
    display: block;
    height: 100%;
}

.risk-summary-item-low .risk-summary-progress span {
    background: #16A34A;
}

.risk-summary-item-medium .risk-summary-progress span {
    background: #D97706;
}

.risk-summary-item-high .risk-summary-progress span {
    background: #DC2626;
}

.risk-summary-item-unknown .risk-summary-progress span {
    background: #64748B;
}

.analytics-footnote {
    background: #F8FAFC;
    border: 1px solid #E5E7EB;
    border-radius: 12px;
    display: grid;
    gap: 4px;
    padding: 12px 14px;
}

.analytics-footnote strong {
    color: #0F172A;
    font-size: 13px;
}

.analytics-footnote span {
    color: #64748B;
    font-size: 13px;
}

.trend-summary-grid {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.trend-chip {
    align-items: flex-start;
    display: grid;
    gap: 10px;
    grid-template-columns: auto minmax(0, 1fr);
}

.trend-chip-icon {
    align-items: center;
    background: #EFF6FF;
    border-radius: 999px;
    color: #1E3A8A;
    display: inline-flex;
    flex: 0 0 34px;
    font-size: 14px;
    height: 34px;
    justify-content: center;
    width: 34px;
}

.trend-chip > div {
    display: grid;
    gap: 5px;
}

.trend-chip strong {
    color: #0F172A;
    font-size: 18px;
    line-height: 1.2;
    overflow-wrap: anywhere;
}

.trend-chip-rendah,
.trend-chip-low {
    border-color: rgba(21, 128, 61, .18);
}

.trend-chip-rendah .trend-chip-icon,
.trend-chip-low .trend-chip-icon {
    background: #DCFCE7;
    color: #15803D;
}

.trend-chip-sedang,
.trend-chip-medium {
    border-color: rgba(217, 119, 6, .18);
}

.trend-chip-sedang .trend-chip-icon,
.trend-chip-medium .trend-chip-icon {
    background: #FEF3C7;
    color: #B45309;
}

.trend-chip-tinggi,
.trend-chip-high {
    border-color: rgba(185, 28, 28, .18);
}

.trend-chip-tinggi .trend-chip-icon,
.trend-chip-high .trend-chip-icon {
    background: #FEE2E2;
    color: #B91C1C;
}

.trend-chip-belum-ada-data,
.trend-chip-unknown {
    border-color: rgba(100, 116, 139, .18);
}

.trend-chip-belum-ada-data .trend-chip-icon,
.trend-chip-unknown .trend-chip-icon {
    background: #E2E8F0;
    color: #64748B;
}

.table-card {
    padding: 22px 24px;
}

.table-card table {
    margin-top: 4px;
}

.table-status-row {
    align-items: center;
    background: #F8FAFC;
    border: 1px solid #E5E7EB;
    border-radius: 12px;
    color: #475569;
    display: flex;
    flex-wrap: wrap;
    gap: 10px 16px;
    justify-content: space-between;
    margin: 0 0 14px;
    padding: 12px 14px;
}

.table-status-row span {
    align-items: center;
    display: inline-flex;
    gap: 8px;
    font-size: 13px;
}

.table-status-row i {
    color: #3B82F6;
}

.table-status-row strong {
    color: #0F172A;
    font-size: 13px;
}

.master-explainer {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin: 0 0 18px;
}

.master-note {
    background: #F8FAFC;
    border: 1px solid #E5E7EB;
    border-radius: 12px;
    display: grid;
    gap: 6px;
    padding: 14px 16px;
}

.master-note strong {
    color: #0F172A;
    font-size: 14px;
}

.master-note span {
    color: #64748B;
    font-size: 13px;
    line-height: 1.65;
}

.master-note b {
    color: #1E3A8A;
    font-weight: 800;
}

.district-cell {
    align-items: flex-start;
    display: grid;
    gap: 10px;
    grid-template-columns: auto minmax(0, 1fr);
}

.district-code {
    align-items: center;
    background: #EFF6FF;
    border: 1px solid #BFDBFE;
    border-radius: 999px;
    color: #1E3A8A;
    display: inline-flex;
    font-size: 12px;
    font-weight: 800;
    justify-content: center;
    min-width: 44px;
    padding: 4px 10px;
}

.district-cell strong {
    color: #0F172A;
    display: block;
    font-size: 15px;
    line-height: 1.35;
}

.district-cell small {
    color: #64748B;
    display: block;
    font-size: 12px;
    line-height: 1.5;
    margin-top: 2px;
}

.field-stack {
    display: grid;
    gap: 6px;
}

.field-help {
    color: #64748B;
    font-size: 12px;
    line-height: 1.45;
}

@media (max-width: 1280px) {
    .dashboard-status-strip {
        grid-template-columns: 1fr;
    }

    .dashboard-analytics-grid {
        grid-template-columns: 1fr;
    }

    .chart-shell-md {
        height: 235px;
    }
}

@media (max-width: 900px) {
    .master-explainer {
        grid-template-columns: 1fr;
    }

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

    .chart-shell-sm {
        height: 196px;
    }

    .trend-summary-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 760px) {
    .dashboard-status-strip {
        padding: 18px;
    }

    .status-strip-copy h2 {
        font-size: 24px;
    }

    .status-strip-actions {
        flex-direction: column;
    }

    .status-strip-actions .button,
    .status-strip-actions .button.secondary {
        width: 100%;
    }

    .dashboard-topbar {
        height: auto;
        margin-bottom: 18px;
        min-height: 72px;
    }

    .admin-page-title {
        padding: 18px;
    }

    .admin-page-title h1 {
        font-size: 26px;
    }

    .admin-page .metric-card {
        min-height: auto;
        padding: 18px;
    }

    .admin-page .panel,
    .table-card {
        padding: 18px;
    }

    .panel-heading.compact {
        align-items: stretch;
        flex-direction: column;
    }

    .chart-meta {
        justify-content: center;
    }

    .chart-shell-md {
        height: 220px;
    }
}

@media (max-width: 520px) {
    .metric-card-head {
        align-items: flex-start;
        flex-direction: column;
    }

    .trend-chip {
        grid-template-columns: 1fr;
    }

    .trend-chip-icon {
        height: 32px;
        width: 32px;
    }

    .table-status-row {
        align-items: flex-start;
        flex-direction: column;
    }

    .district-cell {
        grid-template-columns: 1fr;
    }

    .breadcrumb {
        font-size: 13px;
    }

    .topbar-user strong {
        display: none;
    }

    .admin-page-title h1 {
        font-size: 24px;
    }

    .admin-page-title p,
    .panel-subtitle {
        font-size: 13px;
    }

    .chart-shell-sm {
        height: 182px;
        max-width: 190px;
    }

    .chart-shell-md {
        height: 205px;
    }
}
