/* ─── Variables ─────────────────────────────────────────── */
:root {
  --primary:    #4949FF;
  --primary-dk: #3535CC;
  --accent:     #4FBDFF;
  --dark:       #313131;
  --white:      #FFFFFF;
  --gray-50:    #F8F9FA;
  --gray-100:   #F0F2F5;
  --gray-200:   #E2E8F0;
  --gray-400:   #94A3B8;
  --gray-600:   #64748B;
  --success:    #10B981;
  --warning:    #F59E0B;
  --danger:     #EF4444;
  --sidebar-w:  240px;
}

/* ─── Reset ─────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Montserrat', sans-serif; font-size: 14px; color: var(--dark); background: var(--gray-100); }
a { text-decoration: none; color: inherit; }
input, select, textarea, button { font-family: inherit; font-size: 14px; }
.hidden { display: none !important; }

/* ─── Login ──────────────────────────────────────────────── */
.login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--dark) 0%, #1a1a2e 100%);
}
.login-card {
  background: var(--white);
  border-radius: 12px;
  padding: 40px;
  width: 380px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}
.login-logo { width: 200px; display: block; margin: 0 auto 24px; }
.login-title {
  font-family: 'Noto Serif', serif;
  font-size: 18px;
  text-align: center;
  color: var(--gray-600);
  margin-bottom: 28px;
}

/* ─── App Shell ──────────────────────────────────────────── */
.app { display: flex; min-height: 100vh; }

/* ─── Sidebar ────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--dark);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
}
.sidebar-logo {
  padding: 20px 20px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.sidebar-logo img { width: 160px; }
.sidebar-nav {
  flex: 1;
  padding: 16px 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.15) transparent;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 20px;
  color: rgba(255,255,255,0.6);
  border-radius: 0;
  font-weight: 500;
  transition: all 0.15s;
  border-left: 3px solid transparent;
}
.nav-item svg { width: 18px; height: 18px; fill: currentColor; flex-shrink: 0; }
.nav-item:hover { color: var(--white); background: rgba(255,255,255,0.06); }
.nav-item.active { color: var(--white); border-left-color: var(--primary); background: rgba(73,73,255,0.15); }
.nav-section-label {
  padding: 14px 20px 4px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255,255,255,0.3);
}
.nav-badge {
  margin-left: auto;
  background: var(--danger);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  border-radius: 10px;
  padding: 1px 6px;
  min-width: 18px;
  text-align: center;
}
.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid rgba(255,255,255,0.08);
}
.user-badge { color: rgba(255,255,255,0.7); font-size: 12px; margin-bottom: 8px; font-weight: 600; }
.btn-link { background: none; border: none; color: rgba(255,255,255,0.4); cursor: pointer; font-size: 12px; padding: 0; }
.btn-link:hover { color: var(--white); }

/* ─── Main ───────────────────────────────────────────────── */
.main { margin-left: var(--sidebar-w); flex: 1; display: flex; flex-direction: column; min-height: 100vh; }
.topbar {
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
  padding: 0 28px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  overflow: visible;
}
.topbar h1 { font-family: 'Noto Serif', serif; font-size: 20px; color: var(--dark); flex-shrink: 0; }
.topbar-actions { display: flex; gap: 10px; align-items: center; flex-shrink: 0; }
.content { padding: 28px; flex: 1; }

/* ─── Global Search ──────────────────────────────────────── */
.topbar-search { position: relative; flex: 1; max-width: 420px; margin: 0 20px; }
.topbar-search input {
  width: 100%;
  padding: 8px 14px 8px 36px;
  border: 1px solid var(--gray-200);
  border-radius: 20px;
  font-size: 13px;
  background: var(--gray-50) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='%2394A3B8'%3E%3Cpath d='M21 21l-4.35-4.35M17 11A6 6 0 1 1 5 11a6 6 0 0 1 12 0z' stroke='%2394A3B8' stroke-width='2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat 12px center;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.topbar-search input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(73,73,255,0.1);
  background-color: var(--white);
}
.search-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0; right: 0;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  z-index: 200;
  max-height: 480px;
  overflow-y: auto;
}
.search-section-label {
  padding: 8px 14px 4px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--gray-400);
  border-top: 1px solid var(--gray-200);
}
.search-section-label:first-child { border-top: none; }
.search-result-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 14px;
  cursor: pointer;
  transition: background 0.1s;
  font-size: 13px;
}
.search-result-item:hover { background: var(--gray-50); }
.search-result-item .sri-title { font-weight: 600; color: var(--dark); }
.search-result-item .sri-sub   { color: var(--gray-600); font-size: 12px; }
.search-no-results { padding: 16px 14px; color: var(--gray-400); font-size: 13px; text-align: center; }

