/* ==========================================================================
   cleverscout Angebotswesen — Interface
   Überarbeitet nach Apple-Design-Prinzipien (Fluidität, Materialtiefe,
   größenabhängige Typografie, direktes Feedback, Light/Dark, Reduced-Motion).
   Der eine Akzent: cleverscout-Orange #eb6907 — gezielt, sonst ruhige Neutrals.
   ========================================================================== */

/* ---------- Design-Tokens ---------- */
:root {
    /* Native Steuerelemente (Dropdowns, Datum, Scrollbars) folgen dem App-Theme,
       nicht dem Betriebssystem – sonst dunkle Menüs bei hellem App-Theme. */
    color-scheme: light;

    /* Akzent (Marke) */
    --accent:        #eb6907;
    --accent-press:  #cf5a06;
    --accent-ink:    #b4500a;   /* Text auf hellem Grund */
    --accent-soft:   #fdeede;   /* getönte Fläche */
    --accent-line:   #f6c79b;

    /* warme Neutrals (leicht zum Orange gebogen, nicht neutralgrau) */
    --bg:        #faf9f7;
    --surface:   #ffffff;
    --surface-2: #f4f2ee;
    --ink:       #1d1d1b;
    --ink-soft:  #46443f;
    --muted:     #78756c;
    --faint:     #9c988d;
    --line:      #e8e4dc;
    --line-2:    #dcd7cd;

    /* semantische Farben (getrennt vom Akzent) */
    --green: #1a7d43; --green-bg: #e6f4ec;
    --blue:  #1f5fa8; --blue-bg:  #e7eefa;
    --red:   #b42318; --red-bg:   #fdecea;
    --amber: #8a6400; --amber-bg: #fbf1d8;
    --grey-bg: #edeae4;

    /* Form & Bewegung */
    --r-sm: 8px; --r-md: 12px; --r-lg: 16px; --r-pill: 999px;
    --shadow-1: 0 1px 2px rgba(40,33,20,.06), 0 1px 3px rgba(40,33,20,.05);
    --shadow-2: 0 2px 6px rgba(40,33,20,.07), 0 8px 24px rgba(40,33,20,.06);
    --shadow-pop: 0 10px 40px rgba(40,33,20,.14);
    --ease: cubic-bezier(.2,.8,.2,1);      /* federnd, aber ohne Overshoot */
    --fast: 120ms; --med: 200ms;

    --sans: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
    --maxw: 1080px;
    --sidebar: 238px;
}

:root[data-theme="dark"] {
        color-scheme: dark;
        --accent:        #f6821f;
        --accent-press:  #ff9236;
        --accent-ink:    #f9a862;   /* Text auf dunklem Grund */
        --accent-soft:   #2b2013;
        --accent-line:   #4a3a22;

        --bg:        #16130e;
        --surface:   #201c15;
        --surface-2: #272219;
        --ink:       #f2ede3;
        --ink-soft:  #cdc6b8;
        --muted:     #a49d8d;
        --faint:     #7d7667;
        --line:      #322d23;
        --line-2:    #403a2d;

        --green: #57c584; --green-bg: #16281d;
        --blue:  #6ea8e6; --blue-bg:  #172436;
        --red:   #f08a80; --red-bg:   #2c1714;
        --amber: #e0b45a; --amber-bg: #2a2312;
        --grey-bg: #2a251c;

        --shadow-1: 0 1px 2px rgba(0,0,0,.4);
        --shadow-2: 0 2px 8px rgba(0,0,0,.45), 0 12px 30px rgba(0,0,0,.35);
        --shadow-pop: 0 14px 46px rgba(0,0,0,.55);
}

/* ---------- Reset / Basis ---------- */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
/* Scrollbar-Platz immer reservieren → kein Layout-Sprung zwischen langen/kurzen Listen */
html { overflow-y: scroll; scrollbar-gutter: stable; }
body {
    font-family: var(--sans);
    background: var(--bg);
    color: var(--ink);
    font-size: 15px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}
a { color: var(--accent-ink); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

h1, h2, h3 { text-wrap: balance; }

/* ---------- Seitenleiste (linke Navigation) ---------- */
.topbar {
    position: fixed; top: 0; left: 0; bottom: 0; z-index: 50;
    width: var(--sidebar);
    display: flex; flex-direction: column; gap: 3px;
    padding: 20px 14px 16px;
    background: var(--surface);
    border-right: 1px solid var(--line);
    overflow-y: auto;
    scrollbar-width: none;          /* Firefox: Scrollleiste ausblenden */
    -ms-overflow-style: none;       /* alte Edge/IE */
}
.topbar::-webkit-scrollbar { width: 0; height: 0; display: none; }  /* WebKit/Chrome/Safari */
.brand { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; padding: 4px 8px 18px; }
.brand:hover { text-decoration: none; }
.brand img { display: block; height: 36px; width: auto; }
.brand-sub {
    font-weight: 700; color: var(--muted); font-size: 10.5px;
    text-transform: uppercase; letter-spacing: .13em; padding-left: 2px;
}
.mainnav { display: flex; flex-direction: column; gap: 2px; margin: 0; }
.mainnav a {
    color: var(--ink-soft); font-weight: 500; font-size: 14.5px;
    padding: 9px 12px; border-radius: var(--r-sm);
    transition: background var(--fast) var(--ease), color var(--fast) var(--ease);
}
.mainnav a:hover { background: var(--surface-2); text-decoration: none; color: var(--ink); }
.mainnav a.active { color: var(--accent-ink); background: var(--accent-soft); font-weight: 600; }
/* Kollabierbare Nav-Gruppe (z. B. Einstellungen) */
.navgroup { margin-top: 2px; }
.navgroup > summary {
    list-style: none; cursor: pointer; user-select: none;
    display: flex; align-items: center; gap: 10px;
    color: var(--ink-soft); font-weight: 500; font-size: 14.5px;
    padding: 9px 12px; border-radius: var(--r-sm);
    transition: background var(--fast) var(--ease), color var(--fast) var(--ease);
}
.navgroup > summary::-webkit-details-marker { display: none; }
.navgroup > summary:hover { background: var(--surface-2); color: var(--ink); }
.navgroup > summary > span:first-of-type { flex: 1; }
.navgroup > summary .ic { opacity: .8; }
.navgroup .navchev { display: inline-flex; transition: transform var(--fast) var(--ease); opacity: .7; }
.navgroup[open] > summary .navchev { transform: rotate(180deg); }
.navgroup-body { display: flex; flex-direction: column; gap: 2px; margin: 2px 0 2px 12px; padding-left: 8px; border-left: 1px solid var(--line); }
/* Untergruppe nur zeigen, wenn aufgeklappt – erst per Klick auf die Überschrift sichtbar */
.navgroup:not([open]) > .navgroup-body { display: none; }
.navgroup-body a { font-size: 14px; }
.user-menu {
    margin-top: auto; display: flex; flex-direction: column; align-items: stretch; gap: 10px;
    padding-top: 14px; border-top: 1px solid var(--line);
}
.user-name { font-size: 13px; color: var(--muted); font-weight: 500; padding: 0 4px; }
.user-name:hover { color: var(--ink); }
.user-menu .btn { width: 100%; }

/* Mitteilungen (Glocke + Panel) */
.notif { position: relative; }
.notif-btn { position: relative; background: none; border: 0; cursor: pointer; color: var(--muted);
    padding: 6px; border-radius: 8px; display: inline-flex; line-height: 0; }
.notif-btn:hover { background: var(--surface-2); color: var(--ink); }
.notif-badge { position: absolute; top: -3px; right: -3px; min-width: 17px; height: 17px; padding: 0 4px;
    background: var(--red); color: #fff; border-radius: 999px; font-size: 10px; font-weight: 800;
    line-height: 17px; text-align: center; box-shadow: 0 0 0 2px var(--surface); }
.notif-badge.pulse { animation: notifPulse 1.8s ease-out infinite; }
@keyframes notifPulse { 0% { box-shadow: 0 0 0 2px var(--surface), 0 0 0 0 rgba(180,35,24,.5); }
    70% { box-shadow: 0 0 0 2px var(--surface), 0 0 0 7px rgba(180,35,24,0); }
    100% { box-shadow: 0 0 0 2px var(--surface), 0 0 0 0 rgba(180,35,24,0); } }
.notif-panel { position: fixed; left: 12px; bottom: 66px; width: 340px; max-height: 64vh;
    overflow-y: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md);
    box-shadow: var(--shadow-pop); z-index: 70; }
.notif-head { display: flex; align-items: center; gap: 8px; padding: 13px 15px; font-weight: 800; font-size: 14px;
    border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--surface); z-index: 1; }
.notif-n { margin-left: auto; background: var(--red); color: #fff; font-size: 11px; font-weight: 800;
    border-radius: 999px; padding: 1px 8px; }
.notif-empty { padding: 26px 14px; color: var(--muted); font-size: 13px; text-align: center; }
.notif-item { display: flex; gap: 11px; padding: 12px 15px; border-bottom: 1px solid var(--line); align-items: flex-start;
    border-left: 3px solid transparent; }
