/* ==========================================================================
   CRM Dashboard — Designed matching Sparkhes Aesthetic
   Font: Outfit | Theme: Ultra-Sleek Dark (#050505) with Glassmorphic Cards
   ========================================================================== */

:root {
  --bg-color: #000000;
  --bg-secondary: #0a0a0a;
  --text-color: #ffffff;
  --text-muted: #888888;
  --accent-color: #ffffff;
  --accent-glow: rgba(255, 255, 255, 0.12);
  --card-bg: #0a0a0a;
  --card-border: rgba(255, 255, 255, 0.08);
  --card-hover-border: rgba(255, 255, 255, 0.18);
  --font-main: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
  --transition-speed: 0.25s;
  --ease-apple: cubic-bezier(0.16, 1, 0.3, 1);
  --spark-shadow: 0 16px 48px rgba(0, 0, 0, 0.7);
  --danger-color: #ff5252;
  --danger-bg: rgba(255, 82, 82, 0.1);
  --warning-color: #ffd700;
  --warning-bg: rgba(255, 215, 0, 0.1);
  --success-color: #00e676;
  --success-bg: rgba(0, 230, 118, 0.1);
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-main);
  background-color: #000000;
  background: #000000;
  color: var(--text-color);
  line-height: 1.6;
  overflow-x: hidden;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
}

/* Custom Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.1); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.25); }


/* ─── Glass Card ─── */
.glass-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  box-shadow: 0 16px 44px rgba(0, 0, 0, 0.35);
  transition: all var(--transition-speed) var(--ease-apple);
}
.glass-card:hover {
  border-color: var(--card-hover-border);
}

/* ─── Header (Floating Navbar style like Sparkhes) ─── */
.header {
  position: sticky;
  top: 12px;
  z-index: 100;
  width: calc(100% - 32px);
  max-width: 1400px;
  margin: 12px auto 0 auto;
  background: #0a0a0a;
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 10px 20px;
  border-radius: 14px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.8);
}
.header-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
}
.header-left { display: flex; align-items: center; gap: 16px; }
.header-right { display: flex; align-items: center; gap: 12px; }
.header-center { flex: 1; max-width: 480px; margin: 0 auto; }

.logo { display: flex; align-items: center; gap: 10px; }
.logo-icon {
  width: 32px; height: 32px;
  background: linear-gradient(135deg, #ffffff 0%, #888888 100%);
  border-radius: 8px; display: flex; align-items: center; justify-content: center;
}
.logo-icon svg { width: 18px; height: 18px; color: #050505; }
.logo h1 { font-size: 18px; font-weight: 700; letter-spacing: -0.5px; text-transform: uppercase; color: #ffffff; margin-bottom: 0; }

/* DB Mode Switcher (Leads / Deals) */
.db-mode-switcher {
  display: flex; align-items: center; gap: 4px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 50px; padding: 3px;
}
.db-mode-btn {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 14px; border-radius: 50px; border: none;
  background: transparent; color: var(--text-muted);
  font-family: inherit; font-size: 13px; font-weight: 500;
  cursor: pointer; transition: all 0.2s ease;
}
.db-mode-btn:hover { color: #ffffff; background: rgba(255, 255, 255, 0.06); }
.db-mode-btn.active {
  background: #ffffff; color: #000000; font-weight: 600;
  box-shadow: 0 4px 12px rgba(255, 255, 255, 0.15);
}

.search-wrapper {
  position: relative; display: flex; align-items: center;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 50px; padding: 0 14px;
  transition: all var(--transition-speed) var(--ease-apple);
}
.search-wrapper:focus-within {
  border-color: rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.05);
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.03);
}
.search-icon { width: 15px; height: 15px; color: var(--text-muted); flex-shrink: 0; }
#search-input {
  flex: 1; border: none; background: none; color: var(--text-color);
  padding: 10px 10px; font-size: 13px; outline: none; font-family: inherit;
}
#search-input::placeholder { color: var(--text-muted); }
.search-kbd {
  font-size: 10px; color: var(--text-muted); background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1); border-radius: 4px; padding: 2px 6px;
  font-family: inherit;
}

/* ─── Sparkhes Style Buttons ─── */
.btn-primary {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 22px; font-size: 0.88rem; font-weight: 500; font-family: inherit;
  background: #ffffff; color: #000000;
  border: none; border-radius: 50px; cursor: pointer;
  transition: all 0.4s var(--ease-apple);
  letter-spacing: 0.01em;
}
.btn-primary:hover {
  background: #f0f0f0;
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(255, 255, 255, 0.12);
}
.btn-primary svg { width: 14px; height: 14px; }

.btn-secondary {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 20px; font-size: 0.88rem; font-weight: 500; font-family: inherit;
  background: transparent; color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.12); border-radius: 50px; cursor: pointer;
  transition: all 0.4s var(--ease-apple);
}
.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.25);
  transform: translateY(-2px);
}

.btn-danger {
  padding: 9px 20px; font-size: 0.88rem; font-weight: 500; font-family: inherit;
  background: var(--danger-bg); color: var(--danger-color);
  border: 1px solid rgba(255, 82, 82, 0.25); border-radius: 50px; cursor: pointer;
  transition: all 0.4s var(--ease-apple);
}
.btn-danger:hover { background: rgba(255, 82, 82, 0.2); transform: translateY(-2px); }

.icon-btn {
  width: 36px; height: 36px; display: flex; align-items: center; justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.1); border-radius: 50px;
  background: transparent; color: var(--text-muted); cursor: pointer;
  transition: all 0.3s var(--ease-apple);
  text-decoration: none;
  box-sizing: border-box;
}
.icon-btn:hover { background: rgba(255, 255, 255, 0.06); color: var(--text-color); border-color: rgba(255, 255, 255, 0.25); }
.icon-btn svg { width: 15px; height: 15px; }

/* ─── Main Content Layout ─── */
.main { padding: 32px 24px; max-width: 1400px; margin: 0 auto; }

/* ─── Stat Cards ─── */
.stats-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; margin-bottom: 28px; }
.stat-card {
  padding: 22px 24px; border-radius: 16px; position: relative; overflow: hidden;
  background: var(--card-bg); border: 1px solid var(--card-border);
  backdrop-filter: blur(20px);
  transition: all 0.4s var(--ease-apple);
}
.stat-card:hover {
  border-color: var(--card-hover-border);
  transform: translateY(-3px);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.3);
}
.stat-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.stat-title { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.1em; font-weight: 600; }
.stat-icon {
  width: 32px; height: 32px; border-radius: 8px;
  background: rgba(255, 255, 255, 0.04); border: 1px solid rgba(255, 255, 255, 0.08);
  display: flex; align-items: center; justify-content: center; color: var(--text-muted);
}
.stat-icon svg { width: 16px; height: 16px; }
.stat-value { font-size: 28px; font-weight: 700; letter-spacing: -0.5px; margin-bottom: 4px; color: #ffffff; }
.stat-subtitle { font-size: 12px; color: var(--text-muted); }

/* Glow Accents for Won & Lost */
.stat-card.glow-green {
  background: linear-gradient(135deg, rgba(0, 230, 118, 0.06) 0%, rgba(255, 255, 255, 0.02) 100%);
  border-color: rgba(0, 230, 118, 0.2);
}
.stat-card.glow-green .stat-value, .stat-card.glow-green .stat-icon { color: #00e676; }

.stat-card.glow-red {
  background: linear-gradient(135deg, rgba(255, 82, 82, 0.06) 0%, rgba(255, 255, 255, 0.02) 100%);
  border-color: rgba(255, 82, 82, 0.2);
}
.stat-card.glow-red .stat-value, .stat-card.glow-red .stat-icon { color: #ff5252; }

/* ─── Alerts & Schedule ─── */
.alerts-section { margin-bottom: 28px; }
.section-header { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.section-header h2 { font-size: 0.85rem; color: var(--text-muted); font-weight: 500; text-transform: uppercase; letter-spacing: 0.15em; }
.badge {
  background: rgba(255, 82, 82, 0.15); color: var(--danger-color);
  border: 1px solid rgba(255, 82, 82, 0.3); font-size: 11px; font-weight: 600;
  padding: 2px 10px; border-radius: 50px;
}
.alerts-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.alert-card {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px; border-radius: 12px;
  background: rgba(255, 255, 255, 0.02); border: 1px solid rgba(255, 255, 255, 0.06);
  transition: all 0.3s var(--ease-apple);
  position: relative;
  overflow: hidden;
  cursor: pointer;
}
.alert-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.18);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}
.alert-content { display: flex; flex-direction: column; gap: 8px; flex: 1; min-width: 0; margin-right: 12px; }
.alert-info { flex: 1; min-width: 0; }
.alert-company { font-size: 13px; font-weight: 600; color: #ffffff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.alert-details { font-size: 11px; color: var(--text-muted); margin-top: 2px; display: flex; align-items: center; gap: 4px; }
.alert-date { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-muted); }

/* Alert Type Badges */
.alert-type-badge {
  display: inline-flex; align-items: center;
  padding: 2px 8px; font-size: 10px; font-weight: 600;
  border-radius: 50px; text-transform: uppercase; letter-spacing: 0.05em;
}
.badge-overdue { background: rgba(255, 82, 82, 0.12); color: var(--danger-color); border: 1px solid rgba(255, 82, 82, 0.2); }
.badge-today { background: rgba(116, 185, 255, 0.12); color: #74b9ff; border: 1px solid rgba(116, 185, 255, 0.2); }
.badge-upcoming { background: rgba(255, 255, 255, 0.04); color: var(--text-muted); border: 1px solid rgba(255, 255, 255, 0.08); }

/* Overdue Highlights */
.alert-card.alert-card-overdue {
  border-color: rgba(255, 82, 82, 0.25);
  background: linear-gradient(135deg, rgba(255, 82, 82, 0.03) 0%, rgba(255, 255, 255, 0.01) 100%);
  box-shadow: 0 4px 18px rgba(255, 82, 82, 0.03);
}
.alert-card.alert-card-overdue:hover {
  border-color: rgba(255, 82, 82, 0.45);
  box-shadow: 0 4px 22px rgba(255, 82, 82, 0.08);
}

/* Today Highlights */
.alert-card.alert-card-today {
  border-color: rgba(255, 215, 0, 0.22);
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.03) 0%, rgba(255, 255, 255, 0.01) 100%);
  box-shadow: 0 4px 18px rgba(255, 215, 0, 0.03);
}
.alert-card.alert-card-today:hover {
  border-color: rgba(255, 215, 0, 0.45);
  box-shadow: 0 4px 22px rgba(255, 215, 0, 0.08);
}

/* Upcoming Highlights */
.alert-card.alert-card-upcoming { border-color: rgba(255, 255, 255, 0.05); }
.alert-card.alert-card-upcoming:hover { border-color: var(--card-hover-border); }

/* Alert Actions */
.alert-actions { display: flex; align-items: center; gap: 8px; }
.alert-action-btn {
  width: 30px; height: 30px; display: flex; align-items: center; justify-content: center;
  border-radius: 50%; border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.02); color: var(--text-muted);
  cursor: pointer; transition: all 0.3s var(--ease-apple);
}
.alert-action-btn:hover { transform: scale(1.08); }
.alert-action-btn.complete-btn:hover {
  background: rgba(0, 230, 118, 0.12); color: #00e676; border-color: rgba(0, 230, 118, 0.25);
  box-shadow: 0 0 12px rgba(0, 230, 118, 0.15);
}
.alert-action-btn.dismiss-btn:hover {
  background: rgba(255, 82, 82, 0.12); color: var(--danger-color); border-color: rgba(255, 82, 82, 0.25);
  box-shadow: 0 0 12px rgba(255, 82, 82, 0.15);
}

/* Optimistic UI States & Transitions */
.alert-card.completing {
  background: linear-gradient(135deg, rgba(0, 230, 118, 0.15) 0%, rgba(0, 230, 118, 0.04) 100%) !important;
  border-color: #00e676 !important;
  transform: scale(0.95); opacity: 0;
  transition: all 0.6s var(--ease-apple);
}
.alert-card.completing .alert-company, .alert-card.completing .alert-details {
  text-decoration: line-through; opacity: 0.5;
}
.alert-card.dismissing {
  transform: translate(40px, 0); opacity: 0;
  transition: all 0.6s var(--ease-apple);
}

