/* Selbst gehostet – läuft offline im Container */
@font-face { font-family: "IBM Plex Sans"; font-weight: 100 700; font-display: swap; src: url("fonts/ibm-plex-sans-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "IBM Plex Sans"; font-weight: 100 700; font-display: swap; src: url("fonts/ibm-plex-sans-latin-ext.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+20A0-20AB, U+20AD-20C4, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "IBM Plex Mono"; font-weight: 500; font-display: swap; src: url("fonts/ibm-plex-mono-500-latin.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-weight: 600; font-display: swap; src: url("fonts/ibm-plex-mono-600-latin.woff2") format("woff2"); }
:root {
  --bg: #f4f3ef; --surface: #fff; --ink: #16201f; --muted: #5f6967; --line: #e4e0d8; --line-2: #efece6;
  --accent: #0f766e; --accent-2: #2a9d8f; --accent-soft: #dcefeb;
  --amber: #d99a2b;
  --ok: #15803d; --ok-soft: #e6f4ea; --warn: #a14c08; --warn-soft: #fcf0dc;
  --bad: #b42318; --bad-soft: #fcebe9; --info: #1f4fbf; --info-soft: #e9eefb;
  --r: 12px; --shadow: 0 1px 2px rgba(16,24,22,.05), 0 6px 18px -6px rgba(16,24,22,.07);
  --ease: cubic-bezier(.16, 1, .3, 1);
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-family: "IBM Plex Sans", ui-sans-serif, system-ui, sans-serif;
  font-size: 14px; color: var(--ink); line-height: 1.45;
  font-variant-numeric: tabular-nums;
  accent-color: var(--accent); caret-color: var(--accent);
}
* { box-sizing: border-box; }
html { scrollbar-color: #cbc5b9 transparent; }
::selection { background: #f3d9a4; color: #1b1300; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
a { text-underline-offset: 3px; }
body { margin: 0; background: var(--bg); display: grid; grid-template-columns: 252px minmax(0, 1fr); min-height: 100vh; overflow-x: hidden; }
h1, h2, h3 { letter-spacing: -.015em; text-wrap: balance; }
#main.enter > * { animation: enter .5s var(--ease) both; }
@keyframes enter { from { opacity: 0; transform: translateY(6px); } }
@media (prefers-reduced-motion: reduce) { #main > *, #toast div { animation: none; } }

/* Sidebar */
.side { background: #0f1f1d; color: #c9d6d3; padding: 18px 12px; scrollbar-color: #2b4440 transparent; position: sticky; top: 0; height: 100vh; overflow: auto; display: flex; flex-direction: column; }
.brand { display: grid; grid-template-columns: 1fr auto; align-items: center; padding: 6px 10px 18px; }
.brand small { grid-column: 1; font-weight: 500; color: #86a09b; font-size: 11.5px; letter-spacing: .01em; margin-top: 2px; }
.wordmark { display: inline-flex; align-items: baseline; gap: 3px; color: #fff; text-decoration: none; font-size: 25px; font-weight: 600; letter-spacing: -.045em; line-height: 1; }
.wordmark i { width: 7px; height: 7px; border-radius: 50%; background: #e8b04a; }
.wordmark:focus-visible { outline-color: #e8b04a; }
.nav-close, .menu-btn, .top-wm, .side-role { display: none; }
.side-role { gap: 4px; color: #a9bbb7; font-size: 11.5px; margin-bottom: 14px; }
.side-role select { background: #172f2c; color: #fff; border-color: #2b4440; }
.nav-h { font-size: 10.5px; text-transform: uppercase; letter-spacing: .09em; color: #6a8580; padding: 14px 10px 6px; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 9px; color: inherit; text-decoration: none; font-weight: 500; margin-bottom: 1px; }
.nav a:hover { background: #172f2c; color: #fff; }
.nav a.on { background: #f4f3ef; color: var(--ink); font-weight: 600; }
.nav a.on svg.i { color: var(--accent); }
.nav a { transition: background .2s var(--ease), color .2s var(--ease); }
.nav .badge { margin-left: auto; background: var(--amber); color: #1b1300; font-size: 11px; border-radius: 99px; padding: 0 7px; font-weight: 700; }
.side-foot { margin-top: auto; padding: 16px 10px 0; font-size: 11px; color: #7f9894; line-height: 1.6; }
.side-foot b { color: #c9d6d3; font-weight: 600; letter-spacing: .01em; }
svg.i { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* Topbar */
.top { display: flex; align-items: center; gap: 12px; padding: 12px 28px; border-bottom: 1px solid var(--line); background: rgba(244,243,239,.88); backdrop-filter: blur(10px); position: sticky; top: 0; z-index: 5; }
.search { flex: 1; max-width: 440px; display: flex; align-items: center; gap: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 0 6px 0 10px; color: var(--muted); }
.search input { border: 0; outline: 0; padding: 9px 0; flex: 1; background: transparent; }
.search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.demo { font-size: 12px; color: var(--warn); background: var(--warn-soft); padding: 4px 10px; border-radius: 99px; font-weight: 600; white-space: nowrap; }
.role { margin-left: auto; display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12.5px; }
.role select { width: auto; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; font-weight: 700; font-size: 12px; }

/* Layout */
main { padding: 26px 28px 60px; max-width: 1400px; }
.ph { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.ph h1 { margin: 0; font-size: 26px; }
.ph p { margin: 4px 0 0; color: var(--muted); }
.ph-act { display: flex; gap: 8px; flex-wrap: wrap; }
.crumb { font-size: 12.5px; color: var(--muted); text-decoration: none; display: inline-block; margin-bottom: 6px; }
.crumb:hover { color: var(--accent); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); padding: 18px; min-width: 0; }
.card h2 { font-size: 15px; margin: 0 0 14px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.card h2 .sub, .card h2 .btn { margin-left: auto; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g-side { grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); }
.stack { display: grid; gap: 16px; align-content: start; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; margin-bottom: 16px; }
.kpi { display: block; text-decoration: none; color: inherit; transition: transform .15s, box-shadow .15s; }
.kpi:hover { transform: translateY(-2px); box-shadow: 0 10px 26px rgba(16,24,22,.08); }
.kpi .l { color: var(--muted); font-size: 12.5px; font-weight: 500; display: flex; align-items: center; gap: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi .v { font-size: 28px; font-weight: 600; letter-spacing: -.025em; margin: 8px 0 2px; line-height: 1.15; }
.kpi .s { color: var(--muted); font-size: 12px; }
.sub { color: var(--muted); font-size: 12px; font-weight: 400; }
.muted { color: var(--muted); }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }

/* Controls */
.btn { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); padding: 8px 13px; border-radius: 9px; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; white-space: nowrap; transition: background .2s var(--ease), border-color .2s var(--ease), transform .2s var(--ease); }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:hover { border-color: #cfc9bd; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: #0c625b; }
.btn.danger { color: var(--bad); }
.btn.danger:hover { background: var(--bad-soft); border-color: #f2c3c3; }
.btn.sm { padding: 5px 9px; font-size: 12.5px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn svg.i { width: 16px; height: 16px; }
.icon-btn { border: 0; background: transparent; cursor: pointer; padding: 6px; border-radius: 8px; color: var(--muted); }
.icon-btn:hover { background: var(--line-2); color: var(--ink); }
input, select, textarea { font: inherit; padding: 9px 11px; border: 1px solid var(--line); border-radius: 9px; background: #fff; color: var(--ink); width: 100%; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
input[type=checkbox] { width: 17px; height: 17px; accent-color: var(--accent); }
form.f { display: grid; gap: 12px; }
label.fl { display: grid; gap: 5px; font-weight: 600; font-size: 12.5px; color: #3b4543; }
.f2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.f3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.seg { display: inline-flex; background: #ebe8e1; border-radius: 10px; padding: 3px; }
.seg label { padding: 6px 12px; border-radius: 8px; cursor: pointer; font-weight: 600; color: var(--muted); }
.seg input { display: none; }
.seg label:has(input:checked) { background: #fff; color: var(--ink); box-shadow: var(--shadow); }

/* Pills & tables */
.pill { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 99px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.bad { background: var(--bad-soft); color: var(--bad); }
.pill.info { background: var(--info-soft); color: var(--info); }
.pill.muted { background: #eeece7; color: var(--muted); }
.pill.violet { background: #f1ebfe; color: #6d28d9; }
.pill.teal { background: var(--accent-soft); color: var(--accent); }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 3px; background: #d6d2c8; }
.dot.ok { background: var(--ok); } .dot.warn { background: #f59e0b; } .dot.bad { background: var(--bad); }
.tbl-wrap { overflow: auto; margin: -4px -6px; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 10px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #faf9f6; }
a.id, .id { font-family: var(--mono); font-size: 12.5px; color: var(--accent); text-decoration: none; font-weight: 600; white-space: nowrap; }
a.id:hover { text-decoration: underline; }
.mono { font-family: var(--mono); }
.empty { padding: 26px; text-align: center; color: var(--muted); }
.actions { display: flex; gap: 6px; justify-content: flex-end; }

/* Dashboard */
.alerts { display: grid; gap: 8px; }
.alert { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; text-decoration: none; color: inherit; border: 1px solid transparent; font-weight: 500; }
.alert.warn { background: var(--warn-soft); } .alert.warn svg { color: var(--warn); }
.alert.bad { background: var(--bad-soft); } .alert.bad svg { color: var(--bad); }
.alert.info { background: var(--info-soft); } .alert.info svg { color: var(--info); }
.alert:hover { border-color: rgba(0,0,0,.08); }
.alert .go { margin-left: auto; opacity: .5; }
.feed { display: grid; gap: 11px; }
.feed div { display: grid; grid-template-columns: 92px 1fr; gap: 10px; font-size: 13px; }
.feed time { color: var(--muted); font-size: 12px; }
.chart { width: 100%; height: auto; display: block; }
.chart .b1 { fill: var(--accent-2); } .chart .b2 { fill: #f5b041; }
.chart text { font-size: 10px; fill: var(--muted); }
.chart .grid-l { stroke: var(--line-2); }
.legend { display: flex; gap: 14px; font-size: 12px; color: var(--muted); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.ring-wrap { display: flex; align-items: center; gap: 24px; }
.score { flex: none; width: 150px; }
.score-n { display: flex; align-items: baseline; gap: 4px; }
.score-n b { font-size: 40px; font-weight: 600; letter-spacing: -.03em; line-height: 1; }
.score-n span { color: var(--muted); font-size: 15px; }
.segs { display: grid; grid-template-columns: repeat(10, 1fr); gap: 3px; margin-top: 10px; }
.segs i { height: 8px; border-radius: 2px; background: var(--accent-2); }
.segs i.bad { background: var(--bad); }
.mini-list { display: grid; gap: 6px; font-size: 13px; }
.mini-list div { display: flex; align-items: center; gap: 8px; }

/* Process */
.pool { border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; background: #fff; }
.pool + .pool { margin-top: 12px; }
.stepper { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 12px 0 4px; }
.stepper span { height: 6px; border-radius: 9px; background: #ebe8e1; }
.stepper span.on { background: var(--accent-2); }
.stepper span.bad { background: var(--bad); }
.steplbl { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; font-size: 11px; color: var(--muted); margin-bottom: 12px; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; font-size: 13px; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 500; }
.check-res { border-radius: 12px; padding: 16px; display: flex; gap: 12px; align-items: flex-start; margin-top: 14px; }
.check-res svg.i { width: 26px; height: 26px; }
.check-res.ok { background: var(--ok-soft); color: #0f5129; }
.check-res.bad { background: var(--bad-soft); color: #7f1414; }
.check-res h3 { margin: 0 0 6px; font-size: 16px; }
.check-res ul { margin: 0 0 6px; padding-left: 18px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { border: 1px dashed #c9c3b7; background: transparent; border-radius: 99px; padding: 4px 10px; font: inherit; font-size: 12px; cursor: pointer; color: var(--muted); }
.chip:hover { border-color: var(--accent); color: var(--accent); }
.pat { display: block; text-decoration: none; color: inherit; transition: transform .15s, box-shadow .15s; }
.pat:hover { transform: translateY(-2px); box-shadow: 0 10px 26px rgba(16,24,22,.08); }
.pat h3 { margin: 0; font-size: 17px; }
.bar { height: 8px; background: #ebe8e1; border-radius: 9px; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--accent-2); border-radius: 9px; }
.bar.warn i { background: #f5b041; }
.stat { display: grid; gap: 2px; }
.stat b { font-size: 18px; }
.stat span { color: var(--muted); font-size: 12px; }
.tests { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.test { display: grid; gap: 4px; font-size: 12px; font-weight: 600; }
.checklist { display: grid; gap: 8px; }
.checklist label { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; font-weight: 500; }
.loc { display: grid; gap: 8px; }

/* Trace */
.trace { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; }
.trace .col h4 { margin: 0 0 8px; font-size: 11px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); display: flex; justify-content: space-between; }
.node { display: block; padding: 9px 11px; border: 1px solid var(--line); border-radius: 10px; background: #fff; margin-bottom: 8px; text-decoration: none; color: inherit; font-size: 12px; transition: border-color .15s; }
.node:hover { border-color: var(--accent); }
.node.start { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.node b { font-family: var(--mono); display: block; font-size: 12px; margin-bottom: 2px; }
.node .pill { margin-top: 5px; }
.col-empty { font-size: 12px; color: #b0aa9e; border: 1px dashed var(--line); border-radius: 10px; padding: 10px; text-align: center; }

/* SoHO */
.compl { display: grid; gap: 14px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.ci { display: flex; align-items: flex-start; gap: 9px; padding: 7px 0; font-size: 13.5px; border-bottom: 1px solid var(--line-2); }
.ci:last-child { border-bottom: 0; }
.ci .ok { color: var(--ok); } .ci .bad { color: var(--bad); }
.notice { background: var(--info-soft); color: #1e3a8a; border-radius: 12px; padding: 12px 14px; font-size: 13px; }
.notice.warn { background: var(--warn-soft); color: #7c3a06; }

/* Portal */
.portal { display: grid; grid-template-columns: 360px minmax(0, 1fr); gap: 28px; align-items: start; }
.phone { width: 350px; height: 700px; border-radius: 46px; background: #0b1312; padding: 12px; box-shadow: 0 30px 70px rgba(10,20,18,.25); }
.screen { background: #f7f6f2; border-radius: 36px; height: 100%; overflow: auto; padding: 18px 16px 24px; }
.notch { width: 110px; height: 26px; background: #0b1312; border-radius: 0 0 16px 16px; margin: -18px auto 12px; }
.screen .hero { background: var(--accent); color: #fff; border-radius: 22px; padding: 18px; margin-bottom: 12px; }
.screen .hero h3 { margin: 4px 0 2px; font-size: 20px; }
.screen .card { padding: 14px; border-radius: 18px; margin-bottom: 12px; }
.screen .card h2 { font-size: 14px; margin-bottom: 10px; }
.big-n { font-size: 28px; font-weight: 800; letter-spacing: -.02em; }

/* Modal & toast */
dialog { border: 0; border-radius: 16px; padding: 0; width: min(580px, 94vw); box-shadow: 0 30px 80px rgba(0,0,0,.28); color: var(--ink); }
dialog.wide { width: min(820px, 94vw); }
dialog::backdrop { background: rgba(10,20,18,.45); backdrop-filter: blur(2px); }
.m-h { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.m-h h3 { margin: 0; font-size: 16px; }
.m-b { padding: 20px; }
.m-f { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--line); background: #faf9f6; }
#toast { position: fixed; bottom: 22px; right: 22px; display: grid; gap: 8px; z-index: 100; }
#toast div { background: #0f1f1d; color: #fff; padding: 12px 16px; border-radius: 12px; box-shadow: 0 12px 30px rgba(0,0,0,.2); max-width: 400px; animation: tin .25s ease; }
#toast div.bad { background: var(--bad); }
@keyframes tin { from { opacity: 0; transform: translateY(8px); } }

/* Label */
.label { width: 100%; max-width: 380px; border: 1.5px solid #222; border-radius: 8px; padding: 12px; font-size: 11.5px; background: #fff; color: #000; margin: auto; }
.lab-top { display: flex; justify-content: space-between; gap: 8px; font-size: 10px; color: #333; }
.lab-prod { margin: 7px 0; padding: 4px 8px; font-weight: 800; letter-spacing: .03em; border-radius: 4px; color: #fff; background: #111; font-size: 12px; }
.lab-prod.eigen { background: #6d28d9; } .lab-prod.pasteurisiert { background: #0f766e; } .lab-prod.spende { background: #b45309; }
.barcode { width: 100%; height: 46px; display: block; fill: #000; }
.lab-id { font-family: var(--mono); font-size: 16px; font-weight: 700; text-align: center; letter-spacing: .08em; margin: 3px 0 8px; }
.lab-grid { display: grid; grid-template-columns: 1fr auto; gap: 3px 10px; }
.report { font-size: 13px; }
.report h4 { margin: 14px 0 4px; }

@media print {
  body { display: block; background: #fff; }
  .side, .top, main, #toast { display: none !important; }
  dialog { position: static; box-shadow: none; width: 100%; }
  .m-h, .m-f { display: none; }
}
@media (max-width: 1100px) {
  .g3, .compl, .portal { grid-template-columns: 1fr; }
  .trace { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  body { grid-template-columns: 1fr; }
  /* Navigation als ausklappbare Leiste */
  .side { position: fixed; inset: 0 auto 0 0; z-index: 20; width: min(300px, 86vw); height: 100dvh; transform: translateX(-102%); transition: transform .35s var(--ease); box-shadow: 0 0 0 100vmax rgba(10,20,18,0); }
  body.nav-open .side { transform: none; box-shadow: 0 0 0 100vmax rgba(10,20,18,.45); }
  body.nav-open { overflow: hidden; }
  .nav a { padding: 11px 10px; }
  .nav-close, .menu-btn, .side-role { display: grid; }
  .menu-btn { margin-left: -6px; color: var(--ink); }
  .menu-btn svg.i { width: 22px; height: 22px; }
  .top-wm { display: inline-flex; color: var(--ink); font-size: 21px; }
  .nav-close { color: #a9bbb7; }
  .nav-close:hover { background: #172f2c; color: #fff; }
  .role { display: none; }
  .search { padding: 0 6px 0 8px; }
  .top { position: sticky; gap: 10px; }
  main { padding: 20px 16px 50px; }
  .g2, .g-side, .f2, .f3 { grid-template-columns: 1fr; }
  .trace { grid-template-columns: 1fr 1fr; }
  .demo, .role-l { display: none; }
  .kpi .l { white-space: normal; }
  .top { padding: 10px 16px; }
  .search { max-width: none; }
}
