/* Design "Edel" - Seitengruppe nachweise. Nur aktiv bei DESIGN_STIL == edel (eingebunden in base.html).
   Tokens und Bausteine: design-edel.css, Regeln: SPEZ.md. Jede Regel beginnt mit der Body-Klasse (.seite-nw-*).
   Seiten: Dienstanweisungen, Unterweisungen (Kopfband + Aktenzeilen), Zuweisen, Revisions-Verlauf (Zeitleiste),
   Nachweis (Beleg + Datenblatt), Dokument-Bestaetigungen, Schulungsmatrix (Register, Statuslinien, feste
   Namensspalte), Unterschriften-Uebersicht. Arbeitsseiten bleiben bildfrei (SPEZ 6). Kein Markup neu, nur CSS. */

/* =========================================================================================================
   1  Kopfbaender (nur die zwei Uebersichten)
   ========================================================================================================= */
.seite-nw-dienstanweisungen {
    --we-kopfband: url('/static/img/edel/ausstehend.webp'); --we-kopfband-anzeige: block; --we-kopfband-fokus: 50% 9%;
}
/* Fokus 12 %: am Handy-Band (≈ 4:1) stehen Helme und Gesichter ganz im Bild statt Nacken und Ruecken
   (Motiv: Koepfe bei 9-37 % der Bildhoehe); die Desktop-Kachel (≈ 3:2) schneidet vertikal nicht. */
.seite-nw-unterweisungen {
    --we-kopfband: url('/static/img/edel/mitarbeiter.webp'); --we-kopfband-anzeige: block; --we-kopfband-fokus: 50% 12%;
}

/* =========================================================================================================
   2  Kartenkoepfe mit <strong>-Titel wie die Basis-Kartentitel (Fraunces), Bedeutung bleibt
   ========================================================================================================= */
.seite-nw-dienstanweisungen .card-header > strong,
.seite-nw-dienstanweisungen .card-header > .d-flex > strong,
.seite-nw-unterweisungen .card-header > strong,
.seite-nw-unterweisungen .card-header > .d-flex > strong,
.seite-nw-nachweis .card-header > strong,
.seite-nw-zuweisen .card-header > strong,
.seite-nw-verlauf main > .card > .card-header {
    font-family: var(--we-serif); font-weight: 540; font-size: 1.2rem; color: var(--we-tinte); letter-spacing: -.006em;
    line-height: 1.3;
}
.seite-nw-nachweis .card-header > strong > i,
.seite-nw-verlauf main > .card > .card-header > i { font-size: .85em; color: var(--we-marke); }
.seite-nw-dienstanweisungen .card-header > .d-flex,
.seite-nw-unterweisungen .card-header > .d-flex { flex-wrap: wrap; gap: .5rem 1rem; }

/* =========================================================================================================
   3  Dokumentlisten als Aktenzeilen (Dienstanweisungen / Unterweisungen)
      Statusstreifen links: Pflicht = Gefahr-Kante (wie Etikett "Pflicht"), Optional = Info, Archiviert = grau.
      Text oben volle Breite, Knopfleiste bricht darunter um (Reihenfolge unveraendert).
   ========================================================================================================= */
