/* ============================================================
   ImmoApp – Globales Stylesheet
   Design: Dark Sidebar (#1e293b), helles Content-Panel
   Alle Seiten verwenden dieses Stylesheet.
   Inline-<style>-Blöcke in HTML-Dateien wurden entfernt.
   ============================================================ */

/* ── CSS VARIABLEN ─────────────────────────────────────── */
:root {
    --sidebar-bg:       #1e293b;
    --sidebar-hover:    #334155;
    --sidebar-active:   #334155;
    --sidebar-accent:   #3b82f6;
    --sidebar-text:     #94a3b8;
    --sidebar-width:    220px;

    --primary:          #1e40af;
    --primary-hover:    #1d4ed8;
    --primary-light:    #eff6ff;
    --success:          #22c55e;
    --success-light:    #dcfce7;
    --warning:          #f59e0b;
    --warning-light:    #fef9c3;
    --danger:           #ef4444;
    --danger-light:     #fee2e2;
    --purple:           #7c3aed;
    --purple-light:     #ede9fe;

    --bg:               #f0f2f5;
    --surface:          #ffffff;
    --border:           #e2e8f0;
    --text:             #1e293b;
    --text-muted:       #64748b;
    --text-faint:       #94a3b8;

    --radius:           10px;
    --radius-sm:        6px;
    --radius-lg:        14px;
    --shadow:           0 1px 4px rgba(0,0,0,0.08);
    --shadow-md:        0 4px 16px rgba(0,0,0,0.12);
}

/* ── RESET & BASE ──────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
    margin: 0;
    padding: 0;
    font-size: 15px;
    line-height: 1.5;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── LAYOUT ────────────────────────────────────────────── */
.page-wrapper {
    display: flex;
    min-height: 100vh;
}
.main-content {
    flex: 1;
    padding: 28px;
    overflow-y: auto;
    min-width: 0;
}

/* ── SIDEBAR ───────────────────────────────────────────── */
.sidebar {
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    color: white;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
}
.sidebar-header {
    padding: 18px 16px;
    font-weight: 700;
    font-size: 1rem;
    border-bottom: 1px solid #334155;
    color: white;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.sidebar-nav {
    padding: 10px 0;
    flex: 1;
    overflow-y: auto;
}
.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    color: var(--sidebar-text);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    border-left: 3px solid transparent;
    transition: background 0.15s, color 0.15s;
    white-space: nowrap;
}
.sidebar-nav a:hover {
    background: var(--sidebar-hover);
    color: white;
    text-decoration: none;
}
.sidebar-nav a.active {
    background: var(--sidebar-active);
    color: white;
    border-left-color: var(--sidebar-accent);
}
.sidebar-nav a i { font-size: 1rem; flex-shrink: 0; }

/* CTA-Button in Sidebar */
.sidebar-cta {
    display: flex !important;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 10px 12px 14px !important;
    padding: 9px 14px !important;
    background: var(--sidebar-accent) !important;
    color: white !important;
    border-radius: var(--radius-sm) !important;
    font-weight: 600 !important;
    font-size: 0.85rem !important;
    border-left: none !important;
    transition: background 0.15s !important;
}
.sidebar-cta:hover {
    background: var(--primary-hover) !important;
    color: white !important;
}

.sidebar-footer {
    padding: 14px 16px;
    border-top: 1px solid #334155;
}
.sidebar-footer a {
    display: block;
    color: var(--sidebar-text);
    text-decoration: none;
    font-size: 0.82rem;
    padding: 5px 0;
    transition: color 0.15s;
}
.sidebar-footer a:hover { color: white; }
.sidebar-footer .logout { color: #f87171; }
.sidebar-footer .logout:hover { color: #fca5a5; }

/* ── PAGE HEADER ───────────────────────────────────────── */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    gap: 16px;
    flex-wrap: wrap;
}
.page-header h1 {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text);
    margin: 0;
}
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--text-muted);
    font-size: 0.85rem;
    text-decoration: none;
    margin-bottom: 6px;
}
.back-link:hover { color: var(--text); text-decoration: none; }