/* ─── Cards ──────────────────────────────────────────────── */
.card {
  background: var(--white);
  border-radius: 10px;
  border: 1px solid var(--gray-200);
  padding: 24px;
}
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}
.card-title { font-weight: 700; font-size: 15px; color: var(--dark); }

/* ─── Stat Cards ─────────────────────────────────────────── */
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 24px; }
.stat-card {
  background: var(--white);
  border-radius: 10px;
  border: 1px solid var(--gray-200);
  padding: 20px 24px;
  display: flex;
  align-items: center;
  gap: 16px;
}
.stat-icon {
  width: 48px; height: 48px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.stat-icon svg { width: 22px; height: 22px; fill: var(--white); }
.stat-icon.blue  { background: var(--primary); }
.stat-icon.cyan  { background: var(--accent); }
.stat-icon.green { background: var(--success); }
.stat-icon.amber { background: var(--warning); }
.stat-value { font-size: 26px; font-weight: 700; color: var(--dark); line-height: 1; }
.stat-label { font-size: 12px; color: var(--gray-600); margin-top: 4px; font-weight: 500; }

/* ─── Buttons ────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 7px;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  border: none;
  transition: all 0.15s;
  white-space: nowrap;
}
.btn svg { width: 15px; height: 15px; fill: currentColor; }
.btn-primary { background: var(--primary); color: var(--white); }
.btn-primary:hover { background: var(--primary-dk); }
.btn-secondary { background: var(--gray-100); color: var(--dark); border: 1px solid var(--gray-200); }
.btn-secondary:hover { background: var(--gray-200); }
.btn-danger { background: var(--danger); color: var(--white); }
.btn-danger:hover { background: #DC2626; }
.btn-full { width: 100%; justify-content: center; padding: 11px 16px; font-size: 14px; }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-icon { padding: 6px; background: none; border: 1px solid var(--gray-200); color: var(--gray-600); }
.btn-icon:hover { background: var(--gray-100); color: var(--dark); }

/* ─── Forms ──────────────────────────────────────────────── */
.field { margin-bottom: 16px; }
.field label { display: block; font-weight: 600; font-size: 12px; color: var(--gray-600); margin-bottom: 6px; text-transform: uppercase; letter-spacing: 0.04em; }
.field input, .field select, .field textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--gray-200);
  border-radius: 7px;
  color: var(--dark);
  transition: border-color 0.15s;
  background: var(--white);
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(73,73,255,0.1);
}
.field textarea { resize: vertical; min-height: 80px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }

/* ─── Table ──────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
thead th {
  text-align: left;
  padding: 10px 14px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--gray-600);
  border-bottom: 2px solid var(--gray-200);
  background: var(--gray-50);
  white-space: nowrap;
}
tbody td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--gray-100);
  color: var(--dark);
  vertical-align: middle;
}
tbody tr:hover { background: var(--gray-50); }
tbody tr:last-child td { border-bottom: none; }
.td-primary { font-weight: 600; color: var(--dark); }
.td-sub { font-size: 12px; color: var(--gray-600); margin-top: 2px; }
.td-action { display: flex; gap: 6px; }

/* ─── Badges / Status ────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}
.badge-new         { background: #EEF2FF; color: #4338CA; }
.badge-contacted   { background: #E0F2FE; color: #0369A1; }
.badge-follow_up   { background: #FEF3C7; color: #92400E; }
.badge-qualified   { background: #D1FAE5; color: #065F46; }
.badge-unqualified { background: #F3F4F6; color: #6B7280; }
.badge-closed_won  { background: #D1FAE5; color: #065F46; }
.badge-closed_lost { background: #FEE2E2; color: #991B1B; }
.badge-admin   { background: #EEF2FF; color: var(--primary); }
.badge-manager { background: #E0F2FE; color: #0369A1; }
.badge-agent   { background: #F3F4F6; color: #374151; }

/* ─── Filter Bar ─────────────────────────────────────────── */
.filter-bar {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.filter-bar input, .filter-bar select {
  padding: 8px 12px;
  border: 1px solid var(--gray-200);
  border-radius: 7px;
  color: var(--dark);
  background: var(--white);
}
.filter-bar input:focus, .filter-bar select:focus { outline: none; border-color: var(--primary); }
.filter-bar input[type="text"] { min-width: 220px; }
.filter-spacer { flex: 1; }

/* ─── Pagination ─────────────────────────────────────────── */
.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 16px;
  border-top: 1px solid var(--gray-100);
  margin-top: 4px;
}
.pagination-info { font-size: 12px; color: var(--gray-600); }
.pagination-btns { display: flex; gap: 6px; }

