@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@500;600;700&family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=Poppins:ital,wght@0,400;0,500;0,600;0,700;0,800;1,400;1,600&display=swap');

/* =====================================================================
   GeoPORTAL BPTD Jabar — Command Center Prototype
   PHASE 14A — Harmonized Poppins Typography
   ===================================================================== */
[hidden] {
    display: none !important;
}

/* ---------- Design tokens (Navy Baseline V3) ---------- */
:root {
    /* Brand - Deep Navy & Blue Accents */
    --navy-950: #071C3D;
    --navy-900: #0A2F73;
    --navy-800: #0C3C8C;
    --navy-700: #124FA3;
    --navy-600: #1769E8;
    --blue-700: #124FA3;
    --blue-600: #1769E8;
    --blue-500: #2B7FFF;
    --blue-400: #4A94FF;
    --blue-300: #8BBEFF;
    --blue-200: #C5DEFF;
    --blue-100: #E6F1FF;
    --blue-50: #F3F8FF;
    --accent: #F6A51A;

    /* Status Semantics */
    --success: #12A66A;
    --success-soft: #E5F8F0;
    --warning: #F6A51A;
    --warning-soft: #FFF4D9;
    --danger: #F05252;
    --danger-soft: #FFE9E7;
    --info: #2B7FFF;
    --info-soft: #E8F2FF;
    --violet: #5D4BE8;
    --violet-soft: #EEECFF;
    --offline: #6580A7;

    /* Surfaces & Canvas - Soft Blue Ambient Lighting */
    --bg: #EEF5FF;
    --canvas: #EEF5FF;
    --card: #FFFFFF;
    --surface: rgba(255, 255, 255, 0.92);
    --surface-solid: #FFFFFF;
    --surface-soft: #F7FAFF;
    --surface-blue: #F0F6FF;
    --border: #DCE8F7;
    --border-strong: #CADCF2;
    --divider: rgba(32, 83, 148, 0.10);

    /* Text - Crisp Navy Contrast */
    --text: #0A2147;
    --text-strong: #0A2147;
    --text-muted: #6580A7;
    --text-soft: #91A7C5;
    --text-on-dark: #FFFFFF;
    --text-on-dark-muted: #C2D6F2;

    /* Radii & Shadows - Elevated Soft White Cards */
    --radius: 16px;
    --r-card: 16px;
    --r-panel: 20px;
    --r-shell: 24px;
    --shadow-card: 0 6px 18px rgba(14, 49, 98, 0.07), 0 2px 6px rgba(14, 49, 98, 0.035), inset 0 1px 0 rgba(255, 255, 255, 0.72);
    --shadow-raised: 0 12px 28px rgba(12, 55, 120, 0.10), 0 4px 10px rgba(12, 55, 120, 0.05), inset 0 1px 0 rgba(255, 255, 255, 0.82);
    --shadow-overlay: 0 20px 48px rgba(7, 36, 84, 0.16), 0 8px 18px rgba(7, 36, 84, 0.08);

    /* Motion */
    --ease: cubic-bezier(.2, .8, .2, 1);
    --dur-1: 120ms;
    --dur-2: 180ms;
    --dur-3: 260ms;

    /* Layout */
    --sidebar-w: 264px;
    --content-max: 1560px;

    /* Fonts — Poppins, Plus Jakarta Sans & JetBrains Mono */
    --font-sans: 'Poppins', 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-display: 'Poppins', sans-serif;
    --font-mono: 'JetBrains Mono', ui-monospace, monospace;
}

/* ---------- Reset & base ---------- */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scrollbar-gutter: stable;
    scrollbar-width: thin;
    scrollbar-color: #B9CFE8 transparent;
}

body {
    margin: 0;
    padding: 0;
    font-family: var(--font-sans);
    background: radial-gradient(900px 500px at 72% -5%, rgba(85, 155, 255, 0.10), transparent 68%),
                radial-gradient(650px 360px at 18% 12%, rgba(157, 198, 255, 0.10), transparent 70%),
                var(--bg);
    color: var(--text);
    font-size: 14.5px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
}

h1, h2, h3, h4 {
    font-family: var(--font-display);
    margin: 0;
}

p {
    margin: 0;
}

button {
    font-family: inherit;
    font-size: inherit;
    cursor: pointer;
}

a {
    color: inherit;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

/* ---------- Icons ---------- */
.icon-xs { width: 14px; height: 14px; flex: none; }
.icon-sm { width: 16px; height: 16px; flex: none; }
.icon-md { width: 20px; height: 20px; flex: none; }
.icon-lg { width: 28px; height: 28px; flex: none; }
.icon-xl { width: 36px; height: 36px; flex: none; }
.icon-muted { color: var(--text-soft); }

.text-red { color: var(--danger); }
.text-green { color: var(--success); }
.text-blue { color: var(--blue-700); }
.text-dark { color: var(--text); }

/* ---------- App shell ---------- */
.app-shell {
    display: flex;
    min-height: 100vh;
}

/* ---------- Sidebar ---------- */
.app-sidebar {
    width: var(--sidebar-w);
    flex: none;
    background: radial-gradient(200px 240px at 80% 0%, rgba(43, 127, 255, 0.18), transparent 75%),
                linear-gradient(180deg, #071C3D 0%, #0A2F73 45%, #071C3D 100%);
    color: var(--text-on-dark);
    border-right: 1px solid rgba(139, 190, 255, 0.22);
    box-shadow: 0 20px 48px -8px rgba(7, 28, 61, 0.38), 0 4px 12px rgba(7, 28, 61, 0.16), inset 0 1px 0 rgba(255, 255, 255, 0.20);
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    z-index: 40;
    scrollbar-width: none !important;
}

.app-sidebar::-webkit-scrollbar { display: none !important; width: 0 !important; }

.app-sidebar[inert] {
    pointer-events: none;
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding:  12px 16px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.logo-mark {
    width: 36px;
    height: 36px;
    border-radius: 11px;
    display: grid;
    place-items: center;
    color: var(--navy-900);
    background: linear-gradient(135deg, #FFFFFF, #D6E6FF);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.8);
    flex: none;
    padding: 6px;
}

.logo-text {
    display: flex;
    flex-direction: column;
    line-height: 1.15;
}

.logo-title {
    font-weight: 800;
    letter-spacing: 0.12em;
    font-size: 0.9rem;
}

.logo-sub {
    font-size: 0.72rem;
    color: var(--text-on-dark-muted);
}

.sidebar-logo .brand__mark,
.sidebar-header .brand__mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 3px 6px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.14);
    flex-shrink: 0;
}

.sidebar-logo .brand__logo-img,
.sidebar-header .brand__logo-img {
    height: 24px;
    width: 24px;
    object-fit: contain;
}

.sidebar-logo .brand__title,
.sidebar-header .brand__title {
    font-size: 15px;
    font-weight: 800;
    color: #FFFFFF;
    line-height: 1.15;
    letter-spacing: -0.01em;
}

.sidebar-logo .brand__instansi,
.sidebar-header .brand__instansi {
    font-size: 11px;
    font-weight: 700;
    line-height: 1.2;
    margin-top: 1px;
    color: var(--n-amber, #ffbe4d);
}

.sidebar-logo .brand__tag,
.sidebar-header .brand__tag {
    font-size: 8.5px;
    font-weight: 700;
    border-radius: 3px;
    padding: 1px 5px;
    width: fit-content;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-top: 3px;
    color: var(--n-cyan, #3ef2ff);
    background: rgba(62, 242, 255, 0.12);
    border: 1px solid rgba(62, 242, 255, 0.28);
}

.sidebar-nav {
    flex: 1;
    padding: 0.65rem 0.55rem;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    width: 100%;
    min-height: 42px;
    padding: 0.45rem 0.65rem;
    background: none;
    border: none;
    border-radius: 12px;
    color: var(--text-on-dark-muted);
    text-align: left;
    font-weight: 500;
    font-size: 0.875rem;
    text-decoration: none;
    transition: color 0.18s ease, transform 0.2s cubic-bezier(.16,1,.3,1), background-color 0.18s ease;
}

.nav-link:hover {
    color: #FFFFFF;
    background: rgba(255, 255, 255, 0.08);
    transform: translateX(3px);
}

.nav-link.is-active {
    color: var(--navy-950) !important;
    font-weight: 700;
    background: linear-gradient(135deg, #FFFFFF 0%, #EAF2FF 100%) !important;
    box-shadow: 0 8px 24px -2px rgba(0, 16, 48, 0.40), 0 2px 6px rgba(0, 0, 0, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.95) !important;
}

.nav-link .nav-icon {
    width: 32px;
    height: 30px;
    display: grid;
    place-items: center;
    border-radius: 8px;
    color: #8BBEFF;
    background: rgba(255, 255, 255, 0.06);
    flex: none;
    transition: all 0.2s ease;
}

.nav-link.is-active .nav-icon {
    color: var(--blue-600);
    background: rgba(43, 127, 255, 0.12);
    box-shadow: 0 2px 8px rgba(43, 127, 255, 0.18);
}

.nav-link.is-active .nav-text {
    color: var(--navy-950) !important;
    font-weight: 700;
}

.nav-link.is-active .nav-status-active {
    background: rgba(10, 47, 115, 0.10);
    color: var(--navy-900);
    border: 1px solid rgba(10, 47, 115, 0.25);
}

.nav-text {
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nav-link[aria-disabled="true"] {
    opacity: 0.75;
}

.nav-link[aria-disabled="true"]:hover {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-on-dark-muted);
    cursor: default;
}

.nav-label {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    flex: 1;
}

.nav-icon-warn { color: var(--warning); }

.nav-badge {
    margin-left: auto;
    background: var(--danger);
    color: #fff;
    font-size: 0.68rem;
    font-weight: 700;
    border-radius: 999px;
    padding: 0.1rem 0.45rem;
    min-width: 1.4rem;
    text-align: center;
}

/* Status badges for modular navigation shell (PHASE 15A) */
.nav-status-badge {
    margin-left: auto;
    font-size: 0.58rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    border-radius: 999px;
    padding: 2px 6px;
    line-height: 1.2;
    flex: none;
}

.nav-status-active {
    background: rgba(255, 255, 255, 0.22);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.35);
}

.nav-status-available {
    background: rgba(43, 127, 255, 0.15);
    color: rgba(255, 255, 255, 0.82);
    border: 1px solid rgba(43, 127, 255, 0.28);
}

.nav-status-demo {
    background: rgba(245, 158, 11, 0.22);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.45);
}

.nav-status-soon {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-on-dark-muted);
    border: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 0.58rem;
    font-weight: 600;
}

/* Mobile drawer close button (hidden on desktop) */
.sidebar-close-btn {
    display: none;
    min-width: 44px;
    min-height: 44px;
}

.sidebar-footer {
    padding: 0.9rem 1.25rem 1.1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.07);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.2rem;
}

.logo-mark-sm { width: 20px; height: 20px; }

.footer-title {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-on-dark);
}

