/* =========================================================
   LeadPortero — Sistema de Diseño Principal
   ========================================================= */

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

/* ── Tokens ─────────────────────────────────────── */
:root {
  /* Paleta */
  --clr-primary: #D4AF37; /* Dorado Principal */
  --clr-primary-dark: #B08D26;
  --clr-primary-light: #F1D279;
  --clr-accent: #FFD700; /* Oro Brillante */
  --clr-accent-dark: #EAB308;
  --clr-danger: #FF4757;
  --clr-warning: #F1C40F;
  --clr-info: #3498DB;

  /* Fondos */
  --clr-bg: #000000; /* Negro Puro */
  --clr-bg-2: #0A0A0A;
  --clr-bg-3: #141414;
  --clr-surface: #181818;
  --clr-surface-2: #222222;

  /* Bordes */
  --clr-border: rgba(212,175,55,0.15); /* Bordes dorados sutiles */
  --clr-border-strong: rgba(212,175,55,0.3);

  /* Texto */
  --clr-text: #FFFFFF;
  --clr-text-muted: #A0A0A0;
  --clr-text-subtle: #666666;

  /* Gradientes */
  --gradient-primary: linear-gradient(135deg, #D4AF37 0%, #FFD700 100%);
  --gradient-accent: linear-gradient(135deg, #FFD700 0%, #EAB308 100%);
  --gradient-hero: radial-gradient(circle at top, #1A1A1A 0%, #000000 100%);

  /* Espaciado */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;
  --space-3xl: 64px;

  /* Radios */
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  /* Sombras */
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.5);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.6);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.8);
  --shadow-glow: 0 0 24px rgba(212,175,55,0.2);
  --shadow-glow-accent: 0 0 24px rgba(255,215,0,0.25);

  /* Transiciones */
  --transition: 0.2s ease;
  --transition-slow: 0.4s ease;

  /* Tipografía */
  --font: 'Outfit', sans-serif;
}

/* ── Reset ───────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--clr-bg);
  color: var(--clr-text);
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { text-decoration: none; color: inherit; }
img { max-width: 100%; }
input, textarea, select, button { font-family: var(--font); }

/* ── Botones ─────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: 12px 24px;
  border-radius: var(--radius-full);
  border: none;
  cursor: pointer;
  font-size: 15px;
  font-weight: 600;
  transition: all var(--transition);
  white-space: nowrap;
  text-decoration: none;
}
.btn:active { transform: scale(0.97); }

.btn-primary {
  background: var(--gradient-primary);
  color: #fff;
  box-shadow: var(--shadow-glow);
}
.btn-primary:hover {
  box-shadow: 0 0 32px rgba(0,200,150,0.45);
  transform: translateY(-1px);
}

.btn-accent {
  background: var(--gradient-accent);
  color: #000;
  box-shadow: var(--shadow-glow-accent);
}
.btn-accent:hover {
  box-shadow: 0 0 32px rgba(255,184,0,0.5);
  transform: translateY(-1px);
}

.btn-outline {
  background: transparent;
  border: 1.5px solid var(--clr-border-strong);
  color: var(--clr-text);
}
.btn-outline:hover {
  border-color: var(--clr-primary);
  color: var(--clr-primary);
  background: rgba(0,200,150,0.06);
}

.btn-ghost {
  background: transparent;
  color: var(--clr-text-muted);
}
.btn-ghost:hover { color: var(--clr-text); background: var(--clr-surface); }

.btn-danger {
  background: var(--clr-danger);
  color: #fff;
}
.btn-danger:hover { background: #e03040; transform: translateY(-1px); }

.btn-sm { padding: 8px 16px; font-size: 13px; }
.btn-lg { padding: 16px 32px; font-size: 17px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none !important; }

/* ── Inputs ──────────────────────────────────────── */
.form-group { display: flex; flex-direction: column; gap: var(--space-xs); }
.form-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--clr-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.form-input, .form-select, .form-textarea {
  background: var(--clr-surface);
  border: 1.5px solid var(--clr-border);
  border-radius: var(--radius-md);
  color: var(--clr-text);
  padding: 12px 16px;
  font-size: 15px;
  transition: border-color var(--transition), box-shadow var(--transition);
  width: 100%;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none;
  border-color: var(--clr-primary);
  box-shadow: 0 0 0 3px rgba(0,200,150,0.15);
}
.form-input::placeholder, .form-textarea::placeholder { color: var(--clr-text-subtle); }
.form-select { appearance: none; cursor: pointer; }
.form-textarea { resize: vertical; min-height: 80px; }
.form-hint { font-size: 12px; color: var(--clr-text-subtle); }
.form-error { font-size: 12px; color: var(--clr-danger); display: none; }
.form-group.has-error .form-input { border-color: var(--clr-danger); }
.form-group.has-error .form-error { display: block; }

