:root {
  color-scheme: light;
  /* Vollmar-Firmenfarben: Rot #E30613, Schwarz #1D1D1B */
  --blau: #E30613;
  --blau-dunkel: #B8000F;
  --blau-hell: #FDECEE;
  --tinte: #1D1D1B;
  --grau: #5b6870;
  --grau-hell: #8a969d;
  --linie: #d9e0e4;
  --flaeche: #ffffff;
  --grund: #f4f4f3;
  --zeile-alt: #fafafa;
  --gruen: #18794e;
  --gruen-hell: #e7f5ee;
  --gelb: #9a5b00;
  --gelb-hell: #fff4dc;
  --rot: #b42318;
  --rot-hell: #fdecea;
  --radius: 8px;
  --schatten: 0 1px 2px rgba(16, 35, 45, .06), 0 4px 14px rgba(16, 35, 45, .06);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--grund); color: var(--tinte); }
body { min-height: 100vh; overflow-x: hidden; }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }

/* Kopf */
.kopf { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 18px; padding: 0 20px; height: 62px; background: #fff; color: var(--tinte); border-bottom: 3px solid var(--blau); box-shadow: 0 1px 6px rgba(0,0,0,.05); }
.marke { display: flex; align-items: center; white-space: nowrap; }
.marke .logo { height: 46px; width: auto; display: block; }
.navi { display: flex; gap: 2px; overflow-x: auto; flex: 1; scrollbar-width: none; }
.navi button { background: none; border: 0; color: #3b3b39; padding: 8px 11px; border-radius: 6px; cursor: pointer; white-space: nowrap; font-weight: 500; }
.navi button:hover { background: #f3f3f2; color: var(--tinte); }
.navi button.aktiv { background: var(--blau-hell); color: var(--blau-dunkel); font-weight: 700; }
.kopf-rechts { display: flex; align-items: center; gap: 10px; white-space: nowrap; color: #5d5d5a; }
.kopf-rechts button { background: #f1f1f0; border: 1px solid #e2e2e0; color: var(--tinte); padding: 6px 10px; border-radius: 6px; cursor: pointer; }

.app { padding: 18px 20px 60px; max-width: 1680px; margin: 0 auto; }
.laedt { color: var(--grau); }
h1 { font-size: 20px; margin: 0; }
h2 { font-size: 16px; margin: 0 0 10px; }

/* Knöpfe & Felder */
.knopf { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--linie); background: var(--flaeche); padding: 7px 12px; border-radius: 6px; cursor: pointer; white-space: nowrap; line-height: 1.2; }
.knopf:hover { border-color: #b7c3ca; background: #fbfcfd; }
.knopf.haupt { background: var(--blau); border-color: var(--blau); color: #fff; font-weight: 600; }
.knopf.haupt:hover { background: var(--blau-dunkel); }
.knopf.gefahr { color: var(--rot); }
.knopf.klein { padding: 4px 8px; font-size: 12.5px; }
.knopf.symbol { padding: 4px 7px; color: var(--grau); }
.knopf:disabled { opacity: .5; cursor: default; }
.feld { border: 1px solid var(--linie); background: #fff; border-radius: 6px; padding: 6px 8px; min-width: 0; }
.feld:focus, .knopf:focus-visible, select:focus { outline: 2px solid #f39aa1; outline-offset: 1px; border-color: var(--blau); }
textarea.feld { resize: vertical; line-height: 1.45; }
label.beschriftung { display: grid; gap: 4px; font-size: 12.5px; color: var(--grau); font-weight: 600; }
label.beschriftung .feld { font-weight: 400; color: var(--tinte); font-size: 14px; }

.leiste { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 14px; }
.leiste .abstand { flex: 1; }
.leiste .datumtext { color: var(--grau); }
.titelzeile { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }

/* Tagesplan */
.plan { display: grid; gap: 10px; }
.zeile { display: grid; grid-template-columns: minmax(560px, 1.15fr) minmax(360px, 1fr); background: var(--flaeche); border: 1px solid var(--linie); border-radius: var(--radius); box-shadow: var(--schatten); }
.zeile-links { padding: 10px 12px; border-right: 1px solid var(--linie); min-width: 0; }
.zeile-rechts { padding: 10px 12px; display: grid; grid-template-rows: auto 1fr auto; gap: 6px; min-width: 0; }
.zeile-kopf { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; color: var(--grau); font-size: 12.5px; }
.zeile-kopf .nr { font-weight: 700; color: var(--tinte); font-size: 13px; margin-right: 4px; }
.zeile-kopf .abstand { flex: 1; }
.einsaetze { width: 100%; border-collapse: collapse; table-layout: fixed; }
.zeile { border-left: 4px solid var(--blau); }
.einsaetze th { text-align: left; font-size: 11.5px; color: var(--grau-hell); font-weight: 600; padding: 0 4px 3px; }
.einsaetze td { padding: 3px 4px; vertical-align: top; }
.einsaetze .feld, .einsaetze select { width: 100%; padding: 5px 6px; font-size: 13px; }
.einsaetze select { border: 1px solid var(--linie); border-radius: 6px; background: #fff; }
.einsaetze col.c-kz { width: 62px; } .einsaetze col.c-zeit { width: 64px; } .einsaetze col.c-nr { width: 112px; } .einsaetze col.c-st { width: 92px; } .einsaetze col.c-x { width: 30px; }
.einsaetze tr.warn-zeile td { padding-top: 0; }
.warnungen { display: grid; gap: 3px; margin: 0 4px 4px; }
.warnung { background: var(--gelb-hell); color: var(--gelb); border-radius: 5px; padding: 3px 8px; font-size: 12px; }
.status { display: inline-block; font-size: 11.5px; padding: 3px 6px; border-radius: 5px; background: #eceeef; color: #3b3b39; line-height: 1.25; }
.status.gelesen { background: var(--gruen-hell); color: var(--gruen); }
.status.offen { background: var(--gelb-hell); color: var(--gelb); }
.textkopf { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.textkopf select { max-width: 220px; border: 1px solid var(--linie); border-radius: 6px; padding: 4px 6px; font-size: 12.5px; background: #fff; }
.textkopf .abstand { flex: 1; }
.zeile-rechts textarea { width: 100%; min-height: 92px; font-size: 14px; }
.zeichen { font-size: 11.5px; color: var(--grau-hell); text-align: right; }
.leer-plan { background: var(--flaeche); border: 1px dashed var(--linie); border-radius: var(--radius); padding: 40px; text-align: center; color: var(--grau); }
.punkt { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 5px; vertical-align: middle; }
.punkt.an { background: var(--gruen); } .punkt.aus { background: #c3ccd1; }

/* Tabellen (Stammdaten, Protokoll) */
.karte { background: var(--flaeche); border: 1px solid var(--linie); border-radius: var(--radius); box-shadow: var(--schatten); overflow: hidden; }
.tabelle-wrap { overflow-x: auto; }
table.liste { width: 100%; border-collapse: collapse; }
table.liste th { text-align: left; font-size: 12px; color: var(--grau); font-weight: 600; background: #f7f9fa; padding: 9px 10px; border-bottom: 1px solid var(--linie); white-space: nowrap; }
table.liste td { padding: 8px 10px; border-bottom: 1px solid #edf1f3; vertical-align: top; }
table.liste tr:last-child td { border-bottom: 0; }
table.liste tr:hover td { background: #fafcfd; }
table.liste td.aktionen { white-space: nowrap; text-align: right; }
table.liste td.text { white-space: pre-wrap; max-width: 620px; }
.leise { color: var(--grau); font-size: 12.5px; }
.marke-klein { display: inline-block; font-size: 11.5px; border-radius: 5px; padding: 2px 6px; background: #eef2f4; color: var(--grau); }
.marke-klein.gruen { background: var(--gruen-hell); color: var(--gruen); }
.marke-klein.gelb { background: var(--gelb-hell); color: var(--gelb); }
.marke-klein.rot { background: var(--rot-hell); color: var(--rot); }
.suche { min-width: 240px; }

/* Dialoge */
.schleier { position: fixed; inset: 0; background: rgba(15, 30, 38, .45); display: grid; place-items: center; z-index: 50; padding: 16px; }
.dialog { background: #fff; border-radius: 12px; width: min(720px, 100%); max-height: calc(100vh - 32px); display: flex; flex-direction: column; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.dialog.breit { width: min(980px, 100%); }
.dialog-kopf { padding: 14px 18px; border-bottom: 1px solid var(--linie); display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.dialog-kopf h2 { margin: 0; }
.dialog-inhalt { padding: 16px 18px; overflow-y: auto; display: grid; gap: 12px; }
.dialog-fuss { padding: 12px 18px; border-top: 1px solid var(--linie); display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.raster { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; }
.hinweisbox { background: #f3f4f5; color: #3b3b39; border-radius: 8px; padding: 10px 12px; font-size: 13px; line-height: 1.45; }
.hinweisbox.gelb { background: var(--gelb-hell); color: var(--gelb); }
.fehlerbox { background: var(--rot-hell); color: var(--rot); border-radius: 8px; padding: 10px 12px; }

/* Vorschau */
.vorschau-liste { display: grid; gap: 8px; }
.vorschau-eintrag { border: 1px solid var(--linie); border-radius: 8px; padding: 10px 12px; display: grid; grid-template-columns: auto 1fr; gap: 4px 10px; }
.vorschau-eintrag.aus { opacity: .6; background: #fafbfb; }
.vorschau-eintrag .wer { font-weight: 600; }
.vorschau-eintrag .was { grid-column: 2; white-space: pre-wrap; line-height: 1.45; }
.vorschau-eintrag .hinweis { grid-column: 2; font-size: 12.5px; color: var(--gelb); }

/* Baukasten */
.etappe { border: 1px solid var(--linie); border-radius: 8px; padding: 10px; display: grid; gap: 8px; background: #fbfcfd; }
.etappe-kopf { display: flex; align-items: center; justify-content: space-between; font-weight: 600; font-size: 13px; color: var(--grau); }
.etappe-raster { display: grid; grid-template-columns: 110px 1fr; gap: 8px; }
.etappe-raster2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.mit-knopf { display: flex; gap: 6px; }
.mit-knopf input { flex: 1; min-width: 0; }
.feld.ungueltig { border-color: #e7a33c; background: #fffaf0; }
.mit-knopf select { flex: 1; min-width: 0; }
.ergebnis { background: #f4f8fa; border: 1px solid var(--linie); border-radius: 8px; padding: 10px 12px; white-space: pre-wrap; line-height: 1.5; min-height: 46px; }

/* Zugangskarte */
.zugangskarte { border: 2px solid var(--tinte); border-radius: 12px; padding: 18px 20px; display: grid; gap: 12px; }
.zugangskarte .z-kopf { display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 3px solid var(--blau); padding-bottom: 10px; }
.zugangskarte .z-logo { width: 170px; height: auto; }
.zugangskarte .z-titel { font-size: 17px; font-weight: 700; text-align: right; }
.zugangskarte .z-name { font-size: 16px; font-weight: 600; }
.zugangskarte .z-mitte { display: grid; grid-template-columns: 150px 1fr; gap: 18px; align-items: center; }
.zugangskarte .z-qr svg { width: 150px; height: 150px; display: block; }
.zugangskarte .z-qr-text { font-size: 11px; color: var(--grau); text-align: center; margin-top: 2px; }
.zugangskarte dl { display: grid; grid-template-columns: 110px 1fr; gap: 8px 10px; margin: 0; }
.zugangskarte dt { color: var(--grau); }
.zugangskarte dd { margin: 0; font-weight: 700; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 15px; word-break: break-all; }
.zugangskarte .z-schritte { margin: 0; padding-left: 20px; display: grid; gap: 5px; font-size: 13px; line-height: 1.4; }

/* Anmeldung */
.login { max-width: 380px; margin: 9vh auto 0; background: #fff; border: 1px solid var(--linie); border-radius: 12px; padding: 26px; box-shadow: var(--schatten); display: grid; gap: 14px; }
.login h1 { font-size: 22px; }
.login .login-logo { width: 220px; height: auto; justify-self: center; margin-bottom: 4px; }

/* Meldungen */
.meldungen { position: fixed; right: 18px; bottom: 18px; display: grid; gap: 8px; z-index: 60; max-width: min(420px, calc(100vw - 36px)); }
.meldung { background: var(--tinte); color: #fff; border-radius: 8px; padding: 10px 14px; box-shadow: var(--schatten); }
.meldung.fehler { background: var(--rot); }
.meldung.ok { background: var(--gruen); }

@media (max-width: 1100px) {
  .zeile { grid-template-columns: 1fr; }
  .zeile-links { border-right: 0; border-bottom: 1px solid var(--linie); overflow-x: auto; }
  .einsaetze { min-width: 640px; }
}
@media (max-width: 700px) {
  .kopf { padding: 0 12px; gap: 10px; }
  .app { padding: 14px 12px 60px; }
  .marke .logo { height: 36px; }
}
@media print {
  .kopf, .meldungen, .nicht-drucken, .leiste, .dialog-fuss { display: none !important; }
  body, .app { background: #fff; padding: 0; }
  .karte { box-shadow: none; border: 0; }
  .schleier { position: static; background: none; padding: 0; display: block; }
  .dialog { box-shadow: none; width: 100%; max-height: none; }
  .schleier ~ * { display: none; }
  body.druck-dialog .app { display: none; }
}
