/* Admin console layout. Builds on base.css. */
.app { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh; }
.side { border-right: 1px solid var(--line); padding: 20px 16px; display: flex; flex-direction: column; gap: 4px; position: sticky; top: 0; height: 100vh; background: var(--surface); }
.s-brand { font-weight: 700; padding: 4px 12px 18px; display: flex; align-items: center; gap: 8px; font-size: 15px; }
.s-brand i { width: 12px; height: 12px; border-radius: 3px; background: var(--accent); display: inline-block; }
.nav-btn { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; border: 0; background: none; padding: 9px 12px; border-radius: 7px; cursor: pointer; color: var(--muted); font-size: 14px; text-decoration: none; }
.nav-btn svg { width: 16px; height: 16px; flex: none; }
.nav-btn:hover { background: var(--surface-2); color: var(--ink); }
.nav-btn[aria-selected="true"] { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.nav-btn .badge { margin-left: auto; font: 600 11px var(--f-mono); background: var(--late); color: var(--on-accent); border-radius: 99px; padding: 1px 7px; }
.side-sep { height: 1px; background: var(--line); margin: 10px 4px; }
.side-foot { margin-top: auto; font-size: 12px; color: var(--muted); padding: 12px; display: grid; gap: 6px; }
.side-foot .live { display: flex; align-items: center; gap: 6px; color: var(--ok); font-weight: 500; }
.side-foot .live i { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); display: block; animation: blink 2s infinite; }
.side-foot .live.off { color: var(--late); }
.side-foot .live.off i { background: var(--late); animation: none; }
.side-foot .me { color: var(--ink); font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@keyframes blink { 50% { opacity: .3; } }

.main { padding: 28px 32px 56px; min-width: 0; width: 100%; max-width: 1240px; margin: 0 auto; }
.pane { display: grid; gap: 20px; align-content: start; }
.m-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.m-head h3 { font-size: 22px; font-weight: 600; }
.m-head p { color: var(--muted); font-size: 13px; }
.m-tools { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* Live board. Chart colours are checked for colour-blind separation in both themes; text stays in ink tokens. */
:root { --viz-work: #2348C4; --viz-break: #9E5F0B; }
@media (prefers-color-scheme: dark) { :root { --viz-work: #4F6FE8; --viz-break: #B9812F; } }
.now { display: grid; grid-template-columns: minmax(260px, 1.1fr) minmax(0, 2fr); }
.now-main { padding: 18px 20px; display: grid; gap: 12px; align-content: center; border-right: 1px solid var(--line); }
.now-hero { display: flex; align-items: baseline; gap: 8px; }
.now-hero b { font: 600 52px/1 var(--f-sans); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.now-hero span { font-size: 15px; color: var(--muted); }
.now-bar { display: flex; gap: 2px; height: 12px; }
.now-bar i { display: block; min-width: 6px; border-radius: 3px; }
.now-bar .s-on, .now-legend .s-on { background: var(--ok); }
.now-bar .s-break, .now-legend .s-break { background: var(--warn); }
.now-bar .s-off, .now-legend .s-off { background: var(--idle); }
.now-bar .s-absent, .now-legend .s-absent { background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); }
.now-legend { display: flex; gap: 4px 16px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); }
.now-legend span { display: flex; align-items: center; gap: 6px; }
.now-legend i { width: 9px; height: 9px; border-radius: 2px; display: block; }
.now-legend b { font: 600 12.5px var(--f-mono); color: var(--ink); }
.now-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.stat { padding: 18px 16px; display: grid; gap: 2px; align-content: center; }
.stat + .stat { border-left: 1px solid var(--line); }
.stat .k { font-size: 12.5px; color: var(--muted); }
.stat .v { font: 600 26px/1.2 var(--f-sans); font-variant-numeric: tabular-nums; }
.stat .v small { font-size: 14px; color: var(--muted); font-weight: 500; }
.stat .s { font-size: 12px; color: var(--muted); }
.stat.alert .v { color: var(--late); }

.dash { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; align-items: start; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { border: 1px solid var(--line); background: var(--surface); border-radius: 99px; padding: 3px 10px; font-size: 12.5px; cursor: pointer; color: var(--muted); }
.chip b { font: 600 12px var(--f-mono); margin-left: 4px; color: var(--ink); }
.chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.chip[aria-pressed="true"] b { color: var(--bg); }
.tl-key { display: flex; align-items: center; gap: 6px; margin-top: 2px; }
.tl-key i { display: block; width: 14px; height: 6px; border-radius: 2px; margin-left: 8px; }
.tl-key i:first-child { margin-left: 0; }
.tl-key .k-work { background: var(--viz-work); }
.tl-key .k-break { background: var(--viz-break); }
.tl-key .k-shift { background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); height: 10px; }
.tl { padding: 4px 0 8px; --who: 168px; --sum: 84px; }
.tl-axis, .tl-row { display: grid; grid-template-columns: var(--who) minmax(0, 1fr) var(--sum); column-gap: 14px; padding: 0 16px; align-items: stretch; }
.tl-axis { height: 30px; }
.tl-ticks { position: relative; font: 500 11px var(--f-mono); color: var(--muted); }
.tl-ticks i { position: absolute; bottom: 4px; transform: translateX(-50%); font-style: normal; white-space: nowrap; }
.tl-ticks i.start { transform: none; }
.tl-ticks i.end { transform: translateX(-100%); }
.tl-ticks b { position: absolute; top: 0; transform: translateX(-50%); font: 600 11px var(--f-sans); color: var(--ink); background: var(--surface); padding: 0 4px; white-space: nowrap; z-index: 1; }
.tl-row { min-height: 52px; cursor: pointer; border-top: 1px solid var(--line); transition: background .15s; }
.tl-row:hover, .tl-row:focus-visible { background: var(--surface-2); }
.tl-row.flash { background: var(--accent-soft); }
.tl-who { display: flex; align-items: center; gap: 10px; min-width: 0; }
.tl-id { display: grid; min-width: 0; }
.tl-id .p-name, .tl-st { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tl-st { font-size: 12px; color: var(--muted); }
.tl-track { position: relative; background-image: linear-gradient(to right, var(--line) 1px, transparent 1px); background-size: calc(100% / var(--cols)) 100%; border-right: 1px solid var(--line); }
.tl-track > i, .tl-track > em { position: absolute; display: block; }
.tl-shift { top: 0; bottom: 0; background: var(--surface-2); opacity: .7; }
.tl-row:hover .tl-shift, .tl-row:focus-visible .tl-shift { background: var(--line); opacity: .45; }
.tl-seg { top: 50%; height: 14px; margin-top: -7px; border-radius: 4px; min-width: 3px; box-shadow: 0 0 0 1px var(--surface); }
.tl-seg.work { background: var(--viz-work); }
.tl-seg.break { background: var(--viz-break); }
.tl-seg.open { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.tl-in { top: 50%; width: 12px; height: 12px; margin: -6px 0 0 -6px; border-radius: 50%; background: var(--viz-work); box-shadow: 0 0 0 2px var(--surface); }
.tl-in.late { background: var(--late); }
.tl-now { top: 0; bottom: 0; width: 2px; margin-left: -1px; background: var(--ink); opacity: .55; pointer-events: none; }
.tl-none { top: 50%; transform: translateY(-50%); padding-left: 8px; font-style: normal; font-size: 12px; color: var(--muted); white-space: nowrap; }
.tl-sum { display: grid; align-content: center; justify-items: end; gap: 1px; }
.tl-sum b { font: 600 15px var(--f-mono); font-variant-numeric: tabular-nums; }
.tl-sum small { font-size: 11.5px; color: var(--muted); }
.tip { position: fixed; z-index: 70; pointer-events: none; background: var(--ink); color: var(--bg); font-size: 12.5px; padding: 5px 9px; border-radius: 6px; white-space: nowrap; box-shadow: var(--shadow); }
.av { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; font-weight: 600; background: var(--surface-2); color: var(--ink); grid-row: span 2; position: relative; flex: none; }
.av::after { content: ""; position: absolute; right: -1px; bottom: -1px; width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--surface); background: var(--idle); }
.av.s-on::after { background: var(--ok); }
.av.s-break::after { background: var(--warn); }
.av.s-absent::after { background: var(--late); }
.av.plain::after { display: none; }
.p-name { font-weight: 600; font-size: 14px; }

.side-col { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; align-items: start; }
.exc { list-style: none; margin: 0; padding: 0; }
.exc li { padding: 12px 16px; display: grid; gap: 6px; border-bottom: 1px solid var(--line); }
.exc li:last-child { border-bottom: 0; }
.exc .row { display: flex; align-items: center; gap: 8px; }
.exc .t { font-size: 13.5px; font-weight: 600; }
.exc .d { font-size: 12.5px; color: var(--muted); }
.exc .acts { display: flex; gap: 6px; flex-wrap: wrap; }
.feed { list-style: none; margin: 0; padding: 6px 0; max-height: 360px; overflow-y: auto; }
.ev { display: grid; grid-template-columns: 44px 10px 1fr; gap: 8px; align-items: baseline; padding: 7px 16px; font-size: 13px; }
.ev time { font: 500 12px var(--f-mono); color: var(--muted); }
.ev .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--idle); align-self: center; }
.ev .dot.t-in, .ev .dot.t-break_end { background: var(--ok); }
.ev .dot.t-break_start { background: var(--warn); }
.ev .src { grid-column: 3; font-size: 11.5px; color: var(--muted); margin-top: -2px; }
.ev em { font-style: normal; font-size: 12px; }
.ev.is-new { background: var(--accent-soft); animation: fade 3s ease-out forwards; }
@keyframes fade { to { background: transparent; } }

.ts-wrap { overflow-x: auto; }
table.ts { border-collapse: collapse; width: 100%; min-width: 900px; font-size: 13px; }
.ts th, .ts td { padding: 9px 12px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
.ts th { font-size: 12px; color: var(--muted); font-weight: 500; background: var(--surface-2); }
.ts th.today { color: var(--accent); }
.ts td.c { font: 12.5px/1.35 var(--f-mono); font-variant-numeric: tabular-nums; cursor: pointer; }
.ts td.c:hover { background: var(--surface-2); }
.ts td.c span { display: block; color: var(--muted); font-size: 11.5px; }
.ts td.c .late-in { color: var(--late); font-weight: 600; }
.ts td.c .miss { color: var(--warn); font-weight: 600; }
.ts td.c .ed { display: inline-block; font: 600 10px var(--f-sans); color: var(--accent); border: 1px solid currentColor; border-radius: 3px; padding: 0 3px; margin-left: 4px; vertical-align: 1px; cursor: help; }
.ts td.c.none { color: var(--muted); cursor: default; }
.ts td.tot, .ts th.tot { text-align: right; }
.ts td.tot { font: 600 13px var(--f-mono); }
.ts tr:last-child td { border-bottom: 0; }
.ts-legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12px; color: var(--muted); padding: 10px 16px; border-top: 1px solid var(--line); }
.ts-legend b { font-family: var(--f-mono); }

table.grid-t { border-collapse: collapse; width: 100%; min-width: 640px; font-size: 13.5px; }
.grid-t th, .grid-t td { padding: 11px 16px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
.grid-t th { font-size: 12px; color: var(--muted); font-weight: 500; background: var(--surface-2); }
.grid-t tr:last-child td { border-bottom: 0; }
.grid-t .who { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.grid-t .who .av { width: 30px; height: 30px; font-size: 12px; grid-row: auto; }
.grid-t td.m { font-family: var(--f-mono); color: var(--muted); }
.grid-t .ops { display: flex; gap: 6px; justify-content: flex-end; }
.grid-t tr.off td { color: var(--muted); }
.tbl-wrap { overflow-x: auto; }
.form { padding: 16px; display: grid; gap: 14px; }
.fields { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.set-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; }
.dev { display: flex; align-items: center; gap: 12px; padding: 14px 16px; font-size: 13.5px; flex-wrap: wrap; border-bottom: 1px solid var(--line); }
.dev:last-child { border-bottom: 0; }
.dev .mute { color: var(--muted); font-size: 12.5px; }
.dev .push { margin-left: auto; display: flex; gap: 6px; }
.audit { list-style: none; margin: 0; padding: 0; max-height: 420px; overflow-y: auto; }
.audit li { display: grid; grid-template-columns: 120px 1fr; gap: 12px; padding: 9px 16px; border-bottom: 1px solid var(--line); font-size: 13px; }
.audit li:last-child { border-bottom: 0; }
.audit time { font: 12px var(--f-mono); color: var(--muted); }
.audit .who { color: var(--muted); }

.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.stats > div { padding: 14px 16px; display: grid; gap: 2px; }
.stats > div + div { border-left: 1px solid var(--line); }
.stats .k { font-size: 12.5px; color: var(--muted); }
.stats .v { font: 600 24px var(--f-mono); }
.stats .s { font-size: 12px; color: var(--muted); }
.charts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.chart-body { padding: 12px 14px 14px; }
.chart-body svg { width: 100%; height: auto; display: block; }
.chart-note { font-size: 12px; color: var(--muted); padding: 0 16px 14px; }
svg .grid { stroke: var(--line); stroke-width: 1; }
svg .ax { fill: var(--muted); font: 11px var(--f-mono); }
svg .ax.late { fill: var(--late); }
svg .lbl { fill: var(--ink); font: 500 11.5px var(--f-sans); }
svg .lbl.late { fill: var(--late); }
svg .bar { fill: var(--accent); }
svg .bar.late { fill: var(--late); }
svg .ref { stroke: var(--muted); stroke-width: 1.2; }
svg .ref.late { stroke: var(--late); stroke-dasharray: 4 3; }
svg .line { fill: none; stroke: var(--accent); stroke-width: 2; }
svg .area { fill: var(--accent); opacity: .12; }
svg .pt { fill: var(--surface); stroke: var(--accent); stroke-width: 2; }
svg .pt.end { fill: var(--accent); }
svg .cell { fill: var(--accent); }
svg .cell-bg { fill: var(--surface-2); }
svg .cnt { font: 500 11px var(--f-mono); }
svg .cnt.hi { fill: var(--on-accent); }
svg .cnt.lo { fill: var(--ink); }

.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(440px, 100%); background: var(--surface); z-index: 41; box-shadow: var(--shadow); display: flex; flex-direction: column; }
.dr-h { display: flex; align-items: center; gap: 12px; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.dr-h .av { width: 44px; height: 44px; font-size: 15px; grid-row: auto; }
.dr-h h4 { font-size: 17px; }
.dr-h .sub { font-size: 12.5px; color: var(--muted); }
.dr-x { margin-left: auto; border: 0; background: var(--surface-2); border-radius: 7px; width: 32px; height: 32px; cursor: pointer; font-size: 16px; }
.dr-b { padding: 18px 20px; overflow-y: auto; display: grid; gap: 22px; align-content: start; }
.dr-b h5 { margin: 0 0 10px; font-size: 12px; color: var(--muted); font-weight: 500; letter-spacing: .04em; }
.tl { list-style: none; margin: 0; padding: 0; }
.tl li { display: grid; grid-template-columns: 52px 1fr auto; gap: 12px; align-items: baseline; padding: 8px 0; border-bottom: 1px dashed var(--line); font-size: 13.5px; }
.tl time { font: 600 13px var(--f-mono); }
.tl .src { font-size: 12px; color: var(--muted); }
.tl .src.edit { color: var(--accent); }
.tl li.voided time, .tl li.voided .what { text-decoration: line-through; color: var(--muted); }
.day-sel { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.mini { width: 100%; border-collapse: collapse; font-size: 13px; }
.mini td, .mini th { padding: 7px 0; border-bottom: 1px solid var(--line); text-align: left; }
.mini th { font-size: 12px; color: var(--muted); font-weight: 500; }
.mini td { font-family: var(--f-mono); font-size: 12.5px; }
.mini td:first-child { font-family: var(--f-sans); }
.addp { display: grid; gap: 10px; border: 1px solid var(--line); border-radius: 10px; padding: 14px; background: var(--surface-2); }
.addp .row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.void-form { display: flex; gap: 6px; grid-column: 1 / -1; }
.void-form input { flex: 1; border: 1px solid var(--line); border-radius: 7px; padding: 4px 8px; font-size: 13px; background: var(--surface); min-width: 0; }

.boot { display: grid; place-items: center; min-height: 100vh; color: var(--muted); }

@media (max-width: 1180px) {
  .fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .now { grid-template-columns: minmax(0, 1fr); }
  .now-main { border-right: 0; border-bottom: 1px solid var(--line); }
  .app { grid-template-columns: minmax(0, 1fr); }
  .side { position: sticky; top: 0; z-index: 10; height: auto; flex-direction: row; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--line); padding: 8px; gap: 2px; }
  .s-brand, .side-sep, .side-foot { display: none; }
  .nav-btn { width: auto; white-space: nowrap; }
  .charts { grid-template-columns: minmax(0, 1fr); }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats > div:nth-child(3) { border-left: 0; }
  .stats > div:nth-child(n+3) { border-top: 1px solid var(--line); }
  .main { padding: 18px 16px 40px; }
}
@media (max-width: 620px) {
  .side-col { grid-template-columns: minmax(0, 1fr); }
  .now-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat:nth-child(odd) { border-left: 0; }
  .stat:nth-child(n+3) { border-top: 1px solid var(--line); }
  .tl { --who: 104px; --sum: 56px; }
  .tl-who .av { display: none; }
  .fields { grid-template-columns: minmax(0, 1fr); }
  .audit li { grid-template-columns: minmax(0, 1fr); gap: 2px; }
}
