/* Belegu Digital CRM – Design-System
   Marke: Archivo (Breite als Charakter), Signalrot #E1302B sparsam, Papier hell, Navigation dunkel. */

@font-face {
  font-family: "Archivo";
  src: url("/assets/fonts/archivo.woff2") format("woff2");
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
}

:root {
  --paper: #F6F5F2;
  --surface: #FFFFFF;
  --surface-2: #F0EEEA;
  --ink: #121417;
  --muted: #5C6068;
  --line: rgba(17, 19, 22, .09);
  --line-2: rgba(17, 19, 22, .17);
  --red: #E1302B;
  --red-hover: #C9241F;
  --red-soft: rgba(225, 48, 43, .09);
  --night: #121418;
  --night-2: #1B1E24;
  --night-text: #ECEAE5;
  --night-muted: #9A9DA3;
  --gut: #1E7F4F;
  --gut-soft: rgba(30, 127, 79, .1);
  --offen: #9A6416;
  --offen-soft: rgba(183, 121, 31, .12);
  --nein: #5C6068;
  --nein-soft: rgba(92, 96, 104, .1);
  --info: #2F5AA8;
  --info-soft: rgba(47, 90, 168, .1);
  --warn-soft: #FFF4D6;
  --focus: 0 0 0 3px rgba(225, 48, 43, .35);
  --r-panel: 16px;
  --r-field: 10px;
  --ease: cubic-bezier(.16, 1, .3, 1);
  --nav-w: 244px;
  --font: "Archivo", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  font-variant-numeric: tabular-nums;
}
h1, h2, h3 { margin: 0; line-height: 1.15; font-stretch: 112%; font-weight: 700; letter-spacing: -.01em; }
h2 { font-size: 1.12rem; }
h3 { font-size: 1rem; margin-top: 18px; }
p { margin: 0 0 10px; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: 6px; }
kbd { font: 600 .78rem var(--font); padding: 1px 6px; border: 1px solid var(--line-2); border-bottom-width: 2px; border-radius: 6px; background: var(--surface); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; z-index: 100; background: var(--ink); color: #fff; padding: 8px 14px; border-radius: 999px; }
.skip:focus { left: 8px; }
.muted { color: var(--muted); }
.small { font-size: .86rem; }
.block { display: block; }
.nowrap { white-space: nowrap; }
.prewrap { white-space: pre-wrap; }
.num { text-align: right; }
.link { color: var(--ink); text-decoration: underline; text-decoration-color: var(--line-2); text-underline-offset: 3px; font-weight: 600; }
.link:hover { text-decoration-color: var(--red); }
.link-strong { font-weight: 650; text-decoration: none; }
.link-strong:hover { text-decoration: underline; }
.ic { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Marke ---------- */
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; }
.brand-mark { width: 12px; height: 12px; border-radius: 2px; background: var(--red); flex: none; }
.brand-word { font-weight: 800; font-stretch: 118%; letter-spacing: .02em; text-transform: uppercase; font-size: .92rem; }
.brand-lg .brand-mark { width: 16px; height: 16px; }
.brand-lg .brand-word { font-size: 1.15rem; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 20px; border-radius: 999px; border: 1px solid transparent;
  font-weight: 600; text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background-color .15s, border-color .15s, transform .2s var(--ease);
}
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.btn-primary { background: var(--red); color: #fff; }
.btn-primary:hover:not([disabled]) { background: var(--red-hover); }
.btn-ghost { background: var(--surface); border-color: var(--line-2); }
.btn-ghost:hover:not([disabled]) { border-color: var(--ink); }
.btn-on-dark { background: transparent; color: var(--night-text); border-color: rgba(236, 234, 229, .25); }
.btn-on-dark:hover, .btn-on-dark[aria-pressed="true"] { border-color: var(--night-text); }
.btn-on-dark[aria-pressed="true"] { background: rgba(236, 234, 229, .1); }
.btn-sm { min-height: 34px; padding: 0 14px; font-size: .86rem; }
.btn-block { width: 100%; }
.btn-icon { width: 44px; padding: 0; }
.icon-btn {
  position: relative; display: inline-grid; place-items: center; width: 44px; height: 44px;
  border-radius: 999px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; text-decoration: none;
}
.icon-btn:hover { border-color: var(--line-2); }
.badge {
  min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--red); color: #fff;
  font-size: .72rem; font-weight: 700; display: inline-grid; place-items: center; line-height: 1;
}
.icon-btn .badge { position: absolute; top: -4px; right: -4px; }

/* ---------- Shell ---------- */
.shell { display: grid; grid-template-columns: var(--nav-w) minmax(0, 1fr); min-height: 100vh; }
.nav {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 18px;
  background: var(--night); color: var(--night-text); padding: 22px 14px 16px; overflow-y: auto;
}
.nav .brand { padding: 4px 10px 10px; }
.nav nav { display: flex; flex-direction: column; gap: 2px; }
.nav-link {
  display: flex; align-items: center; gap: 12px; min-height: 42px; padding: 0 12px; border-radius: 10px;
  color: var(--night-muted); text-decoration: none; font-weight: 500; border: 0; background: none; width: 100%; cursor: pointer; text-align: left;
}
.nav-link:hover { color: var(--night-text); background: var(--night-2); }
.nav-link.is-active { color: var(--night-text); background: var(--night-2); box-shadow: inset 3px 0 0 var(--red); }
.nav-link .badge { margin-left: auto; }
.nav-foot { margin-top: auto; display: flex; flex-direction: column; gap: 4px; border-top: 1px solid rgba(236, 234, 229, .08); padding-top: 12px; }
.nav-foot form { margin: 0; }
.me { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; text-decoration: none; }
.me:hover { background: var(--night-2); }
.me-text { display: flex; flex-direction: column; min-width: 0; }
.me-text b { font-weight: 600; font-size: .92rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me-text small { color: var(--night-muted); font-size: .78rem; }

.main-col { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 14px;
  min-height: 72px; padding: 12px 32px; background: rgba(246, 245, 242, .92); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.page-title { font-size: 1.5rem; font-weight: 750; font-stretch: 116%; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.only-mobile { display: none; }
.content { padding: 28px 32px 56px; max-width: 1240px; width: 100%; }
.content.is-wide { max-width: none; }
.content > * + * { margin-top: 20px; }
.flashes { padding: 16px 32px 0; display: grid; gap: 8px; }
.flash { margin: 0; padding: 12px 16px; border-radius: 12px; background: var(--gut-soft); border: 1px solid rgba(30, 127, 79, .2); font-weight: 500; }
.flash-error { background: var(--red-soft); border-color: rgba(225, 48, 43, .25); }

/* ---------- Avatar, Chips ---------- */
.avatar {
  position: relative; width: 36px; height: 36px; border-radius: 999px; flex: none;
  display: inline-grid; place-items: center; background: var(--night-2); color: var(--night-text);
  font-weight: 700; font-size: .8rem; font-stretch: 110%;
}
.main-col .avatar { background: var(--surface-2); color: var(--ink); }
.avatar.sm { width: 30px; height: 30px; font-size: .72rem; }
.avatar.is-online::after {
  content: ""; position: absolute; right: -1px; bottom: -1px; width: 10px; height: 10px; border-radius: 999px;
  background: var(--gut); border: 2px solid var(--surface);
}
.chip {
  display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: 999px;
  background: var(--surface-2); font-size: .8rem; font-weight: 600; white-space: nowrap;
}
.chip::before { content: ""; width: 7px; height: 7px; border-radius: 999px; background: var(--muted); }
.chip-interesse::before, .chip-rueckruf::before, .chip-demo_gesendet::before, .chip-info_gesendet::before { background: var(--gut); }
.chip-nicht_erreicht::before { background: #B7791F; }
.chip-neu::before { background: var(--info); }
.chip-admin::before { background: var(--red); }
.chip-teamlead::before { background: var(--info); }

/* ---------- Panels, Layout ---------- */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-panel); padding: 22px 24px; }
.panel.flush { padding: 0; overflow: hidden; }
.panel .pad, .panel-head.pad { padding: 18px 24px; }
.panel > h2 { margin-bottom: 14px; }
.panel-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.panel-callout { border-color: rgba(225, 48, 43, .3); background: linear-gradient(var(--red-soft), var(--red-soft)), var(--surface); }
.split { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(280px, 1fr); gap: 20px; align-items: start; }
.split-wide { grid-template-columns: minmax(0, 2fr) minmax(300px, 1fr); }
.lead-in { max-width: 70ch; }
.back { margin: 0; }
.empty { text-align: center; padding: 56px 24px; background: var(--surface); border: 1px dashed var(--line-2); border-radius: var(--r-panel); }
.empty h2 { margin-bottom: 8px; }
.empty p { color: var(--muted); max-width: 52ch; margin: 0 auto 18px; }
.small-empty { border: 0; padding: 40px 24px; }

/* ---------- Formulare ---------- */
.stack { display: grid; gap: 16px; }
.field { display: grid; gap: 6px; min-width: 0; }
.field > span { font-size: .84rem; font-weight: 600; color: var(--muted); }
.field small { color: var(--muted); font-size: .8rem; }
.field input, .field select, .field textarea, .mono-input, .search input, .room-select {
  width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid var(--line-2); border-radius: var(--r-field);
  background: var(--surface); transition: border-color .15s, box-shadow .15s;
}
.field textarea { resize: vertical; min-height: 64px; line-height: 1.45; }
.field input:focus, .field select:focus, .field textarea:focus, .mono-input:focus, .search input:focus {
  outline: none; border-color: var(--ink); box-shadow: var(--focus);
}
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
.form-grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.span-2 { grid-column: span 2; }
.form-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; grid-column: 1 / -1; }
.form-actions .check { margin-right: auto; }
.inline-form { display: flex; align-items: end; gap: 10px; flex-wrap: wrap; margin: 0; }
.inline-forms { display: flex; gap: 12px; flex-wrap: wrap; align-items: end; margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); }
.grow { flex: 1 1 220px; }
.check { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; min-height: 32px; }
.check input { width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--red); flex: none; }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
legend { font-weight: 700; font-stretch: 110%; margin-bottom: 10px; padding: 0; }
.radio-group { display: grid; gap: 8px; }
.chips-select { display: flex; flex-wrap: wrap; gap: 8px; }
.chips-select legend { width: 100%; }
.check-chip input { position: absolute; opacity: 0; }
.check-chip span { display: inline-flex; align-items: center; min-height: 38px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--line-2); cursor: pointer; font-weight: 500; }
.check-chip input:checked + span { background: var(--ink); color: #fff; border-color: var(--ink); }
.check-chip input:focus-visible + span { box-shadow: var(--focus); }
.copy-row { display: flex; gap: 10px; }
.mono-input { font-variant-numeric: tabular-nums; font-size: .9rem; }
details > summary { cursor: pointer; font-weight: 600; min-height: 32px; display: flex; align-items: center; }

/* ---------- Tabellen, Listen ---------- */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: .8rem; font-weight: 600; color: var(--muted); padding: 12px 16px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: #FBFAF8; }
.table th.num, .table td.num { text-align: right; }
.panel:not(.flush) .table th:first-child, .panel:not(.flush) .table td:first-child { padding-left: 0; }
.is-off td { opacity: .55; }
.row-actions { display: flex; gap: 6px; justify-content: flex-end; }
.row-actions form { margin: 0; }
.who { display: flex; align-items: center; gap: 10px; }
.who > span:last-child { display: flex; flex-direction: column; }
.who small { font-size: .8rem; }
.plain-list { list-style: none; margin: 0 0 16px; padding: 0; }
.plain-list li { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.plain-list li:last-child { border-bottom: 0; }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 8px 20px; margin: 0; }
.facts dt { color: var(--muted); font-size: .88rem; }
.facts dd { margin: 0; font-weight: 500; overflow-wrap: anywhere; }
.timeline { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.timeline li { display: grid; grid-template-columns: 12px 1fr; gap: 12px; }
.timeline small { display: block; }
.timeline p { margin: 4px 0 0; font-size: .9rem; }
.dot { width: 10px; height: 10px; margin-top: 6px; border-radius: 999px; background: var(--line-2); }
.dot-gut { background: var(--gut); }
.dot-offen { background: #B7791F; }
.dot-nein { background: var(--nein); }
.dot-info { background: var(--info); }

/* ---------- Anmeldung ---------- */
.auth { background: var(--night); }
.auth-wrap { min-height: 100vh; display: grid; grid-template-columns: 1.1fr minmax(320px, 440px); gap: 48px; align-items: center; padding: 48px clamp(20px, 6vw, 96px); }
.auth-side { color: var(--night-text); }
.auth-claim { margin: 48px 0 16px; font-size: clamp(2.6rem, 5.4vw, 4.6rem); line-height: .98; font-weight: 800; font-stretch: 120%; letter-spacing: -.02em; }
.auth-sub { color: var(--night-muted); font-size: 1.1rem; }
.auth-card { background: var(--surface); border-radius: 20px; padding: 32px; display: grid; gap: 16px; }
.auth-card h1 { font-size: 1.6rem; font-stretch: 116%; }
.auth-card .muted { margin: -8px 0 0; }

/* ---------- Arbeitsplatz ---------- */
.ws { display: grid; gap: 20px; }
.callbar {
  position: sticky; top: 72px; z-index: 15;
  display: flex; align-items: center; gap: 18px 24px; flex-wrap: wrap;
  background: var(--night); color: var(--night-text); border-radius: var(--r-panel); padding: 14px 16px 14px 22px;
}
.callbar-status { display: flex; align-items: center; gap: 12px; min-width: 190px; }
.callbar-word { font-size: 1.5rem; font-weight: 800; font-stretch: 122%; letter-spacing: -.01em; line-height: 1; }
.callbar-timer { font-size: 1.05rem; font-weight: 600; color: var(--night-muted); }
.callbar .brand-mark { width: 14px; height: 14px; }
.callbar.is-pause .brand-mark { background: var(--night-muted); }
.callbar.is-busy .brand-mark { animation: pulse 1.6s var(--ease) infinite; }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(225, 48, 43, .6); } 60% { box-shadow: 0 0 0 9px rgba(225, 48, 43, 0); } }
.callbar-project select {
  min-height: 40px; border-radius: 999px; padding: 0 34px 0 14px; background: var(--night-2); color: var(--night-text);
  border: 1px solid rgba(236, 234, 229, .15); max-width: 240px;
}
.callbar-stats { display: flex; gap: 22px; margin: 0; }
.callbar-stats div { display: flex; flex-direction: column-reverse; }
.callbar-stats dt { font-size: .74rem; color: var(--night-muted); }
.callbar-stats dd { margin: 0; font-size: 1.2rem; font-weight: 700; font-stretch: 112%; line-height: 1.1; }
.callbar-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.phone-pill { display: inline-flex; align-items: center; gap: 6px; font-size: .8rem; color: var(--night-muted); padding: 0 10px; }
.phone-pill .ic { width: 16px; height: 16px; }

.ws-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; align-items: start; }
.ws-side { display: grid; gap: 20px; position: sticky; top: 172px; }
.lead-panel { padding: 26px 28px; }
.lead-empty { text-align: center; padding: 48px 16px 40px; }
.lead-empty h2 { font-size: 1.5rem; font-stretch: 118%; margin-bottom: 10px; }
.lead-empty p { color: var(--muted); max-width: 54ch; margin: 0 auto 12px; }
.lead-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 18px; }
.lead-meta { margin: 0 0 6px; color: var(--muted); font-size: .84rem; }
.lead-company { font-size: clamp(1.6rem, 2.6vw, 2.2rem); font-weight: 800; font-stretch: 116%; letter-spacing: -.02em; overflow-wrap: anywhere; }
.lead-person { margin: 6px 0 0; font-size: 1.05rem; color: var(--muted); }
.lead-quick { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.quick {
  display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 14px; border-radius: 999px;
  background: var(--surface-2); text-decoration: none; font-weight: 600; font-size: .92rem; max-width: 100%;
}
.quick span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
a.quick:hover { background: #E6E3DD; }
.quick[hidden] { display: none; }
.quick-phone { background: var(--ink); color: #fff; font-size: 1.05rem; }
a.quick-phone:hover { background: #2A2E34; }
.lead-details { border-top: 1px solid var(--line); padding: 10px 0 4px; }
.lead-details[open] > summary { margin-bottom: 12px; }
.lead-details > summary { color: var(--muted); }
.lead-details .field { margin-top: 14px; }
.results { border-top: 1px solid var(--line); padding-top: 18px; margin-top: 10px; display: grid; gap: 14px; }
.result-row { display: flex; flex-wrap: wrap; gap: 8px; }
.result-btn {
  display: inline-flex; align-items: center; gap: 10px; min-height: 46px; padding: 0 16px 0 12px; border-radius: 999px;
  border: 1px solid var(--line-2); background: var(--surface); cursor: pointer; font-weight: 600;
  transition: background-color .15s, border-color .15s, color .15s;
}
.result-btn kbd { font-size: .72rem; }
.result-btn::before { content: ""; width: 10px; height: 10px; border-radius: 999px; background: var(--nein); }
.result-btn[data-group="gut"]::before { background: var(--gut); }
.result-btn[data-group="offen"]::before { background: #B7791F; }
.result-btn:hover { border-color: var(--ink); }
.result-btn[aria-pressed="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }
.result-btn[aria-pressed="true"] kbd { background: transparent; color: #fff; border-color: rgba(255, 255, 255, .4); }
.callback-row { display: flex; align-items: end; gap: 12px; flex-wrap: wrap; padding: 14px; border-radius: 12px; background: var(--gut-soft); }
.callback-row .field { flex: 0 1 240px; }
.quick-times { display: flex; gap: 6px; flex-wrap: wrap; }
.dispatch { border-top: 1px solid var(--line); padding-top: 18px; margin-top: 18px; display: grid; gap: 12px; }
.dispatch-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.lead-actions { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; border-top: 1px solid var(--line); margin-top: 20px; padding-top: 18px; }
.lead-actions .btn-primary { min-height: 50px; padding: 0 26px; font-size: 1.02rem; }
.search { position: relative; max-width: 520px; margin: 26px auto 0; text-align: left; }
.search > .ic { position: absolute; left: 14px; top: 12px; color: var(--muted); }
.search input { padding-left: 42px; border-radius: 999px; }
.search-results { position: absolute; z-index: 10; left: 0; right: 0; top: 50px; list-style: none; margin: 0; padding: 6px; background: var(--surface); border: 1px solid var(--line-2); border-radius: 14px; box-shadow: 0 12px 32px rgba(17, 19, 22, .12); }
.search-results button { width: 100%; text-align: left; display: flex; justify-content: space-between; gap: 10px; padding: 10px 12px; border: 0; border-radius: 10px; background: none; cursor: pointer; }
.search-results button:hover, .search-results button:focus-visible { background: var(--surface-2); }
.cb-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.cb-list li { display: flex; align-items: center; gap: 12px; }
.cb-list button { width: 100%; display: flex; align-items: center; gap: 12px; padding: 10px; border: 0; border-radius: 10px; background: none; cursor: pointer; text-align: left; }
.cb-list button:hover { background: var(--surface-2); }
.cb-list time { font-weight: 700; font-stretch: 110%; min-width: 48px; }
.cb-list .is-overdue time { color: var(--red); }
.cb-main { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.cb-main b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cb-list-lg li { padding: 12px 0; border-bottom: 1px solid var(--line); }
.cb-list-lg li:last-child { border-bottom: 0; }

/* ---------- Übersicht ---------- */
.today { display: grid; grid-template-columns: minmax(240px, 1fr) minmax(0, 1.4fr); gap: 24px 40px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-panel); padding: 26px 28px; }
.today-label { margin: 0; color: var(--muted); font-weight: 600; }
.today-number { margin: 4px 0 6px; font-size: clamp(3rem, 6vw, 4.4rem); line-height: 1; font-weight: 800; font-stretch: 122%; letter-spacing: -.03em; }
.today-number span { font-size: 1.1rem; font-weight: 600; font-stretch: 100%; letter-spacing: 0; color: var(--muted); }
.today-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 24px; margin: 0; align-content: center; }
.today-facts div { border-left: 2px solid var(--line-2); padding-left: 14px; }
.today-facts dt { color: var(--muted); font-size: .86rem; }
.today-facts dd { margin: 2px 0 0; font-size: 1.6rem; font-weight: 750; font-stretch: 114%; }
.hours { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(12, 1fr); gap: 6px; align-items: end; height: 92px; }
.hour { display: flex; flex-direction: column; align-items: center; gap: 4px; height: 100%; justify-content: flex-end; }
.hour span { width: 100%; max-width: 38px; min-height: 3px; height: var(--h, 0%); border-radius: 6px 6px 2px 2px; background: var(--ink); }
.hour small { color: var(--muted); font-size: .74rem; }

/* ---------- Live-Monitor ---------- */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-panel); padding: 16px 18px; display: grid; gap: 10px; }
.tile header { display: flex; align-items: center; gap: 10px; }
.tile header div { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.tile .state { font-size: .8rem; font-weight: 700; padding: 3px 10px; border-radius: 999px; background: var(--surface-2); }
.tile-ready .state { background: var(--gut-soft); color: var(--gut); }
.tile-busy { border-color: rgba(225, 48, 43, .3); }
.tile-busy .state { background: var(--red-soft); color: var(--red-hover); }
.tile-pause .state { background: var(--offen-soft); color: var(--offen); }
.tile-offline { opacity: .6; }
.tile-lead { margin: 0; font-weight: 600; min-height: 1.5em; }

/* ---------- Leads, Filter ---------- */
.status-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.status-tabs a { display: inline-flex; gap: 8px; align-items: center; min-height: 36px; padding: 0 14px; border-radius: 999px; text-decoration: none; border: 1px solid var(--line); background: var(--surface); font-weight: 500; font-size: .9rem; }
.status-tabs a b { font-weight: 700; color: var(--muted); }
.status-tabs a.is-active { background: var(--ink); color: #fff; border-color: var(--ink); }
.status-tabs a.is-active b { color: rgba(255, 255, 255, .7); }
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: end; }
.filters .field { flex: 0 1 200px; }
.filters .grow { flex: 1 1 280px; }
.pager { display: flex; align-items: center; justify-content: center; gap: 14px; }

/* ---------- Import ---------- */
.steps { list-style: none; margin: 0; padding: 0; display: flex; gap: 8px; flex-wrap: wrap; }
.steps li { display: inline-flex; align-items: center; gap: 10px; padding: 8px 16px 8px 8px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); color: var(--muted); font-weight: 600; }
.steps b { width: 26px; height: 26px; border-radius: 999px; display: inline-grid; place-items: center; background: var(--surface-2); font-size: .82rem; }
.steps .is-current { color: var(--ink); border-color: var(--ink); }
.steps .is-current b { background: var(--red); color: #fff; }
.steps .is-done b { background: var(--ink); color: #fff; }
.dropzone { position: relative; display: grid; place-items: center; gap: 6px; min-height: 140px; padding: 24px; border: 2px dashed var(--line-2); border-radius: var(--r-panel); background: var(--paper); text-align: center; cursor: pointer; }
.dropzone:hover, .dropzone.is-over { border-color: var(--ink); }
.dropzone input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.dropzone:focus-within { box-shadow: var(--focus); }
.map-table th { vertical-align: top; min-width: 170px; }
.map-table .map-head { display: block; margin-bottom: 6px; color: var(--ink); font-weight: 700; }
.map-table select { width: 100%; min-height: 38px; border-radius: 8px; border: 1px solid var(--line-2); padding: 0 8px; background: var(--surface); }
.map-table th.is-unmapped { background: var(--warn-soft); }
.result-facts { display: flex; flex-wrap: wrap; gap: 12px 32px; margin: 14px 0 18px; }
.result-facts dt { color: var(--muted); font-size: .86rem; }
.result-facts dd { margin: 0; font-size: 1.8rem; font-weight: 800; font-stretch: 116%; }

/* ---------- Chat ---------- */
.drawer-scrim { position: fixed; inset: 0; z-index: 40; background: rgba(18, 20, 24, .25); }
.drawer {
  position: fixed; z-index: 41; top: 0; right: 0; bottom: 0; width: min(420px, 100vw);
  display: flex; flex-direction: column; background: var(--surface); border-left: 1px solid var(--line);
  box-shadow: -18px 0 48px rgba(17, 19, 22, .12); animation: slidein .25s var(--ease);
}
@keyframes slidein { from { transform: translateX(24px); opacity: 0; } }
.drawer-head { display: flex; gap: 8px; align-items: center; padding: 14px; border-bottom: 1px solid var(--line); }
.room-select { flex: 1; min-height: 44px; border-radius: 999px; font-weight: 600; }
.chat-log { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px; background: var(--paper); }
.chat-day { align-self: center; font-size: .76rem; color: var(--muted); background: var(--surface); padding: 2px 10px; border-radius: 999px; border: 1px solid var(--line); }
.msg { display: flex; gap: 8px; max-width: 88%; }
.msg .avatar { width: 30px; height: 30px; font-size: .7rem; }
.msg-body { background: var(--surface); border: 1px solid var(--line); border-radius: 14px 14px 14px 4px; padding: 8px 12px; min-width: 0; }
.msg-body p { margin: 2px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.msg-meta { font-size: .76rem; color: var(--muted); }
.msg-meta b { color: var(--ink); font-weight: 650; margin-right: 6px; }
.msg.is-mine { align-self: flex-end; flex-direction: row-reverse; }
.msg.is-mine .msg-body { background: var(--ink); color: #fff; border-color: var(--ink); border-radius: 14px 14px 4px 14px; }
.msg.is-mine .msg-meta, .msg.is-mine .msg-meta b { color: rgba(255, 255, 255, .7); }
.chat-form { display: flex; gap: 8px; align-items: flex-end; padding: 12px; border-top: 1px solid var(--line); background: var(--surface); }
.chat-form textarea { flex: 1; min-height: 44px; max-height: 160px; resize: none; padding: 11px 14px; border: 1px solid var(--line-2); border-radius: 22px; }
.chat-form textarea:focus { outline: none; border-color: var(--ink); box-shadow: var(--focus); }
.chat-empty { margin: auto; color: var(--muted); text-align: center; max-width: 30ch; }
.chat-page { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 20px; height: calc(100vh - 72px - 28px - 56px); min-height: 480px; }
.chat-rooms { overflow-y: auto; padding: 18px 12px; }
.chat-rooms h2 { font-size: .86rem; color: var(--muted); padding: 0 10px; margin: 6px 0 8px; font-stretch: 100%; }
.room-list { list-style: none; margin: 0 0 18px; padding: 0; display: grid; gap: 2px; }
.room-list button { width: 100%; display: flex; align-items: center; gap: 10px; min-height: 42px; padding: 0 10px; border: 0; border-radius: 10px; background: none; cursor: pointer; text-align: left; font-weight: 500; }
.room-list button:hover { background: var(--surface-2); }
.room-list button.is-active { background: var(--ink); color: #fff; }
.room-list .badge { margin-left: auto; }
.room-hash { width: 30px; text-align: center; color: var(--muted); font-weight: 700; }
.room-list button.is-active .room-hash { color: rgba(255, 255, 255, .6); }
.chat-main { display: flex; flex-direction: column; padding: 0; overflow: hidden; }
.chat-main-head { padding: 16px 20px; border-bottom: 1px solid var(--line); }

.search-none { padding: 10px; }

/* ---------- Meldungen ---------- */
.toasts { position: fixed; z-index: 60; left: 50%; bottom: 24px; transform: translateX(-50%); display: grid; gap: 8px; width: min(460px, calc(100vw - 32px)); pointer-events: none; }
.toast { margin: 0; padding: 12px 18px; border-radius: 14px; background: var(--ink); color: #fff; font-weight: 500; box-shadow: 0 12px 32px rgba(17, 19, 22, .25); animation: rise .25s var(--ease); }
.toast-error { background: var(--red-hover); }
@keyframes rise { from { transform: translateY(8px); opacity: 0; } }

/* ---------- Kleine Bildschirme ---------- */
@media (max-width: 1560px) {
  .phone-pill { display: none; }
  .callbar { gap: 14px 20px; }
}
@media (max-width: 1180px) {
  .ws-grid { grid-template-columns: 1fr; }
  .ws-side { position: static; }
  .split, .split-wide { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  :root { --nav-w: 0px; }
  .shell { grid-template-columns: 1fr; }
  .nav { position: fixed; z-index: 50; left: 0; top: 0; width: 280px; transform: translateX(-100%); transition: transform .25s var(--ease); }
  .nav.is-open { transform: none; box-shadow: 24px 0 48px rgba(0, 0, 0, .25); }
  .only-mobile { display: inline-grid; }
  .topbar { padding: 10px 16px; min-height: 64px; }
  .page-title { font-size: 1.25rem; }
  .content { padding: 18px 16px 48px; }
  .flashes { padding: 12px 16px 0; }
  .callbar { top: 64px; padding: 12px 14px; }
  .callbar-status { min-width: 0; }
  .callbar-actions { margin-left: 0; width: 100%; }
  .callbar-actions .btn-primary { flex: 1; }
  .phone-pill { display: none; }
  .lead-panel, .panel { padding: 18px 16px; }
  .form-grid, .form-grid.cols-3 { grid-template-columns: 1fr; }
  .span-2 { grid-column: auto; }
  .today { grid-template-columns: 1fr; padding: 20px 16px; }
  .chat-page { grid-template-columns: 1fr; height: auto; }
  .chat-rooms { max-height: 220px; }
  .chat-main { height: 70vh; padding: 0; }
  .panel.flush { padding: 0; }
  .auth-wrap { grid-template-columns: 1fr; gap: 24px; padding: 32px 16px; }
  .auth-claim { margin-top: 24px; }
  .lead-head { flex-direction: column; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
