/* Redesign Runde 52 (2.117.0). Copyright © Fabian Stamminger @ The Platform Group */

/* R52-01: Datumsfeld plus Uhrzeitfeld auf Touch-Geräten */
.tp-datetime-pair { display: flex; gap: 8px; align-items: stretch; }

/* R52-02: Dashboard am Handy, vier kompakte 2x2-Kacheln (höchstens 96 px), "Als Nächstes" im ersten Bild */
@media (max-width: 599px) {
  html body .dash-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-bottom: 12px; }
  html body #dashKpis .dash-kpi[data-kpi="review"] { display: flex; }
  html body .dash-kpi { padding: 8px 12px; gap: 0; max-height: 96px; box-sizing: border-box; overflow: hidden; }
  html body .dash-kpi-label { font-size: .8125rem; line-height: 1.2; }
  html body .dash-kpi-value { font-size: 1.5rem; line-height: 1.75rem; }
  html body .dash-kpi-sub { font-size: .75rem; min-height: 0; white-space: nowrap !important; overflow: hidden !important; text-overflow: ellipsis !important; }
}
html body .dash-clarify-head .dash-clarify-go { border: 0; background: transparent; min-height: 44px; padding: 0 4px; text-decoration: underline; }

/* R52-03: Belegdetail, Kopf zweizeilig: Zeile 1 Zurück, Titel einzeilig, Menü; Zeile 2 Status, Nummer, Zähler */
html body #documentDetailModal .dph-row1 .doc-detail-title,
html body #documentDetailModal .doc-page-head .doc-detail-title { display: block !important; white-space: nowrap !important; overflow: hidden !important; text-overflow: ellipsis !important; -webkit-line-clamp: unset !important; line-clamp: unset !important; overflow-wrap: normal !important; line-height: 1.3; }
html body #documentDetailModal .dph-row2 { align-items: center; flex-wrap: nowrap; gap: 4px 10px; min-height: 36px; }
html body #documentDetailModal .dph-row2 .doc-head-stage { flex: 0 1 auto; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
html body #documentDetailModal .dph-row2 .doc-head-nr { flex: none; color: #565C67; font-size: .875rem; white-space: nowrap; }
html body #documentDetailModal .dph-row2 .doc-detail-badges { display: none; }
html body #documentDetailModal .dph-row2 .doc-review-nav { margin-left: auto !important; flex: none; display: inline-flex; align-items: center; gap: 2px; position: static !important; padding: 0 !important; }
@media (max-width: 767px) {
  html body #documentDetailModal .doc-page-head { padding-right: 8px !important; }
  html body #documentDetailModal .dph-row1 { min-height: 44px; align-items: center; }
  html body #documentDetailModal .dph-row2 .doc-head-stage { display: none; }
  html body #documentDetailModal .dph-row2 .doc-head-nr { overflow: hidden; text-overflow: ellipsis; min-width: 0; }
  html body #documentDetailModal .dph-row2 .doc-review-nav .rv-keys-btn { display: none; }
  html body #documentDetailModal .dph-row2 .doc-review-nav { gap: 0; }
  html body #documentDetailModal .dph-row2 .doc-review-nav .doc-review-pos-long { display: none; }
  html body #documentDetailModal .dph-row2 .doc-review-nav .doc-review-pos-short { display: inline; }
  html body #documentDetailModal .dph-row2 .doc-review-nav .btn-icon-quick { width: 40px; height: 40px; min-width: 40px; }
}
/* Fußleiste: Grund 14 px, Kontrast mindestens 4,5:1 (#565C67 auf Weiß 7:1) */
html body #documentDetailModal .doc-detail-actionbar #docApproveNote.is-reason { font-size: .875rem; line-height: 1.35; color: #565C67; }
/* Rückgängig-Meldung über der Fußleiste, nie auf dem Knopf */
body:has(#docDetailActionBar) #toastRegion, body:has(#docDetailActionBar) .toast-region { top: auto !important; bottom: calc(var(--doc-bar-h, 72px) + 12px + env(safe-area-inset-bottom, 0px)) !important; z-index: 1400; }
@media (max-width: 767px) {
  body:has(#docDetailActionBar) #toastRegion, body:has(#docDetailActionBar) .toast-region { left: 8px !important; right: 8px !important; width: auto !important; max-width: none !important; transform: none !important; }
  body:has(#docDetailActionBar) #toastRegion .toast { width: 100%; max-width: none; box-sizing: border-box; }
}

/* R52-04: ruhige Listenzeilen, Aktion als Textlink mit Pfeil, Pille erst bei Hover und Fokus */
/* R53-01: Listen-Umbruch bei 1100 px */
@media (min-width: 1100px) {
  html body .documents-grid .doc-table .doc-row .dr-act,
  html body .documents-grid .doc-table .dr-act.dr-act-view,
  html body .documents-grid .doc-table .dr-act.dr-act-assign { background: transparent !important; border: 1px solid transparent !important; color: #0E1115 !important; min-width: 0; width: auto; padding: 0 12px !important; font-weight: 700; box-shadow: none; }
  html body .documents-grid .doc-table .doc-row .dr-act::after { content: "\203A"; margin-left: 8px; font-size: 1.25em; line-height: 1; }
  html body .documents-grid .doc-table .doc-row:hover .dr-act,
  html body .documents-grid .doc-table .doc-row:focus-within .dr-act,
  html body .documents-grid .doc-table .doc-row .dr-act:focus-visible { background: #0E1115 !important; color: #fff !important; border-color: #0E1115 !important; }
  html body .documents-grid .doc-table .doc-row .dr-actcol { justify-content: flex-end; }
}
/* Toolbar: Abstand Reiter zu Tabelle höchstens 24 px */
html body .documents-grid .list-seg-bar { margin-bottom: 0; }
html body .docfilters + .documents-grid { margin-top: 8px; }
html body .documents-grid .doc-table, html body .documents-grid #docsSegPanel { margin-top: 0; }
html body .documents-grid #docsSegPanel > .doc-table { margin-top: 4px; }
html body #docFilters { margin-bottom: 0; }
/* Fälligkeit zweizeilig: Text und Datum, Betrag rechtsbündig tabellarisch */
html body .documents-grid .doc-table .dr-due .dr-due-date { display: block; font-size: .75rem; color: #565C67; line-height: 1.2; }
html body .documents-grid .doc-table .dr-amount { font-variant-numeric: tabular-nums; text-align: right; }
/* Handy: Karte mindestens 64 px mit Pfeil */
/* R53-01: Listen-Umbruch bei 1100 px */
@media (max-width: 1099px) {
  html body .documents-grid .doc-table .doc-row.doc-card { min-height: 64px; position: relative; }
}

/* R52-07: Glossar als offene A-Z-Liste */
.help-glossary { margin: 0 0 1.5rem; }
.help-gloss-label { display: block; font-weight: 700; margin-bottom: .25rem; }
.help-gloss-search { width: 100%; max-width: 420px; min-height: 44px; box-sizing: border-box; padding: 0 12px; border: 1px solid #6B717C; border-radius: 12px; font: inherit; background: #fff; color: #0E1115; }
.help-gloss-count { margin: .5rem 0; color: #565C67; font-size: .875rem; }
.help-gloss-list { margin: 0; display: grid; gap: 0; border: 1px solid #D8DCE4; border-radius: 12px; background: #fff; overflow: hidden; }
.gloss-item { padding: 12px 16px; border-bottom: 1px solid #EEF0F4; }
.gloss-item:last-child { border-bottom: 0; }
.gloss-item[hidden] { display: none; }
.gloss-item dt { font-weight: 900; letter-spacing: -0.01em; }
.gloss-item dd { margin: 2px 0 0; color: #333840; }
.gloss-item.is-target { background: #F5F6F8; }
