/* Grundlayout, mobil zuerst. Farben als Variablen, damit später ein Dunkelmodus oder Druckstil leicht möglich ist. */
:root {
    --bg: #f5f7f9;
    --surface: #ffffff;
    --text: #1d2733;
    --muted: #5f6b7a;
    --primary: #0b6bcb;
    --primary-text: #ffffff;
    --border: #d5dbe2;
    --error-bg: #fde8e8;
    --error-text: #8a1c1c;
    --info-bg: #e6f1fb;
    --info-text: #0b4a86;
    /* Abdunklung des Hintergrunds hinter allen Dialogen (der Dialog selbst bleibt hell) */
    --backdrop: rgba(0, 0, 0, 0.25);
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    font-size: 1rem; /* 16px; über rem, damit die Darstellungsdichte (data-density) alles mitskaliert */
    line-height: 1.5;
    color: var(--text);
    background: var(--bg);
}

h1 { font-size: 1.5rem; margin: 0 0 0.5rem; }
h2 { font-size: 1.2rem; margin: 0 0 0.5rem; }
a { color: var(--primary); }

.muted { color: var(--muted); }
.hint { color: var(--muted); font-size: 0.875rem; margin: 0.25rem 0 0; }
.nowrap { white-space: nowrap; }
.wrap { word-break: break-word; max-width: 24rem; }

/* Seitenmenü: siehe Abschnitt "Seitenmenü" weiter unten */

/* Inhalt */
.content { max-width: 60rem; margin: 0 auto; padding: 1rem; }
.content-wide { max-width: 90rem; }
.section { margin-top: 2rem; padding-top: 1rem; border-top: 1px solid var(--border); }

/* Formulare und Schaltflächen (große Touch-Flächen) */
label { display: block; margin: 1rem 0 0.25rem; font-weight: 600; }
input[type="text"], input[type="password"], input[type="date"], input[type="datetime-local"], input[type="number"], select {
    width: 100%;
    min-height: 2.75rem;
    padding: 0.5rem 0.75rem;
    font-size: 1rem;
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    background: var(--surface);
    color: var(--text);
}
.stack { max-width: 28rem; }
.checkbox-row { display: flex; align-items: center; gap: 0.75rem; margin-top: 1rem; }
.checkbox-row input { width: 1.5rem; height: 1.5rem; flex: none; }
.checkbox-row label { margin: 0; font-weight: 400; }
/* Rollen eines Benutzers (Schnitt 0): Häkchen untereinander, Beschreibung darunter eingerückt */
.role-choice { border: 0; padding: 0; margin: 1rem 0 0; min-width: 0; }
.role-choice legend { font-weight: 600; padding: 0; margin-bottom: 0.25rem; }
.role-choice label.plain { display: grid; grid-template-columns: 1.5rem 1fr; column-gap: 0.75rem; align-items: center; margin: 0.5rem 0 0; }
.role-choice label.plain input { width: 1.5rem; height: 1.5rem; margin: 0; }
.role-choice label.plain .hint { grid-column: 2; margin: 0; }

.btn {
    min-height: 2.75rem;
    padding: 0.5rem 1.25rem;
    font-size: 1rem;
    border-radius: 0.5rem;
    border: 1px solid transparent;
    cursor: pointer;
}
.btn-primary { background: var(--primary); color: var(--primary-text); width: 100%; margin-top: 1.5rem; }
.btn-secondary { background: var(--surface); color: var(--text); border-color: var(--border); }
.btn-danger { background: var(--error-text); color: #fff; border-color: var(--error-text); }
a.btn-inline {
    display: inline-flex;
    align-items: center;
    width: auto;
    margin-top: 0;
    text-decoration: none;
}

/* Meldungen */
.message { padding: 0.75rem 1rem; border-radius: 0.5rem; margin: 1rem 0; }
.message-error { background: var(--error-bg); color: var(--error-text); }
.message-info { background: var(--info-bg); color: var(--info-text); }

/* Rückfrage (zum Beispiel Bericht ohne Datensätze): Orange ist Warnungen vorbehalten, daher hier als Rand */
.message-warn { background: var(--surface); border: 2px solid #c2660a; }
.message-warn p { margin: 0 0 0.5rem; }

/* Tabellen */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; background: var(--surface); }
.table th, .table td { text-align: left; padding: 0.6rem 0.75rem; border-bottom: 1px solid var(--border); vertical-align: top; }
.table th { font-size: 0.85rem; color: var(--muted); }
.row-inactive td { color: var(--muted); }

/* Kacheln (Einstellungen) */
.card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: 1rem; margin-top: 1rem; }

.card {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 1rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    color: var(--text);
    text-decoration: none;
}
a.card:hover { border-color: var(--primary); }
/* gewählte Kachel (zum Beispiel die Vorlage auf der Seite Berichte) */
.card[aria-current="true"] { border-color: var(--primary); box-shadow: inset 0 0 0 1px var(--primary); }
.card-disabled { color: var(--muted); }

/* Login-Seite */
.login-page { display: flex; min-height: 100vh; align-items: center; justify-content: center; padding: 1rem; }
.login-card {
    width: 100%;
    max-width: 24rem;
    padding: 1.5rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 0.75rem;
}

/* Ergänzungen Scheibe 4 */
textarea {
    width: 100%;
    padding: 0.5rem 0.75rem;
    font: inherit;
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    background: var(--surface);
    color: var(--text);
}
.block { display: block; }
.inline-form { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: flex-end; max-width: 28rem; margin: 1rem 0; }
.inline-form .field { flex: 1 1 10rem; }
.inline-form label { margin-top: 0; }
.btn-auto { width: auto; margin-top: 0; }
/* Zurück-Schaltfläche über dem Seitentitel (Fragment layout :: back): überall gleich, daneben das Ziel als Text */
.back-row { display: flex; align-items: center; gap: 0.75rem; margin: 0 0 0.75rem; }
a.btn-back { display: inline-flex; align-items: center; gap: 0.4rem; min-height: 2.5rem; padding: 0.35rem 0.9rem; text-decoration: none; }
a.btn-back:hover { background: var(--bg); }
.back-label { color: var(--muted); }
.btn-small { min-height: 2.25rem; padding: 0.25rem 0.75rem; font-size: 0.9rem; }
.table form { margin: 0; }

/* Ergänzungen Scheibe 5: Auswahl der Messpunkte einer Messliste */
input[type="text"].pos { width: 4rem; min-height: 2.25rem; padding: 0.25rem 0.5rem; text-align: right; }
.table input[type="checkbox"] { width: 1.4rem; height: 1.4rem; }
label.plain { display: inline; margin: 0; font-weight: normal; }
/* Auswahlpunkt mit Text: untereinander, umgebrochener Text bleibt eingerückt */
label.radio-option { display: flex; align-items: flex-start; gap: 0.5rem; margin: 0.25rem 0; font-weight: normal; }
label.radio-option input { flex: none; width: auto; margin: 0.25rem 0 0; }

