/* ============================================================
   Boostify Control – Design System (Dual Theme)
   Display: Bricolage Grotesque · Body: Plus Jakarta Sans · Mono: JetBrains Mono
   ============================================================ */

/* ---------- Theme tokens ---------- */
:root {
    --font-display: "Bricolage Grotesque", Georgia, serif;
    --font-body: "Plus Jakarta Sans", system-ui, sans-serif;
    --font-mono: "JetBrains Mono", ui-monospace, monospace;

    --violet: #7c5cff;
    --violet-2: #a78bfa;
    --teal: #14e0c0;
    --accent-grad: linear-gradient(120deg, #7c5cff 0%, #14e0c0 100%);

    --radius: 16px;
    --radius-sm: 10px;
    --radius-lg: 22px;
    --shadow: 0 18px 50px -20px rgba(0, 0, 0, .55);
    --ring: 0 0 0 3px color-mix(in srgb, var(--violet) 35%, transparent);
    --speed: .25s;
}

/* Dark (default) */
:root, [data-theme="dark"] {
    color-scheme: dark;
    --bg: #07080d;
    --bg-glow-1: rgba(124, 92, 255, .18);
    --bg-glow-2: rgba(20, 224, 192, .12);
    --surface: rgba(255, 255, 255, .035);
    --surface-solid: #11131c;
    --surface-2: rgba(255, 255, 255, .06);
    --surface-hover: rgba(255, 255, 255, .07);
    --border: rgba(255, 255, 255, .09);
    --border-strong: rgba(255, 255, 255, .16);
    --text: #f1f2f8;
    --text-soft: #c3c7d6;
    --muted: #828aa0;
    --grain-opacity: .035;
}

/* Light */
[data-theme="light"] {
    color-scheme: light;
    --bg: #eef0f7;
    --bg-glow-1: rgba(124, 92, 255, .16);
    --bg-glow-2: rgba(20, 224, 192, .14);
    --surface: rgba(255, 255, 255, .8);
    --surface-solid: #ffffff;
    --surface-2: rgba(17, 19, 28, .04);
    --surface-hover: rgba(17, 19, 28, .05);
    --border: rgba(17, 19, 28, .1);
    --border-strong: rgba(17, 19, 28, .18);
    --text: #14161f;
    --text-soft: #38404f;
    --muted: #687085;
    --violet: #6a47ff;
    --teal: #06b6a4;
    --shadow: 0 18px 44px -22px rgba(40, 30, 90, .35);
    --grain-opacity: .02;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { -webkit-text-size-adjust: 100%; }

body {
    font-family: var(--font-body);
    background: var(--bg);
    color: var(--text);
    line-height: 1.55;
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
    transition: background var(--speed), color var(--speed);
}

/* Atmospheric glows + grain */
body::before {
    content: "";
    position: fixed; inset: 0; z-index: -2;
    background:
        radial-gradient(60vw 60vw at 12% -8%, var(--bg-glow-1), transparent 55%),
        radial-gradient(50vw 50vw at 100% 0%, var(--bg-glow-2), transparent 50%);
    transition: opacity var(--speed);
}
body::after {
    content: "";
    position: fixed; inset: 0; z-index: -1; pointer-events: none;
    opacity: var(--grain-opacity);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
.mono { font-family: var(--font-mono); font-feature-settings: "tnum" 1; }
.muted { color: var(--muted); }
.soft { color: var(--text-soft); }
.right { text-align: right; }
.nowrap { white-space: nowrap; }

::selection { background: color-mix(in srgb, var(--violet) 40%, transparent); }

/* ---------- App shell ---------- */
.shell { display: grid; grid-template-columns: 264px 1fr; min-height: 100vh; }

/* ---------- Sidebar ---------- */
.sidebar {
    position: sticky; top: 0; height: 100vh;
    display: flex; flex-direction: column;
    padding: 22px 16px;
    background: var(--surface);
    backdrop-filter: blur(18px);
    border-right: 1px solid var(--border);
}
.brand {
    display: flex; align-items: center; gap: 11px;
    font-family: var(--font-display); font-weight: 700; font-size: 1.28rem;
    letter-spacing: -.02em; padding: 6px 10px 22px;
}
.brand .logo {
    width: 34px; height: 34px; border-radius: 11px;
    background: var(--accent-grad);
    display: grid; place-items: center; color: #fff; font-size: 1.1rem;
    box-shadow: 0 8px 22px -8px var(--violet);
}
/* Echtes Logo (Wortmarke) – Variante je nach Theme */
.brand-logo { height: 38px; width: auto; max-width: 100%; display: block; }
.brand-logo--light { display: none; }
[data-theme="light"] .brand-logo--dark { display: none; }
[data-theme="light"] .brand-logo--light { display: block; }
.auth-card .brand-logo { height: 46px; margin: 0 auto; }
.nav-section { margin-bottom: 18px; }
.nav-label {
    font-size: .68rem; text-transform: uppercase; letter-spacing: .14em;
    color: var(--muted); font-weight: 700; padding: 0 12px 8px;
}

/* Scrollbarer Nav-Bereich + aufklappbare Kategorien */
.nav-scroll { flex: 1; overflow-y: auto; margin: 0 -4px; padding: 0 4px; }
.nav-scroll::-webkit-scrollbar { width: 6px; }
.nav-scroll::-webkit-scrollbar-thumb { background: var(--border); border-radius: 99px; }
.nav-cat { margin-bottom: 6px; }
.nav-cat > summary {
    display: flex; align-items: center; justify-content: space-between;
    list-style: none; cursor: pointer; user-select: none;
    padding: 9px 12px; border-radius: var(--radius-sm);
    font-size: .68rem; text-transform: uppercase; letter-spacing: .12em;
    color: var(--muted); font-weight: 700; transition: var(--speed);
}
.nav-cat > summary::-webkit-details-marker { display: none; }
.nav-cat > summary:hover { color: var(--text-soft); }
.nav-cat > summary .cat-arrow { width: 15px; height: 15px; transition: transform var(--speed); opacity: .7; }
.nav-cat[open] > summary .cat-arrow { transform: rotate(180deg); }
.nav-cat .nav { padding: 2px 0 6px; }
.nav { display: flex; flex-direction: column; gap: 3px; }
.nav a {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 12px; border-radius: var(--radius-sm);
    color: var(--text-soft); font-weight: 600; font-size: .92rem;
    position: relative; transition: var(--speed);
}
.nav a svg { width: 19px; height: 19px; opacity: .8; flex-shrink: 0; }
.nav a:hover { background: var(--surface-hover); color: var(--text); }
.nav a.active { background: var(--surface-2); color: var(--text); }
.nav a.active::before {
    content: ""; position: absolute; left: -16px; top: 50%; transform: translateY(-50%);
    width: 4px; height: 22px; border-radius: 0 4px 4px 0; background: var(--accent-grad);
}
.nav a.active svg { opacity: 1; color: var(--violet); }

.sidebar-foot { margin-top: auto; padding-top: 16px; border-top: 1px solid var(--border); }
.user-chip { display: flex; align-items: center; gap: 11px; padding: 8px 10px; }
.avatar {
    width: 38px; height: 38px; border-radius: 12px; flex-shrink: 0;
    background: var(--accent-grad); color: #fff;
    display: grid; place-items: center; font-weight: 700; font-family: var(--font-display);
}
.user-meta { line-height: 1.25; min-width: 0; }
.user-meta strong { font-size: .9rem; display: block; }
.user-meta span { font-size: .76rem; color: var(--muted); }

/* Profil-Menü (aufklappbar über dem Avatar) */
.profile { position: relative; }
.user-chip--btn {
    width: 100%; background: transparent; border: 1px solid var(--border);
    border-radius: var(--radius-sm); cursor: pointer; text-align: left; transition: var(--speed);
}
.user-chip--btn:hover { border-color: var(--border-strong); background: var(--surface-hover); }
.profile-arrow { width: 16px; height: 16px; margin-left: auto; opacity: .7; transition: transform var(--speed); }
.profile:has([data-profile-menu]:not([hidden])) .profile-arrow { transform: rotate(180deg); }
.profile-menu {
    position: absolute; bottom: calc(100% + 8px); left: 0; right: 0;
    background: var(--surface-solid); border: 1px solid var(--border);
    border-radius: var(--radius); box-shadow: var(--shadow); padding: 6px; z-index: 70;
}
.profile-menu a, .profile-logout {
    display: flex; align-items: center; gap: 10px; width: 100%;
    padding: 10px 12px; border-radius: 10px; color: var(--text-soft);
    font-weight: 600; font-size: .9rem; background: transparent; border: none;
    text-align: left; cursor: pointer; transition: var(--speed); font-family: inherit;
}
.profile-menu a svg, .profile-logout svg { width: 18px; height: 18px; opacity: .8; }
.profile-menu a:hover { background: var(--surface-hover); color: var(--text); }
.profile-divider { height: 1px; background: var(--border); margin: 6px 4px; }
.profile-logout:hover { background: rgba(255,90,110,.12); color: #ff8097; }
.btn-logout {
    width: 100%; margin-top: 10px; padding: 9px;
    background: transparent; border: 1px solid var(--border);
    color: var(--muted); border-radius: var(--radius-sm); font-weight: 600; font-size: .85rem;
    transition: var(--speed);
}
.btn-logout:hover { color: var(--text); border-color: var(--border-strong); }

/* ---------- Main ---------- */
.main { display: flex; flex-direction: column; min-width: 0; }
.topbar {
    position: sticky; top: 0; z-index: 20;
    display: flex; align-items: center; gap: 18px;
    padding: 16px 32px;
    background: color-mix(in srgb, var(--bg) 72%, transparent);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border);
}
.topbar h1 { font-family: var(--font-display); font-size: 1.32rem; letter-spacing: -.02em; }
.crumb { font-size: .78rem; color: var(--muted); margin-bottom: 1px; }
.topbar-spacer { flex: 1; }
.search {
    display: flex; align-items: center; gap: 9px;
    padding: 9px 14px; border-radius: 999px;
    background: var(--surface-2); border: 1px solid var(--border);
    color: var(--muted); font-size: .85rem; min-width: 200px;
}
.search svg { width: 16px; height: 16px; }
.icon-btn {
    width: 40px; height: 40px; display: grid; place-items: center;
    border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border);
    color: var(--text-soft); transition: var(--speed);
}
.icon-btn:hover { color: var(--text); border-color: var(--border-strong); transform: translateY(-1px); }
.icon-btn svg { width: 19px; height: 19px; }
.theme-toggle .sun { display: none; }
[data-theme="light"] .theme-toggle .sun { display: block; }
[data-theme="light"] .theme-toggle .moon { display: none; }

.content { padding: 30px 40px 56px; max-width: 1560px; width: 100%; margin-inline: auto; }

/* page load stagger */
.stagger > * { opacity: 0; animation: fadeUp .55s cubic-bezier(.2,.7,.2,1) forwards; }
.stagger > *:nth-child(1) { animation-delay: .04s; }
.stagger > *:nth-child(2) { animation-delay: .10s; }
.stagger > *:nth-child(3) { animation-delay: .16s; }
.stagger > *:nth-child(4) { animation-delay: .22s; }
.stagger > *:nth-child(5) { animation-delay: .28s; }
.stagger > *:nth-child(6) { animation-delay: .34s; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .stagger > * { animation: none; opacity: 1; } }

/* ---------- Page heading ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; margin-bottom: 26px; flex-wrap: wrap; }
.page-head h2 { font-family: var(--font-display); font-size: 1.9rem; letter-spacing: -.025em; line-height: 1.1; }
.page-head p { color: var(--muted); margin-top: 4px; font-size: .92rem; }

/* ---------- Cards ---------- */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    backdrop-filter: blur(14px);
    box-shadow: var(--shadow);
}
.card-pad { padding: 22px; }
.card-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px; border-bottom: 1px solid var(--border); }
.card-head h3 { font-family: var(--font-display); font-size: 1.08rem; letter-spacing: -.01em; }

