/* Redesign 2026, Runde 20 (2.82.0) */

/* R20-01: Freigabedialog schmal, drei Zeilen, Hinweise als eigene Karte */
.ac-card { width: min(26rem, 100%); }
.ac-card .ac-sub { margin: -.35rem 0 .75rem; color: var(--text-muted, #565C67); font-size: .875rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ac-card .ac-row { grid-template-columns: 7rem minmax(0, 1fr); }
.ac-card .ac-name { display: block; font-weight: 700; }
.ac-card .ac-iban { display: block; white-space: nowrap; }
.ac-card .ac-src { display: block; font-size: .8125rem; font-weight: 400; color: var(--text-muted, #565C67); }
.ac-card .ac-hintcard { margin-top: .75rem; padding: 12px; background: #FFFBEB; border: 1px solid #FDE68A; border-radius: 12px; gap: .25rem; }
.ac-card .ac-hintcard .ac-flag { background: none; border: 0; padding: 0; border-radius: 0; display: flex; align-items: center; gap: .5rem; }
.ac-card .ac-flag .ac-check-row { display: flex; align-items: center; gap: .6rem; min-height: 48px; width: 100%; cursor: pointer; }
.ac-card .ac-flag .ac-tick { color: #166534; font-weight: 900; flex: 0 0 auto; }
.ac-card .ac-flag.is-acked { min-height: 40px; color: var(--orlop-dark, #0E1115); }
.ac-card .ac-doclink { font-size: .8125rem; margin-left: 1.75rem; }
.ac-card .ac-actions { flex-wrap: wrap; }
.ac-card .ac-note { flex: 1 0 100%; font-size: .8125rem; color: var(--text-muted, #565C67); text-align: right; }
.ac-card .ac-actions .btn-primary[aria-disabled="true"] { opacity: .4; cursor: not-allowed; }
.ds-iban, .ac-iban, .doc-iban { white-space: nowrap; }

/* R20-01: Fußleistenknopf nennt, was noch fehlt */
.doc-approve-btn.is-gate { background: #fff; color: var(--orlop-dark, #0E1115); border: 1.5px solid var(--orlop-dark, #0E1115); opacity: 1; cursor: pointer; }
.doc-approve-btn.is-gate:hover { background: #F5F6F8; }
#docDetailPanel, .doc-page-body { scroll-padding-bottom: calc(var(--doc-bar-h, 72px) + 24px); }
#docDetailPanel .doc-field, #docDetailPanel .ds-row, #docDetailPanel .ds-iban-form, #docDetailPanel .dp-card { scroll-margin-bottom: calc(var(--doc-bar-h, 72px) + 24px); }

/* R20-02: Belegliste als Zweizeiler. Kopf und Zeilen teilen ein Raster, die Lücke entsteht nicht mehr */
/* 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(0, 1fr) 140px 140px 200px 96px; column-gap: 24px; padding-left: 16px; padding-right: 8px; }
  .documents-grid .doc-table .doc-row { height: auto; min-height: 64px; max-height: none; padding-top: 12px; padding-bottom: 12px; position: relative; }
  .documents-grid .doc-table .doc-row .dr-sub { display: block !important; }
  .documents-grid .doc-table .doc-row .dr-inv, .documents-grid .doc-table .doc-row .dr-date { display: none !important; }
  .documents-grid .doc-table .dr-due { text-align: left; justify-self: start; }
  .documents-grid .doc-table .dr-amount { justify-self: end; text-align: right; padding-left: 0; }
  .documents-grid .doc-table .doc-thead .dr-amount .dr-sort { justify-content: flex-end; }
  .documents-grid .doc-table .dr-status { justify-self: start; padding-right: 0; }
  .documents-grid .doc-table .dr-actcol { justify-self: end; }
  .documents-grid .doc-table .dr-main .dr-vendor { display: block; max-width: 48ch; }
}
/* Ganze Zeile klickbar über den Lieferantenlink, die Zeile selbst ist kein Tab-Stopp */
.documents-grid .doc-row { position: relative; }
.documents-grid .doc-row .dr-vendor-link::after { content: ""; position: absolute; inset: 0; z-index: 1; }
.documents-grid .doc-row .dr-act { position: relative; z-index: 2; }
.documents-grid .doc-row:focus-within { outline: 2px solid var(--orlop-dark, #0E1115); outline-offset: -2px; }
.documents-grid .doc-row .dr-meta-co, .documents-grid .doc-row .dr-meta-kind { color: var(--text-muted, #565C67); }
.documents-grid .doc-row .dr-sub { color: var(--text-muted, #565C67); }
.documents-grid .doc-row .dr-sub .dr-sub-date { display: inline; }
.doc-quick-chips { display: flex; flex-wrap: wrap; gap: .5rem; margin: 0 0 .75rem; }
.doc-quick-chip { min-height: 44px; padding: 0 1rem; border-radius: 999px; border: 1px solid var(--orlop-line, #D8DCE4); background: #fff; color: var(--orlop-dark, #0E1115); font: inherit; font-weight: 700; cursor: pointer; display: inline-flex; align-items: center; gap: .5rem; }
.doc-quick-chip[aria-pressed="true"] { background: var(--orlop-dark, #0E1115); color: #fff; border-color: var(--orlop-dark, #0E1115); }
.doc-quick-n { font-variant-numeric: tabular-nums; opacity: .8; }
/* R53-01: Listen-Umbruch bei 1100 px */
@media (max-width: 1099px) {
  .documents-grid .doc-table .doc-row .dr-sub { display: none !important; }
  .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" "status due" !important; min-height: 0; padding: 12px 16px; row-gap: 6px; }
  .documents-grid .doc-table .doc-row:has(.dr-due.is-overdue) { grid-template-areas: "main amount" "status due" !important; }
  .documents-grid .doc-table .doc-row:has(.dr-due.is-overdue) .dr-due { justify-self: end; text-align: right; }
  .documents-grid .doc-table .doc-row .dr-status { padding-right: 0; width: fit-content; }
  .documents-grid .doc-row .dr-status .badge, .documents-grid .doc-row .dr-status .dr-progress { width: fit-content; max-width: 100%; }
  .documents-grid .doc-row .dr-co { display: none !important; }
}
/* R53-01: Listen-Umbruch bei 1100 px */
@media (max-width: 1099px) {
  .documents-grid .doc-table .doc-row .dr-vendor { -webkit-line-clamp: 1; line-clamp: 1; }
}

.preview-meta { margin: 1rem 0 0; display: grid; gap: .35rem; text-align: left; font-size: .875rem; width: 100%; }
.preview-meta > div { display: grid; grid-template-columns: 8rem minmax(0, 1fr); gap: .5rem; }
.preview-meta dt { color: var(--text-muted, #565C67); }
.preview-meta dd { margin: 0; overflow-wrap: anywhere; }
.preview-empty { width: 100%; max-width: 28rem; }
.doc-detail-preview #docPreviewToggle { display: none; }
.doc-page-body.is-no-preview #docPreviewToggle { display: none; }

/* R20-03: Belegseite mobil, Kopf eine Zeile, Fußleiste zwei Spalten 1:2 mit sichtbarem Abweisen */
@media (max-width: 767px) {
  #documentDetailModal .doc-detail-actionbar.has-decision .doc-bar-right { display: grid; grid-template-columns: 1fr 2fr; gap: 8px; align-items: center; width: 100%; }
  #documentDetailModal .doc-detail-actionbar .doc-reject-btn, #documentDetailModal .doc-detail-actionbar .beleg-reject { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; border: 1.5px solid var(--orlop-line, #D8DCE4); background: #fff; text-decoration: none; padding: 0 .5rem; }
  #documentDetailModal .doc-detail-actionbar .doc-approve-btn { min-height: 44px !important; height: 44px; width: 100%; }
  #documentDetailModal .doc-detail-actionbar .doc-approve-wrap { display: flex; flex-direction: column-reverse; align-items: stretch; }
  #documentDetailModal .doc-page-body { padding-bottom: 88px; }
  #documentDetailModal .doc-detail-more { width: 44px; height: 44px; min-width: 44px; padding: 0; justify-content: center; }
  #documentDetailModal .doc-detail-more { font-size: 0; }
  #documentDetailModal .doc-detail-more i { font-size: 1.125rem; margin: 0; }
  #documentDetailModal .doc-page-head { padding-right: 64px !important; }
  #documentDetailModal .doc-detail-actionbar .doc-bar-right { min-width: 0; box-sizing: border-box; }
  #documentDetailModal .doc-detail-actionbar .doc-approve-wrap { min-width: 0; }
  #documentDetailModal .doc-page-sub { flex-wrap: nowrap; }
  #documentDetailModal .doc-page-sub .doc-page-file { display: none; }
  #documentDetailModal .doc-page-sub #docHeadStatus { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
  #documentDetailModal .doc-detail-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}

/* R20-04: Dashboard */
.dash-waiting-more { display: flex; flex-wrap: wrap; gap: .25rem 1rem; align-items: center; margin: .5rem 0 0; font-size: .875rem; }
.dash-waiting-more .btn-textlink { min-height: 44px; display: inline-flex; align-items: center; }
.dash-sort-hint { color: var(--text-muted, #565C67); }

/* R20-06: Neuigkeiten, Akzent nur beim neuesten Eintrag, Versionsliste mit Datum und Uhrzeit */
.news-entry .news-entry-body::before { background: var(--orlop-line, #D8DCE4); }
.news-entry:first-of-type .news-entry-body::before { background: var(--orlop-dark, #0E1115); }
.news-entry .news-entry-meta h2.news-version-head { margin: 0; font-size: inherit; font-weight: inherit; display: inline; color: inherit; }
.news-entry .news-entry-body h3.news-entry-title { margin: 0 0 .5rem; font-size: 1.25rem; font-weight: 900; letter-spacing: -0.02em; }
.news-index li { display: flex; flex-direction: column; gap: 0; padding: .25rem 0; }
.news-index li > span:not(.news-current-pill) { color: var(--text-muted, #565C67); font-size: .8125rem; }
.news-index { max-height: calc(100dvh - 2rem); overflow-y: auto; }
.news-entry li[tabindex]:focus-visible { outline: 2px solid var(--orlop-dark, #0E1115); outline-offset: 4px; }
.ac-card .ac-head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-bottom: .75rem; }
.ac-card .ac-head h2 { margin: 0; }
.ac-card .ac-help { margin-left: 0; flex: 0 0 auto; }
