/* DWE-App – Gestaltung nach den Farben der Website. Schrift lokal (kein Abruf bei Google). */

@font-face { font-family: "Fira Sans"; font-weight: 400; font-display: swap; src: url("schrift/fira-sans-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Fira Sans"; font-weight: 500; font-display: swap; src: url("schrift/fira-sans-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Fira Sans"; font-weight: 600; font-display: swap; src: url("schrift/fira-sans-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Fira Sans"; font-weight: 700; font-display: swap; src: url("schrift/fira-sans-latin-700-normal.woff2") format("woff2"); }

:root {
  --petrol: #009a8c;
  --petrol-dunkel: #007a6f;
  --blau: #151635;
  --hell: #eef7f5;
  --text: #1f2333;
  --grau: #5b6275;
  --linie: #d5e3e0;
  --weiss: #fff;
  --rot: #c0392b;
  --rot-hell: #fdecea;
  --orange: #b9650a;
  --orange-hell: #fff3e0;
  --gruen-hell: #e3f5f2;
  --radius: 8px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: "Fira Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.5;
  color: var(--text);
  background: #f6f9f8;
}
a { color: var(--petrol-dunkel); }
a:hover { color: var(--blau); }
h1, h2 { color: var(--blau); line-height: 1.25; }
h1 { font-size: 1.6rem; margin: 0; }
h2 { font-size: 1.15rem; margin: 1.5rem 0 .75rem; }
.kasten > h2:first-child, section > h2:first-child { margin-top: 0; }

/* ---------- Kopf und Navigation ---------- */
.kopf { background: var(--blau); color: var(--weiss); position: sticky; top: 0; z-index: 10; }
.kopf-innen { max-width: 1200px; margin: 0 auto; padding: .6rem 1rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.marke { display: flex; align-items: center; gap: .75rem; color: var(--weiss); text-decoration: none; font-weight: 500; }
.marke img { background: var(--weiss); border-radius: 4px; padding: 2px 4px; height: 30px; width: auto; }
.marke span { font-size: .95rem; }
.nav { max-width: 1200px; margin: 0 auto; padding: 0 .5rem; display: flex; gap: .25rem; overflow-x: auto; scrollbar-width: none; }
.nav a { color: #c9cbe0; text-decoration: none; padding: .55rem .75rem; border-bottom: 3px solid transparent; white-space: nowrap; font-weight: 500; }
.nav a:hover { color: var(--weiss); }
.nav a[aria-current="page"] { color: var(--weiss); border-bottom-color: var(--petrol); }

.konto { position: relative; }
.konto summary { list-style: none; cursor: pointer; width: 38px; height: 38px; border-radius: 50%; background: var(--petrol); display: grid; place-items: center; font-weight: 600; }
.konto summary::-webkit-details-marker { display: none; }
.konto-menue { position: absolute; right: 0; top: 46px; background: var(--weiss); color: var(--text); border-radius: var(--radius); box-shadow: 0 8px 24px rgba(21, 22, 53, .2); padding: 1rem; min-width: 220px; display: grid; gap: .4rem; }
.konto-menue span { color: var(--grau); font-size: .9rem; margin-bottom: .4rem; }

/* ---------- Inhalt ---------- */
.inhalt { max-width: 1200px; margin: 0 auto; padding: 1.25rem 1rem 3rem; }
.inhalt.schmal, .schmal { max-width: 560px; }
.seitenkopf { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem; margin-bottom: 1.25rem; }
.fuss { text-align: center; color: var(--grau); font-size: .85rem; padding: 1.5rem 1rem; }
.kasten { background: var(--weiss); border: 1px solid var(--linie); border-radius: var(--radius); padding: 1.1rem 1.2rem; margin-bottom: 1rem; }
.leer { color: var(--grau); background: var(--hell); border-radius: var(--radius); padding: .9rem 1rem; }
.leise { color: var(--grau); font-size: .9rem; }
.warnung { color: var(--orange); font-weight: 500; }
.anzahl { color: var(--grau); margin: .25rem 0 .75rem; }

.raster-2 { display: grid; gap: 1.25rem; }
.raster-detail { display: grid; gap: 1rem; }
@media (min-width: 900px) {
  .raster-2 { grid-template-columns: 1fr 1fr; align-items: start; }
  .raster-detail { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); align-items: start; }
  .raster-detail .verlauf { grid-column: 1; }
  .raster-detail .seitenleiste { grid-column: 2; grid-row: 1 / span 2; }
}

/* ---------- Hinweise ---------- */
.hinweis { padding: .75rem 1rem; border-radius: var(--radius); margin: 0 0 1rem; border-left: 4px solid; }
.hinweis-ok { background: var(--gruen-hell); border-color: var(--petrol); }
.hinweis-fehler { background: var(--rot-hell); border-color: var(--rot); }

/* ---------- Knöpfe ---------- */
.knopf {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  background: var(--petrol); color: var(--weiss); border: 2px solid var(--petrol);
  border-radius: var(--radius); padding: .6rem 1.1rem; font: inherit; font-weight: 500;
  text-decoration: none; cursor: pointer; min-height: 44px;
}
.knopf:hover { background: var(--petrol-dunkel); border-color: var(--petrol-dunkel); color: var(--weiss); }
.knopf-hell { background: var(--weiss); color: var(--petrol-dunkel); }
.knopf-hell:hover { background: var(--hell); color: var(--blau); }
.knopf-gruen { background: var(--blau); border-color: var(--blau); }
.knopf-gruen:hover { background: #2a2c5a; border-color: #2a2c5a; }
.knopf-voll { width: 100%; }
.knopf-reihe { display: flex; flex-wrap: wrap; gap: .5rem; }
button.link { background: none; border: 0; padding: 0; font: inherit; color: var(--petrol-dunkel); text-decoration: underline; cursor: pointer; text-align: left; }

/* ---------- Formulare ---------- */
.formular fieldset { border: 0; padding: 0; margin: 0 0 1.25rem; display: grid; gap: .9rem 1rem; }
@media (min-width: 700px) { .formular fieldset { grid-template-columns: 1fr 1fr; } }
.formular legend { font-weight: 600; color: var(--blau); font-size: 1.05rem; margin-bottom: .6rem; padding: 0; }
.feld { display: grid; gap: .3rem; align-content: start; }
.feld.breit { grid-column: 1 / -1; }
.feld label { font-weight: 500; font-size: .95rem; }
.pflicht { color: var(--rot); }
input, select, textarea {
  font: inherit; color: inherit; width: 100%; padding: .55rem .7rem; min-height: 44px;
  border: 1px solid #b9c9c5; border-radius: 6px; background: var(--weiss);
}
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus, .knopf:focus-visible, a:focus-visible, summary:focus-visible {
  outline: 3px solid rgba(0, 154, 140, .35); outline-offset: 1px; border-color: var(--petrol);
}
.hat-fehler input, .hat-fehler select, .hat-fehler textarea { border-color: var(--rot); }
.feld-fehler { color: var(--rot); margin: 0; font-size: .9rem; }
.feld-hilfe { color: var(--grau); margin: 0; font-size: .85rem; }
.haken { display: flex; gap: .5rem; align-items: center; font-weight: 500; }
.haken input { width: 20px; min-height: 20px; height: 20px; }
.stapel { display: grid; gap: .9rem; }
.zeile { display: grid; grid-template-columns: 1fr auto; gap: .5rem; align-items: end; margin-bottom: .75rem; }

.filter { display: grid; gap: .75rem; background: var(--hell); border-radius: var(--radius); padding: .9rem 1rem; margin-bottom: 1rem; }
@media (min-width: 700px) { .filter { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); align-items: end; } }
.knopf-feld { align-self: end; }

/* ---------- Kennzahlen ---------- */
.kacheln { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .75rem; margin-bottom: 1.5rem; }
.kachel { background: var(--weiss); border: 1px solid var(--linie); border-radius: var(--radius); padding: .9rem 1rem; text-decoration: none; color: var(--grau); display: grid; gap: .1rem; font-size: .9rem; }
.kachel:hover { border-color: var(--petrol); color: var(--grau); }
.kachel-zahl { font-size: 2rem; font-weight: 600; color: var(--blau); line-height: 1.1; }
.kachel.achtung { background: var(--orange-hell); border-color: #f0c48a; }
.kachel.alarm { background: var(--rot-hell); border-color: #efa59c; }
.kachel.alarm .kachel-zahl { color: var(--rot); }

/* ---------- Havarie-Karten ---------- */
.karten { list-style: none; margin: 0; padding: 0; display: grid; gap: .6rem; }
.karte { background: var(--weiss); border: 1px solid var(--linie); border-left: 5px solid var(--linie); border-radius: var(--radius); }
.karte.prio-hoch { border-left-color: var(--rot); }
.karte.prio-mittel { border-left-color: #e0a030; }
.karte.prio-niedrig { border-left-color: var(--petrol); }
.karte.st-behoben { opacity: .8; border-left-color: var(--linie); }
.karte a { display: grid; gap: .2rem; padding: .75rem 1rem; color: inherit; text-decoration: none; }
.karte a:hover .karte-titel { color: var(--petrol-dunkel); }
.karte-kopf { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; font-size: .85rem; }
.nummer { font-weight: 600; color: var(--grau); font-variant-numeric: tabular-nums; margin-right: .2rem; }
.karte-titel { font-size: 1.05rem; color: var(--blau); }
.karte-ort { color: var(--text); font-size: .95rem; }
.karte-fuss { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem; color: var(--grau); font-size: .85rem; }

.marke-status, .marke-prio { display: inline-block; border-radius: 999px; padding: .05rem .6rem; font-size: .8rem; font-weight: 500; }
.s-neu { background: var(--orange-hell); color: var(--orange); }
.s-in_bearbeitung { background: #e7e8f6; color: var(--blau); }
.s-behoben { background: var(--gruen-hell); color: var(--petrol-dunkel); }
.p-hoch { background: var(--rot); color: var(--weiss); }
.p-mittel { background: #fbecc9; color: #7a5200; }
.p-niedrig { background: var(--hell); color: var(--petrol-dunkel); }

/* ---------- Detailansicht ---------- */
.daten { display: grid; grid-template-columns: max-content 1fr; gap: .45rem 1rem; margin: 1rem 0 0; }
.daten dt { color: var(--grau); font-size: .9rem; padding-top: .1rem; }
.daten dd { margin: 0; }
@media (max-width: 500px) { .daten { grid-template-columns: 1fr; gap: .1rem; } .daten dd { margin-bottom: .5rem; } }
.beschreibung { background: var(--hell); border-radius: 6px; padding: .75rem 1rem; }

.ereignisse { list-style: none; margin: 0 0 1rem; padding: 0; border-left: 2px solid var(--linie); }
.ereignis { position: relative; padding: 0 0 .9rem 1rem; }
.ereignis::before { content: ""; position: absolute; left: -6px; top: .45rem; width: 10px; height: 10px; border-radius: 50%; background: var(--petrol); }
.ereignis.e-benachrichtigung::before { background: var(--linie); }
.ereignis-kopf { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem; color: var(--grau); font-size: .85rem; }
.kommentar { background: var(--hell); border-radius: 6px; padding: .5rem .75rem; margin-top: .25rem; }

/* ---------- Tabellen ---------- */
.tabelle-rahmen { overflow-x: auto; background: var(--weiss); border: 1px solid var(--linie); border-radius: var(--radius); }
.tabelle { width: 100%; border-collapse: collapse; font-size: .95rem; }
.tabelle th { background: var(--petrol); color: var(--weiss); text-align: left; font-weight: 500; padding: .55rem .75rem; white-space: nowrap; }
.tabelle td { padding: .55rem .75rem; border-top: 1px solid var(--linie); vertical-align: top; }
.tabelle tr:nth-child(even) td { background: #f8fbfa; }
.tabelle .zahl { text-align: right; font-variant-numeric: tabular-nums; }
.tabelle tr.inaktiv td { color: var(--grau); }

/* ---------- Anmeldung ---------- */
body.anmelden { min-height: 100vh; display: grid; place-items: center; background: var(--blau); padding: 1rem; }
.anmelde-kasten { background: var(--weiss); border-radius: 12px; padding: 2rem 1.5rem; width: 100%; max-width: 400px; display: grid; gap: 1rem; }
.anmelde-kasten img { height: 60px; width: auto; }
.anmelde-kasten h1 { font-size: 1.25rem; }

/* ---------- Passkeys ---------- */
.passkeys { list-style: none; margin: 0 0 1rem; padding: 0; display: grid; gap: .5rem; }
.passkeys li { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; background: var(--hell); border-radius: 6px; padding: .6rem .9rem; }
.passkey-neu { max-width: 420px; }
[hidden] { display: none !important; }

/* ---------- Tür-QR-Startseite ---------- */
.portal-start h2 { font-size: 1.05rem; margin: .5rem 0 0; }
.portal-objekt { background: var(--hell); border-radius: var(--radius); padding: .75rem 1rem; margin: 0; }

/* ---------- Anlage für die Technik ---------- */
.schnellwahl { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .5rem; margin-bottom: 1rem; }
.dokumente { list-style: none; margin: 0 0 1rem; padding: 0; display: grid; gap: .4rem; }
.dokumente li { display: flex; justify-content: space-between; align-items: center; gap: .75rem; flex-wrap: wrap; background: var(--hell); border-radius: 6px; padding: .55rem .8rem; }
.dokumente a.dok { font-weight: 500; text-decoration: none; }
.dok-art { display: inline-block; font-size: .78rem; color: var(--petrol-dunkel); background: var(--weiss); border-radius: 999px; padding: 0 .5rem; margin-right: .4rem; }
.qr-vorschau { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; }
.qr-vorschau img { width: 140px; height: 140px; border: 1px solid var(--linie); border-radius: 6px; background: #fff; }

/* ---------- Etiketten (Druck) ---------- */
body.druck { background: #fff; padding: 1rem; }
.druck-leiste { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; justify-content: space-between; background: var(--hell); padding: .75rem 1rem; border-radius: var(--radius); margin-bottom: 1rem; }
.etikett { border: 1px dashed #9aa; border-radius: 6px; padding: 5mm; page-break-inside: avoid; break-inside: avoid; color: var(--blau); }
.etikett p { margin: .15rem 0; }
.etikett-qr svg { display: block; width: 100%; height: auto; }
.etikett-tuer { width: 120mm; margin: 0 auto 8mm; text-align: center; }
.etikett-tuer h1 { font-size: 20pt; margin: 2mm 0; }
.etikett-tuer .etikett-qr { width: 70mm; margin: 2mm auto; }
.etikett-logo { height: 14mm; width: auto; }
.etikett-gross { font-size: 13pt; font-weight: 600; }
.etikett-klein { font-size: 8pt; color: #444; }
.etiketten-raster { display: grid; grid-template-columns: repeat(auto-fill, minmax(90mm, 1fr)); gap: 4mm; }
.etikett-anlage { display: grid; grid-template-columns: 32mm 1fr; gap: 4mm; align-items: center; font-size: 9pt; }
.etikett-marke { color: var(--petrol); font-weight: 700; text-transform: uppercase; letter-spacing: .05em; font-size: 8pt; }
.etikett-titel { font-weight: 700; font-size: 11pt; }
@media print {
  .nicht-drucken { display: none !important; }
  body.druck { padding: 0; }
  .etikett { border-color: #ccc; }
  @page { margin: 10mm; }
}
