:root {
    --bg-main: #060b14;
    --card-bg: rgba(15, 23, 42, 0.7);
    --panel-bg: rgba(9, 14, 23, 0.85);
    --glass-bg: rgba(30, 41, 59, 0.6);
    --sidebar-bg: #070d18;
    --sidebar-width: 320px;

    --text-main: #f8fafc;
    --text-muted: #94a3b8;

    --primary: #3b82f6;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --purple: #a855f7;
    --cyan: #06b6d4;
     --yellow: #ffee00;

    --yr-2024: #a855f7;
    --yr-2025: #3b82f6;
    --yr-2026: #10b981;
    --yr-2030: #f59e0b;
}

* { box-sizing: border-box; }

body {
    background: var(--bg-main);
    color: var(--text-main);
    font-family: 'Nunito', sans-serif;
    user-select: none !important;
    overflow-x: hidden;
    min-height: 100vh;
    min-height: 100dvh;
    margin: 0;
    display: flex;
    -webkit-tap-highlight-color: transparent;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
}

/* ========== UTILITIES ========== */
.text-main { color: var(--text-main) !important; }
.text-orange { color: #f97316; }
.text-cyan { color: var(--cyan); }
.text-purple { color: var(--purple) !important; }
.text-glow { text-shadow: 0 0 15px currentColor; }

.bg-primary-glow { background: rgba(59,130,246,0.15); border: 1px solid rgba(59,130,246,0.3); box-shadow: 0 0 15px rgba(59,130,246,0.2); }
.bg-success-glow { background: rgba(16,185,129,0.15); border: 1px solid rgba(16,185,129,0.3); box-shadow: 0 0 15px rgba(16,185,129,0.2); }
.bg-danger-glow { background: rgba(239,68,68,0.15); border: 1px solid rgba(239,68,68,0.3); box-shadow: 0 0 10px rgba(239,68,68,0.15); }
.bg-purple-glow { background: rgba(168,85,247,0.15); border: 1px solid rgba(168,85,247,0.3); box-shadow: 0 0 10px rgba(168,85,247,0.15); }
.bg-warning-glow { background: rgba(245,158,11,0.15); border: 1px solid rgba(245,158,11,0.3); box-shadow: 0 0 10px rgba(245,158,11,0.15); }
.border-glow { border: 1px solid rgba(255,255,255,0.1); box-shadow: 0 8px 32px rgba(0,0,0,0.5); }

/* ========== SIDEBAR ========== */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    height: 100dvh;
    background: var(--sidebar-bg);
    border-right: 1px solid rgba(59,130,246,0.15);
    display: flex;
    flex-direction: column;
    z-index: 1100;
    transition: transform 0.3s ease;
    overflow-y: auto;
    overflow-x: hidden;
    will-change: transform;
}

.sidebar-top { flex: 1; padding: 20px 16px 10px; }

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 4px;
}

.sidebar-logo {
    height: 42px;
    border-radius: 10px;
}

.sidebar-brand-text {
    display: flex;
    flex-direction: column;
}

.brand-name {
    font-size: 22px;
    font-weight: 900;
    color: var(--text-main);
    line-height: 1.1;
}

.brand-badge {
    display: inline-block;
    background: linear-gradient(135deg, var(--primary), var(--purple));
    color: #fff;
    padding: 1px 8px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 800;
    width: fit-content;
    margin-top: 2px;
    box-shadow: 0 0 8px rgba(168,85,247,0.4);
}

.sidebar-subtitle {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 700;
    margin-bottom: 24px;
    padding-left: 2px;
}
.sidebar-subtitle i { color: var(--primary); margin-right: 4px; }

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 11px 16px;
    border-radius: 12px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 14px;
    font-weight: 700;
    transition: all 0.2s;
    position: relative;
}

.nav-item i { font-size: 16px; width: 20px; text-align: center; }

