/*
 * 4TS Webfax – Designsystem „Sendebericht“
 * 4TS-Farben (www.4ts.at): Lime #b1c903 nur als Fläche/Akzent, grüne Schrift auf hell = --lime-ink (≥ 4,5:1).
 * Idee: ruhige Arbeitsfläche (Schreibtisch-Grau), Formulare und Faxe als weiße Blätter; das einzige markante
 * Element ist der Sendebericht (Faxkopfzeile/Ergebnisbeleg) – nur dort Monospace.
 * Schrift „Blender“ optional über css/fonts.css (Lizenz, FAXIT_BRAND_FONTS=1).
 */

:root {
  --lime: #b1c903;
  --lime-hover: #c2d832;
  --lime-strong: #7f9200;
  --lime-ink: #566300;
  --lime-wash: #f2f6d8;
  --night: #24261f;
  --night-soft: #34362e;
  --on-night: #d3d5ca;
  --ink: #34362f;
  --gray-ink: #62645b;
  --gray: #8a8c81;
  --desk: #eef0e8;
  --paper: #ffffff;
  --line: #d7dacd;
  --line-soft: #e6e8de;
  --info: #24527a;
  --info-wash: #e8eff6;
  --warn: #8f4a00;
  --warn-wash: #fbf0e2;
  --crit: #b3261e;
  --crit-wash: #fbeceb;
  --ok: #3b7420;
  --ok-wash: #ecf4e5;
  --font: "Blender", "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", "SF Mono", Consolas, "Liberation Mono", monospace;
  --radius: 6px;
  --radius-sm: 4px;
  --sheet-shadow: 0 1px 0 rgb(36 38 31 / 6%), 0 10px 28px -14px rgb(36 38 31 / 22%);
  --container: 72rem;
  --gutter: clamp(1rem, 4vw, 2rem);
}

/* ---------- Grundlagen ---------- */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; display: flex; flex-direction: column;
  font-family: var(--font); font-size: 1.0625rem; line-height: 1.55; color: var(--ink); background: var(--desk);
  font-variant-numeric: tabular-nums;
}
main { flex: 1; }
img, svg { max-width: 100%; height: auto; }
a { color: var(--lime-ink); text-decoration-thickness: 1px; text-underline-offset: .2em; }
a:hover { color: var(--night); text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--night); outline-offset: 2px; border-radius: 2px; }
h1, h2, h3 { color: var(--night); line-height: 1.2; margin: 0 0 .55em; overflow-wrap: break-word; letter-spacing: -.005em; }
h1 { font-size: clamp(1.6rem, 3.4vw, 2.05rem); font-weight: 700; }
h2 { font-size: 1.3rem; font-weight: 700; }
h3 { font-size: 1.05rem; font-weight: 700; }
p { margin: 0 0 1em; max-width: 72ch; }
ul, ol { padding-left: 1.2rem; }
code, .mono { font-family: var(--mono); font-size: .9em; letter-spacing: 0; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; padding: 0; margin: -1px; }
.skip-link { position: absolute; left: 1rem; top: -4rem; z-index: 100; background: var(--night); color: var(--paper); padding: .6rem 1rem; border-radius: var(--radius); }
.skip-link:focus { top: 1rem; color: var(--paper); }
.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: var(--gutter); }
.muted { color: var(--gray-ink); }
.small { font-size: .9rem; }
/* Kleine Zusatzzeile über/neben Titeln: Kontext, keine Großbuchstaben */
.eyebrow { display: block; margin: 0 0 .25rem; font-size: .95rem; font-weight: 600; color: var(--gray-ink); letter-spacing: 0; }
.section { padding-bottom: 2.25rem; }

/* ---------- Kopfleiste ---------- */
.site-header { background: var(--paper); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 40; }
.site-header__inner { display: flex; align-items: center; gap: 1.25rem; min-height: 4.25rem; flex-wrap: wrap; }
.brand { display: inline-flex; align-items: center; gap: .8rem; text-decoration: none; color: var(--night); }
.brand img { width: 136px; height: auto; display: block; }
.brand__product { font-weight: 800; letter-spacing: .02em; font-size: 1.15rem; padding-left: .8rem; border-left: 2px solid var(--lime); }
.brand__product--admin { border-left-color: var(--night); }
.main-nav { margin-left: auto; }
.main-nav ul { list-style: none; margin: 0; padding: 0; display: flex; align-items: center; gap: .1rem; flex-wrap: wrap; }
.main-nav a, .main-nav button.linklike {
  display: inline-flex; align-items: center; min-height: 2.75rem; padding: .35rem .7rem; border-radius: var(--radius-sm);
  font: 600 1rem/1 var(--font); text-decoration: none; color: var(--ink);
}
.main-nav a:hover, .main-nav button.linklike:hover { background: var(--desk); color: var(--night); }
.main-nav a[aria-current="page"] { color: var(--night); box-shadow: inset 0 -3px 0 var(--lime); border-radius: 0; }
.main-nav .nav-cta { margin-left: .5rem; }
.main-nav .nav-cta a { background: var(--lime); color: var(--night); border-radius: var(--radius); padding-inline: 1rem; font-weight: 700; }
.main-nav .nav-cta a:hover { background: var(--lime-hover); }
.main-nav .nav-cta a[aria-current="page"] { box-shadow: inset 0 0 0 2px var(--night); border-radius: var(--radius); }
.main-nav .nav-sep { width: 1px; height: 1.6rem; background: var(--line); margin: 0 .4rem; }
/* Admin-Kontext unverwechselbar */
.admin-bar { background: var(--night); color: var(--on-night); font-size: .9rem; }
.admin-bar .container { display: flex; align-items: center; gap: .6rem; min-height: 2.1rem; }
.admin-bar strong { color: var(--paper); font-weight: 700; }
.admin-bar::before { content: none; }
.admin-dot { width: .55rem; height: .55rem; border-radius: 50%; background: var(--lime); flex: none; }

