/* ══════════════════════════════════════════════════════
   HANSEKREDIT CRM – Design System
   Design-Kit: docs/design-kit.md (Single Source of Truth)
   Phase 1 Tag 1 (Calvin 2026-05-19): Brand-Sync zur Website-Palette.
   Vorher war CRM auf Navy/Gold, Website auf Blue/Orange — jetzt
   einheitlich. Legacy-Mapping unter den Brand-Tokens hält bestehende
   Klassen am Laufen ohne Big-Bang-Refactor.
   ══════════════════════════════════════════════════════ */

/* ── CSS Custom Properties ──────────────────────────── */
:root {
  /* ── HANSEKREDIT Brand-Tokens (kanonisch) ────────── */
  --hk-blue:        #0072FF;
  --hk-blue-dark:   #001233;
  --hk-blue-logo:   #005B8F;
  --hk-blue-soft:   rgba(0,114,255,0.08);
  --hk-orange:      #FF5F00;
  --hk-yellow:      #FED53F;

  /* Neutral (Welle 32: kühler/navy-getönt für Premium-Konsistenz) */
  --hk-white:       #FFFFFF;
  --hk-bg:          #F5F6FA;
  --hk-text:        #0C1526;
  --hk-text-muted:  #6B7488;
  --hk-border:      #E7EAF1;
  --hk-border-soft: #EEF1F6;

  /* Status (semantisch) */
  --hk-success:      #0F6E56;
  --hk-success-soft: #ECFDF5;
  --hk-warn:         #FF5F00;
  --hk-warn-soft:    #FEF3CD;
  --hk-danger:       #DC2626;
  --hk-danger-soft:  #FEE2E2;

  /* Spacing (8px-Grid) */
  --space-1: 4px;  --space-2: 8px;  --space-3: 12px;  --space-4: 16px;
  --space-5: 20px; --space-6: 24px; --space-8: 32px;  --space-12: 48px;

  /* Type-Scale (Marco-tauglich: 15px Body statt 14px) */
  --text-xs: 11px;
  --text-sm: 13px;
  --text-base: 15px;
  --text-lg: 17px;
  --text-xl: 20px;
  --text-2xl: 24px;
  --text-3xl: 32px;

  /* Touch-Target (Marco-Regel: 44px min für alles Klickbare) */
  --touch-min: 44px;

  /* Schatten (Welle 32: navy-getönt, geschichtet — Premium-Tiefe) */
  --shadow-sm: 0 1px 2px rgba(12,21,38,0.05);
  --shadow-md: 0 1px 2px rgba(12,21,38,0.04), 0 8px 24px rgba(12,21,38,0.07);
  --shadow-lg: 0 12px 40px rgba(0,18,51,0.16);

  /* Radien (Welle 32: etwas runder, moderner) */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-pill: 999px;

  /* Schrift — DM Sans Brand-Font + DM Mono für Metadaten/Zahlen */
  --font-sans: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-mono: 'DM Mono', 'SF Mono', 'Fira Code', 'Consolas', monospace;

  /* ── Legacy-Mapping (Migrations-Brücke) ───────────
     Alle bestehenden Klassen die `var(--color-*)` nutzen funktionieren
     weiter, aber rendern jetzt mit den HK-Brand-Farben. So kann die
     Migration inkrementell erfolgen ohne Big-Bang. */
  --color-primary:       var(--hk-blue);
  --color-primary-dark:  var(--hk-blue-dark);
  --color-primary-light: var(--hk-blue);
  --color-accent:        var(--hk-orange);
  --color-success:       var(--hk-success);
  --color-danger:        var(--hk-danger);
  --color-warning:       var(--hk-warn);
  --color-info:          var(--hk-blue);
  --color-bg:            var(--hk-bg);
  --color-surface:       var(--hk-white);
  --color-text:          var(--hk-text);
  --color-text-muted:    var(--hk-text-muted);
  --color-border:        var(--hk-border);
}

/* DM Sans + DM Mono aus Google Fonts (gleicher Stack wie Website) */
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:opsz,wght@9..40,400;9..40,500;9..40,600;9..40,700&family=DM+Mono:wght@400;500&display=swap');

/* ── CSS Reset ──────────────────────────────────────── */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-sans);
  font-size: var(--text-base);   /* 15px Marco-Default */
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.55;
}

a { color: var(--hk-blue); text-decoration: none; }
a:hover { text-decoration: underline; }

img { max-width: 100%; display: block; }

/* ── Buttons (Marco-Regel: 44px min-height) ───────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 18px;
  min-height: var(--touch-min);
  font-size: var(--text-base);
  font-weight: 600;
  font-family: var(--font-sans);
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background-color 180ms ease, border-color 180ms ease, transform 180ms ease, box-shadow 180ms ease;
  line-height: 1.2;
  white-space: nowrap;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(0,114,255,0.25);
}

.btn-primary {
  background: var(--hk-blue);
  color: #fff;
  border-color: var(--hk-blue);
  box-shadow: 0 1px 2px rgba(0,114,255,0.20), 0 4px 12px rgba(0,114,255,0.14);
}
.btn-primary:hover:not(:disabled) {
  background: #005ED6;
  border-color: #005ED6;
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0,114,255,0.24), 0 8px 20px rgba(0,114,255,0.20);
}

.btn-secondary {
  background: var(--hk-white);
  color: var(--hk-blue);
  border-color: var(--hk-border);
}
.btn-secondary:hover:not(:disabled) {
  background: var(--hk-bg);
  border-color: var(--hk-blue);
}

.btn-danger {
  background: var(--hk-danger);
  color: #fff;
  border-color: var(--hk-danger);
}
.btn-danger:hover:not(:disabled) {
  background: #B91C1C;
  border-color: #B91C1C;
}
.btn-warning {
  background: var(--hk-orange);
  color: #fff;
  border-color: var(--hk-orange);
}
.btn-warning:hover:not(:disabled) {
  background: #E55600;
  border-color: #E55600;
}

.btn-ghost {
  background: transparent;
  color: var(--hk-text-muted);
  border-color: transparent;
}
.btn-ghost:hover:not(:disabled) {
  background: var(--hk-bg);
  color: var(--hk-text);
}

/* Größenvarianten — sm bleibt < 44px nur für sekundäre Toolbars
   (z.B. dichte Tabellen-Aktionen). Primär-CTAs IMMER btn-Default. */
.btn-sm { min-height: 36px; padding: 0 12px; font-size: var(--text-sm); }
.btn-lg { min-height: 52px; padding: 0 28px; font-size: var(--text-lg); }
.btn-block { width: 100%; }

/* ── Badges / Pills ─────────────────────────────────
   Semantik: critical=Top-Prio (orange), high=Erfolg (grün),
   medium=Info (blau), normal=neutral. */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  font-size: var(--text-xs);
  font-weight: 600;
  border-radius: var(--radius-pill);
  white-space: nowrap;
  line-height: 1.4;
}

.badge-critical { background: var(--hk-warn-soft);    color: #92400E; }
.badge-high     { background: var(--hk-success-soft); color: #047857; }
.badge-medium   { background: var(--hk-blue-soft);    color: #005ED6; }
.badge-normal   { background: var(--hk-bg);           color: var(--hk-text-muted); }

/* Status-Badges (Pipeline-Stages) — semantische eigene Palette,
   bewusst farblich abgestuft damit Marco die Stufen visuell sortieren
   kann (kalt → warm → erfolgreich). */
.status-badge {
  padding: 4px 12px;
  font-size: var(--text-xs);
  font-weight: 500;
  border-radius: var(--radius-pill);
  display: inline-block;
}
.status-lead_eingegangen      { background: #F3F4F6; color: #4B5563; }
.status-verpasst              { background: #FEE2E2; color: #B91C1C; }
.status-kontaktaufnahme       { background: var(--hk-blue-soft);    color: var(--hk-blue); }
.status-beratung_geplant      { background: #E0F2FE; color: #0369A1; }
.status-warten_auf_unterlagen { background: var(--hk-warn-soft);    color: #92400E; }
.status-kredit_in_bearbeitung { background: #FFEDD5; color: #C2410C; }
.status-abschluss_auszahlung  { background: var(--hk-success-soft); color: #047857; border: 1px solid #A7F3D0; }
.status-nachbetreuung         { background: #BBF7D0; color: #166534; }
.status-falscher_zeitpunkt    { background: #FEF3C7; color: #92400E; }
.status-nicht_geeignet        { background: var(--hk-bg);           color: var(--hk-text-muted); }
.status-nie_erreicht          { background: var(--hk-bg);           color: var(--hk-text-muted); }
.status-abgeschlossen_verloren { background: var(--hk-danger-soft); color: #991B1B; }

/* ── Cards ──────────────────────────────────────────── */
.card {
  background: var(--hk-white);
  border: 1px solid var(--hk-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: var(--space-5) var(--space-6);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: var(--space-3);
  margin-bottom: var(--space-4);
  border-bottom: 1px solid var(--hk-border);
}
.card-header h2,
.card-header h3 {
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--hk-text);
  margin: 0;
}
.card-header .card-header-meta {
  font-size: var(--text-sm);
  color: var(--hk-text-muted);
}

/* Hover-Variante (nur wo card als ganzes klickbar) */
.card-hover {
  cursor: pointer;
  transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}
.card-hover:hover {
  border-color: var(--hk-blue);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

/* ── Forms (Marco-tauglich: 16px Gap, 15px Labels) ──── */
.form-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
}

.label,
.form-label {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--hk-text);
  letter-spacing: 0.01em;
}
.label-required::after,
.label .required {
  content: ' *';
  color: var(--hk-orange);
}

/* Form-Hilfe-Text unter dem Input */
.form-hint {
  font-size: var(--text-xs);
  color: var(--hk-text-muted);
  margin-top: 4px;
  line-height: 1.4;
}
.form-error {
  font-size: var(--text-xs);
  color: var(--hk-danger);
  margin-top: 4px;
}

.input {
  display: block;
  width: 100%;
  padding: 10px 14px;
  min-height: var(--touch-min);
  font-size: var(--text-base);
  font-family: var(--font-sans);
  color: var(--hk-text);
  background: var(--hk-white);
  border: 1px solid var(--hk-border);
  border-radius: var(--radius-md);
  transition: border-color 180ms ease, box-shadow 180ms ease;
  line-height: 1.4;
}

.input:focus {
  outline: none;
  border-color: var(--hk-blue);
  box-shadow: 0 0 0 3px rgba(0,114,255,0.12);
}

.input:disabled, .input[readonly] {
  background: var(--hk-bg);
  color: var(--hk-text-muted);
  cursor: not-allowed;
}

.input::placeholder {
  color: var(--hk-text-muted);
}

textarea.input {
  min-height: 80px;   /* mehrere Zeilen — kein 44px-Zwang */
  line-height: 1.5;
  resize: vertical;
}

select.input {
  appearance: none;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
  background-position: right 10px center;
  background-repeat: no-repeat;
  background-size: 20px;
  padding-right: 36px;
}

textarea.input {
  min-height: 100px;
  resize: vertical;
}

/* ── Text Utilities ─────────────────────────────────── */
.text-muted   { color: var(--color-text-muted); }
.text-success { color: var(--color-success); }
.text-danger  { color: var(--color-danger); }
.text-warning { color: var(--color-warning); }
.text-info    { color: var(--color-info); }
.text-sm      { font-size: 13px; }
.text-xs      { font-size: 12px; }
.text-center  { text-align: center; }
.text-right   { text-align: right; }
.font-bold    { font-weight: 700; }
.font-medium  { font-weight: 500; }

/* ── Layout Utilities ───────────────────────────────── */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-1 { gap: 4px; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }
.p-4 { padding: 16px; }
.p-6 { padding: 24px; }
.hidden { display: none !important; }

/* ── Loading Spinner ────────────────────────────────── */
.spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ══════════════════════════════════════════════════════
   LOGIN PAGE
   ══════════════════════════════════════════════════════ */

.login-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--hk-blue-dark) 0%, #0a2244 60%, #001a3d 100%);
  padding: 24px;
  position: relative;
  overflow: hidden;
}
.login-page::before {
  content: '';
  position: absolute;
  top: -20%; right: -10%;
  width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(0,114,255,0.16) 0%, transparent 60%);
  pointer-events: none;
}
.login-page::after {
  content: '';
  position: absolute;
  bottom: -20%; left: -10%;
  width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(255,95,0,0.08) 0%, transparent 60%);
  pointer-events: none;
}
.login-page > * { position: relative; z-index: 1; }

.login-logo {
  text-align: center;
  margin-bottom: 32px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.login-logo-img {
  width: 280px;
  max-width: 70vw;
  height: auto;
  display: block;
  /* Original-Logo-Farben: Blue + Orange + Yellow — passen zur dunklen
     Brand-Page (Premium-Feel, kein Filter-Trick nötig). */
}
.login-logo-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 4px;
  text-transform: uppercase;
  color: var(--hk-orange);
  padding: 3px 10px;
  border: 1px solid rgba(255,95,0,0.4);
  border-radius: var(--radius-pill);
}

.login-card {
  width: 100%;
  max-width: 420px;
  background: var(--hk-white);
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 60px rgba(0,0,0,0.25), 0 4px 12px rgba(0,0,0,0.08);
  padding: 36px 36px 32px;
  border: 1px solid rgba(255,255,255,0.08);
}

.login-card h2 {
  font-size: var(--text-xl);
  font-weight: 600;
  margin-bottom: var(--space-5);
  color: var(--hk-text);
  letter-spacing: -0.01em;
}

.login-error {
  display: none;
  background: #fee2e2;
  color: #991b1b;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  margin-bottom: 16px;
  border: 1px solid #fecaca;
}

.login-error.visible {
  display: block;
}

.login-footer {
  text-align: center;
  margin-top: 24px;
}

.login-footer a {
  font-size: var(--text-sm);
  color: var(--hk-text-muted);
  text-decoration: none;
}

.login-footer a:hover {
  color: var(--hk-blue);
}

.login-copyright {
  text-align: center;
  margin-top: 48px;
  font-size: var(--text-xs);
  color: rgba(255,255,255,0.35);
  letter-spacing: 0.04em;
}

/* ══════════════════════════════════════════════════════
   SIDEBAR
   ══════════════════════════════════════════════════════ */

.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: 250px;
  height: 100vh;
  background: linear-gradient(180deg, var(--hk-blue-dark) 0%, #001a3d 100%);
  color: #fff;
  display: flex;
  flex-direction: column;
  z-index: 1000;
  transition: transform 0.25s ease;
  border-right: 1px solid rgba(255,255,255,0.04);
}

.sidebar-header {
  padding: 24px 20px 18px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.sidebar-brand {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}
.sidebar-logo {
  width: 180px;
  max-width: 100%;
  height: auto;
  display: block;
  transition: opacity 180ms ease;
  /* Logo behält Markenfarben (#005B8F Blau / #F24827 Orange /
     #FED53F Gelb) — passen auf dem dunklen Sidebar-BG, kein Filter. */
}
.sidebar-brand:hover .sidebar-logo { opacity: 0.85; }
.sidebar-crm-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--hk-orange);
  padding: 2px 8px;
  border: 1px solid rgba(255,95,0,0.5);
  border-radius: var(--radius-pill);
}

.sidebar-toggle {
  display: none;
  background: none;
  border: none;
  color: rgba(255,255,255,0.5);
  cursor: pointer;
}

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

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  color: rgba(255,255,255,0.7);
  font-size: var(--text-base);
  font-weight: 500;
  text-decoration: none;
  transition: background-color 180ms ease, color 180ms ease, border-color 180ms ease;
  border-left: 3px solid transparent;
}

.sidebar-link:hover {
  background: rgba(255,255,255,0.06);
  color: #fff;
  text-decoration: none;
}

.sidebar-link.active {
  background: linear-gradient(90deg, rgba(0,114,255,0.18) 0%, rgba(0,114,255,0.04) 100%);
  color: #fff;
  border-left-color: var(--hk-blue);
  font-weight: 600;
}
.sidebar-link.active svg { color: var(--hk-blue); }

.sidebar-link svg { flex-shrink: 0; }

/* Group-Label im Nav (Welle 11) */
.sidebar-group-label {
  padding: 16px 20px 6px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.35);
}

/* Highlighted Nav-Item (z.B. Mail-Agent) */
.sidebar-link-highlight {
  position: relative;
}
.sidebar-link-highlight::after {
  content: '';
  position: absolute;
  right: 16px; top: 50%;
  transform: translateY(-50%);
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--hk-orange);
  box-shadow: 0 0 8px var(--hk-orange);
}

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid rgba(255,255,255,0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar-user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--hk-blue) 0%, var(--hk-blue-logo) 100%);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(0,114,255,0.35);
  flex-shrink: 0;
}

.sidebar-user-name {
  font-size: 13px;
  font-weight: 600;
  color: #fff;
}

.sidebar-user-role {
  font-size: 11px;
  color: rgba(255,255,255,0.4);
}

.sidebar-logout {
  background: none;
  border: none;
  color: rgba(255,255,255,0.4);
  cursor: pointer;
  padding: 6px;
  border-radius: var(--radius-sm);
  transition: all 0.15s ease;
}

.sidebar-logout:hover {
  color: var(--color-danger);
  background: rgba(255,255,255,0.06);
}

.hamburger-btn {
  display: none;
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 999;
  background: var(--color-primary-dark);
  border: none;
  color: #fff;
  padding: 8px;
  border-radius: var(--radius-md);
  cursor: pointer;
  box-shadow: var(--shadow-md);
}

/* ── Main Content ──────────────────────────────────── */
.main-content {
  margin-left: 250px;
  min-height: 100vh;
  padding: 24px 32px;
}

/* ══════════════════════════════════════════════════════
   DATA TABLE
   ══════════════════════════════════════════════════════ */

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.data-table thead th {
  text-align: left;
  padding: 10px 12px;
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 2px solid var(--color-border);
  white-space: nowrap;
  cursor: default;
}

.data-table thead th.sortable {
  cursor: pointer;
  user-select: none;
}

.data-table thead th.sortable:hover {
  color: var(--color-primary);
}

.data-table thead th .sort-arrow {
  margin-left: 4px;
  opacity: 0.3;
}

.data-table thead th.sort-active .sort-arrow {
  opacity: 1;
  color: var(--color-primary);
}

.data-table tbody tr {
  border-bottom: 1px solid var(--color-border);
  transition: background 0.1s ease;
}

.data-table tbody tr:hover {
  background: rgba(26, 58, 92, 0.03);
}

.data-table tbody tr:nth-child(even) {
  background: rgba(0,0,0,0.015);
}

.data-table tbody tr:nth-child(even):hover {
  background: rgba(26, 58, 92, 0.05);
}

.data-table tbody td {
  padding: 10px 12px;
  vertical-align: middle;
}

.data-table .row-critical {
  border-left: 3px solid var(--color-accent);
}

.data-table .actions-cell {
  white-space: nowrap;
}

.data-table .actions-cell button {
  background: none;
  border: none;
  color: var(--color-text-muted);
  cursor: pointer;
  padding: 4px 6px;
  border-radius: var(--radius-sm);
  transition: all 0.15s ease;
}

.data-table .actions-cell button:hover {
  color: var(--color-primary);
  background: var(--color-bg);
}

/* ══════════════════════════════════════════════════════
   FILTER BAR
   ══════════════════════════════════════════════════════ */

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  padding: 16px 20px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  margin-bottom: 20px;
}

