:root {
  --bg: #f1f3f3;
  --surface: #ffffff;
  --surface-2: #f6f7f7;
  --ink: #1d2326;
  --ink-2: #3a4448;
  --muted: #5f6b70;
  --line: #dde1e2;
  --line-2: #c5cccf;
  --accent: #0f4c5c;
  --accent-hover: #0b3a47;
  --accent-ink: #ffffff;
  --accent-soft: #e5eef0;
  --accent-text: #0f4c5c;
  --side: #17262b;
  --side-2: #22353b;
  --side-ink: #c9d4d7;
  --side-muted: #8b9ca1;
  --new: #1d5a85;
  --new-soft: #e6eef5;
  --prog: #8a5a00;
  --prog-soft: #f9efd9;
  --prog-dot: #c98a12;
  --done: #2d6a3e;
  --done-soft: #e4f0e6;
  --danger: #b42318;
  --danger-soft: #fae8e6;
  --danger-text: #9b1c13;
  --radius: 6px;
  --radius-sm: 4px;
  --shadow: 0 1px 1px rgba(23, 38, 43, .05);
  --shadow-lg: 0 6px 18px rgba(23, 38, 43, .12);
  --side-w: 248px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 14.5px/1.5 "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}
a { color: var(--accent-text); text-decoration-thickness: 1px; text-underline-offset: 2px; }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .5rem; font-weight: 650; letter-spacing: -.015em; }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.05rem; }
h3 { font-size: .95rem; }
p { margin: 0 0 .75rem; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.nowrap { white-space: nowrap; }
.ic { width: 18px; height: 18px; flex: none; }

/* ---------- App-Rahmen mit Seitenleiste ---------- */
.side {
  position: fixed; inset: 0 auto 0 0; width: var(--side-w); background: var(--side); color: var(--side-ink);
  display: flex; flex-direction: column; padding: 18px 14px; z-index: 1100; overflow-y: auto;
}
.side .brand { display: flex; align-items: center; gap: 11px; color: #fff; text-decoration: none; font-weight: 650; font-size: .98rem; padding: 4px 8px 18px; }
.side .brand .brand-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; }
.side .brand .brand-name { font-size: 1.08rem; font-weight: 700; letter-spacing: -.01em; }
.side .brand .brand-org { font-size: .74rem; font-weight: 500; color: var(--side-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.logo { display: block; flex: none; }
.wordmark { font-weight: 700; letter-spacing: -.02em; }
.wordmark span { color: var(--accent); }
.side .wordmark span, .mobile-top .wordmark span { color: #75dbfd; }
.mobile-top .wordmark { font-size: 1.05rem; }
.inline-pop { display: inline-block; position: relative; }
.inline-pop > summary { list-style: none; }
.inline-pop > summary::-webkit-details-marker { display: none; }
.inline-pop .pop { position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; width: 230px; display: grid; gap: 8px; text-align: left;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px; box-shadow: var(--shadow-lg); }
.inline-pop .pop label { margin: 0; }
.app-sign { text-align: center; color: var(--muted); font-size: .78rem; margin-top: 18px; }
.app-sign strong { color: var(--ink-2); font-weight: 650; }
.side-cta {
  display: flex; align-items: center; justify-content: center; gap: 8px; margin: 0 4px 18px; padding: 10px 12px; border-radius: 10px;
  background: linear-gradient(135deg, #2b30e0, #7335fc); color: #fff; text-decoration: none; font-weight: 600; font-size: .9rem; box-shadow: 0 6px 16px rgba(79, 70, 229, .35);
}
.side-cta:hover { background: linear-gradient(135deg, #3a3ff0, #8247ff); }
.side-label { font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; color: var(--side-muted); padding: 14px 12px 6px; font-weight: 600; }
.side-nav { display: flex; flex-direction: column; gap: 2px; }
.side-nav a {
  display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: 9px; color: var(--side-ink);
  text-decoration: none; font-weight: 500; font-size: .92rem; position: relative;
}
.side-nav a .ic { opacity: .75; }
.side-nav a:hover { background: var(--side-2); color: #fff; }
.side-nav a.on { background: rgba(99, 102, 241, .18); color: #fff; }
.side-nav a.on .ic { opacity: 1; color: #a5b4fc; }
.side-nav a.on::before { content: ""; position: absolute; left: -14px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: #818cf8; }
.count { margin-left: auto; background: var(--new); color: #fff; border-radius: 999px; font-size: .72rem; padding: 0 7px; line-height: 19px; font-weight: 600; }
.side-foot { margin-top: auto; padding-top: 16px; display: flex; flex-direction: column; gap: 10px; }
.me { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 11px; background: var(--side-2); }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: linear-gradient(135deg, #6366f1, #8b5cf6); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 650; flex: none; }
.me-text { min-width: 0; flex: 1; }
.me-name { color: #fff; font-weight: 600; font-size: .88rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me-mail { color: var(--side-muted); font-size: .76rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me-out { color: var(--side-muted); display: flex; padding: 6px; border-radius: 7px; }
.me-out:hover { color: #fff; background: rgba(255, 255, 255, .08); }

.main-wrap { margin-left: var(--side-w); min-height: 100vh; }
.content { max-width: 1320px; margin: 0 auto; padding: 28px 32px 56px; }
body.plain .content { max-width: 1240px; padding: 24px 16px 48px; }
.mobile-top { display: none; }
.backdrop { display: none; }

@media (max-width: 960px) {
  .side { transform: translateX(-100%); transition: transform .2s ease; box-shadow: var(--shadow-lg); }
  .side.open { transform: none; }
  .backdrop.open { display: block; position: fixed; inset: 0; background: rgba(17, 24, 39, .45); z-index: 1050; }
  .main-wrap { margin-left: 0; }
  .mobile-top {
    display: flex; align-items: center; gap: 10px; position: sticky; top: 0; z-index: 1000; height: 56px; padding: 0 12px;
    background: var(--side); color: #fff;
  }
  .mobile-top .brand { display: flex; align-items: center; gap: 9px; color: #fff; text-decoration: none; font-weight: 650; flex: 1; min-width: 0; }
  .mobile-top .brand span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .menu-btn { background: none; border: 0; color: #fff; padding: 8px; border-radius: 8px; display: flex; cursor: pointer; }
  .menu-btn .ic { width: 22px; height: 22px; }
  .content { padding: 20px 16px 48px; }
}

/* ---------- Seitenkopf, Karten, Raster ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 22px; }
.page-head h1 { margin: 0; }
.page-head .sub { color: var(--muted); margin-top: 3px; }
.page-head .small a { color: var(--muted); text-decoration: none; }
.page-head .small a:hover { color: var(--accent-text); }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-pad { padding: 20px 22px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 15px 22px; border-bottom: 1px solid var(--line); }
.card-head h2 { margin: 0; }
.card-head a.small { font-weight: 600; text-decoration: none; }
.grid { display: grid; gap: 18px; }
.g-2 { grid-template-columns: 1fr 1fr; }
.g-main { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); }
.g-side { grid-template-columns: minmax(0, 1fr) 350px; }
.g-side > * { min-width: 0; }
@media (max-width: 1100px) { .g-2, .g-main, .g-side { grid-template-columns: 1fr; } }
.stack > * + * { margin-top: 18px; }

/* Kennzahlen */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
@media (max-width: 760px) { .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.stat { padding: 16px 18px; text-decoration: none; color: inherit; display: block; transition: border-color .15s, box-shadow .15s, transform .15s; }
.stat-warn { border-color: #fcd34d; background: #fffbeb; }
.stat-warn .val { color: var(--prog); }
.stat-danger { border-color: #fca5a5; background: #fef2f2; }
.stat-danger .val { color: var(--danger); }
a.stat:hover { border-color: var(--line-2); box-shadow: var(--shadow-lg); transform: translateY(-1px); }
.stat .chip { width: 44px; height: 44px; border-radius: 12px; display: flex; align-items: center; justify-content: center; flex: none; }
.stat .chip .ic { width: 22px; height: 22px; }
.chip-neu { background: var(--new-soft); color: var(--new); }
.chip-prog { background: var(--prog-soft); color: var(--prog); }
.chip-hoch { background: var(--danger-soft); color: var(--danger); }
.chip-done { background: var(--done-soft); color: var(--done); }
.chip-accent { background: var(--accent-soft); color: var(--accent); }
.stat .lbl { color: var(--muted); font-size: .82rem; font-weight: 500; display: flex; align-items: center; gap: 6px; }
.stat .val { font-size: 1.75rem; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.15; letter-spacing: -.02em; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: none; }
.dot-neu { background: var(--new); } .dot-in_arbeit { background: var(--prog-dot); } .dot-erledigt { background: #10b981; } .dot-hoch { background: var(--danger); }

/* Karte */
.map { height: 460px; border-radius: 0 0 var(--radius) var(--radius); z-index: 0; }
.map.tall { height: 560px; }
.map.small { height: 240px; border-radius: var(--radius); }
.map.picker { height: 380px; border-radius: var(--radius-sm); border: 1px solid var(--line); }
.pin { width: 30px; height: 30px; border-radius: 50%; background: #6b7280; border: 3px solid #fff; color: #fff; font-weight: 700; font-size: 12px;
  display: flex; align-items: center; justify-content: center; box-shadow: 0 2px 6px rgba(0, 0, 0, .35); }
.pin.p-neu { background: var(--new); } .pin.p-prog { background: var(--prog-dot); } .pin.p-ok { background: #6b7280; }
.legend { display: flex; gap: 14px; font-size: .8rem; color: var(--muted); flex-wrap: wrap; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.leaflet-popup-content { font: 14px/1.45 "IBM Plex Sans", system-ui, sans-serif; }
.leaflet-popup-content a { font-weight: 600; color: var(--accent-text); }
.leaflet-popup-content-wrapper { border-radius: 12px; }

/* Tabellen und Listen */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: .72rem; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; background: var(--surface-2); padding-top: 10px; padding-bottom: 10px; }
tr:last-child td { border-bottom: 0; }
tr.click { cursor: pointer; }
tr.click:hover td { background: #fafaff; }
td .t-title { font-weight: 600; color: var(--ink); text-decoration: none; }
tr.click:hover .t-title { color: var(--accent-text); }
td .t-sub { color: var(--muted); font-size: .84rem; }
.empty { padding: 32px 20px; text-align: center; color: var(--muted); }

.list { list-style: none; margin: 0; padding: 0; }
.list li { padding: 13px 22px; border-bottom: 1px solid var(--line); display: flex; gap: 12px; align-items: flex-start; }
.list li:last-child { border-bottom: 0; }
.list li:hover { background: #fafaff; }
.list a.row { display: flex; gap: 12px; align-items: flex-start; text-decoration: none; color: inherit; flex: 1; min-width: 0; }
.list .grow { flex: 1; min-width: 0; }
.list .title { font-weight: 600; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Badges */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 10px; border-radius: 999px; font-size: .76rem; font-weight: 600; white-space: nowrap; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .85; }
.b-neu { background: var(--new-soft); color: var(--new); }
.b-in_arbeit { background: var(--prog-soft); color: var(--prog); }
.b-erledigt { background: var(--done-soft); color: var(--done); }
.b-hoch { background: var(--danger-soft); color: var(--danger-text); }
.b-plain { background: #eef0f4; color: var(--ink-2); }
.b-plain::before { display: none; }
/* Prioritäten: eckiger als Status-Badges, ohne Punkt */
.prio { border-radius: 6px; font-size: .7rem; text-transform: uppercase; letter-spacing: .05em; padding: 2px 8px; }
.prio::before { display: none; }
.pr-notfall { background: #dc2626; color: #fff; }
.pr-hoch { background: #fee2e2; color: #b91c1c; }
.pr-normal { background: #e0e7ff; color: #3730a3; }
.pr-niedrig { background: #eef0f4; color: #4b5563; }
/* Fristen */
.due { display: inline-block; font-size: .78rem; font-weight: 600; white-space: nowrap; }
.due-over { background: #dc2626; color: #fff; padding: 2px 8px; border-radius: 6px; }
.due-soon { background: #fef3c7; color: #92400e; padding: 2px 8px; border-radius: 6px; }
.due-normal { color: var(--muted); font-weight: 500; }
.due-ok { color: var(--done); }
.due-late { color: var(--danger-text); }
tr.over td:first-child { box-shadow: inset 3px 0 0 #dc2626; }
.list li.over { box-shadow: inset 3px 0 0 #dc2626; }
.chip-over { background: #dc2626; color: #fff; }
.stat .sub { font-size: .76rem; color: var(--muted); margin-top: 1px; }
.pin.p-over { box-shadow: 0 0 0 3px #dc2626, 0 2px 6px rgba(0, 0, 0, .35); }
.tag { display: inline-block; padding: 1px 8px; border-radius: 6px; background: var(--accent-soft); color: var(--accent-text); font-size: .76rem; font-weight: 600; }

/* Formulare */
label { display: block; font-weight: 550; font-size: .88rem; margin-bottom: 6px; color: var(--ink-2); }
.hint { color: var(--muted); font-size: .8rem; font-weight: 400; }
input[type=text], input[type=email], input[type=tel], input[type=password], input[type=number], input[type=search], input[type=url],
input[type=date], input[type=time], input[type=datetime-local], select, textarea {
  width: 100%; padding: 9px 12px; border: 1px solid var(--line-2); border-radius: var(--radius-sm); background: #fff; color: var(--ink);
  font: inherit; font-size: 16px; transition: border-color .15s, box-shadow .15s;
}
@media (min-width: 761px) {
  input[type=text], input[type=email], input[type=tel], input[type=password], input[type=number], input[type=search], input[type=url],
  input[type=date], input[type=time], select, textarea { font-size: 14.5px; }
}
textarea { min-height: 110px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(79, 70, 229, .15); }
input[readonly] { background: var(--surface-2); color: var(--muted); }
input[type=checkbox], input[type=radio] { accent-color: var(--accent); }
.field { margin-bottom: 15px; }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.row-3 { display: grid; grid-template-columns: 120px 1fr; gap: 12px; }
@media (max-width: 560px) { .row-2, .row-3 { grid-template-columns: 1fr; } }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; color: var(--ink); }
.check input { margin-top: 3px; width: 17px; height: 17px; flex: none; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; padding: 13px 16px; border-bottom: 1px solid var(--line); background: var(--surface-2); border-radius: var(--radius) var(--radius) 0 0; }
.filters select, .filters input { width: auto; min-width: 150px; padding: 7px 10px; font-size: 14px; }
.filters input[type=search] { flex: 1; min-width: 180px; }
.filters input[type=checkbox] { min-width: 0; width: 17px; padding: 0; }
.filters .check { align-items: center; white-space: nowrap; margin: 0; }
.filters .check input { margin-top: 0; }
.seg { display: inline-flex; border: 1px solid var(--line-2); border-radius: var(--radius-sm); overflow: hidden; background: #fff; padding: 2px; gap: 2px; }
.seg a { padding: 6px 12px; text-decoration: none; color: var(--ink-2); font-size: .86rem; font-weight: 500; border-radius: 7px; }
.seg a:hover { background: var(--surface-2); }
.seg a.on { background: var(--accent); color: #fff; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 9px 15px; border-radius: var(--radius-sm); border: 1px solid var(--line-2);
  background: #fff; color: var(--ink); font: inherit; font-weight: 600; font-size: .9rem; cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: background .15s, border-color .15s, box-shadow .15s; }
.btn:hover { background: var(--surface-2); border-color: #bfc5d2; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); box-shadow: 0 4px 12px rgba(79, 70, 229, .25); }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-danger { color: var(--danger-text); border-color: #f5c2c2; }
.btn-danger:hover { background: var(--danger-soft); border-color: #f0a8a8; }
.btn-sm { padding: 5px 10px; font-size: .82rem; }
.btn-block { width: 100%; padding: 12px; font-size: .98rem; }
.btn .ic { width: 16px; height: 16px; }
.btn:disabled { opacity: .6; cursor: default; }
.linkbtn { background: none; border: 0; padding: 0; color: var(--danger-text); cursor: pointer; font: inherit; font-size: .84rem; font-weight: 500; }

.flash { padding: 12px 16px; border-radius: var(--radius-sm); margin-bottom: 18px; border: 1px solid; font-weight: 500; }
.flash.ok { background: #ecfdf5; border-color: #a7f3d0; color: #065f46; }
.flash.error { background: #fef2f2; border-color: #fecaca; color: #991b1b; }
.note { padding: 11px 14px; border-radius: var(--radius-sm); background: var(--prog-soft); color: #7c2d12; border: 1px solid #fed7aa; font-size: .9rem; }

/* Detailseiten */
.dl { display: grid; grid-template-columns: 130px 1fr; gap: 9px 14px; margin: 0; }
.dl dt { color: var(--muted); font-size: .86rem; }
.dl dd { margin: 0; overflow-wrap: anywhere; }
.desc { white-space: pre-wrap; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 13px 15px; }
.photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.photos a { display: block; aspect-ratio: 1; border-radius: var(--radius-sm); overflow: hidden; border: 1px solid var(--line); background: var(--surface-2); }
.photos img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .2s; }
.photos a:hover img { transform: scale(1.04); }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding: 0 0 15px 22px; }
.timeline li::before { content: ""; position: absolute; left: 3px; top: 6px; width: 9px; height: 9px; border-radius: 50%; background: #fff; border: 2px solid var(--accent); }
.timeline li::after { content: ""; position: absolute; left: 7px; top: 18px; bottom: 0; width: 1px; background: var(--line-2); }
.timeline li:last-child::after { display: none; }
.timeline .meta { color: var(--muted); font-size: .8rem; }
.timeline .pub { color: var(--new); font-size: .75rem; font-weight: 600; }
.qr-thumb { width: 64px; height: 64px; border: 1px solid var(--line); border-radius: 8px; background: #fff; padding: 3px; display: block; }
.stars { color: #f59e0b; letter-spacing: 1px; white-space: nowrap; }
.stars .off { color: var(--line-2); }

/* Öffentliche Seiten (Mieter) */
.pub-body { background: linear-gradient(180deg, #eef0ff 0, var(--bg) 260px); }
.pub-wrap { max-width: 560px; margin: 0 auto; padding: 22px 16px 48px; }
.pub-head { display: flex; align-items: center; gap: 10px; color: var(--ink); font-weight: 650; margin-bottom: 18px; }
.pub-head svg { width: 28px; height: 28px; }
.house-box { padding: 15px 18px; margin-bottom: 14px; border-left: 4px solid var(--accent); }
.house-box .name { font-weight: 650; font-size: 1.05rem; }
.emergency { padding: 12px 15px; border-radius: var(--radius-sm); background: var(--danger-soft); border: 1px solid #fecaca; color: #7f1d1d; font-size: .9rem; margin-bottom: 14px; }
.emergency a { color: inherit; font-weight: 700; }
.cats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.cats label { display: flex; align-items: center; gap: 8px; padding: 10px 11px; border: 1px solid var(--line-2); border-radius: var(--radius-sm); background: #fff; font-weight: 500; font-size: .88rem; cursor: pointer; margin: 0; color: var(--ink); }
.cats input { margin: 0; }
.cats label:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-text); }
.file-drop { border: 1.5px dashed var(--line-2); border-radius: var(--radius-sm); padding: 16px; text-align: center; background: var(--surface-2); color: var(--muted); }
.file-drop input { font-size: 14px; max-width: 100%; }
.hp { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }  /* unsichtbar, auch bei Arabisch (rechts nach links) */
.steps { display: flex; gap: 6px; margin: 14px 0; }
.steps div { flex: 1; text-align: center; font-size: .8rem; color: var(--muted); }
.steps div::before { content: ""; display: block; height: 6px; border-radius: 3px; background: var(--line); margin-bottom: 6px; }
.steps div.on { color: var(--ink); font-weight: 600; }
.steps div.on::before { background: var(--accent); }
.center { text-align: center; }
.big-check { width: 60px; height: 60px; border-radius: 50%; background: var(--done-soft); color: var(--done); display: inline-flex; align-items: center; justify-content: center; margin-bottom: 12px; }
.big-check svg { width: 30px; height: 30px; }
.auth { max-width: 410px; margin: 9vh auto; padding: 0 16px; }
.auth .card { box-shadow: var(--shadow-lg); }
.auth-logo { display: flex; justify-content: center; margin-bottom: 18px; }
body.plain { background: linear-gradient(160deg, #eef0ff 0, var(--bg) 45%); min-height: 100vh; }

/* Zeiterfassung */
.timer-pill { display: inline-flex; align-items: center; gap: 7px; padding: 6px 11px; border-radius: 999px; background: rgba(239, 68, 68, .15);
  color: #fca5a5; font-weight: 600; font-size: .8rem; text-decoration: none; font-variant-numeric: tabular-nums; }
.rec { width: 8px; height: 8px; border-radius: 50%; background: #ef4444; animation: blink 1.4s infinite; flex: none; }
@keyframes blink { 50% { opacity: .25; } }
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-bottom: 1px solid var(--line); }
@media (max-width: 1300px) and (min-width: 561px) { .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } .kpis > div:nth-child(2) { border-right: 0; } .kpis > div:nth-child(-n+2) { border-bottom: 1px solid var(--line); } }
.kpis > div { padding: 13px 22px; border-right: 1px solid var(--line); }
.kpis > div:last-child { border-right: 0; }
.kpis .lbl { color: var(--muted); font-size: .76rem; font-weight: 500; }
.kpis .v { font-weight: 650; font-size: 1.05rem; font-variant-numeric: tabular-nums; }
@media (max-width: 560px) { .kpis { grid-template-columns: 1fr; } .kpis > div { border-right: 0; border-bottom: 1px solid var(--line); } }
.stopwatch { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 14px 22px; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.stopwatch input[type=text] { flex: 1; min-width: 180px; }
.stopwatch .clock { font-size: 1.5rem; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--danger); min-width: 96px; }
.btn-rec { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-rec:hover { background: #b91c1c; border-color: #b91c1c; }
.add-box { border-top: 1px solid var(--line); padding: 18px 22px; }
.add-box h3 { margin-bottom: 12px; }
.time-grid { display: grid; grid-template-columns: 1.4fr 1fr .8fr .8fr .8fr; gap: 10px; }
@media (max-width: 760px) { .time-grid { grid-template-columns: 1fr 1fr; } }
.tr-total td { font-weight: 650; background: var(--surface-2); }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* Rechte-Matrix */
.matrix th, .matrix td { text-align: center; vertical-align: middle; }
.matrix th:first-child, .matrix td:first-child { text-align: left; }
.matrix input[type=checkbox] { width: 18px; height: 18px; }
.matrix input[type=text] { min-width: 120px; font-size: 14px; padding: 6px 8px; font-weight: 600; text-align: center; }
.house-checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 6px; max-height: 220px; overflow: auto;
  border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px; background: var(--surface-2); }
.house-checks label { font-weight: 400; display: flex; gap: 8px; align-items: center; margin: 0; }
.radio-row { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 8px; }
.radio-row label { display: flex; gap: 6px; align-items: center; font-weight: 500; margin: 0; }

/* Mieter-Import */
tr.imp-err td { background: #fef2f2; }
.imp-msg { font-size: .78rem; color: var(--muted); margin-top: 3px; }
.imp-msg-err { color: var(--danger-text); }
.imp-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 16px; flex-wrap: wrap; }

/* Stellplätze im Mietvertrag */
.extras { display: flex; flex-direction: column; gap: 6px; margin-bottom: 6px; }
.extra-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; font-weight: 500; }
.extra-row:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.extra-row .grow { flex: 1; min-width: 0; }
.extra-row input[type=text] { width: 90px; text-align: right; }
tr.lease-child td { border-top: 0; padding-top: 2px; }
tr.lease-child .t-title { font-weight: 500; }
tr.lease-sum td { border-top: 0; padding-top: 0; font-weight: 600; }

/* Kategorien je Haus */
.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 6px 16px; }

/* Vorlagen und Mieterakte */
.doc-pick { display: flex; align-items: center; gap: 6px; padding: 4px 0; text-align: left; }
.doc-pick .grow { flex: 1; min-width: 140px; font-weight: 500; }
.doc-pick form { margin: 0; }
.doc-upload { border-top: 1px solid var(--line); }
.ph-group { margin-top: 14px; }
.ph-group h3 { margin: 0 0 4px; font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.ph { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; width: 100%; text-align: left; background: none; border: 0;
  border-top: 1px solid var(--line); padding: 7px 4px; cursor: pointer; font: inherit; color: inherit; border-radius: 0; }
.ph:hover { background: #f7f8fb; }
.ph code { font-size: .8rem; background: var(--accent-soft); color: var(--accent); padding: 1px 7px; border-radius: 5px; white-space: nowrap; }
.ph-desc { font-size: .82rem; color: var(--muted); flex: 1; min-width: 140px; }
.ph.copied code { background: var(--done-soft); color: var(--done); }
.ph.copied .ph-desc::after { content: " (kopiert)"; color: var(--done); font-weight: 600; }
.steps-list { margin: 0 0 14px; padding-left: 20px; color: var(--ink-2); font-size: .9rem; line-height: 1.6; }
.upload-card { scroll-margin-top: 20px; transition: box-shadow .3s; }
.upload-card.flash-focus { box-shadow: 0 0 0 3px var(--accent); }
.inline-pop .pop:has(.doc-pick) { width: min(440px, 86vw); }

/* Mietverhältnisse in der Mieterakte */
.lease { padding: 16px 22px 18px; border-top: 1px solid var(--line); }
.lease-ended .t-title, .lease-ended .lease-figs .val { color: var(--muted); }
.lease-head { display: flex; gap: 10px; align-items: flex-start; }
.lease-head .t-title { margin-right: 6px; }
.lease-figs { display: grid; grid-template-columns: repeat(auto-fit, minmax(118px, 1fr)); gap: 10px 18px; margin: 12px 0 2px; }
.lease-figs .lbl { font-size: .74rem; color: var(--muted); }
.lease-figs .val { font-weight: 600; font-variant-numeric: tabular-nums; }
.lease-figs .total .val { color: var(--accent); }
.lease-kids { list-style: none; margin: 10px 0 0; padding: 0 0 0 12px; border-left: 2px solid var(--accent-soft); font-size: .88rem; }
.lease-kids li { display: flex; justify-content: space-between; gap: 12px; padding: 3px 0; }
.lease-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.lease-actions .btn.on { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.lease-panel { margin-top: 10px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: #fafbfd; }
.lease-panel .doc-pick { flex-wrap: wrap; padding: 6px 0; }
.lease-panel .doc-pick + .doc-pick { border-top: 1px solid var(--line); }
.panel-row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 12px; }
.panel-row .field { margin: 0; min-width: 160px; }
.panel-row .panel-note { flex-basis: 100%; margin: 0; }
.lease-panel[hidden] { display: none !important; }

/* Kosten, Rundschreiben, Berichte */
.cols-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 700px) { .cols-3 { grid-template-columns: 1fr; } }
.check-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 6px 16px; }
.letter-preview { white-space: pre-wrap; background: #fafbfd; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 14px 16px; font-size: .92rem; line-height: 1.55; }
.warn-box { background: #fffbeb; border: 1px solid #fcd34d; color: #92400e; border-radius: var(--radius-sm); padding: 10px 14px; font-size: .9rem; margin-bottom: 12px; }

/* Meldeseite: Ort fest aus dem QR-Code */
.fixed-place { padding: 11px 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: #f7f8fb; }
.fixed-place .hint { margin-top: 2px; }

/* Nebenkostenabrechnung */
.nk-late { color: var(--danger-text); font-weight: 600; }
.nk-pos { color: var(--danger-text); }
.nk-neg { color: var(--done); }
.nk-warn { margin: 6px 0 0; padding-left: 18px; }
.nk-units { margin-top: 10px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.nk-units th, .nk-units td { padding: 6px 10px; }
.nk-units { table-layout: fixed; width: 100%; }
.nk-units th:first-child { width: 86px; }
.nk-units td { overflow-wrap: anywhere; }
.nk-units td.num { white-space: normal; }
.nk-units td input[type=text] { width: 100%; max-width: 110px; min-width: 64px; padding: 5px 8px; text-align: right; }
@media (max-width: 760px) { .nk-units th, .nk-units td { padding: 6px; } .nk-units th { letter-spacing: 0; } .nk-units th:first-child { width: 70px; } }
.nk-pre { width: 110px; padding: 5px 8px; text-align: right; }
.nk-owner td { background: var(--surface-2); }
.nk-add { background: #fafbfd; }
.lease-head .grow { flex: 1; min-width: 0; }
.lease-head .num { text-align: right; }

/* Zählerstände */
.meter-box { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 14px; margin-bottom: 12px; background: #fafbfd; }
.meter-title { font-weight: 600; font-size: 1.05rem; }
.meter-inputs { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 10px; }
.meter-inputs .field { margin: 0; }
.meter-val { font-size: 1.15rem; font-variant-numeric: tabular-nums; }
.photo-btn { cursor: pointer; }
.meter-thumb { display: block; width: 100%; max-height: 140px; object-fit: cover; border-radius: var(--radius-sm); margin-top: 8px; border: 1px solid var(--line); }
.meter-new { margin: 6px 0 4px; }
.meter-new summary { cursor: pointer; font-weight: 600; color: var(--accent-text); margin-bottom: 10px; }
.meter-link { display: flex; gap: 12px; align-items: flex-start; }
.meter-link img { border: 1px solid var(--line); border-radius: 8px; flex: none; background: #fff; }
.meter-link input { font-size: .8rem; }
.meter-link .grow { flex: 1; min-width: 0; }
.reading-thumb { width: 64px; height: 48px; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); display: block; }
.reading-check { display: flex; gap: 16px; align-items: flex-start; }
.reading-check .grow { flex: 1; min-width: 0; }
.reading-photo { width: 180px; max-height: 180px; object-fit: cover; border-radius: var(--radius-sm); border: 1px solid var(--line); display: block; }
@media (max-width: 760px) {
  .meter-inputs { grid-template-columns: 1fr; }
  .reading-check { flex-direction: column; }
  .reading-photo { width: 100%; max-height: 260px; }
}


/* Einheit hinzufügen (Haus) */
details.add { border-top: 1px solid var(--line); padding: 14px 22px 18px; }
details.add > summary { cursor: pointer; font-weight: 600; color: var(--accent-text); }
details.add[open] > summary { margin-bottom: 14px; }
.check-row { display: flex; flex-wrap: wrap; gap: 8px 18px; padding-top: 4px; }
.check-row .check { align-items: center; }
.check-row .check input { margin-top: 0; }

/* Eigentümer der Wohnung */
details.unit-owner { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 14px; margin-bottom: 15px; background: #fafbfd; }
details.unit-owner > summary { cursor: pointer; font-weight: 600; }
details.unit-owner[open] > summary { margin-bottom: 12px; }

/* Auftragsseite Handwerker */
.job-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 14px 0; }
.job-steps div { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 8px 10px; font-size: .85rem; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.job-steps b { width: 22px; height: 22px; border-radius: 50%; background: #fff; border: 1px solid var(--line-2); display: inline-flex; align-items: center; justify-content: center; font-size: .78rem; color: var(--ink); flex: none; }
.job-steps .done { background: var(--done-soft); border-color: #a7f3d0; color: var(--done); font-weight: 600; }
.job-steps .done b { background: var(--done); border-color: var(--done); color: #fff; }
.job-when { font-weight: 700; font-size: 1.1rem; margin: 0 0 12px; color: var(--accent-text); }
.job-invoice { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: .9rem; }

/* Sprachwahl auf den Mieterseiten */
.pub-head { flex-wrap: wrap; row-gap: 12px; }
.pub-head .grow { flex: 1 1 0; min-width: 0; }
/* Sprachwahl als eigene Zeile unter Logo und Name, damit nichts überlappt */
.lang-pick { flex: 0 0 100%; display: flex; flex-wrap: wrap; gap: 5px; font-weight: 500; }
.lang-pick a { font-size: .78rem; line-height: 1.2; padding: 5px 9px; border-radius: 999px; border: 1px solid var(--line); color: var(--ink-2); text-decoration: none; background: #fff; }
.lang-pick a.on { border-color: var(--accent); color: var(--accent-text); background: var(--accent-soft); font-weight: 600; }
[dir=rtl] .check input { margin-left: 0; }
[dir=rtl] input[inputmode=decimal], [dir=rtl] input[type=tel], [dir=rtl] input[type=email] { direction: ltr; text-align: right; }

/* Anleitung */
.guide { display: grid; gap: 14px; max-width: 860px; }
.guide-step { display: flex; gap: 18px; align-items: flex-start; }
.guide-step h2 { margin-top: 2px; }
.guide-step p { margin: 0 0 8px; line-height: 1.6; }
.guide-no { flex: none; width: 40px; height: 40px; border-radius: 50%; background: var(--accent); color: #fff; font-weight: 700; font-size: 1.1rem; display: flex; align-items: center; justify-content: center; }
.guide-tip { color: var(--muted); font-size: .9rem; border-left: 3px solid var(--accent-soft); padding-left: 10px; }
.guide-list { margin: 0 0 8px; padding-left: 20px; line-height: 1.6; }
.guide-faq dt { font-weight: 600; margin-top: 12px; }
.guide-faq dd { margin: 2px 0 0; color: var(--ink-2); line-height: 1.55; }
@media print { .side, .mobile-top, .page-head .actions { display: none !important; } .guide-step { break-inside: avoid; } .main-wrap { margin: 0 !important; } }
[dir=rtl] .house-box { border-left: 0; border-right: 4px solid var(--accent); }
[dir=rtl] .timeline li { padding: 0 22px 15px 0; }
[dir=rtl] .timeline li::before { left: auto; right: 3px; }
[dir=rtl] .timeline li::after { left: auto; right: 7px; }

/* Prüfliste Zählerstände */
.check-number { margin-top: 6px; font-size: .88rem; padding: 6px 10px; border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid var(--line); }
.check-warn { margin: 8px 0 0; padding: 8px 10px 8px 26px; border-radius: var(--radius-sm); background: #fffbeb; border: 1px solid #fcd34d; color: #92400e; font-size: .86rem; }
.check-warn li + li { margin-top: 3px; }

/* Gebuchte Module (Einstellungen) */
.module-list { list-style: none; margin: 0; padding: 0; font-size: .92rem; }
.module-list li { padding: 5px 0 5px 18px; position: relative; }
.module-list li::before { content: ""; position: absolute; left: 2px; top: 12px; width: 8px; height: 8px; border-radius: 50%; background: var(--done); }
.module-list li.off { color: var(--muted); }
.module-list li.off::before { background: var(--line-2); }

/* ================================================================
   Optik „sachlich-klassisch“ (08.11.2026): Petrol als einzige Akzentfarbe, keine Verläufe,
   kantige Formen, Status als Text mit Farbbalken statt bunter Pillen
   ================================================================ */
h1, h2, h3 { font-weight: 600; letter-spacing: 0; }
h1 { font-size: 1.5rem; }
.card { box-shadow: var(--shadow); }
.side-cta { background: #2b6f7f; box-shadow: none; border-radius: var(--radius-sm); font-weight: 600; }
.side-cta:hover { background: #33808f; }
.side-nav a { border-radius: var(--radius-sm); }
.side-nav a.on { background: rgba(255, 255, 255, .08); }
.side-nav a.on .ic { color: #8cc8d4; }
.side-nav a.on::before { background: #8cc8d4; border-radius: 0; }
.wordmark span { color: var(--accent); }
.side .wordmark span, .mobile-top .wordmark span { color: #8cc8d4; }
.avatar { background: #2b6f7f; border-radius: var(--radius-sm); }
.me { border-radius: var(--radius-sm); }
.count { border-radius: 3px; }
.btn { border-radius: var(--radius-sm); font-weight: 500; }
.btn-primary { box-shadow: none; font-weight: 600; }
.stat { transition: none; }
a.stat:hover { transform: none; box-shadow: var(--shadow); border-color: var(--line-2); }
.stat .val { font-size: 1.55rem; font-weight: 600; letter-spacing: 0; }
.stat .chip { border-radius: var(--radius-sm); }
th { text-transform: none; letter-spacing: 0; font-size: .8rem; color: var(--ink-2); }
/* Status: Text mit Farbbalken links */
.badge { background: none !important; border-radius: 0; padding: 0 0 0 8px; border-left: 3px solid currentColor; font-size: .8rem; line-height: 1.35; }
.badge::before { display: none; }
.b-neu { color: var(--new); } .b-in_arbeit { color: var(--prog); } .b-erledigt { color: var(--done); }
.b-hoch { color: var(--danger-text); } .b-plain { color: var(--muted); border-left-color: var(--line-2); }
.prio { border-radius: 2px; border-left: 0; padding: 1px 7px; }
.prio.pr-notfall { background: var(--danger) !important; color: #fff; }
.prio.pr-hoch { background: var(--danger-soft) !important; color: var(--danger-text); }
.prio.pr-normal { background: #e7ecee !important; color: #33464c; }
.prio.pr-niedrig { background: #eef0f0 !important; color: var(--muted); }
.due-over, .due-soon { border-radius: 2px; }
.due-over { background: var(--danger); }
.tag, .lang-pick a, .mod { border-radius: 3px; }
.seg { border-radius: var(--radius-sm); }
.seg a { border-radius: 3px; }
.flash { border-radius: var(--radius-sm); }
.flash.ok { background: #eef6f0; border-color: #bcd9c3; color: #24502f; }
.pub-body, body.plain { background: var(--bg); }
.big-check { border-radius: var(--radius-sm); }
.dot-erledigt { background: var(--done); }
.guide-no { border-radius: var(--radius-sm); }
.job-steps .done b { border-radius: 2px; }
.job-steps b { border-radius: 2px; }

/* Fälligkeiten (Wartungen): Text mit Farbbalken, wie in der Zentrale */
.state { display: inline-block; font-size: .8rem; font-weight: 600; padding-left: 9px; border-left: 3px solid var(--line-2); line-height: 1.3; white-space: nowrap; }
.st-entwurf { border-color: #9aa5ab; color: var(--muted); font-weight: 500; }
.st-offen { border-color: #c98a12; color: #8a5a00; }
.st-ueberfaellig { border-color: var(--danger); color: var(--danger-text); }
.st-bezahlt { border-color: var(--done); color: var(--done); }
.tech-dl dt { font-size: .82rem; }
.svc-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.svc-row:last-child { border-bottom: 0; }

/* Heizung im Hausformular: oben drei Auswahlfelder, darunter Anlage breit und Baujahr schmal */
.tech-row { display: grid; gap: 0 14px; }
.tech-row-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.tech-row-2 { grid-template-columns: minmax(0, 1fr) 130px; }
@media (max-width: 760px) { .tech-row-3 { grid-template-columns: 1fr; } }
@media (max-width: 420px) { .tech-row-2 { grid-template-columns: 1fr; } }

/* Abmelden als Formular-Knopf, Zwei-Faktor-Einrichtung */
.me-out-form { display: inline; margin: 0; }
button.me-out { background: none; border: 0; cursor: pointer; font: inherit; }
.qr-box { margin: 10px 0 6px; } .qr-box svg { width: 200px; height: 200px; display: block; }
.steps-list { padding-left: 20px; } .steps-list li { margin-bottom: 10px; }
code.secret { font-size: .95rem; letter-spacing: .04em; word-break: break-all; }
.recovery-codes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 14px 0; }
.recovery-codes code { padding: 8px 10px; border: 1px solid var(--line); border-radius: 4px; text-align: center; font-size: 1rem; }
tr[data-href] { cursor: pointer; }