/* ─── Lead Detail ────────────────────────────────────────── */
.lead-detail-grid {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 20px;
}
.detail-section { margin-bottom: 24px; }
.detail-section-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--gray-600);
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--gray-100);
}
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 20px; }
.detail-item label { font-size: 11px; font-weight: 600; color: var(--gray-400); text-transform: uppercase; }
.detail-item span { display: block; margin-top: 3px; font-weight: 500; }

/* ─── Activity Feed ──────────────────────────────────────── */
.activity-feed { display: flex; flex-direction: column; gap: 0; }
.activity-item {
  display: flex;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--gray-100);
  position: relative;
}
.activity-item:last-child { border-bottom: none; }
.activity-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--primary);
  margin-top: 5px;
  flex-shrink: 0;
}
.activity-dot.call  { background: var(--accent); }
.activity-dot.note  { background: var(--success); }
.activity-dot.email { background: var(--warning); }
.activity-content { flex: 1; }
.activity-summary { font-size: 13px; color: var(--dark); }
.activity-meta { font-size: 11px; color: var(--gray-400); margin-top: 2px; }

/* ─── Notes ──────────────────────────────────────────────── */
.note-item {
  background: var(--gray-50);
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 10px;
}
.note-text { font-size: 13px; color: var(--dark); line-height: 1.5; }
.note-meta { font-size: 11px; color: var(--gray-400); margin-top: 6px; }

