/* ==========================================================================
   Partnerprogramm – Design-System
   Markenfarbe kommt aus /brand.css (--brand), alles andere ist hier definiert.
   ========================================================================== */

:root {
  --brand: #4f46e5;
  --brand-contrast: #ffffff;
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-2: #f1f3f6;
  --border: #e3e6eb;
  --border-strong: #cfd4dc;
  --text: #161a22;
  --text-2: #4b5363;
  --text-3: #7b8394;
  --success: #15803d;
  --success-bg: #e8f6ed;
  --warning: #b45309;
  --warning-bg: #fdf3e2;
  --danger: #c2261d;
  --danger-bg: #fdecea;
  --info: #1d5fd1;
  --info-bg: #e8f0fd;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.06);
  --shadow: 0 1px 3px rgba(16, 24, 40, 0.08), 0 1px 2px rgba(16, 24, 40, 0.04);
  --shadow-lg: 0 12px 32px rgba(16, 24, 40, 0.12);
  --radius: 10px;
  --radius-sm: 7px;
  --sidebar: 248px;
  --font: ui-sans-serif, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e1116;
    --surface: #161a21;
    --surface-2: #1d222b;
    --border: #2a303b;
    --border-strong: #3a4250;
    --text: #e8ebf0;
    --text-2: #aeb5c2;
    --text-3: #7f8796;
    --success: #4ade80;
    --success-bg: #12301f;
    --warning: #fbbf24;
    --warning-bg: #33270d;
    --danger: #f87171;
    --danger-bg: #3a1614;
    --info: #7cacf8;
    --info-bg: #142540;
    --shadow-sm: none;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.5);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0e1116;
  --surface: #161a21;
  --surface-2: #1d222b;
  --border: #2a303b;
  --border-strong: #3a4250;
  --text: #e8ebf0;
  --text-2: #aeb5c2;
  --text-3: #7f8796;
  --success: #4ade80;
  --success-bg: #12301f;
  --warning: #fbbf24;
  --warning-bg: #33270d;
  --danger: #f87171;
  --danger-bg: #3a1614;
  --info: #7cacf8;
  --info-bg: #142540;
  --shadow-sm: none;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.5);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; font-weight: 650; letter-spacing: -0.01em; }
h1 { font-size: 22px; }
h2 { font-size: 17px; }
h3 { font-size: 15px; }
p { margin: 0 0 12px; }
code, .mono { font-family: var(--mono); font-size: 12.5px; }
hr { border: 0; border-top: 1px solid var(--border); margin: 20px 0; }
.muted { color: var(--text-2); }
.subtle { color: var(--text-3); font-size: 13px; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- Lizenz-Banner ---------- */
.license-banner {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: center; gap: 12px; flex-wrap: wrap;
  padding: 9px 16px;
  background: var(--danger); color: #fff;
  font-weight: 600; font-size: 13.5px; text-align: center;
}
.license-banner a { color: #fff; text-decoration: underline; }
.license-banner.warn { background: var(--warning); }

/* ---------- App-Layout mit Seitenleiste (Admin) ---------- */
.app {
  display: grid; grid-template-columns: var(--sidebar) 1fr; min-height: 100vh;
  /* Seitenleisten-Hintergrund ueber die volle Seitenhoehe, auch wenn der Inhalt laenger ist */
  background: linear-gradient(90deg, var(--surface) calc(var(--sidebar) - 1px), var(--border) calc(var(--sidebar) - 1px), var(--border) var(--sidebar), var(--bg) var(--sidebar));
}
.sidebar {
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  display: flex; flex-direction: column;
  background: var(--surface); border-right: 1px solid var(--border);
  padding: 18px 12px;
}
.has-banner .sidebar { top: 38px; height: calc(100vh - 38px); }
.sidebar-brand { display: flex; align-items: center; gap: 10px; padding: 2px 8px 18px; color: var(--text); font-weight: 700; }
.sidebar-brand:hover { text-decoration: none; }
.brand-mark {
  width: 30px; height: 30px; border-radius: 8px; flex: none;
  display: grid; place-items: center;
  background: var(--brand); color: var(--brand-contrast); font-weight: 800; font-size: 14px;
}
.brand-mark img { width: 100%; height: 100%; object-fit: contain; border-radius: 8px; background: var(--surface); }
.nav-section { margin: 14px 8px 6px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-3); }
.nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 10px; margin: 1px 0; border-radius: var(--radius-sm);
  color: var(--text-2); font-weight: 520;
}
.nav a:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.nav a.active { background: color-mix(in srgb, var(--brand) 11%, transparent); color: var(--brand); font-weight: 620; }
.nav svg { width: 17px; height: 17px; flex: none; opacity: 0.85; }
.nav .count { margin-left: auto; font-size: 11.5px; font-weight: 700; padding: 1px 7px; border-radius: 99px; background: var(--brand); color: var(--brand-contrast); }
.sidebar-foot { margin-top: auto; padding-top: 14px; border-top: 1px solid var(--border); }
.user-chip { display: flex; align-items: center; gap: 10px; padding: 6px 8px; }
.avatar { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); color: var(--text-2); font-weight: 700; font-size: 12px; flex: none; }
.user-chip .name { font-weight: 600; font-size: 13px; line-height: 1.2; }
.user-chip .role { font-size: 12px; color: var(--text-3); }

