/*
 * Runde 31: eine Regel je Thema, geladen als letzte Datei.
 * Neuigkeiten (D-1517/1518/1519), Fußleiste (D-1538), Beleglisten-Badge und -Spalten (D-1511 ff.),
 * Freigabeschleife, Dashboard und Fehlerzustände.
 *
 * Copyright © Fabian Stamminger @ The Platform Group
 */

/* ---- Neuigkeiten: Schiene außerhalb des Textflusses, Text startet 24 px rechts davon ---- */
#newsList .news-entry-body { position: relative; padding: 0 0 0 24px; overflow: visible; border: 0; max-width: none; }
#newsList .news-entry-body::before { content: ""; display: block; position: absolute; left: 0; top: 0; bottom: 0; width: 2px; border-radius: 2px; background: #D8DCE4; pointer-events: none; }
#newsList .news-entry:first-of-type .news-entry-body::before, #newsList .news-entry--lead .news-entry-body::before { background: #0E1115; width: 3px; }
#newsList .news-entry-body ul, #newsList .news-entry-body li, #newsList .news-entry-body li.news-li-plain { max-width: none; }
#newsList .news-entry-body .news-item-text { max-width: 72ch; }
#newsList .news-entry { scroll-margin-top: 16px; }
#newsList .news-entry:focus:not(:focus-visible), #newsList .news-version-head:focus:not(:focus-visible) { outline: none; box-shadow: none; }
#newsList .news-entry:focus-visible, #newsList .news-version-head:focus-visible, #newsList .news-more-list li:focus-visible { outline: 2px solid #0E1115; outline-offset: 2px; border-radius: 6px; box-shadow: none; }
@media (min-width: 1700px) {
  #newsList .news-entry { display: grid; grid-template-columns: 280px minmax(0, 1fr); column-gap: 32px; align-items: start; }
  #newsList .news-entry > .news-entry-meta { position: sticky; top: 16px; flex-direction: column; align-items: flex-start; border-bottom: 0; padding: 0; margin: 0; }
  #newsList .news-entry > .news-entry-meta .news-entry-help { margin: 8px 0 0; }
  #newsList .news-entry > :not(.news-entry-meta):not(.news-entry-body) { grid-column: 1 / -1; }
  #newsList > .news-entry--lead .news-entry-body ul { display: block; }
  #newsList .news-entry-body li { grid-template-columns: 112px minmax(0, 1fr); }
}
@media (max-width: 767px) { #newsList .news-entry-body { padding-left: 24px; } }

/* ---- Fußleiste: Links als 44-px-Ziele, darunter die Version mit Jahr, ohne führenden Punkt ---- */
#appFooter .app-footer-when-short, #appFooter .app-footer-brand { display: none !important; }
#appFooter .app-footer-left::after { content: none !important; }
#appFooter .app-footer-when { display: inline !important; color: var(--orlop-muted-text, #565C67); font-size: .875rem; }
@media (max-width: 767px) {
  #appFooter { flex-direction: column !important; align-items: center !important; justify-content: center !important; gap: 0 !important; text-align: center; }
  #appFooter .app-footer-links { order: -1; justify-content: center; gap: 8px; }
  #appFooter .app-footer-links a { min-height: 44px; min-width: 44px; padding: 0 12px; justify-content: center; }
  #appFooter .app-footer-left { order: 0; flex: none; justify-content: center; min-height: 44px; flex-wrap: wrap; column-gap: 6px; }
  #appFooter .app-footer-left a#footerVersion { min-height: 44px; }
}

/* ---- Belegliste: eine Tippfläche, ein Badge, leere Spalten fehlen (D-1511, D-1521, D-1528, D-1547) ---- */
.badge.ui-badge { display: inline-flex; align-items: center; gap: 6px; min-height: 24px; height: 24px; padding: 0 10px; border-radius: 999px; border: 1px solid transparent; font-size: .8125rem; font-weight: 600; line-height: 1; white-space: nowrap; box-sizing: border-box; }
.badge.ui-badge i { font-size: .75rem; margin: 0; }
.badge.ui-badge--neutral { background: #EEF0F4; color: #333840; border-color: #D8DCE4; }
.badge.ui-badge--waiting { background: #E8F0FE; color: #1E3A8A; border-color: #C7D7F8; }
.badge.ui-badge--amber { background: #FFF7E6; color: #7A4A00; border-color: #F0D9A8; }
.badge.ui-badge--danger { background: #FDECEC; color: #8A1C1C; border-color: #F3C4C4; }
.badge.ui-badge--success { background: #DDF3E6; color: #14532D; border-color: #B7E3C8; }
.documents-grid .doc-row .dr-vendor-link.is-missing { color: var(--orlop-muted-text, #565C67); font-weight: 600; }
.documents-grid .doc-row .dr-sub-file { display: block; font-size: .8125rem; color: var(--orlop-muted-text, #565C67); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.documents-grid .doc-row .dr-tap { display: none; color: var(--orlop-muted-text, #565C67); }
.dr-sort .dr-arrow { font-size: 1rem; line-height: 1; }
.dr-sort .dr-arrow.is-idle { opacity: 0; }
.dr-sort:hover .dr-arrow, .dr-sort:focus-visible .dr-arrow { opacity: 1; }
.documents-grid .dr-amount, .documents-grid .dr-h.dr-amount { text-align: right; font-variant-numeric: tabular-nums; }
.documents-grid .dr-h.dr-amount .dr-sort { margin-left: auto; }
/* R53-01: Listen-Umbruch bei 1100 px */
@media (min-width: 1100px) {
  .documents-grid .doc-table:not(.has-co):not(.has-sel) { --g-main: minmax(240px, 1.6fr); --g-meta: minmax(0, 1fr); --g-kind: 120px; --g-due: 140px; --g-amt: 128px; --g-status: 200px; --g-act: 48px; }
  .documents-grid .doc-table.no-kind:not(.has-co):not(.has-sel) { --g-kind: ; }
  .documents-grid .doc-table.no-inv:not(.has-co):not(.has-sel) { --g-meta: ; }
  .documents-grid .doc-table.no-due:not(.has-co):not(.has-sel) { --g-due: ; }
  .documents-grid .doc-table.no-amount:not(.has-co):not(.has-sel) { --g-amt: ; }
  .documents-grid .doc-table:not(.has-co):not(.has-sel) .doc-thead, .documents-grid .doc-table:not(.has-co):not(.has-sel) .doc-row { grid-template-columns: var(--g-main) var(--g-meta) var(--g-kind) var(--g-due) var(--g-amt) var(--g-status) var(--g-act); column-gap: 24px; }
  .documents-grid .doc-table.no-inv .dr-meta, .documents-grid .doc-table.no-inv .dr-h.dr-metahead,
  .documents-grid .doc-table.no-due .dr-due, .documents-grid .doc-table.no-due .dr-h.dr-due,
  .documents-grid .doc-table.no-amount .dr-amount, .documents-grid .doc-table.no-amount .dr-h.dr-amount { display: none; }
}
/* R53-01: Listen-Umbruch bei 1100 px */
@media (max-width: 1099px) {
  .documents-grid .doc-row .dr-act-vendor { display: none; }
  .documents-grid .doc-row .dr-amount.is-empty, .documents-grid .doc-table.no-amount .dr-amount { display: none; }
  .documents-grid .doc-row.is-novendor .dr-tap { display: inline-block; grid-area: amount; justify-self: end; align-self: center; }
  .documents-grid .doc-row.is-novendor .dr-sub-file { display: none; }
}
@media (min-width: 1700px) { #newsList .news-entry > .news-entry-meta .news-entry-sep { display: none; } }

/* R31 Nacharbeit: Tour-Zeile unter der Aufgabenkarte (D-1566) */
#tabDashboard > .tour-hint#tourHint { order: 5; }
