/* Boxmove Designsystem „Nachtflug“: dunkles Cockpit als Standard, heller Modus per data-theme="light". */
:root {
  --bg: #0d1117; --bg-glow: radial-gradient(1200px 600px at 20% -10%, #17324a 0%, #0d1117 55%);
  --panel: rgba(22, 30, 41, .82); --panel-solid: #161e29; --panel-2: rgba(30, 40, 54, .9);
  --line: rgba(124, 196, 255, .12); --line-strong: rgba(124, 196, 255, .26);
  --ink: #e6edf3; --muted: #8b98a8; --faint: #58657a;
  --accent: #7cc4ff; --accent-2: #2f81f7; --accent-ink: #0d1117; --accent-soft: rgba(124, 196, 255, .14); --accent-glow: rgba(47, 129, 247, .35);
  --ok: #3fb950; --ok-soft: rgba(63, 185, 80, .16);
  --warn: #ff9f6b; --warn-soft: rgba(255, 159, 107, .16); --warn-ink: #ffb994;
  --danger: #ff6b6b; --danger-soft: rgba(255, 107, 107, .16);
  --input: #0f151d; --shadow: 0 24px 70px rgba(0, 0, 0, .55);
  --radius: 14px; --radius-s: 9px;
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #f2f5f9; --bg-glow: radial-gradient(1200px 600px at 20% -10%, #dfeaf7 0%, #f2f5f9 55%);
  --panel: #ffffff; --panel-solid: #ffffff; --panel-2: #f7f9fc;
  --line: #dde5ee; --line-strong: #b9c8d8;
  --ink: #101820; --muted: #5b6875; --faint: #8a97a5;
  --accent: #1f6fd6; --accent-2: #2f81f7; --accent-ink: #ffffff; --accent-soft: #e3efff; --accent-glow: rgba(47, 129, 247, .22);
  --ok: #1f8a3c; --ok-soft: #e1f5e6;
  --warn: #c2410c; --warn-soft: #fdecdf; --warn-ink: #9a3412;
  --danger: #d03030; --danger-soft: #fde5e5;
  --input: #ffffff; --shadow: 0 20px 50px rgba(16, 24, 32, .18);
  color-scheme: light;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { background: var(--bg); }
body { margin: 0; font-family: 'IBM Plex Sans', 'Segoe UI', Helvetica, Arial, sans-serif; background: var(--bg-glow) fixed; color: var(--ink); font-size: 14px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration: none; } a:hover { text-decoration: underline; }
h1, h2, h3, .display { font-family: 'Sora', 'Segoe UI', Helvetica, Arial, sans-serif; text-wrap: balance; }
h1 { font-size: 26px; font-weight: 600; margin: 0; line-height: 1.2; }
h2 { font-size: 15px; font-weight: 600; margin: 0; }
.mono, code, pre, .log, .num { font-family: 'IBM Plex Mono', Menlo, Consolas, monospace; font-variant-numeric: tabular-nums; }
.num { font-family: 'IBM Plex Sans', sans-serif; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ---------- Gerüst ---------- */
.app { display: flex; min-height: 100vh; }
.sidebar { width: 224px; flex-shrink: 0; display: flex; flex-direction: column; padding: 22px 14px; position: sticky; top: 0; height: 100vh; border-right: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; padding: 0 10px 24px; font-family: 'Sora', sans-serif; font-weight: 700; font-size: 18px; color: var(--ink); }
.brand-mark { width: 24px; height: 24px; border-radius: 7px; background: linear-gradient(135deg, var(--accent), var(--accent-2)); box-shadow: 0 0 18px var(--accent-glow); flex-shrink: 0; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: var(--radius-s); color: var(--muted); font-weight: 500; }
.nav a svg { width: 17px; height: 17px; flex-shrink: 0; opacity: .8; }
.nav a:hover { color: var(--ink); background: var(--accent-soft); text-decoration: none; }
.nav a.active { background: var(--accent-soft); color: var(--ink); }
.nav a.active svg { opacity: 1; color: var(--accent); }
.sidebar-foot { margin-top: auto; padding: 12px 10px 0; font-size: 12px; color: var(--muted); display: flex; flex-direction: column; gap: 8px; border-top: 1px solid var(--line); }
.sidebar-foot strong { color: var(--ink); font-weight: 500; display: block; }
.sidebar-foot .who { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-foot .tools { display: flex; gap: 6px; align-items: center; }
.main { flex-grow: 1; padding: 30px 36px 48px; display: flex; flex-direction: column; gap: 22px; min-width: 0; }
.crumbs { color: var(--muted); font-size: 12px; letter-spacing: .04em; text-transform: uppercase; font-family: 'IBM Plex Mono', Menlo, monospace; }
.crumbs a { color: var(--muted); }
.sub { color: var(--muted); }
.head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.grid-3-2 { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 18px; }
.grid-2-1 { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }

/* ---------- Schaltflächen ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 9px 14px; border: 1px solid var(--line-strong); border-radius: var(--radius-s); background: transparent; color: var(--ink); font: inherit; font-weight: 500; cursor: pointer; line-height: 1.3; transition: background .15s, border-color .15s, box-shadow .15s; }
.btn:hover { background: var(--accent-soft); text-decoration: none; }
.btn.primary { background: linear-gradient(135deg, var(--accent), var(--accent-2)); border-color: transparent; color: var(--accent-ink); font-weight: 600; box-shadow: 0 0 22px var(--accent-glow); }
.btn.primary:hover { box-shadow: 0 0 30px var(--accent-glow); filter: brightness(1.06); }
.btn.dark { background: var(--ink); border-color: var(--ink); color: var(--bg); font-weight: 600; }
.btn.dark:hover { filter: brightness(.92); }
.btn.small { padding: 6px 10px; font-size: 13px; }
.btn.danger { color: var(--danger); border-color: var(--danger-soft); } .btn.danger:hover { background: var(--danger-soft); }
.btn.ghost { border-color: transparent; color: var(--muted); } .btn.ghost:hover { color: var(--ink); }
.btn.icon { padding: 6px; width: 30px; height: 30px; }
.btn[disabled] { opacity: .45; cursor: not-allowed; box-shadow: none; }
.btn svg { width: 15px; height: 15px; }

/* ---------- Flächen ---------- */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); backdrop-filter: blur(10px); }
.card.pad { padding: 20px 22px; }
.card-head { padding: 13px 20px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.card-foot { padding: 12px 20px; border-top: 1px solid var(--line); display: flex; gap: 12px; align-items: center; flex-wrap: wrap; color: var(--muted); font-size: 12px; }
.stat { padding: 16px 20px; display: flex; flex-direction: column; gap: 2px; }
.stat .label { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .06em; font-weight: 500; }
.stat .value { font-family: 'Sora', sans-serif; font-size: 28px; font-weight: 600; line-height: 1.15; font-variant-numeric: tabular-nums; }
.stat .value small { font-size: 13px; color: var(--muted); font-weight: 500; font-family: 'IBM Plex Sans', sans-serif; }
.stat .hint { font-size: 12px; color: var(--muted); }
.stat.warn { border-color: var(--warn-soft); } .stat.warn .value { color: var(--warn); }
.hero { padding: 20px 24px; display: grid; grid-template-columns: 190px minmax(0, 1fr); gap: 26px; align-items: center; }
.kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.kpi .label { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; font-weight: 500; }
.kpi .value { font-family: 'Sora', sans-serif; font-size: 24px; font-weight: 600; font-variant-numeric: tabular-nums; line-height: 1.2; }
.kpi .hint { font-size: 12px; color: var(--muted); }

/* Fortschrittsring */
.ring { position: relative; width: 150px; height: 150px; margin: 0 auto; }
.ring svg { width: 150px; height: 150px; transform: rotate(-90deg); }
.ring .track { fill: none; stroke: var(--accent-soft); stroke-width: 12; }
.ring .fill { fill: none; stroke: var(--accent); stroke-width: 12; stroke-linecap: round; filter: drop-shadow(0 0 6px var(--accent-glow)); transition: stroke-dashoffset .6s ease; }
.ring .fill.ok { stroke: var(--ok); } .ring .fill.warn { stroke: var(--warn); }
.ring .center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.ring .pct { font-family: 'Sora', sans-serif; font-size: 30px; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; }
.ring .lbl { font-size: 11px; color: var(--muted); margin-top: 4px; }

/* Phasenleiste */
.phases { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; padding: 16px 20px; }
.phase { display: flex; flex-direction: column; gap: 7px; }
.phase .track { height: 6px; border-radius: 3px; background: var(--accent-soft); }
.phase.done .track { background: var(--ok); }
.phase.current .track { background: var(--accent); box-shadow: 0 0 10px var(--accent-glow); }
.phase .name { font-weight: 500; font-size: 13px; } .phase.todo .name { color: var(--muted); } .phase.current .name { color: var(--accent); }
.phase .hint { font-size: 11px; color: var(--muted); }

/* ---------- Tabellen ---------- */
table { border-collapse: collapse; width: 100%; }
th { text-align: left; font-weight: 500; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .06em; padding: 10px 16px; border-bottom: 1px solid var(--line); }
td { padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tr.warn td { background: var(--warn-soft); } tr.active td { background: var(--accent-soft); }
tbody tr:hover td { background: var(--accent-soft); }
tr.warn:hover td { background: var(--warn-soft); }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 500; background: var(--accent-soft); color: var(--muted); white-space: nowrap; }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.ok { background: var(--ok-soft); color: var(--ok); } .pill.warn { background: var(--warn-soft); color: var(--warn); } .pill.accent { background: var(--accent-soft); color: var(--accent); }
.pill.plain::before { display: none; }
.bar { height: 6px; background: var(--accent-soft); border-radius: 3px; overflow: hidden; min-width: 80px; }
.bar > i { display: block; height: 6px; background: var(--accent); border-radius: 3px; box-shadow: 0 0 8px var(--accent-glow); transition: width .4s ease; }
.bar > i.ok { background: var(--ok); box-shadow: none; } .bar > i.warn { background: var(--warn); box-shadow: none; }
.bar.live > i { background: linear-gradient(90deg, var(--accent-2), var(--accent)); animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .55; } }

/* ---------- Formulare ---------- */
.form { display: flex; flex-direction: column; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; } .field label { font-size: 12px; color: var(--muted); font-weight: 500; }
input[type=text], input[type=password], input[type=email], input[type=number], input[type=date], input[type=time], input[type=datetime-local], input[type=search], input[type=url], input[type=tel], select, textarea { font: inherit; padding: 9px 12px; border: 1px solid var(--line-strong); border-radius: var(--radius-s); background: var(--input); color: var(--ink); width: 100%; transition: border-color .15s, box-shadow .15s; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
input[readonly] { color: var(--muted); }
input[type=file] { color: var(--muted); }
textarea { min-height: 80px; font-family: 'IBM Plex Mono', Menlo, Consolas, monospace; font-size: 12px; }
select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238b98a8' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 32px; }
.row { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; } .row > * { flex: 1 1 160px; }
.choice { display: flex; flex-direction: column; gap: 8px; }
.choice label { padding: 12px 14px; border: 1px solid var(--line-strong); border-radius: var(--radius-s); display: flex; gap: 10px; cursor: pointer; align-items: flex-start; }
.choice label:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.choice input { margin-top: 3px; accent-color: var(--accent); }
.choice .t { font-weight: 500; } .choice .d { font-size: 12px; color: var(--muted); }
.tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.tiles label { padding: 14px; border: 1px solid var(--line-strong); border-radius: var(--radius-s); cursor: pointer; display: block; }
.tiles label:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 1px var(--accent); }
.tiles input { display: none; } .tiles .t { font-weight: 600; } .tiles .d { font-size: 12px; color: var(--muted); }
input[type=checkbox], input[type=radio] { accent-color: var(--accent); }
.checks { display: flex; flex-direction: column; gap: 10px; } .checks label { display: flex; gap: 10px; align-items: center; }
.checks.inline { flex-direction: row; gap: 18px; flex-wrap: wrap; }
.unit { display: flex; align-items: center; border: 1px solid var(--line-strong); border-radius: var(--radius-s); background: var(--input); overflow: hidden; }
.unit:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.unit input { border: 0; border-radius: 0; flex: 1 1 auto; min-width: 0; box-shadow: none !important; }
.unit span { padding: 0 12px; color: var(--muted); font-size: 12px; border-left: 1px solid var(--line); align-self: stretch; display: flex; align-items: center; background: var(--panel-2); }
.opt-group { display: flex; flex-direction: column; gap: 12px; padding: 16px 0; border-top: 1px solid var(--line); }
.opt-group:first-of-type { border-top: 0; padding-top: 0; }
.opt-title { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
details summary { cursor: pointer; font-weight: 500; }
details summary::marker { color: var(--muted); }

/* Notizen, Meldungen */
.note { padding: 10px 12px; border-radius: var(--radius-s); font-size: 13px; border: 1px solid transparent; }
.note.warn { background: var(--warn-soft); color: var(--warn-ink); border-color: var(--warn-soft); } .note.ok { background: var(--ok-soft); color: var(--ok); } .note.info { background: var(--accent-soft); color: var(--accent); }
.flash { padding: 12px 16px; border-radius: var(--radius-s); border: 1px solid transparent; }
.flash.ok { background: var(--ok-soft); color: var(--ok); border-color: rgba(63,185,80,.3); } .flash.error { background: var(--danger-soft); color: var(--danger); border-color: rgba(255,107,107,.3); }
.muted { color: var(--muted); } .faint { color: var(--faint); } .small { font-size: 12px; } .ok { color: var(--ok); } .warn { color: var(--warn); } .danger { color: var(--danger); }
.empty { padding: 40px 24px; text-align: center; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 12px; }
.empty h2 { font-size: 17px; color: var(--ink); }

/* Protokoll */
.log { background: var(--panel-solid); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 20px; color: var(--ink); font-size: 12px; line-height: 1.7; white-space: pre-wrap; word-break: break-all; max-height: 520px; overflow: auto; }
.log .t, .log .time { color: var(--faint); }
.log .err { color: var(--warn); }
.log.compact { max-height: 260px; }
code, pre.code { font-size: 12px; } pre.code { background: var(--panel-solid); border: 1px solid var(--line); border-radius: var(--radius-s); padding: 12px; white-space: pre-wrap; word-break: break-all; margin: 0; }
.inline-form { display: inline; }

/* Dialoge */
dialog.dialog { border: 1px solid var(--line-strong); border-radius: var(--radius); padding: 24px; width: min(720px, calc(100vw - 48px)); background: var(--panel-solid); color: var(--ink); box-shadow: var(--shadow); }
dialog.dialog::backdrop { background: rgba(5, 9, 14, .6); backdrop-filter: blur(4px); }
dialog.dialog h2 { font-size: 18px; margin-bottom: 4px; }
dialog.dialog .grid-2 { gap: 20px; }

/* Chips, Zuordnungen, Ordnerliste */
.chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 6px 8px; border: 1px solid var(--line-strong); border-radius: var(--radius-s); background: var(--input); min-height: 42px; cursor: text; }
.chips:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 3px 6px 3px 10px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-size: 13px; line-height: 1.4; max-width: 100%; }
.chip-x { border: 0; background: transparent; color: inherit; font-size: 15px; line-height: 1; cursor: pointer; padding: 0 4px; border-radius: 999px; }
.chip-x:hover { background: rgba(124, 196, 255, .25); }
.chip-input { flex: 1 1 160px; border: 0 !important; padding: 4px 6px !important; min-width: 120px; background: transparent !important; box-shadow: none !important; }
.maprows { display: flex; flex-direction: column; gap: 6px; }
.maprow { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto; gap: 8px; align-items: center; }
.maprow .arrow { color: var(--muted); }
.folder-list { max-height: 50vh; overflow: auto; border: 1px solid var(--line-strong); border-radius: var(--radius-s); display: flex; flex-direction: column; }
.folder-item { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-bottom: 1px solid var(--line); cursor: pointer; }
.folder-item:hover { background: var(--accent-soft); }
.folder-item .folder-name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.folder-item[hidden] { display: none; }

