/* Invictus Flugtechnik · Buchhaltung — application shell & components.
   Everything visual sources the v4.0 design-system tokens. */

html, body { height: 100%; }
body { font-family: var(--font-sans); }

[x-cloak] { display: none !important; }
.ift-icon { display: inline-block; vertical-align: middle; flex: none; }
.mono { font-family: var(--font-mono); }
.nowrap { white-space: nowrap; }

/* ===== App shell ===== */
.ift-app {
  display: flex;
  height: 100vh;
  width: 100%;
  overflow: hidden;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-sans);
}
.ift-app *::-webkit-scrollbar { width: 10px; height: 10px; }
.ift-app *::-webkit-scrollbar-thumb {
  background: var(--color-border); border-radius: 6px; border: 3px solid var(--color-bg);
}
.ift-app *::-webkit-scrollbar-track { background: transparent; }

/* ===== Sidebar (always navy) ===== */
.sidebar {
  width: 252px;
  flex: none;
  background: var(--ift-navy);
  border-right: 1px solid var(--ift-hairline-dark);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}
.sidebar-brand {
  display: flex; align-items: center;
  padding: 16px 16px 12px;
}
.brand-lockup { width: 100%; max-width: 200px; height: auto; display: block; }

.context-chip {
  margin: 4px 14px 12px;
  padding: 9px 11px; border-radius: 9px;
  background: var(--ift-navy-700); border: 1px solid var(--ift-hairline-dark);
  display: flex; flex-direction: column; gap: 3px; position: relative;
}
.context-chip .cy { color: var(--ift-ink-dark); font-size: 12px; font-weight: 500; }
.context-chip .cm {
  font-family: var(--font-mono); font-size: 9.5px; color: var(--ift-cloud-muted);
  letter-spacing: 0.03em;
}
.context-chip .q-pill {
  position: absolute; top: 9px; right: 11px;
  font-family: var(--font-mono); font-size: 9.5px; font-weight: 500;
  color: var(--ift-navy); background: var(--ift-amber);
  padding: 2px 6px; border-radius: 20px;
}

