/* Redesign 2026, Runde 21 (2.83.0) */

/* R21-02: Belegliste, Lieferant | Metaspalte | Fällig | Betrag | Status | Aktion. Der Rest der Breite verteilt sich auf Lieferant und Meta. */
.documents-grid .doc-table .dr-metahead { padding: 0; font-size: .8125rem; font-weight: 700; color: var(--text-muted, #565C67); display: flex; align-items: center; }
.documents-grid .doc-table .dr-meta { display: flex; flex-direction: column; gap: 2px; min-width: 0; font-size: .875rem; color: var(--text-muted, #565C67); }
.documents-grid .doc-table .dr-m1, .documents-grid .doc-table .dr-m2 { display: flex; justify-content: space-between; gap: 16px; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.documents-grid .doc-table .dr-m1 { color: var(--orlop-dark, #0E1115); }
.documents-grid .doc-table .dr-m2 { justify-content: flex-start; gap: 8px; }
.documents-grid .doc-table .dr-m2 .dr-meta-in { margin-left: auto; }
.documents-grid .doc-table .dr-sep { opacity: .6; }
.documents-grid .doc-table .dr-m1 .dr-sub-date { display: inline; margin-left: auto; }
.documents-grid .doc-table .dr-m2 .dr-meta-in { margin-left: auto; }
.documents-grid .doc-table .dr-miss { color: #8A1C1C; font-weight: 700; font-size: .8125rem; }
/* R53-01: Listen-Umbruch bei 1100 px */
@media (min-width: 1100px) {
  .documents-grid .doc-table .doc-thead,
  .documents-grid .doc-table .doc-row,
  .documents-grid .doc-table.has-co .doc-thead,
  .documents-grid .doc-table.has-co .doc-row { grid-template-columns: minmax(220px, 1fr) minmax(0, 1fr) 140px 140px 180px 96px; column-gap: 24px; }
  .documents-grid .doc-table .doc-row .dr-sub-flag { display: block !important; }
  .documents-grid .doc-table .doc-row:hover, .documents-grid .doc-table .doc-row:focus-within { background: #F5F6F8; }
  .documents-grid .doc-table .dr-main .dr-vendor { max-width: none; }
  .documents-grid .doc-table .dr-status { min-height: 1px; }
}
@media (max-width: 767px) {
  .doc-quick-chips { flex-wrap: nowrap; overflow-x: auto; margin: 0 -16px .5rem; padding: 0 16px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .doc-quick-chips::-webkit-scrollbar { display: none; }
  .doc-quick-chip { flex: 0 0 auto; min-height: 44px; }
}
/* R53-01: Listen-Umbruch bei 1100 px */
@media (max-width: 1099px) {
  .documents-grid .doc-table .doc-thead { display: none; }
  .documents-grid .doc-table .doc-row, .documents-grid .doc-table.has-co .doc-row {
    grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "main amount" "meta due" "status act" !important;
    min-height: 0; padding: 8px 16px 8px 28px; row-gap: 2px; position: relative; align-items: center;
  }
  .documents-grid .doc-table .doc-row:has(.dr-due.is-overdue) { grid-template-areas: "main amount" "meta due" "status act" !important; }
  .documents-grid .doc-table .doc-row .dr-main { grid-area: main; }
  .documents-grid .doc-table .doc-row .dr-meta { grid-area: meta; font-size: 13px; }
  .documents-grid .doc-table .doc-row .dr-m1 { overflow: hidden; }
  .documents-grid .doc-table .doc-row .dr-m1 .dr-sub-date, .documents-grid .doc-table .doc-row .dr-m2 { display: none; }
  .documents-grid .doc-table .doc-row .dr-amount { grid-area: amount; }
  .documents-grid .doc-table .doc-row .dr-due { grid-area: due; font-size: 13px; line-height: 1.3; color: var(--orlop-muted-text, #565C67); }
  .documents-grid .doc-table .doc-row .dr-due .dr-due-m, .documents-grid .doc-table .doc-row .dr-due .dr-due-d { font-size: 13px; }
  .documents-grid .doc-table .doc-row .dr-due.is-overdue { color: #8A1C1C; font-weight: 700; }
  .documents-grid .doc-table .doc-row .dr-vendor { -webkit-line-clamp: 2; line-clamp: 2; line-height: 1.25; }
  /* Statuspunkt statt Chip, Text bleibt für Screenreader */
  .documents-grid .doc-table .doc-row .dr-status { position: absolute; left: 10px; top: 16px; width: 8px; height: 8px; padding: 0; margin: 0; grid-area: auto; }
  .documents-grid .doc-table .doc-row .dr-status::before { content: ""; display: block; width: 8px; height: 8px; border-radius: 50%; background: #6B717C; }
  .documents-grid .doc-table .doc-row.is-mine .dr-status::before { background: var(--orlop-dark, #0E1115); }
  .documents-grid .doc-table .doc-row .dr-status > * { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; padding: 0; }
  /* Mit Auswahlkästchen (44 px) rückt der Statuspunkt rechts daneben (Zeilenrand in r24.css) */
  .documents-grid .doc-table.has-sel .doc-row .dr-status { left: 2.75rem; }
}
.doc-quick-chips { margin-bottom: 8px; }
.documents-grid .doc-quick-chips + .doc-table { margin-top: 0; }

/* R21-03: Dashboard-Kacheln gleich gebaut, Pfeilplatz immer reserviert */
.step-tile .stat-chevron[hidden] { display: inline-block !important; visibility: hidden; }
@media (max-width: 767px) {
  #tabDashboard #dashStrip.step-strip { grid-template-columns: 1fr !important; gap: 8px; }
  #tabDashboard #dashStrip .step-tile, #tabDashboard #dashStrip .step-tile.is-wide { grid-column: auto; min-height: 56px; height: auto; padding: 8px 16px; display: grid !important; grid-template-columns: minmax(0, 1fr) auto 16px; grid-template-rows: auto auto; grid-template-areas: "label value chev" "sub value chev"; align-items: center; column-gap: 12px; row-gap: 0; }
  #tabDashboard #dashStrip .step-tile .stat-label { grid-area: label; font-size: .875rem; }
  #tabDashboard #dashStrip .step-tile .stat-value { grid-area: value; font-size: 1.5rem; }
  #tabDashboard #dashStrip .step-tile .stat-sub { grid-area: sub; font-size: .8125rem; min-height: 0; white-space: normal; }
  #tabDashboard #dashStrip .step-tile .stat-chevron { display: inline-block !important; grid-area: chev; }
}
#dashUploadBtn[hidden] { display: none !important; }
/* Leerzustand zweispaltig */
.dash-first-card:not([hidden]) { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 2rem; align-items: center; }
.dash-first-card .dash-first-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.dash-first-card .dash-first-steps li { display: flex; gap: 12px; align-items: flex-start; padding: 12px; border: 1px solid var(--orlop-line, #D8DCE4); border-radius: 14px; background: #fff; }
.dash-first-card .dfs-icon { flex: 0 0 40px; height: 40px; border-radius: 50%; background: var(--orlop-dark, #0E1115); color: #fff; display: inline-flex; align-items: center; justify-content: center; }
.dash-first-card .dash-first-steps li > span:last-child { display: flex; flex-direction: column; }
.dash-first-card .dash-first-steps li > span:last-child > span { color: var(--text-muted, #565C67); font-size: .875rem; }
@media (max-width: 767px) { .dash-first-card:not([hidden]) { grid-template-columns: 1fr; gap: 1rem; } .dash-first-card .btn-primary { width: 100%; } }

/* R21-03: Zahlungen */
.pay-sepa-wrap { display: inline-flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.pay-sepa-wrap .btn-primary.is-locked { background: var(--orlop-accent, #B6BCCC); color: var(--orlop-dark, #0E1115); border-color: var(--orlop-accent, #B6BCCC); cursor: not-allowed; }
.pay-sepa-reason { font-size: .875rem; color: #3D424B; max-width: 22rem; text-align: right; }
.pay-empty { text-align: left; align-items: flex-start; max-width: none; width: 100%; box-sizing: border-box; }
.pay-empty .state-box-icon { margin-left: 0; }
@media (max-width: 767px) {
  .pay-head-actions { flex-wrap: wrap; width: 100%; }
  .pay-head-actions .btn-primary, .pay-sepa-wrap { width: 100%; }
  .pay-sepa-wrap { align-items: stretch; }
  .pay-sepa-wrap .btn-primary { width: 100%; }
  .pay-sepa-reason { text-align: left; max-width: none; }
}

/* R21-04: Abweisen-Schublade mit Schnellgründen */
.rj-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.rj-chip { min-height: 44px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--orlop-line, #D8DCE4); background: #fff; color: var(--orlop-dark, #0E1115); font: inherit; font-weight: 700; font-size: .875rem; cursor: pointer; }
.rj-chip[aria-checked="true"] { background: var(--orlop-dark, #0E1115); color: #fff; border-color: var(--orlop-dark, #0E1115); }
.rj-chip:focus-visible { outline: 2px solid var(--orlop-dark, #0E1115); outline-offset: 2px; }
.rj-more { margin-top: .75rem; }
.rj-more summary { min-height: 44px; display: flex; align-items: center; cursor: pointer; font-weight: 600; font-size: .875rem; }
[data-docact-drawer] [data-docact-submit][aria-disabled="true"] { background: var(--orlop-accent, #B6BCCC) !important; color: var(--orlop-dark, #0E1115) !important; border-color: var(--orlop-accent, #B6BCCC) !important; cursor: not-allowed; }

/* R21-04: Freigabedialog */
.ac-card { padding: 24px; }
.ac-card .ac-actions .btn-primary[aria-disabled="true"] { opacity: 1; background: var(--orlop-accent, #B6BCCC); color: var(--orlop-dark, #0E1115); border-color: var(--orlop-accent, #B6BCCC); cursor: not-allowed; }
.ac-card .ac-flag .ac-check-row { min-height: 44px; }
.ac-card .ac-note-li { list-style: none; margin: 0 0 0 1.75rem; padding: 0; }
.ac-card .ac-note-li .ac-note { text-align: left; font-size: .8125rem; color: #3D424B; flex: none; }
@keyframes acShake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
.ac-check-row.is-shake { animation: acShake .24s ease-in-out 1; }
@media (prefers-reduced-motion: reduce) { .ac-check-row.is-shake { animation: none; } }

/* R21-04: kurzer Toast, über Fußleiste und Bottom-Nav */
.toast-region { bottom: calc(var(--toast-offset, 8px) + env(safe-area-inset-bottom, 0px)); }
body:has(#docDetailActionBar) { --toast-offset: calc(var(--doc-bar-h, 72px) + 16px); }
@media (max-width: 639px) { .toast-region { bottom: calc(var(--toast-offset, 8px) + var(--mshell-h, 72px) + env(safe-area-inset-bottom, 0px) + 8px); } body:has(#docDetailActionBar) { --toast-offset: calc(var(--doc-bar-h, 72px) + 16px); } }
.toast .toast-action { min-height: 44px; min-width: 44px; }
.toast .toast-link { border-color: transparent; text-decoration: underline; }

/* R21-06: Neuigkeiten */
.news-index { max-height: none; overflow: visible; position: sticky; top: 1rem; }
.news-index-month { font-size: .75rem; font-weight: 700; text-transform: none; color: var(--text-muted, #565C67); padding-top: .5rem; }
.news-index-older { list-style: none; margin: 0; padding: 0; }
.news-index-olderwrap summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; font-weight: 600; font-size: .875rem; }
.news-entry { border-bottom: 1px solid var(--orlop-line, #D8DCE4); }
.news-more-items { min-height: 44px; background: none; border: 0; padding: 0; font: inherit; font-weight: 600; font-size: .875rem; text-decoration: underline; cursor: pointer; color: var(--orlop-dark, #0E1115); }
@media (min-width: 1280px) { .news-list-wrap, #newsList { column-gap: 3rem; } }

/* R21-06: Fußzeile */
.app-footer-links a, .app-footer a { min-height: 44px; min-width: 44px; display: inline-flex; align-items: center; text-decoration: underline; }
.app-footer-links { gap: 16px; }
.app-footer-links a + a::before { display: none; }
@media (max-width: 767px) { .app-footer { padding-bottom: calc(88px + env(safe-area-inset-bottom, 0px)); } }

/* R21-02: am Handy beginnt die Liste weiter oben: Hochladen als 44-px-Symbolknopf in der Titelzeile */
@media (max-width: 767px) {
  #docsHead { position: relative; margin-bottom: 8px !important; }
  #docsHead .docs-upload-btn { position: absolute; top: 0; right: 0; width: 44px; min-width: 44px; height: 44px; padding: 0; border-radius: 50%; font-size: 0; justify-content: center; align-items: center; display: inline-flex; }
  #docsHead .docs-upload-btn i { font-size: 1rem; margin: 0; }
  #docsHead .docs-head-hint { display: none; }
}
/* R53-01: Listen-Umbruch bei 1100 px */
@media (max-width: 1099px) {
  #docFilters { margin-bottom: 8px; }
  #docFilters .docfilters-card, #docFilters { padding-top: 0; padding-bottom: 0; }
  .documents-grid .doc-table { border-radius: 12px; }
}
.ac-card .ac-flag-sub { display: block; font-size: .8125rem; font-weight: 400; color: var(--text-muted, #565C67); }

/* R21 Nacharbeit (D-1063, D-1070): mobile Zeile <= 64 px, Name bis zwei Zeilen ohne Abschneiden bei üblichen Längen */
/* R53-01: Listen-Umbruch bei 1100 px */
@media (max-width: 1099px) {
  .documents-grid .doc-table .doc-row, .documents-grid .doc-table.has-co .doc-row { height: auto !important; min-height: 52px !important; max-height: 64px; padding-top: 4px !important; padding-bottom: 4px !important; row-gap: 1px; box-sizing: border-box; }
  .documents-grid .doc-table .doc-row .dr-main { margin: 0; padding: 0; }
  .documents-grid .doc-table .doc-row .dr-vendor { font-size: 15px; line-height: 1.15; display: -webkit-box; white-space: normal; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; word-break: break-word; }
  .documents-grid .doc-table .doc-row .dr-meta, .documents-grid .doc-table .doc-row .dr-due { line-height: 1.25; margin: 0; }
  .documents-grid .doc-table .doc-row .dr-amount { line-height: 1.15; font-size: 15px; }
}

/* R21 Nacharbeit (D-1072): Abstand der Links, Einträge nie in schmaler Spalte */
.news-entry-body .news-more-items { display: flex; align-items: center; margin: 8px 0 0; }
.news-entry-body .news-entry-link { display: inline-flex; margin-top: 16px; }
.news-entry-body .news-more-items + .news-entry-link { margin-top: 8px; }
.news-entry-body li { grid-template-columns: minmax(0, 1fr); row-gap: .25rem; }
.news-entry-body li .news-badge { justify-self: start; }
.news-entry-body li > span:not(.news-badge) { min-width: 0; overflow-wrap: break-word; word-break: normal; }

/* R21 Nacharbeit (D-1073): Lieferantenliste im Belegliste-Muster */
#vendorsList .badge, #vendorsTable .badge, #tabSettings .vendor-type-badge { text-transform: none; letter-spacing: 0; }