.seite-nw-dienstanweisungen .scroll-list,
.seite-nw-unterweisungen .scroll-list { padding: 3px; }
.seite-nw-dienstanweisungen .scroll-list > .list-group-item,
.seite-nw-unterweisungen .scroll-list > .list-group-item {
    background: var(--we-flaeche); border: 1px solid var(--we-linie); border-left: 4px solid var(--we-gefahr-kante);
    border-radius: var(--we-rund-klein); padding: 1rem 1.1rem 1.05rem 1.1rem; margin-bottom: .7rem; color: var(--we-text);
}
.seite-nw-dienstanweisungen .scroll-list > .list-group-item:has(.badge.bg-info),
.seite-nw-unterweisungen .scroll-list > .list-group-item:has(.badge.bg-info) { border-left-color: var(--we-info-kante); }
.seite-nw-dienstanweisungen .scroll-list > .list-group-item:has(.badge.bg-secondary),
.seite-nw-unterweisungen .scroll-list > .list-group-item:has(.badge.bg-secondary) { border-left-color: var(--we-linie-stark); background: var(--we-papier); }
.seite-nw-dienstanweisungen .scroll-list > .list-group-item > .d-flex,
.seite-nw-unterweisungen .scroll-list > .list-group-item > .d-flex { flex-wrap: wrap; gap: .85rem 1.25rem; }
.seite-nw-dienstanweisungen .scroll-list > .list-group-item > .d-flex > .me-3,
.seite-nw-unterweisungen .scroll-list > .list-group-item > .d-flex > .me-3 { flex: 1 1 15rem; min-width: 0; margin-right: 0 !important; }
.seite-nw-dienstanweisungen .scroll-list > .list-group-item > .d-flex > .d-flex.gap-2,
.seite-nw-unterweisungen .scroll-list > .list-group-item > .d-flex > .d-flex.gap-2 { flex: 0 1 auto; min-width: 0; }
/* Titel wie ein Aktendeckel: Serif, Etiketten bleiben Sans */
.seite-nw-dienstanweisungen .scroll-list .me-3 > .fw-semibold:first-child,
.seite-nw-unterweisungen .scroll-list .me-3 > .fw-semibold:first-child {
    font-family: var(--we-serif); font-size: 1.15rem; font-weight: 560; line-height: 1.3; color: var(--we-tinte);
    overflow-wrap: break-word; -webkit-hyphens: auto; hyphens: auto; margin-bottom: .2rem;
}
.seite-nw-dienstanweisungen .scroll-list .me-3 .badge,
.seite-nw-unterweisungen .scroll-list .me-3 .badge { font-family: var(--we-sans); vertical-align: .12em; }
.seite-nw-dienstanweisungen .scroll-list .me-3 > .small.text-muted:not(.mt-1),
.seite-nw-unterweisungen .scroll-list .me-3 > .small.text-muted:not(.mt-1) { color: var(--we-text) !important; font-size: .9375rem; }
.seite-nw-dienstanweisungen .scroll-list .me-3 > .small.mt-1,
.seite-nw-unterweisungen .scroll-list .me-3 > .small.mt-1 { margin-top: .55rem !important; line-height: 1.75; }
.seite-nw-dienstanweisungen .scroll-list .me-3 > .small.mt-1 > i,
.seite-nw-unterweisungen .scroll-list .me-3 > .small.mt-1 > i { color: var(--we-leise); opacity: .8; font-size: .85em; }
.seite-nw-dienstanweisungen .scroll-list > .list-group-item:has(.badge.bg-secondary) .me-3 > .fw-semibold:first-child,
.seite-nw-unterweisungen .scroll-list > .list-group-item:has(.badge.bg-secondary) .me-3 > .fw-semibold:first-child { color: var(--we-text); }
/* ein ruhiger Auftakt fuer die Liste (zusammen mit dem Seitenkopf der Basis <= .45 s) */
@media (prefers-reduced-motion: no-preference) {
    .seite-nw-dienstanweisungen .scroll-list > .list-group-item,
    .seite-nw-unterweisungen .scroll-list > .list-group-item { animation: we-auf .36s var(--we-ease) .06s both; }
}

/* Dokument-Matrix unten: Namensspalte deckend auf Kartenflaeche (live #fff), Kopf bleibt Nacht */
html body.seite-nw-dienstanweisungen #instructionsMatrixTable tbody td.sticky-col,
html body.seite-nw-unterweisungen #instructionsMatrixTable tbody td.sticky-col { background: var(--we-flaeche); }
html body.seite-nw-dienstanweisungen #instructionsMatrixTable tbody td.sticky-col,
html body.seite-nw-unterweisungen #instructionsMatrixTable tbody td.sticky-col { border-right: 1px solid var(--we-linie-stark); }
.seite-nw-dienstanweisungen .instruction-employee-email,
.seite-nw-unterweisungen .instruction-employee-email { overflow-wrap: anywhere; }
.seite-nw-dienstanweisungen #instructionsMatrixTable .small.text-muted,
.seite-nw-unterweisungen #instructionsMatrixTable .small.text-muted { font-variant-numeric: tabular-nums; }
@media (max-width: 767.98px) {
    /* Suche ueber der Liste: Feld volle Breite, Status + Suchen darunter je halb (live "Suc-hen" in 2/12) */
    .seite-nw-dienstanweisungen .card-body > form.row > .col-7,
    .seite-nw-unterweisungen .card-body > form.row > .col-7 { width: 100%; }
    .seite-nw-dienstanweisungen .card-body > form.row > .col-3,
    .seite-nw-dienstanweisungen .card-body > form.row > .col-2,
    .seite-nw-unterweisungen .card-body > form.row > .col-3,
    .seite-nw-unterweisungen .card-body > form.row > .col-2 { width: 50%; }
    /* Dokument-Matrix: feste Namensspalte schmaler (live 220 px von ~300 px), Status bleibt sichtbar */
    html body.seite-nw-dienstanweisungen #instructionsMatrixTable th.sticky-col,
    html body.seite-nw-unterweisungen #instructionsMatrixTable th.sticky-col { min-width: 9.5rem !important; }
    html body.seite-nw-dienstanweisungen #instructionsMatrixTable td.sticky-col,
    html body.seite-nw-unterweisungen #instructionsMatrixTable td.sticky-col { max-width: 11rem; }
    html body.seite-nw-dienstanweisungen #instructionsMatrixTable th.text-center,
    html body.seite-nw-unterweisungen #instructionsMatrixTable th.text-center { min-width: 9.5rem !important; }
}

/* =========================================================================================================
   4  Zuweisen (Dokument -> Mitarbeiter, Mitarbeiter -> Dokumente): Statuskante links in der Zeile
   ========================================================================================================= */
