/**
 * Projekt: Picco & Becker CRM
 * Komponente: assets/app.css
 * Version: v2.3
 * Datum: 2026-07-04
 * Copyright: Patrick Picco / die webfabrik GmbH
 *
 * Changelog:
 *   v2.3 - 2026-07-04 - PB-038: .stats-grid-8 (8 KPI in 4 Spalten) für Dashboard-Redesign
 *   v2.2 - 2026-07-04 - PB-038: .row-done (erledigte Zeilen ausgegraut) für Aufgaben-Redesign
 *   v2.1 - 2026-07-04 - PB-038: Redesign-Angleichung Live (CRM v4.4) — orange KI-Farbsystem
 *          (--ki/--ki-deep/--ki-soft), Button-Farbregel (.kiprim/.kiact/.accout/.primary),
 *          KI-Chip 118px, KPI-Karten getönt (--surface-alt + Akzent-Toplinie)
 *   v2.0 - 2026-06-28 - PB-024: Chip klein 90x24 (.chip-status.sm); Button-Gruppe gleichmaessig (.btn-group); Timer Pause/Stopp v2.5 Styles
 *   v1.9 - 2026-06-28 - PB-021: rating-head full-width (Score-neu-Button rechts)
 *   v1.8 - 2026-06-28 - PB-021: Sidebar-Kopf Variante C (Akzentblock, weiss, zweizeilig)
 *   v1.7 - 2026-06-28 - PB-021: M12 Bewertung (score-pill/badge/good/mid/bad, Sterne-Widget)
 *   v1.6 - 2026-06-28 - PB-021: .chip-status (fix 120x28px) fuer echte Status-Chips; .tag bleibt textbreit fuer Inline-Labels
 *   v1.5 - 2026-06-28 - PB-020: Reiter portalweit fixe Breite min-width 160px; Ausreisser via .vtab-wide
 *   v1.4 - 2026-06-28 - PB-020: Reiter-System v2.3 Karteikasten (.vtabs/.vtab/.vtabcard), --accent-mute; ersetzt flaches .tabs/.tab-btn
 *   v1.3 - 2026-06-26 - M3: Aufgaben (Asana-Layout, Feed, DeepL-Box, Foto-Galerie)
 *   v1.2 - 2026-06-26 - M2: Mieter-Toolbar (symmetrische Selects 180px)
 *   v1.1 - 2026-06-26 - M1: Toolbar, Key-Stats-Bar, Tabs, Def-Grid, Provider-Cards
 *   v1.0 - 2026-06-26 - Erstfassung M0: Design-System (Login + Layout-Shell)
 */

:root {
  --accent: #3f6b97;
  --accent-hover: #335678;
  --accent-soft: #eaf0f6;
  --accent-mute: #b9c8d8;
  --danger: #b05a3c;

  /* KI-Farbsystem (orange, PB-038) — orange = KI ausschließlich */
  --ki: #e8863d;
  --ki-deep: #c96e2a;
  --ki-soft: #fdf1e5;
  --accent-deep: #335678;
  --ok: #3e8e5a;
  --ok-soft: #e7f2ec;
  --warn: #c0392b;
  --warn-soft: #f8ebe9;

  --bg: #f5f3ef;
  --surface: #fff;
  --surface-alt: #fafaf8;

  --border: #e0ddd8;
  --border-card: #e8e4de;
  --border-inner: #efece7;

  --text: #1d2327;
  --text-2: #44443f;
  --text-3: #6b6b64;
  --muted: #8a8a82;
  --warning: #9c6a00;
  --success: #1e5a2a;

  --radius: 12px;
  --topbar-h: 56px;
  --sidebar-w: 240px;
  --content-w: 960px;
  --max-w: 1200px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  font-size: 15px;
  line-height: 1.5;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }

/* ---------- Buttons (Fixbreiten-System) ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 36px;
  width: 140px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text-2);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background .12s, border-color .12s, color .12s;
}
.btn:hover { background: var(--surface-alt); }
.btn.sm { height: 28px; width: 100px; font-size: 13px; }
.btn.lg { height: 40px; width: 180px; font-size: 15px; }
.btn.xl { width: 220px; }
.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: #fff; }
.btn-ghost { width: auto; padding: 0 12px; border-color: transparent; background: transparent; }
.btn-ghost:hover { background: var(--accent-soft); }

/* Button-Gruppe (PB-024): fuellt Breite gleichmaessig, alle Buttons gleich gross.
   Feste .btn-Breiten werden in der Gruppe per flex:1 ueberschrieben. */
.btn-group { display: flex; gap: 10px; width: 100%; }
.btn-group > .btn { flex: 1 1 0; width: auto; min-width: 0; }

/* ---------- Forms ---------- */
.field { display: block; margin-bottom: 1rem; }
.field-label { display: block; font-size: 13px; color: var(--text-3); margin-bottom: 6px; }
.input {
  width: 100%;
  height: 36px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font-size: 14px;
}
.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

