/* R30: Entscheidungsrahmen, Wizard-Schale, Zählung, Verwalten, Qualität, Neuigkeiten. Copyright © Fabian Stamminger @ The Platform Group */

:root { --tap: 32px; }
@media (pointer: coarse), (max-width: 767px) { :root { --tap: 44px; } }

/* ---------- R30-05: Fokus zentral, Zielgrößen ---------- */
:focus-visible { outline: 2px solid #0E1115; outline-offset: 2px; box-shadow: 0 0 0 4px #fff; }
.news-version-head:focus-visible, #newsList .news-entry:focus-visible, #newsList .news-more-list li:focus-visible,
.news-version-head[tabindex="-1"]:focus-visible { outline: 2px solid #0E1115; outline-offset: 2px; box-shadow: 0 0 0 4px #fff; }
.news-version-head:focus:not(:focus-visible), #newsList .news-entry:focus:not(:focus-visible) { outline: none; box-shadow: none; }
.dr-sel input, .dr-selhead input, .doc-selall-m input { width: 24px; height: 24px; border: 1px solid #6B717C; border-radius: 4px; accent-color: #0E1115; }
.dr-sel, .dr-selhead { min-width: var(--tap); min-height: var(--tap); }
/* R53-01: Listen-Umbruch bei 1100 px */
@media (max-width: 1099px) {
  .dr-sel, .dr-selhead { width: 44px; min-height: 44px; }
}
.mshell-tabbar[role="navigation"] .mshell-tab { position: relative; min-height: var(--tap); }
.mshell-tab[aria-current="page"]::after { content: ""; position: absolute; top: 4px; left: 50%; margin-left: 10px; width: 6px; height: 6px; border-radius: 50%; background: #0E1115; }

/* ---------- R30-03: Zeilenknopf Kontur, dunkel nur im Sammelband ---------- */
.documents-grid .doc-row button.dr-act-vendor, button.dr-act-vendor { background: #fff !important; color: #0E1115 !important; border: 1px solid #0E1115 !important; }
.docs-vendor-band .btn-secondary, .docs-vendor-band .btn-primary { background: #0E1115 !important; color: #fff !important; border-color: #0E1115 !important; }

/* ---------- R30-01: Karte "Was ist zu tun", Metazeile, gesperrte Felder, Leiste ---------- */
.doc-meta-line { margin: 2px 0 0; font-size: .875rem; color: var(--orlop-muted-text, #565C67); }
.todo-card { background: #fff; border: 1px solid #D8DCE4; border-radius: 14px; box-shadow: 0 1px 3px rgba(14,17,21,.06); padding: 16px 20px; margin: 0 0 16px; }
.todo-head { margin: 0 0 8px; font-size: 1.0625rem; font-weight: 900; letter-spacing: -.01em; color: #0E1115; display: flex; align-items: center; gap: 8px; }
.todo-card.is-clear .todo-head i { color: #1B7F4B; }
.todo-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.todo-item { display: grid; grid-template-columns: 28px 1fr; gap: 12px; align-items: start; }
.todo-n { width: 28px; height: 28px; border-radius: 50%; background: #0E1115; color: #fff; display: inline-flex; align-items: center; justify-content: center; font-weight: 800; font-size: .875rem; }
.todo-title { display: block; font-size: 1rem; color: #0E1115; }
.todo-text { margin: 2px 0 8px; color: #333840; font-size: .9375rem; }
.todo-sub { margin: 8px 0 0; color: var(--orlop-muted-text, #565C67); font-size: .875rem; }
.todo-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.todo-actions button { min-height: 44px; }
.todo-card .todo-text:last-child { margin-bottom: 0; }
.todo-next { margin-top: 8px; min-height: 44px; }
#docDuplicateBanner:empty { display: none; }
/* gesperrte Felder: Definitionsliste (Label/Wert) statt Eingabekästen */
form[data-locked="true"] input:disabled, form[data-locked="true"] select:disabled, form[data-locked="true"] textarea:disabled {
  border: 0 !important; background: transparent !important; box-shadow: none !important; padding-left: 0 !important; color: #0E1115 !important; font-weight: 600; opacity: 1; -webkit-text-fill-color: #0E1115; appearance: none; -webkit-appearance: none;
}
form[data-locked="true"] select:disabled { background-image: none !important; }
form[data-locked="true"] input[type="date"][value=""]:disabled::before { content: "Nicht erkannt"; background: #FEF3C7; color: #7A4B00; border-radius: 9999px; padding: 2px 10px; font-size: .8125rem; font-weight: 700; }
form[data-locked="true"] .doc-field > label::after { content: "gesperrt"; margin-left: 8px; font-size: .75rem; font-weight: 600; color: var(--orlop-muted-text, #565C67); }
/* Entscheidungsleiste: Betrag und Lieferant links, eine Hauptaktion rechts, Sicherheitsabstand */
.doc-detail-actionbar { padding-bottom: calc(.75rem + env(safe-area-inset-bottom, 0px)); }
@media (min-width: 768px) {
  #documentDetailModal .doc-detail-actionbar.has-decision .doc-bar-summary { display: block; flex: 1 1 auto; min-width: 0; max-width: 36%; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; order: -1; }
}

/* ---------- R30-02: Wizard-Schale ---------- */
.ow-draftstamp { margin-left: auto; }
@media (max-width: 767px) { .ow-draftstamp { display: none; } }

/* ---------- R30-04: Verwalten, Mitarbeitende, Leerzustand ---------- */
.reimb-people-line { margin: 4px 0 0; color: var(--orlop-muted-text, #565C67); font-size: .9375rem; }
.reimb-people-line a { color: #0E1115; font-weight: 700; }
.rv-empty { text-align: center; padding: 2.5rem 1rem; color: #333840; }
.rv-empty i { font-size: 1.75rem; color: #1B7F4B; }
.rv-empty-text { margin: .75rem auto 1.25rem; max-width: 52ch; }
.rv-empty-actions { display: flex; gap: 1rem; justify-content: center; align-items: center; flex-wrap: wrap; }
[data-rv-empty="1"] #reimbSearch, [data-rv-empty="1"] [data-rv-search], [data-rv-empty="1"] #reimbSummary { display: none !important; }
.emp-table th { font-size: .8125rem !important; font-weight: 700 !important; color: var(--orlop-muted-text, #565C67) !important; padding: .75rem 1rem !important; white-space: nowrap; }
.emp-table tbody tr { height: 56px; }
.emp-row-menu { display: inline-block; position: relative; margin-left: .25rem; vertical-align: middle; }
.emp-row-menu > summary { list-style: none; cursor: pointer; min-width: 44px; min-height: 40px; display: inline-flex; align-items: center; justify-content: center; border-radius: 9999px; }
.emp-row-menu > summary::-webkit-details-marker { display: none; }
.emp-row-menu-list { position: absolute; right: 0; z-index: 20; min-width: 14rem; margin-top: 4px; background: #fff; border: 1px solid #D8DCE4; border-radius: 12px; box-shadow: 0 8px 24px rgba(14,17,21,.12); padding: 6px; text-align: left; }
.emp-row-menu-list button { display: block; width: 100%; text-align: left; min-height: 44px; padding: 0 12px; background: none; border: 0; border-radius: 8px; cursor: pointer; font: inherit; color: #0E1115; }
.emp-row-menu-list button:hover { background: #F5F6F8; }
.tw-self { border: 1px solid #D8DCE4; border-radius: 14px; background: #F5F6F8; padding: 14px 16px; margin: 12px 0; }
.tw-self p { margin: 4px 0 10px; color: #333840; }
.tw-who { color: var(--orlop-muted-text, #565C67); font-size: .875rem; margin-top: 8px; }
@media (max-width: 639px) {
  .emp-table, .emp-table tbody, .emp-table tr, .emp-table td { display: block; width: 100%; box-sizing: border-box; }
  .emp-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .emp-table tbody tr { height: auto; padding: .85rem; margin: 0 0 .6rem; border: 1px solid #D8DCE4 !important; border-radius: 12px; background: #fff; }
  .emp-table td { padding: .15rem 0 !important; border: 0 !important; text-align: left !important; }
  .emp-table td[data-label]::before { content: attr(data-label) ": "; color: var(--orlop-muted-text, #565C67); font-size: .8125rem; }
  .emp-table-wrap { overflow-x: visible; }
}

/* ---------- R30-06: Neuigkeiten ---------- */
#newsList .news-entry-body ul { max-width: 72ch; }
#newsList .news-entry-body li { display: grid; grid-template-columns: 96px 1fr; gap: 12px; align-items: start; }
#newsList .news-entry-body li.news-li-plain { display: block; }
#newsList .news-badge { justify-self: start; text-align: center; min-width: 84px; }
#newsList .news-badge--new { background: #0E1115; color: #fff; }
#newsList .news-badge--better { background: #E7EAF0; color: #333840; }
#newsList .news-badge--fixed { background: #DDF3E6; color: #14532D; }
@media (min-width: 1280px) { #newsList .news-index { position: sticky; top: 16px; align-self: start; } }
.news-acc { border-top: 1px solid #D8DCE4; }
.news-acc > summary { list-style: none; cursor: pointer; min-height: 44px; padding: 8px 0; display: block; }
.news-acc > summary::-webkit-details-marker { display: none; }
.news-acc > summary::after { content: "\203A"; float: right; font-size: 1.5rem; line-height: 1; transition: transform .15s; }
.news-acc[open] > summary::after { transform: rotate(90deg); }
.news-acc-title { display: block; font-weight: 700; color: #0E1115; }
.news-older-all > summary { min-height: 44px; display: flex; align-items: center; cursor: pointer; font-weight: 700; }
@media (max-width: 767px) {
  #newsList .news-entry-body li { grid-template-columns: 84px 1fr; }
  #newsList .news-entry--compact, #newsList .news-entry:not(.news-entry--lead) { padding-top: 0; padding-bottom: 0; margin-bottom: 0; }
  #newsList .news-index { display: none; }
}
@media (prefers-reduced-motion: reduce) { .news-acc > summary::after { transition: none; } }

/* R30-01: Leiste am Desktop ruhig: Betrag und Lieferant links, rechts Weiter und Hauptaktion */
@media (min-width: 768px) {
  #documentDetailModal .doc-detail-actionbar.has-decision { flex-wrap: nowrap; gap: .75rem; }
  #documentDetailModal .doc-detail-actionbar.has-decision .doc-save-state,
  #documentDetailModal .doc-detail-actionbar.has-decision .doc-keys-hint { display: none; }
  #documentDetailModal .doc-detail-actionbar.has-decision .doc-bar-left { flex: 0 0 auto; }
  #documentDetailModal .doc-detail-actionbar.has-decision .doc-bar-right { flex: 1 1 auto; min-width: 0; flex-wrap: wrap; justify-content: flex-end; }
  #documentDetailModal .doc-detail-actionbar.has-decision .doc-bar-summary { max-width: 26%; }
}

/* R30 Nacharbeit: gesperrter Betrag ohne Eingabeumrandung, Labels brechen um (D-1505, D-1506) */
form[data-locked="true"] .doc-input-suffix { border: 0 !important; background: transparent !important; box-shadow: none !important; padding: 0 !important; }
form[data-locked="true"] .doc-field > label { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; }
form[data-locked="true"] .doc-field > label::after { margin-left: 0; }
@media (max-width: 480px) { form[data-locked="true"] .doc-field-grid { grid-template-columns: 1fr !important; } }

/* R30 Nacharbeit: Dashboard-Karte ohne Wiederholung, Warnsymbol, dunkle Pille rechts (D-1510) */
.dash-waiting-empty.is-warn > i { color: #B45309; }
.dash-waiting-empty.is-warn > div { display: grid; grid-template-columns: 1fr auto; column-gap: 16px; align-items: center; width: 100%; }
.dash-waiting-empty.is-warn > div > strong, .dash-waiting-empty.is-warn > div > span { grid-column: 1; }
.dash-waiting-empty.is-warn .dash-assign-pill { grid-column: 2; grid-row: 1 / span 2; border-radius: 9999px; background: #0E1115; color: #fff; border: 0; padding: 0 20px; min-height: 44px; font-weight: 700; }
@media (max-width: 767px) {
  .dash-waiting-empty.is-warn > div { grid-template-columns: 1fr; }
  .dash-waiting-empty.is-warn .dash-assign-pill { grid-column: 1; grid-row: auto; margin-top: 12px; width: 100%; }
}

/* R30 Nacharbeit: Handy ohne Zeilenknopf, die ganze Zeile öffnet den Beleg (D-1511) */
/* R53-01: Listen-Umbruch bei 1100 px */
@media (max-width: 1099px) {
  .dr-act.dr-act-vendor { display: none !important; }
}
