:root {
  --bg: #06070d;
  --grid: rgba(120, 140, 255, 0.06);
  --surface: rgba(20, 23, 42, 0.86);
  --surface-2: #171b33;
  --text: #eef1ff;
  --text-soft: #a9b0d6;
  --muted: #7d84a8;
  --border: rgba(140, 150, 255, 0.16);
  --g: linear-gradient(135deg, #2dd4bf 0%, #0d9488 60%, #134e4a 120%);
  --accent: #2dd4bf;
  --ok: #22e07a;
  --warn: #ffb020;
  --off: #ff5c7c;
}
* { box-sizing: border-box; margin: 0; }
body {
  min-height: 100vh;
  background:
    radial-gradient(900px 500px at 15% -10%, rgba(13, 148, 136, 0.2), transparent 60%),
    linear-gradient(var(--grid) 1px, transparent 1px) 0 0 / 32px 32px,
    linear-gradient(90deg, var(--grid) 1px, transparent 1px) 0 0 / 32px 32px,
    var(--bg);
  color: var(--text);
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  display: flex; flex-direction: column; align-items: center;
  padding: 20px 16px 28px;
}
header.top, nav.tabs, main, footer { width: 100%; max-width: 760px; }

header.top { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.home {
  width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center;
  background: var(--surface); border: 1px solid var(--border); color: var(--text);
  text-decoration: none; font-size: 18px;
}
/* Kennzeichnungen brechen unter den Titel um, statt den Pfeil in eine eigene Zeile zu schieben */
.title { display: flex; align-items: baseline; gap: 10px; flex: 1; flex-wrap: wrap; row-gap: 4px; min-width: 0; }
h1 {
  font-size: 26px; font-weight: 800;
  background: linear-gradient(90deg, #fff, #99f6e4 60%, #2dd4bf);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.proto {
  font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--warn);
  border: 1px solid rgba(255, 176, 32, .4); border-radius: 999px; padding: 2px 8px;
}
/* Benutzerkonto der Firmen-Apps: wer angemeldet ist */
.wer { font-size: 12px; font-weight: 600; color: var(--text-soft); border: 1px solid var(--border); border-radius: 999px; padding: 3px 10px; white-space: nowrap; }
.wer:empty { display: none; }

select, input, button, textarea { font: inherit; color: inherit; }
select, textarea, input[type="text"], input[type="number"], input[type="date"], input[type="datetime-local"] {
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px;
  padding: 10px 12px; width: 100%; min-width: 0; color-scheme: dark;
}
textarea { resize: vertical; }
input:focus-visible, select:focus-visible, button:focus-visible, textarea:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

nav.tabs { display: flex; gap: 6px; margin: 18px 0 16px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 4px; }
nav.tabs button { flex: 1; min-width: 0; background: none; border: 0; border-radius: 10px; padding: 10px 6px; color: var(--text-soft); cursor: pointer; font-weight: 600; overflow-wrap: anywhere; }
nav.tabs button.on { background: var(--g); color: #fff; }

button { cursor: pointer; }
button:disabled { opacity: .5; cursor: default; }
.primary, .ghost, .danger {
  border-radius: 14px; padding: 12px 18px; font-weight: 700; border: 1px solid transparent;
}
.primary { background: var(--g); color: #fff; }
.ghost { background: var(--surface-2); border-color: var(--border); color: var(--text); }
.danger { background: none; border-color: rgba(255, 92, 124, .5); color: var(--off); }
.big { width: 100%; padding: 18px; font-size: 18px; margin-bottom: 18px; }
.klein { padding: 8px 12px; font-size: 13px; border-radius: 10px; }

.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 18px;
  padding: 16px; margin-bottom: 10px; backdrop-filter: blur(10px);
}
.card h3 { font-size: 16px; display: flex; justify-content: space-between; align-items: center; gap: 10px; overflow-wrap: anywhere; }
.muted { color: var(--muted); font-size: 13px; }
.empty { text-align: center; color: var(--text-soft); padding: 28px 16px; line-height: 1.5; }
.gap {
  border: 1px dashed rgba(255, 176, 32, .6); color: var(--warn); border-radius: 12px;
  padding: 8px 12px; margin-bottom: 10px; font-size: 14px; overflow-wrap: anywhere;
}
.gap.rot { border-color: rgba(255, 92, 124, .7); color: var(--off); }
.gap ul { margin: 6px 0 0; padding-left: 20px; font-weight: 700; }

.badge { display: inline-block; font-size: 12px; font-weight: 700; border-radius: 999px; padding: 2px 9px; border: 1px solid currentColor; white-space: nowrap; flex: none; }
.badge.ok { color: var(--ok); }
.badge.vortag { color: #fff; background: var(--off); border-color: var(--off); }
.fehlt { color: var(--off); font-weight: 600; }

details { font-size: 13px; color: var(--text-soft); min-width: 0; }
details summary { cursor: pointer; font-weight: 600; padding: 4px 0; }
details .mehr { display: grid; gap: 12px; margin-top: 8px; }
.links { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.links a { text-decoration: none; display: inline-block; }

/* Formulare */
label { display: grid; gap: 6px; font-size: 13px; color: var(--text-soft); min-width: 0; }
.row { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.error { color: var(--off); font-weight: 600; }
.error:empty, .hint:empty { display: none; }
#hError { margin-bottom: 10px; }
.hint { color: var(--text-soft); font-size: 14px; }
.actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }
[hidden] { display: none !important; }

dialog {
  width: min(560px, calc(100vw - 24px)); max-height: calc(100vh - 24px); margin: auto;
  background: #0e1122; color: var(--text); border: 1px solid var(--border); border-radius: 22px; padding: 20px;
}
dialog::backdrop { background: rgba(3, 4, 10, .72); backdrop-filter: blur(3px); }
dialog form { display: grid; gap: 12px; }
dialog h2 { font-size: 20px; overflow-wrap: anywhere; }

footer { margin-top: auto; padding-top: 28px; font-size: 12px; color: var(--muted); text-align: center; }

@media (max-width: 560px) {
  /* vier Reiter: Breite nach Textlänge, damit „Einstellungen“ nicht mitten im Wort umbricht */
  nav.tabs { gap: 2px; }
  nav.tabs button { font-size: 13px; padding: 10px 4px; flex: 1 1 auto; }
}

/* Ausdruck: Evakuierungsliste und Aushang stehen in #druck, alles andere bleibt weg */
#druck { display: none; }
@media print {
  body { background: #fff; color: #000; padding: 0; display: block; }
  body.nur-druck > *:not(#druck) { display: none !important; }
  body.nur-druck #druck { display: block; }
  #druck { font-size: 14px; line-height: 1.5; }
  #druck h2 { font-size: 20px; margin-bottom: 12px; }
  #druck table { width: 100%; border-collapse: collapse; margin: 14px 0; }
  #druck th, #druck td { border: 1px solid #000; padding: 8px; text-align: left; vertical-align: top; overflow-wrap: anywhere; }
  #druck td.haken { width: 14%; }
  #druck .entwurf { border: 2px solid #000; padding: 6px 10px; font-weight: 700; margin-bottom: 14px; }
  #druck .klein { font-size: 11px; color: #333; margin-top: 18px; padding: 0; }
  nav.tabs, .home, .links, footer, .proto, .knoepfe, .big { display: none; }
  h1 { color: #000; -webkit-text-fill-color: #000; background: none; }
  .card { border: 1px solid #999; background: none; backdrop-filter: none; }
  .muted { color: #333; }
}

/* ---- Besucherliste ---- */
.buttons { display: grid; }
.liste { list-style: none; padding: 0; display: grid; gap: 0; margin-top: 8px; }
.liste li { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; padding: 9px 0; border-top: 1px solid var(--border); font-size: 14px; }
.liste li > span:first-child { min-width: 0; overflow-wrap: anywhere; line-height: 1.5; }
.knoepfe { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; flex: none; max-width: 45%; }
/* Vorschau des Aushangs am Bildschirm */
.blatt .entwurf { border: 1px dashed rgba(255, 176, 32, .6); color: var(--warn); border-radius: 10px; padding: 6px 10px; font-weight: 700; font-size: 13px; margin-bottom: 12px; }
.blatt h2 { font-size: 18px; margin-bottom: 10px; overflow-wrap: anywhere; }
.blatt table { width: 100%; border-collapse: collapse; table-layout: fixed; font-size: 14px; }
.blatt th, .blatt td { border-top: 1px solid var(--border); padding: 8px 6px 8px 0; text-align: left; vertical-align: top; overflow-wrap: anywhere; line-height: 1.5; }
.blatt th { width: 34%; color: var(--text-soft); font-weight: 600; }
#druck table.punkte th { width: 30%; }
