/* =====================================================================
   Komponenten
   ===================================================================== */

/* ---------------- Nav-Item ---------------- */
.nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  padding: 9px 10px;
  border-radius: var(--radius-sm);
  color: var(--ts);
  font-size: 13.5px;
  font-weight: 500;
  transition: background var(--t-fast), color var(--t-fast);
  text-align: left;
}
.nav-item:hover { background: var(--bg-h); color: var(--tp); }
.nav-item.active { background: var(--accent-bg); color: var(--accent-h); }
.nav-item svg { width: 18px; height: 18px; flex-shrink: 0; }
.nav-item__label { flex: 1; }

/* Badge in Nav + allgemein */
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 6px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 9px;
  background: var(--accent);
  color: #fff;
}
.badge--red { background: var(--red); }
.badge--yellow { background: var(--yellow); color: #1a1205; }
.badge[hidden] { display: none; }

/* ---------------- Buttons ---------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 550;
  border: 1px solid transparent;
  transition: background var(--t-fast), border-color var(--t-fast), opacity var(--t-fast);
  white-space: nowrap;
}
.btn svg { width: 16px; height: 16px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn--primary { background: var(--accent); color: #fff; }
.btn--primary:hover:not(:disabled) { background: var(--accent-h); }
.btn--ghost { background: transparent; color: var(--tp); border-color: var(--brd); }
.btn--ghost:hover:not(:disabled) { background: var(--bg-h); }
.btn--subtle { background: var(--bg-e); color: var(--tp); }
.btn--subtle:hover:not(:disabled) { background: var(--bg-h); }
.btn--danger { background: var(--red-bg); color: var(--red); }
.btn--danger:hover:not(:disabled) { background: var(--red); color: #fff; }
.btn--sm { padding: 5px 10px; font-size: 12px; }
.btn--icon { padding: 8px; }

/* Icon-only round button */
.icon-btn {
  width: 36px; height: 36px;
  display: grid; place-items: center;
  border-radius: var(--radius-sm);
  color: var(--ts);
  transition: background var(--t-fast), color var(--t-fast);
}
.icon-btn:hover { background: var(--bg-h); color: var(--tp); }
.icon-btn svg { width: 18px; height: 18px; }

/* ---------------- Cards ---------------- */
.card {
  background: var(--bg-s);
  border: 1px solid var(--brd);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.card__head {
  padding: 14px 16px;
  border-bottom: 1px solid var(--brd);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.card__body { padding: 16px; }
.card__title { font-size: 14px; font-weight: 600; }

/* ---------------- Stats-Row: 6 Karten (1×6 Desktop, 2×3 Mobile) ---------------- */
.stats-row {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 12px;
  margin-bottom: 22px;
}
.stat-card {
  background: var(--bg-s);
  border: 1px solid var(--brd);
  border-radius: var(--radius);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: relative;
  overflow: hidden;
}
.stat-card__label {
  font-size: 11.5px;
  color: var(--ts);
  font-weight: 500;
  display: flex; align-items: center; gap: 6px;
}
.stat-card__value { font-size: 26px; font-weight: 700; line-height: 1; }
.stat-card__sub { font-size: 11px; color: var(--tt); }
.stat-card__icon {
  position: absolute; top: 12px; right: 12px;
  width: 18px; height: 18px; color: var(--tt); opacity: 0.7;
}
.stat-card--accent .stat-card__value { color: var(--accent-h); }
.stat-card--green .stat-card__value { color: var(--green); }
.stat-card--yellow .stat-card__value { color: var(--yellow); }
.stat-card--red .stat-card__value { color: var(--red); }
.stat-card--cyan .stat-card__value { color: var(--cyan); }

@media (max-width: 768px) {
  .stats-row { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .stat-card__value { font-size: 22px; }
}

/* ---------------- Status-Badges (Mieter) ---------------- */
.status {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 9px; border-radius: 20px;
  font-size: 11.5px; font-weight: 600;
}
.status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.status--aktiv     { color: var(--green);  background: var(--green-bg); }
.status--gekuendigt{ color: var(--yellow); background: var(--yellow-bg); }
.status--ausgezogen{ color: var(--red);    background: var(--red-bg); }

/* Allgemeine Chips */
.chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px; border-radius: 20px;
  font-size: 11.5px; font-weight: 550;
  background: var(--bg-e); color: var(--ts);
}
.chip--green { background: var(--green-bg); color: var(--green); }
.chip--yellow { background: var(--yellow-bg); color: var(--yellow); }
.chip--red { background: var(--red-bg); color: var(--red); }
.chip--cyan { background: var(--cyan-bg); color: var(--cyan); }

/* ---------------- Theme-Toggle ---------------- */
.theme-toggle {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px; border-radius: var(--radius-sm);
  background: var(--bg-e); color: var(--ts);
  font-size: 13px; width: 100%;
}
.theme-toggle:hover { background: var(--bg-h); color: var(--tp); }
.theme-toggle svg { width: 16px; height: 16px; }

/* User-Zeile im Sidebar-Footer */
.user-row {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 4px;
}
.user-row__avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--accent-bg); color: var(--accent-h);
  display: grid; place-items: center; font-weight: 650; font-size: 13px;
}
.user-row__name { font-size: 13px; font-weight: 550; }
.user-row__role { font-size: 11px; color: var(--ts); }

/* ---------------- Login ---------------- */
.login {
  min-height: 100vh;
  display: grid; place-items: center;
  padding: 20px;
  background:
    radial-gradient(900px 500px at 80% -10%, rgba(99,102,241,0.18), transparent),
    var(--bg);
}
.login[hidden] { display: none; }
.login__card {
  width: 100%; max-width: 380px;
  background: var(--bg-s);
  border: 1px solid var(--brd);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 30px 28px;
}
.login__brand { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; }
.login__brand .logo {
  width: 42px; height: 42px; border-radius: 11px;
  background: linear-gradient(135deg, var(--accent), var(--accent-h));
  display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 18px;
}
.login__title { font-size: 18px; }
.login__sub { color: var(--ts); font-size: 12.5px; }

/* ---------------- Form ---------------- */
.field { margin-bottom: 14px; }
.field__label {
  display: block; font-size: 12.5px; color: var(--ts);
  margin-bottom: 6px; font-weight: 550;
}
.input, .select, .textarea {
  width: 100%;
  padding: 10px 12px;
  background: var(--bg);
  border: 1px solid var(--brd);
  border-radius: var(--radius-sm);
  color: var(--tp);
  transition: border-color var(--t-fast);
}
[data-theme="light"] .input,
[data-theme="light"] .select,
[data-theme="light"] .textarea { background: var(--bg-e); }
.input:focus, .select:focus, .textarea:focus { border-color: var(--accent); outline: none; }
.input::placeholder { color: var(--tt); }
.textarea { resize: vertical; min-height: 72px; }

/* ---------------- Toasts ---------------- */
.toasts {
  position: fixed; z-index: 9999;
  bottom: 20px; right: 20px;
  display: flex; flex-direction: column; gap: 10px;
  max-width: min(360px, calc(100vw - 32px));
}
.toast {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px 14px;
  background: var(--bg-e);
  border: 1px solid var(--brd);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  animation: toast-in var(--t);
}
.toast.leaving { animation: toast-out 160ms ease forwards; }
.toast--success { border-left-color: var(--green); }
.toast--error { border-left-color: var(--red); }
.toast--warning { border-left-color: var(--yellow); }
.toast__icon { flex-shrink: 0; width: 18px; height: 18px; margin-top: 1px; }
.toast--success .toast__icon { color: var(--green); }
.toast--error .toast__icon { color: var(--red); }
.toast--warning .toast__icon { color: var(--yellow); }
.toast__msg { font-size: 13px; }
.toast__title { font-weight: 600; margin-bottom: 1px; }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; } }
@keyframes toast-out { to { opacity: 0; transform: translateX(20px); } }