/* ─── View Controls ─── */
.view-controls {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 20px;
}
.view-controls-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.filter-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.tab-group {
  display: flex; gap: 4px; background: rgba(255, 255, 255, 0.025);
  padding: 4px; border-radius: 50px; border: 1px solid rgba(255, 255, 255, 0.06);
}
.tab {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 18px; font-size: 13px; font-weight: 500; font-family: inherit;
  color: var(--text-muted); background: none; border: none; border-radius: 50px; cursor: pointer;
  transition: all 0.3s var(--ease-apple);
}
.tab:hover { color: var(--text-color); }
.tab.active { background: #ffffff; color: #000000; font-weight: 600; }

.filter-toolbar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  background: rgba(255, 255, 255, 0.015);
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}
.filter-select {
  padding: 8px 14px; font-size: 12.5px; font-family: inherit;
  background: rgba(255, 255, 255, 0.04); color: var(--text-muted);
  border: 1px solid rgba(255, 255, 255, 0.08); border-radius: 50px;
  cursor: pointer; transition: all 0.2s var(--ease-apple); outline: none;
  appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23888888' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; padding-right: 28px;
  max-width: 100%;
}
.filter-select:hover {
  background-color: rgba(255, 255, 255, 0.07);
  color: var(--text-color);
  border-color: rgba(255, 255, 255, 0.15);
}
.filter-select.is-active {
  border-color: rgba(0, 230, 118, 0.45);
  background-color: rgba(0, 230, 118, 0.08);
  color: #ffffff;
  font-weight: 500;
}
.filter-select-compact {
  padding-top: 6px;
  padding-bottom: 6px;
  font-size: 12px;
}
.filter-date-input {
  background-image: none !important;
  padding-right: 10px !important;
  color-scheme: dark;
}
.inline-date-wrapper {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  animation: fadeIn 0.2s ease;
}
.date-sep {
  color: rgba(255, 255, 255, 0.4);
  font-size: 12px;
}
.filter-select:focus {
  border-color: rgba(255, 255, 255, 0.25);
  color: var(--text-color);
}
.filter-select option {
  background: #161618;
  color: var(--text-color);
  padding: 6px 12px;
}

/* Reset button with active counter badge */
.btn-reset-filters {
  width: auto !important;
  padding: 0 14px !important;
  border-radius: 50px !important;
  font-size: 12px !important;
  gap: 6px !important;
  display: inline-flex !important;
  height: 34px !important;
  align-items: center !important;
}
.reset-badge {
  background: var(--accent-color);
  color: #000000;
  font-size: 10px;
  font-weight: 700;
  border-radius: 50%;
  width: 16px;
  height: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Active Filters Chips Bar */
.active-filters-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.02);
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.04);
  animation: fadeIn 0.2s var(--ease-apple);
}
.active-filters-list {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}
.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 50px;
  font-size: 11.5px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-color);
}
.filter-chip .chip-label {
  color: var(--text-muted);
}
.filter-chip .chip-val {
  color: #00e676;
  font-weight: 500;
}
.filter-chip .chip-remove {
  cursor: pointer;
  opacity: 0.6;
  font-size: 13px;
  line-height: 1;
  transition: all 0.2s;
  padding: 0 2px;
}
.filter-chip .chip-remove:hover {
  opacity: 1;
  color: #ff5252;
}
.active-filters-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}
.active-filters-summary {
  font-size: 12px;
  color: var(--text-muted);
}
.active-filters-summary strong {
  color: var(--text-color);
}
.btn-clear-all-chips {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 11.5px;
  text-decoration: underline;
  cursor: pointer;
  padding: 0;
  transition: color 0.2s;
}
.btn-clear-all-chips:hover {
  color: #ff5252;
}

/* ─── View Panels ─── */
.view-panel { display: none; }
.view-panel.active { display: block; animation: fadeIn 0.3s var(--ease-apple); }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }

/* ─── Table ─── */
.table-container { overflow-x: auto; }
.crm-table { width: 100%; border-collapse: collapse; }
.crm-table th {
  padding: 14px 18px; font-size: 11px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.12em; color: var(--text-muted); text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06); white-space: nowrap;
}
.crm-table td {
  padding: 16px 18px; font-size: 13px; border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  white-space: nowrap; max-width: 220px; overflow: hidden; text-overflow: ellipsis;
}
.crm-table tbody tr { transition: background 0.2s var(--ease-apple); cursor: pointer; }
.crm-table tbody tr:hover { background: rgba(255, 255, 255, 0.03); }