.nav-item:hover {
    background: rgba(59,130,246,0.08);
    color: var(--text-main);
}

.nav-item.active {
    background: rgba(59,130,246,0.15);
    color: var(--primary);
    box-shadow: inset 3px 0 0 var(--primary);
}

.nav-item.active i { color: var(--primary); }

/* SIDEBAR BOTTOM */
.sidebar-bottom {
    padding: 8px;
    border-top: 1px solid rgba(255,255,255,0.06);
}

.overall-progress-widget {
    background: rgba(15,23,42,0.6);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 16px;
    padding: 16px;
    text-align: center;
    margin-bottom: 12px;
}

.progress-ring-label {
    font-size: 14px;
    font-weight: 800;
    color: var(--text-main);
    margin-bottom: 10px;
}

.progress-ring-container {
    position: relative;
    width: 110px;
    height: 110px;
    margin: 0 auto 10px;
}

.progress-ring { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring-bg { fill: none; stroke: rgba(255,255,255,0.08); stroke-width: 10; }
.ring-fill {
    fill: none;
    stroke: var(--success);
    stroke-width: 10;
    stroke-linecap: round;
    stroke-dasharray: 314;
    stroke-dashoffset: 314;
    transition: stroke-dashoffset 1.5s ease;
    filter: drop-shadow(0 0 6px rgba(16,185,129,0.6));
}

.ring-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.ring-percent {
    font-size: 28px;
    font-weight: 900;
    color: var(--success);
    display: block;
    line-height: 1;
    text-shadow: 0 0 12px rgba(16,185,129,0.5);
}

.ring-status {
    font-size: 11px;
    color: var(--success);
    font-weight: 800;
}

.completed-count {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 700;
}

.view-details-link {
    font-size: 12px;
    color: var(--primary);
    font-weight: 800;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-top: 6px;
    transition: gap 0.2s;
}
.view-details-link:hover { gap: 8px; color: var(--primary); }

.sidebar-footer {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 600;
    padding: 8px 4px 0;
}
.sidebar-footer strong { color: var(--text-main); font-size: 11px; }

/* ========== MAIN WRAPPER ========== */
.main-wrapper {
    margin-left: var(--sidebar-width);
    flex: 1;
    min-width: 0;
    min-height: 100vh;
    min-height: 100dvh;
    background: radial-gradient(ellipse at 20% 0%, #1e1b4b 0%, var(--bg-main) 50%, #020617 100%);
}

/* ========== TOP HEADER ========== */
.top-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: rgba(6,11,20,0.88);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid rgba(59,130,246,0.15);
    padding: 12px 28px;
    display: flex;
    align-items: center;
    gap: 20px;
}

.sidebar-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 20px;
    cursor: pointer;
}

.search-bar {
    flex: 1;
    max-width: 480px;
    position: relative;
}

.search-bar i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 14px;
}

.search-bar input {
    width: 100%;
    background: rgba(30,41,59,0.5);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 12px;
    padding: 10px 16px 10px 40px;
    color: var(--text-main);
    font-family: 'Nunito', sans-serif;
    font-size: 14px;
    font-weight: 600;
    outline: none;
    transition: border-color 0.2s;
}
.search-bar input::placeholder { color: var(--text-muted); }
.search-bar input:focus { border-color: rgba(59,130,246,0.4); }

.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-left: auto;
}

.action-btn {
    background: rgba(30,41,59,0.5);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 10px;
    padding: 9px 14px;
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
    font-family: 'Nunito', sans-serif;
}
.action-btn:hover { border-color: rgba(59,130,246,0.3); color: var(--text-main); }

.notification-btn { position: relative; }
.notif-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: var(--danger);
    color: #fff;
    font-size: 10px;
    font-weight: 900;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 8px rgba(239,68,68,0.5);
}

