/* ==========================================================
   Velox Automatic – Portal-Stylesheet
   Gestaltung wie die Website (velox 4): IBM Plex Sans, Navy-Töne,
   eckige Buttons mit Verlauf, Rasterlinien und Lichtschein im Kopf.
   Keine externen Ressourcen, keine Inline-Styles (CSP).
   ========================================================== */

/* Schrift lokal (DSGVO). Lizenz: static/fonts/OFL-IBM-Plex-Sans.txt */
@font-face { font-family: "IBM Plex Sans"; font-weight: 400; font-style: normal; font-display: swap; src: url("../fonts/ibm-plex-sans-400.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-weight: 500; font-style: normal; font-display: swap; src: url("../fonts/ibm-plex-sans-500.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-weight: 600; font-style: normal; font-display: swap; src: url("../fonts/ibm-plex-sans-600.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-weight: 700; font-style: normal; font-display: swap; src: url("../fonts/ibm-plex-sans-700.woff2") format("woff2"); }

:root {
  --navy-900: #071a33;
  --navy-800: #0b2545;
  --navy-700: #13315c;
  --navy-600: #1d4e89;
  --navy-500: #2a64a8;
  --navy-100: #e6edf6;
  --navy-50:  #f3f6fb;
  --text:     #142236;
  --muted:    #5a6b80;
  --line:     #dde4ee;
  --white:    #ffffff;
  --gradient: linear-gradient(135deg, var(--navy-800) 0%, var(--navy-600) 100%);
  --gradient-soft: linear-gradient(135deg, var(--navy-50) 0%, #ffffff 100%);
  --shadow:   0 1px 2px rgba(11, 37, 69, .06), 0 8px 24px rgba(11, 37, 69, .07);
  --shadow-lift: 0 2px 4px rgba(11, 37, 69, .06), 0 16px 36px rgba(11, 37, 69, .12);

  /* Status-Farben (immer zusammen mit Text, nie allein) */
  --red-bg: #fdecec;   --red-fg: #8f1f1f;   --red-line: #e0a3a3;
  --amber-bg: #fdf3e1; --amber-fg: #7a4b00; --amber-line: #e8c98a;
  --green-bg: #e8f4ec; --green-fg: #1d5c33; --green-line: #a6d1b4;
  --grey-bg: #eef1f5;  --grey-fg: #44546a;

  --radius: 4px;
  --max: 1160px;
  --font: "IBM Plex Sans", "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --ease: cubic-bezier(.2, .8, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; display: flex; flex-direction: column;
  font-family: var(--font); font-size: 16px; line-height: 1.55; color: var(--text);
  background: var(--white); -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
svg { flex-shrink: 0; }
a { color: var(--navy-600); text-underline-offset: 3px; }
a:hover { color: var(--navy-800); }
h1, h2, h3 { color: var(--navy-800); line-height: 1.2; margin: 0 0 .5em; }
h1 { font-size: clamp(1.8rem, 3.4vw, 2.5rem); font-weight: 700; letter-spacing: -.02em; }
h2 { font-size: 1.15rem; font-weight: 600; letter-spacing: -.005em; }
h3 { font-size: 1rem; font-weight: 600; margin-top: 1.4em; }
p { margin: 0 0 .9em; }
.muted { color: var(--muted); }
.small { font-size: .86rem; }
.mono { font-family: var(--mono); font-size: .85em; }
.strong { font-weight: 600; }
.nowrap { white-space: nowrap; }
.eyebrow {
  display: inline-block; font-size: .76rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase;
  color: var(--navy-600); margin-bottom: 10px;
}
.lead { font-size: 1.1rem; color: var(--muted); max-width: 640px; }
.text-gradient { background: var(--gradient); -webkit-background-clip: text; background-clip: text; color: transparent; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

:focus-visible { outline: 3px solid var(--navy-500); outline-offset: 2px; }

/* ---------- Buttons (eckig, wie Website) ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  padding: 12px 22px; font: 600 .95rem var(--font); line-height: 1.2;
  border: 2px solid transparent; border-radius: 0; cursor: pointer; text-decoration: none;
  transition: transform .15s ease, box-shadow .2s ease, background-position .4s ease, color .2s, border-color .2s, background-color .2s;
}
.btn-primary {
  color: #fff;
  background: linear-gradient(135deg, var(--navy-800), var(--navy-600), var(--navy-800));
  background-size: 200% 100%;
}
.btn-primary:hover { color: #fff; background-position: 100% 0; transform: translateY(-2px); box-shadow: 0 10px 24px rgba(11, 37, 69, .25); }
.btn-outline { background: transparent; color: var(--navy-800); border-color: var(--navy-800); }
.btn-outline:hover { background: var(--navy-800); color: #fff; transform: translateY(-2px); }
.btn-danger { background: #fff; color: var(--red-fg); border-color: var(--red-fg); }
.btn-danger:hover { background: var(--red-fg); color: #fff; }
.btn-small { padding: 7px 14px; font-size: .86rem; }
.btn-large { padding: 16px 30px; font-size: 1.02rem; }
.btn-block { width: 100%; }
.btn .arrow { transition: transform .2s; }
.btn:hover .arrow { transform: translateX(4px); }
.btn[disabled] { opacity: .55; cursor: not-allowed; transform: none; box-shadow: none; }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; }
.linkbutton { background: none; border: 0; padding: 0; font: inherit; color: var(--navy-600); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.linkbutton--danger { color: var(--red-fg); }
form.inline { display: inline; }

/* ---------- Kopfbereich (wie Website-Header) ---------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, .94); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.topbar-inner, .mainnav, .content, .footer, .hero-inner { width: 100%; max-width: var(--max); margin: 0 auto; padding-left: 24px; padding-right: 24px; }
.topbar-inner { display: flex; align-items: center; gap: 24px; height: 72px; }
.topbar-logo img { height: 46px; width: auto; }
.topbar-tenant { display: flex; flex-direction: column; line-height: 1.25; padding-left: 24px; border-left: 1px solid var(--line); }
.topbar-label { font-size: .68rem; font-weight: 600; text-transform: uppercase; letter-spacing: .14em; color: var(--navy-600); }
.topbar-badge { display: flex; align-items: center; gap: 8px; font-size: .8rem; color: var(--muted); margin-left: auto; }
.topbar-badge svg { color: var(--navy-600); }
.topbar-user { display: flex; align-items: center; gap: 14px; font-size: .9rem; padding-left: 22px; border-left: 1px solid var(--line); }
.topbar-user form { margin: 0; }
.topbar-who { display: flex; flex-direction: column; line-height: 1.25; text-align: right; }
.topbar-who .muted { font-size: .78rem; }
.mainnav { display: flex; gap: 4px; overflow-x: auto; }
.mainnav a {
  position: relative; padding: 12px 14px 13px; color: var(--muted); text-decoration: none; font-weight: 500; font-size: .93rem;
  white-space: nowrap; transition: color .2s;
}
.mainnav a::after {
  content: ""; position: absolute; left: 14px; right: 14px; bottom: -1px; height: 3px;
  background: var(--gradient); transform: scaleX(0); transform-origin: left; transition: transform .3s var(--ease);
}
.mainnav a:hover { color: var(--navy-800); }
.mainnav a[aria-current="page"] { color: var(--navy-800); font-weight: 600; }
.mainnav a[aria-current="page"]::after, .mainnav a:hover::after { transform: scaleX(1); }

/* ---------- Kopf jeder Seite: Rasterlinien + Lichtschein wie im Website-Hero ---------- */
.hero { position: relative; overflow: hidden; background: var(--gradient-soft); border-bottom: 1px solid var(--line); }
.hero::before {
  content: ""; position: absolute; right: -12%; top: -60%;
  width: 60vw; height: 60vw; max-width: 760px; max-height: 760px;
  background: radial-gradient(circle, rgba(29, 78, 137, .16) 0%, rgba(29, 78, 137, 0) 65%);
  pointer-events: none;
}
.hero-grid {
  position: absolute; inset: 0; pointer-events: none;
  background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse at 78% 30%, rgba(0, 0, 0, .6), transparent 62%);
  -webkit-mask-image: radial-gradient(ellipse at 78% 30%, rgba(0, 0, 0, .6), transparent 62%);
}
.hero-inner { position: relative; padding-top: 40px; padding-bottom: 36px; }
.hero h1 { max-width: 820px; margin-bottom: 10px; }
.hero .lead { margin-bottom: 0; }
.hero--home .hero-inner { padding-top: 56px; padding-bottom: 48px; }
.hero--home h1 { font-size: clamp(2.1rem, 4.4vw, 3.2rem); margin-bottom: 16px; }
.hero--home .lead { margin-bottom: 30px; }
.hero-trust { display: flex; flex-wrap: wrap; gap: 26px; margin-top: 30px; font-size: .88rem; color: var(--muted); }
.hero-trust span { display: inline-flex; align-items: center; gap: 8px; }
.hero-trust svg { color: var(--navy-600); }
.crumbs { font-size: .86rem; margin: 0 0 8px; color: var(--muted); }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--navy-800); }

/* Alter Seitenkopf (Admin-App) bleibt nutzbar */
.pagehead { margin-bottom: 22px; }
.pagehead h1 { margin-bottom: 4px; font-size: 1.7rem; }
.pagehead p { margin: 0; }

/* ---------- Inhalt ---------- */
.content { flex: 1; padding-top: 32px; padding-bottom: 64px; }
.section { margin-bottom: 40px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.section-head h2 { margin: 0; font-size: 1.25rem; }
.section-head a { font-size: .9rem; font-weight: 500; text-decoration: none; }
.section-head a:hover { text-decoration: underline; }
.block { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 24px; margin-bottom: 24px; box-shadow: var(--shadow); }
.block > h2:first-child { margin-bottom: 14px; }
.block--flat { box-shadow: none; }
.block--danger { border-color: var(--red-line); box-shadow: none; }
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.cols--wide { grid-template-columns: 1.55fr 1fr; align-items: start; }
.cols > .block { margin-bottom: 0; }
.cols + .block, .cols + .section { margin-top: 24px; }
.more { margin: 12px 0 0; font-size: .9rem; }
.empty { color: var(--muted); margin: 0; padding: 6px 0; }

/* ---------- Kennzahlen ---------- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; margin: 0 0 28px; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.stats--6 { grid-template-columns: repeat(6, 1fr); }
.stats--4 { grid-template-columns: repeat(4, 1fr); margin-bottom: 8px; }
.stats--4 > div:nth-child(4n+1) { border-left: 0; }
.stats--4 > div:nth-child(n+5) { border-top: 1px solid var(--line); }
.stats-more { margin: 0 0 36px; text-align: right; font-size: .9rem; font-weight: 500; }
.stats-more a { text-decoration: none; }
.stats-more a:hover { text-decoration: underline; }
@media (min-width: 761px) {
  /* Einzelne Kacheln in der letzten Reihe füllen die Zeile, statt allein zu stehen. */
  .stats--4 > div:last-child:nth-child(4n+1) { grid-column: span 4; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-top: 14px; padding-bottom: 14px; }
  .stats--4 > div:last-child:nth-child(4n+1) dd { margin: 0; font-size: 1.4rem; }
  .stats--4 > div:last-child:nth-child(4n+2),
  .stats--4 > div:nth-last-child(2):nth-child(4n+1) { grid-column: span 2; }
  .stats--4 > div:last-child:nth-child(4n+3) { grid-column: span 2; }
}
.stats > div { padding: 18px 20px; border-left: 1px solid var(--line); }
.stats > div:first-child { border-left: 0; }
.stats dt { font-size: .74rem; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .1em; }
.stats dd { margin: 4px 0 0; font-size: 1.75rem; font-weight: 600; color: var(--navy-800); font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.stats .stat--feature { background: var(--gradient); color: #fff; }
.stats .stat--feature dt { color: rgba(255, 255, 255, .78); }
.stats .stat--feature dd { color: #fff; }

.facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px 28px; margin: 0; }
.facts--single { grid-template-columns: 1fr; }
.facts dt { font-size: .72rem; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .1em; }
.facts dd { margin: 3px 0 0; }

/* ---------- Paketkarten ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 22px; }
.card {
  position: relative; display: flex; flex-direction: column;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 24px 24px 22px;
  box-shadow: var(--shadow); transition: transform .2s var(--ease), box-shadow .2s, border-color .2s;
}
.card::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px; background: var(--gradient); transform: scaleX(0); transform-origin: left; transition: transform .35s var(--ease); }
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lift); border-color: #c9d5e5; }
.card:hover::before { transform: scaleX(1); }
.card-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 14px; }
.card-icon { width: 44px; height: 44px; display: grid; place-items: center; background: var(--navy-50); color: var(--navy-600); border: 1px solid var(--line); }
.card h3 { margin: 0 0 6px; font-size: 1.15rem; color: var(--navy-800); }
.card p { color: var(--muted); font-size: .95rem; margin-bottom: 14px; }
.card .label-small { font-size: .7rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--navy-600); margin: 4px 0 8px; }
.deliverables { list-style: none; padding: 0; margin: 0 0 18px; display: grid; gap: 7px; font-size: .92rem; }
.deliverables li { display: flex; gap: 10px; align-items: flex-start; }
.deliverables li::before { content: ""; flex-shrink: 0; width: 14px; height: 14px; margin-top: 4px; background: var(--navy-600); mask: url("../img/check.svg") center / contain no-repeat; -webkit-mask: url("../img/check.svg") center / contain no-repeat; }
.card-meta { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: .82rem; color: var(--muted); margin-top: auto; padding-top: 14px; border-top: 1px solid var(--line); }
.card-meta span { display: inline-flex; align-items: center; gap: 6px; }
.card-action { margin-top: 16px; }
.card-action .btn { width: 100%; }

/* Kleine Statusliste (Übersicht) */
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; align-items: center; gap: 14px; padding: 13px 0; border-bottom: 1px solid var(--line); }
.list li:last-child { border-bottom: 0; }
.list-main { flex: 1; min-width: 0; }
.list-title { font-weight: 600; color: var(--navy-800); text-decoration: none; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
a.list-title:hover { text-decoration: underline; }
.list-sub { font-size: .84rem; color: var(--muted); }
.list-side { display: flex; align-items: center; gap: 10px; white-space: nowrap; font-size: .88rem; }

/* ---------- Neuer Vorgang: Schrittleiste ---------- */
.stepper { list-style: none; display: flex; gap: 0; padding: 0; margin: 26px 0 0; counter-reset: step; max-width: 760px; }
.stepper li { flex: 1; position: relative; padding-top: 34px; font-size: .84rem; color: var(--muted); font-weight: 500; }
.stepper li::before {
  counter-increment: step; content: counter(step);
  position: absolute; top: 0; left: 0; width: 26px; height: 26px; display: grid; place-items: center;
  font-size: .8rem; font-weight: 600; background: #fff; border: 2px solid var(--line); color: var(--muted); z-index: 1;
}
.stepper li::after { content: ""; position: absolute; top: 12px; left: 26px; right: 0; height: 2px; background: var(--line); }
.stepper li:last-child::after { display: none; }
.stepper li.is-done { color: var(--navy-800); }
.stepper li.is-done::before { content: "✓"; background: var(--navy-800); border-color: var(--navy-800); color: #fff; }
.stepper li.is-done::after { background: var(--navy-800); }
.stepper li.is-current { color: var(--navy-800); font-weight: 600; }
.stepper li.is-current::before { border-color: var(--navy-600); color: var(--navy-600); }

/* ---------- Ablagefeld ---------- */
.dropzone {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
  min-height: 210px; padding: 28px 24px; cursor: pointer;
  background: var(--navy-50); border: 2px dashed #b9c8dc; transition: border-color .2s, background-color .2s;
}
.dropzone:hover, .dropzone.is-over { border-color: var(--navy-600); background: var(--navy-100); }
.dropzone input[type="file"] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.dropzone-icon { width: 54px; height: 54px; display: grid; place-items: center; background: #fff; border: 1px solid var(--line); color: var(--navy-600); margin-bottom: 14px; }
.dropzone-title { font-weight: 600; color: var(--navy-800); font-size: 1.05rem; }
.dropzone-sub { font-size: .88rem; color: var(--muted); margin-top: 4px; }
.dropzone.has-file { border-style: solid; border-color: var(--navy-600); background: #fff; }
.dropzone.has-error { border-color: var(--red-fg); background: var(--red-bg); }
.filecheck { display: none; margin-top: 14px; padding: 12px 14px; border: 1px solid var(--line); background: #fff; font-size: .9rem; align-items: center; gap: 12px; }
.filecheck.is-visible { display: flex; }
.filecheck-icon { width: 34px; height: 34px; display: grid; place-items: center; background: var(--green-bg); color: var(--green-fg); flex-shrink: 0; }
.filecheck.is-error .filecheck-icon { background: var(--red-bg); color: var(--red-fg); }
.filecheck-name { font-weight: 600; color: var(--navy-800); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }
.filecheck-facts { color: var(--muted); font-size: .84rem; }
.filecheck > div { min-width: 0; }

/* Schutzstufe als Karten */
.choice-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.choice { position: relative; display: block; padding: 16px 16px 14px; border: 1px solid var(--line); background: #fff; cursor: pointer; transition: border-color .2s, box-shadow .2s, background-color .2s; }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice-title { display: flex; align-items: center; gap: 8px; font-weight: 600; color: var(--navy-800); margin-bottom: 4px; }
.choice-title::before { content: ""; width: 14px; height: 14px; border: 2px solid #9fb2cb; border-radius: 50%; flex-shrink: 0; transition: border-color .2s, box-shadow .2s; }
.choice-text { display: block; font-size: .84rem; color: var(--muted); line-height: 1.45; }
.choice:hover { border-color: #b9c8dc; }
.choice:has(input:checked) { border-color: var(--navy-700); background: var(--navy-50); box-shadow: inset 0 0 0 1px var(--navy-700); }
.choice:has(input:checked) .choice-title::before { border-color: var(--navy-700); box-shadow: inset 0 0 0 3px #fff; background: var(--navy-700); }
.choice:has(input:focus-visible) { outline: 3px solid var(--navy-500); outline-offset: 2px; }

.formstep { padding: 0 0 26px; margin: 0 0 26px; border-bottom: 1px solid var(--line); border-left: 0; border-right: 0; border-top: 0; min-width: 0; }
.formstep:last-of-type { border-bottom: 0; margin-bottom: 0; padding-bottom: 0; }
.formstep > legend, .formstep-title { display: block; font-size: 1.1rem; font-weight: 600; color: var(--navy-800); padding: 0; margin-bottom: 16px; }
.formstep-num { width: 28px; height: 28px; display: grid; place-items: center; background: var(--gradient); color: #fff; font-size: .85rem; font-weight: 600; }
.submitbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-top: 26px; padding-top: 22px; border-top: 1px solid var(--line); }
.submitbar .hint { margin: 0; max-width: 360px; }

/* Erklärung rechts: was mit dem Dokument passiert */
.pipeline { list-style: none; margin: 0; padding: 0; position: relative; }
.pipeline li { position: relative; padding: 0 0 18px 40px; }
.pipeline li:last-child { padding-bottom: 0; }
.pipeline li::before { content: ""; position: absolute; left: 12px; top: 26px; bottom: -2px; width: 2px; background: var(--line); }
.pipeline li:last-child::before { display: none; }
.pipeline-dot { position: absolute; left: 0; top: 0; width: 26px; height: 26px; display: grid; place-items: center; background: #fff; border: 2px solid var(--navy-600); color: var(--navy-600); }
.pipeline strong { display: block; color: var(--navy-800); font-size: .95rem; }
.pipeline span { font-size: .86rem; color: var(--muted); }
.trustbox { margin-top: 20px; padding: 16px 18px; background: var(--navy-50); border-left: 3px solid var(--navy-600); font-size: .86rem; color: var(--muted); }
.trustbox strong { color: var(--navy-800); }

/* ---------- Vorgang: Fortschritt ---------- */
.progress { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; }
.progress > li { position: relative; padding: 40px 14px 0 0; }
.progress > li::before {
  content: ""; position: absolute; top: 0; left: 0; width: 30px; height: 30px; z-index: 1;
  background: #fff; border: 2px solid var(--line);
}
.progress > li::after { content: ""; position: absolute; top: 14px; left: 30px; right: 0; height: 2px; background: var(--line); }
.progress > li:last-child::after { display: none; }
.progress-label { display: block; font-weight: 600; color: var(--muted); font-size: .95rem; }
.progress-sub { display: block; font-size: .82rem; color: var(--muted); margin-top: 2px; }
.progress > li.is-done::before { background: var(--navy-800) url("../img/check-white.svg") center / 16px no-repeat; border-color: var(--navy-800); }
.progress > li.is-done::after { background: var(--navy-800); }
.progress > li.is-done .progress-label { color: var(--navy-800); }
.progress > li.is-current::before { border-color: var(--navy-600); background: #fff; box-shadow: 0 0 0 4px rgba(29, 78, 137, .15); animation: pulse 1.6s ease-in-out infinite; }
.progress > li.is-current .progress-label { color: var(--navy-800); }
.progress > li.is-failed::before { background: var(--red-fg); border-color: var(--red-fg); }
.progress > li.is-failed .progress-label { color: var(--red-fg); }
.substeps { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 5px; font-size: .84rem; color: var(--muted); }
.substeps li { display: flex; gap: 8px; align-items: center; }
.substeps li::before { content: ""; width: 7px; height: 7px; background: var(--line); flex-shrink: 0; }
.is-current .substeps li::before { background: var(--navy-500); animation: blink 1.4s ease-in-out infinite; }
.is-current .substeps li:nth-child(2)::before { animation-delay: .25s; }
.is-current .substeps li:nth-child(3)::before { animation-delay: .5s; }
.is-current .substeps li:nth-child(4)::before { animation-delay: .75s; }
.is-done .substeps li::before { background: var(--navy-800); }
.substeps .is-skipped { text-decoration: line-through; }
.progressbar { height: 4px; background: var(--navy-100); margin-top: 26px; overflow: hidden; position: relative; }
.progressbar::after { content: ""; position: absolute; top: 0; bottom: 0; left: -40%; width: 40%; background: var(--gradient); animation: slide 1.6s var(--ease) infinite; }
.progressbar[hidden] { display: none; }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 4px rgba(29, 78, 137, .15); } 50% { box-shadow: 0 0 0 8px rgba(29, 78, 137, .05); } }
@keyframes blink { 0%, 100% { opacity: .35; } 50% { opacity: 1; } }
@keyframes slide { 0% { left: -40%; } 100% { left: 100%; } }

/* Ergebnisbereich */
.result-hero { display: grid; grid-template-columns: 1fr auto; gap: 24px; align-items: center; padding: 26px 28px; background: var(--gradient); color: #fff; margin-bottom: 20px; position: relative; overflow: hidden; }
.result-hero::after { content: ""; position: absolute; inset: 0; background-image: linear-gradient(rgba(255, 255, 255, .06) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .06) 1px, transparent 1px); background-size: 40px 40px; pointer-events: none; }
.result-hero > * { position: relative; z-index: 1; }
.section > h3 { margin: 26px 0 10px; }
.result-hero h2 { color: #fff; font-size: 1.4rem; margin: 0 0 4px; }
.result-hero p { margin: 0; color: rgba(255, 255, 255, .82); }
.result-hero .btn-light { background: #fff; color: var(--navy-800); }
.result-hero .btn-light:hover { color: var(--navy-800); transform: translateY(-2px); box-shadow: 0 10px 24px rgba(0, 0, 0, .25); }
.result-saved { display: inline-flex; align-items: center; gap: 8px; margin-top: 10px; padding: 4px 10px; background: rgba(255, 255, 255, .12); font-size: .86rem; color: #fff; }

/* ---------- Tabellen ---------- */
.table { width: 100%; border-collapse: collapse; background: var(--white); font-size: .92rem; }
.content > .table, .tablewrap { border: 1px solid var(--line); box-shadow: var(--shadow); }
.tablewrap { overflow-x: auto; background: #fff; border-radius: var(--radius); }
.tablewrap .table { border: 0; }
.table th, .table td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table th { font-size: .72rem; font-weight: 600; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); background: var(--navy-50); }
.table tbody tr { transition: background-color .15s; }
.table tbody tr:hover { background: var(--navy-50); }
.table tbody tr:last-child td { border-bottom: 0; }
.table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.table td.actions { text-align: right; white-space: nowrap; }
.table td.actions > * + * { margin-left: 12px; }
.filename { max-width: 300px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
td.filename { font-weight: 500; color: var(--navy-800); }

/* ---------- Badges: Farbe + Text, nie nur Farbe ---------- */
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px; font-size: .78rem; font-weight: 600; border: 1px solid transparent; border-radius: 2px; white-space: nowrap; }
.badge--queued, .badge--running { background: var(--navy-100); color: var(--navy-700); border-color: #c6d4e8; }
.badge--running::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; animation: blink 1.4s ease-in-out infinite; }
.badge--done { background: var(--green-bg); color: var(--green-fg); border-color: var(--green-line); }
.badge--failed, .badge--overdue { background: var(--red-bg); color: var(--red-fg); border-color: var(--red-line); }
.badge--deleted { background: var(--grey-bg); color: var(--grey-fg); }
.badge--urgent { background: var(--red-bg); color: var(--red-fg); border-color: var(--red-line); }
.badge--overdue { background: var(--red-fg); color: #fff; border-color: var(--red-fg); }
.badge--soon { background: var(--amber-bg); color: var(--amber-fg); border-color: var(--amber-line); }
.badge--planned { background: var(--grey-bg); color: var(--grey-fg); border-color: var(--line); }
.badge--sens-standard { background: var(--grey-bg); color: var(--grey-fg); }
.badge--sens-sensibel { background: var(--amber-bg); color: var(--amber-fg); border-color: var(--amber-line); }
.badge--sens-gesperrt { background: var(--navy-800); color: #fff; }
.badge--health-ok { background: var(--green-bg); color: var(--green-fg); border-color: var(--green-line); }
.badge--health-degraded { background: var(--amber-bg); color: var(--amber-fg); border-color: var(--amber-line); }
.badge--health-down { background: var(--red-bg); color: var(--red-fg); border-color: var(--red-line); }
.badge--health-unknown { background: var(--grey-bg); color: var(--grey-fg); }
.badge--user-active { background: var(--green-bg); color: var(--green-fg); }
.badge--user-invited { background: var(--navy-100); color: var(--navy-700); }
.badge--user-locked, .badge--tenant-locked { background: var(--red-bg); color: var(--red-fg); }
.badge--tenant-active { background: var(--green-bg); color: var(--green-fg); }
.row--overdue td:first-child { box-shadow: inset 3px 0 0 var(--red-fg); }
.row--urgent td:first-child { box-shadow: inset 3px 0 0 var(--red-line); }
.row--soon td:first-child { box-shadow: inset 3px 0 0 var(--amber-line); }
.legend { list-style: none; padding: 0; margin: 0 0 16px; display: flex; flex-wrap: wrap; gap: 8px 22px; font-size: .86rem; color: var(--muted); }
.legend .badge { margin-right: 6px; }
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; background: var(--grey-fg); }
.dot--ok { background: var(--green-fg); }
.dot--degraded { background: #c58a00; }
.dot--down { background: var(--red-fg); }

/* ---------- Hinweise ---------- */
.alert { padding: 12px 16px; border-left: 4px solid; background: var(--white); margin-bottom: 18px; }
.alert--error { border-color: var(--red-fg); background: var(--red-bg); color: var(--red-fg); }
.alert--warn { border-color: var(--amber-fg); background: var(--amber-bg); color: var(--amber-fg); }
.alert--ok { border-color: var(--green-fg); background: var(--green-bg); color: var(--green-fg); }
.notice { padding: 14px 18px; margin: 0 0 18px; background: var(--navy-50); border-left: 4px solid var(--navy-600); font-size: .9rem; }
.notice--ai strong { display: block; color: var(--navy-800); margin-bottom: 2px; }

/* ---------- Formulare ---------- */
.form { display: grid; gap: 18px; }
.form--row { grid-template-columns: 2fr 1fr auto; align-items: end; }
.field { margin: 0; padding: 0; border: 0; min-width: 0; }
.field label, .field legend { display: block; font-size: .84rem; font-weight: 600; margin-bottom: 6px; color: var(--navy-800); padding: 0; }
.field input[type="text"], .field input[type="email"], .field input[type="date"], .field input[type="number"],
.field input[type="url"], .field input[type="password"], .field input[type="file"], .field select {
  width: 100%; padding: 11px 13px; font: 400 .95rem var(--font); color: var(--text);
  border: 1px solid #cdd7e4; border-radius: 0; background: #fff; transition: border-color .2s, box-shadow .2s;
}
.field input:focus, .field select:focus { border-color: var(--navy-500); outline: none; box-shadow: 0 0 0 3px rgba(42, 100, 168, .15); }
.field--actions { display: flex; gap: 8px; align-items: flex-end; }
.hint { font-size: .84rem; color: var(--muted); margin: 7px 0 0; }
.radio { display: flex; gap: 10px; align-items: flex-start; font-weight: 400 !important; padding: 10px 12px; border: 1px solid var(--line); margin-bottom: 6px; cursor: pointer; }
.radio input { margin-top: 3px; accent-color: var(--navy-700); }
.radio:has(input:checked) { border-color: var(--navy-700); background: var(--navy-50); }
.checkbox { display: flex; gap: 8px; align-items: center; font-weight: 400 !important; }
.filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; align-items: end; background: var(--white); border: 1px solid var(--line); padding: 16px 18px; margin-bottom: 18px; box-shadow: var(--shadow); }
.pager { display: flex; gap: 16px; justify-content: center; align-items: center; padding: 16px 0; font-size: .9rem; }

/* ---------- Login / Fehler ---------- */
.page-center { align-items: center; justify-content: center; padding: 24px; background: var(--gradient-soft); }
.panel { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 34px; width: 100%; box-shadow: var(--shadow-lift); }
.panel--narrow { max-width: 460px; }
.panel-logo { width: 150px; height: auto; margin-bottom: 22px; }
.devlogin { margin-top: 28px; padding-top: 20px; border-top: 1px dashed var(--line); }

.login { flex: 1; display: grid; grid-template-columns: 1.1fr 1fr; min-height: 100vh; }
.login-side { position: relative; overflow: hidden; background: var(--gradient); color: #fff; padding: 56px; display: flex; flex-direction: column; justify-content: space-between; }
.login-side::after { content: ""; position: absolute; inset: 0; background-image: linear-gradient(rgba(255, 255, 255, .07) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .07) 1px, transparent 1px); background-size: 56px 56px; mask-image: radial-gradient(ellipse at 30% 40%, #000, transparent 70%); -webkit-mask-image: radial-gradient(ellipse at 30% 40%, #000, transparent 70%); pointer-events: none; }
.login-side > * { position: relative; z-index: 1; }
.login-side .eyebrow { color: rgba(255, 255, 255, .75); }
.login-side h1 { color: #fff; font-size: clamp(2rem, 3.6vw, 2.9rem); max-width: 520px; }
.login-side .lead { color: rgba(255, 255, 255, .8); }
.login-logo { background: #fff; padding: 6px 10px; display: inline-block; align-self: flex-start; }
.login-logo img { height: 46px; width: auto; }
.login-trust { display: grid; gap: 12px; font-size: .92rem; color: rgba(255, 255, 255, .85); }
.login-trust span { display: flex; align-items: center; gap: 10px; }
.login-main { display: flex; align-items: center; justify-content: center; padding: 48px 24px; background: #fff; }
.login-main .panel { box-shadow: none; border: 0; padding: 0; }

/* ---------- Footer ---------- */
.footer { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; padding-top: 18px; padding-bottom: 22px; font-size: .8rem; color: var(--muted); border-top: 1px solid var(--line); }
.footer span { display: inline-flex; align-items: center; gap: 6px; }

/* ---------- Admin-App ---------- */
.admin-flag { background: var(--navy-900); color: #fff; font-size: .75rem; letter-spacing: .1em; text-transform: uppercase; padding: 4px 24px; }
.ampel { display: inline-flex; align-items: center; gap: 6px; }
.ampel::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--grey-fg); flex-shrink: 0; }
.ampel--ok::before { background: var(--green-fg); }
.ampel--degraded::before { background: #c58a00; }
.ampel--down::before { background: var(--red-fg); }

/* ---------- Einblenden ---------- */
.reveal { animation: rise .6s var(--ease) both; }
.reveal-2 { animation-delay: .08s; }
.reveal-3 { animation-delay: .16s; }
.reveal-4 { animation-delay: .24s; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

@media (max-width: 980px) {
  .topbar-badge { display: none; }
  .topbar-user { margin-left: auto; }
  .stats--6 { grid-template-columns: repeat(3, 1fr); }
  .stats--6 > div:nth-child(4) { border-left: 0; }
  .stats--6 > div:nth-child(n+4) { border-top: 1px solid var(--line); }
  .cols--wide { grid-template-columns: 1fr; }
  .login { grid-template-columns: 1fr; }
  .login-side { padding: 36px 24px; min-height: auto; }
}
@media (max-width: 760px) {
  .cols, .facts, .form--row, .choice-grid { grid-template-columns: 1fr; }
  .stats, .stats--6 { grid-template-columns: 1fr 1fr; }
  .stats > div { border-left: 0 !important; border-top: 1px solid var(--line); }
  .stats > div:nth-child(-n+2) { border-top: 0; }
  .stats > div:nth-child(even) { border-left: 1px solid var(--line) !important; }
  .stats--4 > div:last-child:nth-child(odd) { grid-column: span 2; }
  .filters { grid-template-columns: 1fr 1fr; }
  .topbar-inner { height: auto; flex-wrap: wrap; padding-top: 12px; padding-bottom: 12px; gap: 12px; }
  .topbar-tenant { padding-left: 12px; }
  .topbar-user { margin-left: 0; width: 100%; padding-left: 0; border-left: 0; justify-content: space-between; }
  .topbar-who { text-align: left; }
  .progress { grid-template-columns: 1fr; gap: 18px; }
  .progress > li { padding: 0 0 0 44px; min-height: 30px; }
  .progress > li::after { display: none; }
  .result-hero { grid-template-columns: 1fr; }
  .stepper li { font-size: 0; }
  .content > .table, .block .table { display: block; overflow-x: auto; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } }

.formstep > legend label { font: inherit; color: inherit; margin: 0; }

/* ---------- Mehrere Dateien ---------- */
.filechecks { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 8px; }
.filechecks:empty { display: none; }
.filecheck-err { display: none; }
.filecheck.is-error .filecheck-ok { display: none; }
.filecheck.is-error .filecheck-err { display: inline; }
.filecheck.is-error { border-color: var(--red-line); }
.filecheck.is-error .filecheck-facts { color: var(--red-fg); }
.filecheck-sum { font-size: .84rem; color: var(--muted); padding: 2px 2px 0; }

/* ---------- Ergebnis-Blöcke ---------- */
.rblocks { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; margin: 4px 0 8px; align-items: start; }
.rblock { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; box-shadow: var(--shadow); min-width: 0; }
.rblock--text, .rblock--draft, .rblock--checklist, .rblock--notice { grid-column: 1 / -1; }
.rblock-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.rblock-head h3 { margin: 0; font-size: 1.05rem; }
.rblock-meta { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.prose p { margin: 0 0 .8em; }
.prose ul { margin: 0 0 .9em; padding-left: 1.2em; }
.prose li { margin-bottom: .3em; }
.prose > :last-child { margin-bottom: 0; }
.rfacts { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px 20px; margin: 0; }
.rfacts dt { font-size: .72rem; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .1em; }
.rfacts dd { margin: 3px 0 0; font-weight: 500; color: var(--navy-800); overflow-wrap: anywhere; }
.checklist { list-style: none; margin: 0; padding: 0; }
.checklist-item { display: grid; grid-template-columns: 22px 1fr auto; gap: 12px; align-items: start; padding: 10px 0; border-bottom: 1px solid var(--line); }
.checklist-item:last-child { border-bottom: 0; }
.checklist-mark { width: 18px; height: 18px; margin-top: 2px; border: 2px solid var(--line); }
.checklist-item--ok .checklist-mark { background: var(--green-fg) url("../img/check-white.svg") center / 12px no-repeat; border-color: var(--green-fg); }
.checklist-item--missing .checklist-mark { background: var(--red-fg); border-color: var(--red-fg); }
.checklist-item--warn .checklist-mark { background: var(--amber-bg); border-color: #c58a00; }
.checklist-item--info .checklist-mark { background: var(--navy-100); border-color: var(--navy-500); }
.checklist-label { display: block; font-weight: 500; color: var(--navy-800); overflow-wrap: anywhere; }
.checklist-note { display: block; font-size: .84rem; color: var(--muted); }
.checklist-status { font-size: .78rem; font-weight: 600; white-space: nowrap; color: var(--muted); }
.checklist-item--missing .checklist-status { color: var(--red-fg); }
.checklist-item--warn .checklist-status { color: var(--amber-fg); }
.checklist-item--ok .checklist-status { color: var(--green-fg); }
.draft-subject { margin: 0 0 10px; font-size: .92rem; }
.draft-subject span:first-child { font-size: .72rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-right: 8px; }
.draft-body { margin: 0; padding: 16px 18px; background: var(--navy-50); border-left: 3px solid var(--navy-600); font: 400 .95rem/1.6 var(--font); color: var(--text); white-space: pre-wrap; overflow-wrap: anywhere; max-height: 480px; overflow: auto; }
.rblock--notice { border-left: 4px solid var(--navy-600); }
.rblock--notice-warn { border-left-color: #c58a00; background: var(--amber-bg); }
.rblock--notice strong { display: block; color: var(--navy-800); margin-bottom: 4px; }
.rblock--notice p { margin: 0; white-space: pre-line; }
.source-badge { display: inline-flex; align-items: center; gap: 6px; font-size: .78rem; font-weight: 600; color: var(--navy-700); background: var(--navy-100); border: 1px solid #c6d4e8; padding: 2px 8px; border-radius: 2px; white-space: nowrap; }
@media (max-width: 760px) { .rblocks { grid-template-columns: 1fr; } .checklist-item { grid-template-columns: 22px 1fr; } .checklist-status { grid-column: 2; } }
.reauth { display: grid; grid-template-columns: auto 1fr; gap: 22px; align-items: start; max-width: 760px; }
.reauth-icon { width: 56px; height: 56px; display: grid; place-items: center; background: var(--gradient); color: #fff; }

/* ---------- Diagramm (SVG, ohne Skript) ---------- */
.chart { width: 100%; height: auto; max-height: 300px; display: block; }
.chart-axis { stroke: var(--line); stroke-width: 1; }
.chart-bar { fill: #9fb6d3; }
.chart-bar--now { fill: var(--navy-700); }
.chart-value { font: 600 11px var(--font); fill: var(--navy-800); }
.chart-label { font: 500 11px var(--font); fill: var(--muted); }
.chart-sub { font: 400 10px var(--font); fill: var(--muted); }

/* Passkey-Bereiche auf Anmeldung und Bestätigung (Phase 8.4b): Abstand zum Formular darüber */
.passkey-bereich { display: grid; gap: 10px; margin-top: 22px; }
.passkey-bereich .oder { margin: 0; }
.login-main .passkey-bereich .oder { text-align: center; }
.passkey-hinweis { margin: 0; }
.reauth .dev-reauth { display: block; margin-top: 14px; }

/* Phase 8.4b: Versteckte Elemente bleiben versteckt, auch wenn eine Klasse display setzt. */
[hidden] { display: none !important; }
