/* =====================================================================
   Steuerprognose – Stylesheet
   Farbwelt aus dem Logo: Petrol/Türkis, Ozeanblau, Grün, Gold
   ===================================================================== */

:root {
    /* Logo-Farben */
    --petrol-900: #052b38;
    --petrol-800: #08465c;
    --petrol-700: #0b5d77;
    --blue:       #0c6698;   /* Ozeanblau aus dem Logo */
    --teal:       #0a838b;   /* Petrol/Türkis aus dem Logo */
    --teal-light: #15a0a9;
    --teal-100:   #d2edef;
    --teal-50:    #eef8f9;
    --gold:       #c9a227;   /* Lupenring */
    --gold-light: #e3bc4b;
    --green:      #4e9472;   /* Diagramm-Grün */

    --text-dark:  #202428;
    --text-grey:  #5e6a72;
    --bg-page:    #f2f6f7;
    --white:      #ffffff;
    --danger:     #dc2626;
    --success:    #4e9472;

    --radius:     16px;
    --shadow-sm:  0 1px 3px rgba(5, 43, 56, .08);
    --shadow-md:  0 8px 24px rgba(5, 43, 56, .12);
    --shadow-lg:  0 20px 50px rgba(5, 43, 56, .30);
    --sidebar-width: 280px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { font-size: 16px; }

body {
    font-family: "Segoe UI", "Inter", system-ui, -apple-system, sans-serif;
    background: var(--bg-page);
    color: var(--text-dark);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

h1 { font-size: 2rem;   font-weight: 700; letter-spacing: -.02em; }
h2 { font-size: 1.5rem;  font-weight: 700; letter-spacing: -.01em; }
h3 { font-size: 1.15rem; font-weight: 600; }
p  { line-height: 1.6; }

a { color: var(--teal); text-decoration: none; }
a:hover { text-decoration: underline; }

/* =====================================================================
   Buttons – schön groß
   ===================================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 18px 36px;
    font-size: 1.05rem;
    font-weight: 600;
    font-family: inherit;
    border: none;
    border-radius: 14px;
    cursor: pointer;
    transition: all .2s ease;
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--blue), var(--teal));
    color: var(--white);
    box-shadow: 0 6px 18px rgba(10, 131, 139, .35);
}
.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 26px rgba(10, 131, 139, .45);
    text-decoration: none;
}
.btn-primary:active { transform: translateY(0); }

.btn-secondary {
    background: var(--white);
    color: var(--petrol-700);
    border: 2px solid var(--teal-100);
    box-shadow: var(--shadow-sm);
}
.btn-secondary:hover {
    border-color: var(--teal);
    background: var(--teal-50);
    text-decoration: none;
}

.btn-gold {
    background: linear-gradient(135deg, var(--gold), var(--gold-light));
    color: var(--petrol-900);
    box-shadow: 0 6px 18px rgba(201, 162, 39, .35);
}
.btn-gold:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 26px rgba(201, 162, 39, .45);
    text-decoration: none;
}

.btn-danger {
    background: var(--danger);
    color: var(--white);
}

.btn-block { width: 100%; }

/* =====================================================================
   Formulare
   ===================================================================== */
.form-group { display: flex; flex-direction: column; gap: 8px; }

.label-input {
    display: block;
    font-size: .9rem;
    font-weight: 600;
    color: var(--text-grey);
    text-transform: uppercase;
    letter-spacing: .04em;
    line-height: 1.3;
    min-height: 2.6em;
}

input[type=text],
input[type=password],
input[type=email],
input[type=tel],
input[type=url],
input[type=number],
input[type=date],
select,
textarea {
    width: 100%;
    padding: 16px 18px;
    font-size: 1.05rem;
    font-family: inherit;
    border: 2px solid #dde6e8;
    border-radius: 12px;
    background: var(--white);
    color: var(--text-dark);
    transition: border-color .2s, box-shadow .2s;
    outline: none;
}
input:focus, select:focus, textarea:focus {
    border-color: var(--teal);
    box-shadow: 0 0 0 4px rgba(10, 131, 139, .15);
}

.checkbox-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 260px;
    overflow-y: auto;
    padding: 16px 18px;
    border: 2px solid #dde6e8;
    border-radius: 12px;
    background: var(--white);
}
.checkbox-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.02rem;
    cursor: pointer;
}
.checkbox-item input[type=checkbox] {
    width: 18px;
    height: 18px;
    accent-color: var(--teal);
    cursor: pointer;
}

/* Schieberegler (Toggle-Switch), z.B. "Inaktive anzeigen" in Listenansichten */
.switch-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: .95rem;
    font-weight: 600;
    color: var(--text-grey);
    white-space: nowrap;
    cursor: pointer;
    user-select: none;
}
.switch {
    position: relative;
    display: inline-block;
    width: 42px;
    height: 24px;
    flex-shrink: 0;
}
.switch input {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    cursor: pointer;
}
.switch-slider {
    position: absolute;
    inset: 0;
    background: #ccd7da;
    border-radius: 999px;
    transition: background-color .2s;
    pointer-events: none;
}
.switch-slider::before {
    content: "";
    position: absolute;
    width: 18px;
    height: 18px;
    left: 3px;
    top: 3px;
    background: var(--white);
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .3);
    transition: transform .2s;
}
.switch input:checked + .switch-slider {
    background: var(--teal);
}
.switch input:checked + .switch-slider::before {
    transform: translateX(18px);
}
.switch input:focus-visible + .switch-slider {
    box-shadow: 0 0 0 4px rgba(10, 131, 139, .2);
}

/* =====================================================================
   Login-Seite
   ===================================================================== */
body.home {
    background: linear-gradient(140deg, var(--petrol-900) 0%, var(--petrol-700) 55%, var(--teal) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    position: relative;
    overflow: hidden;
}

/* Dezente Deko-Kreise im Hintergrund */
body.home::before,
body.home::after {
    content: "";
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
}
body.home::before {
    width: 600px; height: 600px; top: -200px; right: -150px;
    background: rgba(255, 255, 255, .06);
}
body.home::after {
    width: 420px; height: 420px; bottom: -160px; left: -120px;
    background: rgba(201, 162, 39, .10); /* goldener Schimmer wie der Lupenring */
}

.login-wrapper {
    width: 100%;
    max-width: 480px;
    position: relative;
    z-index: 1;
}

.login-card {
    background: var(--white);
    border-radius: 24px;
    padding: 44px 40px;
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
    gap: 22px;
    border-top: 5px solid var(--gold);
}
.login-card h2 { color: var(--petrol-900); }

.login-logo {
    text-align: center;
    margin-bottom: 4px;
}
.login-logo img {
    max-width: 280px;
    width: 100%;
    height: auto;
}

.login-footer {
    text-align: center;
    margin-top: 24px;
    color: rgba(255, 255, 255, .65);
    font-size: .9rem;
}
.login-footer a { color: rgba(255, 255, 255, .85); }

/* =====================================================================
   Alerts
   ===================================================================== */
.alert {
    display: grid;
    grid-template-columns: 20px 1fr auto;
    gap: 12px;
    align-items: start;
    padding: 13px 12px 13px 16px;
    border-radius: 10px;
    border: 1px solid #dfe7ea;
    background: var(--white);
    color: var(--text-dark);
    font-size: .93rem;
    line-height: 1.5;
}
.alert.error   { border-color: #efc8c8; background: #fffbfb; }
.alert.info    { border-color: var(--teal-100); }
.alert-icon { display: flex; width: 20px; height: 20px; margin-top: 1px; }
.alert-icon svg { width: 100%; height: 100%; }
.alert.error   .alert-icon { color: var(--danger); }
.alert.success .alert-icon { color: var(--green); }
.alert.info    .alert-icon { color: var(--teal); }
.alert-content strong { font-weight: 600; }
.alert-close {
    display: flex; align-items: center; justify-content: center;
    width: 26px; height: 26px; margin: -3px 0 -3px 4px;
    border: none; border-radius: 6px; background: transparent; cursor: pointer;
    color: var(--text-grey);
}
.alert-close svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.alert-close:hover { background: rgba(5, 43, 56, .06); color: var(--text-dark); }
.alert-close:focus-visible { outline: 2px solid var(--teal); outline-offset: 1px; }
.alert.is-weg { opacity: 0; transform: translateY(-4px); transition: opacity .2s ease, transform .2s ease; }

/* Bestätigungen erscheinen kurz oben rechts und blenden sich selbst aus (main.js) */
.alert-stack {
    position: fixed; top: 18px; right: 22px; z-index: 1200;
    display: flex; flex-direction: column; gap: 8px;
    width: min(460px, calc(100vw - 32px));
    pointer-events: none;
}
/* Als Popover in der obersten Ebene (über geöffneten Modals): Browser-Vorgaben für [popover] zurücksetzen */
.alert-stack[popover] {
    inset: 18px 22px auto auto; margin: 0; padding: 0; border: 0;
    background: transparent; overflow: visible; color: inherit;
}
.alert-stack .alert {
    pointer-events: auto;
    /* kräftiges Grün mit weißer Schrift (Kontrast 5,4:1) */
    background: #2e7a55; border-color: #2e7a55; color: var(--white);
    box-shadow: 0 10px 28px rgba(31, 90, 61, .32);
    animation: alertToast .22s cubic-bezier(.2, .8, .2, 1);
}
.alert-stack .alert.success .alert-icon { color: var(--white); background: rgba(255, 255, 255, .18); border-radius: 50%; padding: 3px; width: 22px; height: 22px; margin-top: 0; }
.alert-stack .alert-close { color: rgba(255, 255, 255, .75); }
.alert-stack .alert-close:hover { background: rgba(255, 255, 255, .1); color: var(--white); }
@keyframes alertToast {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) { .alert-stack .alert { animation: none; } }

/* =====================================================================
   Sidebar (nach Login) – hell, damit das Logo wirkt
   ===================================================================== */
.sidebar {
    position: fixed;
    top: 0; left: 0; bottom: 0;
    width: var(--sidebar-width);
    background: var(--white);
    border-right: 1px solid #e3ebed;
    color: var(--text-dark);
    display: flex;
    flex-direction: column;
    padding: 28px 20px;
    gap: 28px;
    z-index: 100;
    overflow-y: auto;
}

.sidebar-header { padding: 0 6px; }
.sidebar-header img { width: 100%; max-width: 220px; height: auto; display: block; }

.nav-section { display: flex; flex-direction: column; gap: 6px; }
.nav-section-label {
    font-size: .72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .1em;
    color: #9aa8ae;
    padding: 0 14px;
    margin: 14px 0 6px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    border-radius: 12px;
    color: var(--text-grey);
    font-size: 1rem;
    font-weight: 500;
    transition: background .15s, color .15s;
}
.nav-item:hover {
    background: var(--teal-50);
    color: var(--petrol-700);
    text-decoration: none;
}
.nav-item.active {
    background: linear-gradient(135deg, var(--blue), var(--teal));
    color: var(--white);
    box-shadow: 0 4px 14px rgba(10, 131, 139, .35);
}
.nav-icon { display: flex; width: 22px; height: 22px; flex-shrink: 0; }
.nav-icon svg { width: 22px; height: 22px; }

.sidebar-bottom { margin-top: auto; }

/* Kontext-Card für den aktuell geöffneten Mandanten (unter "Mandanten" im Menü) */
.sidebar-mandant-card {
    margin: 2px 8px 6px 40px;
    padding: 8px 0 2px 14px;
    border-left: 2px solid var(--teal-100);
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.sidebar-mandant-name {
    font-size: .78rem;
    font-weight: 700;
    color: var(--petrol-800);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 4px;
}
.sidebar-mandant-link {
    font-size: .85rem;
    color: var(--text-grey);
    padding: 7px 10px;
    border-radius: 8px;
    transition: background .15s, color .15s;
}
.sidebar-mandant-link:hover { background: var(--teal-50); color: var(--petrol-700); text-decoration: none; }
.sidebar-mandant-link.active { background: var(--teal-50); color: var(--teal); font-weight: 600; }

/* =====================================================================
   Hauptbereich + Topbar
   ===================================================================== */
.main-content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    background: var(--white);
    padding: 18px 36px;
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 50;
}

.page-title { font-size: 1.3rem; font-weight: 700; color: var(--petrol-900); }

.user-menu { display: flex; align-items: center; gap: 16px; }

.initials-avatar {
    width: 46px; height: 46px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--blue), var(--teal));
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1rem;
    flex-shrink: 0;
}
.user-name { font-weight: 600; }
.user-role { font-size: .82rem; color: var(--text-grey); }