@media (max-width: 768px) {
  .toasts { bottom: calc(var(--bottomnav-h) + 16px); left: 16px; right: 16px; max-width: none; }
}

/* ---------------- Loading ---------------- */
.spinner {
  width: 22px; height: 22px;
  border: 2.5px solid var(--brd);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.loading-overlay {
  position: fixed; inset: 0; z-index: 8000;
  display: grid; place-items: center;
  background: rgba(0,0,0,0.35);
  backdrop-filter: blur(2px);
}
.loading-overlay[hidden] { display: none; }

.loading-inline {
  display: flex; align-items: center; justify-content: center;
  gap: 10px; padding: 50px; color: var(--ts);
}

/* Skeleton */
.skeleton {
  background: linear-gradient(90deg, var(--bg-e) 25%, var(--bg-h) 37%, var(--bg-e) 63%);
  background-size: 400% 100%;
  animation: shimmer 1.3s ease infinite;
  border-radius: 6px;
}
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: 0 0; } }

/* ---------------- Empty State ---------------- */
.empty {
  display: flex; flex-direction: column; align-items: center;
  gap: 10px; padding: 60px 20px; text-align: center; color: var(--ts);
}
.empty svg { width: 40px; height: 40px; color: var(--tt); }
.empty__title { font-size: 15px; font-weight: 600; color: var(--tp); }
.empty--success svg { color: var(--green); }

