/* ==========================================================================
   Tent – Design-System
   ========================================================================== */

:root {
    --blue-50: #eef5ff;
    --blue-100: #dbe9ff;
    --blue-200: #bcd6ff;
    --blue-300: #93bcff;
    --blue-400: #6aa8ff;
    --blue-500: #3d8bfd;
    --blue-600: #2a73e8;
    --blue-700: #1f5cc4;

    --orange-50: #fff4eb;
    --orange-100: #ffe4cc;
    --orange-300: #ffb57f;
    --orange-400: #ffa05c;
    --orange-500: #ff8a3d;
    --orange-600: #f07325;

    --ink-900: #0f1b2d;
    --ink-800: #1e2a3d;
    --ink-700: #334155;
    --ink-500: #64748b;
    --ink-400: #8a98ad;
    --ink-300: #c3cedd;

    --line: #e6ecf4;
    --line-strong: #d6dfeb;
    --bg: #f4f7fb;
    --surface: #ffffff;
    --surface-2: #f8fafd;

    --success: #16a34a;
    --success-bg: #e8f8ee;
    --danger: #e5484d;
    --danger-bg: #fdecec;
    --warning: #c2680a;
    --warning-bg: #fff4e0;

    --radius-sm: 8px;
    --radius: 12px;
    --radius-lg: 18px;
    --shadow-sm: 0 1px 2px rgba(15, 40, 80, .06);
    --shadow: 0 4px 16px rgba(15, 40, 80, .07), 0 1px 3px rgba(15, 40, 80, .05);
    --shadow-lg: 0 20px 50px rgba(15, 40, 80, .16), 0 4px 12px rgba(15, 40, 80, .06);
    --ring: 0 0 0 4px rgba(61, 139, 253, .18);

    --topbar-h: 64px;
    --sidebar-w: 264px;
    --sidebar-w-collapsed: 76px;
    --ease: cubic-bezier(.2, .8, .2, 1);

    --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "Inter", Roboto, "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

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

body {
    margin: 0;
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.5;
    color: var(--ink-900);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { margin: 0; line-height: 1.25; letter-spacing: -.01em; }
p { margin: 0; }
a { color: var(--blue-600); text-decoration: none; }
a:hover { color: var(--blue-700); }
button { font: inherit; color: inherit; }
svg { flex-shrink: 0; }
[hidden] { display: none !important; }

.muted { color: var(--ink-500); }
.text-warning { color: var(--warning); }
.cell-stack small.text-warning { color: var(--warning); }
/* Rechnungslink in der Zusammenfassung */
.summary-link { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }
.summary-link svg { width: 15px; height: 15px; flex: none; }
.small { font-size: 13px; }
.sr-only {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

:focus-visible { outline: none; box-shadow: var(--ring); }

/* ---------- Loader ---------- */

.boot-loader { display: grid; place-items: center; min-height: 100dvh; }

.spinner {
    display: inline-block;
    width: 28px;
    height: 28px;
    border: 3px solid var(--blue-100);
    border-top-color: var(--blue-500);
    border-radius: 50%;
    animation: spin .8s linear infinite;
}
.spinner-sm { width: 16px; height: 16px; border-width: 2px; }

@keyframes spin { to { transform: rotate(360deg); } }

.view-loading { display: grid; place-items: center; min-height: 240px; }

/* ---------- Brand ---------- */

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 750;
    font-size: 19px;
    color: var(--ink-900);
    letter-spacing: -.02em;
}
.brand:hover { color: var(--ink-900); }
.brand svg { width: 34px; height: 34px; }
.brand-light, .brand-light:hover { color: #fff; }

/* ---------- Buttons ---------- */

.btn {
    --btn-bg: var(--surface);
    --btn-fg: var(--ink-800);
    --btn-border: var(--line-strong);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 42px;
    padding: 0 18px;
    border: 1px solid var(--btn-border);
    border-radius: 10px;
    background: var(--btn-bg);
    color: var(--btn-fg);
    font-weight: 600;
    font-size: 14.5px;
    cursor: pointer;
    white-space: nowrap;
    transition: background .15s, border-color .15s, box-shadow .15s, transform .1s, color .15s;
    position: relative;
    user-select: none;
}
.btn:hover { background: var(--surface-2); border-color: var(--ink-300); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.btn svg { width: 18px; height: 18px; }

.btn-primary {
    --btn-bg: var(--blue-500);
    --btn-fg: #fff;
    --btn-border: var(--blue-500);
    box-shadow: 0 4px 14px rgba(61, 139, 253, .28);
}
.btn-primary:hover { background: var(--blue-600); border-color: var(--blue-600); }

.btn-accent {
    --btn-bg: var(--orange-500);
    --btn-fg: #fff;
    --btn-border: var(--orange-500);
    box-shadow: 0 4px 14px rgba(255, 138, 61, .3);
}
.btn-accent:hover { background: var(--orange-600); border-color: var(--orange-600); }

.btn-ghost { --btn-bg: transparent; --btn-border: transparent; }
.btn-ghost:hover { background: var(--blue-50); border-color: transparent; color: var(--blue-700); }

.btn-danger { --btn-bg: var(--danger); --btn-fg: #fff; --btn-border: var(--danger); }
.btn-danger:hover { background: #cf3a3f; border-color: #cf3a3f; }

.btn-block { width: 100%; }
.btn-lg { height: 48px; font-size: 15.5px; }
.btn-sm { height: 34px; padding: 0 12px; font-size: 13.5px; border-radius: 8px; }
.btn-sm svg { width: 16px; height: 16px; }

.btn.is-loading { color: transparent !important; pointer-events: none; }
.btn.is-loading svg { opacity: 0; }
.btn.is-loading::after {
    content: "";
    position: absolute;
    width: 18px;
    height: 18px;
    border: 2px solid currentColor;
    border-color: rgba(255, 255, 255, .5);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin .7s linear infinite;
}
.btn:not(.btn-primary):not(.btn-accent):not(.btn-danger).is-loading::after {
    border-color: var(--blue-100);
    border-top-color: var(--blue-500);
}

.icon-btn {
    display: inline-grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--ink-500);
    cursor: pointer;
    position: relative;
    transition: background .15s, color .15s;
}
.icon-btn:hover, .icon-btn[aria-expanded="true"] { background: var(--blue-50); color: var(--blue-600); }
.icon-btn svg { width: 21px; height: 21px; }
.icon-btn.danger:hover { background: var(--danger-bg); color: var(--danger); }
.icon-btn:disabled { opacity: .5; cursor: progress; }
.row-actions { display: flex; gap: 4px; justify-content: flex-end; }
.icon-btn-sm { width: 32px; height: 32px; border-radius: 8px; }
.icon-btn-sm svg { width: 18px; height: 18px; }

.link-btn {
    border: 0;
    background: none;
    padding: 0;
    color: var(--blue-600);
    font-weight: 600;
    cursor: pointer;
}
.link-btn:hover { color: var(--blue-700); text-decoration: underline; }

/* ---------- Forms ---------- */

.form { display: grid; gap: 18px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

.field { display: grid; gap: 7px; align-content: start; }
.field label, .field-label { font-size: 13.5px; font-weight: 600; color: var(--ink-700); }
.field-hint { font-size: 12.5px; color: var(--ink-400); }
.field-error { font-size: 12.5px; color: var(--danger); min-height: 0; }
.field-error:empty { display: none; }

.input-wrap { position: relative; display: flex; align-items: center; }
.input-icon {
    position: absolute;
    left: 13px;
    color: var(--ink-400);
    display: flex;
    pointer-events: none;
}
.input-icon svg { width: 18px; height: 18px; }
.input-action {
    position: absolute;
    right: 6px;
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border: 0;
    background: none;
    color: var(--ink-400);
    border-radius: 8px;
    cursor: pointer;
}
.input-action:hover { color: var(--blue-600); background: var(--blue-50); }
.input-action svg { width: 18px; height: 18px; }

.input, .select {
    width: 100%;
    height: 44px;
    padding: 0 14px;
    border: 1px solid var(--line-strong);
    border-radius: 10px;
    background: var(--surface);
    color: var(--ink-900);
    font: inherit;
    font-size: 15px;
    transition: border-color .15s, box-shadow .15s;
}
.input-wrap .input { padding-left: 40px; }
.input-wrap .input.with-action { padding-right: 44px; }
.input-wrap .input.no-icon { padding-left: 14px; }
.input::placeholder { color: var(--ink-400); }
.input:hover, .select:hover { border-color: var(--ink-300); }
.input:focus, .select:focus { outline: none; border-color: var(--blue-400); box-shadow: var(--ring); }
.input[readonly] { background: var(--surface-2); color: var(--ink-500); }
.textarea { height: auto; min-height: 96px; padding: 11px 14px; line-height: 1.55; resize: vertical; }
.input:disabled, .select:disabled { background: var(--surface-2); color: var(--ink-500); cursor: not-allowed; }
/* Bestätigte Reservierung: Felder bleiben lesbar, sind aber gesperrt */
.form-locked .field-hint { opacity: .7; }
.field.has-error .input { border-color: var(--danger); }
.field.has-error .input:focus { box-shadow: 0 0 0 4px rgba(229, 72, 77, .15); }

.select {
    appearance: none;
    padding-right: 36px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
    cursor: pointer;
}
.select-sm { height: 34px; font-size: 13.5px; padding-left: 10px; padding-right: 30px; border-radius: 8px; background-position: right 8px center; }

.password-meter { display: flex; gap: 4px; margin-top: 2px; }
.password-meter span { flex: 1; height: 4px; border-radius: 4px; background: var(--line); transition: background .2s; }
.password-meter[data-level="1"] span:nth-child(-n+1) { background: var(--danger); }
.password-meter[data-level="2"] span:nth-child(-n+2) { background: var(--orange-500); }
.password-meter[data-level="3"] span:nth-child(-n+3) { background: var(--blue-400); }
.password-meter[data-level="4"] span { background: var(--success); }

/* ---------- Alerts ---------- */

.alert {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 13px 15px;
    border-radius: var(--radius);
    font-size: 14px;
    border: 1px solid transparent;
}
.alert svg { width: 20px; height: 20px; margin-top: 1px; }
.alert-info { background: var(--blue-50); color: var(--blue-700); border-color: var(--blue-100); }
.alert-success { background: var(--success-bg); color: #13753a; border-color: #cdeed9; }
.alert-error { background: var(--danger-bg); color: #b4262b; border-color: #f8d3d4; }
.alert-warning { background: var(--warning-bg); color: var(--warning); border-color: #fde3b5; }
.alert .alert-body { display: grid; gap: 8px; }

/* ---------- Auth ---------- */

.auth {
    display: grid;
    grid-template-columns: minmax(380px, 46%) 1fr;
    min-height: 100dvh;
}

.auth-brand {
    position: relative;
    overflow: hidden;
    padding: 48px;
    /* Blau aus dem myFestzelt-Logo, nach unten dunkler wie ein Abendhimmel */
    background:
        radial-gradient(520px 320px at 85% 8%, rgba(240, 152, 26, .22), transparent 70%),
        linear-gradient(170deg, #0b62b3 0%, #09569a 45%, #063867 100%);
    color: #fff;
    display: flex;
}
.auth-brand-inner { position: relative; z-index: 2; display: flex; flex-direction: column; gap: 28px; max-width: 460px; width: 100%; }
.auth-brand-copy { margin: auto 0; display: grid; gap: 20px; }
.auth-brand h2 { font-size: 38px; font-weight: 800; letter-spacing: -.03em; }
.auth-brand h2 em { font-style: normal; color: #f7b04a; }
.auth-brand p { font-size: 16.5px; opacity: .88; max-width: 400px; }
.auth-copy { opacity: .7; font-size: 13px; }
.auth-features { list-style: none; padding: 0; margin: 8px 0 0; display: grid; gap: 14px; }
.auth-features li { display: flex; align-items: center; gap: 12px; font-weight: 500; }
.auth-features li span {
    width: 34px; height: 34px; border-radius: 10px;
    display: grid; place-items: center;
    background: rgba(255, 255, 255, .16);
    backdrop-filter: blur(4px);
}
.auth-features svg { width: 18px; height: 18px; }


.auth-main {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 24px;
    background:
        radial-gradient(600px 300px at 100% 0%, rgba(255, 138, 61, .07), transparent 70%),
        radial-gradient(600px 400px at 0% 100%, rgba(61, 139, 253, .07), transparent 70%),
        var(--bg);
}
.auth-slot { width: 100%; max-width: 460px; }
.auth-card { width: 100%; display: grid; gap: 24px; animation: fadeUp .3s var(--ease); }
.auth-card > .brand { display: none; }
.auth-card h1 { font-size: 28px; font-weight: 800; letter-spacing: -.025em; }
.auth-card .auth-sub { margin-top: 6px; color: var(--ink-500); }
.auth-panel {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    padding: 30px;
}
.auth-switch { text-align: center; font-size: 14px; color: var(--ink-500); }
.auth-switch a { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }
.auth-switch svg { width: 16px; height: 16px; }
.auth-status h1 { font-size: 22px; }
.auth-status form { width: 100%; text-align: left; }
.auth-row { display: flex; justify-content: space-between; align-items: center; font-size: 13.5px; }
.auth-status { text-align: center; display: grid; gap: 16px; justify-items: center; }
.auth-status .status-icon {
    width: 64px; height: 64px; border-radius: 20px;
    display: grid; place-items: center;
    background: var(--blue-50); color: var(--blue-500);
}
.auth-status .status-icon.success { background: var(--success-bg); color: var(--success); }
.auth-status .status-icon.error { background: var(--danger-bg); color: var(--danger); }
.auth-status .status-icon.orange { background: var(--orange-50); color: var(--orange-500); }
.auth-status .status-icon svg { width: 30px; height: 30px; }
.invite-summary {
    display: flex; gap: 14px; align-items: center;
    padding: 14px; border-radius: var(--radius);
    background: linear-gradient(135deg, var(--blue-50), var(--orange-50));
    border: 1px solid var(--line);
}

/* ---------- App-Shell ---------- */

.shell {
    display: grid;
    grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
    grid-template-rows: var(--topbar-h) minmax(0, 1fr);
    grid-template-areas: "top top" "side main";
    height: 100dvh;
    transition: grid-template-columns .25s var(--ease);
}
.shell.sidebar-collapsed { grid-template-columns: var(--sidebar-w-collapsed) minmax(0, 1fr); }

.topbar {
    grid-area: top;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 16px 0 18px;
    background: rgba(255, 255, 255, .88);
    backdrop-filter: saturate(1.4) blur(10px);
    border-bottom: 1px solid var(--line);
    z-index: 40;
}
.topbar .brand { margin-left: 4px; }
.topbar-spacer { flex: 1; }

/* Suche in der Kopfzeile mit Ergebnis-Dropdown */
.header-search { position: relative; flex: 1; max-width: 460px; min-width: 0; margin-left: 12px; }
.header-search .search { max-width: none; min-width: 0; }
/* Auf breiten Bildschirmen genau in der Mitte der Seite; darunter im Fluss neben dem Logo */
@media (min-width: 1100px) {
    .topbar { position: relative; }
    .header-search { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: min(460px, calc(100% - 760px)); margin-left: 0; }
}
.header-search .search .input { background: var(--surface-2); }
.header-search .search .input:focus { background: var(--surface); }
.header-search-results {
    position: absolute; top: calc(100% + 8px); left: 0; right: 0; z-index: 60;
    max-height: min(70vh, 520px); overflow-y: auto; padding: 6px;
    background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-lg);
}
.search-group + .search-group { margin-top: 4px; padding-top: 4px; border-top: 1px solid var(--line); }
.search-group-head {
    display: flex; justify-content: space-between; align-items: baseline; padding: 8px 10px 4px;
    font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-400);
}
.search-group-head small { font-size: 11.5px; font-weight: 600; text-transform: none; letter-spacing: 0; }
.search-result { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: 10px; color: var(--ink-800); text-decoration: none; }
.search-result.active { background: var(--blue-50); }
.search-result-icon { width: 32px; height: 32px; flex: none; display: grid; place-items: center; border-radius: 9px; background: var(--surface-2); color: var(--ink-500); }
.search-result.active .search-result-icon { background: var(--surface); color: var(--blue-500); }
.search-result-icon svg { width: 17px; height: 17px; }
.search-result-text { display: grid; gap: 1px; min-width: 0; }
.search-result-text strong { font-size: 14px; font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search-result-text small { font-size: 12.5px; color: var(--ink-500); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search-result mark { background: #fff1b8; color: inherit; border-radius: 3px; padding: 0 1px; }
.search-more { padding: 4px 10px 8px 54px; font-size: 12.5px; color: var(--ink-400); }
.search-empty { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 22px 14px; color: var(--ink-500); font-size: 14px; }
.search-empty svg { width: 18px; height: 18px; color: var(--ink-300); }
@media (max-width: 640px) {
    .header-search { margin-left: 4px; }
    .topbar .brand { display: none; }
    .header-search-results { position: fixed; top: 64px; left: 10px; right: 10px; }
}

.badge-count {
    position: absolute;
    top: 4px;
    right: 3px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 9px;
    background: var(--orange-500);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    line-height: 18px;
    text-align: center;
    border: 2px solid #fff;
    box-sizing: content-box;
    transform: translate(25%, -15%);
}

.avatar {
    --size: 36px;
    width: var(--size);
    height: var(--size);
    border-radius: 50%;
    display: inline-grid;
    place-items: center;
    font-weight: 700;
    font-size: calc(var(--size) * .38);
    color: #fff;
    background: linear-gradient(135deg, var(--blue-400), var(--blue-600));
    flex-shrink: 0;
    letter-spacing: .02em;
}
.avatar.tone-1 { background: linear-gradient(135deg, var(--orange-400), var(--orange-600)); }
.avatar.tone-2 { background: linear-gradient(135deg, #7cc4ff, #3d8bfd); }
.avatar.tone-3 { background: linear-gradient(135deg, #ffb57f, #ff7b54); }
.avatar.tone-4 { background: linear-gradient(135deg, #6aa8ff, #7a6cff); }
.avatar.muted-avatar { background: var(--blue-50); color: var(--blue-500); }
.avatar svg { width: 45%; height: 45%; }
.avatar-lg { --size: 64px; }
.avatar-sm { --size: 30px; }

.avatar-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 4px 8px 4px 4px;
    border: 0;
    background: transparent;
    border-radius: 999px;
    cursor: pointer;
    transition: background .15s;
}
.avatar-btn:hover, .avatar-btn[aria-expanded="true"] { background: var(--blue-50); }
.avatar-meta { display: grid; text-align: left; line-height: 1.2; }
.avatar-meta strong { font-size: 14px; font-weight: 650; max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.avatar-meta small { font-size: 12px; color: var(--ink-500); max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-dropdown { width: 300px; max-height: calc(100dvh - var(--topbar-h) - 24px); overflow-y: auto; }
.menu-item.current { background: var(--blue-50); color: var(--blue-700); cursor: default; }
.avatar-btn > svg { width: 16px; height: 16px; color: var(--ink-400); }

/* ---------- Dropdown ---------- */

.dropdown { position: relative; }
.dropdown-menu {
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    min-width: 240px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 14px;
    box-shadow: var(--shadow-lg);
    padding: 6px;
    z-index: 60;
    opacity: 0;
    transform: translateY(-6px) scale(.98);
    transform-origin: top right;
    pointer-events: none;
    transition: opacity .15s, transform .15s var(--ease);
}
.dropdown.open > .dropdown-menu { opacity: 1; transform: none; pointer-events: auto; }
.dropdown-menu.align-left { left: 0; right: auto; transform-origin: top left; }

.menu-header { padding: 10px 12px 12px; display: flex; gap: 12px; align-items: center; }
.menu-header div { display: grid; min-width: 0; }
.menu-header strong { font-size: 14.5px; }
.menu-header small { color: var(--ink-500); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; }
.menu-label { padding: 8px 12px 4px; font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-400); }
.menu-divider { height: 1px; background: var(--line); margin: 6px 4px; }
.menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 9px 12px;
    border: 0;
    background: none;
    border-radius: 9px;
    color: var(--ink-700);
    font-size: 14px;
    font-weight: 500;
    text-align: left;
    cursor: pointer;
}
.menu-item:hover { background: var(--blue-50); color: var(--blue-700); }
.menu-item svg { width: 18px; height: 18px; color: var(--ink-400); }
.menu-item:hover svg { color: inherit; }
.menu-item.danger { color: var(--danger); }
.menu-item.danger svg { color: var(--danger); }
.menu-item.danger:hover { background: var(--danger-bg); }
.menu-item .check { margin-left: auto; color: var(--blue-500); }
.menu-item-text { display: grid; min-width: 0; flex: 1; }
.menu-item-text span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu-item-text small { font-size: 12px; color: var(--ink-400); }

/* ---------- Benachrichtigungen ---------- */

.notif-panel { width: 380px; padding: 0; overflow: hidden; }
.notif-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    border-bottom: 1px solid var(--line);
}
.notif-head h3 { font-size: 15px; }
.notif-list { max-height: 420px; overflow-y: auto; }
.notif-item {
    display: flex;
    gap: 12px;
    padding: 13px 16px;
    border-bottom: 1px solid var(--line);
    cursor: pointer;
    transition: background .15s;
    position: relative;
}
.notif-item:last-child { border-bottom: 0; }
.notif-item:hover { background: var(--surface-2); }
.notif-item.unread { background: linear-gradient(90deg, rgba(61, 139, 253, .06), transparent); }
.notif-item.unread::after {
    content: "";
    position: absolute;
    right: 16px;
    top: 18px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--orange-500);
}
.notif-icon {
    width: 36px; height: 36px; border-radius: 10px; flex-shrink: 0;
    display: grid; place-items: center;
    background: var(--blue-50); color: var(--blue-500);
}
.notif-icon svg { width: 18px; height: 18px; }
.notif-icon.success { background: var(--success-bg); color: var(--success); }
.notif-icon.warning { background: var(--warning-bg); color: var(--warning); }
.notif-icon.invite { background: var(--orange-50); color: var(--orange-500); }
.notif-body { display: grid; gap: 2px; padding-right: 14px; min-width: 0; }
.notif-body strong { font-size: 14px; font-weight: 650; }
.notif-body p { font-size: 13.5px; color: var(--ink-500); }
.notif-body time { font-size: 12px; color: var(--ink-400); }
.notif-empty { padding: 36px 20px; text-align: center; color: var(--ink-500); display: grid; gap: 10px; justify-items: center; }
.notif-footer {
    display: flex; align-items: center; justify-content: center; gap: 6px; padding: 12px 16px;
    border-top: 1px solid var(--line); font-size: 13.5px; font-weight: 600; color: var(--blue-600); background: var(--surface-2);
}
.notif-footer:hover { background: var(--blue-50); }
.notif-footer svg { width: 15px; height: 15px; }

/* Seite „Benachrichtigungen“: ungelesene hervorgehoben (Punkt, fett, heller Hintergrund) */
.notif-page-list { list-style: none; margin: 0; padding: 0; }
.notif-row { display: flex; gap: 14px; align-items: flex-start; padding: 16px 22px; border-bottom: 1px solid var(--line); cursor: default; }
.notif-row:last-child { border-bottom: 0; }
.notif-row.unread { background: linear-gradient(90deg, rgba(61, 139, 253, .08), transparent 70%); cursor: pointer; }
.notif-row-body { flex: 1; min-width: 0; display: grid; gap: 3px; }
.notif-row-title { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.notif-row-title strong { font-size: 14.5px; font-weight: 550; color: var(--ink-700); }
.notif-row.unread .notif-row-title strong { font-weight: 750; color: var(--ink-900); }
.notif-row-body p { font-size: 14px; color: var(--ink-500); }
.notif-row.unread .notif-row-body p { color: var(--ink-700); }
.notif-row-body time { font-size: 12.5px; color: var(--ink-400); }
.notif-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--blue-500); flex: none; }
.notif-row-actions { flex: none; align-items: center; }
.notif-page-note { margin-top: -8px; }
@media (max-width: 640px) {
    .notif-row { flex-wrap: wrap; padding: 14px 16px; }
    .notif-row-actions { width: 100%; justify-content: flex-end; }
}
.notif-empty svg { width: 30px; height: 30px; color: var(--ink-300); }

/* ---------- Sidebar ---------- */

.sidebar {
    grid-area: side;
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border-right: 1px solid var(--line);
    overflow: hidden;
    z-index: 30;
}

.company-logo {
    width: 36px; height: 36px; border-radius: 10px; flex-shrink: 0;
    display: grid; place-items: center;
    font-weight: 750; font-size: 14px; color: #fff;
    background: linear-gradient(135deg, var(--orange-400), var(--orange-600));
}
.company-logo svg { width: 18px; height: 18px; }
.company-logo.sm { width: 28px; height: 28px; font-size: 12px; border-radius: 8px; }
.company-logo.has-image {
    background: var(--surface); border: 1px solid var(--line); padding: 2px;
    /* Flexbox statt Grid: nur so löst die Prozenthöhe des Bildes gegen die feste Kachelhöhe auf */
    display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.company-logo.has-image img { max-width: 100%; max-height: 100%; object-fit: contain; }

/* Logo-Upload */
.logo-upload {
    display: flex; gap: 20px; align-items: center; flex-wrap: wrap;
    padding: 16px; border: 1.5px dashed var(--line-strong); border-radius: var(--radius);
    transition: border-color .15s, background .15s;
}
.logo-upload.dragover { border-color: var(--blue-500); background: var(--blue-50); }
.logo-upload.busy { opacity: .6; pointer-events: none; }
.logo-preview {
    width: 140px; height: 100px; flex-shrink: 0;
    /* Flexbox mit fester Höhe: eine Grid-Zeile wächst mit dem Inhalt, dann greift max-height am Bild nicht */
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
    background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px;
    color: var(--ink-400); font-size: 12.5px; padding: 8px; overflow: hidden;
}
.logo-preview svg { width: 24px; height: 24px; flex-shrink: 0; }
.logo-preview img { max-width: 100%; max-height: 100%; min-height: 0; object-fit: contain; }
.logo-actions { display: grid; gap: 8px; }
.logo-buttons { display: flex; gap: 8px; flex-wrap: wrap; }
.company-logo.sm svg { width: 15px; height: 15px; color: #fff; }
.company-logo.invite { background: var(--orange-50); }
.company-logo.invite svg { color: var(--orange-500); }

.nav { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 16px 12px 8px; display: grid; align-content: start; gap: 2px; }
.nav-section {
    padding: 16px 12px 6px;
    font-size: 11.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: var(--ink-400);
    white-space: nowrap;
}
.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    height: 42px;
    padding: 0 12px;
    border: 0;
    border-radius: 10px;
    background: none;
    color: var(--ink-700);
    font-size: 14.5px;
    font-weight: 550;
    cursor: pointer;
    white-space: nowrap;
    position: relative;
    transition: background .15s, color .15s;
}
.nav-item svg { width: 20px; height: 20px; color: var(--ink-400); transition: color .15s; }
.nav-item:hover { background: var(--blue-50); color: var(--blue-700); }
.nav-item:hover svg { color: var(--blue-500); }
.nav-item.active { background: var(--blue-50); color: var(--blue-700); font-weight: 650; }
.nav-item.active svg { color: var(--blue-500); }
.nav-item.active::before {
    content: "";
    position: absolute;
    left: -12px;
    top: 9px;
    bottom: 9px;
    width: 4px;
    border-radius: 0 4px 4px 0;
    background: linear-gradient(var(--blue-500), var(--orange-500));
}
.nav-label { overflow: hidden; text-overflow: ellipsis; flex: 1; text-align: left; transition: opacity .2s; }
.nav-chevron { width: 16px !important; height: 16px !important; transition: transform .2s; }
.nav-group.open .nav-chevron { transform: rotate(180deg); }
.nav-sub { display: grid; gap: 2px; overflow: hidden; max-height: 0; transition: max-height .25s var(--ease); }
.nav-group.open .nav-sub { max-height: 300px; }
.nav-subitem { padding-left: 44px; height: 38px; font-size: 14px; }
.nav-subitem svg { width: 18px; height: 18px; }
/* Gruppe mit aktivem Unterpunkt: nur farblich hervorgehoben, der Balken gehört zum Unterpunkt */
.nav-group-toggle.has-active { color: var(--blue-700); }
.nav-group-toggle.has-active svg { color: var(--blue-500); }

.sidebar-footer { padding: 10px 12px 14px; border-top: 1px solid var(--line); }
.collapse-btn svg { transition: transform .25s var(--ease); }

/* Eingeklappte Sidebar (nur Desktop) */
@media (min-width: 961px) {
    .sidebar-collapsed .nav-label,
    .sidebar-collapsed .nav-chevron { display: none; }
    .sidebar-collapsed .nav-section { font-size: 0; padding: 12px 0 4px; }
    .sidebar-collapsed .nav-section::after { content: ""; display: block; height: 1px; margin: 0 10px; background: var(--line); }
    .sidebar-collapsed .nav-item { justify-content: center; padding: 0; }
    .sidebar-collapsed .nav-subitem { padding: 0; }
    .sidebar-collapsed .nav-sub { max-height: 300px; }
    .sidebar-collapsed .nav-group-toggle { display: none; }
    .sidebar-collapsed .collapse-btn svg { transform: rotate(180deg); }

    .sidebar-collapsed .nav-item[data-tooltip]:hover::after {
        content: attr(data-tooltip);
        position: fixed;
        left: calc(var(--sidebar-w-collapsed) + 6px);
        padding: 6px 10px;
        border-radius: 8px;
        background: var(--ink-900);
        color: #fff;
        font-size: 13px;
        font-weight: 500;
        white-space: nowrap;
        pointer-events: none;
        z-index: 100;
    }
}

.sidebar-backdrop { display: none; }

/* ---------- Inhalt ---------- */

.content {
    grid-area: main;
    /* Bezugsrahmen für absolut positionierte Elemente (z. B. unsichtbare Beschriftungen); sonst ragen sie
       am Dokument aus dem Scrollbereich heraus und erzeugen einen zweiten Scrollbalken */
    position: relative;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 32px;
    -webkit-overflow-scrolling: touch;
}

.page { max-width: 1200px; margin: 0 auto; display: grid; gap: 24px; animation: fadeUp .3s var(--ease); }
@keyframes fadeUp { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.page-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.page-header h1 { font-size: 26px; font-weight: 800; letter-spacing: -.025em; }
.page-header p { margin-top: 4px; color: var(--ink-500); }
.breadcrumb { font-size: 13px; color: var(--ink-400); margin-bottom: 6px; display: flex; gap: 6px; align-items: center; }
.breadcrumb svg { width: 14px; height: 14px; }
.page-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}
.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 18px 22px;
    border-bottom: 1px solid var(--line);
}
.card-header h2 { font-size: 16.5px; font-weight: 700; }
.card-header p { font-size: 13.5px; color: var(--ink-500); margin-top: 2px; }
.card-body { padding: 22px; }
.card-footer { padding: 14px 22px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 10px; background: var(--surface-2); border-radius: 0 0 var(--radius-lg) var(--radius-lg); }

.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; align-items: stretch; }
.grid-2 > .card, .grid-2 > .card > form { display: flex; flex-direction: column; }
.grid-2 > .card > form, .grid-2 > .card > form > .card-body { flex: 1; align-content: start; }

/* Hero */
.hero {
    position: relative;
    overflow: hidden;
    padding: 30px 32px;
    border-radius: var(--radius-lg);
    color: #fff;
    background: linear-gradient(120deg, var(--blue-500) 0%, #5aa2ff 55%, #7db6ff 100%);
    box-shadow: 0 10px 30px rgba(61, 139, 253, .25);
}
.hero::before, .hero::after { content: ""; position: absolute; border-radius: 50%; }
.hero::before { width: 320px; height: 320px; right: -80px; top: -150px; background: radial-gradient(circle, rgba(255, 160, 92, .95), rgba(255, 138, 61, 0) 68%); }
.hero::after { width: 200px; height: 200px; right: 180px; bottom: -130px; background: radial-gradient(circle, rgba(255, 255, 255, .35), rgba(255, 255, 255, 0) 70%); }
.hero > * { position: relative; z-index: 1; }
.hero small { font-weight: 600; opacity: .85; text-transform: uppercase; letter-spacing: .08em; font-size: 12px; }
.hero h1 { font-size: 28px; font-weight: 800; margin: 6px 0 8px; letter-spacing: -.025em; }
.hero p { opacity: .92; max-width: 560px; }
.hero .hero-actions { margin-top: 20px; display: flex; gap: 10px; flex-wrap: wrap; }
.hero .btn-white { --btn-bg: #fff; --btn-fg: var(--blue-700); --btn-border: #fff; }
.hero .btn-white:hover { background: var(--blue-50); }
.hero .btn-glass { --btn-bg: rgba(255, 255, 255, .16); --btn-fg: #fff; --btn-border: rgba(255, 255, 255, .35); }
.hero .btn-glass:hover { background: rgba(255, 255, 255, .26); border-color: rgba(255, 255, 255, .5); }

/* Kennzahlen */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 18px; }
.stat-card { padding: 20px; display: flex; gap: 16px; align-items: center; }
.stat-icon {
    width: 48px; height: 48px; border-radius: 14px; flex-shrink: 0;
    display: grid; place-items: center;
    background: var(--blue-50); color: var(--blue-500);
}
.stat-icon svg { width: 22px; height: 22px; }
.stat-icon.orange { background: var(--orange-50); color: var(--orange-500); }
.stat-icon.green { background: var(--success-bg); color: var(--success); }
.stat-icon.violet { background: #f1efff; color: #6d5dfc; }
.stat-value { font-size: 26px; font-weight: 800; letter-spacing: -.02em; line-height: 1.1; }
.stat-label { font-size: 13.5px; color: var(--ink-500); }

/* Listen */
.list { display: grid; }
.list-item { display: flex; align-items: center; gap: 14px; padding: 14px 22px; border-bottom: 1px solid var(--line); }
.list-item:last-child { border-bottom: 0; }
.list-item-body { flex: 1; min-width: 0; display: grid; gap: 2px; }
.list-item-body strong { font-size: 14.5px; }
.list-item-body small { font-size: 13px; color: var(--ink-500); }
.list-item-actions { display: flex; gap: 8px; flex-shrink: 0; }

button.quick-link { width: 100%; border: 0; border-bottom: 1px solid var(--line); background: none; text-align: left; font: inherit; cursor: pointer; }
.quick-link .stat-icon { width: 40px; height: 40px; border-radius: 12px; }
.quick-link { display: flex; align-items: center; gap: 14px; padding: 14px 22px; border-bottom: 1px solid var(--line); color: var(--ink-800); transition: background .15s; }
.quick-link:last-child { border-bottom: 0; }
.quick-link:hover { background: var(--surface-2); color: var(--ink-900); }
.quick-link > svg:last-child { width: 18px; height: 18px; color: var(--ink-300); margin-left: auto; transition: transform .15s, color .15s; }
.quick-link:hover > svg:last-child { transform: translateX(3px); color: var(--blue-500); }

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 24px;
    padding: 0 10px;
    border-radius: 999px;
    font-size: 12.5px;
    font-weight: 600;
    white-space: nowrap;
    background: var(--line);
    color: var(--ink-700);
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .8; }
.badge.no-dot::before { display: none; }
.badge svg { width: 14px; height: 14px; flex-shrink: 0; }
.badge-success { background: var(--success-bg); color: #13753a; }
.badge-warning { background: var(--warning-bg); color: var(--warning); }
.badge-danger { background: var(--danger-bg); color: #b4262b; }
.badge-blue { background: var(--blue-50); color: var(--blue-700); }
.badge-orange { background: var(--orange-50); color: var(--orange-600); }

/* Toolbar */
.card-toolbar { display: flex; gap: 12px; align-items: center; justify-content: space-between; padding: 16px 22px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.search { display: block; position: relative; flex: 1; max-width: 340px; min-width: 200px; }
.search svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 17px; height: 17px; color: var(--ink-400); }
.search .input { height: 40px; padding-left: 38px; }

.segmented { display: inline-flex; padding: 4px; background: var(--bg); border-radius: 10px; gap: 2px; border: 1px solid var(--line); }
.segmented button {
    border: 0; background: none; padding: 6px 12px; border-radius: 7px;
    font-size: 13.5px; font-weight: 600; color: var(--ink-500); cursor: pointer;
    display: inline-flex; gap: 6px; align-items: center;
}
.segmented button span { font-size: 12px; color: var(--ink-400); font-weight: 600; }
.segmented button.active { background: var(--surface); color: var(--ink-900); box-shadow: var(--shadow-sm); }

/* Tabelle */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th {
    text-align: left;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--ink-400);
    padding: 12px 22px;
    background: var(--surface-2);
    border-bottom: 1px solid var(--line);
    white-space: nowrap;
}
.table td { padding: 14px 22px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background .15s; }
.table tbody tr:hover { background: var(--surface-2); }
.table .col-actions { text-align: right; width: 1%; white-space: nowrap; }
.table .col-select { width: 1%; padding-right: 0; }
.table tbody tr.row-selected, .table tbody tr.row-selected:hover { background: var(--blue-50); }
.checkbox { width: 17px; height: 17px; margin: 0; accent-color: var(--blue-500); cursor: pointer; }
.checkbox:disabled { cursor: not-allowed; opacity: .4; }

/* Leiste für die Mehrfachauswahl */
.bulk-bar {
    display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
    padding: 12px 22px; background: var(--blue-50); border-bottom: 1px solid var(--line);
}
.bulk-info { display: grid; margin-right: auto; font-size: 14px; color: var(--ink-700); }
.bulk-info small { font-size: 12.5px; color: var(--ink-500); }

.user-cell { display: flex; align-items: center; gap: 12px; min-width: 0; }
.user-cell > div { display: grid; min-width: 0; }
.user-cell strong { font-weight: 650; display: flex; align-items: center; gap: 8px; }
.user-cell small { color: var(--ink-500); font-size: 13px; overflow: hidden; text-overflow: ellipsis; }
.you-tag { font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 6px; background: var(--orange-50); color: var(--orange-600); }

.empty-state { padding: 48px 24px; text-align: center; display: grid; gap: 10px; justify-items: center; }
.empty-state .empty-icon {
    width: 64px; height: 64px; border-radius: 20px;
    display: grid; place-items: center;
    background: linear-gradient(135deg, var(--blue-50), var(--orange-50));
    color: var(--blue-500);
    margin-bottom: 6px;
}
.empty-state .empty-icon svg { width: 28px; height: 28px; }
.empty-state h3 { font-size: 17px; }
.empty-state p { color: var(--ink-500); max-width: 420px; }
.empty-state .btn { margin-top: 8px; }
/* Kompakte Variante innerhalb einer Formularseite */
.empty-state-sm { padding: 28px 24px; gap: 8px; }
.empty-state-sm .empty-icon { width: 48px; height: 48px; border-radius: 15px; margin-bottom: 2px; }
.empty-state-sm .empty-icon svg { width: 22px; height: 22px; }
.empty-state-sm h3 { font-size: 16px; }

/* Rollenauswahl */
.role-options { display: grid; gap: 10px; }
.role-option { position: relative; cursor: pointer; }
.role-option input { position: absolute; opacity: 0; pointer-events: none; }
.role-option-body {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    padding: 14px 16px;
    border: 1.5px solid var(--line-strong);
    border-radius: 12px;
    transition: border-color .15s, background .15s, box-shadow .15s;
}
.role-option-body .role-icon {
    width: 38px; height: 38px; border-radius: 10px; flex-shrink: 0;
    display: grid; place-items: center;
    background: var(--blue-50); color: var(--blue-500);
}
.role-option-body .role-icon svg { width: 19px; height: 19px; }
.role-option[data-role="admin"] .role-icon { background: var(--orange-50); color: var(--orange-500); }
.role-option-body div { display: grid; gap: 2px; }
.role-option-body strong { font-size: 14.5px; }
.role-option-body small { color: var(--ink-500); font-size: 13px; }
.role-option:hover .role-option-body { border-color: var(--blue-300); }
.role-option input:checked + .role-option-body { border-color: var(--blue-500); background: var(--blue-50); box-shadow: var(--ring); }
.role-option input:focus-visible + .role-option-body { box-shadow: var(--ring); }

/* Profil */
.profile-card { display: flex; gap: 18px; align-items: center; padding: 22px; }
.profile-card div { display: grid; gap: 2px; min-width: 0; }
.profile-card h2 { font-size: 20px; }

/* ---------- Modal ---------- */

.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 27, 45, .45);
    backdrop-filter: blur(3px);
    display: grid;
    place-items: center;
    padding: 20px;
    z-index: 200;
    opacity: 0;
    transition: opacity .2s;
}
.modal-backdrop.open { opacity: 1; }
.modal {
    width: 100%;
    max-width: 500px;
    max-height: calc(100dvh - 40px);
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border-radius: 20px;
    box-shadow: var(--shadow-lg);
    transform: translateY(12px) scale(.98);
    transition: transform .25s var(--ease);
}
.modal-backdrop.open .modal { transform: none; }
.modal-wide { max-width: 720px; }
.form-section { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-400); padding-top: 6px; margin-bottom: -6px; }
.form-section:first-child { padding-top: 0; }
.form-row-zip { grid-template-columns: 160px 1fr; }
.required { color: var(--orange-500); }

/* Kunden */
.cell-stack { display: grid; gap: 2px; font-size: 14px; }
.cell-stack small { color: var(--ink-500); font-size: 13px; }
.cell-stack a { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-700); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 260px; }
.cell-stack a:hover { color: var(--blue-600); }
.cell-stack a svg { width: 14px; height: 14px; color: var(--ink-400); }
/* Veranstaltungen */
.date-tile {
    width: 44px; height: 46px; border-radius: 10px; flex-shrink: 0;
    display: grid; place-items: center; align-content: center; gap: 0;
    background: var(--blue-50); color: var(--blue-700); line-height: 1.05;
    border: 1px solid var(--blue-100);
}
.date-tile small { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--blue-500); }
.date-tile strong { font-size: 17px; font-weight: 800; }
.date-tile.running { background: var(--success-bg); border-color: #cdeed9; color: #13753a; }
.date-tile.running small { color: var(--success); }
.date-tile.past { background: var(--surface-2); border-color: var(--line); color: var(--ink-500); }
.date-tile.past small { color: var(--ink-400); }
.row-muted .user-cell strong { color: var(--ink-500); }
.row-click { cursor: pointer; }
.row-link { color: inherit; }
.row-link:hover { color: inherit; }
.row-link:hover strong { color: var(--blue-600); }

/* Formularseiten */
.breadcrumb a { color: var(--ink-400); }
.breadcrumb a:hover { color: var(--blue-600); }
.form-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 24px; align-items: start; }
.form-main { display: grid; gap: 20px; min-width: 0; }
.form-aside { position: sticky; top: 0; }
.form-actions {
    position: sticky; bottom: 12px; z-index: 5;
    display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
    padding: 12px 16px;
    background: rgba(255, 255, 255, .94);
    backdrop-filter: blur(8px);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
}
.form-actions-spacer { flex: 1; }
.summary-list { margin: 0; padding: 8px 22px 18px; display: grid; }
.summary-list > div { display: flex; justify-content: space-between; gap: 16px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.summary-list > div:last-child { border-bottom: 0; }
.summary-list dt { color: var(--ink-500); }
.summary-list dd { margin: 0; text-align: right; font-weight: 600; min-width: 0; overflow-wrap: anywhere; }
.plan-preview {
    display: flex; gap: 18px; align-items: center;
    padding: 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface-2);
}
.plan-preview.empty { color: var(--ink-500); font-size: 14px; gap: 10px; }
.plan-preview.empty svg { width: 20px; height: 20px; color: var(--ink-300); }
.plan-preview-image { width: 220px; height: 150px; flex-shrink: 0; padding: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; }
.plan-preview-info { display: grid; gap: 6px; justify-items: start; }

@media (max-width: 1100px) {
    .form-layout { grid-template-columns: minmax(0, 1fr); }
    .form-aside { position: static; }
}
@media (max-width: 640px) {
    .form-actions .btn { flex: 1; }
    .form-actions-spacer { display: none; }
    .plan-preview { flex-direction: column; align-items: stretch; }
    .plan-preview-image { width: 100%; height: 170px; }
}

.toolbar-filter { display: block; min-width: 220px; max-width: 300px; }
.toolbar-filter .select { height: 40px; }
.toolbar-filter-sm { min-width: 170px; max-width: 210px; }
@media (max-width: 640px) {
    .toolbar-filter { width: 100%; max-width: none; flex-basis: 100%; }
}

/* Reservierungen */
.reservation-tile { background: var(--blue-50); color: var(--blue-500); }
.item-table td, .item-table th { padding-top: 10px; padding-bottom: 10px; }
.item-table tr.item-active { background: var(--blue-50); }
.item-table tr.item-active:hover { background: var(--blue-100); }
.input-qty { width: 96px; height: 38px; text-align: right; margin-left: auto; font-variant-numeric: tabular-nums; }
.item-total {
    display: flex; align-items: baseline; justify-content: flex-end; gap: 16px;
    padding: 16px 22px; border-top: 1px solid var(--line); background: var(--surface-2);
}
.item-total strong { font-size: 22px; font-weight: 800; letter-spacing: -.02em; }
.aside-note { padding: 0 22px 18px; font-size: 12.5px; color: var(--ink-500); }
.summary-list .summary-total { border-bottom: 0; padding-top: 14px; border-top: 2px solid var(--line-strong); margin-top: 4px; }
.summary-list .summary-total dd strong { font-size: 18px; }

/* Produktverkäufe: Positionen */
.sale-tile { background: var(--success-bg); color: #13753a; }
.sale-lines { padding: 6px 22px 4px; }
.sale-lines-head, .sale-line {
    display: grid; gap: 12px; align-items: start;
    grid-template-columns: minmax(0, 1fr) 140px 104px 96px 116px 32px;
}
.sale-lines-head {
    padding: 8px 0; border-bottom: 1px solid var(--line);
    font-size: 12.5px; font-weight: 600; color: var(--ink-500);
}
.sale-lines-head .num { text-align: right; }
.sale-line { padding: 12px 0; border-bottom: 1px solid var(--line); }
.sale-line .field > label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }
.sale-line .input, .sale-line .select { height: 40px; }
.sale-line .input-money { text-align: right; font-variant-numeric: tabular-nums; }
.sale-line .input-qty { width: 100%; }
.sale-line-total { display: flex; justify-content: flex-end; align-items: center; min-height: 40px; font-variant-numeric: tabular-nums; }
.sale-line-label { display: none; }
.sale-line-remove { display: flex; align-items: center; min-height: 40px; }
.sale-lines-error { padding: 0 22px; }
.sale-lines-add { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px 22px 16px; }
.form-locked .sale-line-remove { display: none; }

/* Eingabe mit Einheit rechts im Feld (€, %) */
.input-unit .input { padding-right: 30px; }
.input-unit::after {
    content: attr(data-unit); position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
    font-size: 13.5px; color: var(--ink-400); pointer-events: none;
}
/* Rabatt auf die Gesamtsumme */
/* Wer wann angelegt bzw. geändert hat: Zeitpunkt, darunter der Benutzer */
.summary-list dd.summary-meta { display: grid; justify-items: end; gap: 1px; }
.summary-list dd.summary-meta small { font-weight: 400; font-size: 12.5px; color: var(--ink-500); }
.summary-list dd.summary-meta small:empty { display: none; }
/* Summe Positionen: wie die Gesamtsumme, eine Stufe kleiner */
.item-subtotal strong { font-size: 18px; }
.sale-discount { display: grid; gap: 6px; padding: 14px 22px 12px; border-top: 1px solid var(--line); }
.sale-discount-row {
    display: grid; grid-template-columns: 1fr auto 130px; gap: 14px; align-items: center;
    font-size: 14px; color: var(--ink-500); font-variant-numeric: tabular-nums;
}
.sale-discount-row > span:last-child { text-align: right; }
.sale-discount-row > span:first-child, .sale-discount-row > label { text-align: right; }
.sale-discount-row > label { font-weight: 600; color: var(--ink-700); }
.sale-discount-control { display: flex; align-items: center; gap: 10px; justify-content: flex-end; }
.sale-discount-control .input-wrap { width: 110px; }
.sale-discount-control .input { height: 38px; }
.sale-discount-control .link-btn { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.sale-discount-control .link-btn svg { width: 13px; height: 13px; }
.sale-discount-field .field-error { text-align: right; }
/* Rabatt von Hand überschrieben */
.sale-discount .input.is-manual { border-color: var(--orange-500); background: var(--orange-50); }
.sale-discount + .item-total { border-top: 0; }
.sale-tier-hint:empty { display: none; }
.sale-tier-hint {
    display: flex; gap: 8px; align-items: flex-start; margin: 10px 22px 0; padding: 10px 12px;
    border-radius: 10px; background: var(--blue-50); color: var(--ink-700); font-size: 13px;
}
.sale-tier-hint svg { width: 16px; height: 16px; flex: none; margin-top: 1px; color: var(--blue-500); }

/* Staffelrabatte der Veranstaltung */
.tier-lines { padding: 6px 22px 4px; max-width: 560px; }
.tier-lines-head, .tier-line { display: grid; gap: 12px; align-items: start; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 32px; }
.tier-lines-head { padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 12.5px; font-weight: 600; color: var(--ink-500); }
.tier-line { padding: 12px 0; border-bottom: 1px solid var(--line); }
.tier-line .field > label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }
.tier-line .input { height: 40px; }
.tier-line .input-money { text-align: right; font-variant-numeric: tabular-nums; }

@media (max-width: 760px) {
    .sale-lines-head { display: none; }
    .sale-line { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; padding: 14px 0; }
    .sale-line-product { grid-column: 1 / -1; }
    .sale-line .field > label { position: static; width: auto; height: auto; overflow: visible; clip: auto; font-size: 12.5px; color: var(--ink-500); }
    .sale-line-total { grid-column: 1 / 3; justify-content: space-between; gap: 8px; }
    .sale-discount-row { grid-template-columns: 1fr auto; }
    .sale-discount-row > span:first-child, .sale-discount-row > label { text-align: left; }
    .sale-discount-row .sale-discount-field { grid-column: 1 / -1; grid-row: 2; }
    .sale-discount-control { justify-content: flex-start; }
    .tier-line .field > label { position: static; width: auto; height: auto; overflow: visible; clip: auto; font-size: 12.5px; color: var(--ink-500); }
    .tier-lines-head { display: none; }
    .sale-line-label { display: inline; font-size: 12.5px; font-weight: 600; color: var(--ink-500); }
    .sale-line-remove { justify-content: flex-end; }
}

/* Auswahlfeld mit Schaltfläche daneben (z. B. „Zum Kunden“); die Schaltfläche steht auf Höhe des Eingabefelds */
.picker-with-action { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: start; }
.picker-action { height: 44px; margin-top: calc(13.5px * 1.5 + 7px); white-space: nowrap; }
@media (max-width: 640px) {
    .picker-action { padding: 0 12px; }
}

/* Durchsuchbares Auswahlfeld */
.combo { position: relative; display: flex; align-items: center; }
.combo .input { padding-left: 40px; }
.combo-list {
    position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 30;
    max-height: 280px; overflow-y: auto;
    background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
    box-shadow: var(--shadow-lg); padding: 5px;
}
.combo-option { padding: 9px 12px; border-radius: 9px; cursor: pointer; display: grid; gap: 1px; }
.combo-option small { color: var(--ink-500); font-size: 12.5px; }
.combo-option-label { font-weight: 600; font-size: 14px; }
.combo-option.active { background: var(--blue-50); }
.combo-option.selected { color: var(--blue-700); }
.combo-option.selected .combo-option-label::after { content: " ✓"; }
.combo-empty { padding: 14px; text-align: center; color: var(--ink-500); font-size: 14px; }

/* Produkte */
.table th.num, .table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.product-tile {
    width: 40px; height: 40px; flex-shrink: 0; border-radius: 10px;
    display: grid; place-items: center;
    background: var(--orange-50); color: var(--orange-500);
}
.product-tile svg { width: 20px; height: 20px; }

.product-picker { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.product-picker-toolbar { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; padding: 10px 12px; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.product-picker-toolbar .search { max-width: none; }
.product-options { max-height: 340px; overflow-y: auto; }
.product-option {
    position: relative;
    display: flex; align-items: center; gap: 12px;
    padding: 0 14px 0 0; border-bottom: 1px solid var(--line);
    transition: background .15s;
}
/* Auswahl (Kästchen, Name, Preis) als eigenes Label, daneben die Mindestabnahme */
.product-option-main { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; padding: 11px 0; cursor: pointer; }
/* Griff zum Sortieren am Zeilenanfang */
.product-drag {
    flex: none; align-self: stretch; width: 34px; margin-left: 4px; margin-right: -4px;
    display: grid; place-items: center; border: 0; background: none; border-radius: 8px;
    color: var(--ink-300); cursor: grab; touch-action: none;
}
.product-drag svg { width: 18px; height: 18px; fill: currentColor; stroke: none; }
.product-drag:hover, .product-drag:focus-visible { color: var(--blue-500); background: var(--blue-50); }
.product-option.dragging { background: var(--surface); box-shadow: var(--shadow-lg); position: relative; z-index: 2; opacity: .95; }
.product-option.dragging .product-drag { cursor: grabbing; color: var(--blue-500); }
.inline-icon { width: 14px; height: 14px; vertical-align: -2px; fill: currentColor; stroke: none; }
.product-min { display: flex; align-items: center; justify-content: flex-end; gap: 8px; min-width: 96px; font-size: 12.5px; color: var(--ink-500); white-space: nowrap; }
/* Spaltenkopf über der Liste; Spalten wie in den Zeilen (Kästchen 20px + 12px Abstand, Preis rechts, Mindestverzehr 96px) */
.product-options-head {
    display: flex; align-items: center; gap: 12px; padding: 8px 14px;
    border-bottom: 1px solid var(--line); font-size: 12.5px; font-weight: 600; color: var(--ink-500);
}
.product-options-head-main { flex: 1; min-width: 0; display: flex; justify-content: space-between; padding-left: 52px; }
.product-options-head-min { width: 96px; text-align: right; line-height: 1.3; }
.product-min-label { display: none; }
.product-min .input-min { width: 72px; height: 34px; padding: 0 8px; text-align: right; font-variant-numeric: tabular-nums; }
.product-min .input-min:disabled { opacity: .5; }
@media (max-width: 640px) {
    .product-option { flex-wrap: wrap; padding-right: 14px; }
    .product-min { width: 100%; justify-content: flex-end; padding: 0 0 10px 44px; }
    .product-min-label { display: inline; }
    .product-options-head-min { display: none; }
}
.product-option:last-of-type { border-bottom: 0; }
.product-option:hover { background: var(--surface-2); }
.product-option:has(input[name=productIds]:checked) { background: var(--blue-50); }
.product-option-main input { position: absolute; opacity: 0; pointer-events: none; }
.product-check {
    width: 20px; height: 20px; flex-shrink: 0;
    display: grid; place-items: center;
    border: 2px solid var(--line-strong); border-radius: 6px;
    background: var(--surface); color: transparent;
    transition: background .15s, border-color .15s;
}
.product-check svg { width: 13px; height: 13px; stroke-width: 3.5; }
.product-option input:checked + .product-check { background: var(--blue-500); border-color: var(--blue-500); color: #fff; }
.product-option input:focus-visible + .product-check { box-shadow: var(--ring); }
.product-option-name { flex: 1; min-width: 0; font-weight: 600; }
.product-option-price { text-align: right; font-weight: 650; white-space: nowrap; font-variant-numeric: tabular-nums; }
.product-option-price small { display: block; font-size: 12px; font-weight: 500; color: var(--ink-500); }
.product-options-empty { padding: 18px; text-align: center; color: var(--ink-500); font-size: 14px; }
.field.has-error .product-picker { border-color: var(--danger); }

.plan-link { display: inline-flex; align-items: center; gap: 8px; color: var(--ink-800); }
.plan-link > svg { width: 18px; height: 18px; color: var(--blue-500); flex-shrink: 0; }
.plan-link:hover { color: var(--blue-700); }
input[type="date"].input { padding-right: 10px; }

/* Lagepläne – Liste */
.fp-thumb-wrap {
    width: 76px; height: 50px; flex-shrink: 0; padding: 3px;
    display: grid; place-items: center;
    background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px;
}
.fp-thumb { width: 100%; height: 100%; }
.fp-list-link { color: inherit; }
.fp-list-link:hover { color: inherit; }
.fp-list-link:hover strong { color: var(--blue-600); }

/* Lagepläne – Editor */
.page-wide { max-width: none; }
.fp-header { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.fp-name { flex: 1; min-width: 200px; max-width: 520px; height: 44px; font-size: 18px; font-weight: 700; }
.fp-header-actions { margin-left: auto; display: flex; gap: 6px; align-items: center; }
.icon-btn:disabled:hover { background: transparent; color: var(--ink-500); }

.fp-editor { display: grid; grid-template-columns: 236px minmax(0, 1fr) 292px; gap: 16px; align-items: start; }
.fp-palette, .fp-props {
    padding: 16px; display: grid; gap: 12px; align-content: start;
    position: sticky; top: 0;
    max-height: calc(100dvh - var(--topbar-h) - 140px); overflow-y: auto;
}
.fp-panel-title { display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 750; }
.fp-panel-title svg { width: 18px; height: 18px; color: var(--blue-500); }
.fp-hint { font-size: 12.5px; color: var(--ink-500); }
.fp-group-label { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-400); margin-top: 4px; }
.fp-palette-items { display: grid; gap: 6px; }

.fp-preset {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 10px; text-align: left;
    background: var(--surface); border: 1px solid var(--line); border-radius: 10px;
    cursor: grab; user-select: none; touch-action: none;
    transition: border-color .15s, background .15s, box-shadow .15s;
}
.fp-preset:hover, .fp-preset.active { border-color: var(--blue-300); background: var(--blue-50); }
.fp-preset.active { box-shadow: var(--ring); }
.fp-preset strong { display: block; font-size: 13.5px; font-weight: 650; }
.fp-preset small { display: block; font-size: 12px; color: var(--ink-500); }
.fp-swatch { width: 22px; height: 22px; flex-shrink: 0; border-radius: 6px; background: var(--f); border: 2px solid var(--c); }

.fp-stage-card { display: flex; flex-direction: column; min-width: 0; overflow: hidden; }
.fp-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.fp-stats { font-size: 13.5px; color: var(--ink-500); }
.fp-stats strong { color: var(--ink-900); }
.fp-zoom { display: flex; align-items: center; gap: 4px; }
.fp-zoom-value {
    min-width: 66px; height: 32px; padding: 0 8px;
    background: var(--surface); border: 1px solid var(--line); border-radius: 8px;
    font-size: 13px; font-weight: 650; cursor: pointer;
}
.fp-zoom-value:hover { border-color: var(--blue-300); color: var(--blue-700); }

.fp-stage {
    position: relative; overflow: auto;
    height: calc(100dvh - var(--topbar-h) - 206px); min-height: 420px;
    padding: 28px;
    background-color: var(--bg);
    background-image: radial-gradient(var(--line-strong) 1px, transparent 1px);
    background-size: 16px 16px;
}
.fp-stage.panning { cursor: grabbing; }

.fp-canvas {
    --cell: 24px;
    position: relative;
    box-sizing: content-box;
    width: calc(var(--cols) * var(--cell));
    height: calc(var(--rows) * var(--cell));
    border: 2px solid var(--ink-300);
    border-radius: 4px;
    background-color: #fff;
    background-image:
        linear-gradient(to right, rgba(61, 139, 253, .22) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(61, 139, 253, .22) 1px, transparent 1px),
        linear-gradient(to right, #e9eef5 1px, transparent 1px),
        linear-gradient(to bottom, #e9eef5 1px, transparent 1px);
    background-size:
        calc(var(--cell) * 10) calc(var(--cell) * 10),
        calc(var(--cell) * 10) calc(var(--cell) * 10),
        var(--cell) var(--cell),
        var(--cell) var(--cell);
    box-shadow: var(--shadow);
    touch-action: pan-x pan-y;
}

.fp-el, .fp-ghost {
    position: absolute;
    box-sizing: border-box;
    left: calc(var(--x) * var(--cell));
    top: calc(var(--y) * var(--cell));
    width: calc(var(--w) * var(--cell));
    height: calc(var(--h) * var(--cell));
}
.fp-el {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
    padding: 2px;
    background: var(--f);
    border: 2px solid var(--c);
    border-radius: max(3px, calc(var(--cell) * .18));
    color: var(--c);
    font-size: clamp(9px, calc(var(--cell) * .5), 17px);
    font-weight: 700;
    line-height: 1.1;
    text-align: center;
    overflow: hidden;
    cursor: grab;
    user-select: none;
    touch-action: none;
    transition: box-shadow .15s;
}
.fp-el:hover { box-shadow: 0 0 0 3px rgba(61, 139, 253, .2); }
.fp-el.selected { z-index: 2; overflow: visible; box-shadow: 0 0 0 3px var(--blue-500), 0 6px 18px rgba(15, 40, 80, .18); }
.fp-el.dragging { z-index: 3; cursor: grabbing; opacity: .92; transition: none; }
.fp-el.vertical { flex-direction: row; }
.fp-el.vertical .fp-el-label, .fp-el.vertical .fp-el-seats { writing-mode: vertical-rl; transform: rotate(180deg); }
.fp-el-label { max-width: 100%; max-height: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fp-el-seats { display: inline-flex; align-items: center; gap: 3px; font-size: .85em; font-weight: 600; opacity: .85; white-space: nowrap; }
.fp-el-seats svg { width: 1em; height: 1em; }
.fp-el.vertical .fp-el-seats svg { transform: rotate(90deg); }
.fp-handle {
    position: absolute; right: -7px; bottom: -7px;
    width: 14px; height: 14px;
    background: var(--blue-500); border: 2px solid #fff; border-radius: 4px;
    box-shadow: var(--shadow-sm);
    cursor: nwse-resize;
}
.fp-tiny .fp-el-label, .fp-tiny .fp-el-seats { display: none; }

.fp-ghost { z-index: 4; pointer-events: none; border: 2px dashed var(--blue-500); border-radius: 4px; background: rgba(61, 139, 253, .14); }
.fp-el.invalid, .fp-ghost.invalid {
    border-color: var(--danger);
    color: var(--danger);
    background: repeating-linear-gradient(45deg, #fdecec, #fdecec 6px, #fff 6px, #fff 12px);
}
body.fp-dragging, body.fp-dragging * { cursor: grabbing !important; user-select: none; }

.fp-form { gap: 14px; }
.fp-form .input, .fp-form .select { height: 40px; }
/* Felder nebeneinander auf gleicher Höhe, auch wenn eine Beschriftung umbricht */
.fp-form .form-row { align-items: end; }
.fp-prop-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.fp-prop-actions .btn { padding: 0 10px; }
.fp-prop-actions [data-remove] { grid-column: 1 / -1; }
.btn-danger-outline { --btn-fg: var(--danger); --btn-border: #f3c4c6; }
.btn-danger-outline:hover { background: var(--danger-bg); border-color: var(--danger); }
.fp-props > .link-btn { justify-self: start; }

.fp-summary { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.fp-summary div { display: grid; gap: 2px; padding: 10px 12px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; }
.fp-summary small { font-size: 12px; color: var(--ink-500); }
.fp-summary strong { font-size: 18px; font-weight: 800; }
.fp-shortcuts { list-style: none; margin: 0; padding: 0; display: grid; gap: 7px; font-size: 12.5px; color: var(--ink-500); }
kbd {
    display: inline-block; padding: 1px 6px;
    font-family: inherit; font-size: 11px; font-weight: 650; color: var(--ink-700);
    background: var(--surface); border: 1px solid var(--line-strong); border-bottom-width: 2px; border-radius: 5px;
}

@media (max-width: 1280px) {
    .fp-editor { grid-template-columns: 210px minmax(0, 1fr) 256px; }
}
@media (max-width: 1100px) {
    .fp-editor { grid-template-columns: minmax(0, 1fr) 256px; }
    .fp-palette {
        grid-column: 1 / -1; position: static; max-height: none;
        display: flex; gap: 8px; align-items: stretch; overflow-x: auto; padding: 10px 12px;
    }
    .fp-palette > .fp-panel-title, .fp-palette > .fp-hint, .fp-palette > .fp-group-label { display: none; }
    .fp-palette-items { display: flex; flex: 0 0 auto; gap: 8px; }
    .fp-preset { flex: 0 0 auto; padding: 6px 10px; }
}
@media (max-width: 960px) {
    .fp-editor { grid-template-columns: minmax(0, 1fr); }
    .fp-props { position: static; max-height: none; }
    .fp-stage { height: 62dvh; min-height: 320px; padding: 16px; }
    .fp-name { max-width: none; order: 3; flex-basis: 100%; }
}
@media (pointer: coarse) {
    .fp-preset { touch-action: manipulation; }
}

/* Seitennavigation */
.pagination {
    display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap;
    padding: 12px 22px; border-top: 1px solid var(--line); background: var(--surface-2);
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}
.pagination-info { font-size: 13.5px; color: var(--ink-500); }
.pagination-pages { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.pagination-num {
    min-width: 32px; height: 32px; padding: 0 8px;
    border: 1px solid transparent; border-radius: 8px;
    background: none; color: var(--ink-700);
    font-size: 13.5px; font-weight: 600; font-variant-numeric: tabular-nums; cursor: pointer;
    transition: background .15s, color .15s, border-color .15s;
}
.pagination-num:hover { background: var(--blue-50); color: var(--blue-700); }
.pagination-num.active { background: var(--blue-500); border-color: var(--blue-500); color: #fff; }
.pagination-gap { padding: 0 2px; color: var(--ink-400); }
@media (max-width: 640px) {
    .pagination { padding: 12px 16px; justify-content: center; }
    .pagination-info { flex-basis: 100%; text-align: center; }
    .pagination-pages { margin: 0 auto; }
}

.result-count { font-size: 13px; color: var(--ink-500); white-space: nowrap; }
.modal-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 22px 24px 6px; }
.modal-header h2 { font-size: 19px; font-weight: 750; }
.modal-header p { font-size: 14px; color: var(--ink-500); margin-top: 4px; }
.modal-body { padding: 16px 24px; overflow-y: auto; }
.modal-footer { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 24px 22px; }

/* ---------- Toasts ---------- */

.toasts {
    position: fixed;
    right: 20px;
    bottom: 20px;
    display: grid;
    gap: 10px;
    z-index: 300;
    width: min(380px, calc(100vw - 32px));
}
.toast {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 14px 16px;
    border-radius: 14px;
    background: var(--ink-900);
    color: #fff;
    box-shadow: var(--shadow-lg);
    font-size: 14px;
    animation: toastIn .25s var(--ease);
}
.toast svg { width: 20px; height: 20px; margin-top: 1px; }
.toast-success svg { color: #4ade80; }
.toast-error svg { color: #ff8589; }
.toast-info svg { color: var(--blue-300); }
.toast.leaving { animation: toastOut .2s ease forwards; }
@keyframes toastIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateY(6px); } }

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 1100px) {
    .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 960px) {
    .auth { grid-template-columns: 1fr; }
    .auth-brand { display: none; }
    .auth-card > .brand { display: inline-flex; justify-self: center; }
    .auth-card > .auth-head { text-align: center; }

    .shell, .shell.sidebar-collapsed { grid-template-columns: minmax(0, 1fr); grid-template-areas: "top" "main"; }
    .sidebar {
        position: fixed;
        top: var(--topbar-h);
        bottom: 0;
        left: 0;
        width: min(300px, 86vw);
        transform: translateX(-100%);
        transition: transform .28s var(--ease);
        box-shadow: none;
    }
    .sidebar-open .sidebar { transform: none; box-shadow: var(--shadow-lg); }
    .sidebar-backdrop {
        display: block;
        position: fixed;
        inset: var(--topbar-h) 0 0 0;
        background: rgba(15, 27, 45, .35);
        z-index: 25;
        opacity: 0;
        pointer-events: none;
        transition: opacity .25s;
    }
    .sidebar-open .sidebar-backdrop { opacity: 1; pointer-events: auto; }
    .collapse-btn { display: none; }
    .sidebar-footer { display: none; }

    .content { padding: 24px 20px; }
    .grid-2 { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
    :root { --topbar-h: 58px; }
    body { font-size: 14.5px; }

    .auth-main { padding: 28px 16px; align-items: flex-start; }
    .auth-panel { padding: 22px 18px; border-radius: 16px; }
    .auth-card h1 { font-size: 24px; }
    .form-row, .form-row-zip { grid-template-columns: 1fr; }
    .table-responsive td .cell-stack { text-align: right; justify-items: end; }

    .topbar { padding: 0 8px 0 10px; gap: 4px; }
    .topbar .brand span { display: none; }
    .avatar-meta, .avatar-btn > svg { display: none; }
    .avatar-btn { padding: 4px; }

    .dropdown-menu { position: fixed; left: 10px !important; right: 10px !important; top: calc(var(--topbar-h) + 6px); min-width: 0; width: auto; }
    .notif-panel { width: auto; }

    .content { padding: 18px 14px 32px; }
    .page { gap: 18px; }
    .page-header h1 { font-size: 22px; }
    .page-actions, .page-actions .btn { width: 100%; }

    .hero { padding: 24px 20px; }
    .hero h1 { font-size: 23px; }
    .stats { gap: 12px; }
    .stat-card { padding: 16px; flex-direction: column; align-items: flex-start; gap: 12px; }
    .stat-icon { width: 40px; height: 40px; border-radius: 12px; }
    .stat-value { font-size: 22px; }

    .card-header, .card-body, .card-toolbar, .bulk-bar { padding-left: 16px; padding-right: 16px; }
    .list-item, .quick-link { padding-left: 16px; padding-right: 16px; }
    .list-item { flex-wrap: wrap; }
    .list-item-actions { width: 100%; }
    .list-item-actions .btn { flex: 1; }
    .search { max-width: none; min-width: 0; width: 100%; flex-basis: 100%; }
    .segmented { width: 100%; }
    .segmented button { flex: 1; justify-content: center; }

    /* Tabelle wird zu Karten */
    .table-responsive thead { display: none; }
    .table-responsive, .table-responsive tbody, .table-responsive tr, .table-responsive td { display: block; width: 100%; }
    .table-responsive tr { padding: 14px 16px; border-bottom: 1px solid var(--line); position: relative; }
    .table-responsive tbody tr:last-child { border-bottom: 0; }
    .table-responsive td { padding: 5px 0; border: 0; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
    .table-responsive td .select { width: auto; min-width: 150px; }
    .table-responsive td[data-label]::before { content: attr(data-label); font-size: 12.5px; color: var(--ink-400); font-weight: 600; }
    .table-responsive td.cell-main { padding: 0 44px 8px 0; }
    .table-responsive td.cell-main::before { display: none; }
    .table-responsive td.col-actions { position: absolute; top: 12px; right: 10px; width: auto; padding: 0; }

    .modal-backdrop { place-items: end center; padding: 0; }
    .modal { max-width: none; border-radius: 20px 20px 0 0; max-height: 92dvh; transform: translateY(40px); }
    .modal-footer { padding-bottom: calc(18px + env(safe-area-inset-bottom)); }
    .modal-footer .btn { flex: 1; }

    .toasts { right: 16px; left: 16px; bottom: 16px; width: auto; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* Online-Buchung (Veranstaltung) */
.copy-row { display: flex; gap: 10px; align-items: center; }
.copy-row .input { flex: 1; min-width: 0; }
.copy-row .btn { flex-shrink: 0; }
.copy-row-end { justify-content: space-between; }
.code-snippet { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; resize: none; }
@media (max-width: 640px) {
    .copy-row { flex-wrap: wrap; }
    .copy-row .btn { flex: 1; }
}

/* Schalter (Checkbox als Toggle) */
/* position: relative hält die unsichtbare Checkbox im Schalter; sonst verschiebt ihr Fokus das ganze Layout */
.toggle { position: relative; display: flex; gap: 14px; align-items: flex-start; cursor: pointer; font-weight: 400 !important; }
.toggle input { position: absolute; opacity: 0; pointer-events: none; }
.toggle-track {
    position: relative; flex-shrink: 0; width: 42px; height: 24px; margin-top: 1px;
    border-radius: 999px; background: var(--ink-300); transition: background .15s;
}
.toggle-track::after {
    content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px;
    border-radius: 50%; background: #fff; box-shadow: var(--shadow-sm); transition: transform .15s var(--ease);
}
.toggle input:checked + .toggle-track { background: var(--success); }
.toggle input:checked + .toggle-track::after { transform: translateX(18px); }
.toggle input:focus-visible + .toggle-track { box-shadow: var(--ring); }
.toggle-text { display: grid; gap: 2px; }
.toggle-text strong { color: var(--ink-900); font-size: 14.5px; }
.toggle-text small { color: var(--ink-500); font-size: 13px; line-height: 1.45; }

/* Reiter (Tabs), z. B. in der Kundenmaske */
.tabs { display: flex; flex-wrap: wrap; gap: 4px; border-bottom: 1px solid var(--line-strong); }
.tab {
    position: relative; display: inline-flex; align-items: center; gap: 8px;
    padding: 10px 14px 12px; border: 0; background: none; cursor: pointer; white-space: nowrap;
    font-size: 14.5px; font-weight: 600; color: var(--ink-500); border-radius: 8px 8px 0 0;
    transition: color .15s, background .15s;
}
.tab svg { width: 17px; height: 17px; }
.tab:hover { color: var(--ink-900); background: var(--surface-2); }
.tab.active { color: var(--blue-600); }
.tab.active::after {
    content: ""; position: absolute; left: 10px; right: 10px; bottom: -1px;
    height: 3px; border-radius: 3px 3px 0 0; background: var(--blue-500);
}
.tab-count:not(:empty) {
    min-width: 22px; padding: 1px 7px; border-radius: 999px; text-align: center;
    font-size: 12px; background: var(--bg); color: var(--ink-500); border: 1px solid var(--line);
}
.tab.active .tab-count { background: var(--blue-50); color: var(--blue-600); border-color: var(--blue-100); }
.tab-panel { display: grid; gap: 20px; min-width: 0; }

/* Lageplan: Linien entlang des Rasters */
.fp-lines {
    position: absolute; inset: 0; width: 100%; height: 100%;
    z-index: 3; overflow: visible; pointer-events: none;
}
.fp-line { stroke: #334155; stroke-width: 3px; stroke-linecap: round; vector-effect: non-scaling-stroke; }
/* Unsichtbare, breitere Trefferfläche, damit sich dünne Linien gut anklicken lassen */
.fp-line-hit { stroke: transparent; stroke-linecap: round; pointer-events: stroke; cursor: grab; }
.fp-line-group:hover .fp-line { stroke: var(--blue-600); }
.fp-line-group.selected .fp-line { stroke: var(--blue-500); stroke-width: 5px; }
.fp-line-group.dragging .fp-line-hit { cursor: grabbing; }
.fp-line-preview { stroke: var(--blue-500); stroke-dasharray: 6 4; }
.fp-line-preview.invalid { stroke: var(--danger); }
/* Beim Zeichnen: Fadenkreuz, und Linien fangen keine Klicks ab */
.fp-canvas.fp-drawing, .fp-canvas.fp-drawing .fp-el { cursor: crosshair; }
.fp-canvas.fp-drawing { touch-action: none; }
.fp-canvas.fp-drawing .fp-line-hit { pointer-events: none; }
.fp-swatch-line { background: linear-gradient(135deg, transparent 44%, #334155 44%, #334155 56%, transparent 56%); border-color: #334155; }
.fp-tool { cursor: pointer; }
.fp-tool.active { border-color: var(--blue-500); background: var(--blue-50); box-shadow: var(--ring); }

/* Lageplan: Tische – Reservierungsreihenfolge und nicht reservierbare Tische */
.fp-el-order {
    position: absolute; top: 2px; left: 2px;
    min-width: 1.5em; padding: 0 .3em; border-radius: 999px;
    background: var(--c); color: #fff; font-size: .72em; line-height: 1.5; text-align: center;
}
.fp-el.vertical .fp-el-order { writing-mode: horizontal-tb; transform: none; }
.fp-el.not-bookable {
    border-style: dashed;
    color: var(--ink-500);
    border-color: var(--ink-400);
    background: repeating-linear-gradient(45deg, #f1f4f8, #f1f4f8 6px, #fff 6px, #fff 12px);
}
.fp-el.not-bookable .fp-el-order { background: var(--ink-400); }
.fp-tiny .fp-el-order { display: none; }
/* Anfasser an den Enden der ausgewählten Linie */
.fp-line-handle { fill: #fff; stroke: var(--blue-500); stroke-width: 2px; vector-effect: non-scaling-stroke; pointer-events: all; }
.fp-line-handle.h { cursor: ew-resize; }
.fp-line-handle.v { cursor: ns-resize; }

/* Umschalter in einer Karten-Werkzeugleiste, z. B. „Archiv“ in den Reservierungen */
.toolbar-toggle.active { background: var(--blue-50); border-color: var(--blue-300); color: var(--blue-700); }
.toggle-count:not(:empty) {
    min-width: 20px; padding: 0 6px; border-radius: 999px; text-align: center;
    font-size: 12px; line-height: 18px; background: var(--bg); color: var(--ink-500); border: 1px solid var(--line);
}
.toolbar-toggle.active .toggle-count { background: #fff; color: var(--blue-600); border-color: var(--blue-100); }

/* ---------- Tischbelegung ---------- */

/* Kennzahlen über einer Liste */
.stat-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.stat-tile { padding: 16px 18px; display: grid; gap: 2px; }
.stat-tile small { font-size: 12.5px; color: var(--ink-500); font-weight: 600; }
.stat-tile strong { font-size: 24px; font-weight: 800; letter-spacing: -.02em; }
.stat-tile span { font-size: 12.5px; color: var(--ink-400); }
@media (max-width: 800px) { .stat-row { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* Zugeordnete Tische als kleine Marken */
.table-chips { display: inline-flex; flex-wrap: wrap; gap: 4px; }
.table-chip {
    padding: 1px 8px; border-radius: 999px; font-size: 12.5px; font-weight: 600;
    background: var(--blue-50); color: var(--blue-700); border: 1px solid var(--blue-100); white-space: nowrap;
}
.cell-main small.muted { display: block; font-size: 12.5px; }

/* Lageplan zur Tischauswahl */
.seat-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 20px; align-items: start; }
/* Freie Stellen: Plan mit der Maus verschieben */
.seat-stage, .seat-canvas .fp-el.seat-static { cursor: grab; }
.seat-stage.panning, .seat-stage.panning * { cursor: grabbing !important; }
.seat-canvas .fp-el:disabled { cursor: not-allowed; }
.seat-static { opacity: .5; pointer-events: none; }
button.seat-table { font-family: inherit; margin: 0; appearance: none; }
.seat-table.seat-free { cursor: pointer; }
.seat-table.seat-free:hover { box-shadow: 0 0 0 3px rgba(61, 139, 253, .35); }
.seat-table.seat-chosen {
    cursor: pointer; z-index: 2;
    background: var(--blue-500); border-color: var(--blue-700); color: #fff;
    box-shadow: 0 0 0 3px rgba(61, 139, 253, .35), 0 4px 12px rgba(15, 40, 80, .2);
}
.seat-table.seat-chosen .fp-el-order { background: #fff; color: var(--blue-700); }
.seat-table.seat-taken {
    cursor: not-allowed;
    background: #e2e8f0; border-color: #94a3b8; color: #64748b;
}
.seat-table.seat-taken .fp-el-order { background: #94a3b8; }
.seat-table.seat-blocked {
    cursor: not-allowed;
    border-style: dashed; border-color: var(--danger); color: #b4262b;
    background: repeating-linear-gradient(45deg, #fdecec, #fdecec 5px, #fff 5px, #fff 10px);
}
.seat-table.seat-blocked .fp-el-order { background: var(--danger); }
.seat-table:disabled { opacity: 1; }
.seat-table:focus-visible { outline: none; box-shadow: var(--ring); }

.seat-legend { display: flex; flex-wrap: wrap; gap: 16px; font-size: 13px; color: var(--ink-500); }
.seat-legend span { display: inline-flex; align-items: center; gap: 6px; }
.seat-key { width: 16px; height: 12px; border-radius: 3px; border: 2px solid; display: inline-block; }
.seat-key.free { background: #e6f0ff; border-color: #3d8bfd; }
.seat-key.chosen { background: var(--blue-500); border-color: var(--blue-700); }
.seat-key.taken { background: #e2e8f0; border-color: #94a3b8; }
.seat-key.blocked { border-style: dashed; border-color: var(--danger); background: repeating-linear-gradient(45deg, #fdecec, #fdecec 3px, #fff 3px, #fff 6px); }

.seat-aside { position: sticky; top: 0; }
.seat-aside-body { display: grid; gap: 14px; }
.seat-progress { display: grid; gap: 2px; padding: 12px 14px; border-radius: var(--radius); background: var(--warning-bg); color: var(--warning); }
.seat-progress strong { font-size: 22px; font-weight: 800; }
.seat-progress.complete { background: var(--success-bg); color: #13753a; }
.seat-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; max-height: 260px; overflow-y: auto; }
.seat-list li { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 6px 6px 6px 10px; border: 1px solid var(--line); border-radius: 10px; }
.seat-list li span { display: grid; }
.seat-list small { color: var(--ink-500); font-size: 12.5px; }
.seat-notes { padding: 10px 12px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line); }
.seat-notes small { color: var(--ink-500); font-size: 12px; font-weight: 600; }
.seat-notes p { font-size: 13.5px; white-space: pre-wrap; }
.seat-actions { display: grid; gap: 8px; }
.seat-actions-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
@media (max-width: 1100px) {
    .seat-layout { grid-template-columns: minmax(0, 1fr); }
    .seat-aside { position: static; }
}

/* Logo myFestzelt (links oben und auf der Anmeldeseite) */
.brand-logo { display: block; height: 40px; width: auto; }
.topbar .brand-logo { height: 42px; }
/* Auf dem blauen Anmelde-Hintergrund auf heller Fläche, damit Blau und Orange gut lesbar bleiben */
.brand-badge { align-self: flex-start; padding: 10px 16px; background: #fff; border-radius: 16px; box-shadow: 0 8px 24px rgba(15, 40, 80, .18); }
.brand-badge .brand-logo { height: 48px; }
@media (max-width: 640px) {
    .topbar .brand-logo { height: 34px; }
}

/* ---------- Anmeldeseite: Festzelt-Stimmung ---------- */
.auth-brand-inner { padding-top: 56px; }
.auth-kicker {
    justify-self: start; padding: 5px 12px; border-radius: 999px;
    font-size: 12.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
    color: #ffe2b3; background: rgba(240, 152, 26, .18); border: 1px solid rgba(247, 176, 74, .45);
}
.auth-features li span { background: rgba(255, 255, 255, .14); border: 1px solid rgba(255, 255, 255, .16); }
.auth-features li:nth-child(odd) span { color: #ffd08a; }

/* Lichterkette am oberen Rand */
.fest-lights { position: absolute; left: 0; top: 0; width: 100%; height: 150px; z-index: 1; pointer-events: none; }
.fest-wire, .fest-lights line { fill: none; stroke: rgba(255, 255, 255, .45); stroke-width: 1.4; }
.bulb-glow { fill: url(#bulb-glow); }
.bulb-warm { fill: #ffe7a8; }
.bulb-orange { fill: #f7a93a; }
@media (prefers-reduced-motion: no-preference) {
    .bulb-warm, .bulb-orange { animation: bulb-twinkle 3.2s ease-in-out infinite; }
    .fest-lights g:nth-of-type(3n) circle { animation-delay: -1.1s; }
    .fest-lights g:nth-of-type(3n+1) circle { animation-delay: -2.2s; }
}
@keyframes bulb-twinkle { 0%, 100% { opacity: 1; } 50% { opacity: .72; } }

/* Festzelt-Silhouette unten rechts, angeschnitten */
.fest-tent { position: absolute; right: -24%; bottom: -14%; width: 74%; max-width: 540px; z-index: 1; pointer-events: none; }
.tent-roof, .tent-valance, .tent-post { fill: rgba(255, 255, 255, .07); }
.tent-stripe { fill: rgba(255, 255, 255, .1); }

/* ---------- Übersicht (Festzelt) ---------- */
.hero-fest {
    display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 24px; align-items: center;
    background:
        radial-gradient(420px 240px at 92% 0%, rgba(240, 152, 26, .35), transparent 70%),
        linear-gradient(120deg, #0b62b3 0%, #09569a 55%, #074580 100%);
    box-shadow: 0 10px 30px rgba(9, 86, 154, .28);
}
.hero-fest::before { background: radial-gradient(circle, rgba(247, 176, 74, .55), rgba(247, 176, 74, 0) 68%); }
.hero-fest .btn-white { --btn-fg: #09569a; }
.hero-event {
    min-width: 290px; padding: 18px 20px; display: grid; gap: 12px;
    border-radius: var(--radius); background: rgba(255, 255, 255, .12);
    border: 1px solid rgba(255, 255, 255, .22); backdrop-filter: blur(6px);
}
.hero-event > small { opacity: .8; }
.hero-event-head { display: flex; gap: 12px; align-items: center; }
.hero-event-head > div { display: grid; gap: 2px; min-width: 0; }
.hero-event-head span { font-size: 13px; opacity: .88; }
.hero-event-name { font-size: 17px; font-weight: 800; overflow-wrap: anywhere; }
.hero-event-date {
    width: 52px; height: 56px; flex-shrink: 0; border-radius: 12px; display: grid; place-items: center; align-content: center;
    background: #fff; color: #09569a; line-height: 1.1;
}
.hero-event-date small { font-size: 11px; font-weight: 700; text-transform: uppercase; color: #f0981a; opacity: 1; letter-spacing: .04em; }
.hero-event-date strong { font-size: 20px; font-weight: 800; }
.hero-event-facts { display: grid; gap: 6px; font-size: 13.5px; }
.hero-event-facts span { display: flex; align-items: center; gap: 8px; }
.hero-event-facts svg { width: 16px; height: 16px; opacity: .8; }
.hero-event-facts b { color: #ffd08a; font-size: 15px; }
.hero-event-link { display: inline-flex; align-items: center; gap: 6px; color: #fff; font-weight: 600; font-size: 13.5px; }
.hero-event-link:hover { color: #ffd08a; }
.hero-event-link svg { width: 16px; height: 16px; }
@media (max-width: 900px) {
    .hero-fest { grid-template-columns: minmax(0, 1fr); }
    .hero-event { min-width: 0; }
}

/* Kennzahlen als Links */
.stat-link { color: inherit; transition: box-shadow .15s, transform .15s, border-color .15s; }
.stat-link:hover { color: inherit; border-color: var(--blue-200); box-shadow: var(--shadow); transform: translateY(-1px); }
.stat-hint { font-size: 12px; color: var(--ink-400); margin-top: 2px; }

/* Nächste Veranstaltungstage mit Auslastungsbalken */
.dash-grid { align-items: start; }
.dash-day .list-item-body { gap: 5px; }
.dash-bar { height: 7px; border-radius: 999px; background: var(--line); overflow: hidden; max-width: 320px; }
.dash-bar span { display: block; height: 100%; border-radius: inherit; background: #09569a; }
.dash-bar.high span { background: #f0981a; }
.dash-bar.full span { background: var(--success); }
.dash-bar.over span { background: var(--danger); }
.dash-day-date { font-weight: 500; color: var(--ink-500); font-size: 13px; margin-left: 4px; }
.text-danger { color: var(--danger); }
/* Kennzahlen der Übersicht: Symbol über dem Wert, damit fünf Kacheln nebeneinander Platz haben */
.stats .stat-card { flex-direction: column; align-items: flex-start; gap: 12px; padding: 18px 20px; }
.stats .stat-icon { width: 40px; height: 40px; border-radius: 12px; }
.stats .stat-icon svg { width: 20px; height: 20px; }
.stats .stat-value { font-size: 24px; }

/* Bemerkung in Listen: höchstens zwei Zeilen, voller Text im Tooltip */
.cell-notes {
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
    max-width: 320px; font-size: 13.5px; color: var(--ink-700); white-space: pre-line; overflow-wrap: anywhere;
}
@media (max-width: 640px) {
    .cell-notes { max-width: none; text-align: right; }
}

/* Einstellungen › Rechnungen: Nummerierung */
.form-row-numbering { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.placeholder-buttons { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 2px; }
.placeholder-buttons .btn { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 12.5px; }
.numbering-preview {
    display: grid; gap: 2px; padding: 14px 16px; border-radius: 12px;
    background: var(--surface-2); border: 1px solid var(--line);
}
.numbering-label { font-size: 12.5px; font-weight: 600; color: var(--ink-500); }
.numbering-preview strong { font-size: 20px; font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; letter-spacing: .01em; }
.numbering-preview small { font-size: 12.5px; color: var(--ink-500); }
@media (max-width: 640px) {
    .form-row-numbering { grid-template-columns: minmax(0, 1fr); }
}

/* Mehrere Elemente rechts im Kartenkopf (z. B. Anzahl und Schaltfläche) */
.card-header-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }

/* Einstellungen › E-Mail: eigener Postausgangsserver */
.form-row-smtp { grid-template-columns: minmax(0, 1fr) 140px; }
.smtp-test { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; }
@media (max-width: 640px) { .form-row-smtp { grid-template-columns: 1fr; } }

/* Einstellungen › E-Mail: Vorschau des E-Mail-Endes in der Übersicht */
.signature-preview { margin: 0 22px 22px; padding: 14px 16px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); display: grid; gap: 6px; font-size: 14px; }
.signature-preview p { margin: 0; white-space: pre-line; overflow-wrap: anywhere; }
