/* Schriften liegen auf dem eigenen Server (kein Abruf bei Google). Lizenz: SIL OFL 1.1 */
@font-face { font-family: "ABeeZee"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/abeezee-latin-400-normal.b0a113fc172b.woff2") format("woff2"); }
@font-face { font-family: "Open Sans"; font-style: normal; font-weight: 300; font-display: swap; src: url("../fonts/open-sans-latin-300-normal.963e5d0fdf9d.woff2") format("woff2"); }
@font-face { font-family: "Open Sans"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/open-sans-latin-400-normal.289ab8c3689e.woff2") format("woff2"); }
@font-face { font-family: "Open Sans"; font-style: normal; font-weight: 600; font-display: swap; src: url("../fonts/open-sans-latin-600-normal.a6d99d784ef0.woff2") format("woff2"); }

:root {
  --red: #8C1F1B; --red-dark: #6E1815; --red-tint: #F6E8E7;
  --text: #4D4F4F; --text-strong: #333333; --muted: #5E6060;
  --bg: #F2F2F2; --card: #FFFFFF; --line: #E2E2E2; --input: #BDBDBD;
  --footer: #242528; --footer-text: #C1C1C1;
  --ok-bg: #E6F1E6; --ok: #24572A; --info-bg: #E7EEF7; --info: #1F4E86;
  --warn-bg: #FBF0E0; --warn: #7A4600; --danger-bg: #F9ECEB; --danger: #7A1B18; --neutral-bg: #EEEEEE;
}
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--text); font-family: "Open Sans", Arial, sans-serif; font-size: 16px; line-height: 1.5; min-height: 100vh; display: flex; flex-direction: column; }
h1, h2 { font-family: "ABeeZee", sans-serif; font-weight: 400; color: var(--text); margin: 0; }
h1 { font-size: 28px; } h2 { font-size: 22px; } h3 { font-size: 15px; font-weight: 600; color: var(--text-strong); margin: 0; }
a { color: var(--red); } a:hover { color: var(--red-dark); }
p { margin: 0; }
code { font-family: ui-monospace, Consolas, monospace; font-size: 0.92em; background: var(--bg); padding: 2px 6px; border-radius: 4px; color: var(--text-strong); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Kopf und Fuß Kundenbereich */
.topbar { background: var(--red); color: #fff; font-size: 13px; padding: 8px 24px; display: flex; justify-content: flex-end; gap: 24px; flex-wrap: wrap; }
.site-header { background: var(--card); border-bottom: 1px solid var(--line); padding: 16px 24px; }
.wrap { max-width: 1120px; margin: 0 auto; }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.logo { height: 56px; width: auto; display: block; }
.header-meta { display: flex; align-items: center; gap: 20px; font-size: 14px; flex-wrap: wrap; }
.site-main { flex: 1 0 auto; padding: 48px 24px; }
.site-footer { background: var(--footer); color: var(--footer-text); padding: 20px 24px; font-size: 14px; }
.site-footer .wrap { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.site-footer nav { display: flex; gap: 24px; }
.site-footer a { color: #E0E0E0; }

/* Karten und Formulare */
.card { background: var(--card); border: 1px solid var(--line); border-radius: 4px; padding: 32px; display: flex; flex-direction: column; gap: 20px; }
.card.narrow { max-width: 420px; margin: 0 auto; }
.card.medium { max-width: 780px; margin: 0 auto; }
.stack { display: flex; flex-direction: column; gap: 8px; }
.stack-lg { display: flex; flex-direction: column; gap: 32px; }
.row { display: flex; gap: 16px; flex-wrap: wrap; align-items: center; }
.row.end { justify-content: flex-end; }
.row.between { justify-content: space-between; }
.lead { color: var(--muted); font-size: 15px; }
.small { font-size: 13px; color: var(--muted); }
.field { display: flex; flex-direction: column; gap: 6px; }
label { font-size: 14px; font-weight: 600; color: var(--text); }
input[type=text], input[type=password], input[type=email], input[type=search], select, textarea {
  font: inherit; font-size: 16px; color: var(--text-strong); border: 1px solid var(--input); border-radius: 4px; padding: 0 12px; height: 44px; background: #fff; width: 100%;
}
textarea { height: auto; padding: 12px; font-family: ui-monospace, Consolas, monospace; font-size: 14px; resize: vertical; }
input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible, a:focus-visible { outline: 3px solid #1F4E86; outline-offset: 2px; }
.code-input { letter-spacing: 4px; font-size: 20px; max-width: 220px; }
.btn { display: inline-flex; align-items: center; justify-content: center; height: 48px; padding: 0 24px; border-radius: 4px; border: 1px solid var(--red); background: var(--red); color: #fff; font: inherit; font-weight: 600; font-size: 16px; text-decoration: none; cursor: pointer; }
.btn:hover { background: var(--red-dark); color: #fff; }
.btn.secondary { background: #fff; color: var(--text); border-color: var(--input); font-weight: 400; }
.btn.secondary:hover { background: var(--bg); color: var(--text-strong); }
.btn.outline { background: #fff; color: var(--red); border-color: var(--red); }
.btn.small { height: 40px; padding: 0 16px; font-size: 14px; }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }
.alert { border-radius: 4px; padding: 10px 12px; font-size: 14px; border: 1px solid; }
.alert.error { background: var(--danger-bg); border-color: #E4BDBA; color: var(--danger); }
.alert.warn { background: var(--warn-bg); border-color: #E8C995; color: #5C3A00; }
.alert.ok { background: var(--ok-bg); border-color: #B9D6BA; color: var(--ok); }
.errorlist { list-style: none; margin: 0; padding: 0; color: var(--danger); font-size: 14px; }

/* Datenschutztext */
.consent-text { max-height: 460px; overflow-y: auto; border: 1px solid var(--line); border-radius: 4px; padding: 24px; background: #FAFAFA; font-size: 15px; line-height: 1.65; white-space: pre-line; }
.consent-text.full { max-height: none; }

/* 2FA */
.steps { display: flex; gap: 40px; flex-wrap: wrap; align-items: flex-start; }
.steps ol { flex: 1 1 340px; margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 20px; counter-reset: step; }
.steps li { display: flex; gap: 14px; counter-increment: step; }
.steps li::before { content: counter(step); flex-shrink: 0; width: 32px; height: 32px; border-radius: 16px; background: var(--red); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: 15px; }
.qr { flex: 0 1 260px; display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; }
.qr svg { width: 220px; height: 220px; shape-rendering: crispEdges; }

/* Upload */
.dropzone { border: 2px dashed #C4C4C4; border-radius: 4px; background: #FAFAFA; padding: 40px 24px; display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; }
.dropzone.dragover { border-color: var(--red); background: var(--red-tint); }
.dropzone svg { width: 44px; height: 44px; }
.progress-list { display: flex; flex-direction: column; gap: 12px; }
.progress-item { display: flex; flex-direction: column; gap: 6px; }
.progress-item .meta { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; }
.progress-item .name { color: var(--text-strong); overflow-wrap: anywhere; }
.bar { height: 8px; background: #E6E6E6; border-radius: 4px; overflow: hidden; }
.bar span { display: block; height: 8px; width: 0; background: var(--red); border-radius: 4px; transition: width 0.2s; }
.progress-item.done .bar span { background: #2E6B30; }
.progress-item.done .state { color: var(--ok); font-weight: 600; }
.progress-item.failed .state { color: var(--danger); font-weight: 600; }

/* Tabellen und Status */
.table-box { background: var(--card); border: 1px solid var(--line); border-radius: 4px; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 15px; }
th { background: var(--text); color: #fff; text-align: left; font-weight: 600; padding: 12px 16px; white-space: nowrap; }
td { padding: 12px 16px; border-top: 1px solid #ECECEC; vertical-align: top; }
td.name { color: var(--text-strong); overflow-wrap: anywhere; }
td.nowrap { white-space: nowrap; }
td.mono { font-family: ui-monospace, Consolas, monospace; font-size: 12px; }
.empty { padding: 24px 16px; color: var(--muted); }
.badge { display: inline-block; padding: 3px 10px; border-radius: 12px; font-size: 13px; font-weight: 600; white-space: nowrap; }
.badge.ok { background: var(--ok-bg); color: var(--ok); }
.badge.info { background: var(--info-bg); color: var(--info); }
.badge.warning { background: var(--warn-bg); color: var(--warn); }
.badge.danger { background: var(--danger-bg); color: var(--danger); }
.badge.neutral { background: var(--neutral-bg); color: var(--text); }

/* Admin */
.admin-header { background: #fff; border-bottom: 3px solid var(--red); padding: 12px 24px; display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.admin-header .brand { display: flex; align-items: center; gap: 16px; }
.admin-header .logo { height: 44px; }
.admin-title { font-family: "ABeeZee", sans-serif; font-size: 18px; }
.tag-intern { background: var(--text); color: #fff; font-size: 12px; font-weight: 600; padding: 3px 8px; border-radius: 4px; }
.admin-body { flex: 1 0 auto; display: flex; flex-wrap: wrap; }
.admin-nav { flex: 1 1 220px; max-width: 240px; background: #fff; border-right: 1px solid var(--line); padding: 24px 12px; display: flex; flex-direction: column; gap: 4px; }
.admin-nav a { padding: 10px 14px; border-radius: 4px; color: var(--text); text-decoration: none; }
.admin-nav a.active { background: var(--red-tint); color: var(--red); font-weight: 600; }
.admin-main { flex: 999 1 560px; min-width: 0; padding: 32px; display: flex; flex-direction: column; gap: 24px; font-size: 15px; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 16px; }
.kpi { background: #fff; border: 1px solid var(--line); border-radius: 4px; padding: 18px; display: flex; flex-direction: column; gap: 6px; }
.kpi .label { font-size: 13px; color: var(--muted); }
.kpi .value { font-family: "ABeeZee", sans-serif; font-size: 30px; color: var(--text-strong); }
.kpi.warn { border-left: 4px solid #B26A00; } .kpi.warn .value { color: #8A5200; }
.kpi.alarm { border-left: 4px solid var(--red); } .kpi.alarm .value { color: var(--red); }
.cards-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.info-card { background: #fff; border: 1px solid var(--line); border-radius: 4px; padding: 20px; display: flex; flex-direction: column; gap: 8px; font-size: 14px; }
.inline-form { display: inline; }
.filters { display: flex; gap: 10px; flex-wrap: wrap; }
.filters input, .filters select { height: 40px; width: auto; font-size: 14px; }
.secret-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.secret { font-size: 16px; padding: 8px 10px; display: block; }
.back { font-size: 14px; text-decoration: none; }
@media (max-width: 640px) {
  .site-main { padding: 24px 16px; }
  .card { padding: 20px; }
  .admin-nav { max-width: none; border-right: 0; border-bottom: 1px solid var(--line); flex-direction: row; flex-wrap: wrap; }
  .admin-main { padding: 20px 16px; }
  .secret-grid { grid-template-columns: minmax(0, 1fr); }
}

/* --- Ergänzungen Download-Backend --- */
.toolbar { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; justify-content: space-between; background: #fff; border: 1px solid var(--line); border-radius: 4px; padding: 12px 16px; }
.toolbar .sel { font-size: 14px; color: var(--muted); }
input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--red); }
tr.selected td { background: #FBF5F4; }
.days { font-weight: 600; white-space: nowrap; }
.days.red { color: var(--danger); }
.hint { background: var(--info-bg); color: #163C66; border: 1px solid #C3D3E8; border-radius: 4px; padding: 10px 12px; font-size: 14px; }
.overlay { position: fixed; inset: 0; background: rgba(36,37,40,0.55); display: flex; align-items: center; justify-content: center; padding: 24px; }
.modal { background: #fff; border-radius: 6px; width: 100%; max-width: 520px; padding: 28px; display: flex; flex-direction: column; gap: 16px; box-shadow: 0 12px 40px rgba(0,0,0,0.25); }
.modal .bar { height: 10px; }
.check-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
.check-list li { display: flex; justify-content: space-between; gap: 12px; }
.ok-txt { color: var(--ok); font-weight: 600; } .run-txt { color: var(--info); font-weight: 600; } .wait-txt { color: var(--muted); }
.confirm-box { background: #fff; border: 2px solid var(--red); border-radius: 4px; padding: 20px; display: flex; flex-direction: column; gap: 12px; }
.storage { height: 8px; background: #E6E6E6; border-radius: 4px; overflow: hidden; } .storage span { display: block; height: 8px; width: 18%; background: var(--text); }
.role { font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 10px; background: var(--neutral-bg); color: var(--text); }
.role.admin { background: var(--red-tint); color: var(--red); }
.filters-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; align-items: end; }
.filters-grid input, .filters-grid select { height: 40px; font-size: 14px; }
.row-alert td { background: #FDF3F2; }
.label-cap { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; }

/* Handy: Tabellen als Karten (eine Karte pro Datei) */
@media (max-width: 640px) {
  .site-header .wrap { flex-direction: row; }
  .header-meta { gap: 10px; }
  .header-meta > span { font-size: 13px; }
  table.cards, table.cards tbody, table.cards tr, table.cards td { display: block; width: 100%; }
  table.cards thead { display: none; }
  table.cards tr { padding: 14px 16px; border-top: 1px solid #ECECEC; }
  table.cards tr:first-child { border-top: 0; }
  table.cards td { border: 0; padding: 3px 0; }
  table.cards td[data-label]::before { content: attr(data-label); display: block; font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
  table.cards td.name { font-weight: 600; font-size: 16px; padding-bottom: 6px; }
  table.cards td:empty { display: none; }
  table.cards input[type=text] { margin-top: 4px; }
  .row.between > .btn { width: 100%; }
}

/* Upload-Auswahl */
.h-small { font-size: 18px; }
.w-comment { width: 45%; }
.w-progress { min-width: 140px; }
.input-small { height: 40px !important; font-size: 14px !important; }
.link-button { background: none; border: 0; padding: 0; color: var(--red); text-decoration: underline; font: inherit; cursor: pointer; }
.link-button:hover { color: var(--red-dark); }
tr.done .state { color: var(--ok); font-weight: 600; }
tr.done .bar span { background: #2E6B30; }
tr.failed .state { color: var(--danger); font-weight: 600; }
#rejected div { color: var(--danger); }
[hidden] { display: none !important; }

/* Backend: Fortschritt im Prüffenster, Warnungen */
.modal .bar span { width: 0; transition: width .4s; }
.overlay[hidden] { display: none !important; }
.days.red, .text-danger { color: var(--danger); }
.small.text-danger { color: var(--danger); }
.pager { display: flex; gap: 12px; align-items: center; }
.value-small { font-size: 18px !important; }
meter { width: 100%; height: 10px; }
.card-tight { padding: 20px; }
.check-label { display: flex; gap: 8px; align-items: center; height: 40px; font-weight: 400; }
input[type=date] { font: inherit; font-size: 14px; color: var(--text-strong); border: 1px solid var(--input); border-radius: 4px; padding: 0 10px; height: 40px; background: #fff; width: 100%; }
.wrap-any { overflow-wrap: anywhere; min-width: 180px; }
table td.nowrap { white-space: nowrap; }
@media (max-width: 640px) { table.cards td.nowrap { white-space: normal; } }

/* Release Notes */
.release { gap: 12px; }
.release h2 { margin: 0; }
.release-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.release-list li { display: flex; gap: 10px; align-items: baseline; }
.release-list .badge { min-width: 92px; text-align: center; }

/* Wartung */
.steps { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 6px; }
.admin-nav .badge { margin-left: 6px; padding: 1px 8px; font-size: 12px; }
