/* recht: ein schlichtes, eigenes Stylesheet. Farben stehen oben als Variablen. */

:root {
  --bg: #f4f5f8;
  --karte: #ffffff;
  --text: #141824;
  --leise: #667085;
  --linie: #e4e7ec;
  --flaeche: #f7f8fa;
  --akzent: #4f46e5;
  --akzent-hover: #4338ca;
  --akzent-zart: #eef0ff;
  --auf-akzent: #ffffff;
  --rot: #c4321f;
  --rot-zart: #fdeeec;
  --gelb: #9a5b05;
  --gelb-zart: #fdf3e0;
  --gruen: #13795b;
  --gruen-zart: #e8f6ef;
  --blau: #2f54c7;
  --blau-zart: #eaf0ff;
  --radius: 16px;
  --schatten: 0 1px 2px rgb(16 24 40 / 4%), 0 12px 32px -18px rgb(16 24 40 / 18%);
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d1017;
    --karte: #151a23;
    --text: #e7e9ef;
    --leise: #98a2b3;
    --linie: #272e3b;
    --flaeche: #1a202b;
    --akzent: #8f96ff;
    --akzent-hover: #a7acff;
    --akzent-zart: #22254a;
    --auf-akzent: #0d1017;
    --rot: #ff9585;
    --rot-zart: #3a1b17;
    --gelb: #f4c46f;
    --gelb-zart: #352914;
    --gruen: #63d4a6;
    --gruen-zart: #10302a;
    --blau: #9ab4ff;
    --blau-zart: #19233f;
    --schatten: none;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 16px; }
main.wrap { padding-top: 20px; padding-bottom: 56px; display: grid; gap: 16px; }
@media (min-width: 720px) {
  .wrap { padding: 0 28px; }
  main.wrap { padding-top: 28px; gap: 20px; }
}
h2 { margin: 0; font-size: 16px; font-weight: 650; letter-spacing: -0.01em; display: flex; align-items: center; gap: 10px; }
small { display: block; color: var(--leise); font-size: 12.5px; font-weight: 400; }
.icon { width: 18px; height: 18px; flex: none; }
:focus-visible { outline: 2px solid var(--akzent); outline-offset: 2px; }

