/* Ergänzungen zu Pico.css. Farben für Diagramme als Tokens, im Dark Mode eigene Stufen. */
:root {
  --viz-surface: #fcfcfb;
  --viz-ink: #0b0b0b;
  --viz-ink-2: #52514e;
  --viz-muted: #898781;
  --viz-grid: #e1e0d9;
  --viz-axis: #c3c2b7;
  --viz-series-1: #2a78d6;
  --status-good: #0ca30c;
  --status-warning: #fab219;
  --status-critical: #d03b3b;
  --heat-0: #eceae4;
  --heat-1: #cde2fb;
  --heat-2: #86b6ef;
  --heat-3: #3987e5;
  --heat-4: #1c5cab;
  --pico-font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --viz-surface: #1a1a19;
    --viz-ink: #ffffff;
    --viz-ink-2: #c3c2b7;
    --viz-grid: #2c2c2a;
    --viz-axis: #383835;
    --viz-series-1: #3987e5;
    --heat-0: #262624;
    --heat-1: #104281;
    --heat-2: #1c5cab;
    --heat-3: #3987e5;
    --heat-4: #86b6ef;
  }
}
:root[data-theme="dark"] {
  --viz-surface: #1a1a19;
  --viz-ink: #ffffff;
  --viz-ink-2: #c3c2b7;
  --viz-grid: #2c2c2a;
  --viz-axis: #383835;
  --viz-series-1: #3987e5;
  --heat-0: #262624;
  --heat-1: #104281;
  --heat-2: #1c5cab;
  --heat-3: #3987e5;
  --heat-4: #86b6ef;
}