/* Ergänzungen Scheibe 7: Dateneingabe */
.entry-table input[type="text"] { min-height: 2.75rem; font-size: 1.1rem; }
.entry-table input.value-input { width: 6rem; text-align: right; }
.entry-table input.remark-input { min-width: 12rem; }
/* Wertfeld mit Zustand: Hinterlegung und Symbol (nie nur Farbe); Rot bleibt Grenzwertverletzungen vorbehalten */
.value-cell { display: flex; align-items: center; gap: 0.35rem; }
.state-mark { width: 1.1rem; text-align: center; font-size: 0.95rem; flex: none; }
.value-cell[data-state="saved"] input.value-input { background: #e6f4ea; }
.value-cell[data-state="saved"] .state-mark::before { content: "\2713"; color: #1b6e3a; }
.value-cell[data-state="changed"] input.value-input { background: #e6f4ea; }
.value-cell[data-state="changed"] .state-mark::before { content: "\270E"; color: #1b6e3a; }
.value-cell[data-state="new"] input.value-input { background: #fff; border-style: dashed; }
.value-cell[data-state="locked"] input.value-input { background: #eceff1; }
.value-cell[data-state="locked"] .state-mark::before { content: "\1F512"; font-size: 0.8rem; }
.value-cell[data-state="dirty"] input.value-input { background: #e3f0fd; }
.value-cell[data-state="dirty"] .state-mark::before { content: "\25CF"; color: #1d5fa8; }
.info-btn { flex: none; width: 2rem; height: 2rem; padding: 0; border-radius: 50%; border: 1px solid var(--border); background: var(--surface);
    color: var(--muted); font: italic 700 1rem/1 Georgia, serif; cursor: pointer; }
.info-btn:hover, .info-btn:focus-visible { color: var(--primary); border-color: var(--primary); }
.entry-table .entered { white-space: normal; }
.row-over td { background: var(--error-bg); }
.row-over .value-cell[data-state] input.value-input { background: var(--error-bg); }
.row-over input.value-input { border-color: var(--error-text); color: var(--error-text); font-weight: 700; }

/* Ergänzungen Scheibe 7a: Aufgabenliste für Proben */
.task-form { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; margin: 0; }

.task-form input[type="text"] { min-height: 2.5rem; }
.task-form input.value-input { width: 6rem; flex: 0 0 auto; text-align: right; }
/* Wert, Bemerkung und Speichern stehen nebeneinander (spart Höhe); die Begründung (überfällig) steht darunter, auf schmalen Anzeigen bricht es um */
.task-form input[type="text"] { flex: 1 1 9rem; width: auto; min-width: 0; }
.task-form .btn { flex: 0 0 auto; }
.task-form input.task-reason { order: 2; flex: 1 1 100%; }
.task-table td { vertical-align: middle; }
.row-late td { background: var(--error-bg); }

/* Ergänzungen Scheibe 8: Tabellenauswertung */
.eval-form { margin: 1rem 0; }
.table tr.row-control td { background: var(--accent-soft, #eef4ff); }
.table tr.row-problem td { background: var(--warn-bg, #fff7e6); }
.eval-chart { margin: 0 0 1rem; }
.eval-canvas-wrap { position: relative; height: 22rem; max-width: 64rem; background: #fff; border: 1px solid var(--border, #ccd); border-radius: 4px; padding: 0.5rem; }
.eval-chart figcaption { font-weight: 600; margin-bottom: 0.25rem; }
.eval-chart img { width: 100%; max-width: 64rem; height: auto; border: 1px solid var(--border, #ccd); border-radius: 4px; background: #fff; }
.eval-dates { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: flex-end; }
.eval-dates .field { flex: 0 1 12rem; }
.eval-dates label { margin-top: 0; }
.eval-points { display: grid; grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr)); gap: 0.25rem 1rem; margin: 0.5rem 0 1rem; }
.eval-point { display: flex; align-items: center; gap: 0.5rem; min-height: 2.25rem; }
.eval-point input { width: 1.4rem; height: 1.4rem; flex: none; }
.eval-table th.eval-day, .eval-table td.eval-cell { text-align: center; min-width: 3.5rem; white-space: nowrap; }
.eval-table th, .eval-table td { padding: 0.4rem 0.5rem; }
.cell-over { background: var(--error-bg); color: var(--error-text); font-weight: 700; }
.sticky-col { position: sticky; left: 0; background: var(--surface); z-index: 1; min-width: 9rem; }
.print-only { display: none; }

/* Ergänzungen Scheibe 9: Diagramm */
.eval-tabs { display: flex; gap: 0.25rem; margin: 1rem 0 0.75rem; border-bottom: 2px solid var(--border, #ccd); }
.eval-tabs a { padding: 0.5rem 1rem; text-decoration: none; border-radius: 0.4rem 0.4rem 0 0; }
.eval-tabs a.active { font-weight: 700; background: var(--surface); border: 2px solid var(--border, #ccd); border-bottom-color: var(--surface); margin-bottom: -2px; }
.chart-box { position: relative; height: 26rem; max-width: 100%; margin: 1rem 0; }
@media (max-width: 40rem) { .chart-box { height: 20rem; } }

/* Ergänzungen Scheibe 9a: Trendregel */
.eval-table td.trend-warn { outline: 3px solid #e07b00; outline-offset: -3px; }
.eval-table td.trend-capa { outline: 3px solid #7f0000; outline-offset: -3px; font-weight: 800; }
.trend-notes { margin: 0.75rem 0; padding-left: 1.25rem; color: var(--error-text); font-weight: 600; }

/* Ergänzungen Scheibe 10a: Auswertung kompakt, Messungen gruppiert */
input[type="date"] { font-family: inherit; }
.eval-dates .field-list { flex: 0 0 auto; }
.eval-dates .btn-primary { margin-top: 0; }
.eval-select { margin: 1rem 0; background: var(--surface); border: 1px solid var(--border); border-radius: 0.5rem; padding: 0.5rem 0.75rem; }
.eval-select > summary { cursor: pointer; min-height: 2rem; }
.eval-select-tools { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; margin: 0.5rem 0; }
.eval-select-tools input[type="text"] { flex: 1 1 14rem; width: auto; max-width: 24rem; }
.eval-group { border-top: 1px solid var(--border); padding: 0.25rem 0; }
.eval-group > summary { cursor: pointer; display: flex; align-items: center; gap: 0.5rem; min-height: 2.25rem; }
.eval-group > summary input { width: 1.3rem; height: 1.3rem; flex: none; }
.eval-points { margin: 0.25rem 0 0.5rem 1.8rem; max-height: 16rem; overflow-y: auto; grid-template-columns: repeat(auto-fill, minmax(22rem, 1fr)); }
.eval-point { min-height: 1.9rem; }
.eval-result { margin-top: 0.75rem; }
.eval-table { font-size: 0.8rem; line-height: 1.25; width: auto; }
.eval-table th, .eval-table td { padding: 0.15rem 0.35rem; }
.eval-table th { font-size: 0.72rem; }
.eval-table th.eval-day, .eval-table td.eval-cell { min-width: 2.3rem; }
.eval-table .sticky-col { width: 20rem; min-width: 20rem; max-width: 20rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.eval-table .sticky-col-2 { position: sticky; left: 20rem; z-index: 1; background: var(--surface); min-width: 5.5rem; text-align: right; box-shadow: 1px 0 0 var(--border); }
.eval-table th.sticky-col, .eval-table th.sticky-col-2 { z-index: 2; background: var(--bg); }
.eval-table th.eval-day { min-width: 4.6rem; }
.eval-table td.eval-cell { padding: 0; }
.eval-cell a, .eval-cell span { display: block; padding: 0.15rem 0.35rem; color: inherit; text-decoration: none; }
.eval-cell a:hover { text-decoration: underline; }
.wrap-names .eval-table .sticky-col { white-space: normal; overflow: visible; text-overflow: clip; }
.eval-options { display: flex; flex-wrap: wrap; gap: 0.1rem 1.5rem; margin: 0.25rem 0; }
.eval-wrap-toggle { display: inline-flex; align-items: center; gap: 0.4rem; margin: 0.25rem 0; font-size: 0.85rem; }
.eval-wrap-toggle input { width: 1.1rem; height: 1.1rem; }

/* Einheitliche Höhe der Bedienelemente in der Kopfleiste; Auswahlfelder ohne Systemdarstellung, damit alle Browser gleich hoch zeichnen */
select {
    -webkit-appearance: none;
    appearance: none;
    padding-right: 2.25rem;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'><path d='M1 1l5 5 5-5' fill='none' stroke='%235f6b7a' stroke-width='2'/></svg>");
    background-repeat: no-repeat;
    background-position: right 0.85rem center;
}
.eval-dates input, .eval-dates select, .eval-dates .btn { height: 2.75rem; min-height: 2.75rem; line-height: 1.25; font-size: 1rem; }
.eval-table .sticky-col .hint { display: inline; margin-left: 0.4rem; font-size: 0.72rem; }

/* Ergänzungen Scheibe 10b: Schnellauswahl und Spaltenwahl */
.eval-dates .field-quick { flex: 0 1 11rem; }
.eval-dates .field:has(#granularity) { flex: 0 1 10rem; }

/* Eingabe: Blättern, Periodenanzeige, Erfasst-von und Verlauf */
.entry-nav { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: flex-end; margin: 1rem 0 0.25rem; }
.entry-nav .field { flex: 0 1 12rem; }
.entry-nav label { margin-top: 0; }
.entry-nav .btn { min-width: 2.75rem; font-size: 1.4rem; line-height: 1; text-decoration: none; }
.entry-nav a.btn:last-of-type { font-size: 1rem; }
.entry-nav .btn-disabled { opacity: 0.4; cursor: not-allowed; }
.period-line { margin: 0.25rem 0 1rem; }
.card .period { font-weight: 600; }
.status-ok { color: var(--ok-text, #1b6e3a); }
.entered { white-space: nowrap; }
.link-button { background: none; border: 0; padding: 0; color: var(--primary); text-decoration: underline; cursor: pointer; font: inherit; font-size: 0.85rem; }
.history-row > td { background: var(--surface); padding-left: 2rem; }
.history-table { width: auto; font-size: 0.9rem; }
.entry-nav a.btn, .entry-nav .btn-disabled { display: inline-flex; align-items: center; justify-content: center; }

/* Detailansicht als Dialog */
.entry-dialog { width: min(94vw, 46rem); height: fit-content; max-height: 90vh; max-width: none; padding: 0; border: 1px solid var(--border); border-radius: 0.5rem; }
.entry-dialog[open] { display: flex; flex-direction: column; }
.entry-dialog::backdrop { background: var(--backdrop, rgba(0, 0, 0, 0.25)); }
.entry-dialog-bar { display: flex; justify-content: space-between; align-items: center; padding: 0.5rem 1rem; border-bottom: 1px solid var(--border); }
.entry-dialog iframe { flex: none; width: 100%; height: 12rem; max-height: calc(90vh - 4rem); border: 0; }
body.embed { padding-top: 0; }
body.embed .content { max-width: none; margin: 0; padding: 0.5rem 1.25rem 1rem; }

/* Lesende Detailansicht */
.detail-list { display: grid; grid-template-columns: max-content 1fr; gap: 0.4rem 1.5rem; margin: 1rem 0; }
.detail-list dt { color: var(--muted); }
.detail-list dd { margin: 0; }
.value-over { color: var(--error-text); }
.detail-actions { margin-top: 1.5rem; }
.detail-actions .btn { text-decoration: none; display: inline-flex; align-items: center; }

/* Sortierbare Tabellen und Aufgabenfilter */
/* Sortiersymbole (Beschluss 13.11.2026): so groß wie der Text der Überschrift und mit drei eigenen Formen, damit der Zustand ohne
   Farbe erkennbar ist: Doppelpfeil = nicht sortiert, Pfeil nach oben = aufsteigend, Pfeil nach unten = absteigend. Sortiert wird
   die Spalte zusätzlich in der Hauptfarbe hervorgehoben; beim Überfahren zeigt ein leichter Hintergrund, dass der Kopf klickbar ist.
   Die Formen sind SVG-Masken (data:-Adressen erlaubt die Inhaltsrichtlinie für Bilder), gefärbt über background-color. */
:root {
    --sort-none: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 9.5l5-5 5 5M7 14.5l5 5 5-5'/%3E%3C/svg%3E");
    --sort-asc: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 19.5V4.5M6 10.5l6-6 6 6'/%3E%3C/svg%3E");
    --sort-desc: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 4.5v15M6 13.5l6 6 6-6'/%3E%3C/svg%3E");
}
table.sortable th[data-sort]:not([data-sort="none"]) { cursor: pointer; user-select: none; white-space: nowrap; }
table.sortable th[data-sort]:not([data-sort="none"])::after {
    content: ""; display: inline-block; width: 1.2em; height: 1.2em; margin-left: 0.3em; vertical-align: -0.25em;
    background-color: var(--muted);
    -webkit-mask: var(--sort-none) center / contain no-repeat; mask: var(--sort-none) center / contain no-repeat;
}
table.sortable th[data-sort]:not([data-sort="none"]):hover,
table.sortable th[data-sort]:not([data-sort="none"]):focus-visible { background-color: color-mix(in srgb, var(--primary) 9%, var(--surface, #fff)); color: var(--text); }
table.sortable th[data-sort]:not([data-sort="none"]):hover::after { background-color: var(--primary); }
table.sortable th[aria-sort="ascending"], table.sortable th[aria-sort="descending"] { color: var(--primary); }
table.sortable th[data-sort]:not([data-sort="none"])[aria-sort="ascending"]::after { background-color: var(--primary); -webkit-mask-image: var(--sort-asc); mask-image: var(--sort-asc); }
table.sortable th[data-sort]:not([data-sort="none"])[aria-sort="descending"]::after { background-color: var(--primary); -webkit-mask-image: var(--sort-desc); mask-image: var(--sort-desc); }
@media print { table.sortable th[aria-sort="none"]::after { display: none; } }
.task-filter { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; margin: 1rem 0 0.25rem; }
.task-filter label { margin: 0; }
.task-filter select { width: auto; min-width: 14rem; }

/* ===== Seitenmenü (11b) ===== */
:root {
    --nav-w: 16rem; /* Platz für "Proben bearbeiten" mit Zahl */
    --nav-w-collapsed: 4.75rem; /* breit genug, dass Zahlen wie "! 13" am Symbol ganz sichtbar bleiben (12.11.2026, vorher 4.25rem) */
    --bar-h: 3.25rem;
    /* Bereichsfarben (rot und orange bleiben Verstößen und Warnungen vorbehalten) */
    --area-start: #52606d;
    --area-entry: #1f7a4d;
    --area-tasks: #8a3fa0;
    --area-eval: #0b6bcb;
    --area-admin: #5b6b7c;
    --area-master: #8a6a2f;
    --area-account: #52606d;
    --area: var(--area-start);
    /* Intervallfarben: blau, petrol, violett, indigo */
    --iv-day: #0b78c9;
    --iv-week: #0f8b8d;
    --iv-month: #7c3aed;
    --iv-quarter: #3f3fb8;
}
body[data-area="start"] { --area: var(--area-start); }
body[data-area="entry"] { --area: var(--area-entry); }
body[data-area="tasks"] { --area: var(--area-tasks); }
body[data-area="eval"] { --area: var(--area-eval); }
body[data-area="admin"] { --area: var(--area-admin); }
body[data-area="master"] { --area: var(--area-master); }
body[data-area="account"] { --area: var(--area-account); }

.icon { width: 1.25rem; height: 1.25rem; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; vertical-align: -0.2em; }
.icon-lg { width: 1.6rem; height: 1.6rem; }

/* Seitenmenü: links, einklappbar. Eingeklappt = schmale Leiste mit Symbolen; beim Darüberfahren (Maus) klappt sie überlagernd
   auf, ein Klick auf den Menüknopf klappt sie fest auf und schiebt den Inhalt zur Seite. Die Symbole bleiben dabei an derselben Stelle. */
.app-header {
    position: fixed; z-index: 30; top: 0; left: 0; bottom: 0; width: var(--nav-w);
    display: flex; flex-direction: column; gap: 0.5rem;
    padding: 0.75rem 0.6rem;
    background: var(--surface); border-right: 1px solid var(--border);
    transition: width 0.15s ease, box-shadow 0.15s ease;
}
.nav-top { display: flex; align-items: center; justify-content: space-between; gap: 0.25rem; min-height: 2.5rem; }
.brand { display: flex; align-items: center; gap: 0.6rem; font-weight: 700; color: var(--text); text-decoration: none; padding: 0.4rem 0.5rem; min-width: 0; white-space: nowrap; }

.icon-brand { color: var(--primary); width: 1.5rem; height: 1.5rem; }
.nav-toggle, .user-button {
    display: inline-flex; align-items: center; gap: 0.6rem; border: 0; background: transparent; color: var(--muted);
    cursor: pointer; font: inherit; border-radius: 0.5rem; padding: 0.5rem 0.9rem; min-height: 2.5rem;
}
.nav-toggle .ic-menu { display: none; }
.nav-toggle:hover, .user-button:hover, .nav-item:hover { background: var(--bg); }
.nav { display: flex; flex-direction: column; gap: 0.15rem; flex: 1 1 auto; overflow-y: auto; overflow-x: hidden; }
.nav-item {
    display: flex; align-items: center; gap: 0.75rem; padding: 0.6rem 0.65rem 0.6rem calc(0.9rem - 3px); border-radius: 0.5rem;
    color: var(--text); text-decoration: none; border-left: 3px solid transparent; white-space: nowrap;
}
.nav-item .icon { color: var(--nav-color, var(--muted)); }
.nav-item[data-area="start"] { --nav-color: var(--area-start); }
.nav-item[data-area="entry"] { --nav-color: var(--area-entry); }
.nav-item[data-area="tasks"] { --nav-color: var(--area-tasks); }
.nav-item[data-area="eval"] { --nav-color: var(--area-eval); }
.nav-item[data-area="admin"] { --nav-color: var(--area-admin); }
.nav-item[data-area="master"] { --nav-color: var(--area-master); }
.nav-item[aria-current="page"] { background: var(--bg); font-weight: 600; border-left-color: var(--nav-color); }
.nav-disabled { color: var(--muted); padding: 0.5rem 0; cursor: not-allowed; }
.nav-label { overflow: hidden; text-overflow: ellipsis; }
/* Zeichen am Menüpunkt (aus hm): rechts neben dem Text, im eingeklappten Menü klein am Symbol. Rot nur für Verstöße wie eine
   Abweichung im Audit Trail. */
.nav-item { position: relative; }
.nav-badge { margin-left: auto; min-width: 1.4rem; padding: 0 0.4rem; border-radius: 999px; background: var(--nav-color, var(--muted));
    color: #fff; font-size: 0.75rem; font-weight: 700; line-height: 1.4rem; text-align: center; }
.nav-badge-alarm { background: var(--error-text, #8a1c1c); }
html[data-nav="collapsed"] .app-header:not(:hover):not(:has(:focus-visible)) .nav-badge {
    position: absolute; top: 0.1rem; left: 1.2rem; min-width: 1rem; padding: 0 0.18rem; font-size: 0.62rem; line-height: 1rem; }

.user-area { position: relative; border-top: 1px solid var(--border); padding-top: 0.5rem; }
.user-button { width: 100%; color: var(--text); text-align: left; padding-left: 0.4rem; white-space: nowrap; }
.user-name { font-weight: 600; }
/* Stilisiertes Portrait (Symbol i-user: Kopf als Kreis über dem Körper als Bogen) statt eines Farbkreises mit Initialen */
.avatar { width: 2.25rem; height: 2.25rem; stroke-width: 1.6; color: var(--primary); vertical-align: middle; }
.user-menu {
    position: absolute; left: 0.25rem; bottom: calc(100% - 0.25rem); min-width: 14rem; z-index: 40;
    background: var(--surface); border: 1px solid var(--border); border-radius: 0.6rem;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.18); padding: 0.35rem; display: flex; flex-direction: column;
}
.user-menu[hidden] { display: none; }
.user-menu-head { margin: 0; padding: 0.4rem 0.65rem; color: var(--muted); font-size: 0.85rem; border-bottom: 1px solid var(--border); }
.user-menu a, .user-menu button {
    display: flex; align-items: center; gap: 0.65rem; width: 100%; padding: 0.55rem 0.65rem; border: 0; background: transparent;
    color: var(--text); font: inherit; text-decoration: none; text-align: left; cursor: pointer; border-radius: 0.4rem;
}
.user-menu a:hover, .user-menu button:hover { background: var(--bg); }
.user-menu form { margin: 0; }

/* Inhalt rückt neben das Menü */
body > main.content, body > .content { margin-left: var(--nav-w); max-width: none; transition: margin-left 0.15s ease; }
body > main.content > * { max-width: 60rem; }
body > main.content-wide > * { max-width: none; }
body.embed > main.content { margin-left: 0; }

/* Eingeklappt (Computer): nur Symbole; der Menüknopf zeigt drei Striche und steht links in der Leiste */
html[data-nav="collapsed"] { --nav-w: var(--nav-w-collapsed); }
html[data-nav="collapsed"] .nav-toggle .ic-menu { display: inline; }
html[data-nav="collapsed"] .nav-toggle .ic-panel { display: none; }
html[data-nav="collapsed"] .nav-toggle { order: -1; }
html[data-nav="collapsed"] .app-header:not(:hover):not(:has(:focus-visible)) .nav-label,
html[data-nav="collapsed"] .app-header:not(:hover):not(:has(:focus-visible)) .brand,
html[data-nav="collapsed"] .app-header:not(:hover):not(:has(:focus-visible)) .user-menu-head { display: none; }
html[data-nav="collapsed"] .nav-top { justify-content: flex-start; }
/* Überlagerung beim Darüberfahren (nur mit Maus) oder bei Tastaturbedienung. Nur sichtbarer Tastaturfokus (:focus-visible), nicht
   :focus-within: sonst bliebe das Menü nach einem Mausklick auf den Menüknopf offen, bis man woanders klickt (Chrome fokussiert
   angeklickte Knöpfe, Safari nicht; gemeldet 12.11.2026). */
html[data-nav="collapsed"] .app-header:has(:focus-visible) { width: 16rem; box-shadow: 4px 0 24px rgba(0, 0, 0, 0.15); }
@media (hover: hover) {
    html[data-nav="collapsed"] .app-header:hover { width: 16rem; box-shadow: 4px 0 24px rgba(0, 0, 0, 0.15); }
}

/* Seitentitel: Symbol des Bereichs in dessen Farbe (von nav.js eingefügt), Hintergrund leicht in der Bereichsfarbe */
.icon-title { width: 1.6rem; height: 1.6rem; color: var(--area); margin-right: 0.5rem; vertical-align: -0.25em; }
body[data-area] { background: color-mix(in srgb, var(--area) 9%, var(--bg)); }
body.embed[data-area] { background: color-mix(in srgb, var(--area) 9%, var(--surface)); }

/* Telefon und kleines Tablet: Kopfleiste, das Menü ist eine Schublade über dem Inhalt */
@media (max-width: 899px) {
    :root, html[data-nav="collapsed"] { --nav-w: 0rem; }
    .app-header { top: 0; left: 0; right: 0; bottom: auto; width: auto; height: var(--bar-h); flex-direction: row; align-items: center; padding: 0 0.6rem; border-right: 0; border-bottom: 1px solid var(--border); overflow: visible; }
    .nav-top { flex: 1; flex-direction: row; justify-content: flex-start; gap: 0.25rem; }
    .nav-toggle { order: -1; padding: 0.5rem 0.6rem; }
    .nav-toggle .ic-menu { display: inline; }
    .nav-toggle .ic-panel { display: none; }
    html[data-nav="collapsed"] .nav-toggle .ic-menu { display: inline; }
    html[data-nav="collapsed"] .app-header .nav-label, html[data-nav="collapsed"] .app-header .brand { display: flex; }
    body > main.content, body > .content { margin-left: 0; padding-top: calc(var(--bar-h) + 1rem); }
    body.embed > main.content { padding-top: 0.5rem; }
    .nav, .user-area { display: none; }
    html[data-drawer="open"] .app-header { top: 0; bottom: 0; right: auto; width: min(20rem, 85vw); height: auto; flex-direction: column; align-items: stretch; padding: 0.5rem 0.6rem 0.75rem; box-shadow: 4px 0 24px rgba(0, 0, 0, 0.25); }
    html[data-drawer="open"] .nav-top { flex: none; }
    html[data-drawer="open"] .nav-toggle .ic-menu { display: none; }
    html[data-drawer="open"] .nav-toggle .ic-panel { display: inline; }
    html[data-drawer="open"] .nav { display: flex; }
    html[data-drawer="open"] .user-area { display: block; }
    html[data-drawer="open"] .user-menu { bottom: 100%; }
    html[data-drawer="open"] body::after { content: ""; position: fixed; inset: 0; background: rgba(0, 0, 0, 0.35); z-index: 25; }
}

/* Intervalle: Farbe und Form (Symbol), nie nur Farbe */
.iv { display: inline-flex; align-items: center; gap: 0.3rem; font-weight: 600; color: var(--iv-color, var(--muted)); white-space: nowrap; }
.iv .icon { width: 1.05rem; height: 1.05rem; }
.iv-day { --iv-color: var(--iv-day); }
.iv-week { --iv-color: var(--iv-week); }
.iv-month { --iv-color: var(--iv-month); }
.iv-quarter { --iv-color: var(--iv-quarter); }

/* Kacheln mit Symbol in der Bereichsfarbe */
.card-head { display: flex; align-items: center; gap: 0.6rem; }
.card-head .icon { color: var(--card-color, var(--area)); width: 1.5rem; height: 1.5rem; }
/* Lange Kacheltitel an festen Trennstellen (weiches Trennzeichen \u00AD im Text, zum Beispiel „Kultivierungs-methoden“) umbrechen statt
   mitten im Wort; die automatische Trennung der Browser wählt oft unschöne Stellen */
.card-head strong { hyphens: manual; -webkit-hyphens: manual; min-width: 0; }
a.card { border-top: 3px solid var(--card-color, var(--border)); }
.card[data-area="entry"] { --card-color: var(--area-entry); }
.card[data-area="tasks"] { --card-color: var(--area-tasks); }
.card[data-area="eval"] { --card-color: var(--area-eval); }
.card[data-area="admin"] { --card-color: var(--area-admin); }
.card[data-area="master"] { --card-color: var(--area-master); }

/* Benutzerkonto */
.account-list { display: grid; grid-template-columns: max-content 1fr; gap: 0.5rem 1.5rem; margin: 1rem 0; }
.account-list dt { color: var(--muted); }
.account-list dd { margin: 0; font-weight: 600; }
.account-head { display: flex; align-items: center; gap: 1rem; margin: 1rem 0; }
.account-head .avatar { width: 3.5rem; height: 3.5rem; }

@page { size: A4 landscape; margin: 1.2cm; }
@media print {
    * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    body { background: #fff; font-size: 10pt; }
    /* Seitenmenü ausblenden, der Symbolsatz (svg) darin muss für die Kästchen erhalten bleiben */
    .app-header { position: static; width: 0; height: 0; padding: 0; border: 0; overflow: hidden; }
    body > main.content, body > .content { margin-left: 0; padding-top: 0; }
    .no-print, .filter-bar, .filter-row, .table-export, dialog { display: none !important; }
    .print-only { display: block; }
    .eval-printed { margin: 0.2rem 0 0.6rem; color: #444; font-size: 9pt; }
    .table-wrap { overflow: visible; }
    .eval-table { font-size: 8pt; }
    .eval-table th, .eval-table td { padding: 0.15rem 0.3rem; }
    .eval-table .sticky-col, .eval-table .sticky-col-2 { position: static; width: auto; min-width: 0; max-width: none;
        white-space: normal; overflow: visible; text-overflow: clip; box-shadow: none; }
    .eval-table th.sticky-col, .eval-table th.sticky-col-2 { background: transparent; }
    thead { display: table-header-group; }
    tr { break-inside: avoid; }
    a { color: inherit; text-decoration: none; }
    .chart-box { max-width: 100%; }
    h1 .icon { display: none; }
}

/* Kacheln: lange Zeiträume ("wöchentlich: KW 42/2026 (12.10. bis 18.10.2026)") umbrechen statt über den Rand zu laufen */
.card { min-width: 0; overflow-wrap: anywhere; }
.card .iv { white-space: normal; align-items: flex-start; }
.card .iv .icon { margin-top: 0.2rem; }

/* Auswertungskopf: Messliste mit Zahnrad, Zeitraum, Von/Bis nur bei "Benutzerdefiniert" */
.combo { position: relative; }
.combo select { padding-right: 4.5rem; }
.combo-gear {
    position: absolute; top: 50%; right: 1.9rem; transform: translateY(-50%);
    display: inline-flex; align-items: center; justify-content: center; width: 2rem; height: 2rem;
    border: 0; border-radius: 0.4rem; background: transparent; color: var(--muted); cursor: pointer;
}
.combo-gear:hover { background: var(--bg); color: var(--text); }
.eval-custom { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: flex-end; }
.eval-custom[hidden] { display: none; }
.eval-dates .field-range { flex: 0 0 auto; }
.eval-custom { flex-wrap: nowrap; }
.eval-custom .field { flex: 0 0 11rem; }

/* Messliste: Auswahl nur so breit wie der längste Eintrag plus Zahnrad */
.eval-dates .combo { display: inline-block; }
.eval-dates .combo select { width: auto; max-width: 100%; }
.eval-dates .field-range select { width: auto; }
.eval-dates .eval-custom { flex: 0 0 auto; }
.eval-dates .eval-custom .field { flex: 0 0 10.5rem; }

/* Auswahl der Messungen als modaler Dialog */
.eval-dialog { width: min(94vw, 46rem); max-height: 88vh; padding: 0; border: 1px solid var(--border); border-radius: 0.6rem; background: var(--surface); color: var(--text); }
.eval-dialog[open] { display: flex; flex-direction: column; }
.eval-dialog::backdrop { background: var(--backdrop, rgba(0, 0, 0, 0.25)); }
.eval-dialog-head { display: flex; align-items: baseline; gap: 0.75rem; padding: 0.75rem 1rem; border-bottom: 1px solid var(--border); }
.eval-dialog-head h2 { margin: 0; }
.eval-dialog-body { flex: 1 1 auto; overflow-y: auto; padding: 0.5rem 1rem; }
.eval-dialog-foot { display: flex; justify-content: flex-end; gap: 0.75rem; padding: 0.75rem 1rem; border-top: 1px solid var(--border); }
.eval-dialog-foot .btn { margin-top: 0; }
.eval-dialog .eval-points { max-height: none; }

/* Konformität: Kästchen (eigene Formen für entspricht / entspricht nicht, Farbe unterstützt nur) */
.box-ok { color: #1f7a4d; width: 1.1rem; height: 1.1rem; }
.box-bad { color: var(--error-text); width: 1.1rem; height: 1.1rem; stroke-width: 2.4; }
.box-dash { color: var(--muted); font-weight: 700; }
.box-empty { display: inline-block; width: 1.2rem; height: 1.2rem; border: 1.5px dashed var(--border); border-radius: 0.3rem; vertical-align: middle; }
.compliance-cell { text-align: center; }
.compliance-cell .cell-link { display: inline-flex; text-decoration: none; }
.compliance-sum { white-space: nowrap; font-weight: 600; text-align: right; }
.compliance-legend { display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; list-style: none; padding: 0; margin: 0.5rem 0; color: var(--muted); font-size: 0.9rem; }
.compliance-legend li { display: inline-flex; align-items: center; gap: 0.4rem; }

/* Diagramm auf weißem Grund */
.chart-box { background: var(--surface); border: 1px solid var(--border); border-radius: 0.5rem; padding: 0.75rem; }

/* ---------- Audit Trail: Seitenwechsel ---------- */

/* ---------- Tabellenfilter (filter.js) ---------- */
.filter-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem; margin: 0.5rem 0; min-height: 1.5rem; }
.filter-count { font-size: 0.9rem; }
.filter-reset { font-size: 0.9rem; }
.filter-warn { color: var(--error-text); background: var(--error-bg); border-radius: 4px; padding: 0.15rem 0.5rem; font-size: 0.9rem; font-weight: 600; }
.filter-warn[hidden] { display: none; }
.table-export { margin-left: auto; display: inline-flex; gap: 0.25rem; }
.table-export .icon-btn { width: auto; margin: 0; min-height: 0; padding: 0.25rem 0.4rem; line-height: 0; background: transparent;
    color: var(--muted); border: 1px solid var(--border); border-radius: 4px; cursor: pointer; }
.table-export .icon-btn:hover { color: var(--primary); border-color: var(--primary); }
.filter-reset:not([hidden])::before { content: "· "; color: var(--muted); }
.filter-row th { font-weight: normal; padding: 0.2rem 0.4rem; background: var(--bg); }
.filter-row .filter-input { width: 100%; min-width: 5rem; padding: 0.2rem 0.4rem; font-size: 0.85rem; box-sizing: border-box; }
.filter-select { width: 100%; min-width: 5rem; text-align: left; padding: 0.2rem 0.4rem; font-size: 0.85rem; cursor: pointer;
    border: 1px solid var(--border); border-radius: 4px; background: var(--surface); color: var(--text, inherit); }
.filter-select::after { content: " \25BE"; float: right; color: var(--muted); }
.filter-select.active, .filter-row .filter-input.active { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary); }
.filter-popup { position: absolute; z-index: 60; min-width: 10rem; max-width: 15rem; max-height: 20rem; overflow: auto;
    background: var(--surface, #fff); border: 1px solid var(--border, #ccc); border-radius: 6px; padding: 0.4rem 0.6rem;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18); }
.filter-popup label { display: block; padding: 0.15rem 0; white-space: nowrap; font-weight: normal; }
.account-prefs { margin: 1rem 0; }
.link-button { background: none; border: 0; padding: 0; color: var(--primary); cursor: pointer; text-decoration: underline; font: inherit; }
input.input-days { width: 6.5rem; }
.filter-popup .filter-input { width: 14rem; max-width: 100%; margin-bottom: 0.35rem; padding: 0.2rem 0.4rem; font-size: 0.85rem; box-sizing: border-box; }
.filter-popup .filter-all { border-bottom: 1px solid var(--border); margin-bottom: 0.2rem; padding-bottom: 0.3rem; font-weight: 600; }
.filter-popup .filter-item { overflow: hidden; text-overflow: ellipsis; }
.filter-popup .filter-hint { margin: 0.2rem 0 0; color: var(--muted); font-size: 0.8rem; white-space: normal; }
.filter-popup label[hidden] { display: none; }
.filter-date { display: flex; flex-direction: column; gap: 0.35rem; min-width: 14rem; }
.filter-date input[type="date"] { width: auto; min-height: 2rem; padding: 0.1rem 0.4rem; font-size: 0.9rem; }
.filter-date .link-button { text-align: left; }
body > main.content-wide > p { max-width: 60rem; }
/* Die Anwendung ist hell gestaltet: Browser-Elemente (Vorschlagslisten, Auswahllisten) nicht dunkel darstellen */
:root { color-scheme: light; }
.filter-row .filter-input { min-height: 0; background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: 4px; }
.filter-row .filter-input option, datalist option { color: #1d2733; background: #fff; }
.backfill-grid { display: grid; grid-template-columns: max-content auto; gap: 0.5rem 1rem; align-items: center; justify-items: start; }
.backfill-grid label { margin: 0; font-weight: 400; }

/* ===== Testsystem-Hinweis ===== */
:root { --banner-h: 2rem; }
.test-banner {
    position: fixed; z-index: 28; top: 0; left: var(--nav-w); right: 0; height: var(--banner-h);
    display: flex; align-items: center; justify-content: center;
    background: repeating-linear-gradient(45deg, #ffd54a, #ffd54a 14px, #f2c230 14px, #f2c230 28px);
    color: #1d2733; font-weight: 700; letter-spacing: 0.04em; border-bottom: 1px solid #c9a21e;
}
body:has(.test-banner) > main.content { margin-top: var(--banner-h); }
.login-page .test-banner { left: 0; }
/* Testsystem (E79, T1a): Menü gelb hinterlegt, Wahl auf der Anmeldeseite */
body:has(.test-banner) .app-header { background: color-mix(in srgb, #ffd54a 22%, var(--surface)); border-right: 4px solid #f2c230; }
.system-choice { border: 1px solid var(--border); border-radius: 0.5rem; padding: 0.5rem 0.75rem; margin: 0.75rem 0; }
.system-choice legend { padding: 0 0.25rem; font-weight: 600; }
.system-test-option span { background: #ffd54a; color: #1d2733; padding: 0 0.3rem; border-radius: 0.25rem; }
/* Vorschau von Word-Dateien (R4, aus hm) */
.docview-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem; margin: 0.5rem 0 1rem; }
.docview-bar .btn { margin-top: 0; text-decoration: none; }
.docview { overflow-x: auto; border: 1px solid var(--border); border-radius: 0.5rem; background: #e5e7eb; min-height: 12rem; }
.docview-loading { padding: 1rem; }
/* docx-preview setzt die Seiten mittig (align-items: center); ist eine Seite breiter als die Fläche (A4 quer), würde sie links
   abgeschnitten. Daher links ausrichten und mit automatischen Rändern mittig setzen: Ist Platz, steht die Seite mittig; ist sie
   breiter, werden die Ränder 0, sie beginnt links und lässt sich nach rechts verschieben. (Eine Lösung mit width: max-content
   rechnete Safari aus dem ungebrochenen Text und zeigte die Seite zu weit rechts.) */
.docview .docx-wrapper { background: #e5e7eb; align-items: flex-start; }
.docview .docx-wrapper > section.docx { margin-left: auto; margin-right: auto; flex-shrink: 0; }
/* Lange Platzhalter ({{zeile.probenahme_datum}}) dürfen in Tabellenzellen umbrechen, sonst wird die Tabelle breiter als die Seite
   (Word bricht bei festen Spaltenbreiten ebenfalls um; docx-preview beachtet feste Breiten nicht) */
.docview .docx-wrapper td, .docview .docx-wrapper td span { overflow-wrap: anywhere; }
/* Voraussichtliche Seitengrenze in der Word-Vorschau (docx-pages.js, Beschluss 17.11.2026) */
.page-estimate { position: absolute; left: -1.5rem; right: -1.5rem; height: 0; border-top: 1px dashed #8a8f98; pointer-events: none; z-index: 2; }
.page-estimate span { position: absolute; right: 0; top: -0.75rem; padding: 0 0.3rem; font: 600 9px/1.4 system-ui, sans-serif; color: #5f6670;
    background: #fff; border: 1px dashed #8a8f98; border-radius: 0.25rem; }
.docview-pages { font-size: 0.85rem; color: var(--muted, #555); margin-left: 0.5rem; }
@media print { .page-estimate { display: none; } }

/* Rundgang auf der Startseite (T4) */
.tour-list { list-style: none; padding: 0; margin: 0.5rem 0 0.75rem; display: grid; gap: 0.4rem; }
.tour-list li { display: flex; align-items: flex-start; gap: 0.6rem; }
.tour-list form { margin: 0; }
.tour-check { width: 1.4rem; height: 1.4rem; border: 2px solid var(--border); border-radius: 0.3rem; background: var(--surface);
    color: var(--primary); font-weight: 700; line-height: 1; padding: 0; cursor: pointer; }
.tour-done a, .tour-done span { color: var(--muted, #6b7280); text-decoration: line-through; }
/* Demo-Zugänge auf der Anmeldeseite (T3b) */
.demo-logins { margin-top: 1.25rem; border-top: 1px solid var(--border); padding-top: 0.75rem; }
.demo-logins h2 { font-size: 1rem; margin: 0 0 0.25rem; }
.demo-login { width: 100%; display: flex; flex-direction: column; align-items: flex-start; gap: 0.1rem; margin-top: 0.5rem; text-align: left; }
.login-card.welcome-card { max-width: 52rem; width: calc(100% - 2rem); }
.welcome-cards { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr)); margin-top: 1rem; }
/* Eingeklapptes Menü, das beim Darüberfahren überlagernd aufklappt (16rem): der Balken rückt mit, statt über dem Menükopf zu liegen
   (gemeldet 12.11.2026) */
html[data-nav="collapsed"] .app-header:has(:focus-visible) .test-banner { left: 16rem; }
@media (hover: hover) {
    html[data-nav="collapsed"] .app-header:hover .test-banner { left: 16rem; }
}
@media (max-width: 899px) {
    .test-banner { top: var(--bar-h); left: 0; }
    body:has(.test-banner) > main.content { margin-top: 0; padding-top: calc(var(--bar-h) + var(--banner-h) + 1rem); }
    .login-page .test-banner { top: 0; }
    /* Der Balken steckt im Kopfbereich, der hier zugleich die Schublade ist: bei offener Schublade läge er über dem ersten
       Menüeintrag (gemeldet 10.11.2026). Solange sie offen ist, ausblenden; beim Schließen erscheint er wieder. */
    html[data-drawer="open"] .test-banner { display: none; }
}
@media print {
        .test-banner { left: 0; top: 0; }
}

/* Über diese Anwendung: großes Herstellerlogo */
.about-logo { margin: 0.5rem 0 1rem; line-height: 0; }
.about-logo img { height: 6rem; width: auto; }

/* Herstellerlogo oben links anstelle des Tabellen-Symbols; auf der Anmeldeseite über dem Titel */
.brand-logo { height: 2rem; width: auto; flex: none; }
.login-logo { margin: 0 0 0.75rem; text-align: center; line-height: 0; }
.login-help { margin-top: 1rem; font-size: 0.875rem; color: var(--muted); }
.login-help summary { cursor: pointer; }
.login-help-code { display: block; margin: 0.25rem 0; padding: 0.3rem 0.5rem; background: var(--bg); border-radius: 0.25rem; overflow-x: auto; white-space: nowrap; }
.login-logo img { height: 4rem; width: auto; }

/* Auswertungstabelle auf dem Telefon: Vorrang haben die Werte. Die Messungsspalte wird schmal (Anfang des Namens, Tooltip und
   "Lange Namen umbrechen" zeigen mehr), die Grenzwertspalte scrollt mit, und im Hochformat weist ein Hinweis auf das Querformat hin. */
.landscape-hint { display: none; }
@media (max-width: 40rem) {
    .eval-table .sticky-col { width: 6.5rem; min-width: 6.5rem; max-width: 6.5rem; box-shadow: 1px 0 0 var(--border); }
    .eval-table .sticky-col-2 { position: static; box-shadow: none; min-width: 3.5rem; }
    .eval-table .sticky-col .hint { display: none; }
    .wrap-names .eval-table .sticky-col .hint { display: block; margin-left: 0; }
}
@media (max-width: 40rem) and (orientation: portrait) {
    .landscape-hint { display: block; }
}
@media print { .landscape-hint { display: none; } }

/* ===== Geführte Einweisung (static/js/tour.js) ===== */
.tour-blocker { position: fixed; inset: 0; z-index: 1000; }
.tour-dim { background: rgba(15, 25, 40, 0.55); }
.tour-spot { position: fixed; z-index: 1001; display: none; pointer-events: none; border-radius: 0.5rem;
    box-shadow: 0 0 0 3px #fff, 0 0 0 9999px rgba(15, 25, 40, 0.55); }
.tour-pop { position: fixed; z-index: 1002; width: min(26rem, calc(100vw - 1rem)); max-height: calc(100vh - 1rem); overflow-y: auto;
    box-sizing: border-box; padding: 1.1rem 1.25rem; background: var(--surface); color: var(--text); border-radius: 0.75rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.35); }
.tour-pop h3 { margin: 0 0 0.5rem; font-size: 1.15rem; }
.tour-pop p { margin: 0.4rem 0; }
.tour-pop ul { margin: 0.5rem 0; padding-left: 1.2rem; }
.tour-pop li { margin: 0.3rem 0; }
.tour-count { color: var(--muted); font-size: 0.85rem; }
.tour-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 0.5rem; margin-top: 0.9rem; }
@media print { .tour-blocker, .tour-spot, .tour-pop { display: none; } }

/* Über diese Anwendung: großes Bild und Änderungsverlauf */
.about-hero { margin: 0.5rem 0 1rem; line-height: 0; }
.about-hero img { width: 100%; max-width: 40rem; height: auto; border-radius: 0.75rem; }
.changelog { margin: 0.4rem 0; padding: 0.4rem 0.75rem; background: var(--surface); border: 1px solid var(--border); border-radius: 0.5rem; }
.changelog summary { cursor: pointer; font-weight: 600; }
.changelog ul { margin: 0.5rem 0; padding-left: 1.2rem; }
.changelog li { margin: 0.3rem 0; }
/* Zusammengefasster Verlauf (Beschluss 12.11.2026): Höhepunkte mit Stern und fett, Datum/Version klein dahinter */
.changelog-latest h3 { margin: 0.2rem 0; font-size: 1rem; }
.changelog-highlight { font-weight: 600; }
.changelog-star { color: var(--primary); margin-right: 0.2rem; }
.changelog-meta { color: var(--muted); font-size: 0.8rem; font-weight: normal; white-space: nowrap; margin-left: 0.3rem; }
.changelog-all h4 { margin: 0.75rem 0 0.2rem; font-size: 0.9rem; }

/* Hilfe: Kurzanleitung */
.help-doc { max-width: 52rem; }
.help-doc h2 { margin-top: 2rem; }
.help-doc h3 { margin-top: 1.5rem; }
.help-doc h2[id], .help-doc h3[id] { scroll-margin-top: 1rem; }
.help-toc { margin: 1rem 0; padding: 0.5rem 1rem; background: var(--surface); border: 1px solid var(--border); border-radius: 0.5rem; }
.help-toc ul { margin: 0.2rem 0; padding-left: 1.2rem; list-style: none; }
.help-toc li { margin: 0.25rem 0; }
.help-table { border-collapse: collapse; margin: 0.75rem 0; width: 100%; }
.help-table th, .help-table td { border: 1px solid var(--border); padding: 0.4rem 0.6rem; text-align: left; vertical-align: top; }
.help-table th { background: var(--surface); }
.help-figure { margin: 1rem 0; }
.help-figure img { max-width: 100%; height: auto; border: 1px solid var(--border); border-radius: 0.5rem; }
@media print { .help-toc { display: none; } }

/* Eingabe chargenbezogener Listen */
.batch-plan { margin: 1rem 0; padding: 0.5rem 1rem; background: var(--surface); border: 1px solid var(--border); border-radius: 0.5rem; }
.batch-list { margin: 0.5rem 0; padding-left: 1.4rem; }
.batch-item { margin: 0.4rem 0; }
.batch-edit { margin: 0.3rem 0 0.6rem; }
.batch-edit summary { cursor: pointer; color: var(--muted); }
.batch-edit form { margin: 0.5rem 0; }
.batch-block { margin: 1.5rem 0; }
.batch-block h2 small { font-weight: normal; margin-left: 0.5rem; }

/* Speichern-Leiste der Eingabemasken: bleibt am unteren Fensterrand, solange das Formular im Bild ist */
.save-bar { position: sticky; bottom: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: 1rem;
    margin-top: 1rem; padding: 0.6rem 0.8rem; background: var(--surface); border-top: 1px solid var(--border); box-shadow: 0 -2px 6px rgba(0, 0, 0, 0.08); }
.save-state { color: var(--muted); }
/* Eingabe: Kästchen "Alle angezeigten Proben anhaken" über der Tabelle, große Touch-Fläche */
.check-all { display: inline-flex; align-items: center; gap: 0.5rem; margin: 0.5rem 0; min-height: 2.75rem; }
/* Schaltfläche in der Leiste: nur so groß wie ihr Text, LINKS, der Text ("Nicht gespeicherte Änderungen") rechts daneben
   (Beschluss 6.11.2026); gilt für alle Masken. Die Hauptschaltfläche steht immer zuerst, unabhängig von der Reihenfolge im HTML. */
.save-bar { justify-content: flex-start; }
.save-bar .btn-primary { order: -1; }
.save-bar .save-state { order: 1; }
.save-bar .btn, .save-bar .btn-primary { width: auto; margin-top: 0; min-height: 2.25rem; padding: 0.3rem 1rem; font-size: 0.95rem; }
.save-bar.is-dirty .save-state { color: inherit; font-weight: 600; }
.field-missing { outline: 2px solid var(--danger, #b3261e); outline-offset: 1px; }

/* Auswertung: Einstieg ohne Auswahl */
.eval-choose { margin: 1.25rem 0; }
.eval-choose-title { font-weight: 600; margin: 0 0 0.6rem; }
.eval-choose-list { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.eval-choose-item { text-decoration: none; display: inline-flex; align-items: center; min-height: 2.75rem; }

/* Eingabe: Gruppen der Listenauswahl */
.group-title { font-size: 1.1rem; margin: 1.25rem 0 0.5rem; }
.group-done { margin: 1.5rem 0; }
.group-done summary { padding-top: 0.4rem; padding-bottom: 0.4rem; }
.group-done[open] summary { margin-bottom: 0.5rem; }
.plan-preview { max-width: 100%; height: auto; border: 1px solid #ccc; }

/* Raumplan: Plan mit Markierungen (Bearbeiten durch den Administrator) */
.plan-editor { display: flex; gap: 16px; flex-wrap: wrap; align-items: flex-start; }
.plan-stage { position: relative; display: inline-block; max-width: 100%; line-height: 0; cursor: crosshair; border: 1px solid #ccc; touch-action: none; }
.plan-image { display: block; max-width: 100%; height: auto; user-select: none; }
.plan-marker { position: absolute; width: 18px; height: 18px; margin: -9px 0 0 -9px; border-radius: 50%; background: #1b6ec2; border: 2px solid #fff; box-shadow: 0 0 0 1px #333; cursor: grab; touch-action: none; }
.plan-panel { min-width: 260px; max-width: 360px; padding: 0.75rem 1rem 1rem; border: 1px solid var(--border); border-radius: 0.6rem; background: var(--surface); box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12); }
.plan-panel[hidden] { display: none; }
.plan-panel h2 { margin-top: 0; }
.plan-panel-buttons { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; margin-top: 0.75rem; }
.plan-panel-buttons .btn { margin: 0; white-space: nowrap; }
.plan-panel-buttons button[hidden] { display: none; }
.plan-location-list { list-style: none; margin: 8px 0; padding: 0; max-height: 320px; overflow-y: auto; }
.plan-location-list li[hidden] { display: none; }
.plan-taken { opacity: 0.45; }
@media print { .plan-panel { display: none; } }

/* Bestätigungsdialog (Testsystem zurücksetzen) */
.confirm-dialog { width: min(92vw, 28rem); padding: 1rem 1.25rem; border: 1px solid var(--border); border-radius: 0.6rem; background: var(--surface); color: var(--text); }
.confirm-dialog::backdrop { background: var(--backdrop, rgba(0, 0, 0, 0.25)); }
.confirm-dialog input[type="text"] { width: 100%; margin-top: 0.25rem; }
.confirm-dialog-buttons { display: flex; justify-content: flex-end; gap: 0.75rem; margin-top: 1rem; }

/* Raumplan für Benutzer */
.plan-stage-view { cursor: default; touch-action: auto; }
.plan-marker-view { padding: 0; font: inherit; cursor: pointer; }
.plan-marker-view:hover, .plan-marker-view:focus-visible { outline: 3px solid var(--primary); outline-offset: 2px; }
.plan-marker-empty { background: #9aa5b1; cursor: default; }
.plan-marker-name, .plan-choices { display: none; }
.plan-choose-list { list-style: none; margin: 0.5rem 0; padding: 0; max-height: 50vh; overflow-y: auto; line-height: 1.4; }
.plan-choose-list li { padding: 0.5rem 0; border-bottom: 1px solid var(--border); }
.plan-choose-list li:last-child { border-bottom: 0; }
.plan-choose-list a { font-weight: 600; }
.plan-choose-list .hint { margin-left: 0.5rem; }

/* Raumplan-Liste: Vorschau in fester Höhe (etwa drei Zeilen) */
.plan-thumb-cell { width: 9rem; padding-top: 0.25rem; padding-bottom: 0.25rem; }
.plan-thumb { display: block; height: 4.5rem; max-width: 8rem; width: auto; object-fit: contain; border: 1px solid var(--border); background: #fff; }
.plan-upload-title { margin-top: 2rem; }

/* Statusfarbe der Markierungen im Raumplan: Farbe und Zeichen (nie nur Farbe) */
.plan-state-ok { background: #1f7a4d; }
.plan-state-violation { background: #b3261e; }
.plan-state-none { background: #9aa5b1; }
.plan-state-ok::after { content: "\2713"; }
.plan-state-violation::after { content: "\2715"; }
.plan-state-none::after { content: "\2013"; }
.plan-marker-view { display: flex; align-items: center; justify-content: center; width: 22px; height: 22px; margin: -11px 0 0 -11px; color: #fff; font-size: 14px; font-weight: 700; line-height: 1; }
.plan-marker-view::before { content: ""; position: absolute; inset: -12px; }
.plan-marker-empty::after { content: none; }
.plan-state { display: inline-flex; align-items: center; justify-content: center; width: 1.2rem; height: 1.2rem; border-radius: 50%; vertical-align: -0.25rem; margin-right: 0.25rem; border: 1px solid #fff; box-shadow: 0 0 0 1px #333; color: #fff; font-size: 0.8rem; font-weight: 700; line-height: 1; }
.plan-legend { display: flex; flex-wrap: wrap; gap: 0.5rem 1.25rem; align-items: center; margin: 0.75rem 0 0.25rem; }
.plan-last { margin-left: 1.7rem; }
@media (max-width: 40rem) {
    .plan-choose-list li { padding: 0.75rem 0; }
    .plan-marker-view { width: 26px; height: 26px; margin: -13px 0 0 -13px; font-size: 16px; }
}
.plan-preview-link { position: relative; display: inline-block; max-width: 100%; line-height: 0; }
.plan-marker-readonly { background: #9aa5b1; cursor: pointer; }
.plan-preview-link .plan-preview { cursor: pointer; }

/* Aufklappbare Bereiche (details/summary), einheitlich in der ganzen Anwendung (Beschluss 12.11.2026): statt des kleinen Dreiecks des
   Browsers ein Pfeil in einem runden Feld links vor der Kopfzeile, nach rechts = zugeklappt, nach unten = aufgeklappt; dunkler bei
   Maus oder Tastaturfokus. Nur CSS. --sum-pad = linker Innenabstand der Kopfzeile (Kopfzeilen mit Rahmen setzen ihn). */
summary { --sum-pad: 0rem; list-style: none; cursor: pointer; position: relative; min-height: 1.75rem;
    padding-left: calc(var(--sum-pad) + 2.1rem); }
summary::-webkit-details-marker { display: none; }
summary::before { content: ""; position: absolute; left: var(--sum-pad); top: 50%; width: 1.5rem; height: 1.5rem; margin-top: -0.75rem;
    border-radius: 50%; background: color-mix(in srgb, var(--primary) 12%, transparent); transition: background-color 0.15s; }
summary::after { content: ""; position: absolute; left: calc(var(--sum-pad) + 0.48rem); top: 50%; width: 0.42rem; height: 0.42rem;
    margin-top: -0.27rem; border-right: 2px solid var(--primary); border-bottom: 2px solid var(--primary); transform: rotate(-45deg);
    transition: transform 0.15s; }
details[open] > summary::after { transform: rotate(45deg); margin-top: -0.38rem; left: calc(var(--sum-pad) + 0.52rem); }
summary:hover::before, summary:focus-visible::before { background: color-mix(in srgb, var(--primary) 24%, transparent); }

@media print { summary::before, summary::after { display: none; } summary { padding-left: 0; } }

/* Berichte: Voransicht der ersten Seite (report-thumbs.js, Beschluss 12.11.2026). Die Seite wird in Originalgröße gezeichnet und mit
   transform verkleinert; .doc-thumb-box schneidet auf die erste Seite zu. Vor dem Laden und bei Fehlern steht das Dokument-Symbol. */
.doc-thumb-cell { width: 4.5rem; padding-top: 0.3rem; padding-bottom: 0.3rem; }
.doc-thumb { display: inline-block; text-decoration: none; line-height: 0; }
.doc-thumb-box { display: flex; align-items: center; justify-content: center; position: relative; overflow: hidden; width: 4rem;
    height: 2.9rem; background: #fff; border: 1px solid var(--border); border-radius: 0.2rem; color: var(--muted); }
.doc-thumb.is-ready .doc-thumb-box { display: block; }
.doc-thumb.is-ready .doc-thumb-box > .icon { display: none; }
.doc-thumb:hover .doc-thumb-box, .doc-thumb:focus-visible .doc-thumb-box { border-color: var(--primary); box-shadow: 0 0 0 2px color-mix(in srgb, var(--primary) 25%, transparent); }
.doc-thumb-inner { position: absolute; left: 0; top: 0; transform-origin: 0 0; pointer-events: none; }
.doc-thumb-inner section { background: #fff; margin: 0; box-shadow: none; }
.doc-thumb-large .doc-thumb-box { width: 100%; height: 14rem; }
.doc-thumb-large { display: block; }
.doc-thumb-large .doc-thumb-box .icon { width: 2.5rem; height: 2.5rem; }
#doc-thumb-pop { position: fixed; z-index: 50; overflow: hidden; background: #fff; border: 1px solid var(--border); border-radius: 0.3rem;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.25); pointer-events: none; }
#doc-thumb-pop .doc-thumb-inner { position: absolute; }

.due-overdue { color: var(--warn-strong, #b45309); font-weight: 600; }

/* Dialog "Server wird gerade aktualisiert" (busy.js, Beschluss 12.11.2026) */
.server-away { max-width: 28rem; border: 1px solid var(--border); border-radius: 0.6rem; padding: 1rem 1.25rem; }
.server-away::backdrop { background: var(--backdrop, rgba(0, 0, 0, 0.25)); }
.server-away h2 { margin-top: 0; }
.server-away-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-top: 0.75rem; }
.server-away-actions .btn { margin-top: 0; }

/* Seite "Heute" (Scheibe H, Beschluss 12.11.2026): drei Karten nebeneinander, auf schmalen Bildschirmen untereinander */
.today-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(19rem, 1fr)); align-items: start; margin-top: 0.75rem; }
.today-card { background: var(--surface); border: 1px solid var(--border); border-top: 4px solid var(--nav-color, var(--area-color, var(--primary)));
    border-radius: 0.6rem; padding: 0.75rem 1rem 0.9rem; }
.today-card[data-area="entry"] { --nav-color: var(--area-entry); }
.today-card[data-area="tasks"] { --nav-color: var(--area-tasks); }
.today-card[data-area="eval"] { --nav-color: var(--area-eval); }
.today-card h2 .icon { color: var(--nav-color); }
.today-card h2 { display: flex; align-items: center; gap: 0.5rem; margin: 0 0 0.5rem; font-size: 1.1rem; }
.today-card h2 a { color: var(--text); text-decoration: none; }
.today-card h2 a:hover { text-decoration: underline; }
.today-list { list-style: none; margin: 0; padding: 0; }
.today-list li + li { border-top: 1px solid var(--border); }
.today-list a { display: flex; flex-direction: column; gap: 0.1rem; padding: 0.5rem 0.25rem; min-height: 2.75rem; color: var(--text); text-decoration: none; border-radius: 0.3rem; }
.today-list a:hover, .today-list a:focus-visible { background: color-mix(in srgb, var(--primary) 7%, transparent); }
.today-main { display: flex; align-items: flex-start; gap: 0.4rem; }

.today-main strong { min-width: 0; }
.today-sub { display: flex; align-items: center; gap: 0.35rem; flex-wrap: wrap; color: var(--muted); font-size: 0.85rem; }
.today-mine { font-size: 0.7rem; font-weight: 700; padding: 0 0.4rem; border-radius: 999px; background: color-mix(in srgb, var(--primary) 15%, transparent); color: var(--primary); }
.today-list li.is-overdue .today-sub { color: var(--warn-strong, #b45309); }
.today-done { display: flex; align-items: center; gap: 0.4rem; color: var(--ok-text, #1b6e3a); font-weight: 600; margin: 0.25rem 0; }
.today-summary { margin: 0 0 0.25rem; font-weight: 600; }
.today-card.is-updated { animation: today-card-glow 1.4s ease-out; }
@keyframes today-card-glow { 0% { box-shadow: 0 0 0 0.35rem color-mix(in srgb, var(--primary) 35%, transparent); } 100% { box-shadow: 0 0 0 0 transparent; } }

/* Seite "Verwaltung" (Beschluss 13.11.2026): zwei Gruppen Stammdaten und System, je mit Überschrift und Kachelraster */
.admin-group { margin: 1.25rem 0 1.75rem; scroll-margin-top: 4rem; }
.admin-group h2 { margin-bottom: 0.15rem; }
.admin-group .card-grid { margin-top: 0.6rem; }

/* Kompakte Tabellendarstellung: je Tabelle und Benutzer (Symbol in der Tabellenleiste, filter.js setzt .is-compact an Tabelle und Leiste) */
.table.is-compact { font-size: 0.9rem; line-height: 1.2; }
.table.is-compact th, .table.is-compact td { padding: 0.12rem 0.4rem; }
.table.is-compact th { font-size: 0.78rem; }
.table.is-compact .hint { margin: 0; }
.table.is-compact input[type="checkbox"] { width: 1.1rem; height: 1.1rem; }
.table.is-compact.entry-table input[type="text"], .table.is-compact .task-form input[type="text"] { min-height: 2rem; padding-top: 0.1rem; padding-bottom: 0.1rem; font-size: 1rem; }
.table.is-compact .value-cell { gap: 0.15rem; }
.table.is-compact .state-mark { width: 0.9rem; }
.table.is-compact .info-btn { width: 1.5rem; height: 1.5rem; font-size: 0.85rem; }
.filter-bar.is-compact { margin: 0.25rem 0; gap: 0.4rem; }
.table.is-compact .filter-row th { padding: 0.1rem 0.25rem; }
.table.is-compact .filter-row .filter-input { padding: 0.1rem 0.3rem; font-size: 0.8rem; }
.filter-bar.is-compact .table-export .icon-btn { padding: 0.1rem 0.3rem; }
.table.is-compact.eval-table { line-height: 1.1; }
.table.is-compact.eval-table th, .table.is-compact.eval-table td { padding: 0.04rem 0.25rem; }
.table.is-compact.eval-table td.eval-cell { padding: 0; }
.table.is-compact.eval-table th.eval-day, .table.is-compact.eval-table td.eval-cell { min-width: 1.9rem; }
.table-export .icon-btn[aria-pressed="true"] { color: var(--primary); border-color: var(--primary); }
/* Auf dem Telefon bleiben Eingabefelder zum Antippen groß */
@media (max-width: 40rem) {
    .table.is-compact.entry-table input[type="text"], .table.is-compact .task-form input[type="text"] { min-height: 2.75rem; }
    .table.is-compact .info-btn { width: 2rem; height: 2rem; }
}

/* Wartebalken (busy.js): schmaler Balken oben, erscheint erst nach 400 ms; Zeiger mit Sanduhr; abgeschicktes Formular gesperrt */
html.is-busy, html.is-busy * { cursor: progress !important; }
#busy-bar { position: fixed; inset: 0 0 auto 0; width: 100%; height: 3px; margin: 0; padding: 0; border: 0; overflow: hidden;
    background: transparent; z-index: 1000; pointer-events: none; }
#busy-bar:not([popover]) { display: none; }
#busy-bar:not([popover]).is-visible { display: block; }
#busy-bar span { display: block; height: 100%; width: 35%; background: var(--primary); animation: busy-slide 1.1s ease-in-out infinite; }
@keyframes busy-slide { 0% { margin-left: -35%; } 100% { margin-left: 100%; } }
@media (prefers-reduced-motion: reduce) {
    #busy-bar span { width: 100%; animation: none; opacity: 0.6; }
}
form[data-submitted] button[type="submit"], form[data-submitted] input[type="submit"] { opacity: 0.6; pointer-events: none; }

@keyframes report-step-flash { from { background: color-mix(in srgb, var(--area-eval, #2563eb) 25%, transparent); } to { background: transparent; } }

.copy-btn { margin-top: 0; white-space: nowrap; }
.copy-btn.is-copied { color: var(--ok-text, #1b5e20); }

/* Audit Trail: Hinweis bei Abweichung und Prüfkasten (Scheibe I, Beschluss 13.11.2026) */
.audit-alarm a { margin-left: 0.5rem; }
.audit-integrity { border: 1px solid var(--border, #d0d7de); border-radius: 8px; padding: 0.75rem 1rem; margin: 0 0 1rem; background: #fff; }
.audit-integrity.is-ok { border-left: 4px solid var(--ok-text, #1b6e3a); }
.audit-integrity.is-bad { border-left: 4px solid var(--error-text, #8a1c1c); background: var(--error-bg, #fde8e8); }
.audit-integrity .state { font-weight: 600; }
.audit-integrity .check-value { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; white-space: nowrap; }
.audit-integrity form { display: inline; }
.audit-integrity .actions { display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: center; margin-top: 0.5rem; }
.audit-integrity a.audit-export { display: inline-flex; align-items: center; text-decoration: none; }

/* Verweise der Berichtsvorlagen auf Messlisten (Beschluss 16.11.2026) */
.due-blocked { color: var(--warn-strong, #b45309); font-weight: 600; white-space: nowrap; }
.due-blocked a { margin-left: 0.4rem; font-weight: 400; }
.template-list-warn { display: inline-block; margin-left: 0.4rem; color: var(--warn-strong, #b45309); font-weight: 600; text-decoration: none; }
.template-lists form.relink { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; margin: 0.5rem 0; }
.template-lists form.relink select { width: auto; min-width: 16rem; }
.template-lists form.relink .btn { margin-top: 0; }
.list-rename-warn ul { margin: 0.25rem 0 0.5rem 1.25rem; }

/* Fassungen einer Berichtsvorlage (Beschluss 16.11.2026) */
.template-versions .row-current td { background: color-mix(in srgb, var(--primary) 6%, var(--surface, #fff)); }
.template-versions .version-active { color: var(--ok-text, #1b6e3a); }
.template-versions .version-warn { display: block; color: var(--warn-strong, #b45309); font-weight: 600; font-size: 0.85em; }
.template-versions .version-actions { white-space: nowrap; }
.template-versions .version-actions form { display: inline; margin-right: 0.4rem; }
.template-versions .version-actions .btn { margin-top: 0; }
.template-versions .version-actions a { margin-right: 0.5rem; }

/* Arbeitsfreier Tag (Beschluss 17.11.2026): Hinweis auf „Heute“ */
.today-free { margin: 0.25rem 0 0.5rem; padding: 0.4rem 0.6rem; border-radius: 0.4rem; background: var(--surface-muted, #f1f3f5); font-size: 0.9rem; }
th.col-free .free-name { display: block; font-size: 0.7rem; font-weight: 400; line-height: 1.15; max-width: 6.5rem; white-space: normal; color: var(--muted, #555); }
td.col-free { color: var(--muted, #666); }
@media print { th.col-free, td.col-free { print-color-adjust: exact; -webkit-print-color-adjust: exact; } }

/* Ausgefallene Messungen mit Bemerkung unter dem Ergebnis (Beschluss 17.11.2026), wird mitgedruckt */
.failure-notes { margin: 0.75rem 0; }
.failure-notes h3 { font-size: 0.95rem; margin: 0 0 0.25rem; }
.failure-notes ul { margin: 0; padding-left: 1.1rem; font-size: 0.9rem; }
.failure-notes li { margin: 0.1rem 0; }
.failure-mark { font-weight: 600; }

.is-struck { text-decoration: line-through; }

/* Voraussichtliche Seitengrenze in der Word-Vorschau (docx-pages.js, Beschluss 17.11.2026) */
.page-estimate { position: absolute; left: -1.5rem; right: -1.5rem; height: 0; border-top: 1px dashed #8a8f98; pointer-events: none; z-index: 2; }
.page-estimate span { position: absolute; right: 0; top: -0.75rem; padding: 0 0.3rem; font: 600 9px/1.4 system-ui, sans-serif; color: #5f6670;
    background: #fff; border: 1px dashed #8a8f98; border-radius: 0.25rem; }

@media print { .page-estimate { display: none; } }

/* Wirksame Rechte mit Herkunft (Schnitt 0d/G3): eine Zeile je Recht */
.permission-sources { list-style: none; padding: 0; margin: 0.5rem 0 0; }
.permission-sources li { padding: 0.3rem 0; border-bottom: 1px solid var(--border); }
.permission-sources li:last-child { border-bottom: 0; }

/* Auswahllisten (Schnitt 1c): Pfeile zum Verschieben nebeneinander */
.move-buttons { display: flex; gap: 0.35rem; align-items: center; }
.move-buttons form { margin: 0; }
/* Gesperrte Schaltflächen sichtbar blasser (zum Beispiel ↑ beim ersten Wert) */
.btn:disabled { opacity: 0.35; cursor: default; }

/* Import von Stammdaten (Schnitt 1d) */
.import-text { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 0.85rem; white-space: pre; }
.import-columns { padding-left: 1.2rem; }
.import-columns li { margin: 0.2rem 0; }
.import-error td { color: var(--error-text, #8a1c1c); }

/* Felder, die nur bei einem Werttyp gelten (Messgröße, Schnitt 2a) */
.field-group { border: 1px solid var(--border); border-radius: 8px; padding: 0.5rem 0.9rem 0.9rem; margin: 1rem 0 0; min-width: 0; }
.field-group legend { font-weight: 600; padding: 0 0.3rem; }

/* Formeln (Schnitt 2c) */
.formula-text { font-family: ui-monospace, Menlo, Consolas, monospace; }
.formula-values { display: flex; flex-wrap: wrap; gap: 0.5rem 1rem; }
.formula-values label.plain { display: flex; align-items: center; gap: 0.4rem; }
.formula-values input { width: 8rem; }
.formula-result { font-size: 1.1rem; margin: 0.6rem 0 0; }

/* Spezifikationen einer Messgröße (Schnitt 3a) */
.spec-list { padding-left: 1.2rem; }
.spec-list li { margin: 0.25rem 0; }

/* Bewertung im Prüfer der Spezifikationen (Schnitt 3b): rot nur für Verletzungen */
.verdict { padding: 0.6rem 0.8rem; border-radius: 8px; border: 1px solid var(--border); }
.verdict-OK { border-color: var(--ok-text, #1b6e3a); }
.verdict-WARNING { border-color: var(--warn-strong, #b45309); }
.verdict-VIOLATION { border-color: var(--error-text, #8a1c1c); color: var(--error-text, #8a1c1c); }
.verdict-NOT_EVALUABLE { border-style: dashed; }

/* Prüfpläne (Schnitt 4a): gezeigte Version hervorheben */
.row-selected td { background: color-mix(in srgb, var(--area, var(--primary)) 8%, transparent); font-weight: 600; }
/* Text und Schaltfläche nebeneinander in einer Tabellenzelle (ohne die Zelle selbst zum Flex-Element zu machen) */
.inline-actions { display: flex; gap: 0.5rem; align-items: center; }
.inline-actions form { margin: 0; }

/* Darstellungsdichte (Einstellung ui.density, nav-early.js setzt data-density vor dem Zeichnen). Fast alle Maße sind in rem,
   deshalb genügt die kleinere Grundschrift; dazu engere Zeilen und Abstände. Normal braucht nichts. */
html[data-density="compact"] { font-size: 81.25%; } /* 13px */
html[data-density="dense"] { font-size: 75%; }      /* 12px */
html[data-density="compact"] body { line-height: 1.35; }
html[data-density="dense"] body { line-height: 1.25; }
html[data-density] label { margin-top: 0.6rem; }
html[data-density] .section { margin-top: 1.25rem; padding-top: 0.75rem; }
html[data-density] .content { padding: 0.75rem; }
html[data-density] .btn-primary { margin-top: 1rem; }
html[data-density="compact"] .table th, html[data-density="compact"] .table td { padding: 0.4rem 0.6rem; }
html[data-density="dense"] .table th, html[data-density="dense"] .table td { padding: 0.2rem 0.45rem; }
html[data-density="dense"] .btn, html[data-density="dense"] input[type="text"], html[data-density="dense"] input[type="password"],
html[data-density="dense"] input[type="date"], html[data-density="dense"] input[type="number"], html[data-density="dense"] select {
    min-height: 2.25rem; }
/* Touch-Geräte: Tippflächen bleiben mindestens 36px hoch, Felder behalten 16px Schrift (sonst vergrößert iOS beim Antippen) */
@media (pointer: coarse) {
    html[data-density] .btn, html[data-density] input[type="text"], html[data-density] input[type="password"],
    html[data-density] input[type="date"], html[data-density] input[type="number"], html[data-density] input[type="datetime-local"],
    html[data-density] select, html[data-density] .user-menu a, html[data-density] .user-menu button { min-height: 36px; }
    html[data-density] input, html[data-density] select, html[data-density] textarea { font-size: 16px; }
}

/* Probenahmen (P1): überfällige Termine */
.text-alarm { color: var(--error-text); font-weight: 600; }
.row-overdue td { background: var(--error-bg); }

/* Werte erfassen (Schnitt 6b): Bewertung als Kennzeichen, schmale Eingabefelder, Ausreißer durchgestrichen */
.eval { display: inline-block; padding: 0.05rem 0.45rem; border-radius: 0.4rem; font-size: 0.85rem; border: 1px solid var(--border); white-space: nowrap; }
.eval-CONFORM { color: #1b6e3a; border-color: #1b6e3a; }
.eval-WARNING { color: #b45309; border-color: #b45309; background: #fff7e6; }
.eval-VIOLATION { color: var(--error-text); border-color: var(--error-text); background: var(--error-bg); font-weight: 600; }
.eval-NOT_EVALUABLE { border-style: dashed; }
.eval-NO_SPEC, .eval-NO_VALUE { color: var(--muted); }
.strike { text-decoration: line-through; }

/* Ergebnistabelle (Schnitt 6c): Kopfzeile und die ersten beiden Spalten bleiben beim Blättern stehen (wie "Fenster fixieren"),
   Zeilen mit Verletzung hinterlegt, Speichern-Leiste bleibt unten sichtbar. Maße in rem (Darstellungsdichte). */
.section-head { justify-content: space-between; }
.section-head h2 { margin: 0; }
.view-switch { display: inline-flex; border: 1px solid var(--border); border-radius: 0.5rem; overflow: hidden; }
.view-switch a { padding: 0.3rem 0.8rem; text-decoration: none; color: var(--text); background: var(--surface); }
.view-switch a.active { background: var(--primary); color: var(--primary-text); }
.grid-wrap { max-height: calc(100vh - 9rem); overflow: auto; margin-top: 1rem; border: 1px solid var(--border); }
.grid-wrap .result-grid thead { position: sticky; top: 0; z-index: 3; }
.grid-wrap .result-grid thead th, .grid-wrap .result-grid thead td { background: var(--bg); }
.result-grid .col-fix1 { position: sticky; left: 0; z-index: 1; background: var(--surface); min-width: 6.5rem; max-width: 6.5rem;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.result-grid .col-fix2 { position: sticky; left: 6.5rem; z-index: 1; background: var(--surface); box-shadow: 1px 0 0 var(--border); }
.result-grid thead .col-fix1, .result-grid thead .col-fix2 { z-index: 4; background: var(--bg); }
.result-grid td, .result-grid th { vertical-align: middle; padding: 0.2rem 0.5rem; }
.result-grid tr.row-violation td { background: var(--error-bg); }
.result-grid .grid-value { white-space: nowrap; } /* nicht .value-cell: die Klasse ist aus hm belegt (display: flex) */
/* spezifischer als die Regeln der Darstellungsdichte für Eingabefelder, damit die Zeilen niedrig bleiben (Touch: 36px, siehe unten) */
.result-grid input.value-input.grid-input { width: 6.5rem; min-height: 1.9rem; padding: 0.15rem 0.45rem; }
.result-grid label.outlier, .result-grid label.outlier input { vertical-align: middle; }
.result-grid .result-cell { white-space: nowrap; }
.result-grid select.grid-input.grid-input { width: auto; min-height: 1.9rem; padding: 0.15rem 0.45rem; }
.result-grid label.outlier { display: inline-flex; align-items: center; gap: 0.15rem; margin: 0 0 0 0.25rem; font-weight: 400; font-size: 0.8rem; }
.result-grid label.outlier input { width: auto; min-height: 0; }
.grouped-test { margin-top: 1.25rem; }
.grouped-test h3 { margin: 0 0 0.4rem; font-size: 1rem; }
.sticky-save { position: sticky; bottom: 0; z-index: 5; background: var(--bg); padding: 0.4rem 0; border-top: 1px solid var(--border);
    display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; }
.sticky-save .btn-primary { width: auto; margin-top: 0; }
.sticky-save label { margin: 0; }
.sticky-save input[type="text"] { flex: 1 1 14rem; width: auto; min-height: 2.25rem; }
.tests-overview { margin-top: 0.5rem; }
.tests-overview summary { cursor: pointer; color: var(--muted); }
@media (pointer: coarse) {
    .result-grid input.value-input.grid-input, .result-grid select.grid-input.grid-input { min-height: 36px; }
}
/* Serieneingabe (6d): erste feste Spalte = Probennummer, breiter; Auswahlfelder in der Speichern-Leiste nicht über die volle Breite */
.result-grid.series .col-fix1 { min-width: 8.5rem; max-width: 8.5rem; }
.result-grid.series .col-fix2 { left: 8.5rem; }
.sticky-save select, .sticky-save input[type="date"] { width: auto; min-height: 2.25rem; }
.filter-row { margin: 0.75rem 0; }
.filter-row select { width: auto; max-width: 100%; }

/* Etiketten (G1): Bildschirm zeigt die Seiten mit Rahmen, gedruckt wird nur der Inhalt in Millimetern */
.label-body { background: var(--bg); }
.label-toolbar { padding: 0.75rem 1rem; display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem; }
.label-toolbar input.narrow { width: 4.5rem; }
.label-page { background: #fff; color: #000; margin: 0.5rem auto; box-shadow: 0 0 0 1px var(--border); }
.label-sheet { display: grid; box-sizing: border-box; }
.label-roll { width: fit-content; }
.label { box-sizing: border-box; padding: 1.5mm 2mm; overflow: hidden; display: flex; flex-direction: column; justify-content: center;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; line-height: 1.15; }
.label-sheet .label { box-shadow: inset 0 0 0 0.2mm #ddd; }
.label-code svg { display: block; width: 100%; height: 9mm; }
.label-number { font-weight: 700; font-size: 3.4mm; text-align: center; margin-top: 0.6mm; letter-spacing: 0.1mm; }
.label-line { font-size: 2.4mm; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: center; }
@media print {
    .no-print { display: none !important; }
    body.label-body { background: #fff; margin: 0; }
    .label-page { margin: 0; box-shadow: none; break-after: page; page-break-after: always; }
    .label-sheet .label { box-shadow: none; }
}

/* Lagepläne (Schritt 9, aus hm übernommen, E131) */
.plan-preview { max-width: 100%; height: auto; border: 1px solid #ccc; }

/* Raumplan: Plan mit Markierungen (Bearbeiten durch den Administrator) */
.plan-editor { display: flex; gap: 16px; flex-wrap: wrap; align-items: flex-start; }
.plan-stage { position: relative; display: inline-block; max-width: 100%; line-height: 0; cursor: crosshair; border: 1px solid #ccc; touch-action: none; }
.plan-image { display: block; max-width: 100%; height: auto; user-select: none; }
.plan-marker { position: absolute; width: 18px; height: 18px; margin: -9px 0 0 -9px; border-radius: 50%; background: #1b6ec2; border: 2px solid #fff; box-shadow: 0 0 0 1px #333; cursor: grab; touch-action: none; }
.plan-panel { min-width: 260px; max-width: 360px; padding: 0.75rem 1rem 1rem; border: 1px solid var(--border); border-radius: 0.6rem; background: var(--surface); box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12); }
.plan-panel[hidden] { display: none; }
.plan-panel h2 { margin-top: 0; }
.plan-panel-buttons { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; margin-top: 0.75rem; }
.plan-panel-buttons .btn { margin: 0; white-space: nowrap; }
.plan-panel-buttons button[hidden] { display: none; }
.plan-location-list { list-style: none; margin: 8px 0; padding: 0; max-height: 320px; overflow-y: auto; }
.plan-location-list li[hidden] { display: none; }
.plan-taken { opacity: 0.45; }
.plan-stage-view { cursor: default; touch-action: auto; }
.plan-marker-view { padding: 0; font: inherit; cursor: pointer; }
.plan-marker-view:hover, .plan-marker-view:focus-visible { outline: 3px solid var(--primary); outline-offset: 2px; }
.plan-marker-empty { background: #9aa5b1; cursor: default; }
.plan-marker-name, .plan-choices { display: none; }
.plan-choose-list { list-style: none; margin: 0.5rem 0; padding: 0; max-height: 50vh; overflow-y: auto; line-height: 1.4; }
.plan-choose-list li { padding: 0.5rem 0; border-bottom: 1px solid var(--border); }
.plan-choose-list li:last-child { border-bottom: 0; }
.plan-choose-list a { font-weight: 600; }
.plan-choose-list .hint { margin-left: 0.5rem; }

/* Raumplan-Liste: Vorschau in fester Höhe (etwa drei Zeilen) */
.plan-thumb-cell { width: 9rem; padding-top: 0.25rem; padding-bottom: 0.25rem; }
.plan-thumb { display: block; height: 4.5rem; max-width: 8rem; width: auto; object-fit: contain; border: 1px solid var(--border); background: #fff; }
.plan-upload-title { margin-top: 2rem; }

/* Statusfarbe der Markierungen im Raumplan: Farbe und Zeichen (nie nur Farbe) */
.plan-state-ok { background: #1f7a4d; }
.plan-state-violation { background: #b3261e; }
.plan-state-none { background: #9aa5b1; }
.plan-state-ok::after { content: "\2713"; }
.plan-state-violation::after { content: "\2715"; }
.plan-state-none::after { content: "\2013"; }
.plan-marker-view { display: flex; align-items: center; justify-content: center; width: 22px; height: 22px; margin: -11px 0 0 -11px; color: #fff; font-size: 14px; font-weight: 700; line-height: 1; }
.plan-marker-view::before { content: ""; position: absolute; inset: -12px; }
.plan-marker-empty::after { content: none; }
.plan-state { display: inline-flex; align-items: center; justify-content: center; width: 1.2rem; height: 1.2rem; border-radius: 50%; vertical-align: -0.25rem; margin-right: 0.25rem; border: 1px solid #fff; box-shadow: 0 0 0 1px #333; color: #fff; font-size: 0.8rem; font-weight: 700; line-height: 1; }
.plan-legend { display: flex; flex-wrap: wrap; gap: 0.5rem 1.25rem; align-items: center; margin: 0.75rem 0 0.25rem; }
.plan-last { margin-left: 1.7rem; }
@media (max-width: 40rem) {
    .plan-choose-list li { padding: 0.75rem 0; }
    .plan-marker-view { width: 26px; height: 26px; margin: -13px 0 0 -13px; font-size: 16px; }
}
.plan-preview-link { position: relative; display: inline-block; max-width: 100%; line-height: 0; }
.plan-marker-readonly { background: #9aa5b1; cursor: pointer; }
.plan-preview-link .plan-preview { cursor: pointer; }
.plan-state-warning { background: #b45309; }
.plan-state-warning::after { content: "!"; }

/* Aktionen (Prüfen, Freigeben, Hochladen, Anzeigen …) sehen aus wie die Speichern-Leiste, bleiben aber an ihrer Stelle; sticky ist
   je Seite nur die eine Speichern-Leiste (Wunsch Dirk 25.11.2026, wie hm) */
.action-bar { display: flex; align-items: center; justify-content: flex-start; gap: 1rem; margin-top: 1rem; }
.action-bar .btn, .action-bar .btn-primary { width: auto; margin-top: 0; min-height: 2.25rem; padding: 0.3rem 1rem; font-size: 0.95rem; }
.form-actions .btn { width: auto; }

/* Voransicht der ersten Seite (Schritt 11, aus hm report-thumbs.js) */
/* Berichte: Voransicht der ersten Seite (report-thumbs.js, Beschluss 12.11.2026). Die Seite wird in Originalgröße gezeichnet und mit
   transform verkleinert; .doc-thumb-box schneidet auf die erste Seite zu. Vor dem Laden und bei Fehlern steht das Dokument-Symbol. */
.doc-thumb-cell { width: 4.5rem; padding-top: 0.3rem; padding-bottom: 0.3rem; }
.doc-thumb { display: inline-block; text-decoration: none; line-height: 0; }
.doc-thumb-box { display: flex; align-items: center; justify-content: center; position: relative; overflow: hidden; width: 4rem;
    height: 2.9rem; background: #fff; border: 1px solid var(--border); border-radius: 0.2rem; color: var(--muted); }
.doc-thumb.is-ready .doc-thumb-box { display: block; }
.doc-thumb.is-ready .doc-thumb-box > .icon { display: none; }
.doc-thumb:hover .doc-thumb-box, .doc-thumb:focus-visible .doc-thumb-box { border-color: var(--primary); box-shadow: 0 0 0 2px color-mix(in srgb, var(--primary) 25%, transparent); }
.doc-thumb-inner { position: absolute; left: 0; top: 0; transform-origin: 0 0; pointer-events: none; }
.doc-thumb-inner section { background: #fff; margin: 0; box-shadow: none; }
.doc-thumb-large .doc-thumb-box { width: 100%; height: 14rem; }
.doc-thumb-large { display: block; }
.doc-thumb-large .doc-thumb-box .icon { width: 2.5rem; height: 2.5rem; }
#doc-thumb-pop { position: fixed; z-index: 50; overflow: hidden; background: #fff; border: 1px solid var(--border); border-radius: 0.3rem;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.25); pointer-events: none; }
#doc-thumb-pop .doc-thumb-inner { position: absolute; }
.report-detail { display: grid; gap: 1rem 1.5rem; }
.report-detail-preview .hint { margin-top: 0.4rem; }
@media (min-width: 56rem) {
    .report-detail { grid-template-columns: minmax(24rem, 36rem) minmax(0, 1fr); align-items: start; }
    .report-detail-preview { position: sticky; top: 1rem; }
}
@media print { .report-table tr > :first-child, .report-detail-preview, #doc-thumb-pop { display: none; } }
@media print { .doc-thumb-cell, .report-detail-preview, #doc-thumb-pop { display: none; } }

/* Alle ankreuzen im Spaltenkopf (Schritt 12, check-all.js) */
.check-all-head { margin: 0 0.35rem 0 0; vertical-align: middle; width: 1.1rem; height: 1.1rem; cursor: pointer; }
