:root {
  --brand: #2e7d4f;
  --brand-strong: #1f5e3a;
  --brand-soft: #e6f4ec;
  --navy: #14324a;
  --ink: #17212b;
  --muted: #637381;
  --line: #dce6df;
  --bg: #f5f9f6;
  --surface: #ffffff;
  --amber: #b8801a;
  --amber-soft: #fbf1da;
  --coral: #c9574b;
  --coral-soft: #fdecea;
  --blue: #2f6bba;
  --blue-soft: #e8f0ff;
  --green: #2d8556;
  --shadow: 0 16px 42px rgba(20, 50, 74, 0.10);
  --radius: 8px;
  --font: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font); }
a { color: inherit; text-decoration: none; }

.demo-app { min-height: 100vh; display: grid; grid-template-columns: 248px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; padding: 18px; background: var(--navy); color: #ffffff; }
.brand { display: flex; align-items: center; gap: 10px; padding-bottom: 18px; border-bottom: 1px solid rgba(255, 255, 255, 0.14); }
.brand img { width: 42px; height: 42px; border-radius: 8px; background: #ffffff; }
.brand strong { display: block; font-size: 17px; }
.brand span { display: block; margin-top: 3px; color: #bcd3dc; font-size: 12px; }
.side-nav { display: grid; gap: 6px; max-height: calc(100vh - 210px); margin-top: 18px; overflow-y: auto; padding-right: 3px; }
.side-nav a { display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 0 11px; border-radius: 8px; color: #d9e8ee; font-weight: 750; font-size: 13px; }
.side-nav a:hover, .side-nav a.active { background: rgba(255, 255, 255, 0.12); color: #ffffff; }
.side-nav i { width: 22px; height: 22px; display: grid; place-items: center; border-radius: 6px; background: rgba(255, 255, 255, 0.12); font-style: normal; font-size: 11px; }
.side-foot { position: absolute; left: 18px; right: 18px; bottom: 18px; display: grid; gap: 8px; }
.side-foot a { min-height: 38px; display: grid; place-items: center; border: 1px solid rgba(255, 255, 255, 0.18); border-radius: 8px; color: #e9f3f6; font-size: 12px; font-weight: 800; }

.main { min-width: 0; }
.topbar { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 68px; padding: 0 24px; background: rgba(255, 255, 255, 0.92); border-bottom: 1px solid var(--line); backdrop-filter: blur(12px); }
.topbar h1 { margin: 0; color: var(--navy); font-size: 20px; line-height: 1.15; }
.topbar p { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.top-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.pill { display: inline-flex; align-items: center; min-height: 30px; padding: 0 10px; border: 1px solid var(--line); border-radius: 999px; background: #ffffff; color: #435564; font-size: 12px; font-weight: 800; }
.content { padding: 22px 24px 34px; }

.hero-strip { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 16px; align-items: stretch; margin-bottom: 16px; }
.hero-card, .panel, .kpi, .selector-card { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.hero-card { padding: 22px; background: linear-gradient(135deg, #ffffff 0%, #eef7f1 100%); }
.hero-card h2 { margin: 0; color: var(--navy); font-size: 30px; line-height: 1.05; }
.hero-card p { margin: 12px 0 0; color: #435564; line-height: 1.55; }
.hero-note { padding: 18px; background: var(--navy); color: #ffffff; }
.hero-note strong { display: block; font-size: 28px; }
.hero-note span { display: block; margin-top: 8px; color: #c6d7df; font-size: 13px; line-height: 1.45; }

.selector-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.selector-group { margin-bottom: 18px; }
.selector-group-head { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; margin: 0 0 9px; }
.selector-group-head strong { color: var(--navy); font-size: 15px; }
.selector-group-head span { color: var(--muted); font-size: 12px; }
.primary-selector-grid { grid-template-columns: minmax(0, 1fr); }
.primary-selector-grid .selector-card { min-height: 118px; grid-template-columns: 48px minmax(0, 1fr); gap: 13px; align-items: center; }
.primary-selector-grid .selector-card b { margin: 0; }
.other-selector-group { padding-top: 3px; border-top: 1px solid var(--line); }
.selector-card { min-height: 164px; padding: 18px; display: grid; align-content: space-between; transition: transform 160ms ease, border-color 160ms ease; }
.selector-card:hover { transform: translateY(-2px); border-color: rgba(46, 125, 79, 0.48); }
.selector-card b { display: block; width: 42px; height: 42px; border-radius: 8px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand-strong); font-size: 12px; }
.selector-card strong { display: block; color: var(--navy); font-size: 18px; }
.selector-card span { display: block; margin-top: 7px; color: var(--muted); font-size: 13px; line-height: 1.4; }

.kpi-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpi-grid.six-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.kpi { min-height: 116px; padding: 16px; display: grid; align-content: space-between; }
.kpi small { color: var(--muted); font-size: 11px; font-weight: 850; text-transform: uppercase; }
.kpi strong { display: block; margin-top: 6px; color: var(--navy); font-size: 26px; line-height: 1; overflow-wrap: anywhere; }
.kpi span { color: #506170; font-size: 12px; }
.kpi.accent-blue { border-top: 4px solid #2f6bba; }
.kpi.accent-gold { border-top: 4px solid #bd7a16; }
.kpi.accent-green { border-top: 4px solid #2d8556; }
.kpi.accent-violet { border-top: 4px solid #6f54b3; }
.kpi.accent-red { border-top: 4px solid #c9574b; }
.kpi.accent-teal { border-top: 4px solid #16847b; }
.grid-2 { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.panel { min-width: 0; overflow: hidden; }
.panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 16px; border-bottom: 1px solid var(--line); background: #fbfdfc; }
.panel-head h3 { margin: 0; color: var(--navy); font-size: 18px; }
.panel-head p { margin: 5px 0 0; color: var(--muted); font-size: 12px; line-height: 1.4; }
.panel-body { padding: 16px; }

.bars { display: grid; gap: 12px; }
.bar-row { display: grid; grid-template-columns: minmax(130px, .8fr) minmax(130px, 1fr) 46px; gap: 12px; align-items: center; }
.bar-row strong { color: var(--navy); font-size: 13px; }
.bar-row span { display: block; margin-top: 3px; color: var(--muted); font-size: 12px; }
.bar-row b { color: var(--brand-strong); text-align: right; font-size: 13px; }
.bar { height: 11px; border-radius: 999px; background: #e8f0eb; overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--brand), #74c391); }

.chart { height: 260px; }
.chart svg { width: 100%; height: 100%; display: block; }
.chart-grid { stroke: #e1eae4; stroke-width: 1; }
.chart-area { fill: rgba(46, 125, 79, 0.14); }
.chart-line { fill: none; stroke: var(--brand); stroke-width: 4; stroke-linecap: round; }
.chart-points circle { fill: #ffffff; stroke: var(--brand); stroke-width: 3; }

.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: 11px 12px; border-bottom: 1px solid var(--line); text-align: left; font-size: 13px; }
.table th { color: var(--muted); font-size: 11px; text-transform: uppercase; }
.table td { color: #344452; }
.status { display: inline-flex; min-height: 24px; align-items: center; padding: 0 8px; border-radius: 999px; background: var(--brand-soft); color: var(--brand-strong); font-size: 11px; font-weight: 850; }
.status.warn { background: var(--amber-soft); color: var(--amber); }
.status.danger { background: var(--coral-soft); color: var(--coral); }

.idm-detail-panel { margin-bottom: 16px; }
.idm-detail-grid { display: grid; grid-template-columns: minmax(210px, .72fr) minmax(260px, 1fr) minmax(280px, 1.15fr); gap: 14px; align-items: stretch; }
.idm-radar-card, .idm-dimension-list, .ai-plan { border: 1px solid var(--line); border-radius: var(--radius); background: #ffffff; }
.idm-radar-card { padding: 16px; background: linear-gradient(135deg, #ffffff 0%, #f0ecff 100%); }
.idm-radar-card small { color: var(--muted); font-size: 11px; font-weight: 850; text-transform: uppercase; }
.idm-radar-card strong { display: block; margin-top: 8px; color: var(--navy); font-size: 44px; line-height: 1; }
.idm-radar-card span { display: block; margin-top: 10px; color: #506170; font-size: 13px; line-height: 1.4; }
.idm-scale { height: 12px; margin-top: 18px; border-radius: 999px; background: linear-gradient(90deg, var(--coral-soft), var(--amber-soft), var(--brand-soft)); overflow: hidden; }
.idm-scale i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--brand), #74c391); }
.idm-scale-labels { display: flex; justify-content: space-between; gap: 8px; margin-top: 7px; color: var(--muted); font-size: 11px; font-weight: 750; }
.idm-dimension-list { display: grid; gap: 11px; padding: 14px; align-content: center; }
.idm-dimension-list > div { display: grid; grid-template-columns: minmax(150px, .8fr) 48px minmax(130px, 1fr); gap: 10px; align-items: center; }
.idm-dimension-list span { color: var(--navy); font-size: 13px; font-weight: 800; }
.idm-dimension-list b { color: var(--brand-strong); font-size: 13px; text-align: right; }
.ai-plan { padding: 14px; background: #fbfdfc; }
.ai-plan-head { display: grid; grid-template-columns: 38px minmax(0, 1fr); gap: 10px; align-items: center; }
.ai-plan-head > b { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 8px; background: var(--navy); color: #ffffff; font-size: 12px; }
.ai-plan-head strong { display: block; color: var(--navy); font-size: 15px; }
.ai-plan-head span { display: block; margin-top: 3px; color: var(--muted); font-size: 12px; line-height: 1.35; }
.ai-plan ol { margin: 12px 0 0; padding-left: 22px; display: grid; gap: 8px; color: #344452; font-size: 13px; line-height: 1.4; }

.map-real { height: 420px; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: #eef4f0; }
.map-real iframe { width: 100%; height: 100%; border: 0; display: block; }
.map-note { margin: 10px 0 0; text-align: right; color: var(--muted); font-size: 12px; }
.map-note a { color: var(--brand-strong); font-weight: 850; }
.list { display: grid; gap: 10px; }
.list-item { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 10px; border: 1px solid var(--line); border-radius: 8px; background: #ffffff; }
.list-item b { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 8px; background: var(--brand-soft); color: var(--brand-strong); font-size: 12px; }
.list-item strong { display: block; color: var(--navy); font-size: 14px; }
.list-item span { display: block; margin-top: 3px; color: var(--muted); font-size: 12px; }

.anchor-panel { scroll-margin-top: 86px; }
.dashboard-section-row { margin-bottom: 16px; }

.executive-callout {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
  padding: 15px 17px;
  border: 1px solid rgba(46, 125, 79, .28);
  border-left: 5px solid var(--brand);
  border-radius: var(--radius);
  background: #eef7f1;
}
.executive-callout strong { display: block; color: var(--navy); font-size: 15px; }
.executive-callout span { display: block; margin-top: 4px; color: #435564; font-size: 12px; line-height: 1.45; }
.executive-callout a { flex: 0 0 auto; color: var(--brand-strong); font-size: 12px; font-weight: 850; }

.summary-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; margin-bottom: 14px; }
.summary-3 > div { padding: 11px; border: 1px solid var(--line); border-radius: var(--radius); background: #f7faf8; }
.summary-3 small { display: block; color: var(--muted); font-size: 10.5px; font-weight: 850; text-transform: uppercase; }
.summary-3 strong { display: block; margin-top: 5px; color: var(--navy); font-size: 17px; line-height: 1.05; overflow-wrap: anywhere; }
.summary-3 span { display: block; margin-top: 5px; color: #506170; font-size: 11px; }
.bars.compact { gap: 9px; }
.bars.compact .bar-row { grid-template-columns: minmax(120px, .8fr) minmax(100px, 1fr) 42px; }

.pbb-map-layout { display: grid; grid-template-columns: minmax(0, 1.16fr) minmax(250px, .84fr); gap: 16px; }
.pbb-map-canvas { position: relative; height: 316px; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: #edf6f0; }
.pbb-map-canvas iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; display: block; }
.pbb-map-canvas .pbb-map-marker { position: absolute; z-index: 1; min-width: 90px; padding: 7px 9px; border: 1px solid rgba(46, 125, 79, .48); border-radius: 7px; background: rgba(255, 255, 255, .95); box-shadow: 0 5px 14px rgba(20, 50, 74, .18); color: var(--navy); font-size: 11px; line-height: 1.3; text-align: center; }
.pbb-map-canvas .pbb-map-marker b { display: block; margin-top: 2px; color: var(--brand-strong); font-size: 13px; }
.pbb-map-canvas .pbb-map-marker.north { left: 13%; top: 17%; }
.pbb-map-canvas .pbb-map-marker.center { left: 46%; top: 42%; }
.pbb-map-canvas .pbb-map-marker.south { right: 11%; bottom: 16%; }
.pbb-map-canvas .pbb-map-marker.warn { border-color: rgba(183, 121, 31, .58); }
.pbb-map-canvas .pbb-map-marker.warn b { color: var(--amber); }
.pbb-map-summary { display: grid; align-content: start; gap: 10px; }
.pbb-map-summary > div { padding: 12px; border: 1px solid var(--line); border-radius: var(--radius); background: #f7faf8; }
.pbb-map-summary strong { display: block; color: var(--navy); font-size: 12px; }
.pbb-map-summary span { display: block; margin-top: 4px; color: #506170; font-size: 12px; line-height: 1.4; }
.pbb-map-summary > div:nth-child(1) strong { color: var(--brand-strong); }
.pbb-map-summary > div:nth-child(2) strong { color: var(--amber); }
.pbb-map-summary > div:nth-child(3) strong { color: var(--coral); }
.pbb-map-summary p { margin: 0; padding: 12px; border-left: 3px solid var(--brand); background: var(--brand-soft); color: #435564; font-size: 11px; line-height: 1.45; }

.project-table td strong { display: block; color: var(--navy); font-size: 13px; }
.project-table td > span:not(.status) { display: block; margin-top: 3px; color: var(--muted); font-size: 11px; }

.index-detail { display: grid; grid-template-columns: minmax(170px, .62fr) minmax(0, 1.38fr); gap: 12px; }
.index-number { padding: 15px; border: 1px solid var(--line); border-radius: var(--radius); background: linear-gradient(135deg, #ffffff, #f0ecff); }
.index-number small { color: var(--muted); font-size: 10.5px; font-weight: 850; text-transform: uppercase; }
.index-number strong { display: block; margin-top: 7px; color: var(--navy); font-size: 40px; line-height: 1; }
.index-number span { display: block; margin-top: 10px; color: #506170; font-size: 12px; line-height: 1.4; }

.absorption-total { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.absorption-total span { color: #506170; font-size: 12px; }
.absorption-total strong { color: var(--navy); font-size: 20px; }
.absorption-total b { color: var(--brand-strong); font-size: 18px; }
.absorption-bar { height: 16px; margin: 10px 0 15px; }
.absorption-stats { margin-bottom: 0; }

.population-detail { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(300px, .95fr); gap: 16px; }
.population-totals { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; }
.population-totals div { padding: 12px; border: 1px solid var(--line); border-radius: var(--radius); background: #f7faf8; }
.population-totals strong { display: block; color: var(--navy); font-size: 20px; }
.population-totals span { display: block; margin-top: 4px; color: var(--muted); font-size: 11px; }
.population-bars { display: grid; gap: 11px; align-content: center; }
.population-bars > div { display: grid; grid-template-columns: 110px minmax(120px, 1fr) 48px; gap: 10px; align-items: center; }
.population-bars span { color: var(--navy); font-size: 12px; font-weight: 800; }
.population-bars b { color: var(--brand-strong); font-size: 12px; text-align: right; }

.recommendation-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.other-dashboard-panel .panel-head { align-items: center; }
.other-dashboard-all { color: var(--brand-strong); font-size: 12px; font-weight: 850; }
.other-dashboard-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.other-dashboard-grid a { min-height: 98px; display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 10px; align-items: start; padding: 11px; border: 1px solid var(--line); border-radius: var(--radius); background: #f7faf8; }
.other-dashboard-grid a:hover { border-color: rgba(46, 125, 79, .48); background: #ffffff; }
.other-dashboard-grid b { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 7px; background: var(--brand-soft); color: var(--brand-strong); font-size: 10px; }
.other-dashboard-grid strong { display: block; color: var(--navy); font-size: 12px; }
.other-dashboard-grid span { display: block; margin-top: 4px; color: var(--muted); font-size: 11px; line-height: 1.35; }

@media (max-width: 1040px) {
  .demo-app { grid-template-columns: 1fr; }
  .sidebar { position: relative; height: auto; }
  .side-nav { max-height: none; overflow: visible; }
  .side-foot { position: static; margin-top: 18px; }
  .side-nav { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero-strip, .grid-2, .idm-detail-grid { grid-template-columns: 1fr; }
  .selector-grid, .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi-grid.six-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .population-detail, .index-detail, .pbb-map-layout { grid-template-columns: 1fr; }
  .recommendation-grid { grid-template-columns: 1fr; }
  .other-dashboard-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 720px) {
  .topbar { align-items: stretch; flex-direction: column; padding: 14px; }
  .top-actions { justify-content: flex-start; }
  .content { padding: 14px; }
  .side-nav, .selector-grid, .kpi-grid, .kpi-grid.six-kpis, .grid-3, .bar-row, .idm-dimension-list > div, .summary-3, .population-totals, .population-bars > div { grid-template-columns: 1fr; }
  .executive-callout { align-items: flex-start; flex-direction: column; }
  .selector-group-head { align-items: flex-start; flex-direction: column; }
  .other-dashboard-grid { grid-template-columns: 1fr; }
  .hero-card h2 { font-size: 24px; }
  .bar-row b, .idm-dimension-list b { text-align: left; }
  .table { min-width: 620px; }
  .table-wrap { overflow-x: auto; }
  .map-real { height: 340px; }
}
