/* U7 (impl-plan §11 D1a–D1d): object pages, reports, bank split view, settings and wizards. Tokens only. */

/* Object head: key figure, split button, «…» (D1a) */
.object-figure { display: inline-grid; justify-items: end; margin-right: 8px; line-height: 1.15; }
.object-figure > span { color: var(--text-muted); font-size: var(--text-xs); line-height: var(--lh-xs); }
.object-figure > strong { font-size: var(--text-lg); line-height: var(--lh-lg); font-weight: var(--weight-semibold); font-variant-numeric: tabular-nums lining-nums; white-space: nowrap; }
.split-button { display: inline-flex; }
.split-button > .btn { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.split-button > .split-menu > .split-caret { min-width: 0; padding-inline: 7px; margin-left: -1px; border-top-left-radius: 0; border-bottom-left-radius: 0; }
.head-actions > .split-button > .btn, .head-actions > .split-button > .menu > .btn { box-shadow: var(--shadow-1); }
.object-menu-button { min-width: 0; padding-inline: 8px; }
.split-menu > .menu-list, .object-menu > .menu-list { min-width: 220px; }
.menu-item.is-danger, .menu-item.is-danger > svg { color: var(--error-fg); }
.page-head p .status-badge { vertical-align: 1px; }
.page-head p .status-badge:not(:first-child) { margin-left: 6px; }
.page-head p .status-badge:first-child { margin-right: 6px; }

/* Object page body: facts, the line table on the full width, related sections below (D1a) */
.object-page { display: grid; gap: var(--section-gap); min-width: 0; }
.object-facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 12px 24px; }
.object-facts > .meta-row { display: grid; align-content: start; gap: 2px; padding: 0; border: 0; min-width: 0; }
.object-facts > .meta-row > :first-child { color: var(--text-muted); font-size: var(--text-xs); line-height: var(--lh-xs); }
.object-facts > .meta-row > :last-child { text-align: left; overflow-wrap: anywhere; }
.object-facts > .object-note { grid-column: span 2; }
.object-facts .payment-reference { display: inline-flex; align-items: center; gap: 4px; }
.object-lines { min-width: 0; overflow: hidden; }
.object-lines > .table-wrap { max-height: none; overflow-x: visible; }
.object-lines .note-box { margin: 0 16px 16px; }
.object-related { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px 32px; align-items: start; }
.object-related > :is(.object-section, .card) { min-width: 0; margin: 0; padding: 12px 0 0; border: 0; border-top: 1px solid var(--border-hairline); border-radius: 0; background: transparent; box-shadow: none; }
.object-related .section-title { margin: 0 0 8px; }
.object-related .attachment-list { margin-bottom: 8px; }

/* Line tables: no sideways scroll at 1280–1920 (audit 7a), no mid-word breaks (audit 6) */
.object-lines .document-lines-table { table-layout: fixed; width: 100%; min-width: 0; }
.object-lines .document-lines-table th { position: static; white-space: normal; overflow-wrap: anywhere; hyphens: auto; }
.object-lines .document-lines-table td { overflow-wrap: normal; hyphens: manual; }
.object-lines .document-lines-table td.line-description { overflow-wrap: anywhere; }
.object-lines .document-lines-table :is(th, td).line-description { width: auto; }
.object-lines .document-lines-table .line-account { width: 68px; }
.object-lines .document-lines-table .line-vat { width: 112px; }
.object-lines .document-lines-table .line-input-vat { width: 164px; }
.object-lines .document-lines-table .line-quantity { width: 96px; }
.object-lines .document-lines-table .line-unit { width: 96px; }
.object-lines .document-lines-table .line-unit-price { width: 112px; }
.object-lines .document-lines-table .line-discount { width: 112px; }
.object-lines .document-lines-table .line-net { width: 112px; }
.object-lines .document-lines-table .line-tax { width: 92px; }
.object-lines .purchase-lines-table .line-quantity { width: 72px; }
.object-lines .document-lines-table td.is-zero { color: var(--text-muted); }
.object-lines .document-lines-table td.line-input-vat small { display: inline; }