.cell-company { font-weight: 600; color: #ffffff; }
.card-identity-group { display: flex; align-items: center; gap: 10px; }
.card-avatar {
  width: 28px; height: 28px; border-radius: 7px; display: inline-flex;
  align-items: center; justify-content: center; font-size: 11px; font-weight: 600;
  color: #e2e8f0; flex-shrink: 0; border: 1px solid rgba(255, 255, 255, 0.08);
}
.card-info-meta { display: flex; flex-direction: column; min-width: 0; }
.card-primary-title { font-weight: 600; color: #ffffff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-mobile-subtitle { display: none; }
.badge-val {
  display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px;
  border-radius: 6px; font-size: 12px; font-weight: 600;
  background: rgba(46, 213, 115, 0.12); color: #2ed573; border: 1px solid rgba(46, 213, 115, 0.25);
}
.badge-val.val-empty { background: transparent; color: var(--text-muted); border: none; font-weight: 400; }
.card-fu-chip { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--text-muted); }
.card-fu-chip.fu-overdue { color: #ff6b6b; font-weight: 600; }
.card-fu-chip.fu-today { color: #fbbf24; font-weight: 600; }
.cell-investment { font-weight: 600; color: #00e676; }
.cell-actions { display: flex; gap: 6px; }

/* Status Badges */
.status-badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px;
  font-size: 11px; font-weight: 500; border-radius: 50px;
  white-space: nowrap; border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04); color: rgba(255, 255, 255, 0.85);
  letter-spacing: 0.02em;
}
.status-badge-icon {
  display: inline-block;
  flex-shrink: 0;
  width: 12px;
  height: 12px;
}
.status-won, .status-client { background: rgba(0, 230, 118, 0.12); color: #00e676; border-color: rgba(0, 230, 118, 0.28); font-weight: 600; }
.status-lost { background: rgba(255, 82, 82, 0.12); color: #ff5252; border-color: rgba(255, 82, 82, 0.28); }
.status-replied { background: rgba(34, 197, 94, 0.14); color: #4ade80; border-color: rgba(34, 197, 94, 0.3); font-weight: 600; }
.status-demo { background: rgba(168, 85, 247, 0.14); color: #c084fc; border-color: rgba(168, 85, 247, 0.3); font-weight: 600; }
.status-meeting { background: rgba(116, 185, 255, 0.12); color: #74b9ff; border-color: rgba(116, 185, 255, 0.25); }
.status-contacted { background: rgba(99, 102, 241, 0.14); color: #a5b4fc; border-color: rgba(99, 102, 241, 0.3); }
.status-ready { background: rgba(14, 165, 233, 0.14); color: #38bdf8; border-color: rgba(14, 165, 233, 0.3); }
.status-viewed { background: rgba(245, 158, 11, 0.14); color: #fbbf24; border-color: rgba(245, 158, 11, 0.3); }
.status-followup { background: rgba(249, 115, 22, 0.14); color: #fb923c; border-color: rgba(249, 115, 22, 0.3); }
.status-draft { background: rgba(148, 163, 184, 0.14); color: #cbd5e1; border-color: rgba(148, 163, 184, 0.25); }
.status-sent { background: rgba(59, 130, 246, 0.14); color: #93c5fd; border-color: rgba(59, 130, 246, 0.3); }
.status-new { background: rgba(255, 255, 255, 0.06); color: #ffffff; border-color: rgba(255, 255, 255, 0.15); }

.action-btn {
  width: 30px; height: 30px; display: flex; align-items: center; justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.08); border-radius: 8px;
  background: rgba(255, 255, 255, 0.03); color: var(--text-muted);
  cursor: pointer; transition: all 0.2s var(--ease-apple);
}
.action-btn:hover { background: rgba(255, 255, 255, 0.08); color: var(--text-color); border-color: rgba(255, 255, 255, 0.2); }
.action-btn.btn-danger-icon:hover { background: rgba(255, 82, 82, 0.15); color: var(--danger-color); border-color: rgba(255, 82, 82, 0.3); }

.table-footer {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px; border-top: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 12px; color: var(--text-muted);
  flex-wrap: wrap; gap: 12px;
}
.table-footer-info { font-size: 13px; color: var(--text-muted); }
.pagination-controls {
  display: flex; align-items: center; gap: 6px;
}
.page-btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 32px; height: 32px; padding: 0 8px;
  border-radius: 8px; border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03); color: var(--text-muted);
  font-size: 12px; font-family: inherit; font-weight: 500;
  cursor: pointer; transition: all 0.2s var(--ease-apple);
  user-select: none;
}
.page-btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.08); color: #ffffff;
  border-color: rgba(255, 255, 255, 0.2);
}
.page-btn.active {
  background: #ffffff; color: #000000; border-color: #ffffff;
  font-weight: 600; box-shadow: 0 2px 10px rgba(255, 255, 255, 0.15);
}
.page-btn:disabled {
  opacity: 0.35; cursor: not-allowed;
}
.page-dots {
  color: var(--text-muted); font-size: 12px; padding: 0 4px;
}

/* ─── Pipeline Board (Kanban) ─── */
.pipeline-board { display: flex; gap: 14px; overflow-x: auto; padding-bottom: 16px; min-height: 450px; }
.pipeline-column {
  min-width: 260px; max-width: 280px; flex-shrink: 0;
  background: rgba(255, 255, 255, 0.02); border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 16px; display: flex; flex-direction: column;
}
.column-header {
  padding: 16px 18px; display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.column-title { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: rgba(255, 255, 255, 0.9); }
.column-count {
  font-size: 11px; font-weight: 600; color: var(--text-muted);
  background: rgba(255, 255, 255, 0.06); padding: 2px 8px; border-radius: 50px;
}
.column-cards { padding: 10px; flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; }
.kanban-card {
  padding: 14px; border-radius: 12px; cursor: pointer;
  background: rgba(255, 255, 255, 0.03); border: 1px solid rgba(255, 255, 255, 0.06);
  transition: all 0.3s var(--ease-apple);
}
.kanban-card:hover { border-color: rgba(255, 255, 255, 0.2); transform: translateY(-2px); background: rgba(255, 255, 255, 0.05); }
.card-company { font-size: 13px; font-weight: 600; margin-bottom: 4px; color: #ffffff; }
.card-country { font-size: 12px; color: var(--text-muted); margin-bottom: 8px; }
.card-footer { display: flex; align-items: center; justify-content: space-between; font-size: 11px; color: var(--text-muted); gap: 6px; }
.kanban-val-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: rgba(46, 213, 115, 0.12);
  color: #2ed573;
  border: 1px solid rgba(46, 213, 115, 0.25);
  border-radius: 5px;
  padding: 1px 6px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.card-date { display: flex; align-items: center; gap: 4px; }
.card-notion-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-muted);
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: all 0.2s var(--ease-apple);
}
.card-notion-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.25);
}

/* ─── Analytics View ─── */
.analytics-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 20px; }
.analytics-card {
  padding: 24px; border-radius: 16px;
  background: var(--card-bg); border: 1px solid var(--card-border);
  backdrop-filter: blur(20px);
}
.analytics-card h3 { font-size: 0.85rem; font-weight: 500; text-transform: uppercase; letter-spacing: 0.15em; color: var(--text-muted); margin-bottom: 20px; }
.analytics-stat-huge { font-size: 42px; font-weight: 800; color: #ffffff; letter-spacing: -1px; margin-bottom: 4px; }
.analytics-stat-label { font-size: 13px; color: var(--text-muted); }

.analytics-list { list-style: none; display: flex; flex-direction: column; gap: 12px; }
.analytics-list li {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px; border-radius: 10px;
  background: rgba(255, 255, 255, 0.02); border: 1px solid rgba(255, 255, 255, 0.04);
  font-size: 13px;
}
.analytics-list span { color: rgba(255, 255, 255, 0.85); }
.analytics-list strong { color: #ffffff; font-weight: 600; }

/* ─── Modal ─── */
.modal-overlay {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(0, 0, 0, 0.78); backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex; align-items: center; justify-content: center; padding: 24px;
  opacity: 0; visibility: hidden; pointer-events: none;
  transition: opacity 0.28s var(--ease-apple), visibility 0.28s var(--ease-apple);
}
.modal-overlay.active { opacity: 1; visibility: visible; pointer-events: auto; }
.modal {
  width: 100%; max-width: 820px; max-height: 88vh; display: flex; flex-direction: column;
  background: #0f0f13; border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 20px; box-shadow: 0 32px 90px rgba(0, 0, 0, 0.75), 0 0 0 1px rgba(255, 255, 255, 0.05);
  transform: scale(0.95) translateY(10px);
  opacity: 0;
  transition: transform 0.28s var(--ease-apple), opacity 0.28s var(--ease-apple);
}
.modal-overlay.active .modal {
  transform: scale(1) translateY(0);
  opacity: 1;
}
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 24px; border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.modal-header-info {
  display: flex; flex-direction: column; gap: 3px; min-width: 0;
}
.modal-header h2 { font-size: 1.05rem; font-weight: 600; letter-spacing: -0.02em; color: #ffffff; }
.modal-subtitle { font-size: 12px; color: var(--text-muted); font-weight: 400; }
.modal-close {
  width: 32px; height: 32px; display: flex; align-items: center; justify-content: center;
  border: none; background: rgba(255, 255, 255, 0.05); color: var(--text-muted); font-size: 20px; cursor: pointer;
  border-radius: 50%; transition: all 0.2s var(--ease-apple); flex-shrink: 0;
}
.modal-close:hover { background: rgba(255, 255, 255, 0.12); color: #ffffff; }

/* ─── Modal Save Status Indicator & Quick Save Button ─── */
.modal-save-indicator {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11.5px;
  font-weight: 500;
  transition: all 0.25s ease;
  user-select: none;
}
.modal-save-indicator.saved {
  background: rgba(46, 213, 115, 0.12);
  color: #2ed573;
  border: 1px solid rgba(46, 213, 115, 0.25);
}
.modal-save-indicator.saving {
  background: rgba(112, 161, 255, 0.12);
  color: #70a1ff;
  border: 1px solid rgba(112, 161, 255, 0.25);
}
.modal-save-indicator.unsaved {
  background: rgba(255, 165, 2, 0.12);
  color: #ffa502;
  border: 1px solid rgba(255, 165, 2, 0.25);
}
.modal-save-indicator.error {
  background: rgba(255, 71, 87, 0.12);
  color: #ff4757;
  border: 1px solid rgba(255, 71, 87, 0.25);
}
.modal-save-indicator .save-status-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.modal-save-indicator.saving .save-status-icon svg {
  animation: spin 0.8s linear infinite;
}
.modal-save-indicator.unsaved .save-status-icon {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #ffa502;
  box-shadow: 0 0 6px rgba(255, 165, 2, 0.6);
}

.btn-icon-header {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-muted);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
}
.btn-icon-header:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
}
.btn-icon-header:active {
  transform: translateY(0);
}

/* ─── Segmented Modal Tabs Bar ─── */
.modal-tabs-bar {
  display: flex; align-items: center; gap: 6px; padding: 10px 24px;
  background: rgba(0, 0, 0, 0.25); border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none;
}
.modal-tabs-bar::-webkit-scrollbar { display: none; }
.modal-tab-btn {
  display: inline-flex; align-items: center; gap: 7px; padding: 7px 14px;
  border-radius: 10px; background: transparent; border: 1px solid transparent;
  color: var(--text-muted); font-family: inherit; font-size: 12.5px; font-weight: 500;
  cursor: pointer; white-space: nowrap; transition: all 0.2s ease;
}
.modal-tab-btn svg { color: inherit; opacity: 0.8; }
.modal-tab-btn:hover {
  color: #ffffff; background: rgba(255, 255, 255, 0.05);
}
.modal-tab-btn.active {
  color: #ffffff; background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.15); font-weight: 600;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}
.modal-tab-btn.active svg { opacity: 1; }

.modal-tab-panel {
  display: none; width: 100%;
}
.modal-tab-panel.active {
  display: grid; grid-template-columns: 1fr 1fr; gap: 16px;
  animation: fadeInModalTab 0.2s ease;
}
@keyframes fadeInModalTab {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

.modal-body { padding: 24px 26px; overflow-y: auto; flex: 1; display: flex; flex-direction: column; gap: 16px; }
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group.full-width { grid-column: span 2; }
.form-group label { font-size: 11px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.08em; }
.form-group input, .form-group select, .form-group textarea {
  padding: 11px 14px; font-size: 13.5px; font-family: inherit;
  background: rgba(255, 255, 255, 0.04); color: var(--text-color);
  border: 1px solid rgba(255, 255, 255, 0.08); border-radius: 10px;
  outline: none; transition: all 0.25s var(--ease-apple);
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  border-color: rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.07);
}
.form-group select option { background: #121212; color: #fff; }

/* Input with action button (e.g. WhatsApp) */
.input-with-action {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
}
.input-with-action input {
  flex: 1;
  min-width: 0;
}
.wa-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 14px;
  border-radius: 10px;
  background: #25D366;
  color: #ffffff;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: all 0.2s var(--ease-apple);
  white-space: nowrap;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(37, 211, 102, 0.25);
  box-sizing: border-box;
}
.wa-action-btn:hover:not(.disabled) {
  background: #20ba59;
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(37, 211, 102, 0.35);
  color: #ffffff;
}
.wa-action-btn.disabled {
  opacity: 0.35;
  cursor: not-allowed;
  pointer-events: none;
  filter: grayscale(1);
}
.table-wa-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: rgba(37, 211, 102, 0.12);
  color: #25D366;
  border: 1px solid rgba(37, 211, 102, 0.3);
  text-decoration: none;
  transition: all 0.2s var(--ease-apple);
  flex-shrink: 0;
}
.table-wa-btn:hover {
  background: #25D366;
  color: #ffffff;
  transform: scale(1.1);
}

/* Textarea with bottom-left copy button */
.textarea-container {
  position: relative;
  width: 100%;
}
.textarea-container textarea {
  width: 100%;
  padding-bottom: 42px;
  box-sizing: border-box;
  resize: vertical;
}
.textarea-actions {
  position: absolute;
  bottom: 8px;
  left: 8px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  z-index: 2;
}
.copy-textarea-btn,
.wa-textarea-btn,
.email-textarea-btn,
.ig-textarea-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: var(--text-color);
  font-size: 11px;
  font-family: inherit;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s var(--ease-apple);
  backdrop-filter: blur(8px);
  user-select: none;
  text-decoration: none;
}
.copy-textarea-btn:hover {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.3);
  transform: translateY(-1px);
}
.copy-textarea-btn:active {
  transform: scale(0.96);
}
.wa-textarea-btn {
  background: rgba(37, 211, 102, 0.12);
  border-color: rgba(37, 211, 102, 0.28);
  color: #25d366;
}
.wa-textarea-btn:hover {
  background: rgba(37, 211, 102, 0.22);
  border-color: rgba(37, 211, 102, 0.5);
  color: #25d366;
  transform: translateY(-1px);
}
.wa-textarea-btn:active {
  transform: scale(0.96);
}

.email-textarea-btn {
  background: rgba(0, 168, 255, 0.12);
  border-color: rgba(0, 168, 255, 0.28);
  color: #00a8ff;
}
.email-textarea-btn:hover {
  background: rgba(0, 168, 255, 0.22);
  border-color: rgba(0, 168, 255, 0.5);
  color: #00a8ff;
  transform: translateY(-1px);
}
.email-textarea-btn:active {
  transform: scale(0.96);
}

.ig-textarea-btn {
  background: rgba(225, 48, 108, 0.12);
  border-color: rgba(225, 48, 108, 0.28);
  color: #e1306c;
}
.ig-textarea-btn:hover {
  background: rgba(225, 48, 108, 0.22);
  border-color: rgba(225, 48, 108, 0.5);
  color: #fd1d1d;
  transform: translateY(-1px);
}
.ig-textarea-btn:active {
  transform: scale(0.96);
}

.modal-footer {
  display: flex; align-items: center; justify-content: flex-end; gap: 10px;
  padding: 18px 24px; border-top: 1px solid rgba(255, 255, 255, 0.08);
}

/* ─── Proposal Preview & Final Review Modal ─── */
.proposal-modal-overlay {
  z-index: 1200;
}
.proposal-modal {
  max-width: 960px;
  height: 90vh;
}
.proposal-badge-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, #a55eea 0%, #4b7bec 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  box-shadow: 0 4px 14px rgba(165, 94, 234, 0.35);
}
.proposal-tab-group {
  display: flex;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 50px;
  padding: 3px;
  gap: 4px;
}
.proposal-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 50px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}
.proposal-tab:hover {
  color: #ffffff;
}
.proposal-tab.active {
  background: #ffffff;
  color: #050505;
  font-weight: 600;
}
.proposal-modal-body {
  overflow-y: auto;
  max-height: calc(90vh - 160px);
}
.proposal-preview-wrapper {
  display: flex;
  flex-direction: column;
  flex: 1;
  height: calc(90vh - 150px);
  background: #1e1e24;
  overflow: hidden;
}
.proposal-preview-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  background: rgba(0, 0, 0, 0.5);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.proposal-preview-frame {
  width: 100%;
  flex: 1;
  border: none;
  background: #2a2a32;
}
.btn-success {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 18px;
  background: #00e676;
  color: #000;
  border-radius: 50px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s ease;
  box-shadow: 0 4px 14px rgba(0, 230, 118, 0.3);
}
.btn-success:hover {
  background: #00c853;
  transform: translateY(-1px);
}
.btn-deal-proposal {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 600;
  background: linear-gradient(135deg, rgba(165, 94, 234, 0.2) 0%, rgba(75, 123, 236, 0.2) 100%);
  border: 1px solid rgba(165, 94, 234, 0.4);
  color: #d1d8e0;
  cursor: pointer;
  transition: all 0.2s var(--ease-apple);
  text-decoration: none;
}
.btn-deal-proposal:hover {
  background: linear-gradient(135deg, rgba(165, 94, 234, 0.4) 0%, rgba(75, 123, 236, 0.4) 100%);
  color: #ffffff;
  border-color: rgba(165, 94, 234, 0.8);
  transform: translateY(-1px);
}

/* ─── Dual-Mode Lead Modal ─── */
.modal-tabs {
  display: flex; gap: 8px; padding: 0 24px; margin-bottom: 8px; border-bottom: 1px solid rgba(255,255,255,0.08);
}
.modal-tab {
  padding: 10px 16px; background: none; border: none; color: var(--text-muted);
  font-size: 13px; font-weight: 500; font-family: inherit; cursor: pointer;
  border-bottom: 2px solid transparent; transition: all 0.3s var(--ease-apple);
}
.modal-tab:hover { color: var(--text-color); }
.modal-tab.active { color: var(--primary-color); border-bottom-color: var(--primary-color); }

/* ─── Lead Stepper Progress ─── */
.lead-stepper {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  padding: 20px 24px 12px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.stepper-step {
  display: flex;
  align-items: center;
  gap: 8px;
  opacity: 0.3;
  transition: all 0.4s var(--ease-apple);
}
.stepper-step.active {
  opacity: 1;
}
.stepper-step.completed {
  opacity: 0.7;
}
.stepper-dot {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  transition: all 0.4s var(--ease-apple);
  flex-shrink: 0;
}
.stepper-step.active .stepper-dot {
  border-color: #ffffff;
  background: #ffffff;
  color: #000;
  box-shadow: 0 0 16px rgba(255,255,255,0.2);
}
.stepper-step.completed .stepper-dot {
  border-color: #00e676;
  background: rgba(0, 230, 118, 0.15);
  color: #00e676;
}
.stepper-step span {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  white-space: nowrap;
}
.stepper-step.active span {
  color: #ffffff;
}
.stepper-step.completed span {
  color: rgba(0, 230, 118, 0.8);
}
.stepper-line {
  width: 32px;
  height: 2px;
  background: rgba(255,255,255,0.08);
  margin: 0 8px;
  border-radius: 2px;
  transition: all 0.4s var(--ease-apple);
  flex-shrink: 0;
}
.stepper-line.active {
  background: rgba(255,255,255,0.3);
}
.stepper-line.completed {
  background: rgba(0, 230, 118, 0.5);
}

/* ─── AI Toggle Switch ─── */
.toggle-wrapper {
  display: flex;
  align-items: center;
  gap: 10px;
}
.toggle-wrapper input[type="checkbox"] {
  display: none;
}
.toggle-label {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
}
.toggle-track {
  width: 40px;
  height: 22px;
  border-radius: 50px;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.15);
  position: relative;
  transition: all 0.3s var(--ease-apple);
  flex-shrink: 0;
}
.toggle-track::after {
  content: '';
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--text-muted);
  position: absolute;
  top: 2px;
  left: 2px;
  transition: all 0.3s var(--ease-apple);
}
.toggle-wrapper input[type="checkbox"]:checked + .toggle-label .toggle-track {
  background: rgba(0, 230, 118, 0.2);
  border-color: rgba(0, 230, 118, 0.4);
}
.toggle-wrapper input[type="checkbox"]:checked + .toggle-label .toggle-track::after {
  transform: translateX(18px);
  background: #00e676;
  box-shadow: 0 0 8px rgba(0, 230, 118, 0.4);
}
.toggle-text-on, .toggle-text-off {
  font-size: 12px;
  color: var(--text-muted);
  transition: all 0.3s var(--ease-apple);
}
.toggle-wrapper input[type="checkbox"]:checked + .toggle-label .toggle-text-on {
  display: inline;
  color: rgba(0, 230, 118, 0.8);
}
.toggle-wrapper input[type="checkbox"]:checked + .toggle-label .toggle-text-off {
  display: none;
}
.toggle-wrapper input[type="checkbox"]:not(:checked) + .toggle-label .toggle-text-on {
  display: none;
}
.toggle-wrapper input[type="checkbox"]:not(:checked) + .toggle-label .toggle-text-off {
  display: inline;
}

/* ─── Enrichment Progress Phases ─── */
.enrichment-progress {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 8px 0;
  grid-column: span 2;
}
.enrich-phase {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.06);
  background: rgba(255,255,255,0.02);
  transition: all 0.5s var(--ease-apple);
}
.enrich-phase.completed {
  border-color: rgba(0, 230, 118, 0.2);
  background: linear-gradient(135deg, rgba(0, 230, 118, 0.06) 0%, rgba(0, 230, 118, 0.01) 100%);
}
.enrich-phase.active {
  border-color: rgba(116, 185, 255, 0.3);
  background: linear-gradient(135deg, rgba(116, 185, 255, 0.06) 0%, rgba(116, 185, 255, 0.01) 100%);
  box-shadow: 0 0 20px rgba(116, 185, 255, 0.05);
}
.enrich-phase.error {
  border-color: rgba(255, 82, 82, 0.3);
  background: linear-gradient(135deg, rgba(255, 82, 82, 0.06) 0%, rgba(255, 82, 82, 0.01) 100%);
}
.enrich-phase.pending {
  opacity: 0.35;
}
.phase-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--text-muted);
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  transition: all 0.4s var(--ease-apple);
}
.enrich-phase.completed .phase-icon {
  color: #00e676;
  background: rgba(0, 230, 118, 0.1);
  border-color: rgba(0, 230, 118, 0.25);
}
.enrich-phase.active .phase-icon {
  color: #74b9ff;
  background: rgba(116, 185, 255, 0.1);
  border-color: rgba(116, 185, 255, 0.25);
}
.enrich-phase.error .phase-icon {
  color: var(--danger-color);
  background: var(--danger-bg);
  border-color: rgba(255, 82, 82, 0.25);
}
.phase-icon.spinning {
  animation: pulse-spin 2s ease-in-out infinite;
}
@keyframes pulse-spin {
  0%, 100% { transform: rotate(0deg); opacity: 1; }
  50% { transform: rotate(180deg); opacity: 0.7; }
}
.phase-info {
  flex: 1;
}
.phase-title {
  font-size: 13px;
  font-weight: 600;
  color: #ffffff;
  margin-bottom: 2px;
}
.enrich-phase.pending .phase-title {
  color: var(--text-muted);
}
.phase-subtitle {
  font-size: 11px;
  color: var(--text-muted);
}