.footer-sub {
    font-size: 0.7rem;
    color: var(--text-on-dark-muted);
}

/* Overlay (mobile) */
.sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(7, 13, 25, 0.55);
    z-index: 30;
}

/* ---------- Main ---------- */
.app-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.app-header {
    background: rgba(255, 255, 255, 0.98);
    border-bottom: 1px solid rgba(206, 224, 246, 0.86);
    box-shadow: 0 4px 20px rgba(10, 33, 71, 0.05), 0 1px 3px rgba(10, 33, 71, 0.02);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    color: var(--text);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.85rem 1.5rem;
    position: sticky;
    top: 0;
    z-index: 30;
    margin: 0;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    min-width: 0;
}

.header-menu-btn {
    display: none;
    background: var(--surface-soft);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--navy-900);
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: var(--shadow-card);
    transition: background-color 0.18s ease, color 0.18s ease, transform 0.15s ease;
}

.header-menu-btn:hover {
    background: #FFFFFF;
    color: var(--blue-600);
}

.header-title-block { flex: 1; min-width: 0; }

.header-title {
    font-size: 1.05rem;
    font-weight: 800;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--navy-950);
}

.header-sub {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 1.1rem;
    flex: none;
}

.header-clock {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: var(--surface-soft);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 0.4rem 0.8rem;
}

.clock-date {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.78rem;
    color: var(--text-muted);
}

.clock-time {
    font-weight: 700;
    font-size: 0.88rem;
    font-variant-numeric: tabular-nums;
    color: var(--navy-900);
}

.bell {
    position: relative;
    display: flex;
    align-items: center;
}

.bell-dot {
    position: absolute;
    top: -6px;
    right: -8px;
    background: var(--danger);
    color: #fff;
    font-size: 0.62rem;
    font-weight: 700;
    border-radius: 999px;
    padding: 0.05rem 0.35rem;
}

.profile {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0.6rem;
    padding: 0.35rem 0.75rem;
}

.profile-avatar {
    width: 32px;
    height: 32px;
    border-radius: 999px;
    background: var(--blue-500);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
}

.profile-text { line-height: 1.15; }

.profile-name {
    font-size: 0.82rem;
    font-weight: 700;
}

.profile-role {
    font-size: 0.7rem;
    color: var(--text-on-dark-muted);
}

/* ---------- Content ---------- */
.app-content {
    width: 100%;
    max-width: var(--content-max);
    margin: 0 auto;
    padding: 1.4rem 1.5rem 2rem;
}

.dash-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.dash-title {
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: -0.01em;
}

.dash-title-dim { color: var(--text-soft); }

.dash-sub {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-top: 0.15rem;
}

.dash-badges {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.72rem;
    font-weight: 700;
    border-radius: 999px;
    padding: 0.3rem 0.7rem;
}

.badge-warn {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fde68a;
}

.badge-blue {
    background: #dbeafe;
    color: #1e40af;
    border: 1px solid #bfdbfe;
}

.badge-dot {
    width: 8px;
    height: 8px;
    border-radius: 999px;
    flex: none;
}

.badge-dot-amber { background: var(--warning); }

.context-panel {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    background: var(--surface);
    border: 1px solid rgba(206, 224, 246, 0.86);
    border-radius: var(--radius);
    box-shadow: var(--shadow-card);
    color: var(--text);
    padding: 0.85rem 1.1rem;
    font-size: 0.8125rem;
    line-height: 1.5;
    margin-bottom: 1.25rem;
}

.context-panel-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--blue-600);
    flex-shrink: 0;
    margin-top: 1px;
}

.context-panel-text {
    flex: 1;
    color: #475569;
}

.context-panel-text strong {
    color: #0f172a;
    font-weight: 600;
}

.demo-notice {
    display: flex;
    align-items: flex-start;
    gap: 0.55rem;
    background: #fffbeb;
    border: 1px solid #fde68a;
    color: #78350f;
    border-radius: var(--radius);
    padding: 0.65rem 0.9rem;
    font-size: 0.8rem;
    margin-bottom: 1.25rem;
}

.demo-notice .icon-sm {
    margin-top: 2px;
    color: #b45309;
}

/* ---------- Dashboard grid ---------- */
.dashboard-grid {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    min-width: 0;
}

.dashboard-primary-grid,
.dashboard-secondary-grid,
.dashboard-tertiary-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.85fr) minmax(360px, 1fr);
    gap: 1.1rem;
    align-items: start;
    min-width: 0;
}

.primary-rail {
    display: flex;
    flex-direction: column;
    gap: 1.1rem;
    min-width: 0;
}

.grid-left,
.grid-right {
    display: flex;
    flex-direction: column;
    gap: 1.1rem;
    min-width: 0;
}

/* ---------- KPI ---------- */
.kpi-row {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
}

.kpi-card {
    background: var(--surface);
    border: 1px solid rgba(206, 224, 246, 0.86);
    border-radius: var(--radius);
    box-shadow: var(--shadow-card);
    padding: 1.1rem 1.15rem 0.95rem;
    position: relative;
    overflow: hidden;
    transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease);
}

.kpi-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    opacity: 0.9;
    border-radius: var(--radius) var(--radius) 0 0;
}

