/* LeadHub */
[hidden] { display: none !important; }
:root {
  --bg: #f5f6f8; --surface: #fff; --surface-2: #f9fafb; --border: #e3e6ea; --border-strong: #cfd4da;
  --text: #1c2128; --muted: #687280; --accent: #2f5bea; --accent-hover: #2349c7; --accent-soft: #e9eefd;
  --ok: #17803d; --ok-soft: #e6f5ec; --err: #c4302b; --err-soft: #fbeaea; --warn: #9a6100; --warn-soft: #fdf3e1;
  --violet: #6c3fd1; --violet-soft: #f0eafc; --grey-soft: #eef0f3;
  --radius: 10px; --shadow: 0 1px 2px rgba(16, 24, 40, .05);
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111418; --surface: #191d22; --surface-2: #1f242a; --border: #2b3138; --border-strong: #3a414a;
    --text: #e6e9ed; --muted: #98a1ad; --accent: #6d8dff; --accent-hover: #87a1ff; --accent-soft: #1f2a4a;
    --ok: #4cc27a; --ok-soft: #173123; --err: #f07470; --err-soft: #3a1d1d; --warn: #e8b35a; --warn-soft: #362a16;
    --violet: #a98bf5; --violet-soft: #2a2245; --grey-soft: #262b32; --shadow: none;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
code, .mono { font-family: var(--mono); font-size: 12.5px; }
code { background: var(--grey-soft); padding: 1px 5px; border-radius: 4px; }
h1 { font-size: 22px; margin: 0; letter-spacing: -.01em; }
h2 { font-size: 15px; margin: 0 0 14px; }
h3 { font-size: 14px; margin: 8px 0; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.strong { font-weight: 600; color: var(--text); }
.nowrap { white-space: nowrap; }
.break { word-break: break-all; }
.text-err { color: var(--err); }
.c { text-align: center; } .r { text-align: right; }

/* Kopfzeile */
.topbar { display: flex; align-items: center; gap: 24px; padding: 0 24px; height: 56px; background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 10; }
.brand { font-weight: 700; font-size: 16px; color: var(--text); white-space: nowrap; }
.brand:hover { text-decoration: none; }
.logo { color: var(--accent); }
.topbar nav { display: flex; gap: 4px; flex: 1; overflow-x: auto; }
.topbar nav a { color: var(--muted); padding: 6px 12px; border-radius: 8px; white-space: nowrap; font-weight: 500; }
.topbar nav a:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.topbar nav a.active { background: var(--accent-soft); color: var(--accent); }
.user { color: var(--muted); font-size: 13px; white-space: nowrap; }

.wrap { max-width: 1320px; margin: 0 auto; padding: 24px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head p { margin: 4px 0 0; }
.actions, .row-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.back { font-size: 13px; color: var(--muted); display: inline-block; margin-bottom: 4px; }

/* Karten & Layout */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.stack { display: flex; flex-direction: column; gap: 16px; }
.grid-2 { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.grid-2.tight { grid-template-columns: 1fr 1fr; margin-top: 16px; }
@media (max-width: 960px) { .grid-2, .grid-2.tight { grid-template-columns: 1fr; } }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 16px; }
@media (max-width: 720px) { .stats { grid-template-columns: repeat(2, 1fr); } }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; color: var(--text); display: flex; flex-direction: column; }
.stat:hover { border-color: var(--border-strong); text-decoration: none; }
.stat span { color: var(--muted); font-size: 12.5px; }
.stat strong { font-size: 24px; font-variant-numeric: tabular-nums; }
.stat-alert strong { color: var(--err); }

/* Chips */
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font-size: 13px; cursor: pointer; font-family: inherit; }
.chip:hover { border-color: var(--border-strong); text-decoration: none; }
.chip.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.chip em { font-style: normal; color: var(--muted); font-size: 12px; }
.chip.active em { color: rgba(255,255,255,.8); }
.chip.inactive { opacity: .6; }
.chip-warn:not(.active) { border-color: var(--warn); color: var(--warn); }
.chip-btn { margin: 3px 2px; }

/* Formulare */
label { display: flex; flex-direction: column; gap: 5px; font-weight: 500; font-size: 13px; }
label.inline { flex-direction: row; align-items: center; gap: 6px; color: var(--muted); font-weight: 400; }
label.check { flex-direction: row; align-items: center; gap: 8px; font-weight: 400; }
input, select, textarea { font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--border-strong); border-radius: 8px; padding: 8px 10px; width: 100%; min-width: 0; }
input[type=checkbox], input[type=radio] { width: auto; accent-color: var(--accent); }
textarea { resize: vertical; }
textarea.mono { font-size: 12.5px; line-height: 1.45; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }
.is-missing { border-color: var(--warn); background: var(--warn-soft); }
.req { color: var(--err); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px; }
.form-grid .span-2 { grid-column: span 2; }
@media (max-width: 640px) { .form-grid { grid-template-columns: 1fr; } .form-grid .span-2 { grid-column: auto; } }
.form-actions { display: flex; gap: 8px; margin-top: 16px; }
.form-actions.sticky { position: sticky; bottom: 0; background: linear-gradient(transparent, var(--bg) 35%); padding: 18px 0 12px; margin: 0; }
.hint { margin-top: 14px; padding: 12px 14px; background: var(--surface-2); border: 1px dashed var(--border-strong); border-radius: 8px; font-size: 12.5px; line-height: 1.9; }
.hint code { white-space: nowrap; }
.segmented { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 14px; }
.segmented label { flex-direction: row; align-items: center; gap: 8px; font-weight: 400; }
details summary { cursor: pointer; color: var(--accent); font-size: 13px; margin: 8px 0; }
.add-field { margin-top: 10px; }
.extra-row { display: grid; grid-template-columns: 1fr auto auto; gap: 10px; align-items: end; padding: 8px 0; border-bottom: 1px solid var(--border); }
.extra-row:last-of-type { border-bottom: 0; }
.copy { display: flex; gap: 6px; }
.copy-block { flex-direction: column; align-items: flex-start; }
.copy-block textarea { font: 12px/1.5 var(--mono); background: var(--surface-2); white-space: pre; overflow: auto; }
.checklist { list-style: none; margin: 0; padding: 0; }
.checklist li { display: flex; gap: 10px; align-items: baseline; padding: 7px 0; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.checklist li:last-child { border-bottom: 0; }
.checklist .ck { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; font-size: 12px; flex: none; transform: translateY(3px); }
.checklist li.ok .ck { background: var(--ok-soft); color: var(--ok); }
.checklist li.todo .ck { background: var(--grey-soft); color: var(--muted); }
.checklist li.warn .ck { background: var(--warn-soft); color: var(--warn); }
.steps { counter-reset: step; list-style: none; margin: 0; padding: 0; }
.steps > li { counter-increment: step; position: relative; padding: 0 0 22px 44px; }
.steps > li::before { content: counter(step); position: absolute; left: 0; top: -2px; width: 28px; height: 28px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-weight: 700; display: grid; place-items: center; font-size: 13px; }
.steps > li::after { content: ""; position: absolute; left: 13px; top: 30px; bottom: 4px; width: 2px; background: var(--border); }
.steps > li:last-child::after { display: none; }
.steps h3 { margin: 0 0 6px; font-size: 15px; }
.steps p { margin: 4px 0 10px; }
.steps .copy, .steps label { margin-bottom: 8px; }
.settings-table td:first-child { color: var(--muted); white-space: nowrap; width: 1%; }
.settings-table td { padding: 7px 10px; }
.method-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.method-tab { flex: 1 1 200px; border: 1px solid var(--border-strong); border-radius: var(--radius); padding: 12px 14px; color: var(--text); background: var(--surface); }
.method-tab:hover { text-decoration: none; border-color: var(--accent); }
.method-tab.active { border-color: var(--accent); background: var(--accent-soft); }
.method-tab b { display: block; }
.method-tab span { font-size: 12.5px; color: var(--muted); }
.callout { padding: 10px 14px; border-left: 3px solid var(--accent); background: var(--accent-soft); border-radius: 6px; font-size: 13px; margin: 8px 0 12px; }
.callout.warn { border-color: var(--warn); background: var(--warn-soft); }
.copy input { font-family: var(--mono); font-size: 12.5px; background: var(--surface-2); }
.row-actions select { width: auto; }
.form-grid.three { grid-template-columns: repeat(3, 1fr); }
.form-grid .span-3 { grid-column: 1 / -1; }
@media (max-width: 900px) { .form-grid.three { grid-template-columns: 1fr 1fr; } }
@media (max-width: 640px) { .form-grid.three { grid-template-columns: 1fr; } }
.seg-buttons { display: inline-flex; border: 1px solid var(--border-strong); border-radius: 8px; overflow: hidden; }
.seg-buttons label { flex-direction: row; font-weight: 400; }
.seg-buttons input { position: absolute; opacity: 0; pointer-events: none; }
.seg-buttons span { padding: 7px 12px; cursor: pointer; border-right: 1px solid var(--border-strong); white-space: nowrap; font-size: 13px; }
.seg-buttons label:last-child span { border-right: 0; }
.seg-buttons input:checked + span { background: var(--ok-soft); color: var(--ok); font-weight: 600; }
.seg-buttons input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: -2px; }
.mapping-table td { padding: 5px 6px; }
.mapping-table input, .mapping-table select { padding: 6px 8px; font-size: 13px; }
.mapping-table td.drag { white-space: nowrap; width: 1%; }
.mapping-table { table-layout: fixed; min-width: 860px; }
.mapping-table th:nth-child(1) { width: 48px; } .mapping-table th:nth-child(2) { width: 56px; }
.mapping-table th:nth-child(3) { width: 20%; } .mapping-table th:nth-child(4) { width: 26%; }
.mapping-table th:nth-child(5) { width: 15%; } .mapping-table th:nth-child(6) { width: 15%; }
.mapping-table th:nth-child(7) { width: 118px; } .mapping-table th:nth-child(8) { width: 36px; }
.mapping-table select { width: 100%; }
.mapping-table tbody.mapping-entry + tbody.mapping-entry tr.field-row td { border-top: 1px solid var(--border); }
.mapping-table tr.field-row td, .mapping-table tr.mapping-detail td { border-bottom: 0; }
.mapping-table tbody.mapping-entry:first-of-type [data-move="-1"], .mapping-table tbody.mapping-entry:last-of-type [data-move="1"] { visibility: hidden; }
.mapping-table tbody:has(> tr > td > input[type=checkbox]:not(:checked)) tr.field-row td:not(:first-child) { opacity: .5; }
.rules-toggle { width: 100%; }
.rules-toggle.has-rules { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.detail-box { background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; padding: 12px 14px; display: flex; flex-direction: column; gap: 12px; margin-bottom: 6px; }
.detail-box .custom-format label { max-width: 420px; }
.rules-head { margin-bottom: 8px; display: flex; gap: 10px; flex-wrap: wrap; align-items: baseline; }
.rule-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 8px; }
.rule-row { display: flex; gap: 8px; align-items: center; }
.rule-row select { width: auto; flex: 0 0 auto; min-width: 150px; }
.rule-row input { width: auto; flex: 1 1 120px; min-width: 80px; }
.rule-row > span { flex: 0 0 auto; }
.rules-toggle { padding-left: 6px; padding-right: 6px; }
.rule-arrow { color: var(--muted); font-size: 13px; white-space: nowrap; }
.explain { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 8px 16px; margin: 4px 0 10px; font-size: 12.5px; }
.explain > div { background: var(--surface-2); border-radius: 8px; padding: 8px 10px; }
.explain b { display: block; margin-bottom: 2px; }
.explain span { color: var(--muted); }
.export-grid { grid-template-columns: minmax(0, 2.4fr) minmax(0, 1fr); }
@media (max-width: 1100px) { .export-grid { grid-template-columns: 1fr; } }