.btn-logout {
    padding: 12px 22px;
    font-size: .95rem;
}

.content-area {
    padding: 36px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 28px;
}

/* =====================================================================
   Karten / Dashboard
   ===================================================================== */
.card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 28px;
    box-shadow: var(--shadow-sm);
}

/* Kachel-Variante für Karten innerhalb einer Karte (z.B. Inhaber-Karten) –
   ganz leichter Farbton statt reinem Weiß, damit sie sich vom Karten-Hintergrund abheben */
.card.card-tile {
    background: var(--teal-50);
    box-shadow: none;
}

.card.card-tile + .card.card-tile {
    margin-top: 20px;
}

.card.hero {
    background: linear-gradient(135deg, var(--petrol-800), var(--teal));
    color: var(--white);
}
.card.hero h2 { color: var(--white); }
.card.hero p  { color: rgba(255, 255, 255, .85); }
.card.hero .btn-primary {
    background: var(--white);
    color: var(--petrol-700);
    box-shadow: none;
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 24px;
}
/* Prognosen-Übersicht: Mandanten-Kacheln – Akzentfarben im Wechsel wie die Balken im Logo */
.prog-kacheln { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 18px; }
.prog-kachel {
    --akzent: var(--teal);
    --akzent-hell: rgba(10, 131, 139, .10);
    position: relative; overflow: hidden;
    display: flex; flex-direction: column; gap: 8px;
    padding: 22px 22px 20px; border-radius: var(--radius);
    background: linear-gradient(160deg, var(--akzent-hell) 0%, var(--white) 55%);
    border: 1px solid var(--teal-100); border-top: 4px solid var(--akzent);
    box-shadow: var(--shadow-sm); color: var(--text-dark);
    text-decoration: none !important;
    transition: transform .15s ease, box-shadow .15s ease;
}
.prog-kachel:nth-child(4n+2) { --akzent: var(--blue);  --akzent-hell: rgba(12, 102, 152, .10); }
.prog-kachel:nth-child(4n+3) { --akzent: var(--green); --akzent-hell: rgba(78, 148, 114, .12); }
.prog-kachel:nth-child(4n+4) { --akzent: var(--gold);  --akzent-hell: rgba(201, 162, 39, .13); }
.prog-kachel *, .prog-kachel:hover * { text-decoration: none !important; }
.prog-kachel[hidden] { display: none; }
.prog-kachel:hover, .prog-kachel:focus-visible { transform: translateY(-3px); box-shadow: var(--shadow-md); outline: none; }
.prog-kachel-kopf { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: .76rem; text-transform: uppercase; letter-spacing: .05em; }
.prog-kachel-nr { padding: 3px 9px; border-radius: 999px; background: var(--akzent); color: var(--white); font-weight: 700; }
.prog-kachel-rf { color: var(--akzent); font-weight: 700; }
.prog-kachel-name { font-size: 1.1rem; color: var(--petrol-900); line-height: 1.3; margin-top: 4px; }
.prog-kachel-info { font-size: .86rem; color: var(--text-grey); }
.prog-kachel-los { margin-top: auto; padding-top: 12px; display: inline-flex; align-items: center; gap: 8px; font-weight: 700; font-size: .9rem; color: var(--akzent); }
.prog-kachel-los svg { width: 26px; height: 26px; padding: 5px; border-radius: 50%; background: var(--akzent); fill: none; stroke: var(--white); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; transition: transform .15s ease; }
.prog-kachel:hover .prog-kachel-los svg { transform: translateX(4px); }
/* Verlauf der Monatsergebnisse (letzte 12 Monate) dezent im Hintergrund */
.prog-kachel > :not(.prog-kachel-graph) { position: relative; z-index: 1; }
.prog-kachel-graph {
    position: absolute; left: 0; right: 0; bottom: 0; width: 100%; height: 55%; z-index: 0; pointer-events: none;
    color: var(--akzent);
    /* links (Text) und oben ausblenden – nur rechts unten als Andeutung sichtbar */
    -webkit-mask-image: linear-gradient(to right, transparent 0%, #000 55%);
            mask-image: linear-gradient(to right, transparent 0%, #000 55%);
}
.prog-kachel-graph-linie { fill: none; stroke: currentColor; stroke-width: 1.5; opacity: .22; vector-effect: non-scaling-stroke; stroke-linecap: round; }
.prog-kachel:hover .prog-kachel-graph-linie { opacity: .32; }
.prog-stand { display: flex; align-items: center; gap: 8px; }
.prog-stand label { font-size: .8rem; font-weight: 600; color: var(--text-grey); text-transform: uppercase; letter-spacing: .05em; }
/* Auswahlfelder in Kopf und Werkzeugleiste der Berechnung: gleiche Höhe/Form wie die Buttons daneben */
.prog-stand select, .report-toolbar-print select { width: auto; padding: 16px 44px 16px 20px; font-size: 1.05rem; font-weight: 600; border-radius: 14px; }
.prog-stand select { min-width: 190px; }
input.prog-suche { width: 320px; max-width: 100%; padding-top: 10px; padding-bottom: 10px; font-size: .95rem; }
.prog-unvollstaendig summary { cursor: pointer; font-weight: 600; color: var(--petrol-800); }
.prog-unvollstaendig ul { margin: 12px 0 0 18px; display: grid; gap: 6px; font-size: .92rem; }

.beweg-hinweis { margin: -4px 0 0; padding: 10px 14px; border-radius: 10px; background: var(--teal-50); color: var(--petrol-800); font-size: .88rem; }
.beweg-hinweis[hidden] { display: none; }

/* Eingabefelder einer Zeile auf gleicher Höhe, auch wenn eine Beschriftung zweizeilig umbricht */
.grid-felder-unten > .form-group { display: flex; flex-direction: column; justify-content: flex-end; }

/* Einklappbare Karten (z.B. Gesellschafter) */
.collapse-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
    cursor: pointer;
    user-select: none;
}
.collapse-chevron {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: var(--teal-50);
    color: var(--teal);
    flex-shrink: 0;
    transition: transform .2s ease;
}
.collapse-chevron svg { width: 20px; height: 20px; }
.card.open .collapse-chevron { transform: rotate(180deg); }
.collapse-body { display: none; }
.card.open .collapse-body,
.collapse-section.open .collapse-body { display: block; }
.collapse-section.open .collapse-chevron { transform: rotate(180deg); }

.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: 999px;
    font-size: .8rem;
    font-weight: 600;
    background: var(--teal-50);
    color: var(--petrol-700);
}
.card.hero .badge {
    background: rgba(255, 255, 255, .16);
    color: var(--white);
}

/* Status als moderne Pille mit Punkt-Indikator (z.B. im Mandanten-Kopfbereich) */
.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 4px 14px;
    border-radius: 999px;
    font-size: .8rem;
    font-weight: 600;
}
.status-pill::before {
    content: "";
    width: 7px;
    height: 7px;
    flex-shrink: 0;
    border-radius: 50%;
    background: currentColor;
}
.status-pill.is-active   { background: var(--teal-50); color: var(--teal); }
.status-pill.is-inactive { background: #eef0f2; color: var(--text-grey); }
.card.hero .status-pill.is-active   { background: rgba(255, 255, 255, .92); color: var(--green); }
.card.hero .status-pill.is-inactive { background: rgba(255, 255, 255, .22); color: var(--white); }

.stat-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 26px;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    gap: 10px;
    border-top: 4px solid var(--teal);
    transition: transform .15s, box-shadow .15s;
}
/* Akzentfarben im Wechsel – wie die Balken im Logo */
.card-grid .stat-card:nth-child(3n+2) { border-top-color: var(--gold); }
.card-grid .stat-card:nth-child(3n)   { border-top-color: var(--green); }

.stat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.stat-card .stat-label { font-size: .85rem; font-weight: 600; color: var(--text-grey); text-transform: uppercase; letter-spacing: .05em; }
.stat-card .stat-value { font-size: 2.1rem; font-weight: 800; color: var(--petrol-900); }
.stat-card .stat-hint  { font-size: .88rem; color: var(--text-grey); }

/* =====================================================================
   Tabellen
   ===================================================================== */
