:root {
  color-scheme: light;
  --bg: #f4f4f4;
  --panel: #ffffff;
  --panel-2: #f6f6f6;
  --panel-3: #eef1f6;
  --text: #000548;
  --muted: #56617d;
  --line: rgba(0,5,72,.14);
  --border: var(--line);
  --surface: var(--panel);
  --primary: #eb003c;
  --brand-blue: #000548;
  --brand-red: #eb003c;
  --success: #008c7a;
  --warning: #f2a900;
  --danger: #c8102e;
  --shadow: 0 14px 38px rgba(0,5,72,.10);
  --radius: 10px;
  --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: Tahoma, Arial, sans-serif; line-height: 1.4; }
button, input, select, textarea { font: inherit; }
button { color: inherit; }
body { min-height: 100dvh; }

.app-shell { display: grid;  min-height: 100dvh; grid-template-columns:272px minmax(0,1fr);}
.sidebar { position: sticky; top: 0;  padding: calc(22px + var(--safe-top)) 18px calc(18px + var(--safe-bottom));     z-index: 30; background:var(--brand-blue);border-right:0;padding-top:calc(28px + var(--safe-top));box-shadow:6px 0 24px rgba(0,5,72,.12);height:100dvh;display:flex;flex-direction:column;overflow:hidden;}
.brand { display: flex;   padding: 0 8px 24px; position:relative;color:white;padding-bottom:28px;align-items:flex-start;flex-direction:column;gap:6px;min-width:0;width:100%;flex:0 0 auto;}

.brand strong { display: block;  font-size:1.15rem;}
.brand small {  display: block; margin-top: 3px; color:rgba(255,255,255,.72);}
.nav { display: grid;  gap:3px;min-height:min-content;}
.nav-item { border: 0; background: transparent;    text-align: left; display: flex; align-items: center; gap: 11px; cursor: pointer; transition: .18s ease; 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 { width: 20px; text-align: center; font-weight: 800;  color:inherit;}
.sidebar-footer { margin-top: auto; padding: 16px 10px 0; border-top: 1px solid var(--line);  border-color:rgba(255,255,255,.18);color:rgba(255,255,255,.7);flex:0 0 auto;}
.status-line { display: flex; gap: 8px; align-items: center; margin-bottom: 4px;  color:white;}
.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(255,255,255,.95);border-bottom:1px solid var(--line);backdrop-filter:blur(14px);padding-top:calc(22px + var(--safe-top));}
.topbar h1 { margin: 0; font-size: clamp(1.35rem,2vw,1.85rem); font-weight:700;}
.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 {  min-height: 44px; padding: 0 16px; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; gap: 8px; border-radius:4px;}
.button.primary {   color:white;background:var(--brand-red);}
.button.primary:hover { filter: brightness(1.05); 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 {   box-shadow: inset 0 0 0 1px rgba(255,107,122,.25); background:#c8102e;color:white;}
.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; color:var(--brand-blue);}
.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;  font-size: .82rem; font-weight: 800; background: var(--panel-3); color: var(--muted); border-radius:999px;}
.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 {  font-size: .82rem;   font-weight: 800;  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;}
tbody tr:hover {  background:#f7f8fb;}
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;  align-items: center; gap: 10px; margin-bottom: 16px; flex-wrap:wrap;}
.toolbar .search {  min-width:260px;flex:1;}
.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:var(--brand-red);box-shadow:0 0 0 3px rgba(235,0,60,.11);}
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); overflow:hidden;}
.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: #fff; color: #000548; border: 1px solid #a2bfe0; border-left: 6px solid #6084bf; border-radius: 12px; padding: 13px 14px; box-shadow: var(--shadow); animation: toast-in .18s ease-out; }
.toast.success { background: #eef9f0; border-left-color: #21883b; }
.toast.warning { background: #fff7df; border-left-color: #b78300; }
.toast.danger { background: #fff0f3; border-left-color: #eb003c; }
.toast strong { display: block; margin-bottom: 3px; }
.toast p { margin: 0; color: #000548; font-size: .9rem; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

.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: #eef4fb; color: #000548; border: 1px solid #a2bfe0; }
.notice strong, .notice small { color: inherit; }
.notice.success { background: #eef9f0; color: #124d24; border-color: #76b785; }
.notice.warning { background: #fff7df; color: #5b4200; border-color: #d29b00; }
.notice.danger { background: #fff0f3; color: #780020; border-color: #eb003c; }
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:linear-gradient(111.26deg,var(--brand-blue) 0 49%,var(--brand-red) 49.2% 100%);}
.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); position:relative;overflow:hidden;}
.login-brand {  align-items: center; gap: 14px; margin-bottom: 24px; display:block!important;min-width:0;width:100%!important;}
.login-brand h1 { margin: 0; font-size: 1.55rem; margin-top:2px;}
.login-brand p { margin: 4px 0 0;  color:var(--brand-red);font-weight:700;}
.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; } }

/* Johanniter Corporate Design */
body::before{content:"";position:fixed;inset:0 0 auto 0;height:5px;background:var(--brand-red);z-index:1000;}

.sidebar 

.nav-divider{height:1px;background:rgba(255,255,255,.18);margin:11px 10px;}

.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);}