.year-selector {
    background: rgba(30,41,59,0.5);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 10px;
    padding: 8px 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-muted);
}
.year-selector i { font-size: 14px; }
.year-selector select {
    background: transparent;
    border: none;
    color: var(--text-main);
    font-family: 'Nunito', sans-serif;
    font-weight: 800;
    font-size: 14px;
    outline: none;
    cursor: pointer;
}
.year-selector select option { background: #0f172a; }

/* ========== MAIN CONTENT ========== */
.main-content { padding: 24px 28px 40px; min-width: 0; }

/* ========== PANELS ========== */
.panel {
    background: var(--panel-bg);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 20px;
    border: 1px solid rgba(255,255,255,0.05);
    display: flex;
    flex-direction: column;
    min-width: 0;
    box-shadow: inset 0 0 40px rgba(0,0,0,0.5), 0 10px 30px rgba(0,0,0,0.6);
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
}

.panel-header h5 {
    font-size: 16px;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
}

.icon-box {
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    font-size: 16px;
}

.panel-info-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 18px;
    cursor: pointer;
    transition: color 0.2s;
}
.panel-info-btn:hover { color: var(--primary); }

.sector-select select {
    background: rgba(30,41,59,0.6);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    padding: 6px 10px;
    color: var(--text-main);
    font-family: 'Nunito', sans-serif;
    font-weight: 700;
    font-size: 13px;
    outline: none;
    cursor: pointer;
}
.sector-select select option { background: #0f172a; }

/* MAP */
.map-section {
    position: relative;
    height: 340px;
    border-radius: 14px;
    overflow: hidden;
    flex-grow: 1;
    border: 1px solid rgba(255,255,255,0.1);
    box-shadow: 0 8px 32px rgba(0,0,0,0.5);
}

#map { height: 100%; width: 100%; }

.glass-panel {
    background: var(--glass-bg);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 12px;
}

#hazard-buttons {
    position: absolute;
    bottom: 12px;
    left: 12px;
    z-index: 10;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    width: 135px;
}

#hazard-buttons strong, #hazard-legend strong {
    font-size: 12px;
    display: block;
    margin-bottom: 4px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    padding-bottom: 6px;
    color: var(--text-main);
}

#hazard-buttons button {
    padding: 6px 10px;
    border-radius: 8px;
    border: 1px solid transparent;
    background: rgba(15,23,42,0.8);
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
}

.hazard-icon { width: 18px; }

#hazard-buttons button:hover {
    background: rgba(30,41,59,1);
    border-color: rgba(255,255,255,0.2);
    transform: translateX(3px);
    color: var(--text-main);
}

#hazard-buttons button.active {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 0 12px rgba(59,130,246,0.5);
}
#hazard-buttons button.active .hazard-icon { color: #fff !important; }

#hazard-legend {
    position: absolute;
    bottom: 12px;
    right: 12px;
    z-index: 10;
    padding: 12px;
    width: 120px;
}

#legend-items div {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 5px;
    font-size: 12px;
    font-weight: 800;
    color: var(--text-main);
}

.legend-color {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    box-shadow: 0 0 6px currentColor;
    flex-shrink: 0;
}

/* STATS STRIP (below map and chart) */
.stats-strip {
    display: flex;
    align-items: center;
    gap: 0;
    margin-top: 14px;
    background: rgba(15,23,42,0.5);
    border-radius: 14px;
    border: 1px solid rgba(255,255,255,0.06);
    overflow: hidden;
}

.stat-chip {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-right: 1px solid rgba(255,255,255,0.06);
    font-size: 13px;
}
.stat-chip:last-child { border-right: none; }
.stat-chip i { font-size: 18px; }
.stat-chip div { display: flex; flex-direction: column; }
.stat-chip strong { font-size: 18px; font-weight: 900; color: var(--text-main); line-height: 1.1; }
.stat-chip span { font-size: 11px; color: var(--text-muted); font-weight: 700; }

