/* ============================================================
   PORTFOLIO DASHBOARD — Redesign
   Baut auf den Tokens aus design-system.css auf (--brand-600,
   --bg, --surface, --border, --text, --text-muted, --positive,
   --negative, --warning, --info, ...). Keine Farbverläufe,
   sehr subtile Schatten, ruhige Flächen.
   ============================================================ */

:root {
    --sidebar-bg: #14233A;
    --sidebar-bg-2: #182B45;
    --sidebar-border: rgba(255,255,255,0.08);
    --sidebar-text: #A9B6C9;
    --sidebar-text-dim: #7488A3;
    --shadow-sm: 0 2px 8px rgba(20,40,70,0.05);
    --shadow-md: 0 6px 20px rgba(20,40,70,0.09);
    --radius-card: 12px;
    --radius-btn: 9px;
}

* { box-sizing: border-box; }
body {
    font-size: 14px;
    font-family: 'Inter', system-ui, -apple-system, "Segoe UI", sans-serif;
    background: var(--bg);
    color: var(--text);
}

/* ============================================================
   SIDEBAR
   ============================================================ */
.sidebar {
    position: fixed; left: 0; top: 0; height: 100vh; width: 240px;
    background: var(--sidebar-bg); color: var(--sidebar-text);
    display: flex; flex-direction: column; z-index: 30;
    transition: transform 0.2s ease;
}
.sidebar-header {
    padding: 22px 20px 18px; border-bottom: 1px solid var(--sidebar-border);
    display: flex; align-items: center; gap: 10px;
}
.sidebar-brand { display: flex; align-items: center; text-decoration: none; min-width: 0; }
.sidebar-brand-logo { height: 32px; width: auto; max-width: 100%; object-fit: contain; }
.sidebar-close { display: none; margin-left: auto; background: none; border: none; color: var(--sidebar-text-dim); cursor: pointer; padding: 4px; }
.sidebar-close:hover { color: #fff; }

.sidebar-nav {
    flex: 1; overflow-y: auto;
    scrollbar-width: thin; scrollbar-color: rgba(255,255,255,0.15) transparent;
}
.sidebar-nav::-webkit-scrollbar { width: 5px; }
.sidebar-nav::-webkit-scrollbar-track { background: transparent; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 3px; }
.sidebar-nav::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.28); }
.sidebar-section { padding: 10px 0; border-bottom: 1px solid var(--sidebar-border); }
.sidebar-section-title { padding: 8px 20px; font-size: 10.5px; color: var(--sidebar-text-dim); text-transform: uppercase; font-weight: 700; letter-spacing: 0.06em; }

