/* ==========================================================================
   VermoegensCockpit – Designsystem
   Navy / Gold / Off-White · Apple/Linear · minimalistisch · premium
   Light & Dark Mode ueber [data-theme]
   ========================================================================== */

/* ---------- Design-Tokens ---------- */
:root {
    --font-display: "Cormorant Garamond", Georgia, "Times New Roman", serif;
    --font-body: "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, system-ui, sans-serif;

    --bg: #f5f3ee;
    --surface: #ffffff;
    --surface-2: #faf8f3;
    --border: #e8e3d8;
    --border-strong: #ddd6c8;
    --text: #16233a;
    --text-muted: #6a7688;
    --text-faint: #9aa6b6;

    --navy: #0f1b2d;
    --navy-600: #16233a;
    --gold: #c39a4c;
    --gold-strong: #b98a35;
    --gold-soft: rgba(195, 154, 76, 0.14);

    --sidebar-bg: #0f1b2d;
    --sidebar-text: #aeb9cb;
    --sidebar-text-strong: #f5f3ee;
    --sidebar-active-bg: rgba(195, 154, 76, 0.16);
    --sidebar-hover-bg: rgba(255, 255, 255, 0.05);

    --success: #3f8f6b;
    --danger: #c0473f;

    --radius: 16px;
    --radius-sm: 10px;
    --radius-lg: 22px;

    --shadow-sm: 0 1px 2px rgba(15, 27, 45, 0.05), 0 1px 3px rgba(15, 27, 45, 0.04);
    --shadow-md: 0 4px 16px rgba(15, 27, 45, 0.07), 0 2px 6px rgba(15, 27, 45, 0.05);
    --shadow-lg: 0 18px 48px rgba(15, 27, 45, 0.14);

    --sidebar-w: 266px;
    --topbar-h: 66px;
    --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

[data-theme="dark"] {
    --bg: #0b1422;
    --surface: #111e30;
    --surface-2: #0e1a2b;
    --border: #223148;
    --border-strong: #2b3d57;
    --text: #eef2f8;
    --text-muted: #97a5bb;
    --text-faint: #6b7b93;

    --sidebar-bg: #0a121e;
    --sidebar-text: #9fabc0;
    --sidebar-text-strong: #f5f3ee;
    --sidebar-hover-bg: rgba(255, 255, 255, 0.06);

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 6px 20px rgba(0, 0, 0, 0.35);
    --shadow-lg: 0 20px 50px rgba(0, 0, 0, 0.5);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body {
    margin: 0;
    font-family: var(--font-body);
    background: var(--bg);
    color: var(--text);
    font-size: 15px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    transition: background 0.3s var(--ease), color 0.3s var(--ease);
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -0.01em; }

/* ---------- Brand ---------- */
.brand { display: flex; align-items: center; gap: 12px; }
.brand__mark {
    display: grid; place-items: center;
    width: 38px; height: 38px;
    border-radius: 11px;
    background: linear-gradient(150deg, var(--gold), var(--gold-strong));
    color: #1a1205;
    font-family: var(--font-display);
    font-weight: 600; font-size: 18px; letter-spacing: 0.5px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35);
}
.brand__word {
    font-family: var(--font-display);
    font-size: 21px; font-weight: 600; letter-spacing: 0.2px;
}

/* ==========================================================================
   Auth / Login
   ========================================================================== */
.auth-body {
    display: grid; place-items: center; min-height: 100vh; padding: 24px;
    background:
        radial-gradient(1100px 600px at 15% -10%, #1c2f4d 0%, transparent 55%),
        radial-gradient(900px 500px at 110% 120%, #223a5e 0%, transparent 50%),
        var(--navy);
}
.auth-wrap { width: 100%; max-width: 424px; }
.auth-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 40px 38px 30px;
    box-shadow: var(--shadow-lg);
}
.brand--auth { justify-content: center; margin-bottom: 26px; }
.auth-title { font-family: var(--font-display); font-size: 30px; text-align: center; }
.auth-sub { margin: 6px 0 24px; text-align: center; color: var(--text-muted); }
.auth-foot { margin: 20px 0 0; text-align: center; font-size: 12.5px; color: var(--text-faint); }

/* ---------- Forms ---------- */
.form { display: flex; flex-direction: column; gap: 16px; }
.field { display: flex; flex-direction: column; gap: 7px; }
.field__label { font-size: 13px; font-weight: 500; color: var(--text-muted); }
.field__input {
    width: 100%;
    padding: 12px 14px;
    font-size: 15px;
    color: var(--text);
    background: var(--surface-2);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    transition: border-color 0.18s var(--ease), box-shadow 0.18s var(--ease), background 0.18s var(--ease);
}
.field__input::placeholder { color: var(--text-faint); }
.field__input:focus {
    outline: none;
    border-color: var(--gold);
    background: var(--surface);
    box-shadow: 0 0 0 4px var(--gold-soft);
}

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 11px 18px;
    font-size: 14.5px; font-weight: 600;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    transition: transform 0.12s var(--ease), background 0.18s var(--ease), border-color 0.18s var(--ease), color 0.18s var(--ease);
}
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--navy); color: #f5f3ee; }
.btn--primary:hover { background: var(--navy-600); }
.btn--ghost {
    background: transparent; color: var(--text);
    border-color: var(--border-strong);
}
.btn--ghost:hover { background: var(--surface-2); border-color: var(--gold); }
.btn--block { width: 100%; }
.btn--sm { padding: 9px 14px; font-size: 13.5px; }