table.data { width: 100%; border-collapse: collapse; background: var(--white); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm); }
table.data th { background: var(--teal-50); color: var(--petrol-800); text-align: left; padding: 14px 18px; font-size: .85rem; text-transform: uppercase; letter-spacing: .05em; }
table.data td { padding: 14px 18px; border-top: 1px solid #eaf1f2; }
table.data tr:hover td { background: var(--teal-50); }
table.data tr.row-link { cursor: pointer; }

table.data th.sortable { cursor: pointer; user-select: none; white-space: nowrap; transition: background .15s; }
table.data th.sortable:hover { background: var(--teal-100); }
table.data th.sortable::after { content: "\21C5"; display: inline-block; margin-left: 6px; font-size: .8em; opacity: .35; }
table.data th.sortable.sorted-asc::after  { content: "\2191"; opacity: 1; }
table.data th.sortable.sorted-desc::after { content: "\2193"; opacity: 1; }

input.search-input {
    background-color: var(--white);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235e6a72' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M21 21l-4.3-4.3'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: 16px center;
    background-size: 18px 18px;
    padding-left: 46px !important;
}

/* =====================================================================
   Modal
   ===================================================================== */
dialog.modal {
    border: none;
    padding: 0;
    width: min(760px, 92vw);
    max-height: 88vh;
    margin: auto;
    background: var(--white);
    color: var(--text-dark);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
}
dialog.modal.modal-sm {
    width: min(420px, 92vw);
}
dialog.modal[open] {
    display: flex;
    flex-direction: column;
    animation: modalPop .22s cubic-bezier(.2, .8, .2, 1);
}
dialog.modal::backdrop {
    background: rgba(5, 43, 56, .55);
    backdrop-filter: blur(3px);
    animation: modalFade .22s ease;
}
@keyframes modalPop {
    from { opacity: 0; transform: translateY(16px) scale(.96); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes modalFade {
    from { opacity: 0; }
    to   { opacity: 1; }
}
.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 24px 28px;
    border-bottom: 1px solid #eaf1f2;
    flex-shrink: 0;
}
.modal-header h2 { margin: 0; }
.modal-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    border: none;
    border-radius: 50%;
    background: var(--teal-50);
    color: var(--petrol-700);
    font-size: 1.4rem;
    line-height: 1;
    cursor: pointer;
    transition: background .15s, color .15s;
}
.modal-close:hover { background: var(--teal-100); color: var(--petrol-900); }
.modal-body {
    padding: 24px 28px 28px;
    overflow-y: auto;
}

/* Reiter (z.B. Inhaber-Formular im Modal) – als Segmented Control,
   damit sie eindeutig als Navigation erkennbar sind; bleibt immer in
   einer Zeile (Labels bewusst kurz gehalten, Buttons teilen sich den
   Platz gleichmäßig und schrumpfen nötigenfalls statt umzubrechen). */
.tabs, .mode-toggle {
    display: flex;
    flex-wrap: nowrap;
    gap: 4px;
    background: var(--teal-50);
    border-radius: 12px;
    padding: 5px;
}
/* Textanfang des ersten Reiters optisch mit dem Inhalt darunter fluchten lassen
   (kompensiert das eigene Innenpolster der Segmented-Control-Leiste + Buttons) */
.tabs { margin-bottom: 24px; margin-left: -17px; }
.tabs.tabs-sub { margin-left: 0; }
.mode-toggle { display: inline-flex; }
.tab-button, .mode-toggle-button {
    flex: 1 1 0;
    min-width: 0;
    padding: 10px 12px;
    background: none;
    border: none;
    border-radius: 8px;
    color: var(--petrol-700);
    font-weight: 600;
    font-size: .87rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer;
    transition: background .15s, color .15s, box-shadow .15s;
}
/* In Modals Platz nach Textlänge verteilen, damit lange Reiter (z. B. „Tätigkeitsvergütung“) nicht gekürzt werden */
dialog.modal .tab-button { flex: 1 1 auto; padding-left: 10px; padding-right: 10px; }
.tab-button:hover, .mode-toggle-button:hover { background: var(--teal-100); }
.tab-button.active, .mode-toggle-button.active {
    background: var(--white);
    color: var(--teal);
    box-shadow: var(--shadow-sm);
}
.tab-panel { display: none; }
.tab-panel.active { display: block; }
.mode-block { display: block; }

/* Getönter Rahmen um eine Unternavigation samt ihrem Inhalt, damit auf einen Blick klar ist,
   dass diese zum darüber aktiven Haupt-Reiter gehören (statt einer eigenen, gleichrangigen Ebene) */
.subnav-panel {
    background: var(--bg-page);
    border-radius: 14px;
    padding: 18px 20px 22px;
}

/* Unternavigation (z.B. Mandantendaten/Kontakt/GewSt/KSt innerhalb eines Haupt-Reiters) –
   bewusst als schlichte Underline-Tabs statt Segmented-Control gestaltet, damit sie sich
   optisch klar von der übergeordneten Haupt-Reiterleiste absetzt. */
.tabs.tabs-sub {
    background: none;
    border-bottom: 2px solid #eaf1f2;
    border-radius: 0;
    padding: 0;
    gap: 22px;
}
.tabs.tabs-sub .tab-button {
    flex: 0 0 auto;
    padding: 8px 2px 12px;
    border-radius: 0;
    border-bottom: 2px solid transparent;
    color: var(--text-grey);
    font-size: .87rem;
}
.tabs.tabs-sub .tab-button:hover { background: none; color: var(--petrol-700); }
.tabs.tabs-sub .tab-button.active {
    background: none;
    box-shadow: none;
    color: var(--teal);
    border-bottom-color: var(--teal);
}

/* Status-Icon je Unterreiter: zeigt auf einen Blick, ob dort schon Daten hinterlegt sind */
.tab-status-icon {
    width: 14px;
    height: 14px;
    vertical-align: -2px;
    margin-right: 5px;
    flex-shrink: 0;
}
.tab-status-icon.is-filled { color: var(--teal); }
.tab-status-icon.is-empty  { color: #b7c2c6; }

/* =====================================================================
   Footer
   ===================================================================== */
.footer {
    padding: 20px 36px;
    color: var(--text-grey);
    font-size: .85rem;
    display: flex;
    justify-content: space-between;
    gap: 12px;
}

/* =====================================================================
   Hilfsklassen
   ===================================================================== */
.FlexRow    { display: flex; flex-direction: row; align-items: center; }
.FlexColumn { display: flex; flex-direction: column; }
.Gap10 { gap: 10px; } .Gap15 { gap: 15px; } .Gap20 { gap: 20px; }
.MargTop20 { margin-top: 20px; } .MargTop30 { margin-top: 30px; }
.TextGrey { color: var(--text-grey); }
.TextTeal { color: var(--teal); }
.TextGold { color: var(--gold); }
.TextCenter { text-align: center; }
.smallText { font-size: .85rem; color: var(--text-grey); }
.W100P { width: 100%; }

/* =====================================================================
   Responsive
   ===================================================================== */
.mobile-menu-btn { display: none; background: none; border: none; cursor: pointer; color: var(--petrol-900); }

@media (max-width: 900px) {
    .sidebar { transform: translateX(-100%); transition: transform .25s ease; box-shadow: var(--shadow-md); }
    .sidebar.open { transform: translateX(0); }
    .main-content { margin-left: 0; }
    .mobile-menu-btn { display: flex; }
    .content-area { padding: 20px; }
    .top-bar { padding: 14px 20px; gap: 12px; }
    .top-bar > .FlexRow { min-width: 0; }
    .page-title { font-size: 1.1rem; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .user-menu { gap: 10px; flex-shrink: 0; }
    /* Mobil: Abmelden steht im Menü (Templates/nav.php), Hilfe entfällt */
    .user-menu .btn-logout, .user-menu .help-trigger { display: none; }
    .login-card { padding: 32px 24px; }
    dialog.modal { width: 96vw; max-height: 92vh; }
    .modal-header { padding: 18px 20px; }
    .modal-body { padding: 18px 20px 22px; }
}

@media (max-width: 600px) {
    .user-menu > a.FlexColumn { display: none; } /* Name und Rolle – der Avatar führt weiterhin zum Profil */
    .initials-avatar { width: 40px; height: 40px; }
}

/* =====================================================================
   Prognose-Bericht (Bildschirm: Papierblätter, Druck/PDF: DIN A4)
   ===================================================================== */
.report { display: flex; flex-direction: column; gap: 28px; align-items: center; }

.report-page {
    background: var(--white);
    width: 100%;
    max-width: 210mm;
    min-height: 297mm;
    padding: 18mm 20mm 20mm 24mm;
    border-radius: 6px;
    box-shadow: var(--shadow-md);
    color: var(--text-dark);
    font-size: .93rem;
    line-height: 1.5;
}

.report-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--teal);
    margin-bottom: 9mm;
}
.report-head-firm { font-weight: 600; color: var(--petrol-800); letter-spacing: .02em; }
.report-head-addr { display: block; font-weight: 400; font-size: .74rem; letter-spacing: 0; color: var(--text-grey); margin-top: 2px; }
.report-head-logo { height: 34px; width: auto; }

.report-address { min-height: 24mm; margin-bottom: 8mm; line-height: 1.45; }

.report-title { font-size: 1.05rem; font-weight: 700; color: var(--petrol-900); margin-bottom: 18px; }
.report-text  { margin-bottom: 10px; }
.report-person { margin: -6px 0 14px; font-size: 1rem; color: var(--petrol-800); }
.report-person strong { color: var(--petrol-900); }
.report-closing { margin-top: 26px; color: var(--text-grey); font-size: .88rem; }
.report-subtitle {
    font-size: .95rem;
    color: var(--petrol-800);
    margin: 22px 0 8px;
    padding-bottom: 4px;
    border-bottom: 1px solid var(--teal-100);
}

.report-table { width: 100%; border-collapse: collapse; margin-top: 14px; font-variant-numeric: tabular-nums; }
.report-table col.report-num { width: 120px; }
.report-table th, .report-table td { padding: 2px 0 2px 12px; vertical-align: bottom; }
.report-table td:first-child, .report-table th:first-child { padding-left: 14px; text-align: left; }
.report-table td:not(:first-child), .report-table th:not(:first-child) { text-align: right; white-space: nowrap; }
.report-colhead th { font-weight: 600; color: var(--petrol-800); padding-bottom: 8px; }
.report-colhead th:first-child { padding-left: 0; }
.report-colhead th:not(:first-child) { text-decoration: underline; text-underline-offset: 3px; }
.report-table-tax td:not(:first-child), .report-table-tax th:not(:first-child) { width: 110px; }
.report-line td:not(:first-child) { border-bottom: 1px solid var(--text-dark); }
.report-sum td { font-weight: 600; }
.report-gap td { padding-top: 10px; }
.report-total td { font-weight: 700; padding-top: 14px; }
.report-total td:not(:first-child) { border-bottom: 3px double var(--text-dark); background: var(--teal-50); }
.report-na { color: var(--text-grey); }
.report-footnote { margin-top: 10px; font-size: .8rem; color: var(--text-grey); }
.report-page-person .report-table col.report-num { width: 140px; }
/* Spaltenansicht: eine Betragsspalte je Gesellschafter */
.report-scroll { overflow-x: auto; }
.report-table-cols { min-width: 720px; }
.report-table-cols col:first-child { width: 30%; }       /* Beschreibung links, Rest gleichmäßig auf die Betragsspalten */
.report-table-cols col.report-num { width: 96px; }
.report-table-cols td:not(:first-child), .report-table-cols th:not(:first-child) { width: 100px; }
.report-table-cols .report-grp { padding-left: 26px; border-left: 1px solid var(--teal-100); }
.report-table-cols .report-grp-end { padding-right: 16px; }
.report-table-cols .report-colhead th:not(:first-child) { text-decoration: none; }
.report-table-cols .report-names th:not(:first-child) { font-size: 1rem; color: var(--petrol-900); text-align: center; }
.report-table-cols .report-taxhead th { padding-top: 26px; }
.report-table-cols .report-taxhead th:not(:first-child) { text-decoration: underline; font-weight: 600; }
/* Gesellschafter abwechselnd schattiert – Spalten leichter zuzuordnen */
.report-table-cols .report-alt { background: #f2f7f8; }
.report-table-cols .report-total td.report-alt { background: #dcebed; }
.report-table-cols .report-names th { padding-top: 10px; }
.report-quote td { color: var(--text-grey); font-size: .85rem; padding-bottom: 6px; }
.report-pay    { color: var(--danger); font-weight: 600; }
.report-refund { color: var(--success); font-weight: 600; }
.report-darauf { display: inline-block; width: 64px; }

.report-kv { display: grid; grid-template-columns: 230px 1fr; gap: 3px 16px; font-size: .88rem; }
.report-kv dt { color: var(--text-grey); }
.report-kv dd { font-variant-numeric: tabular-nums; }
.report-list { width: 100%; border-collapse: collapse; font-size: .88rem; }
.report-list th { text-align: left; color: var(--text-grey); font-weight: 600; padding: 3px 8px 3px 0; border-bottom: 1px solid var(--teal-100); }
.report-list td { padding: 3px 8px 3px 0; }
.report-list .report-num { text-align: right; }

/* Werkzeugleiste + Vollbild */
.report-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    width: 100%;
}
.report-toolbar-print { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.report-toolbar-print select { min-width: 240px; }
.report:fullscreen, .report.is-fullscreen {
    background: var(--bg-page);
    overflow-y: auto;
    display: block;
    padding: 28px 36px 40px;
}
.report.is-fullscreen { position: fixed; inset: 0; z-index: 200; }
.report:fullscreen .report-toolbar, .report.is-fullscreen .report-toolbar {
    position: sticky; top: -28px; z-index: 5;
    background: var(--bg-page); padding: 10px 0;
}
.report-group { break-inside: avoid; }
.report > * { flex-shrink: 0; }
.report:fullscreen > * + *, .report.is-fullscreen > * + * { margin-top: 28px; }

/* Bildschirmansicht: kein Briefkopf, Tabellen als Karten nebeneinander */
@media screen {
    .print-only { display: none !important; }
    .report { align-items: stretch; }
    .report-page { max-width: none; min-height: 0; padding: 0; background: none; box-shadow: none; border-radius: 0; }
    .report-page > .report-title { margin-bottom: 14px; }
    .report-page-person { margin-top: 8px; }
    .report-blocks {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(460px, 1fr));
        gap: 24px;
        align-items: start;
    }
    .report-block {
        background: var(--white);
        border-radius: var(--radius);
        padding: 22px 26px 24px;
        box-shadow: var(--shadow-sm);
    }
    .report-block:empty, .report-block:not(:has(table)) { display: none; }
    /* Links die Tabellen untereinander, rechts die Diagramme */
    .report-blocks:has(> .report-charts) { grid-template-columns: minmax(460px, 1fr) minmax(380px, 1fr); }
    .report-col { display: flex; flex-direction: column; gap: 24px; min-width: 0; }
    .report-block.report-charts { display: flex; flex-direction: column; gap: 30px; position: relative; }
    .report-block > .report-table:first-child { margin-top: 0; }
    .report-page-data {
        background: var(--white);
        border-radius: var(--radius);
        padding: 26px 28px;
        box-shadow: var(--shadow-sm);
    }
    .report-groups { columns: 3 340px; column-gap: 44px; }
    .report-groups .report-subtitle { break-after: avoid; margin-top: 0; padding-top: 14px; }
    .report-groups .report-kv, .report-groups .report-list { break-inside: avoid; margin-bottom: 6px; }
    .report-groups .report-kv { grid-template-columns: minmax(150px, 45%) 1fr; }
}
@media print { .screen-only, .print-skip { display: none !important; } }

@media screen and (max-width: 900px) {
    .report-page-data { padding: 22px 16px; }
    .report-blocks, .report-blocks:has(> .report-charts) { grid-template-columns: 1fr; }
    .report-kv { grid-template-columns: 1fr; }
    .report-kv dd { margin-bottom: 6px; }
    .report-darauf { width: 0; }
}

@media print {
    @page { size: A4; margin: 0; }
    body { background: var(--white) !important; }
    .sidebar, .top-bar, .footer, .no-print, .alert, dialog { display: none !important; }
    .main-content { margin-left: 0 !important; }
    .content-area { padding: 0 !important; gap: 0 !important; }
    .report { gap: 0; display: block; }
    .report-page {
        box-shadow: none; border-radius: 0; max-width: none; width: 210mm; min-height: 0;
        page-break-after: always; break-after: page;
        -webkit-print-color-adjust: exact; print-color-adjust: exact;
        -webkit-box-decoration-break: clone; box-decoration-break: clone;
    }
    .report-table tr, .report-kv, .report-list tr, .report-closing { break-inside: avoid; }
    .report-subtitle { break-after: avoid; }
    .report-page:last-child { page-break-after: auto; break-after: auto; }
    .report-page.print-last { page-break-after: auto; break-after: auto; }
}

/* =====================================================================
   Profilbilder und Kanzleilogos
   ===================================================================== */
a.initials-avatar { text-decoration: none; color: var(--white); }
a.initials-avatar:hover { text-decoration: none; box-shadow: 0 0 0 3px var(--teal-100); }
.initials-avatar.has-photo { background: var(--teal-50); overflow: hidden; padding: 0; }
.initials-avatar.has-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }

.avatar-lg {
    width: 104px; height: 104px; border-radius: 50%; flex-shrink: 0; overflow: hidden;
    background: linear-gradient(135deg, var(--blue), var(--teal));
    color: var(--white); font-size: 2rem; font-weight: 700;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 0 0 4px var(--teal-50);
}
.avatar-lg img { width: 100%; height: 100%; object-fit: cover; display: block; }

.user-cell { display: inline-flex; align-items: center; gap: 12px; }
.avatar-sm {
    width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0; object-fit: cover;
    background: linear-gradient(135deg, var(--blue), var(--teal));
    color: var(--white); font-size: .78rem; font-weight: 700;
    display: inline-flex; align-items: center; justify-content: center;
}

.upload-row { display: flex; align-items: center; gap: 28px; flex-wrap: wrap; }
.logo-preview {
    width: 240px; height: 110px; flex-shrink: 0; border-radius: 14px;
    border: 2px dashed #dde6e8; background: #fafcfc;
    display: flex; align-items: center; justify-content: center; padding: 14px;
}
.logo-preview img { max-width: 100%; max-height: 100%; object-fit: contain; display: block; }
.logo-thumb { max-width: 100px; max-height: 44px; object-fit: contain; display: block; }

.file-input { padding: 12px 14px !important; font-size: .95rem !important; background: #fafcfc !important; cursor: pointer; }
.file-input::file-selector-button {
    margin-right: 14px; padding: 8px 14px; border: none; border-radius: 8px; cursor: pointer;
    background: var(--teal-50); color: var(--petrol-700); font-weight: 600; font-family: inherit;
}
.file-input-sm { width: auto !important; max-width: 260px; padding: 6px 8px !important; font-size: .82rem !important; }
.file-input-sm::file-selector-button { padding: 5px 10px; margin-right: 8px; }

.logo-inline-form { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.btn-sm { padding: 8px 14px !important; font-size: .85rem !important; }
.btn-link {
    background: none; border: none; padding: 0; cursor: pointer; font-family: inherit;
    font-size: .85rem; color: var(--danger); text-decoration: underline;
}

/* Kopf der Prognoseberichte: Kanzleilogo in vernünftigen Grenzen */
.report-head-logo { height: auto !important; width: auto !important; max-height: 52px; max-width: 220px; object-fit: contain; }

/* =====================================================================
   Kontaktanfragen (Verwaltung)
   ===================================================================== */
.anfragen-list { display: flex; flex-direction: column; gap: 14px; }
.anfrage { border: 1px solid #e3ecee; border-radius: 14px; padding: 18px 20px; background: var(--white); }
.anfrage.is-done { background: #f8fafa; opacity: .78; }
.anfrage-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.anfrage-meta { font-size: .88rem; color: var(--text-grey); margin-top: 4px; }
.anfrage-text { margin: 14px 0 16px; line-height: 1.6; white-space: normal; }
.status-pill.is-active   { background: var(--teal-50); color: var(--teal); }
.status-pill.is-inactive { background: #eef1f2; color: var(--text-grey); }

/* Kanzleilogo in der Werkzeugleiste – nur im Vollbild des Berichts */
.report-toolbar-left { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; }
.report-fs-brand { display: none; align-items: center; gap: 16px; padding-right: 24px; border-right: 1px solid #dde6e8; }
.report-fs-brand img { max-height: 52px; max-width: 220px; width: auto; height: auto; object-fit: contain; display: block; }
.report-fs-brand span { display: flex; flex-direction: column; line-height: 1.3; }
.report-fs-brand strong { color: var(--petrol-900); font-size: 1rem; }
.report-fs-brand small { color: var(--text-grey); font-size: .85rem; }
.report:fullscreen .report-fs-brand,
.report.is-fullscreen .report-fs-brand { display: flex; }
@media (max-width: 700px) {
    .report-fs-brand { border-right: none; padding-right: 0; }
    .report-fs-brand img { max-height: 40px; max-width: 160px; }
}

/* Ausdruck: Adresse links, persönlicher Ansprechpartner mit Profilfoto rechts (kompakt, nicht höher als die Adresse) */
.report-addr-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; margin-bottom: 8mm; }
.report-addr-row .report-address { margin-bottom: 0; }
.report-contact { display: grid; grid-template-columns: auto auto; grid-template-rows: auto auto; column-gap: 12px; align-items: center; flex-shrink: 0; }
.report-contact img {
    grid-row: 1 / span 2; width: 20mm; height: 20mm; border-radius: 50%; object-fit: cover; display: block;
    border: 2px solid var(--teal-100);
}
.report-contact-label { align-self: end; font-size: .68rem; letter-spacing: .06em; text-transform: uppercase; color: var(--text-grey); }
.report-contact-name { align-self: start; font-size: .9rem; font-weight: 600; color: var(--petrol-900); line-height: 1.3; }

/* =====================================================================
   Kontexthilfe (Off-Canvas) – Aufbau und Gestaltung nach Vorlage bluefiles,
   Farben an visotax angepasst, Icons als Inline-SVG statt Icon-Schrift.
   ===================================================================== */
.help-drawer, .help-drawer-backdrop {
    --primary-color: var(--petrol-700);
    --border-color: #e3ecee;
    --text-color: var(--text-dark);
    --text-muted: var(--text-grey);
    --surface-color: #ffffff;
    --radius: 12px;
}
.help-drawer-backdrop {
    position: fixed;
    inset: 0;
    z-index: 280;
    background: rgba(8, 20, 33, 0.38);
    backdrop-filter: blur(3px);
    opacity: 0;
    transition: opacity 0.35s ease;
}

.help-drawer-backdrop.is-open {
    opacity: 1;
}

.help-drawer {
    --help-ease: cubic-bezier(0.22, 1, 0.36, 1);
    position: fixed;
    top: 12px;
    right: 12px;
    bottom: 12px;
    z-index: 290;
    display: flex;
    flex-direction: column;
    width: min(460px, calc(100vw - 24px));
    overflow: hidden;
    border-radius: 22px;
    background: var(--surface-color);
    box-shadow: 0 30px 80px rgba(5, 43, 56, 0.35), 0 0 0 1px rgba(11, 93, 119, 0.08);
    transform: translateX(calc(100% + 24px));
    transition: transform 0.55s var(--help-ease);
}

.help-drawer[hidden] {
    display: none;
}

.help-drawer.is-open {
    transform: translateX(0);
}

/* Kopf: Markenverlauf mit weichem Lichtschein und feinem Punktraster. */
.help-drawer-hero {
    position: relative;
    flex: 0 0 auto;
    padding: 18px 22px 24px;
    overflow: hidden;
    color: #fff;
    background:
        radial-gradient(rgba(255, 255, 255, 0.14) 1px, transparent 1.4px) 0 0 / 14px 14px,
        linear-gradient(135deg, var(--teal) 0%, var(--petrol-700) 45%, var(--petrol-900) 100%);
}

.help-drawer-hero-glow {
    position: absolute;
    top: -90px;
    right: -60px;
    width: 260px;
    height: 260px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(126, 224, 214, 0.5), transparent 65%);
    filter: blur(6px);
    animation: help-glow-drift 9s ease-in-out infinite alternate;
    pointer-events: none;
}

@keyframes help-glow-drift {
    from { transform: translate(0, 0) scale(1); }
    to { transform: translate(-60px, 40px) scale(1.15); }
}

.help-drawer-hero-top {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 18px;
}

.help-drawer-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 5px 11px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.18);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.help-drawer-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
    font-size: 15px;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.3s var(--help-ease);
}

.help-drawer-close:hover {
    background: rgba(255, 255, 255, 0.28);
    transform: rotate(90deg);
}

.help-drawer-hero-main {
    position: relative;
    display: flex;
    gap: 16px;
    align-items: flex-start;
}

.help-drawer-icon {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 54px;
    height: 54px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.16);
    border: 1px solid rgba(255, 255, 255, 0.25);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), 0 10px 24px rgba(0, 0, 0, 0.18);
    font-size: 22px;
    backdrop-filter: blur(8px);
}

.help-drawer-heading {
    min-width: 0;
}

.help-drawer-title {
    margin: 2px 0 6px;
    font-size: 23px;
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: -0.01em;
}

.help-drawer-summary {
    margin: 0;
    font-size: 14px;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.85);
}

