/* Münchaurach Webpanel – dunkel, minimalistisch, Akzent Feuerwehrrot */
:root {
  --bg: #0e0f12;
  --flaeche: #16181d;
  --flaeche-2: #1d2027;
  --rand: #2a2e37;
  --text: #e8e9ec;
  --text-2: #9aa0ab;
  --akzent: #e3242b;
  --akzent-hover: #f03a40;
  --akzent-weich: rgba(227, 36, 43, 0.12);
  --ok: #3ecf8e;
  --warn: #f5b84a;
  --radius: 10px;
  --schrift: 'Segoe UI', system-ui, -apple-system, Roboto, 'Helvetica Neue', Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 15px/1.55 var(--schrift);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--akzent-hover); }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .6em; font-weight: 600; }
h1 { font-size: 1.5rem; }
h2 { font-size: 1.1rem; }
h3 { font-size: .95rem; color: var(--text-2); text-transform: uppercase; letter-spacing: .06em; }
.leise { color: var(--text-2); }
.klein { font-size: .85rem; }
[hidden] { display: none !important; }

/* ---------- Layout ---------- */
.layout { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
.seitenleiste {
  background: var(--flaeche);
  border-right: 1px solid var(--rand);
  padding: 20px 14px;
  display: flex; flex-direction: column; gap: 18px;
  position: sticky; top: 0; height: 100vh;
}
.marke { display: flex; align-items: center; gap: 10px; padding: 0 8px; font-weight: 700; letter-spacing: .02em; }
.marke img { width: 30px; height: 30px; }
.marke small { display: block; font-weight: 400; color: var(--text-2); font-size: .75rem; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a {
  color: var(--text-2); text-decoration: none; padding: 9px 12px; border-radius: 8px;
  display: flex; align-items: center; gap: 10px;
}
.nav a:hover { background: var(--flaeche-2); color: var(--text); }
.nav a.aktiv { background: var(--akzent-weich); color: var(--text); box-shadow: inset 3px 0 0 var(--akzent); }
.nutzer { margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 10px 8px 0; border-top: 1px solid var(--rand); }
.nutzer img { width: 32px; height: 32px; border-radius: 50%; background: var(--flaeche-2); }
.nutzer .name { font-size: .9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }

main { padding: 32px clamp(16px, 4vw, 48px); max-width: 1100px; width: 100%; }
.kopf { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }

/* ---------- Karten ---------- */
.raster { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.karte {
  background: var(--flaeche); border: 1px solid var(--rand); border-radius: var(--radius); padding: 20px;
}
.karte + .karte { margin-top: 16px; }
.raster .karte + .karte { margin-top: 0; }
.kennzahl { font-size: 1.9rem; font-weight: 650; }
.kennzahl-titel { color: var(--text-2); font-size: .85rem; }
.status { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; }
.punkt { width: 9px; height: 9px; border-radius: 50%; background: var(--text-2); }
.punkt.ok { background: var(--ok); box-shadow: 0 0 0 4px rgba(62, 207, 142, .15); }
.punkt.aus { background: var(--akzent); box-shadow: 0 0 0 4px var(--akzent-weich); }
.liste-dl { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; margin: 0; }
.liste-dl dt { color: var(--text-2); }
.liste-dl dd { margin: 0; }

/* ---------- Formulare ---------- */
label { display: block; font-size: .85rem; color: var(--text-2); margin-bottom: 6px; }
.feld { margin-bottom: 16px; }
.feld-reihe { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
input[type=text], input[type=number], input[type=url], select, textarea {
  width: 100%; background: var(--bg); color: var(--text); border: 1px solid var(--rand);
  border-radius: 8px; padding: 10px 12px; font: inherit;
}
textarea { min-height: 110px; resize: vertical; }
input:focus, select:focus, textarea:focus, button:focus-visible, a:focus-visible {
  outline: 2px solid var(--akzent); outline-offset: 1px; border-color: transparent;
}
select[multiple] { min-height: 140px; }
.schalter { display: flex; align-items: center; gap: 10px; color: var(--text); font-size: .95rem; cursor: pointer; margin-bottom: 12px; }
.schalter input { appearance: none; width: 38px; height: 22px; border-radius: 11px; background: var(--rand); position: relative; cursor: pointer; flex: none; margin: 0; transition: background .15s; }
.schalter input::after { content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .15s; }
.schalter input:checked { background: var(--akzent); }
.schalter input:checked::after { transform: translateX(16px); }

.knopf {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--akzent); color: #fff; border: 0; border-radius: 8px;
  padding: 10px 18px; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none;
}
.knopf:hover { background: var(--akzent-hover); }
.knopf:disabled { opacity: .5; cursor: default; }
.knopf.zweit { background: var(--flaeche-2); color: var(--text); border: 1px solid var(--rand); }
.knopf.zweit:hover { border-color: var(--text-2); }
.knopf.klein { padding: 6px 12px; font-size: .85rem; }
.knopf.gefahr { background: transparent; color: var(--akzent-hover); border: 1px solid var(--akzent); }
.knopf.gefahr:hover { background: var(--akzent-weich); }
.aktionen { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

/* ---------- Tabellen ---------- */
.tabelle-huelle { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th { text-align: left; color: var(--text-2); font-weight: 500; font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; }
th, td { padding: 10px 12px; border-bottom: 1px solid var(--rand); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
.marke-pill { display: inline-block; padding: 2px 9px; border-radius: 99px; background: var(--flaeche-2); border: 1px solid var(--rand); font-size: .8rem; white-space: nowrap; }
.leer { color: var(--text-2); padding: 24px; text-align: center; }

/* Rollenmenü-Editor */
.menue-zeile { display: grid; grid-template-columns: 1.4fr 70px 1fr 2fr auto; gap: 8px; margin-bottom: 8px; align-items: center; }

/* ---------- Meldungen ---------- */
.toast {
  position: fixed; right: 20px; bottom: 20px; max-width: min(420px, calc(100vw - 32px));
  background: var(--flaeche-2); border: 1px solid var(--rand); border-left: 4px solid var(--ok);
  padding: 12px 16px; border-radius: 8px; box-shadow: 0 10px 30px rgba(0,0,0,.4); z-index: 10;
}
.toast.fehler { border-left-color: var(--akzent); }
.hinweis { background: var(--akzent-weich); border: 1px solid rgba(227,36,43,.35); border-radius: 8px; padding: 12px 14px; }
.hinweis.ok { background: rgba(62,207,142,.08); border-color: rgba(62,207,142,.35); }

/* ---------- Login ---------- */
.login-seite { min-height: 100vh; display: grid; place-items: center; padding: 16px;
  background: radial-gradient(ellipse at top, rgba(227,36,43,.14), transparent 60%), var(--bg); }
.login-karte { width: 100%; max-width: 400px; text-align: center; padding: 36px 28px; }
.login-karte img { width: 64px; height: 64px; margin-bottom: 12px; }
.login-karte .knopf { width: 100%; margin-top: 20px; padding: 12px; }
.login-karte .hinweis { margin-top: 18px; text-align: left; font-size: .9rem; }

/* ---------- Mobil ---------- */
.menue-knopf { display: none; }
@media (max-width: 800px) {
  .layout { grid-template-columns: 1fr; }
  .seitenleiste { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; padding: 12px 16px; gap: 10px; }
  .menue-knopf { display: inline-flex; margin-left: auto; }
  .nav { display: none; width: 100%; }
  .nav.offen { display: flex; }
  .nutzer { display: none; }
  .nav.offen ~ .nutzer { display: flex; width: 100%; }
  main { padding: 20px 16px; }
  .menue-zeile { grid-template-columns: 1fr 1fr; }
  .menue-zeile .breit { grid-column: 1 / -1; }
}
.abstand-oben { margin-top: 16px; }
.suchfeld { max-width: 280px; }
textarea.gross { min-height: 180px; }