/* ---------- Alerts ---------- */
.alert {
    padding: 11px 14px; border-radius: var(--radius-sm);
    font-size: 13.5px; margin-bottom: 18px; border: 1px solid transparent;
}
.alert--error {
    color: var(--danger);
    background: rgba(192, 71, 63, 0.08);
    border-color: rgba(192, 71, 63, 0.25);
}

/* ==========================================================================
   App-Layout (Shell)
   ========================================================================== */
.layout { display: grid; grid-template-columns: var(--sidebar-w) 1fr; min-height: 100vh; }

/* ---------- Sidebar ---------- */
.sidebar {
    position: sticky; top: 0; height: 100vh;
    display: flex; flex-direction: column;
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    padding: 20px 16px;
    border-right: 1px solid rgba(255, 255, 255, 0.06);
}
.sidebar__brand {
    display: flex; align-items: center; gap: 11px;
    color: var(--sidebar-text-strong);
    padding: 6px 8px 20px;
}
.sidebar__brand .brand__word { font-size: 19px; }

.nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.nav__item {
    position: relative;
    display: flex; align-items: center; gap: 12px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    color: var(--sidebar-text);
    font-size: 14.5px; font-weight: 500;
    transition: background 0.16s var(--ease), color 0.16s var(--ease);
}
.nav__item:hover { background: var(--sidebar-hover-bg); color: var(--sidebar-text-strong); }
.nav__icon { width: 20px; height: 20px; flex-shrink: 0; opacity: 0.85; }
.nav__item.is-active {
    background: var(--sidebar-active-bg);
    color: var(--sidebar-text-strong);
}
.nav__item.is-active::before {
    content: ""; position: absolute; left: -16px; top: 50%; transform: translateY(-50%);
    width: 3px; height: 20px; border-radius: 0 3px 3px 0; background: var(--gold);
}
.nav__item.is-active .nav__icon { opacity: 1; color: var(--gold); }

.sidebar__foot { padding-top: 14px; border-top: 1px solid rgba(255, 255, 255, 0.07); }
.userchip { display: flex; align-items: center; gap: 11px; padding: 6px 8px 12px; }
.userchip__avatar {
    display: grid; place-items: center;
    width: 36px; height: 36px; border-radius: 10px;
    background: var(--gold-soft); color: var(--gold);
    font-weight: 600; font-size: 14px;
    border: 1px solid rgba(195, 154, 76, 0.3);
}
.userchip__avatar--sm { width: 34px; height: 34px; }
.userchip__meta { display: flex; flex-direction: column; line-height: 1.25; }
.userchip__name { color: var(--sidebar-text-strong); font-weight: 600; font-size: 14px; }
.userchip__role { font-size: 12px; color: var(--sidebar-text); text-transform: capitalize; }

/* ---------- Topbar ---------- */
.main { display: flex; flex-direction: column; min-width: 0; }
.topbar {
    position: sticky; top: 0; z-index: 20;
    display: flex; align-items: center; gap: 14px;
    height: var(--topbar-h); padding: 0 26px;
    background: color-mix(in srgb, var(--surface) 82%, transparent);
    backdrop-filter: saturate(1.4) blur(12px);
    border-bottom: 1px solid var(--border);
}
.iconbtn {
    display: grid; place-items: center;
    width: 38px; height: 38px; border-radius: 10px;
    background: transparent; border: 1px solid transparent; color: var(--text-muted);
    transition: background 0.16s var(--ease), color 0.16s var(--ease);
}
.iconbtn:hover { background: var(--surface-2); color: var(--text); }
.iconbtn svg { width: 20px; height: 20px; }
#sidebarToggle { display: none; }

.breadcrumb { display: flex; align-items: center; gap: 8px; flex: 1; font-size: 14px; color: var(--text-muted); }
.breadcrumb__item { color: var(--text-muted); }
.breadcrumb__item--current { color: var(--text); font-weight: 600; }
.breadcrumb__sep { color: var(--text-faint); }