.nav-item {
    display: flex; align-items: center; gap: 12px; padding: 10px 20px;
    color: var(--sidebar-text); text-decoration: none; font-size: 13.5px; font-weight: 500;
    transition: background 0.15s, color 0.15s; position: relative;
}
.nav-item:hover { background: rgba(255,255,255,0.06); color: #fff; }
.nav-item.active {
    background: rgba(23,92,59,0.32); color: #fff; font-weight: 600;
    box-shadow: inset 3px 0 0 0 #2FA97A;
}
.nav-item .nav-icon { width: 20px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; opacity: 0.85; }
.nav-item.active .nav-icon { opacity: 1; color: #4ADE9C; }
.nav-item .badge {
    margin-left: auto; background: rgba(255,255,255,0.12); color: #fff;
    padding: 1px 9px; border-radius: 999px; font-size: 10.5px; font-weight: 700;
}
.nav-item.active .badge { background: rgba(255,255,255,0.25); }
.badge-brand { background: var(--brand-600) !important; color: #fff !important; }
.badge-muted { background: rgba(255,255,255,0.12); color: var(--sidebar-text); }
.nav-item-upgrade { color: #fff; background: var(--brand-600); margin-top: 2px; }
.nav-item-upgrade:hover { background: var(--brand-800); }

.sidebar-footer { padding: 14px; border-top: 1px solid var(--sidebar-border); }
.user-menu { background: rgba(255,255,255,0.05); border-radius: 10px; padding: 10px; }
.user-menu-row { display: flex; align-items: center; gap: 8px; }
.user-menu-link { display: flex; align-items: center; gap: 10px; text-decoration: none; flex: 1; min-width: 0; }
.user-avatar {
    width: 36px; height: 36px; border-radius: 50%; background: var(--brand-600); color: #fff;
    display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px; flex-shrink: 0;
}
.user-info { flex: 1; min-width: 0; }
.user-name { font-weight: 600; font-size: 13px; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-plan { font-size: 11px; color: var(--sidebar-text-dim); margin-top: 1px; }
.user-menu-toggle { background: none; border: none; cursor: pointer; color: var(--sidebar-text-dim); padding: 4px; flex-shrink: 0; }
.user-menu-toggle:hover { color: #fff; }
.user-dropdown { display: none; margin-top: 10px; background: rgba(0,0,0,0.2); border-radius: 8px; overflow: hidden; }
.user-dropdown.show { display: block; }
.user-dropdown a, .user-dropdown button {
    display: flex; align-items: center; gap: 9px; padding: 10px 12px; color: var(--sidebar-text); font-size: 12.5px;
    text-decoration: none; width: 100%; border: none; background: none; cursor: pointer; text-align: left;
}
.user-dropdown a:hover, .user-dropdown button:hover { background: rgba(255,255,255,0.08); color: #fff; }
.user-dropdown .danger { color: #f38b8b; }
.user-dropdown .danger:hover { background: rgba(180,35,24,0.25); }

.sidebar-backdrop { display: none; position: fixed; inset: 0; background: rgba(15,23,42,0.5); z-index: 29; }
.sidebar-backdrop.show { display: block; }
.sidebar-mobile-toggle { display: none; background: none; border: none; color: var(--text); cursor: pointer; padding: 6px; margin-right: 6px; flex-shrink: 0; }

/* ============================================================
   MAIN / TOPBAR
   ============================================================ */
.main-content { margin-left: 240px; min-height: 100vh; }

.topbar {
    background: var(--surface); border-bottom: 1px solid var(--border);
    padding: 12px 28px; display: flex; align-items: center; gap: 18px;
    position: sticky; top: 0; z-index: 20;
}
.topbar-search { flex: 1; max-width: 440px; position: relative; display: flex; align-items: center; }
.topbar-search-icon { position: absolute; left: 12px; color: var(--text-muted); display: flex; }
.topbar-search input {
    width: 100%; padding: 9px 14px 9px 36px; border: 1px solid var(--border); border-radius: var(--radius-btn);
    font-size: 13.5px; background: var(--bg); color: var(--text); transition: border-color 0.15s, background 0.15s;
}
.topbar-search input:focus { outline: none; border-color: var(--brand-600); background: var(--surface); }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.icon-btn {
    width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--border); background: var(--surface);
    color: var(--text-muted); display: flex; align-items: center; justify-content: center; cursor: pointer; transition: all 0.15s;
}
.icon-btn:hover { background: var(--bg); color: var(--text); }
.topbar-search-toggle { display: none; flex-shrink: 0; }
.topbar-search-close { display: none; background: none; border: none; color: var(--text-muted); cursor: pointer; padding: 4px; }

.content-area { padding: 26px 28px 60px; max-width: 1560px; margin: 0 auto; }

.dashboard-header { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.dashboard-header h1 { font-weight: 700; font-size: 26px; color: var(--text); letter-spacing: -0.01em; }
.dashboard-subline { font-size: 13.5px; color: var(--text-muted); margin-top: 3px; }
.dashboard-header-meta { text-align: right; }
.meta-date { font-size: 12.5px; color: var(--text-muted); display: flex; align-items: center; gap: 6px; }

/* ============================================================
   SHARED SURFACES / BUTTONS / FORMS
   ============================================================ */
.surface-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-card); padding: 20px; box-shadow: var(--shadow-sm); }
.card-title { font-weight: 700; font-size: 15px; color: var(--text); }
.card-subtitle { font-size: 12.5px; color: var(--text-muted); margin-top: 2px; }

.btn {
    padding: 9px 16px; border-radius: var(--radius-btn); font-size: 13px; font-weight: 600; cursor: pointer;
    border: none; transition: all 0.15s; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
}
.btn-primary { background: var(--brand-600); color: #fff; }
.btn-primary:hover { background: var(--brand-800); }
.btn-secondary { background: var(--bg); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { background: #ECEFED; }
.btn-danger { background: var(--negative-bg); color: var(--negative); }
.btn-danger:hover { background: #fbdada; }
.btn-success { background: var(--positive); color: #fff; }
.btn-success:hover { opacity: 0.9; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-sm { padding: 7px 12px; font-size: 12px; }

.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 11.5px; color: var(--text-muted); margin-bottom: 6px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.03em; }
.form-input { width: 100%; padding: 10px 14px; border: 1.5px solid var(--border); border-radius: var(--radius-btn); font-size: 14px; transition: border-color 0.15s; background: var(--surface); color: var(--text); }
.form-input:focus { outline: none; border-color: var(--brand-600); }
.form-section { background: var(--bg); border-radius: 10px; padding: 16px; margin-bottom: 16px; }
.form-section-title { font-size: 13px; font-weight: 700; margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }

.modal-backdrop { position: fixed; inset: 0; background: rgba(10,15,25,0.55); display: flex; align-items: center; justify-content: center; z-index: 100; padding: 16px; }
.modal { background: var(--surface); border-radius: 16px; width: 100%; max-width: 700px; max-height: 90vh; overflow: hidden; box-shadow: var(--shadow-md); }
.modal-header { padding: 18px 22px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; }
.modal-body { max-height: 60vh; overflow-y: auto; padding: 22px; }
.modal-footer { padding: 16px 22px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 12px; background: var(--bg); }
.modal-close-btn { font-size: 26px; color: var(--text-muted); background: none; border: none; cursor: pointer; line-height: 1; }

.flash-message { padding: 13px 18px; border-radius: 10px; margin-bottom: 20px; font-weight: 500; font-size: 13.5px; }
.flash-success { background: var(--positive-bg); color: var(--positive); }
.flash-error { background: var(--negative-bg); color: var(--negative); }

.guest-banner {
    background: var(--brand-50); border: 1px solid var(--positive-border);
    border-radius: 999px; padding: 8px 8px 8px 16px; margin-bottom: 18px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.guest-banner-icon { color: var(--brand-600); flex-shrink: 0; display: flex; }
.guest-banner-text { flex: 1; min-width: 160px; font-size: 12.5px; font-weight: 600; color: var(--text); }
.guest-banner-body { flex: 1; min-width: 200px; }
.guest-banner-title { font-weight: 700; color: var(--text); font-size: 13.5px; }
.guest-banner-body .guest-banner-text { font-weight: 400; color: var(--text-muted); margin-top: 2px; }
.guest-banner:has(.guest-banner-body) { border-radius: var(--radius-card); border-left: 4px solid var(--brand-600); padding: 14px 18px; }
.guest-cta {
    background: var(--brand-600); color: #fff; padding: 7px 14px; border-radius: 999px; font-size: 12px;
    font-weight: 700; text-decoration: none; transition: background 0.15s; white-space: nowrap; display: inline-flex; align-items: center; gap: 5px;
}
.guest-cta:hover { background: var(--brand-800); }
@media (max-width: 480px) {
    .guest-banner { padding: 7px 6px 7px 12px; }
    .guest-banner-text { font-size: 11.5px; }
    .guest-cta { padding: 6px 11px; font-size: 11px; }
}

.section-intro { margin-bottom: 18px; }
.section-intro h2 { font-weight: 700; font-size: 18px; color: var(--text); }
.section-intro p { color: var(--text-muted); font-size: 13px; margin-top: 4px; }

.empty-inline { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-card); padding: 36px; text-align: center; color: var(--text-muted); font-size: 13.5px; }
.empty-inline a { color: var(--brand-600); font-weight: 600; }

/* ============================================================
   KPI CARDS
   ============================================================ */
.kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 24px; }
.kpi-card2 { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-card); padding: 16px 18px; box-shadow: var(--shadow-sm); }
.kpi-top { margin-bottom: 8px; }
.kpi-icon { width: 30px; height: 30px; border-radius: 50%; display: flex; align-items: center; justify-content: center; }
.kpi-icon-brand { background: var(--brand-50); color: var(--brand-600); }
.kpi-icon-info { background: var(--info-bg); color: var(--info); }
.kpi-label { font-size: 11px; color: var(--text-muted); text-transform: uppercase; font-weight: 600; letter-spacing: 0.03em; }
.kpi-value { font-size: 25px; font-weight: 700; margin-top: 3px; color: var(--text); line-height: 1.1; }
.kpi-sub { font-size: 11.5px; color: var(--text-muted); margin-top: 4px; }
.v-pos { color: var(--positive) !important; }
.v-neg { color: var(--negative) !important; }

/* ============================================================
   DASHBOARD GRID — Karte, Status/Cashflow und Objektliste als eine
   Einheit. Desktop: Karte+Analytics nebeneinander, Objekte darunter
   volle Breite. Mobile: Karte -> Objekte -> Analytics (per area-Reihenfolge).
   ============================================================ */
.dashboard-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    grid-template-areas: "map side" "objects objects";
    gap: 20px; margin-bottom: 28px; align-items: start;
}
.dashboard-grid > .map-card { grid-area: map; }
.dashboard-grid > .side-col { grid-area: side; }
.dashboard-grid > .objects-block { grid-area: objects; min-width: 0; }
.map-card { padding: 20px; }
.map-card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.map-filters { display: flex; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.map-filter-chip {
    padding: 6px 14px; border-radius: 999px; font-size: 12px; font-weight: 600; border: 1px solid var(--border);
    background: var(--surface); color: var(--text-muted); cursor: pointer; transition: all 0.15s;
}
.map-filter-chip:hover { border-color: var(--brand-600); color: var(--text); }
.map-filter-chip.active { background: var(--brand-600); color: #fff; border-color: var(--brand-600); }

.map-canvas-wrap { position: relative; border-radius: 10px; overflow: hidden; border: 1px solid var(--border); }
.map-canvas { width: 100%; height: 440px; background: var(--bg); }
.map-legend {
    position: absolute; bottom: 12px; left: 12px; background: rgba(255,255,255,0.95); border: 1px solid var(--border);
    border-radius: 8px; padding: 8px 12px; display: flex; gap: 12px; font-size: 11.5px; color: var(--text); box-shadow: var(--shadow-sm);
}
.map-legend span { display: flex; align-items: center; gap: 6px; }
.map-legend i { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }

.lsd-marker span { display: block; width: 16px; height: 16px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,0.35); }

.map-popup { min-width: 190px; font-family: inherit; }
.map-popup .mp-badge { display: inline-block; font-size: 10.5px; font-weight: 700; padding: 2px 9px; border-radius: 999px; margin-bottom: 6px; }
.map-popup .mp-title { font-weight: 700; font-size: 13.5px; color: #17211B; }
.map-popup .mp-sub { font-size: 11.5px; color: #66716A; margin-bottom: 6px; }
.map-popup .mp-row { display: flex; justify-content: space-between; font-size: 12px; color: #66716A; padding: 2px 0; }
.map-popup .mp-row b { color: #17211B; }
.map-popup .mp-link { display: inline-block; margin-top: 8px; font-size: 12px; font-weight: 700; color: #175C3B; text-decoration: none; }

.side-col { display: flex; flex-direction: column; gap: 20px; }
.status-card, .cashflow-card { padding: 20px; }
.donut-wrap { position: relative; width: 140px; height: 140px; margin: 14px auto 16px; }
.donut-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.donut-center-value { font-size: 22px; font-weight: 700; color: var(--text); line-height: 1; }
.donut-center-label { font-size: 10.5px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.03em; margin-top: 2px; }
.status-legend { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.status-legend li { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--text-muted); }
.status-legend .dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.status-legend b { margin-left: auto; color: var(--text); font-weight: 700; }

.cashflow-value { font-size: 26px; font-weight: 700; margin-top: 6px; }
.cashflow-empty { text-align: center; padding: 10px 0; }
.cashflow-empty p { color: var(--text-muted); font-size: 13px; margin-bottom: 14px; }

/* ============================================================
   OBJECTS SECTION
   ============================================================ */
.objects-section-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; flex-wrap: wrap; gap: 10px; }
.section-title { font-weight: 700; font-size: 15px; color: var(--text); display: flex; align-items: center; gap: 8px; }
.title-bar { width: 3px; height: 16px; background: var(--brand-600); border-radius: 2px; display: inline-block; }
.objects-head-controls { display: flex; align-items: center; gap: 16px; }
.select-all-inline { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--text-muted); cursor: pointer; }
.select-all-inline input { width: 16px; height: 16px; accent-color: var(--brand-600); }
.view-toggle { display: flex; border: 1px solid var(--border); border-radius: var(--radius-btn); overflow: hidden; }
.view-toggle-btn { padding: 7px 10px; background: var(--surface); border: none; color: var(--text-muted); cursor: pointer; display: flex; }
.view-toggle-btn + .view-toggle-btn { border-left: 1px solid var(--border); }
.view-toggle-btn.active { background: var(--brand-600); color: #fff; }

.object-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; margin-bottom: 30px; }

.property-card { background: var(--surface); border: 1.5px solid var(--border); border-radius: var(--radius-card); overflow: visible; transition: border-color 0.15s, box-shadow 0.15s; position: relative; }
.property-card:hover { border-color: #C7CFCB; box-shadow: var(--shadow-md); }
.property-card.selected { border-color: var(--brand-600); box-shadow: 0 0 0 3px rgba(23,92,59,0.14); }
.property-card.is-fresh { border-color: var(--positive); box-shadow: 0 0 0 3px rgba(23,92,59,0.14); }
.fresh-flag { background: var(--positive); color: #fff; padding: 5px 16px; font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; border-radius: 10px 10px 0 0; }

/* Medienkopf: zeigt ein echtes Karten-Thumbnail der Adresse, sobald sie
   geokodiert ist (siehe JS weiter unten) — bis dahin ein ruhiger, brand-
   getoenter Platzhalter mit Typ-Icon. Keine erfundenen Immobilienfotos. */
.property-media {
    position: relative; height: 128px; border-radius: var(--radius-card) var(--radius-card) 0 0;
    background: var(--brand-50); display: flex; align-items: center; justify-content: center;
    background-size: cover; background-position: center;
}
.property-media-icon { font-size: 2.1rem; opacity: 0.55; }
.property-media.has-photo .property-media-icon { display: none; }
.property-media.has-photo { background-color: var(--bg); }

.property-select { position: absolute; top: 10px; left: 10px; cursor: pointer; z-index: 5; }
.property-select input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.property-select-box {
    width: 24px; height: 24px; border-radius: 7px; background: rgba(255,255,255,0.92); border: 1.5px solid rgba(23,34,53,0.15);
    display: flex; align-items: center; justify-content: center; color: transparent; transition: all 0.15s; box-shadow: var(--shadow-sm);
}
.property-select input:checked + .property-select-box { background: var(--brand-600); border-color: var(--brand-600); color: #fff; }

.property-media-status { position: absolute; top: 10px; right: 10px; z-index: 5; }
.status-badge-onmedia { background: rgba(255,255,255,0.94); box-shadow: var(--shadow-sm); }

.property-body { padding: 14px 16px 12px; }
.property-title-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.property-title { font-weight: 700; font-size: 14.5px; color: var(--text); text-decoration: none; }
.deal-score-badge { font-size: 11px; font-weight: 700; padding: 2px 9px; border-radius: 999px; }
.property-address { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

.status-dropdown { position: relative; display: inline-block; z-index: 10; }
.status-dropdown:hover { z-index: 100; }
.status-dropdown:hover .status-dropdown-content { display: block; }
.status-dropdown-content {
    display: none; position: absolute; top: 100%; right: 0; background: var(--surface); border: 1px solid var(--border);
    border-radius: 10px; box-shadow: var(--shadow-md); z-index: 1000; min-width: 180px; overflow: hidden; padding-top: 6px; margin-top: -2px;
}
.status-dropdown-item { display: flex; align-items: center; gap: 10px; padding: 11px 15px; font-size: 12.5px; color: var(--text); cursor: pointer; transition: background 0.15s; }
.status-dropdown-item:hover { background: var(--bg); }
.status-badge { display: inline-flex; align-items: center; gap: 4px; padding: 4px 11px; border-radius: 999px; font-size: 11px; font-weight: 600; cursor: pointer; }
.strategie-badge { display: inline-flex; align-items: center; margin-top: 9px; padding: 4px 11px; border-radius: 999px; font-size: 11px; font-weight: 600; color: #fff; }

.property-metrics-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--bg); }
.pm-label { font-size: 9.5px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.03em; margin-bottom: 3px; }
.pm-value { font-weight: 700; font-size: 14.5px; color: var(--text); }

.property-submetrics { display: flex; gap: 18px; font-size: 11px; flex-wrap: wrap; color: var(--text-muted); margin-bottom: 12px; }

.details-toggle {
    width: 100%; padding: 9px; background: var(--bg); border: none; border-top: 1px solid var(--border); font-size: 11px;
    color: var(--text-muted); cursor: pointer; font-weight: 600; display: flex; align-items: center; justify-content: center; gap: 5px;
}
.details-toggle:hover { background: #ECEFED; }
.details-content { display: none; padding: 16px; background: var(--bg); border-top: 1px solid var(--border); }
.details-content.show { display: block; }
.detail-note { background: var(--warning-bg); padding: 11px; border-radius: 8px; margin-bottom: 12px; font-size: 12px; color: var(--text); }
.detail-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.detail-actions .btn { flex: 1; justify-content: center; min-width: 100px; }
.detail-hint { flex: 2; font-size: 11px; color: var(--text-muted); align-self: center; padding-left: 6px; }

/* ============================================================
   LIST VIEW (TABLE)
   ============================================================ */
.object-table-wrap { padding: 0; overflow-x: auto; margin-bottom: 30px; }
.object-table { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 720px; }
.object-table th { text-align: left; padding: 12px 16px; font-size: 11px; text-transform: uppercase; letter-spacing: 0.03em; color: var(--text-muted); border-bottom: 1px solid var(--border); font-weight: 700; user-select: none; }
.object-table td { padding: 12px 16px; border-bottom: 1px solid var(--bg); vertical-align: middle; }
.object-table tr:last-child td { border-bottom: none; }
.object-table th.num, .object-table td.num { text-align: right; }
.object-table .actions-col { text-align: right; }
.ot-name { font-weight: 600; color: var(--text); }
.ot-address { font-size: 11.5px; color: var(--text-muted); margin-top: 1px; }

/* ============================================================
   QUICK ACCESS
   ============================================================ */
.quickaccess { border-top: 1px solid var(--bg); padding-top: 24px; }
.quickaccess-title { font-weight: 600; font-size: 12.5px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 12px; }
.quickaccess-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.quick-card {
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-card); padding: 14px 16px;
    display: flex; align-items: center; gap: 12px; text-decoration: none; color: inherit; transition: border-color 0.15s, box-shadow 0.15s;
}
.quick-card:hover { border-color: var(--brand-600); box-shadow: var(--shadow-sm); }
.quick-card-icon { width: 34px; height: 34px; border-radius: 50%; background: var(--brand-50); color: var(--brand-600); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.quick-card-body { flex: 1; min-width: 0; }
.quick-card-label { display: block; font-weight: 600; font-size: 13px; color: var(--text); }
.quick-card-desc { display: block; font-size: 11.5px; color: var(--text-muted); margin-top: 1px; }

/* ============================================================
   EMPTY STATES
   ============================================================ */
.empty-state { background: var(--surface); border-radius: 16px; padding: 44px 30px; text-align: center; border: 1.5px dashed var(--border); }
.empty-state-icon { color: var(--brand-600); margin-bottom: 14px; display: flex; align-items: center; justify-content: center; }
.empty-state h3 { font-size: 17px; font-weight: 700; color: var(--text); margin-bottom: 8px; }
.empty-state p { font-size: 13.5px; color: var(--text-muted); margin-bottom: 22px; max-width: 380px; margin-left: auto; margin-right: auto; line-height: 1.6; }
.empty-state-actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }

/* ============================================================
   NOTES / ZVG-LIST
   ============================================================ */
.notes-heading { font-weight: 700; margin-bottom: 14px; }
.notes-heading-warn { color: var(--warning); }
.notes-heading-neg { color: var(--negative); }
.note-item { padding: 13px; border-radius: 8px; margin-bottom: 10px; }
.note-item-warn { background: var(--warning-bg); }
.note-item-neg { background: var(--negative-bg); }
.note-item-title { font-weight: 600; font-size: 13px; }
.note-item-text { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

.zvg-row { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-card); padding: 16px 20px; display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.zvg-row-title { font-weight: 700; color: var(--text); }
.zvg-row-address { color: var(--text-muted); font-size: 13px; margin-top: 3px; }
.zvg-row-meta { color: var(--text-muted); font-size: 11.5px; margin-top: 3px; }
.zvg-row-value { text-align: right; }
.zvg-row-value-num { font-weight: 700; color: var(--text); font-size: 14.5px; }
.zvg-row-value-label { color: var(--text-muted); font-size: 11px; }
.zvg-row-actions { display: flex; gap: 8px; }

/* ============================================================
   SELECTION TOOLBAR (floating)
   ============================================================ */
.selection-toolbar {
    position: fixed; left: 50%; bottom: 22px; transform: translate(-50%, 20px);
    background: var(--sidebar-bg); color: #fff; border-radius: 999px; padding: 10px 12px 10px 20px;
    display: flex; align-items: center; gap: 16px; box-shadow: var(--shadow-md); z-index: 40;
    opacity: 0; pointer-events: none; transition: opacity 0.18s, transform 0.18s;
}
.selection-toolbar.show { opacity: 1; pointer-events: auto; transform: translate(-50%, 0); }
.selection-toolbar-count { font-size: 13px; }
.selection-toolbar-count strong { color: #fff; }
.selection-toolbar-actions { display: flex; gap: 8px; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
/* Etwas schmalere Seitenspalte statt frueh zu stapeln — bleibt auf
   normalen Laptop-Breiten (ab ~1024px Inhaltsbreite) nebeneinander. */
@media (max-width: 1320px) {
    .dashboard-grid { grid-template-columns: minmax(0, 1fr) 300px; }
}
@media (max-width: 880px) {
    .dashboard-grid { grid-template-columns: 1fr; grid-template-areas: "map" "objects" "side"; }
    .side-col { flex-direction: row; }
    .side-col > .surface-card { flex: 1; }
    .kpi-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
    .side-col { flex-direction: column; }
}
@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); }
    .sidebar-close { display: block; }
    .sidebar-mobile-toggle { display: inline-flex; align-items: center; justify-content: center; }
    .main-content { margin-left: 0; }
    .topbar { padding: 10px 14px; gap: 8px; }
    .content-area { padding: 18px 16px 60px; }
    .dashboard-header-meta { display: none; }
    .quickaccess-grid { grid-template-columns: 1fr 1fr; }
    .map-canvas { height: 320px; }

    /* Suche wird zum Icon-Button, oeffnet sich als Overlay ueber die volle Breite */
    .topbar-search { display: none; }
    .topbar.search-open .topbar-search {
        display: flex; position: absolute; left: 0; right: 0; top: 0; height: 100%;
        max-width: none; padding: 8px 14px; background: var(--surface); z-index: 5; align-items: center;
    }
    .topbar-search-toggle { display: inline-flex; }
    .topbar.search-open .sidebar-mobile-toggle,
    .topbar.search-open .topbar-search-toggle,
    .topbar.search-open .topbar-actions { visibility: hidden; }
    .topbar-search-close { display: none; }
    .topbar.search-open .topbar-search-close { display: inline-flex; margin-left: 8px; }
    .btn-add-label { display: none; }
}
@media (max-width: 480px) {
    .kpi-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
    .kpi-card2 { padding: 13px 14px; }
    .kpi-value { font-size: 22px; }
    .kpi-sub { display: none; }
    .quickaccess-grid { grid-template-columns: 1fr; }
    .selection-toolbar { left: 12px; right: 12px; bottom: 12px; transform: translateY(20px); width: auto; flex-wrap: wrap; }
    .selection-toolbar.show { transform: translateY(0); }
}