.nav-groups { flex: 1; padding: 0 10px 12px; }
.nav-group-label {
  font-family: var(--font-mono); font-size: 9px; text-transform: uppercase;
  letter-spacing: 0.2em; color: var(--ift-blue-dark); padding: 14px 8px 6px;
}
.nav-group-en { display: block; color: var(--ift-amber); font-weight: 400; margin-top: 2px; }
.nav-btn {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 11px; border-radius: 8px;
  color: var(--ift-cloud-muted); text-decoration: none;
  border-left: 3px solid transparent; margin-bottom: 1px;
  transition: background var(--duration-base) var(--ease-out),
              border-color var(--duration-base) var(--ease-out),
              box-shadow var(--duration-base) var(--ease-out);
  position: relative;
}
.nav-btn:hover { background: rgba(143,160,181,0.10); text-decoration: none; }
.nav-btn .ni { color: var(--ift-cloud-muted); flex: none; }
.nav-btn .nt { line-height: 1.15; flex: 1; min-width: 0; }
.nav-btn .nt .main { display: block; font-size: 13.5px; font-weight: 500; color: var(--ift-ink-dark); }
.nav-btn .nt .sub { display: block; font-size: 10.5px; color: var(--ift-cloud-muted); margin-top: 1px; }
.nav-btn.active {
  background: rgba(11,114,255,0.22);
  border-left: 3px solid var(--ift-amber);
  box-shadow: inset 0 0 0 1px rgba(59,142,255,0.22),
              -1px 0 10px -2px rgba(255,155,0,0.45);
}
.nav-btn.active .main { color: #fff; font-weight: 650; letter-spacing: 0.005em; }
.nav-btn.active .sub { color: var(--ift-amber); }
.nav-btn.active .ni { color: var(--ift-amber); }
.nav-badge {
  font-family: var(--font-mono); font-size: 9.5px; font-weight: 500;
  background: var(--ift-amber); color: var(--ift-navy);
  border-radius: 20px; padding: 1px 6px; flex: none;
}

.sidebar-footer {
  border-top: 1px solid var(--ift-hairline-dark);
  padding: 12px 14px; display: flex; align-items: center; gap: 10px;
}
.avatar {
  width: 30px; height: 30px; border-radius: 50%; flex: none;
  background: linear-gradient(150deg, #3B8EFF, #0B72FF);
  color: #fff; font-size: 11px; font-weight: 600;
  display: flex; align-items: center; justify-content: center;
}
.sidebar-footer .who { flex: 1; min-width: 0; line-height: 1.2; }
.sidebar-footer .who .n { font-size: 12px; color: var(--ift-ink-dark); font-weight: 500; }
.sidebar-footer .who .r { font-size: 10px; color: var(--ift-cloud-muted); }
.gobd { font-family: var(--font-mono); font-size: 9px; color: var(--ift-success); display: flex; align-items: center; gap: 4px; }
.gobd::before { content: "●"; font-size: 8px; }
.gobd-warn { color: var(--ift-amber); }

/* ===== Main column ===== */
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; overflow: hidden; }
.topbar {
  height: 62px; flex: none;
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-hairline);
  display: flex; align-items: center; gap: 16px;
  padding: 0 24px;
}
.topbar .titles { flex: 1; min-width: 0; }
.topbar .titles .t { font-size: 17px; font-weight: 600; color: var(--color-text); line-height: 1.2; }
.topbar .titles .s { font-family: var(--font-mono); font-size: 12px; color: var(--color-text-faint); }
.search {
  width: 220px; display: flex; align-items: center; gap: 8px; position: relative;
  background: var(--color-surface-sunken); border: 1px solid var(--color-border);
  border-radius: 8px; padding: 7px 10px; color: var(--color-text-faint);
}
.search-dropdown:empty { display: none; }
.search-dropdown {
  position: absolute; top: calc(100% + 6px); left: 0; width: 340px; z-index: 60;
  background: var(--color-surface); border: 1px solid var(--color-border);
  border-radius: 10px; box-shadow: 0 12px 32px rgba(0,0,0,0.14);
  padding: 6px; max-height: 60vh; overflow-y: auto;
}
.search-group {
  font-size: 10px; text-transform: uppercase; letter-spacing: .05em;
  color: var(--color-text-faint); padding: 8px 8px 3px;
}
.search-hit {
  display: flex; flex-direction: column; gap: 1px; padding: 6px 8px;
  border-radius: 7px; text-decoration: none; color: var(--color-text);
}
.search-hit:hover { background: var(--color-surface-sunken); }
.search-hit .sh-label { font-size: 12.5px; }
.search-hit .sh-sub { font-size: 10.5px; color: var(--color-text-faint); }
.search-empty { padding: 10px 8px; font-size: 12px; color: var(--color-text-faint); }
.search input {
  border: 0; background: transparent; outline: none; flex: 1; min-width: 0;
  min-height: 0; padding: 4px 0; border-radius: 0;
  font-family: var(--font-sans); font-size: 12.5px; color: var(--color-text);
}
.search .kbd {
  font-family: var(--font-mono); font-size: 10px; color: var(--color-text-faint);
  border: 1px solid var(--color-border); border-radius: 4px; padding: 1px 5px;
}
.period-chip {
  font-family: var(--font-mono); font-size: 11px; font-weight: 500;
  color: var(--color-primary); background: rgba(11,114,255,0.10);
  border: 1px solid rgba(11,114,255,0.20); border-radius: 8px; padding: 6px 10px;
}
select.period-chip { cursor: pointer; -webkit-appearance: none; appearance: none; padding-right: 22px;
  background-image: linear-gradient(45deg, transparent 50%, var(--color-primary) 50%), linear-gradient(135deg, var(--color-primary) 50%, transparent 50%);
  background-position: calc(100% - 11px) 11px, calc(100% - 7px) 11px; background-size: 4px 4px, 4px 4px; background-repeat: no-repeat; }
