/* ============================================================
   LeadForge — Design System & Dashboard Styles
   Colors: #121417 (primary bg), #1A1D21 (secondary bg)
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

/* ── CSS Variables ─────────────────────────────────────────── */
:root {
  --bg-primary:    #121417;
  --bg-secondary:  #1A1D21;
  --bg-card:       #1E2228;
  --bg-elevated:   #242830;
  --bg-hover:      #2A2F38;

  --accent-indigo:  #6C63FF;
  --accent-purple:  #8B5CF6;
  --accent-emerald: #10D981;
  --accent-amber:   #F59E0B;
  --accent-red:     #EF4444;
  --accent-blue:    #3B82F6;
  --accent-cyan:    #06B6D4;

  --grad-primary:  linear-gradient(135deg, #6C63FF 0%, #8B5CF6 100%);
  --grad-success:  linear-gradient(135deg, #10D981 0%, #059669 100%);
  --grad-danger:   linear-gradient(135deg, #EF4444 0%, #DC2626 100%);
  --grad-warning:  linear-gradient(135deg, #F59E0B 0%, #D97706 100%);
  --grad-info:     linear-gradient(135deg, #3B82F6 0%, #2563EB 100%);

  --text-primary:   #F1F3F5;
  --text-secondary: #8B949E;
  --text-muted:     #4B5563;

  --border:         rgba(255,255,255,0.07);
  --border-accent:  rgba(108,99,255,0.35);

  --shadow-sm:  0 1px 3px rgba(0,0,0,0.4);
  --shadow-md:  0 4px 16px rgba(0,0,0,0.5);
  --shadow-lg:  0 8px 32px rgba(0,0,0,0.6);
  --shadow-xl:  0 16px 48px rgba(0,0,0,0.7);
  --shadow-glow: 0 0 24px rgba(108,99,255,0.25);

  --radius-sm:  6px;
  --radius-md:  10px;
  --radius-lg:  14px;
  --radius-xl:  20px;
  --radius-2xl: 28px;

  --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

::selection { background: rgba(108,99,255,0.35); color: #fff; }

/* ── Scrollbar ─────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-secondary); }
::-webkit-scrollbar-thumb { background: var(--bg-elevated); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent-indigo); }

/* ── Typography ────────────────────────────────────────────── */
h1 { font-size: 2rem; font-weight: 800; line-height: 1.2; }
h2 { font-size: 1.5rem; font-weight: 700; line-height: 1.3; }
h3 { font-size: 1.125rem; font-weight: 600; }
h4 { font-size: 0.9375rem; font-weight: 600; }
p  { color: var(--text-secondary); }

a { color: var(--accent-indigo); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--accent-purple); }

/* ── Layout ────────────────────────────────────────────────── */
.container { max-width: 1440px; margin: 0 auto; padding: 0 24px; }

/* ── Header ────────────────────────────────────────────────── */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(18, 20, 23, 0.92);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  padding: 0 32px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.header-logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-icon {
  width: 36px;
  height: 36px;
  background: var(--grad-primary);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  box-shadow: var(--shadow-glow);
}

.logo-text {
  font-size: 1.25rem;
  font-weight: 800;
  background: var(--grad-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.logo-badge {
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-indigo);
  background: rgba(108,99,255,0.12);
  border: 1px solid rgba(108,99,255,0.3);
  padding: 2px 7px;
  border-radius: 99px;
}

.header-stats {
  display: flex;
  align-items: center;
  gap: 24px;
}

.header-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
}

.header-stat-value {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text-primary);
}

.header-stat-label {
  font-size: 0.6875rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

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

/* ── Buttons ───────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 18px;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 600;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  transition: all var(--transition);
  border: none;
  outline: none;
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary {
  background: var(--grad-primary);
  color: #fff;
  box-shadow: 0 4px 15px rgba(108,99,255,0.3);
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(108,99,255,0.45);
  color: #fff;
}
.btn-primary:active { transform: translateY(0); }

.btn-secondary {
  background: var(--bg-elevated);
  color: var(--text-primary);
  border: 1px solid var(--border);
}
.btn-secondary:hover { background: var(--bg-hover); border-color: rgba(255,255,255,0.15); color: var(--text-primary); }

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
}
.btn-ghost:hover { color: var(--text-primary); background: rgba(255,255,255,0.04); }

.btn-danger {
  background: rgba(239,68,68,0.15);
  color: var(--accent-red);
  border: 1px solid rgba(239,68,68,0.25);
}
.btn-danger:hover { background: rgba(239,68,68,0.25); }

.btn-sm { padding: 5px 12px; font-size: 0.8125rem; }
.btn-lg { padding: 12px 28px; font-size: 1rem; }
.btn-icon { padding: 8px; width: 36px; height: 36px; justify-content: center; }

/* ── Hero / Upload Area ────────────────────────────────────── */
.hero {
  padding: 48px 32px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.hero-title {
  font-size: 2.5rem;
  font-weight: 900;
  line-height: 1.15;
  margin-bottom: 12px;
}

.hero-title span {
  background: var(--grad-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-size: 1.0625rem;
  color: var(--text-secondary);
  max-width: 560px;
  margin-bottom: 36px;
}

/* ── Upload Zone ───────────────────────────────────────────── */
.upload-zone {
  width: 100%;
  max-width: 640px;
  border: 2px dashed rgba(108,99,255,0.35);
  border-radius: var(--radius-xl);
  padding: 40px 32px;
  text-align: center;
  background: rgba(108,99,255,0.04);
  cursor: pointer;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}

.upload-zone::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--grad-primary);
  opacity: 0;
  transition: opacity var(--transition);
  border-radius: inherit;
}

.upload-zone:hover, .upload-zone.drag-over {
  border-color: var(--accent-indigo);
  background: rgba(108,99,255,0.08);
  box-shadow: var(--shadow-glow);
}

.upload-zone:hover::before, .upload-zone.drag-over::before { opacity: 0.03; }

.upload-zone * { position: relative; z-index: 1; }

.upload-icon {
  font-size: 2.5rem;
  margin-bottom: 12px;
  animation: float 3s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

.upload-text {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.upload-hint {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-bottom: 20px;
}

.upload-formats {
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}

.format-badge {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 99px;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border);
  color: var(--text-secondary);
}

.upload-divider {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 20px 0;
  width: 100%;
  max-width: 640px;
  color: var(--text-muted);
  font-size: 0.875rem;
}
.upload-divider::before, .upload-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ── Analysis Progress ─────────────────────────────────────── */
.analysis-bar {
  display: none;
  width: 100%;
  max-width: 640px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  margin-top: 20px;
}
.analysis-bar.visible { display: block; }

.analysis-bar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.analysis-bar-label { font-size: 0.875rem; font-weight: 600; color: var(--text-primary); }
.analysis-bar-count { font-size: 0.8125rem; color: var(--accent-indigo); font-weight: 600; }

.progress-track {
  height: 6px;
  background: var(--bg-elevated);
  border-radius: 99px;
  overflow: hidden;
  margin-bottom: 8px;
}
.progress-fill {
  height: 100%;
  background: var(--grad-primary);
  border-radius: 99px;
  transition: width 0.3s ease;
  box-shadow: 0 0 10px rgba(108,99,255,0.5);
}

.analysis-status { font-size: 0.75rem; color: var(--text-muted); }

/* ── Toolbar (Filters + Search) ────────────────────────────── */
.toolbar {
  padding: 28px 32px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.search-wrap {
  position: relative;
  flex: 1;
  min-width: 240px;
  max-width: 380px;
}

.search-wrap .search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 0.875rem;
  pointer-events: none;
}

.search-input {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 9px 12px 9px 36px;
  font-size: 0.875rem;
  font-family: 'Inter', sans-serif;
  color: var(--text-primary);
  transition: all var(--transition);
  outline: none;
}
.search-input::placeholder { color: var(--text-muted); }
.search-input:focus { border-color: var(--accent-indigo); box-shadow: 0 0 0 3px rgba(108,99,255,0.15); }

.filter-group { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.filter-select {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 8px 32px 8px 12px;
  font-size: 0.875rem;
  font-family: 'Inter', sans-serif;
  color: var(--text-primary);
  cursor: pointer;
  outline: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='7' viewBox='0 0 12 7'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%234B5563' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  transition: border-color var(--transition);
}
.filter-select:focus { border-color: var(--accent-indigo); }

.filter-btn {
  padding: 8px 14px;
  border-radius: var(--radius-md);
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-secondary);
  transition: all var(--transition);
  font-family: 'Inter', sans-serif;
}
.filter-btn:hover, .filter-btn.active {
  background: rgba(108,99,255,0.15);
  border-color: var(--accent-indigo);
  color: var(--accent-indigo);
}

.toolbar-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }

.results-count {
  font-size: 0.875rem;
  color: var(--text-muted);
  padding: 8px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}
.results-count span { color: var(--text-primary); font-weight: 600; }

/* ── Leads Grid ────────────────────────────────────────────── */
.leads-section { padding: 0 32px 48px; }

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

/* ── Lead Card ─────────────────────────────────────────────── */
.lead-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 20px;
  cursor: pointer;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
  animation: cardAppear 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

@keyframes cardAppear {
  from { opacity: 0; transform: translateY(20px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.lead-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
}

.lead-card.priority-hot::before    { background: var(--grad-danger); }
.lead-card.priority-warm::before   { background: var(--grad-warning); }
.lead-card.priority-cold::before   { background: var(--grad-info); }

.lead-card:hover {
  transform: translateY(-3px);
  border-color: rgba(108,99,255,0.35);
  box-shadow: var(--shadow-lg), var(--shadow-glow);
}

/* Card Header */
.card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 14px;
}

.card-company {
  display: flex;
  align-items: center;
  gap: 12px;
}

.company-avatar {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.125rem;
  font-weight: 800;
  flex-shrink: 0;
}

.avatar-hot    { background: rgba(239,68,68,0.15);  color: var(--accent-red); }
.avatar-warm   { background: rgba(245,158,11,0.15); color: var(--accent-amber); }
.avatar-cold   { background: rgba(59,130,246,0.15); color: var(--accent-blue); }

.company-info { flex: 1; min-width: 0; }

.company-name {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 3px;
}

.company-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.company-meta-dot { width: 3px; height: 3px; border-radius: 50%; background: var(--text-muted); }

/* Priority Badge */
.priority-badge {
  padding: 4px 10px;
  border-radius: 99px;
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  flex-shrink: 0;
}

.badge-hot    { background: rgba(239,68,68,0.15);  color: var(--accent-red);   border: 1px solid rgba(239,68,68,0.25); }
.badge-warm   { background: rgba(245,158,11,0.15); color: var(--accent-amber); border: 1px solid rgba(245,158,11,0.25); }
.badge-cold   { background: rgba(59,130,246,0.15); color: var(--accent-blue);  border: 1px solid rgba(59,130,246,0.25); }
.badge-success { background: rgba(16,217,129,0.12); color: var(--accent-emerald); border: 1px solid rgba(16,217,129,0.25); }
.badge-neutral { background: rgba(255,255,255,0.06); color: var(--text-secondary); border: 1px solid var(--border); }

/* Card Score Bar */
.score-section { margin-bottom: 14px; }

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

.score-label { font-size: 0.75rem; color: var(--text-muted); font-weight: 500; }

.score-value {
  font-size: 0.875rem;
  font-weight: 700;
}
.score-high  { color: var(--accent-emerald); }
.score-med   { color: var(--accent-amber); }
.score-low   { color: var(--accent-blue); }

.score-bar {
  height: 5px;
  background: var(--bg-elevated);
  border-radius: 99px;
  overflow: hidden;
}
.score-fill {
  height: 100%;
  border-radius: 99px;
  transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
}
.fill-high  { background: var(--grad-success); }
.fill-med   { background: var(--grad-warning); }
.fill-low   { background: var(--grad-info); }

/* Problems list */
.card-problems { margin-bottom: 14px; }

.problems-title {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 8px;
}

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

.problem-tag {
  font-size: 0.6875rem;
  font-weight: 500;
  padding: 3px 8px;
  border-radius: 99px;
  display: flex;
  align-items: center;
  gap: 4px;
}
.tag-critical { background: rgba(239,68,68,0.12);  color: #F87171; border: 1px solid rgba(239,68,68,0.2); }
.tag-warning  { background: rgba(245,158,11,0.12); color: #FCD34D; border: 1px solid rgba(245,158,11,0.2); }
.tag-info     { background: rgba(59,130,246,0.12); color: #93C5FD; border: 1px solid rgba(59,130,246,0.2); }

/* Card Metrics */
.card-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 16px;
}

.metric-item {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 10px;
  text-align: center;
}
.metric-value {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 2px;
}
.metric-label {
  font-size: 0.625rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Card Footer */
.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.card-contact {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  color: var(--text-muted);
}

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

.icon-btn {
  width: 30px;
  height: 30px;
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition);
  font-size: 0.75rem;
  color: var(--text-muted);
}
.icon-btn:hover { background: rgba(108,99,255,0.15); border-color: var(--accent-indigo); color: var(--accent-indigo); }

/* ── Empty State ───────────────────────────────────────────── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 32px;
  text-align: center;
}

.empty-icon { font-size: 4rem; margin-bottom: 16px; opacity: 0.4; }
.empty-title { font-size: 1.25rem; font-weight: 700; margin-bottom: 8px; }
.empty-desc { color: var(--text-muted); font-size: 0.9375rem; }

/* ── Skeleton Loader ───────────────────────────────────────── */
.skeleton {
  background: linear-gradient(90deg,
    var(--bg-elevated) 25%,
    var(--bg-hover) 50%,
    var(--bg-elevated) 75%
  );
  background-size: 400% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
}

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

.skeleton-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 20px;
  animation: cardAppear 0.4s ease both;
}

.sk-h { height: 14px; margin-bottom: 8px; }
.sk-avatar { width: 44px; height: 44px; border-radius: var(--radius-md); flex-shrink: 0; }
.sk-line { height: 10px; }

/* ── Notification Toast ────────────────────────────────────── */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px 18px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-primary);
  box-shadow: var(--shadow-xl);
  display: flex;
  align-items: center;
  gap: 10px;
  animation: toastIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) both;
  max-width: 340px;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateX(20px) scale(0.95); }
  to   { opacity: 1; transform: translateX(0) scale(1); }
}

.toast.fadeout { animation: toastOut 0.3s ease forwards; }
@keyframes toastOut {
  to { opacity: 0; transform: translateX(20px) scale(0.95); }
}

.toast-icon { font-size: 1.125rem; flex-shrink: 0; }
.toast-success .toast-icon { color: var(--accent-emerald); }
.toast-error .toast-icon   { color: var(--accent-red); }
.toast-info .toast-icon    { color: var(--accent-indigo); }

/* ── Modal ─────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition);
}
.modal-overlay.open { opacity: 1; visibility: visible; }

.modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-2xl);
  padding: 32px;
  max-width: 500px;
  width: 90%;
  transform: scale(0.95) translateY(20px);
  transition: transform var(--transition);
  box-shadow: var(--shadow-xl);
}
.modal-overlay.open .modal { transform: scale(1) translateY(0); }

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 20px;
}
.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1.25rem;
  padding: 4px;
  line-height: 1;
  transition: color var(--transition);
}
.modal-close:hover { color: var(--text-primary); }

/* ── Utility classes ───────────────────────────────────────── */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }
.text-sm  { font-size: 0.875rem; }
.text-xs  { font-size: 0.75rem; }
.text-muted { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }
.hidden { display: none !important; }
.w-full { width: 100%; }

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 768px) {
  .header { padding: 0 16px; }
  .header-stats { display: none; }
  .hero { padding: 32px 16px 0; }
  .hero-title { font-size: 1.75rem; }
  .toolbar { padding: 20px 16px 12px; }
  .leads-section { padding: 0 16px 32px; }
  .leads-grid { grid-template-columns: 1fr; }
}

/* ── Header Target Links ────────────────────────────────────── */
.header-links {
  display: flex;
  align-items: center;
  gap: 8px;
}
.header-link-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--radius-md);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text-primary);
  font-size: 0.8125rem;
  font-weight: 500;
  transition: all var(--transition);
}
.header-link-btn:hover {
  background: var(--bg-hover);
  border-color: var(--accent-indigo);
  color: #fff;
  transform: translateY(-1px);
}