.kpi-row .kpi-card:nth-child(1)::before {
    background: linear-gradient(90deg, #2B7FFF, #1769E8);
}

.kpi-row .kpi-card:nth-child(2)::before {
    background: linear-gradient(90deg, #124FA3, #082F73);
}

.kpi-row .kpi-card:nth-child(3)::before {
    background: linear-gradient(90deg, #FFBA3A, #F49A13);
}

.kpi-row .kpi-card:nth-child(4)::before {
    background: linear-gradient(90deg, #7163F4, #5140D7);
}

.kpi-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-raised);
}

.kpi-head {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.kpi-icon {
    width: 38px;
    height: 38px;
    border-radius: 11px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #FFFFFF;
    box-shadow: 0 4px 10px rgba(10, 47, 115, 0.15);
}

.kpi-row .kpi-card:nth-child(1) .kpi-icon { background: linear-gradient(135deg, #2B7FFF, #1769E8); }
.kpi-row .kpi-card:nth-child(2) .kpi-icon { background: linear-gradient(135deg, #124FA3, #082F73); }
.kpi-row .kpi-card:nth-child(3) .kpi-icon { background: linear-gradient(135deg, #FFBA3A, #F49A13); }
.kpi-row .kpi-card:nth-child(4) .kpi-icon { background: linear-gradient(135deg, #7163F4, #5140D7); }

.kpi-value {
    font-size: 1.75rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--text-strong);
    margin-top: 0.55rem;
    font-variant-numeric: tabular-nums;
}

.kpi-trend {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.78rem;
    font-weight: 700;
    margin-top: 0.15rem;
}

.kpi-up { color: var(--success); }
.kpi-down { color: var(--danger); }
.kpi-flat { color: var(--text-muted); }

.kpi-spark {
    display: block;
    width: 100%;
    height: 40px;
    margin-top: 0.55rem;
}

.spark-fill { opacity: 0.9; }
.spark-line { stroke-linecap: round; }

/* ---------- Map panel (PHASE 15B / 15B.1) ---------- */
.map-panel {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-card);
    overflow: hidden;
    position: relative;
}

.map-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.1rem;
    flex-wrap: wrap;
    position: relative;
    z-index: 10;
    background: var(--card);
    border-bottom: 1px solid var(--border);
}

.map-heading {
    font-size: 1rem;
    font-weight: 700;
}

.map-sub {
    font-size: 0.76rem;
    color: var(--text-muted);
    margin-top: 0.15rem;
}

.map-sub strong { color: var(--accent); }

.map-legend {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-top: 0.55rem;
}

.legend-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.72rem;
    color: var(--text-on-dark-muted);
    background: rgba(15, 23, 42, 0.65);
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 0.25rem 0.65rem;
    border-radius: 999px;
}

.legend-dot {
    width: 9px;
    height: 9px;
    border-radius: 999px;
    flex: none;
}

.legend-dot-terminal {
    background: #0284c7;
    box-shadow: 0 0 6px rgba(14, 165, 233, 0.7);
}

.legend-dot-uppkb {
    background: #d97706;
    box-shadow: 0 0 6px rgba(245, 158, 11, 0.7);
}

.btn-map-open {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    background: linear-gradient(135deg, rgba(30, 58, 138, 0.9) 0%, rgba(15, 23, 42, 0.95) 100%);
    color: #ffffff;
    font-size: 0.78rem;
    font-weight: 700;
    border-radius: 0.55rem;
    padding: 0.55rem 0.95rem;
    min-width: 44px;
    min-height: 44px;
    text-decoration: none;
    transition: background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
    white-space: nowrap;
    border: 1px solid rgba(56, 189, 248, 0.3);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.btn-map-open:hover {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.95) 0%, rgba(29, 78, 216, 0.95) 100%);
    border-color: #38bdf8;
    box-shadow: 0 0 12px rgba(56, 189, 248, 0.4);
    color: #ffffff;
}

.btn-map-open:focus-visible {
    outline: 2px solid #38bdf8;
    outline-offset: 2px;
}

.map-stage {
    position: relative;
    width: 100%;
    height: 340px;
    background: #070d19;
    overflow: hidden;
    border-top: 1px solid rgba(56, 189, 248, 0.12);
}

.map-stage::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    box-shadow: inset 0 0 24px rgba(7, 13, 25, 0.65), inset 0 1px 0 rgba(56, 189, 248, 0.12);
    z-index: 999;
}

.mini-map {
    width: 100%;
    height: 100%;
    background: #070d19;
}

/* Map State Overlay: loading, empty, error */
.map-state-overlay {
    position: absolute;
    inset: 0;
    background: rgba(11, 21, 38, 0.85);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1002;
    padding: 1.25rem;
    text-align: center;
}

.map-state-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.6rem;
    max-width: 320px;
}

.map-state-spinner {
    width: 28px;
    height: 28px;
    border: 2.5px solid rgba(255, 255, 255, 0.15);
    border-top-color: #38bdf8;
    border-radius: 50%;
    animation: cc-spin 0.8s linear infinite;
}

@keyframes cc-spin {
    to { transform: rotate(360deg); }
}

.map-state-text {
    font-size: 0.8rem;
    color: var(--text-on-dark);
    line-height: 1.45;
}

/* West Java Regional Boundary Overlay (PHASE 15B.1) */
.cc-jabar-boundary-feature {
    stroke: #38bdf8;
    stroke-width: 1.2px;
    stroke-opacity: 0.7;
    fill: #0284c7;
    fill-opacity: 0.05;
    filter: drop-shadow(0 0 2px rgba(56, 189, 248, 0.35));
    pointer-events: none;
}

/* Custom Marker Styling (divIcon) */
.cc-div-icon {
    background: transparent !important;
    border: none !important;
}

.cc-map-marker {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 999px;
    cursor: pointer;
    position: relative;
    transition: transform 0.18s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.18s ease;
}

.cc-marker-terminal {
    background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
    border: 2px solid #ffffff;
    color: #ffffff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.55), 0 0 10px rgba(14, 165, 233, 0.55);
}

.cc-marker-uppkb {
    background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
    border: 2px solid #ffffff;
    color: #ffffff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.55), 0 0 10px rgba(245, 158, 11, 0.55);
}

.cc-marker-svg {
    width: 14px;
    height: 14px;
    stroke: currentColor;
    flex: none;
}

.cc-map-marker:hover,
.cc-map-marker:focus,
.cc-map-marker:focus-visible,
.leaflet-marker-icon:focus .cc-map-marker,
.leaflet-marker-icon:focus-visible .cc-map-marker {
    transform: scale(1.26);
    outline: 2px solid #38bdf8 !important;
    outline-offset: 3px !important;
}

.cc-marker-terminal:hover,
.cc-marker-terminal:focus,
.cc-marker-terminal:focus-visible,
.leaflet-marker-icon:focus .cc-marker-terminal,
.leaflet-marker-icon:focus-visible .cc-marker-terminal {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6), 0 0 18px rgba(56, 189, 248, 0.9);
}

.cc-marker-uppkb:hover,
.cc-marker-uppkb:focus,
.cc-marker-uppkb:focus-visible,
.leaflet-marker-icon:focus .cc-marker-uppkb,
.leaflet-marker-icon:focus-visible .cc-marker-uppkb {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6), 0 0 18px rgba(251, 191, 36, 0.9);
}

/* Leaflet Dark Theme Overrides */
.leaflet-container {
    background-color: #070d19 !important;
    font-family: inherit !important;
}

.leaflet-bar {
    border: 1px solid rgba(56, 189, 248, 0.25) !important;
    border-radius: 0.5rem !important;
    overflow: hidden;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.55) !important;
}

.leaflet-bar a {
    background-color: rgba(11, 21, 38, 0.88) !important;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: #f1f5f9 !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
    width: 44px !important;
    height: 44px !important;
    line-height: 44px !important;
    font-size: 1.25rem !important;
    font-weight: 700 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: background-color 0.15s ease, color 0.15s ease;
    text-decoration: none !important;
}

.leaflet-bar a:last-child {
    border-bottom: none !important;
}

.leaflet-bar a:hover {
    background-color: rgba(30, 41, 59, 0.95) !important;
    color: #38bdf8 !important;
}

.leaflet-bar a:focus-visible {
    outline: 2px solid #38bdf8 !important;
    outline-offset: -2px !important;
}

.leaflet-bar a.leaflet-disabled {
    background-color: rgba(7, 13, 25, 0.85) !important;
    color: #475569 !important;
    cursor: not-allowed;
}

.leaflet-control-attribution {
    background: rgba(7, 13, 25, 0.88) !important;
    color: #cbd5e1 !important;
    font-size: 0.65rem !important;
    padding: 3px 8px !important;
    border-top-right-radius: 6px !important;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    border-top: 1px solid rgba(255, 255, 255, 0.08) !important;
    border-right: 1px solid rgba(255, 255, 255, 0.08) !important;
}

.leaflet-control-attribution a {
    color: #38bdf8 !important;
    text-decoration: underline !important;
}

.leaflet-control-attribution a:hover {
    color: #7dd3fc !important;
}

/* Leaflet Popup Dark Styling */
.leaflet-popup-content-wrapper {
    background: rgba(11, 21, 38, 0.95) !important;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    color: var(--text-on-dark) !important;
    border: 1px solid rgba(56, 189, 248, 0.25) !important;
    border-radius: 0.65rem !important;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.65), 0 0 15px rgba(56, 189, 248, 0.15) !important;
    padding: 0 !important;
    overflow: hidden;
}

.leaflet-popup-content {
    margin: 0.75rem 0.85rem !important;
    line-height: 1.4 !important;
    font-family: inherit !important;
    font-size: 0.76rem !important;
}

.leaflet-popup-tip {
    background: rgba(11, 21, 38, 0.95) !important;
    border: 1px solid rgba(56, 189, 248, 0.25) !important;
}

.leaflet-container a.leaflet-popup-close-button {
    color: var(--text-muted) !important;
    padding: 6px 8px 0 0 !important;
}

.leaflet-container a.leaflet-popup-close-button:hover {
    color: #ffffff !important;
}

.cc-popup-title {
    font-size: 0.84rem;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 0.2rem;
}

.cc-popup-badge {
    display: inline-block;
    font-size: 0.62rem;
    font-weight: 700;
    padding: 0.12rem 0.4rem;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 0.35rem;
}

.cc-popup-badge-terminal {
    background: rgba(2, 132, 199, 0.25);
    color: #38bdf8;
    border: 1px solid rgba(56, 189, 248, 0.4);
}

.cc-popup-badge-uppkb {
    background: rgba(217, 119, 6, 0.25);
    color: #fbbf24;
    border: 1px solid rgba(251, 191, 36, 0.4);
}

.cc-popup-detail {
    font-size: 0.72rem;
    color: var(--text-muted);
}