/* ---------------- Aufgaben ---------------- */
.aufgaben-header {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; margin-bottom: 14px; flex-wrap: wrap;
}
.aufgaben-header__count {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 24px; height: 24px; padding: 0 7px; border-radius: 999px;
  background: var(--accent-bg); color: var(--accent-h); font-size: 12.5px; font-weight: 700;
}
.aufgaben-list { display: flex; flex-direction: column; gap: 10px; }
.aufgabe-card {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 12px 14px; background: var(--bg-s); border: 1px solid var(--brd);
  border-left: 4px solid var(--ts); border-radius: var(--radius);
}
.aufgabe-card--hoch { border-left-color: var(--red); }
.aufgabe-card--mittel { border-left-color: var(--yellow); }
.aufgabe-card--niedrig { border-left-color: var(--ts); }
.aufgabe-card__icon {
  width: 34px; height: 34px; border-radius: var(--radius-sm);
  display: grid; place-items: center; flex-shrink: 0;
  background: var(--accent-bg); color: var(--accent-h);
}
.aufgabe-card__icon svg { width: 17px; height: 17px; }
.aufgabe-card__body { flex: 1; min-width: 0; }
.aufgabe-card__title { font-size: 13.5px; font-weight: 600; }
.aufgabe-card__sub { font-size: 12px; color: var(--ts); margin-top: 2px; }
.aufgabe-card__meta { display: flex; align-items: center; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.aufgabe-card__due { font-size: 11.5px; color: var(--tt); }
.aufgabe-card__actions { flex-shrink: 0; align-self: center; }

/* ---------------- Tabelle (Basis) ---------------- */
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--brd);
  border-radius: var(--radius);
  background: var(--bg-s);
  box-shadow: var(--shadow-sm);
}
table.data { width: 100%; border-collapse: collapse; font-size: 13px; }
table.data th {
  text-align: left; font-weight: 600; color: var(--ts);
  font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.03em;
  padding: 10px 12px; border-bottom: 1px solid var(--brd);
  position: sticky; top: 0; background: var(--bg-s);
}
table.data td { padding: 11px 12px; border-bottom: 1px solid var(--brd-s); }
table.data tbody tr:hover { background: var(--bg-h); }

/* Gruppen-Header-Zeilen (Objekt / Stockwerk) – nicht klickbar */
table.data tr.objekt-header td {
  padding: 16px 12px 6px;
  font-size: 13px; font-weight: 700; color: var(--tp);
  background: transparent; border-bottom: none;
}
table.data tr.objekt-header:first-child td { padding-top: 12px; }
table.data tr.objekt-header:hover, table.data tr.floor-header:hover { background: transparent; }

table.data tr.floor-header td {
  padding: 8px 12px;
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--ts);
  background: var(--bg-e);
  border-left: 3px solid var(--floor-color, var(--accent));
  border-bottom: 1px solid var(--brd);
}

