/* Runde 39 (2.104.0): stabile Warnkarte, Block "Was ist zu tun", Fußleiste, Original-Karte, Liste, Zuordnen. Copyright © Fabian Stamminger @ The Platform Group */

/* ---- R39-01: Warnkarte "Bitte prüfen": Raster statt Flex, Text oben, Haken darunter, Knopf zuletzt ---- */
.doc-check-card { overflow: hidden; min-width: 0; position: static; height: auto; align-self: start; }
.doc-check-card { border: 1px solid #D8DCE4; border-left: 4px solid #92400E; border-radius: 10px; background: #FFFBEB; padding: 12px 14px; margin-bottom: 12px; }
.doc-check-card h3 { margin: 0 0 .25rem; font-size: 1rem; }
.doc-check-card .btn-secondary { margin-top: .5rem; min-height: 44px; }
section.doc-check-card { container-type: inline-size; }
.todo-item.doc-check-card { container-type: normal; margin: 0; }
.todo-item.doc-check-card > .todo-body { container-type: inline-size; min-width: 0; }
.doc-check-card .issue-list { min-width: 0; margin: 0; }
.doc-check-card .issue-item { display: grid; grid-template-columns: minmax(0, 1fr); grid-template-areas: "text" "check" "btn"; align-items: start; gap: 8px; padding: 8px 0; border-top: 0; min-width: 0; }
.doc-check-card .issue-text { grid-area: text; min-width: 0; flex: none; overflow-wrap: anywhere; }
.doc-check-card .iban-confirm { grid-area: check; margin: 0; min-height: 44px; padding: 8px 12px; align-items: center; min-width: 0; }
.doc-check-card .iban-confirm label { flex: 1 1 auto; min-width: 0; min-height: 28px; display: flex; align-items: center; }
.doc-check-card .doc-warn-btn { margin-top: 0; grid-area: btn; justify-self: stretch; width: 100%; min-height: 44px; position: static; }
@container (min-width: 640px) {
  .doc-check-card .issue-item { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "text btn" "check check"; }
  .doc-check-card .doc-warn-btn { justify-self: end; width: auto; }
}

/* ---- R39-02: Block "Was ist zu tun" mit Zähler ---- */
.todo-headrow { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 0 0 8px; }
.todo-headrow .todo-head { margin: 0; }
.todo-count { font-size: .875rem; font-weight: 700; color: var(--orlop-muted-text, #565C67); font-variant-numeric: tabular-nums; white-space: nowrap; }

/* Kopf: Paginator als Gruppe, Titel am Handy zweizeilig */
.doc-review-nav { display: inline-flex; align-items: center; gap: 8px; }
.doc-review-pos { font-variant-numeric: tabular-nums; white-space: nowrap; }
@media (max-width: 767px) {
  #documentDetailModal .dph-row1 { max-height: none; align-items: flex-start; }
  #documentDetailModal .dph-row1 .doc-detail-title { white-space: normal !important; display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden !important; overflow-wrap: anywhere; line-height: 1.25; align-self: center; }
  #documentDetailModal .dph-row1 .doc-review-nav { gap: 0; }
}

/* Fußleiste: links Betrag, Fällig, Status; rechts ein Knopf; Sperrgrund mehrzeilig */
#documentDetailModal .doc-detail-actionbar.has-decision .doc-bar-summary { display: block; font-variant-numeric: tabular-nums; font-size: .9375rem; font-weight: 600; color: #333840; white-space: normal; overflow: visible; max-width: none; }
#documentDetailModal .doc-detail-actionbar.has-decision .doc-bar-summary:empty { display: none; }
.doc-bar-summary .bar-amount { font-weight: 900; color: #0E1115; }
.doc-bar-summary .bar-sep { color: var(--orlop-muted-text, #565C67); }
#docApproveNote.is-reason { display: block; white-space: normal; font-size: .875rem; line-height: 1.35; color: #991B1B; text-align: right; overflow-wrap: anywhere; }
@media (max-width: 767px) {
  #documentDetailModal .doc-detail-actionbar.has-decision .doc-bar-summary { flex: 1 1 100%; font-size: .875rem; }
  #docApproveNote.is-reason { text-align: left; }
}
.doc-detail-panel, .doc-page-body { scroll-padding-bottom: calc(var(--bar-h, 72px) + 16px); }
@media (max-width: 1023px) { .doc-page-body { padding-bottom: calc(var(--bar-h, 72px) + env(safe-area-inset-bottom, 0px)); } }
.doc-approve-btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; }

/* ---- R39-02: ohne Vorschau: kompakte Karte "Original" oben rechts, Formular bis 960 px ---- */
.doc-original-card { display: flex; flex-direction: column; align-items: stretch; max-width: none; width: 100%; text-align: left; background: #fff; border: 1px solid #D8DCE4; border-radius: 14px; box-shadow: 0 1px 3px rgba(14,17,21,.06); padding: 16px; box-sizing: border-box; }
.doc-original-card .preview-empty-text { color: var(--orlop-muted-text, #565C67); font-size: .875rem; margin-top: 4px !important; }
.doc-original-head { display: grid; gap: 2px; }
.doc-original-title { font-size: 1rem; font-weight: 900; letter-spacing: -.01em; color: #0E1115; }
.doc-original-file { font-size: .875rem; color: #333840; overflow-wrap: anywhere; }
.doc-original-card .preview-empty-actions { justify-content: flex-start; flex-direction: column; align-items: stretch; gap: 4px; }
.doc-original-card .preview-empty-actions .btn-secondary { min-height: 44px; }
.doc-original-card .preview-empty-actions .btn-ghost { min-height: 44px; justify-content: flex-start; padding-left: 0; text-decoration: underline; }

/* ---- R39-03: Belegliste und Dashboard: eine Primäraktion, vier Reiter ohne Wischen ---- */
.list-seg-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 0 0 12px; }
.list-seg-bar .list-seg { flex: 1 1 auto; min-width: 0; }
.list-seg-bar .list-seg-action { margin-left: auto; min-height: 44px; display: inline-flex; align-items: center; white-space: nowrap; background: #fff; color: #0E1115; border: 1px solid #0E1115; }
.dr-inv-no.is-muted { color: var(--orlop-muted-text, #565C67); font-style: normal; }
.documents-grid .doc-table:not(.has-co):not(.has-sel) { --g-act: minmax(148px, auto); }
.documents-grid .doc-table .dr-actcol { justify-self: end; min-width: 148px; justify-content: flex-end; text-align: right; }
.documents-grid .doc-table .dr-h, .documents-grid .doc-table .dr-h .dr-sort { font-size: .8125rem; font-weight: 700; letter-spacing: .01em; color: var(--orlop-muted-text, #565C67); text-transform: none; }
@media (max-width: 767px) {
  body.page-has-search .global-search { display: none; }
}
/* R53-01: Listen-Umbruch bei 1100 px */
@media (max-width: 1099px) {
  .list-seg-bar .list-seg { flex: 1 1 100%; }
  .list-seg-bar .list-seg-action { flex: 1 1 100%; justify-content: center; margin-left: 0; }
}
/* Dashboard-Karte "Zu prüfen": genau eine Outline-Aktion plus Textlink, nie zwei dunkle Pillen */
#dashWaitingAll, body.has-clarify #dashWaitingAll { background: #fff; color: #0E1115; border: 1px solid #0E1115; }
body.has-clarify #dashWaitingAssign, #dashWaitingAssign { background: transparent; color: #0E1115; border: 0; border-radius: 0; text-decoration: underline; font-weight: 700; padding: 0 4px; }
/* R40-01: Dashboard-Pille ist die dunkle Primärpille (r40.css), keine weiße Variante mehr */

/* ---- R39-04: Zuordnen: Fortschritt, Kürzel, bündige Fußleiste ---- */
.sw-head { position: relative; }
.sw-progress { height: 6px; }
.sw-step { font-weight: 700; color: #333840; }
.sw-assign-hint { color: var(--orlop-muted-text, #565C67); font-size: .875rem; }
.sw-assign-hint[hidden] { display: none; }
.sw-keys { margin: 0; flex: 1 1 100%; order: 10; font-size: .8125rem; color: var(--orlop-muted-text, #565C67); }
.sw-foot { flex-wrap: wrap; padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px)); }
.sw { background: #F5F6F8; }
.sw-foot { background: #fff; margin-bottom: 0; }
.sw-hint { margin: 8px 0 0; padding: 10px 12px; border-radius: 10px; background: #F5F6F8; border: 1px solid #D8DCE4; color: #333840; }
.sw-done .btn-secondary { min-height: 44px; }
.sw-undo-list { max-height: none; }
@media (hover: none) and (pointer: coarse) { .sw-keys { display: none; } }
@media (max-width: 767px) { .sw-assign-hint { flex: 1 1 100%; order: -2; } }
.sw-head > .sw-help-btn { padding-bottom: 0; margin-bottom: 12px; }
.sw-help-btn { width: 44px; min-width: 44px; height: 44px; border-radius: 50%; border: 1px solid #D8DCE4; font-weight: 800; margin-left: auto; }
.sw-helppanel { position: fixed; top: 0; right: 0; bottom: 0; width: min(440px, 100%); z-index: 1300; background: #fff; border-left: 1px solid #D8DCE4; box-shadow: -8px 0 24px rgba(14,17,21,.12); display: flex; flex-direction: column; }
.sw-helphead { padding: 12px 16px; border-bottom: 1px solid #D8DCE4; display: flex; justify-content: flex-end; }
.sw-helpbody { padding: 16px 20px calc(24px + env(safe-area-inset-bottom, 0px)); overflow: auto; font-size: .9375rem; line-height: 1.5; }
.sw-helpbody h2 { margin: 0 0 8px; font-size: 1.25rem; font-weight: 900; letter-spacing: -.02em; }
.sw-helpbody h3 { margin: 16px 0 6px; font-size: 1rem; font-weight: 800; }
.sw-helpbody dt { font-weight: 700; margin-top: 8px; }
.sw-helpbody dd { margin: 2px 0 0; color: #333840; }

/* ---- R39-06: Neuigkeiten: Hotfixes eingerückt unter der Hauptversion ---- */
.news-index-hotfix { margin-left: 16px; font-size: .875rem; color: var(--orlop-muted-text, #565C67); position: relative; }
.news-index-hotfix::before { content: ""; position: absolute; left: -10px; top: 0; bottom: 50%; width: 6px; border-left: 1px solid #D8DCE4; border-bottom: 1px solid #D8DCE4; }
.todo-item.doc-check-card { padding: 8px 12px; align-items: start; }
.doc-check-card .issue-item { gap: 4px; padding: 4px 0; }
.doc-check-card .issue-text { font-size: .875rem; line-height: 1.35; }
.doc-check-card .iban-confirm { padding: 4px 12px; }
.todo-item.doc-check-card .todo-title { margin: 0; line-height: 1.3; }

.doc-original-card .preview-empty-text, .doc-original-card .doc-original-head, .doc-original-card .preview-meta { text-align: left; align-self: stretch; }
.doc-detail-preview .has-no-preview { overflow: visible; }

/* Fußleiste: nichts abschneiden (Betrag, Fällig, Status und Sperrgrund mehrzeilig) */
#documentDetailModal .doc-detail-actionbar.has-decision #docBarSummary,
#documentDetailModal .doc-detail-actionbar.has-decision .doc-bar-summary { white-space: normal !important; overflow: visible !important; text-overflow: clip !important; max-width: none; }
#documentDetailModal .doc-detail-actionbar #docApproveNote.is-reason { white-space: normal !important; overflow: visible !important; text-overflow: clip !important; display: block; max-width: none; font-size: .875rem; line-height: 1.35; color: #991B1B; }
@media (max-width: 767px) { .sw-back span { display: inline; } .sw-head > .btn-ghost.sw-back { padding-right: 8px; } }

/* D-1903: Sperrgrund mehrzeilig, r18 setzt sonst 24 px Höhe und Zeilenhöhe */
#documentDetailModal .doc-detail-actionbar .doc-approve-step.is-reason { height: auto !important; min-height: 0; line-height: 1.35 !important; padding: 0 0 6px; }

/* R45 Nacharbeit (D-2164): Karte "Original" ohne Vorschau füllt die Spalte, Aktionen unten, mit dem Beleg sticky */
/* R45 Nacharbeit (D-2167): Neuigkeiten, Links ohne Unterstrich */
#newsList a, .news-entry a { text-decoration: none; }
#newsList a:hover, #newsList a:focus-visible { text-decoration: underline; }