.seite-nw-zuweisen #assignForm .table > :is(thead, tbody) > tr > :first-child { border-left: 3px solid transparent; }
.seite-nw-zuweisen #employeeTable > tbody > tr:has(> td:nth-child(4) > .badge.bg-success) > td:first-child,
.seite-nw-zuweisen #assignForm table:not(#employeeTable) > tbody > tr:has(> td:nth-child(5) > .badge.bg-success) > td:first-child { border-left-color: var(--we-erfolg-kante); }
.seite-nw-zuweisen #employeeTable > tbody > tr:has(> td:nth-child(4) > .badge.bg-warning) > td:first-child,
.seite-nw-zuweisen #assignForm table:not(#employeeTable) > tbody > tr:has(> td:nth-child(5) > .badge.bg-warning) > td:first-child { border-left-color: var(--we-warn-kante); }
.seite-nw-zuweisen #employeeTable > tbody > tr:has(> td:nth-child(5) .text-danger) > td:first-child,
.seite-nw-zuweisen #assignForm table:not(#employeeTable) > tbody > tr:has(> td:nth-child(6) .text-danger) > td:first-child { border-left-color: var(--we-gefahr-kante); }
.seite-nw-zuweisen #assignForm .table .form-check-input { width: 1.25rem; height: 1.25rem; margin-top: 0; vertical-align: middle; }
.seite-nw-zuweisen #assignForm .table td .fw-semibold { color: var(--we-tinte); }
.seite-nw-zuweisen #assignForm .table td > span.small { white-space: nowrap; font-variant-numeric: tabular-nums; }
.seite-nw-zuweisen #assignForm > .mt-3 { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 0; }
/* Mitarbeiter-Kontext als ruhiges Datenblatt */
.seite-nw-zuweisen .card-body > p:has(> strong:first-child) { padding: .5rem 0; margin: 0 !important; border-top: 1px solid var(--we-linie); color: var(--we-tinte); }
.seite-nw-zuweisen .card-body > p:has(> strong:first-child):first-child { border-top: 0; padding-top: 0; }
.seite-nw-zuweisen .card-body > p > strong:first-child { font-size: .875rem; font-weight: 600; color: var(--we-leise); }

/* =========================================================================================================
   5  Revisions-Verlauf: Kennwerte + Zeitleiste in der Versionsspalte (reine Deko, kein neues Markup)
   ========================================================================================================= */
.seite-nw-verlauf main > .card.mb-3 .row { row-gap: .75rem; }
.seite-nw-verlauf main > .card.mb-3 .row > div {
    font-family: var(--we-serif); font-size: 1.6rem; font-weight: 500; line-height: 1.2; color: var(--we-tinte);
    font-variant-numeric: lining-nums tabular-nums;
}
.seite-nw-verlauf main > .card.mb-3 .row > div > strong {
    display: block; font-family: var(--we-sans); font-size: .9rem; font-weight: 600; color: var(--we-leise); margin-bottom: .3rem;
}
.seite-nw-verlauf main > .card.mb-3 .row > div > .badge { font-size: 1.05rem; vertical-align: .1em; }
.seite-nw-verlauf .table > tbody > tr > td:first-child { position: relative; padding-left: 2.2rem; white-space: nowrap; }
.seite-nw-verlauf .table > tbody > tr > td:first-child::before {
    content: ''; position: absolute; left: 1.05rem; top: 0; bottom: 0; width: 1px; background: var(--we-linie-stark);
}
.seite-nw-verlauf .table > tbody > tr:first-child > td:first-child::before { top: 50%; }
.seite-nw-verlauf .table > tbody > tr:last-child > td:first-child::before { bottom: 50%; }
.seite-nw-verlauf .table > tbody > tr:only-child > td:first-child::before { display: none; }
.seite-nw-verlauf .table > tbody > tr > td:first-child::after {
    content: ''; position: absolute; left: calc(1.05rem - 5px); top: 50%; width: 11px; height: 11px; margin-top: -5.5px;
    border-radius: 50%; background: var(--we-flaeche); border: 2px solid var(--we-rahmen);
}
.seite-nw-verlauf .table > tbody > tr:has(> td:first-child .badge.bg-primary) > td:first-child::after { background: var(--we-marke); border-color: var(--we-marke); }
.seite-nw-verlauf .table > tbody > tr:has(.badge.bg-danger) > td:first-child::after { border-color: var(--we-gefahr-kante); }
.seite-nw-verlauf .table > thead > tr > th:first-child { padding-left: 2.2rem; }
.seite-nw-verlauf .table td.small { font-size: .875rem; }
@media (max-width: 767.98px) {
    .seite-nw-verlauf main > .card.mb-3 .row > .col-md-6 { flex: 0 0 50%; max-width: 50%; }
    .seite-nw-verlauf main > .card.mb-3 .row > div { font-size: 1.4rem; }
}

/* =========================================================================================================
   6  Nachweis (Beleg): Statuskante an der Unterschriftskarte, Signatur auf Papier, Datenblatt IP/Agent/Hash
   ========================================================================================================= */