/* Leerstand-Zeilen */
tr.row--empty td { color: var(--tt); font-style: italic; }
tr.row--empty .chip { font-style: normal; }

/* Hover-Aktionen (Bearbeiten/Archivieren etc.) */
.row-actions { display: flex; gap: 4px; justify-content: flex-end; opacity: 0; transition: opacity var(--t-fast); }
table.data tbody tr:hover .row-actions { opacity: 1; }

/* ---------------- Mobile: Tabelle → Karten ---------------- */
@media (max-width: 768px) {
  .table-wrap { border: none; background: transparent; box-shadow: none; overflow: visible; }
  table.data thead { display: none; }
  table.data, table.data tbody, table.data tr, table.data td { display: block; width: 100%; }
  table.data tbody tr:not(.objekt-header):not(.floor-header) {
    margin-bottom: 10px; border: 1px solid var(--brd); border-radius: var(--radius);
    padding: 4px 12px; background: var(--bg-s);
  }
  table.data tbody tr:not(.objekt-header):not(.floor-header):hover { background: var(--bg-s); }
  table.data tr.floor-header { border-radius: var(--radius-sm); margin-bottom: 6px; overflow: hidden; }
  table.data tr.floor-header td { border-radius: var(--radius-sm); }
  table.data td {
    display: flex; justify-content: space-between; align-items: center;
    gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--brd-s);
    text-align: right;
  }
  table.data tbody tr:not(.objekt-header):not(.floor-header) td:last-child { border-bottom: none; }
  table.data td::before {
    content: attr(data-label);
    color: var(--ts); font-size: 11.5px; font-weight: 600;
    text-align: left; flex-shrink: 0;
  }
  table.data tr.objekt-header td::before,
  table.data tr.floor-header td::before { content: none; }
  table.data tr.objekt-header td, table.data tr.floor-header td { justify-content: flex-start; }
  .row-actions { opacity: 1; justify-content: flex-end; padding-top: 4px; }
}

/* ---------------- Aufgaben-Liste ---------------- */
.aufgaben-list { display: flex; flex-direction: column; gap: 8px; }
.aufgabe-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; background: var(--bg-s); border: 1px solid var(--brd);
  border-radius: var(--radius); cursor: pointer; transition: background var(--t-fast);
}
.aufgabe-item:hover { background: var(--bg-h); }
.aufgabe-item__icon {
  width: 34px; height: 34px; border-radius: var(--radius-sm);
  display: grid; place-items: center; flex-shrink: 0;
  background: var(--accent-bg); color: var(--accent-h);
}
.aufgabe-item__icon svg { width: 17px; height: 17px; }
.aufgabe-item__body { flex: 1; min-width: 0; }
.aufgabe-item__title { font-size: 13.5px; font-weight: 550; }
.aufgabe-item__sub { font-size: 12px; color: var(--ts); margin-top: 2px; }
.aufgabe-item__meta { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex-shrink: 0; }

/* ---------------- Retention-Anzeige (Papierkorb) ---------------- */
.retention { font-weight: 600; }
.retention--warn { color: var(--red); }

/* ---------------- Toggle-Switch (N8N-Tab) ---------------- */
.toggle { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; }
.toggle input { position: absolute; opacity: 0; width: 0; height: 0; }
.toggle__track {
  width: 38px; height: 22px; border-radius: 11px; background: var(--bg-e);
  border: 1px solid var(--brd); position: relative; transition: background var(--t-fast);
  flex-shrink: 0;
}
.toggle__track::after {
  content: ""; position: absolute; top: 2px; left: 2px;
  width: 16px; height: 16px; border-radius: 50%; background: var(--ts);
  transition: transform var(--t-fast), background var(--t-fast);
}
.toggle input:checked + .toggle__track { background: var(--accent-bg); border-color: var(--accent); }
.toggle input:checked + .toggle__track::after { transform: translateX(16px); background: var(--accent-h); }
.toggle__label { font-size: 13px; }