.main { min-width: 0; }
.topbar {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 32px; border-bottom: 1px solid var(--border); background: var(--surface);
}
.topbar .spacer { flex: 1; }
.topbar .menu-toggle { display: none; }
.content { padding: 28px 32px 64px; max-width: 1280px; }

.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.page-head p { margin: 6px 0 0; color: var(--text-2); }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.breadcrumb { font-size: 13px; color: var(--text-3); margin-bottom: 6px; }
.breadcrumb a { color: var(--text-3); }

/* ---------- Partner-Portal (Navigation oben) ---------- */
.portal-header { background: var(--surface); border-bottom: 1px solid var(--border); }
.portal-header-inner { max-width: 1120px; margin: 0 auto; padding: 0 24px; display: flex; align-items: center; gap: 24px; height: 60px; }
.portal-header .sidebar-brand { padding: 0; }
.portal-nav { display: flex; gap: 4px; flex: 1; overflow-x: auto; }
.portal-nav a { padding: 7px 12px; border-radius: var(--radius-sm); color: var(--text-2); font-weight: 540; white-space: nowrap; }
.portal-nav a:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.portal-nav a.active { background: color-mix(in srgb, var(--brand) 11%, transparent); color: var(--brand); }
.portal-content { max-width: 1120px; margin: 0 auto; padding: 28px 24px 64px; }