@keyframes spin { to { transform: rotate(360deg); } }
/* Inline spinner for buttons */
.spinner-inline {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(0,0,0,0.15);
  border-top-color: #000;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  display: inline-block;
  vertical-align: middle;
  margin-right: 4px;
}

.btn-generate-dm {
  background: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
  color: #ffffff;
  border: none;
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.25);
}

.btn-generate-dm:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
  background: linear-gradient(135deg, #4f46e5 0%, #9333ea 100%);
}

.btn-generate-dm:disabled {
  opacity: 0.65;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.ai-loading-container {
  grid-column: span 2; display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 30px; text-align: center; color: var(--text-muted); font-size: 13px; gap: 16px;
}
.spinner {
  width: 24px; height: 24px; border: 3px solid rgba(255,255,255,0.1); border-top-color: var(--primary-color);
  border-radius: 50%; animation: spin 1s linear infinite;
}

.ai-error-banner {
  grid-column: span 2; padding: 16px 18px; border-radius: 10px;
  background: rgba(255,82,82,0.08); border: 1px solid rgba(255,82,82,0.2);
  color: var(--danger-color); font-size: 13px; font-weight: 500;
  line-height: 1.7;
}

.ai-result-card {
  grid-column: span 2; display: flex; flex-direction: column; gap: 10px;
  padding: 16px; background: rgba(0, 230, 118, 0.04); border: 1px solid rgba(0, 230, 118, 0.2);
  border-radius: 8px;
}
.ai-result-header { margin-bottom: 4px; }
.badge-success {
  display: inline-block; padding: 4px 10px; background: rgba(0, 230, 118, 0.15);
  color: #00e676; border-radius: 50px; font-size: 11px; font-weight: 600;
}
.ai-result-row { font-size: 13px; color: var(--text-color); display: flex; justify-content: space-between; align-items: center; }
.ai-result-row.dm-row { align-items: flex-start; margin-top: 8px; }
.btn-copy-dm {
  background: rgba(255,255,255,0.1); border: none; color: #fff; padding: 4px 8px;
  border-radius: 4px; font-size: 11px; cursor: pointer; transition: all 0.2s;
}
.btn-copy-dm:hover { background: rgba(255,255,255,0.2); }
#ai-res-dm {
  width: 100%; margin-top: 4px; padding: 10px; background: rgba(0,0,0,0.3); border: 1px solid rgba(255,255,255,0.1);
  border-radius: 6px; color: var(--text-muted); font-size: 12px; resize: none; font-family: inherit;
}


