/* ============================================================
   Einsatzprotokoll – Stylesheet
   Hauptfarbe kommt aus den Einstellungen (render_theme_style_tag()).
   Schriftgröße in Eingabefeldern bleibt bei 16px, weil iOS-Safari bei
   kleineren Feldern beim Antippen ungefragt hineinzoomt.
   ============================================================ */
:root {
    --primary: #ad2f34;
    --primary-dark: #87252a;
    --bg: #f2f2f7;
    --card: #fff;
    --text: #1c1c1e;
    --muted: #6e6e73;
    --border: #d1d1d6;
    --gray: #e5e5ea;
    --radius: 12px;
    --sidebar-w: 260px;
    --topbar-h: 64px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-size: 16px;
    line-height: 1.45;
    background: var(--bg);
    color: var(--text);
}
a { color: var(--primary); }

/* ---------- Kopfleiste ---------- */
.topbar {
    position: sticky; top: 0; z-index: 40;
    display: flex; align-items: center; gap: 12px;
    min-height: var(--topbar-h);
    padding: env(safe-area-inset-top) 16px 0;
    padding-left: max(16px, env(safe-area-inset-left));
    padding-right: max(16px, env(safe-area-inset-right));
    background: var(--primary); color: #fff;
}
.topbar h1 {
    flex: 1; margin: 0; font-size: 20px; font-weight: 700;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.topbar-user { font-size: 14px; opacity: .9; white-space: nowrap; }
.topbar-btn, .menu-toggle {
    background: rgba(255,255,255,.18); color: #fff; border: 0;
    border-radius: 999px; padding: 8px 16px; font-size: 15px;
    text-decoration: none; cursor: pointer; white-space: nowrap;
}
.topbar-btn:hover, .menu-toggle:hover { background: rgba(255,255,255,.28); }
.menu-toggle { display: none; font-size: 20px; padding: 6px 12px; line-height: 1; }

/* ---------- Grundgerüst mit Seitenmenü ---------- */
.layout { display: flex; min-height: calc(100vh - var(--topbar-h)); }
.sidebar {
    width: var(--sidebar-w); flex: none;
    background: #fff; border-right: 1px solid var(--border);
    padding: 16px 12px;
    display: flex; flex-direction: column;
    position: sticky; top: var(--topbar-h);
    height: calc(100vh - var(--topbar-h)); overflow-y: auto;
}
.sidebar-org {
    display: flex; align-items: center; gap: 10px;
    padding: 4px 8px 16px; margin-bottom: 8px;
    border-bottom: 1px solid var(--gray);
    font-weight: 700; font-size: 14px; line-height: 1.25;
}
.sidebar-logo { width: 40px; height: 40px; border-radius: 8px; object-fit: cover; flex: none; }
.sidebar nav a {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 14px; margin-bottom: 4px; border-radius: 10px;
    color: var(--text); text-decoration: none; font-weight: 600;
}
.sidebar nav a:hover { background: var(--bg); }
.sidebar nav a.active { background: var(--primary); color: #fff; }
.nav-icon { width: 22px; text-align: center; }
.sidebar-foot { margin-top: auto; padding: 16px 14px 4px; font-size: 12px; color: var(--muted); }
.overlay { display: none; }

.content { flex: 1; min-width: 0; padding: 24px 16px 48px; }
.container { max-width: 930px; margin: 0 auto; }
.app-footer { text-align: center; color: var(--muted); font-size: 12px; margin-top: 32px; }

/* Unter 900px (iPhone, iPad hochkant geteilt) wird das Menü ausklappbar,
   sonst bliebe für den Inhalt kaum Platz. */
@media (max-width: 899px) {
    .menu-toggle { display: inline-block; }
    .topbar-user { display: none; }
    .sidebar {
        position: fixed; top: 0; left: 0; bottom: 0; height: auto; z-index: 60;
        padding-top: calc(16px + env(safe-area-inset-top));
        transform: translateX(-100%); transition: transform .2s ease;
        box-shadow: 2px 0 16px rgba(0,0,0,.15);
    }
    body.menu-offen .sidebar { transform: none; }
    body.menu-offen .overlay {
        display: block; position: fixed; inset: 0; z-index: 50; background: rgba(0,0,0,.35);
    }
}
@media (prefers-reduced-motion: reduce) { .sidebar { transition: none; } }

/* ---------- Startseite ---------- */
.start-hero { padding: 8px 0 28px; }
/* Doppelte Klasse, damit die allgemeine .btn-Regel weiter unten das Polster
   nicht überschreibt. */
.btn.btn-hero {
    display: block; width: 100%; text-align: center;
    padding: 22px 20px; font-size: 22px; font-weight: 700;
    border-radius: 14px;
}
.list-title { font-size: 17px; margin: 0 0 10px; }

/* ---------- Karten, Überschriften ---------- */
.card {
    background: var(--card); border-radius: var(--radius);
    padding: 18px; margin-bottom: 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,.08);
}
.section-title {
    font-size: 15px; text-transform: uppercase; letter-spacing: .04em;
    color: var(--primary); margin: 0 0 12px; font-weight: 700;
}
.hint { color: var(--muted); font-size: 13px; margin: -4px 0 12px; }
.page-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }

/* ---------- Buttons ---------- */
.btn, button.btn {
    display: inline-block; border: 0; cursor: pointer;
    padding: 12px 18px; border-radius: 10px;
    font-size: 16px; font-weight: 600; text-align: center; text-decoration: none;
    font-family: inherit; line-height: 1.2;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-secondary { background: var(--gray); color: var(--text); }
.btn-secondary:hover { background: #d8d8de; }
.btn-danger { background: #fdecec; color: #b3261e; }
.btn-danger:hover { background: #f9d6d6; }
.btn-small { padding: 8px 12px; font-size: 14px; }
.btn-block { display: block; width: 100%; }
.btn[disabled] { opacity: .4; cursor: default; }

/* ---------- Listen ---------- */
.list { display: flex; flex-direction: column; gap: 8px; }
.list-item {
    display: flex; align-items: center; gap: 12px;
    background: #fff; border-radius: var(--radius); padding: 14px 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,.08);
    color: var(--text); text-decoration: none;
}
a.list-item:hover { box-shadow: 0 2px 8px rgba(0,0,0,.12); }
.list-item-main { flex: 1; min-width: 0; }
.list-item-main strong { display: block; overflow: hidden; text-overflow: ellipsis; }
.list-item-badges { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.list-item-actions { display: flex; gap: 8px; align-items: center; flex: none; }
.meta { color: var(--muted); font-size: 14px; margin-top: 2px; }

.badge {
    display: inline-block; padding: 3px 9px; border-radius: 999px;
    font-size: 12px; font-weight: 700; white-space: nowrap;
}
.badge-ok { background: #e3f4e7; color: #1d6b31; }
.badge-warn { background: #fff3d6; color: #8a5a00; }
.badge-rot { background: #fdecec; color: #b3261e; }
.badge-grau { background: var(--gray); color: #48484a; }

/* Das hidden-Attribut muss auch gegen display-Regeln wie .btn gewinnen,
   sonst erscheinen per Skript versteckte Knöpfe trotzdem. */
[hidden] { display: none !important; }

/* ---------- 1.4.0 ---------- */
.sichtung { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.chip-warn { background: #fdecec; color: #8c1d18; }
.vital-diagramme { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 12px; margin-top: 12px; }
.vital-svg { width: 100%; height: auto; background: #fafafc; border: 1px solid #e5e5ea; border-radius: 8px; }
.vs-titel { font-size: 12px; font-weight: 700; fill: #3a3a3c; }
.vs-achse { font-size: 10px; fill: #6e6e73; }
.vs-gitter { stroke: #e5e5ea; stroke-width: 1; }
.plausi-liste { margin: 0; padding-left: 20px; }
.plausi-liste li { margin: 6px 0; }
.plausi-liste a { color: inherit; }
.tab-zahl {
    display: inline-block; min-width: 20px; padding: 1px 6px; border-radius: 999px;
    background: #e0a100; color: #fff; font-size: 12px; text-align: center; margin-left: 4px;
}

/* ---------- Lager-Ampel (Startseite) ---------- */
.ampel {
    display: flex; align-items: center; gap: 12px; margin-bottom: 20px;
    padding: 14px 16px; border-radius: var(--radius); text-decoration: none; color: var(--text);
    background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.08); border-left: 6px solid;
}
.ampel-punkt { width: 16px; height: 16px; border-radius: 50%; flex: none; }
.ampel-rot { border-color: #c62828; } .ampel-rot .ampel-punkt { background: #c62828; }
.ampel-gelb { border-color: #e0a100; } .ampel-gelb .ampel-punkt { background: #e0a100; }
.ampel-gruen { border-color: #2e7d32; } .ampel-gruen .ampel-punkt { background: #2e7d32; }

/* ---------- Offline / Sicherung ---------- */
.offline-leiste {
    position: sticky; top: 0; z-index: 70; background: #4a4a4f; color: #fff;
    padding: 8px 16px; padding-top: max(8px, env(safe-area-inset-top)); font-size: 14px; text-align: center;
}
.warn-box { padding: 14px 16px; border-radius: var(--radius); margin-bottom: 16px; font-size: 15px; background: #fff3d6; color: #6b4600; }
.sicherung { margin-right: auto; align-self: center; font-size: 13px; color: var(--muted); }
.alter-anzeige { padding: 11px 0; font-weight: 600; }
a.topbar-user { color: #fff; text-decoration: none; }
a.topbar-user:hover { text-decoration: underline; }
.sidebar-foot a { color: inherit; }

/* ---------- Meldungen ---------- */
.info-box, .error-box {
    padding: 14px 16px; border-radius: var(--radius); margin-bottom: 16px; font-size: 15px;
}
.info-box { background: #eaf1fc; color: #1f3f7a; }
.error-box { background: #fdecec; color: #8c1d18; }

/* ---------- Formulare ---------- */
label { display: block; font-weight: 600; font-size: 14px; margin: 14px 0 6px; }
label:first-child { margin-top: 0; }
input[type=text], input[type=password], input[type=email], input[type=number],
input[type=date], input[type=time], input[type=search], select, textarea {
    width: 100%; padding: 11px 12px; font-size: 16px; font-family: inherit;
    border: 1px solid var(--border); border-radius: 10px; background: #fff; color: var(--text);
}
textarea { min-height: 90px; resize: vertical; }
input:focus, select:focus, textarea:focus {
    outline: none; border-color: var(--primary);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 20%, transparent);
}
.check { display: flex; align-items: center; gap: 10px; font-weight: 400; font-size: 15px; }
.check input { width: 20px; height: 20px; margin: 0; flex: none; }
.form-actions { margin-top: 18px; display: flex; gap: 10px; flex-wrap: wrap; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.grid-3 { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 0 14px; align-items: end; }
@media (max-width: 599px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }

.filter-bar { display: grid; grid-template-columns: 1fr 180px auto; gap: 10px; align-items: end; }
.filter-bar label { margin-top: 0; }
@media (max-width: 599px) { .filter-bar { grid-template-columns: 1fr; } }

.pagination { display: flex; justify-content: space-between; align-items: center; margin-top: 16px; color: var(--muted); font-size: 14px; }

details { margin-top: 8px; }
summary { cursor: pointer; font-weight: 600; padding: 8px 0; }
.list-item-kompakt { padding: 8px 12px; box-shadow: none; border: 1px solid var(--gray); }
.check-grid > .feld { margin-top: 0; }
.check-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px 16px; }

/* ---------- Lager ---------- */
.qty-btn {
    width: 40px; height: 40px; border-radius: 50%; border: 0; cursor: pointer;
    background: var(--gray); font-size: 20px; font-weight: 700; color: var(--text);
}
.qty-btn[disabled] { opacity: .35; cursor: default; }
.qty { min-width: 32px; text-align: center; font-weight: 700; }
.standort-row { display: flex; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--gray); }
.standort-row:last-child { border-bottom: 0; }
.standort-row input[type=number] { width: 110px; flex: none; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.chip {
    padding: 8px 14px; border-radius: 999px; background: #fff; color: var(--text);
    text-decoration: none; font-size: 14px; font-weight: 600; box-shadow: 0 1px 2px rgba(0,0,0,.08);
}
.chip.active { background: var(--primary); color: #fff; }

/* ---------- Anmeldung ---------- */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px 16px; }
.login-box { width: 100%; max-width: 400px; background: #fff; border-radius: 16px; padding: 28px 24px; box-shadow: 0 4px 20px rgba(0,0,0,.08); text-align: center; }
.login-box form { text-align: left; }
.login-logo { width: 96px; height: 96px; border-radius: 16px; object-fit: cover; }
.login-box h1 { font-size: 20px; margin: 14px 0 4px; }
.login-box .sub { color: var(--muted); margin: 0 0 20px; font-size: 14px; }
.login-version { margin-top: 18px; font-size: 12px; color: var(--muted); }


/* ============================================================
   Einsatzprotokoll – Formular
   ============================================================ */
.protokoll-layout { display: grid; grid-template-columns: 190px 1fr; gap: 20px; align-items: start; }
.protokoll-tabs {
    position: sticky; top: calc(var(--topbar-h) + 16px);
    display: flex; flex-direction: column; gap: 4px;
    background: #fff; border-radius: var(--radius); padding: 8px; box-shadow: 0 1px 3px rgba(0,0,0,.08);
}
.tab-link {
    border: 0; background: none; text-align: left; padding: 10px 12px; border-radius: 8px;
    font: inherit; font-size: 15px; font-weight: 600; color: var(--text); cursor: pointer;
}
.tab-link:hover { background: var(--bg); }
.tab-link.active { background: var(--primary); color: #fff; }
.protokoll-inhalt { min-width: 0; }
.tab-page { display: none; }
.tab-page.active { display: block; }
.tab-nav { display: flex; justify-content: space-between; gap: 10px; margin: 4px 0 24px; }
/* Unter 1100px (iPad hochkant mit Menü, iPhone) werden die Reiter zu einer
   waagrecht wischbaren Leiste über dem Inhalt. */
@media (max-width: 1099px) {
    .protokoll-layout { grid-template-columns: 1fr; gap: 12px; }
    .protokoll-tabs {
        top: var(--topbar-h); z-index: 20; flex-direction: row; overflow-x: auto;
        -webkit-overflow-scrolling: touch; scrollbar-width: none;
    }
    .protokoll-tabs::-webkit-scrollbar { display: none; }
    .tab-link { white-space: nowrap; flex: none; }
}

.feld { margin-top: 14px; }
.feld:first-child { margin-top: 0; }
.feld > label:first-child { margin-top: 0; }
.feld-hinweis { color: var(--muted); font-size: 13px; margin-top: 4px; }
.pflicht { color: var(--primary); }
.versteckt { display: none !important; }
.eingerueckt { margin-left: 30px; }
.massnahme { padding: 12px 0; border-bottom: 1px solid var(--gray); }
.massnahme:last-of-type { border-bottom: 0; }
.massnahme > .feld:first-child { margin: 0; }
.grid-3-gleich { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 14px; }
.grid-3-gleich > .feld { margin-top: 0; }
.grid-plz { display: grid; grid-template-columns: 130px 1fr; gap: 0 14px; }
.grid-2 > .feld, .grid-plz > .feld { margin-top: 14px; }
@media (max-width: 599px) {
    .grid-3-gleich, .grid-plz { grid-template-columns: 1fr; }
    .grid-3-gleich > .feld { margin-top: 14px; }
    .eingerueckt { margin-left: 0; }
}
.zeit-zeile, .einheit-zeile { display: flex; gap: 8px; align-items: center; }
.einheit { color: var(--muted); font-size: 15px; white-space: nowrap; }

.radio-row { display: flex; flex-wrap: wrap; gap: 8px; }
.radio-pill {
    display: inline-flex; align-items: center; margin: 0;
    padding: 10px 14px; border-radius: 999px; border: 1px solid var(--border);
    background: #fff; font-weight: 500; font-size: 15px; cursor: pointer; user-select: none;
}
.radio-pill input { position: absolute; opacity: 0; pointer-events: none; }
.radio-pill.checked { background: var(--primary); border-color: var(--primary); color: #fff; }
.radio-pill:has(input:focus-visible) { outline: 3px solid color-mix(in srgb, var(--primary) 35%, transparent); }

h2.abcde { display: flex; align-items: center; gap: 12px; font-size: 18px; margin: 0 0 14px; }
h2.abcde span {
    width: 36px; height: 36px; border-radius: 10px; background: var(--primary); color: #fff;
    display: inline-flex; align-items: center; justify-content: center; font-size: 20px;
}
.gcs-summe { margin-top: 12px; text-align: center; font-weight: 700; background: var(--bg); border-radius: 10px; padding: 10px; }

.zeilen { display: flex; flex-direction: column; gap: 10px; margin-bottom: 12px; }
.zeile {
    position: relative; display: grid; gap: 8px; align-items: end;
    background: var(--bg); border-radius: 10px; padding: 10px 44px 10px 10px;
}
.zeile label { margin: 0 0 4px; font-size: 12px; }
.zeile-med { grid-template-columns: 110px 2fr 1fr 1fr; }
.zeile-vital { grid-template-columns: repeat(7, minmax(0, 1fr)); }
.zeile .andere-text { margin-top: 6px; }
.zeile-weg {
    position: absolute; top: 8px; right: 8px; width: 30px; height: 30px; border-radius: 50%;
    border: 0; background: #fff; font-size: 18px; cursor: pointer; color: var(--muted);
}
@media (max-width: 799px) {
    .zeile-med { grid-template-columns: 1fr 1fr; }
    .zeile-med .zeile-breit { grid-column: 1 / -1; }
    .zeile-vital { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

.unterschrift-feld { border: 1px solid var(--border); border-radius: 10px; background: #fff; }
/* Gilt für jedes Unterschriftsfeld (Protokollführer und Patient). Früher
   stand die Regel nur am Feld des Protokollführers: Das Patientenfeld hatte
   dadurch keine feste Höhe (wuchs beim Einrichten immer weiter) und kein
   touch-action: none – am Handy wurde gescrollt statt gezeichnet. */
.unterschrift-feld canvas { display: block; width: 100%; height: 180px; touch-action: none; }

.sticky-submit-bar {
    position: sticky; bottom: 0; z-index: 30; display: flex; justify-content: flex-end; gap: 10px;
    padding: 12px 0 calc(12px + env(safe-area-inset-bottom));
    background: linear-gradient(to top, var(--bg) 70%, rgba(242,242,247,0));
}

/* ---------- Körperschema ---------- */
.koerper-arten { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.koerper-art {
    display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px;
    border-radius: 10px; border: 2px solid var(--gray); background: #fff;
    font: inherit; font-size: 14px; font-weight: 600; cursor: pointer;
}
.koerper-art.aktiv { border-color: var(--text); }
.punkt { width: 14px; height: 14px; border-radius: 50%; display: inline-block; flex: none; }
.koerper-figuren { display: flex; gap: 16px; flex-wrap: wrap; }
.koerper-figuren figure { margin: 0; text-align: center; color: var(--muted); font-size: 13px; }
.koerper-figuren figcaption { margin-bottom: 4px; }
.koerper-svg { width: 190px; height: auto; background: var(--bg); border-radius: 10px; cursor: crosshair; display: block; }
.koerper-figuren.klein .koerper-svg { width: 130px; cursor: default; }
.koerper-teil { fill: #e8e4dc; stroke: #8e8b85; stroke-width: 2; }
.koerper-seite { font-size: 15px; font-weight: 700; fill: #8e8b85; }
.koerper-kuerzel { font-size: 10px; font-weight: 700; fill: #fff; text-anchor: middle; pointer-events: none; }
.marke { cursor: pointer; }
.koerper-legende { font-size: 13px; display: flex; flex-direction: column; gap: 4px; justify-content: center; }
.koerper-legende div { display: flex; align-items: center; gap: 6px; }

/* ============================================================
   Einsatzprotokoll – Ansicht (angelehnt an die Pulsation-Dokumentation)
   ============================================================ */
.doku { background: #fff; border-radius: var(--radius); box-shadow: 0 1px 3px rgba(0,0,0,.08); padding: 18px; }
.doku-kopf { display: grid; grid-template-columns: 2fr repeat(4, minmax(110px, 1fr)); border: 1px solid #b9b9bf; background: #e9e9ee; }
.doku-titel { padding: 10px 14px; display: flex; flex-direction: column; justify-content: center; }
.doku-titel strong { font-size: 20px; }
.doku-titel span { color: var(--muted); font-size: 13px; }
.doku-kasten { padding: 8px 10px; border-left: 1px solid #b9b9bf; background: #fff; font-weight: 700; font-size: 16px; }
.doku-kasten small, .doku-zeiten small { display: block; font-size: 11px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
.doku-oben { grid-template-columns: 1.3fr 1fr 150px !important; margin-top: 12px; }
.doku-block h3, .doku-abschnitt h3 {
    margin: 0 0 8px; padding: 6px 10px; background: #e9e9ee; border: 1px solid #b9b9bf;
    font-size: 14px; text-transform: uppercase; letter-spacing: .03em;
}
.doku-zeiten { border: 1px solid #b9b9bf; display: flex; flex-direction: column; }
.doku-zeiten div { padding: 6px 10px; border-bottom: 1px solid #d8d8de; font-weight: 700; }
.doku-zeiten div:last-child { border-bottom: 0; }
.doku-abschnitt { margin-top: 16px; }
.doku-raster { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 12px; }
.doku-raster.breit { grid-template-columns: 1fr; }
.doku-zeile { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 12px; }
.doku-feld { padding: 6px 2px 4px; border-bottom: 1px solid #d8d8de; min-height: 42px; overflow-wrap: anywhere; }
.doku-zeile-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.doku-unter { margin-top: 8px; padding-top: 6px; border-top: 1px dashed #d8d8de; }
.doku-feld.ganz { grid-column: 1 / -1; }
.doku-feld.gross { font-size: 18px; font-weight: 700; }
.doku-feld small { display: block; font-size: 11px; color: var(--muted); font-weight: 400; margin-top: 2px; }
.leer { color: #b0b0b5; }
.doku-tabelle { width: 100%; border-collapse: collapse; font-size: 14px; }
.doku-tabelle th, .doku-tabelle td { border: 1px solid #d1d1d6; padding: 6px 8px; text-align: left; }
.doku-tabelle th { background: #f2f2f7; font-size: 12px; }
.tabelle-scroll { overflow-x: auto; }
.unterschrift-bild { max-width: 260px; max-height: 90px; display: block; }
.koerper-figuren.klein { margin-top: 12px; }
@media (max-width: 799px) {
    .doku { padding: 12px; }
    .doku-kopf { grid-template-columns: 1fr 1fr; }
    .doku-titel { grid-column: 1 / -1; }
    .doku-kasten { border-left: 0; border-top: 1px solid #b9b9bf; }
    .doku-oben, .doku-raster { grid-template-columns: 1fr !important; }
    .doku-zeiten { flex-direction: row; flex-wrap: wrap; }
    .doku-zeiten div { flex: 1 1 45%; }
}

@media print {
    .topbar, .sidebar, .overlay, .no-print { display: none !important; }
    .content { padding: 0; }
    body { background: #fff; }
}

/* ---------- 1.5.0 ---------- */
/* „Jetzt“ in Medikamenten- und Vitalwertzeilen: in der Beschriftungszeile,
   damit das schmale Zeitfeld in der Tabelle voll breit bleibt. */
.label-jetzt { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.jetzt-klein {
    border: 1px solid #c9ccd3; background: #fff; color: #333; border-radius: 999px;
    font-size: 12px; font-weight: 600; padding: 3px 9px; line-height: 1.3; cursor: pointer;
}
.jetzt-klein:active { background: #eef0f4; }
.doku-tabelle .zahl { text-align: right; white-space: nowrap; }
.doku-tabelle td.klein { font-size: 12px; color: #555; }
.inline-form { display: inline; margin: 0; }

/* Jahresübersicht */
.kennzahlen { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 16px; }
.kennzahl { background: #fff; border-radius: 12px; padding: 12px 14px; box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.kennzahl span { display: block; font-size: 12px; color: #666; }
.kennzahl strong { display: block; font-size: 24px; margin-top: 4px; }
.auswertung-raster { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 0 16px; }
.balken-liste { display: flex; flex-direction: column; gap: 6px; }
.balken-zeile { display: grid; grid-template-columns: minmax(90px, 40%) 1fr auto; gap: 8px; align-items: center; font-size: 14px; }
.balken-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.balken-spur { background: #f0f1f4; border-radius: 4px; height: 12px; overflow: hidden; }
.balken { display: block; height: 100%; background: var(--primary, #ad2f34); border-radius: 4px; }
.balken-zahl { font-weight: 700; white-space: nowrap; }
.balken-zahl small { font-weight: 400; color: #777; }
.monate { display: grid; grid-template-columns: repeat(12, 1fr); gap: 4px; height: 160px; align-items: end; }
.monat { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; }
.monat-saeule { width: 70%; background: var(--primary, #ad2f34); border-radius: 4px 4px 0 0; min-height: 0; }
.monat-zahl { font-size: 12px; font-weight: 700; margin-bottom: 2px; }
.monat-name { font-size: 11px; color: #666; margin-top: 4px; }

/* ---------- 1.6.0 ---------- */
/* Region der Lebensretter: eigene Farbe, damit es in Listen auffällt */
.badge-rdl { background: #e6f0fb; color: #1d5ea8; }