/* Contact workspace (D1a): facts instead of KPI tiles, the range as a toolbar */
dl.facts { display: grid; margin: 0; }
dl.facts > div { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding: 6px 0; border-top: 1px solid var(--border-hairline); }
dl.facts > div:first-child { border-top: 0; }
dl.facts dt { color: var(--text-muted); font-size: var(--text-sm); line-height: var(--lh-sm); }
dl.facts dd { margin: 0; font-variant-numeric: tabular-nums lining-nums; white-space: nowrap; text-align: right; }
dl.facts dd.is-finding { color: var(--error-fg); font-weight: var(--weight-semibold); }
.contact-range.toolbar { display: flex; flex-wrap: wrap; align-items: end; gap: 8px 12px; margin: 0; padding: 0; border: 0; background: transparent; box-shadow: none; }
.contact-range.toolbar > small { flex: 1 1 280px; color: var(--text-muted); }
.contact-view-tools { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.contact-view-tools > .contact-tabs { flex: 1; min-width: 0; margin-bottom: 0; }
.contact-view-tools > .btn { flex: none; }
.contact-applied-range { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 16px; }
.contact-applied-range > a { white-space: nowrap; }
.contact-tabs a[data-mahnwesen-link] { gap: 6px; }
.contact-tabs a[data-mahnwesen-link] > svg { color: var(--text-muted); }

/* Reports (D1b): h1 names the report, one toolbar, Staffel statements, D-03 colours, one Hauptbuch table */
.report-head { margin-bottom: 12px; }
.report-head > div:first-child { display: flex; align-items: baseline; flex-wrap: wrap; gap: 2px 12px; }
.report-head > div:first-child > p { margin: 0; }
.report-toolbar { display: grid; gap: 8px; align-items: stretch; padding-bottom: 8px; border-bottom: 0; }
.report-controls { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; }
.report-controls > .report-range { flex-wrap: wrap; gap: 8px 12px; padding: 0; }
.report-tabs-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 8px 16px; border-bottom: 1px solid var(--line-strong); }
.report-tabs-row > .report-nav { margin: 0 0 -1px; border-bottom: 0; }
.report-tabs-row > .report-tools { margin: 0 0 4px; font-size: var(--text-sm); line-height: var(--lh-sm); }
.report-stepper { display: inline-flex; align-items: center; gap: 2px; }
.report-period-label { min-width: 112px; text-align: center; font-weight: var(--weight-medium); white-space: nowrap; }
.report-chip { max-width: none; cursor: pointer; }
.report-chip > input { margin: 0 2px 0 0; accent-color: var(--accent); }
.filter-chip-group.is-active > .filter-chip.report-chip { border-radius: var(--radius-sm); }
.report-export > .split-menu > .menu-list { width: 320px; }
.report-running { margin-left: 6px; vertical-align: 1px; }
.report-total-date { margin-left: 8px; color: var(--text-muted); font-size: var(--text-xs); line-height: var(--lh-xs); font-weight: var(--weight-regular); }
.statement-staffel { display: grid; gap: 24px; max-width: 880px; }
.report-sheet:has(.statement-staffel) { max-width: 928px; }
.statement-staffel > .totals { width: min(380px, 100%); margin-left: auto; padding: 0 10px 0 0; }
.report-sheet :is(.statement-table, .trial-table) td.num.is-negative:not(.is-abnormal) { color: inherit; }
.report-sheet td.num.is-abnormal { color: var(--amount-negative); }
.trial-table td.trial-balance { white-space: nowrap; }
/* Saldenbilanz: one line per account (§2.3), the name as title */
.report-sheet table.trial-table { table-layout: fixed; }
.report-sheet table.trial-table th.num { width: 168px; }
.report-sheet table.trial-table td:nth-child(2) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trial-table td.trial-balance.is-zero { color: var(--text-muted); }
.balance-side { display: inline-block; width: 1.5em; margin-left: 4px; color: var(--text-muted); font-size: var(--text-xs); text-align: left; text-decoration: none; }
.report-sheet td.report-code > .row-link, .ledger-account-head .row-link { color: inherit; }
.ledger-table { table-layout: fixed; }
.ledger-table thead th:nth-child(1) { width: 104px; }
.ledger-table thead th:nth-child(2) { width: 80px; }
.ledger-table thead th:nth-child(3) { width: 132px; }
.ledger-table thead th:nth-child(5) { width: 150px; }
.ledger-table thead th:nth-child(6), .ledger-table thead th:nth-child(7) { width: 136px; }
.ledger-table td { overflow-wrap: anywhere; }
.ledger-table .ledger-account-head th { padding-top: 14px; border-bottom: 1px solid var(--ink-2); background: transparent; color: var(--text-primary); font-weight: var(--weight-semibold); text-align: left; }
.ledger-table .ledger-account-head .subtle { margin-left: 8px; font-weight: var(--weight-regular); }
.ledger-account-bar { display: flex; align-items: center; gap: 4px 12px; margin: 4px 0 8px; }
.ledger-account-bar h2 { margin: 0; font-size: var(--text-lg); line-height: var(--lh-lg); }
.ledger-step { display: inline-flex; gap: 2px; margin-left: auto; }
html[data-density="compact"] .report-sheet .report-table:not(.statement-table) :is(td, tbody th) { padding-top: 4px; padding-bottom: 4px; }
#report-form .field.has-date-field { grid-template-columns: auto auto auto; align-items: center; column-gap: 6px; }
#report-form .field.has-date-field > label { grid-column: 1; }
#report-form .field.has-date-field > .date-input { grid-column: 2; }
#report-form .field.has-date-field > .date-field-button { grid-column: 3; }
html[data-density="compact"] .page:has(> #report-panel) { padding-top: 12px; }
html[data-density="compact"] .report-head { margin-bottom: 8px; }
html[data-density="compact"] .report-toolbar { margin-bottom: 8px; gap: 6px; padding-bottom: 4px; }
html[data-density="compact"] .report-sheet { padding-top: 8px; }
@media print { .report-title.only-print { display: flex; } }

/* Bank split view (D1c): queue and non-modal pane; main.has-bank-pane (no :has(), §3.2); list ≥ 720 px, pane 360–420 px */
.page.has-bank-pane { display: grid; grid-template-columns: minmax(0, 1fr) clamp(360px, calc(100% - 732px), 420px); column-gap: 12px; align-items: start; }
.page.has-bank-pane > :not(.list-sheet, .bank-pane) { grid-column: 1 / -1; }
.page.has-bank-pane > .list-sheet { grid-column: 1; min-width: 0; }
.page.page-fill.has-bank-pane { grid-template-rows: auto auto minmax(0, 1fr); align-items: stretch; }
.bank-pane { grid-column: 2; display: grid; align-content: start; gap: 10px; min-width: 0; min-height: 0; margin-top: 16px; padding: 14px 16px 16px; overflow: auto; border: 1px solid var(--border-hairline); border-radius: var(--radius); background: var(--bg-surface); box-shadow: inset 3px 0 var(--accent); }
.bank-pane:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: -2px; }
.bank-pane-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.bank-pane h2 { margin: 0; font-size: var(--text-lg); line-height: var(--lh-lg); overflow-wrap: anywhere; }
.bank-pane h3 { margin: 0 0 6px; font-size: var(--text-sm); line-height: var(--lh-sm); }
.bank-pane-amount { font-size: var(--text-xl); line-height: var(--lh-xl); font-weight: var(--weight-semibold); font-variant-numeric: tabular-nums lining-nums; }
.bank-pane-amount.is-negative { color: var(--text-primary); }
.bank-pane-proposal { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; }
.bank-pane-proposal:empty { display: none; }
.bank-pane-proposal > small { flex-basis: 100%; color: var(--text-muted); }
.bank-pane-section { display: grid; gap: 8px; padding-top: 10px; border-top: 1px solid var(--border-hairline); }
.bank-pane-section > .notice, .bank-pane > .notice { margin: 0; }
.bank-pane-section > .btn { justify-self: start; }
.bank-pane .form-actions { position: static; margin: 0; padding: 0; background: none; justify-content: flex-start; }
.bank-candidates { table-layout: auto; width: 100%; }
.bank-candidates .col-select { width: 28px; padding-right: 0; }
.bank-candidates th { white-space: normal; }
.bank-candidates td { vertical-align: top; white-space: nowrap; }
.bank-candidate label { display: grid; min-width: 0; }
.bank-candidate label > strong { font-weight: var(--weight-medium); }
.bank-candidate label > small { max-width: 168px; overflow: hidden; text-overflow: ellipsis; color: var(--text-muted); }
.bank-candidate .bank-key { justify-self: start; }
.page.has-bank-pane .bank-table { min-width: 0; }
.page.has-bank-pane .bank-table th.col-ref { width: 18%; }
@media (max-width: 1439px) { .page.has-bank-pane .bank-table th.col-ref { width: 14%; } }
/* One toolbar line next to the pane where the list allows (U1 office-width pattern) */
.page.has-bank-pane .data-grid-toolbar .grid-search.input { flex-basis: 160px; width: 160px; }
.page.has-bank-pane .grid-view-menu > .menu-button > span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.page.has-bank-pane .grid-view-menu > .menu-button { width: var(--control-sm); padding: 0; }
@media (max-width: 1439px) { .bank-candidate label > small { max-width: 104px; } .bank-candidates :is(th, td) { padding-inline: 6px; } }
.bank-candidates tr.is-proposed td { background: var(--bg-selected); }
.bank-candidates tr:has(input:checked) td { background: var(--bg-selected); box-shadow: inset 0 -1px 0 var(--border-hairline); }
.bank-candidates tr:has(input:checked) td:first-child { box-shadow: inset 3px 0 var(--accent); }
.bank-candidates label { cursor: pointer; }
.bank-key { display: none; margin-left: 6px; }
@media (min-width: 1600px) { .bank-key { display: inline-block; } }
/* Presentation polish (27.09.2026, I-15): the key hint stays on the line of its document number (the contact below
   spans both columns), and from 1800 px the pane takes 460 px so contact names are cut less often. */