.topbar__actions { display: flex; align-items: center; gap: 10px; }
.theme-icon--moon { display: none; }
[data-theme="dark"] .theme-icon--sun { display: none; }
[data-theme="dark"] .theme-icon--moon { display: block; }

/* ---------- Content ---------- */
.content { padding: 30px 32px 48px; max-width: 1240px; width: 100%; margin: 0 auto; }
.page-enter { animation: fade-up 0.34s var(--ease) both; }
@keyframes fade-up { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.page-head { margin-bottom: 26px; }
.page-eyebrow {
    font-size: 12px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase;
    color: var(--gold); margin-bottom: 8px;
}
.page-title { font-family: var(--font-display); font-size: 34px; line-height: 1.1; }
.page-sub { margin-top: 8px; color: var(--text-muted); font-size: 15px; }

/* ---------- Cards / KPI-Grid ---------- */
.grid { display: grid; gap: 18px; }
.grid--kpi { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 22px;
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.2s var(--ease), transform 0.2s var(--ease), border-color 0.2s var(--ease);
}
.card:hover { box-shadow: var(--shadow-md); }

.kpi { display: flex; flex-direction: column; gap: 14px; }
.kpi__head { display: flex; align-items: center; justify-content: space-between; }
.kpi__label { font-size: 13.5px; color: var(--text-muted); font-weight: 500; }
.kpi__icon {
    display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px;
    background: var(--gold-soft); color: var(--gold);
}
.kpi__icon svg { width: 18px; height: 18px; }
.kpi__value { font-family: var(--font-display); font-size: 32px; font-weight: 600; line-height: 1; }
.kpi__value--muted { color: var(--text-faint); }
.kpi__foot { font-size: 12.5px; color: var(--text-faint); }

.badge {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 3px 9px; border-radius: 999px;
    font-size: 11.5px; font-weight: 600;
    background: var(--gold-soft); color: var(--gold-strong);
}

/* ---------- Placeholder-Seiten ---------- */
.placeholder {
    display: grid; place-items: center; text-align: center;
    min-height: 52vh; padding: 40px;
}
.placeholder__inner { max-width: 440px; }
.placeholder__icon {
    display: grid; place-items: center; width: 60px; height: 60px; margin: 0 auto 20px;
    border-radius: 18px; background: var(--gold-soft); color: var(--gold);
}
.placeholder__icon svg { width: 28px; height: 28px; }
.placeholder__title { font-family: var(--font-display); font-size: 26px; margin-bottom: 8px; }
.placeholder__text { color: var(--text-muted); }
.placeholder .badge { margin-top: 18px; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
    .layout { grid-template-columns: 1fr; }
    .sidebar {
        position: fixed; z-index: 40; left: 0; top: 0; width: var(--sidebar-w);
        transform: translateX(-100%); transition: transform 0.28s var(--ease);
        box-shadow: var(--shadow-lg);
    }
    .layout.nav-open .sidebar { transform: none; }
    #sidebarToggle { display: grid; }
    .content { padding: 22px 18px 40px; }
    .topbar { padding: 0 16px; }
    .scrim {
        position: fixed; inset: 0; z-index: 35; background: rgba(10, 18, 30, 0.5);
        opacity: 0; pointer-events: none; transition: opacity 0.28s var(--ease);
    }
    .layout.nav-open .scrim { opacity: 1; pointer-events: auto; }
}

/* ---------- A11y ---------- */
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; border-radius: 4px; }
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

/* ============================================================
   Phase 1 – Investment- & Vermoegensentwicklungs-Cockpit
   ============================================================ */

.loading { padding: 3rem 0; text-align: center; color: var(--text-faint); }
.muted { color: var(--text-muted); }
.ta-right { text-align: right; }
.nowrap { white-space: nowrap; }
.pos { color: var(--success); }
.neg { color: var(--danger); }
.zero { color: var(--text-muted); }

.page-head--row { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }

/* Buttons */
.btn--primary { background: var(--navy); color: #fff; border: 1px solid var(--navy); }
[data-theme="dark"] .btn--primary { background: var(--gold); border-color: var(--gold); color: #16233a; }
.btn--primary:hover { background: var(--navy-600); }
.btn--xs { padding: 0.28rem 0.6rem; font-size: 0.78rem; border-radius: 8px; }
.btn svg { width: 1.05em; height: 1.05em; }
.btn span { display: inline-block; }

/* Cards */
.card__head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.card__head--pad { padding: 1.1rem 1.25rem 0; margin-bottom: 0.4rem; }
.card__head h3, .card h3 { font-family: var(--font-display); font-weight: 600; font-size: 1.22rem; color: var(--text); margin: 0; }
.card__actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.card--flush { padding: 0; overflow: hidden; }
.card--soft { background: var(--surface-2); }
.card--cta { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; flex-wrap: wrap; }
.card--cta h3 { font-family: var(--font-display); font-size: 1.3rem; margin: 0 0 0.2rem; }

/* Tabellen */
.table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.table th { text-align: left; font-weight: 600; font-size: 0.74rem; letter-spacing: 0.04em; text-transform: uppercase; color: var(--text-muted); padding: 0.85rem 1.25rem; border-bottom: 1px solid var(--border); }
.table td { padding: 0.85rem 1.25rem; vertical-align: middle; }
.table tbody tr { border-bottom: 1px solid var(--border); }
.table tbody tr:last-child { border-bottom: none; }
.table--hover tbody tr { cursor: pointer; transition: background 0.15s var(--ease); }
.table--hover tbody tr:hover { background: var(--surface-2); }
/* Nur als eigenständiges Element umbrechen – auf einer Tabellenzelle würde
   display:block die Zelle aus dem Tabellenfluss nehmen und die Zeile zerlegen. */
.cell-strong { font-weight: 600; color: var(--text); }
span.cell-strong, div.cell-strong { display: block; }
.cell-sub { display: block; font-size: 0.78rem; color: var(--text-faint); margin-top: 0.15rem; }
.empty { text-align: center; color: var(--text-faint); padding: 2rem 1rem; }

.grid--2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1.1rem; }
@media (max-width: 720px) { .grid--2 { grid-template-columns: 1fr; } }

/* Entwicklungs-Karte (klar getrennte Wertentwicklung) */
.devcard { border-left: 3px solid var(--gold); }
.devcard__lead { display: flex; flex-direction: column; gap: 0.15rem; margin-bottom: 1.1rem; }
.devcard__label { font-size: 0.8rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; }
.devcard__value { font-family: var(--font-display); font-size: 2.3rem; font-weight: 600; line-height: 1; }
.devcard__since { font-size: 0.8rem; color: var(--text-faint); }
.devcard__split { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.75rem; }
@media (max-width: 720px) { .devcard__split { grid-template-columns: 1fr 1fr; } }
.devcard__item { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 0.75rem 0.85rem; display: flex; flex-direction: column; gap: 0.3rem; }
.devcard__item--hl { border-color: var(--gold); background: var(--gold-soft); }
.devcard__k { font-size: 0.76rem; color: var(--text-muted); }
.devcard__v { font-weight: 600; font-size: 1.05rem; }
.devcard__note { margin: 0.9rem 0 0; font-size: 0.78rem; color: var(--text-faint); font-style: italic; }
.devcard--empty { color: var(--text-muted); }

/* Cash */
.cashgrid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.75rem; }
@media (max-width: 720px) { .cashgrid { grid-template-columns: 1fr 1fr; } }
.cashchip { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 0.8rem 0.9rem; }
.cashchip__label { display: block; font-size: 0.76rem; color: var(--text-muted); }
.cashchip__value { display: block; font-weight: 600; font-size: 1.15rem; margin-top: 0.2rem; }
.cashchip__foot { display: block; font-size: 0.72rem; color: var(--text-faint); margin-top: 0.2rem; }

/* Perioden-/Mini-Zeilen */
.mini-rows { display: flex; flex-direction: column; gap: 0.55rem; margin-top: 0.6rem; }
.mini-rows > div { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; padding-bottom: 0.55rem; border-bottom: 1px dashed var(--border); }
.mini-rows > div:last-child { border-bottom: none; }
.mini-rows span { color: var(--text-muted); font-size: 0.9rem; }
.mini-rows b { font-weight: 600; }
.mini-rows .hl b { color: var(--text); }
.mini-rows .hl { font-weight: 600; }

/* Diversifikations-Balken */
.divbar { margin-bottom: 1rem; }
.divbar__top { display: flex; justify-content: space-between; font-size: 0.88rem; margin-bottom: 0.35rem; }
.divbar__top span:last-child { color: var(--text-muted); }
.divbar__track { height: 10px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 6px; overflow: hidden; }
.divbar__fill { height: 100%; background: linear-gradient(90deg, var(--navy), var(--gold)); border-radius: 6px; }

