:root {
  --bg: #f5f7f8;
  --panel: #ffffff;
  --ink: #1c2733;
  --muted: #5c6b7a;
  --line: #dde4e9;
  --accent: #0f5e73;
  --accent-ink: #ffffff;
  --peak: #b3402e;
  --standard: #c98a1c;
  --offpeak: #2e7d5b;
  --chip: #eef2f5;
}
* { box-sizing: border-box; }
body { margin: 0; font: 15px/1.5 "Roboto", system-ui, -apple-system, "Segoe UI", sans-serif; background: var(--bg); color: var(--ink); }

header { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap;
  padding: 14px 22px; background: var(--panel); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
header h1 { font-size: 19px; margin: 0; }
.sub { color: var(--muted); font-size: 12.5px; }
.header-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
#global-search { width: 320px; }

input[type=search], select { padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; font: inherit; background: #fff; }
button { font: inherit; border-radius: 8px; padding: 8px 14px; cursor: pointer; border: 1px solid var(--line); background: #fff; }
button.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
button.ghost { background: transparent; }
button:hover { filter: brightness(0.96); }
.badge { background: #b3402e; color: #fff; border-radius: 10px; padding: 0 7px; font-size: 11.5px; margin-left: 4px; }

main { display: grid; grid-template-columns: 330px 1fr; gap: 0; min-height: calc(100vh - 64px); }
aside { background: var(--panel); border-right: 1px solid var(--line); padding: 14px; overflow-y: auto; max-height: calc(100vh - 64px); position: sticky; top: 64px; }
.filters { display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }
.chk { font-size: 13px; color: var(--muted); display: flex; gap: 6px; align-items: center; }

#muni-list { list-style: none; margin: 0; padding: 0; }
#muni-list .prov { font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 12px 6px 4px; }
#muni-list li.muni { padding: 7px 8px; border-radius: 8px; cursor: pointer; display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
#muni-list li.muni:hover { background: var(--chip); }
#muni-list li.muni.active { background: var(--accent); color: #fff; }
#muni-list li.muni.active .cnt { color: #d6ecf2; }
#muni-list .cnt { font-size: 12px; color: var(--muted); white-space: nowrap; }
#muni-list .nm { overflow: hidden; text-overflow: ellipsis; }

#content { padding: 24px 30px; max-width: 1100px; }
#welcome h2 { margin-top: 4px; }
.disclaimer { background: #fdf3e7; border: 1px solid #f0d9b8; padding: 10px 14px; border-radius: 8px; font-size: 13.5px; }

.crumbs { font-size: 13px; color: var(--muted); margin-bottom: 10px; }
.crumbs a { color: var(--accent); cursor: pointer; text-decoration: none; }
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.page-head h2 { margin: 0 0 4px; }
.meta-chips { display: flex; gap: 6px; flex-wrap: wrap; margin: 6px 0 2px; }
.chip { background: var(--chip); border-radius: 20px; padding: 2px 11px; font-size: 12.5px; color: var(--ink); }
.chip.q-indicative { background: #fdf3e7; color: #8a5a12; }
.chip.q-verified { background: #e5f3ec; color: #1e5c41; }
.chip.q-pending { background: #eee; color: #666; }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; margin-top: 16px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 16px; cursor: pointer; transition: box-shadow .15s; }
.card:hover { box-shadow: 0 4px 14px rgba(20,40,60,.10); }
.card h3 { margin: 0 0 6px; font-size: 15.5px; }
.card .desc { color: var(--muted); font-size: 13px; margin-top: 8px; }

.section { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 18px 20px; margin-top: 18px; }
.section > h3 { margin: 0 0 10px; font-size: 16px; }
.note { color: var(--muted); font-size: 13px; }

table.rates { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.rates th { text-align: left; padding: 7px 9px; background: var(--chip); font-weight: 600; }
table.rates td { padding: 7px 9px; border-top: 1px solid var(--line); vertical-align: top; }
table.rates td.num { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.tag { display: inline-block; padding: 1px 8px; border-radius: 10px; font-size: 11.5px; background: var(--chip); }
.tag.peak { background: #f6e2dd; color: #7c2416; }
.tag.standard { background: #f7ecd6; color: #7a5410; }
.tag.off_peak { background: #dff0e8; color: #1e5c41; }
.tag.high { background: #e3ecf4; color: #274b6d; }
.tag.low { background: #eef2f5; color: #4a5a68; }

.rule { border-left: 3px solid var(--accent); padding: 8px 12px; margin: 10px 0; background: #f6fafb; border-radius: 0 8px 8px 0; }
.rule .rt { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.rule .ttl { font-weight: 600; }
.rule.holiday { border-left-color: var(--peak); background: #fdf6f4; }

.tou-grid { display: grid; gap: 4px; margin-top: 8px; }
.tou-row { display: grid; grid-template-columns: 90px 1fr; align-items: center; gap: 10px; }
.tou-row .lbl { font-size: 12.5px; color: var(--muted); text-align: right; }
.tou-bar { display: flex; height: 26px; border-radius: 6px; overflow: hidden; border: 1px solid var(--line); }
.tou-seg { height: 100%; }
.tou-seg.peak { background: var(--peak); }
.tou-seg.standard { background: var(--standard); }
.tou-seg.off_peak { background: var(--offpeak); }
.tou-hours { display: grid; grid-template-columns: 90px 1fr; gap: 10px; }
.tou-scale { display: flex; justify-content: space-between; font-size: 10.5px; color: var(--muted); padding: 2px 0 8px; }
.legend { display: flex; gap: 14px; font-size: 12.5px; margin: 8px 0 2px; flex-wrap: wrap; }
.legend .sw { display: inline-block; width: 13px; height: 13px; border-radius: 3px; vertical-align: -2px; margin-right: 5px; }
.season-title { font-weight: 600; margin: 14px 0 6px; font-size: 13.5px; }

dialog { border: 1px solid var(--line); border-radius: 12px; max-width: 760px; width: 92%; max-height: 84vh; overflow-y: auto; padding: 20px; }
dialog::backdrop { background: rgba(15,30,42,.45); }
table.plain { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.plain th { text-align: left; background: var(--chip); padding: 6px 9px; }
table.plain td { padding: 6px 9px; border-top: 1px solid var(--line); }

.doc { padding: 8px 0; border-top: 1px solid var(--line); font-size: 13.5px; display: flex; gap: 10px; justify-content: space-between; flex-wrap: wrap; }
.doc:first-child { border-top: 0; }
.doc .st-new { color: #b3402e; font-weight: 600; }
.doc .st-seeded { color: var(--muted); }

.results-list .card { cursor: pointer; margin-bottom: 10px; }
.empty { color: var(--muted); padding: 30px 0; text-align: center; }

@media (max-width: 900px) {
  main { grid-template-columns: 1fr; }
  aside { position: static; max-height: 300px; }
  #global-search { width: 100%; }
}

/* ------------------------------------------------ dashboard */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(185px, 1fr)); gap: 12px; margin: 14px 0 20px; }
.tile { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 14px; }
.tile.warn { border-color: #f0d9b8; background: #fdf3e7; }
.tile .big { font-size: 26px; font-weight: 700; line-height: 1.2; }
.tile .big .of { font-size: 14px; color: var(--muted); font-weight: 400; margin-left: 5px; }
.tile .lbl2 { color: var(--muted); font-size: 12.5px; margin-top: 3px; }
table.plain td.num { text-align: right; font-variant-numeric: tabular-nums; }
.bar { display: inline-block; width: 110px; height: 8px; background: var(--chip); border-radius: 4px; vertical-align: middle; margin-right: 7px; }
.bar-fill { height: 100%; background: #2e7d32; border-radius: 4px; }
.tag.warn { background: #fdecea; color: #b3402e; }
.out-row { cursor: pointer; padding-left: 6px; padding-right: 6px; }
.out-row:hover { background: var(--chip); }
