/* Werkbank – Gestaltung nach Entwurf A (Website-Entwurf werk2720: Lime auf Schwarz), ruhiger eingesetzt.
   Schriften liegen auf dem eigenen Server. */
@font-face { font-family: 'Anton'; src: url('/static/fonts/anton-latin-400-normal.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Anton'; src: url('/static/fonts/anton-latin-ext-400-normal.woff2') format('woff2'); font-weight: 400; font-display: swap; unicode-range: U+0100-024F, U+1E00-1EFF; }
@font-face { font-family: 'DM Sans'; src: url('/static/fonts/dm-sans-latin-400-normal.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'DM Sans'; src: url('/static/fonts/dm-sans-latin-500-normal.woff2') format('woff2'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'DM Sans'; src: url('/static/fonts/dm-sans-latin-700-normal.woff2') format('woff2'); font-weight: 700; font-display: swap; }
@font-face { font-family: 'DM Mono'; src: url('/static/fonts/dm-mono-latin-400-normal.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'DM Mono'; src: url('/static/fonts/dm-mono-latin-500-normal.woff2') format('woff2'); font-weight: 500; font-display: swap; }

:root {
  --schwarz: #0D0D0D;
  --flaeche: #141414;
  --flaeche-2: #1C1C1C;
  --text: #F5F0E8;
  --grau: #A8A29A;
  --lime: #BFFF00;
  --orange: #FF6B1A;
  --pink: #FF2D78;
  --blau: #0057FF;
  --linie: rgba(245, 240, 232, .09);
  --linie-stark: rgba(245, 240, 232, .22);
  --titel: 'Anton', Impact, sans-serif;
  --sans: 'DM Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'DM Mono', ui-monospace, Consolas, monospace;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--schwarz); color: var(--text); font-family: var(--sans); font-size: 16px; line-height: 1.5; }
a { color: var(--lime); }
a:hover { color: var(--text); }
:focus-visible { outline: 3px solid var(--lime); outline-offset: 2px; }
.sprung { position: absolute; left: -9999px; }
.sprung:focus { left: 12px; top: 12px; background: var(--lime); color: var(--schwarz); padding: 8px 14px; z-index: 10; }
.zahl, .mono { font-family: var(--mono); }

/* Gerüst */
.geruest { display: flex; min-height: 100vh; }
.seitenleiste { flex: 0 0 240px; background: var(--flaeche); border-right: 1px solid var(--linie); padding: 28px 20px; display: flex; flex-direction: column; gap: 28px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.marke { display: flex; align-items: center; gap: 12px; color: var(--text); text-decoration: none; font-weight: 700; font-size: 13px; letter-spacing: .2em; text-transform: uppercase; }
.logo { width: 56px; height: 54px; flex: none; }
.marke-gross .logo { width: 80px; height: 78px; }
.nav-liste { display: flex; flex-direction: column; gap: 4px; }
.nav-eintrag { display: flex; justify-content: space-between; align-items: center; min-height: 44px; padding: 0 14px; color: var(--text); text-decoration: none; }
.nav-eintrag:hover { background: var(--flaeche-2); color: var(--text); }
.nav-eintrag.aktiv { background: var(--lime); color: var(--schwarz); font-weight: 700; }
.zaehler { background: var(--pink); color: var(--schwarz); font-family: var(--mono); font-size: 13px; font-weight: 500; padding: 2px 8px; }
.nav-fuss { margin-top: auto; font-size: 14px; color: var(--grau); display: flex; flex-direction: column; gap: 8px; }
.haupt { flex: 1 1 auto; min-width: 0; padding: 36px 40px 64px; display: flex; flex-direction: column; gap: 28px; max-width: 1400px; }

/* Überschriften */
.kopfzeile { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 16px 20px; }
.oberzeile { font-weight: 700; font-size: 12px; letter-spacing: .3em; text-transform: uppercase; color: var(--lime); margin-bottom: 8px; }
h1 { margin: 0; font-family: var(--titel); font-weight: 400; font-size: 44px; line-height: 1.05; text-transform: uppercase; letter-spacing: .01em; }
h2 { margin: 0 0 16px; font-family: var(--titel); font-weight: 400; font-size: 26px; line-height: 1.1; text-transform: uppercase; }
h3 { margin: 0 0 8px; font-size: 16px; font-weight: 700; }
.etikett { font-weight: 700; font-size: 12px; letter-spacing: .22em; text-transform: uppercase; color: var(--grau); }
.neben { color: var(--grau); font-size: 14px; }

/* Karten und Raster */
.karte { background: var(--flaeche-2); border: 1px solid var(--linie); padding: 24px; min-width: 0; }
.karte-hervor { border-color: var(--lime); }
.raster-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px; }
.zwei-spalten { display: flex; flex-wrap: wrap; gap: 20px; align-items: flex-start; }
.spalte-breit { flex: 3 1 440px; min-width: 0; display: flex; flex-direction: column; gap: 20px; }
.spalte-schmal { flex: 2 1 300px; min-width: 0; display: flex; flex-direction: column; gap: 20px; }
.kennzahl { display: flex; flex-direction: column; gap: 12px; }
.kennzahl-wert { font-family: var(--titel); font-size: 60px; line-height: 1; }
.kennzahl-wert small { font-size: 26px; color: var(--grau); }
.balken { height: 10px; background: var(--schwarz); }
.balken > div { height: 10px; background: var(--lime); min-width: 0; }

/* Knöpfe */
.knopf { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 22px; background: var(--lime); color: var(--schwarz); border: 0; border-radius: 0; text-decoration: none; font: 700 13px/1 var(--sans); letter-spacing: .16em; text-transform: uppercase; cursor: pointer; box-shadow: 0 5px 0 var(--text); }
.knopf:hover { color: var(--schwarz); filter: brightness(1.08); }
.knopf:active { transform: translateY(3px); box-shadow: 0 2px 0 var(--text); }
.knopf-zweit { background: transparent; color: var(--text); border: 1px solid var(--linie-stark); box-shadow: none; }
.knopf-zweit:hover { color: var(--text); border-color: var(--text); }
.knopf-gefahr { background: transparent; color: var(--text); border: 1px solid var(--pink); box-shadow: none; }
.knopf-text { background: none; border: 0; padding: 0; color: var(--grau); font: inherit; text-decoration: underline; cursor: pointer; text-align: left; min-height: 32px; }
.knopf-text:hover { color: var(--text); }
.knopf-reihe { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }

/* Etiketten (Status) */
.marke-status { display: inline-block; font-weight: 700; font-size: 13px; padding: 4px 10px; white-space: nowrap; }
.status-neu { background: var(--blau); color: #fff; }
.status-wartet { background: var(--orange); color: var(--schwarz); }
.status-ueberfaellig { background: var(--pink); color: var(--schwarz); }
.status-ruhig { border: 1px solid var(--linie-stark); color: var(--text); padding: 3px 9px; }
.status-erledigt { background: var(--lime); color: var(--schwarz); }

/* Listen */
.liste { display: flex; flex-direction: column; }
.liste-zeile { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; padding: 14px 0; border-top: 1px solid var(--linie); color: var(--text); text-decoration: none; }
a.liste-zeile:hover { background: rgba(245,240,232,.03); color: var(--text); }
.liste-zeile .haupt-text { flex: 1 1 240px; min-width: 0; }
.liste-zeile.ungelesen b::before { content: ''; display: inline-block; width: 8px; height: 8px; background: var(--blau); margin-right: 8px; vertical-align: middle; }
.reiter { display: flex; flex-wrap: wrap; gap: 4px; }
.reiter a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; color: var(--text); text-decoration: none; border: 1px solid var(--linie); }
.reiter a[aria-current] { background: var(--text); color: var(--schwarz); font-weight: 700; }

/* Meilensteine */
.meilensteine { display: flex; flex-wrap: wrap; gap: 10px; font-size: 14px; font-weight: 700; }
.meilenstein { padding: 8px 14px; border: 1px solid var(--grau); color: var(--grau); }
.meilenstein.erreicht { background: var(--lime); color: var(--schwarz); border-color: var(--lime); }
.meilenstein small { font-weight: 400; font-family: var(--mono); margin-left: 6px; }

/* Formulare */
form.formular { display: flex; flex-direction: column; gap: 18px; }
.feld { display: flex; flex-direction: column; gap: 6px; }
.feld label, .feld .etikett-feld { font-weight: 700; font-size: 14px; }
.feld .hilfe { font-size: 14px; color: var(--grau); }
input[type=text], input[type=search], input[type=email], input[type=tel], input[type=password], input[type=date], input[type=number], input[type=url], select, textarea {
  width: 100%; min-height: 48px; padding: 10px 12px; background: var(--schwarz); color: var(--text); border: 1px solid var(--linie-stark); border-radius: 0; font: 16px/1.4 var(--sans);
}
textarea { min-height: 120px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--lime); outline: none; box-shadow: 0 0 0 2px var(--lime); }
.felder-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 18px; }
.code-eingabe { font-family: var(--mono); font-size: 28px; letter-spacing: .3em; text-align: center; }
.falle { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* Meldungen */
.meldung { padding: 14px 18px; border-left: 6px solid var(--blau); background: var(--flaeche-2); }
.meldung-ok { border-color: var(--lime); }
.meldung-fehler { border-color: var(--pink); }
.meldung-fehler ul { margin: 6px 0 0; padding-left: 20px; }
.hinweis-klein { font-size: 13px; color: var(--orange); }

/* Detailansicht */
.angaben { display: grid; grid-template-columns: minmax(120px, max-content) 1fr; gap: 8px 20px; margin: 0; }
.angaben dt { color: var(--grau); font-size: 14px; }
.angaben dd { margin: 0; overflow-wrap: anywhere; }
.nachricht { white-space: pre-wrap; background: var(--flaeche); padding: 16px; overflow-wrap: anywhere; }
.stufen { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; counter-reset: stufe; }
.stufen li { display: flex; gap: 12px; align-items: center; padding: 6px 10px; color: var(--grau); }
.stufen li .nr { font-family: var(--mono); width: 22px; }
.stufen li.erledigt { color: var(--text); }
.stufen li.jetzt { background: var(--lime); color: var(--schwarz); font-weight: 700; }
.verlauf { list-style: none; margin: 0; padding: 0; }
.verlauf li { padding: 12px 0; border-top: 1px solid var(--linie); }
.verlauf .wann { font-family: var(--mono); font-size: 13px; color: var(--grau); }
.leer { color: var(--grau); padding: 8px 0; }
.leer p { margin: 0 0 6px; }
.leer-schritt { color: var(--text); }

/* Tabellen */
.tabelle-huelle { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 12px; border-top: 1px solid var(--linie); vertical-align: top; }
th { font-size: 12px; letter-spacing: .15em; text-transform: uppercase; color: var(--grau); font-weight: 700; }

/* Einfache Seiten (Anmeldung) */
body.einfach { display: flex; min-height: 100vh; align-items: center; justify-content: center; padding: 24px 16px; }
.einfach-karte { width: 100%; max-width: 440px; background: var(--flaeche-2); border: 1px solid var(--linie); padding: 36px 32px; display: flex; flex-direction: column; gap: 22px; }
.einfach-karte h1 { font-size: 36px; }
.qr { background: #fff; padding: 12px; width: 224px; height: 224px; }
.qr img { width: 200px; height: 200px; display: block; }
.geheimnis { font-family: var(--mono); font-size: 15px; word-break: break-all; background: var(--schwarz); padding: 10px; }

/* Handy */
@media (max-width: 860px) {
  .geruest { flex-direction: column; }
  .seitenleiste { position: static; height: auto; flex: none; padding: 14px 16px; gap: 12px; border-right: 0; border-bottom: 1px solid var(--linie); }
  .logo { width: 40px; height: 39px; }
  .nav-liste { flex-direction: row; overflow-x: auto; gap: 4px; padding-bottom: 4px; scrollbar-width: none; }
  .nav-eintrag { flex: none; gap: 8px; }
  .nav-fuss { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 4px 16px; font-size: 13px; }
  .haupt { padding: 22px 16px 48px; gap: 22px; }
  h1 { font-size: 32px; }
  .kennzahl-wert { font-size: 48px; }
  .knopf { width: 100%; }
  .knopf-reihe .knopf { width: auto; flex: 1 1 auto; }
}

.text-warnung { color: var(--text); background: rgba(255, 45, 120, .18); border-left: 3px solid var(--pink); padding: 0 6px; }

/* Bauabschnitt 2 */
.abstand-oben { margin-top: 20px; }
.rechts { text-align: right; }
tfoot td { border-top: 2px solid var(--linie-stark); }
.kennzahl-mittel { font-size: 40px; }
.text-hinweis { color: var(--text); background: rgba(255, 107, 26, .16); border-left: 3px solid var(--orange); }
.verlauf-text { white-space: pre-wrap; overflow-wrap: anywhere; padding-top: 4px; }
.knopf-reihe.klein { gap: 4px 16px; margin-top: 6px; font-size: 14px; }
.knopf-reihe.klein form { display: inline; }
.filterzeile { display: flex; flex-wrap: wrap; gap: 12px 16px; align-items: flex-end; }
.filterzeile .feld { flex: 1 1 180px; }
.filterzeile .feld-breit { flex: 3 1 280px; }
.filterzeile .feld-knopf { flex: 0 0 auto; }
.felder-pos { display: grid; grid-template-columns: minmax(220px, 3fr) minmax(80px, 1fr) minmax(130px, 1.4fr) minmax(130px, 1.2fr); gap: 18px; }
@media (max-width: 860px) { .felder-pos { grid-template-columns: 1fr 1fr; } .felder-pos .feld-breit { grid-column: 1 / -1; } }
.feld-haken label { display: flex; align-items: center; gap: 10px; min-height: 48px; font-weight: 700; }
.feld-haken input { width: 22px; height: 22px; accent-color: var(--lime); }
details summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; color: var(--lime); font-weight: 700; }
details[open] summary { margin-bottom: 12px; }
.balken-einnahmen > div { background: var(--lime); position: relative; }
.balken-kosten { position: absolute; left: 0; top: 0; height: 10px; background: var(--orange); }
th.rechts { text-align: right; }

td:first-child { min-width: 180px; }
input[type=search]::-webkit-search-cancel-button { filter: invert(1); }

/* Bauabschnitt 3: Mails */
.kopfzeile-karte { margin-bottom: 8px; align-items: center; }
.kopfzeile-karte h2 { margin: 0; }
.freigabe { display: flex; flex-direction: column; gap: 10px; padding: 12px 0; border-top: 1px solid var(--linie); }
.freigabe:first-of-type { border-top: 0; padding-top: 0; }
.zitat { background: var(--flaeche); padding: 14px; font-size: 15px; white-space: pre-wrap; overflow-wrap: anywhere; }
textarea.mailtext { min-height: 320px; font-size: 16px; line-height: 1.55; }
.mail-vorschau { max-height: 260px; overflow-y: auto; }
.regeln { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; font-size: 15px; }
.reiter .zaehler { margin-left: 8px; }

/* Bauabschnitt 4: Verträge */
textarea.vorlagentext { min-height: 520px; font-family: var(--mono); font-size: 14px; line-height: 1.55; }
.platzhalter dt { font-size: 13px; color: var(--lime); }
.platzhalter dd { font-size: 14px; color: var(--grau); }
input[type=file] { min-height: 48px; padding: 10px 0; color: var(--text); font: 15px var(--sans); }
input[type=file]::file-selector-button { min-height: 40px; margin-right: 12px; padding: 0 16px; background: transparent; color: var(--text); border: 1px solid var(--linie-stark); font: 700 13px var(--sans); cursor: pointer; }

/* Bauabschnitt 5: Akquise */
.raster-6 { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.checkliste { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.checkliste li { display: flex; gap: 14px; align-items: flex-start; padding: 10px 0; border-top: 1px solid var(--linie); }
.checkliste form { flex: none; }
.haken { width: 44px; height: 44px; background: transparent; border: 2px solid var(--linie-stark); cursor: pointer; position: relative; }
.haken:hover { border-color: var(--lime); }
.haken.erledigt { background: var(--lime); border-color: var(--lime); }
.haken.erledigt::after { content: ''; position: absolute; left: 14px; top: 6px; width: 10px; height: 20px; border: solid var(--schwarz); border-width: 0 4px 4px 0; transform: rotate(45deg); }
.knopf[disabled] { opacity: .45; cursor: not-allowed; }

/* Rückfrage in der Seite (statt Browser-Dialog) */
.rueckfrage { margin-top: 12px; padding: 16px 18px; background: var(--flaeche); border: 1px solid var(--orange); border-left-width: 6px; display: flex; flex-direction: column; gap: 12px; }
.rueckfrage p { margin: 0; font-weight: 700; }
.knopf-reihe.klein + .rueckfrage, form.feld-knopf + .rueckfrage { width: 100%; }
