/* =========================================================
   4smile-Designsprache (CRM-Palette) – Geräteverwaltung
   Verfeinert: Navy-Sidebar + Palette bleiben, Inhaltsflächen
   leichter (dünne Rahmen, weiche Schatten, ruhigere Typo).
   ========================================================= */
@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&display=swap');

:root {
    --brand-50:  #f8f5f3;
    --brand-100: #f2dfdc;
    --brand-200: #ecc9c3;
    --brand-300: #d8ecec;
    --brand-400: #b4ddde;
    --brand-500: #b5c4db;
    --brand-600: #627596;
    --brand-700: #2d4267;
    --brand-800: #192946;
    --brand-900: #121f36;

    --accent: #ecc9c3;
    --mint:   #b4ddde;
    --steel:  #b5c4db;
    --canvas: #fffdfa;
    --ink:    #1d1d1b;

    --line:   #e9e2df;                 /* dezente Trennlinie/Rahmen */
    --shadow: 0 4px 20px rgba(25, 41, 70, .06);
    --shadow-nav: 0 20px 60px rgba(25, 41, 70, .14);

    --ok:        #2f6b57;  --ok-bg:     #e7f1ec;
    --danger:    #a63f3f;  --danger-bg: #f8e8e6;
    --warn:      #8a6425;  --warn-bg:   #f6efe0;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--canvas);
    color: var(--ink);
    font-family: 'Space Grotesk', system-ui, -apple-system, sans-serif;
    font-size: 14.5px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--brand-700); text-decoration: none; font-weight: 600; }
a:hover { text-decoration: underline; }