.bank-candidate label { grid-template-columns: auto minmax(0, 1fr); column-gap: 6px; align-items: baseline; }
.bank-candidate label > small { grid-column: 1 / -1; }
.bank-candidate .bank-key { margin-left: 0; }
/* I-04: the description is the line's link to the pane; it reads as text (not petrol), the whole line opens it. */
.bank-table .bank-row-link { color: inherit; font-weight: inherit; }
.bank-table tbody tr[data-bank-row] > td:not(.grid-select-cell, .row-actions) { cursor: pointer; }
@media (min-width: 1800px) { .page.has-bank-pane { grid-template-columns: minmax(0, 1fr) 460px; } .bank-candidate label > small { max-width: 232px; } }
@media (max-width: 1100px) {
  .page.has-bank-pane { display: block; }
  .bank-pane { margin-top: 16px; }
}

/* Bankabgleich (D1c): one comparison table instead of three cards */
.reconciliation-comparison-table { margin-top: 16px; overflow: hidden; }
.reconciliation-table th[scope="row"] { font-weight: var(--weight-medium); text-align: left; }
.reconciliation-table td.is-movement.is-negative { color: inherit; }
.reconciliation-bank-note { margin: 0; padding: 8px 12px; }
.reconciliation-chevron { display: inline-flex; color: var(--text-muted); }
.reconciliation-evidence[open] .reconciliation-chevron { transform: rotate(180deg); }