/* Client-Banner + Tabs (Kundenmodus) */
.client-banner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; background: var(--navy); color: #fff; border-radius: var(--radius); padding: 0.9rem 1.25rem; margin-bottom: 1.1rem; flex-wrap: wrap; }
.client-banner__info { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; }
.client-banner__badge { font-size: 0.7rem; letter-spacing: 0.08em; text-transform: uppercase; background: var(--gold); color: #16233a; padding: 0.25rem 0.6rem; border-radius: 999px; font-weight: 600; }
.client-banner__name { font-family: var(--font-display); font-size: 1.4rem; font-weight: 600; }
.client-banner__ref { color: rgba(255,255,255,0.6); font-size: 0.85rem; }
.client-banner .btn--ghost { color: #fff; border-color: rgba(255,255,255,0.25); }
.client-banner .btn--ghost:hover { background: rgba(255,255,255,0.1); }

.ws-tabs { display: flex; gap: 0.35rem; margin-bottom: 1.25rem; overflow-x: auto; padding-bottom: 0.25rem; }
.ws-tab { flex: 0 0 auto; padding: 0.55rem 1rem; border: 1px solid var(--border); background: var(--surface); color: var(--text-muted); border-radius: 999px; font: inherit; font-size: 0.88rem; cursor: pointer; transition: all 0.15s var(--ease); }
.ws-tab:hover { border-color: var(--border-strong); color: var(--text); }
.ws-tab.is-active { background: var(--navy); color: #fff; border-color: var(--navy); }
[data-theme="dark"] .ws-tab.is-active { background: var(--gold); color: #16233a; border-color: var(--gold); }

/* Im Kundenmodus: globale Navigation ausblenden (reduzierte Navigation) */
.layout.client-mode .nav { display: none; }
.layout.client-mode .sidebar::after { content: "Kundenmodus aktiv"; display: block; margin: 0.5rem 1.25rem; padding: 0.6rem 0.8rem; font-size: 0.78rem; color: var(--gold); border: 1px dashed rgba(195,154,76,0.4); border-radius: var(--radius-sm); }

/* Vorbereitet-Kachel */
.prepared { text-align: center; padding: 2.5rem 1.5rem; }
.prepared__icon { width: 46px; height: 46px; margin: 0 auto 0.75rem; color: var(--gold); }
.prepared__icon svg { width: 100%; height: 100%; }

/* Modal */
.modal-back { position: fixed; inset: 0; background: rgba(15,27,45,0.5); backdrop-filter: blur(3px); display: flex; align-items: flex-start; justify-content: center; padding: 5vh 1rem; z-index: 100; overflow-y: auto; }
.modal { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); width: 100%; max-width: 560px; animation: modalIn 0.2s var(--ease); }
@keyframes modalIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.modal__head { display: flex; align-items: center; justify-content: space-between; padding: 1.1rem 1.25rem; border-bottom: 1px solid var(--border); }
.modal__head h3 { font-family: var(--font-display); font-size: 1.3rem; margin: 0; }
.modal__body { padding: 1.25rem; display: flex; flex-direction: column; gap: 0.9rem; }
.modal__foot { display: flex; justify-content: flex-end; gap: 0.6rem; padding: 1rem 1.25rem; border-top: 1px solid var(--border); }
body.modal-open { overflow: hidden; }

/* Formularfelder */
.fld { display: flex; flex-direction: column; gap: 0.3rem; }
.fld__label { font-size: 0.8rem; font-weight: 500; color: var(--text-muted); }
.fld__input { font: inherit; font-size: 0.95rem; padding: 0.6rem 0.75rem; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--surface); color: var(--text); transition: border 0.15s var(--ease); }
.fld__input:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-soft); }
.fld__hint { font-size: 0.76rem; color: var(--text-faint); }
select.fld__input { appearance: none; cursor: pointer; }

/* Split-Ergebnis */
.split-result__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.6rem; margin-top: 0.5rem; }
.split-result__grid > div { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 0.7rem; text-align: center; }
.split-result__grid span { display: block; font-size: 0.74rem; color: var(--text-muted); }
.split-result__grid b { display: block; font-size: 1.05rem; margin-top: 0.25rem; }
.split-result__note { color: var(--text-muted); font-size: 0.86rem; margin-top: 0.6rem; }

/* Toast */
.toast { position: fixed; bottom: 1.5rem; left: 50%; transform: translate(-50%, 1.5rem); opacity: 0; background: var(--navy); color: #fff; padding: 0.8rem 1.2rem; border-radius: 999px; box-shadow: var(--shadow-lg); font-size: 0.9rem; z-index: 200; transition: all 0.25s var(--ease); pointer-events: none; max-width: 90vw; }
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }
.toast--err { background: var(--danger); }
.toast--ok { background: var(--navy); }

.iconbtn--xs { width: 28px; height: 28px; padding: 5px; }
.iconbtn--xs svg { width: 100%; height: 100%; }
.badge { display: inline-block; margin-top: 0.75rem; font-size: 0.74rem; padding: 0.3rem 0.7rem; border-radius: 999px; background: var(--gold-soft); color: var(--gold-strong); font-weight: 500; }

