/* Fitrix Basic – Design nach Fitrix Pro (gleiche Farben, Maße und Bausteine) */
:root {
    --font: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
    --text: #1f2937; --muted: #64748b; --faint: #94a3b8;
    --bg: #e9edf3; --surface: #ffffff; --surface-soft: #f6f8fb;
    --border: #dfe4ec; --border-strong: #c9d1dd;
    --primary: #2563c9; --primary-dark: #1d4fa3; --primary-light: #e8f0fc;
    --rail: #f3f5f9;
    --success: #15803d; --success-bg: #e7f6ec;
    --warning: #b45309; --warning-bg: #fdf3e2;
    --error: #c0262d; --error-bg: #fdecec;
    --radius: 4px; --radius-lg: 6px;
    --shadow: 0 1px 2px rgba(15, 23, 42, .06);
    --row: 30px;
}
* { box-sizing: border-box; }
html { font-family: var(--font); font-size: 13px; line-height: 1.45; color: var(--text); -webkit-font-smoothing: antialiased; }
body { margin: 0; background: var(--bg); }
h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -.01em; }
h1 { font-size: 20px; }
h2 { font-size: 13px; }
h3 { font-size: 13.5px; }
p { margin: 0 0 10px; }
a { color: var(--primary); }
strong { font-weight: 600; }
code { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 12px; }
.muted { color: var(--muted); font-size: 12px; }

