/* ===== VARIABLES ===== */
:root {
  --navy:       #1a3f98;
  --navy-dark:  #132e72;
  --navy-light: #2a52b8;
  --gold:       #f5a800;
  --gold-light: #ffc533;
  --bg:         #f0f2f7;
  --surface:    #ffffff;
  --border:     #dde2ec;
  --text:       #1a1f36;
  --text-muted: #6b7280;
  --sidebar-w:  240px;
  --radius:     10px;
  --shadow:     0 2px 8px rgba(0,0,0,.08);
  --green:      #16a34a;
  --red:        #dc2626;
  --blue:       #2563eb;
}

/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; }
body {
  font-family: 'Open Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}
a { color: var(--navy); text-decoration: none; }
a:hover { text-decoration: underline; }
button { cursor: pointer; font-family: inherit; }
input, select, textarea { font-family: inherit; }

/* ===== LAYOUT ===== */
.sidebar {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: var(--sidebar-w);
  background: var(--navy);
  color: #fff;
  display: flex;
  flex-direction: column;
  z-index: 300;
  overflow-y: auto;
}

.main-content {
  margin-left: var(--sidebar-w);
  min-height: 100vh;
  padding: 24px 28px;
}

/* ===== SIDEBAR ===== */
.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 18px 16px;
  border-bottom: 1px solid rgba(255,255,255,.12);
}
.sidebar-logo img { height: 32px; filter: brightness(0) invert(1); }
.sidebar-app-name {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .08em;
  opacity: .7;
  text-transform: uppercase;
}

