/* ═══════════════════════════════════════════════════════ */
/* Components — Light Theme                               */
/* ═══════════════════════════════════════════════════════ */

/* ─── Cards ──────────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-normal);
}
.card:hover { box-shadow: var(--shadow-md); }
.card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1rem; }
.card-header h4 { font-size: 0.9375rem; font-weight: 600; }

/* Metric Card */
.metric-card {
  background: var(--bg-card); border: 1px solid var(--border-color);
  border-radius: var(--radius-lg); padding: 1.25rem;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-normal);
  position: relative; overflow: hidden;
  cursor: pointer;
}
.metric-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.metric-card::after {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, var(--accent-blue), var(--accent-purple));
  opacity: 0; transition: opacity var(--transition-fast);
}
.metric-card:hover::after { opacity: 1; }
.metric-icon { font-size: 1.75rem; margin-bottom: 0.5rem; }
.metric-value { font-size: 1.75rem; font-weight: 800; color: var(--text-primary); margin-bottom: 0.125rem; }
.metric-label { font-size: 0.75rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; font-weight: 500; }
.metric-trend { display: inline-flex; align-items: center; gap: 0.25rem; font-size: 0.75rem; font-weight: 500; margin-top: 0.375rem; padding: 2px 8px; border-radius: 20px; }
.metric-trend.up { color: var(--accent-emerald); background: rgba(16, 185, 129, 0.08); }
.metric-trend.down { color: var(--accent-rose); background: rgba(244, 63, 94, 0.08); }

/* ─── Buttons ────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.375rem;
  padding: 0.5rem 1rem; border-radius: var(--radius-md);
  font-weight: 500; font-size: 0.875rem;
  transition: all var(--transition-fast);
  border: 1px solid transparent; cursor: pointer;
  white-space: nowrap;
}
.btn-primary { background: var(--accent-blue); color: #fff; border-color: var(--accent-blue); }
.btn-primary:hover { background: var(--accent-blue-hover); border-color: var(--accent-blue-hover); box-shadow: 0 4px 12px rgba(79,70,229,0.25); transform: translateY(-1px); }
.btn-secondary { background: var(--bg-tertiary); color: var(--text-primary); border-color: var(--border-color); }
.btn-secondary:hover { background: var(--border-color); }
.btn-ghost { background: transparent; color: var(--text-secondary); }
.btn-ghost:hover { background: var(--bg-tertiary); color: var(--text-primary); }
.btn-danger { background: var(--accent-rose); color: #fff; border-color: var(--accent-rose); }
.btn-danger:hover { background: #e11d48; box-shadow: 0 4px 12px rgba(244,63,94,0.25); }
.btn-success { background: var(--accent-emerald); color: #fff; }
.btn-success:hover { background: #059669; }
.btn-sm { padding: 0.375rem 0.75rem; font-size: 0.8125rem; }
.btn-lg { padding: 0.75rem 1.5rem; font-size: 1rem; }
.btn-icon { width: 32px; height: 32px; padding: 0; border-radius: var(--radius-sm); }
.btn-danger-text { color: var(--accent-rose); }
.btn-danger-text:hover { background: rgba(244,63,94,0.08); }

/* ─── Avatar ─────────────────────────────────────────── */
.avatar {
  width: 40px; height: 40px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 700; font-size: 0.875rem; flex-shrink: 0;
}
.avatar-sm { width: 32px; height: 32px; font-size: 0.75rem; }
.avatar-lg { width: 56px; height: 56px; font-size: 1.25rem; }

