/* =========================================================================
   Arbitragex  ·  Design System
   Vanilla CSS · no build step · light default + dark mode toggle
   ========================================================================= */

/* ---------- Design tokens ------------------------------------------------ */
:root {
  /* brand / accent */
  --brand: #6366f1;
  --brand-600: #5457e5;
  --brand-700: #4f46e5;
  --brand-soft: #eef2ff;
  --brand-softer: #f5f6ff;

  /* semantic */
  --pos: #16a34a;
  --pos-soft: #dcfce7;
  --neg: #dc2626;
  --neg-soft: #fee2e2;
  --warn: #d97706;
  --warn-soft: #fef3c7;
  --info: #0284c7;
  --info-soft: #e0f2fe;

  /* surfaces (light) */
  --bg: #f6f7fb;
  --surface: #ffffff;
  --surface-2: #fafbfe;
  /* Modals/Dialoge nutzen var(--card). War NIE definiert -> Hintergrund transparent,
     der Inhalt dahinter schimmerte durch und der Text war unlesbar. */
  --card: #ffffff;
  --sidebar: #14162b;
  --sidebar-2: #1c1f3a;
  --sidebar-hover: #262a4d;
  --sidebar-active: #6366f1;

  /* text */
  --text: #1a1c2e;
  --text-soft: #565973;
  --text-mut: #8a8ea8;
  --text-invert: #eef0ff;
  --text-invert-soft: #9ea4c9;

  /* lines */
  --border: #e6e8f0;
  --border-strong: #d3d6e4;

  /* radius */
  --r-sm: 8px;
  --r: 12px;
  --r-lg: 16px;
  --r-xl: 22px;
  --r-pill: 999px;

  /* spacing scale */
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 20px;
  --s6: 24px; --s7: 32px; --s8: 40px; --s9: 56px;

  /* shadows */
  --sh-sm: 0 1px 2px rgba(20,22,43,.06);
  --sh: 0 2px 8px rgba(20,22,43,.06), 0 1px 2px rgba(20,22,43,.04);
  --sh-md: 0 8px 24px rgba(20,22,43,.08), 0 2px 6px rgba(20,22,43,.05);
  --sh-lg: 0 20px 48px rgba(20,22,43,.14);
  --sh-brand: 0 8px 24px rgba(99,102,241,.32);

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --sidebar-w: 254px;
  --topbar-h: 64px;
}

[data-theme="dark"] {
  --bg: #0e0f1c;
  --surface: #171827;
  --surface-2: #1c1e30;
  --card: #171827;
  --sidebar: #0b0c17;
  --sidebar-2: #141527;
  --sidebar-hover: #20223a;

  --text: #e9ebf7;
  --text-soft: #a9adc9;
  --text-mut: #767a9a;
  --text-invert: #eef0ff;

  --border: #262838;
  --border-strong: #33364a;

  --brand-soft: #1e2036;
  --brand-softer: #191b2d;

  --pos-soft: #10331f;
  --neg-soft: #3a1a1c;
  --warn-soft: #382a10;
  --info-soft: #10283a;

  --sh: 0 2px 8px rgba(0,0,0,.4), 0 1px 2px rgba(0,0,0,.3);
  --sh-md: 0 8px 24px rgba(0,0,0,.5);
  --sh-lg: 0 20px 48px rgba(0,0,0,.6);
}

/* ---------- Reset -------------------------------------------------------- */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: var(--brand); text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; font-size: 14px; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 8px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: var(--text-mut); background-clip: content-box; }

/* =========================================================================
   BRAND
   ========================================================================= */
