/* Liegenschaften & Versicherungen – VG Falkenstein
   Neutrales Grundgerüst in Grau/Schwarz. Die Hausfarbe der gewählten Körperschaft
   (--rot, gesetzt in mandanten.js) erscheint nur im Wappen und am Punkt vor dem
   Bereichsnamen; Rot/Gelb/Grün sind den Statusangaben vorbehalten. */

:root {
  /* Hausfarbe (wird je Körperschaft überschrieben) */
  --rot: #c11b07;
  --rot-dunkel: #96150a;
  /* Flächen für Auswahl/Hover bleiben bewusst neutral, nicht in der Hausfarbe getönt */
  --rose: #f4f4f5;
  --rose-2: #e4e4e7;

  /* Neutrale Skala */
  --bg: #f7f7f8;
  --flaeche: #f4f4f5;
  --weiss: #fff;
  --linie: #ececee;
  --linie-stark: #dedee2;
  --text: #18181b;
  --text-2: #3f3f46;
  --text-leise: #71717a;
  --grau: #a1a1aa;
  --grau-dunkel: #3f3f46;

  /* Signalfarben – unabhängig von der Hausfarbe */
  --gefahr: #dc2626;
  --gefahr-dunkel: #b91c1c;
  --gefahr-hell: #fef2f2;
  --gelb: #facc15;
  --gelb-hell: #fefce8;
  --st-ueberfaellig: #dc2626;
  --st-faellig: #d97706;
  --st-ok: #16a34a;
  --st-unbekannt: #71717a;
  --st-ueberfaellig-bg: #fef2f2;
  --st-faellig-bg: #fffbeb;
  --st-ok-bg: #f0fdf4;
  --st-unbekannt-bg: #f4f4f5;

  --schrift: 'Inter Variable', 'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --titel: var(--schrift);
  --radius: 12px;
  --radius-s: 8px;
  --schatten: 0 1px 2px rgba(16, 24, 40, .04);
  --schatten-m: 0 4px 12px -2px rgba(16, 24, 40, .08), 0 2px 4px -2px rgba(16, 24, 40, .04);
  --schatten-hoch: 0 24px 48px -12px rgba(16, 24, 40, .25), 0 0 0 1px rgba(16, 24, 40, .05);
  --kopf-hoehe: 56px;
  --rail-breite: 56px;
  --panel-breite: 236px;
  --fokus: 0 0 0 3px rgba(24, 24, 27, .12);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: var(--schrift); font-size: 14px; line-height: 1.5; color: var(--text); background: var(--bg);
  -webkit-font-smoothing: antialiased; font-feature-settings: 'cv11', 'ss01';
}
a { color: var(--text); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--grau); }
h1, h2, h3, h4 { font-family: var(--schrift); font-weight: 600; margin: 0; line-height: 1.3; letter-spacing: -.01em; }
button, input, select, textarea { font: inherit; color: inherit; }
img { max-width: 100%; }
:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }
::selection { background: var(--rose-2); }

.ic {
  display: inline-block; width: 1.05em; height: 1.05em; flex: none; background: currentColor; vertical-align: -0.16em;
  -webkit-mask: var(--ic) center / contain no-repeat; mask: var(--ic) center / contain no-repeat;
}
kbd {
  font-family: var(--schrift); font-size: 11px; font-weight: 500; color: var(--text-leise); background: #fff;
  border: 1px solid var(--linie-stark); border-bottom-width: 2px; border-radius: 5px; padding: 0 5px; line-height: 16px;
}

/* =============================================================== App-Rahmen */
.rahmen { display: flex; height: 100vh; height: 100dvh; overflow: hidden; }
.app-spalte { flex: 1; min-width: 0; display: flex; flex-direction: column; min-height: 0; }
.haupt { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; width: 100%; padding: 28px 32px 64px; }

/* =============================================================== Kopfleiste */
.kopf {
  flex: none; z-index: 50; height: var(--kopf-hoehe); display: flex; align-items: center; gap: 12px;
  padding: 0 20px 0 24px; background: rgba(255, 255, 255, .85); backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--linie);
}
.kopf__titel { font-size: 14px; font-weight: 600; white-space: nowrap; min-width: 0; overflow: hidden; text-overflow: ellipsis; display: flex; align-items: center; gap: 8px; }
.kopf__titel::before { content: ''; width: 8px; height: 8px; border-radius: 3px; background: var(--rot); flex: none; }
.demo-hinweis {
  font-size: 11px; font-weight: 600; color: #92400e; background: #fef3c7; border: 1px solid #fde68a;
  padding: 1px 8px; border-radius: 999px; flex: none;
}
.kopf__rechts { margin-left: auto; display: flex; align-items: center; gap: 8px; flex: none; }
.menue-knopf { display: none; }

