/* XALVEN ELITE — tema oscuro inspirado en XALVEN.app
 * Outfit (Google Fonts). Mobile-first responsive. */

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

:root {
  --bg: #000;
  --bg-elev: #0a0a0a;
  --bg-card: #111;
  --border: #1f1f1f;
  --border-strong: #2a2a2a;
  --text: #e5e5e5;
  --text-dim: #888;
  --text-muted: #555;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --info: #3b82f6;
}

html, body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

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

button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
}

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

.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-elev);
}
.header h1 { font-size: 18px; font-weight: 600; letter-spacing: -0.01em; }
.header h1 a { color: var(--text); }
.header .nav { display: flex; gap: 20px; align-items: center; font-size: 14px; color: var(--text-dim); }
.header .nav a { color: var(--text-dim); }
.header .nav a:hover { color: var(--text); }

.breadcrumb { color: var(--text-dim); font-size: 13px; margin-bottom: 16px; }
.breadcrumb a { color: var(--text-dim); }
.breadcrumb a:hover { color: var(--text); }

/* Login */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.login-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 40px;
  width: 100%;
  max-width: 380px;
}
.login-card h1 { font-size: 22px; margin-bottom: 4px; letter-spacing: -0.01em; }
.login-card .subtitle { color: var(--text-dim); font-size: 14px; margin-bottom: 28px; }

.field { margin-bottom: 16px; }
.field label {
  display: block;
  font-size: 12px;
  color: var(--text-dim);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.field input {
  width: 100%;
  background: var(--bg-elev);
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  padding: 10px 12px;
  color: var(--text);
  outline: none;
}
.field input:focus { border-color: var(--accent); }

.btn {
  display: inline-block;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 6px;
  padding: 10px 18px;
  cursor: pointer;
  font-weight: 500;
  transition: background 0.15s;
}
.btn:hover { background: var(--accent-hover); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn.btn-block { display: block; width: 100%; }
.btn.btn-secondary { background: transparent; border: 1px solid var(--border-strong); color: var(--text); }
.btn.btn-secondary:hover { border-color: var(--text-dim); background: var(--bg-elev); }
.btn.btn-sm { padding: 6px 12px; font-size: 13px; }

.error {
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: var(--danger);
  padding: 10px 14px;
  border-radius: 6px;
  font-size: 13px;
  margin-bottom: 16px;
}

/* Cards */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px;
  cursor: pointer;
  transition: border-color 0.15s, transform 0.15s;
}
.card:hover { border-color: var(--accent); }
.card.card-static { cursor: default; }
.card.card-static:hover { border-color: var(--border); }

.card h3 {
  font-size: 16px;
  margin-bottom: 4px;
  letter-spacing: -0.01em;
}
.card .meta {
  font-size: 12px;
  color: var(--text-dim);
  margin-bottom: 14px;
}

/* Stats */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
  gap: 12px;
  margin-top: 12px;
}
.stat {
  display: flex;
  flex-direction: column;
}
.stat .stat-value {
  font-size: 20px;
  font-weight: 600;
  color: var(--text);
}
.stat .stat-label {
  font-size: 11px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* Tables */
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.table th, .table td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
}
.table th {
  font-size: 11px;
  color: var(--text-dim);
  text-transform: uppercase;
  font-weight: 500;
  letter-spacing: 0.04em;
}
.table tr { transition: background 0.1s; }
.table tr:hover td { background: var(--bg-elev); cursor: pointer; }

/* Badges / pills */
.pill {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.pill-active   { background: rgba(16, 185, 129, 0.12); color: #10b981; }
.pill-paused   { background: rgba(245, 158, 11, 0.12); color: #f59e0b; }
.pill-draft    { background: rgba(139, 139, 139, 0.12); color: var(--text-dim); }
.pill-completed{ background: rgba(99, 102, 241, 0.12); color: #818cf8; }
.pill-cancelled{ background: rgba(239, 68, 68, 0.12); color: var(--danger); }
.pill-archived { background: rgba(99, 102, 241, 0.10); color: #6366f1; }
.pill-pending  { background: rgba(245, 158, 11, 0.10); color: #f59e0b; }
.pill-contacted{ background: rgba(59, 130, 246, 0.12); color: var(--info); }
.pill-engaged  { background: rgba(168, 85, 247, 0.12); color: #a855f7; }
.pill-replied  { background: rgba(16, 185, 129, 0.18); color: var(--success); font-weight: 600; }
.pill-bounced  { background: rgba(239, 68, 68, 0.14); color: var(--danger); }
.pill-unsubscribed,
.pill-blacklisted { background: rgba(127, 127, 127, 0.14); color: var(--text-muted); }
.pill-call_candidate { background: rgba(249, 115, 22, 0.14); color: #f97316; }
.pill-meeting_scheduled { background: rgba(16, 185, 129, 0.18); color: var(--success); font-weight: 600; }
.pill-converted { background: rgba(16, 185, 129, 0.25); color: #34d399; font-weight: 700; }

/* Funnel */
.funnel {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 24px;
}
.funnel-step {
  display: flex;
  align-items: center;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px 18px;
  position: relative;
  overflow: hidden;
}
.funnel-step .funnel-bar {
  position: absolute;
  top: 0; left: 0; bottom: 0;
  background: rgba(37, 99, 235, 0.12);
  z-index: 0;
}
.funnel-step .funnel-content {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  width: 100%;
  align-items: center;
}
.funnel-step .funnel-label { font-size: 14px; color: var(--text); }
.funnel-step .funnel-count { font-size: 18px; font-weight: 600; }
.funnel-step .funnel-pct { font-size: 12px; color: var(--text-dim); margin-left: 8px; }

/* Timeline */
.timeline {
  list-style: none;
  position: relative;
  padding-left: 24px;
  border-left: 1px solid var(--border-strong);
}
.timeline li {
  position: relative;
  padding: 12px 0;
}
.timeline li::before {
  content: '';
  position: absolute;
  left: -28px;
  top: 18px;
  width: 8px;
  height: 8px;
  background: var(--accent);
  border-radius: 50%;
}
.timeline .ts { font-size: 12px; color: var(--text-dim); }
.timeline .event-title { font-size: 14px; font-weight: 500; margin-top: 2px; }
.timeline .event-detail { font-size: 13px; color: var(--text-dim); margin-top: 4px; }

/* Section title */
.section-title {
  font-size: 18px;
  font-weight: 600;
  margin: 28px 0 14px;
  letter-spacing: -0.01em;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Empty state */
.empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-dim);
  border: 1px dashed var(--border-strong);
  border-radius: 8px;
}

/* Modal */
.modal-bg {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}
.modal {
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  padding: 28px;
  max-width: 520px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
}
.modal h2 { font-size: 18px; margin-bottom: 16px; }
.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 20px;
}

/* Loader */
.loader { color: var(--text-dim); padding: 40px; text-align: center; }

/* Responsive */
@media (max-width: 640px) {
  .container { padding: 16px; }
  .grid { grid-template-columns: 1fr; }
  .header { padding: 14px 16px; }
  .header h1 { font-size: 16px; }
}