/* Postfachtabelle, Schalter */
table.mailboxes { table-layout: fixed; }
table.mailboxes td { vertical-align: top; padding: 14px 16px; }
table.mailboxes td:last-child { text-align: right; white-space: normal; }
table.mailboxes td:last-child .btn { margin: 0 0 6px 4px; }
table.mailboxes .addr { word-break: break-all; font-weight: 500; }
table.mailboxes .addr.muted { font-weight: 400; }
table.mailboxes td.small > div + div { margin-top: 2px; }
tr.off td { opacity: .5; } tr.off td:first-child { opacity: 1; }
.switch { position: relative; display: inline-block; width: 38px; height: 22px; cursor: pointer; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; background: var(--line-strong); border-radius: 999px; transition: background .15s; }
.switch span::before { content: ""; position: absolute; width: 18px; height: 18px; left: 2px; top: 2px; background: #fff; border-radius: 50%; transition: transform .15s; box-shadow: 0 1px 2px rgba(0,0,0,.35); }
.switch input:checked + span { background: var(--ok); }
.switch input:checked + span::before { transform: translateX(16px); }
.switch input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Anmeldung und öffentliche Seiten */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.login { width: 400px; padding: 32px; display: flex; flex-direction: column; gap: 16px; }
.login .brand { padding: 0; font-size: 22px; }
.login h1 { font-size: 22px; }
.eyebrow { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; font-weight: 500; }

/* Wizard */
.steps { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.step { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; }
.step .n { width: 24px; height: 24px; border-radius: 50%; border: 1px solid var(--line-strong); display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 600; }
.step.current { color: var(--ink); } .step.current .n { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.step.done .n { background: var(--ok); border-color: var(--ok); color: #fff; }
.step-sep { width: 28px; height: 1px; background: var(--line-strong); }

/* Druck (Bericht) */
@media print {
  :root { --bg: #fff; --bg-glow: #fff; --panel: #fff; --panel-solid: #fff; --line: #d0d7de; --line-strong: #b0bac4; --ink: #101820; --muted: #5b6875; --accent: #1f6fd6; --accent-soft: #eef4fb; --ok: #1f8a3c; --ok-soft: #e1f5e6; --warn: #c2410c; --warn-soft: #fdecdf; color-scheme: light; }
  body { background: #fff; font-size: 12px; }
  .sidebar, .actions, .btn, .flash { display: none !important; }
  .main { padding: 0; }
  .card { backdrop-filter: none; box-shadow: none; }
}

@media (max-width: 1100px) { .grid-2, .grid-3-2, .grid-2-1, .stats { grid-template-columns: 1fr; } .phases { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; } .hero { grid-template-columns: 1fr; } .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 860px) {
  .app { flex-direction: column; }
  .sidebar { width: auto; height: auto; position: static; flex-direction: row; align-items: center; gap: 8px; padding: 12px 16px; border-right: 0; border-bottom: 1px solid var(--line); overflow-x: auto; }
  .brand { padding: 0 12px 0 0; }
  .nav { flex-direction: row; } .nav a span { display: none; } .nav a { padding: 8px; }
  .sidebar-foot { margin-top: 0; margin-left: auto; padding: 0; border: 0; } .sidebar-foot .who { display: none; }
  .main { padding: 20px 16px 40px; }
  .tiles { grid-template-columns: 1fr; }
}

/* Schaltflächen in Formularen nicht auf volle Breite ziehen */
.form > .btn, .stack > .btn { align-self: flex-start; }
.form > .actions .btn { align-self: auto; }

/* ---------- ÜBERSICHT: Dashboard, Assistent „Neue Migration“, Quelle/Ziel-Felder ---------- */
.nowrap { white-space: nowrap; }
.ov-table th.num-col, .ov-table td.num-col { text-align: right; }
.ov-table tr[data-href] { cursor: pointer; }
.ov-table tr[data-href] td:first-child { min-width: 180px; }
.ov-table tr.has-errors td { background: var(--warn-soft); }
.ov-path { display: flex; flex-direction: column; gap: 2px; }
.ov-arrow { color: var(--accent); font-weight: 600; }
.ov-progress { display: flex; align-items: center; gap: 10px; min-width: 150px; }
.ov-progress .bar { flex: 1 1 auto; }
.ov-progress .num { min-width: 42px; text-align: right; color: var(--muted); }
.ov-open { text-align: right; white-space: nowrap; }
.ov-empty { padding: 56px 24px; }
.ov-empty p { max-width: 560px; margin: 0; line-height: 1.6; }
.ov-cta { margin-top: 8px; padding: 12px 22px; font-size: 15px; }
/* Assistent */
.wz [hidden], .ep [hidden] { display: none !important; }
.wz-steps { padding: 0; margin: 0; list-style: none; }
.wz-steps .step { cursor: default; }
.wz-steps .step.done { cursor: pointer; }
.wz-steps .step.done:hover { color: var(--ink); }
.wz-title { display: flex; flex-direction: column; gap: 2px; padding-bottom: 4px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.wz-title h2 { font-size: 17px; }
.wz-nav { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.wz-summary { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 18px; margin: 0; }
.wz-summary > div { padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius-s); background: var(--panel-2); }
.wz-summary > div:first-child { grid-column: 1 / -1; }
.wz-summary dt { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; font-weight: 500; }
.wz-summary dd { margin: 4px 0 0; font-weight: 500; overflow-wrap: anywhere; }
.wz-help { padding: 16px 18px; border-radius: var(--radius-s); background: var(--accent-soft); border: 1px solid var(--line); }
.wz-help h3 { font-size: 14px; margin: 0 0 8px; color: var(--accent); }
.wz-help ol { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.wz-help strong { font-weight: 600; }
/* Quelle/Ziel-Felder */
.ep { display: flex; flex-direction: column; gap: 14px; }
.ep-tiles label { display: flex; flex-direction: column; gap: 4px; padding: 16px; }
.ep-tiles .t { font-family: 'Sora', sans-serif; font-size: 15px; }
.ep-tiles .d { flex: 1 1 auto; }
.ep-tile-foot { font-size: 11px; color: var(--accent); text-transform: uppercase; letter-spacing: .06em; font-weight: 500; margin-top: 6px; }
.ep-host { flex: 3 1 220px; } .ep-port { flex: 1 1 90px; } .ep-tls { flex: 1 1 150px; }
.ep-note { margin-top: 2px; }
@media (max-width: 860px) { .wz-summary { grid-template-columns: 1fr; } .wz-steps .step > span:last-child { display: none; } .wz-steps .step.current > span:last-child { display: inline; } }

/* ---------- COCKPIT: Migrationsseite (Hero, Postfachtabelle, Checkliste, Live-Log, Einstellungen-Dialog) ---------- */
.head .sub strong { color: var(--ink); font-weight: 500; }
.cockpit { grid-template-columns: minmax(0, 1fr) 340px; }
.cockpit-hero { grid-template-columns: 160px minmax(0, 1fr); padding: 22px 24px; }
.cockpit-hero .side { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.kpis.four { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 20px; }
.cockpit-hero .kpi { min-width: 0; }
.cockpit-hero .kpi .value { font-size: 22px; }
.cockpit-hero .kpi .value.mono { font-family: 'IBM Plex Mono', Menlo, Consolas, monospace; font-weight: 500; }
.cockpit-hero .kpi .value.muted { color: var(--muted); }
.cockpit-hero .phases { padding: 14px 0 0; border-top: 1px solid var(--line); gap: 8px; }
.cockpit-hero .phase .name { font-size: 12px; }
.cockpit-hero .phase .hint { display: none; }
.cockpit-hero .phase.current .hint { display: block; }
.cockpit-live { display: flex; flex-direction: column; gap: 8px; }
.cockpit-live .bar { min-width: 0; height: 8px; } .cockpit-live .bar > i { height: 8px; }
.card-head .h-sub { font-weight: 400; font-family: 'IBM Plex Sans', sans-serif; margin-left: 6px; }
.card-title h2 { font-size: 16px; }

/* Postfachtabelle: feste Spalten, Aktionen laufen nie über */
.table-wrap { overflow-x: auto; }
.cockpit-table { table-layout: fixed; min-width: 720px; }
.cockpit-table col.c-on { width: 60px; } .cockpit-table col.c-state { width: 236px; } .cockpit-table col.c-act { width: 238px; }
.cockpit-table th:first-child, .cockpit-table td:first-child { padding-left: 20px; }
.cockpit-table td { vertical-align: top; padding: 14px 14px; }
.cockpit-table td:first-child { padding-top: 16px; }
.cockpit-table .addr { font-weight: 500; overflow-wrap: anywhere; }
.cockpit-table .to { font-family: 'IBM Plex Mono', Menlo, Consolas, monospace; font-size: 12px; color: var(--muted); overflow-wrap: anywhere; margin-top: 2px; }
.cockpit-table .hint { font-size: 12px; color: var(--faint); margin-top: 5px; overflow-wrap: anywhere; line-height: 1.45; }
.cockpit-table .hint a { white-space: nowrap; }
.cockpit-table .hint .ok { color: var(--ok); } .cockpit-table .hint .warn { color: var(--warn); font-weight: 500; }
.cockpit-table .bar { min-width: 0; margin-top: 7px; }
.cockpit-table .state { font-size: 12px; margin-top: 6px; line-height: 1.4; }
.cockpit-table .state + .state { margin-top: 3px; }
.cockpit-table .size { font-family: 'IBM Plex Mono', Menlo, Consolas, monospace; font-size: 11.5px; color: var(--muted); line-height: 1.6; font-variant-numeric: tabular-nums; margin-top: 6px; }
.cockpit-table td.act { text-align: right; white-space: nowrap; padding-right: 20px; }
.cockpit-table td.act .btn { vertical-align: middle; }
.cockpit-table td.act .btn + .btn, .cockpit-table td.act .inline-form + .btn, .cockpit-table td.act .btn + .inline-form, .cockpit-table td.act .inline-form + .inline-form { margin-left: 6px; }
.cockpit-table td.act .btn.icon { font-size: 17px; line-height: 1; }
.cockpit-table tr.off td { opacity: .5; } .cockpit-table tr.off td:first-child { opacity: 1; }
.card > .empty p { margin: 0; max-width: 560px; }
.cockpit-runs { table-layout: fixed; }
.cockpit-runs td { padding: 10px 12px; }
.cockpit-runs th:first-child, .cockpit-runs td:first-child { padding-left: 20px; width: 50%; }
.cockpit-runs td.act, .cockpit-runs th:last-child { text-align: right; padding-right: 20px; width: 70px; }

/* Checkliste bis zum Stichtag (gespeichert): baut auf .checks auf, jeder Punkt eine Zeile */
.checks.checklist { display: flex; flex-direction: column; gap: 4px; padding: 10px 20px 16px; margin: 0; }
.checks.checklist label { display: flex; gap: 14px; align-items: center; padding: 6px 0; font-size: 14px; color: var(--muted); cursor: pointer; }
.checks.checklist label.done { color: var(--ink); }
.checks.checklist .txt { flex: 1 1 auto; min-width: 0; }
.checks.checklist .auto { flex: 0 0 auto; margin-left: 12px; font-size: 11px; color: var(--faint); }
.checks.checklist input { appearance: none; -webkit-appearance: none; width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line-strong); margin: 0; flex-shrink: 0; background: transparent; cursor: pointer; transition: background .15s, border-color .15s, box-shadow .15s; }
.checks.checklist input:checked { background: var(--ok) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230d1117' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E") center / 13px no-repeat; border-color: var(--ok); box-shadow: 0 0 10px rgba(63,185,80,.45); }
.checks.checklist input:disabled { cursor: default; }
.checks.checklist label:hover input:not(:checked):not(:disabled) { border-color: var(--accent); }

/* Live-Log im Panel */
.cockpit-log { border: 0; border-radius: 0 0 var(--radius) var(--radius); max-height: 300px; min-height: 120px; white-space: normal; padding: 12px 20px; color: var(--muted); word-break: normal; }
.cockpit-log .line:first-child { margin-top: 0; }
.cockpit-log .line { white-space: pre-wrap; overflow-wrap: anywhere; }
.cockpit-log .line.err { color: var(--warn); }
.cockpit-log .line.t { color: var(--faint); margin-top: 4px; }
.cockpit-log .time { color: var(--faint); margin-right: 10px; }

/* Einstellungen-Dialog mit Reitern */
.dialog-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.dialog-head h2 { margin: 0; }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 16px; }
.tab { border: 0; background: transparent; color: var(--muted); font: inherit; font-weight: 500; padding: 8px 12px; cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tab:hover { color: var(--ink); }
.tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.tab-panel[hidden] { display: none !important; }
.tab-panel .opt-group:first-child { border-top: 0; padding-top: 0; }
dialog.dialog h3 { font-size: 12px; margin: 0; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; font-weight: 600; }
dialog.dialog .actions .btn.push { margin-left: auto; }
.cockpit-consent details summary { font-size: 13px; }

@media (max-width: 1100px) { .cockpit { grid-template-columns: 1fr; } .cockpit-hero { grid-template-columns: 1fr; } }

/* ---------- SEITEN: Bühne für öffentliche Seiten (Login, Passwort, Ergebnis, Fehler), Lauf, Log, Bericht, Protokoll ---------- */
.stage { min-height: 100vh; display: flex; flex-direction: column; padding: 28px clamp(20px, 5vw, 64px) 20px; }
.stage-inner { flex: 1 1 auto; display: grid; grid-template-columns: minmax(0, 1fr) minmax(320px, 430px); gap: clamp(32px, 6vw, 96px); align-items: center; width: 100%; max-width: 1100px; margin: 0 auto; padding: 24px 0; }
.stage-inner.single { grid-template-columns: minmax(0, 560px); justify-content: center; }
.stage-side .brand { padding: 0 0 30px; font-size: 22px; }
.stage-claim { font-size: clamp(30px, 4vw, 44px); font-weight: 700; line-height: 1.12; letter-spacing: -.01em; margin: 0 0 14px; }
.stage-claim span { color: var(--accent); }
.stage-sub { color: var(--muted); font-size: 16px; max-width: 46ch; margin: 0 0 24px; }
.stage-points { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; color: var(--muted); font-size: 14px; }
.stage-points li { display: flex; gap: 12px; align-items: flex-start; }
.stage-points li::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 10px var(--accent-glow); margin-top: 7px; flex-shrink: 0; }
.stage-card { padding: 28px; display: flex; flex-direction: column; gap: 16px; box-shadow: var(--shadow); }
.stage-card h1 { font-size: 22px; }
.stage-card .brand { padding: 0; font-size: 18px; }
.stage-card p { margin: 0; }
.stage-card details { border-top: 1px solid var(--line); padding-top: 12px; }
.stage-card details .form { margin-top: 12px; }
.stage-card .btn.wide { width: 100%; }
.stage-or { display: flex; align-items: center; gap: 12px; color: var(--faint); font-size: 12px; }
.stage-or::before, .stage-or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.stage-foot { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; color: var(--faint); font-size: 12px; padding-top: 16px; }
.stage-foot a { color: var(--muted); }
.stage-icon { width: 46px; height: 46px; border-radius: 13px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.stage-icon.ok { background: var(--ok-soft); color: var(--ok); } .stage-icon.warn { background: var(--warn-soft); color: var(--warn); } .stage-icon.accent { background: var(--accent-soft); color: var(--accent); }
.stage-icon svg { width: 22px; height: 22px; }
.trust { display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; }
.trust li { display: grid; grid-template-columns: 20px 1fr; gap: 10px; font-size: 13px; color: var(--muted); }
.trust li strong { color: var(--ink); font-weight: 500; display: block; }
.trust svg { width: 18px; height: 18px; color: var(--accent); margin-top: 1px; }
.ms-mark { width: 16px; height: 16px; display: inline-grid; grid-template-columns: 1fr 1fr; gap: 1px; flex-shrink: 0; }
.ms-mark i { display: block; } .ms-mark i:nth-child(1) { background: #f25022; } .ms-mark i:nth-child(2) { background: #7fba00; } .ms-mark i:nth-child(3) { background: #00a4ef; } .ms-mark i:nth-child(4) { background: #ffb900; }

/* SEITEN: Lauf mit großem Gesamtbalken */
.bar.big { height: 12px; border-radius: 6px; } .bar.big > i { height: 12px; border-radius: 6px; }
.progress-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 24px; align-items: end; padding: 20px 22px 0; }
.progress-pct { font-family: 'Sora', sans-serif; font-size: 40px; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; }
.run-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; padding: 18px 22px 20px; }
.run-kpis .kpi .value { font-size: 20px; }
.cell-error { color: var(--warn); font-size: 12px; margin-top: 3px; }
.cell-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.pct { font-size: 12px; color: var(--muted); margin-top: 4px; font-variant-numeric: tabular-nums; }
.log.tall { max-height: calc(100vh - 230px); min-height: 240px; }

/* SEITEN: Bericht für den Kunden */
.report-title { padding: 28px 30px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 24px; align-items: start; }
.report-title .brand { padding: 0 0 18px; font-size: 16px; }
.report-title h1 { font-size: 30px; margin-top: 4px; }
.report-meta { display: grid; grid-template-columns: repeat(3, auto); justify-content: start; gap: 28px; font-size: 13px; color: var(--muted); padding-top: 6px; }
.report-meta strong { display: block; color: var(--ink); font-weight: 500; }
.report-foot { color: var(--muted); font-size: 12px; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

/* SEITEN: Protokoll, Nutzer, Mandanten, Link-Seite */
.filter-bar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; flex: 1 1 320px; } .filter-bar input { max-width: 380px; }
.tenant-id { font-family: 'IBM Plex Mono', Menlo, Consolas, monospace; font-size: 12px; max-width: 330px; }
.row > .w-140 { flex: 0 0 140px; } .row > .w-auto { flex: 0 0 auto; }
.how { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 8px; color: var(--muted); }
.how strong { color: var(--ink); font-weight: 500; }
.intro { max-width: 72ch; color: var(--muted); margin: 0; }

@media print {
  .report-title, .report-title .brand-mark, .bar > i, .btn { box-shadow: none !important; }
  .crumbs, .stage-foot, .sidebar-foot, .filter-bar { display: none !important; }
  .card, .report-title { page-break-inside: avoid; border-color: #d0d7de !important; }
  .main { gap: 14px; }
  .report-title h1 { font-size: 24px; }
  .pill { border: 1px solid currentColor; }
  .report-foot { color: #5b6875; }
}
@media (max-width: 900px) {
  .stage-inner { grid-template-columns: 1fr; gap: 28px; align-items: start; }
  .stage-side .brand { padding-bottom: 18px; }
  .run-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .report-title { grid-template-columns: 1fr; } .report-meta { grid-template-columns: 1fr; gap: 10px; }
}

/* ---------- Feinschliff Cockpit (Hauptpaket) ---------- */
.hero .phases { padding: 14px 0 0; gap: 8px; border-top: 1px solid var(--line); margin-top: 16px; }
.hero .phase .name { font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hero .phase .hint { display: none; }
.hero .phase.current .hint { display: block; }
.cockpit-log { font-size: 11.5px; line-height: 1.6; }
.cockpit-log .line { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cockpit-log .line.t { white-space: nowrap; }

/* ---------- Anbieter-Logik (Paket ANBIETER-LOGIK): empfohlener Weg im Assistenten, Cockpit-Kopf und auf der Anbieter-Seite ---------- */
.mp { display: flex; flex-direction: column; gap: 10px; }
.mp-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.mp-title { font-weight: 600; color: var(--ink); }
.mp-steps { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--ink); }
.mp-steps li::marker { color: var(--accent); font-weight: 600; }
.mp-warn { color: var(--warn-ink); }
.mp-prep summary { cursor: pointer; font-size: 13px; color: var(--accent); }
.mp-prep p { margin: 8px 0 0; font-size: 13px; color: var(--muted); max-width: 80ch; }
.wz-help .mp-head { margin-top: 4px; }
.wz-help .mp-foot { margin: 6px 0 0; }
.mp-cockpit { margin: -8px 0 0; }
.mp-cockpit > summary { cursor: pointer; }
.mp-cockpit > .mp { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); }
.mp-cockpit .mp-steps, .mp-cockpit .mp-title { color: inherit; }
.mp-cockpit .mp-warn { background: transparent; border-color: var(--warn-ink); padding: 8px 10px; }
.prof-prep { margin-top: 6px; }
.prof-prep summary { cursor: pointer; color: var(--accent); font-size: 12px; }
.prof-prep p { margin: 6px 0 0; font-size: 12px; color: var(--muted); max-width: 42ch; }
.mp-cockpit .mp-head { display: none; } /* Titel steht schon in der Zusammenfassungszeile */

/* ---------- ZWISCHENLAGER: vierte Kachel im Endpunkt-Assistenten, Lager-Karte im Cockpit ---------- */
.ep-tiles:has(> label:nth-child(4)) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cockpit-lager .stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 720px) { .cockpit-lager .stats { grid-template-columns: 1fr; } }

/* ---------- BOXMOVE-GUTHABEN: Zahlungen, Zahlungshinweis im Cockpit, Lager-Laufzeiten, Sperr-Banner ---------- */
.bill-ledger td, .bill-ledger th { padding: 10px 14px; }
.bill-ledger td.act { text-align: right; white-space: nowrap; }
.cockpit-credits .cc-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.cockpit-credits .cc-row > div { min-width: 0; }
.cockpit-credits .cc-row .btn { flex-shrink: 0; }
.lager-terms { display: flex; flex-direction: column; gap: 8px; }
.lager-terms-table td, .lager-terms-table th { padding: 8px 10px; font-size: 13px; }
.lager-terms-table td.addr { font-weight: 500; word-break: break-all; }
.lager-terms-table tr.warn td { color: var(--warn-ink); }
.lager-terms-table td.act { text-align: right; white-space: nowrap; }
.flash.account-locked, .flash.support-banner { margin-bottom: -6px; }

/* ---------- Kundensprache (Paket KUNDENSPRACHE): längere Phasennamen („Alles kopieren“, „Täglich nachziehen“) dürfen umbrechen statt abgeschnitten zu werden ---------- */
.hero .phase .name { white-space: normal; overflow: visible; text-overflow: clip; line-height: 1.25; }