/* ── Cards ───────────────────────────────────────── */
.card {
  background: var(--clr-surface);
  border: 1px solid var(--clr-border);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
}
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-md);
}
.card-title { font-size: 16px; font-weight: 700; }
.card-subtitle { font-size: 13px; color: var(--clr-text-muted); margin-top: 2px; }

/* ── Badges ──────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 600;
}
.badge-pending { background: rgba(255,184,0,0.15); color: var(--clr-accent); }
.badge-verified { background: rgba(0,200,150,0.15); color: var(--clr-primary); }
.badge-closed { background: rgba(52,152,219,0.15); color: var(--clr-info); }
.badge-rejected { background: rgba(255,71,87,0.15); color: var(--clr-danger); }

/* ── Navbar ──────────────────────────────────────── */
.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-md) var(--space-xl);
  background: rgba(13,17,23,0.8);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--clr-border);
  position: sticky;
  top: 0;
  z-index: 100;
}
.navbar-brand {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-weight: 700;
  font-size: 18px;
}
.navbar-brand .brand-icon { font-size: 22px; }
.navbar-brand .brand-text { color: var(--clr-primary); }
.navbar-actions { display: flex; align-items: center; gap: var(--space-sm); }
.navbar-user {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: 14px;
  color: var(--clr-text-muted);
}
.navbar-user .avatar {
  width: 34px; height: 34px;
  background: var(--gradient-primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
  color: #fff;
}

/* ── Layout / Main ───────────────────────────────── */
.page-container {
  max-width: 960px;
  margin: 0 auto;
  padding: var(--space-xl) var(--space-lg);
}
.page-header {
  margin-bottom: var(--space-xl);
}
.page-title { font-size: 26px; font-weight: 800; }
.page-subtitle { color: var(--clr-text-muted); margin-top: 4px; }

/* ── Splash page ─────────────────────────────────── */
.splash-page {
  background: var(--gradient-hero);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
}
.splash-container {
  text-align: center;
  padding: var(--space-xl);
  max-width: 480px;
  width: 100%;
}
.splash-logo {
  margin-bottom: var(--space-3xl);
  animation: fadeInDown 0.6s ease;
}
.logo-icon {
  font-size: 72px;
  margin-bottom: var(--space-md);
  filter: drop-shadow(0 0 24px rgba(0,200,150,0.5));
}
.splash-logo h1 {
  font-size: 42px;
  font-weight: 800;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.tagline {
  color: var(--clr-text-muted);
  font-size: 18px;
  margin-top: var(--space-sm);
  font-weight: 300;
  letter-spacing: 0.5px;
}
.splash-actions {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  animation: fadeInUp 0.6s 0.2s ease both;
}
.admin-link {
  font-size: 13px;
  margin-top: var(--space-sm);
  color: var(--clr-text-subtle);
}

/* ── Stats Cards ─────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: var(--space-md);
  margin-bottom: var(--space-xl);
}
.stat-card {
  background: var(--clr-surface);
  border: 1px solid var(--clr-border);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  text-align: center;
  transition: all var(--transition);
}
.stat-card:hover { border-color: var(--clr-primary); transform: translateY(-2px); }
.stat-card.accent:hover { border-color: var(--clr-accent); }
.stat-icon { font-size: 28px; margin-bottom: var(--space-sm); }
.stat-value {
  font-size: 28px;
  font-weight: 800;
  color: var(--clr-primary);
}
.stat-card.accent .stat-value { color: var(--clr-accent); }
.stat-label { font-size: 12px; color: var(--clr-text-muted); margin-top: 2px; }

/* ── Table ───────────────────────────────────────── */
.table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--clr-border);
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
thead { background: var(--clr-surface-2); }
thead th {
  padding: 12px 16px;
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--clr-text-muted);
  border-bottom: 1px solid var(--clr-border);
}
tbody tr {
  border-bottom: 1px solid var(--clr-border);
  transition: background var(--transition);
}
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: var(--clr-surface); }
tbody td {
  padding: 14px 16px;
  color: var(--clr-text);
  vertical-align: middle;
}