.stat-link {
    text-decoration: none;
    color: var(--primary);
    font-weight: 800;
    font-size: 13px;
    justify-content: center;
    transition: gap 0.2s;
    gap: 6px !important;
}
.stat-link:hover { gap: 10px !important; }

.stat-highlight-blue strong { color: var(--primary); text-shadow: 0 0 8px rgba(59,130,246,0.4); }
.stat-highlight-green strong { color: var(--success); text-shadow: 0 0 8px rgba(16,185,129,0.4); }
.stat-highlight-cyan strong { color: var(--cyan); text-shadow: 0 0 8px rgba(6,182,212,0.4); }
.stat-highlight-yellow strong { color: var(--yellow); text-shadow: 0 0 8px rgba(80, 79, 22, 0.4); }


/* CHART WRAPPER */
.chart-wrapper {
    background: rgba(15,23,42,0.5);
    border-radius: 14px;
    height: 340px;
    padding: 14px;
    flex-grow: 1;
    min-width: 0;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.1);
    box-shadow: 0 8px 32px rgba(0,0,0,0.5);
}

/* SECTION HEADER ROW */
.section-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 12px;
}

.section-title {
    font-size: 18px;
    font-weight: 900;
    color: var(--text-main);
    margin: 0;
    text-shadow: 0 0 12px rgba(59,130,246,0.2);
}
.section-title i { margin-right: 8px; }

.section-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.year-legend {
    display: flex;
    gap: 14px;
    background: var(--panel-bg);
    padding: 6px 16px;
    border-radius: 20px;
    border: 1px solid rgba(255,255,255,0.06);
}

.legend-badge {
    font-size: 12px;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-main);
}

.legend-badge .dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    display: inline-block;
    box-shadow: 0 0 6px currentColor;
}

.view-all-link {
    font-size: 13px;
    color: var(--primary);
    font-weight: 800;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: gap 0.2s;
}
.view-all-link:hover { gap: 10px; }

/* ========== TASK CARDS ========== */
.task-card {
    background: var(--card-bg);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    border-radius: 18px;
    padding: 20px;
    transition: all 0.3s ease;
    border: 1px solid rgba(255,255,255,0.06);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    height: 100%;
    box-shadow: 0 8px 20px rgba(0,0,0,0.3);
}

.task-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 30px rgba(59,130,246,0.15);
    border-color: rgba(59,130,246,0.4);
}

.card-header-flex {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 10px;
}

.card-icon-main {
    font-size: 22px;
    padding: 10px;
    border-radius: 12px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.08);
}

.card-menu-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 16px;
    cursor: pointer;
    padding: 4px;
}

.card-pct {
    font-size: 20px;
    font-weight: 900;
    margin-bottom: 2px;
}
.card-pct-label {
    font-size: 12px;
    color: var(--success);
    font-weight: 700;
}

.card-title {
    font-weight: 800;
    font-size: 15px;
    line-height: 1.3;
    color: var(--text-main);
    margin-bottom: 14px;
    overflow-wrap: break-word;
}

/* MULTI-YEAR PROGRESS BAR */
.multi-progress-container { margin-top: auto; }

.multi-progress-bar {
    width: 100%;
    height: 16px;
    background: rgba(0,0,0,0.5);
    border-radius: 10px;
    display: flex;
    overflow: hidden;
    box-shadow: inset 0 2px 5px rgba(0,0,0,0.8);
}