.filter-bar .input {
  max-width: 200px;
  padding: 8px 12px;
  font-size: 13px;
}

.filter-bar .search-input {
  max-width: 280px;
  flex: 1;
}

.filter-bar .filter-actions {
  margin-left: auto;
  display: flex;
  gap: 8px;
}

/* ══════════════════════════════════════════════════════
   CHIPS / TAGS
   ══════════════════════════════════════════════════════ */

.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 10px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 100px;
  white-space: nowrap;
  color: #fff;
}

.chips-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

/* ══════════════════════════════════════════════════════
   MODAL
   ══════════════════════════════════════════════════════ */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s ease;
  padding: 24px;
}

.modal-overlay.modal-visible {
  opacity: 1;
  visibility: visible;
}

.modal-content {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  transform: translateY(10px);
  transition: transform 0.2s ease;
}

.modal-visible .modal-content {
  transform: translateY(0);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--color-border);
}

.modal-header h3 {
  font-size: 18px;
  font-weight: 600;
}

.modal-close-btn {
  background: none;
  border: none;
  font-size: 22px;
  color: var(--color-text-muted);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  line-height: 1;
}

.modal-close-btn:hover {
  background: var(--color-bg);
  color: var(--color-text);
}

.modal-body {
  padding: 20px 24px;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 24px 20px;
  border-top: 1px solid var(--color-border);
}

body.modal-open {
  overflow: hidden;
}

/* ── Modal Tabs ────────────────────────────────────── */
.modal-tabs {
  display: flex;
  border-bottom: 2px solid var(--color-border);
  margin: 0 -24px 20px;
  padding: 0 24px;
}

.modal-tab {
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all 0.15s ease;
  background: none;
  border-top: none;
  border-left: none;
  border-right: none;
}

.modal-tab:hover { color: var(--color-primary); }
.modal-tab.active {
  color: var(--color-primary);
  border-bottom-color: var(--color-primary);
}

.modal-tab-content { display: none; }
.modal-tab-content.active { display: block; }

/* ══════════════════════════════════════════════════════
   TOAST NOTIFICATIONS
   ══════════════════════════════════════════════════════ */

#toast-container {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 3000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  background: var(--color-surface);
  box-shadow: var(--shadow-lg);
  font-size: 14px;
  min-width: 300px;
  max-width: 450px;
  pointer-events: auto;
  transform: translateX(120%);
  transition: transform 0.3s ease, opacity 0.3s ease;
  border-left: 4px solid;
}

.toast-visible { transform: translateX(0); }
.toast-exit { transform: translateX(120%); opacity: 0; }

.toast-success { border-left-color: var(--color-success); }
.toast-error { border-left-color: var(--color-danger); }
.toast-warning { border-left-color: var(--color-warning); }
.toast-info { border-left-color: var(--color-info); }

.toast-icon { flex-shrink: 0; }
.toast-success .toast-icon { color: var(--color-success); }
.toast-error .toast-icon { color: var(--color-danger); }
.toast-warning .toast-icon { color: var(--color-warning); }
.toast-info .toast-icon { color: var(--color-info); }

.toast-message { flex: 1; }

.toast-close {
  background: none;
  border: none;
  color: var(--color-text-muted);
  cursor: pointer;
  font-size: 18px;
  padding: 0 4px;
  line-height: 1;
}

/* ══════════════════════════════════════════════════════
   ACTIVITY TIMELINE
   ══════════════════════════════════════════════════════ */

/* Welle 23: Activity-Stream scrollt nativ mit der mittleren Spalte
   (statt Sub-Container in Sub-Container). Lade-Button bleibt. */
.activity-load-more {
  width: 100%;
  margin-top: 12px;
  font-size: 13px;
}

