/* B&S Kontor – Oberfläche. Farben wie die B&S-Trennblätter. */
@font-face {
  font-family: "Inter";
  src: url("/static/vendor/fonts/InterVariable.woff2") format("woff2-variations"), url("/static/vendor/fonts/InterVariable.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --bg: #f2f3f5;
  --flaeche: #ffffff;
  --flaeche-2: #f8f9fa;
  --linie: #e4e7eb;
  --linie-2: #d3d8de;
  --text: #1f2328;
  --text-2: #4a5059;
  --leise: #7a818b;
  --dunkel: #24272c;
  --dunkel-2: #2f3339;
  --dunkel-3: #3b4047;
  --rot: #c8202a;
  --rot-2: #a91b23;
  --rot-hell: #fcecec;
  --blau: #20609f;
  --blau-hell: #e9f0f8;
  --gruen: #1f8a4e;
  --gruen-hell: #e7f4ec;
  --orange: #e07811;
  --orange-hell: #fdf1e5;
  --gelb: #9a6200;
  --gelb-hell: #fff4dc;
  --radius: 10px;
  --radius-s: 7px;
  --schatten: 0 1px 2px rgba(16, 24, 40, .05), 0 1px 3px rgba(16, 24, 40, .07);
  --schatten-2: 0 10px 30px rgba(16, 24, 40, .14), 0 2px 6px rgba(16, 24, 40, .08);
  --seitenleiste: 236px;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  font-size: 14px; line-height: 1.45; color: var(--text); background: var(--bg);
  -webkit-font-smoothing: antialiased; font-feature-settings: "cv11", "ss01";
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--blau); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; letter-spacing: -0.01em; }
.zahl { font-variant-numeric: tabular-nums; }
.leise { color: var(--leise); }
.klein { font-size: 12.5px; }
.fett { font-weight: 600; }
.rechts { text-align: right; }
.zeile { display: flex; align-items: center; gap: 10px; }
.zeile.oben { align-items: flex-start; }
.zeile.umbruch { flex-wrap: wrap; }
.spalte { display: flex; flex-direction: column; gap: 10px; }
.wachsen { flex: 1 1 auto; min-width: 0; }
.abstand { height: 14px; }
.versteckt { display: none !important; }
.raster-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.raster-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.raster-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
@media (max-width: 1100px) { .raster-4 { grid-template-columns: repeat(2, 1fr); } .raster-3 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 760px) { .raster-2, .raster-3, .raster-4 { grid-template-columns: 1fr; } }
@media (max-width: 1280px) { .inhalt > .raster-2, .inhalt .raster-2:has(> .karte), .inhalt .raster-2:has(> .spalte) { grid-template-columns: 1fr !important; } }
.karte:has(> .tabelle), .karte:has(> table) { overflow-x: auto; }