.sidebar-nav { flex: 1; padding: 12px 0; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 18px;
  color: rgba(255,255,255,.8);
  font-size: 13.5px;
  font-weight: 500;
  border-radius: 0;
  transition: background .15s, color .15s;
  cursor: pointer;
  text-decoration: none;
}
.nav-item:hover { background: rgba(255,255,255,.08); color: #fff; text-decoration: none; }
.nav-item.active { background: rgba(255,255,255,.15); color: #fff; font-weight: 600; }
.nav-item-cta {
  margin: 6px 12px;
  padding: 9px 14px;
  border-radius: 8px;
  background: var(--gold);
  color: var(--navy-dark) !important;
  font-weight: 700;
  justify-content: center;
}
.nav-item-cta:hover { background: var(--gold-light); }
.nav-item-admin { color: rgba(255,255,255,.6); font-size: 13px; }
.nav-divider { height: 1px; background: rgba(255,255,255,.1); margin: 8px 0; }

.nav-badge {
  margin-left: auto;
  min-width: 20px;
  padding: 1px 6px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 700;
  text-align: center;
}
.nav-badge-muted { background: rgba(255,255,255,.15); }
.nav-badge-blue  { background: #3b82f6; }
.nav-badge-gold  { background: var(--gold); color: var(--navy-dark); }

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  border-top: 1px solid rgba(255,255,255,.12);
}
.sidebar-user-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: rgba(255,255,255,.2);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 14px;
  flex-shrink: 0;
}
.sidebar-user-info { flex: 1; min-width: 0; }
.sidebar-user-info strong { display: block; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user-info span { font-size: 11px; opacity: .6; }
.sidebar-logout {
  color: rgba(255,255,255,.6);
  display: flex; align-items: center;
  transition: color .15s;
}
.sidebar-logout:hover { color: #fff; }

/* ===== TOPBAR MOBILE ===== */
.topbar-mobile {
  display: none;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}
.sidebar-toggle {
  background: none; border: 1px solid var(--border);
  border-radius: 8px; padding: 6px;
  display: flex; align-items: center;
  color: var(--text);
}
.topbar-logo-mobile { height: 28px; }

/* ===== PAGE HEADER ===== */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}
.page-header-left { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.page-title { font-size: 22px; font-weight: 800; color: var(--text); }
.page-subtitle { color: var(--text-muted); font-size: 14px; }
.back-link {
  display: flex; align-items: center; gap: 4px;
  color: var(--text-muted); font-size: 13px;
  transition: color .15s;
}
.back-link:hover { color: var(--navy); text-decoration: none; }

/* ===== STATS BAR ===== */
.stats-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}
.stats-bar-lg { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  text-align: center;
}
.stat-card-blue  { border-top: 3px solid var(--blue); }
.stat-card-gold  { border-top: 3px solid var(--gold); }
.stat-card-green { border-top: 3px solid var(--green); }
.stat-card-red   { border-top: 3px solid var(--red); }
.stat-value { font-size: 26px; font-weight: 800; color: var(--navy); line-height: 1; }
.stat-label { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

/* ===== FILTER BAR ===== */
.filter-bar {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 16px;
  margin-bottom: 16px;
}
.filter-form {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.search-wrap {
  position: relative;
  flex: 1;
  min-width: 200px;
}
.search-wrap svg {
  position: absolute;
  left: 10px; top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}
.search-input {
  width: 100%;
  padding: 7px 10px 7px 34px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
  outline: none;
  background: var(--bg);
}
.search-input:focus { border-color: var(--navy); background: #fff; }
.filter-select {
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
  background: var(--bg);
  color: var(--text);
  outline: none;
}
.filter-select:focus { border-color: var(--navy); }

/* ── Multi-Filter-Dropdowns ────────────────────────────────────── */
.mf-wrap {
  position: relative;
  display: inline-block;
}
.mf-trigger {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  height: 34px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color .15s, background .15s;
}
.mf-trigger:hover { border-color: #9ca3af; }
.mf-wrap.mf-active .mf-trigger {
  border-color: var(--navy);
  background: #eff6ff;
  color: var(--navy);
  font-weight: 600;
}
.mf-wrap.mf-open .mf-trigger {
  border-color: var(--navy);
  box-shadow: 0 0 0 3px rgba(26,63,152,.12);
}
.mf-chevron { transition: transform .18s; flex-shrink: 0; }
.mf-wrap.mf-open .mf-chevron { transform: rotate(180deg); }

.mf-panel {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  min-width: 210px;
  max-width: 290px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  box-shadow: 0 8px 28px rgba(0,0,0,.13);
  z-index: 1100;
  overflow: hidden;
}
.mf-wrap.mf-open .mf-panel { display: block; }

.mf-options {
  max-height: 280px;
  overflow-y: auto;
  padding: 6px 0;
}
.mf-option {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 14px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text);
  transition: background .1s;
  user-select: none;
}
.mf-option:hover { background: #f9fafb; }
.mf-option input[type=checkbox] {
  width: 15px; height: 15px;
  accent-color: var(--navy);
  flex-shrink: 0;
  cursor: pointer;
}
.mf-opt-label { flex: 1; line-height: 1.3; }

.mf-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border-top: 1px solid #f3f4f6;
  background: #fafafa;
}
.mf-clear {
  background: none; border: none;
  color: #6b7280; font-size: 12px;
  cursor: pointer; padding: 3px 8px;
  border-radius: 5px;
  transition: color .15s, background .15s;
}
.mf-clear:hover { color: var(--navy); background: #eff6ff; }
.mf-apply {
  background: var(--navy); color: #fff;
  border: none; border-radius: 6px;
  font-size: 12px; font-weight: 600;
  padding: 5px 14px; cursor: pointer;
  transition: background .15s;
}
.mf-apply:hover { background: #153380; }

/* ===== TABLE ===== */
.table-wrapper {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.leads-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}
.leads-table thead th {
  padding: 11px 14px;
  background: var(--bg);
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.leads-table tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background .12s;
  cursor: pointer;
}
.leads-table tbody tr:last-child { border-bottom: none; }
.leads-table tbody tr:hover { background: #f5f7ff; }
.leads-table td { padding: 11px 14px; vertical-align: middle; }
.lead-name        { font-weight: 700; font-size: 14px; }
.lead-meta        { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.lead-meta-muted  { color: #9ca3af; }
.lead-company, .lead-phone, .lead-campaign { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.lead-vehicle { font-weight: 500; }
.lead-price   { font-size: 12px; color: var(--text-muted); }
.lead-date    { color: var(--text-muted); font-size: 12px; white-space: nowrap; }
.lead-actions { width: 1px; white-space: nowrap; }

/* ── Gruppe-Badge ─────────────────────────────────────────────── */
.gruppe-badge {
  display: inline-block;
  background: #e0e7ff; color: #3730a3;
  border-radius: 5px; padding: 2px 8px;
  font-size: 11px; font-weight: 600;
  white-space: nowrap; max-width: 120px;
  overflow: hidden; text-overflow: ellipsis;
}

/* Import-Zeitstempel auf Detailseite */
.import-ts { color: #6b7a99; font-size: 12px; }

/* ── Retargeting-Spalte (Übersicht) ───────────────────────────── */
.td-retargeting { max-width: 160px; }
.rt-overview-cell { display: flex; flex-direction: column; gap: 3px; }
.rt-notiz-chip {
  font-size: 11px; color: var(--text-muted);
  line-height: 1.3; cursor: default;
}
.rt-count-chip {
  display: inline-block;
  background: #fef3c7; color: #92400e;
  border-radius: 10px; padding: 1px 7px;
  font-size: 11px; font-weight: 700;
  width: fit-content;
}
.rt-none { color: var(--text-muted); font-size: 12px; }

/* ── Retargeting-Karte (Detail) ───────────────────────────────── */
.rt-history-count {
  background: #fef3c7; color: #92400e;
  border-radius: 10px; padding: 2px 9px;
  font-size: 12px; font-weight: 700;
}
.rt-import-info {
  margin: 0 0 10px; padding: 10px 14px;
  background: #f0f4ff; border-left: 3px solid var(--navy);
  border-radius: 0 8px 8px 0;
  display: flex; flex-direction: column; gap: 3px;
}
.rt-import-label {
  font-size: 11px; font-weight: 700;
  color: var(--navy); text-transform: uppercase; letter-spacing: .04em;
}
.rt-import-text { font-size: 13px; color: var(--text); line-height: 1.4; }

.rt-history-list {
  display: flex; flex-direction: column; gap: 6px;
  margin: 0 0 12px; padding: 0 0 12px;
  border-bottom: 1px solid var(--border);
}
.rt-history-item {
  background: var(--bg); border-radius: 8px;
  padding: 8px 12px; font-size: 13px;
}
.rt-history-meta {
  display: flex; justify-content: space-between;
  align-items: center; gap: 8px; margin-bottom: 3px;
}
.rt-history-channel { font-weight: 600; font-size: 12px; color: var(--text); }
.rt-history-date    { font-size: 11px; color: var(--text-muted); }
.rt-history-msg     { color: var(--text-muted); font-size: 12px; line-height: 1.4; }
.rt-channel-email    { border-left: 3px solid #2563eb; }
.rt-channel-whatsapp { border-left: 3px solid #25d366; }

.rt-send-section { padding-top: 4px; }
.action-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px;
  border-radius: 6px;
  color: var(--text-muted);
  transition: background .12s, color .12s;
}
.action-btn:hover { background: var(--bg); color: var(--navy); text-decoration: none; }

/* ── Lead-Selektion (Checkboxen) ───────────────────────────── */
.col-check { width: 36px; padding: 6px 8px !important; }
.lead-check, .lead-check-all {
  width: 16px; height: 16px; cursor: pointer;
  accent-color: var(--navy); flex-shrink: 0;
}
.leads-table tbody tr.rt-selected { background: #eef2ff !important; }
.leads-table tbody tr.rt-selected:hover { background: #e4e9ff !important; }

/* ── Selection Action Bar ───────────────────────────────────── */
.rt-select-bar {
  position: fixed; bottom: 0; left: var(--sidebar-w); right: 0;
  z-index: 400;
  background: var(--navy); color: #fff;
  padding: 12px 24px;
  display: flex; align-items: center; gap: 12px;
  box-shadow: 0 -4px 24px rgba(0,0,0,.18);
  animation: slideUp .18s ease;
}
@keyframes slideUp {
  from { transform: translateY(100%); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}
.rt-count-label { font-weight: 700; font-size: 14px; flex: 1; }
.rt-bar-btn {
  background: rgba(255,255,255,.15); border: 1px solid rgba(255,255,255,.3);
  color: #fff; border-radius: 7px; padding: 6px 14px;
  font-size: 13px; font-weight: 600; cursor: pointer;
  transition: background .15s;
}
.rt-bar-btn:hover { background: rgba(255,255,255,.25); }
.rt-wa-btn {
  background: #25d366; color: #fff; border: none;
  border-radius: 8px; padding: 8px 18px;
  font-size: 13.5px; font-weight: 700; cursor: pointer;
  display: inline-flex; align-items: center; gap: 7px;
  transition: background .15s; white-space: nowrap;
}
.rt-wa-btn:hover { background: #1ebe59; text-decoration: none; }
.rt-wa-btn-sm {
  background: #25d366; color: #fff; border: none;
  border-radius: 7px; padding: 5px 10px;
  font-size: 13px; cursor: pointer; flex-shrink: 0;
}
.rt-wa-btn-sm:disabled { background: #9ca3af; cursor: not-allowed; }

/* ── Delete + Export Buttons in Select-Bar ─────────────────── */
.rt-delete-btn {
  background: #dc2626; color: #fff; border: none;
  border-radius: 8px; padding: 7px 16px;
  font-size: 13.5px; font-weight: 700; cursor: pointer;
  display: inline-flex; align-items: center; gap: 7px;
  transition: background .15s; white-space: nowrap;
  flex-shrink: 0;
}
.rt-delete-btn:hover { background: #b91c1c; }
.rt-bar-divider {
  width: 1px; align-self: stretch;
  background: rgba(255,255,255,.25);
  flex-shrink: 0;
}

/* ── Status-Dropdown in der Select-Bar ──────────────────────── */
.rt-status-wrap { position: relative; flex-shrink: 0; }
.rt-status-trigger {
  display: inline-flex; align-items: center; gap: 5px;
}
.rt-status-dropdown {
  position: absolute;
  bottom: calc(100% + 8px); left: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,.18);
  padding: 6px;
  min-width: 170px;
  z-index: 500;
  animation: popIn .14s ease;
}
.rt-status-option {
  display: flex; align-items: center;
  width: 100%; padding: 6px 10px;
  background: none; border: none;
  border-radius: 7px; cursor: pointer;
  transition: background .12s;
  text-align: left;
}
.rt-status-option:hover { background: var(--bg); }

/* ── Delete Confirmation Modal ──────────────────────────────── */
#del-confirm-overlay {
  position: fixed; inset: 0; z-index: 700;
  background: rgba(0,0,0,.45);
  display: flex; align-items: center; justify-content: center;
}
.del-confirm-modal {
  background: var(--surface); border-radius: 14px;
  width: 420px; max-width: 95vw;
  box-shadow: 0 20px 60px rgba(0,0,0,.22);
  overflow: hidden;
  animation: popIn .18s ease;
}
.del-confirm-header {
  background: linear-gradient(135deg, #dc2626, #b91c1c);
  color: #fff; padding: 18px 22px;
  display: flex; align-items: center; gap: 10px;
}
.del-confirm-header h3 { margin: 0; font-size: 15px; font-weight: 700; }
.del-confirm-body { padding: 20px 22px; }
.del-confirm-body p { margin: 0 0 10px; font-size: 14px; color: var(--text-muted); }
#del-confirm-list {
  list-style: none; padding: 0; margin: 0 0 6px;
  max-height: 180px; overflow-y: auto;
  border: 1px solid var(--border); border-radius: 8px;
  background: #fef2f2;
}
#del-confirm-list li {
  padding: 7px 12px; font-size: 13px;
  border-bottom: 1px solid #fee2e2; color: #7f1d1d;
}
#del-confirm-list li:last-child { border-bottom: none; }
.del-confirm-footer {
  padding: 14px 22px 18px;
  display: flex; justify-content: flex-end; gap: 10px;
}

/* ── Retargeting Panel ──────────────────────────────────────── */
#rt-panel-overlay {
  position: fixed; inset: 0; z-index: 600;
  background: rgba(0,0,0,.38);
  display: flex; justify-content: flex-end;
}
.rt-panel {
  width: 540px; max-width: 98vw;
  background: var(--surface); height: 100%;
  display: flex; flex-direction: column;
  box-shadow: -8px 0 40px rgba(0,0,0,.2);
  animation: rtSlideIn .2s ease;
}
@keyframes rtSlideIn {
  from { transform: translateX(100%); }
  to   { transform: translateX(0); }
}
.rt-panel-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid var(--border);
  background: var(--bg); gap: 12px; flex-shrink: 0;
}
.rt-panel-close {
  background: none; border: none; font-size: 18px; line-height: 1;
  color: var(--text-muted); cursor: pointer; padding: 3px 6px;
  border-radius: 5px; transition: background .1s; flex-shrink: 0;
}
.rt-panel-close:hover { background: var(--border); }
.rt-items-list {
  flex: 1; overflow-y: auto; padding: 16px;
  display: flex; flex-direction: column; gap: 14px;
}
.rt-loading {
  text-align: center; color: var(--text-muted);
  padding: 40px; font-size: 14px;
}
.rt-item {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; overflow: hidden;
}
.rt-item-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  padding: 11px 14px 8px; gap: 10px; background: var(--bg);
}
.rt-item-name { font-weight: 700; font-size: 14px; }
.rt-item-meta { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.rt-item-acts { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.rt-textarea {
  width: 100%; border: none; border-top: 1px solid var(--border);
  padding: 12px 14px; font-size: 13px; font-family: inherit;
  resize: vertical; min-height: 150px; line-height: 1.65;
  color: var(--text); background: #fff; outline: none;
}
.rt-textarea:focus { background: #fafbff; }
.rt-status-dot {
  width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0;
}
.rt-status-pending    { background: #d1d5db; }
.rt-status-generating { background: #f59e0b; animation: rtPulse 1s infinite; }
.rt-status-ready      { background: #3b82f6; }
.rt-status-sent       { background: #16a34a; }
.rt-status-error      { background: #dc2626; }
@keyframes rtPulse { 0%,100%{opacity:1}50%{opacity:.3} }
.rt-panel-footer {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; padding: 14px 20px;
  border-top: 1px solid var(--border);
  background: var(--bg); flex-shrink: 0;
}

/* ── Quick-Contact Buttons ─────────────────────────────────── */
.contact-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px;
  border-radius: 6px;
  border: none;
  background: var(--bg);
  color: var(--text-muted);
  cursor: pointer;
  transition: background .12s, color .12s;
  flex-shrink: 0;
}
.contact-btn:hover          { color: #fff; }
.contact-btn-phone:hover    { background: #16a34a; }
.contact-btn-email:hover    { background: #2563eb; }
.contact-btn-whatsapp:hover { background: #25d366; }

/* ── Last-Contact Chip ─────────────────────────────────────── */
.last-contact-chip { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.lc-row { display: flex; align-items: center; gap: 5px; }
.lc-icon { font-size: 12px; flex-shrink: 0; }
.lc-text {
  font-size: 12px; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  max-width: 130px;
}
.lc-meta { font-size: 10.5px; color: var(--text-muted); white-space: nowrap; }
.lc-none { color: var(--text-muted); font-size: 12px; }
.td-last-contact { max-width: 160px; }

/* ── Quick-Contact Modal ───────────────────────────────────── */
.qc-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 1000;
  display: flex; align-items: center; justify-content: center;
}
.qc-modal {
  background: #fff;
  border-radius: 14px;
  width: 440px; max-width: 95vw;
  box-shadow: 0 12px 40px rgba(0,0,0,.22);
  overflow: hidden;
  animation: qcIn .15s ease;
}
@keyframes qcIn {
  from { opacity:0; transform: scale(.96) translateY(6px); }
  to   { opacity:1; transform: scale(1)  translateY(0); }
}
.qc-modal-header {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}
.qc-type-badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12.5px; font-weight: 700;
  white-space: nowrap;
}
.qc-type-call      { background: #d1fae5; color: #065f46; }
.qc-type-email     { background: #dbeafe; color: #1e40af; }
.qc-type-whatsapp  { background: #dcfce7; color: #166534; }
.qc-lead-name {
  flex: 1; font-weight: 700; font-size: 14px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.qc-close {
  background: none; border: none; font-size: 18px; line-height: 1;
  color: var(--text-muted); cursor: pointer; padding: 2px 4px;
  border-radius: 4px; transition: background .1s;
}
.qc-close:hover { background: var(--border); }
.qc-modal-body { padding: 16px 18px; display: flex; flex-direction: column; gap: 10px; }
.qc-ts {
  display: flex; align-items: center; gap: 6px;
  font-size: 12px; color: var(--text-muted);
}
.qc-textarea {
  width: 100%; border: 1px solid var(--border); border-radius: 8px;
  padding: 10px 12px; font-size: 13.5px; font-family: inherit;
  resize: vertical; min-height: 90px; color: var(--text);
  outline: none; transition: border .15s;
  line-height: 1.5;
}
.qc-textarea:focus { border-color: var(--navy); box-shadow: 0 0 0 3px rgba(26,63,152,.08); }
.qc-modal-footer {
  display: flex; justify-content: flex-end; gap: 8px;
  padding: 12px 18px;
  border-top: 1px solid var(--border);
  background: var(--bg);
}
.qc-hint { font-size: 11.5px; color: var(--text-muted); margin-top: 2px; }
.qc-sc-link {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 14px;
  background: #dcfce7; color: #166534;
  border: 1px solid #bbf7d0;
  border-radius: 8px;
  font-size: 13px; font-weight: 600;
  text-decoration: none; cursor: pointer;
  transition: background .15s;
  margin-bottom: 4px;
}
.qc-sc-link:hover { background: #bbf7d0; text-decoration: none; color: #14532d; }
.qc-sc-hint {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 12px; color: #166534;
  background: #f0fdf4; border: 1px solid #bbf7d0;
  border-radius: 6px; padding: 5px 10px;
  margin-top: 6px; margin-left: 2px;
  animation: fadeInUp .2s ease;
}
.qc-email-link {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 14px;
  background: #eff6ff; color: #1d4ed8;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  font-size: 13px; font-weight: 600;
  text-decoration: none; cursor: pointer;
  transition: background .15s;
  margin-bottom: 4px;
}
.qc-email-link:hover { background: #dbeafe; color: #1e3a8a; }

/* WV-Sektion im Quick-Contact Modal */
.qc-wv-toggle { padding-top: 6px; }
.qc-wv-check {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 13px; color: var(--text-muted);
  cursor: pointer; user-select: none;
}
.qc-wv-check input[type="checkbox"] {
  width: 15px; height: 15px; cursor: pointer;
  accent-color: var(--navy); flex-shrink: 0;
}
.qc-wv-check:hover { color: var(--navy); }
#qc-wv-section {
  margin-top: 10px; padding: 14px;
  background: var(--bg); border-radius: 8px;
  border: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 10px;
}
.qc-wv-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.qc-wv-field { display: flex; flex-direction: column; gap: 4px; }
.qc-wv-label {
  font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .04em;
  color: var(--text-muted);
}
.qc-input {
  padding: 7px 10px;
  border: 1px solid var(--border); border-radius: 7px;
  font-size: 13.5px; font-family: inherit;
  color: var(--text); background: #fff; outline: none;
  width: 100%; transition: border .15s;
}
.qc-input:focus { border-color: var(--navy); }

/* ===== BADGES ===== */
.status-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
}
.status-neu             { background: #dbeafe; color: #1d4ed8; }
.status-nicht-erreicht  { background: #fef3c7; color: #92400e; }
.status-kein-kontakt    { background: #f3e8ff; color: #6b21a8; }
.status-lead-liste-alt  { background: #f1f5f9; color: #475569; }
.status-in-kontakt      { background: #cffafe; color: #155e75; }
.status-disqualifiziert { background: #fee2e2; color: #991b1b; }
.status-konvertiert     { background: #d1fae5; color: #065f46; border: 1.5px solid #16a34a; }

.source-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  background: #e5e7eb;
  color: #374151;
}
.source-meta_form   { background: #ede9fe; color: #5b21b6; }
.source-lp_caddy    { background: #dbeafe; color: #1e40af; }
.source-lp_crafter  { background: #dbeafe; color: #1e40af; }
.source-manuell     { background: #f3f4f6; color: #6b7280; }
.source-leasingmarkt{ background: #fef3c7; color: #92400e; }
.source-mobile_de   { background: #dcfce7; color: #166534; }

.assign-chip {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 700;
  background: var(--navy);
  color: #fff;
}
/* Philipp → Blau */
.assign-chip.user-1 { background: #1d4ed8; color: #fff; }
/* Matthias → Gelb */
.assign-chip.user-2 { background: #f59e0b; color: #1c1917; }
/* Lea-Sofie → Lila */
.assign-chip.user-3 { background: #7c3aed; color: #fff; }

.assign-empty { color: var(--text-muted); }

.wv-chip {
  font-size: 12px; font-weight: 600;
  background: #f3f4f6;
  padding: 2px 8px;
  border-radius: 8px;
}
.wv-overdue { background: #fee2e2; color: var(--red); }
.wv-today   { background: #fef3c7; color: #92400e; }

/* ===== EMPTY STATE ===== */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 60px 24px;
  color: var(--text-muted);
  gap: 12px;
}
.empty-state h3 { font-size: 17px; color: var(--text); }

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 600;
  border: none;
  transition: background .15s, opacity .15s;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
}
.btn:hover { text-decoration: none; opacity: .9; }
.btn-primary { background: var(--navy); color: #fff; }
.btn-primary:hover { background: var(--navy-dark); opacity: 1; }
.btn-secondary { background: var(--bg); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { background: #e8eaf2; opacity: 1; }
.btn-ghost { background: transparent; color: var(--text-muted); border: 1px solid var(--border); }
.btn-ghost:hover { background: var(--bg); opacity: 1; }
.btn-danger { background: var(--red); color: #fff; }
.btn-sm { padding: 6px 12px; font-size: 12.5px; }
.btn-block { width: 100%; justify-content: center; }
.btn-block + .btn-block, .mt-1 { margin-top: 6px; }
.mt-2 { margin-top: 10px; }
.mt-4 { margin-top: 24px; }

/* ===== FLASH MESSAGES ===== */
.flash-container { margin-bottom: 16px; display: flex; flex-direction: column; gap: 8px; }
.flash {
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 13.5px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.flash button { background: none; border: none; font-size: 16px; cursor: pointer; opacity: .6; }
.flash-success { background: #d1fae5; color: #065f46; }
.flash-error   { background: #fee2e2; color: #991b1b; }
.flash-info    { background: #dbeafe; color: #1d4ed8; }
.flash-warning { background: #fef3c7; color: #92400e; }

/* ===== FORMS ===== */
.form-group { display: flex; flex-direction: column; gap: 5px; margin-bottom: 14px; }
.form-group label { font-size: 12.5px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: .04em; }
.form-control {
  padding: 8px 11px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  outline: none;
  background: #fff;
  color: var(--text);
  width: 100%;
  transition: border-color .15s;
}
.form-control:focus { border-color: var(--navy); box-shadow: 0 0 0 3px rgba(26,63,152,.1); }
textarea.form-control { resize: vertical; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-section { margin-bottom: 24px; }
.form-section-title {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  padding-bottom: 8px;
  margin-bottom: 14px;
}
.form-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}
.form-page { max-width: 720px; }
.form-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
}

/* ===== LEAD DETAIL LAYOUT ===== */
.detail-grid {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 20px;
  align-items: start;
}
.detail-main, .detail-sidebar { display: flex; flex-direction: column; gap: 16px; }

.detail-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.detail-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}
.detail-card-header h2 { font-size: 13.5px; font-weight: 700; }

.detail-card-body { padding: 16px 18px; }
.detail-card-body .form-group:last-of-type { margin-bottom: 0; }
.detail-fields { padding: 4px 0; }
.detail-row {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 8px;
  padding: 10px 18px;
  border-bottom: 1px solid var(--border);
}
.detail-row:last-child { border-bottom: none; }
.detail-row-block { grid-template-columns: 1fr; }
.detail-label { font-size: 12px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: .04em; padding-top: 2px; }
.detail-value { font-size: 14px; }
.detail-message { white-space: pre-wrap; background: var(--bg); padding: 8px 10px; border-radius: 6px; font-size: 13px; }

/* ===== TIMELINE ===== */
.timeline { padding: 8px 18px; }
.timeline-item {
  display: flex;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.timeline-item:last-child { border-bottom: none; }
.timeline-icon {
  width: 28px; height: 28px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--bg);
  display: flex; align-items: center; justify-content: center;
  color: var(--navy);
  margin-top: 2px;
}
.timeline-desc { font-size: 13.5px; }
.timeline-meta { font-size: 11.5px; color: var(--text-muted); margin-top: 3px; }
.timeline-empty { padding: 20px 0; color: var(--text-muted); font-size: 13px; text-align: center; }

/* ===== STATUS BUTTONS ===== */
.status-buttons { display: flex; flex-wrap: wrap; gap: 6px; padding: 14px 18px 0; }
.status-btn {
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  border: 2px solid transparent;
  transition: all .15s;
  cursor: pointer;
}
.status-btn-neu             { background: #dbeafe; color: #1d4ed8; }
.status-btn-nicht-erreicht  { background: #fef3c7; color: #92400e; }
.status-btn-kein-kontakt    { background: #f3e8ff; color: #6b21a8; }
.status-btn-lead-liste-alt  { background: #f1f5f9; color: #475569; }
.status-btn-in-kontakt      { background: #cffafe; color: #155e75; }
.status-btn-disqualifiziert { background: #fee2e2; color: #991b1b; }
.status-btn-konvertiert     { background: #d1fae5; color: #065f46; border: 1.5px solid #16a34a; }
.status-btn.active { border-color: currentColor; font-weight: 700; }

/* ===== RETARGETING ===== */
.retargeting-tabs { display: flex; gap: 0; border-bottom: 1px solid var(--border); }
.tab-btn {
  flex: 1;
  padding: 9px;
  background: none; border: none;
  font-size: 13px; font-weight: 600;
  color: var(--text-muted);
  border-bottom: 2px solid transparent;
  transition: color .15s, border-color .15s;
}
.tab-btn.active { color: var(--navy); border-bottom-color: var(--navy); }
.retargeting-actions { display: flex; gap: 8px; justify-content: space-between; margin-top: 8px; }
#retargeting-form { padding: 14px 18px; }
.rt-status { padding: 8px 10px; border-radius: 6px; font-size: 13px; margin-top: 8px; }
.rt-ok  { background: #d1fae5; color: #065f46; }
.rt-err { background: #fee2e2; color: #991b1b; }

/* ===== ADMIN ===== */
.admin-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.admin-empty {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 24px 18px;
  color: var(--text-muted);
  font-size: 13.5px;
}
.admin-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.admin-table thead th {
  padding: 10px 16px;
  background: var(--bg);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}
.admin-table tbody tr { border-bottom: 1px solid var(--border); }
.admin-table tbody tr:last-child { border-bottom: none; }
.admin-table td { padding: 10px 16px; }
.chart-container { padding: 16px 18px; }
.text-green { color: var(--green); font-weight: 600; }
.text-red   { color: var(--red); font-weight: 600; }
.text-muted { color: var(--text-muted); }
.text-center { text-align: center; }
.text-sm { font-size: 12px; }
.py-2 { padding-top: 12px; padding-bottom: 12px; }

/* ===== IMPORT ===== */
.import-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 20px; }
.import-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.import-card h3 { font-size: 16px; font-weight: 700; }
.import-card p { font-size: 13.5px; color: var(--text-muted); }
.import-card-icon {
  width: 52px; height: 52px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
}
.import-icon-sheets  { background: #d1fae5; color: #065f46; }
.import-icon-meta    { background: #ede9fe; color: #5b21b6; }
.import-icon-webhook { background: #dbeafe; color: #1d4ed8; }
.import-info { background: var(--bg); border-radius: 6px; padding: 8px 12px; }
.import-info code { font-size: 12px; word-break: break-all; }

/* ===== INFOS & WERBEANZEIGEN ===== */
.info-section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--text-muted);
  margin-bottom: 14px;
}
.info-badge {
  background: #dbeafe;
  color: #1d4ed8;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 20px;
  text-transform: none;
  letter-spacing: 0;
}

/* Landing Page Cards */
.lp-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
  margin-bottom: 8px;
}
.lp-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: var(--shadow);
  transition: box-shadow .15s;
}
.lp-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,.12); }
.lp-card-icon {
  width: 46px; height: 46px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}
.lp-card-body { flex: 1; min-width: 0; }
.lp-card-title { font-weight: 700; font-size: 14px; }
.lp-card-sub   { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.lp-card-actions { flex-shrink: 0; }

/* Drive Embed */
.drive-embed-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.drive-embed-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg);
}
.drive-open-btn {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 600;
  color: var(--navy);
  padding: 4px 10px;
  border-radius: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  text-decoration: none;
  transition: background .15s;
}
.drive-open-btn:hover { background: #f0f4ff; text-decoration: none; }
.drive-iframe {
  width: 100%;
  height: 580px;
  border: none;
  display: block;
}
.drive-hint {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 8px;
}
.drive-placeholder {
  background: var(--surface);
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 48px 32px;
  text-align: center;
  color: var(--text-muted);
}
.drive-placeholder svg { margin-bottom: 12px; opacity: .4; }
.drive-placeholder h3 { font-size: 16px; color: var(--text); margin-bottom: 8px; }
.drive-placeholder p  { font-size: 13px; margin-bottom: 8px; }
.drive-env-hint {
  display: inline-block;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px 14px;
  font-size: 13px;
  font-family: monospace;
}

/* ===== LOGIN ===== */
.login-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.login-container { width: 100%; max-width: 380px; padding: 24px; }
.login-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 36px 32px;
  box-shadow: 0 8px 32px rgba(0,0,0,.1);
}
.login-logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin-bottom: 28px;
}
.login-logo img { height: 40px; }
.login-app-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .12em;
  color: var(--text-muted);
  text-transform: uppercase;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
  .detail-grid  { grid-template-columns: 1fr; }
  .admin-grid   { grid-template-columns: 1fr; }
  .form-row     { grid-template-columns: 1fr; }
  .detail-sidebar { order: -1; }
}

@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); transition: transform .25s; }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; padding: 16px; }
  .topbar-mobile { display: flex; }
  .stats-bar { grid-template-columns: repeat(2, 1fr); }
  .stats-bar-lg { grid-template-columns: repeat(2, 1fr); }
  .filter-form { flex-direction: column; align-items: stretch; }
  .search-wrap { min-width: 0; }
  .leads-table thead th:nth-child(n+5),
  .leads-table tbody td:nth-child(n+5) { display: none; }
  .page-title { font-size: 18px; }
}

/* ===== KONTAKTHISTORIE POPUP ===== */
.hist-modal {
  background: #f8fafc;
  border-radius: 16px;
  box-shadow: 0 24px 64px rgba(0,0,0,.22);
  width: 540px;
  max-width: 96vw;
  max-height: 84vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: qcIn .18s ease;
}

/* ── Header: dunkler Navy-Hintergrund ── */
.hist-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 18px 20px 16px;
  gap: 12px;
  flex-shrink: 0;
  background: linear-gradient(135deg, #1a3f98 0%, #122d72 100%);
}
.hist-modal-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 700;
  color: #fff;
}
.hist-modal-title svg { opacity: .85; }
.hist-modal-lead {
  font-size: 13.5px;
  color: rgba(255,255,255,.75);
  margin-top: 4px;
  font-weight: 500;
}
.hist-modal-header .qc-close {
  color: rgba(255,255,255,.7);
  background: rgba(255,255,255,.12);
  border: none;
}
.hist-modal-header .qc-close:hover {
  color: #fff;
  background: rgba(255,255,255,.22);
}

/* ── Scroll-Body ── */
.hist-body {
  overflow-y: auto;
  padding: 10px 12px 12px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.hist-loading, .hist-empty {
  padding: 36px 20px;
  text-align: center;
  color: #94a3b8;
  font-size: 13.5px;
}

/* ── Einzelner Eintrag ── */
.hist-entry {
  display: flex;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 10px;
  border-left: 4px solid transparent;
  transition: filter .12s;
}
.hist-entry:hover { filter: brightness(.97); }
.hist-entry-left { flex-shrink: 0; }
.hist-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  font-size: 16px;
}
.hist-entry-right { flex: 1; min-width: 0; }
.hist-entry-top {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 5px;
}
.hist-type-label {
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: .05em;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 5px;
}
.hist-ts {
  font-size: 11.5px;
  color: #64748b;
  margin-left: auto;
  white-space: nowrap;
}
.hist-entry-text {
  font-size: 13px;
  line-height: 1.55;
  word-break: break-word;
}

/* ── Farb-Themes je Typ ── */
/* Anruf – Blau */
.hist-entry.hist-call {
  background: #eff6ff;
  border-left-color: #3b82f6;
}
.hist-entry.hist-call .hist-icon     { background: #dbeafe; }
.hist-entry.hist-call .hist-type-label { background: #bfdbfe; color: #1e40af; }
.hist-entry.hist-call .hist-entry-text { color: #1e3a8a; }

/* E-Mail – Indigo */
.hist-entry.hist-email {
  background: #eef2ff;
  border-left-color: #6366f1;
}
.hist-entry.hist-email .hist-icon     { background: #e0e7ff; }
.hist-entry.hist-email .hist-type-label { background: #c7d2fe; color: #3730a3; }
.hist-entry.hist-email .hist-entry-text { color: #312e81; }

/* WhatsApp – Grün */
.hist-entry.hist-whatsapp {
  background: #f0fdf4;
  border-left-color: #22c55e;
}
.hist-entry.hist-whatsapp .hist-icon     { background: #dcfce7; }
.hist-entry.hist-whatsapp .hist-type-label { background: #bbf7d0; color: #15803d; }
.hist-entry.hist-whatsapp .hist-entry-text { color: #14532d; }

/* Notiz – Gelb */
.hist-entry.hist-note {
  background: #fefce8;
  border-left-color: #eab308;
}
.hist-entry.hist-note .hist-icon     { background: #fef9c3; }
.hist-entry.hist-note .hist-type-label { background: #fde68a; color: #92400e; }
.hist-entry.hist-note .hist-entry-text { color: #78350f; }

/* Retargeting – Lila */
.hist-entry.hist-retargeting {
  background: #faf5ff;
  border-left-color: #a855f7;
}
.hist-entry.hist-retargeting .hist-icon     { background: #f3e8ff; }
.hist-entry.hist-retargeting .hist-type-label { background: #e9d5ff; color: #6b21a8; }
.hist-entry.hist-retargeting .hist-entry-text { color: #581c87; }

/* Statusänderung – Grau/Slate */
.hist-entry.hist-status {
  background: #f8fafc;
  border-left-color: #94a3b8;
}
.hist-entry.hist-status .hist-icon     { background: #f1f5f9; }
.hist-entry.hist-status .hist-type-label { background: #e2e8f0; color: #475569; }
.hist-entry.hist-status .hist-entry-text { color: #334155; }

/* Zuweisung – Slate */
.hist-entry.hist-assign {
  background: #f8fafc;
  border-left-color: #64748b;
}
.hist-entry.hist-assign .hist-icon     { background: #f1f5f9; }
.hist-entry.hist-assign .hist-type-label { background: #e2e8f0; color: #334155; }
.hist-entry.hist-assign .hist-entry-text { color: #334155; }

/* ── Letzter-Kontakt-Zelle klickbar ── */
.td-hist-trigger { cursor: pointer; }
.td-hist-trigger:hover .last-contact-chip {
  background: #e8eeff;
  border-radius: 6px;
}
.lc-none-clickable {
  font-size: 12px;
  color: var(--text-muted);
  opacity: .7;
}
.td-hist-trigger:hover .lc-none-clickable { opacity: 1; color: var(--navy); }

/* ===== STATUS-DROPDOWN IN ÜBERSICHT ===== */
.status-dropdown-wrap {
  position: relative;
  display: inline-block;
}
.status-select-overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  font-size: 0;  /* kein Text sichtbar */
}
.status-dropdown-wrap:hover .status-badge {
  box-shadow: 0 0 0 2px var(--navy);
  filter: brightness(.95);
}

/* ===== DISQUALIFIZIERUNGS-MODAL ===== */
.disq-modal {
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 24px 64px rgba(0,0,0,.22);
  width: 480px;
  max-width: 96vw;
  overflow: hidden;
  animation: qcIn .18s ease;
}
.disq-modal-header {
  padding: 18px 20px 14px;
  background: linear-gradient(135deg, #dc2626 0%, #991b1b 100%);
}
.disq-modal-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 700;
  color: #fff;
}
.disq-modal-lead {
  font-size: 13px;
  color: rgba(255,255,255,.75);
  margin-top: 4px;
  font-weight: 500;
}
.disq-modal-body {
  padding: 18px 20px 12px;
}
.disq-hint {
  font-size: 13px;
  color: #64748b;
  margin: 0 0 14px;
}
.disq-reasons {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-bottom: 16px;
  border-radius: 8px;
  padding: 2px;
}
.disq-reason-label {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 13px;
  border-radius: 8px;
  border: 1.5px solid #e2e8f0;
  cursor: pointer;
  transition: border-color .15s, background .15s;
  flex-wrap: wrap;
}
.disq-reason-label:hover {
  border-color: #dc2626;
  background: #fff5f5;
}
.disq-reason-label.disq-reason-selected {
  border-color: #dc2626;
  background: #fef2f2;
}
.disq-radio { accent-color: #dc2626; width: 15px; height: 15px; flex-shrink: 0; cursor: pointer; }
.disq-reason-text { font-size: 13.5px; font-weight: 500; color: #1e293b; flex: 1; }
.disq-sonstiges-input {
  width: 100%;
  margin-top: 6px;
  padding: 7px 10px;
  border: 1.5px solid #e2e8f0;
  border-radius: 7px;
  font-size: 13px;
  outline: none;
  transition: border-color .15s;
}
.disq-sonstiges-input:focus { border-color: #dc2626; }
.disq-detail-wrap { margin-bottom: 4px; }
.disq-detail-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  font-weight: 600;
  color: #374151;
  margin-bottom: 6px;
}
.disq-required {
  font-size: 11px;
  font-weight: 600;
  color: #dc2626;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 4px;
  padding: 1px 6px;
}
.disq-detail-input {
  width: 100%;
  box-sizing: border-box;
  padding: 9px 11px;
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  font-size: 13px;
  font-family: inherit;
  resize: vertical;
  min-height: 72px;
  outline: none;
  transition: border-color .15s;
}
.disq-detail-input:focus { border-color: #dc2626; box-shadow: 0 0 0 3px rgba(220,38,38,.08); }
.disq-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 20px 16px;
  border-top: 1px solid #f1f5f9;
}
.disq-save-btn {
  background: #dc2626;
  color: #fff;
  border: none;
  padding: 8px 20px;
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s;
}
.disq-save-btn:hover:not(:disabled) { background: #b91c1c; }
.disq-save-btn:disabled { opacity: .6; cursor: not-allowed; }

/* ===== KONVERTIERT-MODAL ===== */
.konv-modal {
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 24px 64px rgba(0,0,0,.22);
  width: 440px;
  max-width: 96vw;
  overflow: hidden;
  animation: qcIn .18s ease;
}
.konv-modal-header {
  padding: 18px 20px 14px;
  background: linear-gradient(135deg, #16a34a 0%, #15803d 100%);
}
.konv-modal-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 700;
  color: #fff;
}
.konv-modal-lead {
  font-size: 13px;
  color: rgba(255,255,255,.75);
  margin-top: 4px;
  font-weight: 500;
}
.konv-modal-body {
  padding: 18px 20px 12px;
}
.konv-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 20px 16px;
  border-top: 1px solid #f1f5f9;
}
.konv-save-btn {
  background: #16a34a;
  color: #fff;
  border: none;
  padding: 8px 20px;
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s;
}
.konv-save-btn:hover:not(:disabled) { background: #15803d; }
.konv-save-btn:disabled { opacity: .6; cursor: not-allowed; }
.konv-textarea { border-color: #bbf7d0; }
.konv-textarea:focus { border-color: #16a34a !important; box-shadow: 0 0 0 3px rgba(22,163,74,.08) !important; }
.konv-required {
  font-size: 11px; font-weight: 600; color: #16a34a;
  background: #f0fdf4; border: 1px solid #bbf7d0;
  border-radius: 4px; padding: 1px 6px;
}

/* Detail-Seite: Kauf- und Disq-Infobox unter den Status-Buttons */
.detail-konv-info, .detail-disq-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 9px 12px;
  border-radius: 8px;
  margin-top: 10px;
}
.detail-konv-info {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
}
.detail-disq-info {
  background: #fef2f2;
  border: 1px solid #fecaca;
}

/* ===== WIEDERVORLAGE REMINDER POPUP ===== */
.wv-reminder-stack {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: flex-end;
  pointer-events: none;
}
.wv-reminder-card {
  pointer-events: all;
  background: #fff;
  border: 1.5px solid #f59e0b;
  border-left: 4px solid #f59e0b;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0,0,0,.14);
  padding: 14px 16px 13px;
  width: 300px;
  animation: wvSlideIn .25s ease;
}
@keyframes wvSlideIn {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
.wv-reminder-card.wv-rem-out {
  animation: wvSlideOut .25s ease forwards;
}
@keyframes wvSlideOut {
  to { opacity: 0; transform: translateY(12px); }
}
.wv-rem-top {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 6px;
}
.wv-rem-icon { font-size: 15px; flex-shrink: 0; }
.wv-rem-time {
  font-size: 12px;
  font-weight: 700;
  color: #92400e;
  flex: 1;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.wv-rem-close {
  background: none;
  border: none;
  font-size: 14px;
  color: #9ca3af;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  flex-shrink: 0;
}
.wv-rem-close:hover { color: #374151; }
.wv-rem-name {
  font-size: 14px;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 3px;
}
.wv-rem-note {
  font-size: 12.5px;
  color: #64748b;
  margin-bottom: 8px;
  line-height: 1.4;
}
.wv-rem-link {
  display: inline-block;
  font-size: 12.5px;
  font-weight: 600;
  color: #92400e;
  background: #fef3c7;
  border: 1px solid #fde68a;
  border-radius: 6px;
  padding: 4px 10px;
  text-decoration: none;
  transition: background .15s;
}
.wv-rem-link:hover { background: #fde68a; text-decoration: none; }
