/* ============================================================
   WA Platform — Design System
   Paleta: Verde WhatsApp (#25D366) como acento principal,
   fondo oscuro profundo (#0f1117) en sidebar, blanco roto (#f8f9fb) en contenido.
   ============================================================ */

:root {
  --wa-green: #25D366;
  --wa-green-dark: #1ead52;
  --wa-green-soft: rgba(37, 211, 102, 0.12);
  --sidebar-bg: #0f1117;
  --sidebar-width: 240px;
  --content-bg: #f8f9fb;
  --card-bg: #ffffff;
  --border: #e8ecf0;
  --text-primary: #1a1d23;
  --text-secondary: #6b7280;
  --text-muted: #9ca3af;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 3px rgba(0,0,0,.08), 0 4px 16px rgba(0,0,0,.04);
}

* { box-sizing: border-box; }

body {
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  background: var(--content-bg);
  color: var(--text-primary);
  margin: 0;
}

/* ---- SIDEBAR ---- */
.sidebar {
  width: var(--sidebar-width);
  min-height: 100vh;
  background: var(--sidebar-bg);
  padding: 0;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  padding: 20px 20px 16px;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--wa-green);
  border-bottom: 1px solid rgba(255,255,255,.06);
  letter-spacing: -.2px;
}

.sidebar-brand .bi-whatsapp { font-size: 1.3rem; }

.sidebar-nav {
  list-style: none;
  padding: 12px 0;
  margin: 0;
}

.sidebar-nav li { padding: 1px 10px; }

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  color: rgba(255,255,255,.55);
  text-decoration: none;
  font-size: .875rem;
  font-weight: 500;
  transition: all .15s;
}

.sidebar-link:hover {
  color: rgba(255,255,255,.9);
  background: rgba(255,255,255,.06);
}

.sidebar-link.active {
  color: var(--wa-green);
  background: var(--wa-green-soft);
}

.sidebar-link .bi { font-size: 1rem; flex-shrink: 0; }

.sidebar-footer {
  padding: 12px 10px;
  border-top: 1px solid rgba(255,255,255,.06);
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  margin-bottom: 4px;
}

.sidebar-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--wa-green);
  color: #fff;
  font-size: .8rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.sidebar-user-info {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.sidebar-user-name {
  font-size: .8rem;
  font-weight: 600;
  color: rgba(255,255,255,.85);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-user-email {
  font-size: .7rem;
  color: rgba(255,255,255,.4);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---- MAIN CONTENT ---- */
.main-content {
  padding: 32px;
  min-width: 0;
}

.page-header {
  margin-bottom: 28px;
}

.page-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0 0 4px;
  letter-spacing: -.3px;
}

.page-subtitle {
  color: var(--text-secondary);
  margin: 0;
  font-size: .9rem;
}

/* ---- STAT CARDS ---- */
.stat-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  flex-shrink: 0;
}

.bg-wa-soft { background: var(--wa-green-soft); }
.bg-info-soft { background: rgba(14, 165, 233, .12); }
.bg-success-soft { background: rgba(34, 197, 94, .12); }
.bg-warning-soft { background: rgba(245, 158, 11, .12); }
.text-wa { color: var(--wa-green) !important; }

.stat-info { display: flex; flex-direction: column; }
.stat-value { font-size: 1.6rem; font-weight: 700; line-height: 1; }
.stat-label { font-size: .8rem; color: var(--text-secondary); margin-top: 4px; }

/* ---- EMPTY STATE ---- */
.empty-state-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 48px 32px;
  text-align: center;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}

.empty-icon {
  font-size: 2.5rem;
  color: var(--wa-green);
  display: block;
  margin-bottom: 16px;
}

/* ---- BUTTONS ---- */
.btn-wa {
  background: var(--wa-green);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-weight: 600;
  padding: 10px 20px;
  transition: background .15s;
}

.btn-wa:hover { background: var(--wa-green-dark); color: #fff; }

/* ---- AUTH ---- */
.auth-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #0f1117 0%, #1a2332 100%);
  padding: 24px;
}

.auth-card {
  background: #fff;
  border-radius: 16px;
  padding: 40px 36px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 20px 60px rgba(0,0,0,.3);
}