/* ---------- Karten ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
:where(.content, .portal-content, .stack) > .card + .card { margin-top: 16px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.card-head p { margin: 2px 0 0; font-size: 13px; color: var(--text-2); }
.card-body { padding: 20px; }
.card-foot { padding: 14px 20px; border-top: 1px solid var(--border); background: var(--surface-2); border-radius: 0 0 var(--radius) var(--radius); display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-sidebar { grid-template-columns: minmax(0, 1fr) 340px; align-items: start; }
.stack > * + * { margin-top: 16px; }

/* ---------- Kennzahlen ---------- */
.stat { padding: 18px 20px; }
.stat-label { font-size: 13px; color: var(--text-2); font-weight: 550; display: flex; align-items: center; gap: 6px; }
.stat-value { font-size: 26px; font-weight: 700; letter-spacing: -0.02em; margin-top: 6px; font-variant-numeric: tabular-nums; }
.stat-sub { font-size: 12.5px; color: var(--text-3); margin-top: 2px; }
.spark { display: block; width: 100%; height: 36px; margin-top: 10px; }
.spark path.line { fill: none; stroke: var(--brand); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.spark path.area { fill: color-mix(in srgb, var(--brand) 12%, transparent); stroke: none; }

.chart { width: 100%; height: 220px; display: block; }
.chart .bar { fill: var(--brand); }
.chart .bar.alt { fill: color-mix(in srgb, var(--brand) 35%, transparent); }
.chart .grid-line { stroke: var(--border); stroke-width: 1; }
.chart text { fill: var(--text-3); font-size: 11px; font-family: var(--font); }
.legend { display: flex; gap: 16px; font-size: 12.5px; color: var(--text-2); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; background: var(--brand); margin-right: 6px; vertical-align: -1px; }
.legend i.alt { background: color-mix(in srgb, var(--brand) 35%, transparent); }

/* ---------- Tabellen ---------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th { text-align: left; font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-3); padding: 10px 16px; border-bottom: 1px solid var(--border); background: var(--surface-2); white-space: nowrap; }
td { padding: 12px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: color-mix(in srgb, var(--surface-2) 60%, transparent); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
td .primary { font-weight: 600; color: var(--text); }
td .secondary { font-size: 12.5px; color: var(--text-3); }
.row-link { color: inherit; }
.row-link:hover { text-decoration: none; }
.row-link:hover .primary { color: var(--brand); }
.positive { color: var(--success); }
.negative { color: var(--danger); }

.empty { padding: 48px 24px; text-align: center; color: var(--text-2); }
.empty h3 { margin-bottom: 6px; color: var(--text); }
.empty .icon { width: 44px; height: 44px; margin: 0 auto 12px; border-radius: 12px; display: grid; place-items: center; background: var(--surface-2); color: var(--text-3); }

/* ---------- Badges ---------- */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 99px; font-size: 12px; font-weight: 600; white-space: nowrap; background: var(--surface-2); color: var(--text-2); }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.plain::before { display: none; }
.badge.success { background: var(--success-bg); color: var(--success); }
.badge.warning { background: var(--warning-bg); color: var(--warning); }
.badge.danger { background: var(--danger-bg); color: var(--danger); }
.badge.info { background: var(--info-bg); color: var(--info); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 36px; padding: 0 14px; border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text);
  font: inherit; font-weight: 600; font-size: 13.5px; cursor: pointer; white-space: nowrap;
  box-shadow: var(--shadow-sm); transition: background 0.12s, border-color 0.12s;
}
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, a:focus-visible { outline: 2px solid color-mix(in srgb, var(--brand) 55%, transparent); outline-offset: 2px; }
.btn svg { width: 16px; height: 16px; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: var(--brand-contrast); }
.btn-primary:hover { background: color-mix(in srgb, var(--brand) 88%, #000); }
.btn-danger { color: var(--danger); }
.btn-danger:hover { background: var(--danger-bg); border-color: var(--danger); }
.btn-ghost { border-color: transparent; background: transparent; box-shadow: none; color: var(--text-2); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }
.btn-sm { height: 30px; padding: 0 10px; font-size: 12.5px; }
.btn-lg { height: 44px; padding: 0 20px; font-size: 15px; }
.btn-block { width: 100%; }
.btn[disabled], fieldset[disabled] .btn { opacity: 0.5; cursor: not-allowed; }
.inline-form { display: inline; }

/* ---------- Formulare ---------- */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 18px; }
.form-grid .full { grid-column: 1 / -1; }
.field label, .label { display: block; font-weight: 600; font-size: 13px; margin-bottom: 6px; color: var(--text); }
.field .hint { font-size: 12.5px; color: var(--text-3); margin-top: 5px; }
.field .optional { font-weight: 400; color: var(--text-3); }
input[type="text"], input[type="email"], input[type="password"], input[type="url"], input[type="number"], input[type="date"], input[type="search"], select, textarea {
  width: 100%; height: 38px; padding: 0 11px;
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text); font: inherit; font-size: 14px;
  transition: border-color 0.12s, box-shadow 0.12s;
}
textarea { height: auto; min-height: 110px; padding: 9px 11px; resize: vertical; line-height: 1.5; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 18%, transparent); }
input[readonly] { background: var(--surface-2); color: var(--text-2); }
input[type="color"] { width: 46px; height: 38px; padding: 3px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--surface); cursor: pointer; }
.input-group { display: flex; }
.input-group input { border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
.input-group .addon { display: grid; place-items: center; padding: 0 12px; border: 1px solid var(--border-strong); border-left: 0; border-radius: 0 var(--radius-sm) var(--radius-sm) 0; background: var(--surface-2); color: var(--text-2); font-size: 13px; white-space: nowrap; }
.input-group .btn { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; border-left: 0; height: 38px; box-shadow: none; }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.check { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; font-weight: 500; }
.check input { margin-top: 3px; width: 16px; height: 16px; accent-color: var(--brand); flex: none; }
.check .hint { margin-top: 1px; }

/* Auswahlkacheln (Radio/Checkbox als Karte) */
.choices { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }
.choice { position: relative; display: block; cursor: pointer; }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice .box { display: block; height: 100%; padding: 14px 16px; border: 1.5px solid var(--border); border-radius: var(--radius); background: var(--surface); transition: border-color 0.12s, background 0.12s; }
.choice .box strong { display: block; font-size: 14px; margin-bottom: 2px; }
.choice .box span { display: block; font-size: 12.5px; color: var(--text-2); line-height: 1.45; }
.choice:hover .box { border-color: var(--border-strong); }
.choice input:checked + .box { border-color: var(--brand); background: color-mix(in srgb, var(--brand) 6%, var(--surface)); box-shadow: 0 0 0 1px var(--brand); }
.choice input:focus-visible + .box { outline: 2px solid color-mix(in srgb, var(--brand) 55%, transparent); outline-offset: 2px; }
.btn-reset { border: 0; padding: 0; margin: 0; background: none; font: inherit; color: inherit; text-align: left; width: 100%; }
.choice .tag { position: absolute; top: 10px; right: 10px; font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--brand); }