.theme-toggle {
  width: 34px; height: 34px; border-radius: 8px; flex: none;
  border: 1px solid var(--color-border); background: var(--color-surface);
  color: var(--color-text-muted); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.theme-toggle:hover { background: var(--color-surface-sunken); }

.content { flex: 1; overflow-y: auto; padding: 24px; }
.view { max-width: 1180px; margin: 0 auto; animation: fade-in var(--duration-base) var(--ease-out); }
.view-narrow { max-width: 1000px; }
@keyframes fade-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* ===== Cards & components ===== */
.card {
  background: var(--color-surface); border: 1px solid var(--color-border);
  border-radius: 12px; box-shadow: var(--shadow-xs); padding: 20px;
}
.card-navy {
  background: var(--ift-navy-700); border: 1px solid var(--ift-hairline-dark);
  border-radius: 12px; padding: 20px; color: var(--ift-ink-dark);
}
/* Outline buttons sit on the dark navy card — force readable light contrast
   (the default uses page text colour, which is near-invisible in light mode). */
.card-navy .btn-outline {
  color: #fff; border-color: rgba(255,255,255,0.40);
  background: rgba(255,255,255,0.08);
}
.card-navy .btn-outline:hover { background: rgba(255,255,255,0.18); text-decoration: none; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.card-title { font-size: 15px; font-weight: 600; color: var(--color-text); }

.overline {
  font-family: var(--font-mono); font-size: 9px; text-transform: uppercase;
  letter-spacing: 0.18em; color: var(--color-text-muted);
}

/* KPI grid — responsive: 4 → 2 → 1 columns, never overflows */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 16px; }
/* Dashboard 2-column area: stacks below 880px */
.dash-grid { display: grid; grid-template-columns: 1.6fr 1fr; gap: 18px; margin-top: 18px; }
@media (max-width: 880px) { .dash-grid { grid-template-columns: 1fr; } }
/* Slightly larger base UI scale; content reflows responsively. Tune --ui-zoom. */
:root { --ui-zoom: 1.07; }
.view, .view-narrow { width: 100%; zoom: var(--ui-zoom); }
.kpi .kpi-label { display: flex; align-items: center; gap: 6px; }
.kpi .dot { width: 7px; height: 7px; border-radius: 2px; flex: none; }
.kpi .kpi-value {
  font-family: var(--font-mono); font-size: 23px; font-weight: 600;
  color: var(--color-text); white-space: nowrap; margin-top: 10px;
}
.kpi .kpi-sub { font-size: 11px; color: var(--color-text-muted); margin-top: 4px; }

/* Cashflow bar chart */
.legend { display: flex; gap: 16px; align-items: center; }
.legend span { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--color-text-muted); }
.legend .sw { width: 10px; height: 10px; border-radius: 3px; }
.cashflow { height: 180px; display: flex; align-items: flex-end; gap: 18px; padding-top: 12px; }
.bar-pair { flex: 1; display: flex; align-items: flex-end; justify-content: center; gap: 5px; height: 100%; }
.bar-pair .col { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; flex: 1; }
.bar { width: 100%; max-width: 18px; border-radius: 4px 4px 0 0; min-height: 3px; }
.bar.ein { background: linear-gradient(180deg, #3B8EFF, #0B72FF); }
.bar.aus { background: rgba(255,155,0,0.85); }
.bar-month { font-family: var(--font-mono); font-size: 9px; color: var(--color-text-faint); margin-top: 7px; }
.cf-stats { display: flex; gap: 24px; border-top: 1px solid var(--color-hairline); margin-top: 14px; padding-top: 14px; }
.cf-stats .st .l { font-size: 10px; color: var(--color-text-muted); }
.cf-stats .st .v { font-family: var(--font-mono); font-size: 14px; font-weight: 600; color: var(--color-text); }
.cf-stats .st .v.pos { color: var(--ift-success); }

/* To-do list */
.todo-row { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--color-hairline); }
.todo-row:last-child { border-bottom: 0; }
.todo-row .dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.todo-row .tx { flex: 1; }
.todo-row .tx .ti { font-size: 13px; color: var(--color-text); }
.todo-row .tx .su { font-size: 11px; color: var(--color-text-muted); }
.todo-row .due { font-family: var(--font-mono); font-size: 11px; color: var(--color-text-faint); }

/* JSON payload card */
.json-payload { font-family: var(--font-mono); font-size: 12.5px; line-height: 1.7; }
.json-payload .k { color: var(--ift-amber); }
.json-payload .s { color: var(--ift-blue-dark); }
.json-payload .p { color: var(--ift-cloud-muted); }

/* Buttons */
.btn {
  font-family: var(--font-sans); font-size: 13px; font-weight: 500;
  border-radius: 8px; padding: 9px 16px; cursor: pointer;
  border: 1px solid transparent; display: inline-flex; align-items: center; gap: 8px;
  transition: var(--transition-base); text-decoration: none;
}
.btn-primary { background: var(--color-primary); color: #fff; }
.btn-primary:hover { background: var(--color-primary-hover); text-decoration: none; }
.btn-outline { background: transparent; border-color: var(--color-border); color: var(--color-text); }
.btn-outline:hover { background: var(--color-surface-sunken); text-decoration: none; }
.btn-ghost { background: transparent; color: var(--color-text-muted); }
.btn-ghost:hover { background: var(--color-surface-sunken); text-decoration: none; }
.btn-amber { background: var(--color-accent); color: var(--ift-navy); }
.btn-amber:hover { background: var(--color-accent-hover); text-decoration: none; }
.btn-block { width: 100%; justify-content: center; }

/* Document filter bar — responsive grid so controls never wrap awkwardly. */
.doc-filter {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px; align-items: end; margin-bottom: 10px;
}
.doc-filter .field { margin-bottom: 0; }
.doc-filter-wide { grid-column: span 2; }
.doc-filter-actions { grid-column: 1 / -1; display: flex; justify-content: flex-end; gap: 6px; }

/* Document category "folders" (landing view) — same footprint as the doc cards:
   a big centred folder, label + count below. */
.folder-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.folder-card {
  display: block; background: var(--color-surface); border: 1px solid var(--color-border);
  border-radius: 12px; overflow: hidden; box-shadow: var(--shadow-xs);
  text-decoration: none; color: inherit; transition: var(--transition-base);
}
.folder-card:hover { border-color: var(--color-primary); }
.folder-thumb {
  height: 104px; background: var(--color-surface-sunken); color: var(--color-primary);
  display: flex; align-items: center; justify-content: center;
}
.folder-body { padding: 12px 14px; text-align: center; }
.folder-body .fk { font-size: 12.5px; font-weight: 500; line-height: 1.25; }
.folder-body .fc { font-family: var(--font-mono); font-size: 11px; color: var(--color-text-muted); margin-top: 4px; }

/* Status pills — German over English, centred. */
.pill {
  font-family: var(--font-mono); font-size: 9.5px; font-weight: 500; line-height: 1.15;
  border-radius: 12px; padding: 3px 9px; text-align: center;
  display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
}
.pill small { font-size: 0.82em; font-weight: 400; opacity: 0.7; letter-spacing: 0; }
.pill-green { background: rgba(30,158,90,0.14); color: var(--ift-success); }
.pill-blue  { background: rgba(11,114,255,0.12); color: var(--color-primary); }
.pill-amber { background: rgba(255,155,0,0.16); color: #B26B00; }
.pill-purple{ background: rgba(122,91,214,0.12); color: #7A5BD6; }
.pill-gray  { background: var(--color-surface-sunken); color: var(--color-text-muted); }

/* Forms */
.field { margin-bottom: 16px; }
.field label {
  display: block; font-size: 12px; font-weight: 500; color: var(--color-text-muted);
  margin-bottom: 6px;
}
/* One consistent control style for EVERY input/select/textarea so they always
   line up — same height, padding, radius and font, whether inside .field or in a
   tight grid row. Wrapped in :where() so it is a ZERO-specificity baseline that
   any component rule (.search, .period-chip, .field-sm, inline styles) overrides. */
:where(input[type="text"], input[type="search"], input[type="date"], input[type="number"],
input[type="email"], input[type="password"], input[type="tel"], input:not([type]),
select, textarea) {
  box-sizing: border-box; font-family: var(--font-sans); font-size: 14px;
  line-height: 1.35; padding: 10px 12px; min-height: 42px; border-radius: 8px;
  border: 1px solid var(--color-border); background: var(--color-surface);
  color: var(--color-text); outline: none; -webkit-appearance: none; appearance: none;
}
:where(textarea) { min-height: 66px; line-height: 1.45; }
/* Native chrome removed above → give selects a consistent chevron. */
:where(select) {
  cursor: pointer; padding-right: 34px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%237b8794' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
}
:where(input, select, textarea):focus {
  border-color: var(--color-primary); box-shadow: var(--focus-ring);
}
.field input, .field select, .field textarea { width: 100%; }
.field .help { font-size: 11px; color: var(--color-text-faint); margin-top: 5px; }
.field .err { font-size: 12px; color: var(--ift-danger); margin-top: 5px; }
.field input.mono, input.mono, .mono > input { font-family: var(--font-mono); letter-spacing: 0.15em; }
/* Compact variant for dense grid rows (e.g. allocation lines). */
.ctl-sm, .field-sm input, .field-sm select { font-size: 12.5px; padding: 7px 10px; min-height: 36px; }
.ctl-sm[type="text"], .field-sm input[type="text"] { min-height: 36px; }
/* Checkboxes/radios must not inherit the full-width text-input styling. */
input[type="checkbox"], input[type="radio"] {
  box-sizing: border-box; width: auto; min-height: 0; padding: 0; margin: 0;
  vertical-align: middle; accent-color: var(--color-primary); cursor: pointer;
  -webkit-appearance: auto; appearance: auto;
}

/* Messages */
.messages-host { display: contents; }
.messages { position: fixed; top: 16px; right: 16px; z-index: 50; display: flex; flex-direction: column; gap: 8px; }
.toast {
  background: var(--color-surface); border: 1px solid var(--color-border);
  border-left: 3px solid var(--color-primary); border-radius: 8px;
  padding: 11px 14px; box-shadow: var(--shadow-md); font-size: 13px; max-width: 360px;
  display: flex; align-items: flex-start; gap: 10px;
}
.toast.success { border-left-color: var(--ift-success); }
.toast.warning { border-left-color: var(--ift-amber); }
.toast.error { border-left-color: var(--ift-danger); }
.toast-msg { flex: 1 1 auto; min-width: 0; }
.toast-x {
  flex: 0 0 auto; background: none; border: 0; cursor: pointer; padding: 0 2px;
  font-size: 13px; line-height: 1.2; color: var(--color-text-faint);
}
.toast-x:hover { color: var(--color-text); }

/* Transactions · Matching */
.tx-layout { display: flex; flex-wrap: wrap; gap: 18px; }
.tx-list { flex: 2 1 400px; min-width: 0; }
.tx-detail { flex: 1 1 320px; min-width: 300px; position: sticky; top: 0; align-self: flex-start;
  max-height: calc(100vh - 96px); overflow-y: auto; }
.tx-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.tx-tab {
  font-size: 12px; padding: 6px 12px; border-radius: 8px; text-decoration: none;
  border: 1px solid var(--color-border); color: var(--color-text-muted); background: var(--color-surface);
}
.tx-tab.active { border-color: var(--color-primary); color: var(--color-primary); background: rgba(11,114,255,0.08); }
.tx-chip {
  font-family: var(--font-mono); font-size: 10px; padding: 4px 10px; border-radius: 20px;
  border: 1px solid var(--color-border); color: var(--color-text-muted); text-decoration: none;
}
.tx-chip.active { background: var(--color-primary); color: #fff; border-color: var(--color-primary); }
.tx-acct-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 4px; }
.tx-acct-head .iban { font-family: var(--font-mono); font-size: 10.5px; color: var(--color-text-faint); }
.tx-colhead, .tx-row {
  display: grid; grid-template-columns: 52px minmax(0,1fr) 116px; gap: 10px; align-items: start;
}
.tx-colhead { font-family: var(--font-mono); font-size: 9px; text-transform: uppercase; letter-spacing: 0.12em;
  color: var(--color-text-faint); padding: 8px 12px; border-bottom: 1px solid var(--color-hairline); }
.tx-colhead .r, .tx-row .r { text-align: right; }
.tx-row {
  padding: 11px 12px; border-bottom: 1px solid var(--color-hairline); cursor: pointer; text-decoration: none;
}
.tx-row:hover { background: var(--color-surface-sunken); }
.tx-row.sel { background: var(--color-surface-sunken); box-shadow: inset 3px 0 0 var(--color-primary); }
/* Progressive VAT selector pills (booking pane) */
.vat-pill { padding: 5px 11px; border-radius: 999px; font-size: 12px; cursor: pointer; line-height: 1.2;
  border: 1px solid var(--color-border); background: var(--color-surface); color: var(--color-text-muted); }
.vat-pill:hover { border-color: var(--color-primary); }
.vat-pill.active { border-color: var(--color-primary); background: rgba(11,114,255,0.10); color: var(--color-primary); font-weight: 600; }
.vat-lbl { font-size: 10px; color: var(--color-text-faint); align-self: center; min-width: 104px;
  text-transform: uppercase; letter-spacing: 0.05em; }
.tx-date { font-family: var(--font-mono); font-size: 11px; color: var(--color-text-muted); }
.tx-party { font-size: 12.5px; font-weight: 500; color: var(--color-text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tx-purpose { font-size: 11px; color: var(--color-text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tx-acctline { font-family: var(--font-mono); font-size: 10px; color: var(--color-primary); margin-top: 2px; }
.tx-acctline .vat { color: var(--ift-amber); }
.tx-right { text-align: right; }
.tx-amount { font-family: var(--font-mono); font-size: 12.5px; font-weight: 600; color: var(--color-text); white-space: nowrap; }
.tx-amount.pos { color: var(--ift-success); }
.soll-haben { display: grid; grid-template-columns: 40px 1fr 92px; gap: 6px; align-items: center; font-size: 12px; padding: 6px 0; }
.sh-letter { font-family: var(--font-mono); font-weight: 600; text-align: center; }
.sh-s { color: var(--color-primary); } .sh-h { color: var(--ift-amber); }
.sh-amt { font-family: var(--font-mono); text-align: right; }
.detail-doc {
  background: #fff; border: 1px solid var(--color-border); border-radius: 10px; padding: 16px;
  box-shadow: var(--shadow-md); color: #0A1628;
}
.detail-doc.empty { background: transparent; border: 1.5px dashed var(--color-border); box-shadow: none;
  text-align: center; color: var(--color-text-faint); font-size: 12px; padding: 28px 16px; }
.confidence-row { display: flex; align-items: center; gap: 10px; margin: 12px 0; }
.flightprogress { flex: 1; height: 6px; border-radius: 4px; background: var(--color-surface-sunken); overflow: hidden; }
.flightprogress > span { display: block; height: 100%; background: linear-gradient(90deg,#FF9B00,#0B72FF); }

/* Import wizard */
.stepper { display: flex; align-items: center; gap: 0; margin-bottom: 22px; }
.stepper .step { display: flex; align-items: center; gap: 8px; }
.stepper .num {
  width: 26px; height: 26px; border-radius: 50%; flex: none; display: flex;
  align-items: center; justify-content: center; font-family: var(--font-mono);
  font-size: 12px; border: 1.5px solid var(--color-border); color: var(--color-text-faint);
  background: var(--color-surface);
}
.stepper .step.active .num { border-color: var(--color-primary); color: var(--color-primary); background: rgba(11,114,255,0.08); }
.stepper .step.done .num { border-color: var(--ift-success); color: #fff; background: var(--ift-success); }
.stepper .lbl { font-size: 12.5px; color: var(--color-text-muted); }
.stepper .step.active .lbl { color: var(--color-text); font-weight: 500; }
.stepper .conn { flex: 1; height: 1.5px; background: var(--color-border); margin: 0 12px; min-width: 24px; }
.dropzone {
  border: 1.5px dashed var(--color-border); border-radius: 12px; padding: 44px 24px;
  text-align: center; color: var(--color-text-muted); cursor: pointer;
  transition: var(--transition-base); background: var(--color-surface-sunken);
}
.dropzone.drag { border-color: var(--color-primary); background: rgba(11,114,255,0.06); color: var(--color-primary); }
.dropzone .ico { color: var(--color-text-faint); margin-bottom: 10px; }
.preview-table { width: 100%; border-collapse: collapse; margin-top: 8px; }
.preview-table th { font-family: var(--font-mono); font-size: 9px; text-transform: uppercase; letter-spacing: 0.12em; color: var(--color-text-faint); text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--color-hairline); }
.preview-table td { font-size: 12px; padding: 7px 8px; border-bottom: 1px solid var(--color-hairline); }
.preview-table td.mono { font-family: var(--font-mono); }
.preview-table td.r { text-align: right; }
.stat-row { display: flex; gap: 24px; margin: 14px 0; }
.stat-row .st .l { font-size: 10px; color: var(--color-text-muted); }
.stat-row .st .v { font-family: var(--font-mono); font-size: 18px; font-weight: 600; color: var(--color-text); }

/* Document grid (Belege) */
.doc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
/* Landing view: center the recents + category cards instead of left-stretching.
   Flexbox (not grid auto-fill, which reserves full-width tracks) so the last
   partial row centers too. */
.doc-grid.is-centered, .folder-grid.is-centered {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 16px;
}
.doc-grid.is-centered > *, .folder-grid.is-centered > * { width: 220px; flex: 0 0 220px; }
.doc-card { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: 12px; overflow: hidden; box-shadow: var(--shadow-xs); }
.doc-thumb { height: 104px; background: var(--color-surface-sunken); display: flex; align-items: center; justify-content: center; color: var(--color-text-faint); position: relative; }
.doc-thumb .pill { position: absolute; top: 8px; right: 8px; }
.doc-body { padding: 12px 14px; }
.doc-body .fn { font-family: var(--font-mono); font-size: 11px; color: var(--color-text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.doc-body .meta { font-size: 11px; color: var(--color-text-muted); margin-top: 3px; }
.doc-body .row { display: flex; justify-content: space-between; margin-top: 8px; font-size: 11.5px; }
.doc-body .row .amt { font-family: var(--font-mono); font-weight: 600; }

/* Settings */
.set-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 820px) { .set-grid { grid-template-columns: 1fr; } }
.set-row { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--color-hairline); font-size: 12.5px; }
.set-row:last-child { border-bottom: 0; }
.set-row .k { color: var(--color-text-muted); }
.set-row .v { font-family: var(--font-mono); color: var(--color-text); text-align: right; }

/* ===== Payroll breakdown (per-run, explained) ===== */
.bd-row { display: flex; justify-content: space-between; gap: 14px; align-items: baseline;
  padding: 9px 0; border-bottom: 1px solid var(--color-hairline); font-size: 12.5px; }
.bd-row:last-child { border-bottom: 0; }
.bd-lbl { min-width: 0; }
.bd-en { color: var(--color-text-faint); font-size: 11px; }
.bd-expl { font-family: var(--font-mono); font-size: 10px; line-height: 1.45;
  color: var(--color-text-faint); margin-top: 4px; max-width: 42ch; }
.bd-row .v { font-family: var(--font-mono); color: var(--color-text); text-align: right; white-space: nowrap; }
.bd-sv { display: grid; grid-template-columns: 1fr 94px 94px 94px; gap: 10px; align-items: center; }
.bd-sv-head { font-family: var(--font-mono); font-size: 10px; letter-spacing: .04em;
  color: var(--color-text-faint); text-transform: uppercase; padding-bottom: 7px;
  border-bottom: 1px solid var(--color-hairline); }
.bd-sv-row { padding: 10px 0; border-bottom: 1px solid var(--color-hairline); }
.bd-sv-row .mono { font-size: 11.5px; }
.bd-sv-total { padding: 11px 0 2px; font-weight: 600; font-size: 12.5px; }
.bd-sv .r { text-align: right; }
.ps-row { display: grid; grid-template-columns: 1fr 96px 96px; gap: 10px; align-items: baseline;
  padding: 7px 0; font-size: 12.5px; }
.ps-row .k { color: var(--color-text-muted); min-width: 0; }
.ps-row .r { text-align: right; white-space: nowrap; }

/* DATEV code preview */
.code-block { background: var(--ift-navy); color: var(--ift-cloud-muted); border-radius: 10px; padding: 16px; overflow-x: auto; }
.code-block pre { margin: 0; font-family: var(--font-mono); font-size: 10.5px; line-height: 1.7; white-space: pre; color: var(--ift-blue-dark); }

/* Reports */
.report-layout { display: grid; grid-template-columns: 260px 1fr; gap: 18px; }
@media (max-width: 820px) { .report-layout { grid-template-columns: 1fr; } }
.report-list a { display: block; padding: 11px 13px; border-radius: 8px; text-decoration: none; color: var(--color-text); border: 1px solid var(--color-border); margin-bottom: 8px; background: var(--color-surface); }
.report-list a.active { border-color: var(--color-primary); box-shadow: inset 3px 0 0 var(--color-primary); }
.report-list a .t { font-size: 13px; font-weight: 500; }
.report-list a .s { font-size: 11px; color: var(--color-text-muted); }

/* Stub / empty */
.stub {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 12px; text-align: center; padding: 80px 24px; color: var(--color-text-muted);
}
.stub .ico { color: var(--color-text-faint); }
.stub h2 { font-size: 18px; color: var(--color-text); }

/* ===== Auth (centered, navy blueprint) ===== */
.auth-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  padding: 24px;
}
.auth-card {
  width: 100%; max-width: 408px;
  background: var(--color-surface); border: 1px solid var(--color-border);
  border-radius: 14px; box-shadow: var(--shadow-lg); padding: 32px;
}
.auth-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 6px; }
.auth-card h1 { font-size: 20px; font-weight: 600; margin-top: 18px; }
.auth-card .lead { font-size: 13px; color: var(--color-text-muted); margin-top: 4px; }
.auth-foot { font-size: 12px; color: var(--color-text-faint); margin-top: 18px; text-align: center; }
.recovery-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 18px 0;
}
.recovery-grid code {
  font-family: var(--font-mono); font-size: 14px; letter-spacing: 0.08em;
  background: var(--color-surface-sunken); border: 1px solid var(--color-border);
  border-radius: 6px; padding: 9px 12px; text-align: center; color: var(--color-text);
}
.qr-box {
  display: flex; justify-content: center; padding: 16px;
  background: #fff; border: 1px solid var(--color-border); border-radius: 10px; margin: 8px 0 4px;
}
.qr-box svg, .qr-box img { width: 188px; height: 188px; }