/* Rahmen: blaue Kopfleiste oben, helle Seitenleiste links */
.frame { display: grid; grid-template-columns: 208px minmax(0, 1fr); grid-template-rows: 46px minmax(0, 1fr); grid-template-areas: "top top" "rail main"; min-height: 100vh; }
.topbar { grid-area: top; position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 10px; padding: 0 14px 0 16px; color: #fff; background: linear-gradient(90deg, #1d4fa3, #2563c9 70%, #2b6fd6); box-shadow: 0 1px 3px rgba(15, 23, 42, .2); }
.brand { font-size: 16px; font-weight: 700; letter-spacing: .06em; color: #fff; text-decoration: none; }
.spacer { flex: 1; }
.topbar form { margin: 0; }
.avatar { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: rgba(255, 255, 255, .18); font-size: 11px; font-weight: 700; }
.user-name { font-size: 12.5px; }
.btn-ghost { font: inherit; font-size: 12.5px; height: 28px; padding: 0 11px; color: #fff; background: transparent; border: 1px solid rgba(255, 255, 255, .35); border-radius: var(--radius); cursor: pointer; }
.btn-ghost:hover { background: rgba(255, 255, 255, .12); border-color: rgba(255, 255, 255, .6); }
.sidenav { grid-area: rail; position: sticky; top: 46px; height: calc(100vh - 46px); overflow-y: auto; display: flex; flex-direction: column; gap: 1px; padding: 10px 8px; background: var(--rail); border-right: 1px solid var(--border); }
.sidenav .group { margin: 10px 8px 4px; font-size: 10.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--faint); }
.sidenav .group:first-child { margin-top: 2px; }
.sidenav a { display: flex; align-items: center; gap: 9px; height: 30px; padding: 0 10px; font-size: 13px; color: #334155; text-decoration: none; border-radius: var(--radius); flex: none; }
.sidenav a svg { color: var(--muted); flex: none; }
.sidenav a:hover { background: #e6eaf1; }
.sidenav a[aria-current=page] { background: var(--primary-light); color: var(--primary-dark); font-weight: 600; }
.sidenav a[aria-current=page] svg { color: var(--primary); }
.sidenav .version-link { margin-top: auto; font-size: 11px; color: var(--muted); }
.sidenav a:focus-visible { outline: 2px solid var(--primary); outline-offset: -2px; }
.release + .release { border-top: 1px solid var(--border); margin-top: 18px; padding-top: 14px; }
.release-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-bottom: 12px; }
.release-head h2 { font-size: 14px; }
.release h3 { margin-top: 12px; }
.release ul { margin: 4px 0 12px; padding-left: 20px; }
.release li { margin: 3px 0; overflow-wrap: anywhere; }
.content { grid-area: main; padding: 16px 20px 32px; min-width: 0; max-width: 1600px; }

/* Seitenkopf */
.page-head { margin-bottom: 14px; }
.eyebrow { margin: 0 0 2px; font-size: 10.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.subtitle { margin: 2px 0 0; font-size: 12px; color: var(--muted); }
.page-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.page-actions form { margin: 0; }

/* Buttons */
.btn, button.btn { font: inherit; font-size: 13px; height: 32px; padding: 0 13px; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; color: var(--text); background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius); cursor: pointer; text-decoration: none; transition: background .1s, border-color .1s; }
.btn:hover, button.btn:hover { background: var(--surface-soft); border-color: #8f9bb0; }
/* button.btn hat höhere Spezifität als .btn-primary: deshalb beide Schreibweisen, sonst bleiben Hauptknöpfe weiß. */
.btn-primary, button.btn-primary, a.btn-primary { color: #fff; background: var(--primary); border-color: var(--primary); font-weight: 600; }
.btn-primary:hover, button.btn-primary:hover, a.btn-primary:hover { color: #fff; background: var(--primary-dark); border-color: var(--primary-dark); }
.btn-danger, button.btn-danger { color: var(--error); border-color: #e7b3b5; }
.btn-danger:hover, button.btn-danger:hover { background: var(--error-bg); border-color: var(--error); }
/* Gesperrte Knöpfe: hell und gut lesbar statt dunkel auf dunkel. */
.btn:disabled, button.btn:disabled, button.btn-primary:disabled, .btn-ghost:disabled { color: #475569; background: #e2e8f0; border-color: #cbd5e1; opacity: 1; cursor: not-allowed; }
.btn.disabled { opacity: .5; pointer-events: none; }
.btn-block { width: 100%; justify-content: center; height: 34px; font-size: 13.5px; }
.btn:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid rgba(37, 99, 201, .45); outline-offset: 1px; }
.actions { display: flex; justify-content: flex-end; gap: 6px; margin-bottom: 20px; }

/* Formulare */
input:not([type=checkbox]):not([type=radio]):not([type=file]), select, textarea { font: inherit; font-size: 12.5px; height: 28px; padding: 0 8px; color: var(--text); background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius); min-width: 0; width: 100%; }
input::placeholder, textarea::placeholder { color: var(--faint); }
input:focus, select:focus, textarea:focus { border-color: var(--primary); outline: none; box-shadow: 0 0 0 2px var(--primary-light); }
input:disabled, select:disabled { background: var(--surface-soft); color: var(--muted); }
textarea { height: auto; min-height: 56px; padding: 6px 8px; resize: vertical; }
input[type=checkbox], input[type=radio] { accent-color: var(--primary); width: 14px; height: 14px; margin: 0; }
input[type=file] { font: inherit; font-size: 12.5px; }
label { display: grid; gap: 3px; font-size: 12px; color: var(--muted); }
label.check { display: flex; align-items: center; gap: 6px; color: var(--text); font-size: 12.5px; margin: 8px 0; }
.form-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px 14px; margin-bottom: 8px; }
.span-2 { grid-column: span 2; } .span-4 { grid-column: span 4; }
.narrow { max-width: 110px; }

/* Karten */
.card { display: block; max-width: 1100px; margin: 0 0 12px; padding: 14px 16px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow); color: inherit; text-decoration: none; }
.card-head { margin: -14px -16px 12px; padding: 9px 14px; font-size: 13px; border-bottom: 1px solid var(--border); }
.card-warning { border-left: 3px solid var(--warning); }
.card-table { padding: 0; overflow: auto; border-top: 2px solid var(--primary); max-width: none; }
.card-rows { padding-bottom: 0; max-width: 760px; }
.card-rows .card-head { margin-bottom: 0; }
.rows { margin: 0 -16px; }
.rows > div { display: grid; grid-template-columns: minmax(120px, 38%) 1fr; border-bottom: 1px solid var(--border); }
.rows > div:last-child { border-bottom: 0; }
.rows dt, .rows dd { margin: 0; padding: 6px 14px; min-height: var(--row); overflow-wrap: anywhere; }
.rows dt { color: var(--muted); }

/* Kennzahlen */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); margin-bottom: 12px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow); overflow: hidden; }
.stat { padding: 10px 14px; border-right: 1px solid var(--border); color: inherit; text-decoration: none; }
.stat:last-child { border-right: 0; }
a.stat:hover { background: #f5f8fd; }
.stat-value { display: block; font-size: 20px; font-weight: 500; color: var(--primary); font-variant-numeric: tabular-nums; line-height: 1.25; }
.stat-label { font-size: 11.5px; color: var(--muted); }

/* Tabellen */
.table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 12.5px; background: var(--surface); }
.table th, .table td { padding: 5px 10px; height: var(--row); text-align: left; vertical-align: middle; border-bottom: 1px solid var(--border); }
.table thead th { font-size: 12px; font-weight: 600; color: #334155; background: var(--surface-soft); white-space: nowrap; }
.table tbody tr:last-child > * { border-bottom: 0; }
.table tbody tr:hover > td { background: #f5f8fd; }
.table th a { color: inherit; text-decoration: none; }
.table th a:hover { color: var(--primary); }
.table td a { font-weight: 500; text-decoration: none; }
.table td a:hover { text-decoration: underline; }
.table td input:not([type=checkbox]), .table td select { height: 24px; min-width: 110px; }
.table td .btn { height: 24px; padding: 0 8px; font-size: 12px; }
.sort { color: var(--faint); font-size: 10px; margin-left: 3px; }
.num { text-align: right !important; white-space: nowrap; font-variant-numeric: tabular-nums; }
.empty { color: var(--muted); text-align: center !important; height: 60px !important; }
.filterbar { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 0 0 12px; }
.filterbar .grow { flex: 0 1 260px; }
.filterbar select { width: auto; }
.pagination { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }

/* Abzeichen und Meldungen */
.pill { display: inline-block; padding: 1px 8px; border-radius: 10px; font-size: 11.5px; font-weight: 600; line-height: 18px; white-space: nowrap; color: #475569; background: #eef1f5; }
.pill-green { color: var(--success); background: var(--success-bg); }
.pill-orange { color: var(--warning); background: var(--warning-bg); }
.pill-red { color: var(--error); background: var(--error-bg); }
.alert { border-radius: var(--radius); padding: 6px 10px; margin: 0 0 12px; font-size: 12.5px; max-width: 1100px; }
.alert ul { margin: 4px 0 0; padding-left: 18px; }
.alert-success { color: var(--success); background: var(--success-bg); border: 1px solid #bfe3cb; }
.alert-error { color: var(--error); background: var(--error-bg); border: 1px solid #f3c4c6; }

/* Logo */
.logo-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.logo-row form { margin: 0; }
.logo-preview { max-height: 72px; max-width: 280px; padding: 8px; border: 1px solid var(--border); border-radius: var(--radius); background: #fff; }
.inline-form { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }

/* Belege */
.totals { max-width: 380px; margin-left: auto; margin-right: 0; }
.totals > div { display: flex; justify-content: space-between; gap: 16px; padding: 3px 0; font-variant-numeric: tabular-nums; }
.totals .total { border-top: 1px solid var(--border-strong); margin-top: 5px; padding-top: 8px; font-weight: 600; font-size: 14px; }
.item { border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 12px; margin-bottom: 8px; background: var(--surface-soft); }
.item-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr 1fr; gap: 8px 12px; }
.item-grid .wide { grid-column: 1 / -1; }
.item-grid .vehicle { grid-column: span 2; }
.vehicle-row td { background: var(--primary-light); color: var(--primary-dark); font-weight: 600; }
.item-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; }
.item-sum { font-weight: 600; font-variant-numeric: tabular-nums; }

/* Anmeldung */
.login-page { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; background: linear-gradient(180deg, #1d4fa3 0, #2563c9 42vh, var(--bg) 42vh); }
.login-card { width: 100%; max-width: 380px; padding: 26px 28px 22px; border: 0; border-radius: 8px; box-shadow: 0 10px 30px rgba(15, 23, 42, .16); display: grid; gap: 12px; }
.wordmark { font-size: 20px; font-weight: 700; letter-spacing: .05em; color: var(--primary-dark); }
.subline { margin: -10px 0 6px; font-size: 12.5px; color: var(--muted); }
.login-card input:not([type=checkbox]) { height: 34px; font-size: 14px; }

/* Belege: klassische Desktop-Anordnung, auf kleinen Bildschirmen Karten. */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.nav-toggle { display: none; }
.document-details { max-width: 760px; }
.document-meta dd { overflow-wrap: anywhere; }
.document-lines th, .document-lines td { padding: 10px 12px; }
.document-lines .line-description { min-width: 160px; overflow-wrap: anywhere; }
.document-lines .line-description strong { display: inline-block; margin-bottom: 2px; }
.document-lines .line-total { font-weight: 600; }
.document-total .total { padding-top: 12px; margin-top: 10px; font-size: 16px; }
.document-status .page-actions { margin-top: 0; }
.document-status .payment-form label { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.document-status input[type=date] { width: auto; }

/* Geführte Verbindungseinrichtung, ohne zusätzliche Frontend-Abhängigkeiten. */
.connection-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; max-width: 1200px; }
.connection-card { display: flex; flex-direction: column; align-items: start; gap: 10px; padding: 22px; }
.connection-card h2 { font-size: 17px; }
.connection-card p { margin: 0; }
.connection-card > .btn { margin-top: auto; }
.connection-icon { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 9px; background: var(--primary-light); color: var(--primary-dark); font-size: 22px; font-weight: 600; }
.setup-note { max-width: 1200px; margin-top: 12px; }
.setup-note h2, .setup-note > strong { display: block; margin-bottom: 6px; }
.setup-note p { margin-bottom: 0; }
.setup-wizard { max-width: 860px; padding: 24px; }
.wizard-steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; padding: 0 0 22px; margin: 0 0 24px; border-bottom: 1px solid var(--border); list-style: none; }
.wizard-steps button { width: 100%; min-height: 40px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-soft); color: var(--muted); font: inherit; display: flex; align-items: center; gap: 8px; padding: 8px 12px; cursor: pointer; }
.wizard-steps button[aria-current=step] { color: var(--primary-dark); border-color: var(--primary); background: var(--primary-light); font-weight: 600; }
.wizard-steps button:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.setup-wizard h2 { font-size: 18px; margin-bottom: 10px; }
.setup-wizard h2:focus { outline: none; }
.setup-wizard p { line-height: 1.65; }
.setup-fields { display: grid; gap: 16px; max-width: 560px; margin: 20px 0; }
.setup-fields label, label.setup-fields { font-size: 13px; gap: 6px; }
.setup-fields input:not([type=file]), .setup-fields select { height: 38px; font-size: 14px; }
.setup-two { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-bottom: 0; }
.wizard-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 28px; }
.wizard-actions .btn, .setup-check .btn, .setup-fields > .btn, .connection-card .btn { min-height: 36px; height: auto; padding-top: 7px; padding-bottom: 7px; white-space: normal; }
.setup-instructions { padding-left: 22px; line-height: 1.7; }
.setup-instructions li { padding-left: 4px; margin-bottom: 12px; }
.setup-check { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; justify-content: space-between; max-width: 860px; }
.setup-check h2 { margin-bottom: 4px; }
.setup-check p { margin: 4px 0; }
.setup-details { margin: 16px 0; }
.setup-details dt { color: var(--muted); font-size: 12px; }
.setup-details dd { margin: 4px 0 14px; overflow-wrap: anywhere; }
.provider-options { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 20px; }
.provider-choice { display: flex; flex-direction: column; gap: 4px; font-size: 17px; padding: 18px; }
.provider-choice.selected { border-color: var(--primary); background: var(--primary-light); }
.provider-choice:focus-visible { outline: 2px solid var(--primary); }
.alert-info { color: var(--primary-dark); background: var(--primary-light); line-height: 1.65; }
.connection-token { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--border); }
.connection-token:last-child { border-bottom: 0; }
.connection-token strong { overflow-wrap: anywhere; }
.connection-token p { margin: 5px 0 0; }
.token-reveal { padding: 16px; border: 1px solid var(--primary); border-radius: var(--radius); background: var(--primary-light); margin-bottom: 16px; }
.token-reveal code { display: block; overflow-wrap: anywhere; padding: 12px 0; user-select: all; }

@media (max-width: 1180px) {
    .connection-grid { grid-template-columns: minmax(0, 1fr); }
    .connection-card { padding: 18px; }
}

@media (max-width: 860px) {
    .frame { grid-template-columns: minmax(0, 1fr); grid-template-rows: 46px auto minmax(0, 1fr); grid-template-areas: "top" "rail" "main"; }
    .user-name { display: none; }
    .sidenav { position: static; height: auto; flex-direction: row; overflow-x: auto; padding: 6px 8px; border-right: 0; border-bottom: 1px solid var(--border); }
    .sidenav .group { display: none; }
    .content { padding: 12px; }
    .form-grid { grid-template-columns: 1fr 1fr; }
    .span-2, .span-4 { grid-column: span 2; }
    .stat { border-bottom: 1px solid var(--border); }
    .filterbar .grow { flex: 1 1 100%; }
    .item-grid { grid-template-columns: 1fr 1fr; }
    .item-grid .name { grid-column: 1 / -1; }
    .frame { grid-template-rows: 56px auto minmax(0, 1fr); }
    .topbar { min-height: 56px; gap: 8px; padding: 0 12px; }
    .nav-enhanced .nav-toggle { display: flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 9px; }
    .nav-enhanced .sidenav { display: none; }
    .nav-enhanced.nav-open .sidenav { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; padding: 12px; overflow: visible; }
    .nav-enhanced.nav-open .sidenav .group { display: block; grid-column: 1 / -1; margin-top: 10px; }
    .nav-enhanced.nav-open .sidenav a { min-height: 44px; height: auto; }
    .nav-enhanced.nav-open .sidenav .version-link { grid-column: 1 / -1; }
    .content { padding: 18px 14px 32px; }
    .page-head h1 { font-size: 22px; overflow-wrap: anywhere; }
    .page-actions { gap: 8px; margin-top: 14px; }
    .btn, button.btn, .btn-ghost { min-height: 40px; height: auto; }
    input:not([type=checkbox]):not([type=radio]):not([type=file]), select { min-height: 44px; font-size: 16px; }
    textarea { font-size: 16px; }
    .setup-fields input:not([type=file]), .setup-fields select { min-height: 44px; font-size: 16px; }
    .setup-wizard { padding: 18px; }
}

@media (max-width: 700px) {
    .document-details { max-width: none; }
    .document-lines { display: block; }
    .document-lines thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
    .document-lines tbody { display: block; }
    .document-lines .line-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; padding: 16px; border-bottom: 1px solid var(--border); }
    .document-lines .line-row:last-child { border-bottom: 0; }
    .document-lines .line-row td { display: block; height: auto; padding: 0; border: 0; min-width: 0; text-align: left !important; white-space: normal; }
    .document-lines .line-row td[data-label]::before { content: attr(data-label); display: block; font-size: 11px; color: var(--muted); font-weight: 400; margin-bottom: 3px; }
    .document-lines .line-row .line-position, .document-lines .line-row .line-description { grid-column: 1 / -1; }
    .document-lines .line-row .line-position { color: var(--muted); font-size: 11px; display: flex; gap: 5px; }
    .document-lines .line-description strong { font-size: 14px; line-height: 1.5; }
    .document-lines .line-description .muted { line-height: 1.6; }
    .document-lines .line-row .line-total { color: var(--primary-dark); font-size: 14px; }
    .document-lines .vehicle-row, .document-lines .vehicle-row td { display: block; height: auto; }
    .document-lines .vehicle-row td { padding: 12px 16px; white-space: normal; overflow-wrap: anywhere; line-height: 1.5; }
    .document-lines tbody tr:hover > td { background: transparent; }
    .document-lines .vehicle-row:hover > td { background: var(--primary-light); }
    .document-status .btn { min-height: 44px; }
    .document-status .payment-form label { width: 100%; }
    .document-status input[type=date] { width: 100%; }
    .setup-check { align-items: stretch; }
    .setup-check form, .setup-check .btn { width: 100%; }
    .wizard-steps { gap: 5px; margin-bottom: 20px; padding-bottom: 16px; }
    .wizard-steps button { padding: 8px 6px; font-size: 12px; gap: 5px; min-height: 44px; }
    .wizard-actions .btn { flex: 1 1 auto; min-height: 44px; justify-content: center; }
    .connection-token { align-items: start; flex-wrap: wrap; }
    .provider-choice { padding: 14px; font-size: 16px; }
    .setup-details code { font-size: 12px; }
}

@media (max-width: 520px) {
    .form-grid { grid-template-columns: minmax(0, 1fr); }
    .form-grid .span-2, .form-grid .span-4 { grid-column: 1 / -1; }
    .setup-two { grid-template-columns: minmax(0, 1fr); }
    .item-foot { flex-wrap: wrap; gap: 12px; }
    .topbar .avatar { display: none; }
}

/* Logbuch */
.activity-log .nowrap { white-space: nowrap; }
.activity-log .log-message { max-width: 520px; word-break: break-word; }
.activity-log details { margin-top: 4px; }
.activity-log summary { cursor: pointer; color: var(--muted); font-size: 12px; }
.activity-log pre { margin: 4px 0 0; padding: 6px 8px; font-size: 11.5px; white-space: pre-wrap; background: #f6f8fb; border-radius: var(--radius); }
.topbar .test-mode { margin-right: 12px; padding: 3px 10px; border-radius: 12px; font-size: 12px; font-weight: 600; color: #7c2d12; background: #fed7aa; text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 45vw; }

/* Zahlungsabgleich und Statistik */
.payments .amount-in { color: var(--success); font-weight: 600; }
.payments .amount-out { color: var(--error); }
.payments .inline-form { display: flex; gap: 6px; flex-wrap: wrap; }
.payments .inline-form select { max-width: 320px; }
.small { font-size: 12px; }
.bar-chart { display: grid; grid-template-columns: repeat(12, 1fr); gap: 6px; align-items: end; height: 180px; padding: 8px 4px 0; }
.bar-chart .bar { display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 100%; font-size: 11px; color: var(--muted); }
.bar-chart .fill { width: 70%; min-height: 2px; background: var(--primary); border-radius: 3px 3px 0 0; }
.bar-chart .fill.paid { background: var(--success); }
.bar-chart .value { font-size: 10.5px; color: var(--muted); margin-bottom: 2px; white-space: nowrap; }
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 12px; }
.nowrap { white-space: nowrap; }

/* Ladeanzeige bei längeren Aktionen */
.spinner { display: inline-block; width: 1em; height: 1em; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; vertical-align: -0.15em; }
@keyframes spin { to { transform: rotate(360deg); } }
.busy-overlay { position: fixed; inset: 0; display: none; align-items: center; justify-content: center; background: rgba(15, 23, 42, .5); z-index: 1000; cursor: progress; }
body.busy .busy-overlay { display: flex; }
.busy-box { display: flex; flex-direction: column; align-items: center; gap: .5rem; max-width: 22rem; padding: 1.5rem 1.75rem; background: #fff; border-radius: 12px; box-shadow: 0 10px 30px rgba(0, 0, 0, .2); text-align: center; }
.busy-box .spinner { width: 2rem; height: 2rem; border-width: 3px; color: #2563eb; }

/* Belege */
.dropzone { border: 2px dashed var(--border); text-align: center; }
.dropzone.dragging { border-color: var(--primary); background: var(--primary-light); }
.dropzone-button { cursor: pointer; display: inline-block; margin: 6px 0; }
.upload-list { list-style: none; padding: 0; margin: 8px auto 0; max-width: 34rem; text-align: left; }
.upload-list li { padding: 3px 0; }
.upload-list li.error { color: #b42318; }
.month-label { min-width: 9rem; text-align: center; }
.receipt-layout { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 12px; align-items: start; }
.receipt-preview img { max-width: 100%; height: auto; display: block; }
.receipt-preview iframe { width: 100%; height: 70vh; border: 0; }
@media (max-width: 820px) { .receipt-layout { grid-template-columns: 1fr; } .receipt-preview iframe { height: 50vh; } }
.checkbox { display: flex; align-items: center; gap: 8px; }
.amount-in { color: var(--success); }
.amount-out { color: var(--error); }

/* Nebenknöpfe im Inhalt (btn-ghost ist für die dunkle Kopfleiste gedacht) gut sichtbar machen. */
main .btn-ghost, table .btn-ghost { color: var(--text); background: var(--surface); border: 1px solid var(--border-strong); height: 30px; }
main .btn-ghost:hover, table .btn-ghost:hover { background: var(--surface-soft); border-color: #8f9bb0; }
.busy-box strong { font-size: 16px; }