/* ─── Toast ─── */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 18px;
  min-width: 280px;
  max-width: 440px;
  border-radius: 12px;
  font-size: 13.5px;
  font-weight: 500;
  background: #141418;
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #ffffff;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.85), 0 0 0 1px rgba(255, 255, 255, 0.08);
  opacity: 1;
  pointer-events: auto;
  animation: toastFadeIn 0.25s var(--ease-apple) forwards;
}
@keyframes toastFadeIn {
  from { opacity: 0; transform: translateY(12px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.toast.toast-success, .toast.success {
  border-color: rgba(16, 185, 129, 0.6);
  background: #0d1f17;
}
.toast.toast-error, .toast.error {
  border-color: rgba(239, 68, 68, 0.6);
  background: #200f0f;
}
.toast.toast-info, .toast.info {
  border-color: rgba(99, 102, 241, 0.6);
  background: #121426;
}
.toast-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 18px;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
  transition: color 0.15s ease;
}
.toast-close:hover {
  color: #ffffff;
}

/* ─── Mobile Bottom Navigation (Hidden by default on Desktop) ─── */
.mobile-bottom-nav {
  display: none;
}

/* ─── Responsive ─── */
@media (max-width: 768px) {
  /* Ultra-high performance touch scrolling for Realme 10 & Android */
  html {
    overflow-x: hidden !important;
    overflow-y: auto !important;
    width: 100% !important;
    height: auto !important;
    -webkit-text-size-adjust: 100%;
  }

  body {
    overflow-x: hidden !important;
    overflow-y: visible !important;
    width: 100% !important;
    min-height: 100% !important;
    height: auto !important;
    position: relative;
    -webkit-tap-highlight-color: transparent;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-y: auto;
    touch-action: auto !important;
  }

  /* Main container bottom spacing to clear fixed bottom nav + Android navbar */
  .main {
    padding: calc(8px + env(safe-area-inset-top, 0px)) 12px calc(88px + env(safe-area-inset-bottom, 0px)) 12px;
    width: 100%;
    max-width: 100vw;
    box-sizing: border-box;
    overflow-x: hidden;
  }

  /* Header adjustments: App bar style with status bar clearance */
  .header {
    width: 100%;
    margin: 0;
    top: 0;
    border-radius: 0 0 16px 16px;
    border-top: none;
    border-left: none;
    border-right: none;
    padding: calc(10px + env(safe-area-inset-top, 0px)) 14px 12px 14px;
    box-sizing: border-box;
    background: #0a0a0c;
  }
  .header-container {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    width: 100%;
  }
  .header-left {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
  }
  /* Hide top db-mode-switcher on mobile since bottom navigation handles it */
  .header-left .db-mode-switcher {
    display: none;
  }
  .header-center {
    order: 2;
    max-width: 100%;
    width: 100%;
    flex-basis: 100%;
    margin: 0;
  }
  .search-wrapper {
    width: 100%;
    height: 40px;
    box-sizing: border-box;
  }
  .search-kbd { display: none; }
  
  .header-right {
    display: none; /* Quick actions and Add are moved to bottom nav / in-card buttons */
  }

  /* Compact New Lead / Proposal button */
  #btn-add-text { display: none; }
  #btn-add {
    padding: 0;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    justify-content: center;
    align-items: center;
  }
  #btn-add svg {
    margin: 0;
    width: 16px;
    height: 16px;
  }

  /* Stats Row: 2 column compact cards */
  .stats-row { 
    grid-template-columns: repeat(2, 1fr); 
    gap: 8px;
    margin-bottom: 12px;
  }
  .stat-card {
    padding: 10px 12px;
    border-radius: 12px;
    gap: 4px;
    min-height: 72px;
  }
  .stat-card .stat-icon {
    width: 24px;
    height: 24px;
  }
  .stat-card .stat-icon svg {
    width: 12px;
    height: 12px;
  }
  .stat-value { font-size: 17px; font-weight: 700; }
  .stat-title { font-size: 10px; text-transform: uppercase; letter-spacing: 0.05em; }
  .stat-subtitle { font-size: 10px; }

  /* View Controls & Filter Header */
  .view-controls { 
    flex-direction: column; 
    align-items: stretch; 
    gap: 10px;
    margin-bottom: 14px;
    padding: 12px;
    border-radius: 14px;
  }
  .view-controls-header {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    width: 100%;
  }
  .tab-group {
    display: flex;
    flex: 1;
    min-width: 0;
  }
  .tab {
    flex: 1;
    justify-content: center;
    padding: 7px 10px;
    font-size: 12px;
  }
  .filter-header-actions {
    display: flex;
    align-items: center;
    gap: 6px;
  }
  .filter-select-compact {
    max-width: 140px;
    font-size: 11px;
    padding: 6px 10px;
  }
  .btn-reset-filters {
    padding: 6px 10px;
    font-size: 11px;
    height: 32px;
  }

  /* Filter Toolbar: Smooth horizontal swipeable ribbon */
  .filter-toolbar {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    gap: 8px;
    padding: 4px 2px 8px 2px;
    width: 100%;
    scrollbar-width: none; /* Firefox */
  }
  .filter-toolbar::-webkit-scrollbar {
    display: none; /* Chrome/Safari */
  }
  .filter-toolbar .filter-select {
    flex: 0 0 auto;
    min-width: 130px;
    font-size: 12px;
    padding: 8px 12px;
    height: 36px;
    box-sizing: border-box;
  }
  .inline-date-wrapper {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 6px;
  }
  .inline-date-wrapper input[type="date"] {
    min-width: 120px;
    font-size: 12px;
    padding: 6px 10px;
    height: 36px;
  }

  /* Active Filters Bar */
  .active-filters-bar {
    padding: 8px 10px;
    margin-top: 4px;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }
  .active-filters-list {
    flex-wrap: wrap;
    gap: 6px;
  }
  .active-filter-chip {
    font-size: 11px;
    padding: 4px 8px;
  }
  .active-filters-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 11px;
  }

  /* Table Container & Transformation into Native Mobile Action Cards */
  .table-container {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    overflow-x: visible !important;
  }
  .table-wrapper {
    background: transparent;
    border: none;
    box-shadow: none;
    padding: 0;
    overflow-x: visible;
  }
  .crm-table {
    border-collapse: separate;
    border-spacing: 0;
    width: 100%;
    display: block;
  }
  .crm-table thead {
    display: none;
  }
  .crm-table tbody {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
  }

  /* App-Grade Mobile Action Card */
  .crm-table tbody tr {
    display: flex;
    flex-direction: column;
    position: relative;
    background: #131318;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 14px 15px;
    margin-bottom: 0;
    gap: 10px;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    box-sizing: border-box;
    width: 100%;
    contain: content;
  }
  .crm-table tbody tr:active {
    background: #1a1a22;
  }

  /* Card Top Row: Identity Group (Avatar + Title + Subtitle) */
  .crm-table td.cell-company {
    display: flex;
    align-items: center;
    padding: 0;
    border: none;
    width: 100%;
    padding-right: 110px; /* Generous clearance for status badge on Realme 10 */
    text-align: left;
    box-sizing: border-box;
  }
  .crm-table td.cell-company::before {
    display: none !important;
  }
  .card-identity-group {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    min-width: 0;
  }
  .card-avatar {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14.5px;
    font-weight: 700;
    color: #ffffff;
    flex-shrink: 0;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.15);
  }
  .card-info-meta {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    flex: 1;
    overflow: hidden;
  }
  .card-primary-title {
    font-size: 16px;
    font-weight: 700;
    color: #ffffff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    letter-spacing: -0.2px;
    line-height: 1.3;
  }
  .card-mobile-subtitle {
    display: block;
    font-size: 12px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
  }

  /* Status Pill Badge positioned top-right */
  .crm-table td.cell-status {
    position: absolute;
    top: 14px;
    right: 14px;
    padding: 0;
    border: none;
    display: flex;
    align-items: center;
  }
  .crm-table td.cell-status::before {
    display: none !important;
  }
  .crm-table td.cell-status .status-badge {
    padding: 4px 9px;
    font-size: 11px;
    max-width: 100px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  /* Middle Highlight Chips: Value & Follow-up */
  .card-highlight-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 2px;
  }
  .crm-table td.cell-val {
    display: flex;
    align-items: center;
    padding: 0;
    border: none;
  }
  .crm-table td.cell-val::before {
    display: none !important;
  }
  .badge-val {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 700;
    background: rgba(46, 213, 115, 0.12);
    color: #2ed573;
    border: 1px solid rgba(46, 213, 115, 0.25);
  }
  .badge-val.val-empty {
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-muted);
    border-color: rgba(255, 255, 255, 0.08);
    font-weight: 500;
  }

  .crm-table td.cell-followup {
    display: flex;
    align-items: center;
    padding: 0;
    border: none;
  }
  .crm-table td.cell-followup::before {
    display: none !important;
  }
  .card-fu-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 8px;
    font-size: 11.5px;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.1);
  }
  .card-fu-chip.fu-overdue {
    background: rgba(235, 87, 87, 0.14);
    color: #ff6b6b;
    border-color: rgba(235, 87, 87, 0.3);
  }
  .card-fu-chip.fu-today {
    background: rgba(245, 158, 11, 0.16);
    color: #fbbf24;
    border-color: rgba(245, 158, 11, 0.35);
  }

  /* Hide redundant desktop table columns on mobile */
  .crm-table td.cell-channel,
  .crm-table td.cell-industry,
  .crm-table td.cell-country,
  .crm-table td.cell-phone,
  .crm-table td.cell-social,
  .crm-table td.cell-added,
  .crm-table td.cell-investment,
  .crm-table td.cell-currency,
  .crm-table td.cell-prepared,
  .crm-table td.cell-valid {
    display: none !important;
  }

  /* Quick Action Strip at bottom of card */
  .crm-table td.cell-actions-td {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 0 0 0;
    margin-top: 4px;
    border-top: 1px solid rgba(255, 255, 255, 0.07);
    border-bottom: none;
    width: 100%;
    box-sizing: border-box;
  }
  .crm-table td.cell-actions-td::before {
    display: none !important;
  }
  .crm-table td .cell-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    gap: 8px;
  }
  .card-quick-actions-left {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
  }
  .card-quick-actions-right {
    display: flex;
    align-items: center;
    gap: 6px;
  }

  .btn-quick-wa {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 13px;
    background: rgba(37, 211, 102, 0.14);
    color: #25d366;
    border: 1px solid rgba(37, 211, 102, 0.3);
    border-radius: 11px;
    font-size: 12.5px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.15s ease;
    min-height: 40px;
    box-sizing: border-box;
  }
  .btn-quick-wa:active {
    background: rgba(37, 211, 102, 0.28);
    transform: scale(0.96);
  }
  .btn-quick-call {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.06);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 11px;
    font-size: 12.5px;
    font-weight: 500;
    text-decoration: none;
    min-height: 40px;
    box-sizing: border-box;
  }
  .btn-quick-call:active {
    background: rgba(255, 255, 255, 0.14);
    transform: scale(0.96);
  }
  .btn-quick-dm {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 8px 12px;
    background: rgba(99, 102, 241, 0.14);
    color: #a5b4fc;
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: 11px;
    font-size: 12.5px;
    font-weight: 600;
    min-height: 40px;
    box-sizing: border-box;
    cursor: pointer;
  }
  .btn-quick-dm:active {
    background: rgba(99, 102, 241, 0.28);
    transform: scale(0.96);
  }
  .action-btn-circle {
    width: 40px;
    height: 40px;
    border-radius: 11px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.15s ease;
  }
  .action-btn-circle:active {
    transform: scale(0.94);
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
  }

  /* Pagination Bar at Bottom */
  .table-footer {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 16px 8px;
  }
  .pagination-controls {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
  }

  /* Kanban Pipeline with Horizontal Snap Scroll */
  .pipeline-board {
    display: flex;
    flex-direction: row;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    gap: 14px;
    padding: 4px 4px 20px 4px;
    scrollbar-width: none;
  }
  .pipeline-board::-webkit-scrollbar {
    display: none;
  }
  .pipeline-column {
    min-width: calc(100vw - 40px);
    max-width: calc(100vw - 40px);
    scroll-snap-align: center;
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.025);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 18px;
  }
  .column-header {
    padding: 14px 16px;
  }
  .column-cards {
    padding: 12px;
    gap: 12px;
  }
  .kanban-card {
    padding: 14px;
    border-radius: 14px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
  }

  /* Dashboard View Mobile Optimizations */
  .dashboard-container {
    padding: 12px 6px 20px 6px;
    gap: 16px;
  }
  .dash-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
  .dash-filters {
    width: 100%;
    overflow-x: auto;
    padding-bottom: 4px;
  }
  .dash-select {
    flex: 1;
    font-size: 13px;
    padding: 8px 12px;
  }
  .dash-grid-kpi {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
  .kpi-card {
    padding: 14px;
    border-radius: 12px;
  }
  .kpi-value {
    font-size: 22px;
  }
  .dash-grid-2, .dash-grid-3 {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  /* Modal Bottom Sheet UX on Mobile */
  .modal-overlay {
    padding: 0;
    align-items: flex-end; /* Slide up from bottom like native app sheet */
    z-index: 1000;
  }
  .modal {
    width: 100%;
    max-width: 100%;
    max-height: 92vh;
    border-radius: 24px 24px 0 0;
    border-bottom: none;
    border-left: none;
    border-right: none;
    box-shadow: 0 -12px 50px rgba(0, 0, 0, 0.85);
    transform: translateY(100%);
    transition: transform 0.32s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.25s ease;
    opacity: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }
  .modal-overlay.active .modal {
    transform: translateY(0);
    opacity: 1;
  }
  .modal-drag-indicator {
    display: block;
    width: 48px;
    height: 5px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.35);
    margin: 12px auto 6px auto;
    cursor: grab;
    flex-shrink: 0;
    touch-action: none;
  }
  .modal-header {
    padding: 12px 18px 14px 18px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
  }
  .modal-tabs-bar {
    padding: 8px 12px;
    gap: 6px;
    background: rgba(0, 0, 0, 0.35);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .modal-tabs-bar::-webkit-scrollbar {
    display: none;
  }
  .modal-tab-btn {
    padding: 8px 12px;
    font-size: 12px;
    border-radius: 9px;
    white-space: nowrap;
    flex-shrink: 0;
  }
  .modal-tab-panel.active {
    grid-template-columns: 1fr !important;
    gap: 14px;
  }
  .modal-body {
    padding: 16px 20px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    flex: 1;
  }
  .form-group.full-width {
    grid-column: span 1;
  }
  .form-group input, .form-group select, .form-group textarea {
    font-size: 16px; /* 16px prevents automatic iOS browser zoom on focus */
    padding: 12px 14px;
    border-radius: 12px;
  }
  .modal-footer {
    padding: 12px 16px calc(16px + env(safe-area-inset-bottom, 0px)) 16px;
    flex-direction: row;
    justify-content: flex-end;
    align-items: center;
    gap: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(15, 15, 19, 0.98);
    backdrop-filter: blur(16px);
    flex-shrink: 0;
  }
  .modal-footer button,
  .modal-footer a {
    flex: 1;
    min-height: 48px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 13px;
    justify-content: center;
    padding: 10px 14px;
    box-sizing: border-box;
    width: auto;
  }
  .modal-footer #modal-save {
    flex: 2; /* Main primary save action */
  }

  /* ─── Native App Bottom Navigation Bar ─── */
  .mobile-bottom-nav {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: calc(64px + env(safe-area-inset-bottom, 0px));
    background: #0c0c10;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 900;
    padding: 0 10px;
    padding-bottom: env(safe-area-inset-bottom, 0px);
    justify-content: space-around;
    align-items: center;
    box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.65);
    box-sizing: border-box;
  }
  .mobile-nav-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-family: var(--font-main);
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    padding: 6px 0;
    transition: all 0.2s ease;
    border-radius: 12px;
    min-height: 50px;
    touch-action: manipulation;
  }
  .mobile-nav-btn svg {
    transition: transform 0.2s var(--ease-apple), color 0.2s ease;
  }
  .mobile-nav-btn.active {
    color: #ffffff;
    font-weight: 700;
  }
  .mobile-nav-btn.active svg {
    color: #ffffff;
    transform: translateY(-2px);
  }
  .mobile-nav-add-btn {
    position: relative;
    top: -12px;
    flex: 0 0 54px;
  }
  .mob-add-circle {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #ffffff;
    color: #000000;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 20px rgba(255, 255, 255, 0.38), 0 2px 8px rgba(0, 0, 0, 0.4);
    transition: transform 0.2s var(--ease-apple);
  }
  .mobile-nav-add-btn:active .mob-add-circle {
    transform: scale(0.90);
  }
  .mobile-nav-add-btn span {
    display: none;
  }
}

/* ─── Login Screen ─── */
.login-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: var(--bg-color);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background-image:
    radial-gradient(circle at 14% 10%, rgba(255, 255, 255, 0.04) 0%, transparent 30%),
    radial-gradient(circle at 84% 90%, rgba(255, 255, 255, 0.03) 0%, transparent 30%),
    linear-gradient(180deg, #050505 0%, #020202 50%, #060606 100%);
  transition: opacity 0.4s var(--ease-apple), visibility 0.4s var(--ease-apple);
}
.login-card {
  width: 100%;
  max-width: 400px;
  padding: 40px;
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(16, 16, 16, 0.96) 0%, rgba(6, 6, 6, 0.92) 100%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.6);
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.login-header {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.login-header .logo-icon {
  margin-bottom: 8px;
}
.login-header h2 {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.5px;
  color: #ffffff;
}
.login-header p {
  font-size: 13px;
  color: var(--text-muted);
}
.login-card form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.login-card .form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.login-card .checkbox-group {
  flex-direction: row;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
}
.login-card .checkbox-group input {
  width: 16px;
  height: 16px;
  cursor: pointer;
  accent-color: #ffffff;
}
.login-card .checkbox-group label {
  font-size: 12px;
  text-transform: none;
  letter-spacing: normal;
  cursor: pointer;
}
.login-btn {
  width: 100%;
  justify-content: center;
  padding: 12px;
  font-weight: 600;
  margin-top: 10px;
}
.login-error {
  padding: 10px 14px;
  font-size: 12px;
  color: var(--danger-color);
  background: var(--danger-bg);
  border: 1px solid rgba(255, 82, 82, 0.2);
  border-radius: 10px;
  text-align: center;
}

/* ─── Searchable Lead Selector in Deals Modal ─── */
.lead-picker-wrapper {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}
.lead-picker-input-row {
  display: flex;
  gap: 8px;
  position: relative;
  width: 100%;
}
.lead-search-trigger {
  flex: 1;
  position: relative;
}
.lead-search-trigger input {
  width: 100%;
  padding-left: 34px !important;
  box-sizing: border-box;
}
.lead-search-icon {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
  display: flex;
  align-items: center;
}
.lead-picker-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: #15151a;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.65), 0 0 0 1px rgba(255, 255, 255, 0.05);
  max-height: 240px;
  overflow-y: auto;
  z-index: 1100;
  display: flex;
  flex-direction: column;
  padding: 6px;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}