/* ---------------- Dokumente-Liste (Mieter-Modal) ---------------- */
.doc-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.doc-item { display: flex; align-items: center; gap: 10px; padding: 10px 12px; background: var(--bg-e); border-radius: var(--radius-sm); }
.doc-item__icon { color: var(--accent-h); flex-shrink: 0; }
.doc-item__icon svg { width: 18px; height: 18px; }
.doc-item__body { flex: 1; min-width: 0; }
.doc-item__name { font-size: 13px; font-weight: 550; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.doc-item__meta { font-size: 11.5px; color: var(--ts); }
.doc-item__actions { display: flex; gap: 4px; flex-shrink: 0; }

/* ---------------- Berechnete-Werte-Box (Mietverhältnis/Kaution-Tab) ---------------- */
.computed-box {
  grid-column: 1 / -1;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px;
  padding: 14px 16px; background: var(--bg-e); border-radius: var(--radius); margin-top: 4px;
}
.computed-box__item { display: flex; flex-direction: column; gap: 4px; }
.computed-box__label { font-size: 11px; color: var(--ts); text-transform: uppercase; letter-spacing: 0.04em; }
.computed-box__value { font-size: 15px; font-weight: 650; }
@media (max-width: 768px) { .computed-box { grid-template-columns: 1fr; } }

/* Platzhalter-Hinweis für noch nicht gebaute Views */
.placeholder-note {
  border: 1px dashed var(--brd);
  border-radius: var(--radius);
  padding: 26px;
  color: var(--ts);
  background: var(--bg-s);
  display: flex; align-items: center; gap: 12px;
}
.placeholder-note svg { width: 22px; height: 22px; color: var(--accent-h); flex-shrink: 0; }

/* ---------------- Modal / Bottom-Sheet ---------------- */
.modal-overlay {
  position: fixed; inset: 0; z-index: 7000;
  background: rgba(0,0,0,0.5);
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  animation: fade-in var(--t);
}
.modal-overlay[hidden] { display: none; }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

.modal {
  width: 100%; max-width: 720px;
  max-height: calc(100vh - 48px);
  background: var(--bg-s);
  border: 1px solid var(--brd);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column;
  animation: modal-in var(--t);
}
.modal--sm { max-width: 460px; }
@keyframes modal-in { from { opacity: 0; transform: translateY(12px) scale(0.98); } to { opacity: 1; } }

.modal__head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid var(--brd); flex-shrink: 0;
}
.modal__title { font-size: 16px; font-weight: 650; }
.modal__sub { font-size: 12px; color: var(--ts); }

.modal__tabs {
  display: flex; gap: 4px; padding: 0 16px;
  border-bottom: 1px solid var(--brd); flex-shrink: 0;
  overflow-x: auto;
}
.modal__tab {
  padding: 11px 13px; font-size: 13px; font-weight: 550;
  color: var(--ts); border-bottom: 2px solid transparent;
  white-space: nowrap;
}
.modal__tab:hover { color: var(--tp); }
.modal__tab.active { color: var(--accent-h); border-bottom-color: var(--accent); }

.modal__body { padding: 20px; overflow-y: auto; flex: 1; }
.modal__footer {
  display: flex; align-items: center; justify-content: flex-end; gap: 10px;
  padding: 14px 20px; border-top: 1px solid var(--brd); flex-shrink: 0;
}
.modal__footer .spacer { flex: 1; }

/* Bottom-Sheet auf Mobile (von unten, wie iOS) */
@media (max-width: 768px) {
  .modal-overlay { padding: 0; align-items: flex-end; }
  .modal {
    max-width: 100%;
    max-height: 92vh;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    animation: sheet-in 260ms cubic-bezier(0.32, 0.72, 0, 1);
  }
  .modal__head::before {
    content: ""; position: absolute; top: 8px; left: 50%; transform: translateX(-50%);
    width: 38px; height: 4px; border-radius: 2px; background: var(--brd);
  }
  .modal__head { position: relative; padding-top: 20px; }
  .modal__footer { padding-bottom: calc(14px + env(safe-area-inset-bottom, 0)); }
}
@keyframes sheet-in { from { transform: translateY(100%); } to { transform: translateY(0); } }