.progress-segment {
    height: 100%;
    transition: width 1s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.segment-year-label {
    font-size: 9px;
    font-weight: 900;
    color: #fff;
    text-shadow: 0 1px 4px rgba(0,0,0,0.9);
}

.segment-2025 { background: linear-gradient(90deg, #1d4ed8, var(--yr-2025)); box-shadow: 0 0 8px var(--yr-2025); z-index: 3; }
.segment-2026 { background: linear-gradient(90deg, #047857, var(--yr-2026)); border-left: 1px solid rgba(255,255,255,0.3); box-shadow: 0 0 8px var(--yr-2026); z-index: 2; }
.segment-2030 { background: linear-gradient(90deg, #b45309, var(--yr-2030)); border-left: 1px solid rgba(255,255,255,0.3); box-shadow: 0 0 8px var(--yr-2030); z-index: 1; }

.progress-labels {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 8px;
    font-size: 12px;
    font-weight: 800;
}

.total-cumulative {
    color: var(--primary);
    font-size: 14px;
    text-shadow: 0 0 8px rgba(59,130,246,0.5);
}

.card-tasks-count {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 700;
}

.card-footer-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid rgba(255,255,255,0.06);
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 800;
    text-decoration: none;
    transition: color 0.2s;
}
.card-footer-link:hover { color: var(--primary); }

/* ========== ALERTS PANEL ========== */
.alerts-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: 1;
}

.alert-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: rgba(15,23,42,0.5);
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.04);
    transition: border-color 0.2s;
}
.alert-item:hover { border-color: rgba(255,255,255,0.1); }

.alert-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}
.alert-high { background: rgba(239,68,68,0.15); color: var(--danger); }
.alert-moderate { background: rgba(245,158,11,0.15); color: var(--warning); }

.alert-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.alert-body strong { font-size: 13px; font-weight: 800; color: var(--text-main); }
.alert-body span { font-size: 11px; color: var(--text-muted); font-weight: 600; }

.alert-badge {
    padding: 4px 10px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 900;
    flex-shrink: 0;
}
.badge-high { background: rgba(239,68,68,0.15); color: var(--danger); border: 1px solid rgba(239,68,68,0.3); }
.badge-moderate { background: rgba(245,158,11,0.15); color: var(--warning); border: 1px solid rgba(245,158,11,0.3); }

.panel-footer-link {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: auto;
    padding-top: 12px;
    border-top: 1px solid rgba(255,255,255,0.06);
    color: var(--primary);
    font-weight: 800;
    font-size: 13px;
    text-decoration: none;
    transition: gap 0.2s;
}
.panel-footer-link:hover { gap: 10px; }

/* ========== DONUT PANEL ========== */
.donut-wrapper {
    display: flex;
    align-items: center;
    gap: 20px;
    flex: 1;
    padding: 10px 0;
}

.donut-chart-container {
    position: relative;
    width: 160px;
    height: 160px;
    flex-shrink: 0;
}

.donut-center-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.donut-pct {
    font-size: 28px;
    font-weight: 900;
    color: var(--primary);
    display: block;
    line-height: 1;
    text-shadow: 0 0 10px rgba(59,130,246,0.4);
}

.donut-label {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 700;
}

.pillar-legend {
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: 1;
}

.pillar-row {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    font-weight: 700;
    color: var(--text-main);
}

.p-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.p-val {
    margin-left: auto;
    font-weight: 900;
    font-size: 14px;
}

/* ========== ACHIEVEMENTS ========== */
.achievements-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    flex: 1;
}

.achievement-card {
    background: rgba(15,23,42,0.5);
    border: 1px solid rgba(255,255,255,0.04);
    border-radius: 14px;
    padding: 16px;
    text-align: center;
    transition: border-color 0.2s;
}
.achievement-card:hover { border-color: rgba(255,255,255,0.12); }

.ach-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 8px;
    font-size: 18px;
}

.ach-value {
    font-size: 26px;
    font-weight: 900;
    color: var(--text-main);
    line-height: 1.1;
}

.ach-label {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 700;
    margin-top: 2px;
}

/* ========== POPUP (unchanged structure) ========== */
.popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(2,6,23,0.85);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.popup-content {
    width: 85%;
    max-width: 1100px;
    max-height: 90vh;
    min-width: 0;
    background: var(--panel-bg);
    border-radius: 24px;
    padding: 35px;
    overflow-y: auto;
    overflow-x: hidden;
    position: relative;
    border: 1px solid rgba(255,255,255,0.1);
    box-shadow: 0 20px 50px rgba(0,0,0,0.8);
}