/* ─── Modal ──────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal {
  background: var(--white);
  border-radius: 12px;
  width: 100%;
  max-width: 580px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 25px 60px rgba(0,0,0,0.2);
}
.modal-lg { max-width: 780px; }
.modal-header {
  padding: 20px 24px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}
.modal-header h3 { font-family: 'Noto Serif', serif; font-size: 18px; }
.modal-close { background: none; border: none; font-size: 22px; cursor: pointer; color: var(--gray-400); line-height: 1; padding: 0; }
.modal-close:hover { color: var(--dark); }
.modal-body { padding: 0 24px 24px; }
.modal-footer { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; }

/* ─── Alerts ─────────────────────────────────────────────── */
.alert { padding: 10px 14px; border-radius: 7px; font-size: 13px; margin-bottom: 16px; }
.alert-error { background: #FEE2E2; color: #991B1B; border: 1px solid #FECACA; }
.alert-success { background: #D1FAE5; color: #065F46; border: 1px solid #A7F3D0; }

/* ─── Setup Wizard ───────────────────────────────────────── */
.wizard-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.wizard-overlay.hidden { display: none !important; }
.wizard-card {
  background: var(--white);
  border-radius: 16px;
  width: 100%;
  max-width: 960px;
  height: 88vh;
  max-height: 780px;
  display: flex;
  overflow: hidden;
  box-shadow: 0 24px 80px rgba(0,0,0,0.3);
}
.wizard-sidebar {
  width: 260px;
  flex-shrink: 0;
  background: #0F172A;
  padding: 32px 0 24px;
  display: flex;
  flex-direction: column;
}
.wizard-sidebar-logo {
  padding: 0 24px 28px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  margin-bottom: 20px;
}
.wizard-sidebar-logo img { width: 140px; }
.wizard-step-nav {
  flex: 1;
  padding: 0 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.wizard-step-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s;
}
.wizard-step-item:hover { background: rgba(255,255,255,0.06); }
.wizard-step-item.active { background: rgba(73,73,255,0.25); }
.wizard-step-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.2);
  color: rgba(255,255,255,0.5);
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.2s;
}
.wizard-step-item.active .wizard-step-num {
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
}
.wizard-step-item.done .wizard-step-num {
  border-color: var(--success);
  background: var(--success);
  color: #fff;
}
.wizard-step-label {
  font-size: 13px;
  font-weight: 500;
  color: rgba(255,255,255,0.45);
  line-height: 1.3;
}
.wizard-step-item.active .wizard-step-label { color: #fff; }
.wizard-step-item.done  .wizard-step-label { color: rgba(255,255,255,0.7); }
.wizard-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.wizard-body {
  flex: 1;
  overflow-y: auto;
  padding: 40px 40px 24px;
}
.wizard-step-badge {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--primary);
  margin-bottom: 8px;
}
.wizard-body h2 {
  font-size: 22px;
  font-weight: 700;
  color: #0F172A;
  margin-bottom: 12px;
}
.wizard-body p {
  font-size: 14px;
  color: var(--gray-600);
  line-height: 1.7;
  margin-bottom: 16px;
}
.wizard-done-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #D1FAE5;
  color: #065F46;
  border: 1px solid #A7F3D0;
  border-radius: 20px;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 16px;
}
.wizard-checklist {
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: 10px;
  padding: 16px 20px;
  margin: 16px 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.wizard-check-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 13px;
  color: var(--gray-600);
  line-height: 1.5;
}
.wizard-check-item .wci { flex-shrink: 0; margin-top: 2px; }
.wizard-footer {
  padding: 20px 40px;
  border-top: 1px solid var(--gray-200);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--gray-50);
}
.wizard-progress-text {
  font-size: 12px;
  color: var(--gray-400);
  font-weight: 600;
}
.wizard-footer-btns { display: flex; gap: 10px; }
.wizard-card { position: relative; }
.wizard-close-btn {
  position: absolute;
  top: 14px;
  right: 16px;
  width: 32px;
  height: 32px;
  background: var(--gray-100);
  border: 1px solid var(--gray-200);
  border-radius: 50%;
  color: var(--gray-600);
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s;
  z-index: 10;
}
.wizard-close-btn:hover { background: var(--gray-200); color: var(--dark); }
.wizard-complete-icon {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: linear-gradient(135deg, #10B981, #059669);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 24px;
  box-shadow: 0 8px 24px rgba(16,185,129,0.3);
}

/* ─── Empty State ────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--gray-400);
}
.empty-state svg { width: 48px; height: 48px; fill: var(--gray-200); margin-bottom: 16px; }
.empty-state p { font-size: 15px; font-weight: 600; color: var(--gray-600); margin-bottom: 6px; }
.empty-state span { font-size: 13px; }

/* ─── Dashboard Charts ───────────────────────────────────── */
.dashboard-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.status-bar-list { display: flex; flex-direction: column; gap: 10px; }
.status-bar-item { display: flex; align-items: center; gap: 12px; }
.status-bar-label { width: 100px; font-size: 12px; font-weight: 600; color: var(--gray-600); text-transform: capitalize; }
.status-bar-track { flex: 1; height: 8px; background: var(--gray-100); border-radius: 4px; overflow: hidden; }
.status-bar-fill { height: 100%; border-radius: 4px; background: var(--primary); transition: width 0.4s; }
.status-bar-count { font-size: 12px; font-weight: 700; color: var(--dark); width: 30px; text-align: right; }

/* ─── Import Wizard ─────────────────────────────────────── */
.import-drop-zone {
  border: 2px dashed var(--gray-200);
  border-radius: 10px;
  padding: 40px 20px;
  text-align: center;
  color: var(--gray-400);
  transition: all 0.15s;
  cursor: default;
}
.import-drop-zone.drag-over { border-color: var(--primary); background: #f0f0ff; color: var(--primary); }
.import-drop-zone svg { width: 40px; height: 40px; fill: currentColor; margin-bottom: 12px; display: block; margin: 0 auto 12px; }
.import-drop-zone p { font-size: 15px; font-weight: 600; color: var(--dark); margin-bottom: 4px; }
.import-drop-zone span { font-size: 13px; }
.import-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}
.import-stat {
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  padding: 12px;
  text-align: center;
  font-size: 12px;
  font-weight: 600;
  color: var(--gray-600);
}
.import-stat.green { background: #D1FAE5; border-color: #A7F3D0; color: #065F46; }
.import-stat.amber { background: #FEF3C7; border-color: #FDE68A; color: #92400E; }
.import-stat.blue  { background: #EEF2FF; border-color: #C7D2FE; color: #3730A3; }
.import-stat.red   { background: #FEE2E2; border-color: #FECACA; color: #991B1B; }
.import-stat-val   { font-size: 24px; font-weight: 700; margin-bottom: 4px; }

/* ─── Column Picker ─────────────────────────────────────── */
.col-picker-dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  z-index: 100;
  min-width: 160px;
  padding: 8px 0;
}
.col-picker-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  color: var(--dark);
  white-space: nowrap;
}
.col-picker-item:hover { background: var(--gray-50); }
.col-picker-item input { accent-color: var(--primary); cursor: pointer; }

/* ─── Misc ───────────────────────────────────────────────── */
.divider { border: none; border-top: 1px solid var(--gray-100); margin: 20px 0; }
.text-muted { color: var(--gray-400); font-size: 12px; }
.text-primary { color: var(--primary); }
.fw-600 { font-weight: 600; }
.mt-12 { margin-top: 12px; }
.mt-20 { margin-top: 20px; }
.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--gray-600);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  margin-bottom: 20px;
}
.back-btn:hover { color: var(--primary); }
.back-btn svg { width: 16px; height: 16px; fill: currentColor; }
.loading { text-align: center; padding: 60px; color: var(--gray-400); font-weight: 500; }

/* ─── View Toggle ────────────────────────────────────────── */
.view-toggle { display: flex; gap: 2px; border: 1px solid var(--gray-200); border-radius: 7px; overflow: hidden; background: var(--gray-100); padding: 2px; }
.view-toggle .btn { border-radius: 5px; border: none; background: transparent; color: var(--gray-600); }
.view-toggle .btn:hover { background: var(--gray-200); color: var(--dark); }
.view-toggle .btn.vt-active { background: var(--white); color: var(--primary); box-shadow: 0 1px 3px rgba(0,0,0,0.08); }

/* ─── Kanban ─────────────────────────────────────────────── */
.kanban-board { display: flex; gap: 14px; overflow-x: auto; align-items: flex-start; padding-bottom: 20px; min-height: 60vh; }
.kanban-col { flex-shrink: 0; width: 260px; background: var(--gray-50); border-radius: 10px; border: 1px solid var(--gray-200); display: flex; flex-direction: column; }
.kanban-col-header { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; border-radius: 9px 9px 0 0; background: var(--white); border-bottom: 1px solid var(--gray-200); }
.kanban-col-name { font-weight: 700; font-size: 13px; color: var(--dark); }
.kanban-col-count { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 20px; }
.kanban-cards { padding: 10px; display: flex; flex-direction: column; gap: 8px; min-height: 60px; transition: background 0.15s; }
.kanban-cards.drag-over { background: #eef2ff; }
.kanban-card {
  background: var(--white);
  border-radius: 8px;
  border: 1px solid var(--gray-200);
  padding: 12px;
  cursor: pointer;
  transition: box-shadow 0.15s, transform 0.1s;
  user-select: none;
}
.kanban-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.1); transform: translateY(-1px); }
.kanban-card.dragging { opacity: 0.5; }
.kanban-card-name { font-weight: 600; font-size: 13px; color: var(--dark); margin-bottom: 4px; }
.kanban-card-contact { font-size: 12px; color: var(--gray-600); margin-bottom: 3px; }
.kanban-card-detail { font-size: 11px; color: var(--gray-400); margin-bottom: 2px; }
.kanban-card-assigned { font-size: 11px; color: var(--primary); margin-top: 6px; font-weight: 600; }

