/* PROZESSIMPULS – Farbsystem: helles Blau-Grau als Hintergrund, weiße Karten, kräftiges Blau NUR als Akzent.
   Statusfarben bleiben semantisch: Gelb = Hinweis, Orange = Warnung, Rot = kritisch/Notfall, Grün = erfolgreich/erledigt. */
:root {
  --bg: #F4F7FB; --card: #FFFFFF; --primary: #2563EB; --primary-hover: #1D4ED8; --primary-soft: #EFF4FF; --primary-line: #BFD3FB;
  --text: #172033; --muted: #5B6B82; --line: #DCE3EC; --label: #172033;
  --ok: #15803D; --ok-soft: #DCFCE7; --hint: #92400E; --hint-soft: #FEF3C7; --hint-line: #F3DC8A;
  --warn: #C2410C; --warn-soft: #FFEDD5; --warn-line: #F8C79B; --danger: #B91C1C; --danger-soft: #FEE2E2; --danger-line: #F5AAAA;
  --r-lg: 12px; --r-md: 8px; --r-sm: 6px;
  --shadow-sm: 0 1px 2px rgba(23, 32, 51, .06); --shadow-md: 0 6px 20px rgba(23, 32, 51, .10);
  --ctl-h: 38px;
  /* Kompatibilität mit älteren Regeln */
  --accent: var(--primary); --emg: var(--danger);
}
* { box-sizing: border-box; }
.handover-export { padding: 16px 20px; margin-bottom: 16px; }
.handover-export h2 { margin-top: 0; font-size: 16px; }
.handover-export .row { align-items: end; }
body { margin: 0; font-family: "Segoe UI", system-ui, -apple-system, Roboto, sans-serif; background: var(--bg); color: var(--text); font-size: 14.5px; line-height: 1.45; }
h1, h2, h3 { color: var(--text); }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

.disclaimer { background: var(--hint-soft); color: var(--hint); border-bottom: 1px solid var(--hint-line); text-align: center; padding: 6px 12px; font-size: 12.5px; }

/* ---------- Kopfbereich ---------- */
.topbar { background: var(--card); color: var(--text); border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; padding: 12px 28px; }
.brand { display: flex; gap: 14px; align-items: center; }
.brand-mark { width: 40px; height: 40px; border-radius: var(--r-md); background: var(--primary); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 20px; }
.brand h1 { margin: 0; font-size: 18px; letter-spacing: 1.6px; }
.brand-sub { font-size: 13px; color: var(--text); }
.brand-note { font-size: 11.5px; color: var(--muted); }
/*
 * Name und Rolle des angemeldeten Benutzers bleiben deutlich lesbar: dunkle Schrift auf hellem Feld.
 * (Die zentrale Label-Regel weiter unten gilt für Formulare; hier wird sie für den Kopfbereich gezielt übersteuert.)
 */
.user-session { display: flex; align-items: center; gap: 10px; font-size: 13.5px; background: #EEF2F7; padding: 7px 12px; border-radius: var(--r-md); border: 1px solid var(--line); }
#user-role { color: #334155; font-weight: 800; letter-spacing: .2px; white-space: nowrap; }
.login-card { margin: 48px auto; padding: 28px; }
#login-error { color: var(--danger); }

/* ---------- Navigation ---------- */
.tabs { display: flex; align-items: center; gap: 2px; background: var(--card); padding: 0 24px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: thin; position: relative; }
.tab { background: transparent; border: 0; border-bottom: 3px solid transparent; color: var(--muted); padding: 12px 14px 10px; cursor: pointer; font: inherit; font-size: 13.5px; font-weight: 600; white-space: nowrap; }
.tab:hover { color: var(--text); background: var(--primary-soft); }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); }
.tab[hidden] { display: none; }

/* "Mehr"-Menü: selten benötigte Bereiche (Demo-Formular, Erfassung, Änderungsverlauf, Entwickler-Ansicht)
   bündeln, damit die Hauptnavigation nicht mit Demo-/Technikpunkten überladen ist. */