.nav-toggle {
  display: none; align-items: center; gap: .55rem; min-height: 2.75rem; padding: .4rem .9rem; margin-left: auto; cursor: pointer;
  border: 2px solid var(--night); border-radius: var(--radius); background: var(--paper); font: 700 1rem/1 var(--font); color: var(--night);
}
.nav-toggle__icon, .nav-toggle__icon::before, .nav-toggle__icon::after { display: block; width: 1.1rem; height: 2px; background: currentColor; border-radius: 1px; }
.nav-toggle__icon { position: relative; }
.nav-toggle__icon::before, .nav-toggle__icon::after { content: ""; position: absolute; left: 0; transition: transform .15s ease; }
.nav-toggle__icon::before { top: -6px; }
.nav-toggle__icon::after { top: 6px; }
.nav-toggle[aria-expanded="true"] .nav-toggle__icon { background: transparent; }
.nav-toggle[aria-expanded="true"] .nav-toggle__icon::before { top: 0; transform: rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle__icon::after { top: 0; transform: rotate(-45deg); }
@media (max-width: 60rem) {
  .site-header__inner { justify-content: space-between; }
  .js .nav-toggle { display: inline-flex; }
  .main-nav { width: 100%; margin-left: 0; }
  .js .main-nav:not(.is-open) { display: none; }
  .main-nav ul { flex-direction: column; align-items: stretch; padding: .25rem 0 1rem; }
  .main-nav a, .main-nav button.linklike { width: 100%; border-bottom: 1px solid var(--line-soft); border-radius: 0; min-height: 3rem; }
  .main-nav a[aria-current="page"] { box-shadow: inset 4px 0 0 var(--lime); }
  .main-nav .nav-cta { margin: .5rem 0 .25rem; order: -1; }
  .main-nav .nav-cta a { justify-content: center; border-bottom: 0; }
  .main-nav .nav-sep { display: none; }
}

/* ---------- Banner ---------- */
.env-banner { background: var(--warn); color: var(--paper); text-align: center; font-weight: 600; padding: .35rem 1rem; font-size: .9rem; }
.env-banner--sim { background: var(--info); }

/* ---------- Seitenkopf & Zurück ---------- */
.page-head { padding: 1.9rem 0 1.1rem; }
.page-head__row { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem 1.5rem; flex-wrap: wrap; }
.page-head h1 { margin: 0; }
.page-head .lead { margin: .4rem 0 0; color: var(--gray-ink); }
.back-link {
  display: inline-flex; align-items: center; gap: .3rem; margin-top: 1.25rem; min-height: 2.5rem; padding: .25rem .8rem .25rem .45rem;
  border-radius: var(--radius); color: var(--ink); text-decoration: none; font-weight: 600; font-size: .98rem;
}
.back-link svg { width: 1.2em; height: 1.2em; flex: none; color: var(--lime-strong); transition: transform .15s ease; }
.back-link:hover { background: var(--paper); color: var(--night); }
.back-link:hover svg { transform: translateX(-2px); }
.back-link + .messages, .back-link + .page-head { margin-top: 0; padding-top: .6rem; }
.back-link + .messages + .page-head { padding-top: .9rem; }
.userbox { font-size: .85rem; color: var(--gray-ink); }

/* ---------- Blätter (Formulare, Inhaltsflächen) ---------- */
.grid { display: grid; gap: 1.25rem; }
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr)); align-items: start; }
.grid--3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr)); }
.grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 60rem) { .grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 26rem) { .grid--4 { grid-template-columns: 1fr; } }
.card { position: relative; background: var(--paper); border-radius: var(--radius); padding: 1.4rem 1.5rem; box-shadow: var(--sheet-shadow); }
.card--accent { border-top: 4px solid var(--lime); }
.card--crit { border-top-color: var(--crit); }
.card h2 { font-size: 1.15rem; }
.card > :last-child { margin-bottom: 0; }
aside.card { background: transparent; box-shadow: none; padding: .4rem 0 0; border-top: 1px solid var(--line); border-radius: 0; }
aside.card h2 { font-size: 1.05rem; }
/* Kennzahlen: schlichte Werte, keine Kachel-Optik */
.stat { display: flex; flex-direction: column; gap: .15rem; }
.card.stat { box-shadow: none; background: transparent; padding: .9rem 0 .4rem; border-top: 3px solid var(--line); border-radius: 0; }
.card.stat.card--accent { border-top-color: var(--lime); }
.card.stat.card--crit { border-top-color: var(--crit); }
.stat__value { font-size: 2rem; font-weight: 700; color: var(--night); line-height: 1.1; }
.stat__value.small { font-size: 1.15rem; }
.stat__label { font-size: .95rem; font-weight: 600; color: var(--gray-ink); }
.kv { display: grid; grid-template-columns: minmax(8.5rem, max-content) 1fr; gap: .5rem 1.25rem; margin: 0; }
.kv dt { font-weight: 600; color: var(--gray-ink); }
.kv dd { margin: 0; overflow-wrap: anywhere; color: var(--night); }
@media (max-width: 30rem) { .kv { grid-template-columns: 1fr; gap: .1rem; } .kv dd { margin-bottom: .55rem; } }

