/* Redesign 2026, Runde 26: Schrifttokens, Handy-Karte, ein Link je Zeile, Lieferant-zuordnen-Drawer, Dashboard, Neuigkeiten.
   Copyright © Fabian Stamminger @ The Platform Group */
:root { --fw-regular: 400; --fw-semi: 600; --fw-black: 900; }

/* R26-01 Handy-Karte: Höhe nach Inhalt, nichts wird abgeschnitten, Meta darf umbrechen */
/* R53-01: Listen-Umbruch bei 1100 px */
@media (max-width: 1099px) {
  .documents-grid .doc-table .doc-row.doc-card, .documents-grid .doc-table.has-co .doc-row.doc-card,
  .documents-grid .doc-table .doc-row, .documents-grid .doc-table.has-co .doc-row {
    height: auto !important; max-height: none !important; min-height: 64px !important; overflow: visible !important; padding-top: 10px !important; padding-bottom: 10px !important;
  }
  .documents-grid .doc-table .dr-m2 { flex-wrap: wrap; white-space: normal; overflow: visible; }
  .documents-grid .doc-table .doc-row .dr-m1 { overflow: visible; flex-wrap: wrap; }
  .documents-grid .doc-table .doc-row.is-novendor .dr-sub-flag { display: block !important; }
}
/* Sichtbarer Chip höchstens 24 px, die 44-px-Fläche kommt nur per ::before bei Touch */
.documents-grid .doc-row .dr-flag-btn, .documents-grid .doc-row .doc-wait-chip, .documents-grid .doc-row .dr-act, .documents-grid .doc-row .dr-open { position: relative; }
@media (pointer: coarse) {
  .dr-flag-btn, .doc-wait-chip, .dr-act, .dr-open, .dept-edit, .dept-del { min-height: 0; min-width: 0; }
  .documents-grid .doc-row .dr-flag-btn, .documents-grid .doc-row .doc-wait-chip { max-height: 24px; }
  .documents-grid .doc-row .dr-flag-btn::before, .documents-grid .doc-row .doc-wait-chip::before, .documents-grid .doc-row .dr-act::before, .documents-grid .doc-row .dr-open::before { content: ""; position: absolute; left: -6px; right: -6px; top: 50%; height: 44px; transform: translateY(-50%); }
}
.documents-grid .doc-row .dr-flag-btn, .documents-grid .doc-row .doc-wait-chip { min-height: 0; max-height: 24px; line-height: 20px; padding-top: 1px; padding-bottom: 1px; }

