:root {
  color-scheme: dark;
  --bg: #08111f;
  --panel: #0f1a2b;
  --panel-2: #142238;
  --panel-3: #1a2b45;
  --text: #f4f7fb;
  --muted: #9fb0c5;
  --line: rgba(255,255,255,.09);
  --primary: #4cc2ff;
  --primary-2: #1aa4e8;
  --success: #36d399;
  --warning: #f7c45c;
  --danger: #ff6b7a;
  --shadow: 0 18px 50px rgba(0,0,0,.28);
  --radius: 18px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--text); font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
button, input, select, textarea { font: inherit; }
button { color: inherit; }
body { min-height: 100dvh; }

.app-shell { display: grid; grid-template-columns: 260px minmax(0,1fr); min-height: 100dvh; }
.sidebar { position: sticky; top: 0; height: 100dvh; padding: calc(22px + var(--safe-top)) 18px calc(18px + var(--safe-bottom)); background: linear-gradient(180deg,#0b1526,#09111d); border-right: 1px solid var(--line); display: flex; flex-direction: column; z-index: 30; }
.brand { display: flex; align-items: center; gap: 12px; padding: 0 8px 24px; }
.brand-mark { width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center; font-weight: 900; color: #06101c; background: linear-gradient(145deg,#74d4ff,#35b5f4); box-shadow: 0 8px 24px rgba(76,194,255,.25); }
.brand strong { display: block; font-size: 1.02rem; }
.brand small { color: var(--muted); display: block; margin-top: 3px; }
.nav { display: grid; gap: 7px; }
.nav-item { border: 0; background: transparent; color: var(--muted); padding: 12px 14px; border-radius: 12px; text-align: left; display: flex; align-items: center; gap: 11px; cursor: pointer; transition: .18s ease; }
.nav-item:hover { background: rgba(255,255,255,.05); color: var(--text); }
.nav-item.active { background: linear-gradient(135deg,rgba(76,194,255,.18),rgba(76,194,255,.08)); color: var(--text); box-shadow: inset 0 0 0 1px rgba(76,194,255,.18); }
.nav-item span { width: 20px; text-align: center; font-weight: 800; color: var(--primary); }
.sidebar-footer { margin-top: auto; padding: 16px 10px 0; border-top: 1px solid var(--line); color: var(--muted); }
.status-line { display: flex; gap: 8px; align-items: center; margin-bottom: 4px; color: var(--text); }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 5px rgba(54,211,153,.10); }
.dot.offline { background: var(--warning); box-shadow: 0 0 0 5px rgba(247,196,92,.10); }

.main { min-width: 0; }
.topbar { position: sticky; top: 0; z-index: 20; padding: calc(20px + var(--safe-top)) 28px 18px; display: flex; align-items: center; gap: 14px; background: rgba(8,17,31,.86); backdrop-filter: blur(18px); border-bottom: 1px solid var(--line); }
.topbar h1 { margin: 0; font-size: clamp(1.35rem,2vw,1.85rem); }
.topbar p { margin: 4px 0 0; color: var(--muted); }
.topbar-actions { margin-left: auto; display: flex; gap: 10px; }
.menu-button { display: none !important; }
.view { padding: 26px 28px 48px; max-width: 1600px; width: 100%; margin: 0 auto; }

.button, .icon-button { border: 0; cursor: pointer; transition: transform .15s ease, opacity .15s ease, background .15s ease; }
.button:active, .icon-button:active { transform: translateY(1px); }
.button { border-radius: 12px; min-height: 44px; padding: 0 16px; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.button.primary { color: #06101c; background: linear-gradient(135deg,var(--primary),#7ad6ff); }
.button.primary:hover { filter: brightness(1.05); }
.button.secondary { color: var(--text); background: var(--panel-2); box-shadow: inset 0 0 0 1px var(--line); }
.button.danger { background: rgba(255,107,122,.12); color: #ff9aa5; box-shadow: inset 0 0 0 1px rgba(255,107,122,.25); }
.button.success { background: rgba(54,211,153,.14); color: #7ceabb; box-shadow: inset 0 0 0 1px rgba(54,211,153,.25); }
.button.small { min-height: 36px; padding: 0 12px; font-size: .9rem; }
.button:disabled { opacity: .42; cursor: not-allowed; }
.icon-button { width: 42px; height: 42px; border-radius: 12px; background: var(--panel-2); box-shadow: inset 0 0 0 1px var(--line); display: inline-grid; place-items: center; font-size: 1.2rem; }
.hidden { display: none !important; }

.grid { display: grid; gap: 18px; }
.grid.metrics { grid-template-columns: repeat(4,minmax(0,1fr)); }
.metric { background: linear-gradient(145deg,var(--panel),#101e31); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.metric-label { color: var(--muted); font-size: .92rem; }
.metric-value { margin-top: 9px; font-size: clamp(1.8rem,3vw,2.6rem); font-weight: 900; letter-spacing: -.04em; }
.metric-detail { color: var(--muted); margin-top: 7px; font-size: .88rem; }
.metric-accent { width: 46px; height: 5px; border-radius: 99px; margin-top: 18px; background: var(--primary); }
.metric.success .metric-accent { background: var(--success); }
.metric.warning .metric-accent { background: var(--warning); }
.metric.danger .metric-accent { background: var(--danger); }

.section { margin-top: 24px; }
.section-header { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.section-header h2 { margin: 0; font-size: 1.18rem; }
.section-header p { margin: 5px 0 0; color: var(--muted); }
.actions { display: flex; flex-wrap: wrap; gap: 10px; }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.card-body { padding: 20px; }
.card-list { display: grid; gap: 12px; }
.service-card { padding: 18px; display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 14px; align-items: center; border: 1px solid var(--line); border-radius: 16px; background: linear-gradient(145deg,var(--panel),var(--panel-2)); }
.service-card h3 { margin: 0 0 6px; }
.service-meta { color: var(--muted); display: flex; flex-wrap: wrap; gap: 8px 14px; font-size: .92rem; }
.service-stats { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.pill { display: inline-flex; align-items: center; gap: 6px; min-height: 28px; padding: 0 10px; border-radius: 999px; font-size: .82rem; font-weight: 800; background: var(--panel-3); color: var(--muted); }
.pill.success { color: #7ceabb; background: rgba(54,211,153,.12); }
.pill.warning { color: #fbd786; background: rgba(247,196,92,.12); }
.pill.danger { color: #ff9aa5; background: rgba(255,107,122,.12); }
.pill.info { color: #8cdbff; background: rgba(76,194,255,.12); }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 760px; }
th, td { text-align: left; padding: 14px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { color: var(--muted); font-size: .82rem; text-transform: uppercase; letter-spacing: .06em; font-weight: 800; background: rgba(255,255,255,.018); }
tbody tr:hover { background: rgba(255,255,255,.025); }
tbody tr:last-child td { border-bottom: 0; }
.code { font-family: ui-monospace,SFMono-Regular,Consolas,monospace; letter-spacing: .05em; font-weight: 900; }
.muted { color: var(--muted); }

.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 16px; }
.toolbar .search { flex: 1 1 260px; }
.input, select.input, textarea.input { width: 100%; color: var(--text); background: #0b1728; border: 1px solid var(--line); border-radius: 12px; padding: 12px 13px; outline: none; }
.input:focus { border-color: rgba(76,194,255,.55); box-shadow: 0 0 0 4px rgba(76,194,255,.10); }
textarea.input { min-height: 92px; resize: vertical; }
label.field { display: grid; gap: 7px; color: var(--muted); font-size: .9rem; }
.form-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }
.help { color: var(--muted); font-size: .82rem; margin-top: 4px; }

.workflow { display: grid; grid-template-columns: minmax(0,1.15fr) minmax(320px,.85fr); gap: 18px; align-items: start; }
.workflow-panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.workflow-panel h2 { margin: 0 0 4px; }
.workflow-panel > p { color: var(--muted); margin: 0 0 18px; }
.step { display: grid; gap: 8px; margin-bottom: 16px; }
.step-label { display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: .9rem; font-weight: 800; }
.step-number { width: 25px; height: 25px; border-radius: 50%; display: inline-grid; place-items: center; color: #06101c; background: var(--primary); font-size: .78rem; }
.scan-row { display: grid; grid-template-columns: 1fr auto; gap: 10px; }
.scan-input { min-height: 52px; font-family: ui-monospace,SFMono-Regular,Consolas,monospace; font-size: 1.05rem; }
.selection-card { display: grid; gap: 12px; padding: 16px; border-radius: 14px; background: var(--panel-2); border: 1px solid var(--line); }
.selection-title { font-weight: 900; }
.checkout-list { display: grid; gap: 10px; margin-top: 14px; }
.checkout-item { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 10px; align-items: center; padding: 13px; border-radius: 12px; background: var(--panel-2); border: 1px solid var(--line); }
.checkout-item strong { display: block; }
.checkout-item small { color: var(--muted); }
.summary-box { position: sticky; top: 118px; }
.summary-line { display: flex; justify-content: space-between; gap: 14px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.summary-line:last-child { border-bottom: 0; }
.big-action { width: 100%; min-height: 54px; margin-top: 16px; }

.empty-state { text-align: center; padding: 44px 20px; color: var(--muted); }
.empty-icon { width: 62px; height: 62px; display: grid; place-items: center; margin: 0 auto 14px; border-radius: 18px; background: var(--panel-2); font-size: 1.8rem; color: var(--primary); }
.empty-state h3 { color: var(--text); margin: 0 0 8px; }
.empty-state p { margin: 0; }

.modal { border: 0; padding: 0; background: transparent; width: min(680px,calc(100% - 28px)); max-height: calc(100dvh - 28px); color: var(--text); }
.modal::backdrop { background: rgba(0,0,0,.68); backdrop-filter: blur(5px); }
.modal-card { background: var(--panel); border: 1px solid var(--line); border-radius: 20px; box-shadow: 0 28px 90px rgba(0,0,0,.55); overflow: hidden; margin: 0; }
.modal-header { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; padding: 20px 20px 14px; border-bottom: 1px solid var(--line); }
.modal-header h2 { margin: 0; }
.modal-header p { margin: 5px 0 0; color: var(--muted); }
.modal-body { padding: 20px; max-height: 62dvh; overflow-y: auto; }
.modal-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 10px; padding: 14px 20px 20px; }

.scanner-modal { width: min(760px,calc(100% - 20px)); }
.scanner-stage { position: relative; aspect-ratio: 4/3; background: #02070c; overflow: hidden; }
#scannerVideo { width: 100%; height: 100%; object-fit: cover; }
.scanner-frame { position: absolute; inset: 20% 12%; border: 3px solid rgba(76,194,255,.9); border-radius: 18px; box-shadow: 0 0 0 999px rgba(0,0,0,.28); }
.scanner-message { position: absolute; left: 14px; right: 14px; bottom: 14px; padding: 11px 14px; border-radius: 12px; background: rgba(8,17,31,.82); text-align: center; }
.scanner-controls { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; padding: 16px; }
.file-button input { display: none; }

.toast-container { position: fixed; z-index: 100; right: 18px; bottom: calc(18px + var(--safe-bottom)); display: grid; gap: 10px; width: min(380px,calc(100% - 36px)); }
.toast { background: #142238; border: 1px solid var(--line); border-left: 4px solid var(--primary); border-radius: 12px; padding: 13px 14px; box-shadow: var(--shadow); animation: toast-in .18s ease-out; }
.toast.success { border-left-color: var(--success); }
.toast.warning { border-left-color: var(--warning); }
.toast.danger { border-left-color: var(--danger); }
.toast strong { display: block; margin-bottom: 3px; }
.toast p { margin: 0; color: var(--muted); font-size: .9rem; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

.kpi-row { display: flex; gap: 8px; flex-wrap: wrap; }
.detail-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 12px; }
.detail-box { background: var(--panel-2); border: 1px solid var(--line); border-radius: 14px; padding: 14px; }
.detail-box small { display: block; color: var(--muted); margin-bottom: 6px; }
.detail-box strong { font-size: 1.05rem; }
.notice { padding: 14px 15px; border-radius: 13px; background: rgba(76,194,255,.09); border: 1px solid rgba(76,194,255,.18); color: #cfeeff; }
.notice.warning { background: rgba(247,196,92,.09); border-color: rgba(247,196,92,.20); color: #ffe7ab; }
.notice.danger { background: rgba(255,107,122,.09); border-color: rgba(255,107,122,.20); color: #ffc2c8; }
hr { border: 0; border-top: 1px solid var(--line); margin: 18px 0; }

@media (max-width: 1100px) {
  .grid.metrics { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .workflow { grid-template-columns: 1fr; }
  .summary-box { position: static; }
  .detail-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 780px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; transform: translateX(-102%); transition: transform .2s ease; width: min(290px,86vw); box-shadow: 18px 0 60px rgba(0,0,0,.45); }
  .sidebar.open { transform: translateX(0); }
  .menu-button { display: inline-grid !important; }
  .topbar { padding: calc(14px + var(--safe-top)) 14px 13px; }
  .topbar p { display: none; }
  .topbar-actions .secondary { display: none; }
  .topbar-actions .button { min-height: 40px; padding: 0 12px; }
  .view { padding: 18px 14px 36px; }
  .grid.metrics { grid-template-columns: 1fr 1fr; gap: 12px; }
  .metric { padding: 16px; }
  .section-header { align-items: flex-start; flex-direction: column; }
  .service-card { grid-template-columns: 1fr; }
  .service-card .actions { justify-content: flex-start; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .full { grid-column: auto; }
  .modal { width: calc(100% - 16px); max-height: calc(100dvh - 16px); }
  .modal-body { max-height: 68dvh; }
  .detail-grid { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .grid.metrics { grid-template-columns: 1fr; }
  .topbar h1 { font-size: 1.2rem; }
  #quickScanButton { font-size: 0; width: 44px; padding: 0; }
  #quickScanButton::after { content: '⌁'; font-size: 1.2rem; }
  .scan-row { grid-template-columns: 1fr; }
  .scan-row .button { width: 100%; }
  .workflow-panel { padding: 16px; }
  .scanner-stage { aspect-ratio: 3/4; }
}

@media print {
  .sidebar, .topbar, .button, .toolbar { display: none !important; }
  .app-shell { display: block; }
  .view { padding: 0; max-width: none; }
  body { background: white; color: black; }
  .card, .workflow-panel, .service-card { box-shadow: none; border: 1px solid #bbb; background: white; }
  th, td { color: black; border-color: #ccc; }
  .muted, .service-meta { color: #555; }
}

/* Anmeldung */
.login-screen { min-height: 100dvh; display: grid; place-items: center; padding: 24px; background: radial-gradient(circle at 20% 10%, rgba(76,194,255,.15), transparent 34%), var(--bg); }
.login-card { width: min(440px,100%); padding: 28px; border: 1px solid var(--line); border-radius: 22px; background: var(--panel); box-shadow: 0 28px 90px rgba(0,0,0,.48); }
.login-brand { display: flex; align-items: center; gap: 14px; margin-bottom: 24px; }
.login-brand h1 { margin: 0; font-size: 1.55rem; }
.login-brand p { margin: 4px 0 0; color: var(--muted); }
.login-form { display: grid; gap: 15px; }
.login-card > small { display: block; margin-top: 18px; text-align: center; color: var(--muted); }
.user-chip { display: flex; align-items: center; gap: 10px; padding-left: 12px; border-left: 1px solid var(--line); }
.user-chip > span { font-weight: 800; max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 780px) { .user-chip > span { display: none; } .user-chip { padding-left: 0; border-left: 0; } .user-chip .button { min-height: 40px; } }

.settings-grid { grid-template-columns: repeat(auto-fit,minmax(320px,1fr)); }
.settings-grid .admin-wide { grid-column: 1 / -1; }
@media (max-width: 700px) { .settings-grid .admin-wide { grid-column: auto; } }


/* v3.0 Johanniter Corporate Design */
:root {
  color-scheme: light;
  --bg:#f4f4f4; --panel:#ffffff; --panel-2:#f6f6f6; --panel-3:#eef1f6;
  --text:#000548; --muted:#56617d; --line:rgba(0,5,72,.14);
  --primary:#eb003c; --primary-2:#ff0045; --brand-blue:#000548; --brand-red:#eb003c;
  --success:#008c7a; --warning:#f2a900; --danger:#c8102e;
  --shadow:0 14px 38px rgba(0,5,72,.10); --radius:10px;
}
html,body{background:var(--bg);color:var(--text);font-family:Tahoma,Arial,sans-serif;line-height:1.4}
body::before{content:"";position:fixed;inset:0 0 auto 0;height:5px;background:var(--brand-red);z-index:1000}
.app-shell{grid-template-columns:272px minmax(0,1fr)}
.sidebar{background:var(--brand-blue);border-right:0;padding-top:calc(28px + var(--safe-top));box-shadow:6px 0 24px rgba(0,5,72,.12)}
.brand{position:relative;color:white;padding-bottom:28px}.brand strong{font-size:1.15rem}.brand small{color:rgba(255,255,255,.72)}
.johanniter-word{font-weight:900;letter-spacing:.035em;color:var(--brand-red);font-size:.86rem}.sidebar .johanniter-word{color:white}
.johanniter-symbol{width:44px;height:56px;border-radius:50%;background:var(--brand-red);display:grid;place-items:center;flex:none;position:relative}
.johanniter-symbol span,.johanniter-symbol span::before{display:block;width:30px;height:30px;background:white;clip-path:polygon(50% 0,58% 34%,100% 18%,70% 50%,100% 82%,58% 66%,50% 100%,42% 66%,0 82%,30% 50%,0 18%,42% 34%)}
.nav{gap:3px}.nav-divider{height:1px;background:rgba(255,255,255,.18);margin:11px 10px}
.nav-item{color:rgba(255,255,255,.78);border-radius:4px;padding:11px 14px;font-weight:700}
.nav-item:hover{background:rgba(255,255,255,.09);color:#fff}.nav-item.active{background:var(--brand-red);color:#fff;box-shadow:none}
.nav-item span{color:inherit}.sidebar-footer{border-color:rgba(255,255,255,.18);color:rgba(255,255,255,.7)}.status-line{color:white}
.topbar{background:rgba(255,255,255,.95);border-bottom:1px solid var(--line);backdrop-filter:blur(14px);padding-top:calc(22px + var(--safe-top))}
.topbar::after{content:"";position:absolute;right:0;bottom:-1px;width:180px;height:7px;background:var(--brand-red);clip-path:polygon(14% 0,100% 0,100% 100%,0 100%)}
.topbar h1,h1,h2,h3{font-family:Tahoma,Arial,sans-serif;color:var(--brand-blue)}.topbar h1{font-weight:700}.topbar p{color:var(--muted)}
.button{border-radius:4px}.button.primary{color:white;background:var(--brand-red)}.button.primary:hover{background:white;color:var(--brand-red);box-shadow:inset 0 0 0 2px var(--brand-red)}
.button.secondary{color:var(--brand-blue);background:white;box-shadow:inset 0 0 0 1px rgba(0,5,72,.35)}.button.danger{background:#c8102e;color:white}
.icon-button{color:var(--brand-blue)}
.card,.workflow-panel,.service-card,.metric,.login-card,.modal-card{background:var(--panel);border:1px solid var(--line);border-radius:var(--radius);box-shadow:var(--shadow)}
.metric::before,.workflow-panel::before{content:"";display:block;height:4px;background:var(--brand-red);margin:-1px -1px 15px}
.workflow-panel{overflow:hidden}.workflow-panel::before{margin:-20px -20px 16px}
.input,select.input,textarea.input{color:var(--brand-blue);background:white;border-color:rgba(0,5,72,.25);border-radius:4px}.input:focus{border-color:var(--brand-red);box-shadow:0 0 0 3px rgba(235,0,60,.11)}
th{color:var(--brand-blue);background:white;border-top:3px solid var(--brand-red);border-bottom:3px solid var(--brand-red);text-transform:none;letter-spacing:0}td{border-bottom:1px solid rgba(0,5,72,.22)}tbody tr:hover{background:#f7f8fb}
.pill{border-radius:999px}.notice{background:#eef4fb;border-color:#a2bfe0;color:var(--brand-blue)}.notice.warning{background:#fff7df;color:#6a4a00}.notice.danger{background:#fff0f3;color:#8a0022}
.login-screen{background:linear-gradient(111.26deg,var(--brand-blue) 0 49%,var(--brand-red) 49.2% 100%)}.login-card{position:relative;overflow:hidden}.login-card::before{content:"";position:absolute;left:0;top:0;bottom:0;width:8px;background:var(--brand-red)}
.login-brand h1{margin-top:2px}.login-brand p{color:var(--brand-red);font-weight:700}.login-card>small{color:var(--muted)}
.profile-button{display:flex;align-items:center;gap:8px;border:0;background:transparent;color:var(--brand-blue);font-weight:700;cursor:pointer}.profile-avatar{width:36px;height:36px;border-radius:50%;display:grid;place-items:center;background:var(--brand-red);color:white}
.admin-shell{display:grid;grid-template-columns:220px minmax(0,1fr);gap:20px}.admin-menu{display:grid;align-content:start;gap:5px}.admin-menu button{text-align:left}.admin-heading{padding:18px;background:var(--brand-blue);color:white;border-radius:4px;position:relative;overflow:hidden}.admin-heading h2,.admin-heading p{color:white}.admin-heading::after{content:"";position:absolute;right:-30px;bottom:-44px;width:110px;height:110px;border-radius:50%;background:var(--brand-red)}
.account-hero{background:var(--brand-blue);color:white;padding:24px;border-radius:4px;display:flex;align-items:center;gap:18px}.account-hero h2,.account-hero p{color:white;margin:0}.account-hero .profile-avatar{width:64px;height:64px;font-size:1.5rem}
.hidden{display:none!important}
@media(max-width:900px){.admin-shell{grid-template-columns:1fr}.admin-menu{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:780px){.topbar::after{width:90px}.login-screen{background:linear-gradient(160deg,var(--brand-blue) 0 42%,var(--brand-red) 42.2% 100%)}.profile-button>span:last-child{display:none}.app-shell{grid-template-columns:1fr}}

/* v3.0.1 official JUH logo integration */
.juh-logo{display:block;max-width:100%;height:auto;object-fit:contain}
.login-logo{width:min(390px,72vw);max-height:118px;object-position:left center;margin-bottom:10px}
.sidebar-logo{width:190px;max-height:58px;object-position:left center;margin-bottom:8px}
.login-brand{align-items:flex-start;flex-direction:column}
.brand{align-items:flex-start;flex-direction:column;gap:6px}
@media (max-width:760px){.login-logo{width:min(330px,78vw)}.sidebar-logo{width:165px}}
\n/* v3.0.2: logo sizing and clipping repair */
.login-card { overflow: visible; }
.login-brand, .brand { min-width: 0; width: 100%; overflow: visible; }
.juh-logo {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: none;
  object-fit: contain;
  object-position: left center;
  flex: 0 0 auto;
  overflow: visible;
}
.login-logo {
  width: min(100%, 390px);
  height: auto;
  aspect-ratio: auto;
  margin: 0 0 10px;
}
.sidebar-logo {
  width: min(100%, 205px);
  height: auto;
  aspect-ratio: auto;
  margin: 0 0 8px;
}
.sidebar .brand { padding-left: 2px; padding-right: 2px; }
@media (max-width: 760px) {
  .login-logo { width: min(100%, 340px); }
  .sidebar-logo { width: min(100%, 185px); }
}

/* v3.0.4 definitive logo layout */
.login-card,.login-brand,.brand,.sidebar{overflow:visible!important}
.login-brand{display:block!important;width:100%!important}
.juh-logo{display:block!important;object-fit:contain!important;object-position:left center!important;max-width:none!important;max-height:none!important;height:auto!important}
.login-logo{width:100%!important;max-width:460px!important;margin:0 0 18px!important}
.sidebar-logo{width:100%!important;max-width:230px!important;margin:0 0 10px!important}
@media(max-width:760px){.login-logo{max-width:360px!important}.sidebar-logo{max-width:195px!important}}

/* v3.1 Material- und Einsatzplanung */
.toolbar{flex-wrap:wrap}.toolbar .search{min-width:260px;flex:1}.service-card .service-stats{flex-wrap:wrap}.input option:disabled{color:#777}.planning-summary{display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:12px;margin:12px 0}

/* v3.1.1 Stabilisierung */
input[list]{background-color:#fff}

.planning-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(260px,1fr));gap:16px}.plan-row{display:flex;justify-content:space-between;align-items:center;gap:12px;padding:10px 0;border-bottom:1px solid #deeefc}.plan-row span{display:flex;flex-direction:column}.check-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(180px,1fr));gap:8px;margin-top:8px}.check-grid label{font-weight:400}

/* v3.4 Wartung */
#maintenanceTable td{vertical-align:top}.stats-grid{margin-bottom:22px}.field input[type="checkbox"]{margin-right:8px}

/* v3.5 Berichte */
.report-filter-grid{display:grid;grid-template-columns:repeat(3,minmax(180px,1fr));gap:16px;margin-bottom:22px}.report-preview{overflow:auto}.report-sheet{background:#fff;border:1px solid #deeefc;padding:28px;min-height:420px}.report-head{display:flex;align-items:center;gap:26px;border-bottom:4px solid #eb003c;padding-bottom:18px;margin-bottom:24px}.report-head img{width:min(300px,42%);height:auto;object-fit:contain}.report-head h2{margin:0}.report-sheet footer{border-top:1px solid #a2bfe0;margin-top:28px;padding-top:10px;font-size:.8rem}.report-sheet .section{margin-top:24px}@media(max-width:850px){.report-filter-grid{grid-template-columns:1fr 1fr}.report-head{align-items:flex-start;flex-direction:column}.report-head img{width:min(280px,100%)}}@media(max-width:560px){.report-filter-grid{grid-template-columns:1fr}.report-sheet{padding:16px}}

/* v3.6 Aufgaben, Hinweise und Abschlussworkflow */
.topbar-search{margin-left:auto;min-width:min(330px,30vw)}.topbar-search .input{width:100%}.alert-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(230px,1fr));gap:12px}.alert-card{appearance:none;border:0;text-align:left;border-left:6px solid #6084bf;background:#fff;padding:15px 16px;box-shadow:0 3px 12px rgba(0,5,72,.08);display:flex;justify-content:space-between;gap:12px;cursor:pointer;color:#000548}.alert-card.warning{border-left-color:#f4c300}.alert-card.danger{border-left-color:#eb003c}.alert-card span{font-size:.82rem;text-decoration:underline}.task-list{display:grid;gap:12px}.task-card{background:#fff;border:1px solid #deeefc;border-left:5px solid #6084bf;padding:15px;display:flex;justify-content:space-between;align-items:center;gap:18px}.task-card.overdue{border-left-color:#eb003c}.task-card.soon{border-left-color:#f4c300}.task-card.done{opacity:.68}.task-main{min-width:0}.task-main p{margin:.4rem 0}.task-title{display:flex;align-items:center;gap:10px}.task-status-select{width:auto;min-width:150px}.closure-panel{border-top:5px solid #eb003c}.closure-checks{display:grid;grid-template-columns:repeat(auto-fit,minmax(230px,1fr));gap:12px;margin:14px 0}.closure-check{display:flex;gap:12px;align-items:center;border:1px solid #deeefc;padding:14px;background:#fff}.closure-check>span{display:grid;place-items:center;width:30px;height:30px;border-radius:50%;font-weight:bold}.closure-check.ok>span{background:#dff5e4;color:#126229}.closure-check.blocked>span{background:#ffccd8;color:#9b0027}.closure-check small{display:block;margin-top:3px}.search-results{display:grid;gap:8px}.search-result{appearance:none;border:1px solid #deeefc;background:#fff;padding:12px;display:grid;grid-template-columns:auto 1fr;gap:4px 12px;text-align:left;color:#000548;cursor:pointer}.search-result small{grid-column:2}.search-result:hover{border-color:#eb003c}@media(max-width:950px){.topbar-search{min-width:180px}.task-card{align-items:flex-start;flex-direction:column}.task-card .actions{width:100%}}@media(max-width:720px){.topbar-search{order:4;width:100%;min-width:100%;margin:8px 0 0}.topbar{flex-wrap:wrap}.topbar-actions{margin-left:auto}.closure-checks{grid-template-columns:1fr}}

/* v3.6.1: scrollbare Navigation und Rechteverwaltung */
.sidebar{height:100dvh;display:flex;flex-direction:column;overflow:hidden}.brand{flex:0 0 auto}.sidebar-scroll{flex:1 1 auto;min-height:0;overflow-y:auto;overflow-x:hidden;overscroll-behavior:contain;-webkit-overflow-scrolling:touch;padding-bottom:12px;scrollbar-width:thin;scrollbar-color:#6084bf transparent}.sidebar-scroll::-webkit-scrollbar{width:7px}.sidebar-scroll::-webkit-scrollbar-thumb{background:#6084bf;border-radius:8px}.nav{min-height:min-content}.sidebar-footer{flex:0 0 auto}.permission-grid{display:grid;gap:8px;max-height:48vh;overflow:auto;padding:4px}.permission-row{display:grid;grid-template-columns:minmax(0,1fr) 150px;gap:12px;align-items:center;border-bottom:1px solid #deeefc;padding:8px 0}.permission-row span{font-weight:600}.permission-row small{display:block;font-weight:400;color:#56627a;margin-top:2px}@media(max-width:680px){.permission-row{grid-template-columns:1fr}.permission-row .input{width:100%}}

/* v5.0.1 Datenmanagement */
.data-management .quality-list{display:grid;gap:8px;margin-top:16px;max-height:380px;overflow:auto}.bulk-toolbar{display:grid;grid-template-columns:180px 220px minmax(180px,1fr) auto;gap:10px;margin-bottom:16px}.danger-text{color:#b0002e;font-weight:700}.data-management input[type="checkbox"]{width:18px;height:18px;accent-color:#eb003c}@media(max-width:850px){.bulk-toolbar{grid-template-columns:1fr}.data-management .admin-wide{grid-column:auto}}

/* v5.0.1: lesbare Systemmeldungen und Toasts */
.toast {
  background: #ffffff;
  color: #000548;
  border-color: #a2bfe0;
  border-left-color: #6084bf;
  box-shadow: 0 8px 28px rgba(0,5,72,.18);
}
.toast strong { color: #000548; }
.toast p { color: #34405f; }
.toast.success { background: #eef9f0; border-left-color: #21883b; }
.toast.warning { background: #fff7df; border-left-color: #d29b00; }
.toast.danger { background: #fff0f3; border-left-color: #eb003c; }
.notice,
.workflow-panel .notice,
.section .notice {
  background: #eef4fb;
  border-color: #a2bfe0;
  color: #000548;
}
.notice strong,
.notice small { color: inherit; }
.notice.success {
  background: #eef9f0;
  border-color: #8bc99a;
  color: #145c27;
}
.notice.warning {
  background: #fff7df;
  border-color: #e7c35f;
  color: #654800;
}
.notice.danger {
  background: #fff0f3;
  border-color: #ff9ea7;
  color: #8a0022;
}

/* v5.0.1: verbindliche Kontraste für Systemmeldungen */
#toastContainer .toast,
.toast-container .toast {
  background: #ffffff !important;
  color: #000548 !important;
  border: 1px solid #a2bfe0 !important;
  border-left: 6px solid #6084bf !important;
}
#toastContainer .toast strong,
#toastContainer .toast p,
.toast-container .toast strong,
.toast-container .toast p {
  color: #000548 !important;
}
#toastContainer .toast.success,
.toast-container .toast.success {
  background: #eef9f0 !important;
  border-left-color: #21883b !important;
}
#toastContainer .toast.warning,
.toast-container .toast.warning {
  background: #fff7df !important;
  border-left-color: #b78300 !important;
}
#toastContainer .toast.danger,
.toast-container .toast.danger {
  background: #fff0f3 !important;
  border-left-color: #eb003c !important;
}
.notice,
.workflow-panel .notice,
.section .notice,
.admin-wide .notice,
.quality-list .notice {
  background: #eef4fb !important;
  color: #000548 !important;
  border: 1px solid #a2bfe0 !important;
}
.notice strong,
.notice small,
.workflow-panel .notice strong,
.workflow-panel .notice small,
.quality-list .notice strong,
.quality-list .notice small {
  color: #000548 !important;
}
.notice.success,
.quality-list .notice.success {
  background: #eef9f0 !important;
  color: #124d24 !important;
  border-color: #76b785 !important;
}
.notice.warning,
.quality-list .notice.warning {
  background: #fff7df !important;
  color: #5b4200 !important;
  border-color: #d29b00 !important;
}
.notice.danger,
.quality-list .notice.danger {
  background: #fff0f3 !important;
  color: #780020 !important;
  border-color: #eb003c !important;
}

.notification-bell{position:relative;flex:0 0 auto}.notification-badge{position:absolute;right:-5px;top:-6px;min-width:20px;height:20px;padding:0 5px;border-radius:999px;background:#eb003c;color:#fff;font-size:11px;font-weight:800;display:grid;place-items:center;border:2px solid #fff}.notification-list{display:grid;gap:12px}.notification-list.compact{max-height:60vh;overflow:auto}.notification-card{display:flex;align-items:flex-start;justify-content:space-between;gap:16px;padding:16px;border:1px solid #cbd7e6;border-left:6px solid #4a6d96;border-radius:12px;background:#fff;color:#000548}.notification-card.warning{border-left-color:#b56700;background:#fff8e8}.notification-card.danger{border-left-color:#c90035;background:#fff0f4}.notification-card.info{border-left-color:#1769aa;background:#eef7ff}.notification-card.read{opacity:.68}.notification-card h3{margin:8px 0 4px}.notification-card p{margin:0 0 4px}.notification-card .actions{flex-wrap:nowrap}@media(max-width:700px){.notification-card{display:block}.notification-card .actions{margin-top:12px}.notification-bell{order:2}}

.site-card-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(260px,1fr));gap:14px}.site-card{background:#fff;border:1px solid #cbd7e6;border-top:5px solid #1769aa;border-radius:14px;padding:16px;color:#000548}.site-card.central{border-top-color:#eb003c}.site-card h3{margin:10px 0 4px}.warehouse-list{display:flex;flex-wrap:wrap;gap:6px;margin-top:12px}.warehouse-list span{background:#eef4fa;border-radius:999px;padding:5px 9px;font-size:12px}.wide-table{overflow:auto}.wide-table table{min-width:1100px}.wide-table td small{display:block;margin:5px 0}.transfer-card{display:flex;justify-content:space-between;gap:16px;align-items:center;background:#fff;border:1px solid #cbd7e6;border-radius:12px;padding:15px}.transfer-card h3{margin:8px 0 3px}@media(max-width:760px){.transfer-card{display:block}.transfer-card .actions{margin-top:12px}}

#sectionTargetWrap[hidden]{display:none!important}

/* v4.1 Beschaffung */
.table-wrap td small{display:block;margin-top:4px;color:var(--muted)}
.procurement-summary{display:grid;grid-template-columns:repeat(auto-fit,minmax(180px,1fr));gap:12px}

/* v4.2 Verteilung und Bedarfsplanung */
.service-card small{display:block;max-width:780px;line-height:1.45}.pill.special{background:#f3e8ff;color:#581c87}.table-wrap td{vertical-align:top}

/* v4.3 Datenschutz & Sicherheit */
#privacySubject{max-width:420px}.notice.warning strong{font-size:1.05rem}.privacy-risk{border-left:4px solid #eb003c}

/* v5.0.1 verschlüsselte Backups */
code{font-family:ui-monospace,Consolas,monospace;overflow-wrap:anywhere}

/* v4.4 Dienstplanung */
.duty-status{display:inline-flex;align-items:center;gap:.35rem;font-weight:700}.service-card small br{line-height:1.6}.metrics{align-items:stretch}

.medical-form h3{margin:24px 0 10px;border-bottom:2px solid var(--primary,#000548);padding-bottom:6px}.medical-form textarea{min-height:72px}.medical-form .notice{margin-top:8px}
