/*
 * Eagle Online Marketing — Design-System
 * Schlicht, modern, dark, ohne Tracker, ohne externe Fonts.
 * Verwendet auf: index.html (Landing), login.html (Auth).
 */

*,
*::before,
*::after { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    background: var(--bg-app);
    color: var(--text-primary);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen,
                 Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

body.has-session-footer {
    padding-bottom: 3.25rem;
}

body.is-impersonating {
    padding-top: 3.25rem;
}

.impersonation-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    padding: 0.5rem clamp(0.75rem, 2vw, 1.25rem);
    background: #fef3c7;
    color: #92400e;
    border-bottom: 2px solid #f59e0b;
    font-size: 0.875rem;
    line-height: 1.4;
}

.impersonation-banner__text {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    flex: 1;
    min-width: 12rem;
}

.impersonation-banner__hint {
    font-size: 0.8125rem;
    color: #b45309;
}

.impersonation-banner__exit {
    background: #f59e0b;
    border-color: #d97706;
    color: #451a03;
    white-space: nowrap;
}

.impersonation-banner__exit:hover {
    background: #d97706;
    color: #451a03;
}

.impersonation-notice {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.25rem;
    margin-bottom: 1.25rem;
    border-radius: 12px;
    border: 1px solid #f59e0b;
    background: #fef3c7;
    color: #92400e;
}

.impersonation-notice__body {
    flex: 1;
    min-width: 12rem;
}

.impersonation-notice__title {
    margin: 0 0 0.35rem;
    font-weight: 600;
    font-size: 0.95rem;
    line-height: 1.45;
}

.impersonation-notice__hint {
    margin: 0;
    font-size: 0.875rem;
    color: #b45309;
    line-height: 1.5;
}

.impersonation-notice__exit {
    background: #f59e0b;
    border-color: #d97706;
    color: #451a03;
    white-space: nowrap;
}

.impersonation-notice__exit:hover {
    background: #d97706;
    color: #451a03;
}

.impersonation-notice--toast {
    position: sticky;
    top: 3.5rem;
    z-index: 900;
    box-shadow: 0 8px 24px rgba(146, 64, 14, 0.15);
}

/* Support tickets */
.filter-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 0 0 1rem;
}

.filter-chip {
    padding: 0.35rem 0.75rem;
    border-radius: 6px;
    text-decoration: none;
    font-size: 0.875rem;
    background: var(--bg-surface-2);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.filter-chip--active {
    background: var(--text-primary);
    color: var(--bg-app);
    border-color: transparent;
}

.filter-chip--warn.filter-chip--active,
.filter-chip--warn {
    background: #fef3c7;
    color: #92400e;
    border-color: #fcd34d;
}

.page__head--row {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.support-grid {
    display: grid;
    grid-template-columns: minmax(200px, 260px) 1fr;
    gap: 1rem;
    align-items: start;
}

@media (max-width: 768px) {
    .support-grid { grid-template-columns: 1fr; }
}

.support-meta__form {
    margin-bottom: 1rem;
}

.support-meta__form label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.support-meta__form select {
    width: 100%;
}

.support-msg {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    margin-bottom: 0.75rem;
    background: var(--bg-surface);
}

.support-msg--internal {
    background: #fef9c3;
    border-color: #fde047;
    color: #713f12;
}

.support-msg__head {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
    font-size: 0.8125rem;
    margin-bottom: 0.5rem;
}

.support-msg__badge {
    background: #fde047;
    color: #713f12;
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
    font-size: 0.75rem;
}

.support-msg__body {
    font-size: 0.9375rem;
    line-height: 1.5;
}

.support-reply-form textarea {
    width: 100%;
    margin-bottom: 0.75rem;
}

.context-help-fab {
    position: fixed;
    right: 1.25rem;
    bottom: calc(3.25rem + env(safe-area-inset-bottom, 0px));
    z-index: 900;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.65rem 1rem 0.65rem 0.85rem;
    border-radius: 999px;
    background: var(--color-primary, #2563eb);
    color: #fff;
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 600;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.18);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.context-help-fab:hover {
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.22);
}

.context-help-fab__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.35rem;
    height: 1.35rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.18);
    font-size: 0.95rem;
    line-height: 1;
}

@media (max-width: 640px) {
    .context-help-fab__label {
        position: absolute;
        width: 1px;
        height: 1px;
        padding: 0;
        margin: -1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
        white-space: nowrap;
        border: 0;
    }

    .context-help-fab {
        padding: 0.75rem;
        border-radius: 999px;
    }
}

body.app-layout-body .context-help-fab {
    bottom: calc(3.5rem + env(safe-area-inset-bottom, 0px));
}

