/* DBD Capture — geteiltes Designsystem (Shell) */
:root {
  --bg: #f6f5f8; --surface: #ffffff; --surface2: #efedf3; --surface3: #e7e4ee;
  --line: #e2dfe9; --ink: #1e1b24; --dim: #6c6580; --faint: #938aa6;
  --accent: #b32639; --accent-ink: #ffffff; --accent-soft: #f6e2e5;
  --ok: #2f855a; --warn: #b45309; --danger: #c0243a;
  --shadow: 0 10px 34px rgba(30,27,36,.14); --shadow-sm: 0 2px 8px rgba(30,27,36,.08);
  --r: 12px; --r-sm: 9px;
  --f-display: "Bricolage Grotesque", system-ui, sans-serif;
  --f-body: "Instrument Sans", system-ui, sans-serif;
  --f-mono: "IBM Plex Mono", ui-monospace, monospace;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121016; --surface: #1a1620; --surface2: #221d2a; --surface3: #2a2434;
    --line: #322b3d; --ink: #ece8f2; --dim: #9a90ab; --faint: #6f6683;
    --accent: #db5162; --accent-ink: #1a0a0d; --accent-soft: #331a20;
    --ok: #62b98a; --warn: #d99a4e; --danger: #e0687a;
    --shadow: 0 10px 34px rgba(0,0,0,.55); --shadow-sm: 0 2px 8px rgba(0,0,0,.4);
  }
}
* { box-sizing: border-box; }
/* [hidden] muss IMMER verstecken — sonst überstimmt eine display:flex/-inline-
   flex-Klasse (Buttons, .badge-blocked …) das UA-[hidden] und das Element
   bleibt sichtbar, obwohl der Code es ausblendet. */
[hidden] { display: none !important; }
html { scrollbar-gutter: stable; }
body { margin: 0; background: var(--bg); color: var(--ink);
  font: 15px/1.55 var(--f-body); -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-underline-offset: 2px; }
h1, h2, h3 { font-family: var(--f-display); letter-spacing: -.01em; text-wrap: balance; }
h1 { font-weight: 700; font-size: clamp(28px, 5vw, 40px); margin: 0 0 8px; }
h2 { font-weight: 700; font-size: 21px; margin: 0 0 10px; }
h3 { font-weight: 600; font-size: 16px; margin: 0 0 6px; }
.mono { font-family: var(--f-mono); font-variant-numeric: tabular-nums; }
.dim { color: var(--dim); }
.ic { display: inline-block; vertical-align: -.18em; flex: none; }

/* ── Appbar ─────────────────────────────────────────────────────── */
.appbar { position: sticky; top: 0; z-index: 60; background: color-mix(in oklab, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.appbar .row { max-width: 980px; margin: 0 auto; display: flex; align-items: center;
  gap: 12px; padding: 11px 18px; }
.brand { display: inline-flex; align-items: center; gap: 9px; font-family: var(--f-display);
  font-weight: 700; font-size: 16px; color: var(--ink); text-decoration: none; }
.brand .logo { color: var(--accent); display: grid; place-content: center; }
.brand small { color: var(--dim); font-weight: 500; font-family: var(--f-body); font-size: 12px; }
.appbar .grow { flex: 1; }
.appbar nav { display: flex; gap: 2px; }
.appbar nav a { color: var(--dim); text-decoration: none; font-weight: 600; font-size: 14px;
  padding: 7px 11px; border-radius: var(--r-sm); display: inline-flex; align-items: center; gap: 7px; }
.appbar nav a:hover { color: var(--ink); background: var(--surface2); }
.appbar nav a[aria-current="page"] { color: var(--accent); background: var(--accent-soft); }
@media (max-width: 640px) { .appbar nav a span { display: none; } }

/* ── Buttons ────────────────────────────────────────────────────── */
.btn { font: inherit; font-weight: 600; cursor: pointer; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink); border-radius: var(--r-sm);
  padding: 9px 14px; display: inline-flex; align-items: center; gap: 8px;
  text-decoration: none; line-height: 1; transition: border-color .12s, background .12s; }
.btn:hover { border-color: var(--accent); }
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn[disabled] { opacity: .5; cursor: default; }
.btn-primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn-primary:hover { filter: brightness(1.06); border-color: var(--accent); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--dim); }
.btn-ghost:hover { background: var(--surface2); color: var(--ink); }
.btn-danger { color: var(--danger); border-color: color-mix(in oklab, var(--danger) 40%, var(--line)); }
.btn-danger:hover { background: color-mix(in oklab, var(--danger) 12%, transparent); border-color: var(--danger); }
.btn-lg { padding: 12px 20px; font-size: 16px; }
.btn-sm { padding: 6px 10px; font-size: 13px; }
.icon-btn { padding: 7px; border-radius: var(--r-sm); }