/* ── Dashboard Section ──────────────────────────────────────── */
.dashboard-section {
  padding: 20px 32px 0;
}
.dashboard-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  flex-wrap: wrap;
  gap: 12px;
}
.dashboard-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text-primary);
}
.dashboard-kpis {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.kpi-chip {
  background: var(--bg-card);
  border: 1px solid var(--border);
  padding: 6px 14px;
  border-radius: var(--radius-md);
  font-size: 0.8125rem;
  display: flex;
  align-items: center;
  gap: 6px;
}
.dashboard-statuses-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 10px;
}
.dash-status-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left-width: 4px;
  border-radius: var(--radius-md);
  padding: 10px 14px;
  cursor: pointer;
  transition: all var(--transition);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
}
.dash-status-card:hover {
  background: var(--bg-elevated);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.dash-status-card.active {
  background: var(--bg-elevated);
  border-color: var(--accent-indigo);
  box-shadow: var(--shadow-glow);
}
.dash-status-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 6px;
}
.dash-status-icon {
  font-size: 0.9375rem;
}
.dash-status-name {
  font-size: 0.78125rem;
  font-weight: 600;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}
.dash-new-tab-btn {
  font-size: 0.75rem;
  opacity: 0.6;
  padding: 2px 4px;
  border-radius: 4px;
  transition: opacity var(--transition);
}
.dash-new-tab-btn:hover {
  opacity: 1;
  background: rgba(255,255,255,0.1);
}
.dash-status-count {
  font-size: 1.35rem;
  font-weight: 800;
  line-height: 1;
}

