:root {
  --bg: #0b1120;
  --bg-2: #0e1626;
  --surface: #18233b;
  --surface-2: #1f2c47;
  --border: rgba(255, 255, 255, 0.09);
  --border-strong: rgba(255, 255, 255, 0.16);
  --text: #f1f5f9;
  --muted: #94a3b8;
  --faint: #64748b;
  --accent: #14b8a6;
  --accent-ink: #04201d;
  --radius: 16px;
  --radius-sm: 11px;
  font-family: "Inter", system-ui, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }
html, body { height: 100%; }

body {
  margin: 0;
  background:
    radial-gradient(900px 500px at 100% -10%, rgba(20, 184, 166, 0.10), transparent 60%),
    radial-gradient(700px 500px at -10% 0%, rgba(56, 90, 160, 0.12), transparent 55%),
    var(--bg);
  color: var(--text);
  min-height: 100dvh;
}

.ic { display: inline-flex; }
.ic svg { width: 1em; height: 1em; }

/* ── Boot / Spinner ─────────────────────────────────────────────── */
.boot { min-height: 100dvh; display: grid; place-items: center; }
.spinner {
  width: 38px; height: 38px; border-radius: 50%;
  border: 3px solid var(--border-strong); border-top-color: var(--accent);
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Top App Bar ────────────────────────────────────────────────── */
.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 14px;
  padding: 11px clamp(14px, 3vw, 28px);
  background: rgba(11, 17, 32, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 11px; }
.brand .logo {
  width: 34px; height: 34px; border-radius: 9px; flex: 0 0 auto;
  display: grid; place-items: center; font-size: 20px;
  background: linear-gradient(140deg, var(--accent), #0e8f81); color: var(--accent-ink);
}
.brand .title { font-size: 16px; font-weight: 700; letter-spacing: 0.01em; }
.brand .tag { font-size: 11px; color: var(--muted); margin-top: 1px; }
.spacer { flex: 1; }

.user-chip {
  display: flex; align-items: center; gap: 10px;
  padding: 5px 6px 5px 12px; border: 1px solid var(--border);
  border-radius: 999px; background: var(--surface);
}
.user-chip .u-name { font-size: 13px; font-weight: 600; max-width: 24vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.avatar {
  width: 30px; height: 30px; flex: 0 0 auto; border-radius: 50%;
  display: grid; place-items: center; font-size: 13px; font-weight: 700;
  color: var(--accent-ink); background: var(--accent);
}
.btn-logout {
  appearance: none; cursor: pointer; border: 1px solid var(--border);
  border-radius: 999px; background: transparent; color: var(--muted);
  font: inherit; font-size: 12.5px; font-weight: 600; padding: 7px 14px;
}
.btn-logout:hover { color: var(--text); border-color: var(--border-strong); }

/* ── User-Menü (Dropdown) ───────────────────────────────────────── */
.user-menu { position: relative; }
.user-chip { cursor: pointer; appearance: none; font: inherit; color: var(--text); padding: 4px 11px 4px 5px; }
.user-chip:hover { border-color: var(--border-strong); }
.user-chip .chevron { color: var(--muted); font-size: 16px; transition: transform 0.16s; }
.user-chip.open .chevron { transform: rotate(180deg); }
.avatar.lg { width: 38px; height: 38px; font-size: 14px; }
.user-dropdown {
  position: absolute; top: calc(100% + 8px); right: 0; min-width: 232px; z-index: 100;
  background: var(--surface-2); border: 1px solid var(--border-strong); border-radius: 14px;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.45); padding: 8px; animation: pop 0.14s ease;
}
.user-dropdown[hidden] { display: none; }
.ud-head { display: flex; align-items: center; gap: 11px; padding: 8px 10px 6px; }
.ud-meta { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.ud-meta strong { font-size: 14px; }
.ud-meta small { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-dropdown hr { border: 0; border-top: 1px solid var(--border); margin: 5px 0; }
.ud-item {
  width: 100%; display: flex; align-items: center; gap: 11px; padding: 9px 11px; border-radius: 9px;
  font: inherit; font-size: 13.5px; font-weight: 500; cursor: pointer; text-align: left;
  background: none; border: none; color: var(--text); text-decoration: none;
}
.ud-item:hover { background: var(--surface); }
.ud-item .ic { font-size: 18px; color: var(--muted); }
.ud-item.danger { color: #fca5a5; }
.ud-item.danger .ic { color: #fca5a5; }

/* ── Layout: Sidebar + Content ──────────────────────────────────── */
.layout { display: flex; align-items: stretch; min-height: calc(100dvh - 57px); }
.sidebar {
  flex: 0 0 212px; padding: 18px 12px; border-right: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 4px;
}
.nav-item {
  display: flex; align-items: center; gap: 11px;
  padding: 10px 12px; border-radius: 11px; cursor: pointer;
  color: var(--muted); font-size: 14px; font-weight: 600;
  border: 1px solid transparent; background: none; text-align: left; width: 100%;
  font-family: inherit;
}
.nav-item .ic { font-size: 19px; }
.nav-item:hover { color: var(--text); background: var(--surface); }
.nav-item.active { color: var(--text); background: var(--surface-2); border-color: var(--border); }
.nav-item.active .ic { color: var(--accent); }
.nav-item:disabled { cursor: default; opacity: 0.55; }
.nav-item:disabled:hover { background: none; color: var(--muted); }
.nav-item .soon {
  margin-left: auto; font-size: 9.5px; font-weight: 700; letter-spacing: 0.04em;
  text-transform: uppercase; color: var(--faint);
  background: var(--surface); border: 1px solid var(--border); border-radius: 999px; padding: 2px 7px;
}
.content { flex: 1; min-width: 0; padding: clamp(18px, 3vw, 32px); }

/* ── Produkte: Kopf + Filter ────────────────────────────────────── */
.prod-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.prod-head h1 { margin: 0; font-size: clamp(22px, 3.5vw, 28px); font-weight: 800; letter-spacing: -0.01em; }
.prod-head .sub { color: var(--muted); font-size: 13px; }

.prod-search {
  display: flex; align-items: center; gap: 9px; margin-left: auto;
  background: var(--surface); border: 1px solid var(--border); border-radius: 999px;
  padding: 8px 14px; min-width: 210px;
}
.prod-search .ic { color: var(--faint); font-size: 17px; }
.prod-search input {
  flex: 1; background: none; border: none; outline: none;
  color: var(--text); font: inherit; font-size: 13.5px; min-width: 0;
}
.prod-search input::placeholder { color: var(--faint); }

.pills { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 22px; }
.pill {
  cursor: pointer; font: inherit; font-size: 12.5px; font-weight: 600;
  padding: 7px 13px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--surface); color: var(--muted);
}
.pill:hover { color: var(--text); border-color: var(--border-strong); }
.pill.active { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.pill .n { opacity: 0.7; margin-left: 5px; font-weight: 700; }

/* ── Kategorie-Gruppen + Raster ─────────────────────────────────── */
.cat-group { margin-bottom: 28px; scroll-margin-top: 70px; }
.cat-title {
  display: flex; align-items: center; gap: 9px; margin: 0 0 13px;
  font-size: 13px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--faint);
}
.cat-title .n { color: var(--muted); font-weight: 600; }

.grid { display: grid; gap: 11px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.prod {
  cursor: pointer; font: inherit; text-align: left;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 16px 12px 13px; border-radius: var(--radius);
  border: 1px solid var(--border); background: linear-gradient(180deg, var(--surface), var(--bg-2));
  transition: border-color 0.12s, transform 0.12s;
}
.prod:hover { border-color: var(--accent); transform: translateY(-2px); }
.prod img { width: 52px; height: 52px; object-fit: contain; }
.prod .prod-name { font-size: 13.5px; font-weight: 600; text-align: center; line-height: 1.25; }
.prod .prod-bld { font-size: 11px; color: var(--faint); text-align: center; }
.empty { color: var(--muted); font-size: 14px; padding: 40px 0; text-align: center; }

/* ── Detail-Drawer ──────────────────────────────────────────────── */
.drawer-overlay {
  position: fixed; inset: 0; z-index: 50; display: flex; justify-content: flex-end;
  background: rgba(3, 7, 18, 0.62); backdrop-filter: blur(2px);
  animation: fade 0.15s ease;
}
@keyframes fade { from { opacity: 0; } }
.drawer {
  width: min(440px, 100%); height: 100%; overflow-y: auto;
  background: var(--bg-2); border-left: 1px solid var(--border);
  padding: 22px clamp(18px, 3vw, 26px) 40px;
  animation: slidein 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
}
@keyframes slidein { from { transform: translateX(30px); opacity: 0.3; } }
.drawer-top { display: flex; align-items: flex-start; gap: 15px; margin-bottom: 22px; }
.drawer-top img { width: 64px; height: 64px; object-fit: contain; flex: 0 0 auto; }
.drawer-top h2 { margin: 2px 0 7px; font-size: 21px; font-weight: 800; }
.cat-badge {
  font-size: 11px; font-weight: 700; letter-spacing: 0.03em;
  color: var(--accent); background: rgba(20, 184, 166, 0.12);
  border: 1px solid rgba(20, 184, 166, 0.3); border-radius: 999px; padding: 3px 10px;
}
.drawer-close {
  margin-left: auto; flex: 0 0 auto; cursor: pointer;
  width: 34px; height: 34px; border-radius: 9px; font-size: 18px;
  display: grid; place-items: center;
  border: 1px solid var(--border); background: var(--surface); color: var(--muted);
}
.drawer-close:hover { color: var(--text); border-color: var(--border-strong); }

.d-sect { margin-top: 22px; }
.d-sect > h3 {
  margin: 0 0 11px; font-size: 12px; font-weight: 700; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--faint);
}
.bld-row {
  display: flex; align-items: center; gap: 11px;
  padding: 11px 14px; border-radius: var(--radius-sm);
  background: var(--surface); border: 1px solid var(--border);
}
.bld-row .ic { font-size: 22px; color: var(--accent); }
.bld-row .bld-name { font-size: 15px; font-weight: 600; }

.io-list { display: flex; flex-direction: column; gap: 7px; }
.io-row {
  display: flex; align-items: center; gap: 11px; width: 100%;
  padding: 9px 12px; border-radius: var(--radius-sm); cursor: pointer; font: inherit; text-align: left;
  background: var(--surface); border: 1px solid var(--border); color: var(--text);
}
.io-row:hover { border-color: var(--accent); }
.io-row img { width: 30px; height: 30px; object-fit: contain; flex: 0 0 auto; }
.io-row .amt { font-variant-numeric: tabular-nums; font-weight: 700; color: var(--accent); min-width: 46px; }
.io-row .io-name { font-size: 14px; font-weight: 500; }
.io-row .ic.go { margin-left: auto; color: var(--faint); font-size: 16px; }

.chips { display: flex; flex-wrap: wrap; gap: 7px; }
.chip {
  display: inline-flex; align-items: center; gap: 7px; cursor: pointer; font: inherit;
  font-size: 12.5px; font-weight: 500; padding: 5px 11px 5px 6px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--border); color: var(--text);
}
.chip:hover { border-color: var(--accent); }
.chip img { width: 22px; height: 22px; object-fit: contain; }
.note { color: var(--muted); font-size: 13px; line-height: 1.5; }

.error { min-height: 60dvh; display: grid; place-items: center; padding: 24px; text-align: center; color: var(--muted); }
.error button { margin-top: 14px; }

/* ── Buttons (primary/ghost mit Icon) ───────────────────────────── */
.btn-primary, .btn-ghost {
  display: inline-flex; align-items: center; gap: 8px;
  cursor: pointer; font: inherit; font-size: 13.5px; font-weight: 600;
  padding: 9px 15px; border-radius: 11px; border: 1px solid transparent;
}
.btn-primary .ic, .btn-ghost .ic { font-size: 17px; }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { filter: brightness(1.06); }
.btn-primary:disabled { opacity: 0.5; cursor: default; }
.btn-ghost { background: var(--surface); color: var(--text); border-color: var(--border); }
.btn-ghost:hover { border-color: var(--border-strong); }
.btn-ghost.sm { padding: 7px 11px; font-size: 12.5px; border-radius: 9px; }

.pr-actions { display: flex; gap: 9px; margin-left: auto; }

/* ── Watch-Karten ───────────────────────────────────────────────── */
.watch-grid { display: grid; gap: 13px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.watch {
  cursor: pointer; border: 1px solid var(--border); border-radius: var(--radius);
  background: linear-gradient(180deg, var(--surface), var(--bg-2));
  padding: 15px 16px; transition: border-color 0.12s, transform 0.12s;
}
.watch:hover { border-color: var(--accent); transform: translateY(-2px); }
.watch-top { display: flex; align-items: center; gap: 11px; margin-bottom: 14px; }
.watch-top img { width: 40px; height: 40px; object-fit: contain; flex: 0 0 auto; }
.watch-id { min-width: 0; flex: 1; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.watch-name { font-size: 15px; font-weight: 700; }
.q-badge {
  font-size: 11px; font-weight: 700; color: var(--accent);
  background: rgba(20, 184, 166, 0.12); border: 1px solid rgba(20, 184, 166, 0.3);
  border-radius: 999px; padding: 2px 9px;
}
.watch-acts { display: flex; gap: 5px; flex: 0 0 auto; }
.icon-btn {
  cursor: pointer; width: 30px; height: 30px; border-radius: 8px; font-size: 16px;
  display: grid; place-items: center; border: 1px solid var(--border);
  background: var(--surface); color: var(--muted);
}
.icon-btn:hover { color: var(--text); border-color: var(--border-strong); }
.icon-btn.danger:hover { color: #fca5a5; border-color: rgba(248, 113, 113, 0.4); }
.watch-stats { display: flex; gap: 10px; }
.watch-stats > div { flex: 1; min-width: 0; }
.ws-l { font-size: 10.5px; font-weight: 600; letter-spacing: 0.03em; text-transform: uppercase; color: var(--faint); margin-bottom: 3px; }
.ws-v { font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── Sparbereiche ───────────────────────────────────────────────── */
.sb-reserve { display: flex; align-items: baseline; gap: 6px; margin-bottom: 12px; }
.sb-reserve-v { font-size: 30px; font-weight: 800; color: var(--accent); font-variant-numeric: tabular-nums; line-height: 1; }
.sb-reserve-u { font-size: 12px; font-weight: 600; color: var(--muted); }
.sb-note { margin-top: 10px; font-size: 12px; color: var(--muted); line-height: 1.45; }
.fld-hint { margin-top: 5px; font-size: 11.5px; line-height: 1.4; color: var(--faint); }
.set-window { display: flex; gap: 14px; align-items: flex-end; }
.set-dash { padding-bottom: 9px; color: var(--muted); }

.pr-empty { text-align: center; color: var(--muted); padding: 50px 20px; }
.pr-empty .ic { font-size: 44px; color: var(--faint); }
.pr-empty p { margin: 12px auto 0; max-width: 46ch; font-size: 14px; line-height: 1.6; }

/* ── Modal ──────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 20px;
  background: rgba(3, 7, 18, 0.66); backdrop-filter: blur(2px); animation: fade 0.15s ease;
}
.modal {
  width: min(460px, 100%); max-height: 90dvh; overflow-y: auto;
  background: var(--bg-2); border: 1px solid var(--border-strong); border-radius: 18px;
  padding: 20px 22px 22px; animation: pop 0.16s ease;
}
.modal.wide { width: min(780px, 100%); }
@keyframes pop { from { transform: translateY(8px) scale(0.98); opacity: 0.4; } }
.modal-head { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.modal-head h2 { margin: 0; font-size: 18px; font-weight: 800; }
.modal-x {
  margin-left: auto; cursor: pointer; width: 32px; height: 32px; border-radius: 8px; font-size: 17px;
  display: grid; place-items: center; border: 1px solid var(--border); background: var(--surface); color: var(--muted);
}
.modal-x:hover { color: var(--text); }
.modal-body { display: flex; flex-direction: column; gap: 12px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 9px; margin-top: 20px; }
.modal-err { margin: 2px 0 0; font-size: 12.5px; color: #fca5a5; min-height: 1px; }

.fld-label { font-size: 12px; font-weight: 600; color: var(--muted); display: block; margin-bottom: 5px; }
.fld {
  width: 100%; background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  padding: 9px 12px; color: var(--text); font: inherit; font-size: 13.5px; outline: none;
}
.fld:focus { border-color: var(--accent); }
.fld-row { display: flex; gap: 12px; }
.fld-row > div { flex: 1; }
.picked { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 11px; background: var(--surface); border: 1px solid var(--border); font-weight: 600; }
.picked img { width: 34px; height: 34px; object-fit: contain; }

.pick-list { max-height: 230px; overflow-y: auto; display: flex; flex-direction: column; gap: 3px; border: 1px solid var(--border); border-radius: 11px; padding: 5px; }
.pick {
  display: flex; align-items: center; gap: 10px; cursor: pointer; font: inherit; text-align: left; width: 100%;
  padding: 7px 9px; border-radius: 8px; border: 1px solid transparent; background: none; color: var(--text);
}
.pick:hover { background: var(--surface); }
.pick.sel { background: var(--surface-2); border-color: var(--accent); }
.pick img { width: 26px; height: 26px; object-fit: contain; flex: 0 0 auto; }
.pick-name { font-size: 13.5px; font-weight: 500; flex: 1; }
.pick-cat { font-size: 11px; color: var(--faint); }

/* ── Detail (Chart/Zeitraum/Statistik) ──────────────────────────── */
.detail-id { display: flex; align-items: center; gap: 12px; }
.detail-id img { width: 40px; height: 40px; object-fit: contain; }
.detail-id h2 { margin: 0 0 3px; font-size: 19px; font-weight: 800; }
.range-bar { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; margin-bottom: 16px; }
.range-pills { display: flex; flex-wrap: wrap; gap: 6px; }
.range-pill {
  cursor: pointer; font: inherit; font-size: 12px; font-weight: 600; padding: 6px 11px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--surface); color: var(--muted);
}
.range-pill:hover { color: var(--text); }
.range-pill.active { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.range-custom { display: flex; align-items: center; gap: 6px; color: var(--faint); }
.range-custom .fld { width: auto; padding: 6px 9px; font-size: 12px; }
.range-custom .ic { font-size: 16px; }

.stats-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 9px; margin-bottom: 16px; }
.stat { padding: 11px 13px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); }
.stat.accent { border-color: rgba(20, 184, 166, 0.35); background: rgba(20, 184, 166, 0.08); }
.stat-l { font-size: 10.5px; font-weight: 600; letter-spacing: 0.03em; text-transform: uppercase; color: var(--faint); margin-bottom: 4px; }
.stat-v { font-size: 17px; font-weight: 800; font-variant-numeric: tabular-nums; }
.chart-wrap { position: relative; height: 300px; }
.note.center { text-align: center; padding: 24px 0; }

/* ── Verträge ───────────────────────────────────────────────────── */
.seg { display: inline-flex; background: var(--surface); border: 1px solid var(--border); border-radius: 999px; padding: 3px; gap: 2px; }
.seg-btn { cursor: pointer; font: inherit; font-size: 12.5px; font-weight: 600; padding: 6px 16px; border-radius: 999px; border: none; background: none; color: var(--muted); }
.seg-btn:hover { color: var(--text); }
.seg-btn.active { background: var(--accent); color: var(--accent-ink); }
.vt-bar { margin-bottom: 18px; }

.contract {
  cursor: pointer; border: 1px solid var(--border); border-radius: var(--radius);
  background: linear-gradient(180deg, var(--surface), var(--bg-2));
  padding: 15px 16px; transition: border-color 0.12s, transform 0.12s;
}
.contract:hover { border-color: var(--accent); transform: translateY(-2px); }
.ct-top { display: flex; align-items: center; gap: 10px; margin-bottom: 13px; }
.ct-co-ic {
  width: 30px; height: 30px; flex: 0 0 auto; border-radius: 8px; font-size: 18px;
  display: grid; place-items: center; background: var(--surface-2); color: var(--accent); border: 1px solid var(--border);
}
.ct-co { flex: 1; min-width: 0; font-size: 15px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ct-prod { display: flex; align-items: center; gap: 9px; margin-bottom: 14px; }
.ct-prod img { width: 30px; height: 30px; object-fit: contain; flex: 0 0 auto; }
.ct-prod-name { font-size: 13.5px; font-weight: 600; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.ct-info-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; margin-bottom: 18px; }
.ct-info { padding: 10px 12px; border-radius: 11px; background: var(--surface); border: 1px solid var(--border); }
.ct-info-v { font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; margin-top: 3px; }
.ct-note { margin: -6px 0 16px; padding: 11px 13px; border-radius: 11px; background: var(--surface); border: 1px solid var(--border); color: var(--muted); font-size: 13px; line-height: 1.5; white-space: pre-wrap; }

.btn-primary.big { width: 100%; justify-content: center; padding: 12px; font-size: 14.5px; margin-bottom: 8px; }
.btn-primary.big .ic { font-size: 20px; }

.deliveries { display: flex; flex-direction: column; gap: 6px; overflow-x: auto; }
.del-row {
  display: grid;
  grid-template-columns: var(--cols, minmax(94px, 1fr) repeat(4, minmax(82px, 1fr)) 28px);
  align-items: center; gap: 10px; padding: 9px 12px; border-radius: 10px;
  background: var(--surface); border: 1px solid var(--border);
}
.del-head { background: none; border: none; padding: 2px 12px 0; }
.del-head span { font-size: 10px; font-weight: 600; letter-spacing: 0.03em; text-transform: uppercase; color: var(--faint); text-align: right; }
.del-head span:first-child { text-align: left; }
.del-foot { background: none; border: none; border-top: 1px solid var(--border-strong); border-radius: 0; margin-top: 3px; padding: 9px 12px 0; }
.del-foot .del-when { color: var(--muted); font-weight: 700; }
.del-when { font-size: 12.5px; color: var(--muted); }
.del-num { font-size: 13.5px; font-weight: 600; font-variant-numeric: tabular-nums; text-align: right; }
.del-num.accent { color: var(--accent); font-weight: 700; }
.del-num.good { color: #4ade80; }
.del-num.bad { color: #fca5a5; }
.del-mkt { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.25; }
.del-mkt-p { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; text-align: right; }
.pct { font-size: 11px; font-weight: 700; font-variant-numeric: tabular-nums; }
.pct.good, .stat-v.good { color: #4ade80; }
.pct.bad, .stat-v.bad { color: #fca5a5; }
.vt-tools { display: flex; gap: 9px; margin-bottom: 18px; }
.vt-tools .btn-ghost { flex: 1; justify-content: center; }

.avg-bar { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 14px; margin-bottom: 12px; }
.avg-label { font-size: 12px; font-weight: 600; color: var(--muted); }
.range-custom.active .fld { border-color: var(--accent); color: var(--text); }
.btn-ghost.spin svg { animation: spin 0.8s linear infinite; }
.num-row .btn-ghost.sm { display: grid; place-items: center; padding: 0 11px; }

/* Tabellen-Steuerung: Durchschnitt-Umschalter + Spalten-Konfigurator */
.vt-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin-bottom: 12px; }
.vt-controls .avg-bar { margin-bottom: 0; flex: 1 1 auto; }
.col-config { position: relative; margin-left: auto; }
.col-config > summary {
  list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 7px;
  font-size: 12.5px; font-weight: 600; padding: 7px 12px; border-radius: 9px;
  border: 1px solid var(--border); background: var(--surface); color: var(--muted);
}
.col-config > summary::-webkit-details-marker { display: none; }
.col-config > summary .ic { font-size: 16px; }
.col-config > summary:hover, .col-config[open] > summary { color: var(--text); border-color: var(--border-strong); }
.col-list {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 6; min-width: 210px;
  display: flex; flex-direction: column; gap: 1px; padding: 7px; border-radius: 12px;
  background: var(--surface-2); border: 1px solid var(--border-strong); box-shadow: 0 14px 34px rgba(0, 0, 0, 0.45);
}
.col-opt { display: flex; align-items: center; gap: 9px; padding: 7px 9px; border-radius: 8px; font-size: 13px; cursor: pointer; }
.col-opt:hover { background: var(--surface); }
.col-opt input { accent-color: var(--accent); width: 15px; height: 15px; }
.icon-btn.sm { width: 26px; height: 26px; font-size: 14px; }
textarea.fld { resize: vertical; font-family: inherit; }

.ct-mid { flex: 1; min-width: 0; }
.ct-no { font-size: 11.5px; color: var(--faint); margin-top: 1px; letter-spacing: 0.03em; font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; }
.num-row { display: flex; gap: 8px; align-items: stretch; }
.num-row .fld { flex: 1; }
.num-row .btn-ghost { flex: 0 0 auto; }

/* ── Responsive ─────────────────────────────────────────────────── */
@media (max-width: 780px) {
  .layout { flex-direction: column; min-height: 0; }
  .sidebar {
    flex: none; flex-direction: row; overflow-x: auto; gap: 6px;
    border-right: none; border-bottom: 1px solid var(--border); padding: 10px 12px;
  }
  .nav-item { width: auto; white-space: nowrap; }
  .nav-item .soon { display: none; }
  .prod-search { min-width: 0; width: 100%; margin-left: 0; }
}
@media (max-width: 480px) { .user-chip .u-name { display: none; } }

/* ── Produktion: Wizard ─────────────────────────────────────────── */
.pw-banner { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); }
.pw-banner img { width: 40px; height: 40px; object-fit: contain; flex: 0 0 auto; }
.pw-need { font-size: 16px; font-weight: 800; font-variant-numeric: tabular-nums; }
.pw-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.pw-recipe { font-size: 12.5px; color: var(--muted); margin: 0; }
.pw-choices { display: flex; flex-direction: column; gap: 8px; }
.pw-choice { cursor: pointer; text-align: left; font: inherit; padding: 11px 13px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); color: var(--text); }
.pw-choice:hover { border-color: var(--border-strong); }
.pw-choice.active { border-color: var(--accent); background: rgba(20, 184, 166, 0.08); }
.pw-choice-t { font-size: 14px; font-weight: 700; }
.pw-choice-d { font-size: 12px; color: var(--muted); margin-top: 2px; }
.pw-part { display: flex; flex-direction: column; gap: 9px; padding: 11px 13px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); }
.pw-part-row { display: flex; gap: 10px; align-items: center; }
.pw-part-row .fld { flex: 1; }
.pw-part-row .seg { flex: 0 0 auto; }
.pw-preview { display: flex; gap: 14px; font-size: 13px; font-variant-numeric: tabular-nums; }
.pw-pv-self { color: #4ade80; font-weight: 700; }
.pw-pv-buy { color: var(--muted); font-weight: 600; }

/* ── Produktion: Baum ───────────────────────────────────────────── */
.prod-tree { display: flex; flex-direction: column; gap: 4px; overflow-x: auto; }
.pt-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; background: var(--surface); border: 1px solid var(--border); margin-left: calc(var(--d, 0) * 22px); }
.pt-lead { display: inline-flex; align-items: center; flex: 0 0 auto; }
.pt-lead img { width: 22px; height: 22px; object-fit: contain; }
.pt-qty { font-size: 13.5px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--accent); min-width: 54px; }
.pt-name { font-size: 13.5px; font-weight: 600; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pt-badge { font-size: 11px; font-weight: 700; border-radius: 999px; padding: 2px 9px; white-space: nowrap; flex: 0 0 auto; }
.pt-badge.self, .ps-src.self { color: #4ade80; background: rgba(74, 222, 128, 0.12); border: 1px solid rgba(74, 222, 128, 0.3); }
.pt-badge.buy, .ps-src.buy { color: var(--muted); background: var(--surface-2); border: 1px solid var(--border); }
.pt-badge.part, .ps-src.part { color: #fbbf24; background: rgba(251, 191, 36, 0.12); border: 1px solid rgba(251, 191, 36, 0.3); }
.pt-bld { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; color: var(--faint); white-space: nowrap; flex: 0 0 auto; }
.pt-bld .ic { font-size: 14px; color: var(--accent); }

/* ── Produktion: Summen-Tabelle ─────────────────────────────────── */
.prod-sum { display: flex; flex-direction: column; gap: 5px; overflow-x: auto; }
.ps-row { display: grid; grid-template-columns: minmax(150px, 2fr) minmax(80px, 1fr) minmax(96px, 1fr) minmax(90px, 1.2fr); align-items: center; gap: 10px; padding: 8px 12px; border-radius: 10px; background: var(--surface); border: 1px solid var(--border); }
.ps-head { background: none; border: none; padding: 2px 12px 0; }
.ps-head span { font-size: 10px; font-weight: 600; letter-spacing: 0.03em; text-transform: uppercase; color: var(--faint); }
.ps-name { display: flex; align-items: center; gap: 9px; font-size: 13.5px; font-weight: 600; min-width: 0; }
.ps-name img { width: 22px; height: 22px; object-fit: contain; flex: 0 0 auto; }
.ps-name span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ps-qty { font-size: 13.5px; font-weight: 700; font-variant-numeric: tabular-nums; }
.ps-src { font-size: 11px; font-weight: 700; border-radius: 999px; padding: 2px 9px; justify-self: start; white-space: nowrap; }
.ps-bld { font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── Verkaufsseite ──────────────────────────────────────────────── */
.sp-form { display: flex; flex-direction: column; gap: 20px; max-width: 760px; }
.sp-section { display: flex; flex-direction: column; gap: 10px; }
.sp-section-head { display: flex; align-items: center; gap: 12px; }
.sp-section-head .btn-ghost { margin-left: auto; }
.sp-h { margin: 0; font-size: 12px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--faint); }
.sp-link { display: flex; align-items: center; gap: 10px; padding: 11px 14px; border-radius: 11px; background: var(--surface); border: 1px solid var(--border); }
.sp-link-url { flex: 1; min-width: 0; font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; font-size: 13px; color: var(--accent); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sp-prows { display: flex; flex-direction: column; gap: 9px; }
.sp-prow { display: grid; grid-template-columns: minmax(0, 2.4fr) minmax(0, 0.9fr) minmax(0, 1fr) minmax(0, 1.4fr) auto; gap: 10px; align-items: end; padding: 11px 13px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); }
.sp-prow .fld-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sp-prow .icon-btn { margin-bottom: 1px; }
.sp-cadences { display: flex; flex-wrap: wrap; gap: 8px 20px; }
.sp-check { display: inline-flex; align-items: center; gap: 7px; font-size: 13.5px; font-weight: 500; cursor: pointer; }
.sp-check input { accent-color: var(--accent); width: 16px; height: 16px; }
.sp-foot { display: flex; align-items: center; gap: 14px; margin-top: 4px; }
.sp-status { font-size: 13px; font-weight: 600; }
.sp-status.ok { color: #4ade80; }
.sp-status.err { color: #fca5a5; }
@media (max-width: 620px) {
  .sp-prow { grid-template-columns: 1fr 1fr; }
  .sp-prow .icon-btn { grid-column: span 2; justify-self: end; }
}

/* ════════════════════════════════════════════════════════════════════
   Material 3 — Grundschicht (ADDITIV; Alt-Tokens/-Klassen bleiben bis zur
   Tab-für-Tab-Migration). Namespace: --md-* / .m3-*
   ════════════════════════════════════════════════════════════════════ */
:root {
  --md-primary: #54DBC4; --md-on-primary: #00382F;
  --md-primary-container: #005045; --md-on-primary-container: #74F8E0;
  --md-secondary-container: #33483F; --md-on-secondary-container: #CDE8DE;
  --md-tertiary-container: #234863; --md-on-tertiary-container: #CDE5FF;
  --md-surface: #0E1413; --md-on-surface: #DDE4E1; --md-on-surface-variant: #BEC9C4;
  --md-sc-lowest: #090F0E; --md-sc-low: #161D1B; --md-sc: #1A211F; --md-sc-high: #242B29; --md-sc-highest: #2F3634;
  --md-outline: #889490; --md-outline-variant: #3F4945; --md-error: #FFB4AB;
  --md-shape-xs: 8px; --md-shape-sm: 12px; --md-shape-md: 16px; --md-shape-lg: 20px; --md-shape-xl: 28px;
  --md-font: "Roboto", system-ui, "Segoe UI", sans-serif;
}

/* Seiten-Layout der M3-Views */
.m3-page { max-width: 880px; }
.m3-appbar { padding: 6px 2px 4px; margin-bottom: 6px; }
.m3-headline { font-family: var(--md-font); font-size: 28px; font-weight: 500; line-height: 1.15; color: var(--md-on-surface); }
.m3-supporting { margin-top: 6px; font-size: 14px; color: var(--md-on-surface-variant); max-width: 64ch; }

/* Tabs (primary, Indikator) */
.m3-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--md-outline-variant); margin: 18px 0 26px; }
.m3-tab { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 9px; padding: 15px 22px; border: none; background: none;
  font: inherit; font-size: 14px; font-weight: 600; letter-spacing: .01em; color: var(--md-on-surface-variant);
  position: relative; cursor: pointer; border-radius: 12px 12px 0 0; transition: background .15s, color .15s; }
.m3-tab:hover { background: rgba(84,219,196,.06); color: var(--md-on-surface); }
.m3-tab.active { color: var(--md-primary); }
.m3-tab.active::after { content: ""; position: absolute; left: 16px; right: 16px; bottom: -1px; height: 3px; border-radius: 3px 3px 0 0; background: var(--md-primary); }
.m3-tab .m3-ic { width: 18px; height: 18px; display: inline-flex; }
.m3-ic svg { width: 100%; height: 100%; display: block; }

/* Section-Kopf */
.m3-sec { display: flex; align-items: center; gap: 12px; margin: 0 2px 16px; }
.m3-sec-title { font-size: 16px; font-weight: 600; letter-spacing: .01em; color: var(--md-on-surface); }
.m3-badge { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 7px; border-radius: 999px;
  background: var(--md-primary-container); color: var(--md-on-primary-container); font-size: 12px; font-weight: 600; }
.m3-spacer { flex: 1; }

/* Buttons */
.m3-btn { display: inline-flex; align-items: center; gap: 9px; border: none; cursor: pointer; font: inherit; font-size: 14px;
  font-weight: 600; letter-spacing: .01em; border-radius: 999px; padding: 11px 22px; transition: filter .15s; }
.m3-btn .m3-ic { width: 18px; height: 18px; display: inline-flex; }
.m3-btn--filled { background: var(--md-primary); color: var(--md-on-primary); }
.m3-btn--tonal { background: var(--md-secondary-container); color: var(--md-on-secondary-container); padding-left: 18px; }
.m3-btn--text { background: none; color: var(--md-primary); padding: 10px 14px; }
.m3-btn:hover { filter: brightness(1.08); }
.m3-btn:disabled { opacity: .5; cursor: default; filter: none; }

/* Extended FAB */
.m3-fab { position: fixed; right: clamp(16px,4vw,40px); bottom: 28px; z-index: 40; display: inline-flex; align-items: center; gap: 11px;
  background: var(--md-primary-container); color: var(--md-on-primary-container); border: none; cursor: pointer;
  border-radius: var(--md-shape-md); padding: 17px 22px; font: inherit; font-size: 15px; font-weight: 600;
  box-shadow: 0 6px 16px rgba(0,0,0,.45); }
.m3-fab .m3-ic { width: 20px; height: 20px; display: inline-flex; }
.m3-fab:disabled { opacity: .6; cursor: default; }

/* Card */
.m3-card { background: var(--md-sc-high); border-radius: var(--md-shape-md); overflow: hidden; }
.m3-cards { display: flex; flex-direction: column; gap: 16px; }
.m3-card-top { display: flex; align-items: center; gap: 14px; padding: 16px 18px; }
.m3-avatar { width: 48px; height: 48px; flex: 0 0 auto; border-radius: 50%; display: grid; place-items: center; overflow: hidden;
  font-weight: 600; font-size: 16px; letter-spacing: .02em; background: var(--md-primary-container); color: var(--md-on-primary-container); }
.m3-avatar img { width: 100%; height: 100%; object-fit: contain; }
.m3-p-id { flex: 1; min-width: 0; }
.m3-p-name { font-size: 16px; font-weight: 500; line-height: 1.2; color: var(--md-on-surface); }
.m3-p-meta { font-size: 13px; color: var(--md-on-surface-variant); margin-top: 3px; }

/* Chip */
.m3-chip { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 13px; border-radius: var(--md-shape-xs);
  border: 1px solid var(--md-outline); color: var(--md-on-surface-variant); font-size: 13px; font-weight: 600; background: none; }
.m3-chip--accent { border-color: transparent; background: var(--md-primary-container); color: var(--md-on-primary-container); }

/* Icon-Button */
.m3-iconbtn { width: 40px; height: 40px; flex: 0 0 auto; border-radius: 50%; border: none; background: none; color: var(--md-on-surface-variant);
  display: grid; place-items: center; cursor: pointer; transition: background .15s, color .15s; }
.m3-iconbtn:hover { background: rgba(190,201,196,.12); color: var(--md-on-surface); }
.m3-iconbtn .m3-ic { width: 20px; height: 20px; display: inline-flex; }

/* Options-Block + Switch */
.m3-opts { padding: 4px 14px 14px; }
.m3-opts-h { font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--md-on-surface-variant); margin: 8px 6px 8px; }
.m3-opt { display: flex; align-items: center; gap: 14px; padding: 11px 14px; border-radius: var(--md-shape-sm); transition: background .15s; }
.m3-opt.on { background: var(--md-sc-highest); }
.m3-opt-txt { flex: 1; min-width: 0; }
.m3-opt-name { font-size: 14.5px; font-weight: 500; color: var(--md-on-surface); }
.m3-opt.off .m3-opt-name { color: var(--md-on-surface-variant); }
.m3-opt-sub { font-size: 12.5px; color: var(--md-on-surface-variant); margin-top: 2px; }
.m3-switch { width: 52px; height: 32px; position: relative; flex: 0 0 auto; cursor: pointer; border: none; background: none; padding: 0; }
.m3-switch .m3-track { position: absolute; inset: 0; border-radius: 16px; background: var(--md-sc-highest); border: 2px solid var(--md-outline); transition: .18s; }
.m3-switch .m3-handle { position: absolute; top: 50%; left: 9px; transform: translateY(-50%); width: 16px; height: 16px; border-radius: 50%;
  background: var(--md-outline); transition: .18s cubic-bezier(.2,.8,.2,1); display: grid; place-items: center; }
.m3-switch .m3-handle svg { width: 0; height: 0; color: var(--md-primary); transition: .12s; }
.m3-switch.on .m3-track { background: var(--md-primary); border-color: var(--md-primary); }
.m3-switch.on .m3-handle { left: 24px; width: 24px; height: 24px; background: var(--md-on-primary); }
.m3-switch.on .m3-handle svg { width: 15px; height: 15px; }

/* Outlined Mengenfeld */
.m3-num { display: flex; align-items: center; gap: 9px; flex: 0 0 auto; }
.m3-nlab { font-size: 12px; color: var(--md-on-surface-variant); }
.m3-nf { position: relative; }
.m3-nf input { width: 112px; background: transparent; border: 1px solid var(--md-outline); border-radius: var(--md-shape-xs);
  padding: 10px 46px 10px 13px; color: var(--md-on-surface); font: inherit; font-size: 14.5px; text-align: right;
  font-variant-numeric: tabular-nums; outline: none; }
.m3-nf input:focus { border: 2px solid var(--md-primary); padding: 9px 45px 9px 12px; }
.m3-suffix { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); font-size: 12px; color: var(--md-on-surface-variant); pointer-events: none; }

/* Filled Textfeld + Outlined Select */
.m3-tf { background: var(--md-sc-high); border-radius: var(--md-shape-xs) var(--md-shape-xs) 0 0; border-bottom: 1px solid var(--md-on-surface-variant); padding: 9px 16px 8px; }
.m3-tf:focus-within { border-bottom: 2px solid var(--md-primary); padding-bottom: 7px; }
.m3-tf-label { font-size: 12px; color: var(--md-on-surface-variant); font-weight: 500; }
.m3-tf:focus-within .m3-tf-label { color: var(--md-primary); }
.m3-tf input, .m3-tf textarea { width: 100%; background: none; border: none; outline: none; color: var(--md-on-surface); font: inherit; font-size: 16px; padding: 3px 0 0; resize: vertical; }
.m3-field { margin-bottom: 14px; }
.m3-select { width: 100%; background: var(--md-sc); border: 1px solid var(--md-outline); border-radius: var(--md-shape-xs);
  padding: 11px 13px; color: var(--md-on-surface); font: inherit; font-size: 14.5px; outline: none; }
.m3-select:focus { border: 2px solid var(--md-primary); padding: 10px 12px; }

/* Öffentlicher Link */
.m3-linkrow { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: var(--md-shape-sm); background: var(--md-sc); }
.m3-linkurl { flex: 1; min-width: 0; font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; font-size: 13px;
  color: var(--md-primary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Status-/Hinweistexte */
.m3-status { font-size: 13px; font-weight: 600; }
.m3-status.ok { color: var(--md-primary); }
.m3-status.err { color: var(--md-error); }
.m3-empty { color: var(--md-on-surface-variant); font-size: 14px; padding: 30px 4px; }

/* ── M3-Shell (Override der Alt-Shell; sofort sichtbar in allen Tabs) ──── */
body { background:
  radial-gradient(900px 500px at 100% -10%, rgba(84,219,196,.06), transparent 60%),
  var(--md-surface); color: var(--md-on-surface); }
.topbar { background: rgba(14,20,19,.85); border-bottom: 1px solid var(--md-outline-variant); }
.brand .logo { background: linear-gradient(140deg, var(--md-primary), #2faa98); color: var(--md-on-primary); border-radius: 12px; }
.brand .title { color: var(--md-on-surface); }
.brand .tag { color: var(--md-on-surface-variant); }
.user-chip { background: var(--md-sc-high); border-color: var(--md-outline-variant); color: var(--md-on-surface); }
.user-chip:hover { border-color: var(--md-outline); }
.avatar { background: var(--md-primary); color: var(--md-on-primary); }
.user-dropdown { background: var(--md-sc-high); border-color: var(--md-outline-variant); }
.ud-item { color: var(--md-on-surface); }
.ud-item:hover { background: var(--md-sc-highest); }

.layout { min-height: calc(100dvh - 57px); }
.sidebar { border-right: 1px solid var(--md-outline-variant); }
.nav-item { color: var(--md-on-surface-variant); border-radius: 999px; }
.nav-item:hover { background: var(--md-sc-high); color: var(--md-on-surface); }
.nav-item.active { background: var(--md-secondary-container); color: var(--md-on-secondary-container); border-color: transparent; }
.nav-item.active .ic { color: var(--md-on-secondary-container); }
.nav-item .soon { background: var(--md-sc-high); border-color: var(--md-outline-variant); color: var(--md-on-surface-variant); }

/* ── Selbst-gehostetes Roboto (Variable, von 'self' — CSP-konform, keine externe Abhaengigkeit) ── */
@font-face {
  font-family: 'Roboto';
  font-style: normal;
  font-weight: 100 900;
  font-stretch: 100%;
  font-display: swap;
  src: url('/fonts/roboto-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: 'Roboto';
  font-style: normal;
  font-weight: 100 900;
  font-stretch: 100%;
  font-display: swap;
  src: url('/fonts/roboto-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* Roboto auf den M3-Flaechen + Shell (Alt-Tabs bleiben bis zu ihrer Migration auf Inter) */
.m3-page, .topbar, .sidebar { font-family: var(--md-font); }

/* ════════════════════════════════════════════════════════════════════
   M3-Migration der uebrigen Tabs (Produkte/Preisradar/Vertraege/Produktion)
   — APPEND-ONLY Re-Theme der Alt-Klassen auf die M3-Palette/-Formen.
   Elevation: Seite = surface · Karten/Dialog = sc-high · innere Felder/Zeilen = sc-highest.
   ════════════════════════════════════════════════════════════════════ */

/* 1) Alt-Tokens auf die M3-Palette umbiegen (spaetere :root gewinnt per Source-Order) */
:root {
  --bg: #0E1413;            /* md surface (Seite) */
  --bg-2: #1A211F;          /* md sc */
  --surface: #242B29;       /* md sc-high  → Karten/Dialog-Basis */
  --surface-2: #2F3634;     /* md sc-highest → gehoben/ausgewaehlt */
  --border: #3F4945;        /* md outline-variant */
  --border-strong: #889490; /* md outline */
  --text: #DDE4E1;          /* md on-surface */
  --muted: #BEC9C4;         /* md on-surface-variant */
  --faint: #97A39E;         /* etwas heller als md outline → Kontrast kleiner Labels */
  --accent: #54DBC4;        /* md primary */
  --accent-ink: #00382F;    /* md on-primary (WICHTIG fuer Button-/Chip-Labels) */
  --radius: 16px;
  --radius-sm: 12px;
}

/* app-weit Roboto */
body, .content { font-family: var(--md-font); }

/* 2) Buttons → M3-Pills */
.btn-primary, .btn-ghost { border-radius: 999px; padding: 10px 22px; }
.btn-primary { background: var(--md-primary); color: var(--md-on-primary); }
.btn-ghost { background: var(--md-secondary-container); color: var(--md-on-secondary-container); border-color: transparent; }
.btn-ghost:hover { border-color: transparent; filter: brightness(1.08); }
.btn-ghost.sm { border-radius: 999px; padding: 8px 14px; }
.btn-primary.big { border-radius: 16px; }
.num-row .btn-ghost.sm { border-radius: 10px; padding: 0 11px; } /* Trailing-Icon im Eingabe-Paar kompakt */

/* 3) Karten → flache M3-Surface (Gradient raus, sonst muddy nach Re-Point) */
.prod, .watch, .contract { background: var(--md-sc-high); border: 1px solid var(--md-outline-variant); }
.prod:hover, .watch:hover, .contract:hover { border-color: var(--md-primary); }

/* 4) Innere gefuellte Elemente → eine Stufe hoeher (lesbar auf Karte/Dialog) */
.fld, textarea.fld, select.fld, .stat, .ct-info, .ct-note, .del-row, .io-row, .bld-row,
.pt-row, .ps-row, .picked, .pick-list, .num-row, .pw-part, .pw-banner, .col-list {
  background: var(--md-sc-highest);
}
.fld:focus, .range-custom.active .fld { border-color: var(--md-primary); }

/* 5) Dialog/Drawer → gehobene Surface + M3-Form */
.modal { background: var(--md-sc-high); border-color: var(--md-outline-variant); border-radius: 28px; }
.drawer { background: var(--md-sc-high); }
.prod-search { background: var(--md-sc-high); border-color: var(--md-outline-variant); }
.prod-search:focus-within { border-color: var(--md-primary); }

/* 6) Icon-Buttons → rund + State-Layer */
.icon-btn, .modal-x, .drawer-close { border-radius: 50%; background: none; border: none; color: var(--md-on-surface-variant); }
.icon-btn:hover, .modal-x:hover, .drawer-close:hover { background: rgba(190, 201, 196, 0.12); color: var(--md-on-surface); border: none; }
.icon-btn.danger:hover { background: rgba(255, 180, 171, 0.12); color: var(--md-error); border: none; }

/* 7) Chips/Badges → M3 (hartcodierte Alt-Teals ersetzen) */
.q-badge, .cat-badge { background: var(--md-primary-container); color: var(--md-on-primary-container); border-color: transparent; }
.stat.accent { background: var(--md-primary-container); border-color: transparent; }
.stat.accent .stat-l { color: var(--md-on-primary-container); } /* faint-Label auf Akzent-Kachel: Kontrast ≥ AA */
.chip { border-color: var(--md-outline); }
.chip:hover { border-color: var(--md-primary); }

/* 8) Filter-/Segment-Chips: aktiv = tonal (nicht laut voll-primaer) */
.pill { background: none; border-color: var(--md-outline); color: var(--md-on-surface-variant); }
.pill:hover { color: var(--md-on-surface); background: rgba(190, 201, 196, 0.08); border-color: var(--md-outline); }
.pill.active, .range-pill.active { background: var(--md-secondary-container); color: var(--md-on-secondary-container); border-color: transparent; }
.seg { border-color: var(--md-outline); }
.seg-btn.active { background: var(--md-secondary-container); color: var(--md-on-secondary-container); }

/* 9) Auswahl-Zustaende → tonal */
.pick.sel { background: var(--md-secondary-container); border-color: var(--md-primary); }
.pick:hover { background: var(--md-sc-high); }
.pw-choice.active { background: var(--md-secondary-container); border-color: var(--md-primary); }

/* 10) "Kauf"-Badge eine Stufe abheben, sonst verschwindet es auf der Zeile (sc-highest) */
.pt-badge.buy, .ps-src.buy { background: var(--md-sc); border-color: var(--md-outline-variant); }

/* ── M3-Wizard (öffentliche Käuferseite) ─────────────────────────────── */
.m3-wizard {
  max-width: 540px; margin: 0 auto; background: var(--md-sc-high);
  border-radius: var(--md-shape-xl); overflow: hidden; display: flex; flex-direction: column;
  box-shadow: 0 14px 44px rgba(0, 0, 0, 0.5), 0 2px 8px rgba(0, 0, 0, 0.3);
}
.m3-wiz-head { padding: 22px 26px 16px; }
.m3-wiz-seller { font-size: 13px; font-weight: 600; color: var(--md-primary); letter-spacing: 0.02em; }
.m3-wiz-title { font-size: 22px; font-weight: 500; margin-top: 4px; color: var(--md-on-surface); line-height: 1.2; }
.m3-wiz-progress { height: 4px; border-radius: 2px; background: var(--md-sc-highest); margin-top: 16px; overflow: hidden; }
.m3-wiz-progress-bar { height: 100%; width: 0; background: var(--md-primary); border-radius: 2px; transition: width 0.3s cubic-bezier(0.2, 0.8, 0.2, 1); }
.m3-wiz-steplabel { font-size: 12px; color: var(--md-on-surface-variant); margin-top: 8px; }
.m3-wiz-body { padding: 10px 26px 6px; min-height: 220px; display: flex; flex-direction: column; gap: 16px; animation: m3wizin 0.25s ease; }
@keyframes m3wizin { from { opacity: 0; transform: translateX(12px); } }
.m3-wiz-intro { white-space: pre-wrap; color: var(--md-on-surface-variant); font-size: 14px; line-height: 1.55; }
.m3-wiz-helper { font-size: 12px; color: var(--md-on-surface-variant); margin-top: -8px; }
.m3-wiz-foot { display: flex; align-items: center; gap: 12px; padding: 14px 26px 22px; }

/* Auswählbare M3-Liste (Produkt / Vertragsart) */
.m3-list { display: flex; flex-direction: column; gap: 8px; }
.m3-list-item {
  display: flex; align-items: center; gap: 12px; cursor: pointer; text-align: left; width: 100%;
  padding: 13px 15px; border-radius: var(--md-shape-sm); border: 1px solid var(--md-outline-variant);
  background: var(--md-sc-highest); color: var(--md-on-surface); font: inherit;
  transition: border-color 0.12s, background 0.12s;
}
.m3-list-item:hover { border-color: var(--md-outline); }
.m3-list-item.sel { border-color: var(--md-primary); background: var(--md-secondary-container); color: var(--md-on-secondary-container); }
.m3-li-main { flex: 1; min-width: 0; }
.m3-li-name { font-size: 15px; font-weight: 500; }
.m3-li-sub { font-size: 12.5px; color: var(--md-on-surface-variant); margin-top: 2px; }
.m3-list-item.sel .m3-li-sub { color: var(--md-on-secondary-container); opacity: 0.85; }
.m3-li-check { width: 20px; height: 20px; flex: 0 0 auto; opacity: 0; color: var(--md-on-secondary-container); }
.m3-list-item.sel .m3-li-check { opacity: 1; }

/* Zusammenfassung */
.m3-sum { display: flex; flex-direction: column; gap: 1px; border-radius: var(--md-shape-sm); overflow: hidden; }
.m3-sum-row { display: flex; gap: 14px; padding: 11px 14px; background: var(--md-sc-highest); }
.m3-sum-k { font-size: 13px; color: var(--md-on-surface-variant); flex: 0 0 42%; }
.m3-sum-v { font-size: 13.5px; color: var(--md-on-surface); font-weight: 500; flex: 1; text-align: right; word-break: break-word; }
.m3-wiz-terms { margin-top: 6px; padding: 13px 15px; border-radius: var(--md-shape-sm); background: var(--md-sc); white-space: pre-wrap; color: var(--md-on-surface-variant); font-size: 12.5px; line-height: 1.5; }
.m3-wiz-terms-h { font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--md-on-surface-variant); margin: 8px 2px 6px; }

/* Wizard: Cover (Willkommen) / animierter Abschluss / Zusammenfassungs-Kopf */
.m3-wiz-cover { text-align: center; align-items: center; }
.m3-wiz-hero { width: 76px; height: 76px; border-radius: 50%; display: grid; place-items: center; margin: 8px auto 2px;
  background: var(--md-primary-container); color: var(--md-on-primary-container); }
.m3-wiz-hero svg { width: 38px; height: 38px; display: block; }
.m3-wiz-eyebrow { font-size: 12.5px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--md-primary); margin-top: 6px; }
.m3-wiz-hero-name { font-size: 26px; font-weight: 500; color: var(--md-on-surface); margin-top: 2px; line-height: 1.15; }
.m3-wiz-sub { color: var(--md-on-surface-variant); font-size: 14px; line-height: 1.55; margin-top: 8px; max-width: 42ch; }
.m3-wiz-cover .m3-wiz-intro { text-align: left; width: 100%; margin-top: 12px; background: var(--md-sc); border-radius: var(--md-shape-md); padding: 16px 18px; }
.m3-wiz-success { width: 84px; height: 84px; border-radius: 50%; display: grid; place-items: center; margin: 6px auto 12px;
  background: var(--md-primary); color: var(--md-on-primary); animation: m3pop 0.42s cubic-bezier(0.2, 0.9, 0.3, 1.3); }
.m3-wiz-success svg { width: 46px; height: 46px; display: block; }
@keyframes m3pop { from { transform: scale(0.4); opacity: 0; } }
.m3-sum-head { display: flex; align-items: center; gap: 12px; padding: 2px 2px 14px; }
.m3-sum-head .m3-wiz-hero { width: 44px; height: 44px; margin: 0; flex: 0 0 auto; }
.m3-sum-head .m3-wiz-hero svg { width: 22px; height: 22px; }
.m3-sum-head-t { font-size: 16px; font-weight: 600; color: var(--md-on-surface); }
.m3-sum-head-s { font-size: 12.5px; color: var(--md-on-surface-variant); margin-top: 1px; }

/* Rich-Text: strukturierte Darstellung des Freitexts (Einleitung/Bedingungen) */
.m3-rt { display: flex; flex-direction: column; gap: 9px; }
.m3-rt-p { font-size: 13.5px; line-height: 1.55; color: var(--md-on-surface-variant); }
.m3-rt-h { font-size: 12px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--md-primary); margin-top: 4px; }
.m3-rt-clause { display: flex; gap: 11px; align-items: baseline; }
.m3-rt-clause-n { flex: 0 0 auto; min-width: 26px; font-weight: 700; color: var(--md-primary); font-variant-numeric: tabular-nums; }
.m3-rt-clause-b { flex: 1; min-width: 0; font-size: 13.5px; line-height: 1.55; color: var(--md-on-surface-variant); }
.m3-rt-clause.sub { margin-left: 22px; }
.m3-rt-clause.sub .m3-rt-clause-n { min-width: 34px; font-size: 12.5px; opacity: 0.82; }
.m3-rt-clause.sub .m3-rt-clause-b { font-size: 13px; }
.m3-rt-ul { display: flex; flex-direction: column; gap: 6px; }
.m3-rt-li { display: flex; gap: 9px; font-size: 13.5px; line-height: 1.5; color: var(--md-on-surface-variant); }
.m3-rt-dot { color: var(--md-primary); flex: 0 0 auto; font-weight: 700; }

/* Sprachumschalter (öffentliche Käuferseite) */
.m3-langbar { display: flex; justify-content: flex-end; max-width: 540px; margin: 0 auto 14px; }
.m3-langtog { display: inline-flex; gap: 2px; padding: 3px; border-radius: 999px; background: var(--md-sc-high); border: 1px solid var(--md-outline-variant); }
.m3-langbtn { border: none; background: none; cursor: pointer; font: inherit; font-size: 12.5px; font-weight: 700; letter-spacing: 0.02em; padding: 5px 13px; border-radius: 999px; color: var(--md-on-surface-variant); }
.m3-langbtn:hover { color: var(--md-on-surface); }
.m3-langbtn.active { background: var(--md-secondary-container); color: var(--md-on-secondary-container); }

/* ── Partner-Vertragsauskunft ───────────────────────────────────── */
#partner .m3-langbar { max-width: none; margin: 0 0 14px; }
#partner .m3-card { margin-bottom: 16px; }
.p-pad { padding: 16px 18px; }
.p-hero { text-align: center; margin: 4px 0 20px; }
.p-hero h1 { margin: 0; font-size: 22px; font-weight: 800; letter-spacing: 0.01em; }
.p-hero p { margin: 5px 0 0; color: var(--md-on-surface-variant); font-size: 13.5px; }
.p-search { display: flex; gap: 12px; align-items: flex-end; }
.p-search .m3-field { flex: 1; margin: 0; }
.p-search .m3-btn { flex: 0 0 auto; }
.p-cardtitle { margin: 0 0 10px; font-size: 14px; font-weight: 700; }
.p-chartwrap { position: relative; height: 240px; }
.p-strong { color: var(--md-primary); font-weight: 800; }
.p-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.p-table th { text-align: left; color: var(--md-on-surface-variant); font-weight: 600; font-size: 11px; text-transform: uppercase; letter-spacing: 0.03em; padding: 6px 8px; border-bottom: 1px solid var(--md-outline-variant); white-space: nowrap; }
.p-table td { padding: 8px 8px; border-bottom: 1px solid var(--md-sc-high); font-variant-numeric: tabular-nums; }
.p-table td.num, .p-table th.num { text-align: right; }
.p-table tr:last-child td { border-bottom: none; }
.p-badge-type { flex: 0 0 auto; background: var(--md-tertiary-container); color: var(--md-on-tertiary-container); font-size: 11px; font-weight: 700; border-radius: 999px; padding: 3px 11px; }
.p-foot { text-align: center; color: var(--md-on-surface-variant); font-size: 11.5px; opacity: 0.7; margin-top: 18px; }