/* ── Formulario de auth ──────────────────────────── */
.auth-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: var(--space-lg);
}
.auth-card {
  background: var(--clr-surface);
  border: 1px solid var(--clr-border);
  border-radius: var(--radius-xl);
  padding: var(--space-2xl);
  width: 100%;
  max-width: 440px;
  animation: fadeInUp 0.5s ease;
}
.auth-logo {
  text-align: center;
  margin-bottom: var(--space-xl);
}
.auth-logo .logo-icon { font-size: 48px; }
.auth-logo h2 { font-size: 22px; font-weight: 800; margin-top: var(--space-sm); }
.auth-logo p { color: var(--clr-text-muted); font-size: 14px; margin-top: 4px; }
.auth-form { display: flex; flex-direction: column; gap: var(--space-lg); }
.auth-footer {
  text-align: center;
  margin-top: var(--space-lg);
  font-size: 13px;
  color: var(--clr-text-muted);
}
.auth-footer a { color: var(--clr-primary); font-weight: 600; }

/* ── Sidebar admin ───────────────────────────────── */
.admin-layout {
  display: flex;
  min-height: 100vh;
}
.sidebar {
  width: 240px;
  min-height: 100vh;
  background: var(--clr-bg-2);
  border-right: 1px solid var(--clr-border);
  padding: var(--space-lg) 0;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  flex-shrink: 0;
}
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 0 var(--space-lg) var(--space-lg);
  border-bottom: 1px solid var(--clr-border);
  margin-bottom: var(--space-lg);
  font-weight: 800;
  font-size: 17px;
}
.sidebar-brand .brand-icon { font-size: 22px; }
.sidebar-brand .brand-text { color: var(--clr-primary); }
.sidebar-nav { flex: 1; }
.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 10px var(--space-lg);
  color: var(--clr-text-muted);
  font-size: 14px;
  font-weight: 500;
  transition: all var(--transition);
  border-left: 3px solid transparent;
}
.sidebar-nav a:hover { color: var(--clr-text); background: rgba(255,255,255,0.04); }
.sidebar-nav a.active {
  color: var(--clr-primary);
  background: rgba(0,200,150,0.08);
  border-left-color: var(--clr-primary);
}
.sidebar-nav .nav-icon { font-size: 16px; width: 20px; text-align: center; }
.sidebar-footer {
  padding: var(--space-lg);
  border-top: 1px solid var(--clr-border);
  margin-top: var(--space-lg);
}
.admin-main { flex: 1; overflow-x: hidden; }
.admin-main .page-container { max-width: 1100px; }

/* ── Toast ───────────────────────────────────────── */
#toast-container {
  position: fixed;
  bottom: var(--space-xl);
  right: var(--space-xl);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}
.toast {
  background: var(--clr-surface-2);
  border: 1px solid var(--clr-border-strong);
  border-radius: var(--radius-md);
  padding: 12px 20px;
  font-size: 14px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  animation: slideInRight 0.3s ease;
  box-shadow: var(--shadow-lg);
  max-width: 320px;
}
.toast.success { border-color: var(--clr-primary); color: var(--clr-primary); }
.toast.error { border-color: var(--clr-danger); color: var(--clr-danger); }
.toast.info { border-color: var(--clr-info); color: var(--clr-info); }

/* ── Modal ───────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
  z-index: 500;
  display: none;
  align-items: center;
  justify-content: center;
  padding: var(--space-lg);
}
.modal-overlay.open { display: flex; }
.modal {
  background: var(--clr-surface);
  border: 1px solid var(--clr-border-strong);
  border-radius: var(--radius-xl);
  padding: var(--space-xl);
  width: 100%;
  max-width: 480px;
  animation: fadeInUp 0.3s ease;
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-lg);
}
.modal-title { font-size: 18px; font-weight: 800; }
.modal-close {
  background: none;
  border: none;
  color: var(--clr-text-muted);
  cursor: pointer;
  font-size: 20px;
  padding: 4px;
  line-height: 1;
}
.modal-close:hover { color: var(--clr-text); }
.modal-body { display: flex; flex-direction: column; gap: var(--space-md); }
.modal-footer {
  display: flex;
  gap: var(--space-sm);
  justify-content: flex-end;
  margin-top: var(--space-lg);
}

/* ── Incentivos card ──────────────────────────────── */
.incentive-card {
  background: var(--clr-surface);
  border: 1px solid var(--clr-border);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  display: flex;
  align-items: center;
  gap: var(--space-lg);
  transition: border-color var(--transition);
}
.incentive-card:hover { border-color: var(--clr-primary); }
.incentive-icon { font-size: 36px; flex-shrink: 0; }
.incentive-info { flex: 1; }
.incentive-label { font-size: 15px; font-weight: 700; }
.incentive-desc { font-size: 13px; color: var(--clr-text-muted); margin-top: 2px; }
.incentive-amount {
  font-size: 26px;
  font-weight: 800;
  color: var(--clr-accent);
  text-align: right;
  min-width: 140px;
}
.incentive-amount input {
  width: 100%;
  background: var(--clr-surface-2);
  border: 1.5px solid var(--clr-border);
  border-radius: var(--radius-sm);
  color: var(--clr-accent);
  font-size: 22px;
  font-weight: 800;
  font-family: var(--font);
  padding: 6px 10px;
  text-align: right;
  transition: border-color var(--transition);
}
.incentive-amount input:focus {
  outline: none;
  border-color: var(--clr-accent);
  box-shadow: 0 0 0 3px rgba(255,184,0,0.15);
}

