/* Overview, station and alert tabs */

/* Overview: four counts */

.kpis { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 14px; }
.kpi {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.kpi:hover { box-shadow: var(--shadow-2); }
.kpi[aria-pressed="true"] { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand); }
.kpi-icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 36px; height: 36px;
  border-radius: 10px;
  background: color-mix(in srgb, var(--tone) 14%, var(--surface));
}
.kpi-icon i { width: 12px; height: 12px; border-radius: 50%; background: var(--tone); }
.kpi-icon i.ring { background: transparent; box-shadow: inset 0 0 0 3px var(--tone); width: 14px; height: 14px; }
.kpi-value { display: block; font-size: 22px; font-weight: 600; line-height: 1.15; font-variant-numeric: tabular-nums; }
.kpi-label { display: block; font-size: 12px; color: var(--text-2); }

.facts { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 12px; font-size: 12px; color: var(--muted); }
.facts b { color: var(--text-2); font-weight: 600; }

/* Station lists */

.list { list-style: none; margin: 0 -10px; padding: 0; }
.row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 2px 12px;
  width: 100%;
  padding: 10px;
  border: none;
  border-radius: var(--radius-sm);
  background: none;
  text-align: left;
  cursor: pointer;
}
.row:hover { background: var(--surface-2); }
.row > .dot { grid-row: 1 / span 2; }
.row-title { min-width: 0; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-sub { grid-column: 2; font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-value { grid-row: 1 / span 2; grid-column: 3; text-align: right; font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.row-value small { display: block; font-size: 11px; font-weight: 400; color: var(--muted); }

/* Station tab */

.back { margin-bottom: 12px; }
.station-title h2 { margin: 0; font-size: 20px; font-weight: 600; line-height: 1.3; }
.station-title p { margin: 2px 0 0; font-size: 13px; color: var(--muted); }
.station-title + .banner { margin-top: 14px; }

.kv { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px 16px; margin: 0; }
.kv div { min-width: 0; }
.kv dt { font-size: 12px; color: var(--muted); }
.kv dd { margin: 1px 0 0; font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; }
.kv dd small { font-size: 12px; font-weight: 400; color: var(--muted); margin-left: 3px; }
.kv dd .note { display: block; font-size: 11px; font-weight: 400; color: var(--muted); }
.kv .wide { grid-column: 1 / -1; }

.cam-list { list-style: none; margin: 0 -10px; padding: 0; }
.cam-list button {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 9px 10px;
  border: none;
  border-radius: var(--radius-sm);
  background: none;
  text-align: left;
  cursor: pointer;
}
.cam-list button:hover { background: var(--surface-2); }
.cam-thumb {
  display: grid;
  place-items: center;
  flex: none;
  width: 34px; height: 34px;
  border-radius: 9px;
  background: color-mix(in srgb, var(--cam) 14%, var(--surface));
  color: var(--cam);
}
.cam-thumb svg { width: 16px; height: 16px; }
.cam-name { display: block; font-weight: 500; }
.cam-src { display: block; font-size: 12px; color: var(--muted); }
.cam-list .dist { margin-left: auto; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }

.demo p { margin: 8px 0 0; }

/* Alerts tab */

.alerts-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.alerts-head label { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-2); cursor: pointer; }
.alert-time { font-size: 13px; font-weight: 500; color: var(--text-2); }

/* Water path */

.route-river { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; font-weight: 600; color: var(--brand-strong); }
.route-river svg { width: 18px; height: 18px; }
.route-river .link-btn { margin-left: auto; }
.route-sub { margin: 12px 0 2px; font-size: 12px; font-weight: 600; color: var(--muted); }

/* Canal mouths: a diamond, filled when a gate gauge measures both sides */

.mouth-mark {
  flex: none;
  width: 10px;
  height: 10px;
  margin: 0 3px;
  transform: rotate(45deg);
  border: 2px solid var(--brand-strong);
  border-radius: 2px;
  background: var(--surface);
}
.mouth-mark.gate { background: var(--brand-strong); }
.row > .mouth-mark { grid-row: 1 / span 2; }
.outlet + .outlet { margin-top: 4px; }
.outlet-next { margin: 0 0 0 20px; padding-left: 8px; border-left: 2px solid var(--border); }
p.outlet-next { padding: 4px 10px; }
.route-mouths { display: flex; align-items: baseline; gap: 10px; margin: 10px 0 0; font-size: 12px; color: var(--text-2); }
.route-mouths .mouth-mark { position: relative; top: 1px; }
