/* S51A (owner, 2 Nov 2026): the Overview tab, a live dashboard after Schedule.
   The late, Unverified and punch counts are drawn by tardies.js, unverified.js and punches.js as they always were;
   here they become rings, like a status board: a coloured ring and its number, the label under it, a green tick at zero. */

.ovw{display:grid;gap:14px;padding-bottom:24px}
.ov-dot{width:8px;height:8px;border-radius:50%;background:var(--good);box-shadow:0 0 0 4px var(--good-soft)}

.ov-card{background:var(--panel);border:1px solid var(--line);border-radius:14px;padding:14px 16px 16px}
.ov-card h3{display:flex;align-items:center;gap:8px;margin:0 0 12px;font-size:14px;font-weight:700;letter-spacing:.01em}
.ov-card h3 .i{width:17px;height:17px;color:var(--fog)}
.ov-card h3 small{margin-left:auto;color:var(--fog);font-size:12.5px;font-weight:600}

/* The rings. */
.ov-rings{display:grid;grid-template-columns:repeat(auto-fit,minmax(96px,1fr));gap:10px;margin:0}
.ov-rings[hidden]{display:none}
.ov-sub{display:contents}
.ov-sub[hidden]{display:none}
.ovw .tz-pill,.ovw .unv-pill,.ovw .pt-pill{display:grid;grid-template-rows:62px auto;justify-items:center;align-content:start;gap:8px;
  min-height:0;width:100%;padding:12px 8px;border-radius:12px;border:1px solid var(--line);background:var(--bg-2);color:var(--white);
  font:inherit;text-align:center;cursor:pointer;flex:none}
.ovw div.tz-pill,.ovw div.unv-pill{cursor:default}
.ovw .tz-pill>.i,.ovw .unv-pill>.i,.ovw .pt-pill>.i{display:none}
.ovw .tz-pill b,.ovw .unv-pill b,.ovw .pt-pill b{grid-row:1;display:grid;place-items:center;width:62px;height:62px;border-radius:50%;
  border:4px solid var(--line-2);font-size:22px;font-weight:800;font-variant-numeric:tabular-nums;color:var(--white)}
.ovw .tz-pill span,.ovw .unv-pill span,.ovw .pt-pill span{grid-row:2;font-size:12.5px;font-weight:600;color:var(--fog);line-height:1.3}
.ovw .tz-pill:not(.zero):hover,.ovw .unv-pill:not(.zero):hover,.ovw .pt-pill:hover{border-color:var(--line-2)}

/* Colours: red needs a person now, amber needs a look, green is fine. */
.ovw .tz-pill.late b,.ovw .tz-pill.noshow b,.ovw .pt-pill.red b{border-color:var(--accent);color:var(--bad-text)}
.ovw .tz-pill.call b,.ovw .tz-pill.unplaced b,.ovw .unv-pill b,.ovw .pt-pill.amber b{border-color:var(--amber);color:var(--amber)}
.ovw .tz-pill.in b{border-color:var(--good);color:var(--good)}
.ovw .tz-pill.missed b{border-color:var(--steel);color:var(--fog)}

/* Zero: a green ring with a tick instead of a number. */
.ovw .zero>.i,.ovw .pt-pill.ok>.i{display:block;grid-row:1;grid-column:1;width:62px;height:62px;padding:15px;border-radius:50%;
  border:4px solid var(--good);color:var(--good);stroke-width:2.6}
.ovw .zero b,.ovw .pt-pill.ok b{display:none}
/* Hours check: a calendar in a plain ring. */
.ovw #pt-open-hours>.i{display:block;grid-row:1;width:62px;height:62px;padding:16px;border-radius:50%;border:4px solid var(--line-2);color:var(--fog)}
.ovw #pt-open-hours span{color:var(--white)}

/* This week: the same numbers as before, now a door to the Schedule. */
.ovw .tiles#summary{margin:0}

/* Needs a guard in the next 48 hours. */
.ov-list{display:grid;gap:8px}
.ov-row{display:grid;grid-template-columns:64px 1fr auto;align-items:center;gap:12px;width:100%;padding:10px 12px;border-radius:12px;
  border:1px solid var(--line);border-left:3px solid var(--amber);background:var(--bg-2);color:var(--white);font:inherit;text-align:left;cursor:pointer}
