/*
 * static/dashboard.css – die Startseite „Heute“ des Gastro Hubs.
 *
 * Diagrammregeln (dataviz-Methode): eine Akzentfarbe je Haut (var(--primary)), alles andere neutrales
 * Grau; Linien 2 px, Punkte ≥ 8 px mit Flächenring, Säulen ≤ 24 px mit runder Kappe; Raster als
 * Haarlinie, nie gestrichelt; Status nur mit Zeichen und Wort. Grautöne geprüft: hell #8f8e8a (3,3:1,
 * ΔE 15 zum Akzent), dunkel #898781 (4,5:1, ΔE 16); das Vorjahr liegt bewusst darunter und trägt
 * deshalb Beschriftung und Tabelle. Keine Kästchenwand: Abschnitte trennt Luft und eine Haarlinie.
 */
.db { --viz-grau: #8f8e8a; --viz-grau-2: #b5b4ad; --viz-raster: color-mix(in srgb, var(--text) 9%, transparent);
      --viz-achse: color-mix(in srgb, var(--text) 22%, transparent); --viz-wash: color-mix(in srgb, var(--primary) 10%, transparent);
      --st-gut: #0ca30c; --st-vorsicht: #fab219; --st-kritisch: #d03b3b;
      --woche-offen: color-mix(in srgb, var(--primary) 24%, transparent);
      --woche-teil: color-mix(in srgb, var(--primary) 9%, transparent);
      max-width: 1240px; }
html[data-theme="dark"] .db { --viz-grau: #898781; --viz-grau-2: #5c5b57; }

/* ── Kopf: eine Heldenzahl, daneben das Wetter ──────────────────────── */
.db-held { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 32px; align-items: end;
           padding: 4px 0 26px; border-bottom: 1px solid var(--border); }
.db-held-zahl { font-size: 76px; line-height: .95; font-weight: 650; letter-spacing: -.02em; color: var(--text); }
.db-held-wort { margin-top: 8px; color: var(--text-dim); font-size: 15px; }
.db-held-wort b { color: var(--text); font-weight: 600; }
.db-jetzt { display: flex; gap: 18px; align-items: flex-end; justify-content: flex-end; text-align: right; flex-wrap: wrap; }
.db-jetzt-temp { font-size: 52px; line-height: 1; font-weight: 600; }
.db-jetzt-text { color: var(--text-dim); font-size: 14px; line-height: 1.5; }
.db-jetzt-text b { color: var(--text); font-weight: 600; }

/* ── Status: Zeichen + Wort, nie Farbe allein ───────────────────────── */
.db-status { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; color: var(--text); white-space: nowrap; }
.db-status svg { width: 16px; height: 16px; flex-shrink: 0; }
.db-status[data-stufe="gut"] svg { color: var(--st-gut); }
.db-status[data-stufe="maessig"] svg { color: var(--st-vorsicht); }
.db-status[data-stufe="zu"] svg { color: var(--st-kritisch); }

/* ── Raster der Abschnitte ───────────────────────────────────────────── */
.db-reihe { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 40px; padding: 28px 0;
            border-bottom: 1px solid var(--border); }
.db-reihe.voll { grid-template-columns: minmax(0, 1fr); }
.db-reihe.halb { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
@media (max-width: 960px) { .db-held, .db-reihe, .db-reihe.halb { grid-template-columns: minmax(0, 1fr); gap: 22px; }
                             .db-jetzt { justify-content: flex-start; text-align: left; }
                             .db-held-zahl { font-size: 60px; } }

.db-fig { margin: 0; min-width: 0; }
.db-fig-kopf { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 4px; }
.db-fig h3 { margin: 0; font-size: 16px; font-weight: 650; }
.db-fig .db-unter { margin: 0 0 12px; color: var(--text-dim); font-size: 13px; }
.db-tab-knopf { min-height: 36px; padding: 0 10px; border: 0; background: none; color: var(--text-dim);
                font-size: 12.5px; cursor: pointer; text-decoration: underline; flex-shrink: 0; }
.db-tab-knopf:hover { color: var(--text); }
.db-svg { display: block; width: 100%; overflow: visible; }
.db-svg text { font-size: 11.5px; fill: var(--text-dim); font-variant-numeric: tabular-nums; }
.db-svg .db-ende { font-size: 12px; fill: var(--text); font-weight: 600; font-variant-numeric: normal; }
.db-svg .db-mark { cursor: default; outline: none; }
.db-svg .db-mark:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.db-legende { display: flex; gap: 16px; flex-wrap: wrap; margin: 0 0 8px; font-size: 12.5px; color: var(--text-dim); }
.db-legende span { display: inline-flex; align-items: center; gap: 6px; }
.db-legende i { display: inline-block; width: 16px; height: 2px; border-radius: 1px; }
.db-legende i.punkt { width: 9px; height: 9px; border-radius: 50%; }
.db-legende i.ring { width: 9px; height: 9px; border-radius: 50%; background: none !important; border: 2px solid var(--viz-grau); box-sizing: border-box; }
.db-legende i.flaeche { width: 14px; height: 14px; border-radius: 3px; box-shadow: inset 0 0 0 1px var(--viz-achse); }

/* Tabellenansicht – der barrierefreie Zwilling jedes Diagramms */
.db-tabelle { width: 100%; table-layout: fixed; border-collapse: collapse; margin-top: 10px; font-size: 13px; }
.db-tabelle th, .db-tabelle td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--border); }
.db-tabelle td.z, .db-tabelle th.z { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.db-tabelle th { color: var(--text-dim); font-weight: 600; }

/* Zahl und Wort nebeneinander, Haarlinien statt Kästen */
.db-liste { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--border); }
.db-liste li { display: grid; grid-template-columns: minmax(84px, auto) minmax(0, 1fr); gap: 14px; align-items: baseline;
               padding: 11px 0; border-bottom: 1px solid var(--border); }