/* ---------- Flash ---------- */
.flash {
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 14px;
  margin-bottom: 1rem;
  border: 1px solid var(--border);
}
.flash-success { background: #eef6ef; border-color: #cfe3d2; color: var(--success); }
.flash-error { background: #f8efe9; border-color: #ecd2c4; color: var(--danger); }
.flash-info { background: var(--accent-soft); border-color: #cfdcea; color: var(--accent-hover); }

/* ---------- Auth ---------- */
.auth-body { display: flex; min-height: 100vh; align-items: center; justify-content: center; }
.auth-wrap { width: 100%; max-width: 380px; padding: 1.5rem; }
.auth-card {
  background: var(--surface);
  border: 1px solid var(--border-card);
  border-radius: var(--radius);
  padding: 2rem;
  box-shadow: 0 1px 3px rgba(0,0,0,.04);
}
.auth-brand { text-align: center; margin-bottom: 1.5rem; }
.auth-logo {
  width: 56px; height: 56px; margin: 0 auto .75rem;
  display: flex; align-items: center; justify-content: center;
  background: var(--accent); color: #fff;
  border-radius: var(--radius); font-weight: 700; font-size: 18px;
}
.auth-title { font-size: 18px; font-weight: 600; }
.auth-subtitle { font-size: 13px; color: var(--muted); }
.auth-submit { width: 100%; margin-top: .5rem; }
.auth-foot { text-align: center; font-size: 12px; color: var(--muted); margin-top: 1.25rem; }

/* ---------- App-Shell ---------- */
.app-shell { display: flex; min-height: 100vh; max-width: var(--max-w); margin: 0 auto; }

.sidebar {
  width: var(--sidebar-w);
  flex: 0 0 var(--sidebar-w);
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 1rem .75rem;
}
.sidebar-brand { display: flex; align-items: center; gap: 10px; padding: .25rem .5rem 1rem; }
.sidebar-logo {
  width: 34px; height: 34px; border-radius: 8px;
  background: var(--accent); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px;
}
.sidebar-name { font-weight: 600; font-size: 14px; }

/* Sidebar-Kopf Variante C (PB-021): Akzentblock, weisse Schrift, zweizeilig */
.sidebar-brand-c {
  display: block; padding: .85rem 1rem; margin: 0 0 1rem;
  background: var(--accent); border-radius: 10px;
  box-shadow: 0 2px 6px rgba(63,107,151,.18);
}
.sidebar-brand-c .brand-name {
  color: #fff; font-weight: 700; font-size: 16px; letter-spacing: .01em; line-height: 1.15;
}
.sidebar-brand-c .brand-sub {
  color: rgba(255,255,255,.78); font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .14em; margin-top: 2px;
}
.sidebar-section { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding: 1rem .5rem .35rem; }

/* Gruppen-Überschrift (Format B: blauer Punkt + Text + auslaufende Linie) */
.nav-group-title { display: flex; align-items: center; gap: .5rem; padding: 1rem .55rem .5rem; }
.nav-group-title::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); flex: 0 0 6px; }
.nav-group-title span { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); font-weight: 700; white-space: nowrap; }
.nav-group-title::after { content: ""; flex: 1; height: 1px; background: var(--border-card); }

.sidebar-nav { display: flex; flex-direction: column; gap: 4px; }

/* Buttons – Stufe 3: eigene Fläche, Akzent-Hover mit Anheben */
.nav-item {
  display: flex; align-items: center; gap: .65rem;
  padding: 8px 12px; border-radius: 9px;
  color: var(--text-2); font-size: 14px; font-weight: 500;
  background: var(--surface-alt); border: 1px solid var(--border-inner);
  position: relative; text-decoration: none; line-height: 1;
  transition: transform .12s, background .12s, box-shadow .12s, color .12s, border-color .12s;
}
.nav-item:hover {
  background: var(--accent-soft); border-color: #c5d4e6; color: var(--accent);
  transform: translateY(-1px); box-shadow: 0 3px 10px rgba(63,107,151,.14);
}
.nav-ico { width: 18px; height: 18px; flex: 0 0 18px; opacity: .75; transition: opacity .12s; }
.nav-item:hover .nav-ico { opacity: 1; }
.nav-label { flex: 1; }

/* Aktiv = S6: Vollfläche + Schatten + weißer Marker-Punkt rechts */
.nav-item.is-active {
  background: var(--accent); color: #fff; font-weight: 600; border-color: transparent;
  box-shadow: 0 3px 12px rgba(63,107,151,.32);
}
.nav-item.is-active .nav-ico { opacity: 1; }
.nav-item.is-active::after {
  content: ""; position: absolute; right: .7rem; width: 6px; height: 6px; border-radius: 50%;
  background: #fff; box-shadow: 0 0 0 3px rgba(255,255,255,.18);
}