/* ---------- Schaltflächen ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem; min-height: 2.75rem; padding: .55rem 1.15rem;
  font: 700 1rem/1.15 var(--font); text-decoration: none; letter-spacing: 0;
  border: 2px solid transparent; border-radius: var(--radius); cursor: pointer; background: none; transition: background .12s, border-color .12s, color .12s;
}
.btn svg { width: 1.1em; height: 1.1em; }
.btn--primary { background: var(--lime); color: var(--night); }
.btn--primary:hover { background: var(--lime-hover); color: var(--night); }
.btn--primary:active { background: var(--lime-strong); color: var(--paper); }
.btn--secondary { border-color: var(--line); color: var(--night); background: var(--paper); }
.btn--secondary:hover { border-color: var(--night); color: var(--night); }
.btn--danger { background: var(--paper); color: var(--crit); border-color: var(--crit); }
.btn--danger:hover { background: var(--crit); color: var(--paper); }
.btn--small { min-height: 2.25rem; padding: .3rem .75rem; font-size: .92rem; }
.btn--big { min-height: 3.25rem; padding-inline: 1.6rem; font-size: 1.1rem; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; }
.actions { display: flex; flex-wrap: wrap; gap: .75rem 1rem; align-items: center; }
.actions--center { justify-content: center; }
.inline-form { display: inline; }
button.linklike { background: none; border: 0; padding: 0; color: var(--lime-ink); font: inherit; text-decoration: underline; text-underline-offset: .2em; cursor: pointer; }
button.linklike:hover { color: var(--night); }

/* ---------- Formulare ---------- */
.form { display: grid; gap: 1.2rem; max-width: 40rem; }
.form--wide { max-width: none; }
.form__row { display: grid; gap: 1.2rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 13rem), 1fr)); }
.field { display: grid; gap: .35rem; }
.field > label, .field legend, .field__label { font-weight: 600; color: var(--night); }
.field__label { display: block; margin-bottom: .1rem; }
.field .req { color: var(--crit); }
.field input[type="text"], .field input[type="email"], .field input[type="password"], .field input[type="tel"], .field input[type="number"],
.field input[type="search"], .field input[type="time"], .field input[type="date"], .field input:not([type]), .field select, .field textarea {
  width: 100%; min-height: 2.9rem; padding: .55rem .8rem; font: inherit; color: var(--night);
  background: var(--paper); border: 1.5px solid var(--gray); border-radius: var(--radius);
}
.field input::placeholder { color: var(--gray); }
.field input[type="file"] {
  width: 100%; font: inherit; color: var(--ink); padding: 1rem; cursor: pointer;
  border: 2px dashed var(--gray); border-radius: var(--radius); background: var(--desk);
}
.field input[type="file"]:hover { border-color: var(--lime-strong); background: var(--lime-wash); }
.field input[type="file"]::file-selector-button {
  font: 700 .95rem/1 var(--font); margin-right: .9rem; padding: .6rem 1rem; cursor: pointer;
  border: 0; border-radius: var(--radius); background: var(--night); color: var(--paper);
}
.field input:focus, .field select:focus, .field textarea:focus { outline: 3px solid var(--lime); outline-offset: 0; border-color: var(--night); }
.field .help, .help { font-size: .92rem; color: var(--gray-ink); margin: 0; }
.field .error { color: var(--crit); font-weight: 600; font-size: .95rem; margin: 0; }
.field--invalid input, .field--invalid select, .field--invalid textarea { border-color: var(--crit); }
.field--check { display: flex; align-items: flex-start; gap: .6rem; }
.field--check input { width: 1.3rem; height: 1.3rem; margin-top: .15rem; accent-color: var(--lime-ink); flex: none; }
.field--check > label { font-weight: 500; }
fieldset.field { border: 0; padding: 0; margin: 0; }
.field ul.choices { list-style: none; padding: 0; margin: 0; display: grid; gap: .4rem; }
.field ul.choices label { display: flex; gap: .55rem; align-items: flex-start; font-weight: 400; cursor: pointer; }
.field ul.choices input { accent-color: var(--lime-ink); width: 1.15rem; height: 1.15rem; margin-top: .2rem; }
.form-errors { border-left: 4px solid var(--crit); background: var(--crit-wash); padding: .8rem 1rem; border-radius: var(--radius-sm); }
.form-errors h2 { font-size: 1rem; margin: 0 0 .3rem; color: var(--crit); }
.static-value { margin: 0; padding: .6rem .8rem; border-radius: var(--radius); background: var(--desk); color: var(--night); }
fieldset.section { border: 0; border-top: 1px solid var(--line); padding: 1rem 0 0; margin: 0; }
fieldset.section legend { font-weight: 700; color: var(--night); padding-right: .5rem; }