/* ── Lead-Partner-Karte (Welle 18) ── */
.lp-empty {
  color: var(--hk-text-muted);
  font-size: 13px;
  padding: 8px 0;
}
.lp-section-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--hk-text-muted);
  margin: 12px 0 6px;
}
.lp-section-label:first-child { margin-top: 0; }
.lp-row {
  display: flex; align-items: center; gap: 10px;
  padding: 8px;
  border-radius: 8px;
  border: 1px solid var(--hk-border);
  background: var(--color-surface, #fff);
  margin-bottom: 6px;
}
.lp-row + .lp-row { margin-top: 0; }
.lp-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; color: #fff;
  flex-shrink: 0;
}
.lp-avatar-bank   { background: linear-gradient(135deg, #0072FF 0%, #001233 100%); }
.lp-avatar-ref    { background: linear-gradient(135deg, #FF5F00 0%, #B45309 100%); }
.lp-body { flex: 1; min-width: 0; }
.lp-name { font-weight: 600; font-size: 13px; color: var(--color-text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lp-sub  { font-size: 11px; color: var(--hk-text-muted); margin-top: 2px; }
.lp-unlink {
  background: none; border: none; cursor: pointer;
  width: 24px; height: 24px; border-radius: 6px;
  color: var(--hk-text-muted);
  font-size: 18px; line-height: 1;
}
.lp-unlink:hover { color: #B91C1C; background: #FEE2E2; }

.lp-role-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 12px; border: 1px solid var(--color-border);
  border-radius: 8px; font-size: 13px; cursor: pointer;
  flex: 1;
}
.lp-role-pill input { margin: 0; }
.lp-role-pill:has(input:checked) { border-color: var(--hk-blue, #0072FF); background: var(--hk-blue-soft, #EFF6FF); color: var(--hk-blue, #0072FF); }

.lp-results { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; max-height: 280px; overflow-y: auto; }
.lp-result {
  display: flex; align-items: center; gap: 10px;
  padding: 10px; border-radius: 8px;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
}
.lp-result .lp-body { flex: 1; }

/* ── Doc-Share-System (Welle 18) ── */
.doc-master-bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px;
  background: linear-gradient(90deg, var(--hk-blue-soft, #EFF6FF), transparent);
  border: 1px solid var(--hk-blue, #0072FF);
  border-radius: 10px;
  margin-bottom: 16px;
}
.doc-master-bar .doc-master-text { color: var(--color-text); font-size: 14px; }
.doc-share-master { background: var(--hk-blue, #0072FF); color: #fff; }
.doc-share-master:disabled { opacity: 0.4; cursor: not-allowed; }
.doc-share-cat { color: var(--hk-blue, #0072FF); background: transparent; border: 1px solid var(--hk-blue, #0072FF); }

/* Share-Modal */
.share-summary {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 14px; background: var(--hk-bg);
  border-radius: 8px; margin-bottom: 14px; font-size: 13px;
}
.share-warn { color: #B91C1C; font-weight: 600; }
.share-cat-list { display: flex; flex-direction: column; gap: 12px; max-height: 360px; overflow-y: auto; }
.share-cat { border: 1px solid var(--color-border); border-radius: 8px; padding: 10px 12px; }
.share-cat-head label { display: flex; align-items: center; gap: 8px; font-size: 13px; cursor: pointer; }
.share-cat-body { display: flex; flex-direction: column; gap: 4px; margin-top: 8px; padding-left: 22px; }
.share-doc-row {
  display: flex; align-items: center; gap: 8px; padding: 4px 0;
  font-size: 13px; cursor: pointer;
}
.share-doc-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.share-doc-meta { color: var(--color-text-muted); font-size: 11px; }

.share-section-label {
  font-size: 11px; font-weight: 600; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--color-text-muted);
  margin-bottom: 8px;
}
.share-partner-list { display: flex; flex-direction: column; gap: 6px; max-height: 220px; overflow-y: auto; }
.share-partner-card {
  display: flex; align-items: center; gap: 10px;
  padding: 10px; border: 1px solid var(--color-border);
  border-radius: 8px; cursor: pointer;
  transition: all 0.12s ease;
}
.share-partner-card:hover { border-color: var(--hk-blue, #0072FF); }
.share-partner-card.is-selected {
  border-color: var(--hk-blue, #0072FF);
  background: var(--hk-blue-soft, #EFF6FF);
  box-shadow: 0 0 0 2px var(--hk-blue, #0072FF);
}
.share-pill-conn {
  display: inline-block; padding: 1px 6px;
  background: var(--color-success-soft, #D1FAE5); color: #047857;
  border-radius: 999px; font-size: 10px; font-weight: 600;
}

.share-recap { padding: 14px; background: var(--hk-bg); border-radius: 8px; font-size: 13px; margin-bottom: 14px; }
.share-doc-pills { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; }
.share-doc-pill {
  display: inline-block; padding: 3px 8px;
  background: #fff; border: 1px solid var(--color-border);
  border-radius: 999px; font-size: 11px;
}

/* ── Partner-Detail Side-Sheet (Welle 18) ── */
.pd-lead-list, .pd-fwd-list {
  display: flex; flex-direction: column; gap: 6px;
  max-height: 320px; overflow-y: auto;
}
.pd-lead-row {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 8px;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  cursor: pointer;
  transition: all 0.12s ease;
}
.pd-lead-row:hover { border-color: var(--hk-blue, #0072FF); background: var(--hk-blue-soft, #EFF6FF); }
.pd-lead-name { font-weight: 600; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pd-lead-sub  { font-size: 11px; color: var(--color-text-muted); margin-top: 2px; }
.pd-score {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--hk-blue-soft, #EFF6FF); color: var(--hk-blue, #0072FF);
  font-weight: 700; font-size: 13px;
  flex-shrink: 0;
}
.pd-fwd-row {
  display: flex; gap: 10px; padding: 10px 12px;
  border-radius: 8px; background: var(--hk-bg);
  font-size: 12px;
}
.pd-fwd-subject { font-weight: 600; color: var(--color-text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pd-fwd-meta { font-size: 11px; color: var(--color-text-muted); margin-top: 2px; }
.pd-fwd-when { font-size: 11px; color: var(--color-text-muted); white-space: nowrap; }

/* ── Welle 19: Inline-Edits (Tasks + Lead-Typ) ── */
.task-editable {
  cursor: pointer;
  border-radius: 4px;
  padding: 2px 4px;
  transition: background 0.12s ease;
}
.task-editable:hover { background: var(--hk-blue-soft, #EFF6FF); }
.task-editable.is-editing { background: var(--color-surface); padding: 0; }
.task-editable.is-saving { opacity: 0.6; }
.task-inline-input {
  border: 1px solid var(--hk-blue, #0072FF);
  border-radius: 4px;
  padding: 2px 6px;
  font: inherit;
  width: 100%;
  min-width: 80px;
  background: #fff;
  color: inherit;
  outline: none;
}

.lead-type-edit-row {
  display: flex; align-items: center; gap: 6px;
  margin-top: 2px;
}
.lead-type-select {
  background: transparent;
  border: 1px solid transparent;
  border-radius: 4px;
  padding: 1px 4px;
  font-size: 11px;
  color: var(--color-text);
  cursor: pointer;
  font-family: inherit;
}
.lead-type-select:hover { border-color: var(--color-border); }
.lead-type-select:focus { border-color: var(--hk-blue, #0072FF); outline: none; }

.pipeline-stage-avg {
  display: inline-block;
  padding: 1px 6px;
  background: var(--hk-bg);
  color: var(--color-text-muted);
  border-radius: 999px;
  font-size: 10px;
  margin-left: 6px;
  font-weight: 500;
}

/* Welle 20 — Mail-Agent Cache-Badge */
.ws-cache-ok    { color: var(--color-text-muted); }
.ws-cache-fresh { color: #047857; font-weight: 600; }
.ws-cache-stale { color: #B45309; font-weight: 600; }

.activity-timeline {
  position: relative;
  padding-left: 28px;
}

.activity-timeline::before {
  content: '';
  position: absolute;
  left: 10px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--color-border);
}

.activity-item {
  position: relative;
  padding: 12px 0 16px;
}

.activity-item::before {
  content: '';
  position: absolute;
  left: -22px;
  top: 16px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--color-border);
  border: 2px solid var(--color-surface);
}

.activity-item[data-type="call"]::before { background: var(--color-info); }
.activity-item[data-type="email"]::before { background: var(--color-accent); }
.activity-item[data-type="note"]::before { background: var(--color-text-muted); }
.activity-item[data-type="meeting"]::before { background: var(--color-success); }
.activity-item[data-type="document"]::before { background: #854F0B; }
.activity-item[data-type="status_change"]::before { background: var(--color-primary); }
.activity-item[data-type="system"]::before { background: var(--color-border); }

.activity-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.activity-type-label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.activity-time {
  font-size: 12px;
  color: var(--color-text-muted);
  margin-left: auto;
}

.activity-user {
  font-size: 12px;
  color: var(--color-text-muted);
}

.activity-body {
  font-size: 14px;
  line-height: 1.5;
  color: var(--color-text);
}

.activity-meta {
  display: flex;
  gap: 12px;
  margin-top: 6px;
  flex-wrap: wrap;
}

.activity-meta-item {
  font-size: 12px;
  color: var(--color-text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ══════════════════════════════════════════════════════
   PIPELINE PROGRESS
   ══════════════════════════════════════════════════════ */

.pipeline {
  display: flex;
  gap: 2px;
  margin: 16px 0;
}

.pipeline-step {
  flex: 1;
  padding: 8px 12px;
  text-align: center;
  font-size: 11px;
  font-weight: 600;
  background: var(--color-bg);
  color: var(--color-text-muted);
  position: relative;
  transition: all 0.15s ease;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pipeline-step:first-child { border-radius: var(--radius-md) 0 0 var(--radius-md); }
.pipeline-step:last-child { border-radius: 0 var(--radius-md) var(--radius-md) 0; }

.pipeline-step.active {
  background: var(--color-primary);
  color: #fff;
}

.pipeline-step.completed {
  background: var(--color-primary-light);
  color: #fff;
  opacity: 0.7;
}

.pipeline-step:hover {
  opacity: 0.85;
}

/* ══════════════════════════════════════════════════════
   PHASES CHECKLIST
   ══════════════════════════════════════════════════════ */

.phase-group {
  margin-bottom: 16px;
}

.phase-group-title {
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.phase-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  transition: background 0.1s ease;
}

.phase-item:hover {
  background: var(--color-bg);
}

.phase-check {
  width: 18px;
  height: 18px;
  border-radius: 4px;
  border: 2px solid var(--color-border);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
  flex-shrink: 0;
}

.phase-check.checked {
  background: var(--color-success);
  border-color: var(--color-success);
  color: #fff;
}

.phase-label {
  font-size: 13px;
  flex: 1;
}

.phase-item.completed .phase-label {
  text-decoration: line-through;
  color: var(--color-text-muted);
}

.phase-date {
  font-size: 11px;
  color: var(--color-text-muted);
}

/* ══════════════════════════════════════════════════════
   CALL FORM
   ══════════════════════════════════════════════════════ */

.call-form {
  background: #f8fafc;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 20px;
}

.call-form-title {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.call-form .form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.first-call-box {
  background: #fef3cd;
  border: 1px solid #fde68a;
  border-radius: var(--radius-md);
  padding: 14px 16px;
  margin-bottom: 16px;
}

.first-call-box h4 {
  font-size: 13px;
  font-weight: 700;
  color: #92400e;
  margin-bottom: 8px;
}

.priority-preview {
  margin-top: 12px;
  padding: 10px 14px;
  background: var(--color-surface);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 500;
}

/* ══════════════════════════════════════════════════════
   DETAIL PAGE LAYOUT
   ══════════════════════════════════════════════════════ */

.detail-layout {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 24px;
  align-items: start;
}

.detail-left { min-width: 0; }

.detail-right {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ── Lead-Detail-Page Redesign (Welle 23, Calvin 2026-06-06) ──
   Drei-Spalten Best-Practice (HubSpot 2026 / Attio / Linear):
    - linke App-Sidebar (unverändert, #sidebar-root)
    - kompakter Sticky-Header oben (~64 px)
    - mittlere Spalte (Off-White Background) — eigener Scroll mit sticky
      activity-toolbar + sticky ld-tabs
    - rechte Detail-Sidebar (reines Weiß, vertikale Border) — eigener
      Scroll
   Mobile (<1201 px): Default-Stacking, kein Sub-Scroll-Trap. */
@media (min-width: 1201px) {
  .lead-detail-page {
    height: 100vh;
    max-height: 100vh;
    padding: 0;
    display: grid;
    grid-template-rows: auto 1fr;
    overflow: hidden;
  }
  /* Sticky Kompakt-Header (Welle 31: kompakter + Brand-Akzent) */
  .lead-detail-page > .detail-header {
    padding: 10px 28px;
    margin: 0;
    background: var(--hk-white);
    border-bottom: 1px solid var(--hk-border);
    box-shadow: 0 1px 2px rgba(0, 18, 51, 0.04);
    display: flex;
    align-items: center;
    gap: 20px;
    justify-content: space-between;
    z-index: 10;
  }
  .lead-detail-page > .detail-header h1 {
    font-size: 18px;
    margin: 0;
    line-height: 1.2;
  }
  .lead-detail-page > .detail-header #lead-summary {
    margin-top: 2px;
    font-size: 13px;
  }
  /* Body als 2-Spalten-Grid; jede Spalte eigener Scroll-Container.
     align-items:stretch ist KRITISCH — der äußere .detail-layout-Selector
     setzt align-items:start; ohne stretch bekämen die Spalten nur die
     Höhe ihres Inhalts und overflow-y:auto würde nie greifen. */
  .lead-detail-page > .detail-layout {
    padding: 0;
    margin: 0;
    gap: 0;
    min-height: 0;
    height: 100%;
    overflow: hidden;
    display: grid;
    grid-template-columns: 1fr 400px;
    align-items: stretch;
  }
  /* Mittlere Spalte */
  .lead-detail-page .detail-left {
    overflow-y: auto;
    min-height: 0;
    padding: 0 32px 40px;
    background: var(--hk-bg);
    scrollbar-gutter: stable;
    scrollbar-width: thin;
  }
  /* Activity-Toolbar sticky am oberen Spaltenrand */
  .lead-detail-page .activity-toolbar {
    position: sticky;
    top: 0;
    margin: 0 -32px;
    padding: 16px 32px 12px;
    background: var(--hk-bg);
    z-index: 4;
  }
  /* Tabs sticky direkt unter der Toolbar */
  .lead-detail-page .ld-tabs {
    position: sticky;
    top: 64px;
    margin: 0 -32px 20px;
    padding: 0 32px;
    background: var(--hk-bg);
    border-bottom: 1px solid var(--hk-border);
    z-index: 3;
  }
  /* Rechte Detail-Sidebar */
  .lead-detail-page .detail-right {
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    min-height: 0;
    padding: 24px 24px 40px;
    background: var(--hk-bg);
    border-left: 1px solid var(--hk-border);
    gap: 16px;
    scrollbar-gutter: stable;
    scrollbar-width: thin;
  }
  .lead-detail-page .detail-right > .info-card { flex-shrink: 0; }
  /* Custom-Scrollbars für beide Spalten */
  .lead-detail-page .detail-left::-webkit-scrollbar,
  .lead-detail-page .detail-right::-webkit-scrollbar {
    width: 8px;
  }
  .lead-detail-page .detail-left::-webkit-scrollbar-thumb,
  .lead-detail-page .detail-right::-webkit-scrollbar-thumb {
    background: var(--hk-border);
    border-radius: 4px;
  }
  .lead-detail-page .detail-left::-webkit-scrollbar-thumb:hover,
  .lead-detail-page .detail-right::-webkit-scrollbar-thumb:hover {
    background: var(--hk-text-muted);
  }
}

.detail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}

.detail-header h1 {
  font-size: var(--text-2xl);
  font-weight: 700;
  color: var(--hk-text);
  letter-spacing: -0.01em;
}

.detail-header-actions {
  display: flex;
  gap: 8px;
}

/* ── Info Card (Welle 24: Akzent-Stripe-Redesign) ───── */
.info-card {
  position: relative;
  background: var(--hk-white);
  border: 1px solid var(--hk-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  flex-shrink: 0;                 /* KRITISCH gegen Flex-Kollaps */
  box-shadow: 0 1px 2px rgba(0, 18, 51, 0.04);
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}
.info-card:hover {
  box-shadow: 0 4px 12px rgba(0, 18, 51, 0.07);
}
.info-card::before {
  content: "";
  position: absolute;
  top: 0; bottom: 0; left: 0;
  width: 4px;
  background: var(--hk-border);
  border-top-left-radius: var(--radius-lg);
  border-bottom-left-radius: var(--radius-lg);
}

.info-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px 12px 24px;
  border-bottom: 1px solid var(--hk-border);
  background: transparent;
}

.info-card-header h3 {
  font-size: 11px;
  font-weight: 700;
  margin: 0;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--hk-text-muted);
}

.info-card-body {
  padding: 16px 20px 16px 24px;
}

/* Zuweisung-Card (Welle 24) */
.assign-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}
.assign-avatar {
  width: 40px; height: 40px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--hk-blue) 0%, var(--hk-blue-dark) 100%);
  color: #fff;
  font-weight: 700;
  font-size: 13px;
  flex-shrink: 0;
}
.assign-meta { flex: 1; min-width: 0; }
.assign-name { font-weight: 600; font-size: 14px; color: var(--hk-text, var(--color-text)); }
.assign-sub  { font-size: 12px; color: var(--hk-text-muted); margin-top: 2px; }
.assign-divider {
  height: 1px;
  background: var(--hk-border);
  margin: 12px 0;
}
.assign-meta-row {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 12px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--hk-border);
}

/* Akzent-Modifier */
.info-card--assignment::before { background: var(--hk-blue); }
.info-card--status::before     { background: var(--hk-blue-dark); }
.info-card--score::before      { background: linear-gradient(180deg, #C8A96E 0%, #B45309 100%); }
.info-card--quali::before      { background: var(--hk-success); }
.info-card--partners::before   { background: var(--hk-orange); }
.info-card--labels::before     { background: #38BDF8; }   /* Sky-Blue für Kreditarten */
.info-card--marketing::before  { background: #8B5CF6; }   /* Violet */
.info-card--stats::before      { background: var(--hk-text-muted); }

.info-row {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  font-size: 13px;
}

.info-row .info-label {
  color: var(--color-text-muted);
  font-weight: 500;
}

.info-row .info-value {
  font-weight: 600;
  text-align: right;
}

/* ── Activity Toolbar ──────────────────────────────── */
.activity-toolbar {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.activity-toolbar .btn {
  font-size: 13px;
  padding: 8px 14px;
}

/* ── Inline Edit ───────────────────────────────────── */
.inline-edit-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 12px;
}

.inline-edit-group .label {
  font-size: 12px;
  color: var(--color-text-muted);
}

.inline-edit-group .input {
  font-size: 13px;
  padding: 7px 10px;
}

/* ── Task List ─────────────────────────────────────── */
.task-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--color-border);
  font-size: 13px;
}

.task-item:last-child { border-bottom: none; }

.task-check {
  width: 16px;
  height: 16px;
  border-radius: 4px;
  border: 2px solid var(--color-border);
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.15s ease;
}

.task-check:hover {
  border-color: var(--color-success);
}

.task-title { flex: 1; }

.task-due {
  font-size: 12px;
  color: var(--color-text-muted);
  white-space: nowrap;
}

.task-due.overdue {
  color: var(--color-danger);
  font-weight: 600;
}

/* ══════════════════════════════════════════════════════
   PAGINATION
   ══════════════════════════════════════════════════════ */

.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0;
  font-size: 13px;
}

.pagination-info {
  color: var(--color-text-muted);
}

.pagination-buttons {
  display: flex;
  gap: 4px;
}

.pagination-btn {
  padding: 6px 12px;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 13px;
  transition: all 0.15s ease;
}

.pagination-btn:hover:not(:disabled) {
  background: var(--color-bg);
  border-color: var(--color-primary-light);
}

.pagination-btn.active {
  background: var(--color-primary);
  color: #fff;
  border-color: var(--color-primary);
}

.pagination-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ══════════════════════════════════════════════════════
   SKELETON LOADING
   ══════════════════════════════════════════════════════ */

.skeleton {
  background: linear-gradient(90deg, #EEF1F5 25%, #DDE3EB 50%, #EEF1F5 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s ease-in-out infinite;
  border-radius: var(--radius-md);
}

.skeleton-text   { height: 14px; margin-bottom: 8px; }
.skeleton-text.short  { width: 40%; }
.skeleton-text.medium { width: 75%; }
.skeleton-text.long   { width: 100%; }
.skeleton-row     { height: 48px; margin-bottom: 6px; }
.skeleton-circle  { border-radius: 50%; }

/* Skeleton-Card: 3 Zeilen Text mit ablaufender Animation */
.skeleton-card {
  background: var(--hk-white);
  border: 1px solid var(--hk-border);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
}
.skeleton-card .skeleton + .skeleton { margin-top: 8px; }

@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ══════════════════════════════════════════════════════
   CREDIT LABEL COLORS
   ══════════════════════════════════════════════════════ */

.label-privatkredit          { background: #1a3a5c; }
.label-immobilienkauf        { background: #0F6E56; }
.label-anschlussfinanzierung { background: #854F0B; }
.label-modernisierungskredit { background: #185FA5; }
.label-umschuldung           { background: #993C1D; }
.label-schuldenkonsolidierung { background: #534AB7; }

/* ══════════════════════════════════════════════════════
   DOCUMENT LIST
   ══════════════════════════════════════════════════════ */

.doc-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--color-border);
  font-size: 13px;
}

.doc-item:last-child { border-bottom: none; }

.doc-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: var(--color-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.doc-info { flex: 1; min-width: 0; }
.doc-name {
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.doc-meta { font-size: 11px; color: var(--color-text-muted); }

.doc-actions {
  display: flex;
  gap: 4px;
}

.doc-actions button {
  background: none;
  border: none;
  color: var(--color-text-muted);
  cursor: pointer;
  padding: 4px;
  border-radius: var(--radius-sm);
}

.doc-actions button:hover {
  color: var(--color-primary);
  background: var(--color-bg);
}

/* ══════════════════════════════════════════════════════
   BULK ACTIONS BAR
   ══════════════════════════════════════════════════════ */

.bulk-bar {
  position: fixed;
  bottom: 0;
  left: 250px;
  right: 0;
  background: var(--color-primary-dark);
  color: #fff;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  z-index: 500;
  transform: translateY(100%);
  transition: transform 0.2s ease;
}

.bulk-bar.visible {
  transform: translateY(0);
}

.bulk-bar-count {
  font-size: 14px;
  font-weight: 600;
}

.bulk-bar .btn {
  font-size: 13px;
  padding: 6px 14px;
}

.bulk-bar-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.bulk-bar-actions .btn {
  background: rgba(255,255,255,0.12);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.18);
}
.bulk-bar-actions .btn:hover {
  background: rgba(255,255,255,0.22);
}
.bulk-bar-actions .btn.btn-danger {
  background: rgba(239,68,68,0.85);
  border-color: rgba(239,68,68,0.95);
}
.bulk-bar-actions .btn.btn-danger:hover {
  background: rgb(220,38,38);
}

/* Selektierte Zeile leicht hervorheben */
tr.is-selected {
  background: rgba(24,95,165,0.06) !important;
}

/* Checkbox-Spalte */
.lead-checkbox-cell {
  padding: 0 0 0 12px !important;
  width: 32px;
}

/* ══════════════════════════════════════════════════════
   EMPTY STATE — Marco-Regel: nie nur "Keine Daten"
   Empty-State soll IMMER eine Anleitung haben:
   <div class="empty-state">
     <svg>...</svg>
     <h4>Noch keine Leads</h4>
     <p>Lege manuell einen Lead an oder warte auf die erste Webformular-Anfrage.</p>
     <button class="btn btn-primary btn-sm">Neuer Lead →</button>
   </div>
   ══════════════════════════════════════════════════════ */

.empty-state {
  text-align: center;
  padding: var(--space-12) var(--space-6);
  color: var(--hk-text-muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
}

.empty-state svg {
  width: 48px;
  height: 48px;
  opacity: 0.35;
  color: var(--hk-blue);
}

.empty-state h4 {
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--hk-text);
  margin: 0;
}

.empty-state p {
  font-size: var(--text-base);
  color: var(--hk-text-muted);
  margin: 0;
  max-width: 380px;
  line-height: 1.55;
}

.empty-state .btn { margin-top: var(--space-2); }

/* Empty-Mini: kompakte Variante für Sidebar-Cards (kleinere Bereiche) */
.empty-mini {
  text-align: center;
  padding: var(--space-5) var(--space-3);
  color: var(--hk-text-muted);
  font-size: var(--text-sm);
}

/* ══════════════════════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════════════════════ */

@media (max-width: 1200px) {
  .detail-layout {
    grid-template-columns: 1fr;
  }
  .detail-right {
    order: -1;
  }
}

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.sidebar-open {
    transform: translateX(0);
  }

  .sidebar-toggle {
    display: block;
  }

  .hamburger-btn {
    display: block;
  }

  .main-content {
    margin-left: 0;
    padding: 60px 16px 24px;
  }

  .bulk-bar {
    left: 0;
  }

  .filter-bar {
    flex-direction: column;
  }

  .filter-bar .input {
    max-width: 100%;
  }

  .filter-bar .filter-actions {
    margin-left: 0;
    width: 100%;
  }

  .pagination {
    flex-direction: column;
    gap: 12px;
  }

  .data-table {
    font-size: 13px;
  }

  .detail-header {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* ══════════════════════════════════════════════════════
   KPI-Zeile
   ══════════════════════════════════════════════════════ */
.kpi-zeile {
  display: flex;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

/* Welle 33 (A4) — Operations-Console-Treatment für die geteilten
   KPI-Karten (Berichte, Aufgaben, Kanban): Akzent-Stripe oben,
   DM Mono für Werte und Labels, kompaktere Dichte. */
.kpi-karte {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 13px 20px;
  min-width: 140px;
  text-align: center;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}
.kpi-karte::before {
  content: '';
  position: absolute;
  top: 0; left: 14%; right: 14%;
  height: 3px;
  border-radius: 0 0 2px 2px;
  background: var(--hk-blue);
}

.kpi-karte .kpi-wert {
  font-family: var(--font-mono);
  font-size: 26px;
  font-weight: 500;
  color: var(--hk-blue-dark);
  line-height: 1.2;
}

.kpi-karte .kpi-label {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--color-text-muted);
  margin-top: 4px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

.kpi-karte.kpi-danger::before { background: var(--hk-orange); }
.kpi-karte.kpi-danger .kpi-wert {
  color: var(--color-danger);
}

.kpi-karte.kpi-success::before { background: var(--color-success); }
.kpi-karte.kpi-success .kpi-wert {
  color: var(--color-success);
}

/* ══════════════════════════════════════════════════════
   Kanban Board
   ══════════════════════════════════════════════════════ */
.kanban-board {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 16px;
  min-height: calc(100vh - 200px);
  align-items: flex-start;
}

.kanban-spalte {
  min-width: 260px;
  max-width: 300px;
  flex: 1 0 260px;
  background: var(--color-bg);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  border: 1px solid var(--color-border);
}

.kanban-spalte-schmal {
  min-width: 220px;
  max-width: 240px;
  flex: 0 0 220px;
  opacity: 0.85;
}

.kanban-spalte-special {
  border: 2px solid #c9982a;
  background: #fffdf5;
}

.kanban-spalte.drag-over {
  background: #e8f0fe;
  border-color: var(--color-primary-light);
  box-shadow: inset 0 0 0 2px var(--color-primary-light);
}

.kanban-header {
  padding: 10px 14px;
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.kanban-count {
  background: rgba(255,255,255,0.25);
  padding: 1px 8px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 700;
}

.kanban-hint {
  padding: 8px 14px;
  font-size: 11px;
  color: #92700a;
  background: #fef9e7;
  border-bottom: 1px solid #f0e4b8;
}

.kanban-body {
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
  max-height: calc(100vh - 300px);
}

.kanban-leer {
  text-align: center;
  color: var(--color-text-muted);
  font-size: 12px;
  padding: 20px 8px;
}

/* Kanban Cards */
.kanban-karte {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  cursor: pointer;
  position: relative;
  transition: box-shadow 0.15s, transform 0.15s, opacity 0.2s;
}

.kanban-karte:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.kanban-karte.dragging {
  opacity: 0.4;
  transform: rotate(2deg);
}

.kanban-karte.critical {
  border-left: 3px solid #c9982a;
  background: #fffdf5;
}

.kanban-karte.hat-ueberfaellig {
  border-left: 3px solid var(--color-danger);
}

.kanban-ueberfaellig-punkt {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 8px;
  height: 8px;
  background: var(--color-danger);
  border-radius: 50%;
}

.kanban-karte-z1 {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
}

.kanban-karte-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text);
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.kanban-karte-betrag {
  font-size: 13px;
  font-weight: 700;
  color: var(--color-text);
  margin: 2px 0 6px;
  letter-spacing: 0.01em;
}

.kanban-karte-z2 {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}

.kanban-karte-z3 {
  display: flex;
  gap: 6px;
  font-size: 14px;
  align-items: center;
  justify-content: space-between;
}

.kanban-karte-z4 {
  margin-top: 4px;
}

.kanban-karte-aufgabe {
  margin-top: 6px;
  font-size: 11px;
  color: var(--color-text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
}

.kanban-karte-aufgabe::before {
  content: '📋';
  font-size: 10px;
}

/* Kanban Quick Menu */
.kanban-menu-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 18px;
  color: var(--color-text-muted);
  padding: 0 4px;
  line-height: 1;
  border-radius: 4px;
  margin-left: auto;
}

.kanban-menu-btn:hover {
  background: var(--color-bg);
  color: var(--color-text);
}

.kanban-schnellmenu {
  display: none;
  /* position:fixed bricht aus dem overflow:auto-Container der .kanban-body
     aus — JS positioniert via getBoundingClientRect() (siehe kanban.js).
     Sehr hohes z-index, damit auch hover-Karten (transform → stacking-context)
     das Menu nicht überdecken. */
  position: fixed;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  z-index: 1000;
  min-width: 220px;
  padding: 4px 0;
}

.kanban-schnellmenu.sichtbar {
  display: block;
}

.schnellmenu-gruppe {
  padding: 4px 0;
}

.schnellmenu-titel {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--color-text-muted);
  padding: 6px 14px 4px;
  font-weight: 600;
}

.schnellmenu-item {
  padding: 7px 14px;
  font-size: 13px;
  cursor: pointer;
  color: var(--color-text);
}

.schnellmenu-item:hover {
  background: var(--color-bg);
}

.schnellmenu-trenner {
  height: 1px;
  background: var(--color-border);
  margin: 4px 0;
}

/* Zinsbindung Alert */
.zinsbindung-alert {
  background: #fef3cd;
  color: #856404;
  font-size: 11px;
  padding: 4px 8px;
  border-radius: 4px;
  margin-top: 6px;
  font-weight: 500;
}

/* ══════════════════════════════════════════════════════
   Aufgaben
   ══════════════════════════════════════════════════════ */
.aufgaben-gruppe {
  margin-bottom: 24px;
}

.aufgaben-gruppe-header {
  font-size: 14px;
  font-weight: 700;
  color: var(--color-text);
  padding: 8px 0;
  border-bottom: 2px solid var(--color-border);
  margin-bottom: 4px;
}

.aufgaben-gruppe-ueberfaellig .aufgaben-gruppe-header {
  color: var(--color-danger);
  border-bottom-color: var(--color-danger);
}

.aufgaben-gruppe-heute .aufgaben-gruppe-header {
  color: var(--color-primary);
  border-bottom-color: var(--color-primary);
}

.aufgaben-gruppe-erledigt {
  opacity: 0.6;
}

.aufgaben-zeile {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  margin-bottom: 4px;
  transition: background 0.15s;
}

.aufgaben-zeile:hover {
  background: #f8f9fc;
}

.aufgaben-zeile.ueberfaellig {
  border-left: 3px solid var(--color-danger);
  background: #fdf2f0;
}

.aufgaben-zeile.heute {
  border-left: 3px solid var(--color-primary);
  background: #f0f5ff;
}

.aufgaben-zeile.erledigt {
  opacity: 0.5;
  text-decoration: line-through;
}

.aufgaben-zeile-links {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1;
}

.aufgaben-zeile-mitte {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.aufgaben-zeile-rechts {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  flex-shrink: 0;
}

.aufgaben-typ-badge {
  font-size: 10px;
  color: #fff;
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: 600;
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.aufgaben-titel {
  font-size: 14px;
  font-weight: 500;
  color: var(--color-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.aufgaben-lead-link {
  font-size: 13px;
  color: var(--color-primary);
  text-decoration: none;
  white-space: nowrap;
}

.aufgaben-lead-link:hover {
  text-decoration: underline;
}

.aufgaben-faellig {
  font-size: 12px;
  color: var(--color-text-muted);
  white-space: nowrap;
}

.badge-auto {
  font-size: 9px;
  background: var(--color-info);
  color: #fff;
  padding: 1px 6px;
  border-radius: 8px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ══════════════════════════════════════════════════════
   Phasen (Lead-Detail)
   ══════════════════════════════════════════════════════ */
.phasen-tabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--color-border);
  margin-bottom: 16px;
}

.phasen-tab {
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: color 0.15s, border-color 0.15s;
  background: none;
  border-top: none;
  border-left: none;
  border-right: none;
}

.phasen-tab:hover {
  color: var(--color-text);
}

.phasen-tab.aktiv {
  color: var(--color-primary);
  border-bottom-color: var(--color-primary);
}

.phasen-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 16px;
}

.phase-zeile {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--color-border);
  font-size: 14px;
  cursor: pointer;
  transition: background 0.1s;
}

.phase-zeile:last-child {
  border-bottom: none;
}

.phase-zeile:hover {
  background: #f8f9fc;
}

.phase-zeile.erledigt {
  color: var(--color-text-muted);
}

.phase-zeile .phase-check {
  width: 20px;
  height: 20px;
  border: 2px solid var(--color-border);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.15s;
}

.phase-zeile.erledigt .phase-check {
  background: var(--color-success);
  border-color: var(--color-success);
  color: #fff;
}

.phase-zeile .phase-label {
  flex: 1;
}

.phase-zeile .phase-meta {
  font-size: 11px;
  color: var(--color-text-muted);
}

.phase-zeile .phase-undo {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 16px;
  color: var(--color-text-muted);
  padding: 2px 6px;
  border-radius: 4px;
  opacity: 0;
  transition: opacity 0.15s;
}

.phase-zeile:hover .phase-undo {
  opacity: 1;
}

.phase-zeile .phase-undo:hover {
  background: var(--color-bg);
  color: var(--color-danger);
}

.phase-alert {
  background: #fef3cd;
  color: #856404;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
}

.phasen-content {
  display: none;
}

.phasen-content.aktiv {
  display: block;
}

.phase-zeile-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}

.phase-notiz {
  font-size: 12px;
  color: var(--color-text-muted);
  font-style: italic;
}

.phase-fortschritt {
  height: 4px;
  background: var(--color-border);
  border-radius: 2px;
  margin-bottom: 16px;
  overflow: hidden;
}

.phase-fortschritt-bar {
  height: 100%;
  background: var(--color-success);
  border-radius: 2px;
  transition: width 0.3s ease;
}

/* ══════════════════════════════════════════════════════
   E-Mail-Seite
   ══════════════════════════════════════════════════════ */
.email-tabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--color-border);
  margin-bottom: 20px;
}

.email-tab {
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text-muted);
  cursor: pointer;
  border: none;
  background: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: color 0.15s, border-color 0.15s;
}

.email-tab:hover {
  color: var(--color-text);
}

.email-tab.aktiv {
  color: var(--color-primary);
  border-bottom-color: var(--color-primary);
}

.email-tab-content {
  display: none;
}

.email-tab-content.aktiv {
  display: block;
}

.email-split {
  display: grid;
  grid-template-columns: 35% 65%;
  gap: 20px;
  min-height: 500px;
}

.vorlagen-liste {
  max-height: calc(100vh - 240px);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.vorlage-karte {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  cursor: pointer;
  transition: all 0.15s;
}

.vorlage-karte:hover {
  border-color: var(--color-primary-light);
  box-shadow: var(--shadow-sm);
}

.vorlage-karte.aktiv {
  border-left: 3px solid var(--color-primary);
  background: #f0f5ff;
}

.vorlage-karte-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 6px;
}

.vorlage-karte-meta {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}

.vorlage-trigger-badge {
  font-size: 10px;
  background: var(--color-info);
  color: #fff;
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: 600;
}

.vorlage-filter-badge {
  font-size: 10px;
  background: var(--color-warning);
  color: #fff;
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: 600;
}

.vorlage-editor {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 20px;
  max-height: calc(100vh - 240px);
  overflow-y: auto;
}

.platzhalter-hilfe {
  margin-bottom: 8px;
}

.platzhalter-hilfe summary {
  font-size: 12px;
  color: var(--color-primary);
  cursor: pointer;
  font-weight: 500;
}

.platzhalter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px 0;
}

.platzhalter-chip {
  font-size: 11px;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  padding: 3px 8px;
  border-radius: 4px;
  cursor: pointer;
  font-family: var(--font-mono);
  transition: all 0.1s;
}

.platzhalter-chip:hover {
  background: var(--color-primary);
  color: #fff;
  border-color: var(--color-primary);
}

.vorschau-iframe {
  width: 100%;
  min-height: 400px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
}

/* Einrichtungs-Schritte */
.einrichtungs-schritt {
  display: flex;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--color-border);
}

.einrichtungs-schritt:last-child {
  border-bottom: none;
}

.schritt-nummer {
  width: 28px;
  height: 28px;
  min-width: 28px;
  background: var(--color-primary);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
}

/* Protokoll-Tabelle */
.protokoll-tabelle {
  font-size: 13px;
}

.status-gesendet {
  display: inline-block;
  font-size: 11px;
  background: #d4edda;
  color: #155724;
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: 600;
}

.status-fehlgeschlagen {
  display: inline-block;
  font-size: 11px;
  background: #f8d7da;
  color: #721c24;
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: 600;
}

.status-ausstehend {
  display: inline-block;
  font-size: 11px;
  background: #e9ecef;
  color: #6c757d;
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: 600;
}

/* Gmail Status */
.gmail-status-ok {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: #d4edda;
  color: #155724;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 14px;
}

.gmail-status-fehler {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: #fef3cd;
  color: #856404;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 14px;
}

/* Settings Fields */
.setting-row {
  margin-bottom: 12px;
}

.setting-row .label {
  font-size: 13px;
  margin-bottom: 4px;
}

/* Responsive Email Split */
@media (max-width: 900px) {
  .email-split {
    grid-template-columns: 1fr;
  }

  .vorlagen-liste {
    max-height: 300px;
  }
}

/* ══════════════════════════════════════════════════════
   DASHBOARD & BERICHTE
   ══════════════════════════════════════════════════════ */

.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}

@media (max-width: 768px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
}

.card {
  background: var(--color-surface);
  border-radius: var(--radius-md);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--color-border);
}

.card h3 {
  font-size: 15px;
  font-weight: 600;
  color: var(--color-primary);
  margin-bottom: 16px;
}

.chart-container {
  position: relative;
  height: 280px;
}

/* SOURCE-2FACTOR (Calvin 2026-05-07): zwei kleine Doughnuts side-by-side
   in der 'Leads nach Quelle'-Card. */
.quellen-doppel-chart {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.quellen-chart-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 0;
}

.quellen-chart-titel {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-muted);
  margin-bottom: 6px;
}

.chart-container--klein {
  height: 240px;
  width: 100%;
}

@media (max-width: 720px) {
  .quellen-doppel-chart { grid-template-columns: 1fr; }
}

.card-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.card-header-row h3 {
  margin-bottom: 0;
}

/* Aktivitäten Feed */
.aktivitaet-zeile {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--color-border);
}

.aktivitaet-zeile:last-child {
  border-bottom: none;
}

.aktivitaet-icon {
  font-size: 16px;
  flex-shrink: 0;
  width: 24px;
  text-align: center;
}

.aktivitaet-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 13px;
}

/* Sidebar Badge */
.sidebar-badge {
  display: none;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 10px;
  background: var(--color-danger);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  margin-left: auto;
}

/* ══════════════════════════════════════════════════════
   EINSTELLUNGEN
   ══════════════════════════════════════════════════════ */

.settings-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 24px;
  align-items: start;
}

.settings-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: var(--color-surface);
  border-radius: var(--radius-md);
  padding: 8px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--color-border);
  position: sticky;
  top: 20px;
}

.settings-nav-item {
  padding: 10px 14px;
  border: none;
  background: transparent;
  border-radius: var(--radius-sm);
  font-size: 14px;
  text-align: left;
  cursor: pointer;
  color: var(--color-text);
  transition: background 0.15s;
}

.settings-nav-item:hover {
  background: var(--color-bg);
}

.settings-nav-item.aktiv {
  background: var(--color-primary);
  color: #fff;
  font-weight: 600;
}

.settings-tab-content {
  display: none;
}

.settings-tab-content.aktiv {
  display: block;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

@media (max-width: 768px) {
  .settings-layout {
    grid-template-columns: 1fr;
  }

  .settings-nav {
    flex-direction: row;
    overflow-x: auto;
    position: static;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }
}

.input-group {
  display: flex;
  gap: 8px;
}

.input-group .form-input {
  flex: 1;
}

/* Table styles */
.table-responsive {
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.data-table th,
.data-table td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--color-border);
}

.data-table th {
  font-weight: 600;
  color: var(--color-text-muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  background: var(--color-bg);
}

.data-table tr:hover {
  background: rgba(0,0,0,0.02);
}

/* Button sizes */
.btn-sm {
  padding: 4px 10px;
  font-size: 12px;
}

.btn-danger {
  background: var(--color-danger);
  color: #fff;
  border: none;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 13px;
}

.btn-danger:hover {
  opacity: 0.9;
}

/* Skeleton loading */
.skeleton-box {
  background: linear-gradient(90deg, var(--color-border) 25%, var(--color-bg) 50%, var(--color-border) 75%);
  background-size: 200% 100%;
  animation: skeleton-pulse 1.5s ease-in-out infinite;
  border-radius: var(--radius-md);
}

@keyframes skeleton-pulse {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--color-text-muted);
}

.empty-state p {
  font-size: 14px;
}

/* Confirmation modal danger styles */
.modal-danger .btn-confirm {
  background: var(--color-danger);
}

/* Form select */
.form-select {
  padding: 8px 12px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  background: var(--color-surface);
  color: var(--color-text);
  cursor: pointer;
}

/* Text muted helper */
.text-muted {
  color: var(--color-text-muted);
  font-size: 12px;
}

/* Global responsive: main content */
@media (max-width: 768px) {
  .kpi-zeile {
    grid-template-columns: 1fr 1fr;
  }

  .detail-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
}

@media (max-width: 480px) {
  .kpi-zeile {
    grid-template-columns: 1fr;
  }
}

/* ══════════════════════════════════════════════════════
   LEAD-RANK-001 — Potenzial-Score Pille (1–10)
   Farbskala: 1–3 rot · 4–6 gelb · 7–10 grün.
   ══════════════════════════════════════════════════════ */

.score-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 26px;
  padding: 0 8px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
  position: relative;
  white-space: nowrap;
}

.score-pill--low      { background: #fee2e2; color: #b91c1c; }
.score-pill--med      { background: #fef3c7; color: #92400e; }
.score-pill--high     { background: #d1fae5; color: #065f46; }
.score-pill--unknown  { background: #f1f5f9; color: #94a3b8; font-weight: 600; }

.score-pill__override {
  display: inline-block;
  margin-left: 5px;
  padding: 1px 5px;
  border-radius: 6px;
  background: rgba(0, 0, 0, .12);
  color: inherit;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .03em;
  vertical-align: 1px;
}

.score-pill--lg {
  min-width: 64px;
  height: 44px;
  font-size: 24px;
  padding: 0 14px;
}

.score-block {
  background: var(--color-surface, #f8fafc);
  border: 1px solid var(--color-border, #e2e8f0);
  border-radius: var(--radius-md, 12px);
  padding: 16px;
  margin-bottom: 16px;
}

.score-block__title {
  font-size: 12px;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: 8px;
}

.score-block__row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.score-block__hint {
  margin-top: 10px;
  font-size: 12px;
  color: #64748b;
}

.score-block__explainer {
  margin-top: 12px;
  border-top: 1px dashed #e2e8f0;
  padding-top: 10px;
  font-size: 12px;
  line-height: 1.55;
  color: #475569;
}

.score-block__explainer summary {
  cursor: pointer;
  font-weight: 700;
  color: #334155;
  padding: 2px 0;
}

.score-override-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
}

.score-override-row input {
  width: 64px;
  padding: 6px 8px;
  border: 1px solid var(--color-border, #cbd5e1);
  border-radius: 8px;
  font-size: 14px;
  text-align: center;
}

.score-override-row .btn {
  font-size: 12px;
}

/* ══════════════════════════════════════════════════════
   Lead-Liste UI cleanup (2026-05-05)
   – Kompakte Status-Icons + Legende über der Tabelle
   ══════════════════════════════════════════════════════ */

.lead-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  margin-right: 4px;
  font-size: 14px;
  border-radius: 50%;
  cursor: help;
}

.lead-icon--owner       { background: #d1fae5; color: #065f46; }
.lead-icon--no-owner    { background: #f1f5f9; color: #94a3b8; font-size: 11px; }
.lead-icon--schufa-ok   { background: #d1fae5; color: #065f46; font-weight: 700; }
.lead-icon--schufa-bad  { background: #fee2e2; color: #b91c1c; font-weight: 700; }
.lead-icon--unknown     { background: #f1f5f9; color: #94a3b8; font-weight: 700; }

.leads-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 18px;
  padding: 10px 14px;
  margin: 0 0 16px;
  background: var(--color-surface, #f8fafc);
  border: 1px solid var(--color-border, #e2e8f0);
  border-radius: var(--radius-md, 10px);
  font-size: 12px;
  color: #475569;
}

.leads-legend__title {
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: #334155;
  font-size: 11px;
}

.leads-legend__group {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.leads-legend__item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.leads-legend__sep {
  color: #cbd5e1;
}

.leads-legend__score-row {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* ══════════════════════════════════════════════════════
   Lead-Summary-Tile (2026-05-05) — Wunschbetrag prominent
   im Lead-Detail-Header. Zeigt die Quick-Glance-Lead-Info,
   bevor der Operator sich durch die Forms scrollt.
   ══════════════════════════════════════════════════════ */
/* Welle 31: kompakter + HK-Brand-Akzent (Orange-Stripe + HK-Blue) */
.lead-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 6px;
}
.lead-summary__tile {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 6px 12px;
  background: var(--hk-white, #fff);
  border: 1px solid var(--hk-border, #E2E8F0);
  border-radius: var(--radius-md, 10px);
  min-width: 110px;
  position: relative;
}
.lead-summary__tile--highlight {
  background: var(--hk-blue-soft, rgba(0,114,255,0.08));
  border: 1px solid var(--hk-blue, #0072FF);
  padding-left: 14px;
}
.lead-summary__tile--highlight::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--hk-orange, #FF5F00);
  border-top-left-radius: var(--radius-md, 10px);
  border-bottom-left-radius: var(--radius-md, 10px);
}
.lead-summary__label {
  font-size: 10px;
  font-weight: 700;
  color: var(--hk-text-muted, #6E6E6E);
  text-transform: uppercase;
  letter-spacing: .06em;
}
.lead-summary__value {
  font-size: 15px;
  font-weight: 700;
  color: var(--hk-text, #111111);
}
.lead-summary__tile--highlight .lead-summary__value {
  font-size: 18px;
  color: var(--hk-blue-dark, #001233);
}
.lead-summary__icons {
  margin-left: auto;
  display: flex;
  gap: 6px;
  align-items: center;
}
/* Status-Badges (Welle 31) */
.hk-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid transparent;
  white-space: nowrap;
  letter-spacing: 0.01em;
}
.hk-badge--ok {
  background: rgba(15, 110, 86, 0.08);
  border-color: rgba(15, 110, 86, 0.35);
  color: #0F6E56;
}
.hk-badge--warn {
  background: rgba(255, 95, 0, 0.08);
  border-color: rgba(255, 95, 0, 0.35);
  color: #B34000;
}
.hk-badge--muted {
  background: var(--hk-bg, #F4F6F9);
  border-color: var(--hk-border, #E2E8F0);
  color: var(--hk-text-muted, #6E6E6E);
}

/* ══════════════════════════════════════════════════════
   Mobile Lead-Liste — Card-View statt Tabelle (Calvin 2026-05-13)
   Tabelle hat 10 Spalten, auf <640px unbrauchbar. Card-Layout
   stackt jede Zelle vertikal mit Label.
   ══════════════════════════════════════════════════════ */
@media (max-width: 640px) {
  #leads-table thead { display: none; }
  #leads-table, #leads-table tbody { display: block; }
  #leads-table tr {
    display: block;
    margin-bottom: 12px;
    padding: 12px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
  }
  #leads-table td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    border: none;
    text-align: right;
  }
  #leads-table td::before {
    content: attr(data-label);
    font-weight: 600;
    color: var(--color-text-muted);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    margin-right: 12px;
    text-align: left;
  }
  /* Checkbox-Spalte: alleinstehend oben links */
  #leads-table td.lead-checkbox-cell {
    border-bottom: 1px solid var(--color-border);
    padding-bottom: 10px;
    margin-bottom: 6px;
    justify-content: flex-start;
  }
  #leads-table td.lead-checkbox-cell::before { content: ''; }

  /* Filter-Bar: kompakter Stack */
  .filter-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }
  .filter-bar > * { width: 100%; }

  /* Legende auf Mobile ausblenden — Score-Pills sprechen für sich */
  .leads-legend { display: none; }

  /* Bulk-Bar Mobile-optimiert (volle Breite ohne Sidebar-Offset) */
  .bulk-bar { left: 0; padding: 10px 12px; flex-wrap: wrap; }
  .bulk-bar-actions { width: 100%; }

  /* Dashboard 2-col → 1-col war schon, hier nur Margins schlanker */
  .dash-hero h1 { font-size: 22px; }
  .quick-stats { gap: 10px; }
  .quick-stat { padding: 14px 16px; }
  .quick-stat .stat-value { font-size: 24px; }
}

/* ══════════════════════════════════════════════════════════
   Lead-Detail Tabs (HubSpot-Style) — Calvin 2026-05-18
   Refined minimal — keine lauten Akzente, klare Hierarchie,
   subtile Unterstreichung beim aktiven Tab. Touch-Targets ≥ 44px.
   ══════════════════════════════════════════════════════════ */

.ld-tabs {
  display: flex;
  gap: 2px;
  border-bottom: 1px solid var(--color-border);
  margin: 0 0 18px 0;
  padding: 0;
  overflow-x: auto;
  scrollbar-width: none;
  background: transparent;
}
.ld-tabs::-webkit-scrollbar { display: none; }

.ld-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  min-height: 44px;
  border: none;
  background: transparent;
  color: var(--color-text-muted);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  position: relative;
  transition: color 180ms ease, border-color 180ms ease, background-color 180ms ease;
  font-family: inherit;
  letter-spacing: 0.01em;
}
.ld-tab svg { opacity: 0.7; transition: opacity 180ms ease; }
.ld-tab:hover { color: var(--color-text); background: rgba(0,0,0,0.02); }
.ld-tab:hover svg { opacity: 1; }
.ld-tab:focus-visible {
  outline: none;
  background: rgba(24,95,165,0.06);
  border-radius: 6px 6px 0 0;
}

.ld-tab.is-active {
  color: var(--color-primary);
  border-bottom-color: var(--color-primary);
  font-weight: 600;
}
.ld-tab.is-active svg { opacity: 1; }

/* Badge auf Tabs (Anzahl Aufgaben/Dokumente) */
.ld-tab-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 6px;
  background: var(--color-bg);
  color: var(--color-text-muted);
  border-radius: 9px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
}
.ld-tab-badge:empty { display: none; }
.ld-tab.is-active .ld-tab-badge {
  background: var(--color-primary);
  color: #fff;
}

/* Tab-Panes: nur aktiver Pane sichtbar.
   Soft-fade beim Switch (kein Layout-Shift). */
.ld-pane {
  display: none;
  animation: ld-pane-in 200ms ease-out;
}
.ld-pane.is-active { display: block; }

@keyframes ld-pane-in {
  from { opacity: 0; transform: translateY(2px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Selbstauskunft-Tab — strukturierte Status-Karte */
.ld-selbstauskunft-status {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  padding: 14px 16px;
  background: var(--color-bg);
  border-radius: 8px;
  margin-bottom: 16px;
  align-items: center;
}
.ld-selbstauskunft-status .badge { font-size: 12px; }
.ld-selbstauskunft-status-icon {
  width: 36px; height: 36px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--color-surface);
  color: var(--color-primary);
}
.ld-selbstauskunft-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 8px;
  margin-top: 8px;
}
.ld-selbstauskunft-actions .btn { justify-content: flex-start; }

/* Mobile (≤ 640px): Tab-Bar horizontal scrollbar, kompaktere Padding */
@media (max-width: 640px) {
  .ld-tab { padding: 10px 12px; font-size: 13px; }
  .ld-tab svg { display: none; } /* nur Text auf Mobile, mehr Tabs sichtbar */
}

/* ══════════════════════════════════════════════════════
   Inline-Edit (Tag 3 — Marco-Regel: Klick → Input, Blur → Save)
   Keine "Bearbeiten"-Modus mehr, kein "Speichern"-Button.
   Input sieht aus wie Text, wird zum Input bei Hover/Focus,
   speichert sich selbst bei Blur via PATCH.
   ══════════════════════════════════════════════════════ */

.inline-edit-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 6px 0;
}
.inline-edit-group .label {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--hk-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* Inputs/Selects, die als Inline-Edit fungieren */
.inline-edit-input {
  font-size: var(--text-base);
  font-family: var(--font-sans);
  color: var(--hk-text);
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  padding: 6px 8px;
  margin: -6px -8px;   /* sodass Hover-Border genau über dem Text-Bereich liegt */
  width: calc(100% + 16px);
  transition: background-color 140ms ease, border-color 140ms ease, box-shadow 140ms ease;
  min-height: 36px;    /* Touch-Target ohne 44px-Wucht in dichten Forms */
}

.inline-edit-input:hover:not(:focus):not(.inline-edit-saving):not(.inline-edit-saved):not(.inline-edit-error) {
  background: var(--hk-bg);
  border-color: var(--hk-border);
}

.inline-edit-input:focus {
  outline: none;
  background: var(--hk-white);
  border-color: var(--hk-blue);
  box-shadow: 0 0 0 3px rgba(0,114,255,0.10);
}

/* Saved-State: kurz grün pulsen, dann fade-out zurück zu transparent */
.inline-edit-input.inline-edit-saving {
  background: var(--hk-bg);
}
.inline-edit-input.inline-edit-saved {
  border-color: var(--hk-success);
  background: var(--hk-success-soft);
  animation: inline-saved-fade 1.4s ease-out forwards;
}
.inline-edit-input.inline-edit-error {
  border-color: var(--hk-danger);
  background: var(--hk-danger-soft);
}

@keyframes inline-saved-fade {
  0%   { border-color: var(--hk-success); background: var(--hk-success-soft); }
  60%  { border-color: var(--hk-success); background: var(--hk-success-soft); }
  100% { border-color: transparent; background: transparent; }
}

/* Empty-Value-Hint: Placeholder im Inline-Edit (für leere Felder) */
.inline-edit-input:placeholder-shown {
  color: var(--hk-text-muted);
  font-style: italic;
}

/* Select-Indikator-Pfeil weglassen wenn nicht im Focus */
select.inline-edit-input { appearance: none; background-image: none; padding-right: 8px; }
select.inline-edit-input:focus {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236E6E6E' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
  background-position: right 8px center;
  background-repeat: no-repeat;
  background-size: 16px;
  padding-right: 28px;
}

/* Sektions-Header in Inline-Forms — kompakter als die normalen Card-Header */
.inline-section {
  grid-column: 1 / -1;
  margin: 16px 0 4px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--hk-border);
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--hk-text-muted);
}
.inline-section:first-child { margin-top: 0; }

/* ══════════════════════════════════════════════════════
   Lead-Liste Quick-Actions (Tag 3-B)
   Bei Hover über Zeile erscheinen Mini-Buttons direkt in der
   Aktionen-Zelle — Marco kann anrufen/mailen ohne Detail-View
   ══════════════════════════════════════════════════════ */

.lead-quick-actions {
  display: inline-flex;
  gap: 4px;
  opacity: 0;
  transition: opacity 140ms ease;
}
#leads-table tr:hover .lead-quick-actions,
.lead-quick-actions:focus-within {
  opacity: 1;
}

.lead-quick-actions .qa-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: var(--hk-white);
  border: 1px solid var(--hk-border);
  border-radius: var(--radius-md);
  color: var(--hk-text-muted);
  cursor: pointer;
  transition: all 140ms ease;
  text-decoration: none;
}
.lead-quick-actions .qa-btn:hover {
  background: var(--hk-blue);
  border-color: var(--hk-blue);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}
.lead-quick-actions .qa-btn svg { width: 14px; height: 14px; }

/* Mobile: Quick-Actions immer sichtbar (kein Hover auf Touch) */
@media (max-width: 640px) {
  .lead-quick-actions { opacity: 1; }
}

/* ══════════════════════════════════════════════════════
   Filter-Pills (Tag 3-C) — Quick-Filter über der Filter-Bar
   Marco klickt einen Pill und mehrere Filter werden automatisch
   gesetzt (Macro statt 5 Dropdowns auswählen).
   ══════════════════════════════════════════════════════ */

.filter-pills {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
  padding: 0;
}

.filter-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  min-height: 36px;
  background: var(--hk-white);
  border: 1px solid var(--hk-border);
  border-radius: var(--radius-pill);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--hk-text);
  cursor: pointer;
  transition: all 140ms ease;
  font-family: var(--font-sans);
}

.filter-pill:hover {
  border-color: var(--hk-blue);
  color: var(--hk-blue);
}

.filter-pill.is-active {
  background: var(--hk-blue);
  border-color: var(--hk-blue);
  color: #fff;
}

.filter-pill .pill-count {
  background: var(--hk-bg);
  color: var(--hk-text-muted);
  padding: 1px 8px;
  border-radius: 99px;
  font-size: var(--text-xs);
  font-weight: 600;
}
.filter-pill.is-active .pill-count {
  background: rgba(255,255,255,0.25);
  color: #fff;
}

.filter-pill svg { width: 14px; height: 14px; opacity: 0.6; }
.filter-pill.is-active svg { opacity: 1; }

/* ══════════════════════════════════════════════════════
   Mobile Lead-Liste — Polish (Tag 4-C)
   Telefon prominent, Score-Pill größer, Name groß, Quick-Actions
   immer sichtbar als große Buttons
   ══════════════════════════════════════════════════════ */

@media (max-width: 640px) {
  /* Lead-Card: hierarchischer aufgebaut */
  #leads-table tr {
    padding: var(--space-4);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border-color: var(--hk-border);
    transition: box-shadow 180ms ease, transform 180ms ease;
  }
  #leads-table tr:active { transform: scale(0.99); }
  #leads-table tr.is-selected {
    border-color: var(--hk-blue);
    box-shadow: 0 0 0 2px rgba(0,114,255,0.12), var(--shadow-sm);
  }

  /* Score-Pill bei Mobile größer + linksbündig (1. Zeile) */
  #leads-table td[data-label="Potenzial"] {
    display: flex;
    justify-content: flex-start;
    padding: 0 0 var(--space-2) 0;
    text-align: left;
  }
  #leads-table td[data-label="Potenzial"]::before { display: none; }
  #leads-table td[data-label="Potenzial"] .score-pill {
    font-size: 17px !important;
    font-weight: 700;
    padding: 6px 14px;
    min-height: 32px;
    min-width: 56px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  /* Name als prominente Headline (2. Zeile) */
  #leads-table td[data-label="Name"] {
    display: block;
    text-align: left;
    padding: 0 0 var(--space-2) 0;
  }
  #leads-table td[data-label="Name"]::before { display: none; }
  #leads-table td[data-label="Name"] > div:first-child {
    font-size: var(--text-lg);
    font-weight: 700;
    color: var(--hk-text);
  }
  #leads-table td[data-label="Name"] > div.text-muted {
    font-size: var(--text-sm) !important;
    margin-top: 2px;
  }
  /* Telefon / Email prominent als tappable Link */
  #leads-table td[data-label="Name"] a[href^="tel:"],
  #leads-table td[data-label="Name"] a[href^="mailto:"] {
    display: inline-block;
    font-weight: 600;
    color: var(--hk-blue);
  }

  /* Quick-Actions: größere Touch-Targets, eigene Zeile am Ende */
  #leads-table td.actions-cell {
    display: flex;
    justify-content: flex-end;
    padding: var(--space-3) 0 0 0;
    margin-top: var(--space-2);
    border-top: 1px solid var(--hk-border);
  }
  #leads-table td.actions-cell::before { display: none; }
  #leads-table .lead-quick-actions { opacity: 1 !important; gap: 8px; }
  #leads-table .lead-quick-actions .qa-btn {
    width: 44px;
    height: 44px;
  }
  #leads-table .lead-quick-actions .qa-btn svg { width: 18px; height: 18px; }

  /* Sekundäre Felder kompakter (Kreditart, Phase, Eingegangen) */
  #leads-table td[data-label="Kreditart"],
  #leads-table td[data-label="Phase"],
  #leads-table td[data-label="Eingegangen"],
  #leads-table td[data-label="Letzte Aktivität"],
  #leads-table td[data-label="Status"],
  #leads-table td[data-label="Aufgaben"] {
    font-size: var(--text-sm);
    padding: 4px 0;
  }
  #leads-table td[data-label="Kreditart"]::before,
  #leads-table td[data-label="Phase"]::before,
  #leads-table td[data-label="Eingegangen"]::before,
  #leads-table td[data-label="Letzte Aktivität"]::before,
  #leads-table td[data-label="Status"]::before,
  #leads-table td[data-label="Aufgaben"]::before {
    font-size: 10px;
    opacity: 0.7;
  }

  /* Heute-Hero auch auf Mobile schlanker */
  .today-hero { padding: 20px; margin-bottom: 16px; }
  .today-hero-headline { font-size: 19px; line-height: 1.3; }
  .today-hero-items { gap: 14px 18px; margin-bottom: 18px; }
  .today-hero-item-icon { width: 36px; height: 36px; }
  .today-hero-cta { width: 100%; justify-content: center; }
}

/* ══════════════════════════════════════════════════════
   AI Brain — Settings-Tab (Welle 6)
   ══════════════════════════════════════════════════════ */

/* Banners */
.ai-banner {
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-4);
  font-size: var(--text-sm);
  border-left: 4px solid;
}
.ai-banner-warn   { background: var(--hk-warn-soft);    border-color: var(--hk-warn);    color: #92400E; }
.ai-banner-danger { background: var(--hk-danger-soft);  border-color: var(--hk-danger);  color: #991B1B; }
.ai-banner-info   { background: var(--hk-blue-soft);    border-color: var(--hk-blue);    color: var(--hk-blue-dark); }

/* Card-Varianten */
.card-info   { border-left: 4px solid var(--hk-blue); }
.card-danger { border-left: 4px solid var(--hk-danger); }
.card-danger h3 { color: var(--hk-danger); }

/* API-Key-Card */
.ai-key-card {
  border: 1px solid var(--hk-border);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
  margin-bottom: var(--space-3);
  background: #FAFBFC;
}
.ai-key-card .key-row {
  display: flex; justify-content: space-between; align-items: flex-start; gap: var(--space-4);
}
.ai-key-card .badge { margin-left: var(--space-2); }
.key-display {
  margin-top: 6px;
  font-family: var(--font-mono);
  background: var(--hk-white);
  border: 1px solid var(--hk-border);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  font-size: var(--text-xs);
  color: var(--hk-text);
  display: inline-block;
}
.key-test-result {
  margin-top: 8px; font-size: var(--text-xs); min-height: 16px;
}
.btn-sm { min-height: 32px !important; padding: 0 10px !important; font-size: var(--text-xs); }

/* Toggle-Row */
.toggle-row {
  display: flex; justify-content: space-between; align-items: flex-start; gap: var(--space-4);
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--hk-border);
}
.toggle-row:last-of-type { border-bottom: none; }
.toggle-info { flex: 1; }
.toggle-label { font-weight: 600; display: block; margin-bottom: 4px; }
.toggle-desc {
  font-size: var(--text-sm); color: var(--hk-text-muted);
  margin: 0; line-height: 1.4;
}
.toggle-desc a { color: var(--hk-blue); text-decoration: none; }
.toggle-desc a:hover { text-decoration: underline; }
.toggle-switch {
  position: relative; display: inline-block; width: 44px; height: 24px; flex-shrink: 0;
}
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute; inset: 0;
  background: var(--hk-border);
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: background 0.2s ease;
}
.toggle-slider::before {
  content: ''; position: absolute;
  left: 2px; top: 2px;
  width: 20px; height: 20px;
  background: white;
  border-radius: 50%;
  transition: transform 0.2s ease;
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}
.toggle-switch input:checked + .toggle-slider { background: var(--hk-blue); }
.toggle-switch input:checked + .toggle-slider::before { transform: translateX(20px); }

/* Budget-Bar */
.budget-row {
  display: grid; grid-template-columns: 80px 1fr auto; gap: var(--space-3);
  align-items: center; margin-bottom: var(--space-3);
}
.budget-label { font-size: var(--text-sm); font-weight: 600; color: var(--hk-text-muted); }
.budget-bar {
  height: 8px; background: var(--hk-border);
  border-radius: var(--radius-pill); overflow: hidden;
}
.budget-fill {
  height: 100%; transition: width 0.3s ease;
  border-radius: var(--radius-pill);
}
.budget-fill-ok     { background: var(--hk-success); }
.budget-fill-warn   { background: var(--hk-warn); }
.budget-fill-danger { background: var(--hk-danger); }
.budget-value { font-size: var(--text-sm); color: var(--hk-text); white-space: nowrap; }

/* Input-Suffix (€ / Sek.) */
.input-suffix {
  display: inline-flex; align-items: center;
  padding: 0 var(--space-3);
  background: var(--hk-bg);
  border: 1px solid var(--hk-border);
  border-left: none;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  font-size: var(--text-sm); color: var(--hk-text-muted);
  min-height: 44px;
}
.input-group { display: flex; }
.input-group .form-input { flex: 1; border-radius: var(--radius-md) 0 0 var(--radius-md); }
.input-group:has(.btn) .form-input { border-radius: var(--radius-md); }
.input-group .btn { margin-left: var(--space-2); }

/* Danger-Row */
.danger-row {
  display: flex; justify-content: space-between; align-items: center; gap: var(--space-4);
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--hk-border);
}
.danger-row:last-of-type { border-bottom: none; }
.danger-row strong { display: block; margin-bottom: 4px; }
.danger-row p { margin: 0; font-size: var(--text-sm); color: var(--hk-text-muted); }

/* Helper */
.text-muted { color: var(--hk-text-muted); }
.text-warn  { color: var(--hk-warn); }
.text-danger { color: var(--hk-danger); }
.loading-state, .empty-state {
  text-align: center; padding: var(--space-8); color: var(--hk-text-muted);
}

/* ══════════════════════════════════════════════════════
   CRM Topbar mit KI-Pill (Welle 10)
   ══════════════════════════════════════════════════════ */
.crm-topbar {
  position: fixed; top: 0; left: 240px; right: 0; z-index: 50;
  height: 48px;
  background: var(--hk-white);
  border-bottom: 1px solid var(--hk-border);
  display: flex; align-items: center;
  padding: 0 24px;
  font-family: var(--font-sans);
}
.crm-topbar-spacer { flex: 1; }

.crm-topbar-ki-pill {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--hk-bg);
  border: 1px solid var(--hk-border);
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  font-size: var(--text-sm); font-weight: 600;
  color: var(--hk-text);
  transition: all 0.12s ease;
  position: relative;
}
.crm-topbar-ki-pill:hover { border-color: var(--hk-blue); }
.crm-topbar-ki-pill[data-color="gray"]   .crm-topbar-ki-dot { background: var(--hk-text-muted); }
.crm-topbar-ki-pill[data-color="green"]  .crm-topbar-ki-dot { background: var(--hk-success); animation: ki-pulse 2s ease-in-out infinite; }
.crm-topbar-ki-pill[data-color="yellow"] .crm-topbar-ki-dot { background: var(--hk-warn); }
.crm-topbar-ki-pill[data-color="red"]    .crm-topbar-ki-dot { background: var(--hk-danger); }
.crm-topbar-ki-dot {
  width: 8px; height: 8px; border-radius: 50%;
  flex-shrink: 0;
}
@keyframes ki-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(15,110,86,0.4); }
  50%      { box-shadow: 0 0 0 6px rgba(15,110,86,0); }
}
.crm-topbar-ki-label { font-weight: 700; }
.crm-topbar-ki-spend {
  color: var(--hk-text-muted);
  font-weight: 500;
  font-size: var(--text-xs);
  padding-left: 8px;
  border-left: 1px solid var(--hk-border);
}
.crm-topbar-ki-spend:empty { display: none; }

.crm-topbar-dropdown {
  position: absolute; top: 56px; right: 24px;
  background: var(--hk-white);
  border: 1px solid var(--hk-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 280px;
  padding: 16px;
  z-index: 60;
}
.crm-topbar-dropdown[hidden] { display: none; }
.ki-dd-toggle {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 8px;
}
.ki-dd-hint {
  font-size: var(--text-xs);
  color: var(--hk-text-muted);
  margin: 0 0 12px;
  line-height: 1.4;
}
.ki-dd-spend {
  display: grid; grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
  padding: 10px;
  background: var(--hk-bg);
  border-radius: var(--radius-md);
  font-size: var(--text-xs);
  margin-bottom: 12px;
}
.ki-dd-spend div { display: flex; flex-direction: column; gap: 2px; }
.ki-dd-spend strong { font-size: var(--text-sm); }
.ki-dd-actions { display: flex; gap: 6px; }
.ki-dd-actions .btn { flex: 1; }

/* main-content braucht 48px Top-Padding für die Topbar */
.main-content { padding-top: 72px !important; }

@media (max-width: 768px) {
  .crm-topbar { left: 0; padding: 0 12px; }
  .crm-topbar-ki-spend { display: none; }
  .crm-topbar-dropdown { right: 12px; left: 12px; width: auto; }
}

/* ══════════════════════════════════════════════════════
   Tab-Count Badge + Bulk-Bar + Mail-Check (Welle 10)
   ══════════════════════════════════════════════════════ */
.tab-count {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 8px;
  background: var(--hk-orange);
  color: white;
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: 700;
}
.tab-count:empty { display: none; }

.bulk-bar {
  display: flex; align-items: center; gap: 12px;
  background: var(--hk-blue-soft);
  border: 1px solid var(--hk-blue);
  border-radius: var(--radius-md);
  padding: 10px 16px;
  margin: 12px 0;
}
.bulk-bar strong { color: var(--hk-blue); }
.bulk-bar[hidden] { display: none; }

.mail-card-check {
  display: flex; align-items: center;
}
.mail-card-check input[type="checkbox"] {
  width: 18px; height: 18px; cursor: pointer;
}

.ai-master-card {
  border-left: 4px solid var(--hk-orange);
}
.ai-master-card[data-enabled="1"] { border-left-color: var(--hk-success); }
.ai-master-card .badge { background: var(--hk-bg); color: var(--hk-text-muted); }
.ai-master-card[data-enabled="1"] .badge { background: var(--hk-success-soft); color: var(--hk-success); }

.inbox-status-btn {
  background: transparent; border: none; padding: var(--space-3) var(--space-4);
  cursor: pointer; color: var(--hk-text-muted); font-weight: 600;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
  font-size: var(--text-base);
}
.inbox-status-btn:hover { color: var(--hk-text); }
.inbox-status-btn.active { color: var(--hk-blue); border-bottom-color: var(--hk-blue); }

/* ══════════════════════════════════════════════════════
   Lead-Detail Doc-Kategorien (Welle 15)
   ══════════════════════════════════════════════════════ */

.doc-category-section {
  background: var(--hk-white);
  border: 1px solid var(--hk-border);
  border-radius: var(--radius-lg);
  margin-bottom: 16px;
  overflow: hidden;
}
.doc-category-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid var(--hk-border);
  background: var(--hk-bg);
}
.doc-category-title { display: flex; align-items: center; gap: 8px; }
.doc-category-icon { font-size: 18px; }
.doc-category-counter {
  background: var(--hk-blue-soft); color: var(--hk-blue);
  font-size: 11px; font-weight: 700;
  padding: 2px 8px; border-radius: var(--radius-pill);
  margin-left: 4px;
}
.doc-category-upload { cursor: pointer; }
.doc-category-body {
  padding: 12px 16px;
  display: flex; flex-direction: column; gap: 8px;
}
.doc-card {
  display: flex; gap: 12px; align-items: center;
  padding: 10px 12px;
  background: var(--hk-bg);
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  transition: border-color 0.12s ease;
}
.doc-card:hover { border-color: var(--hk-blue); }
.doc-card-icon { font-size: 20px; flex-shrink: 0; }
.doc-card-info { flex: 1; min-width: 0; }
.doc-card-name {
  font-weight: 600; font-size: 13px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.doc-card-meta { font-size: 11px; color: var(--hk-text-muted); }
.doc-card-actions { display: flex; gap: 4px; }
.doc-card-actions button {
  background: transparent; border: 1px solid var(--hk-border);
  padding: 6px; border-radius: var(--radius-sm);
  cursor: pointer; color: var(--hk-text-muted);
}
.doc-card-actions button:hover { color: var(--hk-blue); border-color: var(--hk-blue); }
.doc-card-empty {
  padding: 20px;
  border: 2px dashed var(--hk-border);
  border-radius: var(--radius-md);
  text-align: center;
  color: var(--hk-text-muted);
  font-size: 13px;
}

/* ══════════════════════════════════════════════════════
   Partner-Cards (Welle 16) — Bankberater + Zuträger
   ══════════════════════════════════════════════════════ */

.partner-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 16px;
}

.partner-card {
  background: var(--hk-white);
  border: 1px solid var(--hk-border);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  display: flex; flex-direction: column;
  gap: 12px;
  transition: box-shadow 0.15s ease, border-color 0.15s ease;
}
.partner-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--hk-blue);
}
.partner-card-inactive { opacity: 0.55; }

.partner-card-head { display: flex; gap: 12px; align-items: flex-start; }

.partner-avatar {
  width: 48px; height: 48px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 15px;
  color: white;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0,0,0,0.12);
}
.partner-avatar-bank {
  background: linear-gradient(135deg, var(--hk-blue) 0%, var(--hk-blue-dark) 100%);
}
.partner-avatar-ref {
  background: linear-gradient(135deg, var(--hk-orange) 0%, #C44A00 100%);
}

.partner-card-meta { flex: 1; min-width: 0; }
.partner-card-name {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  font-size: 14px; line-height: 1.3;
  margin-bottom: 4px;
}
.partner-card-name strong { font-size: 15px; }
.partner-card-contact {
  font-size: 12px; color: var(--hk-text-muted);
}

.pt-badge {
  font-size: 10px; font-weight: 700;
  padding: 2px 8px; border-radius: var(--radius-pill);
  text-transform: uppercase; letter-spacing: 0.04em;
  white-space: nowrap;
}
.pt-badge-bank     { background: var(--hk-blue-soft); color: var(--hk-blue-dark); }
.pt-badge-ref      { background: rgba(255,95,0,0.12); color: #C44A00; }
.pt-badge-default  { background: #FFF3DA; color: #8C6A2A; }
.pt-badge-inactive { background: var(--hk-bg); color: var(--hk-text-muted); }

.partner-card-body {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 10px 12px;
  background: var(--hk-bg);
  border-radius: var(--radius-md);
  font-size: 13px;
}
.partner-stat { display: flex; align-items: center; gap: 6px; }

.partner-card-notes {
  font-size: 12px;
  color: var(--hk-text-muted);
  font-style: italic;
  padding: 8px 12px;
  background: rgba(255,255,255,0.5);
  border-left: 3px solid var(--hk-border);
  border-radius: var(--radius-sm);
}

.partner-card-actions {
  display: flex; gap: 6px; flex-wrap: wrap;
}

/* Radio-Pills im Modal */
.radio-pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 14px;
  background: var(--hk-white);
  border: 2px solid var(--hk-border);
  border-radius: var(--radius-md);
  cursor: pointer;
  font-weight: 500;
  transition: all 0.12s ease;
  font-size: 14px;
}
.radio-pill:hover { border-color: var(--hk-blue); }
.radio-pill input[type="radio"] { margin: 0; cursor: pointer; }
.radio-pill:has(input:checked) {
  background: var(--hk-blue-soft);
  border-color: var(--hk-blue);
  color: var(--hk-blue-dark);
}

/* Counter-Badge in Filter-Pill */
.ai-filter-pill .cnt {
  background: rgba(0,0,0,0.08);
  padding: 1px 7px;
  border-radius: var(--radius-pill);
  font-size: 10px;
  font-weight: 700;
  margin-left: 4px;
}
.ai-filter-pill.active .cnt {
  background: rgba(255,255,255,0.25);
  color: white;
}

/* Form-Grid für Modal */
.form-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 12px;
}
@media (max-width: 600px) {
  .form-grid { grid-template-columns: 1fr; }
}

/* ── Pipeline Quick-View Side-Sheet (Welle 17, Calvin 2026-06-05) ── */
/* Side-Sheet rutscht von rechts rein. Nutzt das normale Modal-System,
   übersteuert .modal-overlay (alignment) + .modal-content (position/size). */
.modal-overlay.has-side-sheet {
  justify-content: flex-end;
  align-items: stretch;
  padding: 0;
}
.modal-content.modal-side-sheet {
  max-height: 100vh;
  height: 100vh;
  max-width: 460px;
  width: 100%;
  border-radius: 0;
  transform: translateX(20px);
  transition: transform 0.22s ease;
  overflow-y: auto;
}
.modal-visible .modal-content.modal-side-sheet {
  transform: translateX(0);
}

/* Sheet-Sections */
.qv-sheet-head {
  position: sticky; top: 0; z-index: 5;
  background: var(--color-surface);
  padding: 20px 24px 14px;
  border-bottom: 1px solid var(--color-border);
}
.qv-sheet-head h2 {
  margin: 0; font-size: 20px; font-weight: 700; line-height: 1.2;
  color: var(--hk-text, var(--color-text));
}
.qv-sheet-head .qv-meta-row {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin-top: 8px;
}
.qv-sheet-head .qv-close {
  position: absolute; top: 14px; right: 14px;
  width: 32px; height: 32px; border-radius: 8px;
  background: none; border: none; font-size: 22px; cursor: pointer;
  color: var(--color-text-muted);
  display: inline-flex; align-items: center; justify-content: center;
}
.qv-sheet-head .qv-close:hover { background: var(--hk-bg); }

.qv-sheet-body { padding: 16px 24px 24px; }
.qv-sheet-body .qv-section { margin-bottom: 22px; }
.qv-sheet-body .qv-section h4 {
  font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--color-text-muted); margin: 0 0 10px;
}

.qv-contact-row { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
.qv-contact-btn {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 12px 8px; border-radius: 10px; border: 1px solid var(--color-border);
  background: var(--color-surface); cursor: pointer; text-decoration: none;
  color: var(--color-text); font-size: 11px; font-weight: 600;
  transition: all 0.15s ease;
}
.qv-contact-btn:hover { border-color: var(--hk-blue, #0072FF); background: var(--hk-blue-soft, #EFF6FF); color: var(--hk-blue, #0072FF); }
.qv-contact-btn.is-disabled { opacity: 0.4; pointer-events: none; }
.qv-contact-btn svg { width: 20px; height: 20px; }

.qv-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 16px; }
.qv-grid-2 .qv-cell { font-size: 13px; }
.qv-grid-2 .qv-cell-label { color: var(--color-text-muted); font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 2px; }
.qv-grid-2 .qv-cell-value { font-weight: 600; color: var(--color-text); }

.qv-activity-list { display: flex; flex-direction: column; gap: 8px; }
.qv-activity-item {
  display: flex; gap: 10px; padding: 10px 12px;
  background: var(--hk-bg); border-radius: 8px; font-size: 12px;
}
.qv-activity-item .qv-act-type { font-weight: 600; min-width: 60px; }
.qv-activity-item .qv-act-when { color: var(--color-text-muted); margin-left: auto; white-space: nowrap; }

.qv-task-item {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 12px; border-radius: 8px; border: 1px solid var(--color-border);
  font-size: 13px; margin-bottom: 6px;
}
.qv-task-item.is-overdue { border-color: #FCA5A5; background: #FEF2F2; }
.qv-task-item .qv-task-due { color: var(--color-text-muted); font-size: 11px; }
.qv-task-item.is-overdue .qv-task-due { color: #B91C1C; font-weight: 600; }

.qv-empty { color: var(--color-text-muted); font-size: 12px; font-style: italic; padding: 8px 0; }

.qv-sheet-foot {
  position: sticky; bottom: 0; z-index: 5;
  display: flex; gap: 8px;
  padding: 14px 24px; background: var(--color-surface);
  border-top: 1px solid var(--color-border);
}
.qv-sheet-foot .btn { flex: 1; }

/* ── Pipeline Card Quick-Actions (Welle 17) ── */
.kanban-card-actions {
  display: flex; gap: 4px;
}
.kanban-card-action {
  width: 26px; height: 26px; border-radius: 7px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--hk-bg); color: var(--color-text-muted);
  border: none; cursor: pointer; text-decoration: none;
  transition: all 0.12s ease;
}
.kanban-card-action:hover { background: var(--hk-blue-soft, #EFF6FF); color: var(--hk-blue, #0072FF); }
.kanban-card-action.is-disabled { opacity: 0.35; cursor: not-allowed; pointer-events: none; }
.kanban-card-action svg { width: 14px; height: 14px; }

/* ── Pipeline Card Marker (Welle 17) ── */
.kanban-karte-marker-row {
  display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 4px;
}
.kanban-pill-neu {
  display: inline-block; padding: 1px 7px; border-radius: 999px;
  background: var(--hk-orange, #FF5F00); color: #fff;
  font-size: 9px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
}
.kanban-pill-diamond {
  display: inline-block; padding: 1px 7px; border-radius: 999px;
  background: linear-gradient(90deg, #FBBF24, #F59E0B); color: #422006;
  font-size: 9px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase;
}
.kanban-karte.is-verpasst-stale .kanban-verpasst-puls {
  position: absolute; top: 6px; right: 6px;
  width: 10px; height: 10px; border-radius: 50%;
  background: #DC2626;
  box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.55);
  animation: kanbanVerpasstPulse 1.6s infinite;
}
@keyframes kanbanVerpasstPulse {
  0%   { box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.6); }
  70%  { box-shadow: 0 0 0 10px rgba(220, 38, 38, 0); }
  100% { box-shadow: 0 0 0 0 rgba(220, 38, 38, 0); }
}


/* ══════════════════════════════════════════════════════
   Welle 33 (Ultraplan A1/A2) — Live-Indikator + Update-Animationen
   ══════════════════════════════════════════════════════ */

.live-indicator {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  font-family: var(--font-mono, 'DM Mono', monospace);
  color: var(--color-text-muted);
  padding: 4px 11px;
  border: 1px solid var(--hk-border, #E7EAF1);
  border-radius: 999px;
  background: var(--color-surface, #fff);
  margin-right: 10px;
  white-space: nowrap;
  cursor: default;
  user-select: none;
}
.live-indicator .live-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #9ca3af;
  position: relative;
  flex-shrink: 0;
}
.live-indicator[data-status="live"] .live-dot { background: var(--hk-success, #0F6E56); }
.live-indicator[data-status="live"] .live-dot::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px solid rgba(15, 110, 86, 0.35);
  animation: hk-live-pulse 2.2s ease-out infinite;
}
.live-indicator[data-status="live"] .live-text { color: var(--hk-success, #0F6E56); font-weight: 600; }
.live-indicator[data-status="connecting"] .live-dot,
.live-indicator[data-status="reconnect"] .live-dot { background: var(--hk-orange, #FF5F00); }
@keyframes hk-live-pulse {
  0%   { transform: scale(0.55); opacity: 1; }
  100% { transform: scale(1.7);  opacity: 0; }
}

/* Sanfter Blau-Flash, wenn sich ein Wert durch ein Live-Update ändert */
.value-flash { animation: hk-value-flash 0.9s ease; border-radius: 6px; }
@keyframes hk-value-flash {
  0%   { background-color: rgba(0, 114, 255, 0.16); }
  100% { background-color: transparent; }
}

@media (max-width: 640px) {
  .live-indicator .live-text { display: none; } /* mobil nur der Puls-Dot */
  .live-indicator { padding: 4px 6px; }
}

/* ── Welle 33 (B2) — Command-Palette / Schnellsuche ───── */
#hk-cmdk { position: fixed; inset: 0; z-index: 9000; }
#hk-cmdk .cmdk-backdrop {
  position: absolute; inset: 0;
  background: rgba(12, 21, 38, 0.45);
  backdrop-filter: blur(2px);
}
#hk-cmdk .cmdk-panel {
  position: relative;
  max-width: 560px;
  margin: 11vh auto 0;
  background: var(--color-surface, #fff);
  border-radius: 14px;
  box-shadow: 0 24px 64px rgba(0, 18, 51, 0.35);
  overflow: hidden;
  border: 1px solid var(--hk-border, #E7EAF1);
}
#hk-cmdk .cmdk-input-row {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--hk-border, #E7EAF1);
  color: var(--color-text-muted);
}
#hk-cmdk .cmdk-input-row input {
  flex: 1; border: none; outline: none;
  font-size: 15px; font-family: var(--font-sans);
  color: var(--hk-text, #0C1526);
  background: transparent;
}
#hk-cmdk .cmdk-input-row kbd {
  font-family: var(--font-mono);
  font-size: 10px;
  border: 1px solid var(--hk-border);
  border-radius: 5px;
  padding: 2px 6px;
  color: var(--color-text-muted);
}
#hk-cmdk .cmdk-results { max-height: 46vh; overflow-y: auto; padding: 6px; }
#hk-cmdk .cmdk-group {
  font-family: var(--font-mono);
  font-size: 10px; text-transform: uppercase; letter-spacing: 0.8px;
  color: var(--color-text-muted);
  padding: 8px 10px 4px;
}
#hk-cmdk .cmdk-hint { padding: 10px 12px; font-size: 12px; color: var(--color-text-muted); }
#hk-cmdk .cmdk-item {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 9px 12px;
  border-radius: 9px;
  cursor: pointer;
}
#hk-cmdk .cmdk-item.is-active { background: var(--hk-blue-soft, rgba(0,114,255,0.08)); }
#hk-cmdk .cmdk-item-title { font-weight: 600; font-size: 14px; }
#hk-cmdk .cmdk-item-sub { font-size: 12px; color: var(--color-text-muted); margin-left: 8px; }
#hk-cmdk .cmdk-item-meta {
  font-family: var(--font-mono);
  font-size: 11px; color: var(--color-text-muted); white-space: nowrap;
}

/* Topbar-Suchknopf (öffnet Palette) */
.crm-topbar-search {
  display: inline-flex; align-items: center; gap: 7px;
  border: 1px solid var(--hk-border, #E7EAF1);
  background: var(--color-surface, #fff);
  border-radius: 999px;
  padding: 4px 11px;
  margin-right: 10px;
  font-size: 12px;
  color: var(--color-text-muted);
  cursor: pointer;
  font-family: var(--font-sans);
}
.crm-topbar-search:hover { border-color: var(--hk-blue); color: var(--hk-blue); }
.crm-topbar-search kbd {
  font-family: var(--font-mono); font-size: 10px;
  border: 1px solid var(--hk-border); border-radius: 4px; padding: 1px 5px;
}
@media (max-width: 640px) { .crm-topbar-search span.label { display: none; } }

/* ── Welle 33 (B1) — Status-/Outcome-Schnellmenü in der Lead-Liste ── */
.hk-quick-menu {
  position: fixed;
  z-index: 8000;
  min-width: 230px;
  background: var(--color-surface, #fff);
  border: 1px solid var(--hk-border, #E7EAF1);
  border-radius: 12px;
  box-shadow: 0 16px 48px rgba(0, 18, 51, 0.22);
  padding: 6px;
}
.hk-quick-menu .qm-title {
  font-family: var(--font-mono);
  font-size: 10px; text-transform: uppercase; letter-spacing: 0.8px;
  color: var(--color-text-muted);
  padding: 7px 10px 5px;
}
.hk-quick-menu .qm-item {
  display: flex; align-items: center; gap: 8px;
  width: 100%;
  text-align: left;
  border: none; background: transparent;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 13px;
  font-family: var(--font-sans);
  color: var(--hk-text, #0C1526);
  cursor: pointer;
}
.hk-quick-menu .qm-item:hover { background: var(--hk-blue-soft, rgba(0,114,255,0.08)); }
.hk-quick-menu .qm-item.is-current { font-weight: 700; color: var(--hk-blue); }
.hk-quick-menu .qm-item .qm-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }

/* Status-Badge in der Liste als klickbar markieren */
.status-badge.is-clickable { cursor: pointer; }
.status-badge.is-clickable:hover { box-shadow: 0 0 0 2px var(--hk-blue-soft, rgba(0,114,255,0.12)); }

/* ── Welle 33 (B4) — Offline-/Verbindungs-Banner ───────── */
#hk-offline-banner {
  position: fixed;
  top: 10px; left: 50%; transform: translateX(-50%);
  z-index: 9500;
  display: flex; align-items: center; gap: 12px;
  background: var(--hk-blue-dark, #001233);
  color: #fff;
  border-radius: 999px;
  padding: 9px 16px;
  font-size: 13px;
  box-shadow: 0 12px 32px rgba(0, 18, 51, 0.35);
}
#hk-offline-banner button {
  border: 1px solid rgba(255,255,255,0.35);
  background: transparent; color: #fff;
  border-radius: 999px; padding: 4px 12px;
  font-size: 12px; cursor: pointer;
}
#hk-offline-banner button:hover { background: rgba(255,255,255,0.12); }

/* ── Welle 33 (D3) — KI-Lage-Karte im Lead-Detail ───────── */
.ki-lage-box { margin: 10px 0 4px; }
.ki-lage-toggle {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--hk-blue-soft, rgba(0,114,255,0.08));
  color: var(--hk-blue, #0072FF);
  border: 1px solid rgba(0,114,255,0.25);
  border-radius: 999px;
  padding: 5px 13px;
  font-size: 12.5px; font-weight: 600;
  cursor: pointer;
  font-family: var(--font-sans);
}
.ki-lage-toggle:hover { background: rgba(0,114,255,0.14); }
.ki-lage-body {
  margin-top: 9px;
  padding: 12px 14px;
  border: 1px solid var(--hk-border, #E7EAF1);
  border-left: 3px solid var(--hk-blue, #0072FF);
  border-radius: 10px;
  background: var(--color-surface, #fff);
}
.ki-lage-situation { font-size: 13.5px; line-height: 1.55; margin-bottom: 8px; }
.ki-lage-step { font-size: 13px; padding: 2px 0; color: var(--hk-text, #0C1526); }
.ki-lage-meta {
  margin-top: 8px;
  font-family: var(--font-mono);
  font-size: 10px; text-transform: uppercase; letter-spacing: 0.7px;
  color: var(--color-text-muted);
}
.ki-lage-meta .ki-lage-refresh {
  background: none; border: none; cursor: pointer;
  color: var(--hk-blue); font: inherit; text-transform: uppercase;
  padding: 0;
}

/* ── Welle 33 (E1) — Unterlagen-Checkliste (Dokumente-Tab) ── */
.doc-checklist {
  margin-bottom: 14px;
  padding: 12px 14px;
  border: 1px solid var(--hk-border, #E7EAF1);
  border-radius: 10px;
  background: var(--color-surface, #fff);
}
.doc-checklist-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; }
.doc-checklist-title { font-weight: 700; font-size: 13.5px; }
.doc-checklist-pct { font-family: var(--font-mono); font-size: 12px; font-weight: 600; }
.doc-checklist-bar {
  height: 6px; border-radius: 3px; overflow: hidden;
  background: var(--color-bg, #F5F6FA);
  margin-bottom: 10px;
}
.doc-checklist-fill { height: 100%; border-radius: 3px; transition: width .4s ease; }
.doc-checklist-items { display: flex; flex-wrap: wrap; gap: 6px 10px; margin-bottom: 10px; }
.doc-checklist-item {
  font-size: 12px;
  color: var(--color-text-muted);
  background: var(--color-bg, #F5F6FA);
  border-radius: 999px;
  padding: 3px 10px;
}
.doc-checklist-item.is-done {
  color: var(--hk-success, #0F6E56);
  background: rgba(15, 110, 86, 0.08);
  font-weight: 600;
}

/* ── Welle 33 (E0c) — Chart-Drilldown-Popup (Berichte + Dashboard) ── */
.drilldown-body { padding: 0 18px 18px; }
.drilldown-loading, .drilldown-empty, .drilldown-error {
  padding: 24px 0;
  text-align: center;
  color: var(--color-text-muted);
  font-size: 13px;
}
.drilldown-error { color: var(--color-danger, #ef4444); }
.drilldown-meta {
  display: flex; align-items: baseline; gap: 6px;
  margin: 4px 0 10px;
  font-family: var(--font-mono);
  font-size: 12px;
}
.drilldown-count { font-weight: 700; color: var(--hk-navy, #001233); }
.drilldown-limit { color: var(--color-text-muted); }
.drilldown-table-wrap { max-height: 55vh; overflow-y: auto; border: 1px solid var(--hk-border, #E7EAF1); border-radius: 10px; }
.drilldown-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.drilldown-table th {
  position: sticky; top: 0; z-index: 1;
  text-align: left;
  padding: 8px 12px;
  background: var(--color-bg, #F5F6FA);
  font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .04em;
  color: var(--color-text-muted);
  border-bottom: 1px solid var(--hk-border, #E7EAF1);
}
.drilldown-table td { padding: 8px 12px; border-bottom: 1px solid var(--hk-border, #E7EAF1); vertical-align: middle; }
.drilldown-table tbody tr:last-child td { border-bottom: none; }
.drilldown-row { cursor: pointer; transition: background .12s ease; }
.drilldown-row:hover { background: rgba(0, 114, 255, 0.05); }
.drilldown-name { font-weight: 600; color: var(--hk-navy, #001233); }
.drilldown-amount, .drilldown-date { font-family: var(--font-mono); font-size: 12px; white-space: nowrap; }
.drilldown-footer { margin-top: 12px; text-align: right; }
.drilldown-list-link { font-size: 12.5px; font-weight: 600; color: var(--hk-blue, #0072FF); text-decoration: none; }
.drilldown-list-link:hover { text-decoration: underline; }

/* ── Welle 33 (E3) — Bank-Einreichungs-Board (Berichte-Tab) ── */
.banksub-board {
  display: grid;
  grid-template-columns: repeat(5, minmax(180px, 1fr));
  gap: 12px;
  align-items: start;
}
@media (max-width: 1100px) { .banksub-board { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px)  { .banksub-board { grid-template-columns: 1fr; } }
.banksub-col {
  background: var(--color-bg, #F5F6FA);
  border: 1px solid var(--hk-border, #E7EAF1);
  border-radius: 10px;
  padding: 10px;
}
.banksub-col-head {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .05em;
  color: var(--color-text-muted);
  padding: 2px 4px 10px;
}
.banksub-col--zusage .banksub-col-head { color: var(--hk-success, #0F6E56); }
.banksub-col--absage .banksub-col-head { color: var(--color-danger, #ef4444); }
.banksub-col--rueckfrage .banksub-col-head { color: var(--hk-orange, #FF5F00); }
.banksub-col-count {
  font-family: var(--font-mono);
  background: var(--color-surface, #fff);
  border-radius: 999px;
  padding: 1px 8px;
}
.banksub-col-body { display: flex; flex-direction: column; gap: 8px; }
.banksub-col-empty { text-align: center; color: var(--color-text-muted); font-size: 12px; padding: 12px 0; }
.banksub-card {
  background: var(--color-surface, #fff);
  border: 1px solid var(--hk-border, #E7EAF1);
  border-radius: 8px;
  padding: 10px 12px;
}
.banksub-card.is-stale { border-left: 3px solid var(--hk-orange, #FF5F00); }
.banksub-card-name { font-weight: 700; font-size: 13px; color: var(--hk-navy, #001233); cursor: pointer; }
.banksub-card-name:hover { color: var(--hk-blue, #0072FF); }
.banksub-card-bank { font-size: 12px; color: var(--color-text-muted); margin: 1px 0 4px; }
.banksub-card-meta { font-family: var(--font-mono); font-size: 11px; color: var(--color-text-muted); margin-bottom: 8px; }
.banksub-status-select {
  width: 100%;
  font-size: 12px;
  padding: 4px 6px;
  border: 1px solid var(--hk-border, #E7EAF1);
  border-radius: 6px;
  background: var(--color-bg, #F5F6FA);
}
/* E3 — Einreichungs-Status in der Partner-Sektion (Lead-Detail) */
.lp-row { flex-wrap: wrap; } /* Einreichungs-Zeile darf umbrechen */
.lp-banksub {
  flex-basis: 100%;
  display: flex; align-items: center; gap: 6px;
  margin-top: 6px; padding-top: 6px;
  border-top: 1px dashed var(--hk-border, #E7EAF1);
}
.lp-banksub-label { font-size: 11px; color: var(--color-text-muted); }
.lp-banksub-select {
  flex: 1; font-size: 12px; padding: 3px 6px;
  border: 1px solid var(--hk-border, #E7EAF1); border-radius: 6px;
  background: var(--color-bg, #F5F6FA);
}
.lp-banksub-create {
  border: none; background: transparent; cursor: pointer;
  font-size: 12px; font-weight: 600; color: var(--hk-blue, #0072FF); padding: 0;
}
.lp-banksub-create:hover { text-decoration: underline; }

/* ── Welle 33 (E5) — GwG/KYC-Karte (Lead-Detail-Sidebar) ── */
.kyc-item {
  display: flex; align-items: baseline; gap: 8px;
  padding: 4px 0;
  font-size: 12.5px;
  color: var(--color-text-muted);
}
.kyc-item.is-ok { color: var(--color-text, #1a1a1a); }
.kyc-item-mark { font-weight: 700; color: var(--color-text-muted); }
.kyc-item.is-ok .kyc-item-mark { color: var(--hk-success, #0F6E56); }
.kyc-item-label { line-height: 1.35; }
.kyc-item-sub { display: block; font-size: 11px; color: var(--color-text-muted); }

/* ══════════════════════════════════════════════════════
   Welle 35 — Einstellungen 2.0 (Operations-Console)
   ══════════════════════════════════════════════════════ */
.st2-header { margin-bottom: 22px; }
.st2-header h1 { margin: 0 0 4px; }
.st2-header-sub { margin: 0; color: var(--color-text-muted); font-size: 13.5px; }

.st2-layout {
  display: grid; grid-template-columns: 248px minmax(0, 1fr);
  gap: 24px; align-items: start;
}
@media (max-width: 900px) { .st2-layout { grid-template-columns: 1fr; } }

/* ── Navigation ── */
.st2-nav {
  position: sticky; top: 16px;
  background: var(--color-surface, #fff);
  border: 1px solid var(--hk-border, #E7EAF1);
  border-radius: 14px;
  padding: 10px;
}
.st2-search {
  display: flex; align-items: center; gap: 8px;
  background: var(--color-bg, #F5F6FA);
  border: 1px solid transparent;
  border-radius: 9px; padding: 8px 10px; margin-bottom: 10px;
  color: var(--color-text-muted);
}
.st2-search:focus-within { border-color: var(--hk-blue, #0072FF); background: #fff; }
.st2-search input {
  border: none; background: transparent; outline: none;
  font: inherit; font-size: 13px; width: 100%;
  color: var(--color-text);
}
.st2-group-label {
  font-size: 10.5px; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; color: var(--color-text-muted);
  padding: 12px 10px 5px;
  font-family: var(--font-mono);
}
.st2-nav-item {
  display: flex; align-items: center; gap: 10px;
  width: 100%; text-align: left;
  background: none; border: none; cursor: pointer;
  font: inherit; font-size: 13.5px; font-weight: 500;
  color: var(--color-text);
  padding: 9px 10px; border-radius: 9px;
  border-left: 3px solid transparent;
  transition: background .12s ease, color .12s ease;
}
.st2-nav-item:hover { background: var(--color-bg, #F5F6FA); color: var(--hk-blue, #0072FF); }
.st2-nav-item.aktiv {
  background: var(--hk-blue-soft, rgba(0,114,255,.08));
  color: var(--hk-blue, #0072FF);
  border-left-color: var(--hk-blue, #0072FF);
  font-weight: 700;
}
.st2-nav-item .st2-ico {
  flex: 0 0 18px; display: inline-flex; opacity: .8;
}
.st2-nav-item.aktiv .st2-ico { opacity: 1; }
.st2-nav-item.st2-hidden { display: none; }
.st2-group.st2-hidden { display: none; }

/* ── Karten + Setting-Rows ── */
.st2-card {
  background: var(--color-surface, #fff);
  border: 1px solid var(--hk-border, #E7EAF1);
  border-radius: 14px;
  margin-bottom: 16px;
  overflow: hidden;
}
.st2-card-head {
  padding: 16px 20px 12px;
  border-bottom: 1px solid var(--hk-border, #E7EAF1);
  display: flex; justify-content: space-between; align-items: flex-start; gap: 12px;
}
.st2-card-head h3 { margin: 0 0 2px; font-size: 15px; }
.st2-card-desc { margin: 0; font-size: 12.5px; color: var(--color-text-muted); line-height: 1.45; }
.st2-card-body { padding: 6px 20px 16px; }

.st2-row {
  display: flex; align-items: center; justify-content: space-between; gap: 18px;
  padding: 13px 0;
  border-bottom: 1px solid var(--color-bg, #F5F6FA);
}
.st2-row:last-child { border-bottom: none; }
.st2-row-label { min-width: 0; }
.st2-row-label strong { display: block; font-size: 13.5px; font-weight: 600; }
.st2-row-label span { display: block; font-size: 12px; color: var(--color-text-muted); margin-top: 1px; line-height: 1.4; }
.st2-row-control { flex-shrink: 0; display: flex; align-items: center; gap: 8px; }
.st2-row-control .form-input, .st2-row-control .form-select { width: 240px; max-width: 42vw; }
.st2-row-control .form-input.st2-narrow { width: 110px; }
.st2-mono { font-family: var(--font-mono); font-size: 12px; }

/* ── Toggle-Switch ── */
.hk-switch { position: relative; display: inline-block; width: 42px; height: 24px; flex-shrink: 0; }
.hk-switch input { opacity: 0; width: 0; height: 0; }
.hk-switch .hk-slider {
  position: absolute; inset: 0; cursor: pointer;
  background: #CBD5E1; border-radius: 999px;
  transition: background .15s ease;
}
.hk-switch .hk-slider::before {
  content: ""; position: absolute; left: 3px; top: 3px;
  width: 18px; height: 18px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(0,18,51,.25);
  transition: transform .15s ease;
}
.hk-switch input:checked + .hk-slider { background: var(--hk-blue, #0072FF); }
.hk-switch input:checked + .hk-slider::before { transform: translateX(18px); }
.hk-switch input:disabled + .hk-slider { opacity: .45; cursor: not-allowed; }

/* ── Status-Pills + Diag ── */
.st2-pill {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11.5px; font-weight: 700;
  border-radius: 999px; padding: 3px 10px;
  font-family: var(--font-mono);
}
.st2-pill .dot { width: 7px; height: 7px; border-radius: 50%; }
.st2-pill.ok   { background: rgba(15,110,86,.08); color: var(--hk-success, #0F6E56); }
.st2-pill.ok .dot { background: var(--hk-success, #0F6E56); }
.st2-pill.warn { background: rgba(255,95,0,.10); color: var(--hk-orange, #FF5F00); }
.st2-pill.warn .dot { background: var(--hk-orange, #FF5F00); }
.st2-pill.err  { background: rgba(239,68,68,.08); color: #b91c1c; }
.st2-pill.err .dot { background: #ef4444; }

.st2-diag-errors {
  font-family: var(--font-mono); font-size: 11px;
  background: var(--color-bg, #F5F6FA); border-radius: 10px;
  padding: 12px; max-height: 260px; overflow-y: auto;
  line-height: 1.6; color: var(--color-text-muted);
  white-space: pre-wrap; word-break: break-word;
}

/* Save-Button-Zustand */
.st2-save.saved { background: var(--hk-success, #0F6E56) !important; }

/* ── Welle 36 (P2) — Partner-Kennzeichnung in der Lead-Liste ── */
.badge-partner {
  display: inline-block; vertical-align: 1px;
  font-size: 9.5px; font-weight: 800; letter-spacing: .07em;
  font-family: var(--font-mono);
  color: #6D28D9; background: rgba(109,40,217,0.10);
  border-radius: 999px; padding: 2px 8px; margin-left: 6px;
}


/* ── Welle 36 (P8) — Potenzielle Partner: Funnel + Tabellen-Polish ── */
.pp-funnel-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 12px; }
.pp-funnel-bar {
  display: flex; height: 26px; border-radius: 8px; overflow: hidden;
  background: var(--color-bg, #F5F6FA);
}
.pp-funnel-seg {
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-mono); font-size: 11.5px; font-weight: 700; color: #fff;
  min-width: 28px; transition: width .4s ease;
}
.pp-funnel-seg.s-offen { background: var(--hk-orange, #FF5F00); }
.pp-funnel-seg.s-gewonnen { background: var(--hk-success, #0F6E56); }
.pp-funnel-seg.s-abgelehnt { background: #9CA3AF; }
.pp-funnel-legend { display: flex; gap: 18px; margin-top: 10px; flex-wrap: wrap; }
.pp-funnel-legend span { font-size: 12px; color: var(--color-text-muted); display: inline-flex; align-items: center; gap: 6px; }
.pp-funnel-legend .dot { width: 9px; height: 9px; border-radius: 3px; display: inline-block; }

.pp-avatar {
  width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 12.5px; font-weight: 800; color: #6D28D9;
  background: rgba(109,40,217,0.10);
}
.pp-avatar.is-won { color: var(--hk-success, #0F6E56); background: rgba(15,110,86,0.10); }
.pp-avatar.is-lost { color: #6b7280; background: rgba(107,114,128,0.10); }
.pp-name-cell { display: flex; align-items: center; gap: 11px; min-width: 0; }
.pp-branche-chip {
  display: inline-block; font-size: 11.5px; font-weight: 600;
  color: var(--hk-blue, #0072FF); background: var(--hk-blue-soft, rgba(0,114,255,0.08));
  border-radius: 999px; padding: 3px 10px; white-space: nowrap;
}
#pp-table tbody tr { transition: background .12s ease; }
#pp-table tbody tr:hover { background: var(--hk-blue-soft, rgba(0,114,255,0.04)); }

.pp-empty { text-align: center; padding: 44px 20px; }
.pp-empty .ico {
  width: 60px; height: 60px; border-radius: 16px; margin: 0 auto 16px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(109,40,217,0.10); color: #6D28D9;
}
.pp-empty h4 { margin: 0 0 6px; }
.pp-empty p { margin: 0 0 18px; color: var(--color-text-muted); font-size: 13.5px; max-width: 460px; margin-left: auto; margin-right: auto; line-height: 1.55; }
.pp-empty .actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