/* Badge (offene Anträge) */
.nav-badge {
  margin-left: auto; margin-right: .8rem; font-size: 10px; font-weight: 600;
  background: #f5ecd9; color: var(--warning); border-radius: 9px; padding: 1px 6px;
}
.nav-item.is-active .nav-badge { background: rgba(255,255,255,.22); color: #fff; }

.app-main { flex: 1; display: flex; flex-direction: column; min-width: 0; }

.topbar {
  height: var(--topbar-h);
  flex: 0 0 var(--topbar-h);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 1.5rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.topbar-left { display: flex; align-items: center; }
.obj-switch { display: flex; align-items: center; gap: 8px; }
.obj-switch-label { font-size: 12px; color: var(--text-3); }
.obj-switch-select {
  height: 40px; min-width: 340px;
  padding: 0 12px; border: 1px solid var(--border);
  border-radius: 8px; background: var(--surface); color: var(--text);
  font-size: 14px;
}
.topbar-right { display: flex; align-items: center; gap: 12px; }
.topbar-user { font-size: 14px; font-weight: 500; }
.topbar-role { font-size: 11px; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); background: var(--surface-alt); padding: 2px 8px; border-radius: 20px; }
.topbar-logout { margin: 0; }

.content { flex: 1; padding: 2rem; max-width: var(--content-w); width: 100%; }

.app-footer { padding: 1rem 2rem; font-size: 12px; color: var(--muted); border-top: 1px solid var(--border); }

/* ---------- Page / Cards ---------- */
.page-head { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 1.5rem; }
.page-title { font-size: 22px; font-weight: 600; margin: 0; }
.page-sub { margin: 4px 0 0; font-size: 14px; color: var(--text-3); }

.stats-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem;
  align-items: stretch; margin-bottom: 1.5rem;
}
.stat-card {
  background: var(--surface); border: 1px solid var(--border-card);
  border-radius: var(--radius); padding: 1.25rem 1.5rem;
}
.stat-value { font-size: 28px; font-weight: 700; color: var(--accent-hover); }
.stat-label { font-size: 13px; color: var(--text-3); margin-top: 2px; }

.card {
  background: var(--surface); border: 1px solid var(--border-card);
  border-radius: var(--radius); padding: 1.75rem 2rem;
}
.card-head { margin-bottom: 1rem; }
.card-title { font-size: 16px; font-weight: 600; margin: 0; }
.muted { color: var(--muted); }

.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th {
  text-align: left; font-weight: 600; color: var(--text-3);
  padding: 8px 10px; border-bottom: 1px solid var(--border-inner); font-size: 13px;
}
.table td { padding: 10px; border-bottom: 1px solid var(--border-inner); }
.table tbody tr:last-child td { border-bottom: none; }

/* ---------- Error ---------- */
.error-body { display: flex; min-height: 100vh; align-items: center; justify-content: center; }
.error-wrap { text-align: center; }
.error-code { font-size: 56px; font-weight: 700; color: var(--accent); }
.error-text { font-size: 16px; color: var(--text-2); margin: .5rem 0 1.5rem; }

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
  .app-shell { flex-direction: column; }
  .sidebar { width: 100%; flex-basis: auto; border-right: none; border-bottom: 1px solid var(--border); }
  .obj-switch-select { min-width: 0; width: 200px; }
  .content { padding: 1.25rem; }
}
@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
  .topbar { flex-wrap: wrap; height: auto; padding: .75rem 1rem; gap: .5rem; }
}

/* ===== M1 Objekte (v1.1 - 2026-06-26) ===== */
[x-cloak] { display: none !important; }

.page-actions { display: flex; gap: .75rem; }

.toolbar { display: flex; gap: .75rem; margin-bottom: 1.25rem; }
.toolbar-search { flex: 0 0 auto; }
.toolbar-input { width: 320px; }

.card-flush { padding: 0; overflow: hidden; }
.table-rows th { padding: 12px 16px; }
.table-rows td { padding: 12px 16px; }
.table .num { text-align: right; white-space: nowrap; }
.row-link { cursor: pointer; transition: background .1s; }
.row-link:hover { background: var(--surface-alt); }
.strong { font-weight: 600; }

