:root {
  --bg: #f3f4f1; --card: #ffffff; --ink: #14212b; --muted: #5d6b76; --line: #e2e5e0;
  --accent: #0f6e8c; --accent-soft: #d7ebf1; --warm: #e0652b;
  --side: #10222d; --side-ink: #c5d3dc; --radius: 12px;
  font-family: "Inter", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font-size: 15px; line-height: 1.45; }
h1 { font-size: 28px; margin: 0 0 4px; letter-spacing: -0.02em; }
h3 { font-size: 14px; margin: 0; font-weight: 650; }
.lead { color: var(--muted); margin: 0 0 20px; max-width: 70ch; }
.shell { display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; }
.side { background: var(--side); color: var(--side-ink); padding: 18px 12px; display: flex; flex-direction: column; gap: 4px; position: sticky; top: 0; height: 100vh; }
.brand { display: flex; gap: 10px; align-items: center; padding: 4px 10px 18px; color: #fff; }
.brand small { display: block; color: var(--side-ink); font-size: 12px; opacity: .8; }
.logo { width: 34px; height: 34px; border-radius: 9px; background: var(--warm); color: #fff; display: grid; place-items: center; font-weight: 800; }
.side a, .bell { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 9px; color: var(--side-ink); text-decoration: none; font-weight: 500; background: none; border: 0; font: inherit; cursor: pointer; width: 100%; text-align: left; }
.side a:hover, .bell:hover { background: rgba(255,255,255,.07); color: #fff; }
.side a.active { background: var(--accent); color: #fff; }
.ico { width: 20px; height: 20px; flex: none; }
.side-foot { margin-top: auto; display: grid; gap: 8px; }
.live { font-size: 12px; padding: 0 12px; opacity: .85; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #8a9aa5; margin-right: 6px; }
.dot.on { background: #4cc38a; }
.badge { margin-left: auto; background: var(--warm); color: #fff; border-radius: 10px; padding: 0 7px; font-size: 12px; }
.main { padding: 28px 32px 48px; min-width: 0; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; }
.card > header { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 12px; }
.card > header span { color: var(--muted); font-size: 12px; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.kpi-label { color: var(--muted); font-size: 12.5px; }
.kpi-value { font-size: 30px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.2; }
.kpi-hint { color: var(--muted); font-size: 12px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); gap: 14px; }
.bars { display: grid; gap: 7px; }
.bar-row { display: grid; grid-template-columns: minmax(90px, 38%) 1fr auto; gap: 10px; align-items: center; font-size: 13px; }
.bar-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink); }
.bar-track { background: #eef1ee; border-radius: 5px; height: 14px; overflow: hidden; }
.bar-fill { background: var(--accent); height: 100%; border-radius: 5px; min-width: 2px; transition: width .4s ease; }
.bar-val { font-variant-numeric: tabular-nums; font-weight: 600; min-width: 3.5em; text-align: right; }
.state { color: var(--muted); padding: 14px 0; font-size: 13px; }
.alert { background: #fdeee7; border: 1px solid #f3c3ad; color: #7a2d0c; padding: 10px 14px; border-radius: 9px; margin-bottom: 14px; font-size: 13px; }
.note { background: #fff7e0; border: 1px solid #ecd48a; color: #5c4600; padding: 8px 14px; border-radius: 9px; margin-bottom: 14px; font-size: 13px; }
.input { width: 100%; padding: 9px 12px; border: 1px solid #cfd5d0; border-radius: 9px; font: inherit; background: #fff; color: var(--ink); }
.input:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }
.btn { padding: 7px 12px; border: 1px solid #cfd5d0; background: #fff; border-radius: 9px; font: inherit; cursor: pointer; color: var(--ink); }
.btn:hover { border-color: var(--accent); }
.btn.on { background: var(--accent); color: #fff; border-color: var(--accent); }
.suggest { position: relative; }
.suggest-list { position: absolute; z-index: 20; left: 0; right: 0; top: calc(100% + 4px); margin: 0; padding: 4px; list-style: none; background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 8px 24px rgba(16,34,45,.14); max-height: 300px; overflow: auto; }
.suggest-list li { display: flex; justify-content: space-between; gap: 10px; padding: 7px 10px; border-radius: 7px; cursor: pointer; }
.suggest-list li:hover, .suggest-list li.active { background: var(--accent-soft); }
.suggest-list li em { font-style: normal; color: var(--muted); font-variant-numeric: tabular-nums; }
.suggest-list li.none { color: var(--muted); cursor: default; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.chip { background: var(--accent-soft); color: #0a4a5f; border-radius: 14px; padding: 3px 4px 3px 10px; font-size: 12.5px; display: inline-flex; gap: 4px; align-items: center; }
.chip.area { background: #dbe6fb; color: #1b3f8f; }
.chip button, .x { border: 0; background: none; cursor: pointer; font-size: 16px; line-height: 1; color: inherit; padding: 0 6px; }
.rows { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 6px; }
.rows li { display: grid; gap: 1px; padding: 9px 11px; border: 1px solid var(--line); border-radius: 9px; position: relative; }
.rows li span { color: var(--muted); font-size: 12.5px; }
.sg .rows li { padding: 7px 10px; }
.sgs { grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); align-items: start; }
.branches { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(320px, 1fr); gap: 14px; align-items: start; }
.mapcard { padding: 10px; }
.maptools { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 2px 2px 10px; }
.hint { color: var(--warm); font-size: 13px; font-weight: 600; }
.map { height: 560px; border-radius: 9px; overflow: hidden; background: #dfe6e8; }
.facets { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 8px; }
.count { color: var(--muted); font-size: 13px; margin-top: 4px; }
.branch-rows { max-height: 430px; overflow: auto; }
.branch-rows li { cursor: pointer; }
.branch-rows li:hover { border-color: var(--accent); }
.dist { position: absolute; right: 10px; top: 9px; font-style: normal; font-weight: 700; color: var(--accent); font-variant-numeric: tabular-nums; }
.area-del { background: #1b3f8f; color: #fff; border: 2px solid #fff; border-radius: 14px; padding: 2px 10px; font: 600 12px/1.5 inherit; cursor: pointer; box-shadow: 0 2px 6px rgba(0,0,0,.25); }
.drawing .maplibregl-marker, .drawing .maplibregl-popup { pointer-events: none; }
.drawing .maplibregl-canvas-container { touch-action: none; }
.feed { position: fixed; left: 244px; bottom: 16px; width: 340px; max-height: 60vh; overflow: auto; z-index: 40; box-shadow: 0 12px 32px rgba(16,34,45,.22); }
.feed-item { padding: 8px 0; border-top: 1px solid var(--line); font-size: 13px; }
.feed-item small { color: var(--muted); margin-left: 6px; }
.chg { color: var(--muted); font-size: 12px; margin-top: 2px; word-break: break-word; }
.toasts { position: fixed; right: 18px; bottom: 18px; display: grid; gap: 8px; z-index: 50; width: min(360px, calc(100vw - 36px)); }
.toast { background: var(--side); color: #fff; padding: 10px 14px; border-radius: 10px; font-size: 13px; box-shadow: 0 8px 24px rgba(0,0,0,.25); animation: in .25s ease; }
.toast .chg { color: #b7c7d1; }
@keyframes in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: static; height: auto; flex-direction: row; flex-wrap: wrap; }
  .brand, .side-foot { width: 100%; }
  .side a span { display: none; }
  .branches { grid-template-columns: 1fr; }
  .main { padding: 18px 14px 40px; }
  .grid { grid-template-columns: 1fr; }
  .feed { left: 12px; }
}