/* ── CARDS / PANELS ────────────────────────────────────── */
.card, .panel {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}
.card-header, .panel-header {
    padding: 13px 18px;
    background: #f8fafc;
    border-bottom: 1px solid var(--border);
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 8px;
}
.card-body, .panel-body { padding: 16px 18px; }

/* ── TABELLEN ──────────────────────────────────────────── */
.data-table, .table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}
.data-table thead th, .table thead th {
    background: #f8fafc;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 11px 14px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}
.data-table tbody td, .table tbody td {
    padding: 12px 14px;
    border-bottom: 1px solid #f1f5f9;
    color: var(--text);
    vertical-align: middle;
}
.data-table tbody tr:last-child td,
.table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover, .table tbody tr:hover {
    background: #f8fafc;
    cursor: pointer;
}

/* ── BUTTONS ───────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: background 0.15s, box-shadow 0.15s;
    text-decoration: none;
    white-space: nowrap;
}
.btn:hover { text-decoration: none; }
.btn-primary   { background: var(--primary);  color: white; }
.btn-primary:hover { background: var(--primary-hover); color: white; }
.btn-success   { background: #16a34a; color: white; }
.btn-success:hover { background: #15803d; color: white; }
.btn-danger    { background: var(--danger-light); color: var(--danger); border: 1px solid #fecaca; }
.btn-danger:hover  { background: #fecaca; color: var(--danger); }
.btn-secondary { background: #f1f5f9; color: var(--text-muted); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--border); }
.btn-outline-primary { background: transparent; color: var(--primary); border: 1px solid var(--primary); }
.btn-outline-primary:hover { background: var(--primary-light); }
.btn-sm { padding: 5px 12px; font-size: 0.82rem; }
.btn-lg { padding: 11px 22px; font-size: 1rem; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.action-button { /* Legacy */ }
.action-button.secondary-button { background: var(--primary); }