.support-context {
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.support-context--customer {
    padding: 0.85rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--surface-muted, #f8fafc);
    border-bottom: 1px solid var(--border-color);
}

.support-context__customer-page {
    margin: 0;
    font-size: 0.9375rem;
    line-height: 1.45;
}

.support-context__customer-label {
    color: var(--text-muted, #64748b);
    font-weight: 500;
}

.support-context__customer-hint {
    margin: 0.35rem 0 0;
    font-size: 0.875rem;
    color: var(--text-muted, #64748b);
    line-height: 1.45;
}

.support-context__title {
    margin: 0 0 0.75rem;
    font-size: 0.9375rem;
}

.support-context__list {
    margin: 0;
    display: grid;
    gap: 0.65rem;
}

.support-context__list dt {
    margin: 0;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted, #64748b);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.support-context__list dd {
    margin: 0.15rem 0 0;
    font-size: 0.875rem;
}

.support-context__url,
.support-context__params code {
    font-size: 0.8125rem;
    word-break: break-all;
}

.support-context__params {
    margin: 0;
    padding-left: 1rem;
}

.form-stack .field {
    margin-bottom: 1rem;
}

.form-stack textarea,
.form-stack input[type="text"],
.form-stack select {
    width: 100%;
    max-width: 40rem;
}

.badge--open { background: #dbeafe; color: #1e40af; }
.badge--in_progress { background: #fef3c7; color: #92400e; }
.badge--waiting_for_customer { background: #ffedd5; color: #c2410c; }
.badge--resolved { background: #dcfce7; color: #166534; }
.badge--closed { background: #f1f5f9; color: #475569; }
.badge--draft { background: #e2e8f0; color: #334155; }
.badge--sent { background: #dbeafe; color: #1e40af; }
.badge--paid { background: #dcfce7; color: #166534; }

body.app-body {
    background: var(--bg-app);
}

body.app-body .shell {
    max-width: none;
    width: 100%;
    padding: 0;
    gap: 0;
    min-height: 100dvh;
}

body.app-body .shell > .topnav,
.shell > .topnav {
    position: sticky;
    top: 0;
    z-index: 800;
    background: var(--chrome-bar-bg);
    color: var(--chrome-bar-text);
    border-bottom: 1px solid var(--chrome-bar-border);
    box-shadow: var(--chrome-bar-shadow);
    padding: 0.65rem clamp(0.75rem, 2.5vw, 1.5rem);
    margin: 0;
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
}

.shell > .topnav .btn--ghost,
body.app-body .shell > .topnav .btn--ghost {
    color: var(--chrome-bar-text);
    border-color: var(--chrome-bar-btn-border);
}

.shell > .topnav .btn--ghost:hover,
body.app-body .shell > .topnav .btn--ghost:hover {
    background: var(--chrome-bar-hover-bg);
    color: var(--chrome-bar-text);
}

.shell > .topnav .topnav__user,
body.app-body .shell > .topnav .topnav__user {
    color: var(--chrome-bar-text-muted);
}

.shell > .topnav .lang-switch--icon,
body.app-body .shell > .topnav .lang-switch--icon {
    border-color: var(--chrome-bar-btn-border);
    background: transparent;
}

.shell > .topnav .lang-switch--icon:hover,
.shell > .topnav .lang-switch--icon:focus-within,
body.app-body .shell > .topnav .lang-switch--icon:hover,
body.app-body .shell > .topnav .lang-switch--icon:focus-within {
    background: var(--chrome-bar-hover-bg);
}

.shell > .topnav .lang-switch__icon-wrap,
body.app-body .shell > .topnav .lang-switch__icon-wrap {
    color: var(--chrome-bar-text);
}

body.app-body .shell > .page,
body.app-body .shell > section.page,
body.app-body .shell > .crm-section,
body.app-body .shell > section.crm-section {
    padding-left: clamp(1rem, 2.5vw, 1.5rem);
    padding-right: clamp(1rem, 2.5vw, 1.5rem);
}

body.app-body .shell > nav.crm-tabs {
    padding-left: clamp(1rem, 2.5vw, 1.5rem);
    padding-right: clamp(1rem, 2.5vw, 1.5rem);
    margin-top: 0;
    background: var(--header-bg);
    border-bottom: 1px solid var(--border-color);
}

body.app-body .shell > .page,
body.app-body .shell > section.page {
    padding-top: 1.5rem;
    padding-bottom: 2rem;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

body.app-body .shell > .crm-section,
body.app-body .shell > section.crm-section {
    padding-top: 0;
    padding-bottom: 2rem;
    max-width: none;
    margin: 0;
    width: 100%;
}

body.app-body .legal {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1rem clamp(1rem, 2.5vw, 1.5rem) 1.25rem;
    width: 100%;
}

a {
    color: var(--link);
    text-decoration: none;
}
a:hover,
a:focus-visible {
    text-decoration: underline;
    outline: none;
    color: var(--link-hover);
}

/* -------------------------------------------------------------------------
 * Layout-Container
 * ------------------------------------------------------------------------- */

.shell {
    max-width: 1040px;
    margin: 0 auto;
    padding: 28px 24px 48px;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    gap: 56px;
}

/* -------------------------------------------------------------------------
 * Top-Nav (Landing)
 * ------------------------------------------------------------------------- */

.topnav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: nowrap;
}

.topnav .brand.brand--logo {
    flex: 0 0 auto;
    min-width: 0;
    max-width: min(58vw, 220px);
}

.topnav .brand__logo--nav {
    display: block;
    width: auto;
    height: 36px;
    max-width: 100%;
    object-fit: contain;
    object-position: left center;
}

.topnav .brand__logo--horizontal {
    height: 36px;
    max-width: min(58vw, 220px);
}

.topnav__actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: nowrap;
    flex: 1 1 auto;
    justify-content: flex-end;
    min-width: 0;
}

/* CMS-Hauptmenü in Marketing-Topnav (inkl. Zielgruppen-Dropdown) */
.topnav__actions .cms-nav--root {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 4px;
    list-style: none;
    margin: 0;
    padding: 0;
    min-width: 0;
}

.topnav__actions .cms-nav__item {
    position: relative;
    list-style: none;
}

.topnav__actions .cms-nav__link {
    display: inline-flex;
    align-items: center;
    padding: 11px 14px;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    text-decoration: none;
    border: 1px solid transparent;
}

.topnav__actions .cms-nav__link:hover,
.topnav__actions .cms-nav__link.is-active {
    background: var(--bg-surface-3);
    border-color: var(--border-color);
    color: var(--text-heading);
    text-decoration: none;
}

.topnav__actions .cms-nav--sub {
    display: none;
    position: absolute;
    /* top: 100% + invisible ::before bridge — avoids hover gap that closes the menu */
    top: 100%;
    left: 0;
    min-width: 15rem;
    margin: 0;
    padding: 6px;
    list-style: none;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: var(--card-shadow-hover);
    z-index: 30;
}

.topnav__actions .cms-nav--sub::before {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    top: -10px;
    height: 10px;
}

.topnav__actions .cms-nav__item:hover > .cms-nav--sub,
.topnav__actions .cms-nav__item:focus-within > .cms-nav--sub {
    display: block;
}

.topnav__actions .cms-nav--sub .cms-nav__link {
    display: block;
    width: 100%;
    padding: 10px 12px;
    white-space: nowrap;
}

/* -------------------------------------------------------------------------
 * Mega-menu — Sistrix-style dropdown panels for top-nav items where
 * render_mode='mega'. Two-column grid of icon + title + description cards.
 * ------------------------------------------------------------------------- */

.topnav__actions .cms-nav__item--has-mega {
    position: relative;
}

.topnav__actions .cms-nav__link--mega-trigger {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.topnav__actions .cms-nav__chev {
    transition: transform 0.15s ease;
    opacity: 0.7;
}

.topnav__actions .cms-nav__item--has-mega:hover .cms-nav__chev,
.topnav__actions .cms-nav__item--has-mega:focus-within .cms-nav__chev {
    transform: rotate(180deg);
}

.topnav__actions .cms-nav__mega {
    display: none;
    position: absolute;
    /* Flush under trigger + ::before bridge — same hover-gap fix as .cms-nav--sub */
    top: 100%;
    left: 0;
    min-width: 34rem;
    background: var(--bg-surface, #fff);
    border: 1px solid var(--border-color, rgba(15, 23, 42, 0.12));
    border-radius: 12px;
    box-shadow: 0 22px 60px rgba(15, 23, 42, 0.18);
    padding: 16px;
    z-index: 1000;
}

.topnav__actions .cms-nav__mega::before {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    top: -10px;
    height: 10px;
}

.topnav__actions .cms-nav__item--has-mega:hover > .cms-nav__mega,
.topnav__actions .cms-nav__item--has-mega:focus-within > .cms-nav__mega {
    display: block;
}

.topnav__actions .cms-nav__mega-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px 16px;
}

.topnav__actions .cms-nav__mega-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 9px 11px;
    border-radius: 8px;
    text-decoration: none;
    color: inherit;
    transition: background 0.1s ease;
}

.topnav__actions .cms-nav__mega-item:hover,
.topnav__actions .cms-nav__mega-item:focus-visible {
    background: rgba(217, 119, 6, 0.08);
    outline: none;
}

.topnav__actions .cms-nav__mega-item.is-active {
    background: rgba(217, 119, 6, 0.1);
}

.topnav__actions .cms-nav__mega-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    flex-shrink: 0;
    border-radius: 8px;
    background: rgba(217, 119, 6, 0.12);
    color: var(--accent);
}

.topnav__actions .cms-nav__mega-meta {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.topnav__actions .cms-nav__mega-title {
    font-size: 14.5px;
    font-weight: 600;
    color: var(--text-heading, #0f172a);
    line-height: 1.2;
}

.topnav__actions .cms-nav__mega-desc {
    font-size: 12.5px;
    color: var(--text-secondary, #64748b);
    line-height: 1.35;
}

@media (max-width: 720px) {
    .topnav__actions .cms-nav__mega {
        position: static;
        min-width: auto;
        box-shadow: none;
        border: 0;
        padding: 4px 0 0;
    }
    .topnav__actions .cms-nav__mega-grid {
        grid-template-columns: 1fr;
    }
}

/* -------------------------------------------------------------------------
 * Brand-Mark (E-Kachel + Schriftzug)
 * Wird in Top-Nav und Auth-Header verwendet.
 * ------------------------------------------------------------------------- */

.brand {
    display: inline-flex;
    align-items: center;
    gap: 14px;
    color: var(--text-primary);
    text-decoration: none;
}
.brand:hover,
.brand:focus-visible {
    text-decoration: none;
    color: var(--text-heading);
}

.brand__mark {
    width: 44px;
    height: 44px;
    border-radius: 11px;
    background: var(--accent);
    color: var(--accent-on);
    font-size: 24px;
    font-weight: 800;
    display: grid;
    place-items: center;
    letter-spacing: -0.02em;
    flex-shrink: 0;
}

.brand__logo {
    display: block;
    width: var(--brand-logo-landing);
    height: var(--brand-logo-landing);
    object-fit: contain;
    flex-shrink: 0;
}

.brand__logo--mark {
    width: auto;
    max-width: 220px;
    height: 44px;
}

.topnav .brand__logo--mark {
    height: 44px;
    max-width: 200px;
}

.app-layout-header .brand__logo--mark {
    max-width: 280px;
    height: var(--brand-logo-app-header, 64px);
    width: auto;
}

.auth-brand .brand__logo--mark {
    max-width: 280px;
    height: 56px;
    width: auto;
}

.auth-brand .brand__logo--stack {
    width: auto;
    max-width: 168px;
    height: auto;
    max-height: 168px;
    object-fit: contain;
}

.auth-brand .brand__logo {
    width: auto;
    max-width: 168px;
    height: auto;
    max-height: 168px;
    filter: none;
}

.app-layout-header .brand__logo {
    width: auto;
    max-width: 280px;
    height: var(--brand-logo-app-header, 64px);
    object-fit: contain;
}

.brand__name {
    font-weight: 600;
    letter-spacing: 0.01em;
    color: var(--text-primary);
    font-size: 16px;
}

/* -------------------------------------------------------------------------
 * Hero (Landing)
 * ------------------------------------------------------------------------- */

.hero {
    display: flex;
    flex-direction: column;
    gap: 22px;
    flex: 1 1 auto;
}

.eyebrow {
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 12px;
    font-weight: 600;
    color: var(--accent);
}

.hero h1 {
    margin: 0;
    font-size: clamp(28px, 4.6vw, 48px);
    line-height: 1.15;
    letter-spacing: -0.015em;
    color: var(--text-heading);
    font-weight: 700;
    max-width: 22ch;
}

.lede {
    margin: 0;
    max-width: 60ch;
    font-size: 17px;
    line-height: 1.6;
    color: var(--text-secondary);
}

.hero__cta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 8px;
}

/* -------------------------------------------------------------------------
 * Buttons
 * ------------------------------------------------------------------------- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 11px 18px;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.2;
    border: 1px solid transparent;
    cursor: pointer;
    transition: background-color 120ms ease, border-color 120ms ease,
                color 120ms ease, transform 120ms ease;
    text-decoration: none;
    font-family: inherit;
}
.btn:hover { text-decoration: none; }
.btn:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}
.btn:disabled,
.btn[disabled] {
    opacity: 0.55;
    cursor: not-allowed;
}

.btn--primary {
    background: var(--accent);
    color: var(--accent-on);
    border-color: var(--accent);
}
.btn--primary:hover:not([disabled]),
.btn--primary:focus-visible:not([disabled]) {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
    /* Override global a:hover (--link-hover) so primary link-buttons stay readable. */
    color: var(--accent-on);
}

.btn--ghost {
    background: transparent;
    color: var(--text-primary);
    border-color: var(--border-color);
}
.btn--ghost:hover {
    background: var(--bg-surface-3);
    border-color: var(--border-color-strong);
    color: var(--text-heading);
}

.btn--block {
    width: 100%;
}

/* -------------------------------------------------------------------------
 * Features (Landing, OL-inspiriert)
 * ------------------------------------------------------------------------- */

.features {
    display: flex;
    flex-direction: column;
    gap: 28px;
}

.features__head {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 52ch;
}

.features__head h2,
.section-intro h2 {
    margin: 0;
    font-size: clamp(22px, 3vw, 30px);
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--text-heading);
}

.features__head p,
.section-intro p {
    margin: 0;
    color: var(--text-secondary);
    line-height: 1.6;
    font-size: 16px;
}

.features__grid {
    display: grid;
    gap: 14px;
    grid-template-columns: 1fr;
}

@media (min-width: 640px) {
    .features__grid { grid-template-columns: 1fr 1fr; }
}

.feature {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 20px 20px 18px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    box-shadow: var(--card-shadow);
}

.feature__icon {
    font-size: 1.35rem;
    line-height: 1;
}

.feature h3 {
    margin: 0;
    font-size: 17px;
    font-weight: 600;
    color: var(--text-heading);
}

.feature p {
    margin: 0;
    font-size: 15px;
    line-height: 1.55;
    color: var(--text-secondary);
}

/* -------------------------------------------------------------------------
 * Tarife (Landing, aus subscription_plans)
 * ------------------------------------------------------------------------- */

.pricing {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.pricing__grid {
    display: grid;
    gap: 16px;
    grid-template-columns: 1fr;
}

@media (min-width: 640px) {
    .pricing__grid { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 1024px) {
    .pricing__grid { grid-template-columns: repeat(4, 1fr); }
}

.plan-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 22px 20px 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    box-shadow: var(--card-shadow);
    position: relative;
}

.plan-card--featured {
    border-color: var(--accent, #2563eb);
    box-shadow: var(--card-shadow-hover);
}

.plan-card__badge {
    align-self: flex-start;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    background: #dbeafe;
    color: #1d4ed8;
}

[data-theme="dark"] .plan-card__badge {
    background: #1e3a5f;
    color: #93c5fd;
}

.plan-card__name {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-heading);
}

.plan-card__desc {
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.5;
    color: var(--text-secondary);
}

.plan-card__price {
    margin: 0;
    font-size: 0.95rem;
    color: var(--text-primary);
    line-height: 1.5;
}

.plan-card__price-sep {
    color: var(--text-muted);
    margin: 0 0.15rem;
}

.plan-card__trial {
    margin: 0;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.plan-card__features {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    font-size: 0.85rem;
}

.plan-card__features li {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    color: var(--text-secondary);
}

.plan-card__features li.is-on span:last-child {
    color: #047857;
    font-weight: 600;
}

.plan-card__features li.is-off span:last-child {
    color: var(--text-muted);
}

.plan-card__cta {
    margin-top: auto;
    align-self: stretch;
    text-align: center;
    text-decoration: none;
}

.plan-card--compact {
    padding: 16px 14px 14px;
    gap: 0.45rem;
}

.plan-card--current {
    border-color: var(--accent, #2563eb);
    box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent, #2563eb) 35%, transparent);
}

.plan-card--below {
    opacity: 0.62;
    filter: grayscale(0.4);
    background: var(--bg-surface-2);
}

.plan-card__badge--current {
    background: #dcfce7;
    color: #166534;
}

.plan-card__badge--book {
    background: #dbeafe;
    color: #1d4ed8;
}

[data-theme="dark"] .plan-card__badge--book {
    background: #1e3a8a;
    color: #93c5fd;
}

[data-theme="dark"] .plan-card__badge--current {
    background: #14532d;
    color: #86efac;
}

.plan-card__actions {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    margin-top: auto;
}

.plan-card__actions .btn {
    width: 100%;
    justify-content: center;
}

.plan-card__hint {
    margin: 0;
    font-size: 0.82rem;
    color: var(--text-muted);
    line-height: 1.4;
}

.pricing__grid--subscribe {
    grid-template-columns: 1fr;
}

/* Checkout: Schritt 1 Tarif · Schritt 2 Zahlungsmethode */
.checkout-steps {
    margin: 0 0 1rem;
}
.checkout-steps__list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1.25rem;
    list-style: none;
    margin: 0;
    padding: 0;
}
.checkout-steps__item {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.88rem;
    color: var(--text-muted, #64748b);
}
.checkout-steps__item.is-active {
    color: var(--text-heading, #0f172a);
    font-weight: 600;
}
.checkout-steps__item.is-done {
    color: var(--success, #15803d);
}
.checkout-steps__num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.35rem;
    height: 1.35rem;
    border-radius: 999px;
    border: 1px solid currentColor;
    font-size: 0.75rem;
    font-weight: 700;
    line-height: 1;
}
.checkout-steps__item.is-active .checkout-steps__num {
    background: var(--accent, #2563eb);
    border-color: var(--accent, #2563eb);
    color: #fff;
}
.checkout-payment-methods {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}
.checkout-payment-method {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
    padding: 0.85rem 1rem;
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 10px;
    cursor: pointer;
    background: var(--bg-surface, #fff);
}
.checkout-payment-method:has(input:checked) {
    border-color: var(--accent, #2563eb);
    box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent, #2563eb) 35%, transparent);
}
.checkout-payment-method--disabled,
.checkout-payment-method--soon {
    opacity: 0.72;
    cursor: not-allowed;
}
.checkout-payment-method input {
    margin-top: 0.2rem;
    flex-shrink: 0;
}
.checkout-payment-method__body {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    min-width: 0;
}
.checkout-payment-method__head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}
.checkout-payment-method__badge {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    padding: 0.15rem 0.45rem;
    border-radius: 999px;
    background: var(--bg-muted, #f1f5f9);
    color: var(--text-muted, #64748b);
}
.checkout-payment-method__desc,
.checkout-payment-method__reason {
    font-size: 0.86rem;
    line-height: 1.4;
}
.checkout-summary__title {
    margin: 0 0 0.5rem;
    font-size: 1rem;
}

@media (min-width: 560px) {
    .pricing__grid--subscribe { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 900px) {
    .pricing__grid--subscribe { grid-template-columns: repeat(3, 1fr); }
}

/* -------------------------------------------------------------------------
 * Produkt-Cards (Landing)
 * ------------------------------------------------------------------------- */

.cards {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.section-intro {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 52ch;
}

.cards__grid {
    display: grid;
    gap: 16px;
    grid-template-columns: 1fr;
}

@media (min-width: 720px) {
    .cards__grid { grid-template-columns: 1fr 1fr; }
}

.card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 22px 22px 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    transition: border-color 120ms ease, transform 120ms ease, box-shadow 120ms ease;
    position: relative;
    box-shadow: var(--card-shadow);
}

.card:hover {
    border-color: var(--border-color-strong);
    transform: translateY(-1px);
    box-shadow: var(--card-shadow-hover);
}

.card--muted,
.card--soon {
    background: var(--bg-surface-2);
}

.card h2,
.card h3 {
    margin: 0;
    font-size: 19px;
    font-weight: 600;
    color: var(--text-heading);
    letter-spacing: -0.005em;
}

/* -------------------------------------------------------------------------
 * Abschluss-CTA (Landing)
 * ------------------------------------------------------------------------- */

.landing-cta {
    text-align: center;
    padding: 32px 24px;
    border-radius: 16px;
    border: 1px solid var(--border-color);
    background: var(--bg-surface);
    box-shadow: var(--card-shadow);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
}

.landing-cta h2 {
    margin: 0;
    font-size: clamp(22px, 3vw, 28px);
    font-weight: 700;
    color: var(--text-heading);
    max-width: 28ch;
}

.landing-cta > p {
    margin: 0;
    max-width: 46ch;
    color: var(--text-secondary);
    line-height: 1.6;
    font-size: 16px;
}

.landing-cta__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
    margin-top: 4px;
}

.card p {
    margin: 0;
    color: var(--text-secondary);
    line-height: 1.55;
    font-size: 15px;
}

.card__link {
    margin-top: auto;
    align-self: flex-start;
    padding-top: 6px;
    font-weight: 600;
    font-size: 15px;
}

.card__link--muted {
    color: var(--text-muted);
    cursor: default;
}
.card__link--muted:hover {
    text-decoration: none;
}

.card__status {
    position: absolute;
    top: 16px;
    right: 16px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    padding: 4px 9px;
    border-radius: 999px;
    background: var(--badge-success-bg);
    color: var(--badge-success-text);
    border: 1px solid var(--badge-success-border);
}

.card__status--muted {
    background: var(--badge-muted-bg);
    color: var(--badge-muted-text);
    border-color: var(--badge-muted-border);
}

/* -------------------------------------------------------------------------
 * Footer
 * ------------------------------------------------------------------------- */

.legal {
    border-top: 1px solid var(--border-color);
    padding-top: 20px;
    color: var(--text-muted);
    font-size: 13px;
}

.legal p { margin: 0; }
.legal a { color: var(--text-secondary); }
.legal a:hover { color: var(--link); }

/* Footer-Zeile mit umbruchsicheren Trennern.
   Verhindert horizontales Ueberlaufen auf Mobile,
   weil zuvor &nbsp;·&nbsp; zwischen den Links keinen Umbruch zuliess. */
.legal__row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem 0.6rem;
}

.legal--auth .legal__row {
    justify-content: center;
}

.legal__sep {
    color: var(--text-muted);
    opacity: 0.7;
    user-select: none;
}

/* -------------------------------------------------------------------------
 * Auth-Shell (Login-Page)
 * ------------------------------------------------------------------------- */

.auth-body {
    background: var(--bg-app);
}

.auth-shell {
    max-width: 440px;
    margin: 0 auto;
    padding: 40px 20px 32px;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    gap: 24px;
    align-items: stretch;
}

/* Logo + Formular = eine weiße Karte (kein weißer Kasten auf grau) */
.auth-brand {
    display: flex;
    justify-content: center;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-bottom: none;
    border-radius: 16px 16px 0 0;
    padding: 32px 28px 16px;
    box-sizing: border-box;
}

.auth-brand + .auth-card {
    margin-top: 0;
    border-top: none;
    border-radius: 0 0 16px 16px;
    padding-top: 20px;
    box-shadow: 0 8px 28px rgba(15, 23, 42, 0.08);
}

.auth-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 32px 28px 28px;
    display: flex;
    flex-direction: column;
    gap: 18px;
    box-sizing: border-box;
}

.auth-body .legal--auth {
    text-align: center;
}

.auth-card h1 {
    margin: 0;
    font-size: 26px;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--text-heading);
}

.auth-card__lead {
    margin: 0;
    color: var(--text-secondary);
    font-size: 15px;
    line-height: 1.5;
}

.auth-notice {
    background: var(--bg-surface-2);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 12px 14px;
    border-radius: 10px;
    font-size: 13.5px;
    line-height: 1.5;
}
.auth-notice a { color: var(--link); text-decoration: underline; }

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.field--row {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.field label {
    font-size: 13.5px;
    font-weight: 600;
    color: var(--text-secondary);
    letter-spacing: 0.01em;
}

.field input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="submit"]):not([type="button"]),
.field textarea {
    appearance: none;
    width: 100%;
    background: var(--bg-input);
    border: 1px solid var(--border-color-strong);
    color: var(--text-primary);
    padding: 11px 13px;
    border-radius: 10px;
    font-size: 15px;
    font-family: inherit;
    transition: border-color 120ms ease, box-shadow 120ms ease;
    box-sizing: border-box;
}

.field textarea {
    min-height: 6rem;
    resize: vertical;
    line-height: 1.5;
}

.field input[type="number"] {
    -moz-appearance: textfield;
}

.field input:focus-visible,
.field textarea:focus-visible {
    outline: none;
    border-color: var(--accent);
    box-shadow: var(--shadow-focus);
}

/* -------------------------------------------------------------------------
 * .form-row — gruppiert mehrere .field nebeneinander mit auto-wrap.
 * Verwendet z. B. im Billing-SMTP-/IMAP-Formular für Host/Port/Verschlüsselung.
 * ------------------------------------------------------------------------- */
.form-stack .form-row {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1rem;
}
.form-stack .form-row .field {
    flex: 1 1 12rem;
    min-width: 0;
    margin-bottom: 0;
}
.form-stack .form-row .field--narrow { flex: 0 1 7rem; }
.form-stack .form-row .field--md     { flex: 0 1 13rem; }
.form-stack .form-row .field--grow   { flex: 2 1 18rem; }

/* Innerhalb von .form-row: Inputs auf 100% des Eltern-.field, kein 40rem-Cap */
.form-stack .form-row .field input[type="email"],
.form-stack .form-row .field input[type="password"],
.form-stack .form-row .field input[type="number"],
.form-stack .form-row .field input[type="text"],
.form-stack .form-row .field input[type="date"],
.form-stack .form-row .field input[type="time"],
.form-stack .form-row .field input[type="datetime-local"],
.form-stack .form-row .field select {
    max-width: none;
    width: 100%;
}

.checkbox {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13.5px;
    color: var(--text-secondary);
    cursor: pointer;
    user-select: none;
}
.checkbox input[type="checkbox"] {
    accent-color: var(--accent);
    width: 16px;
    height: 16px;
}

.auth-form__forgot {
    font-size: 13.5px;
    font-weight: 500;
    color: var(--text-secondary);
}
.auth-form__forgot:hover { color: var(--link); }

.form-actions {
    margin-top: 6px;
}

.auth-switch {
    margin: 0;
    text-align: center;
    color: #aab8cc;
    font-size: 14px;
}

.legal--auth {
    border-top: 0;
    padding-top: 0;
    text-align: center;
}

/* -------------------------------------------------------------------------
 * Selects + select-Inputs (Auth-Form & App)
 * ------------------------------------------------------------------------- */

.field__label-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
}

.field__label-link {
    font-size: 12px;
    font-weight: 500;
    color: var(--link);
    text-decoration: none;
    white-space: nowrap;
}

.field__label-link:hover {
    text-decoration: underline;
}

.field select {
    appearance: none;
    width: 100%;
    background-color: var(--bg-input);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' viewBox='0 0 16 16'%3E%3Cpath stroke='%2364748b' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M4 6l4 4 4-4'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.85rem center;
    background-size: 1rem 1rem;
    border: 1px solid var(--border-color-strong);
    color: var(--text-primary);
    padding: 11px 2.5rem 11px 13px;
    border-radius: 10px;
    font-size: 15px;
    font-family: inherit;
    cursor: pointer;
    transition: border-color 120ms ease, box-shadow 120ms ease;
}

/* Native Dropdown-Pfeil — Admin-Formulare (Windows/Chrome-kompatibel) */
.field select.field__select,
.customer-create-form select {
    appearance: auto;
    -webkit-appearance: menulist;
    background-image: none;
    padding: 10px 12px;
    min-height: 44px;
}

.field__hint {
    margin: 0.35rem 0 0;
    font-size: 0.875rem;
    color: var(--text-muted);
    line-height: 1.45;
    max-width: 42rem;
}

.field__error {
    margin: 0.35rem 0 0;
    font-size: 0.875rem;
    color: var(--alert-error-text);
    line-height: 1.45;
    max-width: 42rem;
}

.field input.is-invalid {
    border-color: var(--alert-error-border);
}

.customer-create-form {
    margin-top: 0.5rem;
}

.customer-create-form__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
    gap: 1rem 1.25rem;
    align-items: start;
}

.customer-create-form .form-actions {
    margin-top: 1.25rem;
    padding-top: 0.25rem;
}
.field select:focus-visible {
    outline: none;
    border-color: var(--accent);
    box-shadow: var(--shadow-focus);
}

/* -------------------------------------------------------------------------
 * Top-Nav (eingeloggt) — User-Anzeige + Sprach-Switcher
 * ------------------------------------------------------------------------- */

.topnav__user {
    color: var(--text-secondary);
    font-size: 14px;
    padding: 0 6px;
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.lang-switch select {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 8px 10px;
    border-radius: 8px;
    font-size: 13.5px;
    font-family: inherit;
    cursor: pointer;
}
.lang-switch select:hover { border-color: var(--border-color-strong); }
.lang-switch select:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* Globus-Icon-Switcher (Marketing-Topnav + Auth); App-Sidebar ueberschreibt in sidebar.css */
.lang-switch--icon {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background: var(--bg-surface);
    padding: 0;
    flex-shrink: 0;
    -webkit-tap-highlight-color: transparent;
}

.lang-switch--icon:hover,
.lang-switch--icon:focus-within {
    border-color: var(--border-color-strong);
    background: var(--bg-surface-3);
}

.lang-switch--icon .lang-switch__icon-wrap {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    line-height: 0;
    pointer-events: none;
}

.lang-switch--icon .lang-switch__globe {
    width: 1.15rem;
    height: 1.15rem;
}

.lang-switch--icon select {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    border: none;
    background: transparent;
    color: transparent;
    font-size: 16px;
    line-height: 1;
    opacity: 0;
    cursor: pointer;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.lang-switch--icon select option {
    color: var(--text-primary);
    background: var(--bg-surface);
}

/* -------------------------------------------------------------------------
 * Page-Layout (App + Admin)
 * ------------------------------------------------------------------------- */

.page {
    display: flex;
    flex-direction: column;
    gap: 24px;
    flex: 1 1 auto;
}

.page__head h1 {
    margin: 0;
    font-size: clamp(24px, 3.4vw, 34px);
    line-height: 1.2;
    color: var(--text-heading);
    font-weight: 700;
    letter-spacing: -0.01em;
}

.page__head p {
    margin: 6px 0 0;
}

.page__lead {
    color: var(--text-secondary);
    font-size: 15.5px;
    line-height: 1.55;
    max-width: 70ch;
}

.muted { color: var(--text-muted); }

.card h3 {
    margin: 22px 0 8px;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-heading);
}

/* -------------------------------------------------------------------------
 * Alerts (Page-Level)
 * ------------------------------------------------------------------------- */

.alert {
    border-radius: 10px;
    padding: 12px 14px;
    font-size: 14px;
    line-height: 1.5;
    border: 1px solid transparent;
}

.alert--error {
    background: var(--alert-error-bg);
    border-color: var(--alert-error-border);
    color: var(--alert-error-text);
}

.alert--success {
    background: var(--alert-success-bg);
    border-color: var(--alert-success-border);
    color: var(--alert-success-text);
}

.alert--info {
    background: rgba(125, 156, 255, 0.10);
    border-color: rgba(125, 156, 255, 0.35);
    color: var(--text-primary);
}

/* -------------------------------------------------------------------------
 * Inline-Form (mehrere Felder nebeneinander)
 * ------------------------------------------------------------------------- */

.form-inline {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 12px;
    margin-top: 8px;
}

.form-inline .field { flex: 1 1 220px; min-width: 0; }
.form-inline .form-actions { margin-top: 0; }

/* -------------------------------------------------------------------------
 * Daten-Tabelle (Admin-Listen)
 * ------------------------------------------------------------------------- */

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    margin-top: 8px;
}

.data-table th,
.data-table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border-color);
    text-align: left;
    vertical-align: middle;
}

.data-table th {
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 12.5px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    background: var(--bg-surface-2);
}

.data-table tbody tr:hover { background: var(--crm-row-hover); }

.data-table__actions { text-align: right; white-space: nowrap; }
.data-table__amount { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.data-table__total-row td { border-top: 2px solid var(--border-color); background: var(--bg-muted, rgba(0,0,0,.03)); }
.data-table__preview {
    font-size: 0.85rem;
    max-width: 420px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Horizontaler Scroll-Wrapper fuer breite Tabellen auf Mobile */
.data-table-scroll {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* Karten-Layout fuer .data-table--stack auf Mobile: jede Zeile = eine Karte,
   TH-Beschriftung ueber data-label. */
@media (max-width: 640px) {
    .data-table-scroll {
        overflow-x: visible;
        margin: 0;
    }

    .data-table--stack {
        display: block;
        width: 100%;
        border-collapse: separate;
    }

    .data-table--stack thead {
        display: none;
    }

    .data-table--stack tbody,
    .data-table--stack tr {
        display: block;
        width: 100%;
    }

    .data-table--stack tr {
        border: 1px solid var(--border-color);
        border-radius: 10px;
        padding: 0.35rem 0.6rem;
        margin: 0 0 0.6rem;
        background: var(--bg-surface);
    }

    .data-table--stack tbody tr:hover {
        background: var(--bg-surface);
    }

    .data-table--stack td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 0.75rem;
        padding: 0.4rem 0;
        border-bottom: 1px dashed var(--border-color);
        text-align: right;
    }

    .data-table--stack td:last-child {
        border-bottom: none;
    }

    .data-table--stack td::before {
        content: attr(data-label);
        font-weight: 600;
        color: var(--text-secondary);
        font-size: 0.8rem;
        text-align: left;
        flex: 0 0 auto;
        margin-right: auto;
        text-transform: uppercase;
        letter-spacing: 0.04em;
    }

    .data-table--stack td[data-label=""]::before,
    .data-table--stack td:not([data-label])::before {
        display: none;
    }

    /* Vorschau-Text darf umbrechen statt truncaten in Karten */
    .data-table--stack .data-table__preview {
        max-width: none;
        white-space: normal;
        text-overflow: clip;
        overflow: visible;
        text-align: right;
    }

    /* Aktionen-Zeile: keine data-label-Beschriftung, Buttons rechts umbruchsicher */
    .data-table--stack .data-table__actions {
        justify-content: flex-end;
        flex-wrap: wrap;
        gap: 0.35rem;
        padding-top: 0.55rem;
    }

    .data-table--stack .data-table__actions::before {
        display: none;
    }

    .data-table--stack .data-table__actions .btn {
        min-height: 36px;
    }
}

.invoice-list-payment-col { width: 3rem; text-align: center; }
@media (max-width: 640px) {
    .data-table--stack td.invoice-list-payment-col {
        width: auto;
        text-align: right;
    }
}
.invoice-due--overdue { color: var(--danger, #c0392b); font-weight: 600; }
.invoice-payment-form { display: inline; margin: 0; }
.invoice-payment-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.75rem;
    height: 1.75rem;
    padding: 0;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    cursor: default;
}
.invoice-payment-toggle--open {
    cursor: pointer;
    border-radius: 0.25rem;
}
.invoice-payment-toggle--open:hover {
    color: var(--accent, #2563eb);
    background: var(--bg-surface-2);
}
.invoice-payment-toggle--paid { color: var(--success, #16a34a); }
.invoice-payment-toggle__svg { width: 1rem; height: 1rem; display: block; }

.invoice-list-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.75rem;
    align-items: center;
}
.invoice-list-filters__automation {
    margin-left: 0.15rem;
    color: var(--text-secondary, #64748b);
    font-weight: 500;
}
.invoice-list-filters__automation.is-open {
    color: var(--text, #0f172a);
    background: var(--bg-surface-2, #f1f5f9);
}
.invoice-list-filters__automation-dot {
    display: inline-block;
    width: 0.45rem;
    height: 0.45rem;
    margin-left: 0.35rem;
    border-radius: 50%;
    background: var(--color-success, #16a34a);
    vertical-align: middle;
}
.badge--muted {
    background: var(--bg-surface-2, #e2e8f0);
    color: var(--text-secondary, #475569);
    font-weight: 600;
}
.invoice-dunning-automation {
    margin-top: 0.55rem;
    padding: 0.75rem 0.85rem;
    border: 1px solid var(--border, #e2e8f0);
    border-radius: 0.5rem;
    background: var(--bg-surface, #fff);
}
.invoice-dunning-automation__lead {
    margin: 0;
    font-size: 0.9rem;
}
.invoice-dunning-automation__note {
    margin: 0.35rem 0 0;
    font-size: 0.85rem;
    color: var(--text-secondary, #64748b);
}
.invoice-dunning-automation__note--ok {
    color: var(--color-success, #15803d);
    font-weight: 600;
}
.invoice-dunning-automation__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin-top: 0.65rem;
}
.invoice-list-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 0.65rem 1rem;
    margin-top: 0.75rem;
}
.invoice-list-toolbar__search {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem;
    flex: 1 1 16rem;
    min-width: min(100%, 12rem);
}
.invoice-list-toolbar__input {
    flex: 1 1 10rem;
    min-width: 0;
    min-height: 2.25rem;
    padding: 0.4rem 0.65rem;
    border-radius: 0.375rem;
    border: 1px solid var(--border-subtle, #d1d5db);
    background: var(--bg-surface, #fff);
    color: var(--text-primary);
    font-size: 0.9375rem;
}
.invoice-list-toolbar__year,
.invoice-list-toolbar__sort {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem;
}
.invoice-list-toolbar__label {
    font-size: 0.8125rem;
    color: var(--text-secondary);
}
.invoice-list-toolbar__select {
    min-width: 10rem;
    min-height: 2.25rem;
    padding: 0.35rem 0.5rem;
    border-radius: 0.375rem;
    border: 1px solid var(--border-subtle, #d1d5db);
    background: var(--bg-surface, #fff);
    color: var(--text-primary);
}
.invoice-list-toolbar__meta {
    margin: 0.5rem 0 0.75rem;
    font-size: 0.875rem;
}
.invoice-list-toolbar__hint {
    flex: 1 1 100%;
    margin: -0.15rem 0 0;
    font-size: 0.8125rem;
}
.invoice-list-toolbar__filter-toggle {
    align-self: flex-end;
}
.invoice-list-toolbar__advanced {
    flex: 1 1 100%;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 0.75rem;
    border: 1px solid var(--border-subtle, #d1d5db);
    border-radius: 0.5rem;
    background: var(--bg-muted, #f8fafc);
}
.invoice-list-toolbar__advanced[hidden] {
    display: none !important;
}
.invoice-list-toolbar__advanced-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr));
    gap: 0.65rem 0.85rem;
    align-items: end;
}
.invoice-list-toolbar__field {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    min-width: 0;
}
.invoice-list-toolbar__check {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    min-height: 2.25rem;
    font-size: 0.875rem;
}
.invoice-list-toolbar__advanced-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}
.invoice-due--soon {
    color: #b45309;
}
.invoice-due-soon-badge,
.invoice-dunning-badge {
    margin-left: 0.35rem;
    font-size: 0.7rem;
    vertical-align: middle;
}
.invoice-list-suggestion--radar {
    border-left: 3px solid var(--color-accent, #e87722);
}
.invoice-list-suggestion--auto-dunning {
    border-left: 3px solid var(--color-primary, #2563eb);
}
.btn--icon-remind {
    color: #b45309;
}
.btn--icon-remind:hover {
    background: #fff7ed;
}
.invoice-list-results {
    position: relative;
    transition: opacity 0.12s ease;
}
.invoice-list-results.is-loading {
    opacity: 0.55;
    pointer-events: none;
}
.invoice-list-suggestion__note {
    margin: 0.35rem 0 0;
    font-size: 0.875rem;
    color: var(--text-secondary);
}
.invoice-list-suggestion__note--ok {
    color: var(--color-success, #15803d);
    font-weight: 600;
}
.invoice-list-suggestion__hint {
    font-size: 0.875rem;
}
.invoice-reminder-form {
    margin: 0 0 0.85rem;
}
.invoice-reminder-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.65rem 1rem;
    padding: 0.65rem 0.85rem;
    border-radius: 0.5rem;
    border: 1px solid var(--border-subtle, #d1d5db);
    background: var(--bg-surface, #fff);
}
.invoice-reminder-bar__all {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.9375rem;
    cursor: pointer;
}
.invoice-reminder-bar__count {
    flex: 1 1 auto;
    font-size: 0.875rem;
}
.invoice-reminder-form__hint {
    margin: 0.45rem 0 0;
    font-size: 0.8125rem;
}
.invoice-reminder-col {
    width: 2.5rem;
    text-align: center;
    vertical-align: middle;
}
.invoice-reminder-check {
    width: 1.1rem;
    height: 1.1rem;
    cursor: pointer;
}
.invoice-reminder-multi {
    margin-left: 0.35rem;
    font-size: 0.75rem;
    vertical-align: middle;
}
@media (max-width: 640px) {
    .data-table--stack td.invoice-reminder-col {
        display: flex;
        justify-content: space-between;
        align-items: center;
    }
}
.invoice-list-sort {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.65rem;
}
.invoice-list-sort__label {
    font-size: 0.8125rem;
    color: var(--text-secondary);
}
.invoice-list-sort__select {
    min-width: 12rem;
    padding: 0.35rem 0.5rem;
    border-radius: 0.375rem;
    border: 1px solid var(--border-subtle, #d1d5db);
    background: var(--bg-surface, #fff);
    color: var(--text-primary);
}
.invoice-list-suggestion {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
    padding: 0.85rem 1rem;
    border-radius: 0.5rem;
    border: 1px solid color-mix(in srgb, var(--warning, #d97706) 35%, transparent);
    background: color-mix(in srgb, var(--warning, #d97706) 8%, var(--bg-surface, #fff));
}
.invoice-list-suggestion__text p {
    margin: 0.25rem 0 0;
    color: var(--text-secondary);
    font-size: 0.9375rem;
}
.invoice-list-suggestion__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}
.invoice-list-suggestion__form { margin: 0; }
.badge--warn {
    background: color-mix(in srgb, var(--warning, #d97706) 18%, transparent);
    color: var(--warning, #b45309);
}

.invoice-schedule-preview__overdue { color: var(--warning, #b45309); font-weight: 600; }
.invoice-schedule-preview__badge {
    display: inline-block;
    margin-left: 0.35rem;
    padding: 0.05rem 0.4rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 600;
    background: color-mix(in srgb, var(--warning, #d97706) 15%, transparent);
    color: var(--warning, #b45309);
}
.invoice-schedule-start-past-hint { color: var(--warning, #b45309); }

.meta-list {
    display: grid;
    gap: 0.65rem;
    margin: 0;
}
.meta-list > div {
    display: grid;
    grid-template-columns: minmax(8rem, 12rem) 1fr;
    gap: 0.75rem;
    align-items: baseline;
}
.meta-list dt {
    margin: 0;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-secondary);
}
.meta-list dd {
    margin: 0;
    color: var(--text-primary);
}

.data-table code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 12.5px;
    color: var(--code-text);
}

/* Kunden-Hierarchie (Superadmin: Haupt- + Unter-Mandanten) */
.customer-tree__name-cell {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    padding-left: calc(var(--customer-tree-depth, 0) * 1.25rem);
}

.customer-tree__toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.5rem;
    height: 1.5rem;
    padding: 0;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    flex-shrink: 0;
}

.customer-tree__toggle:hover {
    background: var(--bg-surface-3);
    color: var(--text-primary);
}

.customer-tree__chev {
    width: 1rem;
    height: 1rem;
    transition: transform 0.15s ease;
}

.customer-tree__toggle--collapsed .customer-tree__chev {
    transform: rotate(-90deg);
}

.customer-tree__spacer {
    display: inline-block;
    width: 1.5rem;
    flex-shrink: 0;
}

.customer-tree__label {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem 0.55rem;
    min-width: 0;
}

.customer-tree__name {
    font-weight: 500;
}

.customer-tree__row--sub .customer-tree__name {
    font-weight: 400;
}

.customer-tree__badge {
    display: inline-flex;
    align-items: center;
    padding: 0.08rem 0.45rem;
    border-radius: 999px;
    font-size: 0.62rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    background: color-mix(in srgb, var(--accent, #2563eb) 14%, transparent);
    color: var(--accent, #2563eb);
}

.customer-tree__badge--sub {
    background: var(--bg-surface-3);
    color: var(--text-muted);
}

.customer-tree__meta {
    font-size: 0.78rem;
}

.customer-tree__row--sub {
    background: color-mix(in srgb, var(--bg-surface-2) 65%, transparent);
}

.customer-tree__row--sub td:first-child {
    border-left: 2px solid color-mix(in srgb, var(--accent, #2563eb) 35%, var(--border-color));
}

/* -------------------------------------------------------------------------
 * Badges (Status)
 * ------------------------------------------------------------------------- */

.badge {
    display: inline-block;
    padding: 3px 9px;
    border-radius: 999px;
    font-size: 11.5px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    border: 1px solid transparent;
}

.badge--active     { background: var(--badge-success-bg); color: var(--badge-success-text); border-color: var(--badge-success-border); }
.badge--suspended  { background: rgba(245,158,11,0.12);  color: #d97706; border-color: rgba(245,158,11,0.32); }
.badge--archived   { background: var(--badge-muted-bg); color: var(--badge-muted-text); border-color: var(--badge-muted-border); }

/* -------------------------------------------------------------------------
 * Button-Sizes
 * ------------------------------------------------------------------------- */

.btn--sm {
    padding: 6px 12px;
    font-size: 13.5px;
    border-radius: 8px;
}

.btn--icon {
    padding: 0.2rem 0.45rem;
    font-size: 0.95rem;
    line-height: 1;
    min-width: 2rem;
    text-align: center;
}

.btn--icon .ui-action__svg {
    display: block;
    width: 1.05em;
    height: 1.05em;
    margin: 0 auto;
}

.btn--icon .ui-action__glyph {
    display: block;
    line-height: 1;
}

.crm-tag-picker__edit,
.crm-inline-edit-btn,
.calendar-filter__edit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.crm-tag-picker__edit .ui-action__svg,
.crm-inline-edit-btn .ui-action__svg,
.calendar-filter__edit .ui-action__svg,
.tab-link .ui-action__svg {
    width: 0.85em;
    height: 0.85em;
    display: block;
}

.ui-status-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    vertical-align: middle;
    line-height: 0;
}

.ui-status-icon .ui-action__svg {
    width: 1.15em;
    height: 1.15em;
}

.ui-status-icon--active {
    color: var(--success, #16a34a);
}

.ui-status-icon--inactive {
    color: var(--muted, #94a3b8);
}

.ui-status-icon--invoice-draft {
    color: #334155;
}

.ui-status-icon--invoice-sent {
    color: #1e40af;
}

.btn--icon-edit,
.btn--icon-view,
.btn--icon-submissions,
.btn--icon-images,
.btn--icon-duplicate,
.btn--icon-deactivate,
.btn--icon-activate,
.btn--icon-delete,
.btn--icon-trash,
.btn--icon-restore,
.btn--icon-retry,
.btn--icon-cancel,
.btn--icon-apply,
.btn--icon-default {
    font-family: inherit;
    letter-spacing: 0;
}

.btn--icon-deactivate:hover,
.btn--icon-deactivate:focus-visible,
.btn--icon-cancel:hover,
.btn--icon-cancel:focus-visible,
.btn--icon-delete:hover,
.btn--icon-delete:focus-visible,
.btn--icon-trash:hover,
.btn--icon-trash:focus-visible {
    color: var(--danger, #dc2626);
    border-color: rgba(220, 38, 38, 0.35);
}

.btn--icon-activate:hover,
.btn--icon-activate:focus-visible,
.btn--icon-restore:hover,
.btn--icon-restore:focus-visible {
    color: var(--success, #16a34a);
    border-color: rgba(22, 163, 74, 0.35);
}

.btn--icon-retry:hover,
.btn--icon-retry:focus-visible {
    color: var(--accent, #0969da);
    border-color: rgba(9, 105, 218, 0.35);
}

.btn--icon-default:hover,
.btn--icon-default:focus-visible {
    color: var(--warning, #d97706);
    border-color: rgba(217, 119, 6, 0.35);
}

.btn--icon-submissions:hover,
.btn--icon-submissions:focus-visible {
    color: #0f766e;
    border-color: rgba(15, 118, 110, 0.35);
}

.btn--icon-images:hover,
.btn--icon-images:focus-visible {
    color: var(--accent, #0969da);
    border-color: rgba(9, 105, 218, 0.35);
}

.data-table__actions form.admin-inline-form,
.admin-actions-cell form.admin-inline-form {
    display: inline;
    margin: 0;
    vertical-align: middle;
}

/* -------------------------------------------------------------------------
 * Customer-Picker-Liste (select_customer.php)
 * ------------------------------------------------------------------------- */

.customer-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.customer-list__row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background: var(--bg-surface-2);
    cursor: pointer;
    transition: border-color 120ms ease;
}
.customer-list__row:hover { border-color: var(--border-color-strong); }
.customer-list__row--selected {
    border-color: var(--accent, #0969da);
    background: color-mix(in srgb, var(--accent, #0969da) 8%, var(--bg-surface-2));
}
.customer-list__row input[type="radio"] { accent-color: var(--accent); }

.customer-list__auto-hint {
    margin: 0 0 1rem;
    font-size: 0.92rem;
    text-align: center;
}

.customer-list__name {
    flex: 1 1 auto;
    color: var(--text-primary);
    font-weight: 600;
}

.customer-list__role {
    color: var(--text-secondary);
    font-size: 13px;
}

.register-lang-step__title {
    margin: 0 0 0.35rem;
    font-size: 1.35rem;
    line-height: 1.3;
}

.register-lang-step__subtitle {
    margin: 0 0 1.25rem;
    font-size: 0.95rem;
    line-height: 1.45;
}

.register-lang-list {
    margin: 0 0 1rem;
}

.register-lang-step__other-select {
    margin-bottom: 1rem;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* -------------------------------------------------------------------------
 * Session-Footer (eingeloggt) + Mandanten-Switcher
 * ------------------------------------------------------------------------- */

.session-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 900;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem 0.75rem;
    padding: 0.45rem clamp(0.75rem, 2vw, 1.25rem);
    font-size: 0.75rem;
    line-height: 1.35;
    color: var(--footer-bar-text);
    background: var(--footer-bar-bg);
    border-top: 1px solid var(--footer-bar-border);
    max-width: 100vw;
    box-sizing: border-box;
    overflow-wrap: anywhere;
}

.session-footer__meta span {
    min-width: 0;
    overflow-wrap: anywhere;
    word-break: break-word;
}

/* Admin-Footer bleibt dunkel (wie Open Lake), auch im Light Mode */
.session-footer--admin {
    background: var(--footer-bar-admin-bg);
    color: var(--footer-bar-admin-text);
    border-top-color: var(--footer-bar-admin-border);
}

.session-footer--admin .session-footer__meta strong {
    color: #cbd5e1;
}

.session-footer--admin .session-footer__theme-btn {
    background: #334155;
    border-color: #475569;
    color: #e2e8f0;
}

.session-footer--admin .session-footer__theme-btn:hover {
    background: #475569;
    color: #f8fafc;
}

.session-footer--customer .session-footer__meta strong {
    color: var(--text-secondary);
}

.session-footer__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem 0.85rem;
    align-items: center;
    min-width: 0;
}

.session-footer__meta strong {
    color: var(--text-secondary);
    font-weight: 600;
}

.session-footer__theme-btn {
    border: 1px solid var(--border-color);
    background: var(--bg-surface-2);
    color: var(--text-secondary);
    border-radius: 8px;
    font-size: 0.75rem;
    padding: 0.26rem 0.55rem;
    cursor: pointer;
    font-family: inherit;
}

.session-footer__theme-btn:hover {
    background: var(--bg-surface-3);
    color: var(--text-primary);
}

/* Mandanten-Auswahl (Header, analog user-popover) */
.customer-switcher {
    position: relative;
}

.customer-switcher__trigger {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    max-width: 15.5rem;
    padding: 0.22rem 0.55rem 0.22rem 0.22rem;
    border: 1px solid var(--border-color, rgba(148, 163, 184, 0.35));
    border-radius: 999px;
    background: transparent;
    color: inherit;
    cursor: pointer;
    font: inherit;
    text-align: left;
    transition: background-color 120ms ease, border-color 120ms ease;
}

.customer-switcher__trigger:hover,
.customer-switcher__trigger[aria-expanded="true"] {
    background: var(--bg-surface-2, rgba(148, 163, 184, 0.1));
    border-color: var(--border-color, rgba(148, 163, 184, 0.45));
}

.customer-switcher__trigger--static {
    cursor: default;
}

.customer-switcher--static .customer-switcher__trigger--static:hover {
    background: transparent;
}

.customer-switcher__avatar {
    width: 1.85rem;
    height: 1.85rem;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.72rem;
    flex-shrink: 0;
    letter-spacing: 0.02em;
}

.customer-switcher__avatar--sm {
    width: 2rem;
    height: 2rem;
    font-size: 0.75rem;
}

.customer-switcher__avatar--root {
    background: var(--accent, #2563eb);
    color: #fff;
}

.customer-switcher__avatar--sub {
    background: #0d9488;
    color: #fff;
}

.customer-switcher__meta {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1;
    line-height: 1.2;
}

.customer-switcher__name {
    font-size: 0.82rem;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.customer-switcher__role {
    font-size: 0.68rem;
    color: var(--text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.customer-switcher__chev {
    width: 0.85rem;
    height: 0.85rem;
    opacity: 0.65;
    flex-shrink: 0;
}

.customer-switcher__panel {
    position: absolute;
    right: 0;
    top: calc(100% + 0.4rem);
    min-width: 18.5rem;
    max-width: 22rem;
    background: var(--dropdown-bg, var(--card-bg, #fff));
    border: 1px solid var(--dropdown-border, rgba(148, 163, 184, 0.3));
    border-radius: 12px;
    box-shadow: var(--dropdown-shadow, 0 18px 50px rgba(15, 23, 42, 0.22));
    z-index: 9998;
    overflow: hidden;
    padding-bottom: 0.35rem;
}

.customer-switcher__panel[hidden] {
    display: none !important;
}

.customer-switcher__section-title {
    margin: 0;
    padding: 0.7rem 0.95rem 0.45rem;
    font-size: 0.68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--text-muted);
}

.customer-switcher__list {
    list-style: none;
    margin: 0;
    padding: 0.15rem 0.45rem;
}

.customer-switcher__item {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.55rem 0.55rem;
    border-radius: 8px;
    color: var(--text-primary);
    text-decoration: none;
    transition: background-color 120ms ease;
}

.customer-switcher__item:hover {
    background: var(--bg-surface-2);
    text-decoration: none;
}

.customer-switcher__item--active {
    background: color-mix(in srgb, var(--accent, #2563eb) 10%, transparent);
}

.customer-switcher__item-body {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    min-width: 0;
    flex: 1;
}

.customer-switcher__item-name {
    font-size: 0.86rem;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.customer-switcher__item-meta {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.customer-switcher__badge {
    display: inline-flex;
    align-items: center;
    padding: 0.08rem 0.4rem;
    border-radius: 999px;
    font-size: 0.62rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    background: var(--bg-surface-3);
    color: var(--text-muted);
}

.customer-switcher__item--active .customer-switcher__badge {
    background: color-mix(in srgb, var(--accent, #2563eb) 18%, transparent);
    color: var(--accent, #2563eb);
}

.customer-switcher__item-role {
    font-size: 0.72rem;
    color: var(--text-muted);
}

.customer-switcher__check {
    width: 1.1rem;
    height: 1.1rem;
    flex-shrink: 0;
    color: var(--accent, #2563eb);
}

.customer-switcher__divider {
    margin: 0.35rem 0.75rem 0.25rem;
    border: none;
    border-top: 1px solid var(--border-color);
}

.customer-switcher__manage {
    display: block;
    margin: 0 0.45rem;
    padding: 0.5rem 0.55rem;
    border-radius: 8px;
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--link);
    text-decoration: none;
}

.customer-switcher__manage:hover {
    background: var(--bg-surface-2);
    text-decoration: none;
}

.admin-platform-section {
    margin-bottom: 1.25rem;
}

.admin-platform-section__head h2 {
    margin: 0 0 0.35rem;
    font-size: 1.05rem;
}

.admin-platform-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr));
    gap: 0.75rem;
    margin-top: 1rem;
}

.admin-platform-tile {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 0.85rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background: var(--bg-surface);
    text-decoration: none;
    color: inherit;
    min-height: 4.5rem;
}

.admin-platform-tile:hover {
    border-color: var(--accent);
    text-decoration: none;
}

.admin-platform-tile__title {
    font-weight: 600;
    color: var(--text-primary);
}

.admin-platform-tile__hint {
    font-size: 0.8125rem;
    color: var(--text-muted);
    line-height: 1.35;
}

.session-footer__link {
    color: var(--accent);
    font-weight: 600;
    text-decoration: none;
}

.session-footer__link:hover {
    text-decoration: underline;
}

.session-footer__link--muted {
    color: var(--text-muted);
    font-weight: 500;
}

.session-footer__aux {
    display: block;
    margin-top: 0.15rem;
    font-size: 0.75rem;
}

.registration-approve-form {
    min-width: 16rem;
    max-width: 22rem;
}

.registration-approve-form .field label {
    font-size: 0.8125rem;
    font-weight: 600;
}

.registration-approve-form select,
.registration-approve-form input[type="text"] {
    width: 100%;
}

.role-usage-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.75rem;
}

@media (max-width: 768px) {
    .role-usage-grid { grid-template-columns: 1fr; }
}

.role-usage-tile {
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 0.85rem 1rem;
    background: var(--bg-surface);
}

.role-usage-tile__label {
    display: block;
    font-weight: 600;
}

.role-usage-tile__count {
    display: block;
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1.2;
    margin: 0.25rem 0;
}

.role-matrix-wrap {
    overflow-x: auto;
}

.role-matrix__group td {
    background: var(--bg-surface-2);
    font-weight: 700;
    font-size: 0.8125rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.role-matrix__role,
.role-matrix__check {
    text-align: center;
    width: 7rem;
}

.checkbox--center {
    display: flex;
    justify-content: center;
}

/* Marketing site footer columns */
.em-footer {
    margin-top: 2.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color, #e2e8f0);
}

.em-footer__cols {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
    gap: 1.5rem 2rem;
    margin-bottom: 1.25rem;
}

.em-footer__heading {
    font-size: 0.875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin: 0 0 0.5rem;
}

.em-footer__intro {
    font-size: 0.875rem;
    color: var(--text-muted, #64748b);
    margin-bottom: 0.5rem;
    line-height: 1.5;
}

.em-footer__intro p {
    margin: 0 0 0.35rem;
}

.em-footer__list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.em-footer__list a {
    display: inline-block;
    padding: 0.2rem 0;
    font-size: 0.9rem;
    color: inherit;
    text-decoration: none;
}

.em-footer__list a:hover {
    text-decoration: underline;
}

.em-footer__bar {
    margin-top: 0.5rem;
}

.em-footer__bar--with-theme {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px 16px;
}

.em-footer__bar--with-theme p {
    margin: 0;
}

.em-footer__theme-btn {
    flex-shrink: 0;
    padding: 0.45rem 0.85rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: var(--bg-surface);
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
}

.em-footer__theme-btn:hover {
    background: var(--bg-surface-3);
    border-color: var(--border-color-strong);
    color: var(--text-heading);
}

.ol-lang-switch {
    display: inline-flex;
    align-items: center;
}

.ol-lang-switch select {
    font-size: 0.875rem;
    padding: 0.35rem 0.5rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: var(--bg-surface);
    color: var(--text-secondary);
    font-family: inherit;
    cursor: pointer;
}

.ol-lang-switch--header select {
    max-width: 9rem;
}

.topnav__tools {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    margin-left: 0.15rem;
}

.ol-lang-switch--icon {
    gap: 0.15rem;
    padding: 0.2rem 0.35rem 0.2rem 0.25rem;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background: var(--bg-surface);
}

.ol-lang-switch--icon:hover {
    border-color: var(--border-color-strong);
    background: var(--bg-surface-3);
}

.ol-lang-switch__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    line-height: 0;
}

.ol-lang-switch__icon .ui-action__svg {
    width: 1.05rem;
    height: 1.05rem;
}

.ol-lang-switch--icon select {
    border: none;
    background: transparent;
    padding: 0.15rem 1.35rem 0.15rem 0.1rem;
    max-width: 6.5rem;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-primary);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' viewBox='0 0 16 16'%3E%3Cpath stroke='%2364748b' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M4 6l4 4 4-4'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.1rem center;
    background-size: 0.85rem;
    appearance: none;
}

.ol-lang-switch--icon select:hover,
.ol-lang-switch--icon select:focus-visible {
    outline: none;
    color: var(--text-heading);
}

.topnav__bar-end {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    flex: 0 0 auto;
    margin-left: 0.25rem;
}

.topnav__login {
    white-space: nowrap;
    min-height: 40px;
    padding-inline: 0.9rem;
    font-weight: 600;
}

.topnav__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem 0.5rem;
}

/* -------------------------------------------------------------------------
 * Marketing-Topnav: Mobile Hamburger + Dropdown unter der Topbar
 * ------------------------------------------------------------------------- */

.topnav__hamburger {
    display: none;
    position: relative;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--text-primary);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.topnav__hamburger:hover,
.topnav__hamburger:focus-visible {
    background: var(--bg-surface-3);
    outline: none;
}

.topnav__hamburger .ui-action__svg {
    width: 1.35rem;
    height: 1.35rem;
}

.topnav__hamburger-icon--close {
    display: none;
}

.topnav__hamburger[aria-expanded="true"] .topnav__hamburger-icon--open {
    display: none;
}

.topnav__hamburger[aria-expanded="true"] .topnav__hamburger-icon--close {
    display: inline-flex;
}

.topnav__scrim {
    display: none;
}

@media (max-width: 860px) {
    .topnav {
        /* sticky bleibt von .shell > .topnav — nur Layout hier */
        gap: 0.35rem;
        width: 100%;
        max-width: 100%;
        min-width: 0;
        box-sizing: border-box;
    }

    .topnav .brand.brand--logo {
        flex: 1 1 auto;
        min-width: 0;
        max-width: calc(100% - 7.5rem);
    }

    .topnav .brand__logo--nav,
    .topnav .brand__logo--horizontal {
        height: 30px;
        max-width: 100%;
        width: auto;
    }

    .topnav__bar-end {
        margin-left: auto;
        flex: 0 0 auto;
        gap: 0.25rem;
        z-index: 3;
        max-width: 100%;
    }

    .topnav__hamburger {
        display: inline-flex;
        flex: 0 0 auto;
        width: 42px;
        height: 42px;
    }

    .topnav__login {
        min-height: 40px;
        padding-inline: 0.75rem;
        font-size: 0.875rem;
        flex: 0 0 auto;
    }

    /* Panel unter der Topbar — kein Vollbild-Drawer */
    .topnav__actions {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        width: 100%;
        max-width: 100%;
        margin: 0;
        padding: 0.5rem 0.85rem 1rem;
        background: var(--bg-surface, #fff);
        border-bottom: 1px solid var(--border-color);
        box-shadow: 0 16px 32px rgba(15, 23, 42, 0.12);
        flex-direction: column;
        align-items: stretch;
        flex-wrap: nowrap;
        justify-content: flex-start;
        gap: 0.15rem;
        max-height: min(70vh, 28rem);
        overflow-y: auto;
        overflow-x: hidden;
        overscroll-behavior: contain;
        z-index: 2;
        display: none;
    }

    body.topnav-is-open .topnav__actions {
        display: flex;
    }

    .topnav__scrim {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 1;
        background: transparent;
        border: 0;
        padding: 0;
        margin: 0;
        cursor: pointer;
    }

    .topnav__scrim[hidden] {
        display: none !important;
    }

    body.marketing-page,
    .shell,
    .home-shell {
        overflow-x: clip;
        max-width: 100vw;
    }

    .topnav__actions .cms-nav--root {
        flex-direction: column;
        align-items: stretch;
        gap: 0.1rem;
        width: 100%;
    }

    .topnav__actions .cms-nav__item {
        width: 100%;
    }

    .topnav__actions .cms-nav__link {
        width: 100%;
        justify-content: space-between;
        padding: 0.85rem 0.7rem;
        font-size: 1rem;
        min-height: 44px;
        border-radius: 10px;
    }

    .topnav__actions .cms-nav__link--mega-trigger {
        width: 100%;
    }

    .topnav__actions .cms-nav__chev {
        display: inline-block;
        flex-shrink: 0;
        margin-left: 0.5rem;
        transition: transform 0.15s ease;
    }

    .topnav__actions .cms-nav__item--has-mega.is-open > .cms-nav__link--mega-trigger .cms-nav__chev {
        transform: rotate(180deg);
    }

    /* Untermenüs nur bei Akkordeon-Open */
    .topnav__actions .cms-nav--sub,
    .topnav__actions .cms-nav__mega {
        display: none;
        position: static;
        margin: 0 0 0.35rem;
        padding: 0.15rem 0 0.35rem 0.35rem;
        min-width: 0;
        max-width: none;
        border: none;
        border-left: 2px solid var(--border-color);
        border-radius: 0;
        background: transparent;
        box-shadow: none;
        opacity: 1;
        pointer-events: auto;
        transform: none;
    }

    .topnav__actions .cms-nav__item.is-open > .cms-nav--sub,
    .topnav__actions .cms-nav__item--has-mega.is-open > .cms-nav__mega {
        display: block;
    }

    .topnav__actions .cms-nav--sub .cms-nav__link {
        padding: 0.7rem 0.65rem;
        font-size: 0.95rem;
        font-weight: 500;
    }

    .topnav__actions .cms-nav__mega-grid {
        display: flex;
        flex-direction: column;
        gap: 0.15rem;
    }

    .topnav__actions .cms-nav__mega-item {
        padding: 0.65rem 0.55rem;
        border-radius: 8px;
    }

    .topnav__actions .cms-nav__mega-desc {
        display: none; /* Mobile: nur Titel, weniger Wand aus Text */
    }

    .topnav__actions .cms-nav__mega-icon {
        width: 28px;
        height: 28px;
    }

    .topnav__tools {
        margin-top: 0.5rem;
        padding-top: 0.65rem;
        border-top: 1px solid var(--border-color);
        width: 100%;
        gap: 0.4rem;
    }

    body.topnav-is-open {
        overflow: hidden;
    }
}

@media (max-width: 420px) {
    .brand__logo:not(.brand__logo--horizontal):not(.brand__logo--nav) {
        width: 56px;
        height: 56px;
    }

    .topnav .brand.brand--logo {
        max-width: calc(100% - 6.75rem);
    }

    .topnav__login {
        padding-inline: 0.6rem;
        font-size: 0.8125rem;
    }
}
