/* towet.dev – VPS Dashboard
   Farben nach DESIGN_towet.dev.md (Olibo-Grün, dunkle Slate-Flächen),
   Aufbau nach dem Mockup (große Kennzahlen, ruhige Tabellen, Rollen-Abzeichen). */

:root {
  --bg: #0E1822;
  --bg-deep: #0A131B;
  --surface: #1C2934;
  --surface-raised: #24333F;
  --border: #344652;
  --border-weich: rgba(52, 70, 82, 0.55);

  --text: #E8EDF2;
  --text-muted: #A8B6BF;
  --text-subtle: #81919D;

  --accent: #5C6437;
  --accent-hover: #737F48;
  --accent-bright: #909A62;
  --accent-soft: #283324;
  --on-accent: #FFFFFF;
  --nav-aktiv: #6A7441;          /* etwas heller als --accent, weißer Text bleibt gut lesbar */

  /* Olibo-Metallic (wie im Mockup). Der helle Glanz liegt rechts, wo kein
     Text steht – weißer Text sitzt immer auf dem dunklen Teil. */
  --metall-flaeche: linear-gradient(100deg, #56612E 0%, #646F37 50%, #8A9655 76%, #6F7B40 90%, #5F6A34 100%);
  --metall-flaeche-hover: linear-gradient(100deg, #5F6A34 0%, #6F7B40 50%, #97A361 76%, #7A8748 90%, #67733A 100%);
  /* Balken: Glanz von oben nach unten wie bei einem gebürsteten Metallstreifen */
  --metall-balken: linear-gradient(180deg, #B6C07D 0%, #95A15B 40%, #7A8644 75%, #8F9B56 100%);
  --metall-abzeichen: linear-gradient(135deg, #5E6934 0%, #7B8746 55%, #98A462 75%, #6C783D 100%);

  --success: #22C55E;
  --warning: #F2B84B;
  --danger: #EF5350;
  --inactive: #94A3B8;
  --chart-secondary: #B5C9D8;

  --font-body: Inter, "Segoe UI", Arial, Helvetica, sans-serif;
  --radius-card: 14px;
  --radius-control: 9px;
  --gap-card: 18px;
  --fokus: 0 0 0 2px var(--bg), 0 0 0 4px var(--accent-bright);
}

* { box-sizing: border-box; }
html { color-scheme: dark; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.5;
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent-bright); }
a:hover { color: #A9B37A; }

:focus-visible { outline: none; box-shadow: var(--fokus); border-radius: 6px; }

svg { flex: none; }

.sprung {
  position: absolute; left: 12px; top: -48px; z-index: 50;
  padding: 8px 12px; border-radius: var(--radius-control);
  background: var(--accent); color: var(--on-accent);
}
.sprung:focus { top: 12px; }

.abstand-oben { margin-top: 18px; }

.nur-vorlesen {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap;
}

/* --- Grundgerüst -------------------------------------------------------------- */

.app {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  min-height: 100vh;
}

.seitenleiste {
  background: var(--bg-deep);
  border-right: 1px solid var(--border-weich);
  padding: 28px 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 28px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.marke {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 2px;
}
.marke img { width: 80px; height: 80px; margin-bottom: 10px; }
.marke-name { font-size: 26px; font-weight: 700; letter-spacing: 0.005em; line-height: 1.2; }
.marke-zusatz { font-size: 16px; color: var(--text-muted); }

.menue { display: flex; flex-direction: column; gap: 4px; }
.menue-punkt {
  display: flex; align-items: center; gap: 14px;
  padding: 11px 16px;
  border-radius: 10px;
  color: var(--text);
  text-decoration: none;
  font-size: 16px;
  font-weight: 500;
}
.menue-punkt svg {
  width: 22px; height: 22px;
  fill: none; stroke: currentColor; stroke-width: 1.7;
  stroke-linecap: round; stroke-linejoin: round;
  color: var(--text-muted);
}
.menue-punkt:hover { background: var(--surface); color: var(--text); }
.menue-punkt[aria-current="page"] {
  background: var(--metall-flaeche);
  color: var(--on-accent);
  font-weight: 700;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.35);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14), inset 0 -1px 0 rgba(0, 0, 0, 0.25);
}
.menue-punkt[aria-current="page"] svg { color: var(--on-accent); }
.menue-punkt[aria-current="page"]:hover { background: var(--metall-flaeche-hover); }
.menue-trenner { border: 0; border-top: 1px solid var(--border); margin: 12px 16px; }

.serverstatus {
  margin-top: auto;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--border-weich);
  border-radius: 12px;
  display: flex; flex-direction: column; gap: 4px;
}
.serverstatus .status { font-weight: 700; font-size: 15px; }
.serverstatus .klein { color: var(--text-muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

main { padding: 26px 32px 40px; max-width: 1600px; width: 100%; }
main:focus { outline: none; }

/* --- Kopfbereich ---------------------------------------------------------------- */

.kopf {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 16px 24px; flex-wrap: wrap;
  margin-bottom: 20px;
}
.kopf h1 { margin: 0; font-size: 32px; font-weight: 700; line-height: 1.2; letter-spacing: -0.01em; }
.untertitel { margin: 4px 0 0; color: var(--text-muted); font-size: 15px; }

.kopf-meta { display: flex; align-items: center; gap: 18px; padding-top: 8px; font-size: 15px; }
.meta-eintrag { display: inline-flex; align-items: center; gap: 10px; white-space: nowrap; }
.meta-eintrag svg {
  width: 20px; height: 20px; fill: none; stroke: var(--text-muted);
  stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
}
.meta-eintrag.veraltet { color: var(--warning); }
.meta-trenner { width: 1px; height: 26px; background: var(--border); }

/* --- Raster und Karten -------------------------------------------------------------- */

.ansicht {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: var(--gap-card);
}
.ansicht[hidden] { display: none; }
.s-12 { grid-column: span 12; }
.s-8 { grid-column: span 8; }
.s-7 { grid-column: span 7; }
.s-6 { grid-column: span 6; }
.s-5 { grid-column: span 5; }
.s-4 { grid-column: span 4; }

.karte {
  background: var(--surface);
  border: 1px solid var(--border-weich);
  border-radius: var(--radius-card);
  padding: 20px 22px;
  min-width: 0;
}
.karte-kopf {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap;
  margin-bottom: 14px;
}
.karte-titel { display: flex; align-items: center; gap: 12px; min-width: 0; }
.karte-titel h2 { margin: 0; font-size: 19px; font-weight: 700; line-height: 1.3; }
.karte-titel svg {
  width: 26px; height: 26px; fill: none; stroke: url(#metall-strich);
  stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round;
}
.karte .unterzeile { margin: -8px 0 14px; color: var(--text-muted); font-size: 14px; }

/* --- KPI-Karte -------------------------------------------------------------------- */

.kpi { display: flex; flex-direction: column; padding: 22px 22px 20px; }
.kpi-oben { display: flex; gap: 18px; align-items: flex-start; }
.kpi-symbol svg {
  width: 44px; height: 44px; fill: none; stroke: url(#metall-strich);
  stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round;
}
.kpi-titel { font-size: 16px; font-weight: 700; }
.kpi-wert { font-size: 40px; font-weight: 700; line-height: 1.15; margin-top: 2px; letter-spacing: -0.01em; }
.kpi-wert.keine-daten { font-size: 24px; color: var(--text-subtle); font-weight: 600; padding: 8px 0 4px; }
.kpi-detail { color: var(--text-muted); font-size: 16px; }

.balken {
  height: 14px;
  background: #2B3945;
  border-radius: 7px;
  margin-top: 18px;
  overflow: hidden;
}
.balken > span {
  display: block; height: 100%; width: 0; border-radius: 7px;
  background: var(--metall-balken);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25);
}
/* Warnstufen bleiben matt in den Statusfarben – eindeutig statt dekorativ */
.balken.warnung > span { background: var(--warning); box-shadow: none; }
.balken.kritisch > span { background: var(--danger); box-shadow: none; }

.kpi-warnung { margin-top: 10px; font-size: 14px; font-weight: 600; display: flex; align-items: center; gap: 6px; }
.kpi-warnung.warnung { color: var(--warning); }
.kpi-warnung.kritisch { color: var(--danger); }

/* --- Status und Abzeichen ------------------------------------------------------------ */

.status { display: inline-flex; align-items: center; gap: 9px; white-space: nowrap; }
.punkt { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.punkt-ok { background: var(--success); }
.punkt-warnung { background: var(--warning); }
.punkt-fehler { background: var(--danger); }
.punkt-inaktiv { background: var(--inactive); }

.abzeichen {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  background: #2E3D49;
  color: #D5DEE5;
}
.abzeichen-admin {
  background: var(--metall-abzeichen); color: #FFFFFF;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.35);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.chip {
  display: inline-block;
  padding: 1px 9px;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 12.5px;
  margin: 2px 4px 2px 0;
}

/* --- Hinweise und Meldungen ---------------------------------------------------------- */

.hinweis {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 12px 16px; margin-bottom: var(--gap-card);
  border-radius: 12px; border: 1px solid var(--border); background: var(--surface);
  font-size: 15px;
}
.hinweis svg { margin-top: 3px; }
.hinweis.warnung { border-color: #7A6230; }
.hinweis.warnung strong, .hinweis.warnung svg { color: var(--warning); }
.hinweis.fehler { border-color: #7C3533; }
.hinweis.fehler strong, .hinweis.fehler svg { color: var(--danger); }

.toast {
  position: fixed; right: 24px; bottom: 24px; z-index: 40;
  display: flex; align-items: center; gap: 10px;
  max-width: min(420px, calc(100vw - 48px));
  padding: 14px 18px;
  background: var(--surface-raised);
  border: 1px solid #2E6B45;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  font-weight: 500;
}
.toast::before { content: "✓"; color: var(--success); font-weight: 700; }
.toast[hidden] { display: none; }

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

.tabelle-rahmen { overflow-x: auto; }
table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 15px; }
th {
  background: var(--surface-raised);
  color: var(--text-muted);
  font-weight: 500;
  text-align: left;
  padding: 8px 12px;
  white-space: nowrap;
}
th:first-child { border-radius: 8px 0 0 8px; }
th:last-child { border-radius: 0 8px 8px 0; }
td { padding: 9px 12px; border-bottom: 1px solid var(--border-weich); vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
th.zahl, td.zahl { text-align: right; white-space: nowrap; }
td.name {
  max-width: 240px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-weight: 700;
}
/* Tabellen in den kleineren Karten der Übersicht etwas enger */
.kompakt th, .kompakt td { padding-left: 9px; padding-right: 9px; }
.kompakt td.name { max-width: 190px; }

.mit-symbol { display: inline-flex; align-items: center; gap: 10px; max-width: 100%; vertical-align: middle; }
.mit-symbol > span:last-child { overflow: hidden; text-overflow: ellipsis; }
.mit-symbol svg {
  width: 20px; height: 20px; fill: none; stroke: var(--text-muted);
  stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round;
}
.mit-symbol.container svg { stroke: var(--accent-bright); }
.leer { color: var(--text-subtle); }
td .zusatz { display: block; color: var(--text-subtle); font-size: 12.5px; font-weight: 400; }

/* --- Angaben-Liste (Systeminformationen) ----------------------------------------------- */

.info-liste { margin: 0; }
.info-liste > div {
  display: flex; justify-content: space-between; align-items: baseline; gap: 16px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border-weich);
}
.info-liste > div:last-child { border-bottom: 0; }
.info-liste dt { color: var(--text); }
.info-liste dd { margin: 0; font-weight: 700; text-align: right; overflow-wrap: anywhere; }

/* --- Diagramm --------------------------------------------------------------------------- */

.legende { display: flex; gap: 22px; margin: 0; padding: 0; list-style: none; font-size: 15px; }
.legende li { display: flex; align-items: center; gap: 8px; }
.quadrat { width: 14px; height: 14px; border-radius: 3px; flex: none; display: inline-block; }
.farbe-cpu { background: var(--metall-balken); }
.farbe-ram { background: var(--chart-secondary); }

.diagramm { position: relative; height: 230px; }
.diagramm svg { position: absolute; inset: 0; display: block; width: 100%; height: 100%; overflow: visible; }
.diagramm svg:focus-visible { box-shadow: var(--fokus); }
.diagramm .raster line { stroke: var(--border); stroke-width: 1; opacity: 0.6; }
.diagramm .achse text { fill: var(--text); font-size: 13px; }
.diagramm .linie { fill: none; stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.diagramm .linie-cpu { stroke: var(--accent-bright); }
.diagramm .linie-ram { stroke: var(--chart-secondary); }
.diagramm .endpunkt { stroke: var(--surface); stroke-width: 2; }
.diagramm .endwert { fill: var(--text); font-size: 12px; font-weight: 600; }
.diagramm .fadenkreuz { stroke: var(--text-subtle); stroke-width: 1; }
.diagramm .leer-text { fill: var(--text-subtle); font-size: 14px; }

.tooltip {
  position: absolute; pointer-events: none; z-index: 2;
  background: var(--bg-deep); border: 1px solid var(--border); border-radius: 8px;
  padding: 8px 10px; font-size: 13px; min-width: 150px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}
.tooltip .zeit { color: var(--text-subtle); margin-bottom: 4px; }
.tooltip .zeile { display: flex; align-items: center; gap: 8px; justify-content: space-between; }
.tooltip .zeile span:first-child { display: flex; align-items: center; gap: 6px; color: var(--text-muted); }

.stunden-tabelle .tabelle-rahmen { max-height: 360px; overflow-y: auto; }
.stunden-tabelle th { position: sticky; top: 0; }

/* --- Knöpfe -------------------------------------------------------------------------- */

.knopf {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 18px;
  border-radius: var(--radius-control);
  font: inherit; font-weight: 600;
  cursor: pointer;
  border: 1px solid var(--border);
  background: var(--surface-raised);
  color: var(--text);
}
.knopf:hover { border-color: var(--accent-bright); }
.knopf svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.knopf-primaer {
  background: var(--metall-flaeche); border-color: #56612E; color: var(--on-accent);
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.35);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14);
}
.knopf-primaer:hover { background: var(--metall-flaeche-hover); border-color: #6F7B40; }
.knopf-klein { padding: 6px 12px; font-size: 14px; }
.knopf:disabled { opacity: 0.6; cursor: wait; }
.knopf-symbol {
  width: 36px; height: 36px; padding: 0;
  display: inline-grid; place-items: center;
  border-radius: 8px; border: 0; background: transparent; color: var(--text-muted); cursor: pointer;
}
.knopf-symbol:hover { background: var(--surface-raised); color: var(--text); }
.knopf-symbol svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }

/* --- Fenster "Neues Konto anlegen" -------------------------------------------------------- */

dialog.fenster {
  width: min(560px, calc(100vw - 32px));
  max-height: calc(100vh - 48px);
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.5);
}
dialog.fenster::backdrop { background: rgba(4, 9, 14, 0.72); }

.fenster-kopf {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 16px;
  padding: 22px 24px 0;
}
.fenster-kopf h2 { margin: 0; font-size: 21px; font-weight: 700; }
.fenster-kopf p { margin: 4px 0 0; color: var(--text-muted); font-size: 14px; }
.fenster-inhalt { padding: 18px 24px 4px; display: flex; flex-direction: column; gap: 18px; }
.fenster-fuss {
  display: flex; justify-content: flex-end; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 18px 24px 22px;
}

.feld { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.feld > label, .feldgruppe > legend { font-size: 14px; font-weight: 600; color: var(--text); }
.feld input {
  font: inherit;
  padding: 11px 13px;
  border-radius: var(--radius-control);
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  width: 100%;
}
.feld input:focus-visible { border-color: var(--accent-bright); }
.feld input[aria-invalid="true"] { border-color: var(--danger); }
.feld-hilfe { font-size: 13px; color: var(--text-subtle); }

.passwort-feld { position: relative; }
.passwort-feld input { padding-right: 48px; }
.passwort-feld .knopf-symbol { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); }

.feldgruppe { border: 0; margin: 0; padding: 0; min-width: 0; }
.feldgruppe > legend { padding: 0; margin-bottom: 8px; }
.rollen-wahl { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; }
.rolle-karte {
  position: relative;
  display: flex; flex-direction: column; gap: 4px;
  padding: 12px 14px 12px 42px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg);
  cursor: pointer;
}
.rolle-karte input { position: absolute; opacity: 0; pointer-events: none; }
.rolle-karte::before {
  content: "";
  position: absolute; left: 14px; top: 15px;
  width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid var(--text-subtle);
}
.rolle-karte:has(input:checked) {
  border-color: var(--accent-bright);
  background: linear-gradient(120deg, #283324 0%, #2E3A26 60%, #3A4730 85%, #2C3725 100%);
}
.rolle-karte:has(input:checked)::before { border-color: var(--accent-bright); background: radial-gradient(var(--accent-bright) 0 4px, transparent 5px); }
.rolle-karte:has(input:focus-visible) { box-shadow: var(--fokus); }
.rolle-name { font-weight: 700; }
.rolle-rechte { font-size: 13px; color: var(--text-muted); }

.abschnitt-trenner {
  border-top: 1px solid var(--border-weich);
  padding-top: 16px;
}
.abschnitt-trenner .feld-hilfe { margin-top: -2px; }

.formular-meldung {
  margin: 0;
  padding: 10px 12px;
  border-radius: var(--radius-control);
  border: 1px solid #7C3533;
  background: rgba(239, 83, 80, 0.08);
  font-size: 14px;
}
.formular-meldung::before { content: "✕ "; color: var(--danger); font-weight: 700; }
.formular-meldung[hidden] { display: none; }

/* --- Login ----------------------------------------------------------------------------- */

.login-seite { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-karte {
  width: 100%; max-width: 420px;
  background: var(--surface);
  border: 1px solid var(--border-weich);
  border-radius: 16px;
  padding: 34px 32px 30px;
}
.login-marke { display: flex; flex-direction: column; align-items: center; text-align: center; margin-bottom: 26px; }
.login-marke img { width: 80px; height: 80px; margin-bottom: 10px; }
.login-karte h1 { font-size: 22px; margin: 0 0 14px; }
.login-formular { display: flex; flex-direction: column; gap: 6px; }
.login-formular label { font-size: 14px; font-weight: 600; margin-top: 10px; }
.login-formular input {
  font: inherit; padding: 11px 13px;
  border-radius: var(--radius-control); border: 1px solid var(--border);
  background: var(--bg); color: var(--text);
}
.login-formular input:focus-visible { border-color: var(--accent-bright); }
.login-formular .knopf { margin-top: 22px; }
.login-meldung {
  margin: 0 0 8px; padding: 10px 12px;
  border-radius: var(--radius-control); border: 1px solid var(--border);
  background: var(--surface-raised); font-size: 14px;
}

/* --- Übersicht am PC: alles auf einen Bildschirm, ohne Scrollen ------------------------------
   Die Kacheln teilen sich die Fensterhöhe. Reicht der Platz nicht, scrollt nur
   die Tabelle innerhalb ihrer Kachel. Unter 1281 × 720 Pixel gilt der normale
   Aufbau mit Scrollen. */

@media (min-width: 1281px) and (min-height: 720px) {
  main.vollbild {
    height: 100vh;
    display: flex;
    flex-direction: column;
    padding-top: 20px;
    padding-bottom: 20px;
  }
  main.vollbild .kopf { margin-bottom: 14px; }
  main.vollbild .kopf h1 { font-size: 30px; }
  main.vollbild #hinweis .hinweis { margin-bottom: 12px; padding: 8px 14px; }
  main.vollbild #ansicht-uebersicht {
    flex: 1;
    min-height: 0;
    gap: 16px;
    grid-template-rows: auto minmax(0, 1.15fr) minmax(0, 1fr);
  }
  main.vollbild #ansicht-uebersicht > .karte {
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
    padding: 16px 20px;
  }
  main.vollbild #ansicht-uebersicht .karte-kopf { margin-bottom: 10px; }
  main.vollbild #ansicht-uebersicht .tabelle-rahmen,
  main.vollbild #ansicht-uebersicht .info-liste { flex: 1; min-height: 0; overflow-y: auto; }
  main.vollbild #ansicht-uebersicht th { position: sticky; top: 0; z-index: 1; }
  main.vollbild #ansicht-uebersicht td { padding-top: 7px; padding-bottom: 7px; }
  main.vollbild #ansicht-uebersicht .info-liste > div { padding: 6px 0; }
  main.vollbild .diagramm { flex: 1; height: auto; min-height: 120px; }
  main.vollbild .kpi { padding: 16px 20px 16px; }
  main.vollbild .kpi-wert { font-size: 36px; }
  main.vollbild .balken { margin-top: 14px; }
}

/* Schmalere PC-Bildschirme (z. B. Laptop oder Windows-Skalierung 125 %):
   Seitenleiste und Tabellen etwas enger, damit keine Spalte abgeschnitten wird. */
@media (min-width: 1281px) and (max-width: 1599px) {
  .app { grid-template-columns: 228px minmax(0, 1fr); }
  .seitenleiste { padding: 22px 14px 16px; gap: 22px; }
  .marke img { width: 64px; height: 64px; }
  .marke-name { font-size: 22px; }
  .menue-punkt { padding: 10px 14px; font-size: 15px; gap: 12px; }
  main { padding-left: 24px; padding-right: 24px; }
  .kompakt table { font-size: 14px; }
  .kompakt th, .kompakt td { padding-left: 7px; padding-right: 7px; }
  .kompakt td.name { max-width: 150px; }
  .kompakt .mit-symbol { gap: 7px; }
  .kompakt .mit-symbol svg { width: 17px; height: 17px; }
  .kompakt .abzeichen { padding: 1px 7px; font-size: 12.5px; }
}

/* Niedrigere PC-Bildschirme: Übersicht noch kompakter, damit alles passt. */
@media (min-width: 1281px) and (min-height: 720px) and (max-height: 860px) {
  main.vollbild { padding-top: 14px; padding-bottom: 14px; }
  main.vollbild .kopf { margin-bottom: 10px; }
  main.vollbild .kopf h1 { font-size: 26px; }
  main.vollbild .untertitel { font-size: 14px; margin-top: 2px; }
  main.vollbild .kopf-meta { padding-top: 4px; font-size: 14px; }
  main.vollbild #ansicht-uebersicht { gap: 12px; }
  main.vollbild #ansicht-uebersicht > .karte { padding: 12px 18px; }
  main.vollbild #ansicht-uebersicht .karte-kopf { margin-bottom: 6px; }
  main.vollbild #ansicht-uebersicht .karte-titel h2 { font-size: 17px; }
  main.vollbild #ansicht-uebersicht .karte-titel svg { width: 22px; height: 22px; }
  main.vollbild .kpi { padding: 12px 18px; }
  main.vollbild .kpi-oben { gap: 14px; }
  main.vollbild .kpi-symbol svg { width: 36px; height: 36px; }
  main.vollbild .kpi-titel { font-size: 15px; }
  main.vollbild .kpi-wert { font-size: 30px; }
  main.vollbild .kpi-detail { font-size: 14px; }
  main.vollbild .balken { height: 11px; margin-top: 10px; }
  main.vollbild #ansicht-uebersicht th { padding-top: 6px; padding-bottom: 6px; }
  main.vollbild #ansicht-uebersicht td { padding-top: 5px; padding-bottom: 5px; }
  main.vollbild #ansicht-uebersicht .info-liste > div { padding: 4px 0; font-size: 14px; }
  main.vollbild .knopf-klein { padding: 4px 10px; }
}

/* --- Kleinere Bildschirme ---------------------------------------------------------------- */

@media (max-width: 1280px) {
  .s-8, .s-7, .s-6, .s-5 { grid-column: span 12; }
}

@media (max-width: 1100px) {
  .s-4 { grid-column: span 12; }
}

@media (max-width: 900px) {
  .app { grid-template-columns: minmax(0, 1fr); align-content: start; }
  .seitenleiste {
    position: static; height: auto; overflow: visible;
    padding: 16px; gap: 14px;
    border-right: 0; border-bottom: 1px solid var(--border-weich);
  }
  .marke { flex-direction: row; gap: 12px; text-align: left; }
  .marke img { width: 44px; height: 44px; margin: 0; }
  .marke-name { font-size: 20px; }
  .marke-zusatz { font-size: 14px; }
  .menue { flex-direction: row; overflow-x: auto; padding-bottom: 4px; }
  .menue-punkt { white-space: nowrap; font-size: 15px; padding: 9px 14px; }
  .menue-trenner { display: none; }
  .serverstatus { margin-top: 0; }
  main { padding: 20px 16px 32px; }
  .kopf h1 { font-size: 26px; }
  .kopf-meta { padding-top: 0; flex-wrap: wrap; }
}