/* R26-01 ein Link je Zeile: Name/Dateiname spannt per ::after die ganze Zeile auf */
.documents-grid .doc-table .doc-row { position: relative; cursor: pointer; }
.documents-grid .doc-table .doc-row .dr-vendor-link::after { content: ""; position: absolute; inset: 0; z-index: 1; }
.documents-grid .doc-table .doc-row .dr-sel, .documents-grid .doc-table .doc-row .dr-flag-btn, .documents-grid .doc-table .doc-row .doc-wait-chip, .documents-grid .doc-table .doc-row .dr-act { z-index: 3; }
.documents-grid .doc-table .doc-row .dr-vendor-link:focus-visible { outline: 2px solid #0E1115; outline-offset: 2px; }
.documents-grid .doc-table .doc-row:focus-within { box-shadow: inset 0 0 0 2px #0E1115; }
.documents-grid .doc-table .doc-row .dr-open { color: var(--orlop-muted-text, #565C67); }
.documents-grid .doc-table .doc-row .dr-open .dr-open-t { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.documents-grid .doc-table .doc-row .dr-open i { font-size: .875rem; }

/* R26-01 404 */
.nf-addr { color: var(--orlop-muted-text, #565C67); font-size: .875rem; margin: 0 0 16px; word-break: break-all; }
.nf-addr code { background: #F5F6F8; border: 1px solid #D8DCE4; border-radius: 6px; padding: 1px 6px; }
.noaccess-actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }

/* R26-05 Typoskala der Belegliste */
.documents-grid .doc-table .doc-row .dr-vendor-link { font-weight: var(--fw-semi); }
.documents-grid .doc-table .doc-row .dr-due { font-weight: var(--fw-regular); font-variant-numeric: tabular-nums; }
.documents-grid .doc-table .doc-row .dr-due.is-overdue { font-weight: var(--fw-semi); }
.documents-grid .doc-table .doc-row .dr-amount { font-weight: var(--fw-semi); }
.documents-grid .doc-table .doc-row .dr-meta, .documents-grid .doc-table .doc-row .dr-inv-no { font-weight: var(--fw-regular); }
.documents-grid .doc-table .doc-row .dr-act { font-weight: var(--fw-semi); }
.documents-grid .doc-table .doc-row .badge { font-weight: var(--fw-semi); }
.badge-wait-other, .badge.badge-info { background: #E8F0FE; color: #1E3A8A; border-color: #C7D7F8; }
.documents-grid .doc-row .doc-wait-chip { background: #0E1115; color: #fff; border-color: #0E1115; }
.documents-grid .doc-row .doc-wait-chip[aria-pressed="true"] { background: #fff; color: #0E1115; }

/* R26-02 Lieferant zuordnen: Drawer rechts, am Handy Sheet */
.vd-back { position: fixed; inset: 0; background: rgba(14, 17, 21, .42); z-index: 1200; }
.vd { position: fixed; top: 0; right: 0; bottom: 0; width: min(480px, 100vw); background: #fff; z-index: 1201; display: flex; flex-direction: column; box-shadow: -8px 0 32px rgba(14, 17, 21, .18); animation: vd-in .18s ease-out; color: #0E1115; }
@keyframes vd-in { from { transform: translateX(24px); opacity: 0; } to { transform: none; opacity: 1; } }
.vd-head { padding: 20px 24px 12px; border-bottom: 1px solid #D8DCE4; display: flex; gap: 12px; align-items: flex-start; }
.vd-head h2 { margin: 0; font-size: 1.125rem; font-weight: 900; letter-spacing: -.01em; }
.vd-file { margin: 2px 0 0; color: var(--orlop-muted-text, #565C67); font-size: .875rem; word-break: break-all; }
.vd-facts { margin: 6px 0 0; color: #333840; font-size: .875rem; }
.vd-close { margin-left: auto; background: transparent; border: 0; font-size: 1.25rem; cursor: pointer; width: 40px; height: 40px; border-radius: 999px; color: #333840; }
.vd-close:hover { background: #F5F6F8; }
.vd-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 16px 24px; }
.vd-search { width: 100%; box-sizing: border-box; min-height: 44px; padding: 0 14px; border: 1px solid #B6BCCC; border-radius: 10px; font: inherit; }
.vd-search:focus-visible { outline: 2px solid #0E1115; outline-offset: 1px; }
.vd-list { list-style: none; margin: 12px 0 0; padding: 0; }
.vd-item { display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; background: #fff; border: 1px solid #D8DCE4; border-radius: 10px; padding: 10px 12px; margin-bottom: 8px; font: inherit; cursor: pointer; min-height: 44px; }
.vd-item:hover, .vd-item:focus-visible { border-color: #0E1115; background: #F5F6F8; }
.vd-item-name { font-weight: var(--fw-semi); flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
.vd-item-sub { color: var(--orlop-muted-text, #565C67); font-size: .8125rem; }
.vd-chip { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 999px; background: #E8F0FE; color: #1E3A8A; font-size: .75rem; font-weight: 600; }
.vd-new { margin-top: 8px; }
.vd-newform { display: grid; gap: 10px; margin-top: 8px; padding: 12px; border: 1px solid #D8DCE4; border-radius: 10px; background: #F5F6F8; }
.vd-newform label { display: grid; gap: 4px; font-size: .875rem; font-weight: 600; }
.vd-newform input { min-height: 44px; padding: 0 12px; border: 1px solid #B6BCCC; border-radius: 8px; font: inherit; background: #fff; }
.vd-empty { color: var(--orlop-muted-text, #565C67); margin: 12px 0 0; }
.vd-foot { padding: 12px 24px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid #D8DCE4; display: flex; gap: 12px; align-items: center; background: #fff; }
.vd-foot .vd-spacer { flex: 1 1 auto; }
.vd-prog { color: var(--orlop-muted-text, #565C67); font-size: .875rem; }
.vd-done { text-align: center; padding: 40px 8px; }
.vd-done i { font-size: 2.5rem; color: #047857; }
.vd-done h3 { margin: 16px 0 8px; font-size: 1.25rem; font-weight: 900; }
.vd-done p { color: var(--orlop-muted-text, #565C67); margin: 0 0 20px; }
.vd-err { color: #8A1C1C; margin: 8px 0 0; font-size: .875rem; }
@media (max-width: 767px) {
  .vd { top: auto; left: 0; right: 0; width: 100%; height: 90vh; height: 90dvh; border-radius: 16px 16px 0 0; animation-name: vd-up; }
  @keyframes vd-up { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }
}
@media (prefers-reduced-motion: reduce) { .vd { animation: none; } }
.dr-flag-btn.is-assign, .dash-recent-flag { cursor: pointer; }

/* R26-03 Dashboard */
.dash-attn { list-style: none; margin: 0; padding: 0; }
.dash-attn li { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid #E7EAF0; }
.dash-attn li:first-child { border-top: 0; }
.dash-attn a { color: #0E1115; font-weight: 600; text-decoration: none; }
.dash-attn a:hover { text-decoration: underline; }
.dash-recent-flag { background: #FFF7E6; color: #7A4B00; border: 1px solid #F0D9A8; border-radius: 999px; padding: 1px 10px; font-size: .8125rem; font-weight: 600; max-height: 24px; }

/* R26-04 Neuigkeiten */
.news-today-more { margin-top: 12px; border-top: 1px solid #E7EAF0; padding-top: 8px; }
.news-today-more summary { cursor: pointer; font-weight: 600; min-height: 32px; }
.news-today-more summary:focus-visible { outline: 2px solid #0E1115; outline-offset: 2px; }
.login-version { text-align: center; color: var(--orlop-muted-text, #565C67); font-size: .8125rem; margin-top: 16px; }
.login-hint { color: var(--orlop-muted-text, #565C67); font-size: .875rem; margin: 12px 0 0; text-align: center; }
.login-help { text-align: center; font-size: .875rem; margin: 8px 0 0; }
.login-help a { color: #0E1115; }
.dash-waiting-sub { margin: -4px 0 8px; color: var(--orlop-muted-text, #565C67); font-size: .875rem; }
.dash-waiting-sub:empty { display: none; }
.dash-attention { background: #fff; border: 1px solid #D8DCE4; border-radius: 12px; box-shadow: 0 1px 3px rgba(14, 17, 21, .06); padding: 16px 20px; margin: 0 0 16px; }
.dash-attention .section-title { margin: 0 0 8px; }
.dash-attn li { align-items: center; }
.dash-columns { align-items: stretch !important; }
.dash-columns > section { height: 100% !important; }
/* R26-04 Neuigkeiten ruhig: Gesamtbreite höchstens 1100 px, Hilfelink leise, Balken nur an der Zielkarte */
#newsList .news-entry { max-width: none; }
#newsList .news-entry-link { font-size: .875rem; font-weight: var(--fw-regular); text-decoration: none; color: #0E1115; }
#newsList .news-entry-link:hover { text-decoration: underline; }
#newsList .news-entry:not(.is-target)::before { display: none; }
#newsList .news-body li, #newsList .news-entry-body li { border-bottom-color: #E7EAF0; }
.dash-waiting-main .dash-recent-flag, .dash-recent-item .dash-recent-flag { align-self: flex-start; width: fit-content; display: inline-flex; align-items: center; height: 24px; margin: 2px 0; }
.dash-recent-item { flex-wrap: wrap; }
/* R27-03: ein Toast-Slot unten mittig im freien Bereich links vom Drawer, am Handy oben über dem Sheet */
body:has(.vd) .toast-region, body:has(.vd) #toastRegion { z-index: 1300; bottom: calc(16px + env(safe-area-inset-bottom)); left: calc((100vw - min(480px, 100vw)) / 2); right: auto; transform: translateX(-50%); max-width: calc(100vw - min(480px, 100vw) - 32px); }
@media (max-width: 767px) { body:has(.vd) .toast-region, body:has(.vd) #toastRegion { top: calc(8px + env(safe-area-inset-top)); bottom: auto; left: 50%; max-width: calc(100vw - 32px); } .vd { height: calc(100dvh - 96px - env(safe-area-inset-top)); } }
.vd-foot .btn-secondary, .vd-foot .btn-textlink { white-space: nowrap; min-height: 44px; }

/* Runde 26 Nacharbeit (2.89.1) */
/* D-1282: Chip 'Lieferant fehlt' im Dashboard liegt über der Zeilenfläche und ist klickbar */
.dash-waiting-item .dash-recent-flag, .dash-recent-item .dash-recent-flag { position: relative; z-index: 3; cursor: pointer; }
/* D-1285: kein Statuspunkt mehr, ein Signal je Zeile (Chip auf dem Desktop, farbiges Statuswort am Handy) */
.badge.ui-badge::before, .doc-row .badge::before, .doc-row .badge-warning::before, .doc-row .badge-secondary::before, .doc-row .badge-info::before, .doc-row .badge-success::before, .doc-row .badge-error::before { display: none !important; content: none !important; }
.documents-grid .doc-table .doc-row .dr-status::before { display: none !important; content: none !important; }
@media (max-width: 767px) {
  /* D-1286: Fußzeile eine Zeile ohne verwaisten Punkt */
  .app-footer { gap: 0 16px !important; padding-top: 4px !important; padding-bottom: calc(var(--mshell-tab-h, 64px) + env(safe-area-inset-bottom, 0px) + 8px) !important; }
  .app-footer-left, .app-footer-links { flex: 0 0 auto !important; }
  .app-footer-left::after { content: none !important; }
  /* D-1288: nichts ragt über den Viewport */
  .help-layout, .help-layout * { overflow-wrap: anywhere; }
  .help-figure-art, .help-figure-art svg { max-width: 100%; }
}
/* R53-01: Listen-Umbruch bei 1100 px */
@media (max-width: 1099px) {
  .documents-grid .doc-table .doc-row .dr-status { display: none; }
  .documents-grid .doc-table .doc-row .dr-m1 .dr-m-status { font-weight: var(--fw-semi); }
  .documents-grid .doc-table .doc-row .dr-m1 .dr-m-status[data-st-word="warn"] { color: #8A4B00; }
  .documents-grid .doc-table .doc-row .dr-m1 .dr-m-status[data-st-word="wait"] { color: #1E3A8A; }
  .documents-grid .doc-table .doc-row .dr-m1 .dr-m-status[data-st-word="ok"] { color: #04603F; }
  .documents-grid .doc-table .doc-row { padding-left: 16px; }
  .documents-grid .doc-table.has-sel .doc-row { padding-left: 2.75rem; }
}
/* D-1287: Neuigkeiten, Trennlinie volle Kartenbreite, Timeline mit Punkten */
#newsList .news-entry-body li, #newsList .news-entry-body li.news-li-plain { max-width: none; width: auto; box-sizing: border-box; }
.news-index ul { position: relative; list-style: none; margin: 0; padding: 0 0 0 18px; }
.news-index ul::before { content: ""; position: absolute; left: 4px; top: 8px; bottom: 8px; width: 2px; background: #D8DCE4; }
.news-index ul li:not(.news-index-month):not(.news-index-olderli) { position: relative; }
.news-index ul li:not(.news-index-month):not(.news-index-olderli)::before { content: ""; position: absolute; left: -18px; top: 6px; width: 10px; height: 10px; border-radius: 50%; background: #fff; border: 2px solid #6B717C; box-sizing: border-box; }
.news-index ul li.is-current::before { background: #0E1115; border-color: #0E1115; }
.news-index li .news-current-pill { display: inline-flex; align-items: center; align-self: flex-start; width: fit-content; margin: 4px 0 0; padding: 0 8px; height: 20px; line-height: 20px; border-radius: 999px; background: #0E1115; color: #fff; font-size: .75rem; font-weight: 600; }
.news-index ul li:not(.news-index-month):not(.news-index-olderli)::before { top: 9px; }

/* R27-02 Neuigkeiten füllt die Breite: Karten links, Versionsliste fest 320 px rechts, Text höchstens 72ch */
@media (min-width: 1100px) {
  #newsList { max-width: none; grid-template-columns: minmax(0, 1fr) 320px; column-gap: 32px; }
  #newsList > .news-index { width: 320px; box-sizing: border-box; align-self: start; }
  .news-jump { display: none; }
}
@media (min-width: 1600px) {
  #newsList { grid-template-columns: repeat(2, minmax(0, 1fr)) 320px; }
  #newsList > .news-entry { grid-column: auto; }
  #newsList > .news-index { grid-column: 3; grid-row: 1 / span 80; }
  #newsList > :not(.news-entry):not(.news-index) { grid-column: 1 / span 2; }
}
#newsList .news-entry-body li { max-width: 72ch; }
@media (max-width: 1099px) {
  #newsList { display: block; max-width: none; }
  #newsList > .news-index { display: none; }
  .news-jump { display: flex; flex-wrap: nowrap; overflow-x: auto; -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 36px), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 36px), transparent); }
}

/* R27-03 Lieferanten-Drawer vollenden */
.vd-head { flex-wrap: wrap; position: relative; }
.vd-head-main { flex: 1 1 0; min-width: 0; }
.vd-facts-detect { color: var(--orlop-muted-text, #565C67); line-height: 1.5; }
.vd-view { display: inline-block; margin-top: 6px; font-size: .875rem; font-weight: 600; color: #0E1115; text-decoration: underline; text-underline-offset: 3px; }
.vd-count { flex: 0 0 100%; margin: 8px 0 0; font-size: .8125rem; color: var(--orlop-muted-text, #565C67); }
.vd-progress { flex: 0 0 100%; height: 3px; background: #E7EAF0; border-radius: 2px; overflow: hidden; margin-top: 8px; }
.vd-progress span { display: block; height: 100%; background: #0E1115; transition: width .18s ease-out; }
.vd-list { margin-top: 8px; }
.vd-item { border: 0; border-radius: 10px; padding: 10px 12px; margin: 0; min-height: 52px; font-size: .9375rem; font-weight: 600; background: transparent; cursor: pointer; }
.vd-item:hover { background: #F5F6F8; border-color: transparent; }
.vd-item:focus-visible { outline: 2px solid #0E1115; outline-offset: 2px; background: #F5F6F8; border-color: transparent; }
.vd-item-main { display: flex; flex-direction: column; flex: 1 1 auto; min-width: 0; }
.vd-item-why { font-size: .8125rem; font-weight: 400; color: var(--orlop-muted-text, #565C67); }
.vd-item-new .vd-item-name { font-weight: 600; }
.vd-undo-list { list-style: none; margin: 8px 0 0; padding: 0; border-top: 1px solid #E7EAF0; }
.vd-undo-list li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid #E7EAF0; }
.vd-undo-text { display: flex; flex-direction: column; min-width: 0; }
.vd-undo-text span { font-size: .8125rem; color: var(--orlop-muted-text, #565C67); overflow-wrap: anywhere; }
.vd-done .btn-textlink { display: block; margin: 12px auto 0; }

/* R27-04 Zeilenaktion folgt dem nächsten Schritt */
.documents-grid .doc-row .dr-vendor, .documents-grid .doc-row .dr-vendor-link { font-size: .9375rem; font-weight: 600; }
.documents-grid .doc-row .dr-act-vendor { white-space: nowrap; }
.dr-sel-off { cursor: not-allowed; }
.dr-sel-off input { cursor: not-allowed; opacity: .4; }
/* R53-01: Listen-Umbruch bei 1100 px */
@media (min-width: 1100px) {
  .documents-grid .doc-table .doc-row { height: 64px; min-height: 64px; max-height: 64px; box-sizing: border-box; }
}
.dash-waiting-vendor-go { white-space: nowrap; }
