:root {
    --color-bg: #f5f5f5;
    --color-dark: #1e1e1e;
    --color-accent: #e63942;
    --color-accent-dark: #c92e36;
    --color-text: #1e1e1e;
    --color-muted: #6b6b6b;
    --color-border: #e0e0e0;
    --color-white: #ffffff;
    --radius: 10px;
    --sidebar-width: 72px;
    --topbar-height: 56px;
    font-size: 16px;
}
* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: "Mulish", system-ui, -apple-system, "Segoe UI", sans-serif;
    color: var(--color-text);
    background: var(--color-bg);
    line-height: 1.5;
}

.topbar {
    position: fixed; top: 0; left: 0; right: 0;
    height: var(--topbar-height);
    background: var(--color-dark);
    color: #fff;
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 20px;
    z-index: 20;
}
.sidebar {
    position: fixed;
    top: var(--topbar-height); left: 0; bottom: 0;
    width: var(--sidebar-width);
    background: var(--color-dark);
    z-index: 10;
}
.content {
    margin-left: var(--sidebar-width);
    padding: calc(var(--topbar-height) + 32px) 40px 40px;
}

.sidenav { display: flex; flex-direction: column; gap: 2px; padding-top: 10px; }
.sidenav-item {
    position: relative;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 4px; padding: 10px 4px;
    color: #cfcfcf; text-decoration: none;
}
.sidenav-item .icon { width: 22px; height: 22px; }
.sidenav-label {
    font-size: 9px; line-height: 1.15; font-weight: 700; letter-spacing: 0.3px;
    text-transform: uppercase; text-align: center; word-break: break-word; hyphens: auto;
}
.sidenav-item:hover { background: rgba(255,255,255,.08); color: #fff; }
.sidenav-item.is-active { color: #fff; }
.sidenav-item.is-active .icon { color: var(--color-accent); }
.sidenav-item.is-active::before {
    content: ""; position: absolute; left: 0; top: 6px; bottom: 6px;
    width: 3px; border-radius: 0 3px 3px 0; background: var(--color-accent);
}

.page-title { font-size: 1.6rem; font-weight: 800; margin: 0 0 8px; }
.page-lead { color: var(--color-muted); margin: 0 0 24px; }
.section-title { font-size: 1.1rem; font-weight: 700; margin: 0 0 12px; }

.user-menu-dropdown {
    display: none;
    position: absolute; right: 0; top: calc(100% + 8px);
    min-width: 232px; background: #fff; color: var(--color-text);
    border: 1px solid var(--color-border); border-radius: 10px;
    box-shadow: 0 12px 32px rgba(0,0,0,.14); padding: 6px; z-index: 30;
}
.user-menu-dropdown.is-open { display: block; }
.user-menu-head {
    display: flex; flex-direction: column; gap: 2px;
    padding: 10px 12px; border-bottom: 1px solid var(--color-border); margin-bottom: 6px;
}
.user-menu-item {
    display: flex; align-items: center; gap: 10px; width: 100%;
    padding: 9px 12px; border: none; background: none; font: inherit;
    text-align: left; color: var(--color-text); text-decoration: none;
    border-radius: 7px; cursor: pointer;
}
.user-menu-item:hover { background: var(--color-bg); }
.user-menu-item-danger { color: var(--color-accent); }

.btn {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 10px 18px; border-radius: 8px; border: none;
    font-family: inherit; font-weight: 700; font-size: 0.9rem;
    text-decoration: none; cursor: pointer;
}
.btn:hover, .btn:focus { text-decoration: none; }
.btn-primary { background: var(--color-accent); color: #fff; }
.btn-primary:hover { background: var(--color-accent-dark); }
.btn-ghost { background: #fff; border: 1px solid var(--color-border); color: var(--color-dark); }
.btn-ghost:hover { border-color: var(--color-accent); color: var(--color-accent); }
.btn-sm { padding: 6px 12px; font-size: 0.85rem; }

/* ---------- Links (WP1: keine unterstrichenen Text-Links mehr) ---------- */
.link { background: none; border: none; padding: 0; font: inherit; color: var(--color-dark); text-decoration: none; cursor: pointer; }
.link:hover { color: var(--color-accent); }
.link-danger { color: var(--color-accent); }
.link-danger:hover { color: var(--color-accent-dark); }
.link-muted { color: var(--color-muted); }
.link-muted:hover { color: var(--color-accent); }
.link-back { display: inline-flex; align-items: center; gap: 6px; color: var(--color-muted); text-decoration: none; font-size: 0.9rem; margin-bottom: 12px; }
.link-back:hover { color: var(--color-accent); }
.row-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.row-actions form { margin: 0; }

/* ---------- Alerts ---------- */
.alert { border-radius: 8px; padding: 11px 14px; margin: 0 0 18px; font-size: 0.9rem; }
.alert-error { background: #fdecee; color: var(--color-accent-dark); }
.alert-success { background: #e9f7ef; color: #1e7e44; }
.alert-warning { background: #fff8e1; border: 1px solid #ffd966; color: #6b5800; }

/* ---------- Auth (Login) ---------- */
.auth-body { margin: 0; display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 24px; }
.auth-card { width: 100%; max-width: 400px; background: var(--color-white); border-radius: var(--radius); box-shadow: 0 12px 40px rgba(0, 0, 0, 0.08); padding: 40px 36px; }
.auth-title { font-size: 1.35rem; font-weight: 800; margin: 0 0 20px; color: var(--color-accent); }
.auth-form { display: flex; flex-direction: column; gap: 16px; }

/* ---------- Formularfelder (Auth + App-Formulare) ---------- */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.field:last-child { margin-bottom: 0; }
.field-label { font-size: 0.85rem; font-weight: 600; color: var(--color-dark); }
.field input, .field select, .field textarea, .field-row > input {
    width: 100%; padding: 11px 13px; border: 1px solid var(--color-border); border-radius: 8px;
    font: inherit; background: #fafafa; transition: border-color 0.15s, background 0.15s; box-sizing: border-box;
}
.field input:focus, .field select:focus, .field textarea:focus, .field-row > input:focus { outline: none; border-color: var(--color-accent); background: var(--color-white); }
.field textarea { resize: vertical; min-height: 64px; font-family: inherit; }
.field input[type="file"] { border: none; padding: 0; background: none; }

/* ---------- Feld-Zeile (Datum/Uhrzeit-Paare, Zusatzfelder-Zeilen) ---------- */
.field-row { display: flex; gap: 12px; margin-bottom: 12px; }
.field-row:last-of-type { margin-bottom: 0; }
.field-row .field { flex: 1; min-width: 0; margin-bottom: 0; }
.field-row > input { flex: 1; min-width: 0; }

/* ---------- Tabellen ---------- */
.data-table { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid var(--color-border); border-radius: var(--radius); overflow: hidden; font-size: 0.9rem; }
.data-table th, .data-table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--color-border); vertical-align: middle; }
.data-table th { background: #fafafa; font-weight: 700; }
.data-table tr:last-child td { border-bottom: none; }
.data-table td.is-right, .data-table th.is-right { text-align: right; }
.data-table .muted { color: var(--color-muted); }

/* ---------- Formular-Karte (Create/Edit-Seiten) ---------- */
.form-card { background: #fff; border: 1px solid var(--color-border); border-radius: var(--radius); padding: 24px; max-width: 480px; }
.form-card-wide { max-width: 560px; }

/* ---------- Seitenkopf (Titel + Aktion) ---------- */
.page-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; gap: 16px; flex-wrap: wrap; }
.page-head .page-title { margin: 0; }
.page-head-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* ---------- Kachel-Grid (Vorlagenübersicht) ---------- */
.tile-grid { display: flex; flex-wrap: wrap; gap: 16px; }
.tile-card { background: #fff; border: 1px solid var(--color-border); border-radius: var(--radius); overflow: hidden; width: 220px; }
/* Seitenverhältnis passend zum tatsächlichen Zertifikatsformat (aspect-ratio inline gesetzt) —
   volles Zertifikat sichtbar statt querformatig beschnittenes Thumbnail (korrekturen v1 §4.1). */
.tile-card-img { width: 100%; display: block; object-fit: contain; background: var(--color-bg); cursor: zoom-in; }
.tile-card-body { padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; }
.tile-card-title { font-weight: 700; display: block; }

/* ---------- Teilnehmerliste: Filter-/Spalten-Werkzeugleiste (§5.2/§5.5/§5.6) ---------- */
.table-toolbar { background: #fff; border: 1px solid var(--color-border); border-radius: var(--radius); padding: 10px 14px; margin: 0 0 16px; display: flex; flex-direction: column; gap: 10px; }
.filter-bar { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; margin: 0; }
.filter-bar input[type="text"], .filter-bar select { padding: 8px 10px; border: 1px solid var(--color-border); border-radius: 6px; font: inherit; font-size: 0.85rem; }
.filter-bar label { font-size: 0.8rem; display: inline-flex; align-items: center; gap: 4px; color: var(--color-muted); white-space: nowrap; }

/* ---------- Teilnehmerliste: sortierbare Spaltenköpfe (§5.1) ---------- */
.sort-link { color: inherit; text-decoration: none; white-space: nowrap; display: inline-flex; align-items: center; gap: 4px; }
.sort-link:hover { color: var(--color-accent); }
.sort-link.is-active { color: var(--color-accent); font-weight: 700; }

/* ---------- Teilnehmerliste: Status-Spalte statt Einzelspalten (§5.3) ---------- */
.status-icons { display: flex; align-items: center; gap: 6px; }
.status-icon { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 50%; flex-shrink: 0; }
.status-icon svg { width: 13px; height: 13px; }
.status-icon.is-ok { background: #e9f7ef; color: #1a7f37; }
.status-icon.is-warn { background: #fff8e1; color: #9a6b00; }
.status-icon.is-error { background: #fdecee; color: var(--color-accent-dark); }
.status-icon.is-muted { background: #f0f0f0; color: var(--color-muted); }

/* ---------- Teilnehmerliste: Mehrfachauswahl & Batch-Aktionen (§5.4) ---------- */
.batch-bar { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; background: #fffaf0; border: 1px solid #ffe4a3; border-radius: 8px; padding: 8px 14px; font-size: 0.85rem; }
.batch-bar-count { font-weight: 700; }
.batch-bar [hidden] { display: none !important; }

/* ---------- Vorlagen-Editor: einklappbare Feld-Karten (§4.2) ---------- */
.field-card { background: #fff; border-radius: 8px; margin-bottom: 8px; overflow: hidden; }
.field-card > summary { padding: 10px; cursor: pointer; font-weight: 700; font-size: 0.85rem; list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.field-card > summary::-webkit-details-marker { display: none; }
.field-card > summary::after { content: '\25BE'; color: var(--color-muted); transition: transform 0.15s; flex-shrink: 0; }
.field-card[open] > summary::after { transform: rotate(180deg); }
.field-card-body { padding: 0 10px 10px; display: flex; flex-direction: column; gap: 8px; }
.field-card-row { display: flex; gap: 8px; }
.field-card-row > div { flex: 1; min-width: 0; }

/* ---------- Vorlagen-Editor: globale Typografie-Leiste (§4.3) ---------- */
.editor-globals { background: #fff; border-radius: 8px; padding: 10px; margin-bottom: 12px; display: flex; flex-direction: column; gap: 8px; }
.editor-globals-title { font-size: 0.8rem; font-weight: 700; color: var(--color-muted); text-transform: uppercase; letter-spacing: 0.3px; }

/* ---------- Vorlagen-Editor: Hilfslinien, nur während des Ziehens (§4.4) ---------- */
.editor-guide { position: absolute; background: var(--color-accent); pointer-events: none; z-index: 5; display: none; }
.editor-guide.is-active { display: block; }
.editor-guide-v { top: 0; bottom: 0; width: 1px; }
.editor-guide-h { left: 0; right: 0; height: 1px; }

/* ---------- Vorlagen-Vorschau-Modal (§4.1: Klick auf Vorschaubild -> groß, aktuelle Konfiguration) ---------- */
.vorlage-modal-overlay { position: fixed; inset: 0; z-index: 1000; background: rgba(0, 0, 0, 0.6); display: flex; align-items: center; justify-content: center; padding: 24px; }
.vorlage-modal-overlay[hidden] { display: none; }
.vorlage-modal { background: #fff; border-radius: 12px; max-width: 92vw; max-height: 92vh; display: flex; flex-direction: column; overflow: hidden; box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35); }
.vorlage-modal-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-bottom: 1px solid var(--color-border); }
.vorlage-modal-head h2 { font-size: 1rem; font-weight: 700; margin: 0; }
.vorlage-modal-close { background: none; border: none; font-size: 1.6rem; line-height: 1; cursor: pointer; color: var(--color-muted); }
.vorlage-modal-body { padding: 20px; overflow: auto; display: flex; align-items: center; justify-content: center; }
.vorlage-modal-preview { position: relative; width: auto; height: 78vh; max-width: 82vw; background-size: contain; background-position: center; background-repeat: no-repeat; border-radius: 4px; box-shadow: 0 2px 12px rgba(0, 0, 0, 0.12); }

/* ---------- Menüleiste (Veranstaltung/Vorlage/Zertifikate) — kein Wizard-Fortschritt, reine Navigation ---------- */
.wizard-stepper { display: flex; margin-bottom: 24px; background: #fff; border: 1px solid var(--color-border); border-radius: var(--radius); overflow: hidden; }
.wizard-step {
    display: block; flex: 1; padding: 10px 12px; text-align: center; font-size: 11px; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.3px; color: var(--color-muted); background: #fff;
    border-right: 1px solid var(--color-border); text-decoration: none; cursor: pointer;
}
.wizard-step:last-child { border-right: none; }
.wizard-step:hover { background: #f2f2f2; color: var(--color-text); }
.wizard-step.is-active, .wizard-step.is-active:hover { background: var(--color-accent); color: #fff; }

/* ---------- Changelog ---------- */
.changelog-list { list-style: none; padding: 0; margin: 0; max-width: 600px; display: flex; flex-direction: column; gap: 8px; }
.changelog-item { background: #fff; border: 1px solid var(--color-border); border-radius: var(--radius); padding: 14px 16px; }
.changelog-version { font-weight: 700; }
.changelog-date { color: var(--color-muted); font-size: 0.8rem; }
.changelog-text { margin: 6px 0 0; }

/* ---------- App-Footer (Version/Changelog-Link) ---------- */
.app-footer { margin-left: var(--sidebar-width); padding: 12px 40px; font-size: 0.72rem; letter-spacing: 0.04em; color: var(--color-muted); }
.app-footer-link { color: inherit; text-decoration: none; }
.app-footer-link:hover { color: var(--color-accent); text-decoration: underline; }

/* ---------- Topbar-Marke & Nutzermenü-Toggle ---------- */
.topbar-brand { display: inline-flex; align-items: center; height: 100%; }
.topbar-logo { height: 28px; width: auto; display: block; }
.user-menu { position: relative; }
.user-menu-toggle {
    display: inline-flex; align-items: center; gap: 6px;
    background: none; border: none; color: #fff; font: inherit; font-weight: 600;
    cursor: pointer; opacity: 0.9; padding: 6px 4px;
}
.user-menu-toggle:hover { opacity: 1; }
.user-menu-caret { display: inline-flex; transition: transform 0.15s; }
.user-menu-toggle[aria-expanded="true"] .user-menu-caret { transform: rotate(180deg); }
.user-menu-head-name { font-weight: 800; }
.user-menu-head-veranstalter { font-size: 12px; color: var(--color-muted); }

/* ---------- Landing (öffentliche Startseite) ---------- */
.landing-body { margin: 0; min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.landing-hero { text-align: center; padding: 24px; }
.landing-title { color: var(--color-accent); font-size: 2rem; font-weight: 800; margin: 0 0 8px; }
.landing-tagline { color: var(--color-muted); margin: 0; }
.landing-actions { margin-top: 24px; display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.landing-footer { position: fixed; bottom: 12px; font-size: 12px; color: var(--color-muted); }

/* ---------- Tags (§2.3, CDN-Referenz: Arbeitsbereiche-Tag-Funktion 1:1 übernommen) ---------- */
.tag-chip-list { display: flex; flex-wrap: wrap; gap: 5px; }
.tag-chip { background: #f0f0f0; border: 1px solid var(--color-border); color: var(--color-muted); font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 20px; white-space: nowrap; }

.tag-input-box { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; border: 1px solid var(--color-border); border-radius: 8px; padding: 6px 8px; background: #fafafa; }
.tag-input-box:focus-within { border-color: var(--color-accent); }
.tag-input-pill { display: inline-flex; align-items: center; gap: 5px; background: #fff; border: 1px solid var(--color-border); color: var(--color-text); font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 20px; }
.tag-input-pill b { cursor: pointer; color: var(--color-muted); font-weight: 700; }
.tag-input-pill b:hover { color: var(--color-accent); }
.tag-input-box input { border: none; background: none; outline: none; font: inherit; font-size: 0.85rem; flex: 1; min-width: 100px; padding: 2px; }

.tag-filter { position: relative; display: inline-block; }
.tag-filter-menu { position: absolute; top: calc(100% + 6px); left: 0; background: #fff; border: 1px solid var(--color-border); border-radius: 8px; box-shadow: 0 12px 32px rgba(0, 0, 0, 0.14); padding: 8px 10px; z-index: 20; min-width: 180px; max-height: 240px; overflow: auto; display: none; }
.tag-filter-menu.is-open { display: block; }
.tag-filter-option { display: flex; align-items: center; gap: 6px; font-size: 0.85rem; padding: 4px 0; }
.tag-sort-form { display: inline-flex; align-items: center; gap: 6px; font-size: 0.8rem; color: var(--color-muted); }
.tag-sort-form select { padding: 6px 8px; border: 1px solid var(--color-border); border-radius: 6px; font: inherit; font-size: 0.85rem; }
.tile-usage { font-size: 11px; color: var(--color-muted); margin-top: 4px; }

/* ---------- Veranstaltungsübersicht: Karten-/Tabellen-Toggle (§2.2, CDN-Referenz: .wd-view-toggle 1:1) ---------- */
.view-toggle { display: flex; border: 1px solid #d0d0d0; border-radius: 6px; overflow: hidden; }
.view-toggle button { display: inline-flex; align-items: center; gap: 6px; background: #fff; border: none; padding: 7px 12px; font: inherit; font-size: 0.8rem; font-weight: 700; cursor: pointer; color: var(--color-muted); }
.view-toggle button svg { width: 14px; height: 14px; }
.view-toggle button + button { border-left: 1px solid #d0d0d0; }
.view-toggle button.active { background: var(--color-dark); color: #fff; }

/* ---------- Veranstaltungs-Karten (§2.2, CDN-Referenz: .wd-card/.wsl-kpis) ---------- */
.ev-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.ev-card { background: #fff; border: 1px solid #e8e8e8; border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; text-decoration: none; color: inherit; transition: transform .15s, box-shadow .15s, border-color .15s; }
.ev-card:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(0,0,0,.06); border-color: #d0d0d0; }
.ev-card-body { padding: 14px 16px; flex: 1; display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.ev-card-title { font-size: 0.95rem; font-weight: 800; line-height: 1.25; margin: 2px 0 0; }
.ev-card-date { font-size: 0.78rem; font-weight: 700; color: var(--color-accent); }
.ev-card-date .muted { color: var(--color-muted); font-weight: 600; }
.ev-kpis { display: flex; border-top: 1px solid #f1f1f1; }
.ev-kpi { flex: 1; text-align: center; padding: 10px 4px; border-right: 1px solid #f1f1f1; }
.ev-kpi:last-child { border-right: none; }
.ev-kpi .v { font-size: 1rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.ev-kpi .l { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px; color: var(--color-muted); margin-top: 2px; }
.ev-foot { display: flex; align-items: center; gap: 10px; padding: 10px 16px; border-top: 1px solid #f3f3f3; background: #fafafa; }
.ev-progress { flex: 1; height: 6px; border-radius: 4px; background: #e9e9e9; overflow: hidden; }
.ev-progress span { display: block; height: 100%; background: #2fae5f; border-radius: 4px; }
.ev-progress-pct { font-size: 11px; font-weight: 700; color: var(--color-muted); font-variant-numeric: tabular-nums; min-width: 32px; text-align: right; }
.ev-card-new { border: 2px dashed #d0d0d0; border-radius: var(--radius); display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 200px; color: #9a9a9a; text-decoration: none; }
.ev-card-new:hover { border-color: var(--color-accent); background: #fef2f2; color: var(--color-accent); }
.ev-card-new .plus { font-size: 36px; font-weight: 800; line-height: 1; margin-bottom: 6px; }
.ev-card-new .lbl { font-size: 0.8rem; font-weight: 700; }

/* Bearbeitungsstand-Badge (CDN-Referenz: .wd-badge-status) */
.ev-badge { display: inline-block; padding: 3px 9px; border-radius: 4px; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .2px; white-space: nowrap; }
.ev-badge-leer { background: #e5e7eb; color: #4b5563; }
.ev-badge-vorlage_fehlt { background: #fff4d6; color: #8a5a00; }
.ev-badge-in_arbeit { background: #dbeafe; color: #1e40af; }
.ev-badge-fertig { background: #dcfce7; color: #166534; }

/* ---------- Dashboard (§2.5, CDN-Referenz: .dash-kpi/.dash-attention) ---------- */
.dash-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin: 8px 0 22px; }
.dash-kpi { background: #fff; border: 1px solid #e7e7e7; border-radius: 14px; padding: 16px 18px; display: flex; flex-direction: column; gap: 4px; text-decoration: none; color: inherit; box-shadow: 0 1px 2px rgba(0,0,0,.03); }
.dash-kpi:hover { border-color: var(--color-accent); }
.dash-kpi .ico { width: 34px; height: 34px; border-radius: 9px; background: #fdecee; color: var(--color-accent); display: flex; align-items: center; justify-content: center; margin-bottom: 6px; }
.dash-kpi .ico svg { width: 18px; height: 18px; }
.dash-kpi .v { font-size: 26px; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
.dash-kpi .l { font-size: 12px; color: #8a8a8a; font-weight: 700; text-transform: uppercase; letter-spacing: .3px; }
.dash-panel { background: #fff; border: 1px solid #e7e7e7; border-radius: 14px; padding: 16px 18px; }
.dash-panel-title { font-size: 0.9rem; font-weight: 800; margin: 0 0 12px; display: flex; align-items: center; }
.dash-attention { border-color: #f3c4c7; background: #fff7f7; }
.dash-attn-count { background: var(--color-accent); color: #fff; border-radius: 10px; padding: 1px 8px; font-size: 12px; margin-left: 8px; }
.dash-attn-list { display: flex; flex-direction: column; gap: 8px; }
.dash-attn-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 12px; border: 1px solid #eee; border-radius: 9px; background: #fff; text-decoration: none; color: inherit; }
.dash-attn-row:hover { border-color: var(--color-accent); }
.dash-attn-name { font-size: 0.85rem; font-weight: 700; }
.dash-attn-sub { color: #9a9a9a; font-weight: 600; font-size: 12px; margin-left: 8px; }
.dash-attn-tags { display: flex; gap: 6px; flex-shrink: 0; }
@media (max-width: 900px) { .dash-kpis { grid-template-columns: 1fr 1fr; } }

/* ---------- Globale Teilnehmerliste (§6) ---------- */
.table-count { margin-left: auto; font-size: 0.8rem; color: var(--color-muted); }
.data-table.is-clickable tbody tr { cursor: pointer; }
.data-table.is-clickable tbody tr:hover { background: #fafafa; }
.person-modal-email { font-size: 0.8rem; color: var(--color-muted); }
.person-modal-body { display: block; width: 640px; max-width: 86vw; max-height: 76vh; text-align: left; }
.person-event { border: 1px solid var(--color-border); border-radius: 10px; padding: 12px 14px; margin-bottom: 12px; }
.person-event:last-child { margin-bottom: 0; }
.person-event-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.person-event-title { font-weight: 800; }
.person-event-meta { font-size: 0.78rem; color: var(--color-muted); margin-top: 2px; }
.person-event-empty { font-size: 0.85rem; color: var(--color-muted); margin: 0; }
.person-cert-table { font-size: 0.82rem; }
.person-cert-table th, .person-cert-table td { padding: 7px 10px; }
.cert-badge { display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: 10px; font-weight: 700; text-transform: uppercase; }
.cert-badge-gueltig { background: #dcfce7; color: #166534; }
.cert-badge-widerrufen { background: #fdecee; color: var(--color-accent-dark); }
.cert-badge-abgelaufen { background: #e5e7eb; color: #4b5563; }

/* ---------- E-Mail-Vorlagen: Übersicht (§7.1/§7.2) ---------- */
.mail-card-body { text-decoration: none; color: inherit; }
.mail-card-badges { display: flex; gap: 6px; flex-wrap: wrap; }
.mail-card-subject { font-size: 0.82rem; font-weight: 700; color: var(--color-text); }
.mail-card-snippet { font-size: 0.78rem; color: var(--color-muted); line-height: 1.45; }
.mail-card-actions { flex-wrap: wrap; gap: 8px; justify-content: flex-start; }
.mail-card-actions form { margin: 0; }

/* ---------- E-Mail-Vorlagen: Editor (§7.3/§7.4) — Formular-Spalte rechts wie im Vorlagen-Editor (§4.2) ---------- */
.mail-editor { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 20px; align-items: start; }
.mail-editor-card { max-width: none; margin-bottom: 16px; }
.mail-editor-side { position: sticky; top: calc(var(--topbar-height) + 16px); }
.mail-editor-labelrow { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.mail-editor-toolbar { display: flex; flex-wrap: wrap; gap: 2px; padding: 4px; border: 1px solid var(--color-border); border-bottom: none; border-radius: 8px 8px 0 0; background: #fafafa; }
.mail-editor-toolbar button { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 30px; border: none; background: none; border-radius: 6px; cursor: pointer; color: var(--color-dark); }
.mail-editor-toolbar button:hover { background: #ececec; color: var(--color-accent); }
.mail-editor-toolbar button svg { width: 16px; height: 16px; }
.mail-editor-toolbar.is-disabled { opacity: .4; pointer-events: none; }
.mail-editor-visual, .mail-editor-source { width: 100%; min-height: 380px; border: 1px solid var(--color-border); border-radius: 0 0 8px 8px; padding: 16px 18px; background: #fff; font: inherit; font-size: 0.95rem; line-height: 1.6; box-sizing: border-box; }
.mail-editor-visual:focus, .mail-editor-source:focus { outline: none; border-color: var(--color-accent); }
.mail-editor-visual p { margin: 0 0 12px; }
.mail-editor-visual h2 { font-size: 1.2rem; margin: 0 0 12px; }
.mail-editor-visual a { color: var(--color-accent); }
.field .mail-editor-source { border-radius: 0 0 8px 8px; padding: 16px 18px; min-height: 380px; font-family: ui-monospace, "SFMono-Regular", Consolas, monospace; font-size: 0.82rem; background: #1e1e1e; color: #f0f0f0; resize: vertical; }
.mail-editor-hint { font-size: 0.78rem; color: var(--color-muted); margin: 4px 0 8px; }
.placeholder-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.placeholder-chip { border: 1px solid #f3c4c7; background: #fef2f2; color: var(--color-accent-dark); font-family: ui-monospace, Consolas, monospace; font-size: 0.75rem; padding: 4px 8px; border-radius: 6px; cursor: pointer; }
.placeholder-chip:hover { background: var(--color-accent); border-color: var(--color-accent); color: #fff; }
.placeholder-chip.is-static { border-color: var(--color-border); background: #f5f5f5; color: var(--color-dark); }
.choice-list { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.choice { display: flex; gap: 10px; align-items: flex-start; border: 1px solid var(--color-border); border-radius: 8px; padding: 10px 12px; cursor: pointer; }
.choice:has(input:checked) { border-color: var(--color-accent); background: #fff7f7; }
.choice input { margin-top: 3px; accent-color: var(--color-accent); }
.choice span { display: flex; flex-direction: column; gap: 2px; font-size: 0.85rem; }
.choice small { color: var(--color-muted); font-size: 0.75rem; }
@media (max-width: 1000px) { .mail-editor { grid-template-columns: 1fr; } .mail-editor-side { position: static; } }

/* ---------- Veranstaltung: Auswahlzeile E-Mail-Vorlage (Schritt „Zertifikate", §7.1) ---------- */
.inline-setting { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; background: #fff; border: 1px solid var(--color-border); border-radius: var(--radius); padding: 10px 14px; margin: 0 0 16px; font-size: 0.85rem; }
.inline-setting label { font-weight: 700; }
.inline-setting select { padding: 7px 10px; border: 1px solid var(--color-border); border-radius: 6px; font: inherit; font-size: 0.85rem; }

/* ---------- Zertifikat-Versionierung (§8) ---------- */
.cert-badge-ersetzt { background: #fff4d6; color: #8a5a00; }
/* Participant details modal: two columns (data | certificate + e-mails), wide enough to avoid scrolling. */
.td-modal-body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; align-items: start; text-align: left; width: 960px; max-width: 88vw; }
.td-modal-col { min-width: 0; }
@media (max-width: 800px) { .td-modal-body { grid-template-columns: 1fr; } }
.td-preview { position: relative; height: min(34vh, 340px); background: #f0f0f0; border-radius: 6px; overflow: hidden; margin-bottom: 4px; }
.td-preview[hidden], .td-preview-hint[hidden] { display: none; }
.td-preview-hint { margin: 0 0 12px; font-size: 0.75rem; color: var(--color-muted); }
.td-reissue-options { display: flex; flex-direction: column; gap: 4px; margin: 4px 0 12px; font-size: 0.82rem; }
.td-reissue-options label { display: flex; align-items: center; gap: 6px; }
.td-history-title { margin: 14px 0 4px; font-size: 0.85rem; }
.td-history { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; font-size: 0.82rem; }
.td-history li { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.cert-status-card { text-align: center; }

/* ---------- Teilnehmer-Import: Spalten-Mapping (B4) ---------- */
.mapping-scroll { overflow-x: auto; margin-bottom: 8px; }
.mapping-table th { vertical-align: top; min-width: 170px; }
.mapping-col-name { font-weight: 800; margin-bottom: 6px; white-space: nowrap; }
.mapping-table select { width: 100%; padding: 6px 8px; border: 1px solid var(--color-border); border-radius: 6px; font: inherit; font-size: 0.82rem; background: #fff; }
.mapping-key { display: flex; align-items: center; gap: 2px; margin-top: 6px; font-family: ui-monospace, Consolas, monospace; font-size: 0.78rem; color: var(--color-muted); }
.mapping-label { display: block; margin-top: 6px; font-size: 0.72rem; font-weight: 600; color: var(--color-muted); }
.mapping-label input { display: block; width: 100%; margin-top: 2px; padding: 4px 6px; border: 1px solid var(--color-border); border-radius: 5px; font: inherit; font-size: 0.85rem; font-weight: 400; color: var(--color-dark); }
.mapping-key input { flex: 1; min-width: 0; padding: 4px 6px; border: 1px solid var(--color-border); border-radius: 5px; font: inherit; }
.mapping-noheader { display: inline-flex; align-items: center; gap: 6px; font-size: 0.85rem; }

/* ---------- Aktivitätsprotokoll (B11) ---------- */
.audit-action { display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: 11px; font-weight: 700; background: #f0f0f0; color: var(--color-dark); white-space: nowrap; }
.audit-action-zertifikat { background: #dcfce7; color: #166534; }
.audit-action-email { background: #dbeafe; color: #1e40af; }
.audit-action-auth { background: #f3f4f6; color: #6b7280; }
.audit-action-teilnehmer, .audit-action-veranstaltung { background: #fff4d6; color: #8a5a00; }

/* ---------- Pagination (B11/B13) ---------- */
.pagination { display: flex; align-items: center; justify-content: center; gap: 12px; margin: 16px 0; font-size: 0.85rem; color: var(--color-muted); }

/* ---------- Seitengröße in der Listen-Werkzeugleiste (B13/B17) ---------- */
.table-count select { padding: 4px 6px; border: 1px solid var(--color-border); border-radius: 6px; font: inherit; font-size: 0.8rem; margin-left: 4px; }

/* ---------- Vorlagen-Rendering (gemeinsam für Kachel, Modal, Designer) ---------- */
.vr-frame { position: relative; display: block; overflow: hidden; }
.vr-canvas { position: absolute; left: 0; top: 0; transform-origin: 0 0; background: #fff no-repeat 0 0 / 100% 100%; box-shadow: 0 1px 6px rgba(0,0,0,.12); }
.vr-field { position: absolute; transform: translate(-50%, -50%); white-space: nowrap; line-height: 1.2; user-select: none; }

/* ---------- Vorlagen-Übersicht: gleich hohe Kacheln, egal ob Hoch- oder Querformat ---------- */
.vt-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; }
.vt-card { background: #fff; border: 1px solid #e8e8e8; border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; transition: box-shadow .15s, border-color .15s; }
.vt-card:hover { box-shadow: 0 6px 20px rgba(0,0,0,.06); border-color: #d0d0d0; }
.vt-card.is-active { border-color: var(--color-accent); }
.vt-preview { display: block; width: 100%; padding: 14px; border: none; border-bottom: 1px solid #f1f1f1; background: #f5f5f5; cursor: zoom-in; }
.vt-frame { height: 230px; width: 100%; }
.vt-body { flex: 1; padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.vt-title-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.vt-title { font-weight: 800; font-size: 0.92rem; }
.vt-meta { font-size: 0.78rem; color: var(--color-muted); }
.vt-actions { display: flex; gap: 8px; padding: 10px 14px; border-top: 1px solid #f3f3f3; background: #fafafa; }
.vt-actions .btn, .vt-actions form { flex: 0 0 auto; }

/* ---------- Vorlagen-Vorschau-Modal mit Eckdaten ---------- */
.vp-modal { width: min(1200px, 94vw); }
.vp-body { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 20px; padding: 18px 20px; height: min(82vh, 900px); }
.vp-stage { position: relative; height: 100%; background: #f5f5f5; border-radius: 8px; }
.vp-info { display: flex; flex-direction: column; gap: 14px; overflow: auto; }
.vp-facts { display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; margin: 0; font-size: 0.85rem; }
.vp-facts dt { color: var(--color-muted); font-weight: 700; }
.vp-facts dd { margin: 0; word-break: break-word; }
.vp-versions { list-style: none; padding: 0; margin: 6px 0 0; display: flex; flex-direction: column; gap: 4px; font-size: 0.82rem; }
.vp-versions li.is-current a { font-weight: 800; color: var(--color-accent); }
.vp-actions { margin-top: auto; display: flex; gap: 8px; flex-wrap: wrap; }
@media (max-width: 800px) { .vp-body { grid-template-columns: 1fr; height: auto; } .vp-stage { height: 60vh; } }

/* ---------- Neue Vorlage: Live-Vorschau neben dem Formular ---------- */
.vc-layout { display: flex; gap: 24px; align-items: flex-start; flex-wrap: wrap; }
.vc-preview { position: relative; width: 360px; height: 460px; background: #f5f5f5; border-radius: var(--radius); }
.mail-editor-hint.is-error { color: var(--color-accent-dark); }

/* ---------- Vorlagen-Designer: Vorschau links (volle Höhe), Menü rechts ---------- */
.ve-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 0 0 12px; }
.ve-title { font-size: 1.15rem; font-weight: 800; margin: 0; }
.ve-flash { font-size: 0.82rem; font-weight: 700; color: #1e7e44; background: #e9f7ef; border-radius: 6px; padding: 3px 10px; }
.ve-layout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 20px; min-height: 520px; }
.ve-stage { position: relative; min-width: 0; height: 100%; background: #ececec; border-radius: var(--radius); overflow: hidden; }
.ve-canvas { cursor: default; }
.ve-draggable { cursor: move; }
.ve-draggable:hover { outline: 1px dashed rgba(230, 57, 66, .6); outline-offset: 3px; }
.ve-side { display: flex; flex-direction: column; gap: 12px; min-height: 0; height: 100%; }

/* Tab-Leiste 1:1 nach CDN-Videodetailseite (.vd-blocktabs / .vd-blocktab) */
.ve-tabs { display: flex; flex-wrap: wrap; gap: 4px; background: #fff; border: 1px solid #e8e8e8; border-radius: 10px; padding: 6px; }
.ve-tab { font: inherit; font-size: 12.5px; font-weight: 700; padding: 7px 12px; border: 0; border-radius: 7px; background: transparent; color: #555; cursor: pointer; white-space: nowrap; }
.ve-tab:hover { background: #f3f3f3; }
.ve-tab.is-active { background: var(--color-accent); color: #fff; }
.ve-count { display: inline-block; min-width: 18px; padding: 0 5px; border-radius: 9px; background: rgba(0,0,0,.08); font-size: 11px; text-align: center; }
.ve-tab.is-active .ve-count { background: rgba(255,255,255,.25); }

/* Karte 1:1 nach CDN .vd-card / .vd-card-head / .vd-card-body */
.ve-card { flex: 1; min-height: 0; display: flex; flex-direction: column; background: #fff; border: 1px solid #e8e8e8; border-radius: 10px; overflow: hidden; }
.ve-card-head { padding: 12px 18px; border-bottom: 1px solid #f0f0f0; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.ve-card-head h3 { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .4px; color: #6f6f6f; margin: 0; }
.ve-card-body { padding: 14px 18px; overflow: auto; flex: 1; min-height: 0; }
.ve-card-body .field { margin-bottom: 10px; }
.ve-card-body .field input, .ve-card-body .field select { padding: 8px 10px; font-size: 0.88rem; }
.ve-card-body .field input[type="color"] { padding: 2px; height: 36px; }
.ve-subhead { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .4px; color: #6f6f6f; margin: 16px 0 8px; padding-top: 12px; border-top: 1px solid #f0f0f0; }
.ve-card-body .field-card { border: 1px solid #eee; }
.ve-card-body .field-card-body .field { margin-bottom: 0; }
.ve-card-body .field-card-body .field-label { font-size: 0.75rem; }
.ve-save { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.ve-save-hint { flex-basis: 100%; margin: 0; font-size: 0.75rem; color: var(--color-muted); }
@media (max-width: 1000px) { .ve-layout { grid-template-columns: 1fr; height: auto !important; } .ve-stage { height: 70vh; } }

/* ---------- Designer v2: Zertifikat linksbündig in voller Höhe, Menü in der restlichen Breite ---------- */
.ve-layout { grid-template-columns: auto minmax(380px, 1fr); }
.ve-stage { height: auto; align-self: start; background: transparent; border-radius: 0; overflow: visible; }
.ve-stage .vr-canvas { box-shadow: 0 2px 14px rgba(0,0,0,.14); }
.ve-saveas { position: relative; }
.ve-saveas-menu { position: absolute; bottom: calc(100% + 6px); left: 0; z-index: 30; width: 320px; background: #fff; border: 1px solid var(--color-border); border-radius: 10px; box-shadow: 0 12px 32px rgba(0,0,0,.14); padding: 6px; display: flex; flex-direction: column; gap: 2px; }
.ve-saveas-menu[hidden] { display: none; }
.ve-saveas-item { display: flex; flex-direction: column; gap: 2px; text-align: left; border: none; background: none; font: inherit; padding: 9px 12px; border-radius: 7px; cursor: pointer; color: var(--color-text); }
.ve-saveas-item:hover { background: var(--color-bg); }
.ve-saveas-item strong { font-size: 0.88rem; }
.ve-saveas-item small { font-size: 0.75rem; color: var(--color-muted); line-height: 1.35; }
@media (max-width: 1000px) { .ve-layout { grid-template-columns: 1fr; } }
.vt-actions { flex-wrap: wrap; }

/* ---------- Stabilität beim Seitenwechsel ---------- */
/* Platz für die Scrollbar immer reservieren: lange Seiten (Scrollbar) und viewport-hohe Seiten wie der
   Vorlagen-Designer (keine Scrollbar) haben sonst unterschiedlich breiten Inhalt → alles springt seitlich. */
html { scrollbar-gutter: stable; }
/* Das hidden-Attribut gewinnt immer — sonst setzen Klassen wie .btn (display:inline-flex) es außer Kraft
   (z. B. „+ Seriendruckfeld“/„+ Konstante“ erschienen im Setup-Tab). */
[hidden] { display: none !important; }

/* ---------- Designer: Feld-/Konstanten-Karten als Raster ----------
   Auf breiten Bildschirmen stehen mehrere Karten nebeneinander (je mind. 300 px), bei wenig Platz
   automatisch gestapelt. align-items:start — eine aufgeklappte Karte zieht die Nachbarn nicht mit. */
#field-panel-var, #field-panel-const { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 10px; align-items: start; }
#field-panel-var .field-card, #field-panel-const .field-card { margin-bottom: 0; min-width: 0; }

/* ---------- Rollen & Support-Modus (D37, CDN-Referenz: .support-banner) ---------- */
.support-banner { position: fixed; top: var(--topbar-height); left: 0; right: 0; z-index: 19; height: 44px; display: flex; align-items: center; justify-content: center; gap: 14px; background: #fff4d6; color: #7a4d00; border-bottom: 1px solid #f3d38a; font-size: 0.85rem; font-weight: 700; }
.support-banner form { margin: 0; }
.support-banner-leave { background: #fff; color: #9a5b00; border: none; border-radius: 6px; padding: 5px 12px; font: inherit; font-weight: 800; cursor: pointer; }
.support-banner-leave:hover { background: #ffe9cc; }
.has-support-banner .sidebar { top: calc(var(--topbar-height) + 44px); }
.has-support-banner .content { padding-top: calc(var(--topbar-height) + 44px + 32px); }
.user-menu-head-role { font-size: 11px; font-weight: 700; color: var(--color-accent); text-transform: uppercase; letter-spacing: .3px; }
.users-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; align-items: start; }
@media (max-width: 1000px) { .users-layout { grid-template-columns: 1fr; } }
.inline-form { margin: 0; }
.inline-form select { padding: 6px 8px; border: 1px solid var(--color-border); border-radius: 6px; font: inherit; font-size: 0.85rem; background: #fff; }
.user-status { display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: 11px; font-weight: 700; }
.user-status-active { background: #dcfce7; color: #166534; }
.user-status-invited { background: #dbeafe; color: #1e40af; }
.user-status-deactivated { background: #f0f0f0; color: #6b7280; }
.is-muted-row td { opacity: .6; }
.auth-link { display: inline-block; margin-top: 4px; font-size: 0.85rem; text-align: center; }
.audit-support { display: inline-block; margin-left: 6px; padding: 1px 6px; border-radius: 4px; font-size: 10px; font-weight: 800; background: #fff4d6; color: #7a4d00; text-transform: uppercase; }

/* ---------- Öffentliche Prüfseite (Modul 1) ---------- */
.pruef-code-input { font-family: ui-monospace, Consolas, monospace; letter-spacing: .5px; }
.pruef-result { display: flex; gap: 14px; align-items: flex-start; margin-top: 20px; padding: 16px; border-radius: 10px; text-align: left; }
.pruef-ok { background: #e9f7ef; color: #14532d; }
.pruef-bad { background: #fdecee; color: var(--color-accent-dark); }
.pruef-wait { background: #fff8e1; color: #6b5800; }
.pruef-icon { flex-shrink: 0; width: 38px; height: 38px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 20px; font-weight: 800; background: rgba(255,255,255,.7); }
.pruef-headline { font-size: 1.05rem; font-weight: 800; }
.pruef-meta { font-size: 0.85rem; margin-top: 2px; opacity: .85; }
.pruef-owner { margin-top: 16px; padding: 14px 16px; border: 1px dashed var(--color-border); border-radius: 10px; text-align: left; }

/* ---------- Löschregeln (Modul 7) ---------- */
.danger-card { border-color: #f3c4c7; }
.danger-btn { color: var(--color-accent-dark); border-color: #f3c4c7; }
.danger-btn:hover { background: #fdecee; }
.danger-inline { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--color-border); display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }
.cert-badge-geloescht { background: #f0f0f0; color: #6b7280; }

/* ---------- Schritt 1: Veranstaltung / Import / Zusatzfelder nebeneinander ---------- */
.event-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; align-items: start; margin-bottom: 24px; }
.event-cards .form-card { max-width: none; margin: 0; }
.card-title { font-size: 0.95rem; font-weight: 800; margin: 0 0 12px; }
@media (max-width: 1100px) { .event-cards { grid-template-columns: 1fr; } }

/* Template editor: preview record browser */
.ve-record { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; padding: 8px 10px; background: #f6f6f6; border-radius: 6px; font-size: 0.85rem; }
.ve-record-label { font-weight: 700; white-space: nowrap; }
.ve-record-info { flex: 1; min-width: 0; text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Column picker modal with on/off switches */
.col-picker-body { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); column-gap: 32px; align-content: start; justify-content: stretch; align-items: stretch; width: 780px; max-width: 88vw; max-height: 70vh; }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 10px 2px; border-bottom: 1px solid var(--color-border); cursor: pointer; font-size: 0.92rem; }
.switch { position: relative; flex: none; width: 40px; height: 22px; }
.switch input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; z-index: 1; }
.switch-slider { position: absolute; inset: 0; background: #c9c9c9; border-radius: 22px; transition: background .15s; }
.switch-slider::before { content: ''; position: absolute; left: 3px; top: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.3); transition: transform .15s; }
.switch input:checked + .switch-slider { background: var(--color-accent); }
.switch input:checked + .switch-slider::before { transform: translateX(18px); }
.switch input:focus-visible + .switch-slider { outline: 2px solid var(--color-dark); outline-offset: 2px; }
.col-picker-actions { grid-column: 1 / -1; margin-top: 16px; text-align: right; }
.col-picker-body .switch-row span:first-child { min-width: 0; overflow-wrap: anywhere; }

/* Column filters live in a second header row, next to the sortable column labels */
.data-table .filter-row th { padding-top: 0; font-weight: 400; vertical-align: top; }
.col-filter { width: 100%; min-width: 72px; padding: 4px 6px; font-size: 0.78rem; font-weight: 400; border: 1px solid var(--color-border); border-radius: 5px; background: var(--color-white); box-sizing: border-box; }
.filter-row .col-filter + .col-filter { margin-top: 4px; }
.sort-ind { font-size: 0.7rem; }
.sort-ind.is-idle { opacity: 0.35; }

/* Step 1 "Setup": text sub-menu at the left edge, one block per item */
.setup-layout { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 28px; align-items: start; margin-bottom: 24px; }
.setup-menu { display: flex; flex-direction: column; gap: 2px; position: sticky; top: 16px; }
.setup-menu-item { display: block; white-space: nowrap; padding: 8px 12px; border-left: 3px solid transparent; font-size: 0.9rem; font-weight: 600; color: var(--color-muted); text-decoration: none; border-radius: 0 6px 6px 0; }
.setup-menu-item:hover { background: #f2f2f2; color: var(--color-text); }
.setup-menu-item.is-active { border-left-color: var(--color-accent); background: #fff; color: var(--color-text); font-weight: 800; }
.setup-content .setup-panel { max-width: 560px; margin: 0 0 16px; }
.setup-content .setup-panel.setup-panel-wide { max-width: 820px; }
.chip-row { display: flex; flex-wrap: wrap; gap: 6px; }
.chip-btn { padding: 3px 9px; border: 1px solid var(--color-border); border-radius: 999px; background: #f6f6f6; font: inherit; font-family: ui-monospace, Consolas, monospace; font-size: 0.78rem; cursor: pointer; }
.chip-btn:hover { background: #fff; border-color: var(--color-accent); }
.setup-menu-item.is-danger { margin-top: 18px; color: #b3262e; }
.setup-content .setup-panel[hidden] { display: none; }
.setup-form { margin: 0; }
@media (max-width: 800px) {
    .setup-layout { grid-template-columns: 1fr; gap: 12px; }
    .setup-menu { flex-direction: row; flex-wrap: wrap; position: static; }
    .setup-menu-item { border-left: 0; border-bottom: 3px solid transparent; border-radius: 6px 6px 0 0; }
    .setup-menu-item.is-active { border-bottom-color: var(--color-accent); }
}
.col-filter-pair { display: flex; gap: 6px; }
.col-filter-pair .col-filter { flex: 1 1 0; min-width: 0; width: 50%; }
.filter-row .col-filter-pair .col-filter + .col-filter { margin-top: 0; }
.mapping-table th.is-new-col { background: #fff8e1; box-shadow: inset 0 3px 0 #f0b429; }
.mapping-bool { display: flex; flex-direction: column; gap: 4px; margin-top: 4px; }
.mapping-bool input { font-size: 0.78rem; }
.batch-bar[hidden] { display: none; }
.gruppe-block { border: 1px solid var(--color-border); border-radius: 8px; padding: 12px; background: #fff; margin-bottom: 10px; }
.gruppe-block.is-nested { background: #fafafa; margin-left: 18px; }
.gruppe-block-head { margin-bottom: 10px; }
.gruppe-cond { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 8px; }
.gruppe-cond select, .gruppe-cond input, .gruppe-block-head select { width: auto; min-width: 130px; }
.gruppe-actions { display: flex; align-items: center; gap: 10px; }
.gruppe-preview { display: flex; align-items: center; gap: 12px; margin-top: 12px; }
.ov-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.ov-kpis { border: 1px solid #e8e8e8; border-radius: 8px 8px 0 0; }
.ov-kpis .ev-kpi.is-warn .v { color: #b45309; }
.ov-foot { border: 1px solid #e8e8e8; border-top: none; border-radius: 0 0 8px 8px; }
.ov-sub { margin-top: 22px; }
.ov-todos { list-style: none; margin: 0; padding: 0; }
.ov-todo { display: flex; align-items: center; gap: 12px; padding: 9px 0; border-bottom: 1px solid #f1f1f1; }
.ov-todo-text { flex: 1; font-size: 0.9rem; }
.ov-check { width: 22px; height: 22px; border-radius: 50%; border: 2px solid #f0b429; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 800; flex: none; }
.ov-todo.is-done .ov-check { background: #2fae5f; border-color: #2fae5f; color: #fff; }
.ov-todo.is-done .ov-todo-text { color: var(--color-muted); }
.ov-todo.is-blocked .ov-check { border-color: #d0d0d0; }
.ov-todo.is-blocked .ov-todo-text { color: #9a9a9a; }
.ov-todo.is-alert .ov-check { border-color: #e63942; color: #e63942; }
.ov-facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; margin: 0; font-size: 0.9rem; }
.ov-facts dt { color: var(--color-muted); font-weight: 700; }
.ov-facts dd { margin: 0; }
.ov-groups { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: 0.9rem; }
.ov-groups li { display: flex; align-items: center; gap: 10px; }
.choice.is-disabled { opacity: 0.5; }
.choice input[type="radio"], .choice input[type="checkbox"] { width: auto; padding: 0; flex: none; }
