/* Immobilienportal - eine Stilvorlage fuer Website und Verwaltung.
   Bewusst ohne Rahmenwerk und ohne Bauschritt: wenige, klar benannte Regeln,
   Systemschriften, ein Farbsatz ueber Variablen. */

:root {
  --farbe: #14532d;
  --farbe-hell: #dcfce7;
  --farbe-dunkel: #0b3d20;
  --akzent: #b45309;
  --text: #1f2937;
  --text-leise: #6b7280;
  --rand: #e5e7eb;
  --flaeche: #ffffff;
  --grund: #f8fafc;
  --fehler: #b91c1c;
  --warnung: #b45309;
  --gut: #15803d;
  --radius: 10px;
  --schatten: 0 1px 2px rgba(15, 23, 42, .06), 0 8px 24px rgba(15, 23, 42, .06);
  --breite: 1180px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  /* Die generische Angabe "sans-serif" am Ende ist wichtig: fehlen die
     benannten Systemschriften (z. B. auf einem schlanken Server), wuerde der
     Browser sonst auf eine Monospace-Schrift zurueckfallen. */
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue",
               "Liberation Sans", "DejaVu Sans", Arial, sans-serif;
  color: var(--text);
  background: var(--grund);
  line-height: 1.55;
}

h1, h2, h3 { line-height: 1.25; margin: 0 0 .5rem; }
h1 { font-size: 1.9rem; }
h2 { font-size: 1.25rem; margin-top: 1.5rem; }
a { color: var(--farbe); }
a:hover { color: var(--farbe-dunkel); }
.klein { font-size: .85rem; color: var(--text-leise); }
.lead { font-size: 1.05rem; color: var(--text-leise); max-width: 62ch; }

.sprung { position: absolute; left: -9999px; }
.sprung:focus { left: 1rem; top: 1rem; background: var(--flaeche); padding: .5rem 1rem; z-index: 10; }

/* --- Kopf und Fuss ------------------------------------------------------- */
.kopf { background: var(--flaeche); border-bottom: 1px solid var(--rand); }
.kopf-inhalt {
  max-width: var(--breite); margin: 0 auto; padding: .75rem 1rem;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
}
.marke { display: flex; align-items: center; gap: .6rem; text-decoration: none; color: var(--text); font-weight: 600; }
.marke-zeichen {
  display: grid; place-items: center; width: 34px; height: 34px; border-radius: 8px;
  background: var(--farbe); color: #fff; font-weight: 700;
}
.hauptnav { display: flex; align-items: center; gap: .25rem; flex-wrap: wrap; }
.hauptnav a {
  text-decoration: none; padding: .45rem .7rem; border-radius: 8px; color: var(--text);
}
.hauptnav a:hover { background: var(--grund); }
.nav-verwaltung { color: var(--text-leise); }
.nav-form { margin: 0; }
.nav-abmelden {
  border: 0; background: transparent; cursor: pointer; font: inherit;
  padding: .45rem .7rem; border-radius: 8px; color: var(--text-leise);
}
.nav-abmelden:hover { background: var(--grund); }

.fuss { border-top: 1px solid var(--rand); background: var(--flaeche); margin-top: 3rem; }
.fuss-inhalt {
  max-width: var(--breite); margin: 0 auto; padding: 1.5rem 1rem;
  display: flex; gap: 2rem; flex-wrap: wrap; justify-content: space-between;
}
.fuss-links { display: flex; gap: 1rem; }

.inhalt { max-width: var(--breite); margin: 0 auto; padding: 1.5rem 1rem 0; }