.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::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;}
td{border-bottom:1px solid rgba(0,5,72,.22);}

.login-card::before{content:"";position:absolute;left:0;top:0;bottom:0;width:8px;background:var(--brand-red);}
.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;}
@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}}

/* Johanniter-Logo */
.login-card,.login-brand,.brand,.sidebar{overflow:visible!important;}

.juh-logo{display:block!important;width:auto;height:auto!important;max-width:none!important;max-height:none!important;object-fit:contain!important;object-position:left center!important;flex:0 0 auto;overflow:visible;}
.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;}
.sidebar .brand{padding-left:2px;padding-right:2px;}
@media(max-width:760px){.login-logo{max-width:360px!important}.sidebar-logo{max-width:195px!important}}

/* v3.1 Material- und Einsatzplanung */
.service-card .service-stats{flex-wrap:wrap;}.input option:disabled{color:#777;}

/* 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-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;}.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.1.0 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}}

.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);}

/* 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;}

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

/* v4.4 Dienstplanung */
.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;}

.system-log{max-height:420px;overflow:auto;padding:16px;border-radius:12px;background:#111;color:#e8e8e8;font:12px/1.5 ui-monospace,SFMono-Regular,Consolas,monospace;white-space:pre-wrap;word-break:break-word;}

/* Ausgerichtete Kontrollfelder */
.checkbox-field{display:flex!important;flex-direction:row!important;align-items:center;justify-content:flex-start;gap:10px;min-height:44px;padding:8px 0;font-weight:600;}.checkbox-field input[type=checkbox]{width:18px;height:18px;flex:0 0 18px;margin:0!important;accent-color:#eb003c;}.checkbox-field>span{display:flex;align-items:center;gap:8px;line-height:1.35;min-width:0;}.checkbox-field .pill{vertical-align:middle;}

/* Planungskonfiguration */
.planning-settings{display:grid;gap:22px;}.planning-settings section{border:1px solid var(--border);border-radius:14px;padding:16px;}.requirement-panel{padding:16px;border:1px solid var(--border);border-radius:14px;}.requirement-editor{display:grid;gap:10px;}.requirement-head,.requirement-row{display:grid;grid-template-columns:76px minmax(160px,1fr) minmax(160px,1fr) minmax(150px,1fr) auto;gap:8px;align-items:end;}.requirement-head{font-size:12px;font-weight:700;color:var(--muted);padding:0 2px 4px;}.requirement-row>label{display:grid;gap:4px;}.requirement-row input,.requirement-row select{min-width:0;}.requirement-actions{display:flex;gap:6px;align-items:center;padding-bottom:1px;}.requirement-toolbar{display:flex;justify-content:space-between;align-items:center;gap:12px;margin:14px 0 8px;padding-top:12px;border-top:1px solid var(--border);}.empty-requirements{padding:14px;border:1px dashed var(--border);border-radius:10px;text-align:center;}.mobile-label{display:none;font-size:12px;font-weight:700;color:var(--muted);}@media(max-width:900px){.requirement-head{display:none}.requirement-row{grid-template-columns:1fr 1fr;padding:12px;border:1px solid var(--border);border-radius:12px}.requirement-actions{grid-column:1/-1}.mobile-label{display:block}.requirement-toolbar{align-items:flex-start;flex-direction:column}}

/* Integrierte Besatzungsvarianten und Einheitenbausteine */
.crew-profile-panel,.unit-component-panel{padding:16px;border:1px solid var(--border);border-radius:14px;}
[data-crew-profile-editor],[data-unit-position-editor],[data-unit-vehicle-editor],[data-unit-material-editor]{display:grid;gap:12px;margin-bottom:12px;}
.crew-profile-card{padding:14px;border:1px solid var(--border);border-radius:12px;background:var(--surface,#fff);}
.crew-profile-head{display:flex;justify-content:space-between;align-items:flex-start;gap:12px;margin-bottom:12px;}
.crew-profile-head>div:first-child{display:grid;gap:3px;}
.crew-profile-head small{color:var(--muted);}
.unit-component-row{display:grid;grid-template-columns:minmax(200px,1.4fr) 100px minmax(160px,1fr) auto;gap:8px;align-items:end;padding:10px;border:1px solid var(--border);border-radius:10px;}
.unit-vehicle-row{grid-template-columns:minmax(180px,1fr) minmax(200px,1.2fr) 100px auto;}
.unit-component-row>label{display:grid;gap:4px;min-width:0;}
.unit-component-row .input{min-width:0;}
@media(max-width:900px){.crew-profile-head{display:block}.crew-profile-head .actions{margin-top:10px}.unit-component-row,.unit-vehicle-row{grid-template-columns:1fr 1fr}.unit-component-row>button{grid-column:1/-1;justify-self:start}}
@media(max-width:560px){.unit-component-row,.unit-vehicle-row{grid-template-columns:1fr}}

/* v5.5.0 – zentrale Einsatzplanung und Bereitschaft */
.service-workspace{margin-top:28px;padding-top:24px;border-top:4px solid var(--brand-red);}
.planning-readiness{margin-top:18px;}
.readiness-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(180px,1fr));gap:12px;}
.readiness-card{display:grid;gap:5px;padding:15px;border:1px solid var(--line);border-left:6px solid #b56700;border-radius:12px;background:#fff;min-height:112px;}
.readiness-card.ready{border-left-color:#16803c;background:#f1fbf4;}
.readiness-card.open{border-left-color:#c90035;background:#fff4f6;}
.readiness-card.neutral{border-left-color:#6084bf;background:#f5f8fc;}
.readiness-card small{color:var(--muted);font-weight:700;text-transform:uppercase;letter-spacing:.04em;}
.readiness-card strong{font-size:1.55rem;color:var(--brand-blue);}
.readiness-card span{font-size:.86rem;line-height:1.35;color:var(--muted);}
.unit-live-summary{padding:14px;border:1px solid var(--line);border-radius:12px;background:#f5f8fc;}
.unit-live-summary .detail-grid{grid-template-columns:repeat(4,minmax(0,1fr));}
.unit-card{border-left:5px solid var(--brand-blue);}
.plan-row span>small+small{margin-top:4px;}
@media(max-width:900px){.unit-live-summary .detail-grid{grid-template-columns:1fr 1fr;}}
@media(max-width:560px){.unit-live-summary .detail-grid{grid-template-columns:1fr;}.readiness-grid{grid-template-columns:1fr;}}


/* v5.5.2 – Materialplanung, Reservierung und Kommissionierung */
.material-package-grid{display:grid;gap:10px;}
.material-package-select{display:grid;grid-template-columns:minmax(0,1fr) 96px;gap:12px;align-items:center;padding:12px;border:1px solid var(--line);border-radius:10px;background:#fff;}
.material-package-select>label{display:grid;grid-template-columns:auto minmax(0,1fr);gap:5px 9px;align-items:center;cursor:pointer;}
.material-package-select>label input{grid-row:1/3;width:18px;height:18px;margin:0;accent-color:var(--brand-red);}
.material-package-select small{display:block;color:var(--muted);font-weight:400;}
.compact-input{width:100px;min-width:84px;}
.material-source-list{font-size:.82rem;line-height:1.45;color:var(--muted);}
.material-plan-table{min-width:1050px;}
.material-plan-table td,.material-plan-table th{vertical-align:top;}
.unit-material-row{grid-template-columns:minmax(220px,1.5fr) 110px minmax(0,.6fr) auto;}
@media(max-width:900px){.unit-material-row{grid-template-columns:1fr 1fr}.material-package-select{grid-template-columns:1fr 90px;}}
@media(max-width:560px){.material-package-select,.unit-material-row{grid-template-columns:1fr}.compact-input{width:100%;}}

/* v5.5.3 – Einsatzunterlagen */
.service-documents{border:1px solid var(--border);border-left:4px solid var(--brand-blue);background:linear-gradient(135deg,var(--surface),var(--panel-2));padding:18px;border-radius:var(--radius)}
.document-action-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(190px,1fr));gap:10px;margin:14px 0 10px}
.document-action-grid .button{width:100%;justify-content:center}
@media(max-width:680px){.document-action-grid{grid-template-columns:1fr}}


/* v5.5.5 – wiederkehrende 2FA-Erinnerung */
.mfa-reminder{display:grid;grid-template-columns:auto minmax(0,1fr);gap:18px;align-items:start;}
.mfa-reminder-icon{width:58px;height:58px;border-radius:50%;display:grid;place-items:center;background:var(--brand-red);color:#fff;font-size:2rem;font-weight:900;box-shadow:0 10px 28px rgba(235,0,60,.28);}
.mfa-reminder-list{margin:18px 0 0;padding-left:22px;display:grid;gap:8px;}
@media(max-width:560px){.mfa-reminder{grid-template-columns:1fr}.mfa-reminder-icon{width:48px;height:48px;font-size:1.55rem}.modal-actions #mfaReminderLater,.modal-actions #mfaReminderNow{width:100%}}

/* v5.5.7: verbindlicher Einsatzworkflow */
.service-workflow-panel{border:1px solid var(--border);border-radius:18px;padding:20px;background:linear-gradient(180deg,var(--card),var(--surface));}
.workflow-steps{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:8px;margin:16px 0;}
.workflow-step{position:relative;padding:12px 10px;border:1px solid var(--border);border-radius:12px;text-align:center;background:var(--surface);color:var(--muted);font-size:.85rem;}
.workflow-step.done{border-color:var(--success);color:var(--success);background:color-mix(in srgb,var(--success) 8%,var(--surface));}
.workflow-step.current{border-color:var(--primary);color:var(--text);box-shadow:0 0 0 2px color-mix(in srgb,var(--primary) 20%,transparent);}
.workflow-history{margin-top:12px;padding:10px 12px;border:1px solid var(--border);border-radius:12px;}
.workflow-history summary{cursor:pointer;font-weight:700;}
.workflow-history div{padding-top:6px;}
@media(max-width:760px){.workflow-steps{grid-template-columns:1fr}.workflow-step{text-align:left}.service-workflow-panel .section-header{align-items:flex-start}.service-workflow-panel .section-header>.actions{width:100%}}

/* v5.5.8: Diagnose, Backups und konsistente Bedienbarkeit */
.diagnostic-groups{display:grid;grid-template-columns:repeat(auto-fit,minmax(260px,1fr));gap:16px}
.diagnostic-group{border:1px solid var(--border,#dbe3ec);border-radius:12px;padding:14px;background:var(--surface,#fff)}
.diagnostic-group h3{margin:0 0 10px}
.diagnostic-check{display:grid;grid-template-columns:30px 1fr;gap:10px;align-items:start;padding:10px 0;border-top:1px solid var(--border,#e6ebf1)}
.diagnostic-check:first-of-type{border-top:0}
.diagnostic-check small{display:block;margin-top:3px;word-break:break-word}
.diagnostic-icon{display:grid;place-items:center;width:26px;height:26px;border-radius:50%;font-weight:800;background:#eaf1f8;color:#234}
.diagnostic-check.pass .diagnostic-icon{background:#dff5e7;color:#0a6b32}
.diagnostic-check.warning .diagnostic-icon{background:#fff2cc;color:#7a5100}
.diagnostic-check.fail .diagnostic-icon{background:#ffe0e0;color:#9b1717}
.diagnostic-check.info .diagnostic-icon{background:#e3efff;color:#1459a6}
.backup-policy{margin:16px 0;padding:16px;border:1px solid var(--border,#dbe3ec);border-radius:12px;background:var(--surface-soft,#f7f9fc)}
@media (max-width:720px){.diagnostic-groups{grid-template-columns:1fr}.backup-policy{padding:12px}.table-wrap .actions{min-width:170px}}

/* v5.6.3: taktische Gesamtstärke gemäß Stärkeangabe hervorheben */
.strength-total {
  text-decoration-line: underline;
  text-decoration-thickness: 0.1em;
  text-underline-offset: 0.12em;
  text-decoration-skip-ink: none;
}

/* v5.6.3: Credits, Admin-Banner und Alexx-Hommage */
.admin-heading{padding-right:92px;min-height:92px;}
.admin-heading::after{z-index:0;pointer-events:none;}
.admin-heading-content{position:relative;z-index:1;max-width:100%;}
.admin-heading-content h2,.admin-heading-content p{position:relative;z-index:1;}
.developer-credit{border:0;background:transparent;color:inherit;font:inherit;cursor:pointer;padding:0;text-align:left;opacity:.78;}
.developer-credit:hover,.developer-credit:focus-visible{opacity:1;text-decoration:underline;}
.login-credit{display:block;margin:14px auto 0;color:var(--muted);text-align:center;}
.sidebar-credit{display:block;margin-top:7px;font-size:.72rem;color:var(--muted);}
.developer-panel{display:flex;align-items:center;justify-content:space-between;gap:20px;background:linear-gradient(135deg,#eef4fb,#fff);}
.developer-panel h2{margin:.2rem 0;}
.alexx-card{max-width:820px;}
.alexx-content{display:grid;grid-template-columns:minmax(220px,320px) 1fr;gap:26px;align-items:center;padding:4px 0 8px;}
.alexx-photo{width:100%;max-height:430px;object-fit:cover;border-radius:20px;box-shadow:0 16px 44px rgba(0,5,72,.22);}
.alexx-message h3{font-size:2rem;margin:0 0 12px;color:var(--brand-red);}
.alexx-message p{font-size:1.05rem;line-height:1.65;}
.alexx-signature{font-size:1.35rem!important;font-weight:700;}
.assignment-card small{line-height:1.55;}
@media(max-width:700px){.alexx-content{grid-template-columns:1fr}.alexx-photo{max-height:340px}.developer-panel{align-items:flex-start;flex-direction:column}.admin-heading{padding-right:70px}}

/* v5.6.3: Audit-, Backup- und Datenqualitätsansichten */
.audit-details{display:block;max-width:520px;white-space:pre-wrap;overflow-wrap:anywhere;font-size:.78rem;line-height:1.45;}
#admin-audit .form-grid{margin:16px 0;}
#admin-audit table td{vertical-align:top;}
#admin-data td .pill{white-space:nowrap;}
.quality-list .notice small{display:block;margin-top:4px;line-height:1.45;}
@media(max-width:760px){.audit-details{max-width:300px}#admin-audit .form-grid{grid-template-columns:1fr}}
