:root {
  --rot: #b3261e;
  --rot-dunkel: #8c1d17;
  --text: #1f2328;
  --grau: #5b6470;
  --linie: #d9dde3;
  --flaeche: #f5f6f8;
  --weiss: #fff;
  --gruen: #1f7a3f;
  --gelb: #b7791f;
  --blau: #1d5fa8;
  --radius: 8px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  color: var(--text); background: var(--flaeche);
}
a { color: var(--blau); }
h1 { font-size: 1.5rem; margin: 0 0 1rem; }
h2 { font-size: 1.2rem; margin: 1.75rem 0 .75rem; }

.kopf { background: var(--rot); color: #fff; }
.bereich-admin .kopf { background: #2b3138; }
.kopf-innen { max-width: 1150px; margin: 0 auto; padding: .7rem 1rem; display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; justify-content: space-between; }
.marke { display: flex; gap: .6rem; align-items: center; line-height: 1.2; }
.marke small { display: block; opacity: .8; font-size: .8rem; }
.marke-icon { display: inline-flex; width: 36px; height: 36px; border-radius: 50%; background: rgba(255,255,255,.15); align-items: center; justify-content: center; }
.hauptnav { display: flex; flex-wrap: wrap; gap: .25rem; }
.hauptnav a { color: #fff; text-decoration: none; padding: .4rem .7rem; border-radius: 6px; }
.hauptnav a:hover, .hauptnav a.aktiv { background: rgba(255,255,255,.18); }

.inhalt { max-width: 1150px; margin: 0 auto; padding: 1.25rem 1rem 3rem; }
.fuss { text-align: center; color: var(--grau); font-size: .85rem; padding: 1rem; }

.karte { background: var(--weiss); border: 1px solid var(--linie); border-radius: var(--radius); padding: 1.25rem; margin-bottom: 1rem; }
.karte-schmal { max-width: 420px; margin: 3rem auto; }
.hinweis { color: var(--grau); font-size: .92rem; }

.meldung { padding: .75rem 1rem; border-radius: var(--radius); margin-bottom: 1rem; border: 1px solid; }
.meldung-ok { background: #e8f5ec; border-color: #b6dfc3; color: #14532d; }
.meldung-fehler { background: #fdecea; border-color: #f3b8b3; color: #7f1d1d; }
.meldung-info { background: #e8f0fb; border-color: #b9cff0; color: #1e3a6e; }

/* Formulare */
label { display: block; font-weight: 600; margin-bottom: .25rem; font-size: .95rem; }
.feld { margin-bottom: 1rem; }
.feld small { display: block; color: var(--grau); font-weight: 400; }
input[type=text], input[type=email], input[type=tel], input[type=password], input[type=number],
input[type=date], input[type=datetime-local], select, textarea {
  width: 100%; padding: .55rem .65rem; border: 1px solid #b8bfc8; border-radius: 6px; font: inherit; background: #fff;
}
textarea { min-height: 90px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--blau); outline-offset: 0; border-color: var(--blau); }
.raster { display: grid; gap: 0 1rem; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.pflicht::after { content: " *"; color: var(--rot); }
.hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }

.knopf {
  display: inline-block; padding: .55rem 1.1rem; border-radius: 6px; border: 1px solid transparent;
  font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; background: var(--rot); color: #fff;
}
.knopf:hover { background: var(--rot-dunkel); }
.knopf-gruen { background: var(--gruen); } .knopf-gruen:hover { background: #17602f; }
.knopf-grau { background: #fff; color: var(--text); border-color: #b8bfc8; } .knopf-grau:hover { background: var(--flaeche); }
.knopf-klein { padding: .3rem .65rem; font-size: .88rem; }
.knopfleiste { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin-top: 1rem; }

/* Tabellen */
.tabelle-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; background: #fff; }
th, td { padding: .55rem .6rem; border-bottom: 1px solid var(--linie); text-align: left; vertical-align: top; }
th { background: var(--flaeche); font-size: .85rem; text-transform: uppercase; letter-spacing: .02em; color: var(--grau); }
td.zahl, th.zahl { text-align: right; white-space: nowrap; }
tr.vergangen td { color: var(--grau); }
tr.voll td { background: #fff6f5; }
tr.klickbar { cursor: pointer; } tr.klickbar:hover td { background: #f8fafc; }

.balken { display: flex; height: 10px; background: #e7eaee; border-radius: 5px; overflow: hidden; min-width: 120px; }
.balken-zugesagt { background: var(--rot); }
.balken-angefragt { background: #f0a39d; }
.legende { display: flex; gap: 1rem; flex-wrap: wrap; font-size: .85rem; color: var(--grau); margin: .5rem 0; }
.legende i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; vertical-align: -1px; margin-right: .3rem; }

.frei-gross { font-weight: 700; font-size: 1.05rem; }
.frei-ok { color: var(--gruen); } .frei-knapp { color: var(--gelb); } .frei-nichts { color: var(--rot); }

.badge { display: inline-block; padding: .1rem .5rem; border-radius: 99px; font-size: .8rem; font-weight: 600; white-space: nowrap; }
.badge-neu { background: #fff4d6; color: #7a4d00; }
.badge-genehmigt { background: #dff3e6; color: #14532d; }
.badge-abgelehnt { background: #fde2e0; color: #7f1d1d; }
.badge-storniert { background: #eceef1; color: #4b5563; }
.zaehler { background: var(--rot); color: #fff; border-radius: 99px; padding: 0 .45rem; font-size: .8rem; margin-left: .25rem; }

.filter { display: flex; flex-wrap: wrap; gap: .5rem; align-items: end; margin-bottom: 1rem; }
.filter .feld { margin: 0; }
.filter select, .filter input { width: auto; }

.dl { display: grid; grid-template-columns: max-content 1fr; gap: .35rem 1rem; margin: 0; }
.dl dt { color: var(--grau); }
.dl dd { margin: 0; }
.zweispaltig { display: grid; gap: 1rem; grid-template-columns: 1fr; }
@media (min-width: 900px) { .zweispaltig { grid-template-columns: 1fr 1.1fr; } }

/* Kalender */
.kal-kopf { display: flex; justify-content: space-between; align-items: center; gap: .5rem; flex-wrap: wrap; }
.kal-kopf h2 { margin: 0; }
.kal-nav { display: flex; gap: .4rem; }
.inaktiv { opacity: .4; pointer-events: none; }
.kal-raster { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); margin-top: 1rem; }
.kal-monat h3 { margin: 0 0 .4rem; font-size: 1rem; }
table.kal { table-layout: fixed; border-collapse: separate; border-spacing: 0 3px; background: transparent; }
.kal th { background: none; border: 0; text-align: center; padding: .2rem 0; font-size: .75rem; }
.kal td { border: 0; padding: 0; text-align: center; font-size: .92rem; }
.kal td:first-child { border-radius: 6px 0 0 6px; }
.kal td:last-child { border-radius: 0 6px 6px 0; }
.kal td a, .kal td span { display: block; padding: .38rem 0; color: inherit; text-decoration: none; border-radius: 6px; }
.kal td a:hover, .kal td a:focus-visible { background: rgba(0,0,0,.12); outline: none; }
.kal .kal-kw { width: 2.6rem; font-size: .75rem; color: var(--grau); font-weight: 600; line-height: 1.15; padding: .25rem 0; }
.kal td.kal-kw small { display: block; font-size: .7rem; font-weight: 700; }
.kal td.fremd { opacity: .45; }
.kal td.heute a, .kal td.heute span { box-shadow: inset 0 0 0 2px var(--text); font-weight: 700; }
.kal tr.kal-gruen td { background: #d7f0df; } .kal tr.kal-gruen td.kal-kw small { color: var(--gruen); }
.kal tr.kal-gelb td  { background: #fdecb5; } .kal tr.kal-gelb td.kal-kw small { color: #8a5a00; }
.kal tr.kal-rot td   { background: #f9d3cf; } .kal tr.kal-rot td.kal-kw small { color: var(--rot); }
.kal tr.kal-vorbei td, .kal tr.kal-ausserhalb td { color: #a3a9b1; }
.kal-farbe-gruen { background: #9fd9b2; } .kal-farbe-gelb { background: #f6d16a; } .kal-farbe-rot { background: #f0a39d; }
.kal-legende { margin-bottom: 0; margin-top: 1rem; }

/* Druck */
.nur-druck { display: none; }
.druck-tabelle td.haken { width: 2.2rem; }
.druck-tabelle .kasten { display: inline-block; width: 16px; height: 16px; border: 1.5px solid #333; }
@media print {
  @page { size: A4 landscape; margin: 12mm; }
  body { background: #fff; font-size: 11pt; }
  .kopf, .fuss, .nicht-drucken, .meldung { display: none !important; }
  .nur-druck { display: block; }
  .inhalt { max-width: none; padding: 0; }
  .karte { border: 0; padding: 0; }
  th { background: #eee !important; color: #000; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  th, td { border: 1px solid #999; padding: 4px 6px; }
  tr { page-break-inside: avoid; }
  h2 { page-break-after: avoid; }
}

/* Impressum / Datenschutz */
.rechtstext { max-width: 820px; }
.rechtstext h2 { font-size: 1.05rem; margin-top: 1.5rem; }
.rechtstext mark { background: #fff1a8; padding: 0 .2rem; border-radius: 3px; }
.fuss a { color: var(--grau); }

/* Ausgabe / Rückgabe */
fieldset.uebergabe { border: 1px solid var(--linie); border-radius: var(--radius); padding: .6rem .9rem .9rem; }
fieldset.uebergabe legend { font-weight: 600; padding: 0 .3rem; }
label.wahl { font-weight: 400; display: flex; gap: .45rem; align-items: center; margin: .2rem 0; }
label.unterlabel { margin-top: .5rem; font-size: .88rem; color: var(--grau); }
.art-fw { color: #6b3fa0; font-weight: 600; }
