:root {
  --bg: #f4f7f5;
  --surface: #ffffff;
  --surface-alt: #f8faf9;
  --ink: #152a2a;
  --muted: #70817e;
  --border: #dfe8e5;
  --green: #0c7569;
  --green-dark: #075a51;
  --green-light: #dff4ee;
  --coral: #f45f53;
  --amber: #eea637;
  --violet: #8174db;
  --shadow: 0 10px 32px rgba(27, 65, 58, .07);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: "DM Sans", sans-serif; }
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }

.app-shell { min-height: 100vh; }
.sidebar { position: fixed; inset: 0 auto 0 0; width: 236px; display: flex; flex-direction: column; padding: 27px 20px 20px; background: #0b342f; color: #e9f7f3; z-index: 30; }
.brand { display: flex; align-items: center; gap: 11px; padding: 0 8px 28px; color: white; text-decoration: none; font: 800 18px "Manrope", sans-serif; }
.brand > span:last-child span { color: #67d4bd; }
.brand-mark { position: relative; width: 30px; height: 30px; display: grid; place-content: center; border-radius: 9px; background: #17a58f; transform: rotate(-5deg); }
.brand-mark span { position: absolute; display: block; width: 5px; border-radius: 3px; background: white; bottom: 7px; }
.brand-mark span:nth-child(1) { height: 7px; left: 7px; }.brand-mark span:nth-child(2) { height: 15px; left: 13px; }.brand-mark span:nth-child(3) { height: 10px; left: 19px; }
.nav-list { display: grid; gap: 6px; }
.nav-item { display: flex; align-items: center; gap: 12px; padding: 11px 13px; border-radius: 9px; color: #9dc0b9; text-decoration: none; font-weight: 500; transition: .2s ease; }
.nav-item:hover, .nav-item.active { color: white; background: rgba(113, 219, 196, .13); }
.nav-item.active { box-shadow: inset 3px 0 #58ceb5; }
.nav-icon { width: 20px; text-align: center; font-size: 19px; }
.sidebar-note { margin-top: auto; padding: 15px; border: 1px solid rgba(134, 219, 202, .16); border-radius: 12px; background: rgba(255, 255, 255, .045); font-size: 12px; }
.sidebar-note strong { font-size: 12px; }.sidebar-note p { color: #82aaa2; line-height: 1.55; margin: 7px 0 0; }.sidebar-note p span { color: #c3dcd7; }
.live-dot { display: inline-block; width: 7px; height: 7px; margin-right: 7px; border-radius: 50%; background: #55d5a8; box-shadow: 0 0 0 4px rgba(85, 213, 168, .1); }
.sidebar-footer { display: grid; grid-template-columns: 32px 34px 1fr; gap: 9px; align-items: center; margin-top: 16px; padding-top: 16px; border-top: 1px solid rgba(255,255,255,.09); }
.sidebar-footer .icon-button { color: #a8c9c2; border-color: rgba(255,255,255,.12); background: transparent; }
.avatar { display: grid; place-content: center; width: 34px; height: 34px; border-radius: 50%; background: #d8a86d; color: #183d36; font-weight: 700; font-size: 11px; }
.sidebar-footer strong, .sidebar-footer span { display: block; }.sidebar-footer strong { font-size: 11px; }.sidebar-footer span { color: #769c94; font-size: 9px; margin-top: 2px; }

main { margin-left: 236px; }
.topbar { height: 100px; display: flex; align-items: center; justify-content: space-between; padding: 0 32px; border-bottom: 1px solid var(--border); background: rgba(255,255,255,.82); backdrop-filter: blur(12px); }
.eyebrow, .section-kicker { margin: 0 0 5px; color: var(--green); font-size: 9px; font-weight: 800; letter-spacing: .14em; }
h1, h2, h3 { font-family: "Manrope", sans-serif; }
h1 { margin: 0; font-size: 24px; letter-spacing: -.04em; } h2 { margin: 0; font-size: 16px; letter-spacing: -.025em; }
.topbar-actions { display: flex; gap: 10px; }
.search { height: 38px; display: flex; align-items: center; gap: 7px; width: 190px; padding: 0 12px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface); color: var(--muted); }
.search input { width: 100%; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 12px; }
.source-pill { justify-content: center; width: auto; color: var(--green); font-size: 10px; font-weight: 700; white-space: nowrap; }
.outline-button { height: 38px; display: flex; align-items: center; gap: 8px; padding: 0 15px; border: 1px solid var(--green); border-radius: 9px; background: var(--surface); color: var(--green); font-weight: 700; font-size: 11px; }
.icon-button { display: grid; place-content: center; width: 36px; height: 36px; border: 1px solid var(--border); border-radius: 9px; color: var(--ink); background: var(--surface); }
.mobile-menu { display: none; }
.content { padding: 22px 32px 32px; max-width: 1600px; margin: auto; }

.insight-banner { display: grid; grid-template-columns: 35px 1fr auto; align-items: center; gap: 13px; margin-bottom: 18px; padding: 12px 15px; border: 1px solid #f5d8b1; border-radius: 11px; background: #fff9ed; }
.insight-icon { display: grid; place-content: center; width: 32px; height: 32px; border-radius: 8px; background: #f7e4bf; color: #9e6512; font-weight: 800; }
.insight-banner strong { font-size: 12px; }.insight-banner p { display: inline; margin-left: 8px; color: #7f704f; font-size: 11px; }
.insight-banner button { border: 0; background: transparent; color: #8e5d15; font-weight: 700; font-size: 11px; }

.metric-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 16px; }
.metric-card, .panel { border: 1px solid var(--border); border-radius: 13px; background: var(--surface); box-shadow: var(--shadow); }
.metric-card { min-height: 135px; padding: 15px 16px; position: relative; overflow: hidden; }
.metric-head { display: flex; justify-content: space-between; align-items: center; color: var(--muted); font-size: 11px; font-weight: 600; }
.metric-icon { display: grid; place-content: center; width: 27px; height: 27px; border-radius: 7px; font-weight: 700; }.metric-icon.coral { color: #da4f44; background: #ffe7e4; }.metric-icon.amber { color: #b97717; background: #fff1d8; }.metric-icon.violet { color: #6959c8; background: #eeebff; }.metric-icon.teal { color: var(--green); background: var(--green-light); }
.metric-value { margin: 5px 0 1px; font: 800 26px "Manrope", sans-serif; letter-spacing: -.04em; }.metric-value small { font-size: 11px; color: var(--muted); }
.metric-meta { color: var(--muted); font-size: 10px; }.metric-meta span { font-weight: 700; }.metric-meta.up span { color: #d84b40; }.metric-meta.down span { color: var(--green); }
.sparkline { position: absolute; inset: auto 0 0; height: 31px; background: linear-gradient(180deg, rgba(244,95,83,.09), transparent); clip-path: polygon(0 75%, 10% 60%, 20% 70%, 31% 35%, 42% 55%, 53% 25%, 65% 40%, 77% 11%, 88% 22%, 100% 0, 100% 100%, 0 100%); }
.mini-dots { display: flex; align-items: end; gap: 4px; height: 22px; margin-top: 6px; }.mini-dots i { display: block; width: 7px; height: 7px; background: #f3bc65; border-radius: 50%; }.mini-dots i:nth-child(4),.mini-dots i:nth-child(5) { width: 10px; height: 10px; background: #eea637; }.mini-dots i:nth-child(6),.mini-dots i:nth-child(7) { width: 13px; height: 13px; background: #d98518; }
.progress { height: 4px; margin-top: 12px; border-radius: 4px; background: #edeaf9; }.progress span { display: block; height: 100%; border-radius: inherit; background: var(--violet); }
.target-label { margin-top: 10px; color: var(--muted); font-size: 9px; }.target-label span { display: inline-block; width: 5px; height: 5px; margin-right: 5px; border-radius: 50%; background: var(--green); }

.dashboard-grid { display: grid; grid-template-columns: minmax(0, 2.25fr) minmax(250px, .75fr); gap: 16px; margin-bottom: 16px; }
.panel-header { min-height: 72px; display: flex; justify-content: space-between; align-items: center; padding: 15px 18px; }
.map-tools { display: flex; gap: 8px; align-items: end; }.select-wrap span { display: block; margin-bottom: 3px; color: var(--muted); font-size: 8px; font-weight: 700; text-transform: uppercase; }.select-wrap select { min-width: 130px; padding: 7px 27px 7px 9px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--ink); font-size: 10px; }
.week-control { display: flex; overflow-x: auto; padding: 0 18px 12px; border-bottom: 1px solid var(--border); scrollbar-width: thin; }
.week-control button { position: relative; flex: 1 0 78px; padding: 7px 8px; border: 0; border-right: 1px solid var(--border); background: var(--surface); color: var(--muted); text-align: left; }.week-control button:first-child { border-radius: 7px 0 0 7px; }.week-control button:last-child { border-right: 0; border-radius: 0 7px 7px 0; }.week-control button.active { background: var(--green-light); color: var(--green-dark); }.week-control button.active::after { content: ""; position: absolute; inset: auto 9px 0; height: 2px; background: var(--green); }
.week-control span, .week-control small { display: block; }.week-control span { font-size: 10px; font-weight: 800; }.week-control small { margin-top: 2px; font-size: 8px; }
.map-wrap { position: relative; height: 405px; overflow: hidden; background: #e9f0ec; }
#map { position: absolute; inset: 0; z-index: 2; }
.map-fallback { position: absolute; inset: 0; overflow: hidden; background-color: #eaf0ed; background-image: linear-gradient(30deg, transparent 24%, rgba(167,185,179,.15) 25%, rgba(167,185,179,.15) 26%, transparent 27%, transparent 74%, rgba(167,185,179,.12) 75%, rgba(167,185,179,.12) 76%, transparent 77%), linear-gradient(120deg, transparent 24%, rgba(167,185,179,.13) 25%, rgba(167,185,179,.13) 26%, transparent 27%); background-size: 100px 130px; }
.fallback-label { position: absolute; top: 50%; left: 50%; padding: 9px 13px; border: 1px solid var(--border); border-radius: 8px; background: rgba(255,255,255,.9); color: var(--muted); font-size: 9px; font-weight: 700; transform: translate(-50%,-50%); }
.map-shape { position: absolute; width: 142px; height: 322px; top: 31px; left: 43%; border-radius: 61% 39% 55% 45% / 28% 38% 62% 72%; background: #dce8df; border: 5px solid rgba(255,255,255,.8); transform: rotate(-9deg); box-shadow: 0 8px 20px rgba(61,93,82,.12); }
.map-shape::before { content: ""; position: absolute; width: 77px; height: 116px; left: -20px; top: 43px; border-radius: 70% 30% 66% 34%; background: inherit; }.map-shape::after { content: "SRI LANKA"; position: absolute; left: 36px; top: 155px; color: #a7b8b1; font-size: 8px; letter-spacing: .18em; transform: rotate(9deg); }
.map-markers { position: absolute; inset: 0; z-index: 4; pointer-events: none; }
.fallback-marker { position: absolute; display: grid; place-content: center; width: var(--size); height: var(--size); border: 2px solid rgba(255,255,255,.9); border-radius: 50%; background: var(--color); box-shadow: 0 2px 7px rgba(31,59,53,.24); transform: translate(-50%,-50%); pointer-events: auto; transition: opacity .2s, transform .2s; }
.fallback-marker:hover, .fallback-marker:focus { transform: translate(-50%,-50%) scale(1.25); outline: 3px solid rgba(12,117,105,.18); }.fallback-marker::after { content: ""; position: absolute; inset: -5px; border: 1px solid var(--color); border-radius: 50%; animation: pulse 2.1s infinite; opacity: .3; }
@keyframes pulse { 70%,100% { transform: scale(1.7); opacity: 0; } }
.map-legend { position: absolute; z-index: 6; left: 14px; bottom: 14px; width: 145px; padding: 11px; border: 1px solid rgba(214,226,222,.9); border-radius: 9px; background: rgba(255,255,255,.92); box-shadow: 0 5px 18px rgba(39,72,65,.12); backdrop-filter: blur(7px); }.map-legend strong { display: block; margin-bottom: 7px; font-size: 9px; }.map-legend div { display: flex; align-items: center; gap: 7px; margin-top: 5px; font-size: 8px; }.map-legend small { margin-left: auto; color: var(--muted); }.legend-dot { flex: 0 0 9px; width: 9px; height: 9px; border: 1px solid #fff; border-radius: 50%; box-shadow: 0 0 0 1px rgba(14,42,38,.35); }.low { background: #36a68d!important; }.medium { background: #eea637!important; }.high { background: #ed5a4f!important; }
.map-filter { position: absolute; z-index: 6; top: 12px; left: 12px; display: flex; padding: 3px; border: 1px solid var(--border); border-radius: 8px; background: rgba(255,255,255,.93); box-shadow: 0 4px 14px rgba(39,72,65,.08); }.map-filter button { padding: 5px 8px; border: 0; border-radius: 5px; background: transparent; color: var(--muted); font-size: 8px; font-weight: 600; }.map-filter button.active { background: var(--green); color: white; }.map-filter i { display: inline-block; width: 5px; height: 5px; margin-right: 4px; border-radius: 50%; }
.location-card { position: absolute; z-index: 7; top: 50px; right: 12px; width: min(330px, calc(100% - 24px)); max-height: calc(100% - 64px); overflow-y: auto; padding: 16px; border: 1px solid var(--border); border-radius: 12px; background: rgba(255,255,255,.97); box-shadow: 0 12px 30px rgba(28,63,56,.18); transform: translateX(370px); opacity: 0; transition: .25s ease; }.location-card.show { transform: translateX(0); opacity: 1; }.location-card > button { position: absolute; right: 9px; top: 7px; border: 0; background: transparent; color: var(--muted); font-size: 18px; }.risk-label { color: var(--coral); font-size: 7px; font-weight: 800; letter-spacing: .1em; }.location-card h3 { margin: 4px 24px 1px 0; font-size: 17px; }.location-card > p { margin: 0 0 12px; color: var(--muted); font-size: 9px; }.profile-demographics { display: flex; align-items: baseline; gap: 6px; padding: 9px 0 12px; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }.profile-demographics strong { font: 800 18px "Manrope"; }.profile-demographics strong:last-child { margin-left: auto; padding: 4px 8px; border-radius: 12px; background: var(--green-light); color: var(--green); font-size: 9px; }.profile-demographics span { color: var(--muted); font-size: 9px; }.profile-details { display: grid; grid-template-columns: 1fr 1fr; gap: 11px 14px; margin: 13px 0 0; }.profile-details div { min-width: 0; }.profile-details .profile-wide { grid-column: 1 / -1; }.profile-details dt { margin-bottom: 3px; color: var(--muted); font-size: 7px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }.profile-details dd { margin: 0; color: var(--ink); font-size: 9px; line-height: 1.4; overflow-wrap: anywhere; }
.map-caption { display: flex; justify-content: space-between; padding: 9px 17px; color: var(--muted); font-size: 8px; }.map-caption i { display: inline-block; width: 6px; height: 6px; margin-right: 6px; border-radius: 50%; background: var(--green); }
.ranking-subtitle { margin: -8px 18px 10px; color: var(--muted); font-size: 9px; }.text-button { border: 0; background: transparent; color: var(--green); font-size: 10px; font-weight: 700; }
.ranking-list { max-height: 480px; overflow-y: auto; padding: 0 18px; scrollbar-width: thin; }.ranking-item { display: grid; grid-template-columns: 20px 1fr auto; align-items: center; gap: 8px; padding: 11px 0; border-bottom: 1px solid var(--border); cursor: pointer; }.ranking-item:last-child { border-bottom: 0; }.rank-number { color: #a3b0ae; font: 700 10px "Manrope"; }.district-name { display: block; font-size: 11px; font-weight: 700; }.district-province { color: var(--muted); font-size: 8px; }.rank-data { text-align: right; }.rank-data strong { display: block; font: 700 12px "Manrope"; }.rank-data span { font-size: 8px; font-weight: 700; }.rank-data .rise { color: var(--coral); }.rank-data .fall { color: var(--green); }
.rank-bar { grid-column: 2 / 4; height: 3px; margin-top: -5px; border-radius: 3px; background: #edf2f0; }.rank-bar span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--coral), #f5a265); }
.ranking-callout { display: flex; gap: 8px; margin: 14px 18px; padding: 10px; border-radius: 8px; background: var(--green-light); color: var(--green-dark); }.ranking-callout > span { display: grid; place-content: center; flex: 0 0 17px; height: 17px; border-radius: 50%; background: var(--green); color: white; font-size: 8px; font-weight: 800; }.ranking-callout p { margin: 0; font-size: 9px; line-height: 1.4; }

.trends-panel { padding-bottom: 12px; }.trend-header { padding-bottom: 7px; }.trend-subtitle { margin: 3px 0 0; color: var(--muted); font-size: 9px; }.segmented { display: flex; padding: 3px; border-radius: 7px; background: var(--surface-alt); }.segmented button { padding: 6px 10px; border: 0; border-radius: 5px; background: transparent; color: var(--muted); font-size: 8px; font-weight: 700; }.segmented button.active { color: var(--green); background: var(--surface); box-shadow: 0 2px 8px rgba(25,64,57,.1); }
.chart-summary { display: flex; align-items: baseline; gap: 7px; padding: 0 18px 5px; }.chart-summary strong { font: 800 22px "Manrope"; }.chart-summary span { color: var(--muted); font-size: 9px; }.chart-summary em { margin-left: auto; color: var(--coral); font-size: 9px; font-style: normal; font-weight: 700; }
.chart-wrap { position: relative; height: 225px; padding: 0 12px; }#trendChart { width: 100%; height: 100%; }.chart-tooltip { position: absolute; display: none; padding: 7px 9px; border-radius: 7px; background: #143f39; color: white; font-size: 9px; pointer-events: none; box-shadow: 0 5px 15px rgba(0,0,0,.15); transform: translate(-50%,-115%); }.chart-tooltip strong { display: block; font-size: 11px; }
.trend-footer { display: flex; align-items: center; gap: 18px; padding: 5px 20px 0; color: var(--muted); font-size: 8px; }.trend-footer i { display: inline-block; width: 14px; height: 2px; margin-right: 5px; vertical-align: middle; }.trend-footer .actual { background: var(--green); }.trend-footer .average { border-top: 2px dashed #91aaa4; }.season-note { margin-left: auto; padding: 4px 8px; border-radius: 10px; background: #fff1da; color: #966312; }
.page-footer { display: flex; justify-content: space-between; padding: 18px 3px 0; color: var(--muted); font-size: 8px; }
.toast { position: fixed; right: 24px; bottom: 24px; z-index: 50; padding: 11px 15px; border-radius: 9px; background: #123d37; color: white; font-size: 11px; box-shadow: 0 12px 30px rgba(16,50,44,.25); transform: translateY(80px); opacity: 0; transition: .25s ease; }.toast.show { transform: translateY(0); opacity: 1; }

body.dark { --bg:#0e1c1a; --surface:#152724; --surface-alt:#1b302c; --ink:#eaf4f2; --muted:#88a49e; --border:#28413c; --shadow:0 10px 30px rgba(0,0,0,.14); }.dark .topbar { background: rgba(21,39,36,.88); }.dark .insight-banner { background:#302b1c; border-color:#53482c; }.dark .insight-banner p { color:#c4b995; }.dark .map-fallback { filter: brightness(.7) saturate(.7); }.dark .map-legend,.dark .map-filter,.dark .location-card { background:rgba(21,39,36,.95); }

@media (max-width: 1100px) { .metric-grid { grid-template-columns: repeat(2,1fr); }.dashboard-grid { grid-template-columns: 1fr; }.ranking-list { display: grid; grid-template-columns: 1fr 1fr; column-gap: 24px; }.map-wrap { height: 440px; } }
@media (max-width: 760px) { .sidebar { transform: translateX(-100%); transition: .25s ease; }.sidebar.open { transform: translateX(0); box-shadow: 15px 0 40px rgba(0,0,0,.2); }.sidebar::after { content:""; position:fixed; inset:0; background:rgba(7,28,25,.4); z-index:-1; opacity:0; pointer-events:none; }.sidebar.open::after { opacity:1; }.mobile-menu { display:grid; flex:0 0 36px; }.topbar { height:auto; min-height:88px; padding:15px 18px; gap:11px; }.topbar h1 { font-size:19px; }.topbar-actions { margin-left:auto; }.search { display:none; }.outline-button { padding:0 10px; }.outline-button span { display:none; } main { margin-left:0; }.content { padding:16px; }.insight-banner { grid-template-columns:35px 1fr; }.insight-banner p { display:block; margin:3px 0 0; }.insight-banner button { grid-column:2; justify-self:start; padding:0; }.dashboard-grid { display:block; }.ranking-card { margin-top:16px; }.week-control { overflow-x:auto; }.week-control button { flex-basis:98px; }.map-header { align-items:flex-start; }.map-tools .select-wrap { display:none; }.map-wrap { height:400px; }.ranking-list { display:block; }.trend-header { align-items:flex-start; }.page-footer { gap:14px; }.trend-footer { flex-wrap:wrap; }.season-note { margin-left:0; } }
@media (max-width: 500px) { .metric-grid { grid-template-columns:1fr 1fr; gap:9px; }.metric-card { min-height:128px; padding:13px; }.metric-value { font-size:22px; }.map-filter { max-width:calc(100% - 24px); overflow:auto; }.map-legend { display:none; }.location-card { top:50px; }.chart-wrap { height:200px; }.chart-summary em { display:none; } }
@media (prefers-reduced-motion: reduce) { *,*::before,*::after { scroll-behavior:auto!important; animation:none!important; transition:none!important; } }
