/* ============================================================================
   Wohnungs-Cockpit – Designsystem
   Professionell und ruhig, klar strukturiert, große Schrift und große
   Bedienflächen (für ältere Nutzer). Voll responsiv inkl. App-Ansicht mit
   unterer Tab-Leiste auf dem Handy.
   ========================================================================== */

:root {
  /* Grundfarben – ruhige, professionelle Palette */
  --bg:          #f3f4f6;
  --surface:     #ffffff;
  --surface-2:   #fafbfc;
  --ink:         #1f2933;
  --ink-soft:    #52606d;
  --ink-faint:   #7b8794;
  --line:        #e4e7eb;
  --line-stark:  #cbd2d9;

  /* Markenfarbe (Aktionen) */
  --brand:       #d75a22;
  --brand-dark:  #b5471a;
  --brand-tint:  #fbeadf;

  /* Ampel */
  --gruen:     #1f8a4c;  --gruen-bg:  #e6f4ec;
  --gelb:      #b7791f;  --gelb-bg:   #fbf1da;
  --rot:       #d13b3b;  --rot-bg:    #fbe4e4;

  --radius:   16px;
  --radius-s: 10px;
  --schatten:    0 1px 2px rgba(16,24,40,.05), 0 4px 14px rgba(16,24,40,.06);
  --schatten-s:  0 1px 2px rgba(16,24,40,.06);

  --nav-h: 66px;         /* untere Leiste (Handy) */
  --font: "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 18px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--brand-dark); }

h1 { font-size: 1.75rem; font-weight: 800; margin: 0 0 .25em; letter-spacing: -.01em; }
h2 { font-size: 1.35rem; font-weight: 800; margin: 1.3em 0 .5em; }
h3 { font-size: 1.12rem; font-weight: 700; margin: .2em 0 .6em; }
h4 { font-size: 1rem;    font-weight: 700; margin: .4em 0; }

/* ---------- Obere App-Leiste ---------- */
.appbar {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  box-shadow: var(--schatten-s);
  position: sticky; top: 0; z-index: 40;
}
.appbar-inner {
  max-width: 1180px; margin: 0 auto;
  display: flex; align-items: center; gap: 1rem;
  padding: .55rem 1.1rem;
}
.brand {
  display: inline-flex; align-items: center; gap: .55rem;
  text-decoration: none; font-weight: 800; font-size: 1.2rem;
  color: var(--ink); white-space: nowrap;
}
.brand-icon { width: 30px; height: 30px; border-radius: 8px; display: block; }
.brand span { color: var(--ink); }

.topnav { display: flex; gap: .2rem; margin-left: .5rem; flex: 1; flex-wrap: nowrap; }
.topnav a {
  text-decoration: none; color: var(--ink-soft); font-weight: 600;
  padding: .55rem .8rem; border-radius: var(--radius-s);
  display: inline-flex; align-items: center; gap: .4rem; white-space: nowrap;
}
.topnav a:hover { background: var(--surface-2); color: var(--ink); }
.topnav a.aktiv, .topnav a.offen { background: var(--brand-tint); color: var(--brand-dark); }
.topnav .ico { font-size: 1.1rem; }

/* Zweite Navi-Ebene (Unterpunkte) */
.subnav-wrap { border-top: 1px solid var(--line); background: var(--surface-2); }
.subnav[hidden] { display: none; }
.subnav-inner {
  max-width: 1180px; margin: 0 auto; display: flex; flex-wrap: wrap; gap: .35rem;
  padding: .55rem 1.1rem;
}
.subnav-inner a {
  text-decoration: none; color: var(--ink-soft); font-weight: 600; font-size: .95rem;
  padding: .42rem .8rem; border-radius: 999px; white-space: nowrap;
  display: inline-flex; align-items: center; gap: .4rem;
  background: var(--surface); border: 1px solid var(--line);
}
.subnav-inner a:hover { border-color: var(--brand); color: var(--ink); }
.subnav-inner a.aktiv { background: var(--brand); color: #fff; border-color: var(--brand); }
.subnav-inner .sub-uebersicht { color: var(--ink-faint); }
.subnav-inner .sub-ico { font-size: 1.05rem; }

.nutzer-box { margin-left: auto; display: flex; align-items: center; gap: .7rem; }
.nutzer-name {
  font-weight: 700; color: var(--ink-soft); max-width: 180px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.logout {
  text-decoration: none; font-weight: 600;
  color: var(--ink-soft); padding: .5rem .9rem; border-radius: var(--radius-s);
  border: 1px solid var(--line); white-space: nowrap;
}
.logout:hover { background: var(--surface-2); }

/* Appbar darf bei vielen Elementen umbrechen statt zu überlaufen */
.appbar-inner { flex-wrap: wrap; }

/* Globale Suche in der Appbar */
.global-suche { display: flex; align-items: center; gap: .25rem; }
.global-suche input {
  padding: .45rem .7rem; border: 1px solid var(--line); border-radius: 999px;
  background: var(--surface-2); color: var(--ink); font-size: .95rem; width: 170px; max-width: 40vw;
}
.global-suche input:focus { outline: none; border-color: var(--brand); background: #fff; }
.global-suche button {
  border: none; background: none; cursor: pointer; font-size: 1.15rem; padding: .3rem .4rem; border-radius: 8px;
}
.global-suche button:hover { background: var(--surface-2); }

/* Schriftgröße-Regler */
.schrift-regler { display: flex; align-items: center; gap: .25rem; }
.schrift-regler .sr-label { font-size: .8rem; color: var(--ink-faint); font-weight: 600; margin-right: .1rem; }
.schrift-regler button {
  border: 1px solid var(--line); background: var(--surface); color: var(--ink-soft);
  border-radius: 8px; cursor: pointer; padding: .15rem .55rem; font-weight: 800; line-height: 1.1;
}
.schrift-regler .sr-a1 { font-size: .8rem; }
.schrift-regler .sr-a2 { font-size: 1rem; }
.schrift-regler .sr-a3 { font-size: 1.2rem; }
.schrift-regler button:hover { border-color: var(--brand); color: var(--ink); }
.schrift-regler button.aktiv { background: var(--brand); color: #fff; border-color: var(--brand); }

/* Inline-Hilfe „Was kann ich hier tun?" */
.hilfe-box {
  background: #eef4fb; border: 1px solid #cfe0f2; border-radius: var(--radius);
  padding: .3rem 1rem; margin-bottom: 1.2rem;
}
.hilfe-box summary {
  cursor: pointer; font-weight: 700; color: #1c4e86; padding: .6rem 0; list-style: none;
}
.hilfe-box summary::-webkit-details-marker { display: none; }
.hilfe-box p { margin: 0 0 .8rem; color: var(--ink-soft); line-height: 1.5; }

/* ---------- Untere Tab-Leiste (App-Ansicht, nur Handy) ---------- */
.bottomnav { display: none; }

/* ---------- Layout ---------- */
main {
  max-width: 1180px; margin: 0 auto;
  padding: 1.5rem 1.1rem 3rem;
}
.kopf-zeile {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; flex-wrap: wrap; margin-bottom: .4rem;
}

/* ---------- Knöpfe ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  font-family: inherit; font-size: 1rem; font-weight: 700; line-height: 1.1;
  padding: .75rem 1.25rem; min-height: 52px;
  border: 1px solid transparent; border-radius: 12px; cursor: pointer;
  text-decoration: none; transition: background .12s, box-shadow .12s, transform .04s;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primar { background: var(--brand); color: #fff; box-shadow: var(--schatten-s); }
.btn-primar:hover { background: var(--brand-dark); }
.btn-grau  { background: var(--surface); color: var(--ink); border-color: var(--line-stark); }
.btn-grau:hover { background: var(--surface-2); }
.btn-rot   { background: var(--rot-bg); color: var(--rot); }
.btn-rot:hover { background: #f7d3d3; }
.btn-klein { min-height: 42px; padding: .45rem .85rem; font-size: .92rem; border-radius: 10px; }
.btn-gross { min-height: 60px; font-size: 1.1rem; padding: .9rem 1.6rem; }

/* ---------- Karten ---------- */
.karte {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--schatten);
  padding: 1.3rem 1.4rem; margin-bottom: 1.3rem;
}
.karte > h3:first-child { margin-top: 0; }

/* ---------- Statusleiste (Cockpit) ---------- */
.status-leiste { display: flex; gap: .7rem; flex-wrap: wrap; margin: 1.1rem 0 1.5rem; }
.status-pill {
  display: inline-flex; align-items: center; gap: .6rem;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 999px; padding: .5rem 1.1rem; font-weight: 600; color: var(--ink-soft);
  box-shadow: var(--schatten-s); text-decoration: none;
}
.status-pill .zahl { font-size: 1.35rem; font-weight: 800; color: var(--ink); }
.filter-pill { cursor: pointer; text-decoration: none; color: inherit; transition: border-color .1s, box-shadow .1s; }
.filter-pill:hover { border-color: var(--brand); }
.status-pill.aktiv { border-color: var(--brand); box-shadow: 0 0 0 2px var(--brand-tint); }
.punkt { width: 20px; height: 20px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
.punkt.gruen { background: var(--gruen); }
.punkt.gelb  { background: var(--gelb); }
.punkt.rot   { background: var(--rot); }

/* Lade-Overlay (Upload / Auslesen) */
.lade-overlay {
  position: fixed; inset: 0; z-index: 100; padding: 1rem;
  background: rgba(16,24,40,.55); display: flex; align-items: center; justify-content: center;
}
.lade-overlay[hidden] { display: none; }   /* hidden-Attribut muss die display:flex-Regel schlagen */
.lade-box {
  background: var(--surface); border-radius: var(--radius); box-shadow: 0 20px 60px rgba(16,24,40,.3);
  padding: 2rem 2.2rem; max-width: 420px; width: 100%; text-align: center;
}
.lade-spinner {
  width: 56px; height: 56px; margin: 0 auto 1rem; border-radius: 50%;
  border: 6px solid var(--line); border-top-color: var(--brand);
  animation: lade-dreh .9s linear infinite;
}
@keyframes lade-dreh { to { transform: rotate(360deg); } }
.lade-titel { font-weight: 800; font-size: 1.1rem; margin-bottom: .35rem; }
.lade-schritt { color: var(--brand-dark); font-weight: 600; margin-bottom: .9rem; }
.lade-bar { height: 10px; border-radius: 999px; background: var(--line); overflow: hidden; }
.lade-bar > i { display: block; height: 100%; width: 12%; border-radius: 999px;
  background: var(--brand); transition: width .6s ease; }
.lade-proz { font-weight: 800; font-size: 1.15rem; margin-top: .5rem; color: var(--ink); }
.lade-hinweis { font-size: .85rem; margin-top: .8rem; }

/* Vorschlag: passendes Objekt beim Upload */
.vorschlag-box {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  background: var(--brand-tint); border: 1px solid var(--brand); border-radius: var(--radius);
  padding: 1rem 1.2rem; margin-bottom: .4rem;
}
.vorschlag-info { min-width: 0; }
.vorschlag-label { font-weight: 800; color: var(--brand-dark); }
.vorschlag-name { font-weight: 700; font-size: 1.05rem; margin: .15rem 0; }
.vorschlag-box .btn { flex-shrink: 0; }

/* Filterleiste (Objektart / Gebäude) */
.filter-leiste { display: flex; align-items: flex-end; gap: 1rem; flex-wrap: wrap; margin: 0 0 1.3rem; }
.filter-feld { display: flex; flex-direction: column; gap: .25rem; font-weight: 700; font-size: .85rem; color: var(--ink-soft); }
.filter-feld select {
  font-size: 1rem; padding: .55rem .7rem; border: 1px solid var(--line);
  border-radius: var(--radius-s); background: #fff; color: var(--ink); min-width: 230px;
}
.filter-reset { align-self: flex-end; }

/* Inventar: Ändern-Button + Bearbeiten-Zeile */
.inv-akt { display: flex; gap: .3rem; justify-content: flex-end; align-items: center; }
.inv-edit-row > td { background: var(--surface-2); }
.inv-edit-form { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; padding: .35rem 0; }
.inv-edit-form input {
  padding: .5rem .65rem; border: 1px solid var(--line); border-radius: var(--radius-s);
  background: #fff; color: var(--ink); font-size: .95rem;
}
.inv-edit-form input[name="gegenstand"] { flex: 1; min-width: 180px; }

/* Inventarliste (Ansicht) */
.inv-liste .felder { color: var(--ink-soft); margin: 0 0 .8rem; }
.inv-raum { margin: 1.3rem 0 .3rem; }
.inv-sig { width: 100%; margin-top: 2.2rem; border-collapse: collapse; }
.inv-sig td { border: none; border-top: 1px solid var(--ink); padding-top: .35rem; font-size: .85rem; width: 50%; }

/* ---------- Kacheln (Wohnungen) ---------- */
.kacheln {
  display: grid; gap: 1.1rem;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  margin-bottom: 1.3rem;   /* gleicher Abstand wie zwischen den Karten darunter */
}
.kachel {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--schatten);
  text-decoration: none; color: var(--ink);
  display: flex; flex-direction: column; overflow: hidden; position: relative;
  transition: transform .1s ease, box-shadow .1s ease;
}
.kachel::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 8px; background: var(--line-stark); }
.kachel.gruen::before { background: var(--gruen); }
.kachel.gelb::before  { background: var(--gelb); }
.kachel.rot::before   { background: var(--rot); }
.kachel:hover { transform: translateY(-2px); box-shadow: 0 8px 22px rgba(16,24,40,.12); }
.kachel-kopf { display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding: 1.05rem 1.15rem .3rem 1.5rem; }
.kachel-haus { font-size: 1.7rem; line-height: 1; }
.kachel-body { padding: .2rem 1.15rem 1.15rem 1.5rem; flex: 1; }
.kachel .name { font-weight: 800; font-size: 1.1rem; line-height: 1.25; }
.kachel .adr { color: var(--ink-faint); font-size: .96rem; margin-top: .15rem; }
.kachel .zahlen { margin-top: .7rem; font-size: .95rem; color: var(--ink-soft); }
.kachel .zahlen b { color: var(--ink); }

/* ---------- Badges ---------- */
.badge {
  display: inline-flex; align-items: center; gap: .4rem;
  font-weight: 700; font-size: .88rem;
  padding: .3rem .7rem; border-radius: 999px; white-space: nowrap;
}
.badge.gruen { background: var(--gruen-bg); color: var(--gruen); }
.badge.gelb  { background: var(--gelb-bg);  color: var(--gelb); }
.badge.rot   { background: var(--rot-bg);   color: var(--rot); }
.badge.info  { background: #e7edf3; color: #3a4a5a; }
.badge .punkt { width: 12px; height: 12px; }

.beispiel-tag {
  font-size: .74rem; font-weight: 700; color: var(--ink-faint);
  background: #eef1f4; padding: .12rem .5rem; border-radius: 6px; margin-left: .4rem;
  vertical-align: middle;
}

/* Mieter auf der Kachel */
.mieter-zeile {
  margin-top: .55rem; font-weight: 700; color: var(--ink);
  display: flex; align-items: center; gap: .35rem;
}
.kachel-info { margin-top: .3rem; font-size: .9rem; color: var(--ink-soft); }
.kachel-info.frei { color: var(--brand-dark); font-weight: 600; }

/* Werkzeug-Leiste (Cockpit) */
.werkzeuge { display: flex; gap: .5rem; flex-wrap: wrap; margin: .2rem 0 .4rem; }

/* Bereichsseiten (Landing mit großen Kacheln) */
.bereich-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); margin-top: 1.2rem; }
.bereich-karte {
  display: flex; align-items: center; gap: 1.1rem; text-decoration: none; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--schatten); padding: 1.4rem 1.4rem; min-height: 92px;
  transition: transform .08s, box-shadow .08s, border-color .08s;
}
.bereich-karte:hover { transform: translateY(-2px); box-shadow: 0 8px 22px rgba(16,24,40,.12); border-color: var(--brand); }
.bk-icon {
  font-size: 2rem; line-height: 1; flex-shrink: 0;
  width: 60px; height: 60px; border-radius: 14px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--brand-tint);
}
.bk-text { display: flex; flex-direction: column; gap: .2rem; }
.bk-label { font-weight: 800; font-size: 1.2rem; }
.bk-hint { color: var(--ink-faint); font-size: .92rem; line-height: 1.35; }

