/* Einfaches, aufgeräumtes Design. Bewusst schlicht und schnell.
   Passt sich an schmale Bildschirme (Handy) an. */

:root {
    /* Markenpalette (Redesign 2026): Navy + ruhige Blau-/Grautöne. */
    --navy: #0A2346;           /* Seitenleiste, Hauptakzent */
    --navy-hover: #16386B;
    --blau: #0A2346;           /* Hauptakzent (Links, Reiter, Knöpfe) */
    --blau-mittel: #1D4E9A;    /* zweitrangiges Blau */
    --blau-hell: #E8EFFC;      /* sehr helles Blau (Chips, aktive Flächen) */
    --badge-blau: #2F6FD6;
    --teal-dunkel: #16386B;    /* dunkler Akzent (Hover) */
    --gruen-btn: #0A2346;      /* Aktionsknöpfe im Navy */
    --text: #0E1B2E;
    --text2: #5B6B82;
    --text3: #8793A6;
    --grau: #5B6B82;
    --grau-hell: #F4F5F7;      /* Seitenhintergrund */
    --flaeche: #FFFFFF;
    --rand: #E4E8EE;
    --rand-2: #DDE2EA;
    --linie: #EEF1F5;
    --hover: #FAFBFC;
    --hover-2: #F7F9FC;
    --gruen: #1E7A46;
    --gruen-hell: #E6F4EC;
    --gelb: #A55A0B;
    --gelb-hell: #FDF1E3;
    --rot: #B42318;
    --grau-pill: #4A5568;
    --grau-pill-bg: #EEF0F4;
    --sidebar-text: #C9D3E3;
    --sidebar-text2: #8EA0BD;
    --font: 'Figtree', -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    --mono: 'JetBrains Mono', ui-monospace, Consolas, monospace;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: var(--font);
    color: var(--text);
    background: var(--grau-hell);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* ===== App-Rahmen: Navy-Seitenleiste links, Inhalt rechts ===== */
.app-shell { display: flex; min-height: 100vh; }

.seitenleiste {
    width: 232px; flex-shrink: 0; background: var(--navy); color: var(--sidebar-text);
    display: flex; flex-direction: column; padding: 18px 12px; gap: 20px;
    position: sticky; top: 0; height: 100vh;
}
.sl-marke { display: flex; align-items: center; gap: 8px; padding: 4px 8px 2px; text-decoration: none; }
.sl-marke img { height: 22px; width: auto; max-width: 148px; display: block; }
.sl-marke-crm { font-size: 10px; font-weight: 700; letter-spacing: 0.16em; color: var(--sidebar-text2); border-left: 1px solid rgba(255,255,255,0.18); padding-left: 8px; }

.sl-nav { display: flex; flex-direction: column; gap: 2px; }
.sl-link {
    display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: 8px;
    color: var(--sidebar-text); text-decoration: none; font-size: 14px; font-weight: 500;
}
.sl-link:hover { background: rgba(255,255,255,0.08); color: #fff; text-decoration: none; }
.sl-link.aktiv { background: rgba(255,255,255,0.12); color: #fff; }
.sl-icon { display: inline-flex; width: 20px; height: 20px; align-items: center; justify-content: center; flex-shrink: 0; opacity: 0.9; }
.sl-label { flex: 1; }
.sl-badge { font-size: 11px; font-weight: 600; background: var(--badge-blau); color: #fff; border-radius: 10px; padding: 1px 7px; }

.sl-fuss { margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 10px 6px 2px; border-top: 1px solid rgba(255,255,255,0.08); }
.sl-avatar { width: 32px; height: 32px; border-radius: 50%; background: #1F3C66; color: #fff; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 600; flex-shrink: 0; }
.sl-benutzer { min-width: 0; line-height: 1.25; }
.sl-name { color: #fff; font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sl-abmelden { font-size: 12px; color: var(--sidebar-text2); }
.sl-abmelden:hover { color: #fff; text-decoration: none; }

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

/* Schmale Handy-Kopfleiste (Logo + Menüknopf) – am Desktop ausgeblendet */
.mobil-kopf { display: none; }
.nav-overlay { display: none; }
.nav-toggle { background: none; border: 0; cursor: pointer; padding: 6px 4px; display: flex; flex-direction: column; gap: 5px; }
.nav-toggle-strich { display: block; width: 24px; height: 2.5px; background: #fff; border-radius: 2px; }

.inhalt { width: 100%; max-width: 1240px; margin: 1.4rem auto; padding: 0 1.4rem; }
body.seite-dashboard .inhalt { max-width: 1440px; }
.fuss { text-align: center; color: var(--grau); font-size: 0.85rem; padding: 1.5rem 1rem; }

/* --- Handy/Tablet: Seitenleiste wird zur Schublade --- */
@media (max-width: 900px) {
    .mobil-kopf {
        display: flex; align-items: center; gap: 12px; position: sticky; top: 0; z-index: 30;
        background: var(--navy); padding: 10px 14px;
    }
    .mobil-logo img { height: 24px; width: auto; display: block; }
    .app-shell { display: block; }
    .seitenleiste {
        position: fixed; top: 0; left: 0; height: 100vh; z-index: 50; width: 250px;
        transform: translateX(-100%); transition: transform 0.22s ease;
        box-shadow: 0 0 40px rgba(0,0,0,0.35);
    }
    body.nav-offen .seitenleiste { transform: none; }
    body.nav-offen .nav-overlay { display: block; position: fixed; inset: 0; background: rgba(6,18,38,0.5); z-index: 40; }
    .inhalt { margin: 1rem auto; }
}

h1 { font-size: 1.6rem; margin: 0 0 1rem; }
h2 { font-size: 1.1rem; margin: 0 0 0.8rem; }

a { color: var(--blau); }

/* Knöpfe */
/* Ruhige Knöpfe: nur die Hauptaktion ist dunkel (Navy), alles andere weiß mit
   feinem Rand. Gleiche Höhe für Links (<a>) und Knöpfe (<button>). */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    box-sizing: border-box;
    background: var(--gruen-btn);
    color: #fff;
    border: 1px solid var(--gruen-btn);
    padding: 0.5rem 0.95rem;
    border-radius: 6px;
    text-decoration: none;
    font: inherit;
    font-size: 0.92rem;
    font-weight: 500;
    line-height: 1.25;
    cursor: pointer;
    vertical-align: middle;
}
.btn:hover { filter: brightness(1.12); text-decoration: none; }
.btn-klein { padding: 0.32rem 0.7rem; font-size: 0.84rem; }
.btn-teal, .btn-hell { background: #fff; color: var(--blau); border-color: var(--rand); }
.btn-teal:hover, .btn-hell:hover { background: #f5f6f8; filter: none; }
.btn-hell.aktiv { background: var(--blau-hell); font-weight: 600; }
/* Löschen/Verwerfen: zurückhaltend – roter Text, rot erst beim Draufzeigen */
.btn-gefahr { background: #fff; color: #b42318; border-color: #ecd2cf; }
.btn-gefahr:hover { background: #fdf2f1; border-color: #e4b4ae; filter: none; }
.btn-gefahr-voll { background: #b42318; border-color: #b42318; color: #fff; }
button[disabled] { opacity: 0.5; cursor: default; }

/* Kleine Symbol-Knöpfe (z. B. E-Mail, Löschen in Tabellen) – grau, ohne Farbe */
.btn-icon {
    display: inline-flex; align-items: center; justify-content: center;
    width: 30px; height: 30px; padding: 0; box-sizing: border-box;
    background: #fff; color: #6b7280; border: 1px solid var(--rand); border-radius: 6px;
    cursor: pointer; text-decoration: none; vertical-align: middle;
}
.btn-icon:hover { color: var(--blau); background: #f5f6f8; text-decoration: none; }
.btn-icon.gefahr:hover { color: #b42318; border-color: #e4b4ae; background: #fdf2f1; }
.aktion-icons { display: flex; align-items: center; gap: 6px; justify-content: flex-end; }
.aktion-icons form { margin: 0; display: inline-flex; }

/* Sicherheitsabfrage (data-bestaetigen) */
.bst-dialog { position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%); margin: 0 !important;
    border: 0; border-radius: 12px; padding: 22px 24px 18px; width: calc(100% - 32px); max-width: 420px;
    box-shadow: 0 18px 50px rgba(10,35,70,.25); }
.bst-dialog::backdrop { background: rgba(10,25,45,.45); }
.bst-text { margin: 0 0 1.1rem; font-size: 15px; line-height: 1.5; }
.bst-knoepfe { display: flex; justify-content: flex-end; gap: 8px; }

/* Filterleiste */
.filter {
    display: flex; gap: 0.8rem; flex-wrap: wrap; align-items: flex-end;
    background: #fff; border: 1px solid var(--rand); border-radius: 8px;
    padding: 1rem; margin-bottom: 1rem;
}
.filter-gruppe { display: flex; flex-direction: column; gap: 0.25rem; }
.filter-gruppe.wachsen { flex: 1; min-width: 160px; }
.filter label { font-size: 0.8rem; color: var(--grau); }

.schnellfilter { display: flex; gap: 0.4rem; flex-wrap: wrap; margin-bottom: 1rem; }
.schnellfilter a {
    padding: 0.35rem 0.8rem; border-radius: 999px; text-decoration: none;
    background: #fff; border: 1px solid var(--rand); color: var(--text); font-size: 0.9rem;
}
.schnellfilter a.aktiv { background: var(--blau); color: #fff; border-color: var(--blau); }

.hinweis { color: var(--grau); font-size: 0.9rem; }
.leer { background: #fff; border: 1px dashed var(--rand); padding: 1.5rem; border-radius: 8px; text-align: center; }

/* Tabelle */
.tabelle { width: 100%; border-collapse: collapse; background: #fff; border-radius: 8px; overflow: hidden; }
.tabelle th, .tabelle td { text-align: left; padding: 0.7rem 0.8rem; border-bottom: 1px solid var(--rand); }
.tabelle th { background: var(--grau-hell); font-size: 0.85rem; color: var(--grau); }
.tabelle tr:last-child td { border-bottom: none; }

/* Status-Etiketten */
.status { display: inline-block; padding: 0.15rem 0.6rem; border-radius: 999px; font-size: 0.8rem; font-weight: 600; }
.status-lead { background: #fdf2d9; color: var(--gelb); }
.status-in-bearbeitung { background: #e3edf9; color: var(--blau); }
.status-kunde { background: #dff0e6; color: var(--gruen); }

/* Formular */
.formular { background: #fff; border: 1px solid var(--rand); border-radius: 8px; padding: 1.2rem; }
.feld { display: flex; flex-direction: column; gap: 0.3rem; margin-bottom: 1rem; }
.feld label { font-size: 0.85rem; color: var(--grau); font-weight: 600; }
.feld-reihe { display: flex; gap: 1rem; flex-wrap: wrap; }
.feld-reihe .feld { flex: 1; min-width: 140px; }
input[type=text], input[type=email], input[type=password], select, textarea {
    padding: 0.55rem 0.7rem; border: 1px solid var(--rand); border-radius: 6px;
    font-size: 0.95rem; font-family: inherit; width: 100%; background: #fff;
}
textarea { resize: vertical; }
.gruppe { border: 1px solid var(--rand); border-radius: 8px; padding: 1rem; margin-bottom: 1rem; }
.gruppe legend { font-weight: 600; color: var(--blau); padding: 0 0.4rem; }
.typ-schalter { display: flex; gap: 1.2rem; }
.radio { display: flex; align-items: center; gap: 0.4rem; font-weight: 400; color: var(--text); }
.knopfleiste { display: flex; gap: 0.8rem; margin-top: 0.5rem; }

/* Detailseite */
.zurueck { margin: 0 0 0.5rem; }
.detail-kopf { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; flex-wrap: wrap; }
.detail-aktionen { display: flex; gap: 0.5rem; }
.unterzeile { color: var(--grau); margin-top: 0.2rem; }
.karte { background: #fff; border: 1px solid var(--rand); border-radius: 8px; padding: 1.2rem; margin-top: 1rem; }
.karte-bald { background: var(--grau-hell); border-style: dashed; }
.status-form { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.daten { display: grid; grid-template-columns: 200px 1fr; gap: 0.4rem 1rem; margin: 0; }
.daten dt { color: var(--grau); font-size: 0.9rem; }
.daten dd { margin: 0; }
.notiz-text { white-space: pre-wrap; }

/* Zwei Karten nebeneinander (Eckdaten / Preise), umbrechend am Handy */
.karten-reihe { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 720px) { .karten-reihe { grid-template-columns: 1fr; } }
.tabelle-eckdaten th { text-align: left; color: var(--grau); font-weight: 500; width: 45%; white-space: nowrap; }
.tabelle-eckdaten td { text-align: right; }

/* ---- Einheiten / Tops (Grundlage der Zinsliste) ---- */
.einheiten-kopf,
.einheit-zeile {
    display: grid;
    grid-template-columns: 0.7fr 0.6fr 0.9fr 1.4fr 0.6fr 0.7fr 1fr 1.2fr 1.2fr 1fr;
    gap: 0.5rem;
    align-items: end;
}
.einheiten-kopf { padding: 0 0.5rem 0.3rem; font-size: 0.78rem; color: var(--grau); }
.einheit-zeile {
    background: #fff; border: 1px solid var(--rand); border-left: 5px solid var(--rand);
    border-radius: 6px; padding: 0.5rem; margin-bottom: 0.5rem;
}
.einheit-zeile .ez-feld { display: flex; flex-direction: column; }
.einheit-zeile label { font-size: 0.72rem; color: var(--grau); margin-bottom: 0.15rem; }
.einheit-zeile input, .einheit-zeile select { padding: 0.35rem 0.4rem; font-size: 0.85rem; }
.ez-knoepfe { display: flex; gap: 0.3rem; }
.einheit-leerstehend { border-left-color: var(--gruen); }
.einheit-befristet   { border-left-color: var(--gelb); }
.einheit-unbefristet { border-left-color: var(--rot); }
.einheit-neu { border-left-color: var(--blau); border-style: dashed; }
.status-punkt { display: inline-block; width: 0.7rem; height: 0.7rem; border-radius: 50%; vertical-align: middle; }
.status-leerstehend { background: var(--gruen); }
.status-befristet { background: var(--gelb); }
.status-unbefristet { background: var(--rot); }
@media (max-width: 900px) {
    .einheiten-kopf { display: none; }
    .einheit-zeile { grid-template-columns: 1fr 1fr; }
}

/* ---- Fotos & Dokumente ---- */
.datei-form { display: flex; gap: 0.6rem; align-items: center; flex-wrap: wrap; }
.foto-galerie { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 0.8rem; margin-top: 0.8rem; }
.foto-kachel { position: relative; border: 1px solid var(--rand); border-radius: 6px; overflow: hidden; }
.foto-kachel img { display: block; width: 100%; height: 130px; object-fit: cover; }
/* Einzelner Lösch-Knopf (Lageplan, Pläne): kleiner, dezenter Kreis oben rechts */
.foto-kachel > form { position: absolute; top: 6px; right: 6px; margin: 0; }
.foto-kachel > form .btn {
    width: 26px; height: 26px; padding: 0; border-radius: 50%; border: 0;
    background: rgba(255, 255, 255, .92); color: #3a4553; font-size: .8rem; line-height: 26px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .25); opacity: 0; transition: opacity .15s;
}
.foto-kachel:hover > form .btn, .foto-kachel > form .btn:focus { opacity: 1; }
.foto-kachel > form .btn:hover { background: #fff; color: var(--rot); }

/* ---- Exposé-Text ---- */
.expose-textfeld {
    width: 100%; font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
    font-size: 0.9rem; line-height: 1.5; padding: 1rem; border: 1px solid var(--rand);
    border-radius: 8px; background: #fff; white-space: pre; overflow-x: auto;
}
.kopiert-hinweis { color: var(--gruen); font-weight: 600; margin-top: 0.5rem; }

/* ---- Angebots-Freigaben (Makler-Seite) ---- */
.link-feld { width: 100%; font-size: 0.82rem; font-family: ui-monospace, Consolas, monospace;
    padding: 0.35rem 0.5rem; border: 1px solid var(--rand); border-radius: 5px; background: var(--grau-hell); }

/* ---- Öffentliche Zwischenseite / freigegebenes Angebot ---- */
body.oeffentlich { background: var(--grau-hell); }
.oe-kopf { background: #fff; border-bottom: 3px solid var(--blau); padding: 1rem 1.2rem; }
.oe-kopf .logo { color: var(--blau); font-weight: 700; font-size: 1.2rem; letter-spacing: 0.02em; }
.oe-inhalt { max-width: 820px; margin: 0 auto; padding: 1.2rem; }
.oe-teaser { display: flex; gap: 1rem; align-items: center; }
.oe-teaser-foto { width: 160px; height: 120px; object-fit: cover; border-radius: 6px; flex-shrink: 0; }
.oe-parteien { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin: 0.8rem 0; }
@media (max-width: 640px) { .oe-parteien { grid-template-columns: 1fr; } .oe-teaser { flex-direction: column; align-items: flex-start; } }
.oe-label { font-weight: 700; color: var(--blau); margin-bottom: 0.2rem; }
.oe-klein { font-size: 0.85rem; color: #444; }
.oe-zustimmung .oe-check { display: flex; gap: 0.6rem; align-items: flex-start; margin: 0.8rem 0;
    padding: 0.8rem; background: var(--grau-hell); border-radius: 6px; cursor: pointer; }
.oe-zustimmung .oe-check input { margin-top: 0.2rem; width: 1.1rem; height: 1.1rem; flex-shrink: 0; }
.oe-hinweis { color: var(--grau); font-size: 0.9rem; margin: 0.8rem 0; }
.btn-gross { font-size: 1.05rem; padding: 0.8rem 1.4rem; }
.oe-fuss { color: var(--grau); font-size: 0.82rem; margin-top: 0.8rem; }
.oe-fehler { color: var(--rot); font-weight: 600; background: #fdecee; padding: 0.6rem 0.8rem; border-radius: 6px; }
.oe-dok-liste { margin: 0.4rem 0 0; padding-left: 1.2rem; }
.oe-dok-liste li { margin: 0.3rem 0; }

/* =========================================================================
   JustImmo-Nachbau: Datensatz-Kopf, Karten mit Kopfzeile, Spalten-Layout,
   direkt bearbeitbare Felder, Aktionsleiste rechts.
   ========================================================================= */

/* --- Datensatz-Kopf (Nr – Name + Aktionen rechts) --- */
.ji-kopf {
    display: flex; align-items: center; justify-content: space-between;
    gap: 1rem; flex-wrap: wrap; margin: 0.2rem 0 0.8rem;
}
.ji-kopf-titel { display: flex; align-items: center; gap: 0.6rem; min-width: 0; }
.ji-kopf-titel .ji-icon { font-size: 1.5rem; color: var(--blau); }
.ji-kopf-titel h1 { font-size: 1.5rem; margin: 0; font-weight: 600; }
.ji-kopf-aktionen { display: flex; gap: 0.4rem; align-items: center; flex-wrap: wrap; }

/* --- Karte mit grauer Kopfzeile (wie JustImmo) --- */
.ji-karte {
    background: #fff; border: 1px solid var(--rand); border-radius: 4px;
    margin-bottom: 1rem; overflow: hidden;
}
.ji-karte-kopf {
    background: #f7f8f9; border-bottom: 1px solid var(--rand);
    padding: 0.6rem 0.9rem; font-weight: 600; font-size: 0.92rem; color: #444;
    display: flex; align-items: center; gap: 0.45rem;
}
.ji-karte-kopf .ji-k-icon { color: var(--blau); }
.ji-karte-inhalt { padding: 0.9rem; }
.ji-karte-inhalt > *:first-child { margin-top: 0; }
.ji-karte-inhalt > *:last-child { margin-bottom: 0; }

/* --- Spalten-Layouts --- */
.ji-spalten { display: grid; grid-template-columns: 300px minmax(0,1fr) 250px; gap: 1rem; align-items: start; }
.ji-form-spalten { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; align-items: start; }
@media (max-width: 1100px) { .ji-spalten { grid-template-columns: 1fr; } .ji-form-spalten { grid-template-columns: 1fr; } }

/* --- Direkt bearbeitbare Felder (kein Bearbeiten-Knopf nötig) --- */
.ji-feld { margin-bottom: 0.8rem; }
.ji-feld > label {
    display: block; font-size: 0.78rem; color: #555; margin-bottom: 0.22rem; font-weight: 600;
}
.ji-feld input[type=text], .ji-feld input[type=email], .ji-feld input[type=date],
.ji-feld input[type=number], .ji-feld select, .ji-feld textarea {
    width: 100%; padding: 0.45rem 0.6rem; font-size: 0.92rem; color: var(--text);
    border: 1px solid #cfd6da; border-radius: 3px; background: #fff;
    font-family: inherit;
}
.ji-feld input:hover, .ji-feld select:hover, .ji-feld textarea:hover { border-color: #9fb3ba; }
.ji-feld input:focus, .ji-feld select:focus, .ji-feld textarea:focus {
    outline: none; border-color: var(--blau); box-shadow: 0 0 0 2px rgba(21,154,156,0.15);
}
.ji-feld textarea { resize: vertical; }
.ji-feld-reihe { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 0 0.7rem; }
.ji-feld .ji-hinweis { font-weight: 400; color: var(--grau); }
.ji-check { display: flex; align-items: flex-start; gap: 0.45rem; font-size: 0.88rem; margin: 0.4rem 0; }
.ji-check input { margin-top: 0.15rem; }

/* --- Info-Liste (Übersicht links) --- */
.ji-liste { margin: 0; }
.ji-liste dt { font-size: 0.75rem; color: var(--grau); margin-top: 0.55rem; }
.ji-liste dt:first-child { margin-top: 0; }
.ji-liste dd { margin: 0.05rem 0 0; font-size: 0.93rem; }
.ji-gross { font-size: 1.02rem; font-weight: 700; }

/* --- Aktionsleiste rechts --- */
.ji-aktionsliste { list-style: none; margin: 0; padding: 0; }
.ji-aktionsliste li { border-bottom: 1px solid #eef0f2; }
.ji-aktionsliste li:last-child { border-bottom: none; }
.ji-aktionsliste a {
    display: flex; align-items: center; gap: 0.5rem; padding: 0.55rem 0.2rem;
    text-decoration: none; color: var(--blau); font-size: 0.9rem; cursor: pointer;
}
.ji-aktionsliste a:hover { color: var(--teal-dunkel); }
.ji-status-knopf {
    display: block; width: 100%; text-align: center; background: var(--gruen-btn);
    color: #fff; padding: 0.6rem; border-radius: 4px; font-weight: 600; margin-bottom: 1rem;
}
/* Der Statusbalken rechts trägt dieselben Farben wie das Kästchen in der Liste. */
.ji-status-knopf.st-aktiv { background: #2e9e4f; }
.ji-status-knopf.st-inaktiv { background: #e08b1e; }
.ji-status-knopf.st-reserviert { background: #3498db; }
.ji-status-knopf.st-verkauft { background: #7f8c8d; }
.ji-status-knopf.st-archiv { background: #2d3436; }

/* ---- Tabs (Detailmasken wie JustImmo) ---- */
.tab-block { margin-top: 1rem; position: relative; }
.tab-leiste {
    display: flex; gap: 0.2rem; flex-wrap: nowrap;
    overflow-x: auto; overflow-y: hidden;   /* nur seitlich scrollen, nie vertikal */
    -webkit-overflow-scrolling: touch; scrollbar-width: thin;
    border-bottom: 2px solid var(--rand); margin-bottom: 1rem;
}
.tab-leiste::-webkit-scrollbar { height: 4px; }
.tab-leiste::-webkit-scrollbar-thumb { background: #c7cdd4; border-radius: 2px; }
.tab-leiste a {
    padding: 0.7rem 1.1rem; text-decoration: none; color: var(--grau);
    font-weight: 600; border-bottom: 3px solid transparent; margin-bottom: -2px;
    cursor: pointer; white-space: nowrap; flex: 0 0 auto;
}
/* Auf schmalen Screens die Reiter seitlich scrollen statt umbrechen +
   rechter Verlauf als Hinweis, dass seitlich noch mehr kommt. */
@media (max-width: 640px) {
    .tab-leiste a { padding: 0.6rem 0.8rem; }
    .tab-block::after {
        content: ""; position: absolute; top: 0; right: 0; width: 26px; height: 2.7rem;
        pointer-events: none;
        background: linear-gradient(to right, rgba(244,245,247,0), var(--grau-hell));
    }
}
.tab-leiste a:hover { color: var(--blau); }
.tab-leiste a.aktiv { color: var(--blau); border-bottom-color: var(--blau); }
.tab-leiste a .tab-zahl {
    display: inline-block; min-width: 1.2rem; padding: 0 0.3rem; margin-left: 0.3rem;
    font-size: 0.75rem; background: var(--grau-hell); color: var(--grau);
    border-radius: 10px; text-align: center; font-weight: 700;
}
.tab-leiste a.aktiv .tab-zahl { background: var(--blau-hell); color: var(--teal-dunkel); }
.tab-panel { display: none; }
.tab-panel.aktiv { display: block; }

/* ---- Dashboard ---- */
.kennzahlen { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 0.8rem; margin: 1rem 0; }
.kennzahl { display: flex; flex-direction: column; align-items: center; justify-content: center;
    background: #fff; border: 1px solid var(--rand); border-radius: 8px; padding: 1.1rem 0.8rem;
    text-decoration: none; color: var(--text); }
a.kennzahl:hover { border-color: var(--blau); }
.kz-wert { font-size: 1.9rem; font-weight: 700; color: var(--blau); line-height: 1.1; }
.kz-label { font-size: 0.85rem; color: var(--grau); margin-top: 0.3rem; text-align: center; }
.kz-gruen .kz-wert { color: var(--gruen); }
.wv-faellig { color: var(--rot); font-weight: 700; }

/* ---- Login ---- */
.login-mitte { min-height: 80vh; display: flex; align-items: center; justify-content: center; padding: 1.2rem; }
.login-karte { max-width: 360px; width: 100%; }
.login-logo { color: var(--blau); margin-top: 0; }
.login-logo span { font-size: 0.7em; color: var(--grau); }
.nav-abmelden { margin-left: auto; opacity: 0.9; }

/* ---- Zinsliste ---- */
.tabelle-scroll { overflow-x: auto; }
.marktpreis-box { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap;
    margin: 1rem 0; padding: 0.8rem 1rem; background: #fffbea; border: 1px solid #f0d98a; border-radius: 8px; }
.marktpreis-box label { font-weight: 600; color: #7a5b00; }
.marktpreis-zelle { background: #fff3b0; border: 1px solid #e0c04a; border-radius: 5px;
    padding: 0.4rem 0.6rem; font-size: 1rem; font-weight: 700; width: 110px; text-align: right; }
.zinsliste .num { text-align: right; white-space: nowrap; }
.zinsliste th.num { text-align: right; }
.zinsliste tbody tr.zl-leerstehend { background: #e9f7ef; }
.zinsliste tbody tr.zl-befristet { background: #fdf6e3; }
.zinsliste tbody tr.zl-unbefristet { background: #fdecee; }
.zinsliste tfoot .zl-summe td { font-weight: 700; background: var(--grau-hell); border-top: 2px solid var(--rand); }
.zl-summen-hinweis { margin-top: 1rem; }
.zl-summen-hinweis p { margin: 0.2rem 0; }
.zl-legende { margin-top: 0.8rem; color: var(--grau); font-size: 0.9rem; }
@media print {
    .no-print, .seitenleiste, .mobil-kopf, .fuss { display: none !important; }
    .inhalt { padding: 0; }
    .zinsliste tbody tr.zl-leerstehend { background: #e9f7ef !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    .zinsliste tbody tr.zl-befristet { background: #fdf6e3 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    .zinsliste tbody tr.zl-unbefristet { background: #fdecee !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* Aktivitätenverlauf */
.formular-eng { padding: 0; border: none; }
.verlauf { list-style: none; margin: 0; padding: 0; }
.verlauf-eintrag { border-left: 3px solid var(--blau); padding: 0.6rem 0.9rem; margin-bottom: 0.8rem; background: var(--grau-hell); border-radius: 0 6px 6px 0; }
.verlauf-kopf { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.verlauf-datum { font-weight: 600; }
.verlauf-notiz { margin: 0.4rem 0 0; white-space: pre-wrap; }
.verlauf-schritt { margin: 0.3rem 0 0; color: var(--blau); font-size: 0.9rem; }
.verlauf-loeschen { margin-left: auto; }
.verlauf-loeschen button { background: none; border: none; color: var(--grau); cursor: pointer; font-size: 1rem; padding: 0 0.2rem; }
.verlauf-loeschen button:hover { color: var(--rot); }

/* Kleine Etiketten (Chips) */
.chip { display: inline-block; padding: 0.1rem 0.55rem; border-radius: 999px; font-size: 0.78rem; background: #e5e7eb; color: #374151; }
.chip-blau { background: #e3edf9; color: var(--blau); }
.chip-rot { background: #fbe3e5; color: var(--rot); font-weight: 600; }
.zeile-ueberfaellig td { background: #fdf0f1; }

.daten-titel { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.03em; color: var(--grau); margin: 1rem 0 0.4rem; border-bottom: 1px solid var(--rand); padding-bottom: 0.3rem; }
.daten-titel:first-child { margin-top: 0; }
.daten-spalten { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
.tabelle-eng th, .tabelle-eng td { padding: 0.5rem 0.6rem; }
.feld.schmal { max-width: 120px; }
.feld-hinweis { color: var(--grau); font-weight: 400; font-size: 0.8rem; }
.verkn-form { margin-top: 1rem; border-top: 1px dashed var(--rand); padding-top: 1rem; }

/* Kopfbereich (Highlights) im Salesforce-Stil */
.highlights { background: #fff; border: 1px solid var(--rand); border-top: 4px solid var(--blau); border-radius: 8px; padding: 1.2rem; margin-top: 0.5rem; }
.highlights-oben { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; flex-wrap: wrap; }
.highlights-titel { display: flex; gap: 0.8rem; align-items: flex-start; }
.highlights-titel h1 { margin: 0; }
.typ-icon { font-size: 1.8rem; line-height: 1; }
.highlights-fakten { display: flex; flex-wrap: wrap; gap: 1.5rem; margin: 1rem 0; padding: 0.8rem 0; border-top: 1px solid var(--rand); border-bottom: 1px solid var(--rand); }
.fakt { display: flex; flex-direction: column; font-size: 0.95rem; }
.fakt-label { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.03em; color: var(--grau); }
.highlights .status-form { align-items: center; }

/* Karten-Kopf mit Aktion rechts */
.karte-kopf { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: 0.8rem; }
.karte-kopf h2 { margin: 0; }

/* Suchprofile */
.profil { border: 1px solid var(--rand); border-radius: 8px; padding: 0.9rem; margin-bottom: 0.8rem; }
.profil-kopf { display: flex; justify-content: space-between; align-items: center; gap: 0.8rem; flex-wrap: wrap; }
.profil-aktionen { display: flex; gap: 0.4rem; }
.profil-chips { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.6rem; }
.profil-freitext { margin: 0.7rem 0 0; padding: 0.6rem 0.8rem; background: var(--blau-hell); border-radius: 6px; white-space: pre-wrap; }
.profil-freitext .fakt-label { display: block; margin-bottom: 0.2rem; }
.gruppe-ki { background: var(--blau-hell); border-color: #cddcee; }

/* Kategorie-Mehrfachauswahl */
.kat-auswahl { display: flex; flex-wrap: wrap; gap: 0.5rem 1rem; padding: 0.6rem 0.8rem; border: 1px solid var(--rand); border-radius: 6px; background: #fff; margin-bottom: 0.5rem; }
.kat-check { display: flex; align-items: center; gap: 0.35rem; font-weight: 400; color: var(--text); }
.kat-neu { margin-top: 0.2rem; }
.chip-kat { background: #e3edf9; color: var(--blau); font-weight: 600; }

/* Benutzerverwaltung: aufklappbare User-Karten */
.user-liste { display: flex; flex-direction: column; gap: 0.6rem; margin-bottom: 1.4rem; }
.user-karte { border: 1px solid var(--rand); border-radius: 8px; background: #fff; overflow: hidden; }
.user-karte[open] { box-shadow: 0 1px 6px rgba(7,43,89,0.08); }
.user-kopf {
    display: flex; align-items: center; gap: 0.6rem; padding: 0.75rem 0.9rem;
    cursor: pointer; list-style: none; user-select: none;
}
.user-kopf::-webkit-details-marker { display: none; }
.user-kopf:hover { background: #f7f8f9; }
.user-status-dot { flex: 0 0 auto; width: 9px; height: 9px; border-radius: 50%; background: #c7cdd4; }
.user-status-dot.an { background: #2e9e5b; }
.user-status-dot.aus { background: #c0392b; }
.user-name { font-weight: 700; }
.user-rolle-badge { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em;
    color: #6b7785; background: #eef0f3; border-radius: 20px; padding: 0.1rem 0.6rem; }
.user-rolle-badge.admin { color: #fff; background: var(--blau); }
.user-status-text { font-size: 0.85rem; color: #8a94a0; }
.user-pfeil { margin-left: auto; color: #8a94a0; transition: transform 0.15s; font-size: 1.1rem; }
.user-karte[open] .user-pfeil { transform: rotate(180deg); }
.user-panel { padding: 0.2rem 0.9rem 0.9rem; border-top: 1px solid var(--rand); }
.user-optionen { display: flex; flex-direction: column; gap: 0.4rem; margin: 0.7rem 0 0.9rem; }
.user-panel-zeile { display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: center; }
.user-pw-form { display: flex; gap: 0.4rem; }
.user-neu-block { border-top: 1px solid var(--rand); padding-top: 1rem; }

/* E-Mail-Adressen-Liste in den Stammdaten – eine Zeile je Adresse */
.ji-email-liste { display: flex; flex-direction: column; gap: 0.5rem; }
.ji-email-zeile { display: flex; align-items: center; gap: 0.6rem; }
.ji-email-zeile .ji-email-input { flex: 1 1 auto; min-width: 0; }
.ji-email-versand {
    flex: 0 0 auto; display: inline-flex; align-items: center; gap: 0.4rem;
    font-size: 0.85rem; color: var(--text); white-space: nowrap; cursor: pointer;
}
.ji-email-versand input { flex: 0 0 auto; }
.ji-email-del {
    flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center;
    width: 2rem; height: 2rem; padding: 0; border: 1px solid var(--rand);
    background: #fff; border-radius: 6px; color: #98a2b0; cursor: pointer;
}
.ji-email-del:hover { color: var(--rot); border-color: var(--rot); }
@media (max-width: 640px) {
    .ji-email-zeile { flex-wrap: wrap; }
    .ji-email-zeile .ji-email-input { flex: 1 1 100%; }
}

/* Einheitliche Linien-Icons (SVG, monochrom) */
.ji-ic { display: inline-block; vertical-align: -0.16em; flex: 0 0 auto; }
.ji-karte-kopf .ji-k-icon { color: var(--blau); display: inline-flex; }

/* Kompakte Kontaktzeilen (Firma-Detail: Ansprechpartner + Kontaktdaten mit Icons) */
.ji-kontaktdaten { margin: 0; }
.ji-kontaktzeile { display: flex; align-items: center; gap: 0.55rem; margin: 0.22rem 0; font-size: 0.85rem; line-height: 1.3; }
.ji-kontaktzeile .ji-ik { flex: 0 0 auto; color: #98a2b0; display: inline-flex; margin-right: 0.15rem; }
.ji-kontaktzeile > span:last-child, .ji-kontaktzeile > a { min-width: 0; overflow-wrap: anywhere; }

/* Kategorien nach Überkategorie gruppiert (Suchprofil-/Objektformular) */
.kat-gruppen { display: flex; flex-direction: column; gap: 0.6rem; margin-bottom: 0.5rem; }
.kat-gruppe-titel { font-size: 0.8rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em; color: #6b7785; margin: 0 0 0.25rem 0.1rem; }
.kat-gruppe .kat-auswahl { margin-bottom: 0; }

/* Matching-Trefferliste */
.treffer { background: #fff; border: 1px solid var(--rand); border-radius: 8px; padding: 1rem; margin-top: 0.8rem; }
.treffer-kopf { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; }
.treffer-name { font-size: 1.1rem; font-weight: 600; text-decoration: none; }
.treffer-name:hover { text-decoration: underline; }
.quote { font-size: 1.15rem; font-weight: 700; padding: 0.2rem 0.7rem; border-radius: 8px; white-space: nowrap; }
.quote-hoch { background: #dff0e6; color: var(--gruen); }
.quote-mittel { background: #fdf2d9; color: var(--gelb); }
.quote-niedrig { background: #f0f1f3; color: var(--grau); }
.begruendung { list-style: none; margin: 0.6rem 0 0; padding: 0; display: flex; flex-direction: column; gap: 0.2rem; }
.begruendung li { font-size: 0.92rem; }
.begruendung .gut { color: var(--gruen); }
.begruendung .schlecht { color: var(--rot); }
.begruendung-kurz { color: var(--gruen); font-size: 0.9rem; margin: 0.5rem 0 0; }
.treffer-aktionen { display: flex; gap: 0.4rem; margin-top: 0.7rem; flex-wrap: wrap; }

/* Dokumente & Provisionen */
.doc-liste { list-style: none; margin: 0.8rem 0 0; padding: 0; }
.doc-liste li { display: flex; align-items: center; gap: 0.6rem; padding: 0.5rem 0; border-bottom: 1px solid var(--rand); }
.doc-liste li:last-child { border-bottom: none; }
.doc-name { flex: 1; }
.doc-groesse { color: var(--grau); font-size: 0.85rem; white-space: nowrap; }
.summe { font-weight: 700; }
.wv-faellig { color: var(--rot); font-weight: 600; }

/* Aufklappbare Kategorien in der Kontaktliste */
.kat-details summary { cursor: pointer; list-style: none; display: inline; }
.kat-details summary::-webkit-details-marker { display: none; }
.kat-details .mehr { display: inline-block; padding: 0.1rem 0.5rem; border-radius: 999px; font-size: 0.78rem; background: var(--rand); color: var(--text); }
.kat-details[open] summary .mehr { color: var(--grau); }
.kat-alle { margin-top: 0.3rem; }
.chip-kat { line-height: 1.9; }

/* Mehrfach-Kategorie-Filter (Aufklapp-Menü mit Häkchen) */
.kat-filter { position: relative; }
.kat-filter > summary { cursor: pointer; list-style: none; padding: 0.55rem 0.7rem; border: 1px solid var(--rand); border-radius: 6px; background: #fff; min-width: 110px; }
.kat-filter > summary::-webkit-details-marker { display: none; }
.kat-filter > summary::after { content: " ▾"; color: var(--grau); }
.kat-filter-box { position: absolute; z-index: 20; margin-top: 0.3rem; background: #fff; border: 1px solid var(--rand); border-radius: 8px; padding: 0.7rem 0.9rem; box-shadow: 0 6px 18px rgba(0,0,0,0.12); display: flex; flex-direction: column; gap: 0.35rem; max-height: 320px; overflow: auto; white-space: nowrap; }

@media (max-width: 600px) {
    .daten { grid-template-columns: 1fr; gap: 0.1rem 0; }
    .daten dd { margin-bottom: 0.6rem; }
    .detail-kopf, .highlights-oben { flex-direction: column; }
    .daten-spalten { grid-template-columns: 1fr; gap: 0.5rem; }
}

/* =========================================================================
   JustImmo-Nachbau: Listenansichten (Seitenkopf, Filterpanel, Ergebnis-
   tabelle mit Sortierung, Blättern, Status-Badges, Bild-Spalte)
   ========================================================================= */

/* --- Seitenkopf: Titel links, Haupt-Aktion rechts --- */
.ji-seitenkopf {
    display: flex; align-items: center; justify-content: space-between;
    gap: 1rem; flex-wrap: wrap; margin: 0.2rem 0 1rem;
}
.ji-seitenkopf h1 { margin: 0; font-size: 1.75rem; font-weight: 400; color: #333; }

/* --- Unter-Reiter (Verwaltung | Exportansicht | …) --- */
.ji-unterreiter { display: flex; gap: 0.15rem; border-bottom: 1px solid var(--rand); margin-bottom: 0; }
.ji-unterreiter a {
    padding: 0.55rem 1rem; text-decoration: none; color: var(--grau); font-size: 0.92rem;
    border: 1px solid transparent; border-bottom: none; border-radius: 4px 4px 0 0; margin-bottom: -1px;
}
.ji-unterreiter a.aktiv { background: #fff; border-color: var(--rand); color: var(--text); font-weight: 600; }
.ji-unterreiter a.gesperrt { color: #b9c0c5; cursor: not-allowed; }

/* --- Filterpanel --- */
.ji-filter { background: #fafbfc; border: 1px solid var(--rand); border-radius: 4px; margin-bottom: 1rem; }
.ji-filter-kopf {
    display: flex; align-items: center; justify-content: space-between;
    padding: 0.5rem 0.9rem; border-bottom: 1px solid var(--rand); font-weight: 600; color: #555; font-size: 0.92rem;
}
.ji-filter-koerper { padding: 0.9rem; }
.ji-filter-zeile { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 0.7rem; }
.ji-filter-zeile + .ji-filter-zeile { margin-top: 0.7rem; }
.ji-filter input[type=text], .ji-filter select {
    width: 100%; padding: 0.45rem 0.6rem; font-size: 0.92rem;
    border: 1px solid #cfd6da; border-radius: 3px; background: #fff; font-family: inherit;
}
.ji-filter input:focus, .ji-filter select:focus {
    outline: none; border-color: var(--blau); box-shadow: 0 0 0 2px rgba(21,154,156,0.15);
}
.ji-filter-schalter { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; font-size: 0.9rem; }
.ji-filter-fuss {
    display: flex; align-items: center; justify-content: flex-end; gap: 0.9rem;
    padding: 0.6rem 0.9rem; border-top: 1px solid var(--rand); font-size: 0.9rem; color: var(--grau);
}

/* --- Ergebniskopf + Blättern --- */
.ji-ergebnis-kopf {
    display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
    background: #fff; border: 1px solid var(--rand); border-bottom: none;
    border-radius: 4px 4px 0 0; padding: 0.6rem 0.9rem; color: var(--grau); font-size: 0.92rem;
}
.ji-blaettern { display: flex; gap: 0.2rem; }
.ji-blaettern a, .ji-blaettern span {
    min-width: 1.9rem; text-align: center; padding: 0.25rem 0.45rem; font-size: 0.88rem;
    border: 1px solid var(--rand); border-radius: 3px; text-decoration: none; color: var(--blau); background: #fff;
}
.ji-blaettern a:hover { background: var(--blau-hell); }
.ji-blaettern .aktiv { background: var(--blau); border-color: var(--blau); color: #fff; font-weight: 600; }
.ji-blaettern .aus { color: #c3c9cd; }

/* --- Ergebnistabelle --- */
.ji-tabelle-rahmen { border: 1px solid var(--rand); border-radius: 0 0 4px 4px; background: #fff; overflow-x: auto; }
table.ji-tabelle { width: 100%; border-collapse: collapse; font-size: 0.87rem; }
table.ji-tabelle th {
    background: #fff; text-align: left; padding: 0.5rem 0.6rem; white-space: nowrap;
    border-bottom: 2px solid var(--rand); font-size: 0.82rem; color: #444; font-weight: 600;
}
table.ji-tabelle th a { color: #444; text-decoration: none; }
table.ji-tabelle th a:hover { color: var(--blau); }
table.ji-tabelle td { padding: 0.5rem 0.6rem; border-bottom: 1px solid #edeff1; vertical-align: top; }
table.ji-tabelle tbody tr:nth-child(even) { background: #fafbfc; }
table.ji-tabelle tbody tr:hover { background: var(--blau-hell); }
.ji-tabelle .num { text-align: right; white-space: nowrap; }
.ji-tabelle .nowrap { white-space: nowrap; }
.ji-bild { width: 62px; height: 46px; object-fit: cover; border-radius: 3px; border: 1px solid var(--rand); }
.ji-bild-leer {
    width: 62px; height: 46px; border-radius: 3px; border: 1px dashed var(--rand);
    display: flex; align-items: center; justify-content: center; color: #c3c9cd; font-size: 1rem;
}
.ji-zeilen-icon { color: var(--grau); }
.ji-datum-spalte { font-size: 0.78rem; color: var(--grau); white-space: nowrap; line-height: 1.5; }

/* --- Status-Badges wie JustImmo --- */
.ji-badge {
    display: inline-block; padding: 0.12rem 0.5rem; border-radius: 3px;
    font-size: 0.76rem; font-weight: 600; color: #fff; white-space: nowrap;
}
.ji-badge-aktiv { background: #2e9e4f; }        /* Aktiv – grün */
.ji-badge-inaktiv { background: #e08b1e; }      /* Inaktiv – orange */
.ji-badge-reserviert { background: #3498db; }   /* Reserviert – blau */
.ji-badge-verkauft { background: #7f8c8d; }     /* Verkauft – grau */
.ji-badge-archiv { background: #2d3436; }       /* Archiv – schwarz */
/* alte Klassennamen bleiben gültig, damit nichts unlackiert bleibt */
.ji-badge-entwurf { background: #e08b1e; }
.ji-badge-zurueck { background: #2d3436; }

/* --- Mehrfachauswahl-Dropdown (Kategorien) --- */
.ji-mehrfach { position: relative; }
.ji-mehrfach-knopf {
    width: 100%; text-align: left; background: #fff; border: 1px solid #cfd6da; border-radius: 3px;
    padding: 0.45rem 0.6rem; font-size: 0.92rem; cursor: pointer; font-family: inherit; color: var(--text);
    display: flex; align-items: center; justify-content: space-between; gap: 0.5rem;
}
.ji-mehrfach-knopf:hover { border-color: #9fb3ba; }
.ji-mehrfach-knopf .pfeil { color: var(--grau); font-size: 0.7rem; }
.ji-mehrfach-liste {
    display: none; position: absolute; z-index: 30; left: 0; right: 0; top: calc(100% + 2px);
    background: #fff; border: 1px solid var(--rand); border-radius: 3px; max-height: 240px; overflow-y: auto;
    box-shadow: 0 4px 12px rgba(0,0,0,0.12); padding: 0.3rem;
}
.ji-mehrfach.offen .ji-mehrfach-liste { display: block; }
.ji-mehrfach-liste label {
    display: flex; align-items: center; gap: 0.5rem; padding: 0.35rem 0.45rem;
    font-size: 0.9rem; border-radius: 3px; cursor: pointer;
}
.ji-mehrfach-liste label:hover { background: var(--blau-hell); }
.ji-mehrfach-chips { display: flex; flex-wrap: wrap; gap: 0.3rem; margin-top: 0.4rem; }

/* Spaltenbreiten in den Ergebnistabellen: Name/Titel brauchen Platz,
   damit sie nicht über mehrere Zeilen umbrechen (wie in JustImmo). */
/* Keine erzwungene Mindestbreite: die Tabellen sollen in die Seite passen. */
table.ji-tabelle { width: 100%; table-layout: auto; }
table.ji-tabelle .sp-name { min-width: 170px; }
table.ji-tabelle .sp-titel { min-width: 240px; }
table.ji-tabelle .sp-adresse { min-width: 130px; }
table.ji-tabelle .sp-mail { min-width: 150px; }
table.ji-tabelle .sp-kat { min-width: 110px; }
table.ji-tabelle .chip { font-size: 0.72rem; padding: 0.08rem 0.4rem; margin: 0 0.15rem 0.15rem 0; }


/* --- Logo in der Kopfzeile (weisses Logo auf Markenblau) --- */
.logo { display: flex; align-items: center; gap: 0.6rem; }
.logo img { height: 30px; width: auto; display: block; }

/* --- Kontaktliste: kompakt, damit ALLE Spalten ohne Scrollen passen --- */
table.ji-tabelle-kontakte { min-width: 0; width: 100%; font-size: 0.82rem; table-layout: auto; }
table.ji-tabelle-kontakte th,
table.ji-tabelle-kontakte td { padding: 0.42rem 0.4rem; }
table.ji-tabelle-kontakte .sp-name { min-width: 155px; }
table.ji-tabelle-kontakte .sp-mail { min-width: 135px; word-break: break-word; }
table.ji-tabelle-kontakte .sp-kat { min-width: 105px; }
/* Die Status-Spalte am Ende darf nie abgeschnitten werden. */
table.ji-tabelle-kontakte th:last-child,
table.ji-tabelle-kontakte td:last-child { white-space: nowrap; padding-right: 0.6rem; }
table.ji-tabelle-kontakte .chip { font-size: 0.68rem; padding: 0.05rem 0.35rem; }
table.ji-tabelle-kontakte .ji-badge { font-size: 0.7rem; padding: 0.1rem 0.4rem; }

/* Schmales Stift-Symbol statt breitem Bearbeiten-Knopf */
.ji-stift {
    display: inline-block; width: 1.7rem; height: 1.7rem; line-height: 1.6rem; text-align: center;
    border: 1px solid var(--rand); border-radius: 3px; color: var(--blau);
    text-decoration: none; font-size: 0.9rem;
}
.ji-stift:hover { background: var(--blau-hell); border-color: var(--blau); }
.login-marke { text-align: center; margin-bottom: 0.8rem; }
.login-marke img { height: 40px; width: auto; }


/* --- Objektliste: kompakt, damit alle Spalten ohne Scrollen passen --- */
table.ji-tabelle-objekte { font-size: 0.82rem; }
table.ji-tabelle-objekte th,
table.ji-tabelle-objekte td { padding: 0.42rem 0.4rem; }
table.ji-tabelle-objekte .ji-badge { font-size: 0.7rem; padding: 0.1rem 0.4rem; }
table.ji-tabelle-objekte .ji-bild, table.ji-tabelle-objekte .ji-bild-leer { width: 54px; height: 40px; }
/* Zahlenspalten schmal halten, damit keine Leerraeume entstehen */
table.ji-tabelle .num { width: 1%; }

/* --- Zwei gleich breite Spalten (z. B. E-Mail-Vorschau) --- */
.ji-spalten-zwei { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; align-items: start; }
@media (max-width: 900px) { .ji-spalten-zwei { grid-template-columns: 1fr; } }

/* --- Fotogalerie mit Reihenfolge --- */
.foto-kachel { position: relative; }
.foto-nummer {
    position: absolute; top: 4px; left: 4px; z-index: 2;
    background: var(--blau); color: #fff; font-size: .72rem; font-weight: 700;
    min-width: 1.3rem; height: 1.3rem; line-height: 1.3rem; text-align: center;
    border-radius: 3px; padding: 0 .25rem;
}
/* Werkzeugleiste auf dem Foto (◀ ▶ ★ ✕): erscheint beim Darüberfahren,
   dezent weiß auf leichtem Schatten – keine roten Kästchen. */
.foto-werkzeuge {
    position: absolute; left: 0; right: 0; bottom: 0;
    display: flex; gap: 5px; justify-content: center; padding: 18px 6px 7px;
    background: linear-gradient(to bottom, rgba(0, 29, 58, 0), rgba(0, 29, 58, .55));
    opacity: 0; transition: opacity .15s;
}
.foto-kachel:hover .foto-werkzeuge, .foto-werkzeuge:focus-within { opacity: 1; }
.foto-werkzeuge form { display: inline; position: static; margin: 0; }
.foto-werkzeuge .btn {
    width: 28px; height: 26px; padding: 0; border: 0; border-radius: 6px;
    background: rgba(255, 255, 255, .92); color: var(--blau, #002d58);
    font-size: .78rem; line-height: 26px; box-shadow: 0 1px 2px rgba(0, 0, 0, .2);
}
.foto-werkzeuge .btn:hover { background: #fff; }
.foto-werkzeuge .btn-gefahr { color: #3a4553; }
.foto-werkzeuge .btn-gefahr:hover { color: var(--rot); }
.foto-werkzeuge button[disabled] { opacity: .4; cursor: default; }
/* Touch-Geräte (kein Darüberfahren): Leiste immer zeigen */
@media (hover: none) {
    .foto-werkzeuge, .foto-kachel > form .btn { opacity: 1; }
}

/* --- Übersicht über die Einheiten (leer / befristet / unbefristet) --- */
.ez-uebersicht { display: flex; gap: .6rem; flex-wrap: wrap; margin: 0 0 1rem; }
.ez-kachel {
    display: flex; flex-direction: column; min-width: 116px;
    border: 1px solid var(--rand); border-left: 4px solid var(--blau);
    border-radius: 4px; padding: .5rem .7rem; background: #fff;
}
.ez-kachel.ez-leer { border-left-color: var(--gruen); }
.ez-kachel.ez-bef { border-left-color: var(--gelb); }
.ez-kachel.ez-unbef { border-left-color: var(--rot); }
.ez-zahl-gross { font-size: 1.35rem; font-weight: 700; color: var(--text); line-height: 1.1; }
.ez-beschriftung { font-size: .82rem; color: var(--text); }
.ez-klein { font-size: .76rem; color: var(--grau); }

/* --- Exposé-Texte: volle Breite, ruhig zu lesen --- */
#tab-expose .ji-karte-inhalt { padding: .8rem 1rem 1rem; }
textarea.expose-text {
    width: 100%; font-size: .95rem; line-height: 1.55; padding: .7rem .8rem;
    font-family: inherit; resize: vertical;
}

/* =========================================================================
   Benutzerverwaltung (Sonstiges) – als Karten-Liste, am Handy stapelbar
   ========================================================================= */
.benutzer-liste { display: flex; flex-direction: column; gap: 0.6rem; margin-bottom: 0.4rem; }
.benutzer-zeile {
    border: 1px solid var(--rand); border-radius: 8px; padding: 0.7rem 0.9rem;
    background: #fff;
}
.benutzer-kopf { display: flex; align-items: center; gap: 0.6rem; margin-bottom: 0.5rem; }
.benutzer-kopf strong { font-size: 1.05rem; }
.benutzer-rolle {
    font-size: 0.75rem; background: #eef2f7; color: var(--grau);
    padding: 0.12rem 0.5rem; border-radius: 999px;
}
.benutzer-aktionen { display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; }
.benutzer-aktionen form { display: flex; gap: 0.3rem; margin: 0; }
.benutzer-passwort input { width: 11rem; max-width: 60vw; }
.btn-gruen { background: var(--gruen); }

/* Neuen Benutzer anlegen – Felder nebeneinander, am Handy untereinander */
.benutzer-neu { display: flex; gap: 0.6rem; flex-wrap: wrap; align-items: end; }
.benutzer-neu .feld { margin: 0; }

/* =========================================================================
   Allgemeine Handy-Optimierung: breite Tabellen seitlich scrollbar machen,
   statt dass sie die Seite sprengen; Karten und Abstände etwas kompakter.
   ========================================================================= */
@media (max-width: 760px) {
    .inhalt { padding: 0 0.9rem; margin: 1rem auto; }
    .karte { padding: 0.9rem 1rem; overflow-x: auto; }
    /* Tabellen in Karten dürfen innerhalb der Karte scrollen, nichts wird abgeschnitten */
    .karte table { min-width: 520px; }
    .benutzer-zeile, .benutzer-liste { min-width: 0; }
    .benutzer-neu { flex-direction: column; align-items: stretch; }
    .benutzer-neu .feld input, .benutzer-neu .feld select { width: 100%; }
    .benutzer-passwort { flex: 1 1 100%; }
    .benutzer-passwort input { width: 100%; max-width: none; }
    h1 { font-size: 1.5rem; }
    /* Breite Tabellen (Todos, Angebote) seitlich scrollbar statt abgeschnitten */
    .tabelle-scroll table { min-width: 560px; }
}

/* =========================================================================
   Todos / Angebote: farblose ✓ / ✗ Kästchen nebeneinander
   ========================================================================= */
.tabelle-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.spalte-aktion { white-space: nowrap; }
.haken-leiste { display: inline-flex; gap: 0.4rem; }
.haken-btn {
    width: 34px; height: 34px; padding: 0; line-height: 1;
    display: inline-flex; align-items: center; justify-content: center;
    background: #fff; border: 1px solid var(--rand); border-radius: 6px;
    color: var(--text); font-size: 1rem; cursor: pointer; transition: background 0.15s, border-color 0.15s;
}
.haken-btn:hover { background: var(--grau-hell); border-color: #b8c0cc; }

/* Namenssuche mit Autovervollständigung in der Kontaktliste */
.kontakt-suche-feld { position: relative; display: inline-block; }
.kontakt-suche-feld .empf-vorschlaege { left: 0; }
.such-firma { color: var(--grau); font-size: 0.88em; }

/* Übergreifende Suche auf dem Dashboard */
.global-suche-feld { position: relative; margin: 0 0 1.2rem; max-width: 640px; }
.global-suche-feld input { width: 100%; padding: 0.7rem 0.9rem 0.7rem 2.4rem; font-size: 1rem;
    border: 1px solid var(--rand); border-radius: 10px; background: #fff; }
.global-suche-feld input:focus { outline: none; border-color: var(--blau); box-shadow: 0 0 0 3px var(--blau-hell); }
.global-suche-lupe { position: absolute; left: 0.8rem; top: 50%; transform: translateY(-50%); opacity: 0.6; }
.global-suche-feld .empf-vorschlaege { left: 0; max-width: none; }
.global-typ { display: inline-block; min-width: 3.6rem; font-size: 0.72rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.03em; }

/* Angebots-Verlauf (Aktivitäten-Historie) */
.verlauf-liste { list-style: none; margin: 0; padding: 0; }
.verlauf-liste li { padding: 0.6rem 0; border-bottom: 1px solid var(--rand); }
.verlauf-liste li:last-child { border-bottom: none; }
.verlauf-kopf { display: flex; justify-content: space-between; align-items: baseline; gap: 0.6rem; }
.verlauf-art { font-weight: 600; }
.verlauf-notiz { margin-top: 0.25rem; white-space: pre-wrap; }

/* =========================================================================
   Angebotsversand: Empfänger-Eingabe mit Autovervollständigung (Chips)
   ========================================================================= */
.empf-eingabe { position: relative; }
.empf-eingabe > label { display: block; font-size: 0.85rem; color: var(--grau); font-weight: 600; margin-bottom: 0.3rem; }
.empf-chips { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-bottom: 0.4rem; }
.empf-chip {
    display: inline-flex; align-items: center; gap: 0.35rem;
    background: var(--blau-hell); color: var(--blau); border: 1px solid #cdd8e8;
    padding: 0.25rem 0.55rem; border-radius: 999px; font-size: 0.88rem;
}
.empf-chip-x { background: none; border: 0; color: var(--blau); cursor: pointer; font-size: 0.9rem; padding: 0; line-height: 1; }
#empf-suche { width: 100%; max-width: 460px; }
.empf-vorschlaege {
    position: absolute; z-index: 20; background: #fff; border: 1px solid var(--rand);
    border-radius: 6px; box-shadow: 0 6px 18px rgba(0,0,0,0.12);
    max-width: 460px; width: 100%; max-height: 260px; overflow-y: auto; margin-top: 2px;
}
.empf-vorschlag { padding: 0.5rem 0.7rem; cursor: pointer; border-bottom: 1px solid #f0f2f4; }
.empf-vorschlag:last-child { border-bottom: none; }
.empf-vorschlag:hover { background: var(--blau-hell); }
/* Firmen-Kopfzeile im Angebots-Empfänger-Dropdown + einzelne Adressen darunter */
.empf-firma-kopf { display: flex; justify-content: space-between; align-items: center;
    gap: 0.6rem; cursor: default; background: var(--grau-hell); }
.empf-firma-kopf:hover { background: var(--grau-hell); }
.empf-adresse { padding-left: 1.4rem; }
.empf-plus { color: var(--gruen); font-weight: 700; }
.empf-alle { border: 1px solid var(--rand); background: #fff; color: var(--blau);
    border-radius: 999px; padding: 0.12rem 0.6rem; font-size: 0.8rem; cursor: pointer; white-space: nowrap; }
.empf-alle:hover { background: var(--blau); color: #fff; }

/* =========================================================================
   Mobil-Feinschliff (durchgängig): nichts läuft seitlich aus der Seite.
   ========================================================================= */

/* Grid-/Flex-Spalten dürfen schrumpfen (sonst blähen breite Inhalte – z. B.
   Tabellen in Detail-Karten – die Spalte über die Bildschirmbreite hinaus auf).
   Das ist die Ursache Nr. 1 für seitliches Wegscrollen am Handy. */
.ji-spalten > *, .ji-form-spalten > *, .ji-spalten-zwei > *,
.karten-reihe > *, .daten-spalten > * { min-width: 0; }

/* Tabellen in Detail-Karten scrollen bei Bedarf innerhalb der Karte, statt die
   Seite zu sprengen. (Der Wrapper .tabelle-scroll steckt direkt in der Karte.) */
.ji-karte-inhalt .tabelle-scroll { max-width: 100%; }
.ji-karte-inhalt .tabelle-scroll .tabelle { min-width: 0; }

/* Lange, unbrechbare Angaben (E-Mails, URLs) dürfen umbrechen. */
.ji-kontaktzeile, .ji-liste dd, .daten dd, .doc-name { overflow-wrap: anywhere; }

@media (max-width: 760px) {
    /* Seitenkopf mit Haupt-Aktion (z. B. „Neues Objekt anlegen"): Titel oben,
       Knopf darunter über die volle Breite – statt gequetscht daneben. */
    .ji-seitenkopf { gap: 0.6rem; }
    .ji-seitenkopf .btn { width: 100%; text-align: center; }
    .ji-seitenkopf h1 { font-size: 1.5rem; }

    /* Detail-Kopf: Titel und Aktionsknöpfe auf volle Breite, gut greifbar. */
    .ji-kopf-aktionen { width: 100%; }
    .ji-kopf-aktionen .btn { flex: 1 1 auto; text-align: center; }

    /* Zurück/Speichern/Löschen am Detailkopf großzügig antippbar. */
    .detail-aktionen { width: 100%; }
    .detail-aktionen .btn { flex: 1 1 auto; text-align: center; }
}

/* Größere Antippflächen am Handy: Knöpfe, Menü, Reiter mindestens ~44px hoch. */
@media (max-width: 760px) {
    .btn { padding: 0.62rem 1rem; }
    .btn-klein { padding: 0.4rem 0.7rem; }
    .haupt-nav a { padding: 0.8rem 0.7rem; }
    .tab-leiste a { padding: 0.7rem 0.9rem; }
    /* Formularfelder: 16px Schrift verhindert das automatische Hineinzoomen
       von iOS beim Antippen eines Eingabefeldes. */
    input[type=text], input[type=email], input[type=password], input[type=date],
    input[type=number], select, textarea,
    .ji-feld input, .ji-feld select, .ji-feld textarea,
    .ji-filter input, .ji-filter select { font-size: 16px; }
}

/* =========================================================================
   Dashboard (Redesign): Kopf, KPI-Karten, Panels, Listen
   ========================================================================= */
.dash { display: flex; flex-direction: column; gap: 24px; }

.dash-kopf { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; }
.dash-datum { font-size: 13px; color: var(--text2); font-weight: 500; }
.dash-gruss { margin: 4px 0 0; font-size: 28px; font-weight: 700; letter-spacing: -0.01em; }
.dash-kopf-rechts { display: flex; gap: 10px; flex-wrap: wrap; }
.dash-suche { position: relative; display: flex; align-items: center; gap: 10px; background: var(--flaeche); border: 1px solid var(--rand-2); border-radius: 10px; padding: 0 12px; height: 42px; width: min(420px, 82vw); }
.dash-suche .lupe { color: var(--text3); display: inline-flex; flex-shrink: 0; }
.dash-suche input { border: 0; outline: 0; flex: 1; font: inherit; font-size: 14px; background: transparent; color: var(--text); min-width: 0; }
.dash-suche .kbd { font-family: var(--mono); font-size: 11px; color: var(--text2); border: 1px solid var(--rand-2); border-radius: 5px; padding: 2px 6px; }
.dash-neu { height: 42px; padding: 0 16px; border: 0; border-radius: 10px; background: var(--navy); color: #fff; font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; }
.dash-neu:hover { background: var(--navy-hover); color: #fff; text-decoration: none; }

.dash-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.kpi { background: var(--flaeche); border: 1px solid var(--rand); border-radius: 12px; padding: 16px 18px; display: flex; flex-direction: column; gap: 6px; text-decoration: none; color: var(--text); }
.kpi:hover { border-color: #B9C4D6; text-decoration: none; }
.kpi-label { font-size: 13px; color: var(--text2); font-weight: 500; }
.kpi-wert { font-size: 30px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; line-height: 1; }
.kpi-note { font-size: 12px; font-weight: 500; color: var(--text2); }
.kpi-note.gruen { color: var(--gruen); }
.kpi-note.blau { color: var(--blau-mittel); }
.kpi-note.orange { color: var(--gelb); }

.dash-spalten { display: flex; flex-wrap: wrap; gap: 20px; align-items: flex-start; }
.dash-links { flex: 3 1 520px; min-width: 0; display: flex; flex-direction: column; gap: 20px; }
.dash-rechts { flex: 2 1 300px; min-width: 0; display: flex; flex-direction: column; gap: 20px; }

.panel { background: var(--flaeche); border: 1px solid var(--rand); border-radius: 12px; overflow: hidden; }
.panel-kopf { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--linie); gap: 10px; }
.panel-kopf-links { display: flex; align-items: center; gap: 10px; min-width: 0; }
.panel-titel { margin: 0; font-size: 16px; font-weight: 700; }
.panel-unter { font-size: 12px; color: var(--text2); margin-top: 2px; }
.panel-anzahl { font-size: 12px; font-weight: 600; color: var(--text2); background: #F1F3F7; border-radius: 10px; padding: 2px 8px; }
.panel-link { font-size: 13px; font-weight: 600; white-space: nowrap; }
.panel-fuss { padding: 12px 20px; font-size: 13px; font-weight: 600; color: var(--navy-link); cursor: pointer; }
.panel-fuss:hover { background: var(--hover); text-decoration: none; }
.panel-leer { padding: 32px 20px; display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; }
.leer-check { width: 40px; height: 40px; border-radius: 50%; background: var(--gruen-hell); color: var(--gruen); display: flex; align-items: center; justify-content: center; font-weight: 700; }
.leer-titel { font-size: 15px; font-weight: 600; }
.leer-text { font-size: 13px; color: var(--text2); max-width: 340px; }

/* Nachfassen */
.nf-zeile { display: flex; align-items: center; gap: 14px; padding: 14px 20px; border-bottom: 1px solid var(--linie); text-decoration: none; color: var(--text); }
.nf-zeile:last-child { border-bottom: 0; }
.nf-zeile:hover { background: var(--hover); text-decoration: none; }
.nf-ini { width: 36px; height: 36px; border-radius: 50%; background: #E8EDF5; color: var(--navy); display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; flex-shrink: 0; }
.nf-haupt { flex: 1; min-width: 0; }
.nf-name { font-size: 14px; font-weight: 600; }
.nf-ctx { font-size: 13px; color: var(--text2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nf-due { font-size: 12px; font-weight: 600; color: var(--text2); white-space: nowrap; flex-shrink: 0; }
.nf-due.rot { color: var(--rot); }
.nf-due.orange { color: var(--gelb); }

/* Zuletzt geöffnete Objekte */
.dobj-kopf, .dobj-zeile { display: grid; grid-template-columns: 44px minmax(0,1fr) 104px 96px; gap: 12px; align-items: center; }
.dobj-kopf { padding: 10px 20px; font-size: 12px; font-weight: 600; color: var(--text2); text-transform: uppercase; letter-spacing: 0.05em; background: var(--hover); border-bottom: 1px solid var(--linie); }
.dobj-kopf .re { text-align: right; }
.dobj-zeile { padding: 12px 20px; border-bottom: 1px solid var(--linie); text-decoration: none; color: var(--text); }
.dobj-zeile:last-child { border-bottom: 0; }
.dobj-zeile:hover { background: var(--hover-2); text-decoration: none; }
.dobj-foto { width: 44px; height: 44px; border-radius: 8px; object-fit: cover; background: repeating-linear-gradient(135deg,#E9EDF3 0 6px,#F3F5F9 6px 12px); flex-shrink: 0; }
.dobj-foto-leer { display: flex; align-items: center; justify-content: center; color: #8793A6; }
.dobj-haupt { min-width: 0; }
.dobj-titel { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dobj-meta { font-size: 12px; color: var(--text2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dobj-zeit { text-align: right; line-height: 1.3; }
.dobj-zeit .rel { font-size: 13px; font-weight: 500; }
.dobj-zeit .abs { font-size: 12px; color: var(--text3); font-variant-numeric: tabular-nums; }

/* Status-Pills */
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 20px; white-space: nowrap; }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill-aktiv { background: var(--gruen-hell); color: var(--gruen); }
.pill-inaktiv { background: var(--gelb-hell); color: var(--gelb); }
.pill-verkauft { background: var(--grau-pill-bg); color: var(--grau-pill); }
.pill-reserviert { background: #E8EFFC; color: var(--blau-mittel); }
.pill-archiv { background: #EEF0F4; color: #2d3436; }

/* Todos heute */
.todo-zeile { display: flex; gap: 12px; padding: 12px 20px; border-bottom: 1px solid var(--linie); text-decoration: none; color: var(--text); }
.todo-zeile:hover { background: var(--hover); text-decoration: none; }
.todo-box { width: 18px; height: 18px; border-radius: 5px; border: 1.5px solid #B9C4D6; flex-shrink: 0; margin-top: 1px; }
.todo-haupt { min-width: 0; }
.todo-text { font-size: 14px; font-weight: 500; }
.todo-meta { font-size: 12px; color: var(--text3); }

/* Aktivitäten (Ereignisse zu Angeboten) – Dashboard und /aktivitaeten */
.akt-zeile { display: flex; align-items: center; gap: 14px; padding: 9px 20px; border-bottom: 1px solid var(--linie); text-decoration: none; color: var(--text); }
.akt-zeile:last-child { border-bottom: 0; }
.akt-zeile:hover { background: var(--hover); text-decoration: none; }
.akt-haupt { flex: 1; min-width: 0; }
.akt-text { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.akt-text strong { font-weight: 600; }
.akt-was.blau { color: var(--blau-mittel); }
.akt-was.gruen { color: var(--gruen); }
.akt-was.rot { color: var(--rot); }
.akt-was.grau { color: var(--text2); }
.akt-was.navy { color: var(--navy); }
.akt-obj { font-size: 12px; color: var(--text2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.akt-zeit { font-size: 12px; font-weight: 600; color: var(--text2); white-space: nowrap; flex-shrink: 0; font-variant-numeric: tabular-nums; }
.akt-seite { max-width: 980px; }
.akt-filter { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 14px; }
.akt-filter a { font-size: 13px; font-weight: 600; color: var(--text2); background: var(--flaeche); border: 1px solid var(--rand); border-radius: 20px; padding: 5px 12px; text-decoration: none; }
.akt-filter a:hover { border-color: #B9C4D6; text-decoration: none; }
.akt-filter a.aktiv { background: var(--navy); border-color: var(--navy); color: #fff; }
.akt-blaettern { display: flex; justify-content: space-between; align-items: center; margin-top: 12px; }

/* Schlanke Panels am Dashboard (gleicher Rand links/rechts wie die Überschrift) */
.panel-kompakt .panel-kopf { padding: 12px 20px; }
.panel-kompakt .panel-titel { font-size: 15px; }
.panel-kompakt .panel-leer { padding: 16px 20px; }
.panel-kompakt .nf-zeile { padding: 9px 20px; gap: 14px; }
.panel-kompakt .nf-name { font-size: 13px; }
.panel-kompakt .nf-ctx { font-size: 12px; }
.panel-kompakt .todo-zeile { padding: 9px 20px; gap: 10px; }
.panel-kompakt .todo-text { font-size: 13px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.panel-kompakt .todo-box { width: 15px; height: 15px; }
.panel-kompakt .dobj-zeile { grid-template-columns: 34px minmax(0,1fr) auto 70px; gap: 12px; padding: 8px 20px; }
.panel-kompakt .dobj-foto { width: 34px; height: 34px; border-radius: 6px; }
.panel-kompakt .dobj-titel { font-size: 13px; }
.panel-kompakt .dobj-zeit .rel { font-size: 12px; font-weight: 600; color: var(--text2); }

@media (max-width: 560px) {
    .dash-gruss { font-size: 24px; }
    .akt-text { white-space: normal; }
    .dash-suche { width: 100%; }
    .dash-kopf-rechts { width: 100%; }
    .dash-neu { flex: 1; justify-content: center; }
}

/* "+ Neu anlegen"-Menü im Dashboard-Kopf */
.neu-menu { position: relative; }
.neu-menu > summary { list-style: none; cursor: pointer; }
.neu-menu > summary::-webkit-details-marker { display: none; }
.neu-menu-box {
    position: absolute; right: 0; top: 48px; z-index: 25; min-width: 190px;
    background: var(--flaeche); border: 1px solid var(--rand); border-radius: 10px;
    box-shadow: 0 8px 26px rgba(10,35,70,0.14); padding: 6px; display: flex; flex-direction: column;
}
.neu-menu-box a { padding: 9px 12px; border-radius: 7px; font-size: 14px; font-weight: 500; color: var(--text); }
.neu-menu-box a:hover { background: var(--hover); text-decoration: none; }
.dash-suche .empf-vorschlaege { left: 0; top: 46px; width: 100%; max-width: none; }

/* Todos: frei angelegte Aufgaben */
.todo-neu { margin-top: 0.4rem; }
.todo-neu-felder { display: flex; gap: 0.8rem; flex-wrap: wrap; }
.todo-neu-titel { flex: 1 1 320px; margin-bottom: 0.6rem; }
.todo-neu-datum { flex: 0 1 190px; margin-bottom: 0.6rem; }
.todo-neu input[type=date] { padding: 0.55rem 0.7rem; border: 1px solid var(--rand); border-radius: 6px; font: inherit; font-size: 0.95rem; width: 100%; background: #fff; }
.aufgaben-liste { background: var(--flaeche); border: 1px solid var(--rand); border-radius: 12px; overflow: hidden; }
.aufgabe { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--linie); }
.aufgabe:last-child { border-bottom: 0; }
.aufgabe-ueberfaellig { background: #fdf3f2; }
.aufgabe-haken { margin: 0; flex-shrink: 0; }
.aufgabe-haupt { flex: 1; min-width: 0; }
.aufgabe-titel { font-size: 14px; font-weight: 600; overflow-wrap: anywhere; }
.aufgabe-notiz { font-size: 13px; color: var(--text2); overflow-wrap: anywhere; }
.aufgabe-datum { font-size: 13px; white-space: nowrap; text-align: right; }
.aufgabe-loeschen { margin: 0; flex-shrink: 0; }
.aufgabe-loeschen button { background: none; border: 0; color: var(--text3); cursor: pointer; font-size: 15px; padding: 4px 6px; }
.aufgabe-loeschen button:hover { color: var(--rot); }
@media (max-width: 560px) {
    .aufgabe { flex-wrap: wrap; }
    .aufgabe-datum { order: 3; width: 100%; text-align: left; padding-left: 46px; }
}

/* Datumsfelder: ganzes Feld anklickbar (öffnet den Kalender, siehe base.html) */
input[type=date], input[type=datetime-local], input[type=month], input[type=time] { cursor: pointer; }
input[type=date]::-webkit-calendar-picker-indicator { cursor: pointer; }

/* ---- Angebotsversand: „Neuer Preis" + bisherige Empfänger ---------------- */
.neuer-preis-schalter { display: flex; gap: .55rem; align-items: flex-start; margin: .8rem 0 .2rem;
    padding: .6rem .75rem; border: 1px solid var(--rand); border-radius: 8px; background: #fbfcfe;
    cursor: pointer; font-size: .92rem; line-height: 1.4; max-width: 640px; }
.neuer-preis-schalter input { margin-top: .2rem; width: auto; flex: none; }
.chip-neuer-preis { background: #fff1d6; color: #9a5b00; font-weight: 600; margin-top: .2rem; }
.bisherige-empf { margin: .5rem 0 .2rem; border: 1px solid var(--rand); border-radius: 8px;
    max-width: 640px; overflow: hidden; }
.bisherige-kopf { display: flex; justify-content: space-between; align-items: center; gap: .6rem;
    padding: .5rem .75rem; background: #f4f6f9; font-size: .85rem; color: var(--grau); flex-wrap: wrap; }
.bisheriger { display: block; width: 100%; text-align: left; background: #fff; border: 0;
    border-top: 1px solid var(--rand); padding: .5rem .75rem; font: inherit; cursor: pointer; color: inherit; }
.bisheriger:hover { background: #eef3fa; }
.bisheriger .unterzeile { display: block; margin-left: 1.15rem; }

/* Stand der automatischen Entfernungen (Objekt → Dateien → Lageplan) */
.entfernungen-stand { display: flex; flex-wrap: wrap; gap: .5rem 1rem; align-items: center;
    justify-content: space-between; font-size: .85rem; padding: .5rem .7rem; margin-bottom: .7rem;
    background: #f6f8fb; border: 1px solid var(--rand); border-radius: 8px; }

/* Fotos per Drag & Drop umsortieren */
[data-sortierbar] .foto-kachel { cursor: grab; transition: opacity .15s, box-shadow .15s; }
[data-sortierbar] .foto-kachel:active { cursor: grabbing; }
[data-sortierbar] .foto-kachel.wird-gezogen { opacity: .35; outline: 2px dashed var(--navy, #002b5c); outline-offset: 2px; }
[data-sortierbar].gespeichert .foto-kachel { box-shadow: 0 0 0 2px #2e9e5b; }

/* Zinsliste: Import-Schritte und einklappbare Einzelbearbeitung */
.zl-schritte { margin: .2rem 0 .8rem 1.2rem; padding: 0; line-height: 1.7; }
.zl-schritte li { margin-bottom: .3rem; }
.zl-einzeln { margin-top: 1.2rem; border-top: 1px solid var(--rand); padding-top: .8rem; }
.zl-einzeln > summary { cursor: pointer; font-weight: 600; color: var(--navy); }
.zl-dateien { margin: .8rem 0 0; padding-left: 1.2rem; }
.zl-dateien li { margin-bottom: .3rem; }

/* Statusbalken rechts oben: Klick klappt den Balken zu allen Status auf
   (je ein Balken in seiner Farbe, der aktuelle mit Häkchen) – kein Menü. */
.status-wahl { margin-bottom: 1rem; }
.status-wahl .ji-status-knopf { border: 0; cursor: pointer; font: inherit; font-weight: 600; margin-bottom: 0; }
.status-wahl .ji-status-knopf:hover { filter: brightness(1.07); }
.status-pfeil { font-size: .8em; opacity: .85; margin-left: .15rem; }
.status-wahl.offen > .ji-status-knopf { display: none; }
.status-menue { display: flex; flex-direction: column; gap: 5px; }
.status-menue[hidden] { display: none; }
.status-menue button {
    display: block; width: 100%; text-align: center; border: 0; border-radius: 4px;
    padding: 0.6rem; font: inherit; font-weight: 600; color: #fff; cursor: pointer;
    background: #9aa5b1; opacity: .55; transition: opacity .12s, filter .12s;
}
.status-menue button:hover { opacity: 1; }
.status-menue button.gewaehlt { opacity: 1; }
.status-menue button.gewaehlt::before { content: "✓ "; }
.status-menue button.st-aktiv { background: #2e9e4f; }
.status-menue button.st-inaktiv { background: #e08b1e; }
.status-menue button.st-reserviert { background: #3498db; }
.status-menue button.st-verkauft { background: #7f8c8d; }
.status-menue button.st-archiv { background: #2d3436; }

/* Angebotsseite: Rückmeldung Besichtigung / kein Interesse */
.oe-nachricht { width: 100%; box-sizing: border-box; margin: .3rem 0 .8rem; padding: .5rem;
                border: 1px solid var(--rand); border-radius: 4px; font: inherit; }
.oe-rueckmeldung-knoepfe { display: flex; gap: .6rem; flex-wrap: wrap; }
.oe-rueckmeldung-ok { color: var(--gruen); font-weight: 600; margin: 0; }

/* Angebotsseite: Unterlagen */
.oe-knopf-icon { display: inline-flex; align-items: center; justify-content: center; gap: .45rem; }
.oe-knopf-breit { width: 100%; box-sizing: border-box; }
.oe-unterlagen { list-style: none; margin: .9rem 0; padding: 0; }
.oe-unterlagen li { border-top: 1px solid var(--rand); }
.oe-unterlagen li:last-child { border-bottom: 1px solid var(--rand); }
.oe-unterlagen a { display: flex; align-items: center; gap: .5rem; padding: .55rem .2rem;
                   color: var(--blau); text-decoration: none; word-break: break-word; }
.oe-unterlagen a:hover { text-decoration: underline; }

/* Objekt: Titelbild in der Übersicht, Hinweis bei neuem Objekt */
.titelbild-uebersicht { display: block; width: 100%; height: auto; max-height: 320px; object-fit: cover; border-radius: 4px; }
.entwurf-hinweis { background: #fdf6e3; border: 1px solid #f0d99a; color: #6b5412; border-radius: 6px;
                   padding: .6rem .9rem; margin: .4rem 0 .8rem; }

.pflicht-meldung { background: #fdecee; border: 1px solid #f3b9c0; color: #9b1c2c; border-radius: 6px;
                   padding: .6rem .9rem; margin: .4rem 0 .8rem; font-weight: 600; }

/* Fotos hochladen: Vorschau mit Fortschritt */
.hochladen-liste { margin-top: .8rem; }
.hochladen-stand { font-size: .9rem; color: var(--grau, #52606d); margin-bottom: .5rem; font-weight: 600; }
.hochladen-raster { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: .6rem; }
.hochladen-kachel { position: relative; height: 130px; border-radius: 6px; overflow: hidden;
                    background: #eef1f5; border: 1px solid var(--rand); }
.hochladen-kachel img { width: 100%; height: 100%; object-fit: cover; display: block;
                        transition: opacity .3s, filter .3s; }
.hochladen-kachel.wartet img, .hochladen-kachel.laeuft img { opacity: .35; filter: grayscale(.6); }
.hochladen-name { padding: .5rem; font-size: .75rem; color: #52606d; word-break: break-all; }
.hochladen-balken { position: absolute; left: 6px; right: 6px; bottom: 6px; height: 5px;
                    background: rgba(255,255,255,.7); border-radius: 3px; overflow: hidden; display: none; }
.hochladen-balken span { display: block; height: 100%; width: 0; background: var(--navy, #0A2346);
                         transition: width .2s; }
.hochladen-kachel.laeuft .hochladen-balken { display: block; }
.hochladen-kachel .foto-nummer { opacity: .6; }
.hochladen-kachel.fertig .foto-nummer { opacity: 1; }
.hochladen-zeichen { position: absolute; top: 6px; right: 6px; width: 22px; height: 22px; border-radius: 50%;
                     display: none; align-items: center; justify-content: center; color: #fff;
                     font-size: 13px; font-weight: 700; }
.hochladen-kachel.fertig .hochladen-zeichen { display: flex; background: #2e9e4f; }
.hochladen-kachel.fertig .hochladen-zeichen::after { content: "✓"; }
.hochladen-kachel.fehler { border-color: #e5a1aa; }
.hochladen-kachel.fehler .hochladen-zeichen { display: flex; background: #c0392b; }
.hochladen-kachel.fehler .hochladen-zeichen::after { content: "✕"; }

/* „Preise veröffentlichen“ – klein und unauffällig unter dem Kaufpreis */
.preis-veroeffentlichen { display: flex; align-items: center; gap: .4rem; margin: -.45rem 0 1.1rem;
                          font-size: .78rem; color: #6b7280; font-weight: 500; cursor: pointer; }
.preis-veroeffentlichen input { width: 13px; height: 13px; margin: 0; }

/* Reiter, die (noch) nicht verfügbar sind – z. B. bei einem neuen Kontakt vor dem Speichern */
.tab-leiste a.tab-aus { opacity: .4; pointer-events: none; cursor: default; }

/* Kontakt → Objekt anbieten: Mehrfachauswahl und Sicherheitsabfrage */
.anb-reihe { display: flex; gap: 10px; align-items: flex-start; flex-wrap: wrap; }
.anb-dropdown { position: relative; flex: 1 1 360px; min-width: 0; }
.anb-dropdown > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 8px; border: 1px solid var(--rand-2, var(--rand)); border-radius: 8px; background: #fff; padding: 9px 12px; font-size: 14px; min-height: 40px; box-sizing: border-box; }
.anb-dropdown > summary::-webkit-details-marker { display: none; }
.anb-dropdown > summary #anb-summary { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.anb-pfeil { color: var(--text2); font-size: 12px; }
.anb-klapp { margin-top: 4px; background: #fff; border: 1px solid var(--rand); border-radius: 8px; box-shadow: 0 10px 28px rgba(10,35,70,.16); padding: 8px; }
.anb-suche { width: 100%; box-sizing: border-box; margin-bottom: 6px; }
.anb-liste { max-height: 280px; overflow-y: auto; }
.anb-zeile { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-bottom: 1px solid var(--linie); cursor: pointer; margin: 0; font-weight: 400; }
.anb-zeile:last-child { border-bottom: 0; }
.anb-zeile:hover { background: var(--hover); }
.anb-zeile input { width: 16px; height: 16px; flex-shrink: 0; margin: 0; }
.anb-titel { flex: 1; min-width: 0; font-size: 14px; }
.anb-schon { font-size: 12px; color: var(--gelb); white-space: nowrap; }
.anb-meldung { margin: 0 0 .7rem; font-size: 14px; }
.anb-meldung.ok { color: var(--gruen); }
.anb-meldung.fehler { color: var(--rot); }
.anb-dialog { position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%); margin: 0 !important; border: 0; border-radius: 12px; padding: 22px 24px; max-width: 460px; width: calc(100% - 32px); box-shadow: 0 18px 50px rgba(10,35,70,.25); }
.anb-dialog::backdrop { background: rgba(10,25,45,.45); }
.anb-dialog h3 { margin: 0 0 .6rem; font-size: 18px; }
.anb-dialog p { margin: .4rem 0; font-size: 14px; }
.anb-dialog ul { margin: .3rem 0 .8rem; padding-left: 1.2rem; font-size: 14px; font-weight: 600; }
.anb-an { color: var(--text2); font-size: 13px !important; }
.anb-knoepfe { display: flex; justify-content: flex-end; gap: 8px; margin-top: 1rem; }

/* Öffentliche Übersicht eines Sammelangebots („Ihre Immobilienangebote“) */
.sm-karte { display: flex; gap: 1rem; align-items: stretch; }
.sm-foto { width: 180px; min-height: 130px; object-fit: cover; border-radius: 6px; flex-shrink: 0; }
.sm-inhalt { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.sm-nr { font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; color: var(--grau); font-weight: 700; }
.sm-titel { margin: .2rem 0 .6rem; font-size: 1.15rem; color: var(--blau); }
.sm-zahlen { display: flex; flex-wrap: wrap; gap: .4rem 1.4rem; margin-bottom: .8rem; }
.sm-zahlen div { display: flex; flex-direction: column; }
.sm-zahlen span { font-size: .75rem; color: var(--grau); }
.sm-zahlen strong { font-size: 1rem; }
.sm-fuss { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: .6rem; flex-wrap: wrap; }
.sm-stand { font-size: .88rem; color: var(--grau); }
.sm-stand.ok { color: var(--gruen); font-weight: 600; }
.oe-zurueck { display: inline-block; margin: 0 0 .8rem; font-weight: 600; }
@media (max-width: 560px) {
    .sm-karte { flex-direction: column; }
    .sm-foto { width: 100%; height: 170px; }
}
