:root {
  --anthrazit: #343A44; --blau: #315F96; --blau-dunkel: #264B78;
  --grund: #ECEEF1; --flaeche: #FFFFFF; --linie: #D5D9DF; --text: #1F242B; --leise: #626B78;
  --neu: #C2710C; --arbeit: #315F96; --fertig: #2F7D4F; --dringend: #B3261E;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--grund); color: var(--text); font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; }
a { color: var(--blau); }
h1 { font-size: 1.5rem; line-height: 1.25; margin: 0 0 .25rem; font-weight: 650; letter-spacing: -.01em; }
h2 { font-size: 1.05rem; margin: 0 0 .75rem; font-weight: 650; }
:focus-visible { outline: 3px solid #7FA6D6; outline-offset: 2px; }

/* Kopf */
.kopf { background: var(--anthrazit); color: #fff; }
.kopf-innen { max-width: 1040px; margin: 0 auto; padding: .75rem 1rem 0; }
.kopf-zeile { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.marke { font-weight: 700; letter-spacing: .04em; color: #fff; text-decoration: none; }
.marke span { font-weight: 400; opacity: .75; letter-spacing: 0; margin-left: .5rem; }
.konto { display: flex; gap: .25rem; align-items: center; font-size: .9rem; }
.konto a, .konto button { color: #fff; background: none; border: 0; font: inherit; padding: .35rem .5rem; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.reiter { display: flex; gap: .25rem; margin-top: .6rem; overflow-x: auto; }
.reiter a { color: #C9CED6; text-decoration: none; padding: .6rem .9rem; border-radius: 6px 6px 0 0; white-space: nowrap; font-weight: 550; }
.reiter a.aktiv { background: var(--grund); color: var(--text); }
.reiter .zahl { display: inline-block; min-width: 1.5em; margin-left: .4rem; padding: 0 .4em; border-radius: 99px; background: var(--neu); color: #fff; font-size: .8rem; text-align: center; font-variant-numeric: tabular-nums; }

main { max-width: 1040px; margin: 0 auto; padding: 1.25rem 1rem 4rem; }
.leiste { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; margin-bottom: 1rem; }
.leiste .platz { flex: 1 1 auto; }
.block { background: var(--flaeche); border: 1px solid var(--linie); border-radius: 8px; padding: 1.1rem; margin-bottom: 1rem; }
.hinweis { color: var(--leise); font-size: .92rem; }
.leer { text-align: center; padding: 2.5rem 1rem; color: var(--leise); }

/* Formulare */
label { display: block; font-size: .88rem; font-weight: 600; margin-bottom: .25rem; }
input, select, textarea { width: 100%; font: inherit; font-size: 1rem; font-weight: 400; color: inherit; background: #fff; border: 1px solid #B9C0CA; border-radius: 6px; padding: .55rem .65rem; min-height: 2.75rem; }
textarea { min-height: 6.5rem; resize: vertical; }
input[type=checkbox] { width: 1.15rem; height: 1.15rem; min-height: 0; margin: 0 .4rem 0 0; vertical-align: -2px; }
input[type=file] { padding: .45rem; }
.feld { margin-bottom: .9rem; }
.feld label > input, .feld label > select, .feld label > textarea { display: block; margin-top: .25rem; }
.raster { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0 1rem; }
.leiste input, .leiste select { width: auto; flex: 1 1 180px; max-width: 320px; }
.haken { display: inline-flex; align-items: center; font-weight: 500; font-size: .95rem; margin: 0; white-space: nowrap; }
button, .knopf { font: inherit; font-weight: 600; cursor: pointer; border-radius: 6px; border: 1px solid #B9C0CA; background: #fff; color: var(--text); padding: .55rem 1rem; min-height: 2.75rem; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; }
button.haupt, .knopf.haupt { background: var(--blau); border-color: var(--blau); color: #fff; }
button.haupt:hover, .knopf.haupt:hover { background: var(--blau-dunkel); }
button.gefahr { color: var(--dringend); border-color: #E0B4B0; }
button.klein { min-height: 2.1rem; padding: .25rem .7rem; font-size: .88rem; }
button:disabled { opacity: .55; cursor: default; }
.knoepfe { display: flex; gap: .6rem; flex-wrap: wrap; margin-top: .5rem; }

/* Mängelliste */
.liste { background: var(--flaeche); border: 1px solid var(--linie); border-radius: 8px; overflow: hidden; }
.zeile { display: grid; grid-template-columns: 1fr auto; gap: .25rem 1rem; padding: .85rem 1rem .85rem 1.1rem; border-left: 6px solid var(--linie); border-bottom: 1px solid var(--linie); color: inherit; text-decoration: none; }
.zeile:last-child { border-bottom: 0; }
.zeile:hover { background: #F6F8FA; }
.zeile.s-neu { border-left-color: var(--neu); }
.zeile.s-in_bearbeitung { border-left-color: var(--arbeit); }
.zeile.s-erledigt { border-left-color: var(--fertig); }
.zeile .titel { font-weight: 650; overflow-wrap: anywhere; }
.zeile .nr { color: var(--leise); font-size: .85rem; font-variant-numeric: tabular-nums; margin-right: .5rem; font-weight: 500; }
.zeile .ort, .zeile .neben { color: var(--leise); font-size: .9rem; }
.zeile .rechts { text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: .3rem; }
.marken { display: flex; gap: .35rem; flex-wrap: wrap; justify-content: flex-end; }
.marke-s { font-size: .8rem; font-weight: 650; padding: .1rem .55rem; border-radius: 99px; border: 1px solid; white-space: nowrap; }
.marke-s.neu { color: var(--neu); background: #FDF3E3; border-color: #EBCB98; }
.marke-s.in_bearbeitung { color: var(--arbeit); background: #EAF1F9; border-color: #B5CBE5; }
.marke-s.erledigt { color: var(--fertig); background: #E8F4EC; border-color: #B2D6BF; }
.marke-s.dringend { color: #fff; background: var(--dringend); border-color: var(--dringend); }
.ueberfaellig { color: var(--dringend); font-weight: 650; }

/* Detail */
.zurueck { display: inline-block; margin-bottom: .75rem; }
.detailkopf { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; align-items: flex-start; margin-bottom: 1rem; }
.detailkopf .nr { color: var(--leise); font-variant-numeric: tabular-nums; }
.status-wahl { display: inline-flex; border: 1px solid #B9C0CA; border-radius: 8px; overflow: hidden; background: #fff; flex-wrap: wrap; }
.status-wahl button { border: 0; border-radius: 0; border-right: 1px solid #B9C0CA; }
.status-wahl button:last-child { border-right: 0; }
.status-wahl button.an.neu { background: var(--neu); color: #fff; }
.status-wahl button.an.in_bearbeitung { background: var(--arbeit); color: #fff; }
.status-wahl button.an.erledigt { background: var(--fertig); color: #fff; }
.spalten { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 1rem; align-items: start; }
dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: .35rem 1rem; }
dt { color: var(--leise); font-size: .9rem; }
dd { margin: 0; overflow-wrap: anywhere; }
.text { white-space: pre-wrap; overflow-wrap: anywhere; }
.fotos { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: .5rem; margin-top: .75rem; }
.fotos img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 6px; border: 1px solid var(--linie); display: block; background: #E3E6EA; }
.verlauf { list-style: none; margin: 0 0 1rem; padding: 0; }
.verlauf li { padding: .7rem 0; border-bottom: 1px solid var(--linie); }
.verlauf li:last-child { border-bottom: 0; }
.verlauf .wer { font-size: .88rem; color: var(--leise); }
.verlauf .wer strong { color: var(--text); }
.verlauf li.aenderung { color: var(--leise); font-size: .92rem; padding: .45rem 0; }

/* Verwaltung */
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: .5rem .5rem .5rem 0; border-bottom: 1px solid var(--linie); vertical-align: middle; }
th { font-size: .85rem; color: var(--leise); font-weight: 600; }
td.aktionen { text-align: right; white-space: nowrap; }
td.aktionen button { margin-left: .3rem; }
.inaktiv td:not(.aktionen) { color: #98A0AB; }
.tabelle-rahmen { overflow-x: auto; }

/* Anmeldung */
.anmeldung { max-width: 420px; margin: 8vh auto 0; padding: 0 1rem; }
.anmeldung .marke { color: var(--anthrazit); display: block; margin-bottom: 1rem; font-size: 1.1rem; }

#toast { position: fixed; left: 50%; bottom: 1.25rem; transform: translateX(-50%); max-width: min(92vw, 520px); background: var(--anthrazit); color: #fff; padding: .7rem 1rem; border-radius: 8px; display: none; z-index: 10; box-shadow: 0 6px 20px rgba(31,36,43,.3); }
#toast.fehler { background: var(--dringend); }
#toast.sichtbar { display: block; }

@media (max-width: 760px) {
  .spalten { grid-template-columns: 1fr; }
  .zeile { grid-template-columns: 1fr; }
  .zeile .rechts { align-items: flex-start; text-align: left; flex-direction: row; flex-wrap: wrap; gap: .3rem .75rem; }
  .marken { justify-content: flex-start; }
  .leiste input, .leiste select { max-width: none; }
  h1 { font-size: 1.3rem; }
}

/* Dialog für die Mitteilung beim Statuswechsel */
.dialog { border: 0; border-radius: 10px; padding: 1.25rem; width: min(94vw, 600px); max-height: 92vh; overflow-y: auto; color: var(--text); box-shadow: 0 12px 40px rgba(31,36,43,.35); }
.dialog::backdrop { background: rgba(31,36,43,.55); }
.dialog h2 { font-size: 1.2rem; margin-bottom: .35rem; }
.dialog .hinweis { margin: 0 0 1rem; }
textarea.gross { min-height: 13rem; }