/* ── Ratings & Director Cards ────────────────────────────────── */
.lead-card.is-top-client {
  border-color: rgba(239, 68, 68, 0.45);
  box-shadow: 0 0 16px rgba(239, 68, 68, 0.15);
}

.rating-btn {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 3px 8px;
  font-size: 0.75rem;
  color: var(--text-primary);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all var(--transition);
}
.rating-btn:hover {
  background: var(--bg-hover);
  border-color: var(--accent-amber);
}

.director-banner {
  background: rgba(108, 99, 255, 0.08);
  border-left: 3px solid var(--accent-indigo);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  margin: 10px 0 6px;
  font-size: 0.8125rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}
.db-phone {
  font-weight: 600;
  color: var(--accent-emerald);
}

.client-speech-box {
  background: rgba(245, 158, 11, 0.08);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  margin-bottom: 8px;
  font-size: 0.8125rem;
  color: var(--text-primary);
  font-style: italic;
}
.cs-label {
  font-weight: 700;
  font-style: normal;
  color: var(--accent-amber);
}

.next-contact-badge {
  background: rgba(59, 130, 246, 0.1);
  border: 1px dashed rgba(59, 130, 246, 0.4);
  border-radius: var(--radius-sm);
  padding: 4px 8px;
  font-size: 0.75rem;
  color: var(--accent-blue);
  margin-bottom: 8px;
}

.social-chip {
  background: rgba(16, 217, 129, 0.15);
  color: var(--accent-emerald);
  border: 1px solid rgba(16, 217, 129, 0.3);
  font-size: 0.6875rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
}

/* ── Modal Dialog Styles ────────────────────────────────────── */
.modal-overlay:not(.hidden) {
  display: flex !important;
  opacity: 1;
  visibility: visible;
}
.modal-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  width: 90%;
  max-width: 600px;
  padding: 24px;
  box-shadow: var(--shadow-xl);
  max-height: 90vh;
  overflow-y: auto;
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.modal-title {
  font-size: 1.15rem;
  font-weight: 700;

  color: var(--text-primary);
}
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
@media (max-width: 600px) {
  .form-grid { grid-template-columns: 1fr; }
}
.form-group {
  margin-bottom: 14px;
}
.form-label {
  display: block;
  font-size: 0.78125rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}
.form-control {
  width: 100%;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 8px 12px;
  color: var(--text-primary);
  font-size: 0.875rem;
  font-family: inherit;
  transition: border-color var(--transition);
}
.form-control:focus {
  outline: none;
  border-color: var(--accent-indigo);
}
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 20px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