/* Settings (D1d): 200 px section navigation (sticky, follows the scroll) and up to 880 px of content */
.settings-page { display: grid; grid-template-columns: 200px minmax(0, 880px); gap: 32px; align-items: start; }
.settings-nav { position: sticky; top: calc(var(--topbar-height) + 16px); }
.settings-nav ul { display: grid; gap: 2px; margin: 0; padding: 0; list-style: none; }
.settings-nav-item { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; min-height: var(--control); padding: 4px 10px; border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--text-secondary); font: inherit; font-size: var(--text-sm); line-height: var(--lh-sm); text-align: left; cursor: pointer; }
.settings-nav-item:hover { background: var(--bg-hover); color: var(--text-primary); }
.settings-nav-item[aria-current="true"] { background: var(--bg-selected); color: var(--text-primary); font-weight: var(--weight-medium); box-shadow: inset 2px 0 var(--accent); }
.settings-dirty:not([hidden]) { display: inline-block; flex: 0 0 8px; width: 8px; height: 8px; border-radius: var(--radius-full); background: var(--warning-bar); }
.settings-dirty-word:not([hidden]) { display: inline-block; margin-left: 8px; padding: 0 6px; border-radius: var(--radius-xs); background: var(--warning-bg); color: var(--warning-fg); font-size: var(--text-xs); line-height: var(--lh-xs); font-weight: var(--weight-medium); vertical-align: 2px; }
.settings-content { display: grid; gap: var(--section-gap); min-width: 0; }
.settings-content > :is(.card, .settings-links) { margin: 0; }
.settings-section { scroll-margin-top: calc(var(--topbar-height) + 16px); }
.settings-section > h2:focus { outline: none; }
.settings-links { display: grid; gap: 12px; }
.settings-links > .section-title { margin: 0; }
.settings-links > .card { margin: 0; }
.settings-links > .card:not([hidden]) { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 4px 16px; }
.settings-links > .card > .section-title, .settings-links > .card > .subtle { grid-column: 1; margin: 0; }
.settings-links > .card > .btn { grid-column: 2; grid-row: 1 / span 2; }
.settings-links > .zefix-settings:not([hidden]) { display: block; }
.settings-scope > summary { display: flex; align-items: center; cursor: pointer; }
.settings-scope > summary > .section-title { margin: 0; }
.settings-scope[open] > summary { margin-bottom: 8px; }