.help-drawer-summary:empty {
    display: none;
}

.help-drawer-scroll {
    flex: 1 1 auto;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 22px 22px 8px;
}

/* Lade-Platzhalter, solange help.php antwortet. */
.help-drawer-skeleton {
    display: none;
    flex-direction: column;
    gap: 12px;
}

.help-drawer.is-loading .help-drawer-skeleton {
    display: flex;
}

.help-drawer.is-loading .help-drawer-view .help-content {
    display: none;
}

.help-drawer-skeleton span {
    height: 14px;
    border-radius: 7px;
    background: linear-gradient(90deg, #edf2f7 25%, #f7fafc 50%, #edf2f7 75%) 0 0 / 200% 100%;
    animation: help-shimmer 1.2s linear infinite;
}

.help-drawer-skeleton span:nth-child(1) { width: 45%; height: 18px; }
.help-drawer-skeleton span:nth-child(2) { width: 92%; }
.help-drawer-skeleton span:nth-child(3) { width: 80%; }
.help-drawer-skeleton span:nth-child(4) { width: 86%; }

@keyframes help-shimmer {
    to { background-position: -200% 0; }
}

/* Gerenderter Hilfetext (auch für die Editor-Vorschau). */
.help-content {
    font-size: 14.5px;
    line-height: 1.65;
    color: var(--text-color);
}

.help-content > * {
    animation: help-fade-up 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.help-content > *:nth-child(2) { animation-delay: 0.05s; }
.help-content > *:nth-child(3) { animation-delay: 0.1s; }
.help-content > *:nth-child(4) { animation-delay: 0.15s; }
.help-content > *:nth-child(n+5) { animation-delay: 0.2s; }

@keyframes help-fade-up {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.help-content p {
    margin: 0 0 14px;
}

.help-content h3,
.help-content h4 {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 22px 0 12px;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    color: var(--primary-color);
}

.help-content h4 {
    font-size: 13px;
    letter-spacing: 0;
    text-transform: none;
    color: var(--text-color);
}

.help-content h3::after {
    content: "";
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, rgba(11, 93, 119, 0.25), transparent);
}

.help-content > h3:first-child,
.help-content > h4:first-child {
    margin-top: 0;
}

/* Aufzählung: Karten mit Häkchen. */
.help-content ul {
    list-style: none;
    margin: 0 0 16px;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.help-content ul li {
    position: relative;
    padding: 11px 14px 11px 46px;
    border-radius: 12px;
    background: #f6f9fc;
    border: 1px solid #e6eef5;
    transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.help-content ul li:hover {
    border-color: rgba(11, 93, 119, 0.3);
    box-shadow: 0 6px 16px rgba(11, 93, 119, 0.08);
    transform: translateX(-2px);
}

.help-content ul li::before {
    content: "";
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230b5d77' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 11px;
    position: absolute;
    top: 13px;
    left: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: rgba(11, 93, 119, 0.1);
    color: var(--primary-color);
    font-size: 10px;
    line-height: 1;
}

/* Nummerierte Liste: Schritte mit Verbindungslinie. */
.help-content ol {
    list-style: none;
    counter-reset: help-step;
    margin: 0 0 16px;
    padding: 0;
}

.help-content ol li {
    position: relative;
    counter-increment: help-step;
    min-height: 30px;
    padding: 3px 0 18px 46px;
}

.help-content ol li::before {
    content: counter(help-step);
    position: absolute;
    top: 0;
    left: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--teal), var(--petrol-700));
    color: #fff;
    font-size: 13px;
    font-weight: 800;
    box-shadow: 0 6px 14px rgba(11, 93, 119, 0.28);
}

.help-content ol li:not(:last-child)::after {
    content: "";
    position: absolute;
    top: 34px;
    bottom: 2px;
    left: 14.5px;
    width: 1px;
    background: linear-gradient(rgba(11, 93, 119, 0.35), rgba(11, 93, 119, 0.05));
}

.help-content ol li:last-child {
    padding-bottom: 6px;
}

.help-content a {
    font-weight: 600;
    text-decoration: underline;
    text-decoration-color: rgba(11, 93, 119, 0.35);
    text-underline-offset: 3px;
}

.help-content code {
    padding: 1px 6px;
    border-radius: 6px;
    background: #eef3f8;
    font-size: 0.9em;
}

.help-content strong {
    font-weight: 700;
    color: #0f2233;
}

.help-tip {
    display: flex;
    gap: 12px;
    margin: 4px 0 16px;
    padding: 14px 16px;
    border-radius: 14px;
    background: linear-gradient(135deg, #fff8e6, #fff3d1);
    border: 1px solid #f6e2a8;
    color: #6b4e00;
    font-size: 13.5px;
}

.help-tip > svg {
    flex: 0 0 auto;
    margin-top: 3px;
    color: #e0a100;
}

/* Fuß: Meta-Infos bzw. Editor-Aktionen. */
.help-drawer-footer {
    flex: 0 0 auto;
    padding: 14px 22px;
    border-top: 1px solid var(--border-color);
    background: linear-gradient(#fff, #f8fafc);
}

.help-drawer-footer-view,
.help-drawer-footer-edit {
    display: flex;
    align-items: center;
    gap: 10px;
}

.help-drawer-footer-view[hidden],
.help-drawer-footer-edit[hidden] {
    display: none;
}

.help-drawer-footer .btn {
    padding: 8px 14px;
    font-size: 14px;
}

.help-drawer-meta {
    flex: 1;
    min-width: 0;
    font-size: 12px;
    color: var(--text-muted);
}

.help-drawer-meta i {
    margin-right: 4px;
}

.help-drawer-kbd {
    font-size: 12px;
    color: var(--text-muted);
    white-space: nowrap;
}

.help-drawer-kbd kbd {
    display: inline-block;
    min-width: 20px;
    padding: 1px 6px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    border-bottom-width: 2px;
    background: #fff;
    font-family: inherit;
    font-size: 11px;
    font-weight: 700;
    text-align: center;
}

.help-drawer-footer-spacer {
    flex: 1;
}

.help-drawer-reset {
    border: none;
    background: none;
    padding: 6px 4px;
    color: var(--text-muted);
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

.help-drawer-reset[hidden] {
    display: none;
}

.help-drawer-reset:hover {
    color: #d32f2f;
}

/* Editor (nur mit hilfe.manage). */
.help-editor[hidden],
.help-drawer-view[hidden] {
    display: none;
}

.help-editor {
    display: flex;
    flex-direction: column;
    gap: 16px;
    animation: help-fade-up 0.35s ease both;
}

.help-editor-scopes {
    display: flex;
    padding: 4px;
    border-radius: 12px;
    background: #eef3f8;
}

.help-editor-scopes:empty {
    display: none;
}

.help-editor-scopes button {
    flex: 1;
    padding: 8px 10px;
    border: none;
    border-radius: 9px;
    background: none;
    color: var(--text-muted);
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.help-editor-scopes button.is-active {
    background: #fff;
    color: var(--primary-color);
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.1);
}

.help-editor-scopes button small {
    display: block;
    font-size: 11px;
    font-weight: 500;
    opacity: 0.75;
}

/* Überschreibt die globale label-Optik (Versalien, grau). */
.help-editor-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin: 0;
    font-size: 14px;
    font-weight: 400;
    color: var(--text-color);
    text-transform: none;
    letter-spacing: 0;
}

.help-editor-field > span {
    font-size: 13px;
    font-weight: 600;
}

.help-editor-field small {
    font-weight: 400;
    color: var(--text-muted);
}

.help-editor-field input,
.help-editor-field textarea {
    width: 100%;
    font: inherit;
    font-size: 14px;
}

.help-editor-tabs {
    display: flex;
    gap: 18px;
    border-bottom: 1px solid var(--border-color);
}

.help-editor-tabs button {
    margin-bottom: -1px;
    padding: 6px 0 9px;
    border: none;
    border-bottom: 2px solid transparent;
    background: none;
    color: var(--text-muted);
    font: inherit;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
}

.help-editor-tabs button.is-active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.help-editor-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.help-editor-toolbar[hidden] {
    display: none;
}

.help-editor-toolbar button {
    width: 32px;
    height: 30px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: #fff;
    color: var(--text-muted);
    cursor: pointer;
    transition: color 0.15s ease, border-color 0.15s ease;
}

.help-editor-toolbar button:hover {
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.help-editor-field textarea.help-editor-body {
    min-height: 260px;
    resize: vertical;
    font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
    font-size: 13px;
    line-height: 1.6;
}

.help-editor-preview {
    min-height: 260px;
    padding: 16px;
    border: 1px dashed var(--border-color);
    border-radius: var(--radius);
}

.help-editor-preview[hidden],
.help-editor-body[hidden] {
    display: none;
}

.help-editor-hint {
    margin: 0;
    font-size: 11.5px;
    color: var(--text-muted);
    line-height: 1.9;
}

.help-editor-hint code {
    white-space: nowrap;
    padding: 1px 5px;
    border-radius: 5px;
    background: #eef3f8;
}

.help-drawer-error {
    display: flex;
    gap: 10px;
    padding: 14px 16px;
    border-radius: 12px;
    background: #fdecea;
    color: #9b1c1c;
    font-size: 13.5px;
}

@media (max-width: 640px) {
    .help-drawer {
        top: 0;
        right: 0;
        bottom: 0;
        width: 100vw;
        border-radius: 0;
    }

    .help-drawer-scroll,
    .help-drawer-footer {
        padding-left: 16px;
        padding-right: 16px;
    }

    .help-drawer-hero {
        padding: 16px 16px 22px;
    }

    .help-drawer-kbd {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .help-drawer,
    .help-drawer-backdrop,
    .help-content > *,
    .help-drawer-hero-glow {
        transition: none;
        animation: none;
    }
}


/* Inline-SVG-Icons im Hilfe-Fenster */
.help-drawer svg { width: 1em; height: 1em; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.help-drawer-eyebrow svg { width: 13px; height: 13px; }
.help-drawer-close svg { width: 16px; height: 16px; }
.help-drawer-icon svg { width: 26px; height: 26px; }
.help-tip > svg { width: 18px; height: 18px; color: #e0a100; }
.help-editor-toolbar button { display: inline-flex; align-items: center; justify-content: center; font-size: 13px; }
.help-editor-toolbar button svg { width: 15px; height: 15px; }
.help-drawer-edit-btn, .help-drawer-reset { display: inline-flex; align-items: center; gap: 7px; }
.help-drawer-edit-btn svg, .help-drawer-reset svg { width: 15px; height: 15px; }
.help-drawer-footer .btn { padding: 10px 18px; font-size: .9rem; }
body.help-open { overflow: hidden; }

/* ?-Button in der Kopfleiste */
.help-trigger {
    position: relative; display: inline-flex; align-items: center; justify-content: center;
    width: 32px; height: 32px; padding: 0; border-radius: 50%;
    border: 1.5px solid var(--teal-100); background: var(--teal-50); color: var(--petrol-700);
    font: inherit; font-size: 15px; font-weight: 800; cursor: pointer;
    transition: background .2s ease, color .2s ease, transform .2s ease, border-color .2s ease;
}
.help-trigger:hover, .help-trigger[aria-expanded="true"] {
    background: var(--petrol-700); border-color: var(--petrol-700); color: #fff; transform: rotate(-12deg) scale(1.06);
}
@media print { .help-trigger, .help-drawer, .help-drawer-backdrop { display: none !important; } }

/* Häkchen der Hilfe-Aufzählung: Farbe und SVG gemeinsam setzen (die Kurzschreibweise der Vorlage überschreibt sonst das Bild) */
.help-content ul li::before { background: rgba(11, 93, 119, 0.1) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230b5d77' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E") center / 11px no-repeat; }

/* ?-Button oben rechts: gleiche Größe und Form wie das Profilbild (.initials-avatar) */
.user-menu .help-trigger {
    width: 46px; height: 46px; flex-shrink: 0;
    border-radius: 50%;
    border: 2px solid var(--teal-100);
    background: var(--teal-50);
    color: var(--petrol-700);
    font-size: 1.15rem; font-weight: 700; line-height: 1;
    transform: none;
    transition: background .2s ease, color .2s ease, border-color .2s ease, box-shadow .2s ease;
}
.user-menu .help-trigger:hover,
.user-menu .help-trigger[aria-expanded="true"] {
    background: linear-gradient(135deg, var(--blue), var(--teal));
    border-color: transparent;
    color: var(--white);
    box-shadow: 0 0 0 3px var(--teal-100);
    transform: none;
}
.user-menu .help-trigger:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--teal-100); }

/* =====================================================================
   Zwei-Faktor-Anmeldung (Login-Schritt, Einrichtung, Profil, Codes)
   ===================================================================== */
.lp-zf-stage { min-height: calc(100vh - 160px); display: flex; align-items: center; }
.lp-zf-inner { display: flex; justify-content: center; padding-top: 56px; padding-bottom: 64px; position: relative; }

.zf-karte {
    width: 100%; max-width: 560px; background: var(--white); color: var(--text-dark);
    border-radius: 24px; padding: 34px 34px 26px;
    display: flex; flex-direction: column; gap: 18px;
    box-shadow: 0 40px 80px -24px rgba(0, 0, 0, .55);
}
.zf-kopf { display: flex; gap: 16px; align-items: center; }
.zf-kopf h2 { font-size: 1.55rem; font-weight: 700; letter-spacing: -.02em; color: var(--petrol-900); margin-top: 2px; }
.zf-schild {
    width: 52px; height: 52px; flex: none; border-radius: 16px; display: grid; place-items: center;
    background: linear-gradient(140deg, var(--teal-50), var(--teal-100)); color: var(--teal);
}
.zf-schild svg, .zf-option-icon svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.zf-text { color: var(--text-grey); line-height: 1.6; }
.zf-klein { font-size: .82rem; color: var(--text-grey); }

/* Methodenwahl */
.zf-wahl { display: flex; flex-direction: column; gap: 12px; }
.zf-option {
    display: flex; gap: 14px; align-items: flex-start; cursor: pointer;
    padding: 18px 18px 18px 16px; border-radius: 16px; border: 2px solid #e3ecee; background: #fafcfc;
    transition: border-color .2s, background .2s, box-shadow .2s;
}
.zf-option:hover { border-color: var(--teal-100); }
.zf-option:has(input:checked) { border-color: var(--teal); background: #fff; box-shadow: 0 10px 24px -14px rgba(10, 131, 139, .5); }
.zf-option > input { width: 20px; height: 20px; margin-top: 12px; accent-color: var(--teal); flex: none; }
.zf-option-body { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.zf-option-head { display: flex; gap: 12px; align-items: center; }
.zf-option-head strong { display: block; font-size: 1.05rem; color: var(--petrol-900); }
.zf-option-icon { width: 42px; height: 42px; flex: none; border-radius: 12px; display: grid; place-items: center; background: var(--teal-50); color: var(--teal); }
.zf-option-icon svg { width: 22px; height: 22px; }
.zf-badge {
    display: inline-block; margin-top: 3px; padding: 3px 9px; border-radius: 999px;
    font-size: .72rem; font-weight: 700; letter-spacing: .02em; color: #2f6b4f; background: #e3f3e9;
}
.zf-option-text { font-size: .9rem; line-height: 1.55; color: var(--text-grey); }
.zf-option-hinweis { font-size: .85rem; color: var(--text-dark); }
.zf-option-feld { display: flex; flex-direction: column; gap: 6px; }
.zf-option-feld input { padding: 11px 14px !important; font-size: .95rem !important; border-radius: 10px !important; }

/* Einrichtung App */
.zf-schritte { margin: 0 0 0 20px; display: grid; gap: 8px; color: var(--text-dark); line-height: 1.55; font-size: .95rem; }
.zf-qr { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 18px; border-radius: 16px; background: #f7fafa; border: 1px solid #e3ecee; }
.zf-qr > svg { width: 220px; height: 220px; display: block; border-radius: 8px; background: #fff; }
.zf-schluessel { width: 100%; font-size: .88rem; color: var(--text-grey); }
.zf-schluessel summary { cursor: pointer; font-weight: 600; color: var(--petrol-700); text-align: center; }
.zf-schluessel p { margin: 10px 0 8px; }
.zf-schluessel code {
    display: block; text-align: center; padding: 10px; border-radius: 10px; background: #fff; border: 1px dashed var(--teal-100);
    font-family: "Cascadia Mono", Consolas, monospace; font-size: 1rem; letter-spacing: .08em; color: var(--petrol-900); word-break: break-all;
}

/* Code-Eingabe */
.zf-code-form { display: flex; flex-direction: column; gap: 10px; }
.zf-code-input {
    text-align: center; font-family: "Cascadia Mono", Consolas, monospace !important;
    font-size: 1.6rem !important; letter-spacing: .35em; padding: 14px !important; border-radius: 14px !important;
}
.zf-link-form { display: inline; }
.zf-link-reihe { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.zf-link { background: none; border: none; padding: 0; font: inherit; font-size: .9rem; font-weight: 600; color: var(--petrol-700); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.zf-link:hover { color: var(--teal); }
.zf-abbrechen { text-align: center; padding-top: 6px; border-top: 1px solid #eef3f4; }
.zf-abbrechen .zf-link { color: var(--text-grey); font-weight: 500; }
.zf-tipp { font-size: .85rem; padding: 10px 14px; border-radius: 12px; background: #fff8e6; color: #6b4e00; border: 1px solid #f6e2a8; }
.zf-notfall { border-radius: 14px; background: #f7fafa; border: 1px solid #e3ecee; padding: 12px 16px; }
.zf-notfall summary { cursor: pointer; font-weight: 600; color: var(--petrol-700); font-size: .92rem; }
.zf-notfall p { margin: 10px 0; font-size: .88rem; color: var(--text-grey); }
.zf-notfall .zf-code-input { font-size: 1.15rem !important; letter-spacing: .2em; }

/* Profil */
.zf-status { display: flex; gap: 16px; align-items: center; margin: 14px 0 16px; }
.zf-status strong { display: block; color: var(--petrol-900); }
.zf-status .TextGrey { font-size: .9rem; }
.zf-empfehlung { padding: 12px 16px; border-radius: 12px; background: #fff8e6; border: 1px solid #f6e2a8; color: #6b4e00; font-size: .9rem; line-height: 1.55; margin-bottom: 16px; }
.zf-profil-aktionen { display: flex; flex-direction: column; gap: 14px; }

/* Wiederherstellungscodes */
.zf-codes-karte { border: 2px solid var(--gold); }
.zf-codes-kopf { display: flex; gap: 16px; align-items: flex-start; }
.zf-codes-kopf h2 { margin-bottom: 4px; }
.zf-codes { list-style: none; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin: 20px 0; }
.zf-codes li {
    text-align: center; padding: 12px 8px; border-radius: 10px; background: #f7fafa; border: 1px solid #e3ecee;
    font-family: "Cascadia Mono", Consolas, monospace; font-size: 1.05rem; letter-spacing: .06em; color: var(--petrol-900);
}
.zf-codes-warnung { padding: 12px 16px; border-radius: 12px; background: #fff8e6; border: 1px solid #f6e2a8; color: #6b4e00; font-size: .9rem; margin-bottom: 18px; }
@media (max-width: 700px) {
    .zf-karte { padding: 26px 20px 20px; }
    .zf-codes { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Abstand der 2FA-Karte zur dunklen Fläche (sonst überschreibt .lp-wrap aus landing.css das Padding) */
.lp-stage .lp-zf-inner { padding-top: 64px; padding-bottom: 72px; }
@media (max-width: 900px) { .lp-stage .lp-zf-inner { padding-top: 32px; padding-bottom: 40px; } }

/* Benutzerverwaltung: Kopf der Mandantenauswahl mit "Alle"-Button, gefilterte Einträge */
.mandant-auswahl-kopf { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 8px; }
.mandant-auswahl-kopf .label-input { margin: 0; }
.checkbox-item[hidden] { display: none !important; }
.mandant-liste-hinweis { margin: 0; }
.mandant-liste-hinweis[hidden] { display: none; }

/* =====================================================================
   Rollen & Berechtigungen (Rechte-Matrix)
   ===================================================================== */
.rechte-matrix { width: 100%; border-collapse: collapse; min-width: 640px; }
.rechte-matrix thead th {
    position: sticky; top: 0; z-index: 1;
    background: var(--teal-50); color: var(--petrol-800); text-align: left;
    padding: 14px 18px; font-size: .82rem; text-transform: uppercase; letter-spacing: .05em;
}
.rechte-matrix th.rechte-rolle { text-align: center; width: 150px; }
.rechte-matrix th.rechte-sa { color: var(--text-grey); }
.rechte-matrix td { padding: 14px 18px; border-top: 1px solid #eaf1f2; vertical-align: middle; }
.rechte-matrix tbody tr:not(.rechte-gruppe):hover td { background: #f9fcfc; }
.rechte-gruppe th {
    text-align: left; padding: 22px 18px 8px; font-size: .78rem; font-weight: 700;
    letter-spacing: .08em; text-transform: uppercase; color: var(--teal); background: none;
}
.rechte-text { display: block; font-size: .86rem; color: var(--text-grey); margin-top: 2px; }
.rechte-zelle { text-align: center; }
.rechte-abweichung {
    display: block; margin-top: 4px; font-size: .7rem; font-weight: 700; letter-spacing: .04em;
    text-transform: uppercase; color: #a8861c;
}
.rechte-immer { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: #eef1f2; color: var(--text-grey); font-weight: 700; font-size: .85rem; }

/* Schalter statt Checkbox */
.rechte-schalter { position: relative; display: inline-block; width: 46px; height: 26px; cursor: pointer; }
.rechte-schalter input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.rechte-schalter span {
    position: absolute; inset: 0; border-radius: 999px; background: #d5dfe1; transition: background .2s;
}
.rechte-schalter span::after {
    content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%;
    background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .2); transition: transform .2s;
}
.rechte-schalter input:checked + span { background: var(--teal); }
.rechte-schalter input:checked + span::after { transform: translateX(20px); }
.rechte-schalter input:focus-visible + span { box-shadow: 0 0 0 3px var(--teal-100); }

/* Benutzerrollen (Rollen & Berechtigungen) */
.rollen-liste { display: flex; flex-direction: column; border: 1px solid #e3ecee; border-radius: 14px; overflow: hidden; }
.rolle-zeile { display: flex; align-items: center; gap: 18px; padding: 14px 18px; flex-wrap: wrap; }
.rolle-zeile + .rolle-zeile { border-top: 1px solid #eef3f4; }
.rolle-info { flex: 1; min-width: 220px; }
.rolle-info strong { color: var(--petrol-900); }
.rolle-text { display: block; font-size: .86rem; color: var(--text-grey); margin-top: 2px; }
.rolle-badge { display: inline-block; margin-left: 8px; padding: 2px 8px; border-radius: 999px; font-size: .7rem; font-weight: 700; color: var(--petrol-700); background: var(--teal-50); vertical-align: middle; }
.rolle-anzahl { font-size: .86rem; color: var(--text-grey); white-space: nowrap; }
.rolle-form { display: flex; gap: 10px; flex: 1; flex-wrap: wrap; align-items: center; }
.rolle-form input[type=text] { flex: 1; min-width: 180px; padding: 10px 14px !important; font-size: .95rem !important; }
.rolle-zeile button[disabled] { opacity: .45; cursor: not-allowed; }

/* =====================================================================
   Diagramme zur Prognose (Templates/PrognoseCharts.php) – nur Bildschirm
   Farben je Bedeutung: Ergebnis = Petrol, Gewerbesteuer = Gold, KSt/Soli = Blau
   (geprüft auf Farbfehlsichtigkeit und Kontrast gegen Weiß)
   ===================================================================== */
.report-charts { --ch-1: #0a929b; --ch-2: #b98500; --ch-3: #2f6db8; --ch-ink: var(--petrol-900); --ch-linie: #e3eaec; }
.ch-fig { margin: 0; }
.ch-head { display: flex; flex-direction: column; gap: 2px; margin-bottom: 12px; }
.ch-title { font-weight: 700; color: var(--petrol-900); font-size: .98rem; }
.ch-sub { font-size: .8rem; color: var(--text-grey); }
.ch-kpis { display: flex; gap: 28px; margin-bottom: 10px; }
.ch-kpis > div { display: flex; flex-direction: column; }
.ch-kpi-wert { font-size: 1.25rem; font-weight: 700; color: var(--ch-ink); font-variant-numeric: tabular-nums; }
.ch-kpi-text { font-size: .76rem; color: var(--text-grey); }
.ch-svg { width: 100%; height: auto; display: block; overflow: visible; }
.ch-grid { stroke: var(--ch-linie); stroke-width: 1; }
.ch-null { stroke: #b9c6cb; stroke-width: 1; }
.ch-achse { font-size: 10.5px; fill: var(--text-grey); font-variant-numeric: tabular-nums; }
.ch-achse-stark { fill: var(--ch-ink); font-weight: 700; }
.ch-svg .ch-c1 { fill: var(--ch-1); }
.ch-svg .ch-wash { fill: var(--ch-1); opacity: .14; }
.ch-c1-strich { stroke: var(--ch-1); stroke-width: 2.4; opacity: .7; }
.ch-prog { fill: url(#ch-schraffur); }
.ch-hitflaeche { fill: transparent; }
.ch-hit { cursor: default; outline: none; }
.ch-hit:hover path, .ch-hit:focus-visible path { filter: brightness(1.12); }
.ch-hit:focus-visible .ch-hitflaeche { fill: rgba(10, 146, 155, .06); }
.ch-legende { display: flex; gap: 18px; margin-top: 8px; font-size: .78rem; color: var(--text-grey); }
.ch-legende span { display: inline-flex; align-items: center; gap: 6px; }
.ch-key { display: inline-block; width: 12px; height: 12px; border-radius: 3px; flex-shrink: 0; }
.ch-key.ch-c1 { background: var(--ch-1); }
.ch-key.ch-c2 { background: var(--ch-2); }
.ch-key.ch-c3 { background: var(--ch-3); }
.ch-key-prog { background: repeating-linear-gradient(45deg, rgba(10, 146, 155, .75) 0 2px, rgba(10, 146, 155, .14) 2px 5px); }

/* Gestapelter Balken: 2px Weißraum zwischen den Segmenten, Enden gerundet */
.ch-stapel { display: flex; gap: 2px; height: 22px; margin: 4px 0 12px; }
.ch-seg { min-width: 3px; outline: none; }
.ch-seg:first-child { border-radius: 4px 0 0 4px; }
.ch-seg:last-child { border-radius: 0 4px 4px 0; }
.ch-seg.ch-c1, .ch-bullet-bar.ch-c1 { background: var(--ch-1); }
.ch-seg.ch-c2, .ch-bullet-bar.ch-c2 { background: var(--ch-2); }
.ch-seg.ch-c3, .ch-bullet-bar.ch-c3 { background: var(--ch-3); }
.ch-seg:hover, .ch-seg:focus-visible, .ch-bullet-bar:hover, .ch-bullet-bar:focus-visible { filter: brightness(1.12); }
.ch-liste { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: .86rem; }
.ch-liste li { display: grid; grid-template-columns: 12px 1fr auto 56px; align-items: center; gap: 10px; color: var(--text-dark); }
.ch-liste b { font-weight: 600; font-variant-numeric: tabular-nums; text-align: right; }
.ch-liste em { font-style: normal; color: var(--text-grey); text-align: right; font-variant-numeric: tabular-nums; }

/* Bullet-Diagramm: Balken = Festsetzung, dunkler Strich = Vorauszahlung */
.ch-bullets { display: grid; gap: 12px; }
.ch-bullet { display: grid; grid-template-columns: 92px 1fr auto; align-items: center; gap: 12px; font-size: .86rem; }
.ch-bullet-art { color: var(--text-dark); }
.ch-bullet-bahn { position: relative; height: 18px; background: #f1f5f6; border-radius: 4px; }
.ch-bullet-bar { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 0 4px 4px 0; outline: none; }
.ch-bullet-vz { position: absolute; top: -4px; bottom: -4px; width: 3px; margin-left: -1.5px; background: var(--ch-ink); border-radius: 2px; outline: none; box-shadow: 0 0 0 2px var(--white); }
.ch-bullet-vz::before { content: ""; position: absolute; inset: -4px -8px; }
.ch-bullet-saldo { font-variant-numeric: tabular-nums; white-space: nowrap; min-width: 150px; text-align: right; }

/* Tooltip (Wert zuerst, Bezeichnung darunter) */
.ch-tip { position: absolute; z-index: 5; pointer-events: none; background: var(--petrol-900); color: var(--white); padding: 7px 10px; border-radius: 8px; font-size: .8rem; line-height: 1.35; box-shadow: var(--shadow-md); white-space: nowrap; transform: translate(-50%, calc(-100% - 10px)); }
.ch-tip strong { display: block; font-size: .92rem; font-variant-numeric: tabular-nums; }
.ch-tip span { color: rgba(255, 255, 255, .78); }

/* Gebuchtes Paket: Auswahl in der Beraterübersicht, Belegung der Mandanten */
.paket-inline-form select { padding: 8px 10px; font-size: .9rem; min-width: 140px; }
.paket-belegung { font-size: .85rem; color: var(--text-grey); font-variant-numeric: tabular-nums; white-space: nowrap; }
td .paket-belegung { color: var(--text-dark); font-weight: 600; }
.paket-belegung.is-voll { color: var(--danger); font-weight: 600; }
.paket-balken { display: block; width: 110px; height: 5px; margin-top: 6px; border-radius: 3px; background: var(--teal-100); overflow: hidden; }
.paket-balken i { display: block; height: 100%; background: var(--teal); border-radius: 3px; }
.paket-balken.is-voll i { background: var(--danger); }

/* =====================================================================
   Freigegebene Auswertung (Abruf per Link + Bestätigungscode)
   ===================================================================== */
.fg-leiste { background: var(--white); border-bottom: 1px solid #e3ecee; }
.fg-leiste-inner { max-width: 1200px; margin: 0 auto; padding: 14px 16px; display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.fg-leiste-text { display: flex; flex-direction: column; gap: 2px; }
.fg-leiste-text strong { color: var(--petrol-900); }
.fg-leiste-text small { color: var(--text-grey); }
.fg-bericht { max-width: 1200px; margin: 0 auto; padding: 28px 16px 48px; }
@media print { .fg-bericht { padding: 0; max-width: none; } }

/* Versand-Dialog in der Prognose */
.fg-empf td { vertical-align: top; }
.fg-empf input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--teal); }
.fg-status { font-size: .85rem; color: var(--text-grey); line-height: 1.5; }
.fg-status-aktiv { color: var(--teal); font-weight: 600; }
.fg-leiste-marke { display: flex; align-items: center; gap: 16px; min-width: 0; }
.fg-leiste-logo { height: 48px; width: auto; max-width: 200px; object-fit: contain; flex: none; }
.fg-leiste { border-bottom: 3px solid var(--teal); }

/* Vertrauenssiegel in den Fußzeilen (Anwendung + öffentliche Seiten) */
.trust-badge {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 4px 11px 4px 8px; border-radius: 999px;
    background: var(--teal-50, #eaf6f6); border: 1px solid rgba(10, 131, 139, .18);
    color: var(--petrol-700, #0b5f66); font-size: .78rem; font-weight: 600; line-height: 1.3;
    text-decoration: none; white-space: nowrap; transition: background .2s, border-color .2s;
}
.trust-badge svg { width: 15px; height: 15px; flex: none; fill: none; stroke: var(--teal, #0a838b); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.trust-badge:hover, .trust-badge:focus-visible { background: #fff; border-color: var(--teal, #0a838b); color: var(--petrol-900, #12454b); }

/* Kinder im Inhaber-Modal (Reiter „Kinder“): eine Zeile je Kind */
.kinder-liste { display: flex; flex-direction: column; gap: 8px; }
.kind-kopf, .kind-zeile {
    display: grid; gap: 10px; align-items: center;
    grid-template-columns: minmax(140px, 2fr) 80px 130px 130px 110px 40px;
}
.kind-kopf {
    align-items: end; font-size: .8rem; font-weight: 700; line-height: 1.3;
    color: var(--text-grey); padding: 0 2px 2px;
}
.kinder-liste.is-leer .kind-kopf { display: none; }
.kind-zeile input, .kind-zeile select { width: 100%; min-width: 0; }
.kind-entfernen {
    width: 38px; height: 38px; border-radius: 10px; border: 1px solid #e3ecee; background: #fff;
    color: var(--text-grey); font-size: 1.3rem; line-height: 1; cursor: pointer;
}
.kind-entfernen:hover { border-color: var(--danger, #c0392b); color: var(--danger, #c0392b); }
.tab-zahl {
    display: inline-block; min-width: 20px; margin-left: 6px; padding: 1px 6px; border-radius: 999px;
    background: var(--teal-50, #eaf6f6); color: var(--petrol-700, #0b5f66); font-size: .72rem; font-weight: 700; text-align: center;
}
@media (max-width: 760px) {
    .kind-kopf { display: none; }
    .kind-zeile { grid-template-columns: 1fr 1fr; padding: 12px; border: 1px solid #e3ecee; border-radius: 12px; }
    .kind-zeile input[name$="[name]"] { grid-column: 1 / -1; }
}

/* =====================================================================
   Ladeanzeige (Seitenwechsel, Formularversand) – main.js: LadeanzeigeZeigen()
   Erscheint sofort (kurzes Einblenden), damit sie auch bei schnellen Seitenwechseln sichtbar ist.
   ===================================================================== */
.lade-overlay {
    position: fixed; inset: 0; z-index: 3000;
    display: none; align-items: center; justify-content: center;
    background: rgba(244, 247, 247, .55);
    -webkit-backdrop-filter: blur(6px) saturate(120%); backdrop-filter: blur(6px) saturate(120%);
    opacity: 0;
}
.lade-overlay.is-aktiv { display: flex; animation: ladeEin .12s ease forwards; }
/* Als Popover (oberste Ebene, über Modals): Browser-Vorgaben zurücksetzen */
.lade-overlay[popover] { width: auto; height: auto; margin: 0; padding: 0; border: 0; color: inherit; overflow: hidden; }
.lade-overlay[popover]:not(:popover-open) { display: none; }
.lade-box {
    display: flex; flex-direction: column; align-items: center; gap: 14px;
    padding: 26px 34px; border-radius: 20px;
    background: rgba(255, 255, 255, .92); border: 1px solid rgba(10, 131, 139, .12);
    box-shadow: 0 24px 60px -24px rgba(7, 31, 40, .35);
}
.lade-spinner {
    width: 46px; height: 46px; border-radius: 50%;
    background: conic-gradient(from 0deg, rgba(63, 193, 201, 0) 0deg, #3fc1c9 120deg, #0a838b 250deg, #8fd16b 330deg, rgba(143, 209, 107, 0) 360deg);
    -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 5px), #000 calc(100% - 4px));
    mask: radial-gradient(farthest-side, transparent calc(100% - 5px), #000 calc(100% - 4px));
    animation: ladeDreh .85s linear infinite;
}
.lade-text { font-size: .9rem; font-weight: 600; color: var(--petrol-800, #0e4a50); letter-spacing: .01em; }
@keyframes ladeDreh { to { transform: rotate(360deg); } }
@keyframes ladeEin  { to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
    .lade-spinner { animation-duration: 2.4s; }
}
@media print { .lade-overlay { display: none !important; } }

/* =====================================================================
   Dashboard (Dashboard.php)
   ===================================================================== */
.dash { gap: 24px; }
.dash-hero { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; flex-wrap: wrap; }
.card.hero .dash-hero-datum { font-size: .8rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: rgba(255, 255, 255, .7); margin-bottom: 6px; }
.dash-hero-text { margin-top: 8px; max-width: 640px; }
.dash-hero-text strong { color: #fff; }
.dash-hero-aktionen { display: flex; gap: 12px; flex-wrap: wrap; }
.dash-hero-aktionen .btn { display: inline-flex; align-items: center; gap: 8px; }
.dash-hero-aktionen .btn svg, .dash-aufgabe-link svg, .dash-mehr svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.dash-btn-hell { background: rgba(255, 255, 255, .14); color: #fff; border: 1px solid rgba(255, 255, 255, .35); }
.dash-btn-hell:hover { background: rgba(255, 255, 255, .24); color: #fff; }

/* Kennzahlen */
.dash-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 18px; }
.dash-kpi {
    position: relative; overflow: hidden;
    background: var(--white); border-radius: var(--radius); padding: 22px 24px;
    box-shadow: var(--shadow-sm); display: flex; flex-direction: column; gap: 6px;
    border: 1px solid #e8eff0; transition: transform .15s, box-shadow .15s;
}
.dash-kpi::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 4px; background: linear-gradient(90deg, #3fc1c9, #0a838b); }
.dash-kpi:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.dash-kpi-label { font-size: .78rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--text-grey); }
.dash-kpi-wert { font-size: 2rem; font-weight: 800; letter-spacing: -.02em; color: var(--petrol-900, #12454b); line-height: 1.15; min-height: 2.3rem; font-variant-numeric: tabular-nums; }
.dash-kpi-wert-klein { font-size: 1.45rem; }
.dash-kpi-hint { font-size: .84rem; color: var(--text-grey); }
.dash-balken { display: block; height: 6px; border-radius: 99px; background: #eef3f4; overflow: hidden; margin-top: 4px; }
.dash-balken i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #3fc1c9, #0a838b); }
.dash-skelett { display: inline-block; width: 140px; height: 1.6rem; border-radius: 8px; vertical-align: middle;
    background: linear-gradient(90deg, #eef3f4 0%, #f8fbfb 50%, #eef3f4 100%); background-size: 200% 100%; animation: dashSkelett 1.2s ease-in-out infinite; }
@keyframes dashSkelett { from { background-position: 100% 0; } to { background-position: -100% 0; } }

/* Raster: links breit, rechts schmal */
.dash-raster { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 24px; align-items: start; }
.dash-spalte { display: flex; flex-direction: column; gap: 24px; min-width: 0; }
.dash-karte { padding: 24px 26px; }
.dash-karte-kopf { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 16px; }
.dash-karte-kopf h3 { font-size: 1.12rem; color: var(--petrol-900, #12454b); }
.dash-karte-kopf p { font-size: .88rem; margin-top: 2px; }
.dash-kopf-icon { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; background: var(--teal-50, #eaf6f6); color: var(--teal); flex: none; }
.dash-kopf-icon svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* Fortschrittsring */
.dash-ring {
    --wert: 0; width: 84px; height: 84px; border-radius: 50%; flex: none; display: grid; place-items: center;
    background: conic-gradient(#0a838b calc(var(--wert) * 1%), #e6eeef 0);
}
.dash-ring > span { width: 66px; height: 66px; border-radius: 50%; background: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.1; }
.dash-ring strong { font-size: 1.05rem; color: var(--petrol-900, #12454b); }
.dash-ring small { font-size: .68rem; color: var(--text-grey); text-transform: uppercase; letter-spacing: .05em; }

/* Listen (Aufgaben, Zuletzt, Termine, Versand) */
.dash-aufgaben, .dash-zuletzt, .dash-termine, .dash-versand { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.dash-aufgaben li, .dash-zuletzt li, .dash-termine li, .dash-versand li { display: flex; align-items: center; gap: 14px; padding: 12px 4px; border-top: 1px solid #eef3f4; }
.dash-aufgaben li:first-child, .dash-zuletzt li:first-child, .dash-termine li:first-child, .dash-versand li:first-child { border-top: 0; }
.dash-aufgabe-icon, .dash-initial { width: 38px; height: 38px; flex: none; border-radius: 11px; display: grid; place-items: center; }
.dash-aufgabe-icon svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.dash-aufgabe-icon.is-bwa   { background: var(--teal-50, #eaf6f6); color: var(--teal); }
.dash-aufgabe-icon.is-stamm { background: #fdf3e3; color: #b7791f; }
.dash-initial { background: linear-gradient(135deg, #0a838b, #3fc1c9); color: #fff; font-weight: 700; }
.dash-aufgabe-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.dash-aufgabe-text strong { color: var(--text-dark); font-size: .95rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dash-aufgabe-text small { color: var(--text-grey); font-size: .82rem; }
.dash-aufgabe-link, .dash-mehr a { display: inline-flex; align-items: center; gap: 6px; font-size: .86rem; font-weight: 600; color: var(--petrol-700, #0b5f66); text-decoration: none; white-space: nowrap; padding: 7px 12px; border-radius: 9px; transition: background .15s; }
.dash-aufgabe-link:hover, .dash-mehr a:hover { background: var(--teal-50, #eaf6f6); }
.dash-mehr { margin-top: 8px; }
.dash-zuletzt-links { display: flex; gap: 6px; flex-wrap: wrap; }
.dash-zuletzt-links a { font-size: .8rem; font-weight: 600; color: var(--petrol-700, #0b5f66); text-decoration: none; padding: 6px 10px; border-radius: 8px; border: 1px solid #e3ecee; }
.dash-zuletzt-links a:hover { border-color: var(--teal); background: var(--teal-50, #eaf6f6); }
.dash-leer { display: flex; align-items: center; gap: 14px; padding: 18px; border-radius: 14px; background: #f3faf6; }
.dash-leer-icon { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; background: #2e7a55; color: #fff; flex: none; }
.dash-leer-icon svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }

/* Steuertermine */
.dash-datum { width: 50px; flex: none; border-radius: 12px; padding: 6px 0; text-align: center; background: #f3f7f8; display: flex; flex-direction: column; line-height: 1.1; }
.dash-datum strong { font-size: 1.15rem; color: var(--petrol-900, #12454b); }
.dash-datum small { font-size: .68rem; text-transform: uppercase; letter-spacing: .06em; color: var(--text-grey); }
.dash-termine li.is-naechster .dash-datum { background: linear-gradient(135deg, #0a838b, #3fc1c9); }
.dash-termine li.is-naechster .dash-datum strong, .dash-termine li.is-naechster .dash-datum small { color: #fff; }
.dash-countdown { font-size: .8rem; font-weight: 700; color: var(--petrol-700, #0b5f66); background: var(--teal-50, #eaf6f6); padding: 5px 10px; border-radius: 99px; white-space: nowrap; }
.dash-countdown.is-bald { color: #9a3412; background: #fdecdf; }
.dash-fussnote { margin-top: 10px; font-size: .78rem; color: var(--text-grey); }

/* Versand */
.dash-versand-zahlen { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 8px; }
.dash-versand-zahlen > div { padding: 12px; border-radius: 12px; background: #f6f9f9; display: flex; flex-direction: column; gap: 2px; }
.dash-versand-zahlen strong { font-size: 1.35rem; color: var(--petrol-900, #12454b); font-variant-numeric: tabular-nums; }
.dash-versand-zahlen small { font-size: .74rem; color: var(--text-grey); line-height: 1.3; }
.dash-versand-zahlen .is-warnung { background: #fdecdf; }
.dash-versand-zahlen .is-warnung strong { color: #9a3412; }
.dash-status { font-size: .74rem; font-weight: 700; padding: 4px 10px; border-radius: 99px; white-space: nowrap; background: #eef3f4; color: var(--text-grey); }
.dash-status.is-offen     { background: #fff4e0; color: #9a5b00; }
.dash-status.is-geoeffnet { background: #e6f4ec; color: #2e7a55; }
.dash-status.is-gesperrt, .dash-status.is-widerrufen { background: #fde8e8; color: #a12b2b; }

@media (max-width: 1100px) { .dash-raster { grid-template-columns: 1fr; } }
@media (max-width: 600px) {
    .dash-karte { padding: 20px 16px; }
    .dash-aufgaben li, .dash-zuletzt li { flex-wrap: wrap; }
    .dash-zuletzt-links { width: 100%; padding-left: 52px; }
    .dash-versand-zahlen { grid-template-columns: 1fr; }
}

/* Buchstabenleiste über der Mandantenübersicht (FilterBuchstabe in main.js) */
.buchstaben-leiste { display: flex; flex-wrap: wrap; gap: 4px; }
.buchstabe {
    min-width: 32px; height: 32px; padding: 0 8px; border: 1px solid #e3ecee; border-radius: 8px;
    background: #fff; color: var(--petrol-700); font: inherit; font-size: .85rem; font-weight: 700; cursor: pointer;
}
.buchstabe:hover:not(:disabled) { border-color: var(--teal); background: var(--teal-50); }
.buchstabe.is-aktiv { background: var(--teal); border-color: var(--teal); color: #fff; }
.buchstabe:disabled { color: #c3ccd0; background: transparent; border-color: transparent; cursor: default; }

/* Dashboard: auffällige Prognosen (hohe Nachzahlung/Erstattung je Mandant) */
.dash-betraege { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 2px; }
.dash-betrag { font-size: .78rem; font-weight: 700; padding: 3px 10px; border-radius: 99px; white-space: nowrap; }
.dash-betrag.is-nach { background: #fdeee8; color: #b4442f; }
.dash-betrag.is-erst { background: #e6f4ec; color: #2e7a55; }
#dash-auffaellig [hidden] { display: none; }
.dash-karte-warn { position: relative; overflow: hidden; background: linear-gradient(180deg, #fffaf6 0, #fff 140px); }
.dash-karte-warn::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 4px; background: linear-gradient(90deg, #e3a34b, #d9573f); }
.dash-karte-warn .dash-karte-kopf h3 { display: flex; align-items: center; gap: 10px; }
.dash-warn-icon { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; flex: none; background: #fdeee8; color: #c24a30; }
.dash-warn-icon svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.dash-warn-icon circle { fill: currentColor; }
#dash-auffaellig .dash-aufgaben { gap: 8px; }
#dash-auffaellig .dash-aufgaben li.dash-auffaellig-zeile { padding: 9px 16px; border: 0; border-radius: 12px; background: #fdf3ef; }
/* Eine Zeile je Mandant: Name · Beträge · Link (auf schmalen Bildschirmen rutschen die Beträge unter den Namen) */
#dash-auffaellig .dash-auffaellig-zeile .dash-aufgabe-text { flex-direction: row; align-items: center; flex-wrap: wrap; column-gap: 12px; row-gap: 4px; }
#dash-auffaellig .dash-auffaellig-zeile .dash-aufgabe-text strong { min-width: 0; max-width: 100%; }
#dash-auffaellig .dash-auffaellig-zeile .dash-betraege { margin-top: 0; }
#dash-auffaellig .dash-aufgaben li.dash-auffaellig-zeile.is-erst { background: #eef7f1; }
#dash-auffaellig .dash-aufgaben li.dash-auffaellig-zeile .dash-betrag.is-nach { background: #fff; }
#dash-auffaellig .dash-aufgaben li.dash-auffaellig-zeile .dash-betrag.is-erst { background: #fff; }

/* Bestätigungsmodal „Inhaber/Gesellschafter löschen“ (Mandanten.php) */
.del-modal-body { position: relative; padding: 32px 30px 26px; text-align: center; }
.del-modal-body .modal-close { position: absolute; top: 14px; right: 14px; }
.del-modal-icon { display: inline-grid; place-items: center; width: 60px; height: 60px; border-radius: 50%; background: #fdecec; color: var(--danger); margin-bottom: 14px; box-shadow: 0 0 0 8px #fef6f6; }
.del-modal-icon svg { width: 28px; height: 28px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.del-modal-body h2 { font-size: 1.3rem; margin: 0 0 6px; color: var(--petrol-900); }
.del-modal-name { font-size: 1.05rem; font-weight: 700; color: var(--text-dark); margin: 0 0 18px; }
.del-modal-folgen { list-style: none; margin: 0 0 14px; padding: 14px 16px; text-align: left; background: #f7fafa; border-radius: 12px; display: flex; flex-direction: column; gap: 8px; }
.del-modal-folgen li { position: relative; padding-left: 22px; font-size: .9rem; line-height: 1.45; color: var(--text-grey); }
.del-modal-folgen li::before { content: ""; position: absolute; left: 4px; top: .5em; width: 7px; height: 7px; border-radius: 50%; background: var(--danger); opacity: .7; }
.del-modal-folgen li[hidden] { display: none; }
.del-modal-hinweis { font-size: .85rem; font-weight: 600; color: var(--danger); margin: 0 0 20px; }
.del-modal-aktionen { display: flex; gap: 12px; justify-content: center; }
.del-modal-aktionen .btn { flex: 1; white-space: nowrap; padding: 13px 16px; }
.del-modal-aktionen .btn-danger:hover { filter: brightness(.92); }

/* Bewegungsdaten: verteilte Posten (Spalte mit Tooltip, Übersichtskarte, Hinweis im Dialog) */
.posten-tipp { display: inline-flex; cursor: help; border-radius: 99px; }
.posten-tipp:focus-visible { outline: 3px solid var(--teal-100); outline-offset: 2px; }
.posten-tipp template { display: none; }
.posten-badge { display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px; border-radius: 99px; background: var(--teal-50); color: var(--petrol-700); font-size: .8rem; font-weight: 700; white-space: nowrap; }
.posten-badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--teal); }
.posten-badge.is-inaktiv { background: #f1f4f5; color: var(--text-grey); }
.posten-badge.is-inaktiv::before { background: #b9c4c8; }

.posten-tooltip { position: fixed; z-index: 2500; width: min(500px, calc(100vw - 24px)); padding: 14px 16px 12px; border-radius: 14px; background: #fff; border: 1px solid #e3ecee; box-shadow: 0 18px 40px -14px rgba(5, 43, 56, .4); font-size: .84rem; pointer-events: none; }
.posten-tooltip[hidden] { display: none; }
.posten-tooltip .pt-titel { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 8px; }
.posten-tooltip .pt-titel strong { color: var(--petrol-900); font-size: .92rem; }
.posten-tooltip .pt-titel span { color: var(--text-grey); font-size: .78rem; }
/* Kompakte Tabelle: Posten | Betrag | bis Stichtag | Korrektur */
.pt-tab { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.pt-tab th { font-size: .68rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--text-grey); text-align: left; padding: 0 0 6px; border-bottom: 1px solid #eef3f4; }
.pt-tab td { padding: 8px 0; border-bottom: 1px solid #f1f5f6; vertical-align: top; color: var(--text-dark); }
.pt-tab th + th, .pt-tab td + td { padding-left: 14px; }
.pt-tab td strong { display: block; font-weight: 600; max-width: 190px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pt-tab td small { display: flex; align-items: center; gap: 6px; margin-top: 3px; font-size: .74rem; color: var(--text-grey); white-space: nowrap; }
.pt-tab .pt-zahl { text-align: right; white-space: nowrap; }
.pt-tab td.pt-zahl small { justify-content: flex-end; }
.pt-tab .pt-korr { font-weight: 700; color: var(--petrol-800); }
.pt-tab tr.is-inaktiv td { color: var(--text-grey); }
.pt-tab tr.is-inaktiv td strong { font-weight: 500; }
.pt-tab .pt-noch-nicht { font-size: .76rem; font-style: italic; vertical-align: middle; }
.pt-tab tfoot td { border-bottom: 0; padding-top: 9px; font-weight: 600; color: var(--petrol-800); }
.pt-tab tfoot .pt-korr { font-size: .95rem; }
.pt-art { font-size: .68rem; font-weight: 700; padding: 1px 7px; border-radius: 99px; white-space: nowrap; }
.pt-art.is-ertrag { background: #e6f4ec; color: #2e7a55; }
.pt-art.is-aufwand { background: #fdeee8; color: #b4442f; }

.posten-tabelle .ta-rechts { text-align: right; }
.posten-tabelle tr.posten-jahr-start:not(:nth-child(2)) td { border-top: 2px solid #d7e5e7; }

.beweg-posten-hinweis { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin: -4px 0 0; padding: 10px 14px; border-radius: 10px; background: #fff7e6; color: #7a4f00; font-size: .88rem; }
.beweg-posten-hinweis[hidden] { display: none; }
.beweg-posten-hinweis a { font-weight: 700; color: #7a4f00; white-space: nowrap; }

/* Versand-Dialog: Freigabe je Empfänger nur bei „einzeln festlegen“ */
.fg-umfang select { max-width: 420px; }
.fg-empf .fg-je { display: none; }
.fg-empf.is-einzeln .fg-je { display: table-cell; }
.fg-empf .fg-je select { width: auto; min-width: 210px; padding: 10px 36px 10px 12px; font-size: .92rem; }
/* Breite Dialoge mit Tabellen (z. B. Versand der Auswertung) */
dialog.modal.modal-lg { width: min(1040px, 94vw); }