/* ---------- Meldungen ---------- */
.messages { list-style: none; padding: 0; margin: 1rem 0 0; display: grid; gap: .5rem; }
.msg { padding: .75rem 1rem; border-radius: var(--radius-sm); border-left: 4px solid var(--info); background: var(--info-wash); color: var(--night); max-width: none; }
.msg--success { border-color: var(--ok); background: var(--ok-wash); }
.msg--warning { border-color: var(--warn); background: var(--warn-wash); }
.msg--error { border-color: var(--crit); background: var(--crit-wash); }

/* ---------- Status (Text + Farbe, nie nur Farbe) ---------- */
.badge { display: inline-flex; align-items: center; gap: .4rem; padding: .15rem .6rem; border-radius: 999px; font-size: .88rem; font-weight: 600; white-space: nowrap; }
.badge::before { content: ""; width: .5rem; height: .5rem; border-radius: 50%; background: currentColor; flex: none; }
.badge--success, .badge--ok { color: var(--ok); background: var(--ok-wash); }
.badge--failed, .badge--bad { color: var(--crit); background: var(--crit-wash); }
.badge--cancelled { color: var(--gray-ink); background: var(--line-soft); }
.badge--queued, .badge--ready, .badge--draft { color: var(--info); background: var(--info-wash); }
.badge--processing, .badge--dialing, .badge--transmitting { color: var(--warn); background: var(--warn-wash); }
.badge--processing::before, .badge--dialing::before, .badge--transmitting::before { animation: pulse 1.2s ease-in-out infinite; }
.badge--sim { color: var(--info); background: transparent; box-shadow: inset 0 0 0 1px currentColor; }
@keyframes pulse { 50% { opacity: .25; } }

/* ---------- Tabellen (mobil als Liste) ---------- */
.table-wrap { overflow-x: auto; background: var(--paper); border-radius: var(--radius); box-shadow: var(--sheet-shadow); }
table.table { width: 100%; border-collapse: collapse; }
.table th, .table td { text-align: left; padding: .75rem 1rem; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
.table thead th { font-size: .9rem; font-weight: 600; color: var(--gray-ink); background: var(--paper); border-bottom: 1px solid var(--line); white-space: nowrap; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: #f8f9f4; }
.table td a { font-weight: 600; }
@media (max-width: 46rem) {
  .table--stack thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .table--stack tr { display: block; padding: .7rem .5rem; border-bottom: 1px solid var(--line-soft); }
  .table--stack td { display: grid; grid-template-columns: 7.5rem 1fr; gap: .5rem; border: 0; padding: .25rem .5rem; }
  .table--stack td::before { content: attr(data-label); font-weight: 600; color: var(--gray-ink); font-size: .9rem; }
}

/* ---------- Filter ---------- */
.filters { display: grid; gap: .9rem 1rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 11rem), 1fr)); align-items: end; margin-bottom: 1.25rem; }
.filters .field input, .filters .field select { min-height: 2.6rem; }

/* ---------- Faxblätter (Vorschau) ---------- */
.preview-grid { display: grid; gap: 1.5rem 1.25rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 13.5rem), 1fr)); }
.preview-page { margin: 0; }
.preview-page img { display: block; width: 100%; height: auto; background: var(--paper); border-radius: 2px; box-shadow: 0 1px 0 rgb(36 38 31 / 8%), 0 14px 30px -18px rgb(36 38 31 / 45%); }
.preview-page figcaption { font-size: .9rem; color: var(--gray-ink); padding-top: .5rem; }