.suche { position: relative; }
.suche input {
  width: 280px; height: 34px; border: 1px solid transparent; border-radius: 9px; padding: 0 44px 0 34px;
  background: var(--flaeche); color: var(--text); font-size: 13.5px; transition: background .15s, border-color .15s, box-shadow .15s;
}
.suche input::placeholder { color: var(--text-leise); }
.suche input:hover { background: #ececee; }
.suche input:focus { outline: none; background: #fff; border-color: var(--linie-stark); box-shadow: var(--fokus); }
.suche > .ic { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--text-leise); width: 15px; height: 15px; }
.suche kbd { position: absolute; right: 9px; top: 50%; transform: translateY(-50%); pointer-events: none; }
.suche__liste {
  position: absolute; right: 0; top: calc(100% + 6px); width: 420px; max-height: 460px; overflow: auto; padding: 6px;
  background: #fff; color: var(--text); border-radius: 12px; box-shadow: var(--schatten-hoch); z-index: 70;
}
.suche__liste a { display: block; padding: 8px 10px; color: var(--text); border-radius: 8px; font-size: 13.5px; }
.suche__liste a:hover, .suche__liste a.markiert { background: var(--flaeche); text-decoration: none; }
.suche__liste small { color: var(--text-leise); display: block; font-size: 12px; }
.suche__typ { font-size: 11px; font-weight: 500; color: var(--text-leise); margin-right: 4px; }

/* Aufklappliste (Körperschaft, Benutzer) */
.auswahl { position: relative; }
.auswahl__knopf {
  display: flex; align-items: center; gap: 8px; height: 34px; padding: 0 8px 0 6px; border-radius: 9px; cursor: pointer;
  border: 1px solid var(--linie-stark); background: #fff; color: var(--text); font-weight: 500; font-size: 13px;
  box-shadow: var(--schatten); transition: background .15s, border-color .15s;
}
.auswahl__knopf:hover, .auswahl__knopf.offen { background: var(--flaeche); }
.auswahl__pfeil { width: 14px; height: 14px; color: var(--text-leise); }
.auswahl__wert { white-space: nowrap; }
.auswahl__liste {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 70; background: #fff; color: var(--text);
  border-radius: 12px; box-shadow: var(--schatten-hoch); padding: 6px; max-height: 70vh; overflow: auto; animation: rein .14s ease-out;
}
.auswahl__titel { font-size: 11.5px; font-weight: 500; color: var(--text-leise); padding: 6px 10px 4px; }
.auswahl__eintrag {
  display: flex; align-items: center; gap: 10px; width: 100%; border: 0; background: none; cursor: pointer; text-align: left;
  padding: 7px 10px; border-radius: 8px; color: var(--text); font: inherit;
}
.auswahl__eintrag:hover { background: var(--flaeche); }
.auswahl__eintrag.aktiv { background: var(--rose); }
.auswahl__eintrag > .ic { color: var(--text); margin-left: auto; width: 16px; height: 16px; }
.auswahl__text { display: flex; flex-direction: column; min-width: 0; flex: 1; font-size: 13.5px; line-height: 1.3; }
.auswahl__text b { font-weight: 500; }
.auswahl__text small { color: var(--text-leise); font-size: 12px; }

.wappenstapel { display: inline-flex; align-items: center; flex: none; }
.wappenstapel img { width: 20px; height: auto; }
.wappenstapel--klein img { width: 18px; }
.wappenstapel--3 img { width: 16px; }
.wappenstapel--3 img + img { margin-left: -4px; }
.wappenstapel--3.wappenstapel--klein img { width: 15px; }

/* =============================================================== Navigation: Rail + Panel */
.leiste {
  flex: none; z-index: 60; height: 100%; display: flex; flex-direction: column;
  background: #fbfbfc; border-right: 1px solid var(--linie);
}
.leiste__logo {
  height: var(--kopf-hoehe); flex: none; display: flex; align-items: center; gap: 8px; padding: 0 10px 0 16px;
  border-bottom: 1px solid var(--linie);
}
.leiste--zu .leiste__logo { width: var(--rail-breite); padding: 0; justify-content: center; }
.leiste__marke { display: flex; align-items: center; gap: 10px; text-decoration: none; min-width: 0; color: var(--text); }
.leiste__marke:hover { text-decoration: none; }
.leiste__marke .wappenstapel img { width: 24px; }
.leiste__marke .wappenstapel--3 img { width: 18px; }
.leiste__name { display: flex; flex-direction: column; font-size: 13px; font-weight: 600; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.leiste__name small { font-size: 11.5px; font-weight: 500; color: var(--text-leise); }
.leiste__einklappen { margin-left: auto; border: 0; background: none; cursor: pointer; color: var(--grau); padding: 6px; border-radius: 7px; display: grid; }
.leiste__einklappen:hover { background: var(--flaeche); color: var(--text); }
.leiste__einklappen .ic { width: 17px; height: 17px; }
.leiste__korpus { flex: 1; min-height: 0; display: flex; }

.rail {
  width: var(--rail-breite); flex: none; display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 12px 0; border-right: 1px solid var(--linie);
}
.rail__knopf, .rail__ich {
  position: relative; width: 36px; height: 36px; border-radius: 10px; border: 0; cursor: pointer;
  display: grid; place-items: center; background: transparent; color: var(--text-leise); transition: background .12s, color .12s;
}
.rail__knopf .ic { width: 18px; height: 18px; }
.rail__knopf:hover { background: #efeff1; color: var(--text); }
.rail__knopf.aktiv { background: #fff; color: var(--text); box-shadow: 0 0 0 1px var(--linie), 0 1px 2px rgba(16, 24, 40, .06); }
.rail__zahl {
  position: absolute; top: -3px; right: -4px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px;
  background: var(--text); color: #fff; font-size: 9.5px; font-weight: 600; line-height: 16px; text-align: center;
  box-shadow: 0 0 0 2px #fbfbfc; font-variant-numeric: tabular-nums;
}
.rail__fuss { margin-top: auto; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.rail__ich { cursor: default; }
[data-tipp]:hover::after {
  content: attr(data-tipp); position: absolute; left: calc(100% + 10px); top: 50%; transform: translateY(-50%);
  background: var(--text); color: #fff; font-size: 12px; font-weight: 500; white-space: nowrap;
  padding: 4px 8px; border-radius: 6px; pointer-events: none; z-index: 80;
}

.panel { width: var(--panel-breite); flex: none; display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.panel__titel { font-size: 13px; font-weight: 600; color: var(--text); padding: 16px 18px 4px; }
.panel__liste { flex: 1; overflow-y: auto; padding: 0 10px 14px; display: flex; flex-direction: column; gap: 1px; }
.panel__gruppe { font-size: 11.5px; font-weight: 500; color: var(--grau); padding: 14px 10px 4px; }
.panel__link {
  position: relative; display: flex; align-items: center; gap: 10px; height: 32px; padding: 0 10px; border-radius: 8px;
  color: var(--text-2); font-weight: 500; font-size: 13.5px; text-decoration: none; white-space: nowrap; transition: background .12s, color .12s;
}
.panel__link .ic { width: 16px; height: 16px; color: var(--text-leise); }
.panel__text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.panel__link:hover { background: #efeff1; color: var(--text); text-decoration: none; }
.panel__link.aktiv { background: #fff; color: var(--text); box-shadow: 0 0 0 1px var(--linie), var(--schatten); }
.panel__link.aktiv .ic { color: var(--text); }
.panel__zahl {
  min-width: 20px; height: 18px; padding: 0 6px; border-radius: 9px; background: #ececee; color: var(--text-2);
  font-size: 11px; font-weight: 600; line-height: 18px; text-align: center; flex: none; font-variant-numeric: tabular-nums;
}
.panel__link.aktiv .panel__zahl { background: #e4e4e7; color: var(--text); }
.leiste-hinter { display: none; }

/* =============================================================== Seite */
.seitenkopf { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.seitenkopf > div:first-child { display: flex; flex-direction: column; }
.seitenkopf h1 { font-size: 24px; font-weight: 650; letter-spacing: -.02em; color: var(--text); order: 2; }
.seitenkopf__kicker { order: 3; font-size: 13.5px; color: var(--text-leise); margin-top: 2px; }
.seitenkopf__kicker .ic { color: var(--text-leise); }
.seitenkopf__aktionen { display: flex; gap: 8px; flex-wrap: wrap; }
.zurueck { order: 1; display: inline-flex; align-items: center; gap: 4px; font-size: 13px; margin-bottom: 6px; color: var(--text-leise); }
.zurueck:hover { color: var(--text); text-decoration: none; }

.raster { display: grid; gap: 16px; }
.raster--kpi { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
.raster--2 { grid-template-columns: repeat(auto-fit, minmax(420px, 1fr)); }
.raster--3 { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.raster--haupt { grid-template-columns: minmax(0, 2fr) minmax(320px, 1fr); }
.stapel { display: flex; flex-direction: column; gap: 16px; }
.raster > *, .stapel > * { min-width: 0; }

/* Karten */
.karte { background: #fff; border-radius: var(--radius); border: 1px solid var(--linie); box-shadow: var(--schatten); }
.karte__kopf { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--linie); }
.karte__kopf h2 { font-size: 14px; font-weight: 600; color: var(--text); display: flex; align-items: center; gap: 8px; }
.karte__kopf h2 .ic { color: var(--text-leise); width: 16px; height: 16px; margin: 0; }
.karte__kopf > a, .karte__kopf .klein { font-size: 12.5px; font-weight: 500; color: var(--text-leise); }
.karte__kopf > a:hover { color: var(--text); }
.karte__inhalt { padding: 16px; }
.karte__fuss { padding: 10px 16px; border-top: 1px solid var(--linie); font-size: 13px; }

/* Kennzahlen */
.kpi { padding: 16px 18px; display: flex; flex-direction: column; gap: 2px; color: inherit; transition: box-shadow .15s, border-color .15s; }
.kpi:hover { text-decoration: none; border-color: var(--linie-stark); box-shadow: var(--schatten-m); }
.kpi__titel { font-size: 12.5px; color: var(--text-leise); font-weight: 500; display: flex; align-items: center; gap: 7px; }
.kpi__titel::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--akzent, var(--linie-stark)); flex: none; }
.kpi__wert { font-size: 26px; font-weight: 650; letter-spacing: -.02em; line-height: 1.2; color: var(--text); font-variant-numeric: tabular-nums; margin-top: 4px; }
.kpi__zusatz { font-size: 12px; color: var(--text-leise); }

/* Status & Chips */
.status {
  display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 500; white-space: nowrap;
  padding: 2px 8px 2px 7px; border-radius: 999px; background: var(--bg); color: var(--fg);
}
.status::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--fg); }
.st-ueberfaellig { --fg: var(--st-ueberfaellig); --bg: var(--st-ueberfaellig-bg); }
.st-faellig { --fg: var(--st-faellig); --bg: var(--st-faellig-bg); }
.st-ok { --fg: var(--st-ok); --bg: var(--st-ok-bg); }
.st-unbekannt { --fg: var(--st-unbekannt); --bg: var(--st-unbekannt-bg); }
.punkt { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--fg); flex: none; }

.chip {
  display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 500; padding: 1px 8px; border-radius: 999px;
  background: var(--flaeche); color: var(--text-2); white-space: nowrap; border: 1px solid transparent; line-height: 1.6;
}
.chip .ic { width: 13px; height: 13px; }
a.chip:hover { text-decoration: none; background: #ececee; }
.chip--rot { background: var(--gefahr-hell); color: var(--gefahr-dunkel); }
.chip--gelb { background: var(--st-faellig-bg); color: #b45309; }
.chip--gruen { background: var(--st-ok-bg); color: #15803d; }
.prio-dringend { background: var(--gefahr-hell); color: var(--gefahr-dunkel); font-weight: 600; }
.prio-hoch { background: var(--st-faellig-bg); color: #b45309; }
.prio-niedrig { color: var(--text-leise); }
.kp-chip { font-weight: 600; font-size: 11px; letter-spacing: .02em; background: #fff; border-color: var(--linie-stark); color: var(--text-2); }

.avatar {
  display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; flex: none;
  background: #e4e4e7; color: var(--text-2); font-size: 10.5px; font-weight: 600; letter-spacing: .01em;
}
.avatar--klein { width: 22px; height: 22px; font-size: 9.5px; }
.person { display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
.person span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Knöpfe */
.btn {
  display: inline-flex; align-items: center; gap: 6px; justify-content: center; height: 34px; padding: 0 12px;
  border: 1px solid var(--linie-stark); background: #fff; color: var(--text); border-radius: var(--radius-s);
  cursor: pointer; font-weight: 500; font-size: 13.5px; text-decoration: none; white-space: nowrap; box-shadow: var(--schatten);
  transition: background .12s, border-color .12s, box-shadow .12s;
}
.btn .ic { width: 15px; height: 15px; }
.btn:hover { background: var(--flaeche); text-decoration: none; }
.btn--primaer { background: var(--text); border-color: var(--text); color: #fff; box-shadow: 0 1px 2px rgba(16, 24, 40, .12), inset 0 1px 0 rgba(255, 255, 255, .1); }
.btn--primaer:hover { background: #27272a; border-color: #27272a; }
.btn--klein { height: 28px; padding: 0 9px; font-size: 12.5px; border-radius: 7px; }
.btn--text { border-color: transparent; background: transparent; color: var(--text-2); box-shadow: none; padding-left: 6px; padding-right: 6px; }
.btn--text:hover { background: var(--flaeche); color: var(--text); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
label.checkbox.btn { gap: 8px; }
.knopfgruppe { display: inline-flex; padding: 2px; background: var(--flaeche); border-radius: 9px; gap: 2px; }
.knopfgruppe .btn { height: 30px; border: 0; box-shadow: none; background: transparent; color: var(--text-leise); border-radius: 7px; }
.knopfgruppe .btn:hover { color: var(--text); background: transparent; }
.knopfgruppe .btn.aktiv { background: #fff; color: var(--text); box-shadow: 0 1px 2px rgba(16, 24, 40, .08), 0 0 0 1px var(--linie); }
.symbolknopf { border: 0; background: none; width: 30px; height: 30px; border-radius: 7px; display: grid; place-items: center; color: var(--text-leise); cursor: pointer; }
.symbolknopf:hover { background: var(--flaeche); color: var(--text); text-decoration: none; }
.schliessen { border: 0; background: none; cursor: pointer; padding: 6px; color: var(--text-leise); border-radius: 7px; display: inline-grid; }
.schliessen:hover { background: var(--flaeche); color: var(--text); }

/* Formulare */
.feld { display: flex; flex-direction: column; gap: 6px; }
.feld > span { font-size: 13px; font-weight: 500; color: var(--text-2); }
.feld > span small { font-weight: 400; color: var(--text-leise); }
.feld input, .feld select, .feld textarea, .eingabe {
  height: 36px; border: 1px solid var(--linie-stark); border-radius: var(--radius-s); padding: 0 11px; background: #fff; width: 100%;
  font-size: 13.5px; box-shadow: var(--schatten); transition: border-color .12s, box-shadow .12s;
}
.feld textarea, textarea.eingabe { height: auto; min-height: 84px; padding: 9px 11px; resize: vertical; line-height: 1.5; }
.feld input[type='file'] { padding: 6px 8px; height: auto; }
.feld input[type='checkbox'] { width: 16px; height: 16px; box-shadow: none; }
.feld input:focus, .feld select:focus, .feld textarea:focus, .eingabe:focus { border-color: var(--grau-dunkel); outline: none; box-shadow: var(--fokus); }
.feld small { color: var(--text-leise); font-size: 12px; }
.formular { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.formular .breit { grid-column: 1 / -1; }
.filterleiste { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 16px; }
.filterleiste .eingabe, .filterleiste select {
  width: auto; min-width: 150px; height: 34px; border: 1px solid var(--linie-stark); border-radius: var(--radius-s);
  padding: 0 10px; background: #fff; font-size: 13.5px; box-shadow: var(--schatten);
}
.filterleiste .suchfeld { min-width: 240px; flex: 1; max-width: 360px; }
.checkbox { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 13.5px; }
.checkbox input { width: 16px; height: 16px; accent-color: var(--text); }

/* Tabellen */
.tabelle-huelle { overflow-x: auto; }
table.tabelle { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13.5px; }
.tabelle th {
  text-align: left; font-weight: 500; font-size: 12.5px; color: var(--text-leise); padding: 9px 14px; white-space: nowrap;
  background: #fafafa; border-bottom: 1px solid var(--linie);
}
.tabelle th:first-child { border-top-left-radius: var(--radius); }
.tabelle th:last-child { border-top-right-radius: var(--radius); }
.tabelle th button { all: unset; cursor: pointer; display: inline-flex; gap: 4px; align-items: center; }
.tabelle th button:hover { color: var(--text); }
.tabelle td { padding: 11px 14px; border-bottom: 1px solid var(--linie); vertical-align: top; }
.tabelle tbody tr:last-child td { border-bottom: 0; }
.tabelle tr.klickbar { cursor: pointer; }
.tabelle tbody tr:hover td { background: #fafafa; }
.tabelle .leise { color: var(--text-leise); font-size: 12.5px; }
.tabelle .rechts { text-align: right; font-variant-numeric: tabular-nums; }
.tabelle .nowrap { white-space: nowrap; }
.tabelle .fett { font-weight: 500; }

.leise { color: var(--text-leise); }
.klein { font-size: 12.5px; }
.fett { font-weight: 600; }
.rot { color: var(--gefahr); }
.gruen { color: var(--st-ok); }
.zeile { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.zeile--zwischen { justify-content: space-between; }
.trenner { border: 0; border-top: 1px solid var(--linie); margin: 14px 0; }
.leer { padding: 36px 18px; text-align: center; color: var(--text-leise); font-size: 13.5px; }
.leer .ic { width: 28px; height: 28px; color: var(--grau); display: block; margin: 0 auto 10px; }

/* Listen */
.liste { list-style: none; margin: 0; padding: 4px 0; }
.liste > li { padding: 10px 16px; display: flex; gap: 12px; align-items: flex-start; }
.liste > li + li { border-top: 1px solid var(--linie); }
.liste a.liste__link { color: inherit; display: flex; gap: 12px; align-items: flex-start; flex: 1; min-width: 0; }
.liste a.liste__link:hover { text-decoration: none; }
.liste a.liste__link:hover .liste__titel { text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--grau); }
.liste__titel { font-weight: 500; font-size: 13.5px; }
.liste__meta { font-size: 12.5px; color: var(--text-leise); }
.liste__rechts { margin-left: auto; text-align: right; flex: none; }
.datum-box { flex: none; width: 42px; text-align: center; border: 1px solid var(--linie); border-radius: 9px; overflow: hidden; font-size: 10px; line-height: 1.2; background: #fff; }
.datum-box b { display: block; font-size: 16px; font-weight: 650; padding: 4px 0 0; font-variant-numeric: tabular-nums; }
.datum-box span { display: block; color: var(--fg, var(--text-leise)); text-transform: uppercase; font-weight: 600; letter-spacing: .04em; padding: 0 0 4px; }

/* Balken */
.balken { display: flex; height: 6px; border-radius: 999px; overflow: hidden; background: var(--flaeche); gap: 2px; }
.balken > i { display: block; height: 100%; border-radius: 999px; }
.legende { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12px; color: var(--text-leise); }
.legende span { display: inline-flex; align-items: center; gap: 6px; }

/* Liegenschaftskacheln */
.kachel { display: flex; flex-direction: column; color: inherit; overflow: hidden; transition: box-shadow .15s, border-color .15s; }
.kachel:hover { text-decoration: none; border-color: var(--linie-stark); box-shadow: var(--schatten-m); }
.kachel__band { display: none; }
.kachel__kopf { padding: 16px 16px 8px; display: flex; gap: 12px; align-items: flex-start; }
.kachel__icon { width: 36px; height: 36px; border-radius: 10px; background: var(--flaeche); color: var(--text-2); display: grid; place-items: center; flex: none; }
.kachel__icon .ic { width: 18px; height: 18px; }
.kachel h3 { font-size: 14.5px; font-weight: 600; color: var(--text); }
.kachel__nr { font-size: 12px; color: var(--text-leise); margin-bottom: 2px; display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.kachel__rumpf { padding: 4px 16px 14px; font-size: 13px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.kachel__fuss { padding: 10px 16px; border-top: 1px solid var(--linie); display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 12.5px; background: #fcfcfd; }

/* Reiter */
.reiter { display: flex; gap: 20px; border-bottom: 1px solid var(--linie); margin-bottom: 20px; overflow-x: auto; }
.reiter button {
  border: 0; background: none; padding: 10px 0; cursor: pointer; font-weight: 500; font-size: 13.5px; color: var(--text-leise);
  border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; display: inline-flex; gap: 6px; align-items: center;
}
.reiter button:hover { color: var(--text); }
.reiter button.aktiv { color: var(--text); border-bottom-color: var(--text); }
.reiter .zahl { background: var(--flaeche); border-radius: 999px; padding: 0 7px; font-size: 11.5px; color: var(--text-leise); font-variant-numeric: tabular-nums; }

.daten { display: grid; grid-template-columns: max-content 1fr; gap: 8px 20px; font-size: 13.5px; margin: 0; }
.daten dt { color: var(--text-leise); }
.daten dd { margin: 0; }

/* Aufgabenboard */
.board { display: grid; grid-template-columns: repeat(3, minmax(280px, 1fr)); gap: 16px; align-items: start; }
.spalte { background: var(--flaeche); border-radius: var(--radius); padding: 8px; min-height: 200px; border: 1px solid transparent; }
.spalte--ziel { border: 1px dashed var(--grau-dunkel); background: #ececee; }
.spalte__kopf { display: flex; justify-content: space-between; align-items: center; padding: 6px 8px 10px; }
.spalte__kopf h3 { font-size: 13px; font-weight: 600; display: flex; align-items: center; gap: 6px; }
.spalte__kopf h3 .ic { color: var(--text-leise); }
.spalte__liste { display: flex; flex-direction: column; gap: 8px; }
.karteikarte {
  position: relative; background: #fff; border-radius: 10px; padding: 11px 12px 11px 14px; border: 1px solid var(--linie);
  box-shadow: var(--schatten); cursor: pointer; color: inherit; display: block; transition: box-shadow .15s, border-color .15s;
}
.karteikarte::before { content: ''; position: absolute; left: 0; top: 10px; bottom: 10px; width: 3px; border-radius: 0 3px 3px 0; background: var(--fg, transparent); }
.karteikarte:hover { box-shadow: var(--schatten-m); border-color: var(--linie-stark); text-decoration: none; }
.karteikarte[draggable='true'] { cursor: grab; }
.karteikarte__titel { font-weight: 500; font-size: 13.5px; line-height: 1.4; }
.karteikarte__meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 8px; font-size: 12px; color: var(--text-leise); }

/* Kalender */
.kalender { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.kalender__wt { padding: 8px 10px; font-size: 12px; font-weight: 500; color: var(--text-leise); border-bottom: 1px solid var(--linie); }
.kalender__tag { min-height: 112px; padding: 6px; border-right: 1px solid var(--linie); border-bottom: 1px solid var(--linie); display: flex; flex-direction: column; gap: 3px; min-width: 0; cursor: pointer; }
.kalender__tag:nth-child(7n) { border-right: 0; }
.kalender__tag--fremd { background: #fcfcfd; color: var(--grau); }
.kalender__tag--we { background: #fcfcfd; }
.kalender__tag--heute .kalender__nr { background: var(--text); color: #fff; }
.kalender__nr { font-size: 12px; font-weight: 600; width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%; font-variant-numeric: tabular-nums; }
.termin {
  font-size: 11.5px; line-height: 1.35; padding: 2px 6px 2px 9px; border-radius: 5px; background: var(--bg); color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; cursor: pointer; position: relative;
}
.termin::before { content: ''; position: absolute; left: 3px; top: 4px; bottom: 4px; width: 2px; border-radius: 2px; background: var(--fg); }
.termin:hover { text-decoration: none; filter: brightness(.97); }
.termin--aufgabe { --fg: var(--text-leise); --bg: var(--flaeche); }
.mehr { font-size: 11.5px; color: var(--text-leise); cursor: pointer; background: none; border: 0; padding: 0 4px; text-align: left; }

/* Karte */
.kartenansicht { position: relative; height: calc(100vh - var(--kopf-hoehe) - 150px); min-height: 520px; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--linie); background: #e5e7e4; }
.kartenansicht .karte-canvas, .minikarte .karte-canvas { position: absolute; inset: 0; }
.minikarte { height: 240px; border-radius: 10px; overflow: hidden; position: relative; background: #e5e7e4; }
.kartenpanel {
  position: absolute; z-index: 5; top: 12px; left: 12px; width: 290px; max-height: calc(100% - 24px); overflow: auto;
  background: rgba(255, 255, 255, .96); backdrop-filter: blur(8px); border-radius: 12px; box-shadow: var(--schatten-hoch); font-size: 13px;
}
.kartenpanel section { padding: 12px 14px; border-bottom: 1px solid var(--linie); }
.kartenpanel h4 { font-size: 12px; font-weight: 500; color: var(--text-leise); margin-bottom: 8px; }
.ebenen { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; }
.ebenen button {
  border: 1px solid var(--linie-stark); background: #fff; border-radius: 9px; padding: 8px 6px; cursor: pointer; font-size: 12px; font-weight: 500;
  display: flex; flex-direction: column; align-items: center; gap: 4px; color: var(--text-2);
}
.ebenen button .ic { width: 17px; height: 17px; }
.ebenen button.aktiv { border-color: var(--text); background: #fff; color: var(--text); box-shadow: 0 0 0 1px var(--text); }
.kartenpanel .checkbox { display: flex; padding: 3px 0; }
.kartenpanel__liste { list-style: none; margin: 0; padding: 4px; }
.kartenpanel__liste li { display: flex; gap: 10px; align-items: center; padding: 7px 10px; cursor: pointer; border-radius: 8px; }
.kartenpanel__liste li:hover { background: var(--flaeche); }
.kartenmarker { width: 30px; height: 30px; padding: 0; border: 0; background: none; cursor: pointer; }
.kartenmarker > i {
  width: 30px; height: 30px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); background: var(--fg); border: 2px solid #fff;
  box-shadow: 0 4px 10px rgba(0, 0, 0, .3); display: grid; place-items: center;
}
.kartenmarker .ic { transform: rotate(45deg); color: #fff; width: 14px; height: 14px; }
.kartenmarker:hover > i { box-shadow: 0 0 0 3px #fff, 0 4px 12px rgba(0, 0, 0, .35); }
.maplibregl-popup-content { font-family: var(--schrift); border-radius: 12px; padding: 12px 14px; box-shadow: var(--schatten-hoch); }
.popup h4 { font-size: 14px; font-weight: 600; margin: 0 0 4px; }
.popup p { margin: 4px 0; font-size: 12.5px; }
.kartenhinweis { position: absolute; z-index: 5; right: 12px; bottom: 34px; background: rgba(255, 255, 255, .92); font-size: 11.5px; padding: 3px 8px; border-radius: 6px; color: var(--text-leise); }

/* Dialoge */
.dialog-hinter {
  position: fixed; inset: 0; background: rgba(24, 24, 27, .4); backdrop-filter: blur(3px); z-index: 100;
  display: flex; align-items: flex-start; justify-content: center; padding: 6vh 16px; overflow-y: auto; animation: einblenden .15s ease-out;
}
.dialog { background: #fff; border-radius: 16px; box-shadow: var(--schatten-hoch); width: 100%; max-width: 640px; animation: rein .18s ease-out; }
.dialog--breit { max-width: 820px; }
.dialog__kopf { padding: 18px 22px 14px; display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.dialog__kopf h2 { font-size: 17px; font-weight: 600; }
.dialog__kopf p { margin: 2px 0 0; color: var(--text-leise); font-size: 13px; }
.dialog__inhalt { padding: 4px 22px 20px; }
.dialog__fuss { padding: 14px 22px; border-top: 1px solid var(--linie); display: flex; justify-content: flex-end; gap: 8px; background: #fcfcfd; border-radius: 0 0 16px 16px; }
.fehlermeldung { background: var(--gefahr-hell); color: var(--gefahr-dunkel); padding: 9px 12px; border-radius: 9px; font-size: 13px; margin-bottom: 14px; border: 1px solid #fecaca; }
.ergebniswahl { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.ergebniswahl button { border: 1px solid var(--linie-stark); background: #fff; border-radius: 9px; padding: 8px 4px; cursor: pointer; font-size: 12.5px; font-weight: 500; }
.ergebniswahl button.aktiv { border-color: var(--fg); background: var(--bg); color: var(--fg); box-shadow: 0 0 0 1px var(--fg); }
.mangelzeile { display: grid; grid-template-columns: 1fr 170px 32px; gap: 8px; align-items: center; margin-bottom: 8px; }
.checkliste { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; }

/* Toasts */
.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 200; display: flex; flex-direction: column; gap: 8px; }
.toast {
  background: var(--text); color: #fff; padding: 10px 14px; border-radius: 10px; box-shadow: var(--schatten-hoch); font-size: 13.5px;
  display: flex; gap: 10px; align-items: center; max-width: 440px; animation: rein .2s ease-out;
}
.toast--ok .ic { color: #4ade80; }
.toast--fehler { background: var(--gefahr); }
@keyframes rein { from { transform: translateY(6px); opacity: 0; } }
@keyframes einblenden { from { opacity: 0; } }

.laden { padding: 60px; text-align: center; color: var(--text-leise); font-size: 13px; }
.laden::before {
  content: ''; display: block; width: 22px; height: 22px; margin: 0 auto 10px; border-radius: 50%;
  border: 2px solid var(--linie-stark); border-top-color: var(--text); animation: dreh .7s linear infinite;
}
@keyframes dreh { to { transform: rotate(360deg); } }

.kommentar { display: flex; gap: 10px; padding: 12px 0; }
.kommentar + .kommentar { border-top: 1px solid var(--linie); }
.kommentar p { margin: 2px 0 0; font-size: 13.5px; }
.qr { width: 120px; height: 120px; border: 1px solid var(--linie); border-radius: 10px; padding: 6px; background: #fff; }
.hinweisbox { background: var(--gelb-hell); border: 1px solid #fef08a; padding: 10px 14px; border-radius: 10px; font-size: 13px; color: #713f12; }
.hinweisbox--rot { background: var(--gefahr-hell); border-color: #fecaca; color: var(--gefahr-dunkel); }
.fussnote { margin-top: 30px; font-size: 12px; color: var(--text-leise); text-align: center; }
.anhaenge { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }

/* Dokumente */
.ablage { position: relative; min-height: 240px; border-radius: var(--radius); }
.ablage--aktiv, .ablagekarte--aktiv { outline: 2px dashed var(--grau-dunkel); outline-offset: 4px; }
.ablagekarte { position: relative; }
.ablage__hinweis {
  position: absolute; inset: 0; z-index: 5; display: grid; place-items: center; pointer-events: none; border-radius: var(--radius);
  font-size: 15px; font-weight: 600; color: var(--text); background: rgba(244, 244, 245, .94);
}
.ablage__hinweis .ic { width: 22px; height: 22px; margin-right: 8px; }
.ablage__leer { cursor: pointer; border-style: dashed; box-shadow: none; }
.ablage__leer:hover { border-color: var(--grau-dunkel); }
.ablage__filter { display: flex; flex-wrap: wrap; gap: 6px; padding: 12px 16px 0; }
.filterpille { border: 1px solid var(--linie-stark); background: #fff; border-radius: 999px; padding: 2px 10px; font-size: 12px; font-weight: 500; color: var(--text-2); cursor: pointer; }
.filterpille span { color: var(--text-leise); margin-left: 2px; }
.filterpille.aktiv { background: var(--text); border-color: var(--text); color: #fff; }
.filterpille.aktiv span { color: rgba(255, 255, 255, .65); }
.ablage__leerflaeche {
  margin: 14px 16px 16px; width: calc(100% - 32px); border: 1px dashed var(--linie-stark); border-radius: 10px; background: #fcfcfd;
  padding: 22px 16px; display: flex; flex-direction: column; align-items: center; gap: 4px; cursor: pointer; color: var(--text-2); font: inherit; font-size: 13.5px;
}
.ablage__leerflaeche:hover { border-color: var(--grau-dunkel); background: var(--flaeche); }
.ablage__leerflaeche .ic { width: 22px; height: 22px; color: var(--text-2); }
.ablage__leerflaeche small { color: var(--text-leise); font-size: 12px; }
.dokliste { list-style: none; margin: 0; padding: 4px 0; }
.dokliste li { display: flex; gap: 12px; align-items: center; padding: 8px 16px; }
.dokliste li:hover { background: #fafafa; }
.dokliste__text { flex: 1; min-width: 0; }
.dokliste__text a { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; color: var(--text); }
.dokliste__aktionen { display: flex; gap: 2px; opacity: 0; transition: opacity .12s; }
.dokliste li:hover .dokliste__aktionen, .dokliste li:focus-within .dokliste__aktionen { opacity: 1; }
.vorschau { width: 36px; height: 36px; object-fit: cover; border-radius: 8px; border: 1px solid var(--linie); flex: none; }
.dateisymbol { width: 36px; height: 36px; border-radius: 8px; background: var(--flaeche); color: var(--text-leise); display: grid; place-items: center; flex: none; }
.dateisymbol .ic { width: 17px; height: 17px; }
.dateiliste { list-style: none; margin: 0; padding: 0; border: 1px solid var(--linie); border-radius: 10px; max-height: 260px; overflow: auto; }
.dateiliste li { display: flex; gap: 10px; align-items: center; padding: 8px 12px; font-size: 13px; }
.dateiliste li + li { border-top: 1px solid var(--linie); }
.fortschrittsbalken { height: 4px; background: var(--flaeche); border-radius: 2px; margin-top: 5px; overflow: hidden; }
.fortschrittsbalken i { display: block; height: 100%; background: var(--text); transition: width .15s; }
.dateifeld { border: 1px dashed var(--linie-stark); border-radius: 10px; padding: 10px 12px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; background: #fcfcfd; }
.dateifeld .dateiliste { flex-basis: 100%; background: #fff; }
.dateifeld--aktiv { border-color: var(--grau-dunkel); background: var(--flaeche); }

/* Versicherungen */
.matrix th { white-space: normal; text-align: center; min-width: 76px; vertical-align: bottom; }
.matrix th:first-child { text-align: left; min-width: 220px; }
.matrix--zahlen th { text-align: right; }
.matrix--zahlen th:first-child { text-align: left; }
.zelle { text-align: center; vertical-align: middle; }
.zelle .ic { width: 14px; height: 14px; }
.zelle--ok { color: var(--st-ok); }
.zelle--ok a { color: var(--st-ok); display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 7px; background: var(--st-ok-bg); }
.zelle--ok a:hover { background: #dcfce7; text-decoration: none; }
td.zelle--fehlt { color: var(--gefahr); }
td.zelle--fehlt .ic { display: block; margin: 0 auto; width: 26px; height: 26px; border-radius: 7px; -webkit-mask: none; mask: none; background: var(--gefahr-hell); position: relative; }
td.zelle--fehlt .ic::after { content: '✕'; position: absolute; inset: 0; display: grid; place-items: center; color: var(--gefahr); font-size: 12px; font-weight: 700; }
.zelle--vg { color: #1d4ed8; }
.zelle--vg .klein { background: #eff6ff; border-radius: 999px; padding: 2px 8px; font-weight: 500; white-space: nowrap; }
.zelle--leer { color: var(--linie-stark); }
.zelle-muster { display: inline-grid; place-items: center; width: 22px; height: 20px; border-radius: 6px; margin-right: 4px; }
.zelle-muster.zelle--ok { background: var(--st-ok-bg); }
.zelle-muster.zelle--fehlt { background: var(--gefahr-hell); color: var(--gefahr); }
.summenzeile td { font-weight: 600; background: #fafafa; border-top: 1px solid var(--linie-stark); }
.chip.auswahl { cursor: pointer; user-select: none; }
.objektwahl { border: 1px solid var(--linie); border-radius: 10px; padding: 6px 10px; max-height: 260px; overflow: auto; display: flex; flex-direction: column; gap: 4px; }

/* Prüfbuch (Druck) */
.pruefbuch { background: #fff; padding: 36px 44px; border: 1px solid var(--linie); border-radius: var(--radius); max-width: 1000px; margin: 0 auto; }
.pruefbuch__kopf { display: flex; gap: 18px; align-items: center; border-bottom: 2px solid var(--text); padding-bottom: 14px; margin-bottom: 18px; }
.pruefbuch__kopf img { width: 48px; }
.pruefbuch h1 { font-size: 22px; }
.pruefbuch h2 { font-size: 14px; color: var(--text); margin: 22px 0 8px; }

@media print {
  .kopf, .leiste, .seitenkopf__aktionen, .nicht-drucken, .toasts { display: none !important; }
  .rahmen, .haupt { display: block; height: auto; overflow: visible; }
  body { background: #fff; font-size: 11px; }
  .haupt { padding: 0; }
  .pruefbuch { border: 0; padding: 0; }
  .tabelle td, .tabelle th { padding: 4px 6px; }
}

/* =============================================================== Kleinere Bildschirme */
@media (max-width: 1180px) {
  .raster--haupt { grid-template-columns: 1fr; }
  .suche input { width: 210px; }
}
@media (max-width: 900px) {
  html, body { overflow-x: hidden; }
  .kopf { padding: 0 10px 0 8px; gap: 8px; }
  .demo-hinweis, .nur-breit, .auswahl__wert { display: none; }
  .kopf__rechts { gap: 6px; }
  .menue-knopf { display: inline-grid; place-items: center; border: 0; background: none; color: var(--text); border-radius: 8px; width: 36px; height: 36px; cursor: pointer; flex: none; }
  .menue-knopf:hover { background: var(--flaeche); }
  .auswahl__knopf { padding: 0 6px; gap: 4px; }
  .auswahl__liste { position: fixed; left: 12px; right: 12px; top: calc(var(--kopf-hoehe) + 6px); width: auto !important; }
  .leiste {
    position: fixed; inset: 0 auto 0 0; height: 100vh; width: min(calc(var(--rail-breite) + 250px), 86vw);
    transform: translateX(-105%); transition: transform .22s ease; box-shadow: var(--schatten-hoch); z-index: 90;
  }
  .leiste--offen { transform: none; }
  .leiste--offen .panel { flex: 1; width: auto; min-width: 0; }
  .leiste-hinter { display: block; position: fixed; inset: 0; background: rgba(24, 24, 27, .4); backdrop-filter: blur(2px); z-index: 85; }
  [data-tipp]:hover::after { display: none; }
  .suche { display: none; }
  .suche--mobil { display: block; margin-bottom: 16px; }
  .suche--mobil input { width: 100%; background: #fff; border-color: var(--linie-stark); }
  .haupt { padding: 18px 16px 48px; }
  .seitenkopf h1 { font-size: 21px; }
  .raster--2, .raster--3 { grid-template-columns: 1fr; }
  .raster--kpi { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .kpi { padding: 14px; }
  .kpi__wert { font-size: 22px; }
  .board { grid-template-columns: 1fr; }
  .formular { grid-template-columns: 1fr; }
  .ergebniswahl { grid-template-columns: repeat(2, 1fr); }
  .kalender__tag { min-height: 60px; }
  .termin { font-size: 0; padding: 0; height: 5px; background: var(--fg); }
  .termin::before { display: none; }
  .kalender__wt { font-size: 10.5px; padding: 6px 2px; text-align: center; }
  .kartenpanel { width: auto; right: 12px; max-height: 45%; }
  .kartenansicht { height: calc(100vh - var(--kopf-hoehe) - 120px); }
  .filterleiste .eingabe, .filterleiste select { min-width: 0; flex: 1 1 140px; }
  .filterleiste .suchfeld { max-width: none; flex-basis: 100%; }
  .mangelzeile { grid-template-columns: 1fr 120px 32px; }
  .tabelle--karten thead { display: none; }
  .tabelle--karten tr { display: block; padding: 10px 4px; border-bottom: 1px solid var(--linie); }
  .tabelle--karten td { display: block; border: 0; padding: 2px 10px; }
  .tabelle--karten td.rechts { text-align: left; }
  .pruefbuch { padding: 18px; }
  .liste > li { padding: 10px 14px; flex-wrap: wrap; }
  .liste a.liste__link { flex: 1 1 100%; }
  .liste__rechts { margin-left: 54px; text-align: left; }
  .karte__kopf { padding: 12px 14px; }
  .dokliste__aktionen { opacity: 1; }
}
@media (min-width: 901px) {
  .suche--mobil { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* Formulare als eigene Seiten */
.formseite__karte { padding: 24px; }
.formseite__fuss { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
/* Auf breiten Bildschirmen mehr Spalten statt gedehnter Felder */
.formseite .formular { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.formseite .seitenkopf__aktionen .btn:not(.btn--primaer) { display: none; }

/* Fuhrpark */
.fz-icon { width: 30px; height: 30px; padding: 0; justify-content: center; flex: none; border-radius: 8px; }
.fz-icon .ic { width: 15px; height: 15px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; }
.wochenplan th, .wochenplan td { min-width: 110px; }
.wochenplan th:first-child, .wochenplan td:first-child { min-width: 180px; }
.wochenplan .heute { background: #fafafa; }
.belegung { display: flex; flex-direction: column; background: var(--flaeche); border-left: 3px solid var(--text); border-radius: 6px; padding: 4px 7px; font-size: 12px; margin-bottom: 4px; }
.belegung span { color: var(--text-leise); }
.wochenplan .frei { all: unset; cursor: pointer; display: block; text-align: center; color: var(--text-leise); border: 1px dashed var(--linie-stark); border-radius: 6px; padding: 3px 0; opacity: 0; }
.wochenplan td:hover .frei, .wochenplan .frei:focus-visible { opacity: 1; }
.kopfwahl { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-leise); }
.kopfwahl .eingabe { height: 34px; min-width: 180px; }

/* ---------------------------------------------------------------------------
   Bereichsfarben: dunkle Rail, je Bereich eine Farbe, farbige Symbolkacheln.
   Die Hausfarbe der Körperschaft bleibt dem Wappen vorbehalten.
   ------------------------------------------------------------------------- */
:root {
  --b-liegenschaften: #1d64b0; --b-liegenschaften-hell: #e8f1fb; --b-liegenschaften-rail: #8fbbec;
  --b-versicherungen: #5b4fc4; --b-versicherungen-hell: #efedfe; --b-versicherungen-rail: #b4aef0;
  --b-fuhrpark: #c2410c;       --b-fuhrpark-hell: #ffeddf;       --b-fuhrpark-rail: #fdae79;
  --b-warnung: #b91c1c;        --b-warnung-hell: #fdeaea;
  --rail-bg: #18181b;
}
[data-bereich='liegenschaften'], [data-thema='liegenschaften'] { --bf: var(--b-liegenschaften); --bh: var(--b-liegenschaften-hell); --br: var(--b-liegenschaften-rail); }
[data-bereich='versicherungen'], [data-thema='versicherungen'] { --bf: var(--b-versicherungen); --bh: var(--b-versicherungen-hell); --br: var(--b-versicherungen-rail); }
[data-bereich='fuhrpark'], [data-thema='fuhrpark'] { --bf: var(--b-fuhrpark); --bh: var(--b-fuhrpark-hell); --br: var(--b-fuhrpark-rail); }
[data-thema='warnung'] { --bf: var(--b-warnung); --bh: var(--b-warnung-hell); }

/* Rail */
.rail { background: var(--rail-bg); border-right-color: var(--rail-bg); }
.rail__knopf { color: var(--br, #a1a1aa); }
.rail__knopf:hover { background: #27272a; color: #fff; }
.rail__knopf.aktiv { background: var(--bf); color: #fff; box-shadow: none; }
.rail__knopf:not([data-bereich]) { color: #a1a1aa; }
.rail__zahl { background: #fff; color: var(--rail-bg); box-shadow: 0 0 0 2px var(--rail-bg); }
.rail__ich .avatar { box-shadow: 0 0 0 1.5px #3f3f46; }
.leiste--zu .leiste__logo { background: var(--rail-bg); border-bottom-color: var(--rail-bg); }
.leiste--zu .leiste__einklappen, .leiste--zu .leiste__marke { color: #fff; }

/* Panel: aktiver Punkt in Bereichsfarbe */
.panel__link.aktiv .ic { color: var(--bf); }
.panel__link.aktiv .panel__zahl { background: var(--bh); color: var(--bf); }

/* Kartenköpfe: Symbol als farbige Kachel */
.karte__kopf h2:has(> .ic:first-child) { position: relative; padding-left: 36px; min-height: 26px; }
.karte__kopf h2:has(> .ic:first-child)::before {
  content: ''; position: absolute; left: 0; top: 50%; width: 26px; height: 26px; margin-top: -13px;
  border-radius: 8px; background: var(--bh, var(--flaeche));
}
.karte__kopf h2 > .ic:first-child { position: absolute; left: 5px; top: 50%; margin-top: -8px; color: var(--bf, var(--text-2)); }
.karte__kopf h2:has(> .ic[data-thema='fuhrpark']:first-child) { --bf: var(--b-fuhrpark); --bh: var(--b-fuhrpark-hell); }
.karte__kopf h2:has(> .ic[data-thema='versicherungen']:first-child) { --bf: var(--b-versicherungen); --bh: var(--b-versicherungen-hell); }
.karte__kopf h2:has(> .ic[data-thema='liegenschaften']:first-child) { --bf: var(--b-liegenschaften); --bh: var(--b-liegenschaften-hell); }
.karte__kopf h2:has(> .ic[data-thema='warnung']:first-child) { --bf: var(--b-warnung); --bh: var(--b-warnung-hell); }

/* Reiter und Kennzahlen greifen die Bereichsfarbe auf */
.reiter button.aktiv { border-bottom-color: var(--bf, var(--text)); }
.kpi:hover { border-color: var(--bf, var(--linie-stark)); }
.fz-icon { background: var(--b-fuhrpark-hell); color: var(--b-fuhrpark); }
/* Während des Speicherns: Absende-Knöpfe sichtbar gesperrt */
form[aria-busy='true'] button[type='submit'], .btn:disabled { opacity: .6; cursor: progress; pointer-events: none; }
/* Mehrere Knöpfe in einer Zelle: gleiche Höhe, mittig, mit Abstand */
.knopfzeile { display: inline-flex; align-items: center; gap: 6px; vertical-align: middle; }
.rechts > .knopfzeile { justify-content: flex-end; }
.btn--symbol { width: 28px; padding: 0; }
.btn--symbol:not(.btn--klein) { width: 34px; }

/* Anmeldung, Einladung, Bestätigung */
.anmeldung { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; background: var(--bg); }
.seite > .anmeldung { min-height: 0; padding-top: 48px; background: transparent; }
.anmeldung__karte { width: 100%; max-width: 400px; background: #fff; border: 1px solid var(--linie); border-radius: 16px; box-shadow: var(--schatten-m); padding: 32px 28px; display: flex; flex-direction: column; gap: 14px; }
.anmeldung__marke { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 14px; line-height: 1.2; margin-bottom: 8px; }
.anmeldung__marke small { display: block; font-size: 11.5px; font-weight: 500; color: var(--text-leise); }
.anmeldung__marke .wappenstapel img { width: 22px; }
.anmeldung h1 { font-size: 22px; letter-spacing: -.02em; margin: 0; }
.anmeldung__unter { margin: -6px 0 6px; color: var(--text-leise); font-size: 13.5px; }
.anmeldung__oder { display: flex; align-items: center; gap: 10px; color: var(--text-leise); font-size: 12px; }
.anmeldung__oder::before, .anmeldung__oder::after { content: ''; flex: 1; height: 1px; background: var(--linie); }
.anmeldung__wechsel { align-self: center; }
.btn--gross { height: 42px; font-size: 14px; width: 100%; }
.code-eingabe { font-size: 22px !important; letter-spacing: .35em; text-align: center; font-variant-numeric: tabular-nums; height: 48px !important; }
.wahl { all: unset; box-sizing: border-box; display: flex; gap: 12px; align-items: flex-start; padding: 14px; border: 1px solid var(--linie-stark); border-radius: 12px; cursor: pointer; }
.wahl:hover, .wahl:focus-visible { border-color: var(--text); background: var(--flaeche); }
.wahl > .ic { width: 20px; height: 20px; margin-top: 2px; }
.wahl b { display: block; font-size: 14px; }
.wahl small { display: block; color: var(--text-leise); font-size: 12.5px; margin-top: 2px; line-height: 1.45; }
.totp { display: flex; gap: 14px; align-items: flex-start; }
.totp__qr { flex: none; width: 132px; height: 132px; border: 1px solid var(--linie); border-radius: 10px; padding: 4px; background: #fff; }
.totp__qr svg { width: 100%; height: 100%; display: block; }
.totp__schluessel { display: inline-block; font-size: 12.5px; background: var(--flaeche); padding: 6px 8px; border-radius: 6px; word-break: break-all; }
.linkfeld { display: flex; gap: 8px; align-items: center; }
.linkfeld code { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; background: var(--flaeche); border: 1px solid var(--linie); border-radius: 8px; padding: 7px 10px; font-size: 12.5px; }

/* Dashboard */
:root { --b-dashboard: #0f766e; --b-dashboard-hell: #e0f2ef; --b-dashboard-rail: #7fd1c3; }
[data-bereich='dashboard'] { --bf: var(--b-dashboard); --bh: var(--b-dashboard-hell); --br: var(--b-dashboard-rail); }
.raster--dashboard-kopf { grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr); align-items: stretch; }
.raster--kacheln { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.kpi--dashboard { position: relative; overflow: hidden; }
.kpi__symbol { position: absolute; right: 14px; top: 14px; width: 18px; height: 18px; color: var(--grau); }
.lagebild { display: flex; flex-direction: column; }
.lagebild .karte__inhalt { flex: 1; }
.lagebild__text { margin: 0 0 10px; font-size: 14.5px; line-height: 1.6; color: var(--text); }
.lagebild__liste { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; font-size: 13.5px; line-height: 1.5; color: var(--text-2); }
.lagebild__liste--punkte { padding-left: 18px; }
.lagebild__positiv { display: flex; gap: 6px; align-items: flex-start; margin: 12px 0 0; font-size: 13px; color: #15803d; }
.lagebild__positiv .ic { margin-top: 2px; }
.skelett { display: flex; flex-direction: column; gap: 8px; }
.skelett i { height: 12px; border-radius: 6px; background: linear-gradient(90deg, var(--flaeche), #ececee, var(--flaeche)); background-size: 200% 100%; animation: skelett 1.4s ease-in-out infinite; }
@keyframes skelett { from { background-position: 200% 0; } to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .skelett i { animation: none; } }

.diagramm { position: relative; width: 100%; }
.diagramm svg { display: block; overflow: visible; }
.diagramm .gitter { stroke: var(--linie); stroke-width: 1; }
.diagramm .achse { stroke: var(--linie-stark); stroke-width: 1; }
.diagramm .heute { stroke: var(--text-2); stroke-width: 1; stroke-dasharray: 3 3; }
.diagramm .achse__text { font-size: 11px; fill: var(--text-leise); font-variant-numeric: tabular-nums; }
.diagramm__tip { position: absolute; z-index: 5; pointer-events: none; min-width: 170px; max-width: 220px; background: #fff; border: 1px solid var(--linie); border-radius: 10px; box-shadow: var(--schatten-m); padding: 8px 10px; font-size: 12.5px; display: flex; flex-direction: column; gap: 3px; }
.diagramm__tip > div { display: flex; align-items: center; gap: 6px; color: var(--text-2); }
.diagramm__tip > div span { margin-left: auto; font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; }
.diagramm__tip i { width: 8px; height: 8px; border-radius: 2px; flex: none; }
.diagramm__tip .tip__gruppe { font-size: 11px; color: var(--text-leise); text-transform: none; margin-top: 3px; }
.legende { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 12px; font-size: 12.5px; color: var(--text-2); }
.legende span { display: inline-flex; align-items: center; gap: 6px; }
.legende i { width: 10px; height: 10px; border-radius: 3px; }

.balkenliste { display: flex; flex-direction: column; gap: 9px; }
.balkenliste__zeile { display: grid; grid-template-columns: minmax(90px, 150px) 1fr auto; gap: 10px; align-items: center; font-size: 13px; }
.balkenliste__name { color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.balkenliste__spur { height: 12px; }
.balkenliste__stapel { display: flex; gap: 2px; height: 12px; }
.balkenliste__stapel i { border-radius: 3px; min-width: 3px; }
.balkenliste__wert { font-variant-numeric: tabular-nums; white-space: nowrap; font-size: 12.5px; }
.minibalken { display: flex; align-items: center; gap: 8px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.minibalken span { width: 80px; height: 6px; border-radius: 3px; background: var(--flaeche); overflow: hidden; flex: none; }
.minibalken i { display: block; height: 100%; border-radius: 3px; }
.brennpunkt__punkt { width: 8px; height: 8px; border-radius: 50%; flex: none; margin-top: 6px; }
tr.gewaehlt td { background: var(--flaeche); }
@media (max-width: 1100px) { .raster--dashboard-kopf { grid-template-columns: 1fr; } }
@media (max-width: 640px) { .raster--kacheln { grid-template-columns: repeat(2, minmax(0, 1fr)); } .balkenliste__zeile { grid-template-columns: 90px 1fr auto; } }