/* --- Hinweise ------------------------------------------------------------ */
.hinweis {
  max-width: var(--breite); margin: 1rem auto 0; padding: .75rem 1rem; border-radius: var(--radius);
  border: 1px solid var(--rand); background: var(--flaeche);
}
.hinweis-gut { border-color: #bbf7d0; background: #f0fdf4; color: #14532d; }
.hinweis-fehler { border-color: #fecaca; background: #fef2f2; color: var(--fehler); }

/* --- Formularelemente ---------------------------------------------------- */
.feld { display: flex; flex-direction: column; gap: .25rem; }
.feld > span { font-size: .85rem; color: var(--text-leise); }
.feld.breit { grid-column: 1 / -1; }
input[type=text], input[type=search], input[type=email], input[type=tel],
input[type=password], input[type=date], input[type=file], select, textarea {
  width: 100%; padding: .55rem .65rem; border: 1px solid var(--rand);
  border-radius: 8px; font: inherit; background: var(--flaeche); color: var(--text);
}
input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--farbe); outline-offset: 1px; border-color: var(--farbe);
}
textarea { resize: vertical; }
.feld-versteckt { position: absolute; left: -9999px; height: 0; overflow: hidden; }
.pruef { display: flex; gap: .5rem; align-items: flex-start; font-size: .9rem; }

