:root {
  --bg: #F6F5F2;
  --surface: #FFFFFF;
  --hover: #FAFAF8;
  --ink: #1B1B19;
  --ink-nav: #3A3935;
  --muted: #6C6B66;
  --faint: #A5A49E;
  --line: #E5E3DE;
  --line-strong: #C9C7C1;
  --accent: #3F5D58;
  --accent-hover: #334C48;
  --amber: #B7791F;
  --red: #A93226;
  --green: #2F6F4E;
  --grey: #9B9A94;
  --sans: 'Inter', system-ui, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, monospace;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--sans); -webkit-font-smoothing: antialiased; }
a { color: var(--accent); } a:hover { color: var(--accent-hover); }
input::placeholder { color: var(--faint); }
*:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
button, input, select { font-family: var(--sans); color: inherit; }
button { cursor: pointer; }
h1 { margin: 0; font-size: 23px; font-weight: 700; }
h2 { margin: 0; font-size: 14px; font-weight: 600; }
.mono { font-family: var(--mono); }
.muted { color: var(--muted); }
.sub { margin: 4px 0 20px; font-size: 13.5px; color: var(--muted); }
.eyebrow { font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); font-weight: 500; }
.hint { font-size: 12.5px; color: var(--muted); }
.demo { font-family: var(--mono); font-size: 11.5px; }
.err { font-size: 13.5px; color: var(--red); font-weight: 500; }
.dot { width: 8px; height: 8px; border-radius: 50%; flex: none; display: inline-block; }
.status { display: flex; align-items: center; gap: 8px; font-size: 12.5px; }
.spacer { flex: 1; }

/* -- Buttons ------------------------------------------------------------ */
.btn { min-height: 44px; padding: 0 16px; border: 1px solid var(--line); background: var(--surface); border-radius: 8px; font-size: 13.5px; font-weight: 500; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.btn:hover { background: var(--hover); }
.btn-primary { background: var(--accent); color: #FFFFFF; border: none; font-weight: 600; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-lg { min-height: 48px; padding: 0 24px; font-size: 15px; }
.btn-link { background: none; border: none; padding: 6px 0; font-size: 13px; color: var(--muted); }
.btn-link:hover { color: var(--ink); }
.btn-danger { background: none; border: none; min-height: 44px; padding: 0 12px; font-size: 13px; color: var(--red); }
.btn-danger:hover { text-decoration: underline; }
.btn:disabled { opacity: 0.5; cursor: default; }

/* -- Layout ------------------------------------------------------------- */
.shell { display: grid; grid-template-columns: 260px minmax(0, 1fr); height: 100vh; overflow: hidden; }
aside { background: var(--surface); border-right: 1px solid var(--line); display: flex; flex-direction: column; padding: 18px 14px 14px; overflow: auto; }
.brand { display: flex; align-items: center; gap: 11px; padding: 2px 8px 18px; }
.brand-mark { width: 36px; height: 36px; border-radius: 8px; background: var(--accent); flex: none; display: flex; align-items: center; justify-content: center; }
.brand-name { font-size: 15px; font-weight: 600; line-height: 1.2; }
.brand-org { font-size: 11px; color: var(--muted); }
nav { display: flex; flex-direction: column; gap: 18px; }
.nav-group { display: flex; flex-direction: column; gap: 2px; }
.nav-label { display: flex; align-items: center; justify-content: space-between; padding: 0 12px 6px; font-size: 10.5px; letter-spacing: 0.09em; text-transform: uppercase; color: var(--muted); font-weight: 500; }
.nav-item { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; text-align: left; min-height: 44px; padding: 0 12px; border-radius: 999px; background: transparent; border: 1px solid transparent; color: var(--ink-nav); font-size: 13.5px; font-weight: 400; }
.nav-item:hover { background: var(--bg); }
.nav-item > span { display: inline-flex; align-items: center; gap: 10px; }
.nav-item svg { flex: none; opacity: 0.85; }
.nav-item.active { background: var(--accent); border-color: var(--accent); color: #FFFFFF; font-weight: 600; }
.badge { min-width: 22px; height: 22px; border-radius: 999px; background: var(--accent); color: #FFFFFF; display: inline-flex; align-items: center; justify-content: center; font-family: var(--mono); font-size: 11.5px; font-weight: 600; padding: 0 6px; }
.nav-item.active .badge { background: #FFFFFF; color: var(--accent); }
.whoami { border-top: 1px solid var(--line); margin: 14px -14px 0; padding: 14px 14px 0; display: flex; align-items: center; gap: 10px; }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--bg); border: 1px solid var(--line); display: flex; align-items: center; justify-content: center; flex: none; font-size: 12px; font-weight: 600; color: var(--accent); }
.avatar.sm { width: 30px; height: 30px; font-size: 10.5px; }
.icon-btn { height: 32px; min-width: 32px; padding: 0 10px; border: none; background: none; border-radius: 8px; display: flex; align-items: center; justify-content: center; gap: 6px; font-size: 12px; color: var(--muted); }
.icon-btn:hover { background: var(--bg); }

.content { display: flex; flex-direction: column; min-width: 0; overflow: auto; }
header { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 32px; border-bottom: 1px solid var(--line); background: var(--bg); position: sticky; top: 0; z-index: 5; }
.crumb { font-size: 13px; color: var(--muted); }
.crumb b { color: var(--ink); font-weight: 500; }
.search { position: relative; width: 260px; }
.search svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); }
.search input { width: 100%; height: 40px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); padding: 0 44px 0 34px; font-size: 13.5px; }
.kbd { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); font-family: var(--mono); font-size: 11px; color: var(--muted); border: 1px solid var(--line); border-radius: 5px; padding: 2px 5px; background: var(--bg); }
main { padding: 28px 32px 48px; width: 100%; }
.banner { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 32px; font-size: 13px; border-bottom: 1px solid var(--line); }
.banner b { font-weight: 600; }
.banner > span:not(.dot) { color: var(--ink-nav); }
.banner.test { background: #FBF3E4; }
.banner.bad { background: #F8E9E7; }
.banner .btn { min-height: 34px; margin-left: auto; }

/* -- Karten und Tabellen ------------------------------------------------ */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 22px 24px; }
.table { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 6px 24px; overflow-x: auto; }
.row { display: grid; gap: 14px; align-items: center; min-height: 56px; border-top: 1px solid var(--line); }
.row.head { min-height: 44px; border-top: none; }
.row.head > span { font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); font-weight: 500; }
.row.click { cursor: pointer; padding: 0 6px; margin: 0 -6px; }
.row.click:hover { background: var(--hover); }
.r { text-align: right; }
.kv { display: flex; justify-content: space-between; align-items: center; min-height: 38px; border-top: 1px solid var(--line); font-size: 13px; }
.kv > span:first-child { color: var(--muted); }
.kv .n { font-family: var(--mono); font-size: 16px; font-weight: 600; }
.empty { padding: 28px 0; text-align: center; font-size: 13.5px; color: var(--muted); border-top: 1px solid var(--line); }
.field-label { font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); font-weight: 500; margin-bottom: 4px; }