/* ---------- Sendebericht (das markante Element) ---------- */
.summary-box, .report {
  position: relative; background: var(--paper); border-radius: 2px; padding: 1.1rem 1.4rem 1.2rem;
  box-shadow: var(--sheet-shadow); font-family: var(--mono); font-size: .95rem; color: var(--night);
  background-image: linear-gradient(var(--paper), var(--paper)), repeating-linear-gradient(90deg, var(--line) 0 6px, transparent 6px 12px);
  background-size: 100% calc(100% - 2px), 100% 2px; background-position: top, bottom; background-repeat: no-repeat;
}
.report__head, .summary-box .report__head {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: .25rem 1rem; padding-bottom: .6rem; margin-bottom: .8rem;
  border-bottom: 1px dashed var(--gray); color: var(--gray-ink); font-size: .85rem;
}
.report .kv { font-family: var(--mono); gap: .35rem 1.5rem; }
.report .kv dt { color: var(--gray-ink); font-weight: 400; }
.report .kv dd { font-weight: 600; }
.report__result { display: inline-flex; align-items: center; gap: .6rem; margin-top: .9rem; font-weight: 700; font-size: 1.05rem; }
.stamp {
  display: inline-block; padding: .15rem .6rem; border: 2px solid currentColor; border-radius: 3px; font-family: var(--mono);
  font-weight: 800; letter-spacing: .08em; transform: rotate(-3deg);
}
.stamp--ok { color: var(--ok); }
.stamp--bad { color: var(--crit); }
.stamp--run { color: var(--warn); transform: none; }
.summary-box .stat__label { font-family: var(--font); }
.summary-box .grid { gap: 1rem 2rem; }
.big-number { font-size: clamp(1.25rem, 3.4vw, 1.6rem); font-weight: 700; color: var(--night); font-family: var(--mono); letter-spacing: 0; }
.faxline { font-family: var(--mono); font-size: .85rem; color: var(--ink); background: var(--paper); border-bottom: 1px dashed var(--gray); padding: .45rem .7rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- Fortschritt eines Auftrags ---------- */
.steps { list-style: none; margin: 0 0 1rem; padding: 0; display: flex; flex-wrap: wrap; gap: .35rem; }
.steps li { flex: 1 1 7.5rem; padding: .5rem .1rem 0; border-top: 4px solid var(--line); font-size: .9rem; color: var(--gray-ink); }
.steps li.done { border-color: var(--lime); color: var(--night); }
.steps li.current { border-color: var(--night); color: var(--night); font-weight: 700; }
.steps li.failed { border-color: var(--crit); color: var(--crit); font-weight: 700; }
.progress { display: flex; align-items: center; gap: .7rem; margin: .6rem 0; flex-wrap: wrap; }
.progress__bar { -webkit-appearance: none; appearance: none; flex: 1 1 10rem; min-width: 8rem; max-width: 34rem; height: .7rem; border: 0; border-radius: 999px; background: var(--line-soft); overflow: hidden; accent-color: var(--lime-ink); }
.progress__bar::-webkit-progress-bar { background: var(--line-soft); border-radius: 999px; }
.progress__bar::-webkit-progress-value { background: var(--lime); border-radius: 999px; transition: width .6s ease; }
.progress__bar::-moz-progress-bar { background: var(--lime); border-radius: 999px; }
.progress__label { white-space: nowrap; }
.table .progress { margin: .35rem 0 0; }
.table .progress__bar { max-width: 9rem; }

/* ---------- Übersicht (Kundenportal) ---------- */
.home { display: grid; gap: 2rem; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); align-items: start; padding-bottom: 2rem; }
@media (max-width: 60rem) { .home { grid-template-columns: 1fr; } }
.today { margin: .35rem 0 0; color: var(--gray-ink); }
.today strong { color: var(--night); }
.recent { list-style: none; margin: 0; padding: 0; background: var(--paper); border-radius: var(--radius); box-shadow: var(--sheet-shadow); }
.recent li { display: grid; grid-template-columns: 1fr auto; gap: .15rem 1rem; padding: .8rem 1rem; border-bottom: 1px solid var(--line-soft); }
.recent li:last-child { border-bottom: 0; }
.recent__to { font-weight: 600; color: var(--night); text-decoration: none; }
.recent__to:hover { text-decoration: underline; }
.recent__meta { grid-column: 1; font-size: .9rem; color: var(--gray-ink); }
.recent__status { grid-column: 2; grid-row: 1 / span 2; align-self: center; text-align: right; }
.recent .progress { grid-column: 1 / -1; margin: .25rem 0 0; }
.head-link { font-weight: 600; }

/* ---------- Leere Zustände, Aufklapper, Code ---------- */
.empty-state { padding: 1.75rem 1.5rem; border-radius: var(--radius); background: var(--paper); box-shadow: var(--sheet-shadow); }
.empty-state p { margin: 0 0 1rem; color: var(--gray-ink); }
.disclosure { border-top: 1px solid var(--line); padding-top: .5rem; }
.disclosure > summary { cursor: pointer; font-weight: 600; color: var(--gray-ink); min-height: 2.75rem; display: flex; align-items: center; }
.disclosure > summary:hover { color: var(--night); }
.disclosure[open] > summary { margin-bottom: .75rem; }
.code-box { white-space: pre-wrap; word-break: break-all; padding: .6rem .8rem; background: var(--desk); border-radius: var(--radius-sm); user-select: all; font-family: var(--mono); }
.pagination { display: flex; gap: .5rem; align-items: center; justify-content: center; margin: 1.25rem 0; flex-wrap: wrap; }

/* ---------- Anmeldung ---------- */
.auth { flex: 1; min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1.25rem;
  padding: clamp(1.5rem, 5vw, 3rem) 1rem; background: var(--desk); }
.auth-card { position: relative; width: 100%; max-width: 26rem; background: var(--paper); border-radius: var(--radius); box-shadow: var(--sheet-shadow);
  border-top: 5px solid var(--lime); padding: clamp(1.75rem, 5vw, 2.4rem); }
.auth-brand { display: flex; align-items: center; gap: .9rem; margin-bottom: 1.75rem; }
.auth-logo { width: 150px; height: auto; }
.auth-product { font-weight: 800; letter-spacing: .02em; font-size: 1.3rem; color: var(--night); padding-left: .9rem; border-left: 2px solid var(--lime); }
.auth-card h1 { font-size: 1.45rem; margin-bottom: .3rem; }
.auth-lead { margin: 0 0 1.5rem; color: var(--gray-ink); }
.auth-card .form { max-width: none; }
.auth-card .btn--primary { width: 100%; }
.auth-card .actions { flex-direction: column; align-items: stretch; gap: .9rem; text-align: center; }
.auth-footer { margin: 0; text-align: center; color: var(--gray-ink); }

