:root {
  --accent: #f07d00;
  --accent-dark: #c96600;
  --accent-soft: #fff3e6;
  --ink: #1e1f1f;
  --bg: #f4f5f7;
  --card: #ffffff;
  --text: #1f2933;
  --muted: #6b7684;
  --line: #e4e8ec;
  --ok: #0b6e4f;
  --warn: #b45309;
  --err: #b91c1c;
  --radius: 10px;
  font-family: "Source Sans 3", "Segoe UI", system-ui, -apple-system, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font-size: 15px; line-height: 1.45; }
a { color: var(--accent-dark); text-decoration: none; }
a:hover { text-decoration: underline; }
.hidden { display: none !important; }
h1 { font-size: 24px; margin: 0 0 6px; letter-spacing: -0.2px; }
h2 { font-size: 18px; margin: 0 0 12px; }
h3 { font-size: 14px; margin: 18px 0 8px; color: var(--muted); text-transform: uppercase; letter-spacing: .6px; font-weight: 700; }
p { margin: 0 0 10px; }
.hint { color: var(--muted); font-size: 13px; }
.lead { font-size: 16px; color: var(--text); }
.screen { min-height: 100vh; }
.login-wrap { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 100vh; padding: 24px; gap: 14px; }
.card { background: var(--card); border-radius: var(--radius); padding: 22px 24px; box-shadow: 0 1px 2px rgba(31,41,51,.06), 0 8px 24px rgba(31,41,51,.06); }
.login-card { width: 100%; max-width: 460px; }
.logo { height: 44px; width: auto; display: block; }
.logo-login { height: 64px; margin: 0 auto 14px; }
.login-title { text-align: center; margin-bottom: 4px; }
.login-sub { text-align: center; }
.tabs { display: flex; gap: 6px; margin: 14px 0 4px; border-bottom: 1px solid var(--line); }
.tabs button { background: none; border: 0; border-bottom: 3px solid transparent; color: var(--muted); padding: 8px 12px; border-radius: 0; font-weight: 600; }
.tabs button:hover { background: none; color: var(--text); }
.tabs button.active { color: var(--accent-dark); border-bottom-color: var(--accent); }
.legal { font-size: 13px; color: var(--muted); text-align: center; }
.legal a { margin: 0 6px; }
header { display: flex; align-items: center; gap: 16px; padding: 10px 24px; background: var(--card); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
header .brand { display: flex; align-items: center; gap: 12px; }
header .brand span { font-weight: 700; color: var(--ink); font-size: 16px; }
header .spacer { flex: 1; }
header .who { color: var(--muted); font-size: 14px; text-align: right; line-height: 1.2; }
header .who b { color: var(--text); }
.layout { display: grid; grid-template-columns: 220px 1fr; min-height: calc(100vh - 65px); }
nav { background: var(--card); border-right: 1px solid var(--line); padding: 16px 10px; display: flex; flex-direction: column; }
nav a { display: block; padding: 10px 14px; border-radius: 8px; color: var(--text); font-weight: 600; margin-bottom: 4px; }
nav a:hover { background: var(--bg); text-decoration: none; }
nav a.active { background: var(--accent); color: #fff; }
nav .nav-foot { margin-top: auto; padding: 12px 14px 4px; font-size: 12px; color: var(--muted); }
nav .nav-foot a { display: inline; padding: 0; margin: 0 6px 0 0; font-weight: 500; color: var(--muted); }
main { padding: 24px 28px 60px; max-width: 1200px; }
section.view { display: none; }
section.view.active { display: block; }
.grid { display: grid; gap: 16px; }
.grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid.cols-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 1000px) { .grid.cols-3, .grid.cols-2, .grid.cols-4 { grid-template-columns: 1fr; } .layout { grid-template-columns: 1fr; } nav { flex-direction: row; flex-wrap: wrap; border-right: 0; border-bottom: 1px solid var(--line); } nav .nav-foot { display: none; } }
.stat { display: flex; flex-direction: column; gap: 4px; }
.stat .num { font-size: 30px; font-weight: 700; color: var(--accent-dark); line-height: 1; }
.stat .lbl { color: var(--muted); font-size: 13px; text-transform: uppercase; letter-spacing: .6px; }
.bar { height: 8px; background: var(--line); border-radius: 4px; overflow: hidden; margin-top: 8px; }
.bar > div { height: 100%; background: var(--accent); }
.bar.warn > div { background: var(--err); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); padding: 8px 10px; border-bottom: 2px solid var(--accent); }
td { padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
tr.click { cursor: pointer; }
tr.click:hover td { background: #fafafa; }
td.r, th.r { text-align: right; white-space: nowrap; }
.badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; background: #e5e7eb; color: #374151; }
.badge.done { background: #d1fae5; color: var(--ok); }
.badge.rejected, .badge.failed { background: #fee2e2; color: var(--err); }
.badge.pending, .badge.running, .badge.processing { background: #fef3c7; color: var(--warn); }
.badge.plan { background: var(--accent-soft); color: var(--accent-dark); }
button, .btn { font: inherit; font-weight: 600; padding: 9px 16px; border-radius: 8px; border: 1px solid var(--accent); background: var(--accent); color: #fff; cursor: pointer; }
button:hover, .btn:hover { background: var(--accent-dark); text-decoration: none; }
button.secondary, .btn.secondary { background: #fff; color: var(--accent-dark); }
button.secondary:hover { background: var(--accent-soft); }
button.danger { background: #fff; color: var(--err); border-color: var(--err); }
button.small { padding: 5px 10px; font-size: 13px; }
button:disabled { opacity: .5; cursor: default; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 12px; align-items: center; }
label { display: block; font-size: 13px; color: var(--muted); margin: 10px 0 4px; font-weight: 600; }
input[type=text], input[type=password], input[type=email], input[type=number], input[type=date], select, textarea {
  width: 100%; font: inherit; padding: 8px 10px; border: 1px solid #cfd6de; border-radius: 8px; background: #fff; color: var(--text); }
input:focus, select:focus, textarea:focus { outline: 2px solid #ffd9b3; border-color: var(--accent); }
textarea { min-height: 120px; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; }
textarea.plain { font-family: inherit; font-size: 15px; min-height: 70px; }
input[type=color] { width: 60px; height: 36px; padding: 0; border: 1px solid #cfd6de; border-radius: 8px; background: #fff; }
.row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.row.tight { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
.check { display: flex; align-items: center; gap: 8px; margin: 8px 0; font-weight: 500; }
.check input { width: auto; }
.radio-group { display: flex; gap: 8px; flex-wrap: wrap; margin: 6px 0 10px; }
.radio-group label { flex: 1; min-width: 160px; margin: 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; font-weight: 600; color: var(--text); display: flex; gap: 8px; align-items: flex-start; }
.radio-group label input { width: auto; margin-top: 3px; }
.radio-group label small { display: block; font-weight: 400; color: var(--muted); font-size: 12px; }
.radio-group label.selected { border-color: var(--accent); background: var(--accent-soft); }
.form-card + .form-card { margin-top: 16px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; }
pre { background: #1e1f1f; color: #e2e8f0; padding: 12px 14px; border-radius: 8px; overflow: auto; font-size: 12.5px; }
code { background: var(--accent-soft); padding: 1px 5px; border-radius: 4px; font-size: 13px; }
.finding { padding: 8px 10px; border-left: 3px solid var(--err); background: #fff5f5; margin: 6px 0; border-radius: 4px; font-size: 14px; }
.finding.warning { border-color: var(--warn); background: #fffbeb; }
.finding .bt { font-weight: 700; margin-right: 6px; }
.finding .src { color: var(--muted); }
.notice { padding: 10px 14px; border-radius: 8px; background: var(--accent-soft); border: 1px solid #ffd9b3; font-size: 14px; margin: 8px 0 12px; }
.notice.info { background: #eef6ff; border-color: #bfdbfe; }
.notice.lock { background: #f3f4f6; border-color: var(--line); color: var(--muted); }
.detail { margin-top: 16px; }
.detail dl { display: grid; grid-template-columns: 180px 1fr; gap: 4px 12px; margin: 0; }
.detail dt { color: var(--muted); }
.detail dd { margin: 0; }
#toast { position: fixed; right: 20px; bottom: 20px; z-index: 20; display: flex; flex-direction: column; gap: 8px; }
.toast { background: #111827; color: #fff; padding: 10px 14px; border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,.2); max-width: 420px; font-size: 14px; }
.toast.err { background: var(--err); }
.toast.ok { background: var(--ok); }
#modal { position: fixed; inset: 0; background: rgba(15,23,42,.55); z-index: 30; display: flex; align-items: center; justify-content: center; padding: 24px; }
.modal-box { background: #fff; border-radius: var(--radius); width: min(960px, 100%); height: min(90vh, 900px); display: flex; flex-direction: column; overflow: hidden; }
.modal-box.modal-auto { height: auto; max-height: 90vh; }
.modal-head { display: flex; align-items: center; padding: 10px 16px; border-bottom: 1px solid var(--line); font-weight: 700; }
.modal-head .spacer { flex: 1; }
.modal-box iframe { flex: 1; border: 0; width: 100%; }
.modal-body { padding: 18px; overflow: auto; }
.logo-preview { max-height: 70px; max-width: 220px; display: block; margin: 6px 0 10px; border: 1px solid var(--line); padding: 6px; border-radius: 6px; background: #fff; }
.secret { font-family: ui-monospace, Menlo, Consolas, monospace; background: #fff7ed; border: 1px solid #fdba74; padding: 10px; border-radius: 8px; word-break: break-all; }
.filter { display: flex; gap: 10px; align-items: center; margin-bottom: 12px; flex-wrap: wrap; }
.filter select { width: auto; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.mt8 { margin-top: 8px; }
.mt12 { margin-top: 12px; }
.mt16 { margin-top: 16px; }
.m0 { margin: 0; }
.error-text { color: var(--err); }
.w260 { width: 260px; }
.sticky-actions { position: sticky; bottom: 0; background: var(--bg); padding: 12px 0; }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
@media (max-width: 1000px) { .steps { grid-template-columns: 1fr; } }
.step { border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; }
.step .no { display: inline-block; width: 26px; height: 26px; border-radius: 50%; background: var(--accent); color: #fff; text-align: center; line-height: 26px; font-weight: 700; margin-right: 8px; }
.step.done .no { background: var(--ok); }
.guide { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
@media (max-width: 1000px) { .guide { grid-template-columns: 1fr; } }
.guide .g { border-left: 4px solid var(--accent); padding: 8px 12px; background: #fafafa; border-radius: 0 8px 8px 0; font-size: 14px; }
.guide .g b { display: block; margin-bottom: 4px; font-size: 15px; }
.guide .g .fmt { display: inline-block; margin-top: 6px; font-weight: 700; color: var(--accent-dark); }
.lines th, .lines td { padding: 6px 6px; }
.lines input, .lines select { padding: 6px 8px; }
.lines td.r input { text-align: right; }
.lines .del { color: var(--err); background: none; border: 0; font-size: 18px; padding: 0 6px; line-height: 1; }
.lines .del:hover { background: none; }
.totals { margin-left: auto; width: 320px; margin-top: 10px; }
.totals td { padding: 4px 8px; border: 0; }
.totals tr.gross td { font-weight: 700; font-size: 16px; border-top: 2px solid var(--accent); }
.result-files a { display: inline-block; margin: 6px 10px 0 0; }
details { margin-top: 16px; }
details summary { cursor: pointer; font-weight: 600; color: var(--accent-dark); padding: 6px 0; }
.legal-page { max-width: 820px; margin: 0 auto; padding: 24px; }
.legal-page h2 { margin-top: 24px; }
.legal-page .card { padding: 28px 32px; }
.legal-page .back { display: inline-block; margin-bottom: 14px; }

/* Felder einer Zeile stehen auf einer Linie, auch wenn ein Label umbricht */
.row > div { display: flex; flex-direction: column; justify-content: flex-end; }
.row > div > label { margin-top: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row > div > .check { margin-top: 0; }
.actions.secondary-actions { margin-top: 8px; }
.actions.secondary-actions button { font-weight: 500; }
/* Karten einer Ansicht deutlich voneinander absetzen */
section.view > .card + .card, section.view > .grid + .card, section.view > .card + details, section.view > .card + .grid, section.view > .notice + .card { margin-top: 20px; }
.form-card + .form-card { margin-top: 20px; }

.mail-form label { margin-top: 8px; }
.mail-form textarea { font-family: inherit; font-size: 14px; min-height: 160px; }
.kv { display: grid; grid-template-columns: 180px 1fr; gap: 4px 12px; margin: 8px 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }

select.company { width: auto; max-width: 320px; font-weight: 700; padding: 6px 30px 6px 10px; }
.step.done { border-color: var(--ok); background: #f3fbf7; }
.step.done .no { background: var(--ok); }
.step.optional { opacity: .85; }
.step .no.opt { background: var(--muted); }