/* ── Benutzer-Chip + Menü ───────────────────────────────────────── */
.user { position: relative; }
.user-btn { font: inherit; cursor: pointer; border: 1px solid var(--line); background: var(--surface);
  color: var(--ink); border-radius: 999px; padding: 4px 11px 4px 4px; display: flex;
  align-items: center; gap: 9px; }
.user-btn:hover { border-color: var(--accent); }
.user-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.avatar { width: 30px; height: 30px; border-radius: 999px; flex: none; object-fit: cover;
  background: var(--surface3); display: grid; place-content: center; font-weight: 700;
  font-size: 13px; color: var(--dim); overflow: hidden; border: 1px solid var(--line); }
.avatar.lg { width: 40px; height: 40px; font-size: 16px; }
.user-btn .nm { font-weight: 600; font-size: 14px; max-width: 20vw; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; }
.menu { position: absolute; right: 0; top: calc(100% + 8px); min-width: 260px; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); padding: 7px; z-index: 70; }
.menu[hidden] { display: none; }
.menu .card-head { display: flex; gap: 11px; align-items: center; padding: 9px 9px 12px;
  border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.menu .card-head .who { min-width: 0; }
.menu .card-head .nm2 { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu .card-head .id { font-family: var(--f-mono); font-size: 11px; color: var(--dim); word-break: break-all; }
.menu .card-head .use { font-size: 12px; color: var(--dim); margin-top: 3px; }
.menu a, .menu button { display: flex; width: 100%; gap: 11px; align-items: center; font: inherit;
  font-size: 14px; text-align: left; text-decoration: none; border: 0; background: none; color: var(--ink);
  border-radius: var(--r-sm); padding: 9px 10px; cursor: pointer; }
.menu a:hover, .menu button:hover { background: var(--surface2); }
.menu .danger { color: var(--danger); }
.menu .sep { height: 1px; background: var(--line); margin: 6px 4px; }

/* ── Rollen-Pille ───────────────────────────────────────────────── */
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600;
  padding: 3px 9px; border-radius: 999px; line-height: 1.3;
  color: var(--pc, var(--dim)); background: color-mix(in oklab, var(--pc, var(--dim)) 14%, transparent);
  border: 1px solid color-mix(in oklab, var(--pc, var(--dim)) 35%, transparent); }
.pill .dot { width: 7px; height: 7px; border-radius: 999px; background: var(--pc, var(--dim)); }

/* ── Karten / Layout ────────────────────────────────────────────── */
main { max-width: 980px; margin: 0 auto; padding: clamp(30px, 6vh, 56px) 18px 64px; }
.narrow { max-width: 760px; }

/* ── Footer (Recht) ─────────────────────────────────────────────── */
.appfooter { border-top: 1px solid var(--line); margin-top: 40px; }
.appfooter .row { max-width: 980px; margin: 0 auto; padding: 22px 18px 34px;
  display: flex; align-items: center; gap: 12px 20px; flex-wrap: wrap; }
.appfooter .cr { color: var(--faint); font-size: 13px; }
.appfooter nav { display: flex; gap: 6px 18px; flex-wrap: wrap; margin-left: auto; }
.appfooter nav a { color: var(--dim); text-decoration: none; font-size: 13.5px; font-weight: 500; }
.appfooter nav a:hover { color: var(--accent); }
body.mit-packbar .appfooter { margin-bottom: 84px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
  padding: 18px 20px; margin-bottom: 14px; }
.card > h2:first-child, .card > h3:first-child { margin-top: 0; }
.lede { color: var(--dim); font-size: 16px; max-width: 62ch; margin: 0 0 12px; }
.hint { color: var(--dim); font-size: 13.5px; }
.section-label { font-family: var(--f-mono); font-size: 11.5px; letter-spacing: .16em;
  text-transform: uppercase; color: var(--faint); margin: 30px 2px 10px; }

/* ── Formularelemente ───────────────────────────────────────────── */
input[type=text], input[type=number], select, textarea {
  font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-sm); padding: 9px 12px; width: 100%; }
input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 1px; }
.field { display: grid; gap: 4px; }
.field label { font-weight: 600; font-size: 14px; }
.field .sub { color: var(--dim); font-size: 12.5px; font-weight: 400; }

/* ── Tabelle ────────────────────────────────────────────────────── */
.tablewrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); }
table { border-collapse: collapse; width: 100%; font-size: 14px; }
thead th { font-family: var(--f-mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase;
  color: var(--dim); text-align: left; font-weight: 500; padding: 11px 12px; border-bottom: 1px solid var(--line);
  white-space: nowrap; background: var(--surface2); }
tbody td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: var(--surface2); }
td.num { text-align: right; font-variant-numeric: tabular-nums; }

/* ── Kleinteile ─────────────────────────────────────────────────── */
.row-flex { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.toast { font-size: 13.5px; color: var(--ok); min-height: 20px; }
.toast.err { color: var(--danger); }
code { font-family: var(--f-mono); font-size: .88em; background: var(--surface2); border: 1px solid var(--line);
  border-radius: 5px; padding: .08em .4em; }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