.cc-popup-metric {
    margin-top: 0.35rem;
    font-size: 0.72rem;
    color: var(--text-on-dark);
    font-weight: 600;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 0.35rem;
}

/* Compass (North orientation control) */
.map-compass {
    position: absolute;
    top: 128px;
    right: 14px;
    width: 34px;
    height: 46px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-radius: 10px;
    z-index: 1001;
    pointer-events: none;
    border: 1px solid rgba(206, 224, 246, 0.86);
    box-shadow: 0 4px 12px rgba(10, 33, 71, 0.12);
    gap: 1px;
}

.compass-n {
    font-size: 0.65rem;
    font-weight: 800;
    color: #ef4444;
    letter-spacing: 0.05em;
    line-height: 1;
}

.map-compass svg {
    width: 14px;
    height: 14px;
    color: var(--navy-900);
    filter: none;
}

/* Transport Intelligence Overview (score-card) */
.score-card {
    position: absolute;
    left: 14px;
    bottom: 14px;
    background: rgba(11, 21, 38, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    color: var(--text-on-dark);
    border-radius: 0.75rem;
    padding: 0.75rem 0.85rem;
    width: 230px;
    max-width: calc(100% - 28px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(56, 189, 248, 0.15);
    z-index: 500;
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: all 0.2s ease;
}

.score-title {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #38bdf8;
    margin-bottom: 0.5rem;
    padding-bottom: 0.35rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.score-line {
    font-size: 0.72rem;
    color: #e2e8f0;
    line-height: 1.4;
    margin-top: 0.35rem;
    padding: 0.25rem 0.45rem;
    background: rgba(15, 23, 42, 0.6);
    border-radius: 0.35rem;
    border-left: 2.5px solid #0ea5e9;
}

.score-line-warn {
    border-left-color: #f59e0b;
    color: #fde68a;
    background: rgba(245, 158, 11, 0.12);
}

.score-note {
    font-size: 0.6rem;
    color: #94a3b8;
    line-height: 1.35;
    margin-top: 0.45rem;
    padding-top: 0.35rem;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    text-align: left;
}

/* ---------- Cards (insight / promo / right column) ---------- */
.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-card);
    padding: 1.1rem 1.15rem;
}

.card-title {
    font-size: 1rem;
    font-weight: 700;
}

.card-title-dim {
    color: var(--text-soft);
    font-weight: 600;
    font-size: 0.85em;
}

.card-note {
    font-size: 0.74rem;
    color: var(--text-muted);
    margin-top: 0.2rem;
}

/* ---------- Insight row ---------- */
.insight-row {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
    gap: 1.1rem;
}

.card-insight {
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
}

.insight-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.6rem;
    margin-top: 0.85rem;
}

.insight-cell {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: 0.6rem;
    padding: 0.6rem 0.7rem;
}

.insight-icon {
    width: 34px;
    height: 34px;
    border-radius: 0.5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: none;
}

.insight-icon-blue { background: #dbeafe; color: var(--blue-700); }
.insight-icon-red { background: #fee2e2; color: var(--danger); }
.insight-icon-green { background: #dcfce7; color: var(--success); }

.insight-text {
    font-size: 0.78rem;
    color: var(--text-muted);
    line-height: 1.35;
}

.insight-text strong {
    color: var(--text);
    font-size: 0.85rem;
}

/* Promo */
.card-promo {
    background: linear-gradient(150deg, #1a237e 0%, #0f1f38 100%);
    border: none;
    color: var(--text-on-dark);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 1.25rem 1.15rem;
    min-height: auto;
}

.promo-bg {
    position: absolute;
    right: -20px;
    top: -20px;
    color: rgba(255, 255, 255, 0.07);
}

.promo-content {
    display: flex;
    gap: 0.8rem;
    align-items: flex-start;
    position: relative;
}

.promo-icon {
    width: 40px;
    height: 40px;
    border-radius: 0.6rem;
    background: rgba(250, 204, 21, 0.15);
    color: var(--accent);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: none;
}

.promo-title {
    font-size: 1rem;
    font-weight: 800;
}

.promo-sub {
    font-size: 0.76rem;
    color: var(--text-on-dark-muted);
    margin-top: 0.15rem;
}

.promo-link {
    display: inline-block;
    margin-top: 0.7rem;
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--accent);
    text-decoration: none;
    border-bottom: 1px solid rgba(250, 204, 21, 0.4);
    padding-bottom: 1px;
}

.promo-link:hover {
    color: #fde047;
}

/* ---------- Quick access ---------- */
.quick-access {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(115px, 1fr));
    gap: 12px;
}

.quick-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    background: var(--surface);
    border: 1px solid rgba(206, 224, 246, 0.86);
    border-radius: 14px;
    box-shadow: var(--shadow-card);
    padding: 0.95rem 0.6rem;
    color: var(--text);
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    min-height: 44px;
    transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease), border-color 0.2s ease;
}

.quick-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-raised);
    border-color: var(--blue-300);
    color: var(--blue-600);
}

.quick-btn svg {
    color: var(--blue-600);
}

.quick-btn .icon-md {
    color: var(--blue-700);
}

.quick-btn:hover {
    border-color: var(--blue-500);
    box-shadow: 0 4px 10px rgba(30, 58, 138, 0.12);
    transform: translateY(-1px);
}

.quick-btn[aria-disabled="true"]:hover {
    border-color: var(--border);
    box-shadow: var(--shadow-card);
    transform: none;
    cursor: default;
}

/* ---------- Alert panel ---------- */
.card-alert {
    position: relative;
    padding-top: 1.3rem;
}

.alert-bar {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: linear-gradient(90deg, #2B7FFF, #1769E8);
    border-radius: var(--radius) var(--radius) 0 0;
}

.alert-head {
    display: flex;
    align-items: center;
    gap: 0.55rem;
}

.alert-list {
    display: flex;
    flex-direction: column;
    margin-top: 0.85rem;
}

.alert-item {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    width: 100%;
    text-align: left;
    background: none;
    border: none;
    border-bottom: 1px solid var(--border);
    padding: 0.65rem 0;
    color: var(--text);
}

.alert-item:last-of-type {
    border-bottom: none;
}

.alert-dot {
    width: 9px;
    height: 9px;
    border-radius: 999px;
    flex: none;
}

.alert-dot-red { background: var(--danger); }
.alert-dot-amber { background: var(--warning); }

.alert-text {
    flex: 1;
    font-size: 0.82rem;
    line-height: 1.4;
}

.alert-status {
    font-size: 0.92rem;
    font-weight: 800;
    margin-top: 0.55rem;
    line-height: 1.3;
}

.alert-status-ok { color: var(--success); }
.alert-status-empty { color: var(--text-soft); }
.alert-status-error { color: var(--danger); }

.alert-detail {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
    line-height: 1.4;
}

.alert-bar-ok { background: var(--success) !important; }
.alert-bar-error { background: var(--danger) !important; }

.icon-chev { color: var(--text-soft); }

.alert-more {
    width: 100%;
    margin-top: 0.65rem;
    background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: 0.55rem;
    color: var(--blue-700);
    font-weight: 700;
    font-size: 0.8rem;
    padding: 0.55rem 0;
}

.alert-more:hover {
    background: #f1f5f9;
}

/* ---------- Top movers ---------- */
.movers-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.movers-tabs {
    display: flex;
    gap: 0.4rem;
    background: #f1f5f9;
    border-radius: 0.6rem;
    padding: 0.25rem;
    margin-top: 0.8rem;
}

.mover-tab {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    background: transparent;
    border: none;
    border-radius: 0.45rem;
    color: var(--text-muted);
    font-size: 0.8rem;
    font-weight: 600;
    padding: 0.5rem 0.4rem;
}

.mover-tab:hover {
    color: var(--text);
}

.mover-tab-active {
    background: var(--card);
    color: var(--text);
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.1);
}

.movers-list {
    display: flex;
    flex-direction: column;
    margin-top: 0.7rem;
}

.mover-row {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.6rem 0.4rem;
    border-bottom: 1px solid var(--border);
}

.mover-row:last-child {
    border-bottom: none;
}

.mover-rank {
    width: 26px;
    height: 26px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.72rem;
    font-weight: 800;
    flex: none;
}

