: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; margin-top: 18px; }
.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-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(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.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; }
.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); }

.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; }

@media (max-width: 1040px) {
  .demo-app { grid-template-columns: 1fr; }
  .sidebar { position: relative; height: auto; }
  .side-foot { position: static; margin-top: 18px; }
  .side-nav { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero-strip, .grid-2 { grid-template-columns: 1fr; }
  .selector-grid, .kpi-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, .grid-3, .bar-row { grid-template-columns: 1fr; }
  .hero-card h2 { font-size: 24px; }
  .bar-row b { text-align: left; }
  .table { min-width: 620px; }
  .table-wrap { overflow-x: auto; }
  .map-real { height: 340px; }
}
