/* ImmoSoft — Oberfläche */
:root {
  --grund: #f5f7fa; --karte: #ffffff; --rand: #e2e8f0; --rand-stark: #cbd5e1;
  --text: #16202e; --text-leise: #64748b;
  --akzent: #1f5f8b; --akzent-hell: #e8f1f8;
  --gut: #0f7b52; --gut-hell: #e6f5ee;
  --warn: #b45309; --warn-hell: #fdf3e3;
  --fehler: #b42318; --fehler-hell: #fdeceb;
  --radius: 10px; --schatten: 0 1px 2px rgba(15,23,42,.06), 0 4px 14px rgba(15,23,42,.05);
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--grund); color: var(--text);
  font: 15px/1.5 "Segoe UI", system-ui, -apple-system, Roboto, Helvetica, Arial, sans-serif;
}
a { color: var(--akzent); text-decoration: none; }
a:hover { text-decoration: underline; }
.rahmen { display: flex; min-height: 100vh; }

/* ---------------------------------------------------------- Seitenleiste */
.seitenleiste {
  width: 216px; flex: 0 0 216px; background: #10243a; color: #cbd9e8;
  padding: 18px 12px; position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.marke { display: flex; align-items: center; gap: 8px; color: #fff; font-weight: 600;
  font-size: 18px; padding: 4px 8px 16px; }
.marke:hover { text-decoration: none; }
.logo { font-size: 20px; }
.seitenleiste nav a { display: block; padding: 7px 10px; border-radius: 8px; color: #cbd9e8;
  font-size: 14px; }
.seitenleiste nav a:hover { background: #1b3550; color: #fff; text-decoration: none; }
.seitenleiste nav a.aktiv { background: var(--akzent); color: #fff; font-weight: 600; }
.gruppe { margin: 16px 10px 4px; font-size: 11px; letter-spacing: .08em; text-transform: uppercase;
  color: #6d8098; }

/* ----------------------------------------------------------------- Kopf */
main { flex: 1; padding: 24px 28px 60px; max-width: 1500px; }
.kopf { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px;
  margin-bottom: 18px; flex-wrap: wrap; }
.kopf h1 { margin: 0; font-size: 24px; letter-spacing: -.01em; }
.kopf .unter { color: var(--text-leise); margin: 4px 0 0; font-size: 14px; }
.kopf-aktionen { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------------------------------------------------------------- Karten */
.karte { background: var(--karte); border: 1px solid var(--rand); border-radius: var(--radius);
  box-shadow: var(--schatten); padding: 18px; margin-bottom: 18px; }
.karte > h2 { margin: 0 0 12px; font-size: 15px; text-transform: uppercase; letter-spacing: .06em;
  color: var(--text-leise); }
.karte > h2 .rechts { float: right; text-transform: none; letter-spacing: 0; font-weight: 400; }
.raster { display: grid; gap: 18px; }
.raster.z2 { grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); }
.raster.z3 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.raster.z4 { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }

.kennzahl { background: var(--karte); border: 1px solid var(--rand); border-radius: var(--radius);
  padding: 14px 16px; box-shadow: var(--schatten); }
.kennzahl .titel { font-size: 12px; text-transform: uppercase; letter-spacing: .06em;
  color: var(--text-leise); }
.kennzahl .zahl { font-size: 26px; font-weight: 650; margin-top: 4px; letter-spacing: -.02em; }
.kennzahl .zusatz { font-size: 13px; color: var(--text-leise); margin-top: 2px; }
.kennzahl.gut .zahl { color: var(--gut); }
.kennzahl.warn .zahl { color: var(--warn); }
.kennzahl.fehler .zahl { color: var(--fehler); }

/* -------------------------------------------------------------- Tabellen */
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em;
  color: var(--text-leise); padding: 8px 10px; border-bottom: 1px solid var(--rand-stark);
  white-space: nowrap; }
td { padding: 9px 10px; border-bottom: 1px solid var(--rand); vertical-align: middle; }
tbody tr:hover { background: #f8fafc; }
tr.summe td { font-weight: 650; border-top: 2px solid var(--rand-stark); background: #f8fafc; }
.rechts, td.rechts, th.rechts { text-align: right; }
.mitte { text-align: center; }
.zahl-sp { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.leise { color: var(--text-leise); font-size: 13px; }
.klein { font-size: 12.5px; }
.leer { color: var(--text-leise); padding: 22px 4px; text-align: center; }

/* --------------------------------------------------------------- Knöpfe */
.knopf, button.knopf, a.knopf {
  display: inline-flex; align-items: center; gap: 6px; padding: 8px 13px; border-radius: 8px;
  border: 1px solid var(--rand-stark); background: #fff; color: var(--text); font-size: 14px;
  cursor: pointer; font-family: inherit; text-decoration: none; line-height: 1.2;
}
.knopf:hover { background: #f1f5f9; text-decoration: none; }
.knopf.wichtig { background: var(--akzent); border-color: var(--akzent); color: #fff; }
.knopf.wichtig:hover { background: #18506f; }
.knopf.gefahr { color: var(--fehler); border-color: #f2c9c5; background: #fff; }
.knopf.gefahr:hover { background: var(--fehler-hell); }
.knopf.klein { padding: 4px 9px; font-size: 13px; }
.knopf-reihe { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* -------------------------------------------------------------- Formular */
form.gitter { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px 16px; }
.feld { display: flex; flex-direction: column; gap: 4px; }
.feld.breit { grid-column: 1 / -1; }
.feld label { font-size: 12.5px; color: var(--text-leise); font-weight: 600; }
input[type=text], input[type=number], input[type=date], input[type=email], input[type=search],
select, textarea {
  padding: 8px 10px; border: 1px solid var(--rand-stark); border-radius: 8px; font: inherit;
  background: #fff; color: var(--text); width: 100%;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--akzent-hell);
  border-color: var(--akzent); }
textarea { min-height: 80px; resize: vertical; }
input[type=checkbox] { width: auto; }
.feld.schalter { flex-direction: row; align-items: center; gap: 8px; }
.feld.schalter label { font-weight: 500; color: var(--text); }
fieldset { border: 1px solid var(--rand); border-radius: var(--radius); padding: 14px 16px;
  margin: 0 0 16px; }
legend { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-leise);
  padding: 0 6px; }
.formular-fuss { display: flex; gap: 8px; margin-top: 16px; flex-wrap: wrap; align-items: center; }

/* -------------------------------------------------------------- Meldungen */
.meldung { padding: 11px 14px; border-radius: 8px; margin-bottom: 14px; font-size: 14px;
  border: 1px solid; }
.meldung.ok { background: var(--gut-hell); border-color: #bfe3d2; color: #12613f; }
.meldung.warn { background: var(--warn-hell); border-color: #f3ddb5; color: #8a4a08; }
.meldung.fehler { background: var(--fehler-hell); border-color: #f4c8c4; color: #94231a; }

/* --------------------------------------------------------------- Marken */
.marke-etikett, .etikett { display: inline-block; padding: 2px 8px; border-radius: 999px;
  font-size: 12px; font-weight: 600; background: #eef2f7; color: #47566b; white-space: nowrap; }
.etikett.gut { background: var(--gut-hell); color: var(--gut); }
.etikett.warn { background: var(--warn-hell); color: var(--warn); }
.etikett.fehler { background: var(--fehler-hell); color: var(--fehler); }
.etikett.info { background: var(--akzent-hell); color: var(--akzent); }

/* --------------------------------------------------------------- Balken */
.balken { background: #eef2f7; border-radius: 6px; height: 10px; overflow: hidden; min-width: 60px; }
.balken > span { display: block; height: 100%; background: var(--akzent); }
.balken.gut > span { background: var(--gut); }
.balken.warn > span { background: var(--warn); }
.saeulen { display: flex; align-items: flex-end; gap: 6px; height: 170px; padding-top: 8px; }
.saeule { flex: 1; display: flex; flex-direction: column; justify-content: flex-end;
  align-items: center; gap: 4px; height: 100%; }
.saeule .stab { width: 100%; background: linear-gradient(180deg, #2f7fb0, #1f5f8b);
  border-radius: 4px 4px 0 0; min-height: 2px; }
.saeule .stab.dl { background: #cbd5e1; }
.saeule .beschriftung { font-size: 10.5px; color: var(--text-leise); white-space: nowrap; }
.saeule .wert { font-size: 11px; font-variant-numeric: tabular-nums; }

/* ---------------------------------------------------------------- Reiter */
.reiter { display: flex; gap: 4px; border-bottom: 1px solid var(--rand); margin-bottom: 16px;
  flex-wrap: wrap; }
.reiter a, .reiter button { padding: 8px 14px; border: none; background: none; cursor: pointer;
  color: var(--text-leise); font: inherit; border-bottom: 2px solid transparent; }
.reiter a.aktiv, .reiter button.aktiv { color: var(--akzent); border-bottom-color: var(--akzent);
  font-weight: 600; }

/* ---------------------------------------------------------------- Editor */
.editor-leiste { display: flex; gap: 3px; flex-wrap: wrap; padding: 6px; background: #f8fafc;
  border: 1px solid var(--rand-stark); border-bottom: none; border-radius: 8px 8px 0 0; }
.editor-leiste button { border: 1px solid transparent; background: none; padding: 5px 9px;
  border-radius: 6px; cursor: pointer; font: inherit; font-size: 14px; min-width: 32px; }
.editor-leiste button:hover { background: #e6ecf3; border-color: var(--rand); }
.editor { min-height: 340px; border: 1px solid var(--rand-stark); border-radius: 0 0 8px 8px;
  padding: 18px 20px; background: #fff; font-size: 15px; line-height: 1.6; overflow-y: auto; }
.editor:focus { outline: none; border-color: var(--akzent); }
.editor p { margin: 0 0 10px; }
.platzhalter-liste { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.platzhalter-liste button { font-size: 12px; padding: 3px 8px; border-radius: 999px;
  border: 1px dashed var(--rand-stark); background: #fff; cursor: pointer; font-family: inherit; }
.platzhalter-liste button:hover { background: var(--akzent-hell); border-color: var(--akzent); }

/* ---------------------------------------------------------------- Galerie */
.galerie { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.galerie figure { margin: 0; border: 1px solid var(--rand); border-radius: 8px; overflow: hidden;
  background: #fff; }
.galerie img { width: 100%; height: 120px; object-fit: cover; display: block; background: #eef2f7; }
.galerie figcaption { padding: 6px 8px; font-size: 12.5px; display: flex; justify-content: space-between;
  align-items: center; gap: 6px; }

.zeile-flex { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.trenner { height: 1px; background: var(--rand); margin: 16px 0; border: 0; }
details.klapp > summary { cursor: pointer; padding: 6px 0; color: var(--akzent); font-size: 14px; }
.hinweis { font-size: 12.5px; color: var(--text-leise); margin-top: 4px; }
@media (max-width: 820px) {
  .rahmen { flex-direction: column; }
  .seitenleiste { width: 100%; flex: none; height: auto; position: static; }
  .seitenleiste nav { display: flex; flex-wrap: wrap; gap: 4px; }
  .gruppe { width: 100%; }
  main { padding: 16px; }
}

/* -------------------------------------------------- Anmeldung und Benutzer */
body.anmeldeseite { display: flex; align-items: center; justify-content: center;
  min-height: 100vh; background: linear-gradient(160deg, #10243a, #1f5f8b); padding: 20px; }
.anmeldekarte { background: var(--karte); border-radius: 14px; padding: 30px 32px;
  width: 100%; max-width: 380px; box-shadow: 0 18px 50px rgba(8,20,35,.35); }
.anmeldekarte.breit { max-width: 460px; }
.anmeldekarte h1 { font-size: 20px; margin: 0 0 6px; }
.anmeldekarte .feld { margin-bottom: 14px; }
.anmeldemarke { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 19px;
  margin-bottom: 18px; color: var(--akzent); }
.knopf.breit { width: 100%; justify-content: center; margin-top: 6px; }
.code-feld { font-family: ui-monospace, "Courier New", monospace; letter-spacing: .12em;
  font-size: 17px; }
.mitte { text-align: center; }

.benutzerfuss { margin-top: 20px; padding-top: 14px; border-top: 1px solid #24405c;
  display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.benutzerfuss a { color: #cbd9e8; font-size: 13px; display: block; padding: 4px 8px;
  border-radius: 8px; }
.benutzerfuss a:hover, .benutzerfuss a.aktiv { background: #1b3550; color: #fff; text-decoration: none; }
.rollenzeile { display: block; font-size: 11.5px; color: #7f93ab; }
.abmelden { background: none; border: 1px solid #2c4a68; color: #9db1c7; border-radius: 8px;
  padding: 5px 9px; font: inherit; font-size: 12.5px; cursor: pointer; }
.abmelden:hover { background: #1b3550; color: #fff; }

.qr { background: #fff; padding: 10px; border: 1px solid var(--rand); border-radius: 10px;
  width: max-content; margin: 10px 0 14px; }
.qr svg { width: 190px; height: 190px; display: block; }
.anleitung { margin: 0 0 14px 18px; padding: 0; color: var(--text); }
.anleitung li { margin-bottom: 6px; }
.codeliste { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px;
  margin-top: 10px; }
.codeliste code { background: #f1f5f9; border: 1px solid var(--rand); border-radius: 8px;
  padding: 8px 10px; font-size: 14px; letter-spacing: .06em; text-align: center; }
table.rechte td:first-child { font-weight: 500; }
input[type=password] { padding: 8px 10px; border: 1px solid var(--rand-stark); border-radius: 8px;
  font: inherit; width: 100%; }

/* --------------------------------------------------------------- Kacheln */
.kacheln { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 18px; }
.kachel { background: var(--karte); border: 1px solid var(--rand); border-radius: var(--radius);
  box-shadow: var(--schatten); overflow: hidden; display: flex; flex-direction: column; }
.kachel:hover { box-shadow: 0 2px 4px rgba(15,23,42,.08), 0 10px 26px rgba(15,23,42,.10); }
.kachelbild { position: relative; display: block; aspect-ratio: 16 / 10; background: #e8eef5; }
.kachelbild img { width: 100%; height: 100%; object-fit: cover; display: block; }
.kachelbild-leer { width: 100%; height: 100%; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 4px; color: #93a5b8;
  background: repeating-linear-gradient(45deg, #eef2f7, #eef2f7 12px, #e7edf4 12px, #e7edf4 24px); }
.kachelbild-leer span:first-child { font-size: 34px; }
.kachelmarke { position: absolute; top: 10px; right: 10px; padding: 3px 9px; border-radius: 999px;
  font-size: 12px; font-weight: 600; background: #fff; box-shadow: 0 1px 4px rgba(15,23,42,.2); }
.kachelmarke.gut { color: var(--gut); } .kachelmarke.warn { color: var(--warn); }
.kachelmarke.fehler { color: var(--fehler); }
.kachelkoerper { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.kachelkoerper h2 { margin: 0; font-size: 16.5px; }
.kachelkoerper h2 a { color: var(--text); }
.kachelzahlen { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 8px 0 4px; }
.kachelzahlen div { text-align: left; }
.kachelzahlen dt { font-size: 10.5px; text-transform: uppercase; letter-spacing: .04em;
  color: var(--text-leise); }
.kachelzahlen dd { margin: 1px 0 0; font-size: 14px; font-weight: 600;
  font-variant-numeric: tabular-nums; }
.kachelcheck { margin-top: auto; padding-top: 10px; border-top: 1px solid var(--rand); }
.kachelcheck .balken { margin-top: 6px; height: 7px; }
.kachelcheck .hinweis { margin-top: 6px; }
.umschalter { display: inline-flex; gap: 4px; }

/* ------------------------------------------------------------- Checkliste */
.checkliste { list-style: none; margin: 0; padding: 0; }
.checkliste li { display: flex; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--rand);
  align-items: flex-start; }
.checkliste li:last-child { border-bottom: 0; }
.haken { flex: 0 0 22px; width: 22px; height: 22px; border-radius: 50%; display: flex;
  align-items: center; justify-content: center; font-size: 13px; font-weight: 700; margin-top: 1px; }
.haken.ja { background: var(--gut-hell); color: var(--gut); }
.haken.nein { background: var(--fehler-hell); color: var(--fehler); }
.haken.offen { background: var(--warn-hell); color: var(--warn); }
.checkliste .titelzeile { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.checkliste .titelzeile b { font-weight: 600; }
.checkliste .wertzeile { font-size: 12.5px; color: var(--text-leise); }
.unterlagen-formular { border: 1px dashed var(--rand-stark); border-radius: 10px; padding: 12px 14px;
  background: #fbfcfe; }
.unterlagen-formular h3 { margin: 0 0 8px; font-size: 13.5px; }

/* ------------------------------------------------------------- Objektkopf */
.objektkopf { display: flex; gap: 18px; align-items: stretch; margin-bottom: 18px; flex-wrap: wrap; }
.objektkopf .objektbild { width: 260px; flex: 0 0 260px; height: auto; min-height: 150px;
  object-fit: cover; border-radius: var(--radius); border: 1px solid var(--rand);
  box-shadow: var(--schatten); background: #e8eef5; }
.objektkopf .raster { flex: 1 1 480px; margin: 0; }
@media (max-width: 700px) { .objektkopf .objektbild { width: 100%; flex: 1 1 100%; height: 180px; } }

/* ------------------------------------------------------ Merkmale, Verlauf */
.merkmalzeile { display: flex; gap: 8px; align-items: flex-start; padding: 4px 0;
  font-size: 14px; cursor: pointer; }
.merkmalzeile input { margin-top: 3px; flex: 0 0 auto; }
.merkmalzeile .hinweis { display: block; margin-top: 1px; }
.pruefzeile { display: flex; gap: 10px; align-items: flex-start; padding: 10px 0;
  border-bottom: 1px solid var(--rand); }
.pruefzeile:last-child { border-bottom: 0; }
.rechenweg td:first-child { color: var(--text-leise); }
.rechenweg tr.ergebnis td { font-weight: 650; border-top: 2px solid var(--rand-stark); }

/* --------------------------------------------------------------- Fristen */
.fristtag {
  display: inline-block; min-width: 46px; text-align: center; font-family: var(--mono, ui-monospace);
  font-size: 12.5px; font-weight: 600; padding: 3px 7px; border-radius: 4px;
  background: #eef2f7; color: var(--text-leise); font-variant-numeric: tabular-nums;
}
.fristtag.ueberfaellig { background: var(--fehler-hell); color: var(--fehler); }
.fristtag.bald { background: var(--warn-hell); color: var(--warn); }
.fristtag.offen { background: var(--akzent-hell); color: var(--akzent); }
.fristtag.erledigt { background: var(--gut-hell); color: var(--gut); }
ul.fristliste { list-style: none; margin: 0; padding: 0; }
ul.fristliste li { display: flex; gap: 12px; align-items: center; padding: 9px 0;
  border-bottom: 1px solid var(--rand); }
ul.fristliste li:last-child { border-bottom: 0; }
.zaehler { display: inline-block; min-width: 19px; padding: 0 6px; border-radius: 999px;
  background: var(--fehler); color: #fff; font-size: 11.5px; font-weight: 700;
  text-align: center; line-height: 18px; margin-left: 4px; }

/* ------------------------------------------------------------ Briefkopf */
.logovorschau {
  border: 1px dashed var(--rand-stark); border-radius: 8px; background: #fff;
  padding: 14px; min-height: 96px; display: flex; align-items: center;
  justify-content: center; max-width: 340px;
}
.logovorschau img { max-width: 280px; max-height: 90px; object-fit: contain; }

/* -------------------------------------------------------------- Datenblatt */
.datenblatt { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 2px; background: var(--rand); border: 1px solid var(--rand); border-radius: 8px;
  overflow: hidden; margin: 0; }
.datenblatt > div { background: var(--karte); padding: 10px 13px; }
.datenblatt dt { font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em;
  color: var(--text-leise); margin: 0 0 2px; }
.datenblatt dd { margin: 0; font-size: 14.5px; font-weight: 500; }
.datenblatt dd .leise { font-weight: 400; }
.datenblatt dd.fehlt { color: var(--text-leise); font-weight: 400; }
.blockrand { margin: 18px 0 8px; font-size: 12px; text-transform: uppercase;
  letter-spacing: .06em; color: var(--text-leise); font-weight: 600; }
button[disabled] { opacity: .45; cursor: not-allowed; }