.auth-logo {
  font-size: 2.5rem;
  color: var(--wa-green);
  text-align: center;
  margin-bottom: 12px;
}

.auth-title {
  font-size: 1.4rem;
  font-weight: 700;
  text-align: center;
  margin: 0 0 6px;
}

.auth-subtitle {
  color: var(--text-secondary);
  text-align: center;
  font-size: .9rem;
  margin-bottom: 28px;
}

.auth-footer-text {
  text-align: center;
  margin: 20px 0 0;
  font-size: .875rem;
  color: var(--text-secondary);
}

.auth-footer-text a {
  color: var(--wa-green);
  font-weight: 600;
  text-decoration: none;
}

.form-control {
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  padding: 10px 14px;
  font-size: .9rem;
  transition: border-color .15s;
}

.form-control:focus {
  border-color: var(--wa-green);
  box-shadow: 0 0 0 3px var(--wa-green-soft);
}

.form-label { font-size: .875rem; color: var(--text-primary); margin-bottom: 6px; }

/* ============================================================
   ETAPA 2 — Números de WhatsApp
   ============================================================ */

/* ---- Number Cards ---- */
.number-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  padding: 20px;
  transition: box-shadow .2s;
}

.number-card:hover { box-shadow: 0 4px 20px rgba(0,0,0,.1); }

.number-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.number-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--wa-green-soft);
  color: var(--wa-green);
  font-size: 1.3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.number-name {
  font-weight: 600;
  font-size: .9rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.number-phone { font-size: .8rem; color: var(--text-secondary); }

.number-card-meta {
  display: flex;
  gap: 12px;
  font-size: .75rem;
  color: var(--text-muted);
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.number-card-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---- Badges de estado ---- */
.badge-status {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: .72rem;
  font-weight: 600;
  flex-shrink: 0;
}

.badge-status--active   { background: rgba(37,211,102,.15); color: #1a8c47; }
.badge-status--inactive { background: rgba(239,68,68,.12);  color: #dc2626; }
.badge-status--pending  { background: rgba(245,158,11,.12); color: #d97706; }
.badge-lg { font-size: .85rem; padding: 6px 16px; }

/* ---- Signup Card ---- */
.signup-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  padding: 32px;
}

.signup-steps {
  display: flex;
  align-items: center;
  justify-content: center;
}

.signup-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  opacity: .4;
}

.signup-step.active { opacity: 1; }

.step-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--border);
  color: var(--text-secondary);
  font-size: .8rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.signup-step.active .step-num { background: var(--wa-green); color: #fff; }
.step-label { font-size: .72rem; color: var(--text-secondary); white-space: nowrap; }
.signup-step-divider { flex-grow: 1; height: 1px; background: var(--border); margin: 0 8px; margin-bottom: 16px; min-width: 24px; }

.signup-icon-wrap {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--wa-green-soft);
  color: var(--wa-green);
  font-size: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
}

.signup-note {
  background: #f8f9fb;
  border-radius: var(--radius-sm);
  padding: 12px 16px;
}

.text-wa { color: var(--wa-green) !important; }

/* ---- Detail Card ---- */
.detail-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  padding: 24px;
}

.detail-card-title {
  font-size: .85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

.detail-dl { margin: 0; }

.detail-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: .875rem;
}

.detail-row:last-child { border-bottom: none; }
.detail-row dt { color: var(--text-secondary); font-weight: 500; flex-shrink: 0; }
.detail-row dd { margin: 0; font-weight: 500; text-align: right; word-break: break-all; }

/* ---- Quick Actions ---- */
.quick-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.quick-action-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 20px 12px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  text-decoration: none;
  color: var(--text-primary);
  font-weight: 600;
  font-size: .875rem;
  transition: all .15s;
  text-align: center;
}

.quick-action-btn:hover {
  border-color: var(--wa-green);
  color: var(--wa-green);
  background: var(--wa-green-soft);
}

.quick-action-btn .bi { font-size: 1.4rem; }
.quick-action-btn small { font-weight: 400; font-size: .75rem; }

/* ---- Sidebar links activación ---- */
.min-w-0 { min-width: 0; }