/* ---- Diversifikation IST/SOLL (Phase: SOLL) ---- */
.divbar__track { position: relative; }
.divbar__mark { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--navy); box-shadow: 0 0 0 1px var(--surface); border-radius: 2px; z-index: 2; }
[data-theme="dark"] .divbar__mark { background: #fff; }
.divbar__foot { margin-top: 0.4rem; }
.tag { display: inline-block; font-size: 0.76rem; padding: 0.22rem 0.6rem; border-radius: 999px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text-muted); }
.tag--over { color: var(--gold-strong); border-color: rgba(195,154,76,0.4); background: var(--gold-soft); }
.tag--under { color: var(--danger); border-color: rgba(192,71,63,0.3); background: rgba(192,71,63,0.08); }
.tag--ontarget { color: var(--success); border-color: rgba(63,143,107,0.35); background: rgba(63,143,107,0.08); }
.tag--none { color: var(--text-faint); }

.impulses { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.6rem; }
.impulses li { padding: 0.75rem 0.9rem; background: var(--surface-2); border: 1px solid var(--border); border-left: 3px solid var(--gold); border-radius: var(--radius-sm); font-size: 0.92rem; color: var(--text); }

/* SOLL-Editor */
.tgt-grid { display: flex; flex-direction: column; gap: 0.5rem; max-height: 46vh; overflow-y: auto; padding-right: 0.25rem; }
.tgt-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.tgt-row__label { font-size: 0.9rem; color: var(--text); }
.tgt-row__input { display: inline-flex; align-items: center; gap: 0.3rem; }
.tgt-row__input .fld__input { width: 92px; text-align: right; padding: 0.4rem 0.55rem; }
.tgt-row__pct { color: var(--text-faint); font-size: 0.85rem; }
.tgt-sum { margin-top: 0.9rem; padding-top: 0.8rem; border-top: 1px solid var(--border); text-align: right; font-size: 0.95rem; color: var(--text-muted); }
.tgt-sum b { color: var(--text); }
.tgt-sum--ok b { color: var(--success); }
.tgt-sum--warn b { color: var(--gold-strong); }

/* ---- v2: Kuchendiagramme, Haushalt, Cash-Editor, Lesbarkeit ---- */
.client-banner__actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.fld__group-label { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-faint); font-weight: 600; margin-top: 0.3rem; }
.cashgrid--pad { padding: 1rem 1.25rem; }
.cashhint { padding: 0 1.25rem 1.1rem; }

/* Kuchendiagramm */
.pie { display: flex; align-items: center; gap: 1.25rem; flex-wrap: wrap; }
.pie__svg { width: 180px; height: 180px; flex: 0 0 auto; }
.pie-leg { flex: 1 1 180px; display: flex; flex-direction: column; gap: 0.5rem; min-width: 160px; }
.pie-leg__row { display: flex; align-items: center; gap: 0.55rem; font-size: 0.9rem; }
.pie-leg__dot { width: 12px; height: 12px; border-radius: 3px; flex: 0 0 auto; }
.pie-leg__label { flex: 1; color: var(--text); }
.pie-leg__pct { font-weight: 600; color: var(--text); }

/* Bessere Kontraste im hellen Modus */
.kpi__foot { color: var(--text-muted); }
.cell-sub { color: var(--text-muted); }