.lead-picker-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
  font-size: 13px;
  color: var(--text-light);
}
.lead-picker-item:hover, .lead-picker-item.highlighted {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}
.lead-picker-item-main {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.lead-picker-item-name {
  font-weight: 600;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.lead-picker-item-sub {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.lead-picker-item-badge {
  font-size: 11px;
  padding: 2px 7px;
  border-radius: 50px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-muted);
  flex-shrink: 0;
}
.lead-picker-empty {
  padding: 14px;
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
}
.lead-picker-custom-btn {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  margin-top: 4px;
  padding-top: 8px;
  color: var(--accent-color);
  font-weight: 500;
}

/* ─── Settings Page Styles ─── */
.settings-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 0 60px 0;
}

.settings-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 16px;
}

.settings-title {
  font-size: 24px;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -0.5px;
  margin-bottom: 4px;
}

.settings-subtitle {
  font-size: 13.5px;
  color: var(--text-muted);
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 20px;
}

.settings-card {
  border-radius: 14px;
  background: #0a0a0a;
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 22px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.6);
}

.settings-card-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.settings-card-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  flex-shrink: 0;
}

.settings-card-header h3 {
  font-size: 16px;
  font-weight: 600;
  color: #ffffff;
  margin-bottom: 2px;
}

.settings-card-header p {
  font-size: 12px;
  color: var(--text-muted);
}

.settings-card-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
  flex: 1;
}

.settings-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  font-size: 13px;
  color: var(--text-color);
}

.settings-toggle-row input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: #ffffff;
  cursor: pointer;
}

.settings-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 500;
}

.settings-status-pill.success {
  background: rgba(0, 230, 118, 0.1);
  color: #00e676;
  border: 1px solid rgba(0, 230, 118, 0.25);
}

.settings-info-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
}

.settings-info-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.025);
  font-size: 12px;
  gap: 8px;
}

.settings-info-item span {
  color: var(--text-muted);
}

.settings-info-item strong {
  color: #ffffff;
  font-weight: 500;
  text-align: right;
}

.settings-actions-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: auto;
}

.settings-actions-group button {
  justify-content: center;
  padding: 10px 16px;
  font-size: 12.5px;
}

/* ─── Opaque Wallpaper & Dark Overlay ─── */
.crm-wallpaper {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: -2;
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  transition: opacity 0.4s ease, filter 0.3s ease;
  pointer-events: none;
}

.crm-wallpaper-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: -1;
  background: #000000;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.wallpaper-preset-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(88px, 1fr));
  gap: 8px;
}

.wallpaper-preset-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 8px;
  color: var(--text-color);
  font-size: 11.5px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
}

.wallpaper-preset-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
}

.wallpaper-preset-btn.active {
  background: rgba(255, 255, 255, 0.16);
  border-color: #ffffff;
  color: #ffffff;
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.12);
}

.settings-slider {
  -webkit-appearance: none;
  appearance: none;
  height: 6px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.12);
  outline: none;
  cursor: pointer;
}

.settings-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #ffffff;
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
  transition: transform 0.15s ease;
}

.settings-slider::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

.settings-slider::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #ffffff;
  cursor: pointer;
  border: none;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
}

/* ─── AI Outreach Knowledge Base Trigger & Modal ─── */
.kb-trigger-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  cursor: pointer;
  transition: all 0.2s ease;
}

.kb-trigger-card:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.16);
  transform: translateY(-1px);
}

.kb-trigger-left {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.kb-trigger-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.kb-word-count-badge {
  font-size: 11px;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.06);
  padding: 1px 6px;
  border-radius: 4px;
  font-weight: 500;
}

.kb-trigger-sub {
  font-size: 11.5px;
  color: var(--text-muted);
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.btn-kb-edit {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 500;
  color: #ffffff;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.btn-kb-edit:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.25);
  color: #ffffff;
}

/* Modal styling */
.kb-modal {
  max-width: 660px;
  width: 92%;
}

.kb-modal-body {
  padding: 16px 22px 20px 22px;
}

.kb-quick-templates {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.kb-quick-header {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #a0a0a0;
}

.kb-preset-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.kb-pill-btn {
  padding: 4px 10px;
  border-radius: 14px;
  font-size: 11px;
  font-weight: 500;
  color: #d0d0d0;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.09);
  cursor: pointer;
  transition: all 0.15s ease;
}

.kb-pill-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.25);
  color: #ffffff;
  transform: translateY(-1px);
}

.kb-pill-btn.active {
  background: rgba(255, 255, 255, 0.2);
  border-color: #ffffff;
  color: #ffffff;
}

.kb-pill-reset {
  color: #a0a0a0;
  border-color: rgba(255, 255, 255, 0.06);
}

.kb-pill-reset:hover {
  color: #ff6b6b;
  border-color: rgba(255, 107, 107, 0.3);
  background: rgba(255, 107, 107, 0.08);
}

.kb-textarea-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.kb-word-counter {
  font-size: 11px;
  color: var(--text-muted);
}

.kb-textarea {
  width: 100%;
  box-sizing: border-box;
  background: #050505;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 12px 14px;
  font-size: 13px;
  line-height: 1.6;
  color: #f0f0f0;
  font-family: inherit;
  resize: vertical;
  min-height: 180px;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.kb-textarea:focus {
  border-color: rgba(255, 255, 255, 0.3);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.05);
}

.kb-helper-hints {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-top: 8px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.02);
  border-radius: 6px;
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.4;
}

.kb-hint-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.kb-hint-item svg {
  color: #10b981;
  flex-shrink: 0;
}

.kb-hint-item strong {
  color: #cccccc;
}

/* ─── Knowledge Base Service Tabs (Modal) ─── */
.kb-service-tabs-bar {
  display: flex;
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding: 8px 16px 0 16px;
  gap: 8px;
}

.kb-service-tab {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-muted);
  font-family: var(--font-main);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  border-radius: 6px 6px 0 0;
}

.kb-service-tab:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.03);
}

.kb-service-tab.active {
  color: #ffffff;
  font-weight: 600;
  border-bottom-color: #ffffff;
  background: rgba(255, 255, 255, 0.05);
}

/* ─── Lead Detail Modal: Service Pitch Switcher & Actions ─── */
.dm-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.service-pitch-switcher {
  display: inline-flex;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 2px;
  gap: 2px;
}

.pitch-pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 9px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 500;
  color: #a0a0a0;
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all 0.15s ease;
}

.pitch-pill-btn:hover {
  color: #ffffff;
}

.pitch-pill-btn.active {
  background: rgba(255, 255, 255, 0.18);
  color: #ffffff;
  font-weight: 600;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
}

/* ─── DM Personalization Readiness Bar ─── */
.dm-readiness-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 16px;
  transition: all 0.3s ease;
}

.dm-readiness-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  gap: 10px;
}

.dm-readiness-title {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-color, #f1f5f9);
}

.dm-readiness-title svg {
  color: #818cf8;
}

.dm-readiness-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 20px;
  border: 1px solid rgba(239, 68, 68, 0.3);
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
  white-space: nowrap;
  transition: all 0.3s ease;
}

.dm-readiness-bar-track {
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 8px;
  position: relative;
}

.dm-readiness-bar-fill {
  height: 100%;
  border-radius: 10px;
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1), background-color 0.4s ease, box-shadow 0.4s ease;
}

.dm-readiness-status {
  font-size: 11.5px;
  color: var(--text-muted, #94a3b8);
  margin-bottom: 8px;
  line-height: 1.4;
}

.dm-readiness-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.readiness-tag {
  font-size: 10.5px;
  padding: 2px 7px;
  border-radius: 6px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  cursor: help;
  transition: all 0.2s ease;
}

.readiness-tag.is-ok {
  background: rgba(16, 185, 129, 0.12);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.25);
}

.readiness-tag.is-missing {
  background: rgba(255, 255, 255, 0.04);
  color: #64748b;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.tab-readiness-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  margin-left: 6px;
  display: inline-block;
  transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

/* ─── Flawless Mobile Responsive Optimizations ─── */
@media (max-width: 768px) {

  /* Settings view on mobile */
  .settings-container {
    padding: 12px 4px 84px 4px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  .settings-header {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    margin-bottom: 16px;
  }

  .settings-header .btn-primary {
    width: 100%;
    justify-content: center;
    min-height: 44px;
  }

  .settings-grid {
    grid-template-columns: 1fr !important;
    gap: 14px;
    width: 100%;
    box-sizing: border-box;
  }

  .settings-card {
    padding: 18px 16px;
    border-radius: 14px;
    width: 100%;
    box-sizing: border-box;
  }

  .settings-card-header {
    gap: 10px;
    margin-bottom: 14px;
    padding-bottom: 12px;
  }

  .settings-card-icon {
    width: 34px;
    height: 34px;
    flex-shrink: 0;
  }

  /* Knowledge Base Trigger on mobile */
  .kb-trigger-card {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding: 12px;
    box-sizing: border-box;
  }

  .btn-kb-edit {
    width: 100%;
    justify-content: center;
    padding: 8px 12px;
    min-height: 40px;
  }

  /* DM Actions row in lead edit modal */
  .dm-header-actions {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    width: 100%;
    margin-top: 6px;
  }

  .service-pitch-switcher {
    width: 100%;
    display: flex;
    justify-content: stretch;
  }

  .pitch-pill-btn {
    flex: 1;
    justify-content: center;
    padding: 7px 8px;
    font-size: 12px;
    min-height: 36px;
  }

  .btn-generate-dm {
    width: 100%;
    justify-content: center;
    min-height: 40px;
  }

  /* Knowledge base modal on mobile */
  .kb-modal {
    width: 100% !important;
    max-width: 100% !important;
    border-radius: 22px 22px 0 0 !important;
    max-height: 90vh !important;
  }

  .kb-service-tabs-bar {
    padding: 6px 12px 0 12px;
  }

  .kb-service-tab {
    padding: 9px 8px;
    font-size: 12px;
  }

  .kb-modal-body {
    padding: 14px 16px;
    max-height: calc(90vh - 170px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .kb-preset-pills {
    gap: 5px;
  }

  .kb-pill-btn {
    padding: 6px 11px;
    font-size: 11.5px;
  }

  .kb-textarea {
    font-size: 15px; /* prevents iOS zoom */
    min-height: 150px;
    padding: 10px 12px;
  }

  .kb-modal-footer {
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px)) 16px;
  }

  /* Wallpaper presets on mobile */
  .wallpaper-presets-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 8px;
  }

  .wallpaper-preset-btn {
    padding: 10px 6px;
    font-size: 11px;
  }

  /* Textarea actions on mobile */
  .textarea-actions {
    flex-wrap: wrap;
    gap: 5px;
  }

  .textarea-actions button {
    flex: 1 1 calc(50% - 5px);
    justify-content: center;
    padding: 8px 10px;
    font-size: 12px;
    min-height: 36px;
  }

  /* Mobile toast container floats safely above bottom nav */
  .toast-container {
    bottom: 78px !important;
    right: 14px !important;
    left: 14px !important;
    align-items: center !important;
    z-index: 99999 !important;
  }
  .toast {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box;
  }
}

/* ──────────────────────────────────────────────────────────
   AI VOICE & QUICK NOTE PARSER + ESTIMATED LEAD VALUE STYLES
   ────────────────────────────────────────────────────────── */

.header-lead-value-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  padding: 4px 10px;
  font-size: 12px;
}

.hlv-label {
  color: var(--text-muted);
  font-size: 11.5px;
  font-weight: 500;
}