/* ─── Card View Grid ─────────────────────────────────────── */
.leads-cards-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.lead-card {
  background: var(--white);
  border-radius: 10px;
  border: 1px solid var(--gray-200);
  padding: 18px;
  cursor: pointer;
  transition: box-shadow 0.15s, transform 0.1s;
}
.lead-card:hover { box-shadow: 0 6px 20px rgba(0,0,0,0.1); transform: translateY(-2px); }
.lead-card-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.lead-card-name { font-weight: 700; font-size: 14px; color: var(--dark); line-height: 1.3; }
.lead-card-contact { font-size: 12px; color: var(--gray-600); margin-bottom: 4px; }
.lead-card-specialty { font-size: 11px; color: var(--gray-400); margin-bottom: 8px; }
.lead-card-meta { display: flex; flex-direction: column; gap: 3px; margin-bottom: 12px; }
.lead-card-meta span { font-size: 12px; color: var(--gray-600); }
.lead-card-footer { display: flex; align-items: center; justify-content: space-between; padding-top: 10px; border-top: 1px solid var(--gray-100); }

/* ─── Stage Pipeline ─────────────────────────────────────── */
.stage-pipeline-wrap { display: flex; align-items: center; gap: 8px; margin-bottom: 20px; flex-wrap: wrap; }
.stage-pipeline { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; flex: 1; }
.stage-step {
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  border: 1.5px solid var(--gray-200);
  color: var(--gray-600);
  background: var(--white);
  transition: all 0.15s;
  white-space: nowrap;
}
.stage-step:hover { border-color: var(--primary); color: var(--primary); }
.stage-step.stage-past { border-color: var(--gray-200); background: var(--gray-100); color: var(--gray-400); }
.stage-step.stage-active { color: #fff; font-weight: 700; border-color: transparent; }
.stage-sep { color: var(--gray-300); font-size: 14px; font-weight: 300; }

/* ─── Lead Detail v2 ─────────────────────────────────────── */
.lead-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.lead-header h1 { font-family: 'Noto Serif', serif; font-size: 22px; font-weight: 700; color: var(--dark); margin-bottom: 6px; }
.lead-header-sub { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 14px; color: var(--gray-600); }
.lead-header-sub .dot { color: var(--gray-300); }
.lead-2col { display: grid; grid-template-columns: 1fr 300px; gap: 20px; }
.lead-main { display: flex; flex-direction: column; }
.lead-sidebar { display: flex; flex-direction: column; }
.sidebar-field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; }
.sidebar-field label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--gray-400); }
.sidebar-field span { font-size: 13px; color: var(--dark); font-weight: 500; }
.sidebar-select { border: 1px solid var(--gray-200); border-radius: 6px; padding: 6px 10px; font-size: 13px; color: var(--dark); background: var(--white); width: 100%; }
.sidebar-select:focus { outline: none; border-color: var(--primary); }
.quick-stats { display: flex; gap: 0; border: 1px solid var(--gray-200); border-radius: 8px; overflow: hidden; }
.quick-stat { flex: 1; text-align: center; padding: 10px 8px; border-right: 1px solid var(--gray-200); }
.quick-stat:last-child { border-right: none; }
.quick-stat strong { display: block; font-size: 18px; font-weight: 700; color: var(--dark); }
.quick-stat span { font-size: 11px; color: var(--gray-400); font-weight: 600; }
.note-compose { display: flex; flex-direction: column; }
.note-compose textarea { width: 100%; border: 1px solid var(--gray-200); border-radius: 8px; padding: 10px 12px; font-size: 13px; resize: vertical; font-family: inherit; color: var(--dark); transition: border-color 0.15s; }
.note-compose textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(73,73,255,0.1); }