/* ---------------- Segmented Control (Zähler: FS31/FS25) ---------------- */
.segmented {
  display: inline-flex; flex-wrap: wrap; background: var(--bg-e); border: 1px solid var(--brd);
  border-radius: var(--radius-sm); padding: 3px; gap: 2px;
}
.segmented__btn {
  padding: 7px 16px; border-radius: 6px; font-size: 13px; font-weight: 550;
  color: var(--ts); transition: background var(--t-fast), color var(--t-fast);
}
.segmented__btn:hover { color: var(--tp); }
.segmented__btn.active { background: var(--bg-s); color: var(--tp); box-shadow: var(--shadow-sm); }

/* ---------------- Zähler-Übersicht ---------------- */
.zaehler-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 14px;
}
.zaehler-card {
  background: var(--bg-s); border: 1px solid var(--brd); border-radius: var(--radius);
  box-shadow: var(--shadow-sm); padding: 16px; display: flex; flex-direction: column; gap: 12px;
}
.zaehler-card__head { display: flex; align-items: center; gap: 10px; }
.zaehler-card__icon {
  width: 36px; height: 36px; border-radius: var(--radius-sm); flex-shrink: 0;
  display: grid; place-items: center;
}
.zaehler-card__icon svg { width: 18px; height: 18px; }
.zaehler-card__icon--strom { background: var(--yellow-bg); color: var(--yellow); }
.zaehler-card__icon--gas { background: var(--red-bg); color: var(--red); }
.zaehler-card__icon--wasser { background: var(--cyan-bg); color: var(--cyan); }
.zaehler-card__name { font-size: 14px; font-weight: 600; }
.zaehler-card__nr { font-size: 11.5px; color: var(--ts); }
.zaehler-card__stats {
  display: flex; flex-direction: column; gap: 6px;
  padding-top: 10px; border-top: 1px solid var(--brd-s);
}
.zaehler-card__stat { display: flex; justify-content: space-between; font-size: 12.5px; gap: 8px; }
.zaehler-card__stat-label { color: var(--ts); }
.zaehler-card__stat-value { font-weight: 600; text-align: right; }

/* ---------------- Zähler-KPI-Kacheln ---------------- */
.zaehler-card__kpis {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
  padding-top: 10px; border-top: 1px solid var(--brd-s);
}
.kpi-tile {
  background: var(--bg); border: 1px solid var(--brd-s); border-radius: var(--radius-sm);
  padding: 8px 10px; display: flex; flex-direction: column; gap: 2px;
}
.kpi-tile__label { font-size: 11px; color: var(--ts); }
.kpi-tile__value { font-size: 14px; font-weight: 700; display: flex; align-items: center; gap: 4px; }
.kpi-tile__sub { font-size: 11px; color: var(--tt); }
.kpi-tile__value svg { width: 14px; height: 14px; }
.kpi-tile--green .kpi-tile__value { color: var(--green); }
.kpi-tile--red .kpi-tile__value { color: var(--red); }

/* ---------------- Zähler-Verlaufsdiagramm ---------------- */
.zaehler-chart-wrap { position: relative; height: 200px; margin-bottom: 10px; }