.hlv-inputs {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.hlv-symbol {
  color: #2ed573;
  font-weight: 700;
  font-size: 13px;
}

.hlv-val-input {
  width: 90px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 6px;
  color: #ffffff;
  padding: 3px 6px;
  font-size: 12px;
  font-weight: 600;
  font-family: inherit;
  outline: none;
  transition: all 0.2s ease;
}

.hlv-val-input:focus {
  border-color: #6366f1;
  background: rgba(99, 102, 241, 0.12);
}

.hlv-curr-select {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 6px;
  color: #ffffff;
  padding: 3px 5px;
  font-size: 11px;
  font-weight: 600;
  font-family: inherit;
  outline: none;
  cursor: pointer;
}

/* Quick Note Container */
.quick-ai-note-wrapper {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 14px;
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: border-color 0.2s ease;
}

.quick-ai-note-wrapper:focus-within {
  border-color: rgba(99, 102, 241, 0.4);
}

.quick-note-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.quick-note-title-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: #ffffff;
  letter-spacing: 0.02em;
}

.quick-note-title-badge svg {
  color: #6366f1;
}

.quick-note-input-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: relative;
}

.quick-note-textarea {
  width: 100%;
  box-sizing: border-box;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  color: #ffffff;
  padding: 10px 12px;
  font-size: 13px;
  font-family: inherit;
  line-height: 1.45;
  resize: vertical;
  min-height: 56px;
  outline: none;
  transition: all 0.2s ease;
}

.quick-note-textarea:focus {
  border-color: #6366f1;
  background: rgba(0, 0, 0, 0.6);
}

.quick-note-actions-bar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

/* Voice Record Button */
.btn-voice-record {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  color: #e0e0e0;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.btn-voice-record:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.2);
}

.btn-voice-record.recording {
  background: rgba(235, 87, 87, 0.2);
  border-color: #eb5757;
  color: #ff6b6b;
  animation: pulse-red-ring 1.5s infinite;
}

@keyframes pulse-red-ring {
  0% { box-shadow: 0 0 0 0 rgba(235, 87, 87, 0.5); }
  70% { box-shadow: 0 0 0 8px rgba(235, 87, 87, 0); }
  100% { box-shadow: 0 0 0 0 rgba(235, 87, 87, 0); }
}

.recording-indicator-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: #eb5757;
  display: inline-block;
  animation: blink-dot 0.8s ease infinite alternate;
}

@keyframes blink-dot {
  0% { opacity: 0.3; transform: scale(0.85); }
  100% { opacity: 1; transform: scale(1.15); }
}

/* Parse Action Button */
.btn-parse-note {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  color: #ffffff;
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(99, 102, 241, 0.3);
  transition: all 0.2s ease;
}

.btn-parse-note:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.45);
}

.btn-parse-note:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* Interactive Review Confirmation Card */
.ai-note-review-card {
  background: rgba(15, 18, 30, 0.95);
  border: 1px solid rgba(99, 102, 241, 0.4);
  border-radius: 12px;
  padding: 16px;
  margin-top: 6px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  animation: slide-down-fade 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slide-down-fade {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

.review-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 10px;
}

.review-card-title {
  font-size: 13px;
  font-weight: 600;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 7px;
}

.review-card-title span.badge {
  background: rgba(99, 102, 241, 0.2);
  color: #818cf8;
  font-size: 11px;
  padding: 2px 7px;
  border-radius: 4px;
}

.review-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

@media (max-width: 600px) {
  .review-grid-3 {
    grid-template-columns: 1fr;
  }
}

.review-field-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.review-field-label {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.review-field-input-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.review-input {
  width: 100%;
  box-sizing: border-box;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  color: #ffffff;
  padding: 6px 10px;
  font-size: 12.5px;
  font-family: inherit;
  outline: none;
}

.review-input:focus {
  border-color: #6366f1;
}

.review-textarea {
  width: 100%;
  box-sizing: border-box;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  color: #ffffff;
  padding: 8px 10px;
  font-size: 12.5px;
  font-family: inherit;
  line-height: 1.45;
  resize: vertical;
  min-height: 90px;
  outline: none;
}

.review-textarea:focus {
  border-color: #6366f1;
}

.review-card-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 12px;
}

.btn-confirm-note {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #2ed573;
  border: none;
  border-radius: 8px;
  color: #000000;
  padding: 7px 16px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(46, 213, 115, 0.3);
  transition: all 0.2s ease;
}

.btn-confirm-note:hover:not(:disabled) {
  background: #26af5f;
  transform: translateY(-1px);
}

.btn-confirm-note:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-discard-note {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  color: var(--text-muted);
  padding: 7px 12px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-discard-note:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.25);
}

/* ─────────────────────────────────────────────────────────────
   DUPLICATE CONFLICT RESOLUTION MODAL
   ───────────────────────────────────────────────────────────── */
.conflict-header-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: rgba(235, 87, 87, 0.12);
  border: 1px solid rgba(235, 87, 87, 0.25);
  color: #eb5757;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.conflict-matched-notice {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  padding: 10px 14px;
  background: rgba(235, 87, 87, 0.08);
  border: 1px solid rgba(235, 87, 87, 0.22);
  border-radius: 10px;
  font-size: 12.5px;
  color: #f87171;
}

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

@media (max-width: 680px) {
  .conflict-comparison-grid {
    grid-template-columns: 1fr;
  }
}

.conflict-col {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
}

.conflict-col-existing {
  border-left: 3px solid rgba(255, 255, 255, 0.3);
}

.conflict-col-incoming {
  border-left: 3px solid #6366f1;
}

.conflict-col-header {
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.conflict-col-tag {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 2px 7px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
}

.conflict-col-tag.incoming-tag {
  background: rgba(99, 102, 241, 0.15);
  color: #a5b4fc;
}

.conflict-details-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.conflict-field-row {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.015);
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.04);
}

.conflict-field-row.conflict-field-matched {
  background: rgba(235, 87, 87, 0.08);
  border-color: rgba(235, 87, 87, 0.28);
}

.conflict-field-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.conflict-field-value {
  font-size: 12.5px;
  color: #ffffff;
  word-break: break-word;
  line-height: 1.4;
}

.conflict-field-empty {
  color: var(--text-muted);
  font-style: italic;
  font-size: 11.5px;
}

.conflict-matched-badge {
  display: inline-flex;
  align-items: center;
  font-size: 9.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 1px 6px;
  border-radius: 4px;
  background: rgba(235, 87, 87, 0.2);
  color: #fca5a5;
}

/* ─────────────────────────────────────────────────────────────
   AI LEAD ENRICHMENT REVIEW MODAL
   ───────────────────────────────────────────────────────────── */
.enrichment-header-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: rgba(99, 102, 241, 0.15);
  border: 1px solid rgba(99, 102, 241, 0.3);
  color: #818cf8;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.enrichment-attributes-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.enrichment-attribute-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 12px;
  transition: all 0.2s ease;
}

.enrichment-attribute-card:hover {
  border-color: rgba(99, 102, 241, 0.25);
  background: rgba(255, 255, 255, 0.03);
}

.enrichment-attribute-card.selected {
  border-color: rgba(99, 102, 241, 0.4);
  background: rgba(99, 102, 241, 0.04);
}

.enrichment-checkbox {
  width: 17px;
  height: 17px;
  accent-color: #6366f1;
  margin-top: 3px;
  cursor: pointer;
}

.enrichment-card-content {
  flex: 1;
  min-width: 0;
}

.enrichment-field-name {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.enrichment-field-value {
  font-size: 13px;
  color: #ffffff;
  line-height: 1.45;
  word-break: break-word;
}

.enrichment-field-diff {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
}

.enrichment-chips-group {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.enrichment-chip {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(99, 102, 241, 0.12);
  border: 1px solid rgba(99, 102, 241, 0.25);
  color: #c7d2fe;
}

.enrichment-chip.gap-chip {
  background: rgba(245, 158, 11, 0.1);
  border-color: rgba(245, 158, 11, 0.25);
  color: #fcd34d;
}

/* ==========================================================================
   BULK OPERATIONS & MULTI-SELECT STYLES
   ========================================================================== */

.crm-checkbox {
  appearance: none;
  -webkit-appearance: none;
  width: 17px;
  height: 17px;
  border: 1.5px solid rgba(255, 255, 255, 0.25);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.05);
  cursor: pointer;
  position: relative;
  vertical-align: middle;
  transition: all 0.15s ease;
  flex-shrink: 0;
  display: inline-block;
}

.crm-checkbox:hover {
  border-color: rgba(255, 255, 255, 0.55);
  background: rgba(255, 255, 255, 0.1);
}

.crm-checkbox:checked {
  background-color: #3b82f6;
  border-color: #3b82f6;
}

.crm-checkbox:checked::after {
  content: '';
  position: absolute;
  left: 4.5px;
  top: 1.5px;
  width: 5px;
  height: 9px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.crm-checkbox:indeterminate {
  background-color: #3b82f6;
  border-color: #3b82f6;
}

.crm-checkbox:indeterminate::after {
  content: '';
  position: absolute;
  left: 3.5px;
  top: 6px;
  width: 8px;
  height: 2px;
  background: white;
}

.crm-table th.th-select,
.crm-table td.cell-select {
  width: 44px;
  min-width: 44px;
  max-width: 44px;
  text-align: center;
  padding: 10px 4px !important;
  vertical-align: middle;
}

.crm-record-row.row-selected {
  background: rgba(59, 130, 246, 0.08) !important;
}

.crm-record-row.row-selected:hover {
  background: rgba(59, 130, 246, 0.13) !important;
}

/* Floating Bulk Actions Dock */
.bulk-actions-dock {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 999;
  animation: dockSlideUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  max-width: 94vw;
}

@keyframes dockSlideUp {
  from {
    opacity: 0;
    transform: translate(-50%, 20px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translate(-50%, 0) scale(1);
  }
}

.bulk-actions-inner {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(15, 15, 20, 0.94);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 14px;
  padding: 8px 14px;
  box-shadow: 0 16px 44px rgba(0, 0, 0, 0.65), 0 0 0 1px rgba(255, 255, 255, 0.06);
}

.bulk-actions-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.bulk-selected-badge {
  font-size: 13px;
  font-weight: 600;
  color: #ffffff;
  background: rgba(59, 130, 246, 0.2);
  border: 1px solid rgba(59, 130, 246, 0.4);
  padding: 4px 10px;
  border-radius: 8px;
  white-space: nowrap;
}

.btn-bulk-text {
  background: none;
  border: none;
  color: #60a5fa;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: underline;
  padding: 2px 4px;
  white-space: nowrap;
}

.btn-bulk-text:hover {
  color: #93c5fd;
}

.bulk-actions-divider {
  width: 1px;
  height: 22px;
  background: rgba(255, 255, 255, 0.12);
}

.bulk-actions-buttons {
  display: flex;
  align-items: center;
  gap: 8px;
}

.bulk-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.bulk-action-btn:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.25);
}

.bulk-action-btn.btn-bulk-danger {
  color: #f87171;
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.25);
}

.bulk-action-btn.btn-bulk-danger:hover {
  background: rgba(239, 68, 68, 0.22);
  border-color: rgba(239, 68, 68, 0.45);
}

.bulk-close-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 6px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s;
}

.bulk-close-btn:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
}

/* Bulk Dropdown */
.bulk-dropdown-wrapper {
  position: relative;
}

.bulk-dropdown-menu {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 0;
  background: #14141c;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 10px;
  padding: 6px;
  min-width: 180px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.6);
  display: flex;
  flex-direction: column;
  gap: 2px;
  z-index: 1000;
}

.bulk-dropdown-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 6px;
  background: none;
  border: none;
  color: #e2e8f0;
  font-size: 13px;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s ease;
}

.bulk-dropdown-item:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}

/* Bulk Edit Modal */
.modal-bulk-edit {
  max-width: 600px;
  width: 100%;
}

.bulk-edit-body {
  padding: 16px 24px;
  max-height: 65vh;
  overflow-y: auto;
}

.bulk-edit-notice {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.25);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 12px;
  color: #93c5fd;
  line-height: 1.4;
  margin-bottom: 16px;
}

.bulk-edit-notice svg {
  flex-shrink: 0;
  margin-top: 1px;
}

.bulk-edit-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.bulk-field-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  padding: 10px 14px;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.bulk-field-row.active {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(59, 130, 246, 0.35);
}

.bulk-field-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
}