.mover-rank-up { background: #dcfce7; color: #15803d; }
.mover-rank-down { background: #fee2e2; color: #b91c1c; }
.mover-rank-plain { background: #f1f5f9; color: var(--text-muted); }

.mover-info { flex: 1; min-width: 0; }

.mover-name {
    font-size: 0.83rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mover-detail {
    font-size: 0.7rem;
    color: var(--text-muted);
}

.mover-val {
    font-size: 0.82rem;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    flex: none;
}

.mover-val-up { color: var(--success); }
.mover-val-down { color: var(--danger); }

/* ---------- Top Movers empty state (PHASE 14F) ---------- */
.mover-empty {
    padding: 1.4rem 0.4rem;
    text-align: center;
}

.mover-empty-title {
    font-size: 0.9rem;
    font-weight: 800;
    color: var(--text-muted);
    letter-spacing: 0.04em;
}

.mover-empty-detail {
    font-size: 0.76rem;
    color: var(--text-soft);
    margin-top: 0.3rem;
    line-height: 1.4;
}

/* ---------- Peringkat Simpul Transportasi (NEXT-06) ---------- */
.card-sub-muted {
    font-size: 0.74rem;
    color: var(--text-muted);
    margin-top: 0.15rem;
    line-height: 1.35;
}

.ranking-panel {
    display: flex;
    flex-direction: column;
}

.ranking-list {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    margin-top: 0.75rem;
}

.ranking-item {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    padding: 0.55rem 0.65rem;
    border-radius: 0.5rem;
    background: #f8fafc;
    border: 1px solid var(--border);
    text-decoration: none;
    color: inherit;
    transition: background-color 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
}

.ranking-item:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
    transform: translateY(-1px);
}

.ranking-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.ranking-ident {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    min-width: 0;
    flex: 1;
}

.ranking-badge {
    width: 22px;
    height: 22px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.72rem;
    font-weight: 800;
    flex: none;
}

.ranking-badge-1 { background: #fef3c7; color: #b45309; }
.ranking-badge-2 { background: #e2e8f0; color: #475569; }
.ranking-badge-3 { background: #ffedd5; color: #c2410c; }
.ranking-badge-other { background: #f1f5f9; color: var(--text-muted); }
.ranking-ident-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
    gap: 1px;
}

.ranking-name {
    font-size: 0.82rem;
    font-weight: 700;
    white-space: normal;
    word-break: break-word;
    line-height: 1.25;
    color: var(--navy-950);
}

.ranking-loc {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-weight: 500;
    margin-left: 0;
}

.ranking-metric {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 1px;
    flex: none;
}

.ranking-val {
    font-size: 0.85rem;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    color: var(--navy-950);
    line-height: 1.2;
}

.ranking-share {
    font-size: 0.68rem;
    font-weight: 600;
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
    line-height: 1.2;
}

.ranking-bar-track {
    width: 100%;
    height: 5px;
    background: #e2e8f0;
    border-radius: 999px;
    overflow: hidden;
}

.ranking-bar-fill {
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, #1769E8, #2B7FFF);
    transition: width 0.35s ease;
}

.ranking-bar-fill-kendaraan {
    background: linear-gradient(90deg, #4f46e5, #6366f1);
}


.ranking-empty {
    padding: 1.5rem 0.5rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.8rem;
    background: #f8fafc;
    border-radius: 0.5rem;
    border: 1px dashed var(--border);
    margin-top: 0.75rem;
}

.ranking-loading {
    padding: 1.5rem 0.5rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.8rem;
    font-style: italic;
    background: #f8fafc;
    border-radius: 0.5rem;
    margin-top: 0.75rem;
}

/* ---------- Perintis donut ---------- */
.perintis-body {
    display: flex;
    align-items: center;
    gap: 1.2rem;
    margin-top: 0.85rem;
    flex-wrap: wrap;
}

.donut {
    width: 132px;
    height: 132px;
    border-radius: 999px;
    background: conic-gradient(
        var(--success) 0deg 223deg,
        var(--warning) 223deg 332deg,
        var(--blue-500) 332deg 404deg,
        var(--danger) 404deg 360deg
    );
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    flex: none;
}

.donut::before {
    content: "";
    position: absolute;
    inset: 16px;
    border-radius: 999px;
    background: var(--card);
}

.donut-center {
    position: relative;
    text-align: center;
    z-index: 1;
}

.donut-num {
    font-size: 1.5rem;
    font-weight: 800;
    line-height: 1;
    display: block;
}

.donut-label {
    font-size: 0.68rem;
    color: var(--text-muted);
    line-height: 1.3;
}

.perintis-legend {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    min-width: 0;
}

.legend-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.82rem;
    font-weight: 500;
}

.legend-count {
    color: var(--text-soft);
    font-size: 0.76rem;
}

/* ---------- Data quality ---------- */
.quality-body {
    display: flex;
    align-items: center;
    gap: 1.2rem;
    margin-top: 0.85rem;
    flex-wrap: wrap;
}

.quality-ring {
    position: relative;
    width: 110px;
    flex: none;
}

.quality-num {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    font-weight: 800;
}

.quality-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.45rem 1.1rem;
    min-width: 0;
}

.quality-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
}

/* ---------- Data quality empty state (PHASE 14F) ---------- */
.quality-empty {
    padding: 1.1rem 0.3rem 0.5rem;
    text-align: left;
}

.quality-empty-title {
    font-size: 0.9rem;
    font-weight: 800;
    color: var(--text-muted);
    letter-spacing: 0.04em;
}

.quality-empty-detail {
    font-size: 0.76rem;
    color: var(--text-soft);
    margin-top: 0.3rem;
    line-height: 1.4;
}

/* ---------- Perintis source missing (NEXT-06) ---------- */
.badge-source-missing {
    font-size: 0.65rem;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 4px;
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fde68a;
    letter-spacing: 0.03em;
    flex: none;
}

.perintis-missing-box {
    background: #fffdf5;
    border: 1px dashed #fcd34d;
    border-radius: 0.5rem;
    margin-top: 0.75rem;
}

/* ---------- Perintis Verified Card (PHASE PERINTIS INTEGRATION) ---------- */
.badge-source-verified {
    font-size: 0.65rem;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 4px;
    background: #dcfce7;
    color: #166534;
    border: 1px solid #bbf7d0;
    letter-spacing: 0.03em;
    flex: none;
}

.perintis-summary-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
    margin-top: 0.75rem;
    margin-bottom: 0.75rem;
}

.perintis-summary-item {
    background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    padding: 0.5rem 0.65rem;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.perintis-summary-label {
    font-size: 0.68rem;
    color: var(--text-muted);
    font-weight: 500;
}

.perintis-summary-val {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
}

.perintis-summary-sub {
    font-size: 0.62rem;
    color: var(--text-muted);
}

.perintis-corridors-list {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    margin-top: 0.5rem;
    margin-bottom: 0.75rem;
}

.perintis-route-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.4rem 0.5rem;
    background: #ffffff;
    border: 1px solid var(--border-light, #e2e8f0);
    border-radius: 0.375rem;
    font-size: 0.75rem;
    transition: background-color 0.15s ease;
}

.perintis-route-row:hover {
    background: #f8fafc;
}

.perintis-route-main {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
}

.perintis-route-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex: none;
}

.perintis-route-dot-green {
    background: #10b981;
}

.perintis-route-dot-amber {
    background: #f59e0b;
}

.perintis-route-dot-red {
    background: #ef4444;
}

.perintis-route-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.perintis-route-name {
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.perintis-route-sub {
    font-size: 0.65rem;
    color: var(--text-muted);
}

.perintis-route-metric {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    flex: none;
    margin-left: 0.5rem;
}

.perintis-route-lf {
    font-weight: 700;
    font-size: 0.75rem;
}

.perintis-route-lf-green {
    color: #059669;
}

.perintis-route-lf-amber {
    color: #d97706;
}

.perintis-route-lf-red {
    color: #dc2626;
}

.perintis-route-pax {
    font-size: 0.62rem;
    color: var(--text-muted);
}

.perintis-card-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-top: 0.4rem;
    border-top: 1px solid var(--border-light, #e2e8f0);
}

.perintis-card-cta {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--primary, #0284c7);
    text-decoration: none;
    transition: color 0.15s ease;
}

.perintis-card-cta:hover {
    color: var(--primary-hover, #0369a1);
    text-decoration: underline;
}

/* ---------- Data quality metrics grid (NEXT-06) ---------- */
.quality-metrics-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.6rem;
    margin-top: 0.8rem;
}

.quality-metric-card {
    padding: 0.65rem 0.75rem;
    border-radius: 0.5rem;
    background: #f8fafc;
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.quality-metric-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.4rem;
}

.quality-metric-label {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-muted);
}

.quality-metric-pill {
    font-size: 0.66rem;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 999px;
    background: #e2e8f0;
    color: #475569;
    font-variant-numeric: tabular-nums;
}

.quality-metric-pill-ok {
    background: #dcfce7;
    color: #15803d;
}

.quality-metric-pill-warn {
    background: #fef3c7;
    color: #b45309;
}

.quality-metric-val {
    font-size: 1.12rem;
    font-weight: 800;
    color: var(--text);
    font-variant-numeric: tabular-nums;
}

.quality-metric-val-sm {
    font-size: 0.92rem;
}

.quality-metric-sub {
    font-size: 0.68rem;
    color: var(--text-soft);
    line-height: 1.3;
}

/* ---------- Footer ---------- */
.page-foot {
    text-align: center;
    font-size: 0.75rem;
    color: var(--text-soft);
    margin-top: 1.6rem;
}

/* ---------- Focus ---------- */
:focus-visible {
    outline: 2px solid var(--blue-500);
    outline-offset: 2px;
}

/* =====================================================================
   PHASE 14D — LIVE DATA FOUNDATION
   ===================================================================== */

/* ---------- Year selector ---------- */
.year-select-wrap {
    flex: none;
}

.year-select {
    appearance: none;
    -webkit-appearance: none;
    background: #FFFFFF;
    border: 1px solid var(--border);
    color: var(--navy-900);
    border-radius: 10px;
    min-height: 38px;
    padding: 0.42rem 2rem 0.42rem 0.85rem;
    font-size: 0.85rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    cursor: pointer;
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%230A2F73' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.7rem center;
}

.year-select option {
    background: #FFFFFF;
    color: var(--navy-900);
}

.year-select:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* ---------- API status pill ---------- */
.api-status {
    flex: none;
}

.api-status-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.72rem;
    font-weight: 700;
    border-radius: 999px;
    padding: 0.3rem 0.7rem;
}

.api-status-ok {
    background: rgba(34, 197, 94, 0.15);
    color: #4ade80;
    border: 1px solid rgba(34, 197, 94, 0.4);
}

.api-status-err {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.4);
}

.api-dot {
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: currentColor;
    flex: none;
}

/* ---------- Status bar (timestamp, konteks tahun, error, retry) ---------- */
.status-bar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-bottom: 0.9rem;
    min-height: 1.4rem;
}