.popup-close {
    position: absolute;
    top: 20px;
    right: 25px;
    font-size: 28px;
    color: var(--text-muted);
    cursor: pointer;
    transition: color 0.2s;
}
.popup-close:hover { color: var(--danger); }

.popup-panel {
    background: rgba(15,23,42,0.6);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 16px;
    box-shadow: inset 0 0 20px rgba(0,0,0,0.3);
}

.border-primary-glow {
    border-color: rgba(59,130,246,0.5);
    box-shadow: 0 0 25px rgba(59,130,246,0.15);
}

.glassy-block {
    background: rgba(30,41,59,0.4);
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: 16px;
    padding: 20px;
    margin-top: 15px;
    border-left: 6px solid #ccc;
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
}

.glassy-block[data-year="2024"] { border-left-color: var(--yr-2024); }
.glassy-block[data-year="2025"] { border-left-color: var(--yr-2025); }
.glassy-block[data-year="2026"] { border-left-color: var(--yr-2026); }
.glassy-block[data-year="2030"] { border-left-color: var(--yr-2030); }

.activity-item {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 12px;
}

.activity-text {
    flex: 1;
    font-size: 14px;
    font-weight: 700;
    color: var(--text-main);
}

.activity-bar-bg {
    flex: 0 0 30%;
    height: 12px;
    background: rgba(0,0,0,0.4);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.5);
}

.activity-bar-fill {
    height: 100%;
    border-radius: 10px;
    box-shadow: 0 0 10px currentColor;
}

.activity-block-val {
    width: 45px;
    text-align: right;
    font-weight: 900;
    font-size: 14px;
    text-shadow: 0 0 8px currentColor;
}

/* ========== MOBILE UX & ACCESSIBILITY ========== */

/* Dim backdrop shown behind the off-canvas sidebar on mobile */
.sidebar-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(2, 6, 23, 0.6);
    -webkit-backdrop-filter: blur(2px);
    backdrop-filter: blur(2px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    z-index: 1050;
}
.sidebar-backdrop.show { opacity: 1; visibility: visible; }
@media (min-width: 1025px) { .sidebar-backdrop { display: none !important; } }

/* Visible keyboard focus (does not affect mouse/touch users) */
a:focus-visible,
button:focus-visible,
select:focus-visible,
input:focus-visible,
.nav-item:focus-visible,
.sidebar-task-item:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
    border-radius: 8px;
}

/* Slim dark scrollbars to match the theme */
.sidebar::-webkit-scrollbar,
.sidebar-static-filler::-webkit-scrollbar,
.popup-content::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
.sidebar::-webkit-scrollbar-thumb,
.sidebar-static-filler::-webkit-scrollbar-thumb,
.popup-content::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.12);
    border-radius: 8px;
}
.sidebar::-webkit-scrollbar-track,
.sidebar-static-filler::-webkit-scrollbar-track,
.popup-content::-webkit-scrollbar-track {
    background: transparent;
}

/* Allow text selection inside the details popup (it has real content) */
.popup-content, .popup-content * { user-select: text; }

/* ========== RESPONSIVE ========== */

/* Tablets / small laptops: collapse the sidebar to an off-canvas drawer */
@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
        box-shadow: 0 0 50px rgba(0, 0, 0, 0.6);
    }
    .sidebar.open { transform: translateX(0); }
    .main-wrapper { margin-left: 0; }
    .sidebar-toggle { display: block; }

    .stats-strip { flex-wrap: wrap; }
    .stat-chip { min-width: 50%; flex: 1 1 50%; }
    .stat-chip:nth-child(2n) { border-right: none; }
}