.notif-item:last-child { border-bottom: 0; }
.notif-item:hover { background: var(--surface-2); text-decoration: none; }
.notif-ic { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; flex: 0 0 auto;
    border-radius: 9px; background: var(--accent-soft); color: var(--accent-ink); margin-top: 1px; }
.notif-item.k-mail { border-left-color: #2563eb; }
.notif-item.k-mail .notif-ic { background: #e5edff; color: #2563eb; }
.notif-item.k-anfrage { border-left-color: var(--accent); }
.notif-item.k-upload { border-left-color: var(--green); }
.notif-item.k-upload .notif-ic { background: var(--green-bg); color: var(--green); }
.notif-item.k-chat { border-left-color: #7c3aed; }
.notif-item.k-chat .notif-ic { background: #efe8fd; color: #7c3aed; }
.notif-tx { display: flex; flex-direction: column; gap: 1px; min-width: 0; flex: 1; }
.notif-tx strong { font-size: 13.5px; font-weight: 700; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.notif-tx .muted { font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.notif-time { flex: 0 0 auto; font-size: 11px; color: var(--muted); white-space: nowrap; margin-top: 2px; }
@media (max-width: 820px) { .notif-panel { position: fixed; top: 60px; right: 12px; bottom: auto; left: 12px; width: auto; } }

/* Aufblinkender Live-Toaster */
.ntoasts { position: fixed; right: 18px; bottom: 18px; z-index: 200; display: flex; flex-direction: column; gap: 10px;
    width: 340px; max-width: calc(100vw - 32px); pointer-events: none; }
.ntoast { pointer-events: auto; display: flex; align-items: flex-start; gap: 11px; padding: 12px 12px 12px 14px;
    background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--accent);
    border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,.18); text-decoration: none; color: inherit;
    animation: ntoastIn .32s cubic-bezier(.2,.8,.25,1); }
.ntoast.k-mail { border-left-color: #2563eb; }
.ntoast.k-upload { border-left-color: var(--green); }
.ntoast.k-anfrage { border-left-color: var(--accent); }
.ntoast.k-chat { border-left-color: #7c3aed; }
.ntoast.k-chat .nt-ic { background: #efe8fd; color: #7c3aed; }
.ntoast.k-chat .nt-label { color: #7c3aed; }
.ntoast.out { animation: ntoastOut .3s ease forwards; }
.ntoast.blink { animation: ntoastIn .32s cubic-bezier(.2,.8,.25,1), ntoastBlink .5s ease-in-out 3; }
.ntoast .nt-ic { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; flex: 0 0 auto;
    border-radius: 10px; background: var(--accent-soft); color: var(--accent-ink); }
.ntoast.k-mail .nt-ic { background: #e5edff; color: #2563eb; }
.ntoast.k-upload .nt-ic { background: var(--green-bg); color: var(--green); }
.nt-tx { display: flex; flex-direction: column; gap: 1px; min-width: 0; flex: 1; }
.nt-label { font-size: 10.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; color: var(--accent-ink); }
.ntoast.k-mail .nt-label { color: #2563eb; }
.ntoast.k-upload .nt-label { color: var(--green); }
.nt-tx strong { font-size: 13.5px; font-weight: 700; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nt-tx .muted { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nt-x { background: none; border: 0; color: var(--muted); font-size: 20px; line-height: 1; cursor: pointer; padding: 0 2px; flex: 0 0 auto; }
.nt-x:hover { color: var(--ink); }
@keyframes ntoastIn { from { opacity: 0; transform: translateX(30px); } to { opacity: 1; transform: none; } }
@keyframes ntoastOut { to { opacity: 0; transform: translateX(30px); } }
@keyframes ntoastBlink { 0%,100% { box-shadow: 0 10px 30px rgba(0,0,0,.18); }
    50% { box-shadow: 0 0 0 3px var(--accent-soft), 0 10px 30px rgba(235,105,7,.3); } }

/* Brand-Zeile mit Einklapp-Button */
.brandrow { display: flex; align-items: center; gap: 6px; margin-bottom: 16px; }
.brandrow .brand { flex: 1; padding-bottom: 0; }
.brand img.brand-mark { display: none; }   /* nur im Rail-Modus sichtbar (höhere Spezifität als .brand img) */
.nav-collapse { background: none; border: 0; cursor: pointer; color: var(--muted); padding: 6px;
    border-radius: 8px; display: inline-flex; line-height: 0; align-self: center; flex-shrink: 0; }
.nav-collapse:hover { background: var(--surface-2); color: var(--ink); }
.nav-collapse .ic { transform: rotate(90deg); transition: transform var(--fast) var(--ease); }   /* zeigt nach links (einklappen) */
:root.nav-rail .nav-collapse .ic { transform: rotate(-90deg); }                                    /* zeigt nach rechts (ausklappen) */
/* Auswahlkarten (Ansicht anpassen) */
.radio-card { display: flex; align-items: flex-start; gap: 10px; padding: 11px 13px;
    border: 1px solid var(--line); border-radius: 10px; margin-bottom: 9px; cursor: pointer;
    transition: border-color var(--fast) var(--ease), background var(--fast) var(--ease); }
.radio-card:hover { background: var(--surface-2); }
.radio-card input { margin-top: 3px; width: 17px; height: 17px; accent-color: var(--accent); flex-shrink: 0; }
.radio-card > span { display: flex; flex-direction: column; gap: 2px; }
.radio-card > span .muted { font-weight: 400; font-size: 12.5px; text-transform: none; letter-spacing: 0; }
.radio-card:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }

@media (min-width: 821px) {
    /* ---- Rail-Modus: schmale Icon-Leiste, klappt beim Hovern als Overlay aus ---- */
    :root.nav-rail .topbar {
        width: 72px; overflow-x: hidden;
        transition: width var(--med) var(--ease), box-shadow var(--med) var(--ease);
        z-index: 60;
    }
    :root.nav-rail .container { margin-left: 72px; }

    /* Texte/Labels im Rail sanft ausblenden (Icons bleiben gleich groß & an Ort und Stelle) */
    :root.nav-rail .topbar .brand,
    :root.nav-rail .topbar .nl,
    :root.nav-rail .topbar .brand-sub,
    :root.nav-rail .topbar .navchev,
    :root.nav-rail .topbar .nav-collapse,
    :root.nav-rail .topbar .user-name,
    :root.nav-rail .topbar .notif,
    :root.nav-rail .topbar .theme-toggle,
    :root.nav-rail .topbar .user-menu .btn {
        opacity: 0; pointer-events: none; white-space: nowrap;
        transition: opacity var(--fast) var(--ease);
    }
    /* Rechtes Padding weg → das 18px-Icon hat links Platz und wird nicht gestaucht (kein Springen beim Hover) */
    :root.nav-rail .mainnav a,
    :root.nav-rail .navgroup > summary { padding-right: 0; }
    :root.nav-rail .navgroup-body { margin-left: 0; padding-left: 0; border-left: 0; }

    /* Kategorie-Überschriften: gleiche Box wie ausgeklappt (Höhe bleibt), nur Text transparent + Trennstrich.
       So verschiebt sich beim Hovern vertikal nichts – die Icons bleiben exakt an derselben Stelle. */
    :root.nav-rail .navsec {
        color: transparent; border-top: 1px solid var(--line); overflow: hidden; white-space: nowrap;
        transition: color var(--fast) var(--ease), border-color var(--fast) var(--ease);
    }
    :root.nav-rail .navgroup { border-top: 1px solid var(--line); }

    /* Hover: Rail klappt zur vollen Breite als Overlay aus */
    :root.nav-rail .topbar:hover { width: var(--sidebar); box-shadow: var(--shadow-pop); }
    :root.nav-rail .topbar:hover .mainnav a,
    :root.nav-rail .topbar:hover .navgroup > summary { padding-right: 12px; }
    :root.nav-rail .topbar:hover .navgroup { border-top-color: transparent; }
    :root.nav-rail .topbar:hover .brand,
    :root.nav-rail .topbar:hover .nl,
    :root.nav-rail .topbar:hover .brand-sub,
    :root.nav-rail .topbar:hover .navchev,
    :root.nav-rail .topbar:hover .nav-collapse,
    :root.nav-rail .topbar:hover .user-name,
    :root.nav-rail .topbar:hover .notif,
    :root.nav-rail .topbar:hover .theme-toggle,
    :root.nav-rail .topbar:hover .user-menu .btn { opacity: 1; pointer-events: auto; }
    /* Hover: Überschrift einblenden, Trennstrich ausblenden – identische Box, kein vertikaler Versatz */
    :root.nav-rail .topbar:hover .navsec { color: var(--faint); border-top-color: transparent; }

    /* Variante 2: kurzes Fade beim Sichtbarwerden statt hartem Einschalten – verteilt das
       Rendern des Logos auf mehrere Frames, sodass der harte Sprung/Ruckler am Anfang entfällt. */
    :root.nav-rail .topbar .brand { transition: opacity 100ms var(--ease); }
}

/* ---------- Layout ---------- */
.container { margin-left: var(--sidebar); max-width: none; padding: 34px 44px 78px; }
.pagehead {
    display: flex; align-items: flex-end; justify-content: space-between;
    gap: 16px; flex-wrap: wrap; margin-bottom: 24px;
}
.pagehead h1 {
    font-size: 25px; line-height: 1.12; letter-spacing: -.021em; margin: 0; font-weight: 700;
}
.pagehead .muted { margin-top: 3px; }
.muted { color: var(--muted); }
.pagefoot { text-align: center; color: var(--faint); font-size: 12px; padding: 28px; letter-spacing: .01em; }

/* ---------- Cards / Grids ---------- */
.card {
    background: var(--surface); border: 1px solid var(--line);
    border-radius: var(--r-lg); box-shadow: var(--shadow-1);
    padding: 22px 24px; margin-bottom: 20px;
}
.card h2 {
    font-size: 16px; letter-spacing: -.01em; margin: 0 0 15px; font-weight: 650;
}
.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: 1fr 1fr; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.detail-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 20px; align-items: start; }
@media (max-width: 900px) { .detail-grid { grid-template-columns: 1fr; } }
@media (max-width: 820px) {
    .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
    /* Seitenleiste klappt zur oberen Leiste (mit scrollbarer Navi-Zeile) */
    .topbar {
        position: sticky; top: 0; left: auto; bottom: auto; width: auto; height: auto;
        flex-direction: row; flex-wrap: wrap; align-items: center; gap: 8px 16px;
        padding: 10px 18px; border-right: none;
        border-bottom: 1px solid color-mix(in srgb, var(--line) 75%, transparent);
        overflow: visible;
        background: color-mix(in srgb, var(--surface) 82%, transparent);
        backdrop-filter: blur(16px) saturate(180%); -webkit-backdrop-filter: blur(16px) saturate(180%);
    }
    .brand { flex-direction: row; align-items: center; gap: 10px; padding: 0; }
    .brand-sub { text-transform: none; letter-spacing: .01em; font-size: 12.5px; font-weight: 600;
        border-left: 1.5px solid var(--accent); padding-left: 9px; }
    .user-menu {
        margin-top: 0; margin-left: auto; flex-direction: row; align-items: center;
        gap: 10px; padding-top: 0; border-top: none;
    }
    .user-menu .btn { width: auto; }
    .user-name { display: none; }
    .mainnav {
        display: flex; flex-direction: row; order: 3; width: 100%; gap: 3px;
        overflow-x: auto; padding-top: 9px; margin-top: 1px;
        border-top: 1px solid var(--line); -webkit-overflow-scrolling: touch;
    }
    .mainnav::-webkit-scrollbar { display: none; }
    .mainnav a { white-space: nowrap; padding: 7px 12px; }
    .container { margin-left: 0; padding: 20px 18px 60px; }
}

/* ---------- Stat-Kacheln ---------- */
.stat {
    background: var(--surface); border: 1px solid var(--line);
    border-radius: var(--r-md); box-shadow: var(--shadow-1);
    padding: 17px 19px;
}
.stat .num {
    font-size: 30px; font-weight: 700; letter-spacing: -.02em;
    font-variant-numeric: tabular-nums; line-height: 1.05;
}
.stat .lbl { font-size: 13px; color: var(--muted); margin-top: 3px; }
.stat .accent { color: var(--accent-ink); }

/* ---------- Tabellen ---------- */
.table-wrap { overflow-x: auto; margin: 0 -4px; padding: 0 4px; }
table.data { width: 100%; border-collapse: collapse; font-size: 14px; }
table.data th, table.data td { text-align: left; padding: 12px 12px; border-bottom: 1px solid var(--line); }
table.data th {
    color: var(--muted); font-weight: 600; font-size: 11.5px;
    text-transform: uppercase; letter-spacing: .05em;
}
table.data tbody tr { transition: background var(--fast) var(--ease); }
table.data tbody tr:hover td { background: var(--surface-2); }
table.data tr:last-child td { border-bottom: none; }
table.data td.num, table.data th.num { text-align: right; font-variant-numeric: tabular-nums; }

/* ---------- Formulare ---------- */
.form-row { margin-bottom: 16px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 640px) { .form-grid { grid-template-columns: 1fr; } }
label {
    display: block; font-size: 12px; font-weight: 650; color: var(--ink-soft);
    margin-bottom: 6px; letter-spacing: .02em; text-transform: uppercase;
}
input[type=text], input[type=email], input[type=tel], input[type=number], input[type=date],
input[type=url], input[type=search], input[type=month], input[type=password], select, textarea {
    width: 100%; padding: 10px 12px; font-size: 14px; font-family: inherit;
    color: var(--ink); background: var(--surface);
    border: 1px solid var(--line-2); border-radius: var(--r-sm);
    transition: border-color var(--fast) var(--ease), box-shadow var(--fast) var(--ease);
}
input::placeholder, textarea::placeholder { color: var(--faint); }
input:focus, select:focus, textarea:focus {
    outline: none; border-color: var(--accent);
    box-shadow: 0 0 0 3.5px var(--accent-soft);
}
textarea { min-height: 92px; resize: vertical; line-height: 1.5; }
.hint { font-size: 12px; color: var(--muted); margin-top: 5px; line-height: 1.45; }
select { appearance: none; -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2378756c' d='M6 8.5 2 4.5h8z'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 12px center; padding-right: 32px; }

/* ---------- Checkboxen & Radios (browserübergreifend identisch, Markenfarbe) ---------- */
input[type=checkbox], input[type=radio] {
    appearance: none; -webkit-appearance: none; margin: 0; flex: none;
    width: 18px; height: 18px; vertical-align: -4px; cursor: pointer;
    background: var(--surface); border: 1.5px solid var(--line-2);
    background-repeat: no-repeat; background-position: center;
    transition: background var(--fast) var(--ease), border-color var(--fast) var(--ease), box-shadow var(--fast) var(--ease);
}
input[type=checkbox] { border-radius: var(--r-sm); }
input[type=radio]    { border-radius: 50%; }
input[type=checkbox]:hover, input[type=radio]:hover { border-color: var(--accent); }
input[type=checkbox]:checked, input[type=radio]:checked { background-color: var(--accent); border-color: var(--accent); }
input[type=checkbox]:checked {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' d='M2.5 6.2 4.8 8.5 9.5 3.5'/%3E%3C/svg%3E");
    background-size: 12px 12px;
}
input[type=radio]:checked { background-image: radial-gradient(circle, #fff 0 3px, transparent 3.6px); }
input[type=checkbox]:focus-visible, input[type=radio]:focus-visible { outline: none; box-shadow: 0 0 0 3.5px var(--accent-soft); }
input[type=checkbox]:disabled, input[type=radio]:disabled { opacity: .5; cursor: not-allowed; }

/* ---------- Datei-Upload (einheitlicher Button statt Browser-Default) ---------- */
input[type=file] { font-family: inherit; font-size: 13px; color: var(--muted); max-width: 100%; }
input[type=file]::file-selector-button {
    font-family: inherit; font-size: 13px; font-weight: 600; color: var(--ink);
    background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r-sm);
    padding: 7px 13px; margin-right: 12px; cursor: pointer;
    transition: background var(--fast) var(--ease), border-color var(--fast) var(--ease);
}
input[type=file]::file-selector-button:hover { background: var(--surface-2); border-color: var(--accent); }
input[type=file]::-webkit-file-upload-button {
    font-family: inherit; font-size: 13px; font-weight: 600; color: var(--ink);
    background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r-sm);
    padding: 7px 13px; margin-right: 12px; cursor: pointer;
}

/* ---------- Buttons (Feedback auf Druck, nicht erst beim Loslassen) ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 7px;
    cursor: pointer; font-family: inherit; font-size: 14px; font-weight: 600;
    padding: 9px 17px; border: 1px solid transparent; border-radius: var(--r-sm);
    text-decoration: none; white-space: nowrap; letter-spacing: -.005em;
    transition: transform var(--fast) var(--ease), background var(--fast) var(--ease),
                border-color var(--fast) var(--ease), box-shadow var(--fast) var(--ease);
}
.btn:hover { text-decoration: none; }
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--accent); color: #fff; box-shadow: 0 1px 2px rgba(180,80,10,.35); }
.btn-primary:hover { background: var(--accent-press); }
.btn-ghost { background: var(--surface); border-color: var(--line-2); color: var(--ink); }
.btn-ghost:hover { background: var(--surface-2); border-color: var(--line-2); }
.btn-danger { background: var(--surface); border-color: color-mix(in srgb, var(--red) 45%, var(--line)); color: var(--red); }
.btn-danger:hover { background: var(--red-bg); }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-block { width: 100%; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

/* ---------- Badges ---------- */
.badge {
    display: inline-block; padding: 3px 11px; border-radius: var(--r-sm);
    font-size: 12px; font-weight: 600; letter-spacing: .01em; vertical-align: middle;
}
.badge-grey   { background: var(--grey-bg);   color: var(--ink-soft); }
.badge-orange { background: var(--accent-soft); color: var(--accent-ink); }
.badge-green  { background: var(--green-bg);  color: var(--green); }
.badge-blue   { background: var(--blue-bg);   color: var(--blue); }
.badge-red    { background: var(--red-bg);    color: var(--red); }

/* ---------- Flash-Meldungen (Status/Erfolg/Fehler) ---------- */
.flash {
    padding: 12px 16px; border-radius: var(--r-md); margin-bottom: 18px;
    font-size: 14px; font-weight: 500; border: 1px solid transparent;
    animation: flash-in var(--med) var(--ease);
}
@keyframes flash-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.flash-success { background: var(--green-bg); color: var(--green); border-color: color-mix(in srgb, var(--green) 22%, transparent); }
.flash-error   { background: var(--red-bg);   color: var(--red);   border-color: color-mix(in srgb, var(--red) 24%, transparent); }
.flash-info    { background: var(--blue-bg);  color: var(--blue);  border-color: color-mix(in srgb, var(--blue) 22%, transparent); }

/* ---------- Auth / öffentliche Seiten ---------- */
.auth-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px;
    background:
        radial-gradient(90ch 60ch at 50% -10%, var(--accent-soft), transparent 60%),
        var(--bg); }
.auth-card {
    background: var(--surface); border: 1px solid var(--line);
    border-radius: var(--r-lg); box-shadow: var(--shadow-2);
    padding: 36px 34px; width: 100%; max-width: 400px;
}
.auth-card .logo { text-align: center; margin-bottom: 22px; }
.auth-card .logo img { width: auto; height: 48px; margin: 0 auto; }   /* Logo kompakt statt auf Kartenbreite gestreckt */
.auth-card h1 { font-size: 20px; text-align: center; letter-spacing: -.02em; margin: 0 0 20px; font-weight: 700; }

/* ---------- Key/Value-Liste ---------- */
dl.kv { margin: 0; display: grid; grid-template-columns: 130px 1fr; gap: 9px 14px; font-size: 14px; }
dl.kv dt { color: var(--muted); }
dl.kv dd { margin: 0; }

/* ---------- Kommunikations-Zeitstrahl ---------- */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { padding: 13px 0 13px 46px; position: relative; border-bottom: 1px solid var(--line); }
.timeline li:last-child { border-bottom: none; }
.timeline .chan {
    position: absolute; left: 0; top: 13px; width: 32px; height: 32px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center; font-size: 14px;
}
.chan-email    { background: var(--blue-bg);   color: var(--blue); }
.chan-telefon  { background: var(--accent-soft); color: var(--accent-ink); }
.chan-whatsapp { background: var(--green-bg);  color: var(--green); }
.chan-notiz    { background: var(--grey-bg);   color: var(--ink-soft); }
.timeline .meta { font-size: 12px; color: var(--muted); margin-top: 2px; }
.dir-in { border-left: 2px solid var(--green); padding-left: 9px; }

/* ---------- Kalkulations-Panel (bewusst dunkles Fokus-Material, beide Themes) ---------- */
.calc-result {
    background: linear-gradient(160deg, #211d16, #17140f);
    color: #fff; border-radius: var(--r-lg); padding: 22px 24px;
    border: 1px solid rgba(255,255,255,.06); box-shadow: var(--shadow-2);
}
.calc-result .rate { font-size: 34px; font-weight: 750; letter-spacing: -.025em;
    color: #fff; font-variant-numeric: tabular-nums; line-height: 1.05; }
.calc-result .rate small { font-size: 15px; font-weight: 500; opacity: .72; letter-spacing: 0; }
.calc-result .sub { opacity: .74; font-size: 13px; margin-top: 8px; }
.calc-result .accent { color: var(--accent); font-variant-numeric: tabular-nums; }

/* ---------- Inline-Code ---------- */
code {
    font-family: var(--mono); font-size: .88em;
    background: var(--surface-2); border: 1px solid var(--line);
    padding: 1px 6px; border-radius: 5px;
}

/* ---------- Barrierefreiheit: Bewegung / Transparenz / Kontrast ---------- */
@media (prefers-reduced-motion: reduce) {
    * { animation-duration: .001ms !important; animation-iteration-count: 1 !important;
        transition-duration: .001ms !important; }
    .btn:active { transform: none; }
}
@media (prefers-reduced-transparency: reduce) {
    .topbar { background: var(--surface); backdrop-filter: none; -webkit-backdrop-filter: none; }
    .auth-wrap { background: var(--bg); }
}
@media (prefers-contrast: more) {
    :root { --line: #b9b3a6; --line-2: #b9b3a6; --muted: #5c5951; }
    .card, .stat { border-color: var(--line-2); }
}

/* ==========================================================================
   Anfrage-System (Liste + Detailansicht) — nach Vorbild easyautoleasing,
   im cleverscout-Design.
   ========================================================================== */

/* ---------- Seitenleisten-Abschnitte ---------- */
.navsec { font-size: 10.5px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
    color: var(--faint); padding: 14px 12px 6px; }
.navsec:first-of-type { padding-top: 4px; }
.mainnav a .ico { width: 18px; display: inline-flex; justify-content: center; opacity: .8; }

/* ---------- Seitenkopf mit Aktionsleiste ---------- */
.toolbar { display: flex; align-items: center; gap: 6px 18px; flex-wrap: wrap; margin-bottom: 16px; }
.toolbar .tool { display: inline-flex; align-items: center; gap: 7px; font-size: 13.5px; font-weight: 600;
    color: var(--ink-soft); background: none; border: none; cursor: pointer; padding: 7px 8px; border-radius: 8px; }
.toolbar .tool:hover { background: var(--surface-2); color: var(--ink); text-decoration: none; }
.toolbar .tool.accent { color: var(--accent-ink); }
.toolbar .sep { flex: 1; }

/* ---------- Liste (Datentabelle mit Filterzeile) ---------- */
.listtable { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.listtable th { text-align: left; color: var(--muted); font-weight: 600; font-size: 11px;
    text-transform: uppercase; letter-spacing: .04em; padding: 10px 12px 6px; }
.listtable th small { text-transform: none; letter-spacing: 0; font-weight: 500; opacity: .7; }
.listtable td { padding: 11px 12px; border-top: 1px solid var(--line); vertical-align: middle; }
.listtable tbody tr { transition: background var(--fast) var(--ease); }
.listtable tbody tr:hover td { background: var(--surface-2); }
.listtable .filterrow th { padding: 0 8px 10px; vertical-align: top; }
.listtable .filterrow input, .listtable .filterrow select {
    width: 100%; padding: 6px 9px; font-size: 12.5px; border-radius: 7px; }
/* Selects (Status, User, Quelle) nicht zusammenquetschen */
.listtable .filterrow select { min-width: 130px; }
.listtable .filterrow input { min-width: 96px; }
/* Bereichsfilter (Datum von/bis, Kaufpreis ab/bis) gestapelt */
.listtable .filterrow .fcell-range { display: flex; flex-direction: column; gap: 4px; min-width: 118px; }
.listtable .filterrow .fcell-range input { min-width: 0; }

/* ---------- Öffentliches Anfrageformular ---------- */
body.publicform { background: var(--surface-2); }
.pf-wrap { max-width: 760px; margin: 0 auto; padding: 32px 20px 60px; }
.pf-head { display: flex; justify-content: center; margin-bottom: 22px; }
.pf-card { padding: 30px 34px; position: relative; }
.pf-card h1 { font-size: 24px; margin: 0 0 14px; letter-spacing: -.02em; }
.pf-q { font-size: 16px; font-weight: 700; margin: 0 0 14px; }
.pf-section { font-size: 20px; font-weight: 700; letter-spacing: -.01em;
    margin: 30px 0 16px; padding-top: 22px; border-top: 1px solid var(--line); }
.pf-radios { display: flex; flex-wrap: wrap; gap: 12px 28px; margin-bottom: 6px; }
.pf-radio { display: inline-flex; align-items: center; gap: 9px; font-weight: 600; cursor: pointer;
    text-transform: none; letter-spacing: 0; }
.pf-radio input { width: 18px; height: 18px; accent-color: var(--accent); }
.req { color: var(--red); font-weight: 700; }

/* ---------- E-Mail-Ansicht: echte HTML-Darstellung + Anhänge ---------- */
.mailframe-wrap { border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; background: #fff; }
.mailframe { width: 100%; height: 480px; border: 0; display: block; background: #fff; }
.attach-list { margin-top: 18px; border-top: 1px solid var(--line); padding-top: 14px; }
.attach-head { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase;
    letter-spacing: .04em; display: flex; align-items: center; gap: 7px; margin-bottom: 10px; }
.attach-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--line);
    border-radius: var(--r-sm); margin-bottom: 8px; background: var(--surface); }
.attach-item .attach-ic { color: var(--muted); display: inline-flex; }
.attach-item .attach-name { flex: 1; font-weight: 500; font-size: 14px; word-break: break-word; }
.attach-item .attach-size { color: var(--muted); font-size: 12.5px; white-space: nowrap; }
.msg-clip { color: var(--muted); display: inline-flex; vertical-align: middle; margin-left: 4px; }
/* Mail-Richtung (gesendet vs. eingegangen/Antwort) */
.mail-dir { display: inline-flex; }
.mail-dir.out { color: var(--blue); }
.mail-dir.in { color: var(--green); }
/* Kundenhistorie (frühere Anfragen) */
.hist-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); }
.hist-row:first-of-type { border-top: 0; padding-top: 2px; }
.hist-nr { font-weight: 600; color: var(--accent-ink); white-space: nowrap; }
.hist-title { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.hist-date { white-space: nowrap; }
@media (max-width: 560px) { .hist-title { display: none; } }
/* Anhang-Auswahl beim Versand */
.attach-check { display: flex; align-items: center; gap: 9px; padding: 8px 11px; border: 1px solid var(--line);
    border-radius: 8px; margin-bottom: 7px; font-weight: 500; cursor: pointer; font-size: 13.5px; }
.attach-check:hover { background: var(--surface-2); }
.attach-check input[type="checkbox"] { width: 17px; height: 17px; accent-color: var(--accent); flex-shrink: 0; }
/* Inline-Kategorieauswahl in der Dokumententabelle */
.catselect { font-size: 12px; padding: 4px 7px; border-radius: 7px; max-width: 170px; }
/* Per E-Mail erhaltene Anhänge (noch nicht übernommen) */
.recv-att { display: flex; align-items: center; gap: 10px; padding: 7px 2px; border-bottom: 1px solid var(--line); font-size: 13px; }
.recv-att:last-child { border-bottom: 0; }
.recv-att .attach-ic { color: var(--muted); display: inline-flex; }
.recv-att-name { flex: 1; font-weight: 500; word-break: break-word; min-width: 0; }

/* ---------- Filterleiste (Anfragenübersicht) ---------- */
.filterbar {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px 14px; align-items: end;
    padding: 16px; margin-bottom: 16px;
    background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-md);
}
.filterbar .fb-field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.filterbar label { font-size: 11px; font-weight: 700; color: var(--muted);
    text-transform: uppercase; letter-spacing: .04em; }
.filterbar input, .filterbar select { width: 100%; padding: 8px 10px; font-size: 13.5px; }
.filterbar .fb-range { display: flex; gap: 6px; }
.filterbar .fb-range input { min-width: 0; }
.filteractions { grid-column: 1 / -1; display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
.filteractions .btn { min-width: 140px; justify-content: center; }
@media (max-width: 640px) { .filteractions .btn { flex: 1; min-width: 0; } }
/* Eigene Autovervollständigung (Filterleiste) */
.ac-menu { position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 45;
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-sm);
    box-shadow: var(--shadow-2); max-height: 240px; overflow-y: auto; }
.ac-item { padding: 8px 11px; font-size: 13.5px; cursor: pointer; white-space: nowrap;
    overflow: hidden; text-overflow: ellipsis; }
.ac-item:hover, .ac-item.active { background: var(--accent-soft); color: var(--accent-ink); }
.listtable td.num { text-align: right; font-variant-numeric: tabular-nums; }
/* Letzte Spalte (Aktionen/Papierkorb) schmal halten, damit Filter-/Inhaltsspalten die volle Breite füllen */
.listtable th:last-child, .listtable td:last-child { width: 1%; white-space: nowrap; }
.listtable .idlink { color: var(--accent-ink); font-weight: 600; display: inline-flex; align-items: center; gap: 6px; }
.icon-btn { background: none; border: none; cursor: pointer; color: var(--muted); padding: 5px; border-radius: var(--r-sm);
    display: inline-flex; line-height: 0; }
.icon-btn:hover { background: var(--surface-2); color: var(--ink); }
.icon-btn.danger:hover { color: var(--red); background: var(--red-bg); }

/* ---------- Detail: Kopfzeile mit User/Status ---------- */
.detailbar { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.detailbar h1 { font-size: 23px; letter-spacing: -.02em; margin: 0; margin-right: auto; font-weight: 700; }
.detailbar .field-inline { min-width: 210px; }
.detailbar .field-inline label { margin-bottom: 3px; }

/* ---------- Detail: 2-Spalten-Raster ---------- */
.anfrage-grid { display: grid; grid-template-columns: 1.12fr 1fr; gap: 20px; align-items: start; }
@media (max-width: 980px) { .anfrage-grid { grid-template-columns: 1fr; } }
.stack { display: flex; flex-direction: column; gap: 20px; }

/* ---------- Karten mit farbigem Kopf ---------- */
.dcard { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
    box-shadow: var(--shadow-1); overflow: hidden; }
.dcard > .dhead { display: flex; align-items: center; gap: 9px; padding: 13px 18px; font-weight: 650; font-size: 15px;
    background: var(--surface-2); border-bottom: 1px solid var(--line); }
.dcard > .dhead .dico { font-size: 16px; line-height: 1; }
.dcard.green  > .dhead { background: var(--green-bg); color: var(--green);
    border-bottom-color: color-mix(in srgb, var(--green) 22%, transparent); }
.dcard.orange > .dhead { background: var(--accent-soft); color: var(--accent-ink);
    border-bottom-color: var(--accent-line); }
.dcard.blue   > .dhead { background: var(--blue-bg); color: var(--blue);
    border-bottom-color: color-mix(in srgb, var(--blue) 22%, transparent); }
.dcard > .dbody { padding: 18px; }
.dcard .dbody + .dbody { border-top: 1px solid var(--line); }

/* Kompaktere Felder in Detailkarten */
.fg2 { display: grid; grid-template-columns: 1fr 1fr; gap: 13px 14px; }
.fg3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 13px 14px; }
.fg-2-1 { display: grid; grid-template-columns: 2fr 1fr; gap: 13px 14px; }
@media (max-width: 620px) { .fg2, .fg3, .fg-2-1 { grid-template-columns: 1fr; } }
.dbody .form-row { margin-bottom: 13px; }
.dbody .form-row:last-child { margin-bottom: 0; }

/* ---------- "Kunde existiert bereits"-Banner ---------- */
.infobanner { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; padding: 11px 14px;
    background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; margin-bottom: 16px; font-size: 13.5px; }
.infobanner .ib-ico { color: var(--blue); }
.chip-ref { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 999px;
    background: var(--blue-bg); color: var(--blue); font-size: 12px; font-weight: 600; text-decoration: none; }
.chip-ref:hover { text-decoration: none; filter: brightness(.97); }

/* ---------- Mini-Tabellen (E-Mails, Dokumente) ---------- */
.minitable { width: 100%; border-collapse: collapse; font-size: 13px; }
.minitable th { text-align: left; color: var(--muted); font-weight: 600; font-size: 11px; text-transform: uppercase;
    letter-spacing: .04em; padding: 6px 10px; }
.minitable td { padding: 9px 10px; border-top: 1px solid var(--line); }
.minitable tbody tr:hover td { background: var(--surface-2); }
.scrolly { max-height: 260px; overflow-y: auto; }
.subhead { font-size: 12.5px; font-weight: 650; color: var(--ink-soft); display: flex; align-items: center;
    gap: 7px; margin: 4px 0 8px; }
.subhead .cnt { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px;
    padding: 0 6px; border-radius: 999px; background: var(--surface-2); font-size: 11px; color: var(--muted); }

/* ---------- Tabs (Kalkulation) ---------- */
.tabs { display: flex; gap: 4px; background: var(--surface-2); padding: 4px; border-radius: var(--r-md); margin-bottom: 16px; }
.tab { flex: 1; text-align: center; padding: 8px 6px; font-size: 13px; font-weight: 600; border-radius: var(--r-sm);
    border: none; background: none; color: var(--ink-soft); cursor: pointer; transition: all var(--fast) var(--ease); }
.tab:hover { color: var(--ink); }
.tab.active { background: var(--accent); color: #fff; box-shadow: 0 1px 2px rgba(180,80,10,.3); }
.calc-out { border-color: var(--accent) !important; background: var(--accent-soft) !important; font-weight: 700; }

/* ---------- Ziele-Verwaltung ---------- */
.goaltable { width: 100%; border-collapse: collapse; font-size: 13px; }
.goaltable th { text-align: left; font-size: 10.5px; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); font-weight: 600; padding: 4px 6px; white-space: nowrap; }
.goaltable td { padding: 4px 6px; vertical-align: middle; border-top: 1px solid var(--line); }
.goaltable input, .goaltable select { padding: 6px 8px; font-size: 13px; }
.goaltable input[type=checkbox] { width: 16px; height: 16px; }
.goaltable .newrow td { border-top: 1px dashed var(--line-2); }

/* ---------- Brief-Editor (DIN 5008, A4-WYSIWYG) ---------- */
.briefwrap { display: flex; justify-content: center; padding: 20px; overflow: auto;
    background: repeating-linear-gradient(45deg, var(--surface-2), var(--surface-2) 10px, transparent 10px, transparent 20px); border-radius: var(--r-md); }
.a4page { position: relative; background: #fff; box-shadow: 0 6px 24px rgba(0,0,0,.14); flex: none;
    font-family: Helvetica, Arial, var(--sans); color: #1d1d1b; line-height: 1.35; }
:root[data-theme="dark"] .a4page, :root:not([data-theme="light"]) .a4page { color: #1d1d1b; }
.a4guide { position: absolute; top: 0; bottom: 0; width: 0; border-left: 1px dashed #e3ded3; pointer-events: none; }
.lz { position: absolute; box-sizing: border-box; }
.zone { padding: 2px 3px; border: 1px solid transparent; border-radius: 3px; outline: none; white-space: normal; }
.zone:hover { border-color: #e3ded3; }
.zone:focus { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); background: #fffdf9; }
.zone.bold { font-weight: 700; }
.zlabel { position: absolute; top: -13px; left: 0; font-size: 9px; text-transform: uppercase; letter-spacing: .04em; color: var(--accent-ink);
    pointer-events: none; font-family: var(--sans); opacity: 0; transition: opacity .12s; background: var(--accent-soft); padding: 0 3px; border-radius: 3px; user-select: none; }
.zone:hover .zlabel, .zone:focus .zlabel, .zone:focus-within .zlabel { opacity: 1; }
.zone:hover .mvh, .zone:focus .mvh, .zone:focus-within .mvh,
.zone:hover .rzh, .zone:focus .rzh, .zone:focus-within .rzh { opacity: 1; }
.logo { cursor: grab; }
.logo img { width: 100%; height: auto; display: block; pointer-events: none; }
.lblock { position: absolute; box-sizing: border-box; border: 1px dashed transparent; border-radius: 3px; }
.lblock:hover, .lblock:focus-within { border-color: var(--accent-line); }
.lblock .block-body { outline: none; padding: 2px 3px; min-height: 1em; }
.mvh { position: absolute; top: -9px; left: -1px; width: 18px; height: 16px; background: var(--accent); color: #fff;
    font-size: 10px; line-height: 16px; text-align: center; border-radius: 4px 4px 0 0; cursor: grab; opacity: 0; transition: opacity .12s; }
.delb { position: absolute; top: -9px; right: -1px; width: 16px; height: 16px; background: var(--red); color: #fff; border: none;
    font-size: 13px; line-height: 1; border-radius: 4px; cursor: pointer; opacity: 0; transition: opacity .12s; }
.rzh { position: absolute; right: -4px; bottom: -4px; width: 12px; height: 12px; background: #fff; border: 1.5px solid var(--accent);
    border-radius: 3px; cursor: ew-resize; opacity: 0; transition: opacity .12s; }
.lblock:hover .mvh, .lblock:hover .delb, .lblock:hover .rzh, .logo:hover .rzh, .lblock:focus-within .mvh, .lblock:focus-within .delb, .lblock:focus-within .rzh { opacity: 1; }

/* ---------- Erweiterte Kalkulation (Excel-Stil) ---------- */
.calc-glance { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px 14px;
    background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 12px 14px; }
.calc-glance > div { display: flex; flex-direction: column; gap: 1px; }
.calc-glance span { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
.calc-glance b { font-size: 15px; font-variant-numeric: tabular-nums; }
@media (max-width: 560px) { .calc-glance { grid-template-columns: repeat(2, 1fr); } }

.calcsheet { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.calcsheet th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .03em;
    color: var(--muted); font-weight: 600; padding: 4px 8px; border-bottom: 1px solid var(--line-2); }
.calcsheet th.num, .calcsheet td.num { text-align: right; font-variant-numeric: tabular-nums; }
.calcsheet td { padding: 5px 8px; border-bottom: 1px solid var(--line); }
.calcsheet tr.grp td { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; font-weight: 700;
    color: var(--accent-ink); background: var(--accent-soft); padding-top: 8px; padding-bottom: 6px; border-bottom: none; }
.calcsheet tr.auto td { color: var(--ink-soft); }
.calcsheet tr.edit .c-label { width: 100%; padding: 5px 8px; border: 1px solid transparent; background: none; border-radius: 6px; }
.calcsheet tr.edit .c-label:hover, .calcsheet tr.edit input:focus { border-color: var(--line-2); background: var(--surface); }
.calcsheet tr.edit .c-amount { width: 120px; padding: 5px 8px; text-align: right; border: 1px solid var(--line-2);
    background: var(--surface); border-radius: 6px; font-variant-numeric: tabular-nums; }
.calcsheet .c-del { color: var(--muted); font-size: 18px; line-height: 1; padding: 2px 6px; }
.calcsheet .c-del:hover { color: var(--red); background: var(--red-bg); }
.calcsheet td.addrow { padding: 6px 4px; border-bottom: 1px solid var(--line-2); }
.calcsheet tr.sub td { font-weight: 600; border-top: 1px solid var(--line-2); }
.calcsheet tr.result td { font-weight: 800; font-size: 15.5px; border-bottom: 2px solid var(--ink); }
.calcsheet tr.minor td { color: var(--muted); font-size: 12.5px; border-bottom: none; padding-top: 3px; padding-bottom: 3px; }

/* ---------- Aktionspanel ---------- */
.actionblock + .actionblock { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.actionblock .lbl { font-size: 12.5px; font-weight: 650; color: var(--ink-soft); margin-bottom: 10px; }
.btn-lease { background: var(--blue); color: #fff; }
.btn-lease:hover { background: color-mix(in srgb, var(--blue) 85%, black); }

/* ---------- Sticky Aktionsleiste unten ---------- */
.formbar { position: sticky; bottom: 0; z-index: 30; margin: 24px -44px -78px; padding: 14px 44px;
    display: flex; align-items: center; gap: 14px;
    background: color-mix(in srgb, var(--surface) 82%, transparent);
    backdrop-filter: blur(16px) saturate(180%); -webkit-backdrop-filter: blur(16px) saturate(180%);
    border-top: 1px solid var(--line); }
.formbar .sep { flex: 1; }
.formbar .link-danger { color: var(--red); font-weight: 600; background: none; border: none; cursor: pointer;
    display: inline-flex; align-items: center; gap: 7px; padding: 8px; border-radius: 8px; }
.formbar .link-danger:hover { background: var(--red-bg); text-decoration: none; }
.formbar .link-muted { color: var(--muted); font-weight: 600; background: none; border: none; cursor: pointer;
    padding: 8px; text-decoration: none; }
.formbar .link-muted:hover { color: var(--ink); }
@media (max-width: 820px) { .formbar { margin: 20px -18px -60px; padding: 12px 18px; } }

/* ---------- Icons (Inline-SVG) ---------- */
.ic { flex: none; vertical-align: -0.16em; }
.mainnav a { display: flex; align-items: center; gap: 10px; }
.mainnav a .ic { opacity: .8; }
/* Nav-Icons immer exakt 18px – nie durch Flexbox stauchen (gilt in allen Zuständen) */
.mainnav a > .ic, .navgroup > summary > .ic { flex-shrink: 0; width: 18px; height: 18px; }
.mainnav a.active .ic { opacity: 1; }
.btn .ic, .tool .ic, .icon-btn .ic, .link-danger .ic, .link-muted .ic { vertical-align: -0.16em; }
.dhead .dico { display: inline-flex; align-items: center; }
.subhead .ic, .infobanner .ic { flex: none; }

/* ---------- Modal-Dialog (Dokumente generieren) ---------- */
dialog.modal { border: none; border-radius: var(--r-lg); padding: 0; max-width: 560px; width: calc(100% - 32px);
    background: var(--surface); color: var(--ink); box-shadow: var(--shadow-pop); }
dialog.modal::backdrop { background: rgba(20,16,10,.45); backdrop-filter: blur(2px); }
.modal-inner { padding: 22px 24px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 6px; }
.modal-head h2 { margin: 0; font-size: 18px; display: flex; align-items: center; gap: 9px; }
.doclist { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.docrow { display: grid; grid-template-columns: 22px 1fr auto auto; align-items: center; gap: 12px;
    padding: 11px 14px; cursor: pointer; border-top: 1px solid var(--line); }
.docrow:first-child { border-top: none; }
.docrow:hover { background: var(--surface-2); }
.docrow input { width: 18px; height: 18px; accent-color: var(--accent); }
.docname { font-size: 14px; font-weight: 500; }
.doclink { color: var(--accent-ink); font-size: 12.5px; font-weight: 600; }
.modal-foot { display: flex; align-items: center; gap: 10px; margin-top: 18px; flex-wrap: wrap; }
.modal-foot .sep { flex: 1; }

/* ---------- Postfach (Mail-Client) ---------- */
.mailbox { display: grid; grid-template-columns: 216px 1fr; gap: 20px; align-items: start; }
@media (max-width: 820px) { .mailbox { grid-template-columns: 1fr; } }
.folders { display: flex; flex-direction: column; gap: 3px; }
.folder { display: flex; align-items: center; gap: 11px; padding: 10px 13px; border-radius: 10px;
    color: var(--ink-soft); font-weight: 500; font-size: 14.5px; text-decoration: none; }
.folder:hover { background: var(--surface-2); text-decoration: none; color: var(--ink); }
.folder.active { background: var(--accent-soft); color: var(--accent-ink); font-weight: 600; }
.folder .ic { opacity: .8; }
.folder span:nth-of-type(1) { margin-right: auto; }
.fcount { font-size: 11.5px; font-variant-numeric: tabular-nums; color: var(--muted);
    background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 1px 8px; }
.folder.active .fcount { background: #fff; border-color: var(--accent-line); color: var(--accent-ink); }
:root[data-theme="dark"] .folder.active .fcount { background: var(--surface); }
/* Postfach-Gruppen je Benutzer */
.folder-lbl { font-size: 10.5px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
    color: var(--faint); padding: 4px 13px; }
.mailgroup > summary { list-style: none; cursor: pointer; user-select: none;
    display: flex; align-items: center; gap: 11px; padding: 10px 13px; border-radius: 10px;
    color: var(--ink-soft); font-weight: 500; }
.mailgroup > summary::-webkit-details-marker { display: none; }
.mailgroup > summary:hover { background: var(--surface-2); color: var(--ink); }
.mailgroup > summary > span:first-of-type { flex: 1; }
.mailgroup > summary .navchev { display: inline-flex; opacity: .7; transition: transform var(--fast) var(--ease); }
.mailgroup[open] > summary .navchev { transform: rotate(180deg); }
.mailgroup-body { display: flex; flex-direction: column; gap: 3px; margin: 3px 0 3px 12px;
    padding-left: 8px; border-left: 1px solid var(--line); }

.msglist { display: flex; flex-direction: column; }
.msg { display: grid; grid-template-columns: 30px 150px 1fr auto; align-items: center; gap: 14px;
    padding: 13px 18px; border-top: 1px solid var(--line); text-decoration: none; color: var(--ink);
    transition: background var(--fast) var(--ease); }
.msg:first-child { border-top: none; }
.msg:hover { background: var(--surface-2); text-decoration: none; }
.msg-ico { width: 30px; height: 30px; border-radius: 50%; background: var(--surface-2); color: var(--ink-soft);
    display: flex; align-items: center; justify-content: center; }
.msg-who { font-size: 13.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msg-sub { font-size: 14px; overflow: hidden; }
.msg-sub strong { font-weight: 600; }
.msg-snip { color: var(--muted); font-weight: 400; margin-left: 8px; }
.msg-date { font-size: 12px; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
@media (max-width: 640px) { .msg { grid-template-columns: 30px 1fr auto; } .msg-who { display: none; } .msg-snip { display: none; } }

/* ---------- Toasts (Flash-Meldungen) ---------- */
.toasts { position: fixed; top: 16px; right: 16px; z-index: 200; display: flex; flex-direction: column;
    gap: 10px; max-width: min(430px, calc(100vw - 32px)); }
.toasts .flash { margin: 0; box-shadow: var(--shadow-2); cursor: pointer; }
@media (max-width: 560px) { .toasts { left: 12px; right: 12px; top: 12px; max-width: none; } }

/* ---------- Responsive / Skalierung ---------- */
img, svg, video { max-width: 100%; }
.actions { row-gap: 8px; }
@media (max-width: 640px) {
    .fg3 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
    /* iOS-Zoom vermeiden + größere Touch-Ziele */
    input[type=text], input[type=email], input[type=tel], input[type=number], input[type=date],
    input[type=url], input[type=search], input[type=month], input[type=password], select, textarea { font-size: 16px; padding: 11px 12px; }
    .btn { padding: 10px 16px; }
    .btn-sm { padding: 8px 13px; font-size: 13px; }
    .pagehead { align-items: flex-start; }
    .pagehead h1 { font-size: 21px; }
    .detailbar h1 { font-size: 20px; }
    .detailbar .field-inline { min-width: 0; flex: 1 1 100%; }
    .container { padding: 18px 16px 84px; }
    .card, .dcard > .dbody { padding-left: 16px; padding-right: 16px; }
    .fg2, .fg3, .fg-2-1 { grid-template-columns: 1fr; }
    .modal-inner { padding: 18px 16px; }
    .docrow { grid-template-columns: 20px 1fr auto; }
    .docrow .doclink { grid-column: 2 / -1; }
}
/* Buttons/Segmente nie über den Rand */
.tabs { flex-wrap: wrap; }
.tab { min-width: 68px; }

/* ---------- Großer Modal + Mail-Vorschau ---------- */
dialog.modal-lg { max-width: 720px; }
/* E-Mail-Vorschau: breiter & höher */
dialog.mailmodal { max-width: 780px; width: calc(100% - 28px); }
.mailframe-wrap { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #f4f2ee; }
.mailframe { width: 100%; height: 76vh; min-height: 560px; border: 0; display: block; background: #f4f2ee; }
.modal-head .link-muted { display: inline-flex; padding: 4px; }
@media (max-width: 560px) { .mailframe { height: 70vh; min-height: 440px; } }

/* ---------- Anfragen-Liste: Responsive-Feinschliff ---------- */
.listtable td.num, .listtable th.num { white-space: nowrap; }
.listtable td, .listtable th { vertical-align: middle; }
/* Spalten sind konfigurierbar → auf Mobil horizontal scrollen statt fest ausblenden */
@media (max-width: 720px) {
    .listtable .filterrow { display: none; }   /* Filterzeile auf Mobil aus */
    .listtable td, .listtable th { padding: 12px 12px; white-space: nowrap; }
}

/* ---------- Sortierbare Liste (Ansicht anpassen) ---------- */
.sortlist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.sortitem { display: flex; align-items: center; gap: 12px; padding: 10px 12px;
    border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.sortitem.dragging { opacity: .5; border-color: var(--accent); }
.sortitem:hover { border-color: var(--line-2); }
.draghandle { cursor: grab; color: var(--faint); font-size: 15px; line-height: 1; user-select: none; letter-spacing: -2px; }
.sortitem label { margin: 0; display: inline-flex; }
.sortitem input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--accent); }
.si-ic { display: inline-flex; color: var(--ink-soft); }
.si-label { font-size: 14.5px; font-weight: 500; }

/* ---------- Theme-Umschalter ---------- */
.um-row { display: flex; align-items: center; gap: 8px; }
.theme-toggle { flex: none; display: inline-flex; align-items: center; justify-content: center;
    width: 34px; height: 34px; border: 1px solid var(--line); border-radius: 9px;
    background: var(--surface); color: var(--ink-soft); cursor: pointer;
    transition: background var(--fast) var(--ease), color var(--fast) var(--ease); }
.theme-toggle:hover { background: var(--surface-2); color: var(--ink); }
.theme-toggle .ic-sun { display: none; }
.theme-toggle .ic-moon { display: inline-flex; }
:root[data-theme="dark"] .theme-toggle .ic-sun { display: inline-flex; }
:root[data-theme="dark"] .theme-toggle .ic-moon { display: none; }
@media (max-width: 820px) { .um-row { gap: 8px; } }

/* ---------- Sortierbare Spaltenköpfe + Doku-Icons ---------- */
.listtable th .sortlink { color: inherit; display: inline-flex; align-items: center; gap: 3px; text-decoration: none; white-space: nowrap; }
.listtable th .sortlink:hover { color: var(--ink); text-decoration: none; }
.listtable th .sortlink.active { color: var(--accent-ink); }
.icon-btn.vis-on { color: var(--green); }

/* ---------- Logo folgt dem App-Theme (nicht dem OS) ---------- */
img.logo-dark { display: none; }
:root[data-theme="dark"] img.logo-light { display: none; }
:root[data-theme="dark"] img.logo-dark { display: inline-block; }

/* Segmented-Control (Slider-Auswahl) – global nutzbar (Statistik, Audit-Log …) */
.seg{display:inline-flex;background:var(--surface-2);border:1px solid var(--line);border-radius:12px;padding:4px;gap:2px;max-width:100%;overflow-x:auto;}
.seg a{position:relative;display:inline-flex;align-items:center;gap:6px;padding:8px 14px;border-radius:9px;text-decoration:none;color:var(--muted);font-weight:600;font-size:13.5px;white-space:nowrap;transition:color .18s ease,background .25s ease,box-shadow .25s ease;}
.seg a:not(.on):hover{color:var(--ink);background:rgba(0,0,0,.04);}
.seg a.on{color:#fff;background:var(--accent);box-shadow:0 2px 9px rgba(235,105,7,.35);}
:root[data-theme="dark"] .seg a:not(.on):hover{background:rgba(255,255,255,.06);}

/* Sortierbare Tabellenköpfe (Klick sortiert auf-/absteigend, mit Pfeil) */
.th-sort{color:inherit;text-decoration:none;display:inline-flex;align-items:center;gap:3px;white-space:nowrap;cursor:pointer;}
.th-sort:hover{color:var(--accent);text-decoration:none;}
.th-sort.on{color:var(--accent);font-weight:700;}
/* Aktive-Filter-Leiste mit entfernbaren Chips */
.filterbar{display:flex;flex-wrap:wrap;gap:8px;align-items:center;margin-top:12px;}
.filterbar .lbl{font-size:12px;color:var(--muted);font-weight:600;}
.fchip{display:inline-flex;align-items:center;gap:7px;background:var(--surface-2);border:1px solid var(--line);border-radius:999px;padding:5px 11px;font-size:13px;color:var(--ink);}
.fchip a{color:var(--muted);text-decoration:none;font-weight:700;line-height:1;font-size:14px;}
.fchip a:hover{color:var(--red);}

/* Spalten-Filterzeile in Listen (wie Anfragenübersicht) */
.data tr.filterrow td{padding:6px 8px;background:var(--surface-2);border-bottom:1px solid var(--line);}
.data tr.filterrow input,.data tr.filterrow select{width:100%;font-size:12px;padding:5px 7px;border-radius:7px;}

/* ===== Kundenportal: große Aktions-Kacheln + Timeline ===== */
.ptiles{display:grid;grid-template-columns:repeat(2,1fr);gap:12px;margin-bottom:20px;}
.ptile{display:flex;flex-direction:column;gap:8px;padding:18px;border-radius:16px;background:var(--surface);border:1px solid var(--line);text-decoration:none;color:var(--ink);box-shadow:0 2px 8px rgba(0,0,0,.05);transition:transform .15s ease,box-shadow .2s ease;min-height:104px;}
.ptile:hover{transform:translateY(-2px);box-shadow:0 10px 24px rgba(0,0,0,.10);text-decoration:none;}
.ptile .pt-ic{width:46px;height:46px;border-radius:13px;background:var(--accent-soft);color:var(--accent);display:flex;align-items:center;justify-content:center;}
.ptile .pt-t{font-weight:700;font-size:16px;line-height:1.2;}
.ptile .pt-s{color:var(--muted);font-size:13px;line-height:1.35;}
.ptile.accent{background:var(--accent);color:#fff;border-color:transparent;}
.ptile.accent .pt-ic{background:rgba(255,255,255,.22);color:#fff;}
.ptile.accent .pt-s{color:rgba(255,255,255,.9);}
.ptile .pt-badge{position:absolute;top:12px;right:12px;background:#c62828;color:#fff;border-radius:99px;font-size:11px;font-weight:700;padding:1px 8px;}
.ptile{position:relative;}
@media(max-width:600px){.ptiles{gap:10px;}.ptile{padding:14px;min-height:92px;}.ptile .pt-ic{width:40px;height:40px;}}

/* Ansprechpartner-Karte (Kundenportal) */
.contact-top{display:flex;gap:16px;align-items:center;}
.contact-photo{width:78px;height:78px;border-radius:50%;object-fit:cover;border:1px solid var(--line);flex:0 0 auto;}
.contact-photo-ph{background:var(--accent-soft);color:var(--accent);display:flex;align-items:center;justify-content:center;}
.contact-meta{min-width:0;}
.contact-name{font-weight:750;font-size:18px;letter-spacing:-.01em;}
.contact-job{color:var(--accent-ink);font-size:13px;font-weight:600;margin-top:1px;}
.contact-lines{display:flex;flex-direction:column;gap:3px;margin-top:8px;}
.contact-lines a{display:inline-flex;align-items:center;gap:7px;color:var(--ink-soft);font-size:14px;text-decoration:none;}
.contact-lines a:hover{color:var(--accent-ink);}
.contact-quote{margin:14px 0 0;padding:12px 16px;background:var(--surface-2);border-left:3px solid var(--accent);border-radius:0 10px 10px 0;
    font-style:italic;color:var(--ink-soft);font-size:14px;line-height:1.5;}

.ptl{list-style:none;margin:0;padding:0;}
.ptl li{position:relative;padding:0 0 20px 32px;}
.ptl li:before{content:'';position:absolute;left:9px;top:4px;bottom:-2px;width:2px;background:var(--line);}
.ptl li:last-child:before{display:none;}
.ptl .dot{position:absolute;left:0;top:1px;width:20px;height:20px;border-radius:50%;background:var(--surface);border:2px solid var(--line);display:flex;align-items:center;justify-content:center;color:#fff;}
.ptl li.done .dot{background:var(--accent);border-color:var(--accent);}
.ptl li.active .dot{border-color:var(--accent);box-shadow:0 0 0 4px var(--accent-soft);}
.ptl .tl-t{font-weight:650;font-size:14.5px;}
.ptl li.upcoming .tl-t{color:var(--muted);font-weight:500;}
.ptl li.active .tl-t{color:var(--accent);}
.ptl .tl-s{color:var(--muted);font-size:13px;margin-top:2px;line-height:1.4;}

/* Pfad-/Schluessel-Box (Dateipruefung, Schnittstellen-Einstellungen) */
.pathbox{margin:8px 0 0;padding:11px 13px;background:var(--surface-2);border:1px solid var(--line);border-radius:10px;
    font-family:ui-monospace,Menlo,Consolas,monospace;font-size:13px;line-height:1.55;
    white-space:pre-wrap;overflow-wrap:anywhere;word-break:break-word;-webkit-user-select:all;user-select:all;}
.pathlbl{font-size:11px;font-weight:700;text-transform:uppercase;letter-spacing:.04em;color:var(--muted);margin-top:14px;}
.pathlbl:first-of-type{margin-top:6px;}

/* ---------- Dokumenten-Eingang ---------- */
.dropzone{border:2px dashed var(--line-2);border-radius:12px;padding:22px;text-align:center;background:var(--surface-2);
    transition:border-color .15s ease,background .15s ease;}
.dropzone.over{border-color:var(--accent);background:var(--accent-soft);}
.doc-row{display:flex;gap:16px;align-items:flex-start;margin-bottom:12px;}
.doc-prev{flex:0 0 auto;width:92px;height:92px;border:1px solid var(--line);border-radius:10px;overflow:hidden;
    background:var(--surface-2);display:flex;align-items:center;justify-content:center;}
.doc-prev img{width:100%;height:100%;object-fit:cover;display:block;}
.doc-prev .doc-pdf{display:flex;flex-direction:column;align-items:center;gap:4px;color:var(--muted);text-decoration:none;font-size:11px;font-weight:700;}
.doc-prev .doc-pdf:hover{color:var(--accent-ink);}
.doc-assign{display:flex;flex-wrap:wrap;gap:10px 12px;align-items:flex-end;}
.doc-assign label{display:flex;flex-direction:column;gap:3px;font-size:11px;font-weight:600;text-transform:uppercase;
    letter-spacing:.03em;color:var(--muted);}
.doc-assign select,.doc-assign input[type=text]{min-width:200px;}
.doc-assign .qsel{min-width:300px;max-width:100%;}
.doc-assign .doc-chk{flex-direction:row;align-items:center;gap:7px;text-transform:none;letter-spacing:0;font-size:13.5px;
    font-weight:500;color:var(--ink);white-space:nowrap;height:38px;}
.doc-assign .doc-chk input[type=checkbox]{width:17px;min-width:17px;height:17px;flex:0 0 auto;margin:0;}
.doc-assign .doc-actions{display:flex;align-items:center;height:38px;}
@media(max-width:820px){.doc-row{flex-wrap:wrap;}.doc-assign .qsel,.doc-assign select,.doc-assign input[type=text]{min-width:100%;}}
.doc-sug{display:flex;align-items:center;gap:10px;margin:0 0 12px;padding:8px 12px;border-radius:10px;font-size:13px;
    border:1px solid var(--line);background:var(--surface-2);}
.doc-sug.ok{border-color:var(--green);background:var(--green-bg);}
.doc-sug.weak{border-color:var(--accent);background:var(--accent-soft);}
.doc-sug .ds-badge{flex:0 0 auto;min-width:44px;text-align:center;font-weight:800;font-size:12px;padding:3px 8px;
    border-radius:999px;background:var(--surface);border:1px solid var(--line);font-variant-numeric:tabular-nums;}
.doc-sug.ok .ds-badge{color:var(--green);border-color:var(--green);}
.doc-sug.weak .ds-badge{color:var(--accent-ink);border-color:var(--accent);}
.doc-sug .ds-tx{flex:1;min-width:0;}
.doc-sug .ds-tx .muted{display:block;font-size:11.5px;margin-top:1px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.doc-sug .ds-frage{display:block;margin-top:5px;padding:6px 9px;border-radius:8px;background:var(--surface);
    border:1px solid var(--line-2);color:var(--ink);font-size:12.5px;line-height:1.45;white-space:normal;}
/* Zwischenüberschrift innerhalb einer Karte (z. B. "Adresse" in den Stammdaten) */
.cardsep{margin:18px 0 10px;padding-top:14px;border-top:1px solid var(--line);font-size:11px;font-weight:700;
    text-transform:uppercase;letter-spacing:.05em;color:var(--muted);}
