/* Betriebs-App — Shell.
   Schlicht und schnell: keine Animationen, keine Schatten, keine Verlaeufe.
   Dichte Darstellung ist erwuenscht. Ecken abgerundet, nie kantig.
   Aktionsknoepfe stehen beim Objekt, auf das sie wirken. */

:root {
  --mass: 1;
  --grundgroesse: 16px;
  --schrift: system-ui, "Segoe UI", sans-serif;

  --grund: #f3f5f6;
  --flaeche: #ffffff;
  --fuell: #e8ecee;
  --rahmen: #c5cdd2;
  --rahmen-stark: #8b959c;
  --text: #1a2125;
  --text-leise: #5a666e;
  --akzent: #1f5f8b;
  --akzent-flaeche: #e2ecf3;
  --warn: #8a4b12;
  --warn-flaeche: #f6ebdd;
  --gut: #1f6b45;

  --r-klein: 6px;
  --r-mittel: 10px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-darstellung="hell"]) {
    --grund: #12161a;
    --flaeche: #1a2126;
    --fuell: #242c33;
    --rahmen: #323b43;
    --rahmen-stark: #606c75;
    --text: #e4e9ec;
    --text-leise: #939ea7;
    --akzent: #74b2db;
    --akzent-flaeche: #1a2c39;
    --warn: #d9a44f;
    --warn-flaeche: #32261a;
    --gut: #6cc194;
  }
}

:root[data-darstellung="dunkel"] {
  --grund: #12161a;
  --flaeche: #1a2126;
  --fuell: #242c33;
  --rahmen: #323b43;
  --rahmen-stark: #606c75;
  --text: #e4e9ec;
  --text-leise: #939ea7;
  --akzent: #74b2db;
  --akzent-flaeche: #1a2c39;
  --warn: #d9a44f;
  --warn-flaeche: #32261a;
  --gut: #6cc194;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--grund);
  color: var(--text);
  font-family: var(--schrift);
  font-size: calc(var(--grundgroesse) * var(--mass));
  line-height: 1.5;
}

h1 { font-size: 1.5em; margin: 0 0 0.6em; text-wrap: balance; }
h2 { font-size: 1.1em; margin: 0 0 0.5em; }
p  { margin: 0 0 0.6em; }
a  { color: var(--akzent); }

.bahn { max-width: 1200px; margin-inline: auto; padding: 24px 16px 64px; }
.mitte { max-width: 42ch; margin-inline: auto; padding-top: 24px; }
.klein { font-size: 0.82em; color: var(--text-leise); }
.fest  { font-variant-numeric: tabular-nums; }

/* -------------------------------------------------------------- Kopf */

.umgebungsband {
  background: var(--warn-flaeche); color: var(--warn);
  padding: 6px 16px; font-size: 0.82em; text-align: center;
  border-bottom: 1px solid var(--rahmen);
}

.kopf {
  display: flex; flex-wrap: wrap; gap: 12px; align-items: center;
  padding: 10px 16px; background: var(--flaeche);
  border-bottom: 1px solid var(--rahmen);
}
.marke { font-weight: 600; text-decoration: none; color: var(--text); }
.kopfnav { display: flex; gap: 14px; flex-wrap: wrap; }
.kopfnav a { text-decoration: none; }
.kopfrechts { margin-left: auto; display: flex; gap: 10px; align-items: center; }

/* Das Kuerzel steht dauerhaft im Bild, nicht in einem Menue: Wer am geteilten
   Geraet steht und ein fremdes Kuerzel sieht, merkt es sofort. */
.kuerzel {
  font-weight: 600; font-variant-numeric: tabular-nums;
  background: var(--akzent-flaeche); color: var(--akzent);
  border-radius: var(--r-klein); padding: 4px 10px;
}

.zeitband {
  display: flex; gap: 12px; align-items: center; justify-content: center;
  background: var(--warn-flaeche); color: var(--warn);
  padding: 10px 16px; border-bottom: 1px solid var(--rahmen);
}

/* ------------------------------------------------------------ Flaechen */