/* ---------- Kopfleiste ---------- */
.navtoggle { display: none; }
.topbar { display: flex; align-items: center; gap: 14px; padding: 16px 26px 2px; }
.app-name { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .18em; color: var(--brand-600); }
.nav-burger { display: none; font-size: 20px; cursor: pointer; line-height: 1; border: 2px solid var(--brand-800); border-radius: 14px; padding: 5px 11px; background: #fff; }

/* ---------- Rumpf: Sidebar + Inhalt ---------- */
.shell { display: flex; align-items: flex-start; gap: 22px; padding: 8px 26px 40px; }

.sidebar {
    width: 258px; flex: none;
    background: var(--brand-800); color: #fff;
    border-radius: 24px; box-shadow: var(--shadow-nav);
    padding: 14px; position: sticky; top: 14px;
    max-height: calc(100vh - 28px); overflow-y: auto; z-index: 20;
    display: flex; flex-direction: column;
}
.logo-box { background: #fff; border-radius: 18px; padding: 14px; display: flex; justify-content: center; margin-bottom: 14px; }
.logo-box img { width: 100%; max-width: 150px; height: auto; display: block; }

.mainnav { display: flex; flex-direction: column; gap: 5px; }
.mainnav a {
    display: block; border-radius: 999px; border: 1.5px solid transparent;
    background: rgba(255,255,255,.07); color: rgba(255,255,255,.92);
    padding: 9px 15px; font-size: 11px; font-weight: 700;
    text-transform: uppercase; letter-spacing: .04em;
}
.mainnav a:hover { background: var(--accent); color: var(--brand-800); text-decoration: none; }
.mainnav a.aktiv { background: var(--mint); color: var(--brand-800); border-color: var(--brand-400); }
.nav-overlay { display: none; }

/* Zweite Ebene: aufklappbare Gruppe */
.nav-group { margin-top: 2px; }
.nav-group > summary {
    list-style: none; cursor: pointer;
    display: flex; align-items: center; justify-content: space-between;
    border-radius: 999px; border: 1.5px solid transparent;
    background: rgba(255,255,255,.07); color: rgba(255,255,255,.92);
    padding: 9px 15px; font-size: 11px; font-weight: 700;
    text-transform: uppercase; letter-spacing: .04em;
}
.nav-group > summary::-webkit-details-marker { display: none; }
.nav-group > summary::after { content: '▸'; font-size: 10px; opacity: .7; transition: transform .15s; }
.nav-group[open] > summary::after { transform: rotate(90deg); }
.nav-group > summary:hover { background: var(--accent); color: var(--brand-800); }
.nav-group > summary.aktiv { color: #fff; }
.nav-sub { display: flex; flex-direction: column; gap: 4px; margin: 5px 0 2px 10px; padding-left: 8px; border-left: 2px solid rgba(255,255,255,.12); }
.nav-sub a { font-size: 10.5px; padding: 8px 13px; letter-spacing: .03em; }

.session-card { margin-top: 16px; padding: 13px 14px; border-radius: 18px; background: rgba(255,255,255,.08); display: flex; flex-direction: column; gap: 10px; }
.session-card .uname { display: flex; flex-direction: column; line-height: 1.2; font-size: 13px; font-weight: 700; color: #fff; }
.session-card .uname small { font-size: 9px; font-weight: 600; text-transform: uppercase; letter-spacing: .16em; color: rgba(255,255,255,.6); }
.logout {
    display: inline-flex; align-items: center; justify-content: center;
    min-height: 38px; padding: 0 14px; border-radius: 999px;
    border: 1.5px solid var(--brand-400); background: var(--mint); color: var(--brand-800);
    font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em;
}
.logout:hover { background: var(--brand-300); text-decoration: none; }

.content { flex: 1; min-width: 0; max-width: 1200px; }
.seitentitel {
    display: inline-block; margin: 0 0 18px;
    background: var(--accent); color: var(--brand-800);
    padding: 5px 12px; border-radius: 6px;
    font-size: 22px; font-weight: 700; line-height: 1.15;
}
.site-footer { color: var(--brand-600); font-size: 10px; text-transform: uppercase; letter-spacing: .16em; padding: 22px 0 4px; }

/* ---------- Karten ---------- */
.card {
    border: 1px solid var(--line); border-radius: 16px; background: #fff;
    box-shadow: var(--shadow); padding: 18px 20px; margin-bottom: 16px;
}
.card h2, .card h3 {
    margin: 0 0 14px; font-size: 12px; font-weight: 700;
    text-transform: uppercase; letter-spacing: .07em; color: var(--brand-700);
}
.card.schmal { max-width: 520px; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 8px; }
.card-head h3 { margin: 0; }
.hervorgehoben { border-color: var(--brand-400); box-shadow: var(--shadow), 0 0 0 3px rgba(180,221,222,.5); }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }

/* ---------- Formulare ---------- */
label { display: block; margin: 11px 0; font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .12em; color: var(--brand-600); }
label.check { display: flex; align-items: center; gap: 10px; text-transform: none; letter-spacing: normal; font-size: 14px; font-weight: 500; color: var(--ink); }
label.check input { width: auto; margin: 0; }
input, select, textarea {
    display: block; width: 100%; margin-top: 5px;
    border: 1.5px solid var(--brand-500); border-radius: 12px;
    padding: 9px 13px; background: #fff; color: var(--ink);
    font: inherit; font-size: 14.5px; text-transform: none; letter-spacing: normal;
}
textarea { border-radius: 14px; min-height: 84px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand-600); box-shadow: 0 0 0 3px var(--brand-300); }
input[type=file] { padding: 8px 11px; }
input[type=checkbox] { width: 17px; height: 17px; border-radius: 5px; }

.feldgruppe { display: grid; grid-template-columns: 1fr 1fr; gap: 0 20px; }
.feld-paar { display: flex; gap: 10px; margin-top: 5px; }
.feld-paar input { margin-top: 0; }
.feld-paar input[type=number] { max-width: 120px; flex: none; }
.feldhinweis { display: block; margin-top: 5px; font-size: 12px; font-weight: 500; text-transform: none; letter-spacing: normal; color: var(--brand-600); }
.vertrag-block { border: 1px solid var(--line); border-radius: 16px; padding: 2px 16px 12px; margin: 12px 0; min-width: 0; }
.vertrag-block legend { padding: 0 8px; }
.vertrag-block legend .check { margin: 0; }
/* Eingeklappt: nur die Zeile mit dem Häkchen, ohne leeren Rahmen. */
.vertrag-block:has(#vertrag-felder[hidden]) { border-color: transparent; padding-bottom: 0; }
#vertrag-felder { padding-top: 6px; }
#wartung-vorschau { font-weight: 700; color: var(--brand-700); }
.formaktionen { margin-top: 18px; display: flex; gap: 10px; flex-wrap: wrap; }

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center;
    min-height: 40px; padding: 8px 16px;
    border: 1.5px solid var(--brand-800); border-radius: 999px;
    background: var(--accent); color: var(--brand-800);
    font: inherit; font-size: 11px; font-weight: 800;
    text-transform: uppercase; letter-spacing: .04em;
    cursor: pointer; white-space: nowrap; transition: background .15s, border-color .15s;
}
.btn:hover { background: var(--brand-100); text-decoration: none; }
.btn-primary { border-color: var(--brand-400); background: var(--mint); }
.btn-primary:hover { background: var(--brand-300); }
.btn-warn { background: #fff; border-color: var(--danger); color: var(--danger); }
.btn-erfolg { background: var(--ok-bg); border-color: var(--ok); color: var(--ok); }
.btn-warn:hover { background: var(--danger-bg); }
.btn-klein { min-height: 32px; padding: 6px 12px; font-size: 10.5px; }
.linkbtn { background: none; border: none; color: var(--brand-700); cursor: pointer; padding: 0 2px; width: auto; font: inherit; font-size: 13px; font-weight: 700; text-transform: none; letter-spacing: normal; text-decoration: underline; }
.inline { display: inline; margin: 0; }

/* ---------- Tabellen (Navy-Header + Accent-Unterstrich) ---------- */
.liste { width: 100%; border-collapse: separate; border-spacing: 0; }
.liste thead th {
    background: var(--brand-800); color: #fff; text-align: left; padding: 7px 11px;
    font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: .07em;
    border-bottom: 2px solid var(--accent);
}
.liste thead th:first-child { border-top-left-radius: 10px; }
.liste thead th:last-child { border-top-right-radius: 10px; }
.liste td { padding: 8px 11px; font-size: 13.5px; vertical-align: top; background: #fff; border-bottom: 1px solid var(--line); }
.liste tbody tr:last-child td { border-bottom: none; }
.liste tbody tr:hover td { background: var(--brand-50); }
.liste tr.klickbar { cursor: pointer; }
.liste small { color: var(--brand-600); }
.subrow td { padding-top: 0; }
.inaktiv-row td { opacity: .5; }
.erledigt-row td { opacity: .55; }
.aktionen-zelle { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.aktionen-zelle form, .aktionen-zelle a { margin: 0; }
.leer { color: var(--brand-600); padding: 12px 0; }
.count { color: var(--brand-600); font-size: 11px; text-transform: uppercase; letter-spacing: .1em; margin: 2px 0 10px; }

.detailtabelle { width: 100%; border-collapse: collapse; }
.detailtabelle tr { border-bottom: 1px solid var(--brand-50); }
.detailtabelle tr:last-child { border-bottom: none; }
.detailtabelle th { text-align: left; width: 1%; white-space: nowrap; padding: 8px 20px 8px 0; vertical-align: top; font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--brand-600); }
.detailtabelle td { padding: 8px 0; font-size: 14px; color: var(--ink); vertical-align: top; }
.detailtabelle td:empty::after { content: '—'; color: var(--brand-500); }

/* ---------- Badges ---------- */
.status, .prio, .ergebnis, .svstatus, .faellig {
    display: inline-block; border-radius: 999px; padding: 2px 10px;
    font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em;
    background: var(--brand-50); color: var(--brand-700);
}
.status-in_betrieb { background: var(--ok-bg); color: var(--ok); }
.status-defekt { background: var(--danger-bg); color: var(--danger); }
.status-in_reparatur { background: var(--warn-bg); color: var(--warn); }
.status-ausser_betrieb, .status-ausgemustert { background: var(--brand-50); color: var(--brand-600); }
.prio-niedrig { background: var(--brand-50); color: var(--brand-600); }
.prio-mittel { background: var(--brand-300); color: var(--brand-800); }
.prio-hoch { background: var(--warn-bg); color: var(--warn); }
.prio-kritisch { background: var(--danger-bg); color: var(--danger); }
.ergebnis-bestanden { background: var(--ok-bg); color: var(--ok); }
.ergebnis-mit_maengeln { background: var(--warn-bg); color: var(--warn); }
.ergebnis-nicht_bestanden { background: var(--danger-bg); color: var(--danger); }
.svstatus-termin_eingetragen { background: var(--brand-300); color: var(--brand-800); }
.svstatus-intern_bestaetigt { background: var(--ok-bg); color: var(--ok); }
.svstatus-abgelehnt { background: var(--danger-bg); color: var(--danger); }
.faellig-ueberfaellig { background: var(--danger-bg); color: var(--danger); }
.faellig-bald { background: var(--warn-bg); color: var(--warn); }
.faellig-ok { background: transparent; color: var(--ink); letter-spacing: normal; text-transform: none; font-weight: 600; }
.status-text { color: var(--brand-600); margin-left: 8px; font-size: 13px; }

/* ---------- Chips (Räume) ---------- */
.raeume { display: flex; flex-wrap: wrap; gap: 7px; align-items: center; padding: 5px 0; }
.chip { display: inline-flex; align-items: center; gap: 4px; border: 1px solid var(--brand-500); border-radius: 999px; background: #fff; padding: 3px 8px 3px 13px; font-size: 13px; font-weight: 600; }
.chip.inaktiv { opacity: .45; }
.raum-add { display: inline-flex; gap: 6px; align-items: center; }
.raum-add input { width: 160px; margin: 0; min-height: 34px; padding: 5px 13px; }

/* ---------- Toolbar / Filter ---------- */
.toolbar { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; align-items: center; }
.filterform { display: flex; gap: 9px; flex-wrap: wrap; align-items: center; }
.filterform input, .filterform select { width: auto; margin: 0; min-height: 40px; padding: 7px 12px; }
.filterform input[name=q] { min-width: 240px; }
.toolbar-actions { display: flex; gap: 9px; align-items: center; flex-wrap: wrap; }

/* ---------- Detail-Kopf ---------- */
.detail-kopf { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.detail-kopf .inv { margin: 0; font-size: 26px; font-weight: 700; color: var(--brand-800); }
.untertitel { color: var(--brand-600); margin: 3px 0 9px; }
.detail-aktionen { display: flex; gap: 9px; align-items: center; flex-wrap: wrap; }

/* ---------- KPI ---------- */
.kpi-reihe { display: grid; grid-template-columns: repeat(3, 1fr); gap: 13px; margin-bottom: 18px; }
.kpi-5 { grid-template-columns: repeat(5, 1fr); }
.kpi { display: flex; flex-direction: column; gap: 3px; border: 1px solid var(--line); border-radius: 14px; background: #fff; padding: 14px 16px; color: var(--brand-800); box-shadow: var(--shadow); }
.kpi:hover { text-decoration: none; background: var(--brand-50); }
.kpi-zahl { font-size: 27px; font-weight: 700; line-height: 1; }
.kpi-label { font-size: 9.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .12em; color: var(--brand-600); }
.kpi-warn { border-color: #eabfba; } .kpi-warn .kpi-zahl { color: var(--danger); }
.kpi-amber { border-color: #e6d6b6; } .kpi-amber .kpi-zahl { color: var(--warn); }

.prio-reihe { display: grid; grid-template-columns: repeat(4, 1fr); gap: 9px; }
.prio-kachel { display: flex; flex-direction: column; align-items: center; gap: 5px; border: 1px solid var(--line); border-radius: 12px; padding: 11px 8px; background: #fff; color: var(--brand-800); }
.prio-kachel:hover { background: var(--brand-50); text-decoration: none; }
.prio-zahl { font-size: 21px; font-weight: 700; }

/* ---------- Flash / Hinweise ---------- */
.flash { border: 1px solid var(--line); border-radius: 12px; padding: 10px 15px; margin-bottom: 14px; font-size: 13.5px; font-weight: 600; background: #fff; color: var(--brand-800); }
.flash-ok { background: var(--ok-bg); border-color: #bfe0d1; color: var(--ok); }
.flash-fehler { background: var(--danger-bg); border-color: #ecc4bf; color: var(--danger); }
.flash-info { background: var(--brand-300); border-color: #a9d3d4; color: var(--brand-800); }
.hinweis { color: var(--brand-600); font-size: 13px; }
.hinweis-klein { color: var(--brand-600); font-size: 12px; margin-top: 12px; }
code { background: var(--brand-50); border: 1px solid var(--line); padding: 1px 6px; border-radius: 6px; font-size: 13px; }

/* ---------- Aufklapp-Formulare ---------- */
.add-details { margin: 0; }
.add-details > summary { display: inline-flex; list-style: none; cursor: pointer; }
.add-details > summary::-webkit-details-marker { display: none; }
.add-form { margin-top: 12px; padding: 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--brand-50); }
.add-form.kompakt { min-width: 250px; }
.add-form.card { background: #fff; }

/* ---------- Störung-melden-Formular + suchbarer Geräte-Picker ---------- */
.stoerung-form { width: min(440px, 90vw); padding: 20px; border-radius: 18px; border: 2px solid var(--brand-800); box-shadow: var(--shadow); }
.stoerung-form > label { margin: 0 0 16px; }
.stoerung-form .feldlabel { display: block; margin-bottom: 6px; font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .12em; color: var(--brand-600); }
.stoerung-form button { margin-top: 4px; }

.geraet-picker { position: relative; }
.picker-feld { position: relative; }
.geraet-suche { padding-right: 38px; }
.picker-clear {
    position: absolute; top: 50%; right: 8px; transform: translateY(-50%);
    width: 24px; height: 24px; padding: 0; margin: 0; border: none; border-radius: 999px;
    background: var(--brand-100); color: var(--brand-700); font-size: 12px; line-height: 1;
    cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
}
.picker-clear:hover { background: var(--accent); }
.geraet-picker.gewaehlt .geraet-suche { border-color: var(--brand-700); background: var(--brand-300); font-weight: 600; }

.geraet-liste {
    position: absolute; z-index: 30; left: 0; right: 0; top: calc(100% + 4px);
    margin: 0; padding: 5px; list-style: none; max-height: 300px; overflow-y: auto;
    background: #fff; border: 2px solid var(--brand-800); border-radius: 16px; box-shadow: var(--shadow-nav);
}
.picker-item {
    display: grid; grid-template-columns: auto 1fr; gap: 1px 10px; align-items: baseline;
    padding: 8px 11px; border-radius: 11px; cursor: pointer;
    text-transform: none; letter-spacing: normal;
}
.picker-item:hover, .picker-item.aktiv { background: var(--brand-300); }
.pi-inv { grid-row: 1 / span 2; align-self: center; font-weight: 800; font-size: 14px; color: var(--brand-800); font-variant-numeric: tabular-nums; }
.pi-bez { font-size: 13.5px; font-weight: 600; color: var(--ink); }
.pi-meta { font-size: 11.5px; color: var(--brand-600); }
.picker-item mark { background: var(--mint); color: var(--brand-800); border-radius: 3px; padding: 0 1px; }
.picker-leer { padding: 12px; text-align: center; color: var(--brand-600); font-size: 13px; text-transform: none; letter-spacing: normal; }
.picker-count { display: block; margin-top: 6px; font-size: 11px; font-weight: 600; text-transform: none; letter-spacing: normal; color: var(--brand-600); }
.picker-count.fehler, .geraet-suche.fehler { color: var(--danger); }
.geraet-suche.fehler { border-color: var(--danger); box-shadow: 0 0 0 3px var(--danger-bg); }

.linkzeile { display: flex; gap: 9px; align-items: center; flex-wrap: wrap; }
.linkzeile input { flex: 1; min-width: 230px; margin: 0; }

/* ---------- Unwirtschaftlichkeit / Erinnerungen ---------- */
.unwirt-banner { border: 1px solid #e6d6b6; border-radius: 14px; background: var(--warn-bg); color: var(--warn); padding: 12px 16px; margin-bottom: 18px; display: flex; flex-direction: column; gap: 3px; font-weight: 700; }
.unwirt-banner span { font-size: 13px; font-weight: 500; }
.empf-block { margin-bottom: 13px; padding-bottom: 11px; border-bottom: 1px solid var(--line); }
.empf-liste { margin: 8px 0 0; padding-left: 0; list-style: none; }
.empf-liste li { padding: 4px 0; font-size: 14px; }
.mini-ok { color: var(--ok); font-size: 10.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
.mini-neu { color: var(--brand-700); font-size: 10.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }

/* ---------- PDF-Import ---------- */
.pdftext { margin-top: 12px; max-height: 340px; overflow: auto; background: var(--brand-50); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; font-size: 12px; white-space: pre-wrap; word-break: break-word; }
.dropzone { display: block; border: 2px dashed var(--brand-500); border-radius: 16px; padding: 30px 16px; text-align: center; cursor: pointer; background: var(--brand-50); color: var(--brand-700); font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .1em; margin: 6px 0 14px; transition: background .15s, border-color .15s; }
.dropzone:hover { background: var(--brand-100); }
.dropzone.over { border-color: var(--brand-400); background: var(--mint); color: var(--brand-800); }
.csv-hint { display: block; margin-top: 3px; font-size: 11px; color: var(--brand-600); }
.qr-gross { width: 340px; max-width: 90vw; height: auto; image-rendering: pixelated; }
.qr-inv { font-size: 22px; font-weight: 700; letter-spacing: .5px; color: var(--brand-800); margin-top: 6px; }
.row-standort { min-height: 34px; padding: 5px 10px; margin: 0; }

/* ---------- Login / öffentliche Service-Seite ---------- */
.login-body { display: flex; align-items: center; justify-content: center; min-height: 100vh; background: var(--canvas); }
.login-card { border: 1px solid var(--line); border-radius: 22px; background: #fff; box-shadow: var(--shadow-nav); padding: 32px; width: 390px; max-width: 92vw; }
.login-logo { width: 156px; height: auto; display: block; margin: 0 auto 18px; }
.login-card h1 { margin: 0 0 4px; font-size: 22px; font-weight: 700; color: var(--brand-800); }
.login-sub { color: var(--brand-600); margin: 0 0 18px; font-size: 11px; text-transform: uppercase; letter-spacing: .16em; font-weight: 700; }
.login-card .btn { width: 100%; margin-top: 12px; }
.service-card { border: 1px solid var(--line); border-radius: 22px; background: #fff; box-shadow: var(--shadow-nav); padding: 28px; width: 560px; max-width: 94vw; margin: 24px; }
.service-card h1 { margin: 0 0 4px; font-size: 22px; color: var(--brand-800); }
.service-sub { color: var(--brand-600); margin: 0 0 16px; }
.service-card .anliegen { background: var(--brand-50); border: 1px solid var(--line); padding: 12px 14px; border-radius: 14px; }
.service-card hr { border: none; border-top: 1px solid var(--line); margin: 20px 0; }

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
    .grid-2, .kpi-5, .feldgruppe { grid-template-columns: 1fr; }
    /* Kennzahl-Reihe bleibt auch mobil nebeneinander (nur enger). */
    .kpi-reihe { gap: 8px; }
    .kpi-reihe .kpi { padding: 11px 10px; }
    .kpi-reihe .kpi-zahl { font-size: 21px; }
    .kpi-reihe .kpi-label { font-size: 8px; letter-spacing: .06em; }
    .prio-reihe { grid-template-columns: repeat(2, 1fr); }
    .linkzeile input { min-width: 0; }
    .nav-burger { display: block; }
    .app-name { display: none; }
    .shell { padding: 8px 14px 40px; }
    .card { padding: 16px; }
    .seitentitel { font-size: 20px; }
    .filterform input[name=q] { min-width: 0; flex: 1; }

    /* Sidebar → Drawer */
    .sidebar { position: fixed; top: 12px; left: 12px; bottom: 12px; width: 270px; max-height: none; transform: translateX(-115%); transition: transform .2s ease; }
    .navtoggle:checked ~ .shell .sidebar { transform: translateX(0); }
    .nav-overlay { position: fixed; inset: 0; background: rgba(25,41,70,.45); z-index: 15; }
    .navtoggle:checked ~ .shell .nav-overlay { display: block; }

    /* Tabellen → gestapelte Karten (Labels per Skript aus dem Tabellenkopf) */
    .liste thead { display: none; }
    .liste, .liste tbody, .liste tr, .liste td { display: block; width: 100%; }
    .liste tr { border: 1px solid var(--line); border-radius: 16px; background: #fff; margin-bottom: 10px; padding: 6px 14px; box-shadow: var(--shadow); }
    .liste tbody tr:hover td { background: transparent; }
    .liste td { border: none; background: transparent; padding: 7px 0; display: flex; justify-content: space-between; align-items: baseline; gap: 14px; text-align: right; }
    .liste td + td { border-top: 1px solid var(--line); }
    .liste td::before { content: attr(data-label); flex: none; text-align: left; padding-top: 2px; font-size: 9.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .12em; color: var(--brand-600); }
    .liste td[colspan] { display: block; text-align: left; }
    .liste td[colspan]::before { content: none; }
    .liste td:empty { display: none; }
    .subrow { border: none; padding: 0; margin: 0; box-shadow: none; }
}

/* =========================================================
   QM-Handbuch – projektspezifische Ergänzungen
   ========================================================= */

/* Dokumentstatus-Badges */
.status-entwurf     { background: var(--warn-bg); color: var(--warn); }
.status-freigegeben { background: var(--ok-bg); color: var(--ok); }
.status-archiviert  { background: var(--brand-50); color: var(--brand-600); }
.status-offen       { background: var(--warn-bg); color: var(--warn); }

.dok-nr { font-weight: 800; color: var(--brand-800); font-variant-numeric: tabular-nums; letter-spacing: .02em; }
.dok-eyebrow { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .14em; color: var(--brand-600); margin: 0 0 4px; }

/* Große Suchleiste (Handbuch-Start) */
.suche-gross { display: flex; gap: 10px; margin: 4px 0 20px; }
.suche-gross input[type=search] {
    flex: 1; margin: 0; min-height: 52px; padding: 10px 18px;
    border: 2px solid var(--brand-800); border-radius: 16px; font-size: 16px;
}
.suche-gross input[type=search]:focus { box-shadow: 0 0 0 3px var(--brand-300); }
.suche-gross .btn { min-height: 52px; padding: 0 22px; }

/* Inhaltsverzeichnis */
.kapitel-block { margin: 4px 0 10px; }
.kapitel-titel { margin: 12px 0 6px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--brand-700); }
.kapitel-leer { color: var(--brand-500); margin: 0 0 6px; font-size: 13px; }
.dok-liste { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.dok-liste li { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; padding: 3px 0; }
.dok-liste a { color: var(--ink); font-weight: 600; }
.dok-liste a:hover { color: var(--brand-700); }

/* Dokumentansicht: Inhalt + Metaspalte */
.dok-layout { display: grid; grid-template-columns: 1fr 300px; gap: 18px; align-items: start; }
.dok-meta { display: flex; flex-direction: column; gap: 16px; }
.dok-meta .card { margin-bottom: 0; }
.qr-card { text-align: center; }
.qr-mini { display: inline-block; width: 150px; }
.qr-mini svg { width: 100%; height: auto; }
.qr-fehler { color: var(--brand-500); font-size: 12px; }

/* Fließtext im Dokument (bereinigtes HTML) */
.dok-inhalt { line-height: 1.65; }
.dok-inhalt h2 { font-size: 20px; color: var(--brand-800); margin: 18px 0 8px; }
.dok-inhalt h3 { font-size: 16px; color: var(--brand-700); margin: 16px 0 6px; text-transform: none; letter-spacing: normal; }
.dok-inhalt h4 { font-size: 14px; color: var(--brand-700); margin: 14px 0 6px; }
.dok-inhalt p { margin: 0 0 12px; }
.dok-inhalt ul, .dok-inhalt ol { margin: 0 0 12px; padding-left: 22px; }
.dok-inhalt li { margin: 3px 0; }
/* Verschachtelte Listen (2. Ebene) klar abgesetzt darstellen. */
.dok-inhalt ul ul, .dok-inhalt ol ol, .dok-inhalt ul ol, .dok-inhalt ol ul,
.editor ul ul, .editor ol ol, .editor ul ol, .editor ol ul { margin: 3px 0 3px; }
.dok-inhalt ul ul, .editor ul ul { list-style-type: circle; }
.dok-inhalt ul ul ul, .editor ul ul ul { list-style-type: square; }
.dok-inhalt ol ol, .editor ol ol { list-style-type: lower-alpha; }
.dok-inhalt ol ol ol, .editor ol ol ol { list-style-type: lower-roman; }
.dok-inhalt img { max-width: 100%; height: auto; border-radius: 12px; margin: 8px 0; }
.dok-inhalt table { border-collapse: collapse; width: 100%; margin: 10px 0; }
.dok-inhalt th, .dok-inhalt td { border: 1px solid var(--line); padding: 6px 10px; text-align: left; }
.dok-inhalt th { background: var(--brand-50); }
.dok-inhalt blockquote { margin: 10px 0; padding: 6px 14px; border-left: 3px solid var(--brand-400); color: var(--brand-700); background: var(--brand-50); border-radius: 0 10px 10px 0; }
.dok-inhalt a { color: var(--brand-700); text-decoration: underline; }

/* Editor */
.editor-toolbar { display: flex; flex-wrap: wrap; gap: 4px; padding: 8px; background: var(--brand-50); border: 1px solid var(--line); border-radius: 12px 12px 0 0; position: sticky; top: 0; z-index: 6; box-shadow: 0 2px 8px rgba(25,41,70,.06); }
.editor-toolbar button {
    min-height: 32px; padding: 4px 10px; margin: 0; width: auto;
    border: 1px solid var(--brand-500); border-radius: 8px; background: #fff; color: var(--brand-800);
    font-size: 12px; font-weight: 700; cursor: pointer; line-height: 1.2;
}
.editor-toolbar button:hover { background: var(--mint); border-color: var(--brand-400); }
.editor-toolbar button.active { background: var(--mint); border-color: var(--brand-700); color: var(--brand-800); box-shadow: inset 0 0 0 1px var(--brand-400); }
.editor hr, .dok-inhalt hr, .druck-inhalt hr { border: none; border-top: 2px solid var(--line); margin: 16px 0; }
.editor-toolbar .tb-sep { width: 1px; align-self: stretch; background: var(--line); margin: 2px 4px; }
.editor {
    min-height: 320px; padding: 16px 18px; border: 1px solid var(--line); border-top: none;
    border-radius: 0 0 12px 12px; background: #fff; line-height: 1.65; outline: none;
}
.editor:focus { box-shadow: inset 0 0 0 2px var(--brand-300); }
.editor h2 { font-size: 20px; color: var(--brand-800); margin: 14px 0 8px; }
.editor h3 { font-size: 16px; color: var(--brand-700); margin: 12px 0 6px; }
.editor h4 { font-size: 14px; color: var(--brand-700); margin: 10px 0 5px; font-weight: 700; }
.editor img { max-width: 100%; height: auto; border-radius: 10px; }
.editor ul, .editor ol { padding-left: 22px; }
.editor table { border-collapse: collapse; width: 100%; margin: 10px 0; }
.editor th, .editor td { border: 1px solid var(--brand-500); padding: 6px 9px; min-width: 40px; }
.editor th { background: var(--brand-50); text-align: left; }

/* Interner Link-Picker (Overlay) */
.link-picker { position: fixed; inset: 0; background: rgba(25,41,70,.45); z-index: 40; display: flex; align-items: flex-start; justify-content: center; padding-top: 12vh; }
.link-picker[hidden] { display: none; }
.link-picker-box { width: min(460px, 92vw); background: #fff; border: 2px solid var(--brand-800); border-radius: 18px; box-shadow: var(--shadow-nav); padding: 18px; }
.link-picker-box h3 { margin: 0 0 10px; }
.link-treffer { list-style: none; margin: 10px 0; padding: 0; max-height: 320px; overflow-y: auto; }
.link-treffer li { padding: 9px 12px; border-radius: 10px; cursor: pointer; }
.link-treffer li:hover { background: var(--brand-300); }
.link-treffer .picker-leer { color: var(--brand-600); cursor: default; text-align: center; }

/* Suchtreffer */
.such-card { padding: 6px 8px; }
.such-liste { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.such-liste li { padding: 13px 12px; border-radius: 12px; border-bottom: 1px solid var(--line); transition: background .12s; }
.such-liste li:last-child { border-bottom: none; }
.such-liste li:hover { background: var(--brand-50); }
.such-titel { display: inline-block; font-size: 15.5px; font-weight: 600; color: var(--ink); }
.such-titel:hover { text-decoration: none; color: var(--brand-700); }
.such-titel .dok-nr { margin-right: 4px; }
.such-typ { display: inline-block; margin-left: 8px; padding: 1px 9px; border-radius: 999px; background: var(--brand-50); border: 1px solid var(--line); font-size: 9.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; color: var(--brand-600); vertical-align: middle; }
.such-snippet { margin: 6px 0 0; color: var(--brand-700); font-size: 13.5px; line-height: 1.5; }
.such-snippet mark, .such-titel mark { background: var(--mint); color: var(--brand-800); border-radius: 3px; padding: 0 2px; }
.such-tags { margin: 6px 0 0; }
.such-typ-filter { min-height: 52px; width: auto; margin: 0; border: 2px solid var(--brand-800); border-radius: 16px; padding: 0 14px; background: #fff; font-weight: 600; }
#such-ergebnis.such-laedt { opacity: .55; transition: opacity .1s; }
.count { transition: opacity .1s; }

/* Kapitelverwaltung */
.kapitel-verwaltung { display: flex; flex-direction: column; gap: 8px; }
.kapitel-zeile { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.kapitel-edit { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 0; }
.kapitel-edit input, .kapitel-edit select { margin: 0; min-height: 36px; width: auto; }
.kapitel-edit input[type=text] { min-width: 200px; }
.kapitel-edit input[type=number] { max-width: 80px; }

.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--brand-50); }
.faellig-ueberfaellig { background: var(--danger-bg); color: var(--danger); }
.faellig-bald { background: var(--warn-bg); color: var(--warn); }
.faellig-ok { background: var(--ok-bg); color: var(--ok); }

/* Druck-/QR-Blatt (eigenständige Seiten) */
.druck { background: #fff; }
.druck-blatt { max-width: 800px; margin: 24px auto; padding: 0 24px; }
.druck-kopf { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; border-bottom: 2px solid var(--brand-800); padding-bottom: 12px; margin-bottom: 18px; }
.druck-kopf h1 { margin: 2px 0 6px; font-size: 24px; color: var(--brand-800); }
.druck-meta { color: var(--brand-600); font-size: 12px; margin: 0; }
.druck-qr { width: 120px; flex: none; }
.druck-qr svg { width: 100%; height: auto; }
.druck-inhalt { line-height: 1.6; }
.druck-inhalt h2 { font-size: 18px; color: var(--brand-800); }
.druck-inhalt h3 { font-size: 15px; }
.druck-inhalt img { max-width: 100%; height: auto; }
.druck-inhalt table { border-collapse: collapse; width: 100%; margin: 10px 0; }
.druck-inhalt th, .druck-inhalt td { border: 1px solid #999; padding: 5px 9px; }
.druck-fuss { display: flex; justify-content: space-between; margin-top: 24px; padding-top: 10px; border-top: 1px solid var(--line); color: var(--brand-600); font-size: 11px; }
.druck-aktionen { display: flex; gap: 10px; justify-content: center; margin: 20px 0; }

.qr-blatt { max-width: 420px; margin: 40px auto; text-align: center; padding: 0 20px; }
.qr-logo { width: 140px; margin: 0 auto 20px; display: block; }
.qr-blatt .qr-gross { width: 300px; max-width: 80vw; margin: 0 auto; }
.qr-blatt .qr-gross svg { width: 100%; height: auto; }
.qr-nummer { font-size: 22px; font-weight: 800; color: var(--brand-800); margin: 16px 0 2px; }
.qr-titel { font-size: 15px; color: var(--brand-700); margin: 0 0 10px; }
.qr-link { font-size: 11px; color: var(--brand-600); word-break: break-all; }

@media print {
    .druck-aktionen { display: none; }
    .druck-blatt, .qr-blatt { margin: 0 auto; }
    body { font-size: 12px; }
}

@media (max-width: 980px) {
    .dok-layout { grid-template-columns: 1fr; }
    .suche-gross { flex-direction: column; }
    .suche-gross .btn { width: 100%; }
}

/* ---------- Lesebestätigung & Ansichts-Tracking ---------- */
.lesebestaetigung-banner {
    display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
    border: 2px solid var(--brand-400); border-radius: 16px;
    background: var(--brand-300); color: var(--brand-800);
    padding: 14px 18px; margin-bottom: 18px;
}
.lesebestaetigung-banner strong { display: block; font-size: 15px; }
.lesebestaetigung-banner span { font-size: 13px; color: var(--brand-700); }
.lesebestaetigung-banner form { margin: 0; }

/* Basisdokumente (Anlagen) */
.basis-liste { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 12px; }
.basis-chip { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--brand-500); border-radius: 999px; background: #fff; padding: 4px 6px 4px 12px; font-size: 13px; }
.basis-chip-label { font-weight: 600; color: var(--brand-800); }
.basis-chip-label:hover { text-decoration: underline; }
.basis-chip-x { width: 22px; height: 22px; padding: 0; margin: 0; border: none; border-radius: 999px; background: var(--brand-100); color: var(--brand-700); font-size: 14px; line-height: 1; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.basis-chip-x:hover { background: var(--accent); }
.basis-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.anlagen-liste { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.anlagen-liste a { color: var(--ink); font-weight: 600; }
.anlage-typ { display: inline-block; min-width: 40px; font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--brand-700); background: var(--brand-50); border-radius: 6px; padding: 1px 6px; margin-right: 4px; }
.druck-anlagen { margin: 12px 0; font-size: 13px; }

/* Schlagwörter / Tags */
.tag-chip { display: inline-block; margin: 2px 4px 2px 0; padding: 2px 10px; border-radius: 999px; background: var(--brand-50); border: 1px solid var(--line); color: var(--brand-700); font-size: 12px; font-weight: 600; }
.tag-chip:hover { background: var(--mint); border-color: var(--brand-400); color: var(--brand-800); text-decoration: none; }
.tag-zelle { line-height: 1.9; }
.such-tags { margin: 5px 0 0; }

/* Versions-Diff */
.diff { font-size: 13.5px; line-height: 1.6; }
.diff-zeile { display: flex; gap: 8px; padding: 2px 8px; border-radius: 6px; }
.diff-mark { flex: none; width: 14px; text-align: center; font-weight: 800; color: var(--brand-500); }
.diff-add { background: var(--ok-bg); color: var(--ink); }
.diff-add .diff-mark { color: var(--ok); }
.diff-del { background: var(--danger-bg); color: var(--brand-700); text-decoration: line-through; }
.diff-del .diff-mark { color: var(--danger); text-decoration: none; }
.diff-gleich { color: var(--brand-600); }

/* Entwurf-Hinweis / -Vorschau */
.entwurf-banner { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; border: 1.5px solid #e6d6b6; border-radius: 16px; background: var(--warn-bg); padding: 12px 18px; margin-bottom: 18px; }
.entwurf-banner strong { display: block; font-size: 14px; color: var(--warn); }
.entwurf-banner span { font-size: 13px; color: var(--brand-700); }
.entwurf-banner.vorschau { border-color: var(--brand-400); background: var(--brand-300); }
.entwurf-banner.vorschau strong { color: var(--brand-800); }
.entwurf-aktionen { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.entwurf-aktionen form { margin: 0; }

/* Fortschritts-Balken */
.balken { position: relative; height: 10px; border-radius: 999px; background: var(--brand-100); overflow: hidden; }
.balken > span { position: absolute; inset: 0 auto 0 0; height: 100%; background: var(--ok); border-radius: 999px; }
.balken.teil > span { background: var(--brand-500); }
.balken.leer-balken { background: var(--line); }
.balken.gross { height: 16px; }
.balken-label { margin: 8px 0 0; font-size: 13px; color: var(--brand-700); }

.fortschritt-link { display: block; color: inherit; }
.fortschritt-link:hover { text-decoration: none; }
.fortschritt-zahl { font-size: 20px; font-weight: 700; color: var(--brand-800); margin-bottom: 8px; }
.fortschritt-zahl small { font-size: 13px; font-weight: 600; color: var(--brand-600); }

.gruppe-zeile { margin: 12px 0; }
.gruppe-kopf { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 4px; }
.gruppe-zahl { font-weight: 700; color: var(--brand-700); font-variant-numeric: tabular-nums; }

/* Tab-Navigation (Fortschritt / Gesehen / Ausstehend) */
.tabnav { display: flex; gap: 6px; margin-bottom: 16px; flex-wrap: wrap; }
.tabnav a {
    padding: 8px 16px; border-radius: 999px; border: 1.5px solid var(--line);
    background: #fff; color: var(--brand-700); font-size: 12px; font-weight: 700;
    text-transform: uppercase; letter-spacing: .04em;
}
.tabnav a:hover { background: var(--brand-50); text-decoration: none; }
.tabnav a.aktiv { background: var(--mint); border-color: var(--brand-400); color: var(--brand-800); }

/* Gruppen-Zuweisung in der Benutzerliste */
.gruppen-edit > summary { cursor: pointer; color: var(--brand-700); font-weight: 600; font-size: 13px; }
.gruppen-edit .leer { color: var(--brand-500); }
.gruppen-form { margin-top: 10px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--brand-50); min-width: 220px; }
.gruppen-form .check { margin: 4px 0; font-size: 13px; }
.gruppen-form .btn { margin-top: 8px; }

/* Praxis-Geltung im Editor */
.praxis-geltung { border: 1px solid var(--line); border-radius: 12px; padding: 6px 14px 12px; margin-top: 14px; }
.praxis-geltung legend { padding: 0 6px; font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: var(--brand-600); }
.praxis-geltung legend span { text-transform: none; letter-spacing: normal; font-weight: 500; color: var(--brand-500); }
.praxis-checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 0 16px; }
.praxis-checks .check { margin: 5px 0; }

/* Checklisten */
.cl-liste { list-style: none; margin: 0 0 18px; padding: 0; counter-reset: cl; }
.cl-punkt { padding: 10px 0; border-bottom: 1px solid var(--line); }
.cl-punkt:last-child { border-bottom: none; }
.cl-punkt label { text-transform: none; letter-spacing: normal; font-size: 14.5px; font-weight: 500; color: var(--ink); margin: 0; }
.cl-punkt label.check { display: flex; align-items: center; gap: 10px; }
.cl-punkt input[type=text] { margin-top: 6px; max-width: 320px; }
.cl-pflicht { color: var(--danger); font-weight: 700; }
.cl-ja { color: var(--ok); font-weight: 700; }
.cl-nein { color: var(--brand-600); }
.druck-cl { width: 100%; border-collapse: collapse; margin: 14px 0; }
.druck-cl th, .druck-cl td { border: 1px solid #999; padding: 7px 9px; text-align: left; font-size: 13px; }
.druck-cl .cl-box { text-align: center; font-size: 18px; width: 70px; }
.druck-cl .cl-blank { width: 200px; }
.druck-sign { margin-top: 16px; font-size: 13px; }

/* Kapitelverwaltung – aufgeräumter Baum */
.kap-tree { display: flex; flex-direction: column; gap: 2px; }
.kap-kopf { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 10px; }
.kap-zeile.ebene-0 > .kap-kopf { background: var(--brand-50); }
.kap-kopf:hover { background: var(--brand-100); }
.kap-name { font-weight: 600; color: var(--ink); flex: 1; min-width: 0; }
.kap-zeile.ebene-0 .kap-name { font-weight: 800; color: var(--brand-800); }
.kap-tick { color: var(--brand-500); margin-right: 4px; }
.kap-meta { font-size: 11px; color: var(--brand-600); white-space: nowrap; }
.kap-actions { display: flex; align-items: center; gap: 4px; }
.kap-ic { min-height: 28px; padding: 3px 10px; border: 1px solid var(--brand-500); border-radius: 8px; background: #fff; color: var(--brand-700); font-size: 12px; font-weight: 700; cursor: pointer; line-height: 1.4; }
.kap-ic:hover { background: var(--mint); border-color: var(--brand-400); color: var(--brand-800); }
.kap-bearbeiten { position: relative; display: inline-block; }
.kap-bearbeiten > summary { list-style: none; display: inline-flex; align-items: center; }
.kap-bearbeiten > summary::-webkit-details-marker { display: none; }
.kap-bearbeiten[open] > summary { background: var(--mint); border-color: var(--brand-400); color: var(--brand-800); }
.kap-panel { position: absolute; top: calc(100% + 4px); right: 0; z-index: 30; margin: 0; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--brand-50); box-shadow: var(--shadow-nav); display: flex; flex-direction: column; gap: 12px; width: max-content; max-width: min(560px, 92vw); }
.kap-panel-form { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; margin: 0; }
.kap-panel-form label { margin: 0; flex: 1; min-width: 150px; }
.kap-panel-form input, .kap-panel-form select { margin-top: 4px; }

/* Ansicht-Umschalter + Kachel-Ansicht */
.ansicht-umschalter { display: flex; gap: 4px; }
.ansicht-umschalter a { padding: 6px 12px; border-radius: 999px; border: 1.5px solid var(--line); background: #fff; color: var(--brand-700); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.ansicht-umschalter a:hover { background: var(--brand-50); text-decoration: none; }
.ansicht-umschalter a.aktiv { background: var(--mint); border-color: var(--brand-400); color: var(--brand-800); }
.kachel-breadcrumb { margin: 6px 0 16px; font-size: 13px; color: var(--brand-600); }
.kachel-breadcrumb a { color: var(--brand-700); font-weight: 600; }
.bc-sep { margin: 0 6px; color: var(--brand-500); }
.kachel-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px; margin-bottom: 18px; }
.kachel { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; border: 1px solid var(--line); border-radius: 16px; background: #fff; padding: 18px; color: var(--brand-800); box-shadow: var(--shadow); min-height: 100px; }
.kachel:hover { text-decoration: none; border-color: var(--brand-400); background: var(--brand-50); }
.kachel-icon { font-size: 20px; color: var(--brand-500); }
.kachel-titel { font-weight: 700; font-size: 15px; line-height: 1.25; }
.kachel-meta { font-size: 11px; color: var(--brand-600); text-transform: uppercase; letter-spacing: .06em; margin-top: auto; }
.kachel-flag { display: inline-block; margin-top: 6px; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--warn); background: var(--warn-bg); border-radius: 999px; padding: 2px 9px; }
.kachel-icon { font-size: 30px; line-height: 1; }
.kap-emoji { font-size: 15px; }

/* Icon-Auswahl für Kapitel */
.icon-picker { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.icon-opt { margin: 0; cursor: pointer; text-transform: none; letter-spacing: normal; }
.icon-opt input { position: absolute; opacity: 0; width: 0; height: 0; }
.icon-opt > span { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; border: 1.5px solid var(--line); border-radius: 10px; background: #fff; font-size: 20px; line-height: 1; }
.icon-opt .io-none { font-size: 14px; color: var(--brand-500); }
.icon-opt:hover > span { border-color: var(--brand-400); background: var(--brand-50); }
.icon-opt input:checked + span { border-color: var(--brand-400); background: var(--mint); box-shadow: 0 0 0 2px rgba(180,221,222,.5); }

/* ---------- Aufgaben ---------- */
.nav-badge { display: inline-block; min-width: 18px; padding: 0 6px; margin-left: 4px; border-radius: 999px; background: var(--danger); color: #fff; font-size: 10.5px; font-weight: 800; line-height: 18px; text-align: center; vertical-align: middle; }
.nav-badge-info { background: var(--mint); color: var(--brand-800); }
.mainnav a.aktiv .nav-badge { background: var(--brand-800); color: #fff; }

/* „Neu für mich"-Liste */
.neu-liste { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.neu-liste li { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; padding: 12px 0; border-bottom: 1px solid var(--brand-50); }
.neu-liste li:last-child { border-bottom: none; }
.neu-titel { font-size: 15px; font-weight: 600; color: var(--ink); }
.neu-meta { font-size: 12.5px; color: var(--brand-600); }
.neu-flag { flex: none; padding: 1px 9px; border-radius: 999px; font-size: 9.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; }
.neu-flag-neu { background: #e7f1ec; color: #2f6d4f; border: 1px solid #cfe6da; }
.neu-flag-geaendert { background: #e6eef8; color: #35507a; border: 1px solid #cfddf0; }

.tab-leiste { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.tab-leiste a { border: 1px solid var(--line); border-radius: 999px; padding: 7px 16px; background: #fff; color: var(--brand-700); font-size: 13px; font-weight: 700; }
.tab-leiste a.aktiv { background: var(--mint); border-color: var(--brand-400); color: var(--brand-800); }

.filter-leiste { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.filter-leiste select { min-height: 40px; margin: 0; width: auto; }

.aufgabe-neu { padding: 0; }
.aufgabe-neu > summary { cursor: pointer; padding: 14px 18px; font-weight: 700; color: var(--brand-700); list-style: none; }
.aufgabe-neu > summary::-webkit-details-marker { display: none; }
.aufgabe-neu[open] > summary { border-bottom: 1px solid var(--line); }
.aufgabe-form { padding: 16px 18px; display: flex; flex-direction: column; gap: 14px; }
.aufgabe-form .feld { display: flex; flex-direction: column; gap: 5px; }
.aufgabe-form .feld label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--brand-600); }
.aufgabe-form .feld input, .aufgabe-form .feld select, .aufgabe-form .feld textarea { margin: 0; width: 100%; }
.aufgabe-form .feld-reihe { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
@media (max-width: 640px) { .aufgabe-form .feld-reihe { grid-template-columns: 1fr; } }

.aufgaben-liste { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.aufgabe { border: 1px solid var(--line); border-left: 4px solid var(--brand-400); border-radius: 14px; background: #fff; padding: 14px 16px; box-shadow: var(--shadow); }
.aufgabe.ueberfaellig { border-left-color: var(--danger); }
.aufgabe.erledigt { opacity: .62; border-left-color: var(--brand-200); }
.aufgabe-haupt { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.aufgabe-titel { font-size: 15px; font-weight: 600; color: var(--ink); }
.aufgabe.erledigt .aufgabe-titel { text-decoration: line-through; }
.aufgabe-text { margin: 7px 0 0; color: var(--brand-700); font-size: 13.5px; line-height: 1.5; }
.aufgabe-fuss { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 10px; font-size: 13px; color: var(--brand-600); }
.aufgabe-dok { font-weight: 600; }
.aufgabe-person { color: var(--brand-700); }
.aufgabe-aktionen { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 12px; }

/* Aufgaben-Typ-Pille (an jeder Stelle einheitlich) */
.aufgabe-typ { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 9.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; background: var(--brand-50); color: var(--brand-700); border: 1px solid var(--line); white-space: nowrap; }
.aufgabe-typ.typ-checkliste    { background: #e7f1ec; color: #2f6d4f; border-color: #cfe6da; }
.aufgabe-typ.typ-ueberarbeiten { background: var(--warn-bg); color: var(--warn); border-color: #e6d6b6; }
.aufgabe-typ.typ-pruefen       { background: #e6eef8; color: #35507a; border-color: #cfddf0; }
.aufgabe-typ.typ-hinweis       { background: var(--brand-100); color: #8a4a3f; border-color: var(--brand-200); }
.aufgabe-typ.typ-sonstiges     { background: var(--brand-50); color: var(--brand-600); }

.kachel-neu { margin: 4px 0 14px; }

/* „Aufgabe dazu"-Sektion im Dokumentformular */
.aufgabe-inline-felder { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 12px; }
.aufgabe-inline-felder[hidden] { display: none; }
.aufgabe-inline-felder .feld { display: flex; flex-direction: column; gap: 5px; }
.aufgabe-inline-felder .feld label { margin: 0; }
.aufgabe-inline-felder .feld input, .aufgabe-inline-felder .feld select { margin: 0; }
.aufgabe-inline-felder .feld-reihe { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
@media (max-width: 640px) { .aufgabe-inline-felder .feld-reihe { grid-template-columns: 1fr; } }

/* Hinweis-/Vorschlag-Karte am Dokument */
.hinweis-karte details > summary { cursor: pointer; list-style: none; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--brand-700); }
.hinweis-karte details > summary::-webkit-details-marker { display: none; }
.hinweis-karte details[open] > summary { margin-bottom: 8px; }
.hinweis-karte textarea { min-height: 70px; }
.hinweis-karte .btn { margin-top: 8px; }

/* Kompakte Aufgabenliste am Dokument */
.dok-aufgaben { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.dok-aufgaben li { display: flex; flex-direction: column; gap: 4px; padding-bottom: 9px; border-bottom: 1px solid var(--brand-50); }
.dok-aufgaben li:last-child { border-bottom: none; padding-bottom: 0; }
.dok-aufgaben .da-titel { font-size: 13.5px; font-weight: 600; color: var(--ink); }
.dok-aufgaben .da-meta { font-size: 12px; color: var(--brand-600); }