/* ---------- Hinweise ---------- */
.alert { display: flex; gap: 10px; padding: 12px 14px; border-radius: var(--radius-sm); border: 1px solid transparent; font-size: 13.5px; margin-bottom: 16px; }
.alert strong { display: block; }
.alert.success { background: var(--success-bg); color: var(--success); border-color: color-mix(in srgb, var(--success) 25%, transparent); }
.alert.error { background: var(--danger-bg); color: var(--danger); border-color: color-mix(in srgb, var(--danger) 25%, transparent); }
.alert.warning { background: var(--warning-bg); color: var(--warning); border-color: color-mix(in srgb, var(--warning) 25%, transparent); }
.alert.info { background: var(--info-bg); color: var(--info); border-color: color-mix(in srgb, var(--info) 25%, transparent); }
.alert p:last-child { margin-bottom: 0; }

/* ---------- Kopierfeld / Code ---------- */
.copy { display: flex; align-items: stretch; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); overflow: hidden; background: var(--surface-2); }
.copy code, .copy input { flex: 1; min-width: 0; border: 0; background: transparent; padding: 9px 12px; font-family: var(--mono); font-size: 12.5px; color: var(--text); overflow-x: auto; white-space: nowrap; height: auto; }
.copy input:focus { box-shadow: none; }
.copy button { border: 0; border-left: 1px solid var(--border-strong); background: var(--surface); color: var(--text); font: inherit; font-weight: 600; font-size: 12.5px; padding: 0 14px; cursor: pointer; }
.copy button:hover { background: var(--surface-2); }
pre.code { margin: 0; padding: 14px 16px; border-radius: var(--radius-sm); background: #0f1320; color: #d6deeb; font-family: var(--mono); font-size: 12.5px; line-height: 1.6; overflow-x: auto; white-space: pre; }

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin-bottom: 20px; overflow-x: auto; }
.tabs a { padding: 9px 14px; color: var(--text-2); font-weight: 560; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a:hover { color: var(--text); text-decoration: none; }
.tabs a.active { color: var(--brand); border-bottom-color: var(--brand); }

/* ---------- Filterleiste ---------- */
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.toolbar input[type="search"] { max-width: 280px; height: 34px; }
.toolbar select { width: auto; height: 34px; }
.toolbar .spacer { flex: 1; }
.pill-filter { display: flex; gap: 4px; flex-wrap: wrap; }
.pill-filter a { padding: 5px 11px; border-radius: 99px; font-size: 13px; font-weight: 560; color: var(--text-2); border: 1px solid var(--border); }
.pill-filter a:hover { text-decoration: none; background: var(--surface-2); }
.pill-filter a.active { background: var(--text); border-color: var(--text); color: var(--surface); }
.pill-filter .n { opacity: 0.6; margin-left: 4px; }
.pagination { display: flex; gap: 8px; justify-content: space-between; align-items: center; padding: 12px 16px; border-top: 1px solid var(--border); font-size: 13px; color: var(--text-2); }

/* ---------- Definitionsliste ---------- */
.dl { display: grid; grid-template-columns: 160px 1fr; gap: 10px 16px; margin: 0; font-size: 13.5px; }
.dl dt { color: var(--text-3); }
.dl dd { margin: 0; word-break: break-word; }

/* ---------- Auth-Seiten ---------- */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 32px 16px; }
.auth-box { width: 100%; max-width: 420px; }
.auth-box.wide { max-width: 640px; }
.auth-brand { display: flex; align-items: center; justify-content: center; gap: 10px; margin-bottom: 22px; font-weight: 700; font-size: 17px; color: var(--text); }
.auth-brand:hover { text-decoration: none; }
.auth .card-body { padding: 28px; }
.auth h1 { font-size: 20px; margin-bottom: 4px; }
.auth .lead { color: var(--text-2); margin-bottom: 20px; }
.auth .stack-sm > * + * { margin-top: 14px; }
.auth-foot { text-align: center; margin-top: 18px; font-size: 13.5px; color: var(--text-2); }
.auth-switch { display: flex; justify-content: center; gap: 14px; margin-top: 18px; font-size: 12.5px; }
.auth-switch a { color: var(--text-3); }

