/* Redesign 2026, Runde 16 (2.78.0) */

/* R16-07 (D-846): ein globaler Fokusring, 2 px dunkel plus 2 px weiss */
:focus-visible { outline: 2px solid #0E1115; outline-offset: 2px; box-shadow: 0 0 0 4px #FFFFFF; }
.pw-toggle:focus-visible,
.pay-more-item:focus-visible,
.dash-waiting-link:focus-visible { outline: 2px solid #0E1115; outline-offset: 2px; box-shadow: 0 0 0 4px #FFFFFF; }
:is(#tabReise, .tw) :focus-visible { outline: 2px solid #0E1115; outline-offset: 2px; box-shadow: 0 0 0 4px #FFFFFF; }
.mshell-tab:focus-visible { outline-offset: -4px; box-shadow: none; }

/* R16-07 (D-845): Tableiste am Handy, fuenfter Tab ohne Ueberlauf, Labels auf einer Grundlinie */
.mshell-tab { overflow: hidden; }
.mshell-tab span { display: block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; line-height: 1.2; letter-spacing: -0.01em; }
@media (max-width: 767px) { .mshell-tab { font-size: .75rem; padding: 4px 1px; justify-content: flex-start; padding-top: 8px; } }

/* R16-07 (D-846): Zielgroessen am Touch-Geraet mindestens 44 px */
@media (pointer: coarse) {
  .dr-act, .doc-missing-chip { min-height: 44px; }
  .page-help-link { position: relative; width: 44px; height: 44px; font-size: 1rem; }
  .page-help-link::after { content: none; }
}

/* R16-03: Belegliste */
.documents-grid .dr-sortarrow { margin-left: .25rem; font-size: .75rem; }
.doc-row .dr-progress { display: inline-flex; align-items: center; gap: .4rem; font-size: .8125rem; color: var(--orlop-text-2, #4B5563); }
.doc-row .dr-progress::before { content: ""; width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--orlop-primary, #6B717C); border-top-color: transparent; animation: r16spin .9s linear infinite; }
.doc-row .dr-progress.is-stale { color: #7A1D12; }
.doc-row .dr-progress.is-stale::before { display: none; }
.dr-pending { display: inline-block; min-width: 4.5rem; height: .8em; border-radius: 4px; vertical-align: middle; color: transparent; background: linear-gradient(90deg, #E7EAF0 25%, #F5F6F8 50%, #E7EAF0 75%); background-size: 200% 100%; animation: r16shimmer 1.4s linear infinite; }
.dr-missing { color: var(--orlop-text-2, #4B5563); font-size: .875rem; }
.badge { min-height: 24px; }
@keyframes r16spin { to { transform: rotate(360deg); } }
@keyframes r16shimmer { to { background-position: -200% 0; } }

/* R16-05: Skeletons und Fehlerbaustein */
.ui-skel { display: block; border-radius: 6px; background: linear-gradient(90deg, #E7EAF0 25%, #F5F6F8 50%, #E7EAF0 75%); background-size: 200% 100%; animation: r16shimmer 1.4s linear infinite; }
.ui-skel-table { background: #fff; border: 1px solid var(--orlop-line, #D8DCE4); border-radius: 12px; padding: .5rem 1rem; }
.ui-skel-row { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 1rem; padding: .85rem 0; border-top: 1px solid var(--orlop-line, #D8DCE4); }
.ui-skel-row:first-child { border-top: 0; }
.ui-skel-row .ui-skel { height: 14px; }
.ui-skel-head .ui-skel { height: 10px; opacity: .7; }
.ui-skel-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1rem; }
.ui-skel-card { height: 96px; border-radius: 12px; }
.ui-error { text-align: center; padding: 2.5rem 1.25rem; background: #fff; border: 1px solid var(--orlop-line, #D8DCE4); border-radius: 12px; box-shadow: 0 1px 3px rgba(14,17,21,.06); }
.ui-error h2 { margin: 0 0 .4rem; font-size: 1.25rem; font-weight: 900; letter-spacing: -0.02em; }
.ui-error p { margin: 0 auto .5rem; max-width: 34rem; color: var(--orlop-text-2, #4B5563); }
.ui-error .ui-error-code { font-size: .8125rem; color: var(--orlop-text-2, #4B5563); }
.ui-error-actions { display: flex; flex-wrap: wrap; gap: .75rem; justify-content: center; margin-top: 1rem; align-items: center; }
.ui-error-icon { font-size: 2rem; color: var(--orlop-primary, #6B717C); margin-bottom: .5rem; }
.dash-tile.is-skeleton { pointer-events: none; }
.dash-tile.is-skeleton .ui-skel { height: 28px; width: 40%; }
.dash-error-pad { padding-bottom: 5rem; }
@media (prefers-reduced-motion: reduce) {
  .ui-skel, .dr-pending, .doc-row .dr-progress::before { animation: none !important; }
}

/* R16-02: Belegseite */
.beleg-bar { position: sticky; bottom: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .75rem 1rem; background: #fff; border-top: 1px solid var(--orlop-line, #D8DCE4); box-shadow: 0 -4px 16px rgba(14,17,21,.06); }
.beleg-bar .beleg-reject { background: none; border: 0; padding: .5rem; font: inherit; font-weight: 700; color: var(--orlop-ink, #0E1115); text-decoration: underline; cursor: pointer; min-height: 44px; }
.beleg-bar .beleg-primary { background: #0E1115; color: #fff; border: 0; border-radius: 9999px; padding: .75rem 1.5rem; font: inherit; font-weight: 800; min-height: 44px; cursor: pointer; }
.beleg-bar .beleg-primary[aria-disabled="true"] { opacity: .55; cursor: not-allowed; }
.beleg-nav { display: inline-flex; align-items: center; gap: .5rem; color: var(--orlop-text-2, #4B5563); font-size: .875rem; }
.beleg-nav button { min-width: 44px; min-height: 44px; border: 1px solid var(--orlop-line, #D8DCE4); background: #fff; border-radius: 50%; cursor: pointer; }
.beleg-drawer-backdrop { position: fixed; inset: 0; z-index: 940; background: rgba(14,17,21,.45); }
.beleg-drawer { position: fixed; top: 0; right: 0; bottom: 0; z-index: 950; width: min(440px, 100vw); background: #fff; box-shadow: -8px 0 32px rgba(14,17,21,.2); display: flex; flex-direction: column; }
.beleg-drawer header, .beleg-drawer footer { padding: 1rem 1.25rem; }
.beleg-drawer main { flex: 1; padding: 0 1.25rem; overflow: auto; }
.beleg-drawer textarea { width: 100%; min-height: 8rem; box-sizing: border-box; }
.beleg-drawer footer { display: flex; justify-content: space-between; gap: .75rem; border-top: 1px solid var(--orlop-line, #D8DCE4); }
.beleg-error { max-width: 40rem; margin: 3rem auto; text-align: left; padding: 0 1rem; }
.beleg-error h1 { font-weight: 900; letter-spacing: -0.02em; }
.beleg-done { max-width: 40rem; margin: 3rem auto; text-align: center; padding: 0 1rem; }
.beleg-toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: 5rem; z-index: 960; display: flex; align-items: center; gap: 1rem; background: #0E1115; color: #fff; padding: .75rem 1.25rem; border-radius: 9999px; box-shadow: 0 8px 24px rgba(14,17,21,.3); }
.beleg-toast button { background: none; border: 0; color: #fff; font: inherit; font-weight: 800; text-decoration: underline; cursor: pointer; min-height: 32px; }

/* R16-06: Neuigkeiten */
.news-day-more { margin-top: .75rem; }
.news-day-more summary { cursor: pointer; font-weight: 700; padding: .5rem 0; min-height: 44px; display: flex; align-items: center; }
.news-topic { margin: .75rem 0 .25rem; font-size: .8125rem; font-weight: 800; color: var(--orlop-text-2, #4B5563); }
.footer-new-chip { display: inline-block; margin-left: .35rem; padding: 0 .45rem; border-radius: 9999px; background: #0E1115; color: #fff; font-size: .75rem; font-weight: 800; line-height: 1.5; }

/* R16-03: Punkt in Textfarbe, Zeile am Handy hoechstens 80 px */
.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 { background: currentColor; }
.doc-row .dr-progress { white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
/* R53-01: Listen-Umbruch bei 1100 px */
@media (max-width: 1099px) {
  .documents-grid .doc-row { min-height: 0; padding: .5rem 1rem; gap: .5rem .75rem; }
  .documents-grid .doc-row .dr-sub { display: none; }
  .documents-grid .doc-row .dr-vendor { -webkit-line-clamp: 1; line-clamp: 1; white-space: nowrap; display: block; text-overflow: ellipsis; overflow: hidden; }
  .documents-grid .doc-row .dr-amount { align-self: center; }
  .documents-grid .doc-row .dr-amount .dr-missing { font-size: .8125rem; }
  .documents-grid .doc-row:has(.dr-due.is-overdue) { grid-template-areas: "main amount" "status status" "due due"; }
}

/* R16-05 (D-812): Dashboard im Fehlerfall */
.dash-error .step-tile .stat-value, .dash-error .step-tile .stat-sub, .dash-error .step-tile .stat-label { visibility: hidden; }
.dash-error .step-tile { position: relative; min-height: 88px; background: #F5F6F8; border-color: var(--orlop-line, #D8DCE4); box-shadow: none; }
.dash-error .step-tile::after { content: ""; position: absolute; left: 1rem; right: 1rem; top: 1.1rem; height: 14px; border-radius: 6px; background: linear-gradient(90deg, #E7EAF0 25%, #F5F6F8 50%, #E7EAF0 75%); background-size: 200% 100%; animation: r16shimmer 1.4s linear infinite; }
.dash-error .stat-chevron { display: none !important; }
.dash-error #dashZeroLine { display: none !important; }
.dash-error { padding-bottom: calc(5rem + env(safe-area-inset-bottom, 0px)); }
@media (prefers-reduced-motion: reduce) { .dash-error .step-tile::after { animation: none; } }

/* R16-02: Abweisen als Textlink, Entscheidungsleiste mit genau einer Primaeraktion */
.doc-bar-right .doc-reject-btn.beleg-reject { background: none; border: 0; padding: .5rem .75rem; min-height: 44px; font-weight: 700; text-decoration: underline; cursor: pointer; }
.doc-bar-right .doc-approve-btn { background: #0E1115; color: #fff; border-radius: 9999px; border: 0; min-height: 44px; }
body.doc-error-mode #tabDocuments > *:not(#docLoadError) { display: none !important; }
#docLoadError.beleg-error-page { max-width: 40rem; margin: 3rem auto; padding: 0 1rem; }
#docLoadError.beleg-error-page h1 { font-size: 1.75rem; font-weight: 900; letter-spacing: -0.02em; margin: 0 0 .75rem; }
#docLoadError.beleg-error-page p { color: var(--orlop-text-2, #4B5563); }
#docLoadError .beleg-error-actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.25rem; align-items: center; }

/* R16 Nacharbeit (D-863): Tab-Icons gleich hoch, aktiver Tab springt nicht */
.mshell-tab i, .mshell-tab[aria-current="page"] i { display: inline-flex; align-items: center; justify-content: center; height: 28px; box-sizing: border-box; line-height: 1; }
.mshell-tab[aria-current="page"] i { padding: 0 14px; }
/* D-864: Ueberschrift im Dashboard-Fehlerzustand sichtbar */
#tabDashboard.dash-error .upload-section .section-title, #tabDashboard.dash-error #uploadTitle { display: block !important; visibility: visible !important; }
#tabDashboard.dash-error #uploadTitle .r9b-desktop, #tabDashboard.dash-error #uploadTitle .r9b-mobile { display: inline !important; }