.seite-nw-nachweis .col-lg-4 > .card:has(.alert-success) { border-top: 3px solid var(--we-erfolg-kante); }
.seite-nw-nachweis .col-lg-4 > .card:has(.alert-warning) { border-top: 3px solid var(--we-warn-kante); }
html body.seite-nw-nachweis img[alt="Digitale Unterschrift"] {
    border: 1px solid var(--we-linie-stark) !important; border-radius: var(--we-rund-klein) !important; background: #fff !important;
    padding: .6rem .75rem; display: block;
}
.seite-nw-nachweis .col-lg-4 .card-body > .small:last-child > .mb-1 {
    display: grid; grid-template-columns: 6.25rem minmax(0, 1fr); gap: .75rem; align-items: baseline;
    padding: .55rem 0; margin: 0 !important; border-top: 1px solid var(--we-linie); color: var(--we-tinte);
}
.seite-nw-nachweis .col-lg-4 .card-body > .small:last-child > .mb-1 > strong { color: var(--we-leise); font-weight: 600; }
.seite-nw-nachweis .col-lg-4 .card-body > .small:last-child > .mb-1 > .text-muted { color: var(--we-text) !important; }
.seite-nw-nachweis .col-lg-4 .card-body code { color: var(--we-text); font-size: .8125rem; line-height: 1.5; }
html body.seite-nw-nachweis iframe {
    border: 1px solid var(--we-linie-stark) !important; border-radius: var(--we-rund-klein) !important; background: var(--we-flaeche-2);
}
.seite-nw-nachweis .instruction-content { max-width: 72ch; }
/* Druck der Nachweisseiten (Audit-Unterlagen): ohne Menue, Inhalt volle Blattbreite - nur im Druck */
@media print {
    html body.seite-nw-nachweis nav.sidebar, html body.seite-nw-verlauf nav.sidebar, html body.seite-nw-unterschriften nav.sidebar,
    html body.seite-nw-bestaetigungen nav.sidebar, html body.seite-nw-matrix nav.sidebar { display: none !important; }
    html body.seite-nw-nachweis main, html body.seite-nw-verlauf main, html body.seite-nw-unterschriften main,
    html body.seite-nw-bestaetigungen main, html body.seite-nw-matrix main {
        flex: 0 0 100% !important; width: 100% !important; max-width: 100% !important; margin-left: 0 !important;
        padding-left: 0 !important; padding-right: 0 !important;
    }
    html body.seite-nw-nachweis main > .d-flex.border-bottom, html body.seite-nw-verlauf main > .d-flex.border-bottom,
    html body.seite-nw-unterschriften main > .d-flex.border-bottom, html body.seite-nw-bestaetigungen main > .d-flex.border-bottom { padding-top: .5rem !important; }
}
@media print {
    html body.seite-nw-nachweis img[alt="Digitale Unterschrift"] { border-color: #000 !important; }
    .seite-nw-nachweis .col-lg-4 .card-body > .small:last-child > .mb-1 { border-top-color: #999; }
    .seite-nw-nachweis .col-lg-4 > .card { border-top-width: 1px; }
}

/* =========================================================================================================
   7  Dokument-Bestaetigungen: fehlendes Titelsymbol (fa-file-check gibt es in FA 6 nicht -> leeres Siegel),
      Namensspalte bleibt beim seitlichen Scrollen stehen
   ========================================================================================================= */
.seite-nw-bestaetigungen main > .d-flex.border-bottom h1 > i.fa-file-check::before { content: "\f46c"; }
.seite-nw-bestaetigungen .table-responsive > .table > tbody > tr > td:first-child,
.seite-nw-bestaetigungen .table-responsive > .table > thead > tr > th:first-child {
    position: sticky; left: 0; z-index: 1; border-right: 1px solid var(--we-linie);
}
.seite-nw-bestaetigungen .table-responsive > .table > tbody > tr > td:first-child { background-color: var(--we-flaeche); }
.seite-nw-bestaetigungen .table-responsive > .table > thead > tr > th:first-child { z-index: 2; }
.seite-nw-bestaetigungen .table-responsive > .table > tbody > tr > td:not(:first-child) small { font-variant-numeric: tabular-nums; }
.seite-nw-bestaetigungen .card-body > .d-flex.gap-4 > div { display: flex; align-items: center; flex-wrap: wrap; gap: .25rem 0; }

/* =========================================================================================================
   8  Unterschriften-Uebersicht: Signaturen auf weissem Papier, Suchknoepfe in einer Zeile
   ========================================================================================================= */
html body.seite-nw-unterschriften img[alt="Signatur"] {
    background: #fff; border: 1px solid var(--we-linie-stark); border-radius: var(--we-rund-etikett); padding: 3px 8px;
}
.seite-nw-unterschriften form[method="get"] .row > .col-md-2 { display: flex; flex-wrap: wrap; gap: .5rem; }
.seite-nw-unterschriften form[method="get"] .row > .col-md-2 > .ms-1 { margin-left: 0 !important; }
@media (min-width: 768px) {
    .seite-nw-unterschriften form[method="get"] .row > .col-md-2 { flex: 0 0 auto; width: auto; }
}
.seite-nw-unterschriften .card-header .card-title > .badge { font-family: var(--we-sans); vertical-align: .15em; }
@media print {
    html body.seite-nw-unterschriften img[alt="Signatur"] { border-color: #999; }
}

/* =========================================================================================================
   9  Schulungsmatrix (admin/employee_progress_matrix): Titel-Look wie Seitenkopf (Symbol als Siegel),
      Kennzahlen als Haarlinien-Kacheln mit Status-Siegel, heller Register-Kopf der Basis,
      ruhige Initialen statt Lila-Verlauf, Statuslinie oben je Zelle, kein Pulsieren/Zoomen,
      Namensspalte deckend und am Handy allein fest. Die Seite bringt eigene <style>-Regeln im <body> mit
      (spaeter geladen), darum hier bewusst hoehere Spezifitaet (html body.seite-nw-matrix #trainingMatrixTable).
   ========================================================================================================= */
/* Titel-Look (kein .d-flex.border-bottom-Kopf auf dieser Seite) */
.seite-nw-matrix main > .container-fluid > .row:first-child { position: relative; padding-bottom: 1rem; margin-bottom: 1.75rem; }
.seite-nw-matrix main > .container-fluid > .row:first-child::before {
    content: ''; position: absolute; left: calc(var(--bs-gutter-x) * .5); right: calc(var(--bs-gutter-x) * .5); bottom: 0;
    height: 1px; background: var(--we-linie-stark);
}
.seite-nw-matrix main > .container-fluid > .row:first-child::after {
    content: ''; position: absolute; left: calc(var(--bs-gutter-x) * .5); bottom: -1px; width: 56px; height: 3px; background: var(--we-marke);
}
.seite-nw-matrix main > .container-fluid > .row:first-child h2 {
    font-size: clamp(1.75rem, 1.35rem + 1.2vw, 2.4rem); margin: 0 0 .35rem; overflow-wrap: break-word; -webkit-hyphens: auto; hyphens: auto;
}
.seite-nw-matrix main > .container-fluid > .row:first-child p.text-muted { margin: 0; }
/* Titelzeichen (Emoji im Text, bleibt Text) als Siegel wie das Symbol der uebrigen Seitenkoepfe: Kreis mit
   Haarlinie, Zeichen klein und grau (grayscale wirkt auf die Tinte des Titels praktisch nicht).
   flow-root haelt das Siegel im Titel, damit der Untertitel bei einzeiligem Titel nicht daneben rutscht. */
html body.seite-nw-matrix main > .container-fluid > .row:first-child h2 { display: flow-root; filter: grayscale(1); }
html body.seite-nw-matrix main > .container-fluid > .row:first-child h2::first-letter {
    float: left; font-size: 1.05rem; line-height: 2.5rem; padding: 0 .68rem; margin: 0 .8rem 0 0;
    border: 1px solid var(--we-linie-stark); border-radius: 50%; background: var(--we-flaeche);
}
/* Kartentitel "📋 Schulungs-Matrix": das Zeichen zeichnet FontAwesome (U+1F4CB = Klemmbrett) in Firmenfarbe wie die
   Kartensymbole der Basis; ohne geladene FA-Schrift bleibt es das Emoji wie live. */
html body.seite-nw-matrix main .card-header > h5::first-letter {
    font-family: "Font Awesome 6 Free"; font-weight: 900; font-size: .85em; color: var(--we-marke);
}

/* Kennzahlen (live Farbflaechen, Basis: Papierkarte mit 3-px-Statuskante) wie die uebrigen Dashboards:
   Haarlinie rundum, gleiche Hoehe, Symbol als Siegel oben rechts in Statusfarbe (Farbe aus der Basis). */
html body.seite-nw-matrix main > .container-fluid > .row > .col-md-3 > .card.text-white[class*="bg-"] {
    height: 100%; border-top: 1px solid var(--we-linie) !important;
}
html body.seite-nw-matrix main > .container-fluid > .row > .col-md-3 > .card.text-white[class*="bg-"] > .card-body { position: relative; }
html body.seite-nw-matrix main > .container-fluid > .row > .col-md-3 > .card.text-white[class*="bg-"] > .card-body > .d-flex > div:first-child { min-width: 0; }
html body.seite-nw-matrix main > .container-fluid > .row > .col-md-3 > .card.text-white[class*="bg-"] > .card-body > .d-flex > div:first-child > h4 { padding-right: 3.25rem; }
html body.seite-nw-matrix main > .container-fluid > .row > .col-md-3 > .card.text-white[class*="bg-"] > .card-body > .d-flex > .align-self-center {
    position: absolute; top: 1rem; right: 1rem;
}
html body.seite-nw-matrix main > .container-fluid > .row > .col-md-3 > .card.text-white[class*="bg-"] i.fa-2x {
    width: 44px; height: 44px; display: grid; place-items: center; font-size: 1rem; border-radius: 50%; opacity: 1;
    background: var(--we-flaeche); border: 1px solid var(--we-linie-stark);
}
/* Tablet und kleiner Laptop: vier Spalten waeren ~150 px schmal ("3 6 . 1 %" zeichenweise) -> 2 x 2, Reihenfolge bleibt */
@media (min-width: 768px) and (max-width: 1199.98px) {
    .seite-nw-matrix main > .container-fluid > .row:has(> .col-md-3 > .card.text-white[class*="bg-"]) { --bs-gutter-y: 1.5rem; }
    .seite-nw-matrix main > .container-fluid > .row:has(> .col-md-3 > .card.text-white[class*="bg-"]) > .col-md-3 { flex: 0 0 auto; width: 50%; }
    /* Filterzeile ebenso 2 x 2 (Firmen-Etikett lief sonst in das Statusfeld, Auswahlen abgeschnitten) */
    .seite-nw-matrix .card-body > .row:has(#statusFilter) { --bs-gutter-y: 1rem; }
    .seite-nw-matrix .card-body > .row:has(#statusFilter) > .col-md-3 { flex: 0 0 auto; width: 50%; }
    /* Kartenkopf der Matrix: Knoepfe rutschen unter den Titel, statt "Excel / Export" zu brechen */
    .seite-nw-matrix main .card-header.d-flex:has(> .btn-group) { flex-wrap: wrap; gap: .5rem 1rem; }
    .seite-nw-matrix main .card-header.d-flex > .btn-group > .btn { white-space: nowrap; }
}
@media (prefers-reduced-motion: no-preference) {
    .seite-nw-matrix main > .container-fluid > .row:first-child { animation: we-auf .36s var(--we-ease) both; }
}
.seite-nw-matrix main > .container-fluid > .row:nth-child(2) .form-label { font-weight: 600; color: var(--we-tinte); }

/* Register-Kopf: Farben (heller Kopf, Titel in Tinte) kommen seit 19.11. aus der Basis, hier nur Schrift */
html body.seite-nw-matrix #trainingMatrixTable thead th { font-size: .8125rem; font-weight: 600; letter-spacing: .005em; }
html body.seite-nw-matrix #trainingMatrixTable thead .course-title { font-size: .875rem; line-height: 1.3; }

/* Koerper: oben ausrichten (Name steht neben der ersten Zeile, nicht in der Mitte einer hohen Zelle) */
html body.seite-nw-matrix #trainingMatrixTable > tbody > tr > td { vertical-align: top; }
html body.seite-nw-matrix #trainingMatrixTable tbody tr:hover { transform: none; transition: none; }
html body.seite-nw-matrix #trainingMatrixTable tbody tr:nth-child(even) { background-color: #f8f7f3; }
html body.seite-nw-matrix #trainingMatrixTable tbody td.sticky-col { background-color: var(--we-flaeche) !important; }
html body.seite-nw-matrix #trainingMatrixTable tbody tr:nth-child(even) > td.sticky-col { background-color: #f8f7f3 !important; }
html body.seite-nw-matrix #trainingMatrixTable tbody td.sticky-col.col-1 { border-right: 1px solid var(--we-linie-stark); }

/* Initialen: ruhiges Siegel in Firmenfarbe statt Lila-Verlauf */
.seite-nw-matrix .avatar-circle {
    background: var(--we-marke-zart); color: var(--we-marke); border: 1px solid var(--we-linie-stark);
    font-family: var(--we-serif); font-weight: 560; font-size: 1.05rem; flex: 0 0 auto;
}
html body.seite-nw-matrix #trainingMatrixTable td.col-1 strong { font-size: .9375rem; color: var(--we-tinte); }
html body.seite-nw-matrix #trainingMatrixTable td.col-1 .d-flex { align-items: flex-start !important; }

/* Kurszellen als kleines Datenblatt: Begriff leise, Wert dunkel, Haarlinie dazwischen */
html body.seite-nw-matrix #trainingMatrixTable td.course-cell { min-width: 11.5rem; max-width: 14rem; padding: .5rem .55rem !important; }
html body.seite-nw-matrix #trainingMatrixTable .course-status-info { font-size: .8125rem !important; padding: 0 !important; line-height: 1.35; }
html body.seite-nw-matrix #trainingMatrixTable .course-status-info > .mb-1 { margin: 0 !important; padding: .32rem 0; border-top: 1px solid var(--we-linie); }
html body.seite-nw-matrix #trainingMatrixTable .course-status-info > .mb-1:first-child { border-top: 0; padding-top: .15rem; }
html body.seite-nw-matrix #trainingMatrixTable .course-status-info strong { font-size: .75rem !important; font-weight: 600; color: var(--we-leise); }
html body.seite-nw-matrix #trainingMatrixTable .course-status-info .text-muted { font-size: .8125rem !important; color: var(--we-text) !important; }
html body.seite-nw-matrix #trainingMatrixTable .course-status-info small.text-muted { font-size: .75rem !important; color: var(--we-leise) !important; }
html body.seite-nw-matrix #trainingMatrixTable .course-status-info .text-info { font-size: .8125rem !important; }
html body.seite-nw-matrix #trainingMatrixTable .course-cell .badge,
html body.seite-nw-matrix #trainingMatrixTable .instr-cell .badge { font-size: .75rem !important; padding: .22em .5em !important; white-space: normal; }
html body.seite-nw-matrix #trainingMatrixTable .course-cell .btn {
    font-size: .8125rem !important; padding: .3rem .55rem !important; line-height: 1.3;
}
/* kein Pulsieren, kein Zoomen an Etiketten (live: pulse 2s infinite, scale 1.1) */
html body.seite-nw-matrix .badge { animation: none !important; }
html body.seite-nw-matrix #trainingMatrixTable .course-cell .badge:hover { transform: none; box-shadow: none; }
html body.seite-nw-matrix #trainingMatrixTable .course-cell .badge[data-action]:hover { text-decoration: underline; }

/* Statuslinie oben je Zelle: Farbe + Etikettentext (eindeutig auch ohne Farbe) */
html body.seite-nw-matrix #trainingMatrixTable td.course-cell:has(> .course-status-info > .mb-1:first-child > .badge.bg-success),
html body.seite-nw-matrix #trainingMatrixTable td.instr-cell:has(> .badge.bg-success) {
    box-shadow: inset 0 3px 0 var(--we-erfolg-kante), inset 0 0 0 9999px var(--bs-table-accent-bg);
}
html body.seite-nw-matrix #trainingMatrixTable td.course-cell:has(> .course-status-info > .mb-1:first-child > .badge.bg-warning),
html body.seite-nw-matrix #trainingMatrixTable td.instr-cell:has(> .badge.bg-warning) {
    box-shadow: inset 0 3px 0 var(--we-warn-kante), inset 0 0 0 9999px var(--bs-table-accent-bg);
}
html body.seite-nw-matrix #trainingMatrixTable td.course-cell:has(> .course-status-info > .mb-1:first-child > .badge.bg-secondary),
html body.seite-nw-matrix #trainingMatrixTable td.instr-cell:has(> .badge.bg-info) {
    box-shadow: inset 0 3px 0 var(--we-info-kante), inset 0 0 0 9999px var(--bs-table-accent-bg);
}
html body.seite-nw-matrix #trainingMatrixTable td.instr-cell:has(> .badge.bg-danger) {
    box-shadow: inset 0 3px 0 var(--we-gefahr-kante), inset 0 0 0 9999px var(--bs-table-accent-bg);
}
html body.seite-nw-matrix #trainingMatrixTable td.instr-cell { min-width: 9rem; padding-top: .6rem; }