/* ── BADGES / STATUS ───────────────────────────────────── */
.badge, .status-badge, .badge-status, .badge-prio {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
}
/* Ticket Status */
.s-neu, .status-neu           { background: var(--purple-light); color: var(--purple); }
.s-offen, .status-offen       { background: #dbeafe; color: #1d4ed8; }
.s-in-bearbeitung, .status-in-bearbeitung { background: var(--warning-light); color: #92400e; }
.s-erledigt, .status-erledigt { background: var(--success-light); color: #166534; }
.s-geschlossen, .status-geschlossen { background: #f1f5f9; color: var(--text-muted); }
/* Priorität */
.p-dringend, .p-hoch, .prio-dringend, .prio-hoch { background: var(--danger-light); color: var(--danger); }
.p-normal, .prio-normal       { background: #e0f2fe; color: #0369a1; }
.p-niedrig, .prio-niedrig     { background: var(--success-light); color: #16a34a; }
/* Rollen */
.rolle-mieter      { background: #dcfce7; color: #166534; }
.rolle-verwaltung, .rolle-verwalter { background: #fef3c7; color: #92400e; }
.rolle-eigentuemer { background: #ede9fe; color: #6d28d9; }
.rolle-dienstleister { background: #fff7ed; color: #c2410c; }
.rolle-hausmeister { background: #f1f5f9; color: #475569; }
.rolle-betreuer    { background: #e0f2fe; color: #0369a1; }

/* ── FORMULARE ─────────────────────────────────────────── */
.form-control, .form-select {
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 8px 12px;
    font-size: 0.88rem;
    font-family: inherit;
    color: var(--text);
    background: white;
    width: 100%;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.form-control:focus, .form-select:focus {
    outline: none;
    border-color: var(--sidebar-accent);
    box-shadow: 0 0 0 3px rgba(59,130,246,0.12);
}
.form-label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 5px;
}
.form-floating > .form-control { padding-top: 1.4rem; }

/* ── FILTER BAR ────────────────────────────────────────── */
.filter-bar {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 14px 18px;
    margin-bottom: 18px;
    box-shadow: var(--shadow);
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: flex-end;
}

/* ── STATS / KACHELN (Dashboard-Stil) ─────────────────── */
.kpi-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 14px;
    margin-bottom: 22px;
}
.kpi-card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 16px 18px;
    box-shadow: var(--shadow);
    border-left: 5px solid transparent;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: default;
    transition: box-shadow 0.2s;
}
.kpi-card:hover { box-shadow: var(--shadow-md); }
.kpi-card.clickable { cursor: pointer; }
.kpi-card-left { display: flex; flex-direction: column; gap: 4px; }
.kpi-label {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-faint);
}
.kpi-value {
    font-size: 1.9rem;
    font-weight: 700;
    line-height: 1;
    color: var(--text);
}
.kpi-icon {
    font-size: 2rem;
    opacity: 0.18;
    color: var(--text);
}

/* Farbvarianten */
.kpi-card.kpi-neu         { border-left-color: var(--purple); }
.kpi-card.kpi-neu         .kpi-label { color: var(--purple); }
.kpi-card.kpi-offen       { border-left-color: var(--primary); }
.kpi-card.kpi-offen       .kpi-label { color: var(--primary); }
.kpi-card.kpi-bearbeitung { border-left-color: var(--warning); }
.kpi-card.kpi-bearbeitung .kpi-label { color: #b45309; }
.kpi-card.kpi-erledigt    { border-left-color: var(--success); }
.kpi-card.kpi-erledigt    .kpi-label { color: #15803d; }
.kpi-card.kpi-dringend    { border-left-color: var(--danger); }
.kpi-card.kpi-dringend    .kpi-label { color: var(--danger); }

/* Legacy-Aliases damit alte Klassen noch funktionieren */
.stats-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; margin-bottom: 22px; }
.stat-card { background: var(--surface); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); border-left: 5px solid #e2e8f0; }
.stat-label { font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-faint); margin-bottom: 4px; }
.stat-value { font-size: 1.9rem; font-weight: 700; line-height: 1; color: var(--text); }

/* ── INFO ROWS (Detail-Seiten) ─────────────────────────── */
.info-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: 7px 0;
    border-bottom: 1px solid #f1f5f9;
    gap: 8px;
}
.info-row:last-child { border-bottom: none; }
.info-label { font-size: 0.78rem; color: var(--text-faint); white-space: nowrap; }
.info-value { font-size: 0.875rem; color: var(--text); font-weight: 500; text-align: right; }

/* ── TICKET KARTEN ─────────────────────────────────────── */
.ticket-card-wrapper { display: flex; flex-direction: column; }
.ticket-card {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 14px 18px;
    display: flex;
    align-items: center;
    gap: 14px;
    cursor: pointer;
    border-left: 4px solid transparent;
    text-decoration: none;
    color: inherit;
    transition: box-shadow 0.15s, transform 0.1s;
}
.ticket-card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); color: inherit; text-decoration: none; }
.ticket-card.prio-dringend, .ticket-card.prio-hoch { border-left-color: var(--danger); }
.ticket-card.prio-normal    { border-left-color: #3b82f6; }
.ticket-card.prio-niedrig   { border-left-color: var(--success); }
.ticket-card.status-erledigt, .ticket-card.status-geschlossen { opacity: 0.65; }
.ticket-card.status-neu     { border-left-color: var(--purple); }
.ticket-id { font-size: 0.78rem; color: var(--text-faint); font-weight: 600; min-width: 50px; flex-shrink: 0; }
.ticket-body { flex: 1; min-width: 0; }
.ticket-betreff { font-weight: 600; font-size: 0.92rem; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ticket-meta  { font-size: 0.78rem; color: var(--text-faint); margin-top: 2px; }
.ticket-badges { display: flex; gap: 6px; align-items: center; flex-shrink: 0; }
.ticket-date { font-size: 0.78rem; color: var(--text-faint); white-space: nowrap; flex-shrink: 0; }

/* ── BESTÄTIGUNGS-BANNER ───────────────────────────────── */
.confirm-banner {
    background: var(--purple-light);
    border: 1px solid #c4b5fd;
    border-radius: 0 0 var(--radius) var(--radius);
    padding: 10px 16px;
    display: none;
    align-items: center;
    gap: 12px;
    font-size: 0.85rem;
    color: #5b21b6;
    margin-top: -4px;
}
.confirm-banner i { font-size: 1rem; flex-shrink: 0; }
.confirm-banner .text { flex: 1; }
.confirm-banner .text strong { display: block; font-size: 0.85rem; }
.confirm-banner .text small { opacity: 0.75; font-size: 0.78rem; }
.btn-confirm {
    background: var(--purple);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    padding: 6px 14px;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
    transition: background 0.15s;
}
.btn-confirm:hover { background: #6d28d9; }
.btn-confirm:disabled { background: var(--text-faint); cursor: not-allowed; }

/* ── CHAT ──────────────────────────────────────────────── */
.chat-wrapper {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    height: 600px;
}
.chat-header {
    padding: 13px 18px;
    background: #f8fafc;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-muted);
}
#chat-history {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.chat-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-faint);
    gap: 8px;
}
.chat-empty i { font-size: 2rem; }
.chat-empty p { font-size: 0.88rem; margin: 0; }
.chat-message { display: flex; }
.chat-message.own  { justify-content: flex-end; }
.chat-message.other { justify-content: flex-start; }
.chat-bubble { max-width: 72%; padding: 10px 14px; }
.chat-message.own   .chat-bubble { background: #1e40af; color: white; border-radius: 16px 4px 16px 16px; }
.chat-message.other .chat-bubble { background: #f1f5f9; color: var(--text); border-radius: 4px 16px 16px 16px; }
.chat-meta { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 4px; }
.chat-author { font-size: 0.75rem; font-weight: 700; opacity: 0.8; }
.chat-time   { font-size: 0.72rem; opacity: 0.6; }
.chat-text   { font-size: 0.88rem; line-height: 1.5; word-break: break-word; }
.chat-footer { padding: 12px 16px; border-top: 1px solid var(--border); background: #f8fafc; }
.suggestions { display: flex; gap: 6px; margin-bottom: 10px; flex-wrap: wrap; }
.suggestion-btn {
    background: white;
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 4px 12px;
    font-size: 0.78rem;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.15s;
}
.suggestion-btn:hover { border-color: #3b82f6; color: #3b82f6; background: var(--primary-light); }
.input-row { display: flex; gap: 8px; align-items: flex-end; }
#chat-input {
    flex: 1;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 10px 14px;
    font-size: 0.9rem;
    resize: none;
    min-height: 42px;
    max-height: 120px;
    outline: none;
    font-family: inherit;
    transition: border-color 0.15s;
}
#chat-input:focus { border-color: #3b82f6; box-shadow: 0 0 0 3px rgba(59,130,246,0.1); }
#send-button {
    background: #1e40af;
    color: white;
    border: none;
    border-radius: var(--radius);
    padding: 10px 18px;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s;
    height: 42px;
    display: flex;
    align-items: center;
    gap: 6px;
}
#send-button:hover { background: var(--primary-hover); }
#send-button:disabled { background: var(--text-faint); cursor: not-allowed; }

/* ── DETAIL GRID (Ticket/Kontakt/Objekt) ───────────────── */
.detail-grid {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 20px;
    align-items: start;
}
@media (max-width: 900px) {
    .detail-grid { grid-template-columns: 1fr; }
    .sidebar { display: none; }
    .main-content { padding: 16px; }
}

/* ── TOAST SYSTEM (aus utils.js) ───────────────────────── */
#toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
    display: flex;
    flex-direction: column-reverse;
    gap: 10px;
    max-width: 380px;
}
.toast-box {
    background: #1e293b;
    color: #f1f5f9;
    border-radius: var(--radius);
    box-shadow: 0 4px 20px rgba(0,0,0,0.25);
    overflow: hidden;
    animation: toastIn 0.25s ease;
    min-width: 280px;
}
.toast-box.success { border-left: 4px solid var(--success); }
.toast-box.error   { border-left: 4px solid var(--danger); background: #2d1515; color: #fca5a5; }
.toast-box.warning { border-left: 4px solid var(--warning); background: #2d2010; color: #fcd34d; }
.toast-box.undo    { border-left: 4px solid #3b82f6; }
.toast-inner { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; gap: 10px; }
.toast-icon  { font-size: 1.1em; flex-shrink: 0; }
.toast-msg   { flex: 1; font-size: 0.88rem; line-height: 1.4; }
.toast-close { background: none; border: none; color: inherit; opacity: 0.5; cursor: pointer; font-size: 1.1em; padding: 0 4px; flex-shrink: 0; transition: opacity 0.15s; }
.toast-close:hover { opacity: 1; }
.toast-undo-btn {
    background: #3b82f6; color: white; border: none; border-radius: var(--radius-sm);
    padding: 5px 12px; font-size: 0.8rem; font-weight: 600; cursor: pointer; flex-shrink: 0;
    transition: background 0.15s; white-space: nowrap;
}
.toast-undo-btn:hover { background: #2563eb; }
.toast-undo-btn:disabled { background: var(--text-faint); cursor: not-allowed; }
.toast-progress {
    height: 3px; background: #3b82f6; width: 100%;
    transform-origin: left; transition: transform linear;
}
.toast-box.success .toast-progress { background: var(--success); }
.toast-box.error   .toast-progress { background: var(--danger); }
.toast-box.warning .toast-progress { background: var(--warning); }
@keyframes toastIn {
    from { opacity: 0; transform: translateY(16px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ── EMPTY STATE ───────────────────────────────────────── */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-faint);
}
.empty-state i { font-size: 2.8rem; display: block; margin-bottom: 12px; }
.empty-state p { font-size: 0.9rem; margin: 0; }

/* ── SPINNER ───────────────────────────────────────────── */
.spinner-border { border-width: 2px; }

/* ── KONTAKT AVATAR ────────────────────────────────────── */
.contact-avatar {
    width: 38px; height: 38px;
    border-radius: 50%;
    background: var(--primary-light);
    color: var(--primary);
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 0.9rem;
    flex-shrink: 0;
}
.contact-avatar-large {
    width: 72px; height: 72px;
    border-radius: 50%;
    background: var(--primary-light);
    color: var(--primary);
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 1.8rem;
    margin: 0 auto 12px;
}

/* ── BESCHREIBUNG ──────────────────────────────────────── */
.beschreibung-text {
    font-size: 0.88rem;
    color: #334155;
    line-height: 1.6;
    background: #f8fafc;
    border-radius: var(--radius-sm);
    padding: 12px;
    white-space: pre-wrap;
}

/* ── DETAIL SIDEBAR (Kontakt slideout) ─────────────────── */
.details-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.3); z-index: 1040; display: none;
    backdrop-filter: blur(2px);
}
.details-sidebar {
    position: fixed; top: 0; right: -460px; width: 420px; height: 100%;
    background: white; z-index: 1050;
    box-shadow: -5px 0 25px rgba(0,0,0,0.1);
    transition: right 0.3s ease; display: flex; flex-direction: column;
    max-width: 90vw;
}
.details-sidebar.open { right: 0; }
.details-header {
    padding: 18px 20px;
    border-bottom: 1px solid var(--border);
    display: flex; justify-content: space-between; align-items: center;
}
.details-body { padding: 20px; overflow-y: auto; flex: 1; }

/* ── DIVERSE LEGACY ────────────────────────────────────── */
.section-label {
    font-size: 0.72rem; text-transform: uppercase;
    letter-spacing: 0.07em; font-weight: 700;
    color: var(--text-faint); margin: 16px 0 10px;
}
.detail-row { margin-bottom: 12px; padding-bottom: 8px; border-bottom: 1px dashed #f0f0f0; }
.detail-label { font-size: 0.78rem; color: var(--text-faint); display: block; margin-bottom: 2px; }
.detail-value { font-size: 0.92rem; font-weight: 500; color: var(--text); }
.global-nav { background: var(--sidebar-bg); padding: 0 24px; height: 56px; display: flex; align-items: center; justify-content: space-between; }
.global-nav .brand { color: white; font-weight: 700; font-size: 1.05rem; text-decoration: none; }
.global-nav .nav-links a { color: var(--sidebar-text); text-decoration: none; margin-left: 18px; font-size: 0.85rem; transition: color 0.15s; }
.global-nav .nav-links a:hover { color: white; }

/* ── FILTER BUTTONS (Objekttyp & Kontaktrolle) ─────────── */
/* Basis – inaktiv: kein Hintergrund, kein Rahmen */
.filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 14px;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    border: 2px solid transparent;
    background: transparent;
    color: var(--text-muted);
    transition: all 0.15s;
    user-select: none;
    white-space: nowrap;
}
.filter-chip:hover { opacity: 0.85; }
.filter-chip.active { border-color: transparent !important; }

/* ── Objekttypen: inaktiv = sehr heller Tint + zarter farbiger Rand ── */
.filter-chip[data-typ="MFH"]       { background: #f0f6ff; color: #1d4ed8; border-color: #93c5fd; }
.filter-chip[data-typ="WEG"]       { background: #f0fdff; color: #0e7490; border-color: #67e8f9; }
.filter-chip[data-typ="Gewerbe"]   { background: #fefff0; color: #a16207; border-color: #fde047; }
.filter-chip[data-typ="Misch"]     { background: #f8f9fa; color: #475569; border-color: #ced4da; }
.filter-chip[data-typ="Garage"]    { background: #f8f9fa; color: #374151; border-color: #adb5bd; }
.filter-chip[data-typ="Sonstiges"] { background: #f8fafc; color: #64748b; border-color: #cbd5e1; }
.filter-chip[data-typ="EFH"]       { background: #f0faf4; color: #166534; border-color: #86efac; }
.filter-chip[data-typ="ZFH"]       { background: #f0fdfb; color: #0f766e; border-color: #5eead4; }
.filter-chip[data-typ="Doppelhaus"]{ background: #f0fdff; color: #0e7490; border-color: #67e8f9; }
.filter-chip[data-typ="Reihenhaus"]{ background: #faf5ff; color: #6d28d9; border-color: #c4b5fd; }
.filter-chip[data-typ="Büro"]      { background: #fff9f5; color: #c2410c; border-color: #fdba74; }
.filter-chip[data-typ="Lager"]     { background: #f8f9fa; color: #475569; border-color: #ced4da; }

/* ── Objekttypen aktiv: volle Badge-Farbe ── */
.filter-chip[data-typ="MFH"].active       { background: #0d6efd; color: #fff; }
.filter-chip[data-typ="WEG"].active       { background: #0dcaf0; color: #000; }
.filter-chip[data-typ="Gewerbe"].active   { background: #ffc107; color: #000; }
.filter-chip[data-typ="Misch"].active     { background: #6c757d; color: #fff; }
.filter-chip[data-typ="Garage"].active    { background: #212529; color: #fff; }
.filter-chip[data-typ="Sonstiges"].active { background: #e2e8f0; color: #475569; }
.filter-chip[data-typ="EFH"].active       { background: #198754; color: #fff; }
.filter-chip[data-typ="ZFH"].active       { background: #20c997; color: #fff; }
.filter-chip[data-typ="Doppelhaus"].active{ background: #0dcaf0; color: #000; }
.filter-chip[data-typ="Reihenhaus"].active{ background: #6610f2; color: #fff; }
.filter-chip[data-typ="Büro"].active      { background: #fd7e14; color: #fff; }
.filter-chip[data-typ="Lager"].active     { background: #6c757d; color: #fff; }

/* ── Kontaktrollen: inaktiv = sehr heller Tint + zarter farbiger Rand ── */
.filter-chip[data-rolle="Mieter"]        { background: #f0faf4; color: #198754; border-color: #a3cfbb; }
.filter-chip[data-rolle="Dienstleister"] { background: #fffdf0; color: #997404; border-color: #ffe69c; }
.filter-chip[data-rolle="Betreuer"]      { background: #f8f9fa; color: #6c757d; border-color: #ced4da; }
.filter-chip[data-rolle="Verwaltung"],
.filter-chip[data-rolle="Verwalter"]     { background: #fff5f5; color: #dc3545; border-color: #f1aeb5; }
.filter-chip[data-rolle="Hausmeister"]   { background: #f5f5f5; color: #495057; border-color: #adb5bd; }
.filter-chip[data-rolle="Eigentümer"]    { background: #f0fbfe; color: #0e7490; border-color: #9eeaf9; }
.filter-chip[data-rolle="Handwerker"]    { background: #fffdf0; color: #997404; border-color: #ffe69c; }
.filter-chip[data-rolle="Admin"]         { background: #fff5f5; color: #dc3545; border-color: #f1aeb5; }

/* ── Kontaktrollen aktiv: exakt die Badge-Farbe ── */
.filter-chip[data-rolle="Mieter"].active        { background: #198754; color: #fff; }
.filter-chip[data-rolle="Dienstleister"].active { background: #ffc107; color: #212529; }
.filter-chip[data-rolle="Betreuer"].active      { background: #6c757d; color: #fff; }
.filter-chip[data-rolle="Verwaltung"].active,
.filter-chip[data-rolle="Verwalter"].active     { background: #dc3545; color: #fff; }
.filter-chip[data-rolle="Hausmeister"].active   { background: #212529; color: #fff; }
.filter-chip[data-rolle="Eigentümer"].active    { background: #0dcaf0; color: #212529; }
.filter-chip[data-rolle="Handwerker"].active    { background: #ffc107; color: #212529; }
.filter-chip[data-rolle="Admin"].active         { background: #dc3545; color: #fff; }

/* Ticket-Status KPI Kachel – Klick-Filter */
.kpi-card.clickable { cursor: pointer; }
.kpi-card.kpi-neu.active         { box-shadow: 0 0 0 3px var(--purple);  background: #f5f3ff; }
.kpi-card.kpi-offen.active       { box-shadow: 0 0 0 3px var(--primary); background: #eff6ff; }
.kpi-card.kpi-bearbeitung.active { box-shadow: 0 0 0 3px var(--warning); background: #fffbeb; }
.kpi-card.kpi-erledigt.active    { box-shadow: 0 0 0 3px var(--success); background: #f0fdf4; }
.kpi-card.kpi-dringend.active    { box-shadow: 0 0 0 3px var(--danger);  background: #fef2f2; }

/* ── Mieter-Live-Dropdown (Mietverhältnisse) ─────────────────── */
.mieter-live-dropdown {
    display: none; position: absolute; top: calc(100% + 2px); left: 0; right: 0; z-index: 500;
    background: #fff; border: 1.5px solid #e2e8f0; border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.1);
    max-height: 246px; /* ~6 Zeilen */ overflow-y: auto;
    scrollbar-width: thin; scrollbar-color: #cbd5e1 transparent;
}
.mieter-live-dropdown.open { display: block; }
.mieter-live-dropdown::-webkit-scrollbar { width: 5px; }
.mieter-live-dropdown::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }
.mieter-live-item {
    padding: 9px 13px; cursor: pointer; font-size: 0.85rem;
    display: flex; align-items: center; justify-content: space-between;
    gap: 8px; color: #0f172a; border-bottom: 1px solid #f8fafc;
}
.mieter-live-item:last-child { border-bottom: none; }
.mieter-live-item:hover { background: #f0f6ff; }
.mieter-live-item.new-mieter {
    background: #f0fdf4; color: #166534; font-weight: 600;
    border-top: 1px solid #bbf7d0; position: sticky; bottom: 0;
}
.mieter-live-item.new-mieter:hover { background: #dcfce7; }
.mieter-live-item .ml-sub { font-size: 0.73rem; color: #94a3b8; }