/* ─── New Status Badge ───────────────────────────────────── */
.badge-called { background: #EDE9FE; color: #5B21B6; }

/* ─── Sortable Table Headers ─────────────────────────────── */
.sortable-th { cursor: pointer; user-select: none; white-space: nowrap; }
.sortable-th:hover { color: var(--primary); }
.sortable-th.sort-active { color: var(--primary); }
.sort-ind { font-size: 10px; opacity: 0.5; margin-left: 2px; }
.sortable-th.sort-active .sort-ind { opacity: 1; }
tbody tr.row-selected td { background: #EEF2FF; }

/* ─── Bulk Action Bar ────────────────────────────────────── */
.bulk-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  margin-bottom: 12px;
  background: #EEF2FF;
  border: 1px solid #C7D2FE;
  border-radius: 8px;
  font-size: 13px;
  flex-wrap: wrap;
}
.bulk-bar.hidden { display: none; }
.bulk-select {
  padding: 5px 10px;
  border: 1px solid var(--gray-200);
  border-radius: 6px;
  font-size: 13px;
  color: var(--dark);
  background: var(--white);
}

/* ─── Modal XL ───────────────────────────────────────────── */
.modal-xl { max-width: 900px; width: 95vw; }

/* ─── Back Button ────────────────────────────────────────── */
.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--gray-600);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  margin-bottom: 16px;
  padding: 6px 0;
}
.back-btn:hover { color: var(--primary); }
.back-btn svg { width: 16px; height: 16px; fill: currentColor; }