html { font-size: 93.75%; }
body { background: var(--pico-background-color); }
main.container { padding-top: 1rem; padding-bottom: 3rem; }
h1 { font-size: 1.6rem; margin-bottom: .75rem; }
h2 { font-size: 1.2rem; margin-bottom: .5rem; }
h3 { font-size: 1.05rem; margin-bottom: .4rem; }
article { margin-bottom: 1.25rem; padding: 1rem 1.25rem; }
article > header { margin: -1rem -1.25rem 1rem; padding: .75rem 1.25rem; }
.muted { color: var(--pico-muted-color); }
.small { font-size: .85rem; }
.num { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.nowrap { white-space: nowrap; }
.stack > * + * { margin-top: .5rem; }
.row { display: flex; gap: .75rem; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.grow { flex: 1 1 auto; }
.mb0 { margin-bottom: 0; }

/* Navigation */
.topbar { border-bottom: 1px solid var(--pico-muted-border-color); background: var(--pico-card-background-color); }
.topbar nav { flex-wrap: wrap; padding: 0 16px; }
.topbar .brand { font-weight: 700; color: var(--pico-color); text-decoration: none; }
.topbar .mainnav { overflow-x: auto; flex-wrap: nowrap; max-width: 100%; }
.topbar .mainnav a { white-space: nowrap; }
.topbar a[aria-current="page"] { font-weight: 700; text-decoration: underline; text-underline-offset: .3em; }
.nav-timer { color: var(--status-critical) !important; font-variant-numeric: tabular-nums; font-weight: 600; }
.linklike { background: none; border: 0; padding: 0; margin: 0; color: var(--pico-primary); cursor: pointer; width: auto; font: inherit; }
.linklike.danger { color: var(--status-critical); }
form.inline { display: inline; margin: 0; }
form.inline button { margin: 0; }

/* Meldungen */
.flash { padding: .65rem 1rem; border-radius: var(--pico-border-radius); margin-bottom: .75rem; border-left: 4px solid; background: var(--pico-card-background-color); }
.flash.success { border-color: var(--status-good); }
.flash.warning { border-color: var(--status-warning); }
.flash.error { border-color: var(--status-critical); }
.flash::before { font-weight: 700; margin-right: .4rem; }
.flash.success::before { content: "✓"; }
.flash.warning::before { content: "!"; }
.flash.error::before { content: "✕"; }

/* Timer */
.timer-card { border-left: 4px solid var(--viz-series-1); }
.timer-card.running { border-left-color: var(--status-critical); }
.timer-display { font-size: 2.6rem; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.1; }
.timer-grid { display: grid; grid-template-columns: 2fr 2fr 3fr auto; gap: .75rem; align-items: end; }
.timer-grid > * { margin-bottom: 0; }
.timer-grid button { margin-bottom: 0; white-space: nowrap; }
.chips { display: flex; flex-wrap: wrap; gap: .5rem; }
.chip { display: inline-flex; align-items: center; gap: .4rem; padding: .3rem .7rem; font-size: .85rem; width: auto; margin: 0;
  border-radius: 999px; border: 1px solid var(--pico-muted-border-color); background: var(--pico-card-background-color); color: var(--pico-color); }
.chip:hover { border-color: var(--pico-primary); }
.dot { display: inline-block; width: .65rem; height: .65rem; border-radius: 50%; flex: none; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: .75rem; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 0 .75rem; }

/* Einträge */
.day-head { display: flex; justify-content: space-between; border-bottom: 1px solid var(--pico-muted-border-color); padding: .4rem 0; margin-top: .75rem; font-weight: 600; }
.entry { display: grid; grid-template-columns: auto 1fr auto auto; gap: .6rem; align-items: center; padding: .45rem 0; border-bottom: 1px dashed var(--pico-muted-border-color); }
.entry:last-child { border-bottom: 0; }
.entry .meta { font-size: .8rem; color: var(--pico-muted-color); }
table { font-size: .9rem; }
td, th { vertical-align: top; }
.table-wrap { overflow-x: auto; }

/* Kennzahlen */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: .75rem; margin-bottom: 1.25rem; }
.kpi { background: var(--pico-card-background-color); border-radius: var(--pico-border-radius); padding: .8rem 1rem; box-shadow: var(--pico-card-box-shadow); }
.kpi .label { font-size: .8rem; color: var(--pico-muted-color); }
.kpi .value { font-size: 1.6rem; font-weight: 700; line-height: 1.2; }
.kpi .sub { font-size: .8rem; color: var(--pico-muted-color); }
progress { margin-bottom: .2rem; height: .5rem; }

/* Statusanzeige: immer Symbol + Text, nie nur Farbe */
.status { display: inline-flex; align-items: center; gap: .35rem; font-size: .85rem; white-space: nowrap; }
.status::before { display: inline-grid; place-items: center; width: 1.1rem; height: 1.1rem; border-radius: 50%; font-size: .7rem; font-weight: 700; color: #fff; }
.status.good::before { content: "✓"; background: var(--status-good); }
.status.warning::before { content: "!"; background: var(--status-warning); color: #0b0b0b; }
.status.critical::before { content: "✕"; background: var(--status-critical); }

/* Kategorie-Balken (HTML statt Diagramm, mit Drill-down) */
.cat-list details { margin-bottom: .25rem; }
.cat-list summary { list-style: none; cursor: pointer; }
.cat-list summary::-webkit-details-marker { display: none; }
.cat-row { display: grid; grid-template-columns: minmax(120px, 1.3fr) 2fr 4.5rem 3rem; gap: .6rem; align-items: center; padding: .25rem 0; font-size: .9rem; }
.cat-row.sub { font-size: .82rem; color: var(--pico-muted-color); padding-left: 1rem; }
.bar-track { height: .6rem; border-radius: 4px; background: var(--heat-0); overflow: hidden; }
.bar-fill { height: 100%; border-radius: 0 4px 4px 0; }
.cat-list summary .name::before { content: "▸ "; color: var(--pico-muted-color); }
.cat-list details[open] summary .name::before { content: "▾ "; }

/* Diagramme */
.chart-box { position: relative; height: 280px; }
.chart-box.tall { height: 320px; }
.chart-controls { display: flex; gap: .5rem; align-items: center; }
.chart-controls select { margin: 0; width: auto; padding-top: .25rem; padding-bottom: .25rem; }

/* Heatmap */
.heatmap { display: grid; grid-template-columns: auto repeat(7, 1fr); gap: 3px; font-size: .7rem; max-width: 360px; }
.heatmap .lbl { color: var(--pico-muted-color); padding-right: .3rem; align-self: center; white-space: nowrap; }
.heatmap .cell { aspect-ratio: 1; border-radius: 3px; background: var(--heat-0); }
.heatmap .cell.l1 { background: var(--heat-1); }
.heatmap .cell.l2 { background: var(--heat-2); }
.heatmap .cell.l3 { background: var(--heat-3); }
.heatmap .cell.l4 { background: var(--heat-4); }
.heatmap .cell.future { opacity: .35; }
.heat-legend { display: flex; gap: 3px; align-items: center; font-size: .7rem; color: var(--pico-muted-color); margin-top: .4rem; }
.heat-legend .cell { width: .8rem; height: .8rem; border-radius: 2px; }

/* Backlog-Board */
.board { display: grid; grid-template-columns: repeat(4, minmax(220px, 1fr)); gap: .75rem; overflow-x: auto; }
.column { background: var(--pico-card-sectioning-background-color); border-radius: var(--pico-border-radius); padding: .6rem; min-height: 8rem; }
.column > h3 { display: flex; justify-content: space-between; font-size: .95rem; margin: .2rem .2rem .6rem; }
.card { background: var(--pico-card-background-color); border-radius: var(--pico-border-radius); padding: .6rem .7rem; margin-bottom: .5rem; box-shadow: var(--pico-card-box-shadow); font-size: .85rem; }
.card .title { font-weight: 600; display: block; margin: .15rem 0 .3rem; }
.card select { font-size: .8rem; padding: .2rem .5rem; margin: .3rem 0 0; height: auto; }
.badge { display: inline-block; font-size: .72rem; padding: .05rem .45rem; border-radius: 4px; border: 1px solid var(--pico-muted-border-color); white-space: nowrap; }
.badge.bug { border-color: var(--status-critical); }
.badge.feature { border-color: var(--viz-series-1); }
.badge.prio-kritisch, .badge.prio-hoch { font-weight: 700; }
.over { color: var(--status-critical); font-weight: 600; }

/* Login & Codes */
.auth-box { max-width: 420px; margin: 3rem auto; }
.qr { display: block; margin: .5rem auto 1rem; background: #fff; padding: 6px; border-radius: 8px; max-width: 220px; }
.secret { font-family: ui-monospace, monospace; letter-spacing: .05em; word-break: break-all; }
.codes { display: grid; grid-template-columns: repeat(2, 1fr); gap: .3rem 1rem; font-family: ui-monospace, monospace; font-size: 1.05rem; padding: 1rem; }
.copy-field { display: flex; gap: .5rem; }
.copy-field input { margin: 0; font-family: ui-monospace, monospace; font-size: .8rem; }
.copy-field button { margin: 0; width: auto; }

@media (max-width: 900px) {
  .timer-grid { grid-template-columns: 1fr 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .timer-grid, .grid-3 { grid-template-columns: 1fr; }
  .timer-display { font-size: 2rem; }
  .entry { grid-template-columns: auto 1fr auto; }
  .entry .actions { grid-column: 2 / -1; }
  .cat-row { grid-template-columns: 1fr 1fr 4rem; }
  .cat-row .pct { display: none; }
  .board { grid-template-columns: repeat(4, 80vw); }
}
