/* Studio Control — Lizenz- und Update-Server, Verwaltung.
   Derselbe Hausstil wie das Bedienpult (studio_control/static/style.css):
   Farbe nur für Zustand, hell und dunkel als eine Liste über light-dark(),
   Staffel 21 / 17 / 15 / 13, Überschrift über der Karte. Keine Schrift
   mitgeliefert, kein Framework. */

:root {
  color-scheme: light dark;
  --bg:            light-dark(#FFFFFF, #0B0B0C);
  --surface:       light-dark(#FAFAFA, #141416);
  --border:        light-dark(#DADADA, #33333A);
  --border-strong: light-dark(#B4B4B4, #4E4E58);
  --fg:            light-dark(#0A0A0A, #F2F2F3);
  --fg-secondary:  light-dark(#666666, #A1A1A6);
  --fg-muted:      light-dark(#767676, #85858A);
  --live:          light-dark(#C8102E, #FF453A);
  --ready:         light-dark(#0B7A3B, #30D158);
  --prep:          light-dark(#E09B00, #FFD60A);
  --radius:    10px;
  --radius-sm: 7px;
  --ziel: 44px;
  --grotesk: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, monospace;
}
:root[data-thema="hell"]   { color-scheme: light; }
:root[data-thema="dunkel"] { color-scheme: dark; }

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 15px/1.5 var(--grotesk);
  min-height: 100vh;
}
a { color: inherit; }
code, .mono { font-family: var(--mono); font-size: 13px; }
pre.mono { white-space: pre-wrap; word-break: break-all; margin: 8px 0; padding: 10px 12px;
  border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg); }

/* Leiste */
.leiste { border-bottom: 1px solid var(--border-strong); background: var(--surface); }
.leiste-innen { max-width: 1100px; margin: 0 auto; padding: 0 20px; height: 48px;
  display: flex; align-items: center; gap: 24px; }
.marke { font-weight: 600; text-decoration: none; white-space: nowrap; }
.leise { color: var(--fg-secondary); font-weight: 400; }
.seiten { display: flex; gap: 4px; flex: 1; }
.seiten a { text-decoration: none; padding: 6px 10px; border-radius: var(--radius-sm); color: var(--fg-secondary); }
.seiten a[aria-current="page"] { color: var(--fg); background: var(--bg); border: 1px solid var(--border); }
.rechts { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.thema { border: 0; background: none; color: var(--fg-secondary); font-size: 18px; cursor: pointer;
  width: 32px; height: 32px; border-radius: var(--radius-sm); }
.thema:hover { color: var(--fg); }

/* Inhalt */
.inhalt { max-width: 1100px; margin: 0 auto; padding: 24px 20px 60px; }
.titel { font-size: 21px; font-weight: 600; margin: 0 0 20px; }
.gruppe-titel { font-size: 17px; font-weight: 600; margin: 40px 0 10px; }
.titel + .gruppe-titel, .kacheln + .gruppe-titel { margin-top: 28px; }
.titel + .zwei-spalten .gruppe-titel { margin-top: 0; }
.karte { background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius);
  padding: 16px 18px; }
.karte.schmal { max-width: 420px; }
.karte p { margin: 0 0 8px; }
.karte p:last-child { margin-bottom: 0; }
.hinweis { color: var(--fg-secondary); font-size: 13px; }
.warn { color: var(--live); }
.gross { font-size: 21px; font-weight: 600; margin: 0 0 4px; }
.zurueck { margin: 0 0 8px; font-size: 13px; }
.zurueck a { color: var(--fg-secondary); text-decoration: none; }

.meldung { margin: 0 0 28px; padding: 10px 14px; border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong); background: var(--surface); }
.meldung.ok { border-color: var(--ready); }
.meldung.fehler { border-color: var(--live); }

/* Punkte: Zustand hat immer ein Wort daneben */
.punkt { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 7px;
  vertical-align: 0; background: var(--fg-muted); }
.punkt.ready { background: var(--ready); }
.punkt.live { background: var(--live); }
.punkt.prep { background: var(--prep); }
.punkt.aus { background: var(--fg-muted); }

/* Kacheln der Übersicht */
.kacheln { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 0 20px; }
.kacheln .gruppe-titel { margin-top: 0; }
.zahlen, .paare { margin: 0; display: grid; gap: 6px 0; }
.zahlen div, .paare div { display: flex; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--border); padding: 4px 0; }
.zahlen div:last-child, .paare div:last-child { border-bottom: 0; }
.zahlen dt, .paare dt { color: var(--fg-secondary); margin: 0; }
.zahlen dd, .paare dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; }
.paare dd { font-weight: 400; text-align: right; word-break: break-all; }

/* Tabellen */
.tabelle { overflow-x: auto; border: 1px solid var(--border-strong); border-radius: var(--radius); background: var(--surface); }
.liste { border-collapse: collapse; width: 100%; }
.liste th, .liste td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; white-space: nowrap; }
.liste th { font-size: 13px; font-weight: 600; color: var(--fg-secondary); }
.liste tbody tr:last-child td { border-bottom: 0; }
.liste td form { display: inline; }
.knoepfe-zelle { text-align: right; }
.knoepfe-zelle form + form { margin-left: 6px; }

/* Formulare */
.feld { display: grid; grid-template-columns: 150px 1fr; gap: 8px 12px; align-items: center; margin-bottom: 18px; }
.feld > span:first-child { color: var(--fg-secondary); font-size: 13px; }
.feld.schalter > span:last-child { display: flex; align-items: center; gap: 8px; }
input:not([type="checkbox"]), select, textarea {
  font: inherit; color: var(--fg); background: var(--bg);
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm); padding: 8px 10px; width: 100%; min-height: 38px; }
textarea { font-family: var(--mono); font-size: 13px; resize: vertical; }
input.mono { font-family: var(--mono); font-size: 13px; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--fg-secondary); outline-offset: 1px; }
.knoepfe { display: flex; gap: 10px; align-items: center; margin-top: 14px; flex-wrap: wrap; }
.karte .knoepfe { margin-top: 14px; }
button, .knopf-link {
  font: inherit; font-weight: 500; color: var(--fg); background: var(--bg);
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  padding: 8px 14px; min-height: 38px; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; }
button:hover, .knopf-link:hover { border-color: var(--fg-secondary); }
button.klein { min-height: 30px; padding: 3px 10px; font-size: 13px; }
button.leise-knopf { border-color: transparent; color: var(--fg-secondary); background: none; }
button.leise-knopf:hover { color: var(--fg); border-color: var(--border-strong); }
button[data-zweimal-scharf] { border-color: var(--live); color: var(--live); }
.suche { display: flex; gap: 8px; margin-bottom: 18px; flex-wrap: wrap; }
.suche input, .suche select { width: auto; flex: 1; min-width: 160px; }
.zwei-spalten { display: grid; grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)); gap: 0 24px; }
.klapper { margin-top: 12px; }
.klapper summary { cursor: pointer; color: var(--fg-secondary); font-size: 13px; }
.klapper textarea { margin-top: 8px; }

@media (max-width: 700px) {
  .leiste-innen { height: auto; flex-wrap: wrap; padding: 8px 14px; gap: 8px 16px; }
  .seiten { order: 3; flex-basis: 100%; overflow-x: auto; }
  .inhalt { padding: 18px 14px 40px; }
  .feld { grid-template-columns: 1fr; gap: 4px; }
}