.more-menu { position: relative; margin-left: 2px; }
.more-toggle.active { color: var(--primary); border-bottom-color: var(--primary); }
.more-panel { position: fixed; z-index: 20; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-md); box-shadow: var(--shadow-md); padding: 6px; min-width: 270px; display: flex; flex-direction: column; gap: 2px; }
.more-item { background: transparent; border: 0; text-align: left; padding: 9px 10px; border-radius: var(--r-sm); font: inherit; font-size: 13.5px; font-weight: 600; color: var(--text); cursor: pointer; }
.more-item:hover { background: var(--primary-soft); }
.more-item.active { color: var(--primary); background: var(--primary-soft); }
.more-item[hidden] { display: none; }
.count { display: inline-block; min-width: 20px; padding: 0 6px; margin-left: 4px; border-radius: 999px; background: var(--primary-soft); color: var(--primary); font-size: 11px; font-weight: 700; text-align: center; }
.count:empty { display: none; }
.count.warn { background: var(--warn-soft); color: var(--warn); } .count.ok { background: var(--ok-soft); color: var(--ok); }

main { padding: 22px 28px 60px; max-width: 1400px; margin: 0 auto; }
.view { display: none; } .view.active { display: block; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 20px 22px; box-shadow: var(--shadow-sm); }
.card.narrow { max-width: 880px; margin: 0 auto 18px; }
h2 { margin: 0 0 8px; font-size: 18px; }
h3 { margin: 0 0 8px; font-size: 12px; text-transform: uppercase; letter-spacing: .7px; color: var(--muted); }
.muted { color: var(--muted); } .hint { color: var(--muted); font-size: 12.5px; margin: 0; }
.archive-intro { max-width: 880px; margin: 0 auto 14px; }