.bulk-field-name {
  font-size: 13px;
  font-weight: 600;
  color: #ffffff;
}

.bulk-field-input-wrap {
  padding-left: 27px;
  margin-top: 4px;
}

.bulk-input:disabled {
  opacity: 0.35;
  pointer-events: none;
  filter: grayscale(0.5);
}

.bulk-followup-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-bulk-clear-date {
  padding: 8px 12px;
  font-size: 12px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-muted);
  cursor: pointer;
  white-space: nowrap;
}

.btn-bulk-clear-date:hover:not(:disabled) {
  color: #f87171;
  border-color: rgba(239, 68, 68, 0.3);
}

.bulk-two-inputs {
  display: flex;
  gap: 8px;
}

.bulk-two-inputs input {
  flex: 1;
}

.bulk-note-mode {
  display: flex;
  gap: 16px;
  margin-top: 6px;
  font-size: 12px;
  color: var(--text-muted);
}

.radio-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}

@media (max-width: 768px) {
  .bulk-actions-inner {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    padding: 10px;
  }
  .bulk-actions-buttons {
    justify-content: space-between;
    flex-wrap: wrap;
  }
  .bulk-actions-divider {
    display: none;
  }
  .bulk-action-btn {
    font-size: 12px;
    padding: 6px 10px;
  }
}

/* Status dots for dropdowns and badges (clean emoji-free indicator) */
.status-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  margin-right: 8px;
  background: #a1a1aa;
  vertical-align: middle;
}
.status-dot.status-draft { background: #71717a; }
.status-dot.status-sent { background: #3b82f6; }
.status-dot.status-viewed { background: #8b5cf6; }
.status-dot.status-review { background: #f59e0b; }
.status-dot.status-accepted { background: #10b981; }
.status-dot.status-declined { background: #ef4444; }
.status-dot.status-new { background: #71717a; }
.status-dot.status-ready { background: #8b5cf6; }
.status-dot.status-contacted { background: #3b82f6; }
.status-dot.status-replied { background: #10b981; }
.status-dot.status-demo { background: #f59e0b; }
.status-dot.status-meeting { background: #6366f1; }
.status-dot.status-followup { background: #eab308; }
.status-dot.status-won { background: #10b981; }
.status-dot.status-lost { background: #ef4444; }

/* ─── VIP Lead Badge & Controls ─── */
.vip-badge {
  display: inline-flex;
  align-items: center;
  gap: 3.5px;
  background: rgba(245, 158, 11, 0.1);
  color: #fbbf24;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  padding: 1.5px 6px;
  border-radius: 4px;
  border: 1px solid rgba(245, 158, 11, 0.25);
  vertical-align: middle;
  line-height: 1.2;
  user-select: none;
  flex-shrink: 0;
  white-space: nowrap;
  transition: all 0.15s ease;
  cursor: pointer;
}
.vip-badge:hover {
  background: rgba(245, 158, 11, 0.18);
  border-color: rgba(245, 158, 11, 0.4);
}
.vip-badge-icon {
  font-size: 10.5px;
  line-height: 1;
}

.card-title-row {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  max-width: 100%;
}
.card-title-row .card-primary-title {
  flex: 0 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.card-company-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  min-width: 0;
  max-width: 100%;
}
.card-company-row .card-company {
  flex: 0 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-bottom: 0;
}
.btn-vip-toggle {
  display: none !important;
}

/* ─── Modern Streamlined Table Elements (8 High-Impact Columns) ─── */
.lead-meta-sub {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--text-muted, #94a3b8);
  margin-top: 3px;
  flex-wrap: wrap;
}

.lead-sub-contact {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: #94a3b8;
  font-weight: 500;
}

.lead-sub-contact svg {
  color: #64748b;
}

.lead-sub-link {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  color: #94a3b8;
  text-decoration: none;
  font-weight: 500;
  transition: all 0.15s ease;
}

.lead-sub-link svg {
  color: #64748b;
  transition: color 0.15s ease;
}

.lead-sub-link:hover {
  color: #f8fafc;
  text-decoration: underline;
}

.lead-sub-link:hover svg {
  color: #94a3b8;
}

.lead-sub-link.ig {
  color: #94a3b8;
}

.lead-sub-link.ig svg {
  color: #64748b;
}

.lead-sub-link.ig:hover {
  color: #f8fafc;
}

.sub-sep {
  color: rgba(255, 255, 255, 0.2);
  font-size: 9px;
}

.lead-industry-primary {
  font-weight: 600;
  color: var(--text-color, #f1f5f9);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 180px;
}

.lead-location-sub {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: var(--text-muted, #94a3b8);
  margin-top: 2px;
}

.lead-location-sub svg {
  color: #64748b;
  flex-shrink: 0;
}

.channel-pill-group {
  margin-bottom: 4px;
}

.channel-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 500;
  padding: 2px 7px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.05);
  color: #cbd5e1;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.cell-phone-inline {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  color: var(--text-muted, #94a3b8);
}

.phone-num-text {
  font-family: var(--font-mono, monospace);
  font-size: 11px;
}

.table-call-btn,
.table-wa-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.05);
  color: #94a3b8;
  border: 1px solid rgba(255, 255, 255, 0.1);
  text-decoration: none;
  transition: all 0.15s ease;
}

.table-call-btn:hover,
.table-wa-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
}

/* AI Outreach DM Table Cell */
.table-dm-cell {
  display: flex;
  align-items: center;
  gap: 6px;
}

.dm-badge-ready {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10.5px;
  font-weight: 500;
  padding: 2px 7px;
  border-radius: 5px;
  background: rgba(16, 185, 129, 0.08);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.2);
  white-space: nowrap;
}

.btn-table-copy-dm {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 5px;
  font-size: 10.5px;
  font-weight: 500;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #94a3b8;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.btn-table-copy-dm:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.2);
}

.btn-table-copy-dm.is-copied {
  background: rgba(16, 185, 129, 0.12) !important;
  border-color: rgba(16, 185, 129, 0.25) !important;
  color: #10b981 !important;
}

.dm-table-readiness-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 500;
  padding: 2px 6px;
  border-radius: 4px;
  color: #94a3b8;
  white-space: nowrap;
}

.dm-table-readiness-pill .readiness-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

.btn-table-gen-dm {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 3px 8px;
  border-radius: 5px;
  font-size: 10.5px;
  font-weight: 500;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #cbd5e1;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.btn-table-gen-dm:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.22);
}

.lead-val-row {
  margin-bottom: 3px;
}

.lead-fu-row {
  margin-top: 2px;
}
.btn-filter-vip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.25);
  color: #FBBF24;
  transition: all 0.2s ease;
}
.btn-filter-vip:hover {
  background: rgba(245, 158, 11, 0.18);
  border-color: #F59E0B;
}
.btn-filter-vip.is-active {
  background: linear-gradient(135deg, #F59E0B 0%, #D97706 100%);
  color: #1a1003;
  border-color: #FCD34D;
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.4);
}
.btn-vip-header-toggle {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.3);
  color: #FBBF24;
  transition: all 0.15s ease;
}
.btn-vip-header-toggle:hover {
  background: rgba(245, 158, 11, 0.2);
  border-color: #F59E0B;
}
.btn-vip-header-toggle.is-vip {
  background: linear-gradient(135deg, #FFE066 0%, #F59E0B 50%, #D97706 100%);
  color: #1c1305;
  border-color: #FCD34D;
  box-shadow: 0 1px 6px rgba(245, 158, 11, 0.4);
}

/* VIP Toggle in Desktop Modal */
.vip-toggle-container {
  margin-bottom: 16px;
}
.vip-toggle-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(245, 158, 11, 0.05);
  border: 1px solid rgba(245, 158, 11, 0.2);
  border-radius: 12px;
  padding: 10px 14px;
  cursor: pointer;
  transition: all 0.2s ease;
}
.vip-toggle-card:hover {
  background: rgba(245, 158, 11, 0.09);
  border-color: rgba(245, 158, 11, 0.4);
}
.vip-toggle-card.is-active {
  background: rgba(245, 158, 11, 0.12);
  border-color: #F59E0B;
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.2);
}
.vip-toggle-left {
  display: flex;
  align-items: center;
  gap: 10px;
}
.vip-toggle-desc {
  font-size: 12px;
  color: var(--text-muted);
}
.vip-switch {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 22px;
  flex-shrink: 0;
}
.vip-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.vip-slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: #27272a;
  transition: .25s;
  border-radius: 22px;
  border: 1px solid rgba(255,255,255,0.15);
}
.vip-slider:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 2px;
  bottom: 2px;
  background-color: #fff;
  transition: .25s;
  border-radius: 50%;
}
.vip-switch input:checked + .vip-slider {
  background: linear-gradient(135deg, #F59E0B, #D97706);
  border-color: #FCD34D;
}
.vip-switch input:checked + .vip-slider:before {
  transform: translateX(18px);
  background-color: #18181b;
}

/* ─── API Keys & Integrations Settings Styles ─── */
.settings-input-group {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.settings-input-group input {
  width: 100%;
  padding-right: 36px;
  font-family: var(--font-mono, monospace);
  font-size: 12.5px;
}

.btn-toggle-secret {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  color: #64748b;
  cursor: pointer;
  padding: 4px 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: all 0.15s ease;
}

.btn-toggle-secret:hover {
  color: #f1f5f9;
  background: rgba(255, 255, 255, 0.08);
}

.settings-field-hint {
  font-size: 11px;
  color: var(--text-muted, #94a3b8);
  margin-top: 4px;
}

.integration-test-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 8px;
  margin-top: 4px;
}

.btn-test-action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  padding: 4px 10px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #cbd5e1;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-test-action:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.22);
}

.btn-test-action:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.integration-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 500;
  color: #94a3b8;
  padding: 2px 8px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  max-width: 100%;
}

.integration-status-badge .status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #64748b;
  flex-shrink: 0;
}

.integration-status-badge.is-connected {
  color: #34d399;
  background: rgba(16, 185, 129, 0.08);
  border-color: rgba(16, 185, 129, 0.25);
}

.integration-status-badge.is-connected .status-dot {
  background: #10b981;
  box-shadow: 0 0 6px rgba(16, 185, 129, 0.5);
}

.integration-status-badge.is-testing {
  color: #fbbf24;
  background: rgba(245, 158, 11, 0.08);
  border-color: rgba(245, 158, 11, 0.25);
}

.integration-status-badge.is-testing .status-dot {
  background: #f59e0b;
  animation: pulse 1s infinite;
}

.integration-status-badge.is-error {
  color: #f87171;
  background: rgba(239, 68, 68, 0.08);
  border-color: rgba(239, 68, 68, 0.25);
}

.integration-status-badge.is-error .status-dot {
  background: #ef4444;
}

/* ─── Settings Sidebar & Categorized Layout ─── */
.settings-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 28px;
  align-items: start;
  margin-top: 16px;
}

.settings-sidebar {
  position: sticky;
  top: 90px;
}

.settings-nav-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: rgba(10, 10, 10, 0.6);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 8px;
}

.settings-nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 8px;
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.18s ease;
  text-align: left;
  width: 100%;
}

.settings-nav-item svg {
  flex-shrink: 0;
  stroke: currentColor;
  transition: transform 0.18s ease;
}

.settings-nav-item:hover {
  background: rgba(255, 255, 255, 0.04);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.06);
}

.settings-nav-item.active {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.16);
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.settings-nav-item.active svg {
  transform: scale(1.08);
}

.settings-content {
  min-width: 0;
}

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

.settings-tab-pane.active {
  display: block;
  animation: fadeInPane 0.2s ease forwards;
}

@keyframes fadeInPane {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.settings-input-group {
  position: relative;
  display: flex;
  align-items: center;
}

.settings-input-group input {
  padding-right: 40px !important;
}

.btn-toggle-secret {
  position: absolute;
  right: 8px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: color 0.15s ease;
}

.btn-toggle-secret:hover {
  color: #ffffff;
}

.settings-field-hint {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
  line-height: 1.4;
}

.integration-test-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

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

  .settings-sidebar {
    position: static;
  }

  .settings-nav-list {
    flex-direction: row;
    overflow-x: auto;
    padding: 6px;
    scrollbar-width: none;
  }

  .settings-nav-list::-webkit-scrollbar {
    display: none;
  }

  .settings-nav-item {
    white-space: nowrap;
    width: auto;
    padding: 8px 12px;
  }
}