/* ---------- Fuß ---------- */
.site-footer { background: var(--paper); color: var(--gray-ink); padding: 1.25rem 0; margin-top: 2rem; font-size: .9rem; border-top: 1px solid var(--line); }
.site-footer a { color: var(--lime-ink); }
.site-footer :focus-visible { outline-color: var(--night); }
.site-footer__inner { display: flex; flex-wrap: wrap; gap: .5rem 2rem; justify-content: space-between; }

/* ---------- Admin ---------- */
.status-list { list-style: none; padding: 0; margin: 0 0 1rem; display: grid; }
.status-list li { display: flex; justify-content: space-between; gap: 1rem; align-items: center; border-bottom: 1px solid var(--line-soft); padding: .55rem 0; }
.status-list li:last-child { border-bottom: 0; }
pre.raw { background: var(--night); color: var(--on-night); padding: 1rem; border-radius: var(--radius); overflow-x: auto; font-size: .85rem; }
.qr { background: var(--paper); padding: .75rem; display: inline-block; border: 1px solid var(--line); border-radius: var(--radius); }
.qr svg { width: 220px; height: 220px; display: block; }
.codes { columns: 2; font-family: var(--mono); font-size: 1.1rem; }

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

/* Admin: viele Bereiche – Navigation als eigene, linksbündige Zeile unter dem Logo */
@media (min-width: 60.01rem) {
  .site-header--admin .site-header__inner { row-gap: 0; padding-top: .5rem; }
  .site-header--admin .main-nav { margin-left: 0; width: 100%; }
  .site-header--admin .main-nav ul { margin-left: -.7rem; }
}

/* ---------- Such- und Filterleiste ---------- */
.toolbar { display: grid; gap: .9rem; margin-bottom: 1.75rem; }
.toolbar__search { display: flex; gap: .6rem; max-width: 40rem; }
.toolbar__search input { flex: 1; min-width: 0; min-height: 2.9rem; padding: .55rem .9rem; font: inherit; color: var(--night);
  background: var(--paper); border: 1.5px solid var(--gray); border-radius: var(--radius); }
.toolbar__search input:focus { outline: 3px solid var(--lime); outline-offset: 0; border-color: var(--night); }
.toolbar__links { margin: 0; color: var(--gray-ink); }
.toolbar__more { max-width: 46rem; }
.toolbar__more .form__row { margin-bottom: .9rem; }
.chips { display: flex; flex-wrap: wrap; gap: .45rem; }
.chip { display: inline-flex; align-items: center; min-height: 2.35rem; padding: .3rem .95rem; border-radius: 999px; text-decoration: none;
  font-weight: 600; font-size: .95rem; color: var(--ink); background: var(--paper); box-shadow: inset 0 0 0 1.5px var(--line); }
.chip:hover { color: var(--night); box-shadow: inset 0 0 0 1.5px var(--night); text-decoration: none; }
.chip[aria-current="true"] { background: var(--night); color: var(--paper); box-shadow: none; }

/* ---------- Sendejournal (Faxhistorie) ---------- */
.journal { display: grid; gap: 1.75rem; }
.journal__date { font-size: 1rem; font-weight: 700; color: var(--gray-ink); margin: 0 0 .55rem; }
.journal__list { list-style: none; margin: 0; padding: 0; background: var(--paper); border-radius: var(--radius); box-shadow: var(--sheet-shadow); }
.journal__item { display: grid; grid-template-columns: 3.6rem minmax(0, 1fr) auto; gap: .2rem 1rem; align-items: start;
  padding: .85rem 1.1rem .85rem 1rem; border-bottom: 1px solid var(--line-soft); border-left: 4px solid transparent; }
.journal__item:last-child { border-bottom: 0; }
.journal__item--failed { border-left-color: var(--crit); }
.journal__item--dialing, .journal__item--transmitting, .journal__item--processing, .journal__item--queued { border-left-color: var(--warn); }
.journal__time { font-family: var(--mono); color: var(--gray-ink); padding-top: .1rem; }
.journal__who { display: grid; gap: .1rem; min-width: 0; }
.journal__who > a { font-weight: 700; color: var(--night); text-decoration: none; }
.journal__who > a:hover { text-decoration: underline; }
.journal__sub { font-size: .92rem; color: var(--gray-ink); }
.journal__error { font-size: .92rem; color: var(--crit); }
.journal__status { padding-top: .05rem; }
.journal__item .progress { margin: .35rem 0 0; }
@media (max-width: 40rem) {
  .journal__item { grid-template-columns: 3rem minmax(0, 1fr); }
  .journal__status { grid-column: 2; }
}

/* ---------- Karteikasten (Adressbuch) ---------- */
.index-tabs { display: flex; flex-wrap: wrap; gap: .3rem; margin: -.5rem 0 1.5rem; }
.index-tabs a { display: inline-flex; align-items: center; justify-content: center; min-width: 2.25rem; min-height: 2.25rem; padding: 0 .4rem;
  border-radius: var(--radius-sm); font-weight: 700; text-decoration: none; color: var(--night); background: var(--paper); box-shadow: inset 0 0 0 1px var(--line); }
.index-tabs a:hover { background: var(--lime); box-shadow: none; }
.cardfile { display: grid; gap: 1.1rem; }
.cardfile__group { display: grid; grid-template-columns: 3.25rem minmax(0, 1fr); gap: 0; scroll-margin-top: 6rem; }
.cardfile__letter { margin: 0; align-self: start; display: flex; align-items: center; justify-content: center; height: 3.25rem;
  font-size: 1.6rem; font-weight: 800; color: var(--night); background: var(--lime); border-radius: var(--radius) 0 0 var(--radius); }