/* -- Dashboard ---------------------------------------------------------- */
.grid-cta { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px; margin-bottom: 14px; }
.cta { display: flex; align-items: center; gap: 18px; text-align: left; border-radius: 10px; padding: 20px 22px; }
.cta.primary { background: var(--accent); color: #FFFFFF; border: none; }
.cta.primary:hover { background: var(--accent-hover); }
.cta.plain { background: var(--surface); border: 1px solid var(--line); }
.cta.plain:hover { background: var(--hover); }
.cta-icon { width: 48px; height: 48px; border-radius: 10px; display: flex; align-items: center; justify-content: center; flex: none; }
.cta.primary .cta-icon { background: rgba(255, 255, 255, 0.12); }
.cta.plain .cta-icon { background: var(--bg); border: 1px solid var(--line); }
.cta-kicker { display: block; font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; font-weight: 600; }
.cta.primary .cta-kicker { opacity: 0.8; }
.cta-main { display: flex; align-items: baseline; gap: 10px; margin-top: 4px; font-size: 15px; font-weight: 600; }
.cta-main .mono { font-size: 34px; font-weight: 700; line-height: 1; }
.cta-go { display: flex; align-items: center; gap: 8px; font-size: 13.5px; font-weight: 600; flex: none; }
.grid-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin-bottom: 14px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 18px 20px; }
.stat-top { display: flex; justify-content: space-between; align-items: flex-start; }
.stat-n { font-family: var(--mono); font-size: 32px; font-weight: 600; margin-top: 10px; }
.stat-n small { font-size: 13px; font-weight: 400; color: var(--muted); margin-left: 6px; }
.grid-main { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 14px; align-items: start; }
.side-stack { display: flex; flex-direction: column; gap: 14px; }
.side-stack .card { padding: 20px 22px; }

