/* Layout und Fachkomponenten des Lehrsystems (ohne externe Ressourcen) */
body { background: #f4f6fa; font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
.demo-banner { position: sticky; top: 0; z-index: 1000; background: repeating-linear-gradient(45deg, #b91c1c, #b91c1c 14px, #991b1b 14px, #991b1b 28px);
  color: #fff; font-weight: 700; text-align: center; letter-spacing: .04em; padding: .35rem 1rem; font-size: .9rem; }
.app-shell { display: flex; min-height: calc(100vh - 2rem); }
.app-sidebar { width: 250px; flex-shrink: 0; background: #1e293b; color: #cbd5e1; padding: 1rem .75rem; display: flex; flex-direction: column; gap: .15rem; }
.app-sidebar .brand { color: #fff; font-weight: 700; font-size: 1.2rem; text-decoration: none; margin-bottom: .75rem; display: block; }
.app-sidebar .brand span { display: block; font-size: .75rem; font-weight: 500; color: #94a3b8; letter-spacing: .08em; }
.app-sidebar .nav-group { text-transform: uppercase; font-size: .7rem; letter-spacing: .1em; color: #64748b; margin: .9rem .5rem .25rem; }
.app-sidebar .nav-item { color: #cbd5e1; text-decoration: none; padding: .4rem .6rem; border-radius: .4rem; font-size: .92rem; }
.app-sidebar .nav-item:hover, .app-sidebar .nav-item.active { background: #334155; color: #fff; }
.app-sidebar .nav-footer { margin-top: auto; border-top: 1px solid #334155; padding-top: .75rem; font-size: .85rem; display: flex; flex-direction: column; gap: .3rem; }
.app-sidebar .nav-footer a, .app-sidebar .nav-footer button { color: #94a3b8; text-decoration: none; font-size: .85rem; text-align: left; }
.app-sidebar .who { color: #fff; font-weight: 600; }
.app-sidebar .roles { color: #64748b; font-size: .75rem; }
.app-main { flex: 1; padding: 1.5rem 2rem; min-width: 0; }
.app-main-full { max-width: 520px; margin: 3rem auto; }
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.25rem; }
.page-head h1 { font-size: 1.5rem; margin: 0; }
.page-head .sub { color: #64748b; font-size: .9rem; }
.panel { background: #fff; border: 1px solid #e2e8f0; border-radius: .6rem; padding: 1rem 1.25rem; margin-bottom: 1rem; }
.panel h2 { font-size: 1.05rem; margin: 0 0 .75rem; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: .25rem 1rem; font-size: .92rem; }
.kv dt { color: #64748b; font-weight: 500; }
.kv dd { margin: 0; }
.ident { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: .85rem; background: #f1f5f9; padding: .05rem .35rem; border-radius: .25rem; word-break: break-all; }
.system-tag { display: inline-block; font-size: .7rem; font-weight: 700; padding: .1rem .45rem; border-radius: .25rem; letter-spacing: .05em; }
.sys-kis { background: #dbeafe; color: #1e40af; } .sys-ris { background: #fef3c7; color: #92400e; } .sys-pacs { background: #dcfce7; color: #166534; }
.badge-status { display: inline-block; padding: .2rem .55rem; border-radius: 1rem; font-size: .78rem; font-weight: 600; white-space: nowrap; }
.st-requested { background: #e0e7ff; color: #3730a3; } .st-scheduled { background: #cffafe; color: #155e75; }
.st-inprogress { background: #fef3c7; color: #92400e; } .st-completed { background: #e0f2fe; color: #075985; }
.st-pending { background: #fee2e2; color: #991b1b; } .st-reported { background: #f3e8ff; color: #6b21a8; }
.st-released { background: #dcfce7; color: #166534; } .st-cancelled { background: #e5e7eb; color: #374151; text-decoration: line-through; }
.prio-emergency { color: #b91c1c; font-weight: 700; } .prio-urgent { color: #c2410c; font-weight: 600; } .prio-routine { color: #475569; }
.sim-tag { background: #fde68a; color: #78350f; font-size: .7rem; font-weight: 700; padding: .1rem .4rem; border-radius: .25rem; }
.real-tag { background: #bbf7d0; color: #14532d; font-size: .7rem; font-weight: 700; padding: .1rem .4rem; border-radius: .25rem; }
.fail-tag { background: #fecaca; color: #7f1d1d; font-size: .7rem; font-weight: 700; padding: .1rem .4rem; border-radius: .25rem; }
.msg-payload { background: #0f172a; color: #e2e8f0; padding: .75rem; border-radius: .4rem; font-size: .8rem; white-space: pre-wrap; word-break: break-all; max-height: 480px; overflow: auto; }
.timeline { list-style: none; padding: 0; margin: 0; position: relative; }
.timeline::before { content: ""; position: absolute; left: 14px; top: 0; bottom: 0; width: 2px; background: #cbd5e1; }
.timeline > li { position: relative; padding: 0 0 1.25rem 2.6rem; }
.timeline > li::before { content: ""; position: absolute; left: 6px; top: .25rem; width: 18px; height: 18px; border-radius: 50%; background: #fff; border: 3px solid #cbd5e1; }
.timeline > li.done::before { background: #16a34a; border-color: #16a34a; }
.timeline > li.current::before { background: #f59e0b; border-color: #f59e0b; }
.timeline .step-title { font-weight: 600; }
.stat { background: #fff; border: 1px solid #e2e8f0; border-radius: .6rem; padding: .85rem 1rem; }
.stat .num { font-size: 1.6rem; font-weight: 700; }
.stat .lbl { color: #64748b; font-size: .85rem; }
.no-images { border: 2px dashed #f59e0b; background: #fffbeb; color: #78350f; padding: 1rem; border-radius: .5rem; }
.pacs-down { border: 2px solid #dc2626; background: #fef2f2; color: #7f1d1d; padding: 1rem; border-radius: .5rem; }
.report-text { white-space: pre-wrap; font-family: Georgia, serif; }
textarea.report { font-family: Georgia, serif; min-height: 180px; }
.arch-svg { width: 100%; max-width: 980px; height: auto; }
.table-sm td, .table-sm th { vertical-align: middle; }
.hl7-seg { font-family: ui-monospace, Consolas, monospace; font-weight: 700; }
@media (max-width: 900px) { .app-shell { flex-direction: column; } .app-sidebar { width: 100%; } .app-main { padding: 1rem; } }
@media print { .app-sidebar, .no-print { display: none !important; } .demo-banner { position: static; } }

/* Einfacher Bildbetrachter (PACS) */
.viewer-layout { display: grid; grid-template-columns: minmax(220px, 300px) 1fr; gap: 1rem; }
.viewer-series .list-group-item.active { background: #166534; border-color: #166534; color: #fff; }
.viewer-series .list-group-item.active .text-muted { color: #dcfce7 !important; }
.viewer-canvas { position: relative; background: #000; border-radius: .4rem; min-height: 360px; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.viewer-canvas img { max-width: 100%; max-height: 72vh; image-rendering: auto; }
.viewer-overlay { position: absolute; left: .5rem; top: .4rem; color: #facc15; font-size: .8rem; font-family: ui-monospace, monospace; text-shadow: 0 0 2px #000; }
#windowPresets .btn.active { background: #1f2937; color: #fff; }
@media (max-width: 768px) { .viewer-layout { grid-template-columns: 1fr; } }

/* Schalter „Hilfe & Erklärungen“ und die Hilfetexte */
.help-switch { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: .5rem;
    background: #0f172a; border: 1px solid #334155; border-radius: .5rem; padding: .5rem .6rem; margin-bottom: .75rem; }
.help-switch .form-check-input { width: 2.4rem; height: 1.25rem; margin: 0; cursor: pointer;
    background-color: #475569; border-color: #64748b; flex-shrink: 0; }
.help-switch .form-check-input:checked { background-color: #22c55e; border-color: #22c55e; }
.help-switch .form-check-input:focus { box-shadow: 0 0 0 .2rem rgba(34, 197, 94, .35); }
.help-switch label { color: #e2e8f0; font-size: .9rem; font-weight: 600; cursor: pointer; margin: 0; }
.help-switch-hint { grid-column: 1 / -1; color: #94a3b8; font-size: .75rem; }
body.help-on .help-switch { border-color: #22c55e; }

.nav-help { display: none; }
body.help-on .nav-help { display: block; color: #cbd5e1; background: #0f172a; border-left: 3px solid #22c55e;
    font-size: .78rem; line-height: 1.35; margin: .1rem 0 .35rem .6rem; padding: .35rem .5rem; border-radius: 0 .3rem .3rem 0; }

.page-help { display: none; }
body.help-on .page-help { display: block; background: #f0fdf4; border: 1px solid #86efac; border-left: 6px solid #22c55e;
    border-radius: .6rem; padding: 1rem 1.25rem; margin-bottom: 1rem; color: #14532d; }
.page-help-title { font-size: 1.05rem; font-weight: 700; margin: 0 0 .25rem; }
.page-help-role { font-size: .78rem; color: #15803d; margin: 0 0 .5rem; }
.page-help-what { margin-bottom: .75rem; }
.page-help-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; }
.page-help-cols h3 { font-size: .85rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: #15803d; margin: 0 0 .3rem; }
.page-help-cols ol { margin: 0; padding-left: 1.1rem; }
.page-help-cols li, .page-help-cols p { font-size: .92rem; margin-bottom: .25rem; }
@media (max-width: 900px) { .page-help-cols { grid-template-columns: 1fr; } }
@media print { .help-switch, .nav-help { display: none !important; } }

/* Hilfsklassen statt style-Attributen (die Content-Security-Policy erlaubt keine Inline-Styles) */
.mw-260 { max-width: 260px; }
.mw-520 { max-width: 520px; }
.mw-640 { max-width: 640px; }
.mw-720 { max-width: 720px; }
.mw-760 { max-width: 760px; }
.mw-800 { max-width: 800px; }
.mw-820 { max-width: 820px; }
.pre-line { white-space: pre-line; }
