/* Runde 61 (2.126.0): Zahlungen als Übersicht, ein Assistent-Rahmen, Belegdetail, Belegliste mobil, Dashboard.
   Copyright © Fabian Stamminger @ The Platform Group */

/* R61-02: gesperrter Primärknopf überall gleich (dunkle Pille, Deckkraft .55) */
html body .btn-primary[aria-disabled="true"], html body .tp-btn-primary[aria-disabled="true"], html body .sw-main[aria-disabled="true"], html body .tw-next[aria-disabled="true"],
html body .sw-foot .btn-primary[aria-disabled="true"], html body .ow-foot .btn-primary[aria-disabled="true"] { background: #0E1115; border-color: #0E1115; color: #fff; opacity: .55; cursor: not-allowed; }
html body .tw-top .ws-x, html body .xw-top .ws-x { margin-left: auto; }
html body .tw-inline-err { margin: 6px 0 0; color: #B91C1C; font-size: .875rem; font-weight: 600; }

/* R61-01: Zahlungen als Übersicht */
html body .pay-overview { margin: 20px 0 0; background: #fff; border: 1px solid #D8DCE4; border-radius: 16px; box-shadow: 0 1px 3px rgba(14,17,21,.06); padding: 20px 24px; }
html body .po-top { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 8px 24px; }
html body .po-big { margin: 0; font-size: 2.5rem; font-weight: 900; letter-spacing: -.02em; line-height: 1.1; color: #0E1115; }
html body .po-lead { margin: 6px 0 0; color: #3D434E; font-size: .9375rem; }
html body .po-runs { color: #0E1115; font-weight: 700; text-decoration: underline; min-height: 44px; display: inline-flex; align-items: center; }
html body .po-tabs { display: flex; gap: 4px; margin: 16px 0 12px; border-bottom: 1px solid #D8DCE4; overflow-x: auto; }
html body .po-tab { appearance: none; background: none; border: 0; border-bottom: 3px solid transparent; padding: 0 14px; min-height: 44px; font: inherit; font-weight: 600; color: #3D434E; cursor: pointer; white-space: nowrap; }
html body .po-tab.is-active { color: #0E1115; border-bottom-color: #0E1115; font-weight: 800; }
html body .po-count { display: inline-block; min-width: 1.5em; padding: 1px 7px; border-radius: 999px; background: #EEF0F4; color: #0E1115; font-size: .8125rem; text-align: center; }
html body .po-table { width: 100%; }
html body .po-table td { padding: 12px 10px; }
html body .po-late { color: #B91C1C; font-weight: 700; }
html body .po-nodate { display: inline-block; padding: 2px 8px; border-radius: 999px; background: #FEF3C7; color: #78350F; font-size: .8125rem; font-weight: 600; }
html body .po-text { margin: 4px 0 12px; }
@media (max-width: 600px) {
  html body .pay-overview { padding: 16px; }
  html body .po-big { font-size: 2rem; }
}

/* R61-01: SEPA-Assistent, Auswahlzeilen 56 px */
html body .sw-table--pick td { height: 56px; }
html body .sw-sumbar { position: sticky; top: 0; z-index: 3; }

/* R61-05: Dashboard-Kacheln als Einstiege */
html body .dash-kpi { position: relative; }
html body .dash-kpi-value { font-size: 40px; line-height: 1.05; font-weight: 900; letter-spacing: -.02em; }
html body .dash-kpi-sub { white-space: pre-line; }
html body .dash-kpi-go { position: absolute; top: 16px; right: 16px; color: #6B717C; font-size: .875rem; }
html body .dash-kpi:hover .dash-kpi-go, html body .dash-kpi:focus-visible .dash-kpi-go { color: #0E1115; transform: translateX(2px); }
@media (prefers-reduced-motion: no-preference) { html body .dash-kpi-go { transition: transform .15s ease, color .15s ease; } }
html body .dash-next-item { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px 12px; }
html body .dash-next-item .dash-next-open { min-width: 0; }
html body .dash-next-item .dash-next-go { min-height: 44px; white-space: nowrap; }
html body .dash-waiting-card, html body #dashWaitingCard { height: auto; align-self: start; }

/* R61-03: Stepper einzeilig, nur der aktive Schritt mit Beschriftung; Handy als Punkte */
html body .todo-steps { display: flex; flex-wrap: nowrap; align-items: center; gap: 8px; margin: 0; padding: 0; list-style: none; }
html body .todo-step:not(.is-current) .todo-step-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
html body .todo-step.is-current .todo-step-now { display: none; }
html body .todo-progress { display: flex; align-items: center; justify-content: flex-start; }
html body .todo-step { flex-direction: row; align-items: center; gap: 6px; padding-top: 0; border-top: 0; }
html body .todo-step.is-current .todo-step-label { font-weight: 800; color: #0E1115; }
@media (max-width: 600px) { html body .todo-step.is-current .todo-step-label { font-size: .875rem; } }

/* R61-03: Summenprüfung */
html body .sc-card { padding: 16px 20px; margin: 16px 0; }
html body .sc-title { margin: 0 0 10px; font-size: 1rem; font-weight: 800; }
html body .sc-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 0; }
html body .sc-grid dt { font-size: .8125rem; color: #3D434E; }
html body .sc-grid dd { margin: 2px 0 0; font-weight: 700; font-variant-numeric: tabular-nums; }
html body .sc-miss { color: #565C67; font-weight: 500; }
html body .sc-verdict { margin: 12px 0 0; font-size: .9375rem; }
html body .sc-verdict.is-ok { color: #166534; }
html body .sc-verdict.is-warn { color: #78350F; background: #FEF3C7; padding: 8px 12px; border-radius: 8px; }
html body .sc-link { color: #0E1115; font-weight: 700; text-decoration: underline; }
@media (max-width: 600px) { html body .sc-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* R61-04: Belegliste ab 1600 px füllt die Breite (kein leerer Streifen rechts), Unternehmen mit Tooltip und Auslassung */
@media (min-width: 1600px) {
  html body .documents-grid .doc-table:not(.has-co) .doc-thead, html body .documents-grid .doc-table:not(.has-co) .doc-row { grid-template-columns: minmax(0, 1.6fr) minmax(220px, 1fr) 200px 140px 220px 96px !important; }
  html body .documents-grid .doc-table:not(.has-co).no-status .doc-thead, html body .documents-grid .doc-table:not(.has-co).no-status .doc-row { grid-template-columns: minmax(0, 1.6fr) minmax(220px, 1fr) 200px 140px 96px !important; }
  html body .documents-grid .doc-table.has-co .doc-thead, html body .documents-grid .doc-table.has-co .doc-row { grid-template-columns: minmax(0, 1.4fr) minmax(220px, 1fr) minmax(0, 1fr) 200px 140px 220px 96px !important; }
  html body .documents-grid .doc-table.has-co.no-status .doc-thead, html body .documents-grid .doc-table.has-co.no-status .doc-row { grid-template-columns: minmax(0, 1.4fr) minmax(220px, 1fr) minmax(0, 1fr) 200px 140px 96px !important; }
  html body .documents-grid .doc-table .dr-co { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
}

/* R61-04: Handy, Dreizeilenkarte (Lieferant + Betrag / Rechnungsnummer + Fälligkeit / Status + Unternehmen), Auswahlmodus */
@media (max-width: 767px) {
  html body .documents-grid .doc-table .doc-row.doc-card.doc-card { grid-template-columns: minmax(0, 1fr) auto !important; grid-auto-rows: auto; row-gap: 4px; min-height: 96px !important; padding: 12px 32px 12px 14px !important; }
  html body .documents-grid .doc-table .doc-row.doc-card.doc-card .dr-main { grid-column: 1; grid-row: 1; }
  html body .documents-grid .doc-table .doc-row.doc-card.doc-card .dr-amount { grid-column: 2; grid-row: 1; justify-self: end; font-weight: 800; }
  html body .documents-grid .doc-table .doc-row.doc-card.doc-card .dr-meta { grid-column: 1; grid-row: 2; overflow: visible; }
  html body .documents-grid .doc-table .doc-row.doc-card.doc-card .dr-meta .dr-m1 { white-space: normal !important; overflow: visible !important; text-overflow: clip !important; overflow-wrap: anywhere; }
  html body .documents-grid .doc-table .doc-row.doc-card.doc-card .dr-meta .dr-inv-no { white-space: nowrap; text-overflow: clip !important; overflow: visible !important; }
  html body .documents-grid .doc-table .doc-row.doc-card.doc-card .dr-m-date, html body .documents-grid .doc-table .doc-row.doc-card.doc-card .dr-m2 { display: none !important; }
  html body .documents-grid .doc-table .doc-row.doc-card.doc-card .dr-due { grid-column: 2; grid-row: 2; justify-self: end; white-space: nowrap; text-align: right; }
  html body .documents-grid .doc-table .doc-row.doc-card.doc-card .dr-status { grid-column: 1; grid-row: 3; justify-self: start; }
  html body .documents-grid .doc-table .doc-row.doc-card.doc-card .dr-co { grid-column: 2; grid-row: 3; justify-self: end; max-width: 55vw; text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  html body .documents-grid .doc-table .doc-row.doc-card.doc-card .dr-kind, html body .documents-grid .doc-table .doc-row.doc-card.doc-card .dr-actcol { display: none !important; }
  html body .documents-grid:not(.is-selecting) .doc-table .doc-row .dr-sel { display: none !important; }
  html body .documents-grid.is-selecting .doc-table .doc-row.doc-card.doc-card { padding-left: 56px !important; }
  html body .documents-grid.is-selecting .doc-table .doc-row .dr-sel { display: flex !important; width: 44px; height: 44px; min-width: 44px; min-height: 44px; }
  html body .documents-grid:not(.is-selecting) .doc-selall-m { display: none !important; }
  html body .doc-select-mode { display: flex; justify-content: flex-end; margin: 0 0 8px; }
  html body .doc-select-toggle { min-height: 44px; }
  html body .doc-selbar { bottom: calc(72px + env(safe-area-inset-bottom, 0px)); width: calc(100% - 24px); box-sizing: border-box; }
}
@media (min-width: 768px) { html body .doc-select-mode { display: none; } }

/* R61-04: inaktive Reiter und Zähler mit Kontrast mindestens 4.5:1 */
html body .list-seg-tab:not([aria-selected="true"]), html body .list-seg-tab:not([aria-selected="true"]) * { color: #3D434E; }
@media (max-width: 767px) { html body .list-seg-bar, html body .list-seg { overflow-x: auto; flex-wrap: nowrap; scrollbar-width: none; scroll-padding-inline: 24px; padding-right: 24px; } }

/* Runde 62 (Nacharbeit): gesperrter Primärknopf als Token (hohe Spezifität, schlägt ältere Regeln) */
html body .btn-primary[aria-disabled="true"]:not(#_a):not(#_b), html body .tp-btn-primary[aria-disabled="true"]:not(#_a):not(#_b), html body .sw-main[aria-disabled="true"]:not(#_a):not(#_b), html body .tw-next[aria-disabled="true"]:not(#_a):not(#_b),
html body .pay-flow-go[aria-disabled="true"]:not(#_a):not(#_b), html body .pay-head-sepa[aria-disabled="true"]:not(#_a):not(#_b), html body .sw-foot .btn-primary[aria-disabled="true"]:not(#_a):not(#_b),
html body .btn-primary[disabled]:not(#_a):not(#_b) { background: #0E1115 !important; border-color: #0E1115 !important; color: #fff !important; opacity: .55 !important; cursor: not-allowed !important; }

/* Runde 62: Belegliste Handy, Auswahlkästchen im Auswahlmodus sichtbar (schlägt die Ausblendung in r46), Rechnungsnummer bricht um statt zu überlappen */
@media (max-width: 767px) {
  html body .documents-grid.is-selecting .doc-table .doc-row.doc-card.doc-card .dr-sel { display: flex !important; position: absolute; left: 6px; top: 12px; transform: none; width: 44px; height: 44px; min-width: 44px; min-height: 44px; align-items: center; justify-content: center; }
  html body .documents-grid .doc-table .doc-row.doc-card.doc-card { position: relative; }
  html body .documents-grid .doc-table .doc-row.doc-card.doc-card .dr-meta { min-width: 0; }
  html body .documents-grid .doc-table .doc-row.doc-card.doc-card .dr-meta .dr-inv-no { white-space: normal !important; overflow-wrap: anywhere; word-break: break-word; }
  html body .documents-grid .doc-table .doc-row.doc-card.doc-card .dr-due { max-width: 45vw; white-space: normal; }
}

html body .todo-item[data-todo="recipient"] { grid-template-columns: minmax(0,1fr); }
html body .todo-item[data-todo="recipient"] .todo-answers { display: flex; flex-wrap: wrap; gap: 8px; }
@media (max-width: 600px) { html body .todo-item[data-todo="recipient"] .todo-text { margin: 2px 0 8px; } }
