/* Redesign Runde 37 (2.102.0): Einrichtungs-Checkliste, Reiterleiste der Belegliste, ehrliches Prüf-Ende, ruhige Neuigkeiten.
   Copyright © Fabian Stamminger @ The Platform Group */
:root { --r37-card-pad: 16px; --r37-head-h: 64px; }
@media (min-width: 768px) { :root { --r37-card-pad: 24px; } }

/* ---- Einstellungen: Einrichtungs-Checkliste ---- */
.setup-checklist { display: block; margin-bottom: 1.5rem; }
.setup-head { display: flex; align-items: center; gap: 1.25rem; justify-content: space-between; background: #fff; border: 1px solid #D8DCE4; border-radius: 14px; padding: var(--r37-card-pad); box-shadow: 0 1px 2px rgba(14,17,21,.04), 0 4px 14px rgba(14,17,21,.04); margin-bottom: 1rem; }
.setup-head-main { flex: 1; min-width: 0; }
.setup-count { margin: 0 0 .6rem; font-size: 1.5rem; font-weight: 900; letter-spacing: -0.02em; color: #0E1115; }
.setup-sub { margin: 0; color: #565C67; }
.setup-bar { height: 8px; border-radius: 999px; background: #E9ECF1; overflow: hidden; }
.setup-bar > span { display: block; height: 100%; background: #0E1115; border-radius: 999px; transition: width .18s ease; }
.setup-primary { flex: none; white-space: nowrap; }
.setup-head.is-complete .setup-count { margin: 0 0 .25rem; }
.setup-check { width: 3rem; height: 3rem; border-radius: 50%; background: #ECFDF5; color: #047857; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.setup-list { list-style: none; margin: 0; padding: 0; background: #fff; border: 1px solid #D8DCE4; border-radius: 14px; box-shadow: 0 1px 2px rgba(14,17,21,.04), 0 4px 14px rgba(14,17,21,.04); overflow: hidden; }
.setup-row + .setup-row { border-top: 1px solid #E9ECF1; }
.setup-link { display: flex; align-items: center; gap: 1rem; min-height: 64px; padding: .75rem var(--r37-card-pad); color: inherit; text-decoration: none; }
.setup-link:hover { background: #F5F6F8; }
.setup-mark { width: 1.5rem; height: 1.5rem; border-radius: 50%; border: 2px solid #B6BCCC; display: inline-flex; align-items: center; justify-content: center; flex: none; font-size: .75rem; }
.setup-row.is-done .setup-mark { background: #047857; border-color: #047857; color: #fff; }
.setup-row.is-open .setup-mark { border-color: #0E1115; }
.setup-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.setup-text strong { font-size: 1rem; color: #0E1115; }
.setup-text span { font-size: .875rem; color: #565C67; }
.setup-state { flex: none; font-size: .8125rem; font-weight: 600; padding: .2rem .65rem; border-radius: 999px; background: #F5F6F8; border: 1px solid #D8DCE4; color: #333840; }
.setup-row.is-done .setup-state { background: #ECFDF5; border-color: #A7F3D0; color: #047857; }
.setup-row.is-open .setup-state, .setup-row.is-check .setup-state { background: #FFFBEB; border-color: #FDE68A; color: #92400E; }
.setup-chev { color: var(--orlop-muted-text, #565C67); flex: none; }
.settings-nav-group { margin: .9rem 0 .25rem; padding: 0 .75rem; font-size: .75rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--orlop-muted-text, #565C67); }
.role-tick { color: #047857; margin-right: .25rem; }
.role-tick-no { color: var(--orlop-muted-text, #565C67); }
@media (max-width: 767px) {
  .setup-head { flex-direction: column; align-items: stretch; }
  .setup-primary { width: 100%; text-align: center; min-height: 44px; }
  .setup-link { min-height: 56px; }
  .setup-text span { display: none; }
  #tabSettings .settings-nav { display: none; }
}

/* ---- Belegliste: Reiterleiste mit Zählern ---- */
.list-seg { display: flex; align-items: center; gap: .5rem; overflow-x: auto; scrollbar-width: none; padding: 0 0 .75rem; border-bottom: 1px solid #D8DCE4; margin-bottom: .75rem; }
.list-seg::-webkit-scrollbar { display: none; }
.list-seg-tab { flex: none; display: inline-flex; align-items: center; gap: .4rem; min-height: 40px; padding: 0 .9rem; border-radius: 999px; border: 1px solid transparent; background: transparent; color: #333840; font: inherit; font-weight: 600; cursor: pointer; }
.list-seg-tab:hover { background: #F5F6F8; }
.list-seg-tab[aria-selected="true"] { background: #0E1115; color: #fff; }
.list-seg-n { font-variant-numeric: tabular-nums; font-size: .8125rem; opacity: 1; }
.list-seg-action { margin-left: auto; flex: none; }
.list-seg-extra { flex: none; }
/* R53-01: Listen-Umbruch bei 1100 px */
@media (max-width: 1099px) {
  .list-seg-tab, .list-seg-extra { flex: 0 0 auto; min-width: max-content; min-height: 44px; scroll-snap-align: center; }
  .list-seg-action { min-height: 44px; }
  .list-seg { scroll-snap-type: x proximity; scroll-padding-inline: 16px; }
}
/* R45-01: Warnreiter Überfällig: roter Punkt plus roter Zähler, flach wie die anderen Reiter, aktiv dunkle Pille */
.list-seg-extra { display: inline-flex; align-items: center; gap: .4rem; border-color: transparent; background: transparent; padding: 0 .9rem; }
.list-seg-extra::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #B42318; flex: none; }
.list-seg-extra .doc-quick-n { color: #B42318; font-weight: 700; opacity: 1; }
.list-seg-extra[aria-pressed="true"] { background: #0E1115; color: #fff; }
.list-seg-extra[aria-pressed="true"] .doc-quick-n { color: #fff; }
.dr-missing-text { color: #565C67; font-style: normal; }

/* ---- Prüf-Ende: neutral, solange etwas offen ist ---- */
.doc-done-count { width: 4rem; height: 4rem; border-radius: 50%; background: #F5F6F8; border: 1px solid #D8DCE4; color: #0E1115; display: inline-flex; align-items: center; justify-content: center; font-size: 1.5rem; font-weight: 900; margin-bottom: .75rem; }

/* ---- Karten und Kopf ---- */
.dash-columns { align-items: start; }

/* ---- Neuigkeiten ---- */
.news-version-group { margin: 0; }
.news-hotfix-note { color: #565C67; font-size: .875rem; }

/* R37-04: bei offenen Klärfällen ist der Zuordnen-Knopf die einzige dunkle Pille, Hochladen wird Outline */
body.has-clarify #dashUploadBtn { background: #fff; color: #0E1115; border: 1px solid #0E1115; }


/* R37-07: Neuigkeiten, Sticky-Leiste unter dem Kopf, dünne Kante in Linienfarbe */
@media (min-width: 1700px) {
  #newsList .news-entry > .news-entry-meta { top: calc(var(--chrome-h, 64px) + 16px); border-left: 1px solid #D8DCE4; padding-left: 16px; }
}

/* ---- R37 Nacharbeit (2.102.1) ---- */
/* D-1809: Belegliste mit Spalte Unternehmen passt in 1440 ohne Quer-Scrollen */
@media (min-width: 1100px) {
  .documents-grid .doc-table.has-co .doc-thead, .documents-grid .doc-table.has-co .doc-row { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) minmax(0, 150px) minmax(80px, 110px) minmax(80px, 110px) minmax(120px, 170px) 120px !important; column-gap: 16px !important; }
  .documents-grid .doc-table, .documents-grid, .list-seg { max-width: 100%; min-width: 0; box-sizing: border-box; }
}
.documents-grid { grid-template-columns: minmax(0, 1fr); }
/* D-1810/D-1811: Zuordnen-Knopf ist die einzige dunkle Pille, Titel wird nicht abgeschnitten */
#dashboardWaiting .dash-waiting-head { flex-wrap: wrap; row-gap: 8px; }
#dashboardWaiting #dashWaitingTitle { flex: none; white-space: nowrap; overflow: visible; text-overflow: clip; }
#dashWaitingAssignHint { display: none; }
body.has-clarify #dashWaitingAssign { background: #0E1115; color: #fff; border: 1px solid #0E1115; border-radius: 9999px; font-weight: 700; }
body.has-clarify #dashWaitingAll { background: #fff; color: #0E1115; border: 1px solid #0E1115; }
/* D-1813: Ausgangsrechnungen, Kopf wie auf allen Seiten */
.oi-wrap > .oi-card:first-child { background: transparent; box-shadow: none; padding: 0; }
/* D-1815: Neuigkeiten, dünne Kante in Linienfarbe auch unter 1700 px */
#newsList .news-entry .news-entry-body, #newsList .news-entry--lead .news-entry-body, #newsList .news-entry--compact .news-entry-body { border-left: 1px solid #D8DCE4; }