.brand { display: flex; align-items: center; gap: 11px; }
.brand-badge {
  width: 38px; height: 38px; flex: 0 0 38px;
  border-radius: 11px;
  background: linear-gradient(135deg, #7c7ff5 0%, #6366f1 55%, #4f46e5 100%);
  color: #fff; font-weight: 800; font-size: 17px;
  display: flex; align-items: center; justify-content: center;
  letter-spacing: -.5px;
  box-shadow: var(--sh-brand);
}
.brand-badge.sm { width: 30px; height: 30px; flex-basis: 30px; font-size: 14px; border-radius: 9px; }
.brand-word { display: flex; flex-direction: column; line-height: 1.05; }
.brand-word b { font-weight: 800; font-size: 16px; letter-spacing: -.3px; }
.brand-word span { font-size: 10.5px; color: var(--text-invert-soft); letter-spacing: 1.5px; text-transform: uppercase; }

/* =========================================================================
   APP SHELL
   ========================================================================= */
/* Sidebar und Main sind FEST platziert (grid-area statt Auto-Placement).
   Grund: vorher hat sich jedes zusätzliche .app-Kind per Auto-Placement die
   Content-Zelle geschnappt und .main in Zeile 2 aus dem Viewport geschoben
   (= schwarzer Content auf allen Seiten). Mit benannten Areas landen neue
   Kinder in einer impliziten Zeile und können .main nicht mehr verdrängen. */
.app { display: grid; grid-template-columns: var(--sidebar-w) 1fr;
       grid-template-areas: "sidebar main"; min-height: 100vh; }
.sidebar { grid-area: sidebar; }
.main { grid-area: main; }
/* Drawer-Overlay ist NUR auf dem Handy aktiv (dort position:fixed). */
.nav-backdrop { display: none; }

/* ---------- Sidebar ------------------------------------------------------ */
.sidebar {
  background: var(--sidebar);
  color: var(--text-invert);
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
  border-right: 1px solid rgba(255,255,255,.04);
  z-index: 30;
}
.sidebar-head { padding: 14px 18px 8px; }
.sidebar-nav { flex: 1; padding: 2px 10px 6px; overflow-y: auto; }
.nav-label {
  font-size: 10.5px; letter-spacing: 1.4px; text-transform: uppercase;
  color: var(--text-invert-soft); padding: 8px 12px 2px; opacity: .7;
}
.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 5px 12px; border-radius: var(--r-sm);
  color: var(--text-invert-soft); font-weight: 500; font-size: 13.5px;
  cursor: pointer; margin-bottom: 1px; gap: 10px;
  transition: background .14s, color .14s;
  border: none; background: none; width: 100%; text-align: left;
}
.nav-item:hover { background: var(--sidebar-hover); color: #fff; }
.nav-item.active {
  background: linear-gradient(90deg, rgba(99,102,241,.28), rgba(99,102,241,.10));
  color: #fff;
  box-shadow: inset 3px 0 0 var(--brand);
}
.nav-item svg { width: 17px; height: 17px; flex: 0 0 17px; stroke-width: 1.9; }
.nav-item .nav-badge {
  margin-left: auto; background: var(--brand); color: #fff;
  font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: var(--r-pill);
  min-width: 20px; text-align: center;
}

.sidebar-foot { padding: 8px 12px; border-top: 1px solid rgba(255,255,255,.06); }
.user-card {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px; border-radius: var(--r); background: rgba(255,255,255,.04);
}
.user-avatar {
  width: 34px; height: 34px; border-radius: 50%; flex: 0 0 34px;
  background: linear-gradient(135deg, #7c7ff5, #4f46e5); color: #fff;
  display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px;
}
.user-meta { line-height: 1.2; min-width: 0; }
.user-meta b { font-size: 13.5px; display: block; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-meta span { font-size: 11px; color: var(--text-invert-soft); }
.icon-btn-ghost {
  margin-left: auto; background: none; border: none; color: var(--text-invert-soft);
  width: 32px; height: 32px; border-radius: 8px; display: flex; align-items: center; justify-content: center;
  transition: background .14s, color .14s;
}
.icon-btn-ghost:hover { background: rgba(255,255,255,.08); color: #fff; }
.icon-btn-ghost svg { width: 17px; height: 17px; }

/* ---------- Main / topbar ------------------------------------------------ */
.main { display: flex; flex-direction: column; min-width: 0; }
.topbar {
  height: var(--topbar-h); position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--surface) 82%, transparent);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 14px;
  padding: 0 26px;
}
.topbar h1 { font-size: 19px; font-weight: 700; margin: 0; letter-spacing: -.3px; }
.topbar .sub { color: var(--text-mut); font-size: 13px; margin-left: 2px; }
.topbar-spacer { flex: 1; }
.topbar-tools { display: flex; align-items: center; gap: 10px; }
.nav-toggle { display: none; margin-right: 2px; }   /* Hamburger — nur Handy sichtbar */

.content { padding: 26px; max-width: 1440px; width: 100%; }
.section { display: none; animation: fade .28s ease; }
.section.active { display: block; }
@keyframes fade { from { opacity: 0; transform: translateY(6px);} to { opacity: 1; transform: none; } }

.section-head { display: flex; align-items: flex-end; gap: 14px; margin-bottom: 18px; flex-wrap: wrap; }
.section-head h2 { margin: 0; font-size: 17px; font-weight: 700; letter-spacing: -.2px; }
.section-head p { margin: 3px 0 0; color: var(--text-mut); font-size: 13px; }
.section-head .spacer { flex: 1; }

/* =========================================================================
   CONTROLS
   ========================================================================= */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 9px 16px; border-radius: var(--r-sm); font-weight: 600; font-size: 13.5px;
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text);
  transition: all .14s; white-space: nowrap;
}
.btn:hover { border-color: var(--brand); color: var(--brand); box-shadow: var(--sh-sm); }
.btn svg { width: 16px; height: 16px; }
.btn.primary {
  background: linear-gradient(135deg, #6b6ef4, var(--brand-700));
  border-color: transparent; color: #fff; box-shadow: var(--sh-brand);
}
.btn.primary:hover { color: #fff; filter: brightness(1.06); box-shadow: 0 10px 28px rgba(99,102,241,.4); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--text-soft); }
.btn.ghost:hover { background: var(--brand-soft); color: var(--brand); box-shadow: none; }
.btn.sm { padding: 6px 11px; font-size: 12.5px; }
.btn.danger:hover { border-color: var(--neg); color: var(--neg); }
.btn:disabled { opacity: .55; cursor: not-allowed; box-shadow: none; }

.seg { display: inline-flex; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-sm); padding: 3px; }
.seg button {
  border: none; background: none; color: var(--text-soft); font-weight: 600; font-size: 13px;
  padding: 6px 13px; border-radius: 6px; transition: all .14s;
}
.seg button.active { background: var(--surface); color: var(--brand); box-shadow: var(--sh-sm); }
.seg button:hover:not(.active) { color: var(--text); }

.field { display: flex; flex-direction: column; gap: 6px; }
.field > label { font-size: 12.5px; font-weight: 600; color: var(--text-soft); }
.field .hint { font-size: 11.5px; color: var(--text-mut); font-weight: 400; }
.input, select.input, textarea.input {
  width: 100%; padding: 9px 12px; border-radius: var(--r-sm);
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text);
  transition: border-color .14s, box-shadow .14s;
}
.input:focus, textarea.input:focus, select.input:focus {
  outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(99,102,241,.16);
}
textarea.input { resize: vertical; min-height: 74px; }
select.input { appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238a8ea8' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 11px center; padding-right: 32px; cursor: pointer; }

.select-mini {
  padding: 7px 30px 7px 12px; border-radius: var(--r-sm); border: 1px solid var(--border-strong);
  background: var(--surface); color: var(--text); font-weight: 600; font-size: 13px;
  appearance: none; -webkit-appearance: none; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238a8ea8' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center;
}
.select-mini:focus { outline: none; border-color: var(--brand); }

.checkline { display: flex; align-items: center; gap: 8px; font-size: 13.5px; font-weight: 500; cursor: pointer; user-select: none; }
.checkline input { width: 16px; height: 16px; accent-color: var(--brand); cursor: pointer; }

.mp-toggle {
  display: inline-flex; align-items: center; gap: 8px; padding: 8px 13px;
  border: 1.5px solid var(--border-strong); border-radius: var(--r-sm); cursor: pointer;
  font-weight: 600; font-size: 13px; transition: all .14s; user-select: none; background: var(--surface);
}
.mp-toggle input { display: none; }
.mp-toggle .flag { font-size: 15px; }
.mp-toggle.on { border-color: var(--brand); background: var(--brand-soft); color: var(--brand); }

/* =========================================================================
   CARDS
   ========================================================================= */
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg);
  box-shadow: var(--sh); padding: 20px;
}
.card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.card-head h3 { margin: 0; font-size: 15px; font-weight: 700; }
.card-head .spacer { flex: 1; }
.card-sub { color: var(--text-mut); font-size: 12.5px; }

.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid.charts { grid-template-columns: 1.7fr 1fr; }