/* --- Kopf ------------------------------------------------------------------ */
.kopf { background: color-mix(in srgb, var(--karte) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--linie); position: sticky; top: 0; z-index: 10; }
.kopf-innen { display: flex; align-items: center; justify-content: space-between; gap: 12px; height: 62px; }
.logo { display: flex; align-items: center; gap: 11px; color: inherit; text-decoration: none; }
.logo-zeichen {
  width: 36px; height: 36px; border-radius: 11px; flex: none;
  background: linear-gradient(135deg, var(--akzent), color-mix(in srgb, var(--akzent) 70%, #000));
  color: var(--auf-akzent); display: grid; place-items: center;
  font: 21px/1 Georgia, "Times New Roman", serif;
}
.logo-text b { display: block; font-size: 17px; line-height: 1.15; letter-spacing: -0.02em; }
.logo-text small { font-size: 12px; }
.kopf-nav { display: flex; align-items: center; gap: 4px; }
.kopf-nav form { margin: 0; }
.pille {
  display: inline-flex; align-items: center; padding: 6px 12px; margin-right: 6px;
  border-radius: 999px; background: var(--flaeche); border: 1px solid var(--linie);
  font-size: 13px; color: var(--leise); white-space: nowrap; font-variant-numeric: tabular-nums;
}
.pille b { color: var(--text); font-weight: 600; }
.pille .budget { display: inline-flex; align-items: center; }
.punkt { width: 4px; height: 4px; border-radius: 50%; background: var(--leise); margin: 0 8px; opacity: 0.6; }
@media (max-width: 680px) {
  .breit, .logo-text small { display: none; }
  .pille { font-size: 12px; padding: 5px 10px; margin-right: 0; }
}
@media (max-width: 420px) { .pille .budget { display: none; } }

/* --- Karten ---------------------------------------------------------------- */
.karte { background: var(--karte); border: 1px solid var(--linie); border-radius: var(--radius); box-shadow: var(--schatten); padding: 18px; min-width: 0; }
@media (min-width: 720px) { .karte { padding: 22px 24px; } }
.karte-kopf { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; min-height: 38px; }
.karte-kopf form { margin: 0; }
.nr { width: 26px; height: 26px; border-radius: 50%; background: var(--akzent-zart); color: var(--akzent); display: grid; place-items: center; font-size: 13px; font-weight: 700; flex: none; }

/* --- Knöpfe ---------------------------------------------------------------- */
.knopf {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 38px; padding: 0 14px; border-radius: 10px; border: 1px solid transparent;
  background: var(--akzent); color: var(--auf-akzent);
  font: inherit; font-size: 14px; font-weight: 600; white-space: nowrap; text-decoration: none; cursor: pointer;
  transition: background 0.15s, border-color 0.15s, opacity 0.15s, transform 0.05s;
}
.knopf:hover { background: var(--akzent-hover); }
.knopf:active:not(:disabled) { transform: translateY(1px); }
.knopf:disabled { opacity: 0.45; cursor: not-allowed; }
.knopf.leise { background: transparent; color: var(--text); border-color: var(--linie); }
.knopf.leise:hover { background: var(--flaeche); }
.knopf.gross { width: 100%; height: 50px; font-size: 15px; border-radius: 12px; }
.kopf .knopf.leise { border-color: transparent; color: var(--leise); padding: 0 10px; }
.kopf .knopf.leise:hover { color: var(--text); background: var(--flaeche); }
.icon-knopf { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; border: 0; background: transparent; color: var(--leise); cursor: pointer; flex: none; }
.icon-knopf:hover { background: var(--flaeche); color: var(--text); }
.icon-knopf.gefahr:hover, .dateien .icon-knopf:hover { background: var(--rot-zart); color: var(--rot); }

/* --- Eingaben -------------------------------------------------------------- */
label { display: grid; gap: 6px; font-size: 13px; font-weight: 600; color: var(--leise); }
input:not([type="checkbox"]):not([type="file"]), textarea {
  width: 100%; font: inherit; font-size: 15px; color: var(--text);
  background: var(--karte); border: 1px solid var(--linie); border-radius: 10px; padding: 10px 12px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
input:focus, textarea:focus { outline: none; border-color: var(--akzent); box-shadow: 0 0 0 3px var(--akzent-zart); }
textarea { resize: vertical; min-height: 160px; line-height: 1.55; display: block; }
::placeholder { color: var(--leise); opacity: 0.75; }

/* --- Hinweise und Meldungen ------------------------------------------------ */
.hinweis { margin: 10px 0 0; font-size: 13px; color: var(--leise); }
.mitte { text-align: center; }
.gedimmt { color: var(--leise); }
.meldung { margin: 0; padding: 12px 14px; border-radius: 12px; font-size: 14px; background: var(--flaeche); border: 1px solid var(--linie); }
.meldung.ok { background: var(--gruen-zart); border-color: transparent; color: var(--gruen); }
.meldung.fehler { background: var(--rot-zart); border-color: transparent; color: var(--rot); }
.hinweis-meldung { background: var(--gelb-zart); border-color: transparent; color: var(--gelb); }

/* --- ① Dateien und Vorschau ------------------------------------------------ */
.dateiwahl { display: grid; gap: 16px; }
@media (min-width: 900px) { .dateiwahl { grid-template-columns: 320px minmax(0, 1fr); gap: 22px; } }
.dateien { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; max-height: 420px; overflow-y: auto; }
.dateien li { display: flex; align-items: center; border-radius: 11px; border: 1px solid transparent; padding-right: 4px; transition: background 0.15s; }
.dateien li:hover { background: var(--flaeche); }
.dateien li.aktiv { background: var(--akzent-zart); border-color: color-mix(in srgb, var(--akzent) 30%, transparent); }
.dateien a { flex: 1; min-width: 0; display: flex; align-items: center; gap: 11px; padding: 10px; color: inherit; text-decoration: none; }
.dateien a .icon { color: var(--leise); }
.dateien li.aktiv a .icon { color: var(--akzent); }
.datei-text { min-width: 0; }
.datei-text b { display: block; font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dateien form { margin: 0; }
.dateien .icon-knopf { opacity: 0; }
.dateien li:hover .icon-knopf, .dateien li.aktiv .icon-knopf, .dateien .icon-knopf:focus-visible { opacity: 1; }
@media (hover: none) { .dateien .icon-knopf { opacity: 1; } }

.vorschau { border: 1px solid var(--linie); border-radius: 12px; overflow: auto; max-height: 420px; }
.vorschau table { width: 100%; border-collapse: collapse; font-size: 14px; }
.vorschau th { position: sticky; top: 0; background: var(--flaeche); text-align: left; font-size: 11.5px; font-weight: 600; color: var(--leise); text-transform: uppercase; letter-spacing: 0.05em; padding: 9px 12px; border-bottom: 1px solid var(--linie); }
.vorschau td { padding: 8px 12px; border-bottom: 1px solid var(--linie); vertical-align: top; overflow-wrap: anywhere; }
.vorschau tr:last-child td { border-bottom: 0; }
.vorschau td:first-child, .vorschau th:first-child { width: 1%; white-space: nowrap; text-align: right; color: var(--leise); font-variant-numeric: tabular-nums; }
.leer { margin: 0; color: var(--leise); font-size: 14px; }
.leer.gross { min-height: 200px; height: 100%; display: grid; place-content: center; justify-items: center; gap: 10px; padding: 24px; text-align: center; border: 1.5px dashed var(--linie); border-radius: 12px; }
.leer.gross .icon { width: 30px; height: 30px; opacity: 0.55; }
.leer.gross p { margin: 0; }

/* --- ② Text und ③ Prüfen --------------------------------------------------- */
.unten { display: grid; gap: 16px; margin: 0; }
@media (min-width: 900px) { .unten { grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); gap: 20px; } }
.schaetzung { margin: 0 0 14px; font-size: 14px; color: var(--leise); }
.schaetzung b { color: var(--text); }
.fortschritt { margin-top: 16px; }
.balken { height: 8px; border-radius: 99px; background: var(--flaeche); border: 1px solid var(--linie); overflow: hidden; }
.balken span { display: block; height: 100%; width: 0; border-radius: 99px; background: var(--akzent); transition: width 0.4s ease; }
#fehler { margin-top: 14px; }
.ergebnis { margin-top: 16px; padding: 14px; border-radius: 12px; background: var(--gruen-zart); display: grid; gap: 10px; justify-items: start; }
.ergebnis p { margin: 0; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ergebnis .knopf { background: var(--karte); }
.haken-rund { width: 22px; height: 22px; border-radius: 50%; background: var(--gruen); color: var(--karte); display: grid; place-items: center; }
.haken-rund .icon { width: 14px; height: 14px; stroke-width: 3; }
.legende { margin: 18px 0 0; padding-top: 16px; border-top: 1px solid var(--linie); display: grid; gap: 8px; font-size: 13px; color: var(--leise); }
.legende div { display: flex; align-items: center; gap: 10px; }
.legende dt, .legende dd { margin: 0; }
.legende .chip { min-width: 96px; justify-content: center; }

/* --- Chips ----------------------------------------------------------------- */
.chip { display: inline-flex; align-items: center; height: 24px; padding: 0 9px; border-radius: 99px; background: var(--flaeche); color: var(--leise); font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.chip.rot { background: var(--rot-zart); color: var(--rot); }
.chip.gelb { background: var(--gelb-zart); color: var(--gelb); }
.chip.blau { background: var(--blau-zart); color: var(--blau); }

/* --- Verlauf --------------------------------------------------------------- */
.verlauf { width: 100%; border-collapse: collapse; font-size: 14px; }
.verlauf th { padding: 0 10px 10px; border-bottom: 1px solid var(--linie); text-align: left; font-size: 11.5px; font-weight: 600; color: var(--leise); text-transform: uppercase; letter-spacing: 0.05em; white-space: nowrap; }
.verlauf td { padding: 12px 10px; border-bottom: 1px solid var(--linie); vertical-align: top; }
.verlauf th:first-child, .verlauf td:first-child { padding-left: 0; }
.verlauf th:last-child, .verlauf td:last-child { padding-right: 0; }
.verlauf tr:last-child td { border-bottom: 0; }
.verlauf .r { text-align: right; }
.verlauf .zahlen { white-space: nowrap; font-variant-numeric: tabular-nums; }
.verlauf .wann { white-space: nowrap; }
.verlauf .datei { font-weight: 500; overflow-wrap: anywhere; }
.verlauf .zitat { color: var(--leise); max-width: 300px; }
.verlauf td .chip { margin: 0 4px 4px 0; }
.verlauf td:last-child .icon-knopf { margin-top: -6px; }
@media (max-width: 760px) {
  .verlauf thead { display: none; }
  .verlauf, .verlauf tbody, .verlauf tr, .verlauf td { display: block; }
  .verlauf tr { position: relative; padding: 14px 0; border-bottom: 1px solid var(--linie); }
  .verlauf tr:last-child { border-bottom: 0; }
  .verlauf td { padding: 2px 44px 2px 0; border: 0; text-align: left !important; max-width: none !important; }
  .verlauf .zahlen { display: inline-block; padding-right: 14px; color: var(--leise); }
  .verlauf .zahlen::before { content: attr(data-label) " "; }
  .verlauf td:last-child { position: absolute; top: 14px; right: 0; padding: 0; }
  .verlauf td.chips-zelle { padding-top: 6px; }
}

/* --- Verwaltung ------------------------------------------------------------ */
.zurueck { display: inline-flex; align-items: center; gap: 6px; width: fit-content; color: var(--leise); text-decoration: none; font-size: 14px; font-weight: 500; }
.zurueck:hover { color: var(--text); }
.anlegen { display: grid; gap: 12px; align-items: end; }
@media (min-width: 760px) { .anlegen { grid-template-columns: 1fr 1fr auto auto; } }
.anzahl { padding: 1px 8px; border-radius: 99px; background: var(--flaeche); border: 1px solid var(--linie); font-size: 12px; font-weight: 600; color: var(--leise); }
.nutzerliste { list-style: none; margin: 0; padding: 0; }
/* Handy: Name · Admin · Löschen, darunter das Passwortfeld über die ganze Breite */
.nutzerliste li { display: grid; grid-template-columns: minmax(0, 1fr) auto 34px; gap: 10px 12px; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--linie); }
.nutzerliste .passwort { grid-row: 2; grid-column: 1 / -1; }
.nutzerliste .loeschen { grid-row: 1; grid-column: 3; }
.nutzerliste li:first-child { padding-top: 0; }
.nutzerliste li:last-child { border-bottom: 0; padding-bottom: 0; }
@media (min-width: 760px) {
  .nutzerliste li { grid-template-columns: minmax(0, 1fr) auto minmax(0, 320px) 34px; gap: 10px 16px; }
  .nutzerliste .passwort { grid-row: 1; grid-column: 3; }
  .nutzerliste .loeschen { grid-column: 4; }
}
.nutzerliste form { margin: 0; }
.wer { display: flex; align-items: center; gap: 12px; min-width: 0; }
.wer b { font-weight: 600; }
.avatar { width: 38px; height: 38px; border-radius: 50%; flex: none; background: var(--akzent-zart); color: var(--akzent); display: grid; place-items: center; font-weight: 700; }
.passwort { display: flex; gap: 8px; }
.passwort input { flex: 1; min-width: 0; height: 38px; padding: 0 10px; font-size: 14px; }

.schalter-label { display: inline-flex; align-items: center; gap: 9px; height: 38px; font-size: 14px; font-weight: 500; color: var(--text); cursor: pointer; }
.schalter { appearance: none; -webkit-appearance: none; position: relative; width: 38px; height: 22px; margin: 0; flex: none; border-radius: 99px; background: var(--linie); cursor: pointer; transition: background 0.2s; }
.schalter::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgb(0 0 0 / 25%); transition: transform 0.2s; }
.schalter:checked { background: var(--akzent); }
.schalter:checked::after { transform: translateX(16px); }
.schalter:disabled { opacity: 0.5; cursor: not-allowed; }

/* --- Anmelden -------------------------------------------------------------- */
.anmelden { min-height: calc(100vh - 100px); display: grid; place-items: center; }
.anmelden-karte { width: min(380px, 100%); display: grid; gap: 16px; padding: 30px 28px; }
.anmelden-karte .logo { justify-content: center; margin-bottom: 8px; }