/* Wizards (D1d): a vertical stepper beside the page content */
.wizard-page { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 24px; align-items: start; }
.wizard-body { min-width: 0; }
.wizard-body > :first-child { margin-top: 0; }
.wizard-steps { position: sticky; top: calc(var(--topbar-height) + 16px); display: grid; gap: 0; margin: 0; padding: 0; list-style: none; }
.wizard-step { position: relative; display: grid; grid-template-columns: 24px minmax(0, 1fr); column-gap: 8px; padding: 0 0 16px; }
.wizard-step:not(:last-child)::after { content: ""; position: absolute; left: 11px; top: 24px; bottom: 2px; width: 1px; background: var(--border-default); }
.wizard-mark { grid-row: 1 / span 2; display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: var(--radius-full); border: 1px solid var(--border-control); background: var(--bg-surface); color: var(--text-muted); }
.wizard-label { font-size: var(--text-sm); line-height: var(--lh-sm); font-weight: var(--weight-medium); color: var(--text-primary); }
.wizard-state { font-size: var(--text-xs); line-height: var(--lh-xs); color: var(--text-muted); }
.wizard-step.is-done .wizard-mark { border-color: var(--accent); background: var(--accent); color: var(--text-on-solid); }
.wizard-step.is-current .wizard-mark { border-color: var(--accent); color: var(--accent-text); box-shadow: 0 0 0 2px var(--bg-selected); }
.wizard-step.is-current .wizard-state { color: var(--accent-text); font-weight: var(--weight-medium); }
.wizard-step.is-blocked .wizard-mark { border-color: var(--warning-line); background: var(--warning-bg); color: var(--warning-fg); }
.wizard-step.is-blocked .wizard-state { color: var(--warning-fg); font-weight: var(--weight-medium); }
@media (max-width: 1439px) {
  .wizard-page { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .wizard-steps { position: static; display: flex; flex-wrap: wrap; gap: 8px 24px; }
  .wizard-step { padding: 0; }
  .wizard-step:not(:last-child)::after { display: none; }
}
@media (max-width: 1100px) {
  .settings-page { grid-template-columns: minmax(0, 1fr); }
  .settings-nav { position: static; }
}
@media print { .settings-page, .wizard-page { display: block; } }

/* Native disclosure markers on the D1 pages: a chevron icon instead of the ▶ glyph */
:is(.object-page, .settings-page, .report-sheet, .reconciliation-summary, .wizard-page) details:not(.menu) > summary { list-style: none; }
:is(.object-page, .settings-page, .report-sheet, .reconciliation-summary, .wizard-page) details:not(.menu) > summary::-webkit-details-marker { display: none; }
:is(.object-page, .settings-page, .report-sheet, .reconciliation-summary, .wizard-page) details:not(.menu) > summary::before { content: ""; display: inline-block; width: 12px; height: 12px; margin-right: 6px; background: var(--icon-chevron) center / 12px no-repeat; transform: rotate(-90deg); vertical-align: -1px; }
:is(.object-page, .settings-page, .report-sheet, .reconciliation-summary, .wizard-page) details[open]:not(.menu) > summary::before { transform: none; }

@media (prefers-reduced-motion: no-preference) {
  :is(.object-page, .settings-page, .report-sheet, .reconciliation-summary, .wizard-page) details:not(.menu) > summary::before { transition: transform var(--motion); }
}
@media print {
  .object-figure, .split-button > .split-menu, .object-menu { display: none !important; }
  .object-related { grid-template-columns: 1fr; }
}

/* BA «Bankautomatik»: confidence dots (Sicher, Prüfen, Unsicher; always with a word or a label), the
   ranking block in the bank pane and the bulk confirmation list. Tokens only. */
.bank-dot { display: inline-block; flex: none; width: 9px; height: 9px; margin-right: 6px; border-radius: 50%; vertical-align: 1px; background: var(--error-bar); box-shadow: 0 0 0 1px var(--bg-surface); }
.bank-dot-green { background: var(--success-bar); }
.bank-dot-yellow { background: var(--warning-bar); }
.bank-ranking:empty { display: none; }
.bank-ranking { display: grid; gap: 4px; }
.bank-ranking-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; }
.bank-ranking-reasons, .bank-ranking-party { color: var(--text-muted); overflow-wrap: anywhere; }
.bank-ranking-suggestion { display: grid; gap: 4px; margin-top: 6px; padding: 8px 10px; border: 1px solid var(--border-hairline); border-radius: var(--radius); }
.bank-ranking-suggestion > small { color: var(--text-muted); }
.bank-ranking-suggestion > .btn { justify-self: start; }
.bank-ranking-suggestion > .notice { margin: 0; }
.bank-candidate label .bank-dot { margin-right: 4px; }
.modal:has(> .modal-body > .bank-auto) { width: min(880px, calc(100% - 32px)); }
.bank-auto-list { max-height: min(52vh, 480px); overflow: auto; }
.bank-auto-list td[translate="no"] { white-space: nowrap; }
.bank-auto-summary { margin: 8px 0; }
@media print { .bank-ranking-suggestion .btn { display: none; } }