/* ---------- KPI cards ---------------------------------------------------- */
.kpi-row {
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; margin-bottom: 18px;
}
.kpi {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg);
  padding: 15px 16px; box-shadow: var(--sh); position: relative; overflow: hidden;
  transition: transform .16s, box-shadow .16s;
}
.kpi:hover { transform: translateY(-2px); box-shadow: var(--sh-md); }
.kpi.hero { background: linear-gradient(150deg, #6b6ef4 0%, #4f46e5 100%); border-color: transparent; color: #fff; box-shadow: var(--sh-brand); }
.kpi.hero .kpi-label, .kpi.hero .kpi-icon { color: rgba(255,255,255,.85); }
.kpi-top { display: flex; align-items: center; gap: 8px; margin-bottom: 9px; }
.kpi-icon {
  width: 30px; height: 30px; border-radius: 9px; display: flex; align-items: center; justify-content: center;
  background: var(--brand-soft); color: var(--brand); flex: 0 0 30px;
}
.kpi.hero .kpi-icon { background: rgba(255,255,255,.18); }
.kpi-icon svg { width: 16px; height: 16px; }
.kpi-label { font-size: 12px; font-weight: 600; color: var(--text-soft); letter-spacing: .1px; }
.kpi-value { font-size: 25px; font-weight: 800; letter-spacing: -.6px; line-height: 1.1; }
.kpi.hero .kpi-value { font-size: 27px; }
.kpi-foot { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 3px; font-size: 11.5px; font-weight: 700;
  padding: 2px 8px; border-radius: var(--r-pill);
}
.chip svg { width: 12px; height: 12px; }
.chip.up { background: var(--pos-soft); color: var(--pos); }
.chip.down { background: var(--neg-soft); color: var(--neg); }
.chip.flat { background: var(--border); color: var(--text-soft); }
.kpi.hero .chip.up { background: rgba(255,255,255,.22); color: #fff; }
.kpi.hero .chip.down { background: rgba(0,0,0,.18); color: #ffd9d9; }
.kpi-foot small { color: var(--text-mut); font-size: 11.5px; }
.kpi.hero .kpi-foot small { color: rgba(255,255,255,.75); }

/* =========================================================================
   TABLES
   ========================================================================= */
.table-wrap { overflow-x: auto; border-radius: var(--r); }
table.tbl { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13.5px; }
table.tbl thead th {
  position: sticky; top: 0; z-index: 2;
  background: var(--surface-2); text-align: left; font-weight: 700; font-size: 11.5px;
  letter-spacing: .5px; text-transform: uppercase; color: var(--text-mut);
  padding: 11px 14px; border-bottom: 1px solid var(--border); white-space: nowrap;
}
table.tbl tbody td { padding: 12px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
table.tbl tbody tr:nth-child(even) { background: var(--surface-2); }
table.tbl tbody tr:hover { background: var(--brand-softer); }
table.tbl tbody tr:last-child td { border-bottom: none; }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tbl .prod { display: flex; align-items: center; gap: 11px; min-width: 210px; }
.tbl .prod img, .prod-thumb {
  width: 40px; height: 40px; border-radius: var(--r-sm); object-fit: cover;
  background: var(--surface-2); border: 1px solid var(--border); flex: 0 0 40px;
}
.prod-thumb.ph { display: flex; align-items: center; justify-content: center; color: var(--text-mut); }
.prod-thumb.ph svg { width: 18px; height: 18px; }
.tbl .prod-title { font-weight: 600; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tbl .prod-meta { font-size: 11.5px; color: var(--text-mut); font-family: var(--mono); }

.mono { font-family: var(--mono); font-size: 12.5px; }
.muted { color: var(--text-mut); }

/* editable cell */
.cell-edit {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 8px; border-radius: 7px;
  border: 1px dashed transparent; cursor: text; transition: border-color .14s, background .14s;
}
.cell-edit:hover { border-color: var(--border-strong); background: var(--surface-2); }
.cell-edit svg { width: 12px; height: 12px; color: var(--text-mut); opacity: 0; transition: opacity .14s; }
.cell-edit:hover svg { opacity: 1; }
.cogs-input {
  width: 92px; padding: 6px 9px; border-radius: 7px; border: 1px solid var(--brand);
  box-shadow: 0 0 0 3px rgba(99,102,241,.16); text-align: right; font-variant-numeric: tabular-nums;
  background: var(--surface); color: var(--text);
}

/* =========================================================================
   PILLS / BADGES
   ========================================================================= */
.pill {
  display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: var(--r-pill);
  font-size: 11.5px; font-weight: 700; white-space: nowrap; letter-spacing: .2px;
}
.pill::before { content:""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.gray { background: var(--border); color: var(--text-soft); }
.pill.green { background: var(--pos-soft); color: var(--pos); }
.pill.red { background: var(--neg-soft); color: var(--neg); }
.pill.amber { background: var(--warn-soft); color: var(--warn); }
.pill.blue { background: var(--info-soft); color: var(--info); }
.pill.violet { background: var(--brand-soft); color: var(--brand); }
.pill.plain::before { display: none; }

.txt-red { color: var(--neg); }
/* Übermenge im Prep-Center: ein Fehler, aber kein Verlust — deshalb Warn- statt Rotton. */
.txt-amber { color: var(--warn); }
/* Kompaktes Auswahlfeld in Tabellenzellen (Bearbeitungsstand je Abweichung). */
select.input.sm { padding: 5px 26px 5px 8px; font-size: 12.5px; background-position: right 7px center; }
.txt-pos { color: var(--pos); }
.sec-subtitle { font-size: 15px; font-weight: 700; color: var(--text); }
.pnl-card { max-width: 640px; }
.pnl-tbl td { padding: 9px 14px; }
.pnl-tbl td.num { font-variant-numeric: tabular-nums; font-weight: 600; }
.pnl-tbl tr.pnl-total td { border-top: 1px solid var(--border); font-weight: 700; }
.pnl-tbl tr.pnl-result td { border-top: 2px solid var(--border); font-size: 15px; font-weight: 800; }
tr.row-alert > td { background: var(--neg-soft); }
tr.row-alert:hover > td { background: var(--neg-soft); }

.badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: var(--r-pill);
  font-size: 12px; font-weight: 700; border: 1px solid transparent;
}
.badge.ok { background: var(--pos-soft); color: var(--pos); }
.badge.off { background: var(--warn-soft); color: var(--warn); }
.badge .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }

.flag-chip { font-size: 12px; font-weight: 700; display: inline-flex; align-items: center; gap: 5px; }

/* =========================================================================
   CHARTS (inline SVG)
   ========================================================================= */
.chart-box { width: 100%; }
.chart-svg { width: 100%; height: auto; display: block; overflow: visible; }
.chart-legend { display: flex; gap: 18px; margin-top: 12px; flex-wrap: wrap; }
.leg { display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--text-soft); font-weight: 500; }
.leg .swatch { width: 11px; height: 11px; border-radius: 3px; }
.chart-tip {
  position: fixed; pointer-events: none; z-index: 100; background: var(--sidebar); color: #fff;
  padding: 9px 12px; border-radius: 10px; font-size: 12px; box-shadow: var(--sh-lg);
  opacity: 0; transform: translateY(4px); transition: opacity .12s, transform .12s; min-width: 130px;
}
.chart-tip.show { opacity: 1; transform: none; }
.chart-tip b { display: block; font-size: 11px; color: var(--text-invert-soft); font-weight: 600; margin-bottom: 5px; }
.chart-tip .row { display: flex; justify-content: space-between; gap: 16px; line-height: 1.7; }
.chart-tip .row span { color: var(--text-invert-soft); }
.chart-tip .row b { display: inline; color: #fff; font-weight: 700; margin: 0; }

.bar-list { display: flex; flex-direction: column; gap: 15px; }
.bar-item .bar-top { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 6px; font-size: 13px; }
.bar-item .bar-top b { font-weight: 700; }
.bar-track { height: 9px; border-radius: var(--r-pill); background: var(--surface-2); overflow: hidden; }
.bar-fill { height: 100%; border-radius: var(--r-pill); transition: width .5s cubic-bezier(.2,.7,.2,1); }

/* =========================================================================
   FORMS / layout helpers
   ========================================================================= */
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.form-grid .full { grid-column: 1 / -1; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.divider { height: 1px; background: var(--border); margin: 20px 0; border: none; }

/* items editor (prep announce) */
.items-editor { display: flex; flex-direction: column; gap: 10px; }
.item-row {
  display: grid; grid-template-columns: 1fr 1fr 1.5fr 70px 1fr 34px; gap: 8px; align-items: center;
}
.item-row .input { padding: 7px 10px; }
.item-remove {
  width: 34px; height: 34px; border-radius: 8px; border: 1px solid var(--border-strong); background: var(--surface);
  color: var(--text-mut); display: flex; align-items: center; justify-content: center; transition: all .14s;
}
.item-remove:hover { border-color: var(--neg); color: var(--neg); }
.item-remove svg { width: 15px; height: 15px; }

/* producttype picklist */
.pt-search { position: relative; }
.pt-list {
  margin-top: 8px; border: 1px solid var(--border); border-radius: var(--r); overflow: hidden;
  max-height: 220px; overflow-y: auto; background: var(--surface); box-shadow: var(--sh);
}
.pt-opt { padding: 9px 13px; cursor: pointer; border-bottom: 1px solid var(--border); transition: background .12s; }
.pt-opt:last-child { border-bottom: none; }
.pt-opt:hover { background: var(--brand-soft); }
.pt-opt b { font-weight: 600; }
.pt-opt .pt-name { font-family: var(--mono); font-size: 11.5px; color: var(--text-mut); }
.pt-selected { display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: var(--r-sm); background: var(--brand-soft); color: var(--brand); font-weight: 600; font-size: 13px; }
.pt-selected .x { cursor: pointer; opacity: .7; }
.pt-selected .x:hover { opacity: 1; }

/* listing result cards */
.result-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px,1fr)); gap: 14px; }
.result-card { border: 1px solid var(--border); border-radius: var(--r); padding: 15px; background: var(--surface-2); }
.result-card.ok { border-left: 3px solid var(--pos); }
.result-card.bad { border-left: 3px solid var(--neg); }
.result-card .rc-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.result-card .rc-mp { font-weight: 700; font-size: 14px; display: flex; align-items: center; gap: 7px; }
.result-card .issue { font-size: 12.5px; color: var(--neg); padding: 6px 0; border-top: 1px dashed var(--border); }
.result-card .rc-sub { font-size: 11.5px; color: var(--text-mut); font-family: var(--mono); word-break: break-all; }

/* =========================================================================
   EU-LISTING · ASIN arbitrage flow
   ========================================================================= */
.pricing-bar { padding: 14px 18px; }
.pricing-bar .pricing-label { font-size: 13px; font-weight: 700; color: var(--text-soft); }

.lc-card { padding: 18px; }
.lc-card.bad { border-left: 3px solid var(--neg); }

.lc-head { display: flex; align-items: flex-start; gap: 14px; }
.lc-thumb {
  width: 84px; height: 84px; flex: 0 0 84px; border-radius: var(--r);
  object-fit: cover; background: var(--surface-2); border: 1px solid var(--border);
}
.lc-thumb.ph { display: flex; align-items: center; justify-content: center; color: var(--text-mut); }
.lc-thumb.ph svg { width: 30px; height: 30px; }
.lc-info { min-width: 0; flex: 1; padding-top: 2px; }
.lc-title {
  font-weight: 700; font-size: 15px; line-height: 1.3; letter-spacing: -.2px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.lc-meta { margin-top: 5px; font-size: 12px; color: var(--text-mut); display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.lc-meta .mono { font-size: 11.5px; }

.lc-error {
  display: flex; align-items: center; gap: 12px; margin-top: 16px; padding: 13px 15px;
  border-radius: var(--r); background: var(--neg-soft); color: var(--neg);
}
.lc-error svg { width: 22px; height: 22px; flex: 0 0 22px; }
.lc-error b { display: block; font-size: 13.5px; }
.lc-error span { font-size: 12.5px; opacity: .85; }

.lc-grid { display: grid; grid-template-columns: 1.5fr 1fr; gap: 20px; margin-top: 16px; align-items: start; }

.mp-table { border: 1px solid var(--border); border-radius: var(--r); overflow: hidden; }
.mp-row {
  display: grid; grid-template-columns: 1.1fr .9fr 1fr; gap: 10px; align-items: center;
  padding: 9px 13px; border-bottom: 1px solid var(--border);
}
.mp-row:last-child { border-bottom: none; }
.mp-row.mp-head {
  background: var(--surface-2); font-size: 10.5px; font-weight: 700; letter-spacing: .5px;
  text-transform: uppercase; color: var(--text-mut);
}
.mp-name { font-weight: 700; font-size: 13px; display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.mp-bb { font-variant-numeric: tabular-nums; font-weight: 600; color: var(--text-soft); font-size: 13px; }
.mp-price { padding: 7px 10px; text-align: right; font-variant-numeric: tabular-nums; }

.lc-side { display: flex; flex-direction: column; gap: 12px; }
.lc-side .lc-submit { margin-top: 4px; }

.lc-results:empty { display: none; }
.lc-results { margin-top: 16px; padding-top: 14px; border-top: 1px dashed var(--border); }
.lc-res-head { font-size: 12px; font-weight: 700; color: var(--text-soft); text-transform: uppercase; letter-spacing: .4px; margin-bottom: 10px; }
.lc-res-list { display: flex; flex-direction: column; gap: 8px; }
.lc-res-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.lc-res-row .mp-name { min-width: 130px; }
.lc-res-row .issue { width: 100%; font-size: 12.5px; color: var(--neg); }
.lc-freischalt {
  width: 100%; display: flex; align-items: flex-start; gap: 11px; margin-top: 4px;
  padding: 12px 14px; border-radius: var(--r); background: var(--warn-soft); color: var(--warn);
}
.lc-freischalt svg { width: 20px; height: 20px; flex: 0 0 20px; margin-top: 1px; }
.lc-freischalt b { display: block; font-size: 13.5px; }
.lc-freischalt span { font-size: 12.5px; opacity: .9; }

/* =========================================================================
   SETTINGS · grouped sections
   ========================================================================= */
.settings-group { margin-bottom: 22px; }
.settings-group:last-of-type { margin-bottom: 0; }
.settings-group-head {
  font-size: 11.5px; font-weight: 700; letter-spacing: .6px; text-transform: uppercase;
  color: var(--text-mut); padding-bottom: 10px; margin-bottom: 14px; border-bottom: 1px solid var(--border);
}

/* =========================================================================
   SKELETON / EMPTY / TOAST
   ========================================================================= */
.skel { background: linear-gradient(100deg, var(--surface-2) 30%, var(--border) 50%, var(--surface-2) 70%);
  background-size: 220% 100%; animation: shimmer 1.3s infinite linear; border-radius: 7px; }
@keyframes shimmer { from { background-position: 220% 0; } to { background-position: -220% 0; } }
.skel-line { height: 12px; margin: 7px 0; }
.skel-kpi { height: 108px; border-radius: var(--r-lg); }
.skel-block { height: 260px; border-radius: var(--r-lg); }

.empty { text-align: center; padding: 46px 20px; color: var(--text-mut); }
.empty .ic {
  width: 56px; height: 56px; border-radius: 16px; background: var(--brand-soft); color: var(--brand);
  display: flex; align-items: center; justify-content: center; margin: 0 auto 14px;
}
.empty .ic svg { width: 26px; height: 26px; }
.empty h4 { margin: 0 0 5px; color: var(--text); font-size: 15px; }
.empty p { margin: 0; font-size: 13px; }

.toast-wrap { position: fixed; bottom: 22px; right: 22px; z-index: 200; display: flex; flex-direction: column; gap: 10px; }
.toast {
  display: flex; align-items: flex-start; gap: 11px; padding: 13px 16px; border-radius: var(--r);
  background: var(--surface); box-shadow: var(--sh-lg); border: 1px solid var(--border);
  min-width: 280px; max-width: 380px; animation: toastIn .3s cubic-bezier(.2,.8,.2,1);
  border-left: 4px solid var(--brand);
}
.toast.ok { border-left-color: var(--pos); }
.toast.err { border-left-color: var(--neg); }
.toast.info { border-left-color: var(--info); }
.toast .t-ic { flex: 0 0 20px; margin-top: 1px; }
.toast .t-ic svg { width: 20px; height: 20px; }
.toast.ok .t-ic { color: var(--pos); }
.toast.err .t-ic { color: var(--neg); }
.toast.info .t-ic { color: var(--info); }
.toast .t-body { display: flex; flex-direction: column; }
.toast .t-body b { display: block; font-size: 13.5px; margin-bottom: 1px; }
.toast .t-body span { font-size: 12.5px; color: var(--text-soft); }
.toast .t-action { align-self: flex-start; }
.toast .t-close { margin-left: auto; background: none; border: none; color: var(--text-mut); font-size: 16px; line-height: 1; padding: 2px; }
@keyframes toastIn { from { opacity: 0; transform: translateX(30px); } to { opacity: 1; transform: none; } }
.toast.out { animation: toastOut .25s forwards; }
@keyframes toastOut { to { opacity: 0; transform: translateX(30px); } }

.spinner {
  width: 15px; height: 15px; border: 2px solid rgba(255,255,255,.4); border-top-color: #fff;
  border-radius: 50%; animation: spin .7s linear infinite; display: inline-block;
}
.btn:not(.primary) .spinner { border-color: var(--border-strong); border-top-color: var(--brand); }
@keyframes spin { to { transform: rotate(360deg); } }

/* =========================================================================
   LOGIN
   ========================================================================= */
.login-body {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(1200px 600px at 100% -10%, #eef0ff 0%, transparent 55%),
              radial-gradient(900px 500px at -10% 110%, #f3e8ff 0%, transparent 50%),
              var(--bg);
  padding: 24px;
}
.login-card {
  width: 100%; max-width: 400px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-xl); box-shadow: var(--sh-lg); padding: 34px 32px; position: relative; overflow: hidden;
}
.login-card::before { content:""; position: absolute; top: 0; left: 0; right: 0; height: 4px;
  background: linear-gradient(90deg, #7c7ff5, #6366f1, #a855f7); }
.login-brand { display: flex; flex-direction: column; align-items: center; gap: 12px; margin-bottom: 26px; }
.login-brand .brand-badge { width: 54px; height: 54px; flex-basis: 54px; font-size: 24px; border-radius: 15px; }
.login-brand h1 { margin: 4px 0 0; font-size: 22px; font-weight: 800; letter-spacing: -.4px; }
.login-brand p { margin: 0; color: var(--text-mut); font-size: 13px; }
.login-form { display: flex; flex-direction: column; gap: 15px; }
.login-form .btn.primary { padding: 12px; font-size: 14.5px; margin-top: 4px; }
.login-err {
  display: none; align-items: center; gap: 8px; padding: 10px 13px; border-radius: var(--r-sm);
  background: var(--neg-soft); color: var(--neg); font-size: 13px; font-weight: 500;
}
.login-err.show { display: flex; }
.login-err svg { width: 16px; height: 16px; flex: 0 0 16px; }
.login-switch { text-align: center; margin-top: 16px; font-size: 13px; color: var(--text-soft); }
.login-switch a { font-weight: 700; margin-left: 4px; }
.login-switch a:hover { text-decoration: underline; }
.login-foot { text-align: center; margin-top: 20px; color: var(--text-mut); font-size: 12px; }

/* =========================================================================
   ONBOARDING BANNER
   ========================================================================= */
.onboard-banner {
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
  padding: 20px 24px; margin-bottom: 20px; border-radius: var(--r-lg);
  background: linear-gradient(135deg, #6b6ef4 0%, #4f46e5 100%);
  color: #fff; box-shadow: var(--sh-brand); position: relative; overflow: hidden;
}
.onboard-banner .ob-ic {
  width: 46px; height: 46px; border-radius: 13px; flex: 0 0 46px;
  background: rgba(255,255,255,.18); display: flex; align-items: center; justify-content: center;
}
.onboard-banner .ob-ic svg { width: 24px; height: 24px; }
.onboard-banner .ob-body { flex: 1; min-width: 220px; }
.onboard-banner .ob-body b { font-size: 15.5px; font-weight: 800; display: block; letter-spacing: -.2px; }
.onboard-banner .ob-body span { font-size: 13px; color: rgba(255,255,255,.85); }
/* Feste dunkle Schrift: der Knopf ist in beiden Themes weiss. Mit var(--brand-700)
   stand im Dark Mode #a5b4fc auf Weiss (Kontrast ~1,9:1). #3730a3 auf #fff ~10:1. */
.onboard-banner .btn {
  background: #fff; color: #3730a3; border-color: transparent; box-shadow: var(--sh-sm);
}
.onboard-banner .btn:hover { color: #3730a3; filter: brightness(.97); box-shadow: var(--sh); }

/* =========================================================================
   AMAZON ACCOUNTS PANEL
   ========================================================================= */
.acct-list { display: flex; flex-direction: column; gap: 12px; }
.acct-card {
  display: flex; align-items: flex-start; gap: 14px; padding: 15px 16px;
  border: 1px solid var(--border); border-radius: var(--r); background: var(--surface-2);
}
.acct-card .acct-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.acct-head { display: flex; align-items: center; gap: 9px; }
.acct-head b { font-size: 14.5px; font-weight: 700; }
.acct-spid { color: var(--text-soft); word-break: break-all; }
.acct-mps { display: flex; flex-wrap: wrap; gap: 6px; }
.acct-card .btn.danger { flex: 0 0 auto; }

/* =========================================================================
   RESPONSIVE
   ========================================================================= */
@media (max-width: 1240px) {
  .kpi-row { grid-template-columns: repeat(3, 1fr); }
  .grid.charts { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 1024px) {
  .kpi-row { grid-template-columns: repeat(2, 1fr); }
  .form-grid, .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .lc-grid { grid-template-columns: 1fr; }
  .item-row { grid-template-columns: 1fr 1fr; }
  .content { padding: 18px; }
  .topbar { padding: 0 16px; }
}
/* Tablet: Icon-Rail-Sidebar (nur 641–1024px; Handy nutzt den Drawer) */
@media (min-width: 641px) and (max-width: 1024px) {
  :root { --sidebar-w: 72px; }
  .brand-word, .nav-item span.lbl, .nav-label, .user-meta, .nav-badge { display: none; }
  .sidebar-head, .nav-item { justify-content: center; }
  .nav-item { padding: 11px; }
  .user-card { justify-content: center; padding: 8px; }
}
/* ===== HANDY: Off-Canvas-Drawer + Hamburger (≤640px) ===== */
@media (max-width: 640px) {
  /* Handy: nur noch eine Spalte. Die Sidebar ist hier position:fixed und
     damit ausserhalb des Grid-Flows, braucht also keine eigene Area. */
  .app { grid-template-columns: 1fr; grid-template-areas: "main"; }
  .sidebar {
    position: fixed; top: 0; left: 0; bottom: 0; width: 264px; max-width: 84vw;
    transform: translateX(-100%);
    transition: transform .28s cubic-bezier(.4, 0, .2, 1);
    z-index: 1300; box-shadow: 8px 0 46px rgba(6, 8, 20, .42);
  }
  .app.nav-open .sidebar { transform: translateX(0); }
  .nav-backdrop {
    display: block;
    position: fixed; inset: 0; background: rgba(8, 10, 22, .5);
    opacity: 0; visibility: hidden; transition: opacity .28s; z-index: 1200;
  }
  .app.nav-open .nav-backdrop { opacity: 1; visibility: visible; }
  .nav-toggle { display: inline-flex; order: 0; }
  /* Topbar bricht auf dem Handy in 2 Zeilen: Zeile 1 = Hamburger + Titel + Theme,
     Zeile 2 = seiten-spezifische Tools (voll breit, horizontal scrollbar). */
  .topbar {
    flex-wrap: wrap; height: auto; min-height: var(--topbar-h);
    align-items: center; row-gap: 8px; gap: 8px; padding: 9px 12px;
  }
  .topbar h1 { order: 1; flex: 1 1 auto; min-width: 0; font-size: 16px;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .topbar .sub, .topbar-spacer { display: none; }
  #themeBtn { order: 2; flex: 0 0 auto; }
  .topbar-tools {
    order: 3; flex-basis: 100%; width: 100%; gap: 6px; flex-wrap: nowrap;
    overflow-x: auto; -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .topbar-tools::-webkit-scrollbar { display: none; }
  .topbar-tools:empty { display: none; }   /* keine leere 2. Zeile wenn Seite keine Tools hat */
  .content { padding: 15px 13px calc(env(safe-area-inset-bottom, 0px) + 24px); }
  /* Kennzahlen zweispaltig und kompakt: vorher stand jede der 11 KPI-Karten
     einzeln untereinander (sehr viel Scrollen). */
  .kpi-row { grid-template-columns: 1fr 1fr; gap: 10px; }
  .kpi { padding: 12px 13px; }
  .kpi-top { margin-bottom: 6px; gap: 6px; }
  .kpi-icon { width: 24px; height: 24px; }
  .kpi-label { font-size: 11px; line-height: 1.25; }
  .kpi-value, .kpi.hero .kpi-value { font-size: 18px; letter-spacing: -.3px; word-break: break-word; }
  .kpi .delta, .kpi .kpi-delta { font-size: 10.5px; }
  .p-grid { grid-template-columns: 1fr; }
  .section-head h2 { font-size: 16px; }
  .section-head { gap: 10px; }
  body { overflow-x: hidden; }
  /* Inline gesetzte Raster (Cashflow 1.4fr/1fr, Formulare 1fr 1fr, Bewertungen …)
     schlugen die Klassen-Regeln — auf dem Handy ragte z. B. die Wochen-Prognose
     rechts aus dem Bild. Hier gewinnt die Handy-Regel. */
  .content .grid[style*="grid-template-columns"],
  .content [style*="grid-template-columns:1fr 1fr"],
  .content [style*="grid-template-columns: 1fr 1fr"],
  .content [style*="grid-template-columns:1.4fr"] { grid-template-columns: 1fr !important; }
  .content .card { max-width: 100%; min-width: 0; }
  /* Zeitraum-/Filter-Leisten seitlich wischbar statt abgeschnitten */
  .seg { max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
  .seg::-webkit-scrollbar { display: none; }
  .seg > * { flex: 0 0 auto; }
  /* breite Tabellen: im Karten-Rahmen seitlich scrollen */
  .table-wrap, .tbl-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .tour-pop { left: 12px !important; right: 12px; width: auto; transform: none !important; }
}

/* Einkäufe — ASIN-hinzufügen-Formular */
.p-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 12px; }
.p-grid label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--text-soft); }
.p-grid input { padding: 8px 10px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface); color: var(--text); }
@media (max-width: 900px){ .p-grid { grid-template-columns: 1fr 1fr; } }
/* EK-Feld + Brutto/Netto-Umschalter direkt daneben (ein Feld, zwei Teile) */
.p-ek { display: flex; gap: 6px; align-items: stretch; }
.p-ek input { flex: 1; min-width: 0; }
.p-grid select {
  flex: 0 0 84px; padding: 8px 24px 8px 9px; border: 1px solid var(--border);
  border-radius: 9px; background: var(--surface); color: var(--text);
  font-weight: 600; font-size: 12.5px; appearance: none; -webkit-appearance: none; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238a8ea8' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 7px center;
}
.p-grid select:focus { outline: none; border-color: var(--brand); }
/* Knopfzeile im Schnell-hinzufügen: Speichern + Prep-Schalter nebeneinander */
.p-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 12px; }
.p-actions .btn[data-on="0"] { color: var(--text-soft); border-style: dashed; }

/* Einstellungen — ArbitrageOne-Stil Sektionen */
.settings-group-head { display: flex; align-items: center; gap: 9px; }
.sg-ic { display: inline-flex; width: 28px; height: 28px; align-items: center; justify-content: center; border-radius: 9px; background: var(--brand-soft); color: var(--brand-700); flex: 0 0 auto; }
.sg-ic svg { width: 16px; height: 16px; }
.settings-group-desc { margin: 4px 0 14px; font-size: 12.5px; color: var(--text-soft); line-height: 1.5; }

/* Onboarding-Tour */
.tour-overlay { position: fixed; inset: 0; background: rgba(15,17,32,.72); z-index: 100000; display: none; }
.tour-spot { position: fixed; z-index: 100001; border-radius: 12px; box-shadow: 0 0 0 9999px rgba(15,17,32,.72); border: 2px solid #8b5cf6; pointer-events: none; transition: top .25s, left .25s, width .25s, height .25s; display: none; }
.tour-pop { position: fixed; z-index: 100002; width: 340px; max-width: calc(100vw - 24px); background: #fff; color: #1e2230; border-radius: 16px; padding: 18px 20px; box-shadow: 0 20px 55px rgba(20,22,40,.38); display: none; font: 14px/1.5 -apple-system, system-ui, sans-serif; }
.tour-pop .tour-step { font-size: 11px; font-weight: 700; letter-spacing: .5px; color: #8b5cf6; text-transform: uppercase; }
.tour-pop b { display: block; font-size: 16px; margin: 4px 0 6px; }
.tour-pop p { color: #5a6072; margin: 0 0 14px; }
.tour-nav { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.tour-right { display: flex; gap: 8px; }
.tour-skip { background: none; border: none; color: #9096ab; cursor: pointer; font-size: 13px; }
.tour-skip:hover { color: #5a6072; }
:root[data-theme="dark"] .tour-pop { background: #1b1e30; color: #e7e9f2; }
:root[data-theme="dark"] .tour-pop p { color: #a0a6bd; }

/* "neu"-Badge in der Navigation (Browser-Extension) — schmaler als die
   Zähler-Badges, weil es Text ist und keine Zahl. */
.nav-item .nav-badge.new {
  background: var(--ok, #059669);
  text-transform: lowercase;
  letter-spacing: .02em;
  padding: 1px 8px;
}

/* Beschaffungspreise: Der Sprung nach Seller Central ist die eigentliche Handlung
   der Seite — die Spalte bleibt deshalb rechts stehen, auch wenn die Tabelle
   breiter ist als die Karte. Der Hintergrund muss je Zeilenzustand mitgezogen
   werden, sonst scheint beim Querscrollen der Inhalt darunter durch. */
#sec-beschaffung table.tbl th.sticky-act,
#sec-beschaffung table.tbl td.sticky-act {
  position: sticky; right: 0; z-index: 1;
  background: var(--card);
  /* Kein Schatten: die Tabelle passt jetzt ohne Querscrollen ins Bild, da
     wirkte der Schatten wie ein versehentlicher Trenner. Die Fixierung
     bleibt als Schutz fuer schmale Fenster. */
}
#sec-beschaffung table.tbl thead th.sticky-act { z-index: 3; background: var(--surface-2); }
#sec-beschaffung table.tbl tbody tr:nth-child(even) td.sticky-act { background: var(--surface-2); }
#sec-beschaffung table.tbl tbody tr:hover td.sticky-act { background: var(--brand-softer); }

/* Beschaffungspreise: sechs Spalten muessen ohne Querscrollen ins Bild passen —
   Verlust & Erstattung ist der halbe Zweck der Seite und darf nicht rechts
   herausfallen. Deshalb hier engere Zellabstaende als in den anderen Tabellen. */
#sec-beschaffung table.tbl thead th,
#sec-beschaffung table.tbl tbody td { padding-left: 9px; padding-right: 9px; }
#sec-beschaffung table.tbl .prod { min-width: 0; gap: 9px; }

/* Lange, unbrechbare Titel-Ketten (z.B. „DSLR/Kamera/Fotografen/…") sprengten
   die Produktspalte: der innere Flex-Container hat min-width:auto und kann
   nicht unter seine min-content-Breite schrumpfen, der Titel lief dadurch in
   die FNSKU-Spalte. Nur hier noetig, weil diese Tabelle eng kalkuliert ist. */
#sec-beschaffung table.tbl .prod > div { min-width: 0; }
#sec-beschaffung table.tbl .prod-title,
#sec-beschaffung table.tbl .prod-meta { overflow-wrap: anywhere; }


/* EU-Preis-Panel in der Produkttabelle. Die Tabelle scrollt waagerecht; das
   Panel soll das NICHT mitmachen, sonst steht die Haelfte der Marktplaetze
   ausserhalb des Bildes. Auf schmalen Schirmen faellt der Sidebar-Abzug weg. */
.eu-row td { background: var(--surface); }
@media (max-width: 900px) {
  .eu-wrap { max-width: calc(100vw - 32px) !important; }
}
.eu-market a { color: var(--brand); }
.eu-market a:hover { text-decoration: underline !important; }

/* Inline-Icons in Karten: ohne feste Groesse fuellen SVGs die ganze Breite (23.09.2026: Prep-Webhook-Karte) */
.ic18 { display: inline-flex; }
.ic18 svg { width: 18px; height: 18px; flex: 0 0 18px; }
.nav-sep { height: 1px; background: rgba(255,255,255,.07); margin: 8px 12px 6px; }

/* ---------- Sprachumschalter DE/EN (i18n.js) ------------------------------ */
.topbar .lang-btn { margin-left: 4px; width: auto; min-width: 32px; padding: 0 8px; font-size: 12px; font-weight: 800; letter-spacing: .4px; color: var(--text-soft); border: 1px solid var(--border); }
.topbar .lang-btn:hover { color: var(--text); background: rgba(127,127,127,.12); }
@media (max-width: 640px) {
  .topbar .lang-btn { order: 2; flex: 0 0 auto; margin-left: 0; }
}

/* =========================================================================
   REDESIGN 11.10.2026 · Feinschliff-Schicht
   Bewusst als Schicht am Ende statt Umbau der Regeln oben: app.js erzeugt
   das Markup, alle Klassennamen bleiben, nur Tokens und Oberflaechen
   aendern sich. Gleiche Sprache wie die oeffentlichen Seiten (landing.css):
   Navy-Neutrals, ein Indigo-Akzent, Inter selbst gehostet, tabellarische
   Ziffern, Haarlinien statt schwerer Schatten.
   ========================================================================= */
@font-face{
  font-family:'Inter';font-style:normal;font-weight:400 800;font-display:swap;
  src:url(inter-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:'Inter';font-style:normal;font-weight:400 800;font-display:swap;
  src:url(inter-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;
}
:root{
  --brand:#4f46e5; --brand-600:#4338ca; --brand-700:#3730a3;
  --brand-soft:#eef0fe; --brand-softer:#f6f7ff;
  --pos:#0f8a5f; --pos-soft:#ddf5ea;
  --neg:#c4320a; --neg-soft:#fdeceb;
  --bg:#f6f8fb; --surface:#ffffff; --surface-2:#f6f8fb; --card:#ffffff;
  --sidebar:#0c1a2e; --sidebar-2:#13243c; --sidebar-hover:rgba(255,255,255,.06); --sidebar-active:#4f46e5;
  --text:#0f1c30; --text-soft:#44546b; --text-mut:#5f6e84;
  --text-invert:#e9eef6; --text-invert-soft:#9fb0c6;
  --border:#e2e8f0; --border-strong:#cbd5e1;
  --r-sm:8px; --r:10px; --r-lg:14px; --r-xl:14px;
  --sh-sm:0 1px 2px rgba(12,26,46,.05);
  --sh:0 1px 2px rgba(12,26,46,.05),0 1px 1px rgba(12,26,46,.03);
  --sh-md:0 6px 18px -6px rgba(12,26,46,.14),0 2px 4px rgba(12,26,46,.04);
  --sh-lg:0 24px 48px -20px rgba(12,26,46,.28);
  --sh-brand:0 6px 16px -6px rgba(79,70,229,.5);
  --font:'Inter',-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif;
  --mono:ui-monospace,"SF Mono",SFMono-Regular,Menlo,Consolas,monospace;
}
[data-theme="dark"]{
  --bg:#0a1322; --surface:#101c2e; --surface-2:#0d1828; --card:#101c2e;
  --sidebar:#070f1b; --sidebar-2:#0d1828; --sidebar-hover:rgba(255,255,255,.05);
  --text:#e8eef7; --text-soft:#a7b5c8; --text-mut:#7d8ca2;
  --border:#1d2b40; --border-strong:#2a3a52;
  --brand:#7c83f5; --brand-600:#6b72f0; --brand-700:#a5b4fc;
  --brand-soft:#1a2142; --brand-softer:#131c34;
  --pos:#34c38f; --pos-soft:#0f2e24; --neg:#f87171; --neg-soft:#3a1717;
  --sh:0 1px 2px rgba(0,0,0,.4); --sh-md:0 8px 24px rgba(0,0,0,.45); --sh-lg:0 20px 48px rgba(0,0,0,.55);
}
body{font-feature-settings:'cv11','ss03'}
:focus-visible{outline:2px solid var(--brand);outline-offset:2px}

/* Seitenleiste: ruhiger, aktive Zeile als helle Flaeche statt Verlauf */
.sidebar{border-right:1px solid rgba(255,255,255,.06)}
.brand-word b{font-weight:700;letter-spacing:-.01em}
.brand-word span{letter-spacing:.04em;text-transform:none;font-size:11px}
.nav-label{font-size:11.5px;letter-spacing:0;text-transform:none;font-weight:600;opacity:1;color:#6f819b;padding:12px 12px 4px}
.nav-item{border-radius:7px;padding:6px 10px;color:#b4c2d4;font-size:13.5px}
.nav-item:hover{background:var(--sidebar-hover);color:#fff}
.nav-item.active{background:rgba(255,255,255,.09);box-shadow:inset 2px 0 0 #a5b4fc;color:#fff}
.nav-item svg{stroke-width:1.75;opacity:.85}
.nav-item.active svg{opacity:1}
.nav-item .nav-badge{background:rgba(165,180,252,.18);color:#c7d0fe;font-weight:600;font-variant-numeric:tabular-nums}
.nav-item .nav-badge.new{background:rgba(52,195,143,.18);color:#7ee2b8}
.user-avatar{background:#26385a;border-radius:9px}
.user-card{background:rgba(255,255,255,.05)}

/* Kopfzeile: Icon-Knoepfe sind auf hellem Grund sichtbar */
.topbar{background:color-mix(in srgb,var(--surface) 88%,transparent)}
.topbar h1{font-size:18px;font-weight:650;letter-spacing:-.02em}
.topbar .icon-btn-ghost{color:var(--text-soft)}
.topbar .icon-btn-ghost:hover{background:var(--surface-2);color:var(--text)}
.topbar .lang-btn{font-weight:600;letter-spacing:.02em}

/* Knoepfe: kein Verlauf, ein Akzent */
.btn{border-radius:var(--r-sm);transition:background-color .15s,border-color .15s,color .15s,box-shadow .15s,transform .15s}
.btn:hover{border-color:var(--text-mut);color:var(--text);box-shadow:none}
.btn:active{transform:translateY(1px)}
.btn.primary{background:var(--brand);border-color:var(--brand);box-shadow:0 1px 0 rgba(255,255,255,.15) inset,var(--sh-brand)}
.btn.primary:hover{background:var(--brand-600);border-color:var(--brand-600);filter:none;box-shadow:0 1px 0 rgba(255,255,255,.15) inset,var(--sh-brand)}
[data-theme="dark"] .btn.primary{background:#5b5ff0;border-color:#5b5ff0}
.btn.ghost:hover{background:var(--surface-2);color:var(--text)}
.seg{border-radius:var(--r-sm)}
.seg button{font-variant-numeric:tabular-nums}
.seg button.active{color:var(--text)}
.input:focus,textarea.input:focus,select.input:focus,.cogs-input{box-shadow:0 0 0 3px rgba(79,70,229,.18)}

/* Karten: Haarlinie, kaum Schatten */
.card{border-radius:var(--r-lg);box-shadow:var(--sh)}
.card-head h3{font-size:15px;font-weight:650;letter-spacing:-.01em}

/* Kennzahlen: Zahl im Mittelpunkt, tabellarische Ziffern */
.kpi{border-radius:var(--r-lg);box-shadow:var(--sh);padding:16px 18px}
.kpi:hover{transform:none;box-shadow:var(--sh);border-color:var(--border-strong)}
.kpi-icon{width:26px;height:26px;border-radius:7px;background:var(--surface-2);color:var(--text-mut);border:1px solid var(--border)}
.kpi-icon svg{width:14px;height:14px}
.kpi-label{font-weight:500;color:var(--text-mut);font-size:12.5px}
.kpi-value{font-weight:650;letter-spacing:-.03em;font-variant-numeric:tabular-nums}
.kpi.hero{background:var(--sidebar);color:#fff;box-shadow:var(--sh-md);
  background-image:radial-gradient(280px 140px at 100% 0%,rgba(99,102,241,.45),transparent 70%)}
.kpi.hero .kpi-icon{background:rgba(255,255,255,.1);border-color:rgba(255,255,255,.12);color:#c7d0fe}
[data-theme="dark"] .kpi.hero{background-color:#16244a}
.chip{font-weight:600;font-variant-numeric:tabular-nums}

/* Tabellen: Kopf in normaler Schreibweise, Zebra raus, Haarlinien */
table.tbl thead th{text-transform:none;letter-spacing:0;font-size:12.5px;font-weight:600;color:var(--text-mut);background:var(--surface)}
table.tbl tbody tr:nth-child(even){background:transparent}
table.tbl tbody tr:hover{background:var(--surface-2)}
.tbl .prod-meta{font-size:11.5px;letter-spacing:0}
#sec-beschaffung table.tbl thead th.sticky-act{background:var(--surface)}
#sec-beschaffung table.tbl tbody tr:nth-child(even) td.sticky-act{background:var(--card)}
#sec-beschaffung table.tbl tbody tr:hover td.sticky-act{background:var(--surface-2)}
.pill{font-weight:600;letter-spacing:0;font-variant-numeric:tabular-nums}
.pnl-tbl tr.pnl-result td{font-weight:700}
.badge{font-weight:600}

/* Leere Zustaende und Toasts */
.empty{padding:48px 20px}
.toast{border-radius:var(--r)}

/* Onboarding-Tour in Markenfarbe statt Violett */
.tour-spot{border-color:var(--brand)}
.tour-pop{border-radius:14px}
.tour-pop .tour-step{color:var(--brand);letter-spacing:0;text-transform:none;font-size:12px}

@media (prefers-reduced-motion:reduce){
  .section{animation:none}
  .sidebar{transition:none}
}
@media (max-width:640px){ .app:not(.nav-open) .sidebar{box-shadow:none} }