.db-liste .wert { font-size: 22px; font-weight: 650; white-space: nowrap; }
.db-liste .wort { color: var(--text-dim); font-size: 13.5px; line-height: 1.4; }
.db-liste .wort b { color: var(--text); font-weight: 600; }

/* Meter für die Prüfpunkte: Spur in einer hellen Stufe des Akzents */
.db-meter { position: relative; height: 10px; margin: 8px 0 34px; border-radius: 5px;
            background: color-mix(in srgb, var(--primary) 14%, transparent); }
.db-meter i { position: absolute; top: -4px; width: 2px; height: 18px; background: var(--text); border-radius: 1px; }
.db-meter i.real { background: var(--text-dim); }
.db-meter em { position: absolute; top: 16px; transform: translateX(-50%); font-style: normal; font-size: 11.5px;
               color: var(--text-dim); white-space: nowrap; font-variant-numeric: tabular-nums; }

/* 7 Tage */
.db-tage { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--border); }
.db-tage li { display: grid; grid-template-columns: 74px 70px minmax(0, 1fr); gap: 10px; align-items: center;
              padding: 9px 0; border-bottom: 1px solid var(--border); font-size: 13.5px; }
.db-tage .tag { font-weight: 600; }
.db-tage .temp { font-variant-numeric: tabular-nums; }
.db-tage .temp small { color: var(--text-dim); }
.db-tage .rest { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 8px; align-items: center; min-width: 0; }
.db-tage .rest small { color: var(--text-dim); white-space: nowrap; }

/* Wochenraster der Mitbewerber */
.db-woche { width: 100%; table-layout: fixed; border-collapse: separate; border-spacing: 2px; font-size: 12px; }
.db-woche th { font-weight: 600; color: var(--text-dim); padding: 4px 2px; text-align: center; }
.db-woche th.name { text-align: left; width: 34%; }
.db-woche td { height: 26px; padding: 0 4px; text-align: center; border-radius: 4px; color: var(--text-dim);
               font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.db-woche td.name { text-align: left; color: var(--text); font-size: 12.5px; }
.db-woche td.name small { color: var(--text-dim); }
.db-woche td.offen { background: var(--woche-offen); color: var(--text); }
.db-woche td.teil { background: var(--woche-teil); color: var(--text-dim); }
.db-woche td.unbekannt { background: repeating-linear-gradient(45deg, transparent 0 4px, var(--viz-raster) 4px 5px); }
.db-woche tr.wir td.offen { background: var(--primary); color: var(--on-primary); font-weight: 600; }
.db-woche tr.summe td { color: var(--text); font-weight: 650; border-top: 1px solid var(--border); border-radius: 0; }
.db-woche tr.zu td.name { color: var(--text-dim); text-decoration: line-through; }
/* Schmal reicht der Platz nicht für Uhrzeiten: die Fläche trägt, Zeiten stehen im Titel und in der Tabelle */
@media (max-width: 640px) {
  .db-woche td .zeit { display: none; }
  .db-woche td.ausser .zeit { display: inline; font-size: 10px; }   /* offen, aber nur außerhalb unserer Zeit */
  .db-woche th.name { width: 42%; }
  .db-woche td.name { white-space: normal; line-height: 1.2; padding: 3px 4px; font-size: 12px; }
  .db-woche td.name small { display: none; }
}

/* Fahrplan */
.db-plan-zeile text.etappe { fill: var(--text); font-weight: 600; font-size: 12px; }

/* Tooltip: Wert vorn und kräftig, Name dahinter */
.db-tip { position: fixed; z-index: 90; pointer-events: none; min-width: 120px; max-width: 280px; padding: 8px 10px;
          background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: 8px;
          box-shadow: 0 8px 22px var(--shadow); font-size: 12.5px; line-height: 1.45; }
.db-tip .kopf { color: var(--text-dim); margin-bottom: 2px; }
.db-tip .zeile { display: flex; align-items: center; gap: 8px; }
.db-tip .zeile i { width: 12px; height: 2px; border-radius: 1px; flex-shrink: 0; }
.db-tip .zeile b { font-variant-numeric: tabular-nums; }
.db-tip .zeile span { color: var(--text-dim); }

.db-quelle { margin: 18px 0 0; font-size: 12px; color: var(--text-dim); }
.db-leer { color: var(--text-dim); font-size: 13.5px; padding: 8px 0; }

/* Betrieb des Hubs (nur Admin) – dieselbe Liste wie sonst im Hub, nur ohne Abstand nach unten */
.db .liste { margin-bottom: 0; }
.db .liste > li { font-size: 14px; padding: 10px 2px; }