/* ── Empty state ─────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: var(--space-3xl) var(--space-lg);
  color: var(--clr-text-muted);
}
.empty-state .empty-icon { font-size: 48px; margin-bottom: var(--space-md); }
.empty-state h3 { font-size: 18px; font-weight: 700; color: var(--clr-text); }
.empty-state p { margin-top: 4px; font-size: 14px; }

/* ── Filtros ─────────────────────────────────────── */
.filters-bar {
  display: flex;
  gap: var(--space-sm);
  flex-wrap: wrap;
  margin-bottom: var(--space-lg);
}
.filter-chip {
  padding: 6px 16px;
  border-radius: var(--radius-full);
  border: 1.5px solid var(--clr-border);
  background: transparent;
  color: var(--clr-text-muted);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  font-family: var(--font);
}
.filter-chip:hover { border-color: var(--clr-primary); color: var(--clr-primary); }
.filter-chip.active {
  background: rgba(0,200,150,0.1);
  border-color: var(--clr-primary);
  color: var(--clr-primary);
}

/* ── Animaciones ─────────────────────────────────── */
@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-20px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes slideInRight {
  from { opacity: 0; transform: translateX(20px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes pulse-glow {
  0%, 100% { box-shadow: var(--shadow-glow); }
  50% { box-shadow: 0 0 40px rgba(212,175,55,0.4); }
}
.pulse { animation: pulse-glow 2.5s infinite; }

/* ── Timeline de lead ────────────────────────────── */
.lead-timeline {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}
.timeline-item {
  display: flex;
  gap: var(--space-md);
  font-size: 13px;
}
.timeline-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--clr-border);
  flex-shrink: 0;
  margin-top: 5px;
}
.timeline-dot.active { background: var(--clr-primary); box-shadow: 0 0 8px rgba(212,175,55,0.4); }
.timeline-content { color: var(--clr-text-muted); }
.timeline-content strong { color: var(--clr-text); }

/* ── Progreso ganancias ──────────────────────────── */
.earnings-highlight {
  background: linear-gradient(135deg, rgba(212,175,55,0.1) 0%, rgba(212,175,55,0.05) 100%);
  border: 1px solid rgba(212,175,55,0.2);
  border-radius: var(--radius-xl);
  padding: var(--space-xl);
  text-align: center;
  margin-bottom: var(--space-xl);
}
.earnings-total {
  font-size: 48px;
  font-weight: 800;
  color: var(--clr-primary);
  line-height: 1;
}
.earnings-label { color: var(--clr-text-muted); font-size: 14px; margin-top: var(--space-sm); }
.earnings-sub { font-size: 13px; color: var(--clr-text-subtle); margin-top: 4px; }

/* ── Responsive ──────────────────────────────────── */
@media (max-width: 768px) {
  .navbar { padding: var(--space-md); }
  .page-container { padding: var(--space-lg) var(--space-md); }
  .admin-layout { flex-direction: column; }
  .sidebar {
    width: 100%;
    height: auto;
    position: relative;
    min-height: unset;
  }
  .sidebar-nav {
    display: flex;
    overflow-x: auto;
    padding-bottom: var(--space-sm);
  }
  .sidebar-nav a {
    flex-direction: column;
    padding: var(--space-sm) var(--space-md);
    font-size: 11px;
    text-align: center;
    border-left: none;
    border-bottom: 3px solid transparent;
    white-space: nowrap;
  }
  .sidebar-nav a.active { border-left-color: transparent; border-bottom-color: var(--clr-primary); }
  .sidebar-footer { display: none; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .incentive-card { flex-wrap: wrap; }
  .incentive-amount { min-width: 100%; }
  #toast-container { right: var(--space-md); bottom: var(--space-md); }
}