.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; align-items: center; }
.filters input[type=search] { flex: 1 1 260px; width: auto; }
.filters select, .filters input[type=date] { width: auto; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 8px 14px; border-radius: 8px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); font: inherit; font-weight: 500; cursor: pointer; white-space: nowrap; }
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-ghost { border-color: transparent; background: transparent; color: var(--muted); }
.btn-ghost:hover { color: var(--text); }
.btn-danger { color: var(--err); border-color: var(--err); background: transparent; }
.btn-danger:hover { background: var(--err-soft); }
.btn-small { padding: 4px 10px; font-size: 12.5px; }
.btn.wide { width: 100%; margin-top: 8px; }
.icon-btn { border: 0; background: none; color: var(--muted); cursor: pointer; padding: 4px 6px; border-radius: 6px; font-size: 14px; }
.icon-btn:hover { background: var(--grey-soft); color: var(--text); }
.icon-btn.danger:hover { color: var(--err); background: var(--err-soft); }

/* Tabellen */
.table-wrap { overflow-x: auto; padding: 0; }
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-weight: 600; font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; padding: 10px 12px; border-bottom: 1px solid var(--border); background: var(--surface-2); white-space: nowrap; }
.table td { padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr[data-href] { cursor: pointer; }
.table tbody tr[data-href]:hover { background: var(--surface-2); }
.table .cb { width: 36px; }
.table .empty { text-align: center; color: var(--muted); padding: 40px 16px; }
.card > .table th:first-child, .card .table th:first-child { border-top-left-radius: var(--radius); }
.fields-table td { padding: 6px; }
.fields-table input, .fields-table select { padding: 6px 8px; font-size: 13px; }
.fields-table td.drag { white-space: nowrap; width: 1%; }
.fields-table tr:first-child [data-move="-1"], .fields-table tr:last-child [data-move="1"] { visibility: hidden; }

/* Badges */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.b-dot::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.b-blue { background: var(--accent-soft); color: var(--accent); }
.b-green { background: var(--ok-soft); color: var(--ok); }
.b-red { background: var(--err-soft); color: var(--err); }
.b-amber { background: var(--warn-soft); color: var(--warn); }
.b-violet { background: var(--violet-soft); color: var(--violet); }
.b-grey { background: var(--grey-soft); color: var(--muted); }
.b-lang { background: var(--grey-soft); color: var(--text); font-family: var(--mono); font-size: 11px; letter-spacing: .04em; border-radius: 5px; padding: 2px 6px; }
.chip b.lang { font-family: var(--mono); font-size: 11px; font-weight: 600; opacity: .75; }
.warn-dot { display: inline-grid; place-items: center; width: 16px; height: 16px; border-radius: 50%; background: var(--warn-soft); color: var(--warn); font-size: 11px; font-weight: 700; margin-left: 4px; }

/* Hinweise */
.flash { padding: 11px 14px; border-radius: 8px; margin-bottom: 12px; border: 1px solid; }
.flash-ok { background: var(--ok-soft); border-color: transparent; color: var(--ok); }
.flash-err { background: var(--err-soft); border-color: transparent; color: var(--err); }
.flash-warn { background: var(--warn-soft); border-color: transparent; color: var(--warn); }
.flash code { background: rgba(0,0,0,.06); }

/* Sonstiges */
.meta { display: grid; grid-template-columns: 110px 1fr; gap: 8px 12px; margin: 0 0 14px; font-size: 13px; }
.meta dt { color: var(--muted); }
.meta dd { margin: 0; }
pre.code { background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; padding: 12px; overflow: auto; max-height: 420px; font: 12px/1.5 var(--mono); margin: 0; white-space: pre-wrap; word-break: break-word; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { padding: 8px 0 8px 14px; border-left: 2px solid var(--border); display: flex; flex-direction: column; }
.timeline li.ok { border-color: var(--ok); }
.timeline li.err { border-color: var(--err); }
.bulkbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 10px 12px; margin-bottom: 10px; background: var(--accent-soft); border-radius: var(--radius); position: sticky; top: 64px; z-index: 5; }
.bulkbar select { width: auto; }
.bulkbar span { font-weight: 600; color: var(--accent); margin-right: 6px; }
.pager { display: flex; gap: 12px; align-items: center; justify-content: center; margin: 16px 0; color: var(--muted); }
.tabs, .subnav { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 16px; overflow-x: auto; }
.tabs a, .subnav a { padding: 8px 14px; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; font-weight: 500; }
.tabs a.active, .tabs a:hover, .subnav a:hover { color: var(--text); border-color: var(--accent); text-decoration: none; }
section[id] { scroll-margin-top: 72px; }
.empty-state { text-align: center; padding: 48px 24px; }
.empty-state p { max-width: 560px; margin: 0 auto 18px; color: var(--muted); }
.danger-zone { margin-top: 24px; }
.center-page { display: grid; place-items: center; min-height: 100vh; padding: 16px; }
.login-card { width: 100%; max-width: 380px; display: flex; flex-direction: column; gap: 14px; }
.login-card h1 { margin-bottom: 4px; }

@media (max-width: 720px) {
  .topbar { padding: 0 16px; gap: 12px; }
  .uname { display: none; }
  .wrap { padding: 16px; }
  .card { padding: 16px; }
  .extra-row { grid-template-columns: 1fr; }
}

/* Exporte */
.label { display: block; font-weight: 500; font-size: 13px; margin-bottom: 6px; }
.stat-small { font-size: 16px !important; line-height: 1.9; }
.schedule-types { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px; margin-bottom: 16px; }
.type-card { flex-direction: row; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--border-strong); border-radius: 8px; cursor: pointer; font-weight: 400; }
.type-card:hover { background: var(--surface-2); }
.type-card:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.type-card b { font-weight: 500; }
.day-picker { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.day-picker label { flex-direction: row; }
.day-picker input { position: absolute; opacity: 0; pointer-events: none; }
.day-picker span { display: inline-grid; place-items: center; min-width: 40px; height: 36px; padding: 0 8px; border: 1px solid var(--border-strong); border-radius: 8px; cursor: pointer; font-weight: 500; }
.day-picker.month span { min-width: 36px; }
.day-picker input:checked + span { background: var(--accent); border-color: var(--accent); color: #fff; }
.day-picker input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.chip-check { flex-direction: row; font-weight: 400; }
.chip-check:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.export-row { display: grid; grid-template-columns: 1fr auto; gap: 8px 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--border); }
.export-row:last-child { border-bottom: 0; }