.cardfile__list { list-style: none; margin: 0; padding: 0; background: var(--paper); border-radius: 0 var(--radius) var(--radius) var(--radius); box-shadow: var(--sheet-shadow); }
.cardfile__item { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: .25rem 1.25rem; align-items: center;
  padding: .75rem 1.1rem; border-bottom: 1px solid var(--line-soft); }
.cardfile__item:last-child { border-bottom: 0; }
.cardfile__who { display: grid; gap: .05rem; min-width: 0; }
.cardfile__who > a { font-weight: 700; color: var(--night); text-decoration: none; }
.cardfile__who > a:hover { text-decoration: underline; }
.cardfile__sub { font-size: .92rem; color: var(--gray-ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cardfile__number { font-family: var(--mono); color: var(--ink); white-space: nowrap; }
@media (max-width: 40rem) {
  .cardfile__group { grid-template-columns: 2.5rem minmax(0, 1fr); gap: 0; }
  .cardfile__letter { height: 2.5rem; font-size: 1.25rem; }
  .cardfile__item { grid-template-columns: minmax(0, 1fr) auto; }
  .cardfile__number { grid-column: 1; }
  .cardfile__send { grid-column: 2; grid-row: 1 / span 2; }
}

/* Mini-Faxblatt (Vorschau der Kopfzeile) */
.faxsheet { background: var(--paper); border-radius: 2px; box-shadow: 0 1px 0 rgb(36 38 31 / 8%), 0 14px 30px -18px rgb(36 38 31 / 45%);
  aspect-ratio: 210 / 120; max-width: 26rem; margin: .5rem 0 1rem; overflow: hidden; display: flex; flex-direction: column; }
.faxsheet .faxline { margin: 0; max-width: none; font-size: .74rem; padding: .4rem .6rem; }
.faxsheet__lines { flex: 1; margin: 1.1rem 1.25rem; background: repeating-linear-gradient(var(--line-soft) 0 6px, transparent 6px 18px); opacity: .9; }

/* ---------- Leitstand (Admin) ---------- */
.verdict { padding: 1rem 1.25rem 1rem 1.15rem; border-radius: var(--radius); border-left: 6px solid; background: var(--paper); box-shadow: var(--sheet-shadow); }
.verdict h2 { margin: 0 0 .3rem; font-size: 1.2rem; }
.verdict p, .verdict ul { margin: 0; }
.verdict ul { padding-left: 1.1rem; display: grid; gap: .15rem; }
.verdict--ok { border-left-color: var(--ok); }
.verdict--ok h2 { color: var(--ok); }
.verdict--warn { border-left-color: var(--warn); }
.verdict--warn h2 { color: var(--warn); }
.facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 13rem), 1fr)); gap: 1rem 1.5rem; margin: 0; }
.facts dt { font-size: .9rem; font-weight: 600; color: var(--gray-ink); }
.facts dd { margin: .1rem 0 0; color: var(--night); font-weight: 600; }
.danger-zone { margin-top: 1rem; padding: 1.25rem 1.5rem; border-radius: var(--radius); border: 1.5px solid var(--crit); background: var(--paper); }
.danger-zone h2 { color: var(--crit); font-size: 1.1rem; }
.table--status tbody tr { box-shadow: inset 4px 0 0 transparent; }
.table--status tr.row--failed, .table--status tr.row--critical { box-shadow: inset 4px 0 0 var(--crit); }
.table--status tr.row--warning, .table--status tr.row--dialing, .table--status tr.row--transmitting, .table--status tr.row--processing, .table--status tr.row--queued { box-shadow: inset 4px 0 0 var(--warn); }
.nowrap { white-space: nowrap; }
.error-text { color: var(--crit); margin-top: .2rem; }
.attempt { background: var(--paper); border: 0; border-radius: var(--radius); box-shadow: var(--sheet-shadow); padding: .25rem 1.1rem .75rem; margin-bottom: .75rem; }
.attempt > summary { font-weight: 700; color: var(--night); }
.table details summary { cursor: pointer; color: var(--lime-ink); }
.table pre.raw { margin: .4rem 0 0; max-width: 34rem; white-space: pre-wrap; word-break: break-word; font-size: .8rem; }
.status-list li > strong { font-variant-numeric: tabular-nums; color: var(--night); }
/* Abstand nach Blättern/Kästen, die zugleich Abschnitt sind (ihr eigenes Padding überschreibt .section) */
.card.section, .verdict, .danger-zone, .empty-state.section, .table-wrap.section, .report.section, .summary-box.section, .msg.section { margin-bottom: 1.75rem; }
.grid.section > .card, .grid.section > .report { margin-bottom: 0; }