/* Monatskalender (Cockpit) */
.kal-karte { margin-top: 0; }   /* Abstand kommt aus margin-bottom der Karte darüber (einheitlich 1,3rem) */
.kal-kopf { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; margin-bottom: .85rem; }
.kal-titel { font-size: 1.25rem; margin: 0; }
.kal-pfeil {
  text-decoration: none; font-size: 1.5rem; line-height: 1; color: var(--ink-soft);
  width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--line);
  display: inline-flex; align-items: center; justify-content: center;
}
.kal-pfeil:hover { background: var(--surface-2); border-color: var(--brand); color: var(--brand-dark); }
.kal-legende { margin-left: auto; display: flex; gap: 1rem; color: var(--ink-faint); font-size: .9rem; align-items: center; }
.kal-legende i { display: inline-block; width: 11px; height: 11px; border-radius: 3px; margin-right: .3rem; vertical-align: middle; }
.pkt-termin { background: var(--brand); }
.pkt-aufgabe { background: #2d76c9; }
.pkt-frist { background: #e0a423; }

.kal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.kal-wt { text-align: center; font-weight: 700; color: var(--ink-faint); font-size: .85rem; padding: .2rem 0; }
.kal-tag {
  min-height: 92px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface);
  padding: .35rem; display: flex; flex-direction: column; gap: 3px; overflow: hidden;
}
.kal-tag.klickbar { cursor: pointer; }
.kal-tag.klickbar:hover { border-color: var(--brand); background: var(--brand-tint); }
.kal-tag.leer { background: transparent; border: none; }
.kal-tag.heute { border-color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand); }
.kal-num { font-weight: 700; font-size: .9rem; color: var(--ink-soft); }
.kal-tag.heute .kal-num {
  background: var(--brand); color: #fff; width: 24px; height: 24px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center; align-self: flex-start;
}
.kal-item {
  display: block; text-decoration: none; font-size: .78rem; line-height: 1.2;
  padding: .18rem .35rem; border-radius: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.kal-item.termin { background: var(--brand-tint); color: var(--brand-dark); }
.kal-item.aufgabe { background: #e7f0fb; color: #1c4e86; }
.kal-item.frist { background: #fdf1d4; color: #8a5a00; }
.kal-mehr { font-size: .72rem; color: var(--ink-faint); padding-left: .2rem; }
.kal-tipp { font-size: .85rem; margin: .6rem 0 0; }
.kal-fuss { display: flex; gap: .5rem; margin-top: .9rem; flex-wrap: wrap; }

/* Kalender: Titelzeile mit Einklappen + Monat/Liste-Umschalter */
.kal-titelzeile { display: flex; align-items: center; justify-content: space-between; gap: .6rem; flex-wrap: wrap; }
.kal-toggle {
  background: none; border: none; cursor: pointer; padding: .2rem .1rem;
  font-size: 1.2rem; font-weight: 800; color: var(--ink);
  display: inline-flex; align-items: center; gap: .45rem;
}
.kal-chevron { font-size: .9rem; color: var(--ink-soft); transition: transform .15s; }
.kal-karte.kal-zu .kal-chevron { transform: rotate(-90deg); }
.kal-switch { flex-shrink: 0; }
.kal-body { margin-top: .7rem; }
.kal-body[hidden] { display: none; }

/* Kalender: Listenansicht */
.kal-liste { list-style: none; margin: .3rem 0 0; padding: 0; display: flex; flex-direction: column; gap: .4rem; }
.kal-le {
  display: flex; align-items: baseline; gap: .9rem;
  padding: .6rem .8rem; border: 1px solid var(--line); border-radius: 10px;
  background: var(--surface); border-left: 4px solid var(--brand);
}
.kal-le.aufgabe { border-left-color: #2d76c9; }
.kal-le.frist { border-left-color: #e0a423; }
.kal-le-datum { flex: 0 0 auto; min-width: 155px; color: var(--ink-soft); font-weight: 600; font-size: .92rem; }
.kal-le-titel { text-decoration: none; color: var(--ink); font-weight: 600; }
.kal-le-titel:hover { text-decoration: underline; }
.kal-le-icon { margin-right: .2rem; }
@media (max-width: 560px) {
  .kal-le { flex-direction: column; gap: .15rem; }
  .kal-le-datum { min-width: 0; }
}

@media (max-width: 560px) {
  .kal-grid { gap: 3px; }
  .kal-legende { width: 100%; margin-left: 0; }
  .kal-tag { min-height: 54px; padding: .25rem; gap: 2px; }
  .kal-item { height: 5px; padding: 0; font-size: 0; border-radius: 3px; }
  .kal-item.termin { background: var(--brand); }
  .kal-item.aufgabe { background: #2d76c9; }
  .kal-item.frist { background: #e0a423; }
  .kal-mehr { font-size: .6rem; }
}

/* Kalender: Dialog „Neuer Termin" */
.kal-dialog {
  border: none; border-radius: var(--radius); padding: 1.4rem; width: min(460px, 94vw);
  box-shadow: 0 20px 60px rgba(16,24,40,.28); color: var(--ink); background: var(--surface);
}
.kal-dialog::backdrop { background: rgba(16,24,40,.45); }
.kal-dialog-form label { display: block; font-weight: 600; margin-top: .7rem; font-size: .95rem; }
.kal-dialog-form input, .kal-dialog-form select, .kal-dialog-form textarea {
  width: 100%; margin-top: .25rem; padding: .6rem .7rem; font-size: 1rem;
  border: 1px solid var(--line); border-radius: var(--radius-s); background: #fff; color: var(--ink);
}
.kal-dialog-reihe { display: flex; gap: .8rem; }
.kal-dialog-reihe label { flex: 1; }
.kal-dialog-aktionen { display: flex; justify-content: flex-end; gap: .6rem; margin-top: 1.2rem; }

/* ---------- KI-Prüfung ---------- */
.ki-status { font-size: 1.05rem; margin: 0; }
.ki-status.leer { color: #8a6d00; }
.btn-ki { background: #6b4de6; color: #fff; border: 1px solid #6b4de6; }
.btn-ki:hover { background: #5a3fce; border-color: #5a3fce; color: #fff; }
.ki-start { display: flex; flex-direction: column; gap: .6rem; }
.ki-lauf { color: var(--brand-dark); font-weight: 600; }
.ki-datenschutz { font-size: .88rem; margin: 0; }
pre.code, .code {
  background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-s);
  padding: .8rem 1rem; overflow-x: auto; font-size: .9rem; white-space: pre;
}

.ki-kopf { display: flex; align-items: center; gap: .8rem; flex-wrap: wrap; margin-bottom: .3rem; }
.ki-ampel { font-weight: 800; font-size: 1.15rem; padding: .3rem .8rem; border-radius: 999px; }
.ki-ampel.ki-gruen { background: var(--gruen-bg); color: var(--gruen); }
.ki-ampel.ki-gelb  { background: var(--gelb-bg);  color: #8a6d00; }
.ki-ampel.ki-rot   { background: var(--rot-bg);   color: var(--rot); }
.ki-stand { margin-left: auto; font-size: .88rem; }
.ki-summe { font-size: 1.05rem; margin: .4rem 0 1rem; }
.ki-fehlend { background: var(--gelb-bg); border-radius: var(--radius-s); padding: .7rem 1rem; margin-bottom: 1rem; }
.ki-fehlend h4 { margin: 0 0 .3rem; }
.ki-fehlend ul { margin: 0; padding-left: 1.2rem; }

.ki-liste { list-style: none; margin: .4rem 0 0; padding: 0; display: flex; flex-direction: column; gap: .7rem; }
.ki-befund { border: 1px solid var(--line); border-left: 5px solid var(--line-stark); border-radius: 10px; padding: .8rem 1rem; }
.ki-befund.ki-s-hoch    { border-left-color: var(--rot); }
.ki-befund.ki-s-mittel  { border-left-color: #e0a423; }
.ki-befund.ki-s-niedrig { border-left-color: #2d76c9; }
.ki-befund.ki-s-ok      { border-left-color: var(--gruen); }
.ki-befund-kopf { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.ki-schwere { font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .03em;
  padding: .15rem .5rem; border-radius: 6px; color: #fff; }
.ki-schwere.ki-s-hoch    { background: var(--rot); }
.ki-schwere.ki-s-mittel  { background: #e0a423; }
.ki-schwere.ki-s-niedrig { background: #2d76c9; }
.ki-schwere.ki-s-ok      { background: var(--gruen); }
.ki-kat { font-size: .8rem; color: var(--ink-faint); background: var(--surface-2); padding: .1rem .5rem; border-radius: 6px; }
.ki-problem { margin: .5rem 0 .3rem; }
.ki-empf { margin: .3rem 0; }
.ki-recht { margin: .3rem 0 0; color: var(--ink-soft); font-size: .9rem; }
.ki-hinweis { margin-top: 1.2rem; padding-top: .8rem; border-top: 1px solid var(--line);
  color: var(--ink-faint); font-size: .88rem; }
.ki-befund-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-top: 1rem; }
.ki-uebernehmen { margin: .6rem 0 0; }
.ki-uebernommen { margin: .6rem 0 0; color: var(--gruen); font-weight: 700; }
.ki-alle-unten { margin: 1.3rem 0 .3rem; text-align: center; }

/* Selbstauskunft-Formular */
.sa-wrap { max-width: 720px; margin: 1rem auto; }
.sa-kopf { text-align: center; margin-bottom: 1.2rem; }
.sa-kopf img { width: 56px; height: 56px; border-radius: 14px; }
.sa-kopf h1 { margin: .4rem 0 .1rem; }
.sa-intro { text-align: left; background: var(--surface-2); border-radius: var(--radius-s);
  padding: .7rem 1rem; color: var(--ink-soft); font-size: .92rem; margin-top: .8rem; }
.sa-abschnitt { margin: 1.4rem 0 .4rem; padding-bottom: .3rem;
  border-bottom: 2px solid var(--brand-tint); color: var(--brand-dark); font-size: 1.12rem; }
.sa-check { display: flex; align-items: flex-start; gap: .6rem; font-weight: 600; margin: .5rem 0; line-height: 1.4; }
.sa-check input { margin-top: .2rem; width: 20px; height: 20px; flex-shrink: 0; }

/* Bewerber: vollständige Selbstauskunft */
.sa-details { margin-top: .6rem; }
.sa-details summary { cursor: pointer; font-weight: 700; color: var(--brand-dark); }
.sa-dl { display: grid; grid-template-columns: 1fr 1fr; gap: 0 .8rem; margin: .6rem 0 0; }
.sa-dl > div { display: flex; gap: .5rem; border-bottom: 1px solid var(--line); padding: .3rem 0; }
.sa-dl dt { font-weight: 700; color: var(--ink-soft); min-width: 140px; margin: 0; }
.sa-dl dd { margin: 0; }
@media (max-width: 560px) { .sa-dl { grid-template-columns: 1fr; } }
.bw-dateien { display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; margin-top: .5rem; }

/* Fristen & Erinnerungen */
.fristen-karte summary { cursor: pointer; list-style: none; }
.fristen-karte summary::-webkit-details-marker { display: none; }
.fristen-karte .frist-titel { font-size: 1.12rem; font-weight: 700; }
.fristen-karte summary::before { content: "▸ "; color: var(--ink-faint); }
.fristen-karte[open] summary::before { content: "▾ "; }
.fristen-karte .liste li { padding-left: .6rem; border-left: 5px solid var(--line-stark); border-radius: 4px; margin-bottom: 2px; }
.frist-icon { font-size: 1.3rem; }
.frist-hoch   { border-left-color: var(--rot) !important; background: var(--rot-bg); }
.frist-mittel { border-left-color: var(--gelb) !important; background: var(--gelb-bg); }
.frist-niedrig{ border-left-color: var(--line-stark) !important; }
.frist-info   { border-left-color: var(--line-stark) !important; }

/* Umschalter Kacheln/Liste */
.ansicht-schalter {
  display: inline-flex; background: var(--surface); border: 1px solid var(--line);
  border-radius: 999px; padding: 3px; box-shadow: var(--schatten-s);
}
.ansicht-schalter a {
  text-decoration: none; color: var(--ink-soft); font-weight: 700;
  padding: .4rem .9rem; border-radius: 999px; font-size: .95rem;
}
.ansicht-schalter a.aktiv { background: var(--brand); color: #fff; }

/* ---------- Formulare ---------- */
form.stack { display: grid; gap: 1.1rem; }
.feld { display: flex; flex-direction: column; gap: .35rem; }
.feld label { font-weight: 700; color: var(--ink); }
.feld .hinweis { color: var(--ink-faint); font-size: .88rem; font-weight: 400; }
input[type=text], input[type=number], input[type=date], input[type=email],
input[type=tel], input[type=password], input[type=file], select, textarea {
  font-family: inherit; font-size: 1.02rem; color: var(--ink);
  padding: .72rem .85rem; border: 1.5px solid var(--line-stark);
  border-radius: var(--radius-s); background: #fff; width: 100%;
}
input:focus, select:focus, textarea:focus {
  outline: 3px solid var(--brand-tint); outline-offset: 0; border-color: var(--brand);
}
textarea { min-height: 92px; resize: vertical; }
.raster2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.raster3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 1rem; }
.aktionen { display: flex; gap: .8rem; flex-wrap: wrap; margin-top: .4rem; }

/* Auswahl-Kacheln (Status-Radios) */
.wahl {
  display: flex; align-items: center; gap: .55rem; cursor: pointer;
  border: 1.5px solid var(--line-stark); border-radius: var(--radius-s);
  padding: .7rem .85rem; font-weight: 700; background: #fff;
}
.wahl input { width: auto; margin: 0; accent-color: var(--brand); transform: scale(1.25); }
.wahl:hover { background: var(--surface-2); }

/* ---------- Tabellen / Listen ---------- */
.tabelle-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: .75rem .6rem; border-bottom: 1px solid var(--line); }
th { color: var(--ink-faint); font-size: .82rem; text-transform: uppercase; letter-spacing: .03em; font-weight: 700; }
tr:last-child td { border-bottom: none; }

.liste { list-style: none; padding: 0; margin: 0; }
.liste li {
  display: flex; align-items: center; gap: .85rem;
  padding: .8rem .1rem; border-bottom: 1px solid var(--line);
}
.liste li:last-child { border-bottom: none; }
.liste .erledigt { text-decoration: line-through; color: var(--ink-faint); }

/* Große Checkbox */
.check {
  width: 32px; height: 32px; border: 2px solid var(--line-stark); border-radius: 9px;
  background: #fff; cursor: pointer; display: inline-flex; align-items: center;
  justify-content: center; font-size: 1.25rem; color: #fff; flex-shrink: 0; padding: 0;
}
.check:hover { border-color: var(--gruen); }
.check.an { background: var(--gruen); border-color: var(--gruen); }

/* ---------- Zählerstände ---------- */
.zaehler-block {
  border: 1px solid var(--line); border-radius: var(--radius-s);
  padding: 1rem 1.1rem; margin-bottom: 1rem; background: var(--surface-2);
}
.zaehler-kopf {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; flex-wrap: wrap;
}
.z-titel { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.z-icon { font-size: 1.5rem; }
.z-letzter b { font-size: 1.15rem; }
.z-aktionen {
  display: flex; align-items: end; gap: .8rem; flex-wrap: wrap; margin-top: .8rem;
}
.z-manuell { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.z-manuell input { width: auto; }
.z-manuell input[type=number] { max-width: 200px; }
.z-verlauf { margin-top: .7rem; }
.z-verlauf summary { cursor: pointer; font-weight: 700; color: var(--ink-soft); }

/* Verbrauch-Schaubild */
.legende { display: flex; gap: 1.2rem; flex-wrap: wrap; color: var(--ink-soft); font-size: .9rem; margin: .2rem 0 .6rem; }
.legende span { display: inline-flex; align-items: center; gap: .4rem; }
.lg-box { width: 16px; height: 12px; border-radius: 3px; display: inline-block; }
.lg-line { width: 16px; height: 0; border-top: 2px dashed var(--ink); display: inline-block; }

/* Baumarkt-Angebote */
.markt-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); margin-top: 1rem; }
.markt-karte { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--schatten); overflow: hidden; }
.markt-kopf { display: flex; align-items: center; gap: .6rem; padding: .9rem 1rem; color: #fff; }
.markt-logo { background: rgba(255,255,255,.25); border-radius: 8px; padding: .15rem .55rem; font-weight: 800; }
.markt-name { font-weight: 800; font-size: 1.1rem; }
.markt-body { padding: .8rem 1rem 1.1rem; }
.markt-aktionen { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: .8rem; }

/* Toast-Hinweis */
.toast {
  position: fixed; left: 50%; bottom: calc(var(--nav-h) + 20px); transform: translateX(-50%);
  background: var(--ink); color: #fff; padding: .7rem 1.1rem; border-radius: 12px;
  z-index: 100; box-shadow: 0 6px 20px rgba(0,0,0,.25); font-weight: 600; max-width: 92vw; text-align: center;
}

/* ---------- Unterschriften-Pad ---------- */
.sigpad {
  width: 100%; max-width: 460px; height: 150px; background: #fff;
  border: 2px dashed var(--line-stark); border-radius: var(--radius-s);
  touch-action: none; cursor: crosshair; display: block;
}
.sig-vorhanden { max-width: 220px; border: 1px solid var(--line); border-radius: 8px; background: #fff; margin-bottom: .3rem; display: block; }

/* ---------- Bildergalerie ---------- */
.galerie {
  display: grid; gap: .8rem;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
}
.galerie-item { position: relative; }
.galerie-item img {
  width: 100%; height: 130px; object-fit: cover;
  border-radius: var(--radius-s); border: 1px solid var(--line); display: block;
}
.bild-loeschen {
  position: absolute; top: 6px; right: 6px;
  border: none; border-radius: 8px; cursor: pointer;
  background: rgba(255,255,255,.9); font-size: 1rem; padding: .25rem .4rem;
  line-height: 1; box-shadow: var(--schatten-s);
}
.bild-loeschen:hover { background: #fff; }

/* ---------- Vertrags-Konfigurator ---------- */
.konf-grid { display: grid; grid-template-columns: 1fr 260px; gap: 1.1rem; align-items: start; }
.wohnungswahl { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px,1fr)); gap: .6rem; }
.whl-karte {
  display: flex; align-items: flex-start; gap: .5rem; text-align: left;
  border: 1.5px solid var(--line-stark); background: #fff; border-radius: var(--radius-s);
  padding: .6rem .7rem; cursor: pointer; font: inherit; color: var(--ink);
  overflow: hidden;
}
.whl-karte:hover { background: var(--surface-2); border-color: var(--brand); }
.whl-karte.aktiv { border-color: var(--brand); background: var(--brand-tint); }
.whl-haus { font-size: 1.4rem; flex-shrink: 0; }
.whl-txt { min-width: 0; overflow-wrap: anywhere; word-break: break-word; line-height: 1.3; }
.dropzone {
  border: 2px dashed var(--line-stark); border-radius: var(--radius-s);
  min-height: 120px; padding: 1rem; display: flex; flex-direction: column;
  justify-content: center; text-align: center; background: var(--surface-2);
}
.dropzone .dz-name { font-weight: 800; font-size: 1.05rem; margin-top: .3rem; }
.gesamt-box {
  margin-top: .8rem; padding: .7rem 1rem; border-radius: var(--radius-s);
  background: var(--brand-tint); color: var(--brand-dark); font-size: 1.15rem;
}
.gesamt-box b { font-size: 1.3rem; }
@media (max-width: 640px) { .konf-grid { grid-template-columns: 1fr; } }

/* ---------- Vertrag Druckansicht ---------- */
.vertrag-druck h2 { font-size: 1.15rem; border-bottom: 1px solid var(--line); padding-bottom: 3px; margin-top: 1.4rem; }
.vertrag-druck table { width: 100%; border-collapse: collapse; }
.vertrag-druck .box { border: 1px solid var(--line); }
.vertrag-druck .parteien td { width: 50%; border: 1px solid var(--line); padding: 8px; vertical-align: top; }

/* ---------- Meldungen ---------- */
.meldungen { margin-bottom: 1.1rem; }
.meldung {
  padding: 1.1rem 1.3rem; border-radius: 12px; margin-bottom: .7rem; font-weight: 700;
  font-size: 1.15rem; display: flex; align-items: center; gap: .7rem;
  border: 2px solid transparent; box-shadow: var(--schatten-s);
}
.meldung-icon { font-size: 1.5rem; flex-shrink: 0; }
.meldung-text { flex: 1; }
.meldung-zu {
  flex-shrink: 0; background: none; border: none; cursor: pointer; font-size: 1.25rem;
  line-height: 1; color: inherit; opacity: .6; padding: .2rem .4rem; border-radius: 8px;
}
.meldung-zu:hover { opacity: 1; background: rgba(0,0,0,.06); }
.meldung.ok     { background: var(--gruen-bg); color: var(--gruen); border-color: #a9d8ba; }
.meldung.fehler { background: var(--rot-bg);   color: var(--rot);   border-color: #eba9a9; }

/* ---------- Leerzustand ---------- */
.leer-zustand { text-align: center; padding: 3rem 1.2rem; color: var(--ink-soft); }
.leer-zustand .gross { font-size: 3.2rem; }

/* ---------- Hilfsklassen ---------- */
.muted { color: var(--ink-faint); }
.rechts { text-align: right; }
.trenn { height: 1px; background: var(--line); border: none; margin: 1.2rem 0; }
.zurueck { display: inline-flex; align-items: center; gap: .35rem; margin-bottom: .9rem; font-weight: 600; text-decoration: none; color: var(--ink-soft); }
.zurueck:hover { color: var(--brand-dark); }
.info-box { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-s); padding: 1rem 1.15rem; color: var(--ink-soft); }

/* ---------- Login ---------- */
.login-wrap { min-height: 82vh; display: flex; align-items: center; justify-content: center; }
.login-box {
  width: 100%; max-width: 400px; background: var(--surface);
  border-radius: var(--radius); box-shadow: var(--schatten);
  padding: 2.2rem 2rem; text-align: center; border: 1px solid var(--line);
}
.login-box .brand-icon-gross { width: 64px; height: 64px; border-radius: 16px; }

/* Google-Login-Knopf */
.google-btn {
  width: 100%; background: #fff; color: #3c4043;
  border: 1.5px solid var(--line-stark); font-weight: 700; margin-top: .4rem;
  gap: .7rem;
}
.google-btn:hover { background: #f7f8fa; }
.google-btn .g-logo { display: inline-flex; }
.oder {
  display: flex; align-items: center; gap: .8rem; color: var(--ink-faint);
  font-size: .85rem; margin: 1.2rem 0 .2rem;
}
.oder::before, .oder::after { content: ""; height: 1px; background: var(--line); flex: 1; }

/* ---------- Upload-Prüfseite ---------- */
.pruef-grid { display: grid; grid-template-columns: 300px 1fr; gap: 1.3rem; align-items: start; }
.vorschau-karte { position: sticky; top: 90px; }
.vorschau-bild { width: 100%; border-radius: var(--radius-s); border: 1px solid var(--line); background: #fff; }
.treffer-bar { height: 10px; border-radius: 999px; background: var(--line); overflow: hidden; margin-top: .4rem; }
.treffer-bar > i { display: block; height: 100%; background: var(--gruen); }

/* ============================================================================
   Responsiv / App-Ansicht
   ========================================================================== */
@media (max-width: 860px) {
  body { font-size: 18px; padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px)); }
  .topnav { display: none; }
  .subnav-wrap { display: none; }
  .nutzer-name { display: none; }
  .brand span { font-size: 1.1rem; }
  main { padding: 1.1rem .9rem 2rem; }
  .raster2, .raster3 { grid-template-columns: 1fr; }
  .pruef-grid { grid-template-columns: 1fr; }
  .vorschau-karte { position: static; }
  h1 { font-size: 1.5rem; }

  /* untere Tab-Leiste einblenden */
  .bottomnav {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
    background: var(--surface); border-top: 1px solid var(--line);
    box-shadow: 0 -2px 12px rgba(16,24,40,.06);
    padding: .3rem .2rem calc(.3rem + env(safe-area-inset-bottom, 0px));
    justify-content: space-around;
  }
  .bottomnav a {
    flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px;
    text-decoration: none; color: var(--ink-faint); font-size: .72rem; font-weight: 600;
    padding: .35rem .1rem; border-radius: 10px; min-width: 0;
  }
  .bottomnav a .ico { font-size: 1.45rem; line-height: 1; }
  .bottomnav a.aktiv { color: var(--brand-dark); }
  .bottomnav a.aktiv .ico { transform: translateY(-1px); }
}

@media (max-width: 400px) {
  .bottomnav a { font-size: .66rem; }
  .status-pill { padding: .45rem .8rem; }
}

/* ---------- Zweisprachige Übersetzung (Dokument-Layout) ---------- */
.ueb-hinweis { background: var(--gelb-bg); padding: .7rem 1rem; border-radius: var(--radius-s); margin: 0 0 1.2rem; }
.ueb-dok { max-width: 820px; margin: 0 auto; line-height: 1.5; }
.ueb-kopf { margin: 1.5rem 0 .5rem; font-weight: 800; font-size: 1.12rem; }
.ueb-kopf:first-child { margin-top: 0; }
.ueb-kopf-xx { color: var(--ink-soft); font-weight: 700; }
.ueb-block { margin: 0 0 .9rem; }
.ueb-de { margin: 0; }
.ueb-xx { margin: .2rem 0 0; padding-left: .95rem; border-left: 2px solid var(--line-stark);
  color: var(--ink-soft); font-style: italic; }
.print-only { display: none; }
.ueb-print-kopf { margin-bottom: 1rem; }
.ueb-print-kopf h2 { margin: 0 0 .2rem; }

/* ---------- Übergabeprotokoll: Inventar-Checkliste ---------- */
.proto-inv { display: flex; flex-direction: column; gap: .5rem; }
.proto-inv-zeile { border: 1px solid var(--line); border-radius: var(--radius-s);
  padding: .55rem .7rem; background: var(--surface); }
.proto-check { display: flex; align-items: center; gap: .7rem; cursor: pointer; user-select: none; }
.proto-check input { position: absolute; opacity: 0; width: 0; height: 0; }
.proto-haken { flex: 0 0 auto; width: 30px; height: 30px; border-radius: 8px;
  border: 2px solid var(--line-stark); background: #fff; position: relative; transition: .12s; }
.proto-check input:checked + .proto-haken { background: var(--gruen); border-color: var(--gruen); }
.proto-check input:checked + .proto-haken::after { content: "✓"; color: #fff; font-weight: 800;
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 1.1rem; }
.proto-name { font-size: 1.05rem; }
.proto-inv-felder { display: flex; gap: .5rem; margin-top: .45rem; flex-wrap: wrap; }
.proto-inv-felder input { flex: 1 1 180px; }

/* ---------- Serien-E-Mail: Sprachauswahl ---------- */
.sprach-wahl { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .5rem; }
.sprach-chip { display: inline-flex; align-items: center; gap: .35rem; padding: .35rem .6rem;
  border: 1px solid var(--line-stark); border-radius: 999px; background: var(--surface); cursor: pointer; }

/* ---------- Dokumentenmappe (je Objekt) ---------- */
.mappe-gruppe { margin-bottom: .6rem; }
.mappe-kat { font-weight: 700; color: var(--ink-soft); margin: .5rem 0 .2rem; }

/* ---------- Zähler-Verbrauch ---------- */
.verbrauch { display: inline-block; margin-left: .35rem; padding: .05rem .4rem; border-radius: 999px;
  background: var(--brand-tint); color: var(--brand-dark); font-size: .8rem; font-weight: 700; }

/* ---------- Mängel-QR: Aushänge ---------- */
.qr-aushang { max-width: 420px; margin: 1rem auto; padding: 1.6rem; text-align: center;
  border: 2px solid var(--ink); border-radius: var(--radius); background: #fff; }
.qr-aushang-titel { font-size: 1.7rem; font-weight: 800; }
.qr-bild { width: 260px; height: 260px; margin: .8rem auto; display: block; }
.qr-objekt { font-size: 1.25rem; font-weight: 700; }
.qr-anleitung { color: var(--ink-soft); margin: .4rem 0 0; }
.qr-link { margin-top: .8rem; font-size: .8rem; color: var(--ink-faint); word-break: break-all; }

.qr-bogen { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 1rem; }
.qr-karte { border: 1px solid var(--line-stark); border-radius: var(--radius-s); padding: 1rem;
  text-align: center; background: #fff; }
.qr-karte-titel { font-weight: 800; font-size: 1.1rem; }
.qr-karte-bild { width: 170px; height: 170px; margin: .5rem auto; display: block; }
.qr-karte-objekt { font-weight: 700; }
.qr-karte-adr { color: var(--ink-soft); font-size: .9rem; }
.qr-karte-hinweis { color: var(--ink-faint); font-size: .8rem; margin: .3rem 0 .5rem; }

/* ---------- Familien-Dashboard „Was ist zu tun" ---------- */
.dash-karte { border-left: 4px solid var(--brand); }
.dash-karte summary { cursor: pointer; list-style: none; display: flex; align-items: center;
  justify-content: space-between; gap: .6rem; }
.dash-karte summary::-webkit-details-marker { display: none; }
.dash-karte .dash-titel { font-size: 1.12rem; font-weight: 700; }
.dash-karte .dash-titel::before { content: "\25B8  "; color: var(--ink-faint); }
.dash-karte[open] .dash-titel::before { content: "\25BE  "; }
.dash-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: .7rem; margin: .6rem 0; }
.dash-tile { display: flex; flex-direction: column; gap: .1rem; padding: .8rem .9rem;
  border-radius: var(--radius-s); text-decoration: none; color: var(--ink);
  border: 1px solid var(--line-stark); background: var(--surface); transition: transform .08s; }
.dash-tile:hover { transform: translateY(-2px); }
.dash-zahl { font-size: 1.8rem; font-weight: 800; line-height: 1; }
.dash-label { font-size: .85rem; color: var(--ink-soft); }
.dash-tile.rot   { background: var(--rot-bg);   border-color: var(--rot);   }
.dash-tile.rot   .dash-zahl { color: var(--rot); }
.dash-tile.gelb  { background: var(--gelb-bg);  border-color: var(--gelb);  }
.dash-tile.gelb  .dash-zahl { color: var(--gelb); }
.dash-tile.blau  { background: #e8f0fe; border-color: #2563eb; }
.dash-tile.blau  .dash-zahl { color: #1d4ed8; }
.dash-tile.gruen { background: var(--gruen-bg); border-color: var(--gruen); }
.dash-tile.gruen .dash-zahl { color: var(--gruen); }
.dash-verlauf { margin-top: .4rem; border-top: 1px solid var(--line); padding-top: .5rem; }
.dash-verlauf ul { list-style: none; margin: .3rem 0 0; padding: 0; }
.dash-verlauf li { padding: .15rem 0; font-size: .92rem; }

/* ---------- Aktivitäts-Verlauf ---------- */
.verlauf-liste { list-style: none; margin: 0; padding: 0; }
.verlauf-eintrag { display: flex; gap: .7rem; padding: .55rem 0; border-bottom: 1px solid var(--line); }
.verlauf-eintrag:last-child { border-bottom: none; }
.verlauf-icon { flex: 0 0 auto; font-size: 1.3rem; }
.verlauf-text { flex: 1; }
.verlauf-link { margin-left: .3rem; font-size: .85rem; white-space: nowrap; }

/* ---------- Mieter-/Vertrags-Reiter ---------- */
.mieter-tabs { margin-bottom: 1rem; }
.mieter-tabs a { font-size: 1rem; padding: .5rem .9rem; }

/* ---------- Bescheinigungen: große Knöpfe ---------- */
.dok-liste { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: .7rem; margin-top: .6rem; }
.dok-knopf { display: flex; align-items: center; gap: .7rem; padding: .9rem 1rem;
  border: 1px solid var(--line-stark); border-radius: var(--radius-s); background: var(--surface);
  color: var(--ink); text-decoration: none; transition: transform .08s, border-color .08s; }
.dok-knopf:hover { transform: translateY(-2px); border-color: var(--brand); }
.dok-icon { font-size: 1.7rem; flex: 0 0 auto; }

/* ---------- Ein-/Auszugs-Ablauf ---------- */
.fortschritt { height: 10px; background: var(--line); border-radius: 999px; overflow: hidden; margin: .5rem 0 1rem; }
.fortschritt-balken { height: 100%; background: var(--gruen); border-radius: 999px; transition: width .2s; }
.ablauf-liste { list-style: none; margin: 0; padding: 0; }
.ablauf-schritt { display: flex; align-items: center; gap: .7rem; padding: .6rem 0; border-bottom: 1px solid var(--line); }
.ablauf-schritt:last-child { border-bottom: none; }
.ablauf-text { flex: 1; }
.ablauf-schritt.erledigt .ablauf-text { color: var(--ink-faint); text-decoration: line-through; }

/* ---------- Kautionsabrechnung: Abzugs-Zeilen ---------- */
.posten-zeile { display: flex; gap: .5rem; margin-bottom: .4rem; }
.posten-zeile input:first-child { flex: 1; }

/* ---------- Druckansicht ---------- */
@media print {
  .appbar, .bottomnav, .noprint { display: none !important; }
  main { max-width: none; padding: 0; }
  body { background: #fff; font-size: 11pt; padding: 0; }
  .karte { box-shadow: none; border: none; padding: 0; }
  .print-only { display: block; }
  .ueb-dok { max-width: none; }
  .ueb-block, .ueb-kopf { page-break-inside: avoid; }
  .ueb-xx { color: #333; border-left-color: #999; }
  /* QR-Aufkleber: saubere Kacheln mit Schnittkante */
  .qr-bogen { grid-template-columns: repeat(2, 1fr); gap: .4cm; }
  .qr-karte { border: 1px dashed #999; page-break-inside: avoid; }
  .qr-aushang { page-break-inside: avoid; }
}