.tag {
  display: inline-block; font-size: 12px; padding: 2px 9px;
  border-radius: 20px; background: var(--surface-alt);
  color: var(--text-3); border: 1px solid var(--border-inner);
}
.tag-ok { background: #eef6ef; color: var(--success); border-color: #cfe3d2; }
.tag-warn { background: #fdf6e9; color: var(--warning); border-color: #ecdcbf; }

/* Status-Chips (PB-021): nur echte Status, fix 120x28px. NICHT fuer Inline-Labels (.tag bleibt textbreit). */
.chip-status {
  display: inline-flex; align-items: center; justify-content: center;
  width: 120px; height: 28px; box-sizing: border-box;
  font-size: 12px; padding: 0 8px; border-radius: 20px;
  background: var(--surface-alt); color: var(--text-3);
  border: 1px solid var(--border-inner);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
/* Chip klein (PB-024): fuer enge Spalten/Listen */
.chip-status.sm { width: 90px; height: 24px; font-size: 11px; padding: 0 6px; }

/* Key-Stats-Bar */
.keystats {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px;
  background: var(--border-card); border: 1px solid var(--border-card);
  border-radius: var(--radius); overflow: hidden; margin-bottom: 1.5rem;
}
.keystat { background: var(--surface); padding: 1rem 1.25rem; }
.keystat-value { font-size: 22px; font-weight: 700; color: var(--accent-hover); }
.keystat-label { font-size: 12px; color: var(--text-3); margin-top: 2px; }

/* ===== Reiter-System v2.3 — Karteikasten (PB-019, portalweiter Standard) ===== */
/* Container: Reiterzeile. position:relative fuer gestaffelte z-index-Schichtung. */
.vtabs { display: flex; align-items: flex-end; position: relative; padding-left: 0; height: 46px; }
.vtab {
  height: 44px; padding: 0 22px;
  min-width: 160px;            /* portalweit einheitliche Reiter-Breite (laengster Normalbegriff "Objekt-Zuordnung") */
  box-sizing: border-box;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 500;
  border: none; background: transparent;
  border-radius: 11px 11px 0 0; cursor: pointer; white-space: nowrap; position: relative;
  transition: color .12s, background .12s;
}
/* Ausnahme: extrem langes Label sprengt die Norm-Breite, bleibt einzeiliger Ausreisser */
.vtab.vtab-wide { min-width: 0; }
/* INAKTIV = Karte dahinter: grau, abgesenkt, nach rechts gestaffelt, hinter der aktiven */
.vtab:not(.is-active) {
  background: var(--surface-alt); color: var(--text-3);
  border: 1px solid var(--border-card); border-bottom: none;
  margin-left: -14px;          /* schiebt unter die vorhergehende Karte -> Staffelung */
  padding-left: 30px;          /* Text nicht unter die Ueberlappung */
  height: 40px;                /* etwas niedriger -> sitzt tiefer */
  box-shadow: 2px -1px 3px rgba(40,50,60,.06);
}
.vtab:not(.is-active):first-child { margin-left: 0; padding-left: 22px; }
.vtab:not(.is-active):hover { background: var(--accent-soft); color: var(--accent); }
/* z-index-Treppe: je weiter rechts, desto weiter hinten */
.vtab:nth-child(1) { z-index: 6; }
.vtab:nth-child(2) { z-index: 5; }
.vtab:nth-child(3) { z-index: 4; }
.vtab:nth-child(4) { z-index: 3; }
.vtab:nth-child(5) { z-index: 2; }
/* AKTIV = vorderste, vollstaendige Karte: Akzent-Outline, ganz vorne, kein linker Versatz */
.vtab.is-active {
  background: var(--surface); color: var(--accent-hover); font-weight: 600;
  border: 1px solid var(--accent-mute); border-bottom: none;
  height: 44px; z-index: 10; margin-left: 0;
  box-shadow: 2px -1px 4px rgba(40,50,60,.07);
}
/* deckt die Akzent-Kante der Karte direkt unter dem aktiven Reiter ab -> verschmilzt nahtlos */
.vtab.is-active::after {
  content: ""; position: absolute; left: 1px; right: 1px; bottom: -1px; height: 2px; background: var(--surface); z-index: 11;
}
/* Karte = Fortsetzung des aktiven Reiters: gleiche Akzent-Outline, linke Kante fluchtet */
.vtabcard {
  background: var(--surface); border: 1px solid var(--accent-mute);
  border-radius: 0 12px 12px 12px; position: relative; z-index: 9; margin-top: -1px;
  padding: 1.75rem 2rem; box-shadow: 0 2px 6px rgba(40,50,60,.07);
}
/* Innere .card im Karteikasten nicht doppelt rahmen.
   Tab-Container sind direkte [x-show]-Kinder (section ODER div).
   Greift: (a) Tab-Container ist selbst .card, (b) .card als Kind des Tab-Containers. */
.vtabcard > [x-show].card,
.vtabcard > [x-show] > .card,
.vtabcard > .card {
  border: none; box-shadow: none; padding: 0; background: transparent;
}
/* card-flush (randlose Tabellen-Karten) behalten Overflow-Clipping */
.vtabcard > [x-show] > .card.card-flush,
.vtabcard > [x-show].card.card-flush { overflow: hidden; }
/* provider-card behaelt eigene Karten-Optik (abgesetzte Einheit im Karteikasten) */
.vtabcard > [x-show] > .card.provider-card {
  border: 1px solid var(--border-card); box-shadow: none;
  padding: 1.25rem 1.5rem; background: var(--surface-alt);
}
.vtabcard > [x-show] > .card.provider-card + .provider-card { margin-top: 1rem; }
/* Abstaende zwischen mehreren Bloecken innerhalb eines Tabs */
.vtabcard > [x-show] > .card + .card,
.vtabcard > [x-show] > .card + section,
.vtabcard > [x-show] > .toolbar + .card,
.vtabcard > [x-show] > section { margin-top: 1.25rem; }

/* Definition-Grid (Stammdaten) */
.def-grid { display: grid; grid-template-columns: 200px 1fr; gap: 12px 1.5rem; }
.def-label { color: var(--text-3); font-size: 14px; }
.def-value { font-size: 14px; }

.authorship {
  margin-top: 1.5rem; padding-top: 1rem; border-top: 1px solid var(--border-inner);
  font-size: 12px; color: var(--muted);
}

/* Provider-Cards */
.card-head-bar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1rem; }
.provider-card { margin-bottom: 1rem; }
.provider-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; margin-bottom: .5rem; }
.provider-name { font-weight: 600; font-size: 15px; margin-right: 8px; }
.provider-comp { font-size: 14px; color: var(--text-2); white-space: nowrap; }
.provider-contact { display: flex; flex-wrap: wrap; gap: 1rem; font-size: 13px; color: var(--text-3); margin-bottom: .5rem; }
.provider-logs { margin-top: .75rem; padding-top: .75rem; border-top: 1px solid var(--border-inner); }
.provider-logs-title { font-size: 12px; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); margin-bottom: .5rem; }
.log-entry { padding: .5rem 0; }
.log-meta { font-size: 12px; color: var(--muted); }
.log-body { font-size: 14px; color: var(--text-2); }