.kasten {
  background: var(--flaeche); border: 1px solid var(--rahmen);
  border-radius: var(--r-mittel); padding: 16px; margin-bottom: 20px;
}
.kasten.code { border-color: var(--akzent); background: var(--akzent-flaeche); }
.codewert {
  font-family: "Cascadia Mono", Consolas, monospace;
  font-size: 1.6em; letter-spacing: 0.08em; margin: 8px 0;
  user-select: all;
}

.meldung, .hinweis {
  background: var(--akzent-flaeche); color: var(--akzent);
  border: 1px solid var(--akzent); border-radius: var(--r-mittel);
  padding: 10px 14px; margin-bottom: 16px;
}

.band {
  background: var(--flaeche); border: 1px solid var(--rahmen);
  border-left: 4px solid var(--rahmen-stark); border-radius: var(--r-mittel);
  padding: 10px 14px; margin-bottom: 12px;
}
.band-hinweis { border-left-color: var(--akzent); }
.band-warnung { border-left-color: var(--warn); background: var(--warn-flaeche); }

/* ------------------------------------------------------------ Kacheln */

.kacheln {
  display: grid; gap: 12px; margin-bottom: 28px;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
}
.kachel {
  display: flex; align-items: center; min-height: 72px;
  background: var(--flaeche); border: 1px solid var(--rahmen);
  border-radius: var(--r-mittel); padding: 16px;
  text-decoration: none; color: var(--text);
}
.kachel:hover { border-color: var(--akzent); }
.kachel .name { font-weight: 600; }
.kachel.verwaltung { background: var(--fuell); }

/* ----------------------------------------------------------- Formulare */

.formular { display: flex; flex-direction: column; gap: 6px; }
.formular label { font-size: 0.86em; color: var(--text-leise); margin-top: 8px; }
.formular.breit { max-width: 44ch; }

.reihe { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.reihe.eng { gap: 6px; align-items: center; }
.reihe span { display: flex; flex-direction: column; gap: 4px; }
.reihe label { font-size: 0.86em; color: var(--text-leise); }

input, select {
  font: inherit; color: var(--text); background: var(--flaeche);
  border: 1px solid var(--rahmen-stark); border-radius: var(--r-klein);
  padding: 9px 10px; min-height: 44px;
}
input:focus-visible, select:focus-visible, button:focus-visible, a:focus-visible {
  outline: 3px solid var(--akzent); outline-offset: 2px;
}

.knopf {
  font: inherit; font-weight: 500; cursor: pointer;
  min-height: 44px; padding: 8px 16px;
  background: var(--akzent); color: var(--grund);
  border: 1px solid var(--akzent); border-radius: var(--r-klein);
  text-decoration: none; display: inline-flex; align-items: center; justify-content: center;
}
.knopf.still { background: var(--flaeche); color: var(--text); border-color: var(--rahmen-stark); }
.knopf.gross { margin-top: 16px; width: 100%; }
.knopf.klein-knopf { min-height: 36px; padding: 5px 10px; font-size: 0.86em; }
.knopf[disabled] { opacity: 0.45; cursor: not-allowed; }

/* ------------------------------------------------------------ Tabellen */

.rolle { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 0.92em; }
th, td {
  text-align: left; padding: 8px 10px; vertical-align: top;
  border-bottom: 1px solid var(--rahmen);
}
th { font-size: 0.8em; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-leise); }
tbody tr:last-child td { border-bottom: 0; }

.aktionen, .gruppenwahl { display: flex; flex-wrap: wrap; gap: 6px; }

.marke {
  font: inherit; font-size: 0.82em; cursor: pointer;
  border: 1px solid var(--rahmen-stark); border-radius: 999px;
  padding: 5px 11px; min-height: 32px;
  background: var(--flaeche); color: var(--text-leise);
}
.marke.an { background: var(--akzent-flaeche); color: var(--akzent); border-color: var(--akzent); }
.marke.aus { border-style: dashed; }
.marke-aktiv { color: var(--gut); border-color: var(--gut); cursor: default; }
.marke-neu { color: var(--akzent); border-color: var(--akzent); cursor: default; }
.marke-gesperrt { color: var(--warn); border-color: var(--warn); cursor: default; }

.paare { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0; }
.paare dt { color: var(--text-leise); font-size: 0.86em; }
.paare dd { margin: 0; }

form { margin: 0; }