/* ---------------- Accordion (Verlauf) ---------------- */
.accordion__toggle {
  display: flex; align-items: center; gap: 8px; width: 100%;
  padding-top: 10px; border-top: 1px solid var(--brd-s);
  font-size: 12.5px; font-weight: 600; color: var(--ts);
}
.accordion__toggle:hover { color: var(--tp); }
.accordion__toggle .chip { margin-left: auto; }
.accordion__chevron svg { width: 14px; height: 14px; transition: transform var(--t-fast); }
.accordion__toggle.open .accordion__chevron svg { transform: rotate(180deg); }
.accordion__content[hidden] { display: none; }
.accordion__content { padding-top: 8px; }
.ablesung-list { display: flex; flex-direction: column; gap: 4px; max-height: 240px; overflow-y: auto; }
.ablesung-row {
  display: flex; flex-direction: column; gap: 3px;
  font-size: 11.5px; padding: 7px 8px; border-radius: 6px;
}
.ablesung-row:hover { background: var(--bg-e); }
.ablesung-row__top, .ablesung-row__bottom { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.ablesung-row__date { color: var(--ts); }
.ablesung-row__stand { font-weight: 600; }
.ablesung-row__verbrauch { color: var(--ts); }
.ablesung-row__kosten { font-weight: 600; }

/* ---------------- Neue-Ablesung-Wizard ---------------- */
.wizard-steps { display: flex; align-items: center; margin-bottom: 20px; }
.wizard-step { display: flex; align-items: center; flex: 1; }
.wizard-step:last-child { flex: 0; }
.wizard-step__num {
  width: 24px; height: 24px; border-radius: 50%; flex-shrink: 0;
  display: grid; place-items: center; font-size: 11px; font-weight: 700;
  background: var(--bg-e); color: var(--ts); transition: background var(--t-fast), color var(--t-fast);
}
.wizard-step.active .wizard-step__num { background: var(--accent); color: #fff; }
.wizard-step.done .wizard-step__num { background: var(--accent-bg); color: var(--accent-h); }
.wizard-step__line { flex: 1; height: 2px; background: var(--brd); margin: 0 6px; }
.wizard-step.done .wizard-step__line { background: var(--accent); }

.choice-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.choice-card {
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  padding: 26px 16px; border: 1px solid var(--brd); border-radius: var(--radius);
  background: var(--bg-e); text-align: center;
  transition: border-color var(--t-fast), background var(--t-fast);
}
.choice-card:hover { border-color: var(--accent); background: var(--accent-bg); }
.choice-card svg { width: 26px; height: 26px; color: var(--accent-h); }
.choice-card__label { font-size: 13.5px; font-weight: 600; }
@media (max-width: 768px) { .choice-grid { grid-template-columns: 1fr; } }

/* ---------------- Mieter-Wizard: Zimmer-Auswahl (Schritt 2) ---------------- */
.room-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: 8px; }
.room-tile {
  display: flex; align-items: center; justify-content: center;
  padding: 16px 8px; border: 1px solid var(--brd); border-radius: var(--radius-sm);
  background: var(--bg-e); font-size: 13.5px; font-weight: 600; cursor: pointer;
  transition: border-color var(--t-fast), background var(--t-fast);
}
.room-tile:hover { border-color: var(--accent); background: var(--accent-bg); }
.room-tile--occupied {
  cursor: not-allowed; opacity: 0.45; color: var(--ts);
}
.room-tile--occupied:hover { border-color: var(--brd); background: var(--bg-e); }

.zaehler-pick-list { display: flex; flex-direction: column; gap: 6px; }
.zaehler-pick-group {
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--ts); margin: 14px 0 4px;
}
.zaehler-pick-group:first-child { margin-top: 0; }
.zaehler-pick-item {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px;
  border: 1px solid var(--brd); border-radius: var(--radius-sm);
  transition: background var(--t-fast), border-color var(--t-fast);
}
.zaehler-pick-item:hover { background: var(--bg-h); border-color: var(--accent); }
.zaehler-pick-item__meta { font-size: 11.5px; color: var(--ts); }

.ocr-photo { width: 100%; max-height: 200px; object-fit: contain; border-radius: var(--radius); background: var(--bg-e); }
.ocr-confidence { display: flex; align-items: center; gap: 8px; font-size: 12.5px; }
.ocr-confidence svg { width: 16px; height: 16px; }

.success-box { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 30px 10px; text-align: center; }
.success-box__icon {
  width: 56px; height: 56px; border-radius: 50%; background: var(--green-bg); color: var(--green);
  display: grid; place-items: center;
}
.success-box__icon svg { width: 28px; height: 28px; }
.success-box__title { font-size: 16px; font-weight: 650; }

/* ---------------- Mieteinnahmen: Zahlungsmatrix ---------------- */
.pay-symbol {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; border-radius: 6px;
  font-size: 13px; font-weight: 700;
}
.pay-symbol.pay--ok { color: var(--green); background: var(--green-bg); }
.pay-symbol.pay--open { color: var(--red); background: var(--red-bg); }
.pay-symbol.pay--none { color: var(--tt); }

@media (max-width: 768px) {
  table.data td[data-label] .pay-symbol { margin-left: auto; }
}