/* ---------- Einrichtungs-Assistent ---------- */
.setup { display: grid; grid-template-columns: 300px 1fr; min-height: 100vh; }
.setup-side { background: var(--surface); border-right: 1px solid var(--border); padding: 28px 22px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.setup-side .sidebar-brand { padding: 0 0 26px; }
.steps { list-style: none; margin: 0; padding: 0; counter-reset: step; }
.steps li { position: relative; padding: 0 0 18px 40px; counter-increment: step; }
.steps li::before {
  content: counter(step); position: absolute; left: 0; top: -2px;
  width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center;
  font-size: 12px; font-weight: 700; border: 1.5px solid var(--border-strong); color: var(--text-3); background: var(--surface);
}
.steps li:not(:last-child)::after { content: ""; position: absolute; left: 12.5px; top: 26px; bottom: 2px; width: 1.5px; background: var(--border); }
.steps li.done::before { content: "✓"; background: var(--brand); border-color: var(--brand); color: var(--brand-contrast); }
.steps li.done::after { background: var(--brand); }
.steps li.current::before { border-color: var(--brand); color: var(--brand); box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 15%, transparent); }
.steps .step-title { font-weight: 600; font-size: 13.5px; color: var(--text-2); display: block; line-height: 1.3; }
.steps .step-desc { font-size: 12px; color: var(--text-3); }
.steps li.current .step-title { color: var(--text); }
.steps a { color: inherit; }
.steps a:hover { text-decoration: none; }
.steps a:hover .step-title { color: var(--brand); }
.setup-main { padding: 40px 48px 80px; max-width: 860px; width: 100%; }
.setup-main .step-kicker { font-size: 12.5px; font-weight: 700; color: var(--brand); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 8px; }
.setup-main h1 { font-size: 26px; margin-bottom: 8px; }
.setup-main .lead { font-size: 15px; color: var(--text-2); margin-bottom: 28px; max-width: 640px; }
.setup-section { margin-bottom: 26px; }
.setup-section > h2 { font-size: 15px; margin-bottom: 4px; }
.setup-section > p { font-size: 13.5px; color: var(--text-2); margin-bottom: 14px; }
.setup-actions { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 32px; padding-top: 20px; border-top: 1px solid var(--border); }
.setup-progress { height: 4px; background: var(--border); border-radius: 99px; overflow: hidden; margin-top: 22px; }
.setup-progress span { display: block; height: 100%; background: var(--brand); border-radius: 99px; }
.setup-progress .w-0 { width: 0%; }
.setup-progress .w-10 { width: 10%; }
.setup-progress .w-20 { width: 20%; }
.setup-progress .w-30 { width: 30%; }
.setup-progress .w-40 { width: 40%; }
.setup-progress .w-50 { width: 50%; }
.setup-progress .w-60 { width: 60%; }
.setup-progress .w-70 { width: 70%; }
.setup-progress .w-80 { width: 80%; }
.setup-progress .w-90 { width: 90%; }
.setup-progress .w-100 { width: 100%; }
.provider-card .box { display: flex; gap: 12px; align-items: flex-start; }
.provider-logo { width: 36px; height: 36px; border-radius: 9px; flex: none; display: grid; place-items: center; font-weight: 800; font-size: 13px; color: #fff; }
.pl-stripe { background: #635bff; }
.pl-digistore24 { background: #1d6fb8; }
.pl-copecart { background: #ff6b2c; }
.pl-verotel { background: #c8102e; }
.pl-ccbill { background: #00843d; }
.pl-segpay { background: #2b3a67; }
.pl-generic { background: #334155; }
.w-auto { width: auto; max-width: 160px; }
.checklist { list-style: none; padding: 0; margin: 0; }
.checklist li { display: flex; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.checklist li:last-child { border-bottom: 0; }
.checklist .ok { color: var(--success); font-weight: 700; }
.checklist .todo { color: var(--warning); font-weight: 700; }
.how-to { counter-reset: how; list-style: none; padding: 0; margin: 0; }
.how-to li { counter-increment: how; position: relative; padding: 0 0 14px 34px; }
.how-to li::before { content: counter(how); position: absolute; left: 0; top: 0; width: 22px; height: 22px; border-radius: 50%; background: var(--surface-2); color: var(--text-2); font-size: 12px; font-weight: 700; display: grid; place-items: center; }

/* ---------- Sprachumschalter ---------- */
.lang-switch { display: inline-flex; border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; }
.lang-switch a { padding: 5px 9px; font-size: 12px; font-weight: 700; color: var(--text-3); }
.lang-switch a + a { border-left: 1px solid var(--border); }
.lang-switch a:hover { text-decoration: none; color: var(--text); background: var(--surface-2); }
.lang-switch a.active { color: var(--brand); background: color-mix(in srgb, var(--brand) 9%, transparent); }

/* ---------- Rechtstexte ---------- */
.legal-text { margin-top: 16px; }
.mt { margin-top: 16px; }
.mt-sm { margin-top: 8px; }
.mb { margin-bottom: 16px; }
.mb-0 { margin-bottom: 0; }
.gap-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ---------- Druckansicht (Gutschrift) ---------- */
.doc { background: #fff; color: #111; max-width: 820px; margin: 24px auto; padding: 56px 64px; box-shadow: var(--shadow-lg); border-radius: 4px; font-size: 13px; }
.doc h1 { font-size: 22px; margin-bottom: 4px; color: #111; }
.doc table th { background: #f4f5f7; color: #555; }
.doc td, .doc th { border-color: #e4e6ea; }
.doc .meta { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin: 28px 0; }
.doc .total td { font-weight: 700; font-size: 14px; border-top: 2px solid #111; }
.doc-actions { max-width: 820px; margin: 16px auto 0; display: flex; gap: 8px; justify-content: flex-end; }
@media print {
  body { background: #fff; }
  .doc { box-shadow: none; margin: 0; padding: 0; max-width: none; }
  .doc-actions, .license-banner { display: none !important; }
}

/* ---------- Responsiv ---------- */
@media (max-width: 1100px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-sidebar { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; background: var(--bg); }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; height: 100vh; width: 270px; z-index: 60; transform: translateX(-100%); transition: transform 0.2s; box-shadow: var(--shadow-lg); }
  .nav-open .sidebar { transform: none; }
  .topbar .menu-toggle { display: inline-flex; }
  .topbar { padding: 12px 16px; }
  .content { padding: 20px 16px 48px; }
  .setup { grid-template-columns: 1fr; }
  .setup-side { position: static; height: auto; padding: 18px 16px; border-right: 0; border-bottom: 1px solid var(--border); }
  .setup-side .steps { display: none; }
  .setup-main { padding: 24px 16px 64px; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .portal-header-inner { padding: 0 16px; gap: 12px; }
  .portal-content { padding: 20px 16px 48px; }
}
@media (max-width: 640px) {
  .grid-4 { grid-template-columns: 1fr 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .dl { grid-template-columns: 1fr; gap: 2px 0; }
  .dl dd { margin-bottom: 10px; }
  .stat-value { font-size: 21px; }
  .doc { padding: 28px 20px; }
  .doc .meta { grid-template-columns: 1fr; }
  .portal-header .brand-name { display: none; }
}

/* 25.11.2026: Powered by */
.powered-by { text-align: center; font-size: 12px; color: var(--text-3, var(--text-2)); opacity: .75; margin: 22px 0 6px; }
.powered-by a, .powered-by strong { color: inherit; font-weight: 600; text-decoration: none; }
.powered-by a:hover { text-decoration: underline; }
.sidebar-foot .powered-by { margin: 0 0 10px; }

/* 25.11.2026: Demo-Modus */
.demo-banner { background: color-mix(in srgb, var(--brand) 12%, var(--surface)); border: 1px solid color-mix(in srgb, var(--brand) 35%, transparent); border-radius: var(--radius-sm, 8px); padding: 10px 14px; margin: 0 0 16px; font-size: 14px; }
.demo-banner a { font-weight: 600; }