/* ---------- KPI grid ---------- */
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 22px; }
.kpis--5 { grid-template-columns: repeat(5, 1fr); }
.kpi { padding: 20px; position: relative; overflow: hidden; }
.kpi .kpi-ico {
    width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center;
    background: var(--surface-2); color: var(--violet); margin-bottom: 16px;
}
.kpi .kpi-ico svg { width: 21px; height: 21px; }
.kpi .kpi-label { color: var(--muted); font-size: .82rem; font-weight: 600; }
.kpi .kpi-value { font-family: var(--font-display); font-size: 1.85rem; letter-spacing: -.02em; margin-top: 2px; font-feature-settings: "tnum" 1; }
.kpi .kpi-trend { font-size: .78rem; font-weight: 700; margin-top: 8px; display: inline-flex; align-items: center; gap: 4px; }
.kpi .up { color: var(--teal); }
.kpi .down { color: #ff7a90; }
.kpi--feature {
    background: linear-gradient(140deg, color-mix(in srgb, var(--violet) 90%, #000), color-mix(in srgb, var(--teal) 70%, var(--violet)));
    border: none; color: #fff;
}
.kpi--feature .kpi-label, .kpi--feature .kpi-trend.up { color: rgba(255,255,255,.85); }
.kpi--feature .kpi-ico { background: rgba(255,255,255,.18); color: #fff; }

/* ---------- Layout helpers ---------- */
.row { display: grid; gap: 16px; }
.row-2-1 { grid-template-columns: 1.6fr 1fr; }
.grid-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 16px; }

/* ---------- Chart ---------- */
.chart { display: flex; align-items: flex-end; gap: 14px; height: 200px; padding: 10px 4px 0; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 9px; height: 100%; justify-content: flex-end; }
.bar {
    width: 100%; max-width: 46px; border-radius: 8px 8px 4px 4px;
    background: var(--accent-grad);
    position: relative; min-height: 4px;
    animation: grow .7s cubic-bezier(.2,.7,.2,1) backwards;
    transition: filter var(--speed);
}
.bar:hover { filter: brightness(1.15); }
.bar:hover .bar-val { opacity: 1; transform: translate(-50%, -4px); }
.bar-val {
    position: absolute; top: -22px; left: 50%; transform: translateX(-50%);
    font-family: var(--font-mono); font-size: .68rem; color: var(--text-soft);
    opacity: 0; transition: var(--speed); white-space: nowrap;
}
.bar-label { font-size: .74rem; color: var(--muted); font-weight: 600; }
@keyframes grow { from { height: 0; } }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; }
.table th {
    text-align: left; font-size: .72rem; text-transform: uppercase; letter-spacing: .07em;
    color: var(--muted); font-weight: 700; padding: 13px 18px; border-bottom: 1px solid var(--border);
}
.table td { padding: 14px 18px; border-bottom: 1px solid var(--border); font-size: .9rem; vertical-align: middle; }
.table tbody tr { transition: background var(--speed); }
.table tbody tr:hover { background: var(--surface-hover); }
.table tbody tr:last-child td { border-bottom: none; }
.table .num { font-family: var(--font-mono); font-feature-settings: "tnum" 1; }
.cell-strong { font-weight: 700; }
.cell-sub { font-size: .78rem; color: var(--muted); }

/* ---------- Badges ---------- */
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px; border-radius: 999px; font-size: .74rem; font-weight: 700; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge--paid { color: var(--teal); background: color-mix(in srgb, var(--teal) 16%, transparent); }
.badge--sent { color: var(--violet-2); background: color-mix(in srgb, var(--violet) 18%, transparent); }
.badge--overdue { color: #ff8097; background: rgba(255, 110, 130, .15); }
.badge--draft { color: var(--muted); background: var(--surface-2); }

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 11px 18px; border-radius: 12px; border: 1px solid transparent;
    font-weight: 700; font-size: .9rem; transition: var(--speed); white-space: nowrap;
}
.btn svg { width: 17px; height: 17px; }
.btn--primary { background: var(--accent-grad); color: #fff; box-shadow: 0 12px 26px -12px var(--violet); }
.btn--primary:hover { transform: translateY(-1px); filter: brightness(1.06); }
.btn--ghost { background: var(--surface-2); border-color: var(--border); color: var(--text); }
.btn--ghost:hover { border-color: var(--border-strong); }
.btn--danger { background: rgba(255, 90, 110, .13); color: #ff8097; border-color: rgba(255,90,110,.25); }
.btn--danger:hover { background: rgba(255, 90, 110, .2); }
.btn--sm { padding: 7px 12px; font-size: .82rem; border-radius: 9px; }
.btn--block { width: 100%; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; }

.link { color: var(--violet); font-weight: 700; font-size: .85rem; }
.link:hover { text-decoration: underline; }

/* ---------- Forms ---------- */
form.card.card-pad {
    max-width: 920px;
    margin: 0 auto;
}
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.field { display: flex; flex-direction: column; gap: 7px; }
.field.full { grid-column: 1 / -1; }
.field label { font-size: .82rem; font-weight: 700; color: var(--text-soft); }
.field .hint { font-size: .74rem; color: var(--muted); }
.input, .select, textarea.input {
    width: 100%; padding: 11px 14px; border-radius: 11px;
    background: var(--surface-2); border: 1px solid var(--border);
    color: var(--text); font-size: .92rem; font-family: inherit; transition: var(--speed);
}
textarea.input { resize: vertical; min-height: 90px; }
.input:focus, .select:focus, textarea.input:focus { outline: none; border-color: var(--violet); box-shadow: var(--ring); background: var(--surface-solid); }
.field.error .input, .field.error .select { border-color: #ff7a90; }
.field .err { color: #ff8097; font-size: .76rem; font-weight: 600; }
.input-group { display: flex; align-items: stretch; }
.input-group .prefix { display: grid; place-items: center; padding: 0 13px; background: var(--surface-2); border: 1px solid var(--border); border-right: none; border-radius: 11px 0 0 11px; color: var(--muted); font-weight: 700; }
.input-group .input { border-radius: 0 11px 11px 0; }

/* ---------- Product cards ---------- */
.product { padding: 20px; display: flex; flex-direction: column; transition: var(--speed); }
.product:hover { transform: translateY(-3px); border-color: var(--border-strong); }
.product-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.product-icon { width: 46px; height: 46px; border-radius: 13px; background: var(--surface-2); display: grid; place-items: center; color: var(--violet); flex-shrink: 0; }
.product-icon svg { width: 23px; height: 23px; }
.product-icon--lg { width: 64px; height: 64px; border-radius: 16px; background: var(--accent-grad); color: #fff; }
.product-icon--lg svg { width: 30px; height: 30px; }

/* ---------- Produkt-Detailseite (gebuchte Leistung) ---------- */
.prod-hero { display: flex; align-items: center; gap: 18px; }
.hero-badges { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 8px; }
.chip--accent { background: color-mix(in srgb, var(--violet) 18%, transparent); color: var(--violet-2); border: 1px solid color-mix(in srgb, var(--violet) 30%, transparent); }
.section-label { font-size: .72rem; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); font-weight: 700; margin: 24px 0 12px; }

/* Was ist enthalten */
.feat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.feat-item { display: flex; align-items: flex-start; gap: 10px; padding: 14px; border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid var(--border); font-size: .88rem; font-weight: 600; }
.feat-item svg { width: 17px; height: 17px; color: var(--teal); flex-shrink: 0; margin-top: 1px; }

/* Paketdetails */
.pd-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.pd-card { padding: 16px; display: flex; flex-direction: column; gap: 4px; }
.pd-label { font-size: .76rem; color: var(--muted); }
.pd-value { font-family: var(--font-display); font-size: 1.15rem; }

/* Timeline */
.timeline { list-style: none; display: flex; flex-direction: column; }
.tl-item { display: flex; gap: 14px; padding: 11px 0; position: relative; }
.tl-item:not(:last-child)::before { content: ""; position: absolute; left: 5px; top: 22px; bottom: -11px; width: 2px; background: var(--border); }
.tl-dot { width: 12px; height: 12px; border-radius: 50%; margin-top: 4px; flex-shrink: 0; z-index: 1; }
.tl-dot--teal { background: var(--teal); box-shadow: 0 0 8px var(--teal); }
.tl-dot--violet { background: var(--violet); box-shadow: 0 0 8px var(--violet); }
.tl-dot--amber { background: #f5a623; box-shadow: 0 0 8px #f5a623; }
.tl-item strong { font-size: .92rem; }

/* Dokumente */
.doc-row { display: flex; align-items: center; gap: 14px; padding: 14px 16px; }
.doc-ico { width: 40px; height: 40px; border-radius: 10px; background: color-mix(in srgb, var(--violet) 18%, transparent); color: var(--violet-2); display: grid; place-items: center; font-size: .66rem; font-weight: 800; letter-spacing: .03em; flex-shrink: 0; }
.doc-meta { flex: 1; min-width: 0; }
.doc-meta strong { display: block; font-size: .9rem; }
.doc-meta span { font-size: .78rem; }

/* Ansprechpartner */
.advisor { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.advisor .avatar { width: 46px; height: 46px; }
.advisor-meta { flex: 1; min-width: 120px; }
.advisor-meta strong { display: block; }
.advisor-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* Aufklappbares "Leistung zuweisen" */
.assign-box > summary { list-style: none; cursor: pointer; }
.assign-box > summary::-webkit-details-marker { display: none; }
.assign-box[open] > summary { margin-bottom: 4px; }
.product .p-top { display: flex; justify-content: space-between; align-items: start; gap: 10px; }
.product h4 { font-family: var(--font-display); font-size: 1.1rem; }
.chip { font-family: var(--font-mono); font-size: .7rem; padding: 3px 8px; border-radius: 7px; background: var(--surface-2); color: var(--muted); }
.product .p-desc { color: var(--muted); font-size: .87rem; margin: 11px 0 16px; flex: 1; }
.product .p-foot { display: flex; align-items: center; justify-content: space-between; padding-top: 14px; border-top: 1px solid var(--border); }
.price { font-family: var(--font-display); font-weight: 700; font-size: 1.3rem; }
.price .per { font-size: .75rem; color: var(--muted); font-family: var(--font-body); font-weight: 500; }

/* ---------- Invoice document ---------- */
.invoice-doc { padding: 30px; }
.inv-top { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; margin-bottom: 26px; }
.inv-top h4 { font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: 8px; }
.inv-meta { text-align: right; font-family: var(--font-mono); font-size: .85rem; }
.inv-meta div { margin: 3px 0; }
.inv-total { font-family: var(--font-display); font-size: 1.3rem; }

/* ---------- Status segmented control ---------- */
.seg { display: inline-flex; background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; padding: 4px; gap: 4px; }
.seg button { padding: 8px 14px; border-radius: 9px; border: none; background: transparent; color: var(--muted); font-weight: 700; font-size: .82rem; transition: var(--speed); }
.seg button:hover { color: var(--text); }
.seg button.on { background: var(--surface-solid); color: var(--text); box-shadow: var(--shadow); }

/* ---------- Toast / flash ---------- */
.toast {
    position: fixed; bottom: 26px; right: 26px; z-index: 80;
    display: flex; align-items: center; gap: 11px;
    padding: 14px 18px; border-radius: 14px;
    background: var(--surface-solid); border: 1px solid var(--border);
    box-shadow: var(--shadow); font-weight: 600; font-size: .9rem;
    animation: toastIn .4s cubic-bezier(.2,.7,.2,1), toastOut .4s ease 4.2s forwards;
}
.toast .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--teal); box-shadow: 0 0 12px var(--teal); }
@keyframes toastIn { from { opacity: 0; transform: translateY(16px); } }
@keyframes toastOut { to { opacity: 0; transform: translateY(16px); } }

/* ---------- Empty state ---------- */
.empty { text-align: center; padding: 46px 20px; color: var(--muted); }
.empty .e-ico { width: 54px; height: 54px; margin: 0 auto 14px; border-radius: 16px; background: var(--surface-2); display: grid; place-items: center; color: var(--violet); }
.empty .e-ico svg { width: 24px; height: 24px; }

/* ---------- Auth ---------- */
.auth-stage { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.auth-card { width: 100%; max-width: 410px; padding: 38px 34px; }
.auth-card .brand { justify-content: center; padding: 0 0 6px; }
.auth-title { font-family: var(--font-display); font-size: 1.5rem; text-align: center; letter-spacing: -.02em; }
.auth-sub { text-align: center; color: var(--muted); font-size: .9rem; margin: 4px 0 26px; }
.auth-card .form-grid { grid-template-columns: 1fr; gap: 16px; }
.auth-hint { text-align: center; font-size: .78rem; color: var(--muted); margin-top: 20px; line-height: 1.8; }
.auth-hint code { font-family: var(--font-mono); background: var(--surface-2); padding: 2px 7px; border-radius: 6px; color: var(--text-soft); }
.alert { padding: 12px 15px; border-radius: 12px; font-size: .88rem; font-weight: 600; margin-bottom: 18px; }
.alert--error { background: rgba(255, 90, 110, .12); color: #ff8097; border: 1px solid rgba(255,90,110,.25); }

/* ---------- Misc ---------- */
.line-items { display: flex; flex-direction: column; gap: 10px; }
.li-row { display: grid; grid-template-columns: 1.4fr 2fr .7fr 1fr auto; gap: 10px; align-items: center; }
.li-row--vat { grid-template-columns: 1.1fr 1.8fr .6fr 1fr .7fr auto; }
.li-head { display: grid; grid-template-columns: 1.1fr 1.8fr .6fr 1fr .7fr auto; gap: 10px;
    font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; padding: 0 2px 8px; }
.li-row .icon-btn { width: 38px; height: 38px; }
.totals-box { margin-top: 16px; margin-left: auto; max-width: 340px; display: flex; flex-direction: column; gap: 8px; }
.totals-box > div { display: flex; justify-content: space-between; font-size: .9rem; color: var(--text-soft); }
.totals-box .grand { border-top: 1px solid var(--border); padding-top: 10px; font-size: 1.1rem; }
.totals-box .grand strong { color: var(--teal); font-family: var(--font-display); }
.search-bar { margin-bottom: 4px; }
.section-gap { margin-top: 22px; }

/* Support-Card Kontaktzeilen */
.support-line { display: flex; align-items: center; gap: 10px; padding: 9px 0; font-weight: 600; font-size: .9rem; border-top: 1px solid var(--border); transition: var(--speed); }
.support-line:first-of-type { border-top: none; }
.support-line svg { width: 17px; height: 17px; color: var(--violet); }
.support-line:hover { color: var(--violet); }

/* Blog-Teaser im Dashboard */
.news-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 0; border-top: 1px solid var(--border); transition: var(--speed); }
.news-item:first-child { border-top: none; }
.news-item strong { font-size: .9rem; font-weight: 600; }
.news-item .mono { font-size: .76rem; flex-shrink: 0; }
.news-item:hover strong { color: var(--violet); }

/* Support-Card mit Illustration */
.support-card { overflow: hidden; display: flex; flex-direction: column; }
.support-illu {
    background: linear-gradient(135deg, color-mix(in srgb, var(--violet) 20%, transparent), color-mix(in srgb, var(--teal) 16%, transparent));
    display: grid; place-items: center; padding: 18px 10px;
}
.support-illu svg { width: 170px; height: auto; max-width: 80%; }

/* Blog-Karten (Dashboard-Teaser & /blog) */
.post-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 16px; }
.post-card { overflow: hidden; display: flex; flex-direction: column; transition: var(--speed); }
.post-card:hover { transform: translateY(-3px); border-color: var(--border-strong); }
.post-cover { position: relative; aspect-ratio: 16 / 9; background: var(--accent-grad); display: grid; place-items: center; overflow: hidden; }
.post-cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.post-cover-ico { color: #fff; opacity: .85; }
.post-cover-ico svg { width: 42px; height: 42px; }
.post-cover--lg { aspect-ratio: 24 / 9; border-radius: 0; }
.post-body { padding: 18px; display: flex; flex-direction: column; flex: 1; }
.post-meta { font-size: .76rem; color: var(--muted); display: flex; gap: 6px; align-items: center; margin-bottom: 8px; }
.post-title { font-family: var(--font-display); font-size: 1.12rem; line-height: 1.25; margin-bottom: 8px; }
.post-excerpt { color: var(--muted); font-size: .88rem; flex: 1; margin-bottom: 14px; }
.post-card .btn { align-self: flex-start; }

/* Mehrere gestapelte Karten mit gleichmaessigem Abstand */
.cards-stack { display: flex; flex-direction: column; gap: 18px; margin-top: 22px; }
/* Kompaktere Leerzustaende innerhalb von Abschnitts-Karten */
.card-pad > .empty { padding: 26px 16px; }
.divider { height: 1px; background: var(--border); margin: 20px 0; }

/* ---------- Tabs / Filter ---------- */
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 20px; }
.tab {
    padding: 9px 16px; border-radius: 999px; font-weight: 700; font-size: .85rem;
    background: var(--surface-2); border: 1px solid var(--border); color: var(--muted); transition: var(--speed);
}
.tab:hover { color: var(--text); }
.tab.on { background: var(--accent-grad); color: #fff; border-color: transparent; }

/* ---------- Profil-Definitionsliste ---------- */
.deflist { display: grid; grid-template-columns: 150px 1fr; gap: 10px 16px; }
.deflist dt { color: var(--muted); font-size: .85rem; font-weight: 600; }
.deflist dd { font-weight: 600; }

/* Toggle-Button (Passwort anzeigen) */
.pw-wrap { position: relative; }
.pw-toggle { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); width: 32px; height: 32px; }

/* ---------- Print (Beleg-Druckansicht) ---------- */
@media print {
    .sidebar, .topbar, .btn-row, .seg, .no-print { display: none !important; }
    body, body::before, body::after { background: #fff !important; }
    .shell, .main, .content { display: block; padding: 0; margin: 0; max-width: none; }
    .card { box-shadow: none; border: 1px solid #ddd; background: #fff; color: #000; }
    * { color: #000 !important; }
}

/* ---------- Responsive ---------- */
@media (max-width: 1000px) { .row-2-1 { grid-template-columns: 1fr; } .kpis { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 820px) {
    .shell { grid-template-columns: 1fr; }
    .sidebar { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; }
    .sidebar .nav-section { margin: 0; }
    .nav { flex-direction: row; flex-wrap: wrap; }
    .nav-label { display: none; }
    .nav a.active::before { display: none; }
    .sidebar-foot { margin: 0 0 0 auto; border: none; padding: 0; }
    .form-grid, .li-row { grid-template-columns: 1fr; }
    .search { display: none; }
    .content, .topbar { padding-left: 18px; padding-right: 18px; }
    .twofa-setup { grid-template-columns: 1fr; }
    .toggle-row { gap: 12px; }
}

/* ============================================================
   Konto-Module (Unternehmensdaten, Sicherheit, Support, Notifications)
   ============================================================ */
.section-block { margin-bottom: 18px; }
.block-title { font-family: var(--font-display); font-size: 1.12rem; display: flex; align-items: center; gap: 9px; margin-bottom: 18px; }
.block-title svg { color: var(--violet); }
.alert--success { background: color-mix(in srgb, var(--teal) 14%, transparent); color: var(--teal); border: 1px solid color-mix(in srgb, var(--teal) 35%, transparent); }

/* Pagination */
.pagination { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; border-top: 1px solid var(--border); font-size: .85rem; }
.pagination .is-disabled { opacity: .4; pointer-events: none; }

/* 2FA-Setup */
.twofa-setup { display: grid; grid-template-columns: auto 1fr; gap: 26px; align-items: center; }
.twofa-qr { background: #fff; padding: 10px; border-radius: 14px; width: max-content; }
.backup-codes { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; margin: 8px 0; }
.backup-codes span { background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; text-align: center; letter-spacing: .08em; }

/* Toggle-Schalter */
.toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 12px 0; border-top: 1px solid var(--border); font-weight: 600; font-size: .92rem; }
.toggle-row:first-of-type { border-top: none; }
.toggle { position: relative; flex-shrink: 0; }
.toggle input { position: absolute; opacity: 0; width: 0; height: 0; }
.toggle-track { display: block; width: 46px; height: 26px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); transition: var(--speed); }
.toggle-track::after { content: ""; position: absolute; top: 4px; left: 4px; width: 18px; height: 18px; border-radius: 50%; background: var(--muted); transition: var(--speed); }
.toggle input:checked + .toggle-track { background: var(--accent-grad); border-color: transparent; }
.toggle input:checked + .toggle-track::after { transform: translateX(20px); background: #fff; }

/* Support-Chat */
.chat { display: flex; flex-direction: column; gap: 14px; }
.chat-row { display: flex; }
.chat-row--user { justify-content: flex-end; }
.chat-bubble { max-width: 72%; padding: 12px 15px; border-radius: 16px; background: var(--surface-2); border: 1px solid var(--border); }
.chat-row--user .chat-bubble { background: color-mix(in srgb, var(--violet) 20%, var(--surface-2)); border-color: color-mix(in srgb, var(--violet) 30%, transparent); }
.chat-meta { font-size: .72rem; color: var(--muted); margin-bottom: 5px; }
.chat-text { font-size: .92rem; }
.chat-attach { display: inline-flex; align-items: center; gap: 6px; margin-top: 8px; font-size: .82rem; color: var(--violet); font-weight: 600; }

/* Notification-Center (Topbar-Dropdown) */
.notif { position: relative; }
.notif-badge { position: absolute; top: -4px; right: -4px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: #ff5a6e; color: #fff; font-size: .68rem; font-weight: 700; display: grid; place-items: center; }
.notif-dropdown { position: absolute; right: 0; top: calc(100% + 10px); width: 340px; max-width: 90vw; background: var(--surface-solid); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow); z-index: 60; overflow: hidden; }
.notif-head { display: flex; align-items: center; justify-content: space-between; padding: 13px 16px; border-bottom: 1px solid var(--border); }
.notif-list { max-height: 360px; overflow-y: auto; }
.notif-empty { padding: 26px 16px; text-align: center; color: var(--muted); font-size: .88rem; }
.notif-item { display: block; padding: 12px 16px; border-bottom: 1px solid var(--border); transition: var(--speed); }
.notif-item:hover { background: var(--surface-hover); }
.notif-item strong { display: block; font-size: .88rem; }
.notif-item span { display: block; font-size: .8rem; color: var(--muted); }
.notif-item .notif-time { font-size: .72rem; margin-top: 3px; }
.notif-item.is-unread { background: color-mix(in srgb, var(--violet) 8%, transparent); }
.notif-item.is-unread strong::after { content: "•"; color: var(--violet); margin-left: 6px; }
.notif-foot { display: block; padding: 12px 16px; text-align: center; font-weight: 700; font-size: .85rem; color: var(--violet); }

/* Notification-Verlauf (Seite) */
.notif-line { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--border); }
.notif-line:first-child { border-top: none; }
.notif-line-body { flex: 1; min-width: 0; }
.notif-line-body strong { display: block; font-size: .9rem; }
.notif-line .notif-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--border-strong); flex-shrink: 0; }
.notif-line.is-unread .notif-dot { background: var(--violet); box-shadow: 0 0 8px var(--violet); }
