html { font-size: 15px; }
body { background: #f4f6f8; }

.pg-nav { background: #0f5e6e; }
.pg-nav .nav-link { color: rgba(255,255,255,.85); }
.pg-nav .nav-link:hover { color: #fff; }
.pg-nav .nav-link.active { color: #fff; font-weight: 600; }

/* Menü-Bereiche: farbige Unterstreichung, damit Reinigung / Aufnahme / Betten klar getrennt sind */
.pg-nav .nav-bereich > .nav-link { border-bottom: 3px solid transparent; }
.pg-nav .bereich-reinigung > .nav-link.active, .pg-nav .bereich-reinigung > .nav-link:hover { border-bottom-color: #7dd3a7; }
.pg-nav .bereich-aufnahme > .nav-link.active, .pg-nav .bereich-aufnahme > .nav-link:hover { border-bottom-color: #c4a7f5; }
.pg-nav .bereich-betten > .nav-link.active, .pg-nav .bereich-betten > .nav-link:hover { border-bottom-color: #8ec5ff; }
.pg-nav .nav-trenner { width: 1px; background: rgba(255,255,255,.3); margin: .5rem .6rem; }
@media (min-width: 992px) { .pg-nav .nav-bereich { margin: 0 .15rem; } }

.card { border: none; box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.kpi .wert { font-size: 2rem; font-weight: 700; line-height: 1.1; }
.kpi .titel { color: #6c757d; font-size: .85rem; text-transform: uppercase; letter-spacing: .03em; }

.table td, .table th { vertical-align: middle; }
.zeile-erledigt td { color: #6c757d; text-decoration: line-through; }
.zeile-erledigt td.kein-strich { text-decoration: none; }

/* Mobile Ansicht für Reinigungskräfte */
.aufgabe { border-left: 6px solid #0f5e6e; }
.aufgabe.sonder { border-left-color: #dc3545; }
.aufgabe.erledigt { opacity: .55; border-left-color: #198754; }
.aufgabe .btn-erledigt { min-width: 7.5rem; min-height: 3rem; font-size: 1.05rem; }

.sterne { display: flex; gap: .4rem; flex-wrap: wrap; }
.sterne input { display: none; }
.sterne label { font-size: 2.4rem; cursor: pointer; padding: .2rem .5rem; border-radius: .5rem; background: #fff; border: 1px solid #dee2e6; }
.sterne input:checked + label { background: #0f5e6e; color: #fff; }

.qr-etikett { width: 62mm; display: inline-block; text-align: center; border: 1px dashed #aaa; padding: 4mm; margin: 2mm; page-break-inside: avoid; background: #fff; }
.qr-etikett img { width: 45mm; height: 45mm; }
@media print {
    .pg-nav, .no-print { display: none !important; }
    body { background: #fff; }
}

/* ── Grundriss ─────────────────────────────────────────── */
.gr-plan { position: relative; user-select: none; }
.gr-plan img { width: 100%; display: block; }
.gr-plan svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.gr-raum { stroke: #333; stroke-width: 1.5; fill-opacity: .45; cursor: pointer; transition: fill-opacity .15s; }
.gr-raum:hover, .gr-raum.gewaehlt { fill-opacity: .75; stroke-width: 3; }
.st-sonder { fill: #dc3545; background: #dc3545; }
.st-offen { fill: #fd7e14; background: #fd7e14; }
.st-erledigt { fill: #198754; background: #198754; }
.st-frei { fill: #adb5bd; background: #adb5bd; }
.nur-meine .gr-raum:not(.meins) { fill-opacity: .12; stroke-opacity: .3; }
.nur-meine .gr-label:not(.meins) { opacity: .35; }
.gr-label { position: absolute; transform: translate(-50%, -50%); font-size: .75rem; font-weight: 600; background: rgba(255,255,255,.8);
            padding: 0 .3rem; border-radius: .25rem; white-space: nowrap; cursor: pointer; pointer-events: auto; }
.gr-legende { display: inline-block; width: .9rem; height: .9rem; border-radius: .2rem; vertical-align: -2px; opacity: .8; }

/* Editor */
.gr-editor svg { cursor: crosshair; }
.gr-editor .gr-raum { cursor: crosshair; fill: #0f5e6e; }
.gr-editor .gr-raum.aktiv { fill: #fd7e14; fill-opacity: .6; stroke-width: 3; }
.gr-editor .gr-vorschau { fill: #fd7e14; fill-opacity: .3; stroke: #fd7e14; stroke-width: 2; stroke-dasharray: 4 3; }
.gr-editor .gr-label { pointer-events: none; }
.raum-liste { max-height: 70vh; overflow-y: auto; }
.raum-liste .list-group-item { cursor: pointer; }

/* ── Bettenmanagement ──────────────────────────────────── */
.bett { width: 7.4rem; min-height: 4.6rem; border-radius: .5rem; border: 2px solid; padding: .25rem .4rem; text-align: start;
        display: flex; flex-direction: column; line-height: 1.15; cursor: pointer; transition: transform .1s; }
.bett:hover { transform: translateY(-2px); box-shadow: 0 2px 6px rgba(0,0,0,.15); }
.bett-nr { font-weight: 700; font-size: .8rem; opacity: .75; }
.bett-wer { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bett-info { font-size: .75rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bett-Frei, .bett-legende.bett-Frei { background: #d1e7dd; border-color: #198754; color: #0f5132; }
.bett-Reserviert { background: #e2d9f3; border-color: #6f42c1; color: #3d2272; }
.bett-Belegt { background: #cfe2ff; border-color: #0d6efd; color: #052c65; }
.bett-Belegt.entlassung { border-style: dashed; border-color: #fd7e14; }
.bett-Schmutzig { background: #f3e3d3; border-color: #8a5a2b; color: #4d3118; }
.bett-Schmutzig.ueberfaellig { border-color: #dc3545; animation: bett-puls 1.6s infinite; }
.bett-Gesperrt { background: repeating-linear-gradient(45deg, #e9ecef, #e9ecef 6px, #dee2e6 6px, #dee2e6 12px); border-color: #495057; color: #343a40; }
.bett-legende { display: inline-block; width: .9rem; height: .9rem; border: 2px solid; border-radius: .2rem; vertical-align: -2px; }
@keyframes bett-puls { 50% { box-shadow: 0 0 0 4px rgba(220,53,69,.35); } }

/* Belegungsplan */
.plan-tabelle { table-layout: fixed; font-size: .8rem; }
.plan-tabelle th, .plan-tabelle td { padding: .15rem .2rem; border-color: #e3e7eb; }
.plan-tabelle .plan-bett { width: 11rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.plan-tabelle .plan-tag { text-align: center; width: 3.2rem; }
.plan-tabelle .wochenende { background: #f1f3f5; }
.plan-tabelle .heute { box-shadow: inset 2px 0 0 #dc3545, inset -2px 0 0 #dc3545; }
.plan-balken { border-radius: .35rem; padding: .05rem .35rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.plan-Aktiv { background: #0d6efd; color: #fff; }
.plan-Geplant { background: #e2d9f3; color: #3d2272; border: 1px dashed #6f42c1; }
.plan-Beendet { background: #ced4da; color: #495057; }
.plan-gesperrt { background: repeating-linear-gradient(45deg, #f1f3f5, #f1f3f5 5px, #dee2e6 5px, #dee2e6 10px); }
.plan-frei-zeile td { font-weight: 600; text-align: center; }

/* Patientenlogistik – Disposition */
.transport-karte { border: 1px solid #dee2e6; border-left: 6px solid #adb5bd; border-radius: .5rem; padding: .5rem .65rem; margin-bottom: .5rem; background: #fff; cursor: grab; }
.transport-karte.prio-1 { border-left-color: #dc3545; }
.transport-karte.prio-2 { border-left-color: #fd7e14; }
.transport-karte.ueberfaellig, .transport-mini.ueberfaellig { background: #fff1f2; }
.transport-karte.zieht, .transport-mini.zieht { opacity: .4; }
.transport-mini { border: 1px solid #e3e7eb; border-radius: .4rem; padding: .3rem .45rem; margin-bottom: .35rem; background: #f8f9fa; }
.transport-mini[draggable="true"] { cursor: grab; }
.transport-mini.unterwegs { background: #e7f1ff; border-color: #9ec5fe; }
.begleiter-karte { transition: box-shadow .1s, outline .1s; }
.begleiter-karte.ziel { outline: 3px dashed #0d6efd; box-shadow: 0 0 0 4px rgba(13,110,253,.15); }
.begleiter-karte .ablage { border: 1px dashed #ced4da; border-radius: .4rem; padding: .6rem; text-align: center; }
.pg-nav .bereich-logistik > .nav-link.active, .pg-nav .bereich-logistik > .nav-link:hover { border-bottom-color: #ffb37c; }

/* Gesamtübersicht */
.bereichskarte { border-top: 5px solid #adb5bd; }
.bereichskarte.bereich-reinigung { border-top-color: #7dd3a7; }
.bereichskarte.bereich-betten { border-top-color: #8ec5ff; }
.bereichskarte.bereich-aufnahme { border-top-color: #c4a7f5; }
.bereichskarte.bereich-logistik { border-top-color: #ffb37c; }
.mini-kpi { background: #f8f9fa; border-radius: .5rem; padding: .45rem .6rem; height: 100%; }
.mini-kpi .titel { color: #6c757d; font-size: .72rem; text-transform: uppercase; letter-spacing: .02em; }
.mini-kpi .wert { font-size: 1.45rem; font-weight: 700; line-height: 1.15; }
.mini-kpi .unter { font-size: .75rem; color: #6c757d; }
.handlung { display: block; border-left: 5px solid #adb5bd; background: #f8f9fa; border-radius: .4rem; padding: .4rem .6rem; color: #212529; height: 100%; }
.handlung:hover { background: #eef1f4; }
.handlung.kritisch { background: #fff1f2; }
.handlung-reinigung { border-left-color: #7dd3a7; }
.handlung-betten { border-left-color: #8ec5ff; }
.handlung-aufnahme { border-left-color: #c4a7f5; }
.handlung-logistik { border-left-color: #ffb37c; }
.handlung.kritisch { box-shadow: inset 0 0 0 1px #f1aeb5; }

/* Diagramme (Infrastructure/Diagramm.cs) */
.diagramm { width: 100%; height: auto; display: block; }
.diagramm .d-raster { stroke: #e9ecef; stroke-width: 1; }
.diagramm .d-achse { font-size: 10px; fill: #6c757d; }
.diagramm .d-grenze { stroke: #dc3545; stroke-width: 1.5; stroke-dasharray: 6 4; }
.diagramm .d-grenze-text { font-size: 10px; fill: #dc3545; }
.diagramm rect:hover { opacity: .8; }
.d-legende { display: flex; flex-wrap: wrap; gap: .9rem; font-size: .8rem; color: #495057; margin-top: .3rem; }
.d-legende i { display: inline-block; width: .8rem; height: .8rem; border-radius: .15rem; margin-right: .3rem; vertical-align: -1px; }
.d-legende i.strich { height: 0; border-top: 2px dashed; border-radius: 0; vertical-align: 3px; width: 1.1rem; background: none !important; }
.d-balken .d-zeile { display: flex; align-items: center; gap: .5rem; font-size: .85rem; margin: .2rem 0; }
.d-balken .d-name { width: 38%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.d-balken .d-spur { flex: 1; background: #f1f3f5; border-radius: .25rem; height: .75rem; overflow: hidden; }
.d-balken .d-spur span { display: block; height: 100%; border-radius: .25rem; }
.d-balken .d-wert { width: 5rem; text-align: end; font-variant-numeric: tabular-nums; }

/* Aufnahmebogen (Druck A4) */
.bogen { max-width: 190mm; background: #fff; padding: 12mm; box-shadow: 0 1px 4px rgba(0,0,0,.1); }
.bogen-tabelle th { width: 38%; background: #f8f9fa; font-weight: 600; }
.bogen-isolation { border: 3px solid #dc3545; color: #dc3545; font-weight: 700; font-size: 1.3rem; text-align: center; padding: .4rem; }
.bogen-unterschrift { margin-top: 18mm !important; }
@media print {
    .bogen { box-shadow: none; padding: 0; max-width: none; margin: 0 !important; }
    .bogen-tabelle th { background: #eee !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* ── Fotos ─────────────────────────────────────────────── */
.foto-mini img, .foto-mini-bild { width: 64px; height: 64px; object-fit: cover; border-radius: .35rem; border: 1px solid #dee2e6; }
.foto-mini:hover img { outline: 2px solid #0f5e6e; }

/* ── Chat ──────────────────────────────────────────────── */
.chat-liste { max-height: calc(100vh - 200px); overflow-y: auto; }
.chat-fenster { height: calc(100vh - 140px); min-height: 380px; display: flex; flex-direction: column; }
.chat-verlauf { flex: 1; overflow-y: auto; background: #eef2f4; }
.chat-zeile { display: flex; margin: .25rem 0; }
.chat-zeile.eigene { justify-content: flex-end; }
.chat-blase { max-width: 75%; background: #fff; border-radius: .75rem; padding: .35rem .65rem; box-shadow: 0 1px 1px rgba(0,0,0,.06); }
.chat-zeile.eigene .chat-blase { background: #d4ede6; }
.chat-von { font-size: .75rem; font-weight: 600; color: #0f5e6e; }
.chat-text { white-space: pre-wrap; word-break: break-word; }
.chat-zeit { font-size: .7rem; color: #6c757d; text-align: end; }
.chat textarea { resize: none; }