.knopf {
  display: inline-block; padding: .55rem .9rem; border-radius: 8px; border: 1px solid var(--rand);
  background: var(--flaeche); color: var(--text); cursor: pointer; font: inherit; text-decoration: none;
}
.knopf:hover { background: var(--grund); color: var(--text); }
.knopf-haupt { background: var(--farbe); border-color: var(--farbe); color: #fff; font-weight: 600; }
.knopf-haupt:hover { background: var(--farbe-dunkel); color: #fff; }
.knopf-leise { font-size: .9rem; padding: .4rem .6rem; }
.knopf-gefahr { border-color: #fecaca; color: var(--fehler); }
.knopf-gefahr:hover { background: #fef2f2; color: var(--fehler); }

.formular { display: flex; flex-direction: column; gap: 1rem; }
.formular-raster { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1rem; }
.formular-aktionen { display: flex; gap: .75rem; flex-wrap: wrap; }
.formular-schmal { max-width: 620px; }
.formular-inline { flex-direction: row; align-items: center; gap: .5rem; flex-wrap: wrap; }
fieldset {
  border: 1px solid var(--rand); border-radius: var(--radius);
  padding: 1.35rem 1rem 1rem; background: var(--flaeche); margin: 0 0 1.25rem;
}
/* Die Beschriftung liegt auf der Rahmenlinie. Mit Hintergrund und Innenabstand
   sitzt sie sauber im Rahmen statt darauf zu kleben. */
legend {
  font-weight: 600; padding: .1rem .55rem; margin-left: -.3rem;
  background: var(--flaeche); border-radius: 6px;
}
fieldset.gefahr { border-color: #fecaca; }

/* --- Suche und Ergebnisse ------------------------------------------------ */
.kopfbereich { padding: 1.5rem 0 .5rem; }
.suche {
  background: var(--flaeche); border: 1px solid var(--rand); border-radius: var(--radius);
  padding: 1rem; box-shadow: var(--schatten); margin-top: 1rem;
}
.suche-haupt { display: grid; grid-template-columns: 2fr 1fr 1fr auto; gap: .75rem; align-items: end; }
.suche-schmal { display: grid; grid-template-columns: 2fr 1fr 1fr auto; gap: .75rem; align-items: end; }
.suche-mehr { margin-top: .75rem; }
.suche-mehr summary { cursor: pointer; color: var(--text-leise); font-size: .9rem; }
.suche-raster { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: .75rem; margin-top: .75rem; }

.ergebnis-kopf { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; margin: 1.5rem 0 1rem; }

.karten { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1.25rem; }
.karte {
  background: var(--flaeche); border: 1px solid var(--rand); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--schatten); display: flex; flex-direction: column;
}
.karte-bild { display: block; position: relative; aspect-ratio: 4 / 3; background: var(--grund); text-decoration: none; }
.karte-bild img { width: 100%; height: 100%; object-fit: cover; display: block; }
.karte-platzhalter { display: grid; place-items: center; height: 100%; color: var(--text-leise); }
.karte-text { padding: .9rem 1rem 1.1rem; display: flex; flex-direction: column; gap: .35rem; }
.karte-text h3 { margin: 0; font-size: 1.05rem; }
.karte-text h3 a { text-decoration: none; color: var(--text); }
.karte-ort { margin: 0; color: var(--text-leise); font-size: .9rem; }
.karte-preis { margin: .2rem 0; font-size: 1.1rem; }
.karte-daten { list-style: none; display: flex; gap: .75rem; padding: 0; margin: 0; flex-wrap: wrap; font-size: .85rem; color: var(--text-leise); }
.karte-kurz { margin: .3rem 0 0; font-size: .9rem; color: var(--text-leise); }

.etikett {
  display: inline-block; padding: .15rem .5rem; border-radius: 999px; font-size: .75rem;
  font-weight: 600; background: var(--farbe-hell); color: var(--farbe-dunkel);
}
.karte-bild .etikett { position: absolute; left: .6rem; top: .6rem; }
.etikett-kauf { background: #fef3c7; color: #92400e; }
.etikett-miete { background: var(--farbe-hell); color: var(--farbe-dunkel); }
.etikett-grau { background: var(--grund); color: var(--text-leise); }
.etikett-warn { background: #fef3c7; color: var(--akzent); }

.blaettern { display: flex; gap: .4rem; margin: 1.5rem 0; flex-wrap: wrap; }
.blaettern a, .seite-aktiv {
  padding: .35rem .7rem; border: 1px solid var(--rand); border-radius: 8px;
  background: var(--flaeche); text-decoration: none;
}
.seite-aktiv { background: var(--farbe); border-color: var(--farbe); color: #fff; }
.leer { background: var(--flaeche); border: 1px solid var(--rand); border-radius: var(--radius); padding: 2rem; text-align: center; }

/* --- Objektseite --------------------------------------------------------- */
.brotkrumen { font-size: .85rem; color: var(--text-leise); margin-bottom: .75rem; display: flex; gap: .4rem; }
.objekt-kopf {
  display: flex; justify-content: space-between; gap: 2rem; flex-wrap: wrap;
  background: var(--flaeche); border: 1px solid var(--rand); border-radius: var(--radius);
  padding: 1.25rem; box-shadow: var(--schatten);
}
.objekt-kopf h1 { margin: .4rem 0 .2rem; }
.objekt-ort { margin: 0; color: var(--text-leise); }
.objekt-preis { display: flex; flex-direction: column; gap: .4rem; align-items: flex-start; min-width: 220px; }
.objekt-preis strong { font-size: 1.6rem; }
.objekt-preis .klein { margin-top: -.3rem; }

.galerie { margin: 1.5rem 0; }
.galerie-gross { margin: 0; border-radius: var(--radius); overflow: hidden; background: var(--flaeche); border: 1px solid var(--rand); }
.galerie-gross img { width: 100%; max-height: 70vh; object-fit: contain; display: block; background: #0b1220; }
.galerie-streifen { display: flex; gap: .5rem; margin-top: .6rem; overflow-x: auto; padding-bottom: .3rem; }
.galerie-klein { border: 2px solid transparent; padding: 0; border-radius: 8px; overflow: hidden; cursor: pointer; background: none; width: 110px; flex: 0 0 auto; }
.galerie-klein img { width: 100%; height: 74px; object-fit: cover; display: block; }
.galerie-klein[aria-current="true"] { border-color: var(--farbe); }

.objekt-daten, .objekt-text, .objekt-kosten, .anfrage, .textseite, .expose {
  background: var(--flaeche); border: 1px solid var(--rand); border-radius: var(--radius);
  padding: 1.25rem; margin: 1.25rem 0;
}
.datenliste { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: .5rem 1.5rem; margin: 0; }
.datenliste > div { display: flex; justify-content: space-between; gap: 1rem; border-bottom: 1px dashed var(--rand); padding: .35rem 0; }
.datenliste dt { color: var(--text-leise); font-size: .9rem; margin: 0; }
.datenliste dd { margin: 0; font-weight: 500; text-align: right; }
.ausstattung { columns: 2; margin: .5rem 0 0; padding-left: 1.1rem; }
.ausstattung li { break-inside: avoid; margin-bottom: .25rem; }
.anfrage form { margin-top: .75rem; }

/* --- Expose -------------------------------------------------------------- */
.expose-werkzeuge { display: flex; gap: .75rem; margin-bottom: 1rem; }
.expose { max-width: 900px; margin: 0 auto; }
.expose-kopf { display: flex; justify-content: space-between; gap: 1.5rem; border-bottom: 2px solid var(--farbe); padding-bottom: .75rem; flex-wrap: wrap; }
.expose-preis { text-align: right; }
.expose-preis strong { display: block; font-size: 1.5rem; }
.expose-bilder { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; margin: 1rem 0; }
.expose-bilder img { width: 100%; height: 200px; object-fit: cover; border-radius: 8px; }
.expose-tabelle { width: 100%; border-collapse: collapse; }
.expose-tabelle th, .expose-tabelle td { text-align: left; padding: .4rem .6rem; border-bottom: 1px solid var(--rand); }
.expose-tabelle th { width: 40%; color: var(--text-leise); font-weight: 500; }
.expose-liste { padding-left: 1.1rem; }
.expose-fuss { margin-top: 1.5rem; padding-top: .75rem; border-top: 1px solid var(--rand); display: flex; flex-direction: column; gap: .15rem; font-size: .9rem; }

/* --- Verwaltung ---------------------------------------------------------- */
.verwaltung .inhalt { padding-top: 1.5rem; }
.kacheln { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1rem; margin: 1rem 0 1.5rem; }
.kachel {
  background: var(--flaeche); border: 1px solid var(--rand); border-radius: var(--radius);
  padding: 1rem; display: flex; flex-direction: column; gap: .15rem; text-decoration: none; color: var(--text);
}
.kachel-aktiv { border-color: var(--farbe); box-shadow: inset 0 0 0 1px var(--farbe); }
.kachel-zahl { font-size: 1.6rem; font-weight: 700; }
.spalten { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 1.5rem; }

.tabelle { width: 100%; border-collapse: collapse; background: var(--flaeche); border: 1px solid var(--rand); border-radius: var(--radius); overflow: hidden; }
.tabelle th, .tabelle td { text-align: left; padding: .55rem .7rem; border-bottom: 1px solid var(--rand); vertical-align: middle; }
.tabelle th { background: var(--grund); font-size: .85rem; color: var(--text-leise); font-weight: 600; }
.tabelle tr:last-child td { border-bottom: 0; }

.zustand { display: inline-block; padding: .1rem .5rem; border-radius: 999px; font-size: .78rem; background: var(--grund); color: var(--text-leise); }
.zustand-veroeffentlicht { background: var(--farbe-hell); color: var(--farbe-dunkel); }
.zustand-reserviert { background: #fef3c7; color: var(--akzent); }
.zustand-entwurf { background: #e0e7ff; color: #3730a3; }
.zustand-verkauft, .zustand-vermietet { background: #e5e7eb; color: var(--text); }
.zustand-neu { background: #fee2e2; color: var(--fehler); }
.zustand-bearbeitet { background: #fef3c7; color: var(--akzent); }
.zustand-erledigt { background: var(--farbe-hell); color: var(--farbe-dunkel); }

.anmeldung { max-width: 420px; margin: 3rem auto; background: var(--flaeche); border: 1px solid var(--rand); border-radius: var(--radius); padding: 1.5rem; box-shadow: var(--schatten); }
.bildliste { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 1rem; margin-top: 1rem; }
.bildkarte { border: 1px solid var(--rand); border-radius: var(--radius); padding: .6rem; background: var(--flaeche); }
.bildkarte img { width: 100%; height: 150px; object-fit: cover; border-radius: 6px; }
.bildkarte-aktionen { display: flex; gap: .35rem; align-items: center; }
.anfrage-karte { background: var(--flaeche); border: 1px solid var(--rand); border-radius: var(--radius); padding: 1rem; margin-bottom: 1rem; }
.anfrage-karte header { display: flex; justify-content: space-between; gap: 1rem; align-items: flex-start; }
.anfrage-text { white-space: pre-wrap; background: var(--grund); padding: .6rem .75rem; border-radius: 8px; }

/* --- Kleine Bildschirme -------------------------------------------------- */
@media (max-width: 820px) {
  h1 { font-size: 1.55rem; }
  .suche-haupt, .suche-schmal { grid-template-columns: 1fr; }
  .ausstattung { columns: 1; }
  .expose-bilder { grid-template-columns: 1fr; }
  .kopf-inhalt { flex-direction: column; align-items: flex-start; }
  .objekt-kopf { flex-direction: column; }
  .tabelle { display: block; overflow-x: auto; }
}

/* --- Phase 2: Verwaltung, Rechtstexte, Bildsortierung -------------------- */
.kopf-aktionen { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.ergebnis-kopf { display: flex; justify-content: space-between; gap: 1rem; align-items: flex-start; flex-wrap: wrap; }

/* Kontrollkaestchen: Beschriftung in normaler Schrift, Kasten gross genug */
.feld.kaestchen { display: flex; align-items: flex-start; gap: .6rem; font-weight: 500; margin: .5rem 0; }
.feld.kaestchen input[type="checkbox"] { width: 1.15rem; height: 1.15rem; margin-top: .2rem; flex: 0 0 auto; }
.feld.kaestchen span { font-weight: 400; }

/* Hinweis auf neue Anfragen in der Navigation */
.hauptnav .zaehler {
  display: inline-block; min-width: 1.3rem; margin-left: .35rem; padding: 0 .35rem;
  border-radius: 999px; background: var(--fehler); color: #fff; font-size: .75rem;
  font-weight: 700; text-align: center; line-height: 1.3rem;
}

/* Bilder sortieren */
.bildkarte-kopf { display: flex; align-items: center; justify-content: space-between; gap: .4rem; margin-bottom: .4rem; }
.ziehgriff { cursor: grab; color: var(--text-leise); letter-spacing: -2px; user-select: none; padding: 0 .2rem; }
.bildkarte[draggable="true"] { cursor: grab; }
.bildkarte.wird-gezogen { opacity: .45; outline: 2px dashed var(--farbe); }
.bildmarke { font-size: .78rem; color: var(--text-leise); }
.bildmarke-aktiv { color: var(--farbe-dunkel); background: var(--farbe-hell); padding: .05rem .45rem; border-radius: 999px; font-weight: 600; }
.bildkarte-aktionen { display: flex; gap: .35rem; align-items: center; flex-wrap: wrap; margin-top: .5rem; }
.bildkarte-aktionen form { margin: 0; }

/* Hinweise */
.hinweis-warnung { background: #fef3c7; border-color: #fcd34d; color: #7c2d12; }
.hinweis-warnung a { color: #7c2d12; }

/* Rechtstexte */
.textseite .angaben { margin: 1rem 0; }
.textseite .angaben dt { font-weight: 600; margin-top: .8rem; }
.textseite .angaben dd { margin: .15rem 0 0; white-space: pre-line; }
.textseite .fehlt { color: var(--fehler); font-style: italic; }
.textseite .pflicht { font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; color: var(--fehler); }

/* Anfragen */
.anfrage-aktionen { display: flex; gap: 1rem; align-items: flex-end; flex-wrap: wrap; margin-top: .75rem; padding-top: .6rem; border-top: 1px dashed var(--rand); }
.anfrage-aktionen form { margin: 0; }
.anfrage-aktionen .formular-inline { display: flex; gap: .5rem; align-items: flex-end; }
.verlauf { margin-top: .5rem; }
.verlauf pre { white-space: pre-wrap; background: var(--grund); padding: .5rem .7rem; border-radius: 8px; margin: .3rem 0 0; }

/* Formularaktionen als Zeile, auch wenn sie aus mehreren Formularen bestehen */
.formular-aktionen { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; margin-top: 1rem; }
.formular-aktionen form { margin: 0; }
.formular-aktionen .klein { flex: 1 1 260px; }

/* Ueberschriften und Absaetze in den Textseiten etwas ruhiger */
.textseite p { max-width: 72ch; }
.textseite h1 { margin-bottom: 1rem; }

/* --- Kleine Bildschirme (Telefon) ---------------------------------------- */
@media (max-width: 480px) {
  :root { --radius: 8px; }
  h1 { font-size: 1.35rem; }
  h2 { font-size: 1.1rem; }
  .inhalt { padding: .9rem; }
  .kopf-inhalt { padding: .6rem .9rem; }
  /* Bedienelemente gross genug fuer den Daumen */
  .knopf, .hauptnav a, .nav-abmelden { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; }
  .formular-raster { grid-template-columns: 1fr; }
  .bildliste { grid-template-columns: 1fr; }
  .kacheln { grid-template-columns: 1fr 1fr; }
  .kachel { padding: .7rem; }
  .galerie-klein { width: 84px; }
  .galerie-klein img { height: 60px; }
  .anfrage-aktionen { flex-direction: column; align-items: stretch; }
  .anfrage-aktionen .formular-inline { flex-direction: column; align-items: stretch; }
  .datenliste > div { flex-direction: column; gap: .1rem; }
  .datenliste dd { text-align: left; }
  .textseite, .objekt-daten, .objekt-text, .objekt-kosten, .anfrage { padding: 1rem; }
  .tabelle { font-size: .88rem; }
}

/* Nichts darf die Seite seitlich aufziehen */
img, table, pre { max-width: 100%; }
pre { overflow-x: auto; }

/* --- Druck (Expose) ------------------------------------------------------ */
@media print {
  .kopf, .fuss, .expose-werkzeuge, .hinweis, .brotkrumen { display: none !important; }
  body { background: #fff; }
  .inhalt { max-width: none; padding: 0; }
  .expose { border: 0; box-shadow: none; padding: 0; margin: 0; }
  .expose-bilder { grid-template-columns: 1fr 1fr; }
  .expose-bilder img { height: 60mm; }
  a { color: inherit; text-decoration: none; }
  h2 { break-after: avoid; }
}


/* =========================================================================
   Interner Verwaltungsbereich (Neuausrichtung)
   Wiederverwendet die vorhandenen Farbwerte und Formen.
   ========================================================================= */

.seitenkopf { display: flex; justify-content: space-between; align-items: flex-start;
  gap: 1rem; flex-wrap: wrap; margin: 0 0 1rem; }
.seitenkopf h1 { margin: 0 0 .15rem; font-size: 1.5rem; }
.seitenkopf .unterzeile { color: var(--text-leise); font-size: .92rem; }

.kpi-gruppe { margin: 0 0 1.5rem; }
.kpi-gruppe > h2 { font-size: 1rem; margin: 0 0 .5rem; color: var(--text-leise);
  text-transform: uppercase; letter-spacing: .04em; }
.kpi { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: .75rem; }
.kpi-feld { background: var(--flaeche); border: 1px solid var(--rand);
  border-radius: var(--radius); padding: .7rem .85rem; }
.kpi-feld .kpi-label { display: block; font-size: .82rem; color: var(--text-leise); }
.kpi-feld .kpi-wert { display: block; font-size: 1.35rem; font-weight: 700;
  margin-top: .15rem; }
.kpi-feld .kpi-zusatz { display: block; font-size: .78rem; color: var(--text-leise);
  margin-top: .1rem; }
.kpi-feld.warnung { border-color: #b45309; background: #fffbeb; }
.kpi-feld.unbekannt .kpi-wert { color: var(--text-leise); font-weight: 500; }
.kpi-feld.gut { border-color: var(--farbe); }

.filterleiste { display: flex; gap: .5rem; align-items: flex-end; flex-wrap: wrap;
  background: var(--grund); border: 1px solid var(--rand); border-radius: var(--radius);
  padding: .6rem .75rem; margin: 0 0 1rem; }
.filterleiste .feld { margin: 0; }
.filterleiste label { font-size: .8rem; color: var(--text-leise); }

.tabellen-umschlag { overflow-x: auto; }
.tabelle .zahl { text-align: right; font-variant-numeric: tabular-nums; }
.tabelle tfoot td { font-weight: 700; background: var(--grund); border-top: 2px solid var(--rand); }
.tabelle tr.summe td { font-weight: 600; }
.tabelle tr.leer-zeile td { color: var(--text-leise); text-align: center; padding: 1.2rem; }

.stand { display: inline-block; padding: .1rem .5rem; border-radius: 999px;
  font-size: .78rem; font-weight: 600; white-space: nowrap; }
.stand-offen { background: #fee2e2; color: #991b1b; }
.stand-teilweise { background: #fef3c7; color: #92400e; }
.stand-bezahlt { background: var(--farbe-hell); color: var(--farbe-dunkel); }
.stand-ueberzahlt { background: #dbeafe; color: #1e40af; }
.stand-erlassen, .stand-unbekannt, .stand-neutral { background: var(--grund);
  color: var(--text-leise); }
.stand-aktiv { background: var(--farbe-hell); color: var(--farbe-dunkel); }
.stand-beendet, .stand-entwurf { background: var(--grund); color: var(--text-leise); }
.stand-hoch { background: #fee2e2; color: #991b1b; }
.stand-normal { background: var(--grund); color: var(--text-leise); }
.stand-niedrig { background: #e0f2fe; color: #075985; }

.akten-raster { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1rem; align-items: start; }
.akte-karte { background: var(--flaeche); border: 1px solid var(--rand);
  border-radius: var(--radius); padding: .85rem 1rem; }
.akte-karte > h2 { font-size: .95rem; margin: 0 0 .6rem; }
.akte-karte .leer { color: var(--text-leise); font-size: .9rem; }

.verlauf { list-style: none; margin: 0; padding: 0; }
.verlauf li { border-left: 2px solid var(--rand); padding: 0 0 .6rem .75rem; margin-left: .25rem; }
.verlauf li:last-child { padding-bottom: 0; }
.verlauf .verlauf-kopf { font-size: .85rem; color: var(--text-leise); }

.hinweis-block { border-left: 4px solid var(--farbe); background: var(--grund);
  padding: .6rem .85rem; border-radius: 0 var(--radius) var(--radius) 0; margin: 0 0 1rem;
  font-size: .92rem; }
.hinweis-block.warnung { border-left-color: #b45309; background: #fffbeb; }
.hinweis-block.fehler { border-left-color: #991b1b; background: #fef2f2; }

.knopf-reihe { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.klein-leise { font-size: .82rem; color: var(--text-leise); }
.formular-raster.drei { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.feldgruppe { border: 1px solid var(--rand); border-radius: var(--radius);
  padding: .75rem 1rem 1rem; margin: 0 0 1rem; }
.feldgruppe > legend { font-weight: 600; padding: 0 .4rem; font-size: .95rem; }
.formular-raster { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: .75rem; }
.formular-raster .feld.voll { grid-column: 1 / -1; }

@media (max-width: 640px) {
  .kpi { grid-template-columns: 1fr 1fr; }
  .seitenkopf h1 { font-size: 1.25rem; }
  .tabelle th, .tabelle td { padding: .45rem .5rem; font-size: .88rem; }
}
