/* objektOS – Demo Design System
   Clean: weiß / schwarz, Akzent #006BB3 */

:root {
  --blue: #006BB3;
  --blue-hover: #005A96;
  --blue-soft: #EAF3FA;
  --blue-line: #B9D6EC;
  --black: #0F0F10;
  --text: #0F0F10;
  --muted: #6B6F76;
  --faint: #9A9EA5;
  --border: #E7E8EA;
  --border-strong: #D4D6DA;
  --bg: #FFFFFF;
  --bg-subtle: #F7F8F9;
  --success: #1E7F4A;
  --success-soft: #E8F5EE;
  --warning: #9A5B00;
  --warning-soft: #FFF4E0;
  --danger: #C0262D;
  --danger-soft: #FDECEC;
  --radius: 10px;
  --radius-sm: 7px;
  --shadow: 0 1px 2px rgba(15, 15, 16, .04), 0 4px 16px rgba(15, 15, 16, .05);
  --shadow-lg: 0 20px 60px rgba(15, 15, 16, .18);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html, body { margin: 0; }

body {
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { margin: 0; line-height: 1.25; letter-spacing: -0.01em; }
h1 { font-size: 26px; font-weight: 700; }
h2 { font-size: 16px; font-weight: 650; }
h3 { font-size: 14px; font-weight: 650; }
p { margin: 0; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }

.icon { width: 18px; height: 18px; flex: none; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.nowrap { white-space: nowrap; }

/* ---------- Brand ---------- */
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  color: var(--black); font-weight: 700; font-size: 18px; letter-spacing: -0.02em;
}
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 32px; height: 32px; border-radius: 8px;
  background: var(--blue); color: #fff;
  display: grid; place-items: center;
}
.brand-mark svg { width: 18px; height: 18px; }
.brand b { color: var(--blue); font-weight: 700; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 36px; padding: 0 14px;
  border-radius: var(--radius-sm); border: 1px solid transparent;
  font-weight: 550; font-size: 13.5px; cursor: pointer; white-space: nowrap;
  transition: background .15s, border-color .15s, color .15s;
}
.btn:hover { text-decoration: none; }
.btn:disabled { opacity: .55; cursor: default; }
.btn .icon { width: 16px; height: 16px; }
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--blue-hover); }
.btn-dark { background: var(--black); color: #fff; }
.btn-dark:hover:not(:disabled) { background: #2A2B2E; }
.btn-secondary { background: #fff; color: var(--text); border-color: var(--border-strong); }
.btn-secondary:hover:not(:disabled) { border-color: var(--black); }
.btn-ghost { background: transparent; color: var(--muted); }
.btn-ghost:hover:not(:disabled) { background: var(--bg-subtle); color: var(--text); }
.btn-danger { background: #fff; color: var(--danger); border-color: #F1C4C6; }
.btn-danger:hover:not(:disabled) { background: var(--danger-soft); }
.btn-sm { height: 30px; padding: 0 10px; font-size: 12.5px; }
.btn-block { width: 100%; }

.icon-btn {
  width: 32px; height: 32px; border-radius: var(--radius-sm);
  display: inline-grid; place-items: center;
  border: 0; background: transparent; color: var(--muted); cursor: pointer;
}
.icon-btn:hover { background: var(--bg-subtle); color: var(--text); }
.icon-btn.danger:hover { background: var(--danger-soft); color: var(--danger); }
.icon-btn .icon { width: 17px; height: 17px; }

/* ---------- Formulare ---------- */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > span { font-size: 12.5px; font-weight: 550; color: var(--muted); }
.field.full { grid-column: 1 / -1; }
.input, .field input, .field select, .field textarea {
  width: 100%; height: 38px; padding: 0 12px;
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  background: #fff; outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.field textarea { height: auto; min-height: 90px; padding: 10px 12px; resize: vertical; }
.input:focus, .field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--blue); box-shadow: 0 0 0 3px rgba(0, 107, 179, .14);
}
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px; }
.form-section {
  grid-column: 1 / -1; margin-top: 6px; padding-top: 14px; border-top: 1px solid var(--border);
  font-size: 11.5px; font-weight: 650; text-transform: uppercase; letter-spacing: .06em; color: var(--muted);
}
.form-section:first-child { margin-top: 0; padding-top: 0; border-top: 0; }

/* ---------- Badges ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  height: 22px; padding: 0 8px; border-radius: 999px;
  font-size: 11.5px; font-weight: 600; white-space: nowrap;
  background: var(--bg-subtle); color: var(--muted); border: 1px solid var(--border);
}
.badge-blue { background: var(--blue-soft); color: var(--blue); border-color: var(--blue-line); }
.badge-green { background: var(--success-soft); color: var(--success); border-color: #BFE3CF; }
.badge-amber { background: var(--warning-soft); color: var(--warning); border-color: #F3D9A8; }
.badge-red { background: var(--danger-soft); color: var(--danger); border-color: #F1C4C6; }
.badge-dark { background: var(--black); color: #fff; border-color: var(--black); }
.dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; display: inline-block; }

/* ---------- Karten ---------- */
.card {
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
}
.card-pad { padding: 20px; }
.card-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 16px 20px; border-bottom: 1px solid var(--border);
}
.card-head .link { font-size: 13px; font-weight: 550; }
.card-body { padding: 16px 20px; }
.empty { padding: 28px 20px; text-align: center; color: var(--muted); }

.dl { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 20px; margin: 0; }
.dl div { min-width: 0; }
.dl dt { font-size: 12px; color: var(--muted); margin-bottom: 2px; }
.dl dd { margin: 0; font-weight: 550; overflow-wrap: anywhere; }
.dl .full { grid-column: 1 / -1; }

/* ---------- App-Layout (Verwalter) ---------- */
.app { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }

.sidebar {
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column;
  border-right: 1px solid var(--border); background: #fff;
  padding: 20px 14px;
}
.sidebar .brand { padding: 2px 8px 22px; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-label {
  padding: 14px 10px 6px; font-size: 11px; font-weight: 650; color: var(--faint);
  text-transform: uppercase; letter-spacing: .07em;
}
.nav a {
  position: relative; display: flex; align-items: center; gap: 11px;
  height: 38px; padding: 0 10px; border-radius: var(--radius-sm);
  color: #3A3C40; font-weight: 550;
}
.nav a:hover { background: var(--bg-subtle); color: var(--black); text-decoration: none; }
.nav a.active { background: var(--blue-soft); color: var(--blue); }
.nav a.active::before {
  content: ""; position: absolute; left: -14px; top: 8px; bottom: 8px; width: 3px;
  border-radius: 0 3px 3px 0; background: var(--blue);
}
.nav-badge {
  margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px;
  background: var(--blue); color: #fff; font-size: 11px; font-weight: 700;
  display: inline-grid; place-items: center;
}
.sidebar-foot {
  margin-top: auto; padding: 14px 8px 0; border-top: 1px solid var(--border);
  display: flex; align-items: center; gap: 10px;
}
.avatar {
  width: 34px; height: 34px; border-radius: 50%; flex: none;
  background: var(--black); color: #fff; font-weight: 650; font-size: 12.5px;
  display: grid; place-items: center;
}
.avatar.blue { background: var(--blue); }
.avatar.light { background: var(--blue-soft); color: var(--blue); }
.sidebar-user { min-width: 0; flex: 1; }
.sidebar-user strong { display: block; font-size: 13px; }
.sidebar-user span { font-size: 12px; color: var(--muted); }

.main { min-width: 0; padding: 32px 40px 60px; background: #fff; }

.page-head {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  margin-bottom: 26px;
}
.page-head .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.eyebrow { font-size: 12.5px; font-weight: 600; color: var(--blue); margin-bottom: 6px; }
.back { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; margin-bottom: 10px; }
.back:hover { color: var(--black); text-decoration: none; }
.back .icon { width: 15px; height: 15px; }
.subtitle { color: var(--muted); margin-top: 6px; }

/* KPIs */
.kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; margin-bottom: 20px; }
.kpi { padding: 18px 18px 16px; border: 1px solid var(--border); border-radius: var(--radius); }
.kpi-label { font-size: 12.5px; color: var(--muted); font-weight: 550; }
.kpi-value { font-size: 26px; font-weight: 700; letter-spacing: -0.02em; margin: 6px 0 2px; }
.kpi-sub { font-size: 12px; color: var(--muted); }
.kpi-sub.alert { color: var(--danger); font-weight: 600; }
.kpi.accent { background: var(--blue); border-color: var(--blue); color: #fff; }
.kpi.accent .kpi-label, .kpi.accent .kpi-sub { color: rgba(255, 255, 255, .8); }
.meter { height: 6px; border-radius: 99px; background: var(--border); overflow: hidden; margin-top: 10px; }
.meter > i { display: block; height: 100%; background: var(--blue); border-radius: 99px; }

.grid-2 { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.stack { display: flex; flex-direction: column; gap: 20px; min-width: 0; }

/* Listen */
.list { display: flex; flex-direction: column; }
.list-row {
  display: flex; align-items: center; gap: 14px; padding: 13px 20px;
  border-top: 1px solid var(--border); color: inherit; cursor: pointer; background: #fff;
  text-align: left; width: 100%; border-left: 0; border-right: 0; border-bottom: 0;
}
.list-row:first-child { border-top: 0; }
.list-row:hover { background: var(--bg-subtle); text-decoration: none; }
.list-row .grow { flex: 1; min-width: 0; }
.list-row .title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-row .meta { font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.date-chip { font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.date-chip.overdue { color: var(--danger); font-weight: 600; }

/* Tabellen */
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; }
.table th {
  text-align: left; font-size: 12px; font-weight: 600; color: var(--muted);
  padding: 11px 16px; border-bottom: 1px solid var(--border); background: var(--bg-subtle); white-space: nowrap;
}
.table td { padding: 13px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr.clickable { cursor: pointer; }
.table tbody tr.clickable:hover td { background: var(--bg-subtle); }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table .actions-cell { text-align: right; white-space: nowrap; width: 1%; }
.cell-main { font-weight: 600; }
.cell-sub { font-size: 12.5px; color: var(--muted); }

.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.search { position: relative; flex: 1; min-width: 220px; max-width: 360px; }
.search .icon { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--faint); width: 16px; height: 16px; }
.search input { padding-left: 34px; }
.toolbar select.input { width: auto; min-width: 170px; }

/* Objekt-Karten */
.property-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 16px; }
.property-card {
  display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: var(--radius);
  color: inherit; overflow: hidden; transition: border-color .15s, box-shadow .15s;
}
.property-card:hover { border-color: var(--blue-line); box-shadow: var(--shadow); text-decoration: none; }
.property-visual {
  height: 108px; background: linear-gradient(135deg, var(--blue) 0%, #004E84 100%);
  position: relative; overflow: hidden;
}
.property-visual svg { position: absolute; right: 16px; bottom: 0; height: 92px; width: auto; color: rgba(255, 255, 255, .9); }
.property-visual .badge { position: absolute; left: 16px; top: 14px; background: rgba(255, 255, 255, .95); border-color: transparent; color: var(--black); }
.property-body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 4px; }
.property-body h2 { font-size: 16.5px; }
.property-stats { display: flex; justify-content: space-between; margin-top: 12px; font-size: 12.5px; color: var(--muted); }
.property-stats strong { color: var(--text); }

/* Detail-Kopf mit Infos */
.info-strip {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 20px;
}
.info-strip > div { padding: 16px 20px; border-left: 1px solid var(--border); }
.info-strip > div:first-child { border-left: 0; }
.info-strip dt { font-size: 12px; color: var(--muted); }
.info-strip dd { margin: 3px 0 0; font-size: 18px; font-weight: 650; }

/* Dokumente */
.doc-row { display: flex; align-items: center; gap: 12px; padding: 12px 20px; border-top: 1px solid var(--border); }
.doc-row:first-child { border-top: 0; }
.doc-icon {
  width: 36px; height: 36px; border-radius: 8px; flex: none;
  background: var(--blue-soft); color: var(--blue); display: grid; place-items: center;
}
.doc-icon .icon { width: 18px; height: 18px; }
.doc-row .grow { flex: 1; min-width: 0; }
.doc-row .name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.upload-box {
  display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
  padding: 14px 20px; border-top: 1px dashed var(--border-strong); background: var(--bg-subtle);
  border-radius: 0 0 var(--radius) var(--radius);
}
.upload-box select.input { width: auto; flex: 0 0 190px; height: 34px; }
.file-pick { position: relative; flex: 1; min-width: 180px; }
.file-pick input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.file-pick span {
  display: flex; align-items: center; gap: 8px; height: 34px; padding: 0 12px;
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: #fff;
  color: var(--muted); overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
}
.file-pick:hover span { border-color: var(--black); color: var(--text); }

/* Kanban */
.board { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; align-items: start; }
.column { background: var(--bg-subtle); border: 1px solid var(--border); border-radius: var(--radius); min-height: 200px; transition: background .15s, border-color .15s; }
.column.drag-over { background: var(--blue-soft); border-color: var(--blue); }
.column-head { display: flex; align-items: center; gap: 8px; padding: 14px 16px 10px; font-weight: 650; }
.column-head .count { color: var(--muted); font-weight: 550; font-size: 12.5px; }
.column-head .dot { width: 8px; height: 8px; }
.column-body { display: flex; flex-direction: column; gap: 10px; padding: 4px 12px 14px; }
.task {
  background: #fff; border: 1px solid var(--border); border-radius: 9px; padding: 13px 14px;
  cursor: grab; box-shadow: 0 1px 1px rgba(15, 15, 16, .03);
  transition: border-color .15s, box-shadow .15s;
}
.task:hover { border-color: var(--blue-line); box-shadow: var(--shadow); }
.task.dragging { opacity: .45; }
.task-top { display: flex; align-items: center; gap: 6px; margin-bottom: 7px; }
.task-no { font-size: 11.5px; font-weight: 650; color: var(--faint); margin-right: auto; font-variant-numeric: tabular-nums; }
.task-title { font-weight: 600; line-height: 1.35; margin-bottom: 8px; }
.task-meta { display: flex; flex-direction: column; gap: 3px; font-size: 12.5px; color: var(--muted); }
.task-meta div { display: flex; align-items: center; gap: 6px; min-width: 0; }
.task-meta .icon { width: 14px; height: 14px; }
.task-meta span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.task-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border); }
.prio { font-size: 11.5px; font-weight: 650; display: inline-flex; align-items: center; gap: 5px; }
.prio-Hoch { color: var(--danger); }
.prio-Mittel { color: var(--warning); }
.prio-Niedrig { color: var(--muted); }

.segmented { display: inline-flex; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); overflow: hidden; }
.segmented button { border: 0; background: #fff; height: 36px; padding: 0 14px; cursor: pointer; font-weight: 550; color: var(--muted); border-left: 1px solid var(--border); }
.segmented button:first-child { border-left: 0; }
.segmented button.active { background: var(--black); color: #fff; }

/* ---------- Chat ---------- */
.messenger {
  display: grid; grid-template-columns: 320px 1fr;
  border: 1px solid var(--border); border-radius: var(--radius);
  height: calc(100vh - 170px); min-height: 480px; overflow: hidden;
}
.conv-list { border-right: 1px solid var(--border); overflow-y: auto; }
.conv {
  display: flex; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--border);
  color: inherit; cursor: pointer;
}
.conv:hover { background: var(--bg-subtle); text-decoration: none; }
.conv.active { background: var(--blue-soft); }
.conv .grow { flex: 1; min-width: 0; }
.conv-top { display: flex; justify-content: space-between; gap: 8px; }
.conv-name { font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conv-time { font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.conv-unit { font-size: 12px; color: var(--muted); }
.conv-last { font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 2px; }
.conv.unread .conv-last { color: var(--text); font-weight: 600; }
.unread-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--blue); flex: none; margin-top: 6px; }

.thread { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.thread-head { display: flex; align-items: center; gap: 12px; padding: 14px 20px; border-bottom: 1px solid var(--border); }
.thread-head .grow { flex: 1; min-width: 0; }

.chat-scroll { flex: 1; overflow-y: auto; padding: 20px; display: flex; flex-direction: column; gap: 12px; background: var(--bg-subtle); }
.msg { display: flex; flex-direction: column; max-width: 74%; align-self: flex-start; }
.msg.own { align-self: flex-end; align-items: flex-end; }
.msg-bubble {
  padding: 10px 14px; border-radius: 14px 14px 14px 4px;
  background: #fff; border: 1px solid var(--border);
  overflow-wrap: anywhere;
}
.msg.own .msg-bubble { background: var(--blue); color: #fff; border-color: var(--blue); border-radius: 14px 14px 4px 14px; }
.msg.bot .msg-bubble { background: #fff; border-color: var(--blue-line); }
.msg-meta { font-size: 11.5px; color: var(--muted); margin: 4px 4px 0; display: flex; gap: 6px; align-items: center; }
.msg-sender { font-size: 11.5px; font-weight: 650; color: var(--muted); margin: 0 4px 4px; display: flex; align-items: center; gap: 5px; }
.msg.bot .msg-sender { color: var(--blue); }
.msg-photo { display: block; margin-top: 8px; max-width: 220px; border-radius: 9px; border: 1px solid rgba(255, 255, 255, .4); }
.msg-ticket {
  display: inline-flex; margin-top: 8px; padding: 2px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 650;
  background: var(--blue-soft); color: var(--blue);
}
.msg.own .msg-ticket { background: rgba(255, 255, 255, .2); color: #fff; }
.chat-day { align-self: center; font-size: 11.5px; color: var(--muted); background: #fff; border: 1px solid var(--border); padding: 2px 10px; border-radius: 999px; }
.chat-options { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; max-width: 520px; }
.chip {
  border: 1px solid var(--blue-line); background: #fff; color: var(--blue);
  height: 32px; padding: 0 13px; border-radius: 999px; cursor: pointer; font-weight: 550; font-size: 13px;
  display: inline-flex; align-items: center; gap: 6px;
}
.chip:hover { background: var(--blue-soft); border-color: var(--blue); }
.chip.primary { background: var(--blue); color: #fff; border-color: var(--blue); }
.chip.primary:hover { background: var(--blue-hover); }
.chip .icon { width: 15px; height: 15px; }

.chat-compose { border-top: 1px solid var(--border); padding: 12px 14px; background: #fff; }
.chat-quick { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.chat-input-row { display: flex; gap: 8px; align-items: flex-end; }
.chat-input-row textarea {
  flex: 1; resize: none; min-height: 40px; max-height: 120px; padding: 9px 12px;
  border: 1px solid var(--border-strong); border-radius: 10px; outline: none;
}
.chat-input-row textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(0, 107, 179, .14); }
.chat-input-row .btn { height: 40px; width: 44px; padding: 0; }
.typing { display: inline-flex; gap: 4px; padding: 4px 2px; }
.typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--faint); animation: blink 1.2s infinite; }
.typing i:nth-child(2) { animation-delay: .2s; }
.typing i:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }

/* ---------- Modal ---------- */
.modal-overlay {
  position: fixed; inset: 0; z-index: 50; background: rgba(15, 15, 16, .38);
  display: flex; align-items: flex-start; justify-content: center; padding: 6vh 16px;
  overflow-y: auto; animation: fade .15s ease-out;
}
.modal {
  width: 100%; max-width: 640px; background: #fff; border-radius: 14px; box-shadow: var(--shadow-lg);
  animation: pop .18s ease-out;
}
.modal.narrow { max-width: 420px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px; border-bottom: 1px solid var(--border); }
.modal-head h2 { font-size: 17px; }
.modal-body { padding: 20px 22px; }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; align-items: center; padding: 16px 22px; border-top: 1px solid var(--border); }
.modal-actions .spacer { flex: 1; }
.modal-note { grid-column: 1 / -1; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--blue-soft); color: #0B3F66; font-size: 13px; display: flex; align-items: center; gap: 12px; }
.modal-note img { width: 64px; height: 64px; object-fit: cover; border-radius: 6px; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98); } }

/* ---------- Toast ---------- */
.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 80; display: flex; flex-direction: column; gap: 8px; }
.toast {
  display: flex; align-items: center; gap: 10px; min-width: 260px; max-width: 380px;
  padding: 12px 16px; border-radius: 10px; background: var(--black); color: #fff;
  box-shadow: var(--shadow-lg); font-weight: 500; animation: pop .18s ease-out;
}
.toast .dot { background: #4FC38A; }
.toast.error .dot { background: #FF6B6B; }

/* ---------- Login ---------- */
.login-page { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
.login-side {
  background: var(--blue); color: #fff; padding: 48px; display: flex; flex-direction: column; justify-content: space-between;
  position: relative; overflow: hidden;
}
.login-side .brand { color: #fff; }
.login-side .brand-mark { background: #fff; color: var(--blue); }
.login-side .brand b { color: #fff; opacity: .75; }
.login-side h1 { font-size: 36px; line-height: 1.15; max-width: 440px; letter-spacing: -0.025em; }
.login-side p { max-width: 420px; margin-top: 14px; color: rgba(255, 255, 255, .8); font-size: 15px; }
.login-skyline { position: absolute; right: -10px; bottom: 0; width: 88%; max-width: 620px; color: rgba(255, 255, 255, .13); pointer-events: none; }
.login-foot { font-size: 12.5px; color: rgba(255, 255, 255, .7); position: relative; }
.login-main { display: grid; place-items: center; padding: 40px 24px; }
.login-card { width: 100%; max-width: 380px; }
.login-card h2 { font-size: 24px; font-weight: 700; margin-bottom: 6px; }
.login-card form { display: flex; flex-direction: column; gap: 14px; margin-top: 26px; }
.login-card .btn { height: 42px; margin-top: 4px; }
.login-error { padding: 10px 12px; border-radius: var(--radius-sm); background: var(--danger-soft); color: var(--danger); font-size: 13px; font-weight: 500; }
.demo-users { margin-top: 28px; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.demo-users-head { padding: 10px 14px; background: var(--bg-subtle); font-size: 11.5px; font-weight: 650; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.demo-user { display: flex; align-items: center; gap: 12px; width: 100%; padding: 11px 14px; border: 0; border-top: 1px solid var(--border); background: #fff; cursor: pointer; text-align: left; }
.demo-user:hover { background: var(--blue-soft); }
.demo-user .grow { flex: 1; }
.demo-user strong { display: block; font-size: 13.5px; }
.demo-user span { font-size: 12px; color: var(--muted); }
.demo-user code { font-size: 12px; color: var(--muted); }

/* ---------- Mieterportal ---------- */
.portal-header {
  position: sticky; top: 0; z-index: 10; background: rgba(255, 255, 255, .92); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.portal-header-inner { max-width: 1240px; margin: 0 auto; padding: 14px 24px; display: flex; align-items: center; gap: 16px; }
.portal-tag { font-size: 12.5px; font-weight: 600; color: var(--muted); padding-left: 16px; border-left: 1px solid var(--border); }
.portal-user { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.portal-user .name { font-weight: 600; font-size: 13.5px; }
.lang-switch button { height: 28px; padding: 0 10px; font-size: 12px; font-weight: 650; letter-spacing: .03em; }
.portal { max-width: 1240px; margin: 0 auto; padding: 32px 24px 60px; }
.portal-hero { margin-bottom: 24px; }
.portal-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 20px; align-items: start; }
.portal-col { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.chat-card { position: sticky; top: 88px; display: flex; flex-direction: column; height: calc(100vh - 120px); min-height: 520px; overflow: hidden; }
.chat-card .chat-scroll { background: #fff; }
.chat-header { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.chat-header .grow { flex: 1; }
.online { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--success); font-weight: 550; }
.online .dot { background: var(--success); }
.lease-progress { margin-top: 16px; }
.lease-progress .meter { height: 8px; }
.lease-progress-labels { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin-top: 6px; }

.hero-unit {
  display: flex; gap: 18px; align-items: center; padding: 20px;
}
.hero-unit .unit-visual {
  width: 76px; height: 76px; border-radius: 12px; background: var(--blue); color: #fff;
  display: grid; place-items: center; flex: none;
}
.hero-unit .unit-visual svg { width: 40px; height: 40px; }

/* ---------- Responsive ---------- */
@media (max-width: 1200px) {
  .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 1024px) {
  .grid-2, .portal-grid { grid-template-columns: 1fr; }
  .board { grid-template-columns: 1fr; }
  .chat-card { position: static; height: 620px; order: -1; }
  .info-strip { grid-template-columns: 1fr 1fr; }
  .info-strip > div:nth-child(3) { border-left: 0; }
  .info-strip > div:nth-child(n+3) { border-top: 1px solid var(--border); }
}
@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: sticky; z-index: 20; height: auto; flex-direction: row; align-items: center; padding: 10px 16px; border-right: 0; border-bottom: 1px solid var(--border); overflow-x: auto; }
  .sidebar .brand { padding: 0 12px 0 0; }
  .sidebar .brand span:last-child, .nav-label, .sidebar-user { display: none; }
  .nav { flex-direction: row; }
  .nav a.active::before { display: none; }
  .sidebar-foot { margin: 0 0 0 auto; padding: 0; border: 0; }
  .main { padding: 24px 16px 48px; }
  .messenger { grid-template-columns: 1fr; height: auto; }
  .conv-list { max-height: 240px; border-right: 0; border-bottom: 1px solid var(--border); }
  .thread { height: 560px; }
  .login-page { grid-template-columns: 1fr; }
  .login-side { display: none; }
  .form-grid { grid-template-columns: 1fr; }
  .kpis { grid-template-columns: 1fr 1fr; }
  .msg { max-width: 88%; }
  .portal-tag { display: none; }
  .portal-user .name { display: none; }
}
