
/* Mietblick Portal – Arbeitsfläche mit Seitenleiste; das Klingeltableau ist das prägende Element, Briefe erscheinen als echtes Papier */
:root {
  --bg: #EEF3F3; --surface: #FFFFFF; --surface-2: #F4F7F7; --ink: #102A2F; --muted: #56696D; --line: #D6E0E0; --line-strong: #B9C8C9;
  --accent: #0B5F68; --accent-hover: #084C53; --accent-ink: #FFFFFF; --accent-soft: #DCEDEE;
  --signal: #E9B500; --signal-soft: #FFF4CC;
  --ok: #1D7348; --ok-bg: #DDF1E5; --warn: #8F5600; --warn-bg: #FDEFD5; --bad: #B0281F; --bad-bg: #FBE1DE;
  --plate: #C5CED0; --plate-2: #E6ECEC; --plate-edge: #97A4A6; --plate-label: #FBFBF6; --plate-ink: #1E2B2E; --bell: #7E8C8F;
  --sheet: #FFFFFF; --sheet-ink: #1C1F20; --sheet-muted: #5E6B6E; --sheet-line: #DCE3E3; --sheet-head: #E8EEEE;
  --overlay: rgba(10, 28, 32, .45);
  --shadow: 0 1px 2px rgba(16, 42, 47, .06), 0 6px 18px rgba(16, 42, 47, .07);
  --f-display: "Barlow Semi Condensed", "Arial Narrow", "Helvetica Neue", system-ui, sans-serif;
  --f-body: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --f-mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --r: 10px;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --bg: #0C1719; --surface: #132226; --surface-2: #182B30; --ink: #E3ECED; --muted: #98ADB1; --line: #25393E; --line-strong: #37525A;
  --accent: #4DB6BF; --accent-hover: #6FC7CF; --accent-ink: #04282C; --accent-soft: #163A3F;
  --signal: #F2C94C; --signal-soft: #3A3217;
  --ok: #6CCB96; --ok-bg: #163829; --warn: #E8B04F; --warn-bg: #3A2C12; --bad: #F2887D; --bad-bg: #40201C;
  --plate: #3A4649; --plate-2: #59686C; --plate-edge: #222C2E; --plate-label: #E9EAE3; --plate-ink: #1E2B2E; --bell: #8C9A9D;
  --sheet: #FBFBF8; --sheet-ink: #1C1F20; --sheet-muted: #5E6B6E; --sheet-line: #DCE3E3; --sheet-head: #E8EEEE;
  --overlay: rgba(0, 0, 0, .6);
  --shadow: 0 1px 2px rgba(0, 0, 0, .35), 0 8px 24px rgba(0, 0, 0, .3);
  color-scheme: dark;
} }
:root[data-theme="dark"] {
  --bg: #0C1719; --surface: #132226; --surface-2: #182B30; --ink: #E3ECED; --muted: #98ADB1; --line: #25393E; --line-strong: #37525A;
  --accent: #4DB6BF; --accent-hover: #6FC7CF; --accent-ink: #04282C; --accent-soft: #163A3F;
  --signal: #F2C94C; --signal-soft: #3A3217;
  --ok: #6CCB96; --ok-bg: #163829; --warn: #E8B04F; --warn-bg: #3A2C12; --bad: #F2887D; --bad-bg: #40201C;
  --plate: #3A4649; --plate-2: #59686C; --plate-edge: #222C2E; --plate-label: #E9EAE3; --plate-ink: #1E2B2E; --bell: #8C9A9D;
  --sheet: #FBFBF8; --sheet-ink: #1C1F20; --sheet-muted: #5E6B6E; --sheet-line: #DCE3E3; --sheet-head: #E8EEEE;
  --overlay: rgba(0, 0, 0, .6);
  --shadow: 0 1px 2px rgba(0, 0, 0, .35), 0 8px 24px rgba(0, 0, 0, .3);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { background: var(--bg); color: var(--ink); font: 400 14px/1.5 var(--f-body); }
h1, h2, h3 { font-family: var(--f-display); font-weight: 700; line-height: 1.1; margin: 0; text-wrap: balance; letter-spacing: .005em; }
h1 { font-size: 34px; }
h2 { font-size: 22px; }
h3 { font-size: 17px; font-weight: 600; }
p { margin: 0; }
a { color: var(--accent); }
.num, td.num, .mono { font-family: var(--f-mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.eyebrow { font: 600 11px/1.2 var(--f-body); letter-spacing: .09em; text-transform: uppercase; color: var(--muted); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--signal); outline-offset: 2px; border-radius: 4px; }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* Gerüst */
.app { display: grid; grid-template-columns: 236px minmax(0, 1fr); gap: 24px; padding-block: 16px 48px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); max-width: 1440px; margin: 0 auto; }
.side { position: sticky; top: calc(16px + env(safe-area-inset-top, 0px)); align-self: start; display: flex; flex-direction: column; gap: 18px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 18px 12px 14px; }
.brand { display: flex; align-items: center; gap: 10px; padding: 0 6px; text-decoration: none; color: inherit; }
.brand svg { flex: none; }
.brand-name { font: 700 24px/1 var(--f-display); letter-spacing: .01em; }
.brand-sub { font: 600 9.5px/1.2 var(--f-body); letter-spacing: .16em; text-transform: uppercase; color: var(--muted); margin-top: 3px; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; color: var(--ink); text-decoration: none; font-weight: 500; white-space: nowrap; }
.nav a svg { flex: none; opacity: .75; }
.nav a:hover { background: var(--surface-2); }
.nav a[aria-current="page"] { background: var(--accent-soft); color: var(--accent); }
.nav a[aria-current="page"] svg { opacity: 1; }
.nav .count { margin-left: auto; font: 600 11px/1 var(--f-mono); background: var(--bad); color: var(--surface); border-radius: 999px; padding: 3px 6px; }
.side-foot { border-top: 1px solid var(--line); padding: 12px 6px 0; display: grid; gap: 4px; font-size: 12px; color: var(--muted); }
.store-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--muted); margin-right: 6px; vertical-align: 1px; }
.store-dot.konto { background: var(--ok); }
.store-dot.browser { background: var(--warn); }
.store-dot.sitzung { background: var(--bad); }
main { min-width: 0; display: flex; flex-direction: column; gap: 20px; }
.topbar { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 20px; padding-top: 6px; }
.topbar .ctx { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.ctx label { display: grid; gap: 2px; font-size: 11px; color: var(--muted); font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
@media (max-width: 880px) {
  .app { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .side { position: static; padding: 12px; gap: 10px; }
  .nav { flex-direction: row; overflow-x: auto; gap: 4px; padding-bottom: 4px; scrollbar-width: thin; }
  .nav a { padding: 7px 10px; }
  .side-foot { display: none; }
  h1 { font-size: 28px; }
}

/* Bausteine */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 20px; display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.panel-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; }
.panel-head .acts { display: flex; flex-wrap: wrap; gap: 8px; }
.grid-2 { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.stack { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
@media (max-width: 1100px) { .grid-2 { grid-template-columns: minmax(0, 1fr); } }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 36px; padding: 7px 14px; border-radius: 8px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); font-weight: 500; cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:hover { background: var(--surface-2); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-ghost { border-color: transparent; background: transparent; color: var(--accent); }
.btn-ghost:hover { background: var(--accent-soft); }
.btn-danger { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 40%, var(--line)); }
.btn-sm { min-height: 30px; padding: 4px 10px; font-size: 13px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.pill { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); }
.pill-ok { background: var(--ok-bg); color: var(--ok); border-color: transparent; }
.pill-warn { background: var(--warn-bg); color: var(--warn); border-color: transparent; }
.pill-bad { background: var(--bad-bg); color: var(--bad); border-color: transparent; }
.pill-accent { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.pill-signal { background: var(--signal-soft); color: var(--ink); border-color: transparent; }
.badge-bsp { font: 600 10px/1 var(--f-body); letter-spacing: .08em; text-transform: uppercase; background: var(--signal); color: #2A2100; padding: 4px 6px; border-radius: 4px; vertical-align: 3px; }
.field { display: grid; gap: 4px; min-width: 0; }
.field > span { font-size: 12px; font-weight: 600; color: var(--muted); }
.field small { color: var(--muted); font-size: 12px; }
input[type=text], input[type=number], input[type=date], input[type=month], input[type=email], input[type=tel], input:not([type]), select, textarea {
  width: 100%; min-height: 36px; padding: 6px 10px; border-radius: 8px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink);
}
select { padding-right: 28px; }
.ctx select { min-width: 160px; width: auto; }
textarea { min-height: 90px; resize: vertical; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.form-grid .wide { grid-column: 1 / -1; }
.check { display: flex; gap: 8px; align-items: flex-start; }
.check input { margin-top: 3px; accent-color: var(--accent); }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; }
table { border-collapse: collapse; width: 100%; font-size: 13.5px; }
th { text-align: left; font-size: 11.5px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); background: var(--surface-2); padding: 9px 12px; white-space: nowrap; border-bottom: 1px solid var(--line); }
td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; white-space: nowrap; }
tfoot td { font-weight: 600; background: var(--surface-2); border-top: 1px solid var(--line-strong); }
tr.click { cursor: pointer; }
tr.click:hover td { background: var(--surface-2); }
.sub { display: block; font-size: 12px; color: var(--muted); }
.empty { border: 1px dashed var(--line-strong); border-radius: 12px; padding: 28px 20px; text-align: center; color: var(--muted); display: grid; gap: 10px; justify-items: center; }
.note { font-size: 12.5px; color: var(--muted); }
.callout { border-radius: 10px; padding: 12px 14px; background: var(--surface-2); border: 1px solid var(--line); font-size: 13px; display: grid; gap: 4px; }
.callout-warn { background: var(--warn-bg); border-color: transparent; color: var(--ink); }
.callout-bad { background: var(--bad-bg); border-color: transparent; }
.callout-accent { background: var(--accent-soft); border-color: transparent; }

/* Übersicht */
.hello { display: grid; gap: 6px; }
.hello p { color: var(--muted); font-size: 15px; }
.kpis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.kpi { background: var(--surface); padding: 14px 16px; display: grid; gap: 2px; }
.kpi b { font: 600 22px/1.15 var(--f-mono); font-variant-numeric: tabular-nums; }
.kpi span { font-size: 12px; color: var(--muted); }
.todo-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.todo { display: grid; grid-template-columns: 6px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 12px 14px 12px 0; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); overflow: hidden; }
.todo::before { content: ""; align-self: stretch; background: var(--accent); margin: -12px 0; }
.todo.sev-warn::before { background: var(--warn); }
.todo.sev-bad::before { background: var(--bad); }
.todo strong { display: block; font-weight: 600; }
.todo span { font-size: 13px; color: var(--muted); }
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; counter-reset: s; }
.step { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; display: grid; gap: 4px; background: var(--surface); text-decoration: none; color: inherit; }
.step:hover { border-color: var(--line-strong); }
.step-n { font: 600 12px/1 var(--f-mono); color: var(--muted); display: flex; align-items: center; gap: 6px; }
.step.done .step-n { color: var(--ok); }
.step.now { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.step strong { font-weight: 600; }
.step span { font-size: 12.5px; color: var(--muted); }
@media (max-width: 720px) { .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.mbf { border-radius: 14px; padding: 18px 20px; background: var(--surface); border: 1px solid var(--line); display: grid; gap: 10px; }
.mbf h3 { font-size: 18px; }
.mbf p { font-size: 13.5px; color: var(--muted); }
.mbf .row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.mbf .tel { font: 500 14px var(--f-mono); user-select: all; }

/* Klingeltableau */
.haus { display: grid; grid-template-columns: minmax(0, 300px) minmax(0, 1fr); gap: 22px; align-items: start; }
@media (max-width: 760px) { .haus { grid-template-columns: minmax(0, 1fr); } }
.klingel { border-radius: 12px; padding: 14px 14px 10px; background: linear-gradient(160deg, var(--plate-2), var(--plate) 55%, var(--plate-2)); border: 1px solid var(--plate-edge); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35), 0 1px 3px rgba(0, 0, 0, .12); display: grid; gap: 7px; }
.klingel-top { display: flex; justify-content: space-between; align-items: baseline; font: 700 13px/1 var(--f-display); letter-spacing: .14em; text-transform: uppercase; color: var(--plate-ink); opacity: .8; padding: 0 2px 4px; }
.klingel-row { display: grid; grid-template-columns: 18px minmax(0, 1fr); gap: 10px; align-items: center; background: none; border: 0; padding: 0; text-align: left; cursor: pointer; color: inherit; }
.klingel-row .knopf { width: 16px; height: 16px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff, var(--bell) 70%); border: 1px solid var(--plate-edge); box-shadow: 0 1px 1px rgba(0, 0, 0, .25); }
.klingel-row .schild { background: var(--plate-label); color: var(--plate-ink); border: 1px solid var(--plate-edge); border-radius: 3px; padding: 5px 8px; display: flex; justify-content: space-between; gap: 8px; box-shadow: inset 0 1px 2px rgba(0, 0, 0, .12); min-width: 0; }
.schild b { font: 500 12.5px/1.2 var(--f-mono); text-transform: uppercase; letter-spacing: .04em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.schild i { font: 400 11px/1.2 var(--f-body); font-style: normal; opacity: .7; white-space: nowrap; }
.schild.frei b { opacity: .45; }
.klingel-row:hover .schild { border-color: var(--plate-ink); }
.klingel-row:hover .knopf { background: radial-gradient(circle at 35% 30%, #fff, var(--signal) 70%); }
.klingel-foot { display: flex; justify-content: center; gap: 4px; padding-top: 4px; }
.klingel-foot span { width: 22px; height: 3px; border-radius: 2px; background: var(--plate-edge); opacity: .55; }
.fakten { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px 18px; margin: 0; align-content: start; }
.fakten div { display: grid; gap: 2px; align-content: start; }
.fakten dt { font-size: 12px; color: var(--muted); }
.fakten dd { margin: 0; font-weight: 600; }

/* Belege */
.drop { border: 1.5px dashed var(--line-strong); border-radius: 14px; background: var(--surface); display: grid; place-items: center; text-align: center; padding: 26px 18px; gap: 6px; cursor: pointer; transition: border-color .15s, background .15s; }
.drop:hover, .drop.over { border-color: var(--accent); background: var(--accent-soft); }
.drop strong { font: 600 18px/1.2 var(--f-display); }
.drop input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.beleg { border: 1px solid var(--line); border-radius: 12px; background: var(--surface); padding: 14px 16px; display: grid; gap: 10px; }
.beleg-head { display: flex; justify-content: space-between; gap: 10px; align-items: center; flex-wrap: wrap; }
.beleg-name { display: flex; gap: 8px; align-items: center; font-weight: 600; min-width: 0; }
.beleg-name span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.beleg-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px 16px; }
.beleg-grid div { display: grid; gap: 1px; }
.beleg-grid dt { font-size: 11.5px; color: var(--muted); }
.beleg-grid dd { margin: 0; font-weight: 500; }
.spin { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--line-strong); border-top-color: var(--accent); animation: spin .8s linear infinite; display: inline-block; vertical-align: -2px; }
@keyframes spin { to { transform: rotate(360deg); } }
.ki-tag { font: 600 10px/1 var(--f-mono); letter-spacing: .05em; color: var(--accent); border: 1px solid var(--accent); border-radius: 4px; padding: 2px 4px; vertical-align: 1px; }

/* Abrechnung */
.band { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.band > div { background: var(--surface); padding: 12px 14px; display: grid; gap: 2px; }
.band b { font: 600 18px/1.2 var(--f-mono); font-variant-numeric: tabular-nums; }
.band span { font-size: 12px; color: var(--muted); }
.checks { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.checks li { display: grid; grid-template-columns: 20px minmax(0, 1fr); gap: 8px; font-size: 13.5px; }
.checks .ic { width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; font: 700 11px/1 var(--f-mono); }
.checks .ok .ic { background: var(--ok-bg); color: var(--ok); }
.checks .warn .ic { background: var(--warn-bg); color: var(--warn); }
.checks .bad .ic { background: var(--bad-bg); color: var(--bad); }
.erg-plus { color: var(--bad); font-weight: 600; }
.erg-minus { color: var(--ok); font-weight: 600; }
.row-acts { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }

/* Brief */
.sheet-wrap { overflow-x: auto; background: var(--surface-2); border-radius: 10px; padding: 16px; }
.sheet { background: var(--sheet); color: var(--sheet-ink); width: 100%; max-width: 760px; min-width: 560px; margin: 0 auto; padding: 44px 48px 36px 56px; box-shadow: 0 2px 10px rgba(0, 0, 0, .12); position: relative; font: 400 13px/1.5 var(--f-body); }
.sheet::before, .sheet::after { content: ""; position: absolute; left: 14px; width: 12px; border-top: 1px solid #A9B3B5; }
.sheet::before { top: 33%; }
.sheet::after { top: 50%; width: 16px; }
.sheet h4 { font: 700 19px/1.1 var(--f-display); margin: 0; color: var(--sheet-ink); }
.sheet .kopf { border-bottom: 2px solid #0B5F68; padding-bottom: 8px; margin-bottom: 22px; }
.sheet .kopf p, .sheet .muted { color: var(--sheet-muted); font-size: 11.5px; }
.sheet .adr { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 220px); gap: 20px; margin-bottom: 18px; }
.sheet .rs { font-size: 9.5px; color: var(--sheet-muted); border-bottom: 1px solid var(--sheet-line); padding-bottom: 2px; margin-bottom: 6px; }
.sheet .info { display: grid; grid-template-columns: auto 1fr; gap: 2px 12px; font-size: 11.5px; align-content: start; }
.sheet .info dt { color: var(--sheet-muted); }
.sheet .info dd { margin: 0; }
.sheet .datum { text-align: right; margin-bottom: 10px; }
.sheet .betreff { font-weight: 600; font-size: 14.5px; margin-bottom: 12px; }
.sheet p { margin: 0 0 10px; }
.sheet table { font-size: 11.5px; margin: 6px 0 12px; }
.sheet th { background: var(--sheet-head); color: #24393D; font-size: 10px; padding: 6px 8px; border-bottom: 0; }
.sheet td { padding: 6px 8px; border-bottom: 1px solid var(--sheet-line); }
.sheet .summen { margin-left: auto; width: min(340px, 100%); display: grid; gap: 4px; margin-bottom: 14px; }
.sheet .summen div { display: flex; justify-content: space-between; gap: 12px; }
.sheet .summen .end { border-top: 1.5px solid #0B5F68; padding-top: 6px; font-weight: 700; font-size: 15px; }
.sheet .klein { font-size: 11.5px; color: var(--sheet-muted); }
.sheet .fuss { margin-top: 26px; padding-top: 8px; border-top: 1px solid var(--sheet-line); font-size: 10px; color: var(--sheet-muted); display: flex; justify-content: space-between; }

/* Zahlungen */
.konto th, .konto td { text-align: center; padding: 8px 6px; }
.konto th:first-child, .konto td:first-child { text-align: left; padding-left: 12px; position: sticky; left: 0; background: var(--surface); z-index: 1; min-width: 150px; }
.konto th:first-child { background: var(--surface-2); }
.zelle { display: grid; gap: 1px; justify-items: center; min-width: 74px; padding: 6px 4px; border-radius: 8px; border: 1px solid transparent; background: none; cursor: pointer; width: 100%; }
.zelle b { font: 500 12px/1.2 var(--f-mono); }
.zelle i { font-style: normal; font-size: 10.5px; }
.z-bezahlt { background: var(--ok-bg); color: var(--ok); }
.z-teilweise { background: var(--warn-bg); color: var(--warn); }
.z-offen { background: var(--bad-bg); color: var(--bad); }
.z-bald { border-color: var(--line-strong); color: var(--muted); }
.z-frei { color: var(--muted); }
.zelle:hover { box-shadow: inset 0 0 0 1px currentColor; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }

/* Fristen */
.timeline { list-style: none; margin: 0; padding: 0; display: grid; }
.timeline li { display: grid; grid-template-columns: 92px 14px minmax(0, 1fr) auto; gap: 10px; align-items: start; padding: 10px 0; border-bottom: 1px solid var(--line); }
.timeline li:last-child { border-bottom: 0; }
.timeline .d { font: 500 13px/1.3 var(--f-mono); }
.timeline .d small { display: block; color: var(--muted); font-size: 11px; }
.timeline .dot { width: 10px; height: 10px; border-radius: 50%; margin-top: 4px; background: var(--accent); }
.timeline .bad .dot, .timeline li.bad .dot { background: var(--bad); }
.timeline li.warn .dot { background: var(--warn); }
.timeline li.past { opacity: .6; }
@media (max-width: 560px) { .timeline li { grid-template-columns: 78px 12px minmax(0, 1fr); } .timeline li > :last-child { grid-column: 3; } }
.rs-card { border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; display: grid; gap: 10px; background: var(--surface); }

/* Modal, Toast */
.modal-back { position: fixed; inset: 0; background: var(--overlay); z-index: 50; display: grid; place-items: center; padding: calc(16px + env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) calc(16px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px)); }
.modal { background: var(--surface); color: var(--ink); width: min(640px, 100%); max-height: 100%; overflow: auto; border-radius: 14px; box-shadow: var(--shadow); display: flex; flex-direction: column; }
.modal.wide { width: min(920px, 100%); }
.modal-h { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--surface); z-index: 2; }
.modal-b { padding: 18px 20px; display: grid; gap: 14px; }
.modal-f { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--line); position: sticky; bottom: 0; background: var(--surface); }
.modal-f .left { margin-right: auto; }
.x { width: 34px; height: 34px; border-radius: 8px; border: 0; background: none; cursor: pointer; display: grid; place-items: center; color: var(--muted); }
.x:hover { background: var(--surface-2); color: var(--ink); }
.toasts { position: fixed; z-index: 60; right: max(16px, env(safe-area-inset-right, 0px)); bottom: calc(16px + env(safe-area-inset-bottom, 0px)); display: grid; gap: 8px; width: min(380px, calc(100% - 32px)); }
.toast { background: var(--ink); color: var(--bg); padding: 11px 14px; border-radius: 10px; box-shadow: var(--shadow); font-size: 13.5px; display: flex; gap: 10px; align-items: flex-start; }
.toast::before { content: ""; flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--signal); margin-top: 6px; }
.toast.ok::before { background: var(--ok); }
.toast.bad::before { background: var(--bad); }

/* Mieterbereich */
.portal { position: fixed; inset: 0; z-index: 40; background: var(--bg); overflow: auto; }
.portal-in { max-width: 860px; margin: 0 auto; padding: calc(18px + env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) calc(40px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px)); display: grid; gap: 18px; }
.portal-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.vorschau { background: var(--signal-soft); border: 1px solid var(--signal); border-radius: 10px; padding: 10px 14px; font-size: 13px; }
.login { max-width: 420px; margin: 6vh auto 0; width: 100%; }
.doc-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); }
.doc-row:last-child { border-bottom: 0; }
.loading { padding: 60px 20px; text-align: center; color: var(--muted); display: grid; gap: 10px; justify-items: center; }