/* ---------- Statistik ---------- */
.chart-card .page-head__row { margin-bottom: .75rem; align-items: center; }
.chart { display: block; width: 100%; height: auto; overflow: visible; }
.chart__grid { stroke: var(--line-soft); stroke-width: 1; }
.chart__baseline { stroke: var(--gray); stroke-width: 1; }
.chart__axis { fill: var(--gray-ink); font-size: 11px; font-family: var(--font); }
.chart__ok { fill: var(--lime-strong); }
.chart__bad { fill: var(--crit); }
.chart__hit { fill: transparent; }
.chart__col:hover .chart__hit { fill: var(--desk); }
.legend { list-style: none; display: flex; flex-wrap: wrap; gap: .4rem 1.1rem; margin: 0; padding: 0; font-size: .92rem; color: var(--ink); }
.legend li { display: inline-flex; align-items: center; gap: .45rem; }
.legend__swatch { width: .85rem; height: .85rem; border-radius: 3px; }
.legend__swatch--ok { background: var(--lime-strong); }
.legend__swatch--bad { background: var(--crit); }
.table .num { text-align: right; white-space: nowrap; }
.table tfoot th, .table tfoot td { border-top: 1.5px solid var(--line); border-bottom: 0; font-weight: 700; color: var(--night); background: var(--paper); }
.ratebar { display: inline-block; width: 3.5rem; height: .45rem; vertical-align: middle; border-radius: 999px; background: var(--crit-wash); overflow: hidden; }
.ratebar__fill { display: block; height: 100%; background: var(--lime-strong); border-radius: 999px; }
.ratebar__fill--0 { width: 0%; }
.ratebar__fill--1 { width: 10%; }
.ratebar__fill--2 { width: 20%; }
.ratebar__fill--3 { width: 30%; }
.ratebar__fill--4 { width: 40%; }
.ratebar__fill--5 { width: 50%; }
.ratebar__fill--6 { width: 60%; }
.ratebar__fill--7 { width: 70%; }
.ratebar__fill--8 { width: 80%; }
.ratebar__fill--9 { width: 90%; }
.ratebar__fill--10 { width: 100%; }
@media (max-width: 46rem) { .table--stack td.num { text-align: left; } .ratebar { display: none; } }

/* Admin-Navigation kompakter (viele Bereiche in einer Zeile) */
@media (min-width: 60.01rem) {
  .site-header--admin .main-nav a, .site-header--admin .main-nav button.linklike { padding-inline: .5rem; font-size: .95rem; }
  .site-header--admin .main-nav .nav-sep { margin: 0 .25rem; }
}

/* ---------- Hilfe ---------- */
.help-toc { display: flex; flex-wrap: wrap; gap: .45rem; margin-bottom: 2rem; }
.help-toc a { display: inline-flex; align-items: center; min-height: 2.35rem; padding: .3rem .9rem; border-radius: 999px; text-decoration: none;
  font-weight: 600; font-size: .95rem; color: var(--ink); background: var(--paper); box-shadow: inset 0 0 0 1.5px var(--line); }
.help-toc a:hover { color: var(--night); box-shadow: inset 0 0 0 1.5px var(--night); }
.help-section { max-width: 48rem; scroll-margin-top: 6rem; }
.help-steps { list-style: none; counter-reset: step; margin: 0 0 1.25rem; padding: 0; display: grid; gap: .9rem; }
.help-steps li { counter-increment: step; position: relative; padding: 1rem 1.25rem 1rem 4rem; background: var(--paper); border-radius: var(--radius); box-shadow: var(--sheet-shadow); }
.help-steps li::before { content: counter(step); position: absolute; left: 1.1rem; top: 1rem; width: 2rem; height: 2rem; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; font-weight: 800; color: var(--night); background: var(--lime); }
.help-steps strong { display: block; color: var(--night); font-size: 1.05rem; margin-bottom: .2rem; }
.help-steps p { margin: 0; }
.help-tip { padding: .85rem 1.1rem; border-left: 4px solid var(--lime); background: var(--lime-wash); border-radius: var(--radius-sm); }
.help-tip strong { color: var(--night); margin-right: .35rem; }
.help-status { display: grid; gap: .6rem; margin: 0 0 1rem; }
.help-status > div { display: grid; grid-template-columns: 13rem 1fr; gap: 1rem; align-items: baseline; }
.help-status dd { margin: 0; }
@media (max-width: 40rem) { .help-status > div { grid-template-columns: 1fr; gap: .2rem; } }
.help-list { display: grid; gap: .45rem; margin: 0 0 1rem; }
.faq { background: var(--paper); border: 0; border-radius: var(--radius); box-shadow: var(--sheet-shadow); padding: .2rem 1.1rem; margin-bottom: .6rem; }
.faq > summary { color: var(--night); }
.faq p { margin: 0 0 .9rem; }
.help-contact { max-width: 48rem; }

/* Admin: Konto/Abmelden in der dunklen Leiste (Desktop), Navigation bleibt einzeilig */
.admin-bar__account { margin-left: auto; display: inline-flex; align-items: center; gap: 1rem; }
.admin-bar__account a, .admin-bar__account button.linklike { color: var(--paper); font-weight: 600; text-decoration: none; font-size: .9rem; }
.admin-bar__account a:hover, .admin-bar__account button.linklike:hover { color: var(--lime); text-decoration: underline; }
.admin-bar :focus-visible { outline-color: var(--lime); }
@media (min-width: 60.01rem) { .site-header--admin .main-nav .nav-account { display: none; } }
@media (max-width: 60rem) { .admin-bar__account, .admin-bar__note { display: none; } }