/* ─── Tooltip (ℹ icon on buttons) ───────────────────────── */
.tip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: rgba(0,0,0,0.30);
  color: #fff;
  font-size: 10px;
  font-style: italic;
  font-weight: 700;
  cursor: help;
  margin-left: 5px;
  position: relative;
  vertical-align: middle;
  flex-shrink: 0;
  line-height: 1;
  user-select: none;
}
/* On secondary/light buttons, use a visible teal background */
.btn-secondary .tip, .btn-icon .tip {
  background: #4b9b8a;
  color: #fff;
}
.tip::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: #1f2937;
  color: #fff;
  padding: 7px 11px;
  border-radius: 7px;
  font-size: 11px;
  font-weight: 500;
  font-style: normal;
  white-space: normal;
  width: max-content;
  max-width: 220px;
  text-align: center;
  z-index: 9999;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s ease;
  box-shadow: 0 3px 10px rgba(0,0,0,0.25);
  line-height: 1.4;
}
.tip::before {
  content: '';
  position: absolute;
  bottom: calc(100% + 3px);
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: #1f2937;
  z-index: 9999;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s ease;
}
.tip:hover::after,
.tip:hover::before { opacity: 1; }


/* ─── Sandbox ────────────────────────────────────────────── */
.sandbox-wrap { padding: 4px 0; }
.sandbox-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.sandbox-tab {
  padding: 8px 18px;
  border: 1px solid #CBD5E1;
  border-radius: 8px;
  background: #fff;
  color: #475569;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s;
}
.sandbox-tab:hover { background: #F1F5FF; border-color: #4949FF; color: #4949FF; }
.sandbox-tab.active { background: #4949FF; border-color: #4949FF; color: #fff; }

.sandbox-panel { display: none; }
.sandbox-panel.active { display: block; }

.sandbox-grid {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 24px;
  align-items: start;
}
@media (max-width: 900px) {
  .sandbox-grid { grid-template-columns: 1fr; }
}
.sandbox-col-left, .sandbox-col-right {
  background: #fff;
  border: 1px solid #E2E8F0;
  border-radius: 10px;
  padding: 20px;
}
.sandbox-section-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: #64748B;
  margin-bottom: 8px;
}
.sbx-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: #64748B;
  margin-bottom: 4px;
}

/* Timeline */
.sbx-timeline { position: relative; padding-left: 20px; }
.sbx-timeline-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  position: relative;
}
.sbx-timeline-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #4949FF;
  border: 2px solid #fff;
  box-shadow: 0 0 0 2px #4949FF;
  flex-shrink: 0;
  margin-top: 3px;
  position: relative;
  z-index: 1;
}
.sbx-timeline-connector {
  width: 2px;
  height: 28px;
  background: #CBD5E1;
  margin-left: 6px;
}
.sbx-timeline-content { padding-bottom: 4px; }
.sbx-timeline-day {
  font-size: 11px;
  font-weight: 700;
  color: #4949FF;
  text-transform: uppercase;
  letter-spacing: .06em;
}
.sbx-timeline-subject {
  font-size: 14px;
  color: #1E293B;
  font-weight: 600;
  margin-top: 2px;
}

/* ─── Booking view ──────────────────────────────────────────── */
.booking-status-sel {
  font-size: 12px;
  padding: 3px 8px;
  border-radius: 6px;
  border: 1px solid var(--gray-200);
  background: #fff;
  cursor: pointer;
}