/* Live-Ergänzungen */
html, body { margin: 0; }
:root { padding-top: env(safe-area-inset-top, 0px); padding-bottom: env(safe-area-inset-bottom, 0px); }
.banner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; padding: 10px 14px; border-radius: 10px; background: var(--signal-soft); border: 1px solid color-mix(in srgb, var(--signal) 60%, transparent); font-size: 13.5px; }
.banner-bad { background: var(--bad-bg); border-color: color-mix(in srgb, var(--bad) 35%, transparent); }
.side-foot .who { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-foot .btn { color: var(--ink); }
.seg { display: inline-flex; border: 1px solid var(--line-strong); border-radius: 999px; padding: 3px; gap: 2px; background: var(--surface-2); }
.seg button { border: 0; background: none; padding: 5px 12px; border-radius: 999px; cursor: pointer; font-weight: 500; color: var(--muted); }
.seg button.on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.12); }
.pakete { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 1100px) { .pakete { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .pakete { grid-template-columns: minmax(0, 1fr); } }
.paket { border: 1px solid var(--line); border-radius: 12px; padding: 16px; display: flex; flex-direction: column; gap: 6px; background: var(--surface); }
.paket-hl { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.paket .preis { display: flex; align-items: baseline; gap: 6px; }
.paket .preis b { font: 600 26px/1.1 var(--f-mono); }
.paket ul { margin: 4px 0 8px; padding-left: 18px; font-size: 13px; color: var(--muted); display: grid; gap: 2px; }
.paket .btn { margin-top: auto; }
button.zelle { font: inherit; }