/* Scrollbereich: ruhige Leiste statt Grau-Kugel */
.seite-nw-matrix .matrix-scroll { border: 1px solid var(--we-linie); border-radius: var(--we-rund-klein); }
.seite-nw-matrix .matrix-scroll::-webkit-scrollbar-track { background: var(--we-flaeche-2); border-radius: 0; }
.seite-nw-matrix .matrix-scroll::-webkit-scrollbar-thumb { background: var(--we-rahmen); border-radius: 6px; border: 3px solid var(--we-flaeche-2); }
.seite-nw-matrix .matrix-scroll::-webkit-scrollbar-thumb:hover { background: var(--we-leise); }
.seite-nw-matrix #trainingMatrixTable { margin-bottom: 0; }

/* Handy: nur die Namensspalte bleibt stehen (live verdecken drei feste Spalten die ganze Breite),
   Schrift lesbar statt 8 px */
@media (max-width: 767.98px) {
    html body.seite-nw-matrix #trainingMatrixTable { font-size: .8125rem; }
    html body.seite-nw-matrix #trainingMatrixTable thead th.sticky-col:not(.col-1),
    html body.seite-nw-matrix #trainingMatrixTable tbody td.sticky-col:not(.col-1) { left: auto; }
    html body.seite-nw-matrix #trainingMatrixTable tbody td.sticky-col:not(.col-1) { position: static; }
    /* Kopf "Mitarbeiter" bleibt oben: die uebrigen Kopfzellen (E-Mail, Gesamt, Firma) kleben weiter nach oben
       (z-index 10 wie th.col-1, im DOM spaeter) und uebermalten sonst beim seitlichen Scrollen die feste Zelle. */
    html body.seite-nw-matrix #trainingMatrixTable thead th.sticky-col.col-1 { z-index: 12; }
    html body.seite-nw-matrix #trainingMatrixTable thead th.sticky-col:not(.col-1) { z-index: 9; }
    /* sichtbare Kante der festen Spalte (border-collapse: der Zellrand scrollt sonst mit weg) */
    html body.seite-nw-matrix .table#trainingMatrixTable > thead.table-dark > tr > th.sticky-col.col-1 {
        box-shadow: inset 0 -1px 0 var(--we-linie-stark), inset -1px 0 0 var(--we-linie-stark);
    }
    html body.seite-nw-matrix #trainingMatrixTable tbody td.sticky-col.col-1 { box-shadow: inset -1px 0 0 var(--we-linie-stark); }
    /* Excel Export (Link) und Aktualisieren (Knopf) im Kartenkopf: Text mittig im 44-px-Knopf
       (live-Regel .btn-group .btn setzt .25rem Innenabstand, der Link stand dadurch oben) */
    html body.seite-nw-matrix main .card-header > .btn-group > .btn { padding-top: .6875rem; padding-bottom: .6875rem; line-height: 1.25; }
    /* Kennzahlen: Siegel kleiner oben rechts, Zahl darunter mit voller Breite (wie die Firmen-Dashboard-Kacheln am
       Handy; daneben brach "50.0 %" um, "100.0%" waere noch breiter), Beschriftung darunter */
    html body.seite-nw-matrix main > .container-fluid > .row > .col-md-3 > .card.text-white[class*="bg-"] > .card-body > .d-flex > .align-self-center { top: .7rem; right: .7rem; }
    html body.seite-nw-matrix main > .container-fluid > .row > .col-md-3 > .card.text-white[class*="bg-"] > .card-body > .d-flex > div:first-child { padding-top: 2.4rem; }
    html body.seite-nw-matrix main > .container-fluid > .row > .col-md-3 > .card.text-white[class*="bg-"] > .card-body > .d-flex > div:first-child > h4 { padding-right: 0; }
    html body.seite-nw-matrix main > .container-fluid > .row > .col-md-3 > .card.text-white[class*="bg-"] i.fa-2x { width: 36px; height: 36px; font-size: .85rem; }
    html body.seite-nw-matrix #trainingMatrixTable .sticky-col.col-1 { min-width: 9.75rem; max-width: 11.5rem; }
    html body.seite-nw-matrix #trainingMatrixTable thead th.sticky-col:not(.col-1) { min-width: 9rem; }
    html body.seite-nw-matrix #trainingMatrixTable td.col-1 .d-flex { flex-direction: column; gap: .35rem; }
    .seite-nw-matrix .avatar-circle { width: 32px; height: 32px; font-size: .9rem; margin-right: 0 !important; }
    html body.seite-nw-matrix #trainingMatrixTable td.col-1 { overflow-wrap: anywhere; }
    html body.seite-nw-matrix #trainingMatrixTable td.course-cell { min-width: 10.5rem; max-width: 12.5rem; }
    html body.seite-nw-matrix #trainingMatrixTable th.course-header { min-width: 10.5rem; max-width: 12.5rem; }
}
@media print {
    html body.seite-nw-matrix #trainingMatrixTable thead th.sticky-col,
    html body.seite-nw-matrix #trainingMatrixTable thead th.sticky-header { background: #fff !important; color: #000 !important; }
    html body.seite-nw-matrix #trainingMatrixTable thead .text-muted { color: #333 !important; }
    .seite-nw-matrix .avatar-circle { background: #fff; color: #000; }
}

/* =========================== Feinschliff 20.11.2026: Schulungsmatrix am PC =========================== */
/* Live kleben 3 (Firmen-Admin: Mitarbeiter, E-Mail, Gesamt = 580 px) bzw. 4 Spalten (Plattform-Admin, + Firma = 740 px)
   links fest. Gemessen (seitlich gescrollt, ganz sichtbare Kursspalten): 1280 px 0, 1440 px 1, 1920 px 3.
   Darum bleibt wie am Handy nur die Namensspalte stehen; E-Mail/Firma/Gesamt scrollen mit, ihre Koepfe kleben
   weiter oben. */
@media (min-width: 768px) {
    html body.seite-nw-matrix #trainingMatrixTable thead th.sticky-col:not(.col-1),
    html body.seite-nw-matrix #trainingMatrixTable tbody td.sticky-col:not(.col-1) { left: auto; }
    html body.seite-nw-matrix #trainingMatrixTable tbody td.sticky-col:not(.col-1) { position: static; }
    html body.seite-nw-matrix #trainingMatrixTable thead th.sticky-col.col-1 { z-index: 12; }
    html body.seite-nw-matrix #trainingMatrixTable thead th.sticky-col:not(.col-1) { z-index: 9; }
    html body.seite-nw-matrix .table#trainingMatrixTable > thead.table-dark > tr > th.sticky-col.col-1 {
        box-shadow: inset 0 -1px 0 var(--we-linie-stark), inset -1px 0 0 var(--we-linie-stark);
    }
    html body.seite-nw-matrix #trainingMatrixTable tbody td.sticky-col.col-1 { box-shadow: inset -1px 0 0 var(--we-linie-stark); }
}
/* Scrollbereich am PC: live calc(100vh - 350px) = bei 900 px Fensterhoehe nur ~1 Mitarbeiter sichtbar. Jetzt fuellt
   er das Fenster, sobald man zur Matrix scrollt (Kopfzeile + Namensspalte kleben innen). */
@media (min-width: 992px) {
    html body.seite-nw-matrix .matrix-scroll { max-height: max(26rem, calc(100vh - 6rem)); }
}