/* ---- v3: Sidebar-Buttons (dunkel), Marktübersicht ---- */
/* Ghost-Buttons in der dunklen Sidebar brauchen helle Schrift */
.sidebar .btn--ghost { color: var(--sidebar-text-strong, #f5f3ee); border-color: rgba(255,255,255,0.18); }
.sidebar .btn--ghost:hover { background: rgba(255,255,255,0.08); border-color: rgba(255,255,255,0.3); }

.market-overview { min-height: 460px; }
.market-overview .loading { padding: 4rem 0; }
.tradingview-widget-container { width: 100%; }

/* ---- v4: Logo, Entwicklungs-/Empfehlungs-Feinschliff ---- */
.brand__mark--logo { background: #fff; padding: 5px; overflow: hidden; }
.brand__mark--logo img { width: 100%; height: 100%; object-fit: contain; display: block; }
.devcard .grid--2 { margin-top: 0.9rem; }

/* ---- v6: Simulation ---- */
.sim-check { display: inline-flex; align-items: center; gap: 0.55rem; cursor: pointer; }
.sim-check input { width: 17px; height: 17px; accent-color: var(--gold, #c39a4c); cursor: pointer; flex: 0 0 auto; }
.sim-row--sell { opacity: 0.62; }
.sim-row--sell .cell-strong { text-decoration: line-through; }

/* ---- v7: Feinverteilung (Detailtabelle) ---- */
.table--detail td:first-child { padding-left: 2.4rem; }
.detail-group td { background: var(--surface-2, #f6f4ef); }
.detail-group td:first-child { padding-left: 1.25rem; }

/* ---- v8: Dashboard-Ausbau (grosser Chart, News, Fokusfonds) ---- */
.big-chart { height: 520px; }
.big-chart .tradingview-widget-container,
.big-chart .tradingview-widget-container__widget { height: 100%; }
.market-news { min-height: 420px; }
.chart-picker { max-width: 260px; padding: 0.45rem 0.7rem; font-size: 0.9rem; }
#focus-funds { min-height: 200px; }
.wl-name, .wl-isin, .wl-group { padding: 0.45rem 0.6rem; font-size: 0.9rem; }

/* ---- v9: deutscher Newsfeed, Fonds ohne Symbol ---- */
.news-head { display: flex; justify-content: flex-end; margin-bottom: 0.7rem; }
.news-source { max-width: 220px; padding: 0.4rem 0.6rem; font-size: 0.85rem; }
.newsfeed { list-style: none; margin: 0; padding: 0; max-height: 520px; overflow-y: auto; }
.newsitem { padding: 0.85rem 0; border-bottom: 1px solid var(--border); }
.newsitem:last-child { border-bottom: none; }
.newsitem__title { display: block; font-weight: 600; color: var(--text); text-decoration: none; line-height: 1.35; }
.newsitem__title:hover { color: var(--gold, #c39a4c); text-decoration: underline; }
.newsitem__text { margin: 0.35rem 0 0.3rem; font-size: 0.88rem; color: var(--text-muted); line-height: 1.45; }
.newsitem__meta { font-size: 0.78rem; color: var(--text-faint); }
.fund-pending { margin-top: 0.9rem; padding-top: 0.9rem; border-top: 1px solid var(--border); }
.fund-pending__head { font-weight: 600; font-size: 0.88rem; margin: 0 0 0.4rem; }
.fund-pending__row { margin: 0.2rem 0; font-size: 0.85rem; color: var(--text-muted); }
.fund-pending__grp { font-weight: 600; color: var(--text); }
.wl-symbol { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.82rem; }

/* ---- v10: Analyse-Impulse ---- */
.insights { display: flex; flex-direction: column; gap: 0.9rem; }
.insight { padding: 0.9rem 1rem; border-radius: 10px; border-left: 3px solid var(--border-strong); background: var(--surface-2); }
.insight--hoch { border-left-color: #c47b6a; }
.insight--mittel { border-left-color: #d4b06a; }
.insight--info { border-left-color: #7c9bb8; }
.insight__head { display: flex; align-items: center; gap: 0.6rem; margin-bottom: 0.35rem; flex-wrap: wrap; }
.insight__badge { font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.05em; font-weight: 700; padding: 0.15rem 0.45rem; border-radius: 4px; background: var(--surface); color: var(--text-muted); }
.insight--hoch .insight__badge { color: #a8543f; }
.insight__title { font-weight: 600; }
.insight__text { margin: 0; font-size: 0.9rem; line-height: 1.55; color: var(--text-muted); }

/* ---- v11: Forecast ---- */
.fc-lead { text-align: center; padding: 1.6rem 1.25rem; }
.fc-lead__label { display: block; font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); }
.fc-lead__value { display: block; font-size: 2.4rem; font-weight: 700; margin: 0.35rem 0 0.25rem; color: var(--text); }
.fc-lead__sub { display: block; font-size: 0.88rem; color: var(--text-muted); }

/* ---- v12: Depotbewertung (Verteilungsbalken) ---- */
.dist-wrap { padding: 1rem 1.25rem 1.25rem; }
.dist__head { font-size: 0.85rem; font-weight: 600; margin: 0 0 0.6rem; color: var(--text); }
.dist { display: flex; flex-direction: column; gap: 0.5rem; }
.dist__row { display: grid; grid-template-columns: minmax(90px, 32%) 1fr auto; align-items: center; gap: 0.6rem; font-size: 0.85rem; }
.dist__label { color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dist__track { height: 9px; background: var(--surface-2); border-radius: 5px; overflow: hidden; }
.dist__fill { display: block; height: 100%; background: #7c9bb8; border-radius: 5px; }
.dist__fill--none { background: #cfd5dd; }
.dist__val { font-weight: 600; text-align: right; white-space: nowrap; }
.dist__eur { display: block; font-weight: 400; font-size: 0.76rem; color: var(--text-muted); }

/* ---- v13: Export / Experteneinschätzung ---- */
.review-box { width: 100%; font-family: inherit; font-size: 0.9rem; line-height: 1.5; resize: vertical; }
#export-box { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.8rem; }

/* ---- v15: Versionsanzeige ---- */
.sidebar__version { margin-top: 0.7rem; text-align: center; font-size: 0.7rem;
    letter-spacing: 0.04em; color: rgba(255,255,255,0.38); }

/* ---- v16: Schnellerfassung ---- */
.table--import { font-size: 0.85rem; }
.table--import td { padding: 0.4rem 0.5rem; }
.table--import .fld__input { padding: 0.35rem 0.5rem; font-size: 0.85rem; }
.table--import input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--gold, #c39a4c); }
.table--import .imp-shares, .table--import .imp-value { text-align: right; }

/* ---- v17: Prozente führen, Euro-Beträge gut lesbar darunter ---- */
.big-pct { display: block; font-size: 1.08rem; font-weight: 700; line-height: 1.25; }
.mid-eur { display: block; font-size: 0.9rem; font-weight: 500; line-height: 1.35; color: var(--text-muted); }
.warnhint { color: #a8543f; }

/* ---- v18: Strategie-Seite ---- */
.strat-sub td { background: var(--surface-2); font-size: 0.85rem; color: var(--text-muted); }
.strat-sub td:first-child { padding-left: 2.4rem; }
.strat-sell, .strat-buy { max-width: 130px; padding: 0.35rem 0.5rem; font-size: 0.9rem; }
.strat-set { max-width: 160px; }

/* ---- v19: IST/SOLL-Tabelle einheitlich, bewusstes Halten ---- */
.table--ist-soll td, .table--ist-soll th { white-space: nowrap; }
.table--ist-soll td { font-size: 0.95rem; }
.tag--hold { background: rgba(124,155,184,0.16); color: #4a6b87; }
.row--hold td { background: rgba(124,155,184,0.06); }
.val-neg { color: #a8543f; font-weight: 600; }
.val-pos { color: #4a7c59; font-weight: 600; }
.linkbtn { background: none; border: none; padding: 0; font: inherit; font-size: 0.76rem;
    color: var(--text-muted); text-decoration: underline; cursor: pointer; }
.linkbtn:hover { color: var(--gold, #c39a4c); }

/* ---- v19: Strategie – Summenzeilen, Fondszuordnung ---- */
.strat-sum td { border-top: 1px solid var(--border-strong, #cfd5dd); background: var(--surface-2); }
.strat-plan { max-width: 78px; padding: 0.35rem 0.4rem; font-size: 0.88rem; }
.strat-funds td { background: var(--surface-2); padding-top: 0.5rem; padding-bottom: 0.6rem; }
.fundpick__wrap { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }
.strat-fund-add { max-width: 260px; padding: 0.35rem 0.5rem; font-size: 0.85rem; }

/* ---- v20: Strategie-Tabellen, Fondsgewichtung ---- */
.table--strat td { vertical-align: middle; }
.strat-sum td { border-top: 1px solid var(--border-strong, #cfd5dd); background: var(--surface-2); }
.strat-buy, .strat-sell { max-width: 130px; padding: 0.35rem 0.5rem; font-size: 0.9rem; }
.strat-plan { max-width: 74px; padding: 0.35rem 0.4rem; font-size: 0.88rem; }
.strat-fundpct { max-width: 68px; padding: 0.3rem 0.4rem; font-size: 0.85rem; }
.strat-cashnote { width: 100%; padding: 0.4rem 0.6rem; font-size: 0.88rem; }
.strat-funds td { background: var(--surface-2); padding: 0.6rem 1rem 0.8rem; }
.fundtable { margin: 0 0 0.5rem; }
.fundtable th { font-size: 0.7rem; padding: 0.25rem 0.5rem; }
.fundtable td { padding: 0.3rem 0.5rem; font-size: 0.86rem; border-bottom: 1px solid var(--border); }
.fundpick__wrap { display: flex; flex-wrap: wrap; gap: 0.7rem; align-items: center; }
.strat-fund-add { max-width: 300px; padding: 0.35rem 0.5rem; font-size: 0.85rem; }

/* ---- v21: Statusleiste der Strategie ---- */
.statusbar { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.statusbar--decided { border-left: 3px solid var(--gold, #c39a4c); }
.statusbar__label { display: block; font-weight: 600; }
.statusbar__hint { display: block; font-size: 0.82rem; color: var(--text-muted); margin-top: 0.15rem; }
.statusbar__dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--border-strong, #cfd5dd); margin-left: 0.4rem; vertical-align: middle; }
.statusbar__dot--gespeichert { background: #4a7c59; }
.statusbar__dot--offen { background: #d4b06a; }
.statusbar__dot--fehler { background: #c47b6a; }