@media (max-width: 768px) {
  .keystats { grid-template-columns: repeat(2, 1fr); }
  .def-grid { grid-template-columns: 1fr; gap: 4px; }
  .def-label { font-weight: 600; margin-top: .5rem; }
  .toolbar-input { width: 100%; }
}

/* ===== M2 Mieter (v1.2 - 2026-06-26) ===== */
.toolbar-grid { display: grid; grid-template-columns: 1fr 180px 180px; gap: .75rem; align-items: center; }
.toolbar-select { width: 180px; }
@media (max-width: 768px) {
  .toolbar-grid { grid-template-columns: 1fr; }
  .toolbar-select { width: 100%; }
}

/* ===== M3 Aufgaben (v1.3 - 2026-06-26) ===== */
.keystats-3 { grid-template-columns: repeat(3, 1fr); }
.toolbar-grid-4 { display: grid; grid-template-columns: 1fr 180px 180px 180px; gap: .75rem; align-items: center; }
.tag-info { background: var(--accent-soft); color: var(--accent-hover); border-color: #cfdcea; }
.overdue { color: var(--danger); font-weight: 600; }

/* Asana-Layout: Mittelspalte + Sidebar */
.task-layout { display: grid; grid-template-columns: 1fr 300px; gap: 1.25rem; align-items: start; }
.task-main { display: flex; flex-direction: column; gap: 1.25rem; min-width: 0; }
.task-side { display: flex; flex-direction: column; gap: 1rem; position: sticky; top: 1rem; }
.task-desc { font-size: 14px; color: var(--text-2); line-height: 1.6; }

.side-row { display: flex; justify-content: space-between; gap: 1rem; padding: 8px 0; border-bottom: 1px solid var(--border-inner); }
.side-row:last-child { border-bottom: none; }
.side-label { font-size: 13px; color: var(--text-3); }
.side-value { font-size: 14px; text-align: right; }
.authorship-side { margin-top: 0; padding: 1rem 1.25rem; border-top: none; background: var(--surface-alt); border-radius: var(--radius); line-height: 1.5; }

/* Übersetzungs-Box (DeepL) */
.translation-box { margin-top: 1rem; padding: .75rem 1rem; background: var(--accent-soft); border: 1px solid #cfdcea; border-radius: 8px; }
.translation-inline { margin-top: .5rem; }
.translation-head { font-size: 11px; text-transform: uppercase; letter-spacing: .03em; color: var(--accent-hover); margin-bottom: .35rem; }
.translation-body { font-size: 14px; color: var(--text-2); }

/* Foto-Galerie */
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: .75rem; }
.photo-thumb { display: block; aspect-ratio: 1; border-radius: 8px; overflow: hidden; border: 1px solid var(--border-card); }
.photo-thumb img { width: 100%; height: 100%; object-fit: cover; }

/* Aktivitäts-Feed (Asana) */
.feed { display: flex; flex-direction: column; gap: 1rem; }
.feed-item { display: flex; gap: 12px; }
.feed-avatar { flex: 0 0 32px; width: 32px; height: 32px; border-radius: 50%; background: var(--accent); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 600; }
.feed-content { flex: 1; min-width: 0; }
.feed-meta { display: flex; gap: 8px; align-items: baseline; margin-bottom: 2px; }
.feed-author { font-weight: 600; font-size: 14px; }
.feed-time { font-size: 12px; color: var(--muted); }
.feed-body { font-size: 14px; color: var(--text-2); }
.feed-system { font-size: 13px; color: var(--text-3); font-style: italic; }

.comment-form { display: flex; gap: .75rem; align-items: flex-start; margin-top: 1.25rem; padding-top: 1.25rem; border-top: 1px solid var(--border-inner); }
.comment-input { flex: 1; resize: vertical; min-height: 38px; padding: 8px 12px; }

@media (max-width: 1024px) {
  .keystats-3 { grid-template-columns: repeat(3, 1fr); }
  .task-layout { grid-template-columns: 1fr; }
  .task-side { position: static; }
}
@media (max-width: 768px) {
  .toolbar-grid-4 { grid-template-columns: 1fr; }
  .keystats-3 { grid-template-columns: 1fr; }
}

/* ===== Platzhalter-Seiten (v1.8 - 2026-06-26) ===== */
.placeholder-box { text-align: center; padding: 2.5rem 1rem; }
.placeholder-icon { font-size: 32px; margin-bottom: .75rem; opacity: .7; }
.placeholder-text { font-size: 15px; color: var(--text-3); margin: 0; }

/* ===== M5 Mietverträge Klausel-Builder (v2.0 - 2026-06-26) ===== */
.terms-money { margin-bottom: 1.5rem; }
.clause-h { font-size: 15px; font-weight: 600; margin: 1.5rem 0 .5rem; }
.clause-intro { margin-top: 0; font-size: 13px; }
.clause-list { padding-left: 0; list-style: none; counter-reset: none; margin: 0 0 1rem; }
.clause-item { padding: .75rem 1rem; border: 1px solid var(--border-inner); border-radius: 8px; margin-bottom: .5rem; }
.clause-base { background: var(--surface-alt); }
.clause-title { font-weight: 600; font-size: 14px; margin-bottom: .25rem; }
.clause-body { font-size: 14px; color: var(--text-2); }
.clause-options { display: flex; flex-direction: column; gap: .5rem; }
.clause-option { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; padding: .5rem .75rem; border: 1px solid var(--border-inner); border-radius: 8px; }
.clause-option input { margin-top: 3px; }
.clause-note { font-size: 13px; margin-top: .75rem; }

/* ===== Formulare (v2.1 - 2026-06-26) ===== */
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem 1.5rem; }
.form-row { display: flex; flex-direction: column; gap: 6px; }
.form-row-wide { grid-column: 1 / -1; }
.form-label { font-size: 13px; color: var(--text-3); }
.form-row textarea.input { height: auto; padding: 8px 12px; resize: vertical; }
.danger-zone { margin-top: 1.25rem; border-color: #ecd2c4; }
.btn-danger { width: auto; padding: 0 16px; background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger:hover { background: #9a4c33; border-color: #9a4c33; }
@media (max-width: 768px) { .form-grid { grid-template-columns: 1fr; } }

/* ===== Inline-Formulare (v2.3 - 2026-06-26) ===== */
.form-check { flex-direction: row; align-items: center; gap: 8px; }
.form-check input { width: auto; }
.form-actions { margin-top: 1rem; display: flex; justify-content: flex-end; }

/* ===== M4 Zeiterfassung (v2.4 - 2026-06-26) ===== */
.timer-card { text-align: center; padding: 2rem; }
.timer-label { font-size: 13px; color: var(--text-3); text-transform: uppercase; letter-spacing: .05em; }
.timer-task { font-size: 20px; font-weight: 600; margin: .25rem 0; }
.timer-prop { color: var(--text-2); margin-bottom: 1rem; }
.timer-clock { font-size: 48px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--accent); margin: 1rem 0; }
.timer-started { font-size: 13px; color: var(--text-3); margin-bottom: 1.5rem; }
.timer-stop { display: inline-flex; align-items: center; justify-content: center; }
/* Timer Pause/Stopp v2.5 (PB-024) */
.timer-clock.is-paused { color: var(--muted); }
.timer-actions { display: flex; gap: 10px; justify-content: center; }
.timer-pausehint { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--warning); background: #faeeda; border-radius: 8px; padding: 6px 14px; margin-bottom: .75rem; }
.timer-confirm { background: var(--surface); border: 1px solid var(--border-card); border-radius: var(--radius); padding: 1.75rem 2rem; text-align: center; margin-top: 1rem; }
.timer-confirm-title { font-size: 18px; font-weight: 500; color: var(--text); }
.timer-confirm-text { font-size: 14px; color: var(--text-3); margin-top: 8px; line-height: 1.6; }
.seg { display: flex; gap: 0; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.seg-btn { flex: 1; padding: 10px; border: none; background: var(--surface); cursor: pointer; font-size: 14px; }
.seg-btn.is-active { background: var(--accent); color: #fff; }
.mat-num { text-align: right; max-width: 110px; }
.sig-wrap { position: relative; margin: .75rem 0; }
.sig-canvas { width: 100%; max-width: 600px; height: 180px; border: 1px dashed var(--border); border-radius: 8px; background: #fff; touch-action: none; }
.sig-clear { position: absolute; top: 8px; right: 8px; }
.sig-image { max-width: 320px; border: 1px solid var(--border); border-radius: 8px; background: #fff; }
.report-body { font-size: 15px; line-height: 1.6; }
.report-anomaly { margin-top: .75rem; padding: .5rem .75rem; background: #fbf6ed; border-radius: 6px; font-size: 14px; }
.report-note { margin-top: .5rem; padding: .5rem .75rem; background: var(--surface-alt); border-radius: 6px; font-size: 14px; }
.umlage-actions { display: flex; gap: 1rem; margin-top: 1rem; }

/* Abschnitts-Titel (v2.5) */
.section-title { font-size: 16px; font-weight: 600; margin: 1.5rem 0 .75rem; }

/* GPS-Link (v2.6) */
.gps-link { margin-left: .75rem; font-size: 13px; color: var(--accent); }

/* ===== Rundschreiben (v2.7 - 2026-06-27) ===== */
.nl-col { max-width: 720px; }
.nl-preview { border: 1px solid var(--border); border-radius: 8px; padding: 1.5rem; background: #fff; }
.nl-preview-subject { font-size: 18px; font-weight: 600; margin-bottom: 1rem; }
.nl-preview-body { font-size: 15px; line-height: 1.6; }
.nl-preview-footer { margin-top: 1.5rem; padding-top: 1rem; border-top: 1px solid var(--border-inner); color: var(--text-3); font-size: 13px; }
.nl-recipients { display: flex; flex-direction: column; gap: .5rem; }
.nl-recipient-list { columns: 2; font-size: 14px; color: var(--text-2); margin: .5rem 0 0; padding-left: 1.25rem; }

/* ===== M10 Bankkonten + M11 Mieter-Portal + M1 Grundriss (PB-018, v3.2) ===== */
.checkbox-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: .5rem 1.5rem; }
.checkbox-row { display: flex; align-items: center; gap: .6rem; font-size: 14px; color: var(--text-2); padding: .35rem 0; }
.checkbox-row input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--accent); }

.matrix-table th.matrix-col { text-align: center; vertical-align: bottom; min-width: 120px; }
.matrix-table td.matrix-cell { text-align: center; }
.matrix-table td.matrix-cell input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--accent); cursor: pointer; }

/* Mieter-Portal (schmale, eigenständige Ansicht ohne Admin-Chrome) */
.portal-body { background: var(--bg); min-height: 100vh; margin: 0; }
.portal-shell { max-width: 640px; margin: 0 auto; padding: 2rem 1.25rem; }
.portal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.5rem; }
.portal-logo { display: flex; align-items: center; gap: .75rem; font-weight: 600; color: var(--text); }
.portal-logo .sidebar-logo { width: 40px; height: 40px; }
.portal-card { background: var(--surface); border: 1px solid var(--border-card); border-radius: var(--radius); padding: 1.5rem; margin-bottom: 1rem; }
.portal-note { background: var(--accent-soft); border: 1px solid var(--border-card); border-radius: var(--radius); padding: 1rem 1.25rem; font-size: 14px; color: var(--text-2); margin-bottom: 1rem; }

/* Freigabe-Queue */
.queue-old { color: var(--text-3); text-decoration: line-through; }
.queue-new { color: var(--success); font-weight: 600; }
.history-old { color: var(--text-3); }
.history-arrow { color: var(--muted); padding: 0 .4rem; }

/* Grundriss-KI: 3-Schritt-Flow */
.kistep-row { display: flex; gap: .5rem; margin-bottom: 1.25rem; }
.kistep { flex: 1; text-align: center; padding: .75rem; border: 1px solid var(--border-card); border-radius: var(--radius); background: var(--surface-alt); font-size: 13px; color: var(--text-3); }
.kistep.is-active { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); font-weight: 600; }
.confidence { font-size: 12px; padding: 2px 8px; border-radius: 10px; }
.confidence-exact { background: #e4f0e6; color: var(--success); }
.confidence-read { background: var(--accent-soft); color: var(--accent); }
.confidence-est { background: #f5ecd9; color: var(--warning); }

/* ===== M12 Mieter-Bewertung (PB-021) ===== */
/* Score-Pill (Liste + KI-Tabelle): kompakt, klickbar */
.score-pill {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 40px; height: 26px; padding: 0 8px; box-sizing: border-box;
  border-radius: 13px; font-weight: 700; font-size: 13px;
  text-decoration: none; border: 1px solid transparent;
}
a.score-pill:hover { filter: brightness(0.96); }
/* Score-Badge (Detail, gross) */
.score-badge {
  display: inline-flex; align-items: center; justify-content: center;
  width: 64px; height: 64px; border-radius: 50%;
  font-size: 26px; font-weight: 700; border: 2px solid transparent;
}
.score-good { background: #e4f0e6; color: var(--success); border-color: #bcd9c2; }
.score-mid  { background: #f7eecf; color: var(--warning); border-color: #e6d4a0; }
.score-bad  { background: #f6e0d8; color: var(--danger);  border-color: #e6c0b0; }
.score-none { background: var(--surface-alt); color: var(--text-3); border-color: var(--border-inner); }
.score-alarm { color: var(--danger); font-weight: 700; }

.rating-head { display: flex; align-items: center; width: 100%; }
.rating-overall { display: flex; align-items: center; gap: 1rem; }
.rating-overall-label { font-size: 13px; color: var(--text-3); font-weight: 600; }

/* Manuelle Sterne-Bewertung */
.rating-questions { display: flex; flex-direction: column; gap: .5rem; margin-top: 1rem; }
.rating-q-row { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 1rem; padding: .4rem 0; border-bottom: 1px solid var(--border-inner); }
.rating-q-row:last-child { border-bottom: none; }
.rating-q-label { font-size: 14px; color: var(--text-2); }
.stars { display: inline-flex; align-items: center; gap: 2px; }
.star {
  background: none; border: none; cursor: pointer; font-size: 22px; line-height: 1;
  color: #d7d2ca; padding: 0 1px; transition: color .1s;
}
.star:hover, .star.star-on { color: #e0a93b; }
.star-clear { background: none; border: none; cursor: pointer; color: var(--text-3); font-size: 16px; margin-left: 6px; }
.star-clear:hover { color: var(--danger); }


/* =====================================================================
   REDESIGN-ANGLEICHUNG LIVE (v4.4, PB-038, 2026-07-04)
   Button-Farbregel portalweit: Farbe folgt Funktion.
   KI-Kernaktion = orange gefüllt · KI-Sekundär = orange outline
   Daten-Aktion = blau outline · Daten-Hauptaktion = blau gefüllt
   Umschalter/Segmente = dezent, KEINE Button-Optik
   ===================================================================== */

/* --- KI-Kernaktion: orange GEFÜLLT (senden, KI erledigt komplett) --- */
.btn.kiprim, .kiprim {
  background: var(--ki); border-color: var(--ki-deep); color: #fff;
}
.btn.kiprim:hover, .kiprim:hover { background: var(--ki-deep); border-color: var(--ki-deep); color: #fff; }

/* --- KI-Sekundär: orange OUTLINE (neu erzeugen, KI führt mich) --- */
.btn.kiact, .kiact {
  background: var(--surface); border-color: var(--ki); color: var(--ki-deep);
}
.btn.kiact:hover, .kiact:hover { background: var(--ki-soft); border-color: var(--ki-deep); color: var(--ki-deep); }

/* --- Daten-Aktion: blau OUTLINE (Übersetzen/Bearbeiten/Vorschau/Manuell) --- */
.btn.accout, .accout {
  background: var(--surface); border-color: var(--accent-mute); color: var(--accent-deep);
}
.btn.accout:hover, .accout:hover { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-deep); }

/* --- Daten-Hauptaktion: blau GEFÜLLT (Alias auf bestehendes .btn-primary) --- */
.btn.primary, .primary {
  background: var(--accent); border-color: var(--accent-deep); color: #fff;
}
.btn.primary:hover, .primary:hover { background: var(--accent-deep); border-color: var(--accent-deep); color: #fff; }

/* --- KI-Chip (Vorschlag-Kennzeichnung, fix 118px, orange) --- */
.chip-ki {
  display: inline-flex; align-items: center; justify-content: center;
  width: 118px; height: 28px; box-sizing: border-box;
  font-size: 12px; font-weight: 600; padding: 0 8px; border-radius: 20px;
  background: var(--ki-soft); color: var(--ki-deep); border: 1px solid #f0cfa8;
  white-space: nowrap;
}
.chip-ki.sm { width: 100px; height: 24px; font-size: 11px; }

/* --- Umschalter/Segmente: dezent, klar getrennt vom Aktions-Look --- */
.segmode { display: inline-flex; border: 1px solid var(--border-card); border-radius: 8px; overflow: hidden; }
.segmode > .segopt {
  padding: 0 14px; height: 34px; display: inline-flex; align-items: center;
  background: var(--surface-alt); color: var(--text-3); font-size: 13px; font-weight: 500;
  border: none; border-right: 1px solid var(--border-card); cursor: pointer;
}
.segmode > .segopt:last-child { border-right: none; }
.segmode > .segopt.is-active { background: var(--accent-soft); color: var(--accent-deep); font-weight: 600; }

/* --- KPI-Karten getönt (statt hartes Weiß): surface-alt + Akzent-Toplinie --- */
.stat-card, .keystat {
  background: var(--surface-alt); position: relative; overflow: hidden;
}
.stat-card::before, .keystat::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 3px; background: var(--accent-mute);
}
.stat-card.kicard { background: var(--ki-soft); }
.stat-card.kicard::before { background: var(--ki); }
.stat-card.kicard .stat-value { color: var(--ki-deep); }
.stat-card.okcard::before { background: var(--ok); }
.stat-card.okcard .stat-value { color: var(--ok); }
.stat-card.warncard { background: var(--warn-soft); }
.stat-card.warncard::before { background: var(--warn); }
.stat-card.warncard .stat-value { color: var(--warn); }
/* keystat sitzt in einem Grid mit 1px-Fugen — Toplinie dort dezenter halten */
.keystat::before { height: 2px; }

/* Erledigte Zeilen ausgegraut (PB-038, Aufgaben-Redesign) */
.row-done { opacity: .5; }
.row-done:hover { opacity: .72; }

/* Dashboard: 8 KPI-Karten in 4 Spalten (PB-038) */
.stats-grid-8 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 1024px) { .stats-grid-8 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .stats-grid-8 { grid-template-columns: 1fr; } }