/* -- Scan-Screens ------------------------------------------------------- */
.narrow { max-width: 760px; margin: 0 auto; }
.scan { width: 100%; height: 76px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); padding: 0 24px; font-family: var(--mono); font-size: 22px; text-align: center; }
.scan.bad { border-color: var(--red); }
.scan.card-in { max-width: 420px; height: 64px; border-color: var(--accent); }
.result { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 48px 24px; text-align: center; }
.result .big { font-family: var(--mono); font-size: 64px; font-weight: 700; margin: 14px 0 10px; letter-spacing: 0.02em; }
.result .kicker { font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; font-weight: 600; }
.result p { font-size: 14px; color: var(--muted); margin: 0 0 28px; }
.actions { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; }
.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 18px 32px; }
.facts .v { font-size: 14.5px; }
.facts .v.mono { font-size: 15px; font-weight: 500; }
.footer-stats { margin-top: 36px; display: flex; justify-content: center; gap: 28px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.footer-stats b { font-family: var(--mono); font-weight: 600; color: var(--ink); margin-left: 8px; }
.pruef-in { width: 100%; height: 84px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); padding: 0 24px; font-family: var(--mono); font-size: 24px; text-align: center; }
.verdict { margin-top: 28px; border-radius: 10px; padding: 44px 32px; text-align: center; color: #FFFFFF; }
.verdict.ok { background: var(--green); }
.verdict.fail { background: var(--red); }
.verdict input { margin-top: 12px; width: 100%; max-width: 360px; height: 56px; border: none; border-radius: 8px; background: #FFFFFF; color: var(--ink); padding: 0 20px; font-family: var(--mono); font-size: 20px; text-align: center; }

/* -- Fall --------------------------------------------------------------- */
.pill { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 999px; padding: 6px 14px; background: var(--surface); font-size: 12.5px; font-weight: 500; }
.chip { min-height: 36px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); font-size: 12.5px; font-weight: 500; }
.chip.on { background: var(--accent); color: #FFFFFF; }
.addr { border: 1px solid var(--line); border-radius: 8px; padding: 14px 16px; }
.addr.new { border-color: var(--accent); }
.tl { display: grid; grid-template-columns: 14px minmax(0, 1fr); gap: 12px; }
.tl-rail { display: flex; flex-direction: column; align-items: center; }
.tl-rail .dot { margin-top: 5px; }
.tl-rail i { width: 1px; flex: 1; background: var(--line); }
.tl:last-child .tl-rail i { display: none; }
.popover { position: absolute; right: 0; top: calc(100% + 6px); background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 8px; display: flex; flex-direction: column; gap: 4px; z-index: 10; min-width: 180px; box-shadow: 0 8px 24px rgba(27, 27, 25, 0.08); }
.popover button { text-align: left; min-height: 40px; border: none; background: none; border-radius: 6px; padding: 0 12px; font-size: 13.5px; }
.popover button:hover { background: var(--bg); }

/* -- Versandliste ------------------------------------------------------- */
.check { width: 26px; height: 26px; border-radius: 6px; border: 1.5px solid var(--line-strong); background: var(--surface); display: flex; align-items: center; justify-content: center; padding: 0; }
.check.on { border-color: var(--accent); background: var(--accent); }

/* -- Formulare ---------------------------------------------------------- */
.input, select.input { height: 40px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); padding: 0 12px; font-size: 13px; }
.form { display: flex; flex-direction: column; gap: 14px; }
.form label { display: flex; flex-direction: column; gap: 6px; }
.form label > span { font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); font-weight: 500; }
.form .input { height: 44px; font-size: 14px; }
.check-label { flex-direction: row !important; align-items: center; gap: 10px !important; font-size: 13.5px; }
.modal-bg { position: fixed; inset: 0; background: rgba(27, 27, 25, 0.35); display: flex; align-items: center; justify-content: center; z-index: 50; padding: 16px; }
.modal { width: 440px; max-width: 100%; background: var(--surface); border-radius: 10px; padding: 26px 28px; max-height: 90vh; overflow: auto; }
.modal h2 { font-size: 16px; margin-bottom: 18px; }
.modal .actions { justify-content: flex-end; margin-top: 8px; }

.login { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 28px; padding: 16px; }
.login .card { width: 380px; max-width: 100%; padding: 28px; }

.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--ink); color: #FFFFFF; padding: 12px 18px; border-radius: 8px; font-size: 13.5px; z-index: 60; max-width: calc(100% - 32px); }
.toast.bad { background: var(--red); }

/* -- Klein -------------------------------------------------------------- */
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; height: auto; overflow: visible; }
  aside { border-right: none; border-bottom: 1px solid var(--line); padding: 12px 16px; }
  nav { flex-direction: row; overflow-x: auto; gap: 6px; }
  .nav-group { flex-direction: row; gap: 4px; }
  .nav-label, aside > .spacer { display: none; }
  .nav-item { width: auto; white-space: nowrap; }
  .content { overflow: visible; }
  header { padding: 12px 16px; position: static; }
  .banner { padding: 10px 16px; }
  .search { width: 100%; max-width: 260px; }
  main { padding: 20px 16px 40px; }
  .grid-main { grid-template-columns: 1fr; }
  .grid-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-stats .stat:last-child { grid-column: 1 / -1; }
  .facts { grid-template-columns: 1fr; }
  .result .big { font-size: 44px; }
}

@media print {
  aside, header, .banner, .no-print { display: none !important; }
  .shell { display: block; height: auto; overflow: visible; }
  .content { overflow: visible; }
  body, main { background: #FFFFFF; padding: 0; }
  .table, .card { border-color: #999; }
}
.toast[hidden] { display: none; }