/* Landscape phones / small tablets */
@media (max-width: 768px) {
    .main-content { padding: 16px 14px 32px; }
    .top-header { padding: 10px 14px; }
    .search-bar { max-width: 200px; }
    .donut-wrapper { flex-direction: column; }
    .section-actions { flex-wrap: wrap; }

    .panel { padding: 16px; border-radius: 16px; }
    .panel-header { margin-bottom: 12px; }
    .panel-header h5 { font-size: 15px; }
    .icon-box { width: 30px; height: 30px; font-size: 14px; }

    .map-section { height: 300px; }
    .chart-wrapper { height: 300px; }
    .section-title { font-size: 16px; }

    /* Lighter blur during scroll on touch devices = smoother frame rate */
    .panel, .task-card { -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
    .glass-panel { -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }

    /* Details popup */
    .popup-content { width: 94%; padding: 20px; border-radius: 18px; }
    .popup-close { top: 14px; right: 16px; font-size: 26px; }
}

/* Portrait phones */
@media (max-width: 576px) {
    .main-content { padding: 14px 12px 28px; }
    .top-header { padding: 10px 12px; }
    .brand-name { font-size: 20px; }

    /* Stats read cleaner stacked on a narrow screen */
    .stat-chip {
        min-width: 100%;
        flex: 1 1 100%;
        border-right: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    }
    .stat-chip:last-child { border-bottom: none; }

    /* Map: shrink the two overlay panels so they never overlap */
    .map-section { height: 280px; }
    #hazard-buttons {
        width: auto;
        max-width: 47%;
        padding: 8px;
        gap: 4px;
        bottom: 8px;
        left: 8px;
    }
    #hazard-buttons button { padding: 5px 7px; font-size: 11px; }
    #hazard-buttons strong, #hazard-legend strong { font-size: 11px; padding-bottom: 4px; }
    .hazard-icon { width: 15px; }
    #hazard-legend {
        width: auto;
        max-width: 42%;
        padding: 8px;
        bottom: 8px;
        right: 8px;
    }
    #legend-items div { font-size: 11px; margin-bottom: 4px; }

    .chart-wrapper { height: 280px; padding: 10px; }

    /* Task cards */
    .task-card { padding: 16px; border-radius: 16px; }
    .card-title { font-size: 14px; }
    .card-pct { font-size: 18px; }
    .card-icon-main { font-size: 20px; padding: 8px; }

    /* Section header */
    .section-header-row { gap: 10px; }
    .year-legend { gap: 10px; padding: 6px 12px; }

    /* Popup internals */
    .popup-content { width: 96%; padding: 16px; }
    .glassy-block { padding: 16px; }
    .activity-item { gap: 10px; }
    .activity-text { font-size: 13px; }
    .activity-bar-bg { flex-basis: 24%; }
}

/* Very small phones */
@media (max-width: 380px) {
    .brand-name { font-size: 18px; }
    #hazard-buttons button { font-size: 10px; padding: 4px 6px; }
    #legend-items div { font-size: 10px; }
    .hazard-icon { width: 13px; }
}

/* Respect users who prefer 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;
    }
}

/* ========== ANIMATIONS ========== */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.panel { animation: fadeInUp 0.5s ease backwards; }
.row .col-lg-6:nth-child(1) .panel { animation-delay: 0.1s; }
.row .col-lg-6:nth-child(2) .panel { animation-delay: 0.2s; }
.row .col-lg-4:nth-child(1) .panel { animation-delay: 0.3s; }
.row .col-lg-4:nth-child(2) .panel { animation-delay: 0.4s; }
.row .col-lg-4:nth-child(3) .panel { animation-delay: 0.5s; }

.task-card { animation: fadeInUp 0.4s ease backwards; }

.sidebar-task-item{
    border-bottom: 1px solid rgb(197, 197, 197);
    padding-bottom: 3px;
    padding-top: 1px;
    padding-left: 1px;
    padding-right: 1px;
}