/* ------------------------------------------------------------ Grundgerüst */
.app { display: flex; min-height: 100vh; }
.seitenleiste {
  width: var(--seitenleiste); flex: 0 0 var(--seitenleiste); background: var(--dunkel); color: #d7dade;
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; z-index: 5;
}
.marke { display: flex; align-items: center; gap: 12px; padding: 20px 18px 18px; border-bottom: 1px solid rgba(255,255,255,.06); }
.marke img { height: 34px; width: auto; }
.marke .name { font-weight: 800; font-size: 16px; color: #fff; letter-spacing: -0.01em; line-height: 1.1; }
.marke .name span { color: var(--rot); }
.marke .firma { font-size: 11.5px; color: #9aa0a8; margin-top: 2px; max-width: 150px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav { padding: 12px 10px; display: flex; flex-direction: column; gap: 2px; flex: 1 1 auto; overflow-y: auto; }
.nav .gruppe { font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: #7f868f; padding: 14px 10px 6px; font-weight: 600; }
.nav a {
  display: flex; align-items: center; gap: 11px; padding: 9px 10px; border-radius: 8px; color: #cfd3d8; font-weight: 500;
  text-decoration: none; position: relative;
}
.nav a:hover { background: var(--dunkel-2); color: #fff; }
.nav a.aktiv { background: var(--dunkel-3); color: #fff; }
.nav a.aktiv::before { content: ""; position: absolute; left: -10px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--rot); }
.nav a svg { width: 18px; height: 18px; flex: 0 0 18px; opacity: .9; }
.nav .zaehler { margin-left: auto; background: var(--rot); color: #fff; font-size: 11px; font-weight: 700; border-radius: 10px; padding: 1px 7px; }
.benutzerbox { border-top: 1px solid rgba(255,255,255,.07); padding: 12px 14px; display: flex; align-items: center; gap: 10px; }
.benutzerbox .avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--rot); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 13px; }
.benutzerbox .wer { font-size: 13px; color: #fff; font-weight: 600; line-height: 1.2; }
.benutzerbox .rolle { font-size: 11.5px; color: #9aa0a8; }
.benutzerbox button { margin-left: auto; background: none; border: 0; color: #9aa0a8; cursor: pointer; padding: 6px; border-radius: 6px; }
.benutzerbox button:hover { color: #fff; background: var(--dunkel-2); }

.hauptbereich { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.kopfleiste {
  position: sticky; top: 0; z-index: 4; background: rgba(242, 243, 245, .9); backdrop-filter: saturate(1.4) blur(8px);
  border-bottom: 1px solid var(--linie); padding: 14px 28px; display: flex; align-items: center; gap: 10px 14px; min-height: 64px; flex-wrap: wrap;
}
.kopfleiste h1 { font-size: 20px; font-weight: 750; }
.kopfleiste .unter { color: var(--leise); font-size: 13px; }
.kopfleiste .aktionen { margin-left: auto; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.kopfleiste > div:not(.aktionen) { min-width: 0; flex: 1 1 320px; }
.hauptbereich { overflow-x: hidden; }
.inhalt { padding: 22px 28px 60px; max-width: 1480px; width: 100%; }
.zurueck { display: inline-flex; align-items: center; gap: 6px; color: var(--leise); font-size: 13px; cursor: pointer; background: none; border: 0; padding: 4px 0; }
.zurueck:hover { color: var(--text); }

/* ------------------------------------------------------------ Bausteine */
.karte { background: var(--flaeche); border: 1px solid var(--linie); border-radius: var(--radius); box-shadow: var(--schatten); }
.karte > .kopf { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--linie); }
.karte > .kopf h2, .karte > .kopf h3 { font-size: 15px; font-weight: 700; }
.karte > .kopf .rechts { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.karte > .koerper { padding: 16px 18px; }
.karte.flach { box-shadow: none; }

.knopf {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 36px; padding: 0 14px; border-radius: 8px;
  border: 1px solid var(--linie-2); background: var(--flaeche); color: var(--text); font-weight: 600; font-size: 13.5px; cursor: pointer;
  white-space: nowrap; text-decoration: none; transition: background .12s, border-color .12s, box-shadow .12s;
}
.knopf:hover { background: var(--flaeche-2); border-color: #c3c9d0; text-decoration: none; }
.knopf:focus-visible { outline: 2px solid var(--blau); outline-offset: 2px; }
.knopf svg { width: 16px; height: 16px; }
.knopf.haupt { background: var(--rot); border-color: var(--rot); color: #fff; box-shadow: 0 1px 2px rgba(168, 27, 35, .25); }
.knopf.haupt:hover { background: var(--rot-2); border-color: var(--rot-2); }
.knopf.dunkel { background: var(--dunkel); border-color: var(--dunkel); color: #fff; }
.knopf.dunkel:hover { background: var(--dunkel-3); }
.knopf.geist { border-color: transparent; background: transparent; }
.knopf.geist:hover { background: rgba(0,0,0,.05); }
.knopf.gefahr { color: var(--rot); }
.knopf.gefahr:hover { background: var(--rot-hell); border-color: #f0c2c4; }
.knopf.klein { height: 30px; padding: 0 10px; font-size: 12.5px; border-radius: 7px; }
.knopf.winzig { height: 26px; padding: 0 8px; font-size: 12px; border-radius: 6px; }
.knopf.gross { height: 42px; padding: 0 20px; font-size: 14.5px; }
.knopf[disabled] { opacity: .5; cursor: not-allowed; }

.feld { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.feld > span.label { font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.feld .hilfe { font-size: 12px; color: var(--leise); }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=search], select, textarea {
  width: 100%; height: 36px; border: 1px solid var(--linie-2); border-radius: 8px; padding: 0 11px; background: #fff; outline: none;
  transition: border-color .12s, box-shadow .12s;
}
textarea { height: auto; padding: 9px 11px; resize: vertical; line-height: 1.4; }
input:focus, select:focus, textarea:focus { border-color: #8fb0d3; box-shadow: 0 0 0 3px rgba(32, 96, 159, .14); }
input[readonly] { background: var(--flaeche-2); color: var(--text-2); }
input.markiert, select.markiert, textarea.markiert { border-color: #e2a33a; box-shadow: 0 0 0 3px rgba(226, 163, 58, .18); }
input.ok-feld { border-color: #7cc29b; }
.haken { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; user-select: none; }
.haken input { width: 16px; height: 16px; accent-color: var(--rot); margin: 0; }
.schalter { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; }
.schalter input { display: none; }
.schalter .bahn { width: 36px; height: 20px; border-radius: 20px; background: #cdd2d8; position: relative; transition: background .15s; flex: 0 0 36px; }
.schalter .bahn::after { content: ""; position: absolute; left: 2px; top: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.schalter input:checked + .bahn { background: var(--gruen); }
.schalter input:checked + .bahn::after { transform: translateX(16px); }

.marker {
  display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: 11px; font-size: 11.5px; font-weight: 600;
  background: #eef0f3; color: var(--text-2); white-space: nowrap;
}
.marker.gruen { background: var(--gruen-hell); color: #17683b; }
.marker.rot { background: var(--rot-hell); color: #a31b22; }
.marker.blau { background: var(--blau-hell); color: #1a4f84; }
.marker.orange { background: var(--orange-hell); color: #a85808; }
.marker.gelb { background: var(--gelb-hell); color: var(--gelb); }
.marker.dunkel { background: var(--dunkel); color: #fff; }
.punkt { width: 9px; height: 9px; border-radius: 50%; display: inline-block; flex: 0 0 9px; }

.tabelle { width: 100%; border-collapse: separate; border-spacing: 0; }
.tabelle th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--leise); font-weight: 600;
  padding: 10px 14px; border-bottom: 1px solid var(--linie); background: var(--flaeche-2); position: sticky; top: 0; }
.tabelle td { padding: 11px 14px; border-bottom: 1px solid var(--linie); vertical-align: middle; }
.tabelle tr.klickbar { cursor: pointer; }
.tabelle tr.klickbar:hover td { background: #fafbfc; }
.tabelle tr:last-child td { border-bottom: 0; }
.tabelle .betrag { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; font-weight: 600; }
.tabelle td.leise { color: var(--leise); }

.leer { padding: 36px 20px; text-align: center; color: var(--leise); }
.leer svg { width: 40px; height: 40px; opacity: .45; margin-bottom: 8px; }
.leer b { display: block; color: var(--text-2); margin-bottom: 4px; font-size: 14.5px; }

.hinweis { display: flex; gap: 12px; padding: 12px 14px; border-radius: var(--radius-s); background: var(--blau-hell); color: #1a4170; border: 1px solid #cfe0f1; align-items: flex-start; }
.hinweis.gelb { background: var(--gelb-hell); color: #6d4600; border-color: #f2dfae; }
.hinweis.rot { background: var(--rot-hell); color: #8e171d; border-color: #f3c7c9; }
.hinweis.gruen { background: var(--gruen-hell); color: #155c34; border-color: #c4e4d1; }
.hinweis .symbol { font-weight: 800; flex: 0 0 auto; }
.hinweis .wachsen > b { display: block; margin-bottom: 2px; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--linie); margin-bottom: 18px; flex-wrap: wrap; }
.tabs button { background: none; border: 0; padding: 10px 14px; font-weight: 600; color: var(--leise); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs button:hover { color: var(--text); }
.tabs button.aktiv { color: var(--text); border-bottom-color: var(--rot); }

.lader { width: 22px; height: 22px; border: 3px solid #dfe3e8; border-top-color: var(--rot); border-radius: 50%; animation: drehen .8s linear infinite; display: inline-block; }
.lader.klein { width: 14px; height: 14px; border-width: 2px; }
@keyframes drehen { to { transform: rotate(360deg); } }
.ladefeld { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 48px; color: var(--leise); }

.meldungen { position: fixed; right: 20px; bottom: 20px; display: flex; flex-direction: column; gap: 8px; z-index: 100; max-width: 420px; }
.meldung { background: var(--dunkel); color: #fff; padding: 12px 16px; border-radius: 9px; box-shadow: var(--schatten-2); animation: einblenden .18s ease-out; font-weight: 500; }
.meldung.fehler { background: #8e171d; }
.meldung.ok { background: #17683b; }
@keyframes einblenden { from { transform: translateY(8px); opacity: 0; } }

.dialog-hg { position: fixed; inset: 0; background: rgba(20, 22, 26, .45); z-index: 50; display: grid; place-items: center; padding: 20px; animation: hg .15s; }
@keyframes hg { from { opacity: 0; } }
.dialog { background: #fff; border-radius: 14px; box-shadow: var(--schatten-2); width: min(560px, 100%); max-height: calc(100vh - 40px); display: flex; flex-direction: column; }
.dialog.breit { width: min(900px, 100%); }
.dialog .kopf { padding: 18px 22px 10px; display: flex; align-items: center; gap: 10px; }
.dialog .kopf h2 { font-size: 17px; }
.dialog .kopf button.x { margin-left: auto; background: none; border: 0; font-size: 20px; color: var(--leise); cursor: pointer; }
.dialog .koerper { padding: 8px 22px 18px; overflow-y: auto; }
.dialog .fuss { padding: 14px 22px; border-top: 1px solid var(--linie); display: flex; gap: 8px; justify-content: flex-end; background: var(--flaeche-2); border-radius: 0 0 14px 14px; }

.ablage {
  border: 2px dashed #c9cfd6; border-radius: 12px; background: #fbfbfc; padding: 26px; text-align: center; cursor: pointer;
  transition: border-color .15s, background .15s; color: var(--text-2);
}
.ablage:hover, .ablage.aktiv { border-color: var(--rot); background: #fff8f8; }
.ablage svg { width: 38px; height: 38px; color: var(--rot); margin-bottom: 6px; }
.ablage b { display: block; font-size: 15px; color: var(--text); }
body.ziehen .ablage { border-color: var(--rot); background: #fff3f3; }

/* ------------------------------------------------------------ Anmeldung */
.anmelden-seite { min-height: 100vh; display: grid; grid-template-columns: 1fr 1.05fr; }
.anmelden-bild { background: var(--dunkel); color: #fff; padding: 56px; display: flex; flex-direction: column; position: relative; overflow: hidden; }
.anmelden-bild::after { content: ""; position: absolute; right: 0; top: 0; bottom: 0; width: 14px; background: var(--rot); }
.anmelden-bild img { width: 150px; }
.anmelden-bild h1 { font-size: 46px; font-weight: 800; margin-top: auto; letter-spacing: -0.02em; line-height: 1.05; }
.anmelden-bild h1 span { color: var(--rot); }
.anmelden-bild p { color: #aeb4bb; max-width: 440px; font-size: 15px; }
.anmelden-bild .farben { display: flex; gap: 8px; margin-top: 26px; }
.anmelden-bild .farben i { width: 26px; height: 8px; border-radius: 4px; display: block; }
.anmelden-form { display: grid; place-items: center; padding: 40px; background: #fff; }
.anmelden-form form { width: min(380px, 100%); display: flex; flex-direction: column; gap: 14px; }
.anmelden-form h2 { font-size: 26px; font-weight: 800; }
@media (max-width: 860px) { .anmelden-seite { grid-template-columns: 1fr; } .anmelden-bild { display: none; } }

/* ------------------------------------------------------------ Kennzahlen & Diagramm */
.kennzahl { padding: 16px 18px; }
.kennzahl .label { font-size: 12.5px; color: var(--leise); font-weight: 600; display: flex; align-items: center; gap: 7px; }
.kennzahl .wert { font-size: 25px; font-weight: 750; margin-top: 6px; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.kennzahl .unter { font-size: 12.5px; color: var(--leise); margin-top: 2px; }
.balken { display: grid; grid-template-columns: repeat(12, 1fr); gap: 10px; align-items: end; height: 190px; padding: 6px 4px 0; }
.balken .monat { display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.balken .paar { display: flex; gap: 3px; align-items: flex-end; height: 160px; width: 100%; justify-content: center; }
.balken .b { width: 42%; max-width: 16px; border-radius: 4px 4px 0 0; min-height: 2px; }
.balken .b.e { background: var(--gruen); }
.balken .b.a { background: var(--rot); opacity: .85; }
.balken .m { font-size: 11px; color: var(--leise); }
.legende { display: flex; gap: 16px; font-size: 12.5px; color: var(--text-2); }
.legende span { display: inline-flex; align-items: center; gap: 6px; }

/* ------------------------------------------------------------ Belegordner */
.jahre { display: flex; gap: 6px; }
.quartale { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 18px; }
.quartal-knopf {
  background: var(--flaeche); border: 1px solid var(--linie); border-radius: 12px; padding: 12px 14px; cursor: pointer; text-align: left;
  display: flex; align-items: center; gap: 12px; box-shadow: var(--schatten);
}
.quartal-knopf .q { font-size: 24px; font-weight: 850; letter-spacing: -0.03em; }
.quartal-knopf .q span { color: var(--rot); }
.quartal-knopf .t { font-size: 12px; color: var(--leise); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1 1 auto; }
.quartal-knopf { min-width: 0; }
@media (max-width: 1250px) { .quartale { grid-template-columns: repeat(2, 1fr); } }
.quartal-knopf.aktiv { background: var(--dunkel); border-color: var(--dunkel); color: #fff; }
.quartal-knopf.aktiv .t { color: #aab0b8; }
.quartal-knopf .fortschritt { margin-left: auto; text-align: right; font-size: 11.5px; }
.monate { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
@media (max-width: 1180px) { .monate { grid-template-columns: 1fr; } }
.monat-karte { background: var(--flaeche); border: 1px solid var(--linie); border-radius: 12px; box-shadow: var(--schatten); overflow: hidden; display: flex; flex-direction: column; }
.monat-karte .monat-kopf { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--linie); }
.monat-karte .nr { width: 40px; height: 40px; border-radius: 9px; background: var(--blau); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 16px; }
.monat-karte .titel { font-weight: 750; font-size: 16.5px; }
.abschnitt { display: flex; align-items: center; gap: 12px; padding: 11px 16px; border-bottom: 1px solid var(--linie); cursor: pointer; position: relative; }
.abschnitt:last-child { border-bottom: 0; }
.abschnitt:hover { background: #fafbfc; }
.abschnitt .farbe { width: 4px; align-self: stretch; border-radius: 3px; }
.abschnitt .ziffer { width: 22px; height: 22px; border-radius: 6px; color: #fff; display: grid; place-items: center; font-size: 11.5px; font-weight: 800; flex: 0 0 22px; }
.abschnitt .name { font-weight: 600; }
.abschnitt .info { font-size: 12px; color: var(--leise); }
.abschnitt .summe { margin-left: auto; text-align: right; font-weight: 650; font-variant-numeric: tabular-nums; }
.status-haken { display: flex; gap: 4px; }
.status-haken span { width: 20px; height: 20px; border-radius: 5px; border: 1.5px solid #c7ccd3; display: grid; place-items: center; font-size: 12px; color: transparent; }
.status-haken span.an { color: #fff; }
.blau-bg { background: var(--blau) !important; border-color: var(--blau) !important; }
.rot-bg { background: var(--rot) !important; border-color: var(--rot) !important; }
.gruen-bg { background: var(--gruen) !important; border-color: var(--gruen) !important; }
.orange-bg { background: var(--orange) !important; border-color: var(--orange) !important; }
.dunkel-bg { background: var(--dunkel) !important; border-color: var(--dunkel) !important; }
.bar-karte { margin-top: 14px; display: flex; align-items: center; gap: 16px; padding: 14px 18px; border-radius: 12px; background: var(--flaeche); border: 1px solid var(--linie); border-left: 5px solid var(--orange); box-shadow: var(--schatten); cursor: pointer; }
.bar-karte:hover { background: #fffdfb; }
.uebergabe { margin-top: 14px; display: flex; gap: 16px; align-items: center; padding: 14px 18px; border-radius: 12px; background: var(--dunkel); color: #fff; flex-wrap: wrap; }
.uebergabe .leise { color: #a9afb7; }
.uebergabe input { background: var(--dunkel-2); border-color: var(--dunkel-3); color: #fff; width: auto; }

.abschnitt-kopf { display: flex; align-items: center; gap: 14px; padding: 18px 20px; border-radius: 12px; color: #fff; margin-bottom: 16px; position: relative; overflow: hidden; }
.abschnitt-kopf .gross { font-size: 30px; font-weight: 850; letter-spacing: -0.02em; line-height: 1; }
.abschnitt-kopf .klein { opacity: .85; }
.abschnitt-kopf .aktionen { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.abschnitt-kopf .knopf { background: rgba(255,255,255,.14); border-color: rgba(255,255,255,.25); color: #fff; }
.abschnitt-kopf .knopf:hover { background: rgba(255,255,255,.24); }
.zweigeteilt { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(360px, .85fr); gap: 16px; align-items: start; }
@media (max-width: 1200px) { .zweigeteilt { grid-template-columns: 1fr; } }
.vorschau { position: sticky; top: 80px; }
.vorschau iframe, .vorschau img { width: 100%; height: calc(100vh - 230px); min-height: 480px; border: 0; border-radius: 8px; background: #e9ebee; object-fit: contain; }

/* ------------------------------------------------------------ Rechnung / Vertrag */
.positionen-kopf, .position { display: grid; grid-template-columns: 74px minmax(0, 1fr) 92px 100px 112px 96px; gap: 6px; align-items: start; }
.positionen-kopf { font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--leise); font-weight: 600; padding: 0 0 6px; }
.position { padding: 6px 0; border-top: 1px solid var(--linie); }
.position.ueb textarea { font-weight: 700; }
.position .typ { display: block; font-size: 10.5px; color: var(--leise); margin-top: 3px; cursor: pointer; text-align: center; }
.position .typ:hover { color: var(--blau); }
.position .knoepfe { display: flex; gap: 2px; justify-content: flex-end; }
.position .knoepfe button { width: 26px; height: 30px; border: 0; background: none; cursor: pointer; color: var(--leise); border-radius: 6px; }
.position .knoepfe button:hover { background: #eef0f3; color: var(--text); }
.position input, .position textarea { height: 32px; font-size: 13px; padding: 0 8px; }
.position textarea { min-height: 32px; padding: 6px 8px; resize: none; overflow: hidden; }
.position input.gp { text-align: right; }
.summen { display: grid; grid-template-columns: 1fr auto; gap: 4px 24px; justify-content: end; margin-left: auto; width: min(360px, 100%); font-variant-numeric: tabular-nums; }
.summen .b { font-weight: 750; font-size: 15px; border-top: 1px solid var(--linie-2); padding-top: 6px; }
.pruefpunkte { display: flex; flex-direction: column; gap: 6px; }
.pruefpunkt { display: flex; gap: 10px; align-items: flex-start; padding: 8px 11px; border-radius: 8px; font-size: 13px; background: var(--flaeche-2); border: 1px solid var(--linie); }
.pruefpunkt .ic { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; font-weight: 800; flex: 0 0 20px; color: #fff; background: var(--leise); }
.pruefpunkt.ok .ic { background: var(--gruen); }
.pruefpunkt.warnung .ic { background: #d9901a; }
.pruefpunkt.warnung { background: var(--gelb-hell); border-color: #f2dfae; }
.pruefpunkt.unsicher .ic { background: #d9901a; }
.pruefpunkt.unsicher { background: #fffaf0; border-color: #f4e6c4; }
.pruefpunkt.info .ic { background: var(--blau); }
.pruefpunkt.vorschlag .ic { background: #6b4fbb; }
.pruefpunkt.fehler .ic { background: var(--rot); }
.pruefpunkt.fehler { background: var(--rot-hell); border-color: #f3c7c9; }
.chip { display: inline-block; padding: 2px 8px; border-radius: 12px; background: #fff; border: 1px solid var(--linie-2); margin: 3px 4px 0 0; cursor: pointer; font-size: 12.5px; }
.chip:hover { border-color: var(--blau); color: var(--blau); }
.betrachter { background: #fff; border: 1px solid var(--linie); border-radius: 12px; box-shadow: var(--schatten); position: sticky; top: 80px; }
.betrachter .seiten { max-height: calc(100vh - 200px); overflow-y: auto; padding: 14px; background: #e9ebee; border-radius: 0 0 12px 12px; }
.betrachter .seiten img { width: 100%; display: block; margin: 0 auto 12px; box-shadow: 0 1px 4px rgba(0,0,0,.15); background: #fff; }
.betrachter .seitennr { font-size: 11.5px; color: var(--leise); margin: 4px 0; }
.stempel-buehne { position: relative; user-select: none; touch-action: none; }
.stempel-buehne > img.seite { width: 100%; display: block; }
.stempel-buehne .datum { position: absolute; white-space: nowrap; cursor: move; color: #000; outline: 1px dashed rgba(32, 96, 159, .7); background: rgba(32, 96, 159, .06); padding: 0 2px; }
.stempel-buehne .stempel { position: absolute; cursor: move; outline: 1px dashed rgba(200, 32, 42, .6); transform-origin: center center; }
.stempel-steuerung { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; padding: 10px 14px; border-bottom: 1px solid var(--linie); }

.erechnung { font-size: 13.5px; }
.erechnung .er-kopf { display: flex; gap: 20px; justify-content: space-between; border-bottom: 2px solid var(--dunkel); padding-bottom: 10px; margin-bottom: 12px; }
.erechnung .er-typ { font-size: 20px; font-weight: 800; }
.erechnung .er-meta { text-align: right; font-size: 13px; }
.erechnung .er-parteien { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 14px; }
.erechnung .klein { font-size: 11.5px; color: var(--leise); }
.erechnung .er-tab { width: 100%; border-collapse: collapse; }
.erechnung .er-tab th, .erechnung .er-tab td { padding: 6px 8px; border-bottom: 1px solid var(--linie); text-align: left; vertical-align: top; }
.erechnung .r { text-align: right; }
.erechnung .er-summe { margin: 12px 0 0 auto; border-collapse: collapse; min-width: 300px; }
.erechnung .er-summe td { padding: 4px 8px; }
.erechnung .er-summe .fett td { font-weight: 700; border-top: 1px solid var(--linie-2); }
.erechnung .er-zahlung { margin-top: 10px; font-size: 12.5px; color: var(--text-2); }

.verlauf { display: flex; flex-direction: column; gap: 0; }
.verlauf .eintrag { display: flex; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--linie); align-items: center; }
.verlauf .eintrag:last-child { border-bottom: 0; }
.qr svg { width: 180px; height: 180px; }
code.mono, .mono { font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-size: 12.5px; }
.einmalpasswort { font-family: ui-monospace, Consolas, monospace; font-size: 20px; font-weight: 700; padding: 12px 16px; background: var(--gelb-hell); border: 1px dashed #d9a520; border-radius: 8px; letter-spacing: .04em; user-select: all; text-align: center; }
.trenner { height: 1px; background: var(--linie); margin: 14px 0; }
.liste-einfach { margin: 0; padding-left: 18px; }
.liste-einfach li { margin: 4px 0; }
.faq details { border: 1px solid var(--linie); border-radius: 10px; padding: 0 16px; background: #fff; margin-bottom: 8px; }
.faq summary { padding: 14px 0; font-weight: 650; cursor: pointer; }
.faq details[open] summary { border-bottom: 1px solid var(--linie); margin-bottom: 10px; }
.faq details p, .faq details ul { color: var(--text-2); }
@media print {
  .seitenleiste, .kopfleiste .aktionen, .meldungen { display: none !important; }
  .inhalt { padding: 0; }
}

/* ---- Version 1.1: Signatur-Editor, Sammelaktionen, Zahlungen, Notizen, Vorschau, Hinweisleisten ---- */
.signatur-editor { border: 1px solid var(--linie-2); border-radius: 8px; padding: 14px 16px; min-height: 180px; background: #fff;
  font-family: Calibri, Arial, sans-serif; font-size: 11pt; color: #1f2328; margin: 8px 0; overflow: auto; line-height: 1.35; }
.signatur-editor:focus { outline: none; border-color: #8fb0d3; box-shadow: 0 0 0 3px rgba(32, 96, 159, .14); }
.signatur-editor img { max-width: 260px; height: auto; }
.signatur-vorschau { border: 1px dashed var(--linie-2); border-radius: 8px; padding: 10px 12px; background: #fff; font-family: Calibri, Arial, sans-serif; font-size: 10.5pt; }
.signatur-vorschau img { max-width: 200px; height: auto; }
.signatur-leiste { gap: 6px; }
.signatur-leiste button { height: 30px; min-width: 32px; padding: 0 9px; border: 1px solid var(--linie-2); border-radius: 6px; background: #fff; cursor: pointer; font: inherit; font-size: 13px; }
.signatur-leiste button:hover { background: var(--flaeche-2); }
.signatur-leiste input[type=color] { width: 36px; height: 30px; padding: 2px; border: 1px solid var(--linie-2); border-radius: 6px; background: #fff; cursor: pointer; }
.auswahl-leiste { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 14px; margin-bottom: 12px;
  background: #24272c; color: #fff; border-radius: 10px; box-shadow: var(--schatten-2); }
.auswahl-leiste .knopf { height: 32px; }
.auswahl-leiste .leise { color: #c9ced4; }
td.wahl, th.wahl { width: 34px; padding-right: 0 !important; }
td.wahl input, th.wahl input { width: 17px; height: 17px; accent-color: var(--rot); cursor: pointer; }
.zahlungen .eintrag .betrag-klein { font-variant-numeric: tabular-nums; font-weight: 600; }
.notiz { padding: 9px 11px; border-radius: 8px; background: #fffbea; border: 1px solid #f1e3a7; }
.notiz .kopfzeile { display: flex; gap: 8px; font-size: 12px; color: var(--text-2); margin-bottom: 3px; }
.notiz .kopfzeile .wachsen { flex: 1; }
.notiz button { border: 0; background: none; color: var(--text-2); cursor: pointer; font-size: 12px; padding: 0 2px; }
.notiz button:hover { color: var(--rot); }
.vorschau-pdf { width: 100%; height: calc(100vh - 230px); min-height: 520px; border: 1px solid var(--linie); border-radius: 8px; background: #fff; display: block; }
.update-leiste { display: flex; align-items: center; gap: 12px; padding: 9px 16px; background: #fff4e5; border-bottom: 1px solid #f3d3a5; font-size: 13.5px; }
.update-leiste .wachsen { flex: 1; }
.neuigkeiten li { margin: 4px 0; }button.chip { font: inherit; font-size: 12.5px; color: var(--text); }
button.mini { border: 0; background: none; color: var(--text-2); cursor: pointer; font-size: 14px; padding: 0 4px; }
button.mini:hover { color: var(--rot); }/* Rechnungs-Editor: Vorschau neben der Eingabe nur auf breiten Bildschirmen, sonst darunter */
.editor-vorschau { display: grid; grid-template-columns: minmax(640px, 1.2fr) minmax(420px, 1fr); gap: 16px; align-items: start; }
.editor-vorschau > .vorschau-spalte { position: sticky; top: 12px; }
@media (max-width: 1599px) { .editor-vorschau { grid-template-columns: minmax(0, 1fr); } .editor-vorschau > .vorschau-spalte { position: static; } }