/* ---------- Formulare ---------- */
form { display: flex; flex-direction: column; gap: 14px; margin-top: 12px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
/*
 * EINE zentrale Regel für alle Feldbezeichnungen: Formulare (<label>) UND Vorgangsansichten (.kv dt, .field-view .fv-label)
 * teilen sich dieselben Werte (fett, dunkel, gleiche Größe). Wird eine Stelle geändert, bitte die anderen mitanpassen.
 */
label { display: flex; flex-direction: column; gap: 5px; font-weight: 800; font-size: 13px; color: var(--label); letter-spacing: .1px; }
label.check { flex-direction: row; align-items: center; gap: 8px; font-weight: 500; margin: 10px 0; color: var(--text); }
input, select, textarea { font: inherit; padding: 8px 10px; min-height: var(--ctl-h); border: 1px solid var(--line); border-radius: var(--r-md); background: #fff; font-weight: 400; width: 100%; color: var(--text); transition: border-color .12s, box-shadow .12s; }
textarea { min-height: 84px; }
input:hover, select:hover, textarea:hover { border-color: #B8C4D4; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37, 99, 235, .18); }
input::placeholder, textarea::placeholder { color: #8A97AB; }
input[type=checkbox] { width: auto; min-height: 0; accent-color: var(--primary); }
input:disabled, textarea:disabled, select:disabled { background: #F1F4F8; color: var(--muted); cursor: not-allowed; }
.sample-bar { background: var(--primary-soft); border: 1px solid var(--primary-line); border-radius: var(--r-md); padding: 10px 12px; margin: 14px 0 0; }
.channel-note { border: 1px solid var(--hint-line); background: var(--hint-soft); color: var(--hint); border-radius: var(--r-md); padding: 9px 12px; font-size: 12.5px; margin-top: 10px; }
.channel-note:empty { display: none; }

/* ---------- Buttons ---------- */
.btn { border: 1px solid var(--line); background: #fff; min-height: var(--ctl-h); padding: 7px 16px; border-radius: var(--r-md); font-weight: 600; cursor: pointer; font-size: 13.5px; color: var(--text); font-family: inherit; transition: background .12s, border-color .12s; }
.btn:hover { background: #F1F5FA; border-color: #B8C4D4; }
.btn.primary, .btn.approve, .btn.send { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn.primary:hover, .btn.approve:hover, .btn.send:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.btn.primary { align-self: flex-start; }
.btn.edit { background: #fff; color: var(--primary); border-color: var(--primary-line); }
.btn.edit:hover { background: var(--primary-soft); border-color: var(--primary); }
.btn.reject, .btn.danger { background: #fff; color: var(--danger); border-color: var(--danger-line); }
.btn.reject:hover, .btn.danger:hover { background: var(--danger-soft); border-color: var(--danger); }
.btn.review { background: #fff; color: var(--warn); border-color: var(--warn-line); }
.btn.ghost { background: transparent; border-color: var(--line); color: var(--muted); }
.btn.ghost:hover { color: var(--text); background: #F1F5FA; }
.btn:disabled, .btn[disabled] { opacity: .5; cursor: not-allowed; pointer-events: none; }
.btn.small { min-height: 30px; padding: 3px 11px; font-size: 12.5px; }
.link-btn { background: none; border: 0; padding: 0; color: var(--primary); font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer; text-decoration: underline; }
.link-btn:hover { color: var(--primary-hover); }
.row { display: flex; gap: 10px; flex-wrap: wrap; margin: 14px 0; align-items: center; }

/* ---------- Listen ---------- */
.split { display: grid; grid-template-columns: 390px minmax(0, 1fr); gap: 18px; align-items: start; }
.list { padding: 14px; }
.list .rows { max-height: 72vh; overflow: auto; padding: 2px; margin: 0 -2px; }
.list-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.list-head h2 { margin: 0; }
.item { border: 1px solid var(--line); border-left-width: 4px; border-radius: var(--r-md); padding: 10px 12px; margin-bottom: 8px; cursor: pointer; background: #fff; transition: border-color .12s, background .12s; }
.item:hover { border-color: var(--primary-line); background: #FAFCFF; }
.item.sel { border-color: var(--primary); background: var(--primary-soft); }
.item.rev { border-left-color: var(--warn); }
.item.emg { border-left-color: var(--danger); }
.item .t { font-weight: 700; color: var(--label); display: flex; gap: 8px; align-items: center; justify-content: space-between; }
.item .m { color: var(--muted); font-size: 12.5px; margin-top: 3px; }
.item .pills { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; margin-top: 6px; }
.review-needed-line { color: var(--warn); font-weight: 600; font-size: 12px; margin-top: 4px; }

/* ---------- Pillen / Chips (Status und Dringlichkeit sind getrennte Dinge) ---------- */
.pill { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 700; background: #E8EDF4; color: #33475B; white-space: nowrap; }
.pill.emergency { background: var(--danger); color: #fff; letter-spacing: .3px; }
.pill.manual_review { background: var(--hint-soft); color: var(--hint); }
.pill.high { background: var(--warn-soft); color: var(--warn); }
.pill.normal { background: var(--primary-soft); color: #1D4ED8; }
.pill.low { background: #E8EDF4; color: #33475B; }
.pill.NEW { background: #E8EDF4; color: #33475B; }
.pill.MANUAL_REVIEW { background: var(--warn-soft); color: var(--warn); }
.pill.READY_FOR_APPROVAL { background: var(--primary-soft); color: #1D4ED8; }
.pill.WAITING_FOR_INFORMATION { background: var(--hint-soft); color: var(--hint); }
.pill.APPROVED, .pill.IN_PROGRESS { background: var(--ok-soft); color: var(--ok); }
.pill.CLOSED { background: #E8EDF4; color: #33475B; }
.pill.archived { background: #E8EDF4; color: #475569; }
.pill.chan { background: #fff; border: 1px solid var(--line); color: var(--muted); font-weight: 600; }
.pill.assigned { background: #fff; border: 1px solid var(--primary-line); color: var(--primary); font-weight: 600; }
.pill.unassigned { background: #fff; border: 1px dashed var(--line); color: var(--muted); font-weight: 600; }
.chip { display: inline-block; padding: 1px 8px; border-radius: var(--r-sm); font-size: 12px; font-weight: 700; vertical-align: baseline; }
.chip.missing { background: #F1F5F9; color: var(--muted); border: 1px dashed #B8C4D4; font-style: italic; font-weight: 600; }
.chip.missing.blocking { background: var(--warn-soft); color: var(--warn); border-color: var(--warn-line); font-style: normal; }
.chip.review { background: var(--hint-soft); color: var(--hint); border: 1px solid var(--hint-line); }

/* ---------- Banner ---------- */
.banner { padding: 11px 14px; border-radius: var(--r-md); font-weight: 600; margin: 12px 0; border: 1px solid transparent; }
.banner.emergency { background: var(--danger); color: #fff; letter-spacing: .3px; }
.banner.warn { background: var(--hint-soft); color: var(--hint); border-color: var(--hint-line); }
.banner.ok { background: var(--ok-soft); color: var(--ok); border-color: #A7E3BC; }
.banner.err { background: var(--danger-soft); color: var(--danger); border-color: var(--danger-line); }
.banner.info { background: var(--primary-soft); color: #1E3A8A; border-color: var(--primary-line); }
.banner.review-reason { background: var(--warn-soft); color: #7C2D12; font-weight: 400; border-color: var(--warn-line); }
.banner.review-reason strong { display: block; font-weight: 800; margin-bottom: 6px; font-size: 14.5px; color: var(--warn); }
.banner.conn { margin: 0; border-radius: 0; text-align: center; position: sticky; top: 0; z-index: 30; }
[hidden] { display: none !important; }

/* Sicherheitsrelevanter Hinweis */
.safety-box { border: 1px solid var(--danger-line); border-left: 6px solid var(--danger); background: #FFF5F5; border-radius: var(--r-md); padding: 14px 16px; margin: 0 0 16px; }
.safety-box .sb-title { display: flex; align-items: center; gap: 10px; font-weight: 800; color: var(--danger); font-size: 15px; letter-spacing: .3px; }
.safety-box .sb-icon { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--danger); color: #fff; font-size: 15px; flex: none; }
.safety-box p { margin: 8px 0 0; color: #5B1A1A; }
.safety-box .tags { margin-top: 10px; }
.safety-box .tag { background: var(--danger-soft); color: var(--danger); font-weight: 700; }

/* ---------- Detailansicht ---------- */
.detail { padding: 0; overflow: hidden; }
.detail > .pad { padding: 20px 22px 8px; }
.detail-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 10px 16px; }
.detail-head h2 { margin: 0; }
.head-badges { display: flex; flex-wrap: wrap; gap: 8px 16px; }
.badge-group { display: flex; flex-direction: column; gap: 3px; }
.badge-group .bg-label { font-size: 10.5px; font-weight: 800; letter-spacing: .6px; text-transform: uppercase; color: var(--muted); }
.review-line { margin: 6px 0 0; color: var(--warn); font-weight: 600; font-size: 13px; }
.dsec { padding: 16px 22px 14px; border-top: 1px solid var(--line); }
.dsec > h3 { margin-bottom: 10px; }
.dsec .sub { margin: 12px 0 4px; font-size: 11.5px; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; }
/* Einklappbare Bereiche (Originalnachricht, Bearbeitungshistorie, Prüf-/Systemhinweise): ruhiger als
   dauerhaft sichtbare farbige Kästen, aber jederzeit einen Klick entfernt. */
details.dsec > summary { cursor: pointer; list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
details.dsec > summary::-webkit-details-marker { display: none; }
details.dsec > summary::after { content: "Anzeigen ▸"; font-size: 11.5px; font-weight: 700; color: var(--primary); text-transform: none; letter-spacing: 0; flex: none; }
details.dsec[open] > summary::after { content: "Ausblenden ▾"; }
details.dsec[open] > summary { margin-bottom: 10px; }
details.dsec .dsec-body { padding-top: 2px; }
.kv { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 9px 16px; margin: 4px 0; }
.kv dt { font-weight: 800; color: var(--label); }
.kv dt::after { content: ":"; }
.kv dd { margin: 0; color: var(--text); min-width: 0; }
.field-view { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 9px 16px; margin: 8px 0; align-items: start; }
.field-view .fv-label { font-weight: 800; color: var(--label); }
.field-view .fv-label::after { content: ":"; }
.field-view .fv-val { min-width: 0; overflow-wrap: anywhere; }
.conf-pct { color: var(--muted); font-size: 12px; margin-left: 4px; }
.msg { white-space: pre-wrap; background: #F8FAFD; border: 1px solid var(--line); border-left: 4px solid #9DB4D1; border-radius: var(--r-md); padding: 12px 14px; max-height: 280px; overflow: auto; overflow-wrap: anywhere; }
.tags { display: flex; gap: 6px; flex-wrap: wrap; } .tag { background: var(--hint-soft); color: var(--hint); padding: 2px 9px; border-radius: var(--r-sm); font-size: 12.5px; font-weight: 600; }
.tag.info { background: var(--primary-soft); color: #1D4ED8; }
.reasons { margin: 6px 0 0; padding-left: 18px; }
.editbox { border: 1.5px dashed var(--primary-line); border-radius: var(--r-md); padding: 14px; background: #F7FAFF; margin-top: 8px; }
.edit-fields { display: flex; flex-direction: column; gap: 12px; }
.conf { display: inline-block; width: 90px; height: 8px; background: #E2E8F0; border-radius: 4px; vertical-align: middle; margin-right: 8px; overflow: hidden; }
.conf > i { display: block; height: 100%; background: var(--primary); }

/* Rückfrage (fehlende Angaben) + ehrlicher Versandstatus */
.pill.delivery-sent, .pill.delivery-simulated { background: var(--ok-soft); color: var(--ok); }
.pill.delivery-failed { background: var(--danger-soft); color: var(--danger); }
.pill.delivery-not_connected { background: #E8EDF4; color: var(--muted); }

/* Mitarbeiter-Empfehlung */
.assign-box { border: 1px solid var(--primary-line); background: #F7FAFF; border-radius: var(--r-md); padding: 12px 14px; }
.assign-box .who { font-size: 15px; font-weight: 800; color: var(--text); }
.assign-box ul.why { list-style: none; margin: 8px 0 0; padding: 0; }
.assign-box ul.why li { padding: 1px 0 1px 22px; position: relative; color: var(--text); }
.assign-box ul.why li::before { content: "✓"; position: absolute; left: 2px; color: var(--ok); font-weight: 800; }
.assign-box ul.why li.warn::before { content: "!"; color: var(--warn); }
.assign-box ul.why li.warn { color: var(--warn); font-weight: 600; }
.assign-box .assign-other { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.assign-box .assign-other select { flex: 1 1 200px; width: auto; }
.assign-box .alt { margin-top: 8px; font-size: 12.5px; color: var(--muted); }

/* Verlauf */
.timeline { list-style: none; padding: 0; margin: 6px 0; border-left: 3px solid var(--line); }
.timeline li { padding: 6px 0 6px 16px; position: relative; }
.timeline li::before { content: ""; position: absolute; left: -7px; top: 11px; width: 11px; height: 11px; border-radius: 50%; background: var(--primary); border: 2px solid #fff; }
.timeline li.proc::before { background: var(--warn); }
.timeline li.edit::before { background: #94A3B8; }
.timeline .when { font-weight: 800; color: var(--label); }
.history-entry { border: 1px solid var(--line); border-radius: var(--r-md); padding: 10px 12px; margin-bottom: 8px; }
.history-entry .h-top { display: flex; justify-content: space-between; gap: 10px; }
.history-entry .h-cat { font-weight: 700; color: var(--label); }

/* Aktionsleiste: bleibt beim Scrollen der Detailansicht sichtbar */
.actions { position: sticky; bottom: 0; background: rgba(255, 255, 255, .96); border-top: 1px solid var(--line); padding: 10px 22px; z-index: 5; backdrop-filter: blur(4px); }
.actions .row { margin: 0; }
.actions .check { margin: 8px 0 0; }
.actions-msg { padding: 0 22px 12px; }

.audit { border: 1px solid var(--line); border-radius: var(--r-md); margin-bottom: 8px; padding: 8px 12px; }
.audit summary { cursor: pointer; display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.audit pre { background: #F6F8FA; padding: 10px; border-radius: var(--r-sm); overflow: auto; max-height: 320px; font-size: 12px; }
.confirm-box { border: 1.5px solid var(--danger-line); background: #FFF5F5; border-radius: var(--r-md); padding: 12px 14px; margin: 10px 22px 0; }
.confirm-box strong { color: var(--danger); }
.customer-result { border: 1px solid var(--line); border-radius: var(--r-md); padding: 9px 12px; margin-top: 8px; cursor: pointer; }
.customer-result:hover { border-color: var(--primary); background: var(--primary-soft); }
.dev-status { background: #F6F8FA; border: 1px solid var(--line); border-radius: var(--r-md); padding: 10px 12px; font-size: 12.5px; margin-bottom: 10px; font-family: ui-monospace, Consolas, monospace; }
.dev-channel { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; border: 1px solid var(--line); border-radius: var(--r-md); padding: 9px 12px; margin-bottom: 8px; }
.dev-channel .dc-desc { color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.saved-toast { display: inline-flex; align-items: center; gap: 6px; background: var(--ok-soft); color: var(--ok); font-weight: 700; padding: 6px 12px; border-radius: 999px; font-size: 12.5px; }

/* ---------- Suche und Filter ---------- */
.filter-bar { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 10px; margin-bottom: 12px; padding: 12px; border: 1px solid var(--line); border-radius: var(--r-md); background: #F8FAFD; }
.filter-bar .fb-field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.filter-bar .fb-field.wide { grid-column: 1 / -1; }
.filter-bar .fb-label { font-size: 11px; font-weight: 800; letter-spacing: .4px; text-transform: uppercase; color: var(--muted); }
.filter-bar input, .filter-bar select { min-height: 36px; padding: 6px 9px; font-size: 13px; }
.filter-bar .fb-field.active .fb-label { color: var(--primary); }
.filter-bar .fb-field.active input, .filter-bar .fb-field.active select { border-color: var(--primary); background: var(--primary-soft); }
.filter-bar .fb-foot { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; }
.filter-bar .fb-check { flex-direction: row; align-items: center; gap: 7px; font-weight: 600; font-size: 12.5px; color: var(--text); background: #fff; border: 1px solid var(--line); border-radius: var(--r-sm); padding: 6px 10px; cursor: pointer; }
.filter-bar .fb-check.active { background: var(--hint-soft); border-color: var(--hint-line); color: var(--hint); }
.filter-bar .fb-active { font-size: 12px; font-weight: 700; color: var(--primary); }
.filter-bar .fb-active:empty { display: none; }

/* ---------- Bedienhinweise: Dubletten, Bearbeiten, Verlassen ---------- */
.duplicate-box { border: 1.5px solid var(--warn-line); background: #FFF9F2; border-radius: var(--r-md); padding: 14px; margin: 0 0 16px; }
.duplicate-box strong { display: block; font-size: 15px; margin-bottom: 8px; color: var(--warn); }
.duplicate-candidate { display: flex; justify-content: space-between; align-items: center; gap: 10px; background: #fff; border: 1px solid var(--line); border-radius: var(--r-md); padding: 8px 12px; margin-bottom: 8px; flex-wrap: wrap; }
.leave-overlay { position: fixed; inset: 0; background: rgba(23, 32, 51, 0.55); display: flex; align-items: center; justify-content: center; z-index: 100; padding: 16px; }
.leave-modal { background: #fff; border-radius: var(--r-lg); padding: 22px 24px; max-width: 440px; box-shadow: var(--shadow-md); }
.leave-modal h3 { margin: 0 0 10px; text-transform: none; font-size: 16px; color: var(--label); letter-spacing: 0; }
.leave-modal p { margin: 0 0 16px; color: var(--text); }
.dirty-badge { display: inline-block; background: var(--warn); color: #fff; font-weight: 700; font-size: 11.5px; padding: 2px 9px; border-radius: 999px; margin-left: 8px; }

/* ---------- Bild-Upload mit Vorschau ---------- */
.file-previews { display: flex; flex-wrap: wrap; gap: 10px; margin: 4px 0; }
.file-chip { border: 1px solid var(--line); border-radius: var(--r-md); padding: 8px; width: 140px; background: #FAFBFD; text-align: center; }
.file-thumb { width: 100%; height: 90px; object-fit: cover; border-radius: var(--r-sm); cursor: zoom-in; background: #EEF2F7; }
.file-icon { font-size: 34px; height: 90px; display: flex; align-items: center; justify-content: center; }
.file-chip-name { font-size: 11px; color: var(--muted); margin: 6px 0; word-break: break-all; }
.file-chip-actions { display: flex; flex-wrap: wrap; gap: 4px; justify-content: center; }
.file-chip-actions .btn { padding: 3px 7px; min-height: 26px; font-size: 11px; }
.file-chip.file-rejected { width: 220px; background: var(--warn-soft); border-color: var(--warn-line); text-align: left; }
.file-chip.file-rejected .file-chip-name { color: var(--warn); }
.lightbox-modal { max-width: 90vw; max-height: 90vh; display: flex; flex-direction: column; gap: 12px; align-items: center; }
.lightbox-modal img { max-width: 90vw; max-height: 78vh; border-radius: var(--r-md); background: #fff; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) { .split { grid-template-columns: 340px minmax(0, 1fr); } }
@media (max-width: 960px) {
  .split { grid-template-columns: 1fr; }
  .list .rows { max-height: 46vh; }
  .grid2 { grid-template-columns: 1fr; }
  .kv, .field-view { grid-template-columns: 1fr; gap: 2px 0; }
  .kv dd { margin-bottom: 8px; }
  .field-view { margin: 10px 0; }
  main { padding: 16px 14px 60px; }
  .topbar { padding: 10px 14px; }
  .tabs { padding: 0 8px; }
  .dsec, .detail > .pad { padding-left: 16px; padding-right: 16px; }
  .actions { padding: 10px 16px; }
  .confirm-box { margin-left: 16px; margin-right: 16px; }
}
@media (max-width: 520px) {
  .filter-bar { padding: 10px; gap: 8px; }
  .brand-note { display: none; }
  .user-session { width: 100%; justify-content: space-between; }
  .btn { flex: 1 1 auto; }
  .actions .row .btn { flex: 1 1 calc(50% - 10px); }
}
@media (max-width: 340px) { .filter-bar { grid-template-columns: 1fr; } }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
/* Demo-Werkzeuge bleiben bis zur ausdrücklichen Bestätigung durch /api/status verborgen. */
body:not(.demo-enabled) .demo-only { display: none !important; }