.status-chip {
    display: inline-flex;
    align-items: center;
    font-size: 0.74rem;
    font-weight: 600;
    color: var(--text-muted);
    background: #f1f5f9;
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 0.22rem 0.7rem;
}

.status-error {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--danger);
}

.retry-btn {
    appearance: none;
    -webkit-appearance: none;
    border: 1px solid var(--blue-700);
    background: var(--blue-700);
    color: #fff;
    font-size: 0.8rem;
    font-weight: 700;
    border-radius: 0.6rem;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.35rem 0.9rem;
    cursor: pointer;
    transition: background 0.15s ease, opacity 0.15s ease;
}

.retry-btn:hover {
    background: #1e3a8a;
    opacity: 0.92;
}

.retry-btn:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* ---------- Badge live vs demo ---------- */
.badge-live {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #86efac;
}

.badge-dot-green { background: var(--success); }

/* ---------- KPI live states ---------- */
.kpi-card-live {
    /* Semantic domain styling handled by top-rim accents per DESIGN.md §3.3 */
}

.kpi-value-loading {
    color: var(--text-soft);
    font-weight: 600;
    letter-spacing: 0.01em;
}

.kpi-value-error {
    color: var(--danger);
    font-weight: 700;
}

.kpi-value-live {
    color: var(--text);
    font-weight: 800;
}

.kpi-year {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-soft);
    margin-top: 0.15rem;
}

.kpi-metric-wrap {
    display: flex;
    align-items: baseline;
    gap: 0.35rem;
    flex-wrap: wrap;
    margin-top: 0.55rem;
}

.kpi-metric-wrap .kpi-value {
    margin-top: 0;
}

.kpi-unit {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
}

.kpi-source {
    font-size: 0.68rem;
    color: var(--text-soft);
    margin-top: 0.4rem;
    padding-top: 0.4rem;
    border-top: 1px dashed #e2e8f0;
    line-height: 1.3;
}