/* ─── Badges ─────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; padding: 0.2rem 0.6rem;
  border-radius: 20px; font-size: 0.6875rem; font-weight: 600;
  white-space: nowrap; line-height: 1.4;
}
.badge-blue { background: rgba(79,70,229,0.1); color: var(--accent-blue); }
.badge-purple { background: rgba(139,92,246,0.1); color: var(--accent-purple); }
.badge-emerald { background: rgba(16,185,129,0.1); color: var(--accent-emerald); }
.badge-amber { background: rgba(245,158,11,0.1); color: #b45309; }
.badge-rose { background: rgba(244,63,94,0.1); color: var(--accent-rose); }
.badge-cyan { background: rgba(6,182,212,0.1); color: #0891b2; }
.badge-muted { background: var(--bg-tertiary); color: var(--text-muted); }

/* Status Badge */
.status-badge {
  display: inline-flex; align-items: center; gap: 0.375rem;
  padding: 0.25rem 0.75rem; border-radius: 20px;
  font-size: 0.75rem; font-weight: 500;
}
.status-dot { width: 7px; height: 7px; border-radius: 50%; }
.status-badge[data-status="not_contacted"] { background: rgba(100,116,139,0.1); color: #475569; }
.status-badge[data-status="not_contacted"] .status-dot { background: var(--status-not-contacted); }
.status-badge[data-status="contacted"] { background: rgba(59,130,246,0.1); color: #2563eb; }
.status-badge[data-status="contacted"] .status-dot { background: var(--status-contacted); }
.status-badge[data-status="replied"] { background: rgba(139,92,246,0.1); color: #7c3aed; }
.status-badge[data-status="replied"] .status-dot { background: var(--status-replied); }
.status-badge[data-status="interested"] { background: rgba(245,158,11,0.1); color: #b45309; }
.status-badge[data-status="interested"] .status-dot { background: var(--status-interested); }
.status-badge[data-status="converted"] { background: rgba(16,185,129,0.1); color: #059669; }
.status-badge[data-status="converted"] .status-dot { background: var(--status-converted); }
.status-badge[data-status="dead"] { background: rgba(239,68,68,0.1); color: #dc2626; }
.status-badge[data-status="dead"] .status-dot { background: var(--status-dead); }

/* Tag Pills */
.tag-pill {
  display: inline-flex; align-items: center; gap: 0.25rem;
  padding: 0.125rem 0.5rem; border-radius: 12px;
  font-size: 0.6875rem; font-weight: 500;
}
.tag-pill .tag-remove { cursor: pointer; opacity: 0.6; font-size: 0.625rem; }
.tag-pill .tag-remove:hover { opacity: 1; }
.tag-pill-more { font-size: 0.6875rem; color: var(--text-muted); padding: 0.125rem 0.375rem; }
.brand-new-badge {
  display: inline-flex; align-items: center; padding: 0.125rem 0.5rem;
  background: linear-gradient(90deg, rgba(79,70,229,0.12), rgba(139,92,246,0.12));
  color: var(--accent-blue); border-radius: 12px;
  font-size: 0.625rem; font-weight: 700; letter-spacing: 0.05em;
  animation: pulse 2s infinite;
}

/* ─── Data Table ─────────────────────────────────────── */
.data-table { width: 100%; border-collapse: collapse; font-size: 0.8125rem; }
.data-table thead { position: sticky; top: 0; z-index: 5; }
.data-table th {
  padding: 0.75rem 0.875rem; text-align: left;
  font-weight: 600; font-size: 0.75rem; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.05em;
  background: var(--bg-tertiary); border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
}
.data-table th.sortable { cursor: pointer; user-select: none; }
.data-table th.sortable:hover { color: var(--accent-blue); }
.data-table th .sort-arrow { font-size: 0.625rem; margin-left: 0.25rem; }
.data-table td { padding: 0.75rem 0.875rem; border-bottom: 1px solid var(--border-color); vertical-align: middle; }
.data-table tr:hover td { background: var(--accent-blue-light); }
.data-table tr:last-child td { border-bottom: none; }

/* ─── Checkbox ───────────────────────────────────────── */
.checkbox-custom {
  width: 16px; height: 16px; accent-color: var(--accent-blue);
  cursor: pointer; border-radius: 4px;
}

/* ─── Select ─────────────────────────────────────────── */
.select-custom {
  padding: 0.5rem 2rem 0.5rem 0.75rem;
  background: var(--bg-input); border: 1px solid var(--border-color);
  border-radius: var(--radius-sm); color: var(--text-primary);
  font-size: 0.8125rem; cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 8px center;
  transition: all var(--transition-fast);
}
.select-custom:focus { outline: none; border-color: var(--accent-blue); box-shadow: var(--shadow-glow); }

/* ─── Input Group ────────────────────────────────────── */
.input-group { margin-bottom: 1rem; display: flex; flex-direction: column; gap: 0.375rem; }
.input-group label { font-size: 0.8125rem; font-weight: 500; color: var(--text-secondary); }
.input-group input, .input-group select, .input-group textarea {
  padding: 0.625rem 0.875rem;
  background: var(--bg-input); border: 1px solid var(--border-color);
  border-radius: var(--radius-sm); color: var(--text-primary);
  font-size: 0.875rem; transition: all var(--transition-fast);
  width: 100%;
}
.input-group input:focus, .input-group select:focus, .input-group textarea:focus {
  outline: none; border-color: var(--accent-blue); box-shadow: var(--shadow-glow);
}
.input-group input::placeholder, .input-group textarea::placeholder { color: var(--text-muted); }
.input-group textarea { resize: vertical; min-height: 80px; }

/* ─── Filter Bar ─────────────────────────────────────── */
.filter-bar {
  display: flex; align-items: center; gap: 0.75rem;
  margin-bottom: 1.25rem; flex-wrap: wrap;
  padding: 0.75rem 1rem; background: var(--bg-card);
  border: 1px solid var(--border-color); border-radius: var(--radius-lg);
}

/* ─── Empty State ────────────────────────────────────── */
.empty-state { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 3rem; text-align: center; }
.empty-state-icon { font-size: 3rem; margin-bottom: 1rem; opacity: 0.5; }
.empty-state h3 { font-size: 1.125rem; margin-bottom: 0.5rem; }
.empty-state p { color: var(--text-muted); font-size: 0.875rem; }

/* ─── Modal ──────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0; z-index: 9999;
  background: rgba(15, 23, 42, 0.4); backdrop-filter: blur(4px);
  display: none; align-items: center; justify-content: center;
  padding: 1rem;
}
.modal-overlay.active { display: flex; animation: fadeIn 0.15s ease; }
.modal-container {
  background: var(--bg-secondary); border: 1px solid var(--border-color);
  border-radius: var(--radius-xl); box-shadow: var(--shadow-xl);
  max-width: 600px; width: 100%; max-height: 85vh; overflow-y: auto;
  animation: scaleIn 0.2s ease;
}
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 1.25rem 1.5rem; border-bottom: 1px solid var(--border-color); }
.modal-header h3 { font-size: 1.125rem; }
.modal-body { padding: 1.5rem; }
.modal-footer { display: flex; align-items: center; justify-content: flex-end; gap: 0.75rem; padding: 1rem 1.5rem; border-top: 1px solid var(--border-color); }

/* ─── Tabs ───────────────────────────────────────────── */
.tabs { display: flex; gap: 0; border-bottom: 2px solid var(--border-color); }
.tab-item {
  padding: 0.625rem 1.25rem; font-size: 0.875rem; font-weight: 500;
  color: var(--text-muted); cursor: pointer;
  transition: all var(--transition-fast);
  position: relative; border-bottom: 2px solid transparent; margin-bottom: -2px;
}
.tab-item:hover { color: var(--text-primary); }
.tab-item.active { color: var(--accent-blue); border-bottom-color: var(--accent-blue); font-weight: 600; }

/* ─── Progress Bar ───────────────────────────────────── */
.progress-bar {
  width: 100%; height: 8px; background: var(--bg-tertiary);
  border-radius: 10px; overflow: hidden;
}
.progress-bar-fill {
  height: 100%; border-radius: 10px;
  background: linear-gradient(90deg, var(--accent-blue), var(--accent-purple));
  transition: width 0.6s ease;
}

/* ─── Toast ──────────────────────────────────────────── */
.toast-container {
  position: fixed; top: 1rem; right: 1rem; z-index: 99999;
  display: flex; flex-direction: column; gap: 0.5rem;
}
.toast {
  display: flex; align-items: center; gap: 0.625rem;
  padding: 0.75rem 1rem; border-radius: var(--radius-md);
  font-size: 0.875rem; min-width: 280px; max-width: 420px;
  box-shadow: var(--shadow-lg);
  transform: translateX(100%); opacity: 0;
  transition: all 0.3s ease;
  background: var(--bg-secondary); border: 1px solid var(--border-color);
  color: var(--text-primary);
}
.toast.show { transform: translateX(0); opacity: 1; }
.toast-icon { font-size: 1.125rem; flex-shrink: 0; width: 28px; height: 28px; display: flex; align-items: center; justify-content: center; border-radius: 50%; }
.toast-message { flex: 1; }
.toast-success .toast-icon { background: rgba(16,185,129,0.1); color: var(--accent-emerald); }
.toast-error .toast-icon { background: rgba(244,63,94,0.1); color: var(--accent-rose); }
.toast-info .toast-icon { background: rgba(79,70,229,0.1); color: var(--accent-blue); }
.toast-warning .toast-icon { background: rgba(245,158,11,0.1); color: var(--accent-amber); }
.toast-success { border-left: 3px solid var(--accent-emerald); }
.toast-error { border-left: 3px solid var(--accent-rose); }
.toast-info { border-left: 3px solid var(--accent-blue); }
.toast-warning { border-left: 3px solid var(--accent-amber); }

/* ─── Confetti ───────────────────────────────────────── */
.confetti-canvas { position: fixed; top: 0; left: 0; width: 100%; height: 100%; pointer-events: none; z-index: 99999; }

/* ─── Loading Spinner ────────────────────────────────── */
.loading-spinner {
  width: 32px; height: 32px; border: 3px solid var(--border-color);
  border-top-color: var(--accent-blue);
  border-radius: 50%; animation: spin 0.7s linear infinite;
}

/* ─── Permissions Panel ──────────────────────────────── */
.permissions-panel { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--border-color); }
.permissions-panel h4 { font-size: 0.875rem; font-weight: 600; margin-bottom: 0.75rem; }
.permissions-section { margin-bottom: 1rem; }
.permissions-section h5 { font-size: 0.8125rem; color: var(--text-muted); margin-bottom: 0.5rem; text-transform: uppercase; letter-spacing: 0.05em; }
.permissions-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 0.5rem; }
.permission-item { display: flex; align-items: center; gap: 0.5rem; font-size: 0.8125rem; padding: 0.375rem 0.5rem; border-radius: var(--radius-sm); transition: background var(--transition-fast); }
.permission-item:hover { background: var(--bg-tertiary); }
.permission-item label { cursor: pointer; flex: 1; }