.ov-row:hover{border-color:var(--line-2);border-left-color:var(--amber)}
.ov-when{display:grid;font-size:11.5px;font-weight:700;color:var(--fog);text-transform:uppercase;letter-spacing:.04em}
.ov-when b{font-size:15px;color:var(--white);text-transform:none;letter-spacing:0}
.ov-when.live{color:var(--bad-text)}
.ov-what{display:grid;min-width:0}
.ov-what b{font-size:14px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.ov-what small{color:var(--fog);font-size:12.5px}
.ov-tag{font-size:11px;font-weight:700;color:var(--amber);border:1px solid rgba(245,166,35,.5);background:var(--amber-soft);border-radius:999px;padding:3px 9px;white-space:nowrap}
.ov-clear{display:flex;align-items:center;gap:8px;color:var(--good);font-weight:600;font-size:14px}
.ov-clear .i{width:18px;height:18px}
.ov-more{margin:2px 0 0}

/* Schedule: which Overview number is filtering the board, with Show all. */
.ov-filter{display:flex;align-items:center;justify-content:space-between;gap:10px;margin:0 0 10px;padding:8px 12px;border-radius:10px;
  border:1px solid rgba(245,166,35,.45);background:var(--amber-soft);font-size:13.5px;font-weight:600}
.ov-filter[hidden]{display:none}


/* The hero: one sentence on how things stand, beside the week's coverage ring. Its colour follows the sentence. */
.ov-hero{position:relative;overflow:hidden;display:grid;grid-template-columns:auto 1fr;align-items:center;gap:22px;padding:20px 24px;border-radius:18px;
  border:1px solid var(--line);background:linear-gradient(120deg,var(--panel-2),var(--panel))}
.ov-hero{border-left-width:4px}
.ov-hero[data-state="bad"]{border-left-color:var(--accent)}
.ov-hero[data-state="warn"]{border-left-color:var(--amber)}
.ov-hero[data-state="good"]{border-left-color:var(--good)}
.ov-ring{position:relative;width:118px;height:118px;flex:none}
.ov-ring svg{width:100%;height:100%;transform:rotate(-90deg)}
.ov-ring circle{fill:none;stroke-width:10}
.ov-ring .trk{stroke:var(--line-2)}
.ov-ring .arc{stroke:var(--good);stroke-linecap:round;transition:stroke-dashoffset .9s cubic-bezier(.2,.7,.2,1)}
.ov-ring .arc[data-level="warn"]{stroke:var(--amber)}
.ov-ring .arc[data-level="bad"]{stroke:var(--accent)}
.ov-ring>div{position:absolute;inset:0;display:grid;place-content:center;text-align:center}
.ov-ring b{font-size:27px;font-weight:800;letter-spacing:-.03em;font-variant-numeric:tabular-nums}
.ov-ring small{color:var(--fog);font-size:11.5px;font-weight:600;margin-top:-2px}
.ov-verdict{position:relative;z-index:1;min-width:0}
.ov-live{display:inline-flex;align-items:center;gap:8px;margin:0;color:var(--fog);font-size:12px;font-weight:700;letter-spacing:.06em;text-transform:uppercase}
.ov-live span#ov-clock{text-transform:none;letter-spacing:0;font-weight:600}
.ov-verdict h2{margin:6px 0 4px;font-size:28px;line-height:1.15;letter-spacing:-.025em}
.ov-hero[data-state="bad"] h2{color:var(--bad-text)}
.ov-sub-line{margin:0;color:var(--fog);font-size:14.5px;line-height:1.45}

/* Two across: the rings, then the map beside what needs a guard (like a live status board). */
.ov-row2{display:grid;grid-template-columns:minmax(0,2fr) minmax(0,1fr);gap:14px;align-items:stretch}
.ov-live-row{grid-template-columns:minmax(0,1.5fr) minmax(0,1fr)}
.ov-soon .ov-list{max-height:330px;overflow:auto;padding-right:2px}

/* Today on the map. */
.ov-mapcard{display:flex;flex-direction:column}
.ov-map{flex:1;min-height:300px;border-radius:12px;overflow:hidden;border:1px solid var(--line);background:var(--bg-2);z-index:0}
.ov-map-note{display:grid;place-items:center;height:100%;min-height:300px;padding:20px;color:var(--fog);font-size:14px;text-align:center}
html:not([data-theme="light"]) .ov-map .leaflet-tile{filter:invert(1) hue-rotate(180deg) brightness(.85) contrast(.9) saturate(.6)}
.ov-map .leaflet-container{background:var(--bg-2);font:inherit}
.ov-legend{display:flex;flex-wrap:wrap;gap:6px 14px;margin:10px 0 0;color:var(--fog);font-size:12px}
.ov-legend span{display:inline-flex;align-items:center;gap:6px}
.ov-legend i{width:10px;height:10px;border-radius:50%}
.ov-legend i.ok{background:var(--good)}.ov-legend i.open{background:var(--amber)}.ov-legend i.risk{background:var(--accent)}.ov-legend i.none{background:var(--steel)}

@media(max-width:1000px){.ov-row2,.ov-live-row{grid-template-columns:minmax(0,1fr)}}
@media(max-width:640px){
  .ov-hero{grid-template-columns:1fr;justify-items:start;gap:14px;padding:18px}
  .ov-ring{width:96px;height:96px}
  .ov-ring b{font-size:22px}
  .ov-verdict h2{font-size:23px}
  .ov-map,.ov-map-note{min-height:240px}

  .ov-rings{grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}
  .ovw .tz-pill,.ovw .unv-pill,.ovw .pt-pill{grid-template-rows:52px auto;padding:10px 4px}
  .ovw .tz-pill b,.ovw .unv-pill b,.ovw .pt-pill b,.ovw .zero>.i,.ovw .pt-pill.ok>.i,.ovw #pt-open-hours>.i{width:52px;height:52px}
  .ovw .zero>.i,.ovw .pt-pill.ok>.i{padding:12px}
  .ovw #pt-open-hours>.i{padding:13px}
  .ovw .tz-pill b,.ovw .unv-pill b,.ovw .pt-pill b{font-size:19px}
  .ov-row{grid-template-columns:52px 1fr;}
  .ov-tag{display:none}
}