/* ---------- Overview Monthly Trend Chart (NEXT-05) ---------- */
.card-trend-overview {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.trend-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.trend-sub {
    font-size: 0.76rem;
    color: var(--text-muted);
    margin-top: 0.2rem;
}

.trend-controls {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.trend-metric-toggle {
    display: inline-flex;
    background: #e2e8f0;
    border-radius: 0.45rem;
    padding: 2px;
    gap: 2px;
}

.trend-toggle-btn {
    border: none;
    background: transparent;
    padding: 0.25rem 0.65rem;
    font-size: 0.74rem;
    font-weight: 600;
    color: var(--text-muted);
    border-radius: 0.35rem;
    cursor: pointer;
    transition: all 0.15s ease;
    font-family: inherit;
}

.trend-toggle-btn:hover {
    color: var(--text);
}

.trend-toggle-btn.active {
    background: #ffffff;
    color: var(--text);
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
    font-weight: 700;
}

.trend-legend {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.trend-container {
    padding: 1rem 1rem 0.75rem;
    background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.trend-bars-wrap {
    display: flex;
    align-items: flex-end;
    gap: 0.45rem;
    height: 140px;
    padding-top: 1.75rem;
    border-bottom: 1px solid #cbd5e1;
    position: relative;
}

.trend-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100%;
    justify-content: flex-end;
    position: relative;
    cursor: default;
}

.trend-bar-fill {
    width: 100%;
    max-width: 32px;
    background: var(--blue-500);
    border-radius: 3px 3px 0 0;
    min-height: 2px;
    transition: height 0.3s ease, background-color 0.2s ease;
}

.trend-col:hover .trend-bar-fill:not(.trend-bar-fill-zero) {
    background: var(--blue-600);
}

.trend-bar-fill-zero {
    background: #cbd5e1;
    height: 2px !important;
}

.trend-bar-fill-penumpang {
    background: var(--blue-500);
}

.trend-col:hover .trend-bar-fill-penumpang:not(.trend-bar-fill-zero) {
    background: var(--blue-600);
}

.trend-bar-fill-kendaraan {
    background: #6366f1;
}

.trend-col:hover .trend-bar-fill-kendaraan:not(.trend-bar-fill-zero) {
    background: #4f46e5;
}

.trend-bar-fill-rasio {
    background: #0d9488;
}

.trend-col:hover .trend-bar-fill-rasio:not(.trend-bar-fill-zero) {
    background: #0f766e;
}

.legend-dot-penumpang {
    background: var(--blue-500);
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.legend-dot-kendaraan {
    background: #6366f1;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.legend-dot-rasio {
    background: #0d9488;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.trend-bar-val {
    font-size: 0.65rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.trend-months-wrap {
    display: flex;
    gap: 0.45rem;
    margin-top: 0.45rem;
}

.trend-month-label {
    flex: 1;
    text-align: center;
    font-size: 0.72rem;
    color: var(--text-muted);
    font-weight: 600;
}

.trend-loading,
.trend-empty-note {
    font-size: 0.8125rem;
    color: var(--text-muted);
    text-align: center;
    padding: 2.5rem 1rem;
    margin: 0;
}

.live-badge {
    margin-left: auto;
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    color: #166534;
    background: #bbf7d0;
    border-radius: 999px;
    padding: 0.12rem 0.5rem;
    text-transform: uppercase;
}

/* ---------- Insight live states ---------- */
.insight-cell-stack {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.35rem;
}

.insight-value {
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--text);
    line-height: 1.3;
    font-variant-numeric: tabular-nums;
}

.insight-value-loading {
    color: var(--text-soft);
    font-weight: 600;
}

.insight-value-error {
    color: var(--danger);
    font-weight: 700;
}

.insight-value-demo {
    color: var(--text-muted);
    font-size: 0.82rem;
    font-weight: 600;
}

.insight-sub {
    font-size: 0.7rem;
    color: var(--text-soft);
    line-height: 1.35;
}

.insight-sub-warn {
    color: var(--warning);
    font-weight: 700;
}

/* ---------- Utility ---------- */
.is-hidden {
    display: none !important;
}

/* =====================================================================
   END PHASE 14D
   ===================================================================== */

@media (min-width: 768px) and (max-width: 1024px) {
    .score-card {
        width: 180px;
        padding: 0.65rem 0.75rem;
    }
}

/* ---------- Responsive ---------- */
@media (min-width: 1024px) {
    .kpi-row { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; }
}

@media (max-width: 1099px) {
    .dashboard-primary-grid,
    .dashboard-secondary-grid,
    .dashboard-tertiary-grid {
        grid-template-columns: 1fr;
    }
    .primary-rail {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 1.1rem;
    }
    .clock-date { display: none; }
    .header-right { gap: 0.75rem; }
    .header-title { font-size: 1.05rem; }
}

@media (min-width: 768px) and (max-width: 1023px) {
    .kpi-row { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.85rem; }
    .quick-access { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
    .map-stage { height: 290px; }
    .app-header { padding: 0.75rem 1.25rem; }
    .trend-bars-wrap { gap: 0.3rem; height: 125px; }
    .perintis-summary-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (min-width: 768px) and (max-width: 920px) {
    .map-compass { top: 188px; }
}

@media (max-width: 1023px) {
    .app-sidebar {
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
        transform: translateX(-100%);
        transition: transform 0.25s ease;
        box-shadow: 4px 0 20px rgba(0, 0, 0, 0.3);
        z-index: 40;
    }

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

    .sidebar-close-btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        margin-left: auto;
        background: rgba(255, 255, 255, 0.08);
        border: 1px solid rgba(255, 255, 255, 0.12);
        border-radius: 0.5rem;
        color: var(--text-on-dark);
        width: 44px;
        height: 44px;
        min-width: 44px;
        min-height: 44px;
        cursor: pointer;
        padding: 0;
        flex: none;
        transition: background-color 0.15s ease;
    }

    .sidebar-close-btn:hover {
        background: rgba(255, 255, 255, 0.16);
    }

    .sidebar-close-btn:focus-visible {
        outline: 2px solid var(--accent);
        outline-offset: 2px;
    }

    .sidebar-overlay.is-visible {
        display: block;
    }

    .header-menu-btn {
        display: inline-flex;
    }
}

@media (max-width: 767px) {
    .primary-rail {
        display: flex;
        flex-direction: column;
        gap: 1.1rem;
    }

    .app-header {
        padding: 0.65rem 0.85rem;
        flex-wrap: nowrap;
        gap: 0.5rem;
        align-items: center;
    }

    .header-left {
        gap: 0.6rem;
        min-width: 0;
        flex: 1 1 auto;
        align-items: center;
    }

    .header-menu-btn {
        width: 38px;
        height: 38px;
        min-width: 38px;
        min-height: 38px;
        border-radius: 8px;
    }

    .header-title-block {
        min-width: 0;
        display: flex;
        flex-direction: column;
        justify-content: center;
    }

    .header-title {
        font-size: 0.88rem;
        font-weight: 800;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        line-height: 1.2;
    }

    .header-sub {
        display: none;
    }

    .header-right {
        width: auto;
        min-width: 0;
        flex: 0 0 auto;
        justify-content: flex-end;
        align-items: center;
        gap: 0.4rem;
        flex-wrap: nowrap;
    }

    .header-clock {
        padding: 0.22rem 0.45rem;
        border-radius: 8px;
        gap: 0.3rem;
    }

    .clock-time {
        font-size: 0.7rem;
        font-variant-numeric: tabular-nums;
        white-space: nowrap;
    }

    .year-select {
        font-size: 0.7rem;
        padding: 0.22rem 1.4rem 0.22rem 0.45rem;
        min-width: 60px;
        max-width: 85px;
        border-radius: 8px;
    }

    .clock-date { display: none; }

    .year-select-wrap {
        display: block;
    }
    .app-content {
        padding: 1rem 0.9rem 1.5rem;
    }

    .dash-head {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .dash-badges {
        display: flex;
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .kpi-row { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.75rem; }
    .kpi-card { padding: 0.9rem 0.85rem; }
    .kpi-value { font-size: 1.45rem; }
    .kpi-head { flex-wrap: wrap; }
    .kpi-head .kpi-icon { flex: none; }
    .kpi-head > span:nth-child(2) {
        flex: 1 1 60px;
        min-width: 0;
    }
    .insight-row { grid-template-columns: 1fr; }
    .quick-access { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
    .map-stage { height: 250px; }
    .score-card {
        position: static;
        width: auto;
        margin: 0.75rem 0.75rem 0.75rem;
        border: 1px solid rgba(255, 255, 255, 0.1);
        box-shadow: none;
    }
    .quality-list { grid-template-columns: 1fr; }
    .trend-bars-wrap {
        gap: 0.25rem;
        height: 120px;
        padding-top: 1.25rem;
    }
    .trend-bar-val {
        font-size: 0.62rem;
        font-weight: 700;
        display: block;
    }
    .trend-months-wrap {
        gap: 0.25rem;
    }
    .trend-month-label {
        font-size: 0.65rem;
    }
    .trend-metric-toggle {
        width: 100%;
        display: flex;
    }
    .trend-toggle-btn {
        flex: 1;
        text-align: center;
        padding: 0.3rem 0.4rem;
    }
    .perintis-summary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .map-compass { top: 206px; }
}

@media (max-width: 639px) {
    .header-title .title-prefix { display: none; }
    .kpi-row { grid-template-columns: 1fr; gap: 0.65rem; }
    .quick-access { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
    .quality-metrics-grid { grid-template-columns: 1fr; }
}

@media (max-width: 400px) {
    .kpi-row { grid-template-columns: 1fr; gap: 0.65rem; }
    .kpi-card { padding: 0.85rem 0.75rem; }
    .map-stage { height: 240px; }
    .trend-bar-val {
        font-size: 0.55rem;
        font-weight: 700;
        display: block;
    }
    .trend-bars-wrap {
        gap: 0.15rem;
        height: 110px;
    }
    .trend-months-wrap {
        gap: 0.15rem;
    }
    .trend-month-label {
        font-size: 0.6rem;
    }
    .quality-metrics-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 520px) {
    .header-clock {
        display: none;
    }
}

@media (max-width: 375px) {
    .map-compass { top: 230px; }
}
/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    .app-sidebar,
    .score-fill {
        transition: none;
    }
}

/* =====================================================================
   TEMA BASELINE MINIMALIS & RAPI (NAVY KEMENHUB — FERNLY EDITION)
   Diadaptasi sebagai Template Baseline Resmi Command Center V2
   ===================================================================== */
:root {
    --navy-950: #071E42;
    --navy-900: #0B2559;
    --navy-800: #0D3073;
    --navy-700: #124FA3;
    --navy-600: #1769E8;
    --blue-600: #1769E8;
    --blue-500: #2563EB;
    --blue-400: #3B82F6;
    --blue-100: #DBEAFE;
    --blue-50:  #F0F6FF;

    --accent: #D97706;
    --accent-soft: #FEF3C7;

    --bg: #F6F8FC;
    --canvas: #F6F8FC;
    --card: #FFFFFF;
    --surface: #FFFFFF;
    --border: #E2E8F0;
    --border-subtle: #EDF2F7;

    --text: #0F172A;
    --text-strong: #0B1B33;
    --text-muted: #64748B;
    --text-soft: #94A3B8;

    --radius: 12px;
    --r-card: 12px;
    --r-panel: 14px;
    --shadow-sm: 0 1px 2px rgba(11, 37, 89, 0.04);
    --shadow-card: 0 2px 8px rgba(11, 37, 89, 0.04), 0 1px 2px rgba(11, 37, 89, 0.02);
    --shadow-lift: 0 8px 20px rgba(11, 37, 89, 0.08), 0 2px 6px rgba(11, 37, 89, 0.03);

    --ease-out-expo: cubic-bezier(0.22, 1, 0.36, 1);
    --spring-ease: cubic-bezier(0.16, 1, 0.3, 1);
}

body {
    background: var(--bg) !important;
    color: var(--text) !important;
    font-size: 13.5px !important;
    line-height: 1.45 !important;
}

/* Sidebar Minimalis & Zero Truncation */
.app-sidebar {
    width: 232px !important;
    background: radial-gradient(200px 240px at 80% 0%, rgba(43, 127, 255, 0.18), transparent 75%),
                linear-gradient(180deg, #071C3D 0%, #0A2F73 45%, #071C3D 100%) !important;
    color: #FFFFFF !important;
    border-right: 1px solid rgba(139, 190, 255, 0.22) !important;
    box-shadow: 0 20px 48px -8px rgba(7, 28, 61, 0.38), 0 4px 12px rgba(7, 28, 61, 0.16) !important;
}

.sidebar-logo {
    padding: 0.85rem 1rem !important;
    gap: 0.55rem !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
}

.logo-mark {
    width: 30px !important;
    height: 30px !important;
    border-radius: 8px !important;
    background: linear-gradient(135deg, #FFFFFF 0%, #D6E6FF 100%) !important;
    color: #0A2F73 !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25) !important;
    padding: 5px !important;
}

.logo-title {
    color: #FFFFFF !important;
    font-size: 0.82rem !important;
    font-weight: 800 !important;
    letter-spacing: 0.08em !important;
}

.logo-sub {
    color: #C2D6F2 !important;
    font-size: 0.65rem !important;
    font-weight: 500 !important;
}

.sidebar-nav {
    padding: 0.5rem 0.45rem !important;
}

.nav-group-title {
    color: rgba(139, 190, 255, 0.55) !important;
    font-size: 0.62rem !important;
    font-weight: 700 !important;
    letter-spacing: 0.08em !important;
    margin: 0.6rem 0.4rem 0.25rem !important;
}

.nav-link {
    color: #C2D6F2 !important;
    border-radius: 8px !important;
    padding: 0.42rem 0.6rem !important;
    margin: 1.5px 0 !important;
    gap: 0.5rem !important;
    font-size: 0.8rem !important;
    font-weight: 500 !important;
    transition: all 0.18s var(--ease-out-expo) !important;
    position: relative !important;
    background: transparent !important;
    border: 1px solid transparent !important;
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.08) !important;
    color: #FFFFFF !important;
    transform: translateX(2px) !important;
}

.nav-link.is-active {
    background: linear-gradient(135deg, #FFFFFF 0%, #EAF2FF 100%) !important;
    color: #071C3D !important;
    font-weight: 700 !important;
    box-shadow: 0 4px 14px rgba(0, 16, 48, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.95) !important;
    border: none !important;
}

.nav-link .nav-icon {
    width: 22px !important;
    height: 22px !important;
    border-radius: 6px !important;
    color: #8BBEFF !important;
    background: rgba(255, 255, 255, 0.06) !important;
    display: grid !important;
    place-items: center !important;
}

.nav-link .nav-icon svg {
    width: 14px !important;
    height: 14px !important;
}

.nav-link.is-active .nav-icon {
    color: #1769E8 !important;
    background: rgba(43, 127, 255, 0.12) !important;
}

.nav-link.is-active .nav-text {
    color: #071C3D !important;
    font-weight: 700 !important;
}

.nav-text {
    font-size: 0.8rem !important;
    overflow: visible !important;
    text-overflow: clip !important;
}

.nav-status-available {
    display: none !important;
}

.nav-status-active {
    background: rgba(10, 47, 115, 0.12) !important;
    color: #071C3D !important;
    font-size: 0.55rem !important;
    font-weight: 700 !important;
    padding: 1px 5px !important;
    border-radius: 999px !important;
}

.nav-status-demo {
    background: rgba(245, 158, 11, 0.22) !important;
    color: #FBBF24 !important;
    border: 1px solid rgba(245, 158, 11, 0.45) !important;
    font-size: 0.55rem !important;
    font-weight: 700 !important;
    padding: 1px 5px !important;
    border-radius: 999px !important;
}

.sidebar-footer {
    padding: 0.7rem 0.9rem !important;
    background: rgba(0, 0, 0, 0.15) !important;
    border-top: 1px solid rgba(255, 255, 255, 0.08) !important;
}

.footer-title {
    font-size: 0.74rem !important;
    font-weight: 700 !important;
    color: #FFFFFF !important;
}

.footer-sub {
    font-size: 0.65rem !important;
    color: #C2D6F2 !important;
}

/* Header Minimalis */
.app-header {
    height: 48px !important;
    background: rgba(255, 255, 255, 0.96) !important;
    backdrop-filter: blur(10px) !important;
    -webkit-backdrop-filter: blur(10px) !important;
    border-bottom: 1px solid var(--border) !important;
    box-shadow: 0 1px 3px rgba(11, 37, 89, 0.02) !important;
    padding: 0 1.25rem !important;
}

.header-title {
    font-size: 0.88rem !important;
    font-weight: 700 !important;
    color: #0B2559 !important;
}

.header-sub {
    font-size: 0.72rem !important;
    color: #64748B !important;
}

.clock-date, .clock-time {
    font-size: 0.74rem !important;
    color: #475569 !important;
}

/* Content Head & Title */
.app-content {
    padding: 1rem 1.25rem 2rem !important;
}

.dash-head {
    margin-bottom: 0.75rem !important;
}

.dash-title {
    font-size: 1.1rem !important;
    font-weight: 700 !important;
    letter-spacing: -0.01em !important;
    color: #0B2559 !important;
}

.dash-sub {
    font-size: 0.74rem !important;
    color: #64748B !important;
    margin-top: 0.1rem !important;
}

/* Context Panel */
.context-panel {
    padding: 0.55rem 0.85rem !important;
    background: #FFFFFF !important;
    border: 1px solid var(--border) !important;
    border-left: 3px solid #1769E8 !important;
    border-radius: 8px !important;
    margin-bottom: 0.9rem !important;
    box-shadow: var(--shadow-sm) !important;
}

.context-panel-icon svg {
    width: 15px !important;
    height: 15px !important;
    color: #1769E8 !important;
}

.context-panel-text {
    font-size: 0.73rem !important;
    color: #475569 !important;
    line-height: 1.4 !important;
}

/* KPI Cards */
.kpi-row {
    gap: 0.75rem !important;
    margin-bottom: 0.9rem !important;
}

.kpi-card {
    padding: 0.85rem 0.95rem 0.75rem !important;
    background: #FFFFFF !important;
    border: 1px solid var(--border) !important;
    border-radius: var(--radius) !important;
    box-shadow: var(--shadow-card) !important;
}

.kpi-head {
    gap: 0.45rem !important;
    margin-bottom: 0.45rem !important;
    padding-bottom: 0.4rem !important;
    border-bottom: 1px solid var(--border-subtle) !important;
}

.kpi-icon {
    width: 28px !important;
    height: 28px !important;
    border-radius: 7px !important;
}

.kpi-icon svg {
    width: 14px !important;
    height: 14px !important;
}

.kpi-label {
    font-size: 0.7rem !important;
    font-weight: 600 !important;
    letter-spacing: 0.04em !important;
    color: #64748B !important;
}

.kpi-value {
    font-size: 1.32rem !important;
    font-weight: 700 !important;
    letter-spacing: -0.015em !important;
    color: #0B2559 !important;
    line-height: 1.2 !important;
    font-feature-settings: "tnum" !important;
}

.kpi-sub {
    font-size: 0.68rem !important;
    color: #94A3B8 !important;
    margin-top: 0.15rem !important;
}

.kpi-spark {
    height: 28px !important;
    margin-top: 0.25rem !important;
}

/* Kartu Konten, Map & Panels */
.card,
.map-panel {
    background: #FFFFFF !important;
    border: 1px solid var(--border) !important;
    border-radius: var(--radius) !important;
    box-shadow: var(--shadow-card) !important;
    padding: 0.85rem 1rem !important;
}

.card-title,
.map-heading {
    font-size: 0.88rem !important;
    font-weight: 700 !important;
    color: #0B2559 !important;
}

.card-note,
.map-sub {
    font-size: 0.7rem !important;
    color: #64748B !important;
    margin-top: 0.1rem !important;
}

.btn-map-open {
    padding: 0.3rem 0.65rem !important;
    font-size: 0.72rem !important;
    border-radius: 6px !important;
    background: #0B2559 !important;
}

.btn-map-open svg {
    width: 12px !important;
    height: 12px !important;
}

.map-stage {
    height: 280px !important;
    border-radius: 8px !important;
}

/* Controls */
.year-selector {
    background: #F1F5F9 !important;
    padding: 2px !important;
    border-radius: 6px !important;
}

.year-btn {
    padding: 2px 8px !important;
    font-size: 0.72rem !important;
    font-weight: 600 !important;
    border-radius: 5px !important;
    color: #64748B !important;
}

.year-btn.is-active {
    background: #FFFFFF !important;
    color: #0D3073 !important;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06) !important;
}

.trend-metric-toggle {
    background: #F1F5F9 !important;
    padding: 2px !important;
    border-radius: 6px !important;
}

.trend-toggle-btn {
    padding: 2px 7px !important;
    font-size: 0.7rem !important;
    font-weight: 600 !important;
    border-radius: 5px !important;
    color: #64748B !important;
}

.trend-toggle-btn.is-active {
    background: #FFFFFF !important;
    color: #0D3073 !important;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06) !important;
}

/* Peringkat Simpul */
.ranking-list {
    gap: 0.3rem !important;
}

.ranking-item {
    padding: 0.2rem 0.35rem !important;
    border-radius: 6px !important;
}

.ranking-badge {
    width: 18px !important;
    height: 18px !important;
    font-size: 0.65rem !important;
}

.ranking-name {
    font-size: 0.76rem !important;
    font-weight: 600 !important;
    color: #0F172A !important;
}

.ranking-loc {
    font-size: 0.65rem !important;
}

.ranking-val {
    font-size: 0.78rem !important;
    font-weight: 700 !important;
    color: #0B2559 !important;
}

.ranking-bar-track {
    height: 4.5px !important;
}

/* Quick Access */
.quick-access {
    gap: 8px !important;
}

.quick-btn {
    padding: 0.65rem 0.5rem !important;
    border-radius: 8px !important;
}

.quick-btn-icon {
    width: 24px !important;
    height: 24px !important;
}

.quick-btn-icon svg {
    width: 14px !important;
    height: 14px !important;
}

.quick-btn-label {
    font-size: 0.72rem !important;
    font-weight: 600 !important;
    margin-top: 0.25rem !important;
}

/* Animasi Entrance & Hover */
@keyframes fernlyCascade {
    0% {
        opacity: 0;
        transform: translateY(18px) scale(0.985);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.kpi-row .kpi-card:nth-child(1) { animation: fernlyCascade 0.5s var(--spring-ease) 0.08s both; }
.kpi-row .kpi-card:nth-child(2) { animation: fernlyCascade 0.5s var(--spring-ease) 0.14s both; }
.kpi-row .kpi-card:nth-child(3) { animation: fernlyCascade 0.5s var(--spring-ease) 0.20s both; }
.kpi-row .kpi-card:nth-child(4) { animation: fernlyCascade 0.5s var(--spring-ease) 0.26s both; }
.map-panel { animation: fernlyCascade 0.55s var(--spring-ease) 0.28s both; }
.primary-rail .card { animation: fernlyCascade 0.55s var(--spring-ease) 0.32s both; }

.kpi-card,
.card,
.map-panel,
.quick-btn {
    transition: transform 0.22s var(--ease-out-expo),
                box-shadow 0.22s var(--ease-out-expo),
                border-color 0.18s ease !important;
}

.kpi-card:hover,
.card:hover {
    transform: translateY(-2.5px) !important;
    box-shadow: var(--shadow-lift) !important;
    border-color: rgba(23, 105, 232, 0.2) !important;
}

.btn:active,
.quick-btn:active,
.year-btn:active,
.trend-toggle-btn:active {
    transform: scale(0.96) !important;
}
