/* ==========================================================
   Nanas Seguras CRM - Dark Mode Clean v1
   Alcance: SOLO modo oscuro. No afecta modo claro.
   Objetivo: eliminar negro puro/gris rata, crear profundidad y
   hacer que los iconos de métricas coincidan con el color de etapa.
   ========================================================== */

body[data-theme="dark"]{
  --kb-bg:#0f172a;
  --kb-column:#162033;
  --kb-card:#1e293b;
  --kb-border:#334155;
  --kb-text:#f8fafc;
  --kb-muted:#cbd5e1;
  --kb-shadow:0 18px 44px rgba(0,0,0,.24);
  --kb-shadow-soft:0 10px 24px rgba(0,0,0,.18);
  background:#0f172a!important;
  color:#f8fafc!important;
}

body[data-theme="dark"] .main,
body[data-theme="dark"] .login-page{
  background:#0f172a!important;
  color:#f8fafc!important;
}

body[data-theme="dark"] .sidebar{
  background:#0b1120!important;
  color:#f8fafc!important;
  border-right:1px solid rgba(148,163,184,.12)!important;
}

body[data-theme="dark"] .kanban-scroll-top,
body[data-theme="dark"] .kanban::-webkit-scrollbar-track,
body[data-theme="dark"] .kanban-scroll-top::-webkit-scrollbar-track,
body[data-theme="dark"] .cards::-webkit-scrollbar-track{
  background:#0f172a!important;
}

body[data-theme="dark"] .kanban::-webkit-scrollbar-thumb,
body[data-theme="dark"] .kanban-scroll-top::-webkit-scrollbar-thumb,
body[data-theme="dark"] .cards::-webkit-scrollbar-thumb{
  background:#334155!important;
  border-color:#0f172a!important;
}

/* Superficies principales: 3 capas, sin negro puro */
body[data-theme="dark"] .metric,
body[data-theme="dark"] .dashboard-card,
body[data-theme="dark"] .quick-link,
body[data-theme="dark"] .modal,
body[data-theme="dark"] .modal-body,
body[data-theme="dark"] .modal-head,
body[data-theme="dark"] .modal-foot,
body[data-theme="dark"] .perm-card,
body[data-theme="dark"] .user-create-card,
body[data-theme="dark"] .users-table-card,
body[data-theme="dark"] .login-card{
  background:#1e293b!important;
  color:#f8fafc!important;
  border-color:#334155!important;
  box-shadow:0 12px 28px rgba(0,0,0,.18)!important;
}

body[data-theme="dark"] .column,
body[data-theme="dark"] .column-head,
body[data-theme="dark"] .form-section,
body[data-theme="dark"] .edit-section,
body[data-theme="dark"] .premium-tab-section,
body[data-theme="dark"] .info-box,
body[data-theme="dark"] .form-detail-row,
body[data-theme="dark"] .doc-download,
body[data-theme="dark"] .stage-row,
body[data-theme="dark"] .transfer-box,
body[data-theme="dark"] .ranking-row,
body[data-theme="dark"] .recent-row,
body[data-theme="dark"] .alert-row,
body[data-theme="dark"] .profile-hero,
body[data-theme="dark"] .profile-card,
body[data-theme="dark"] .profile-row,
body[data-theme="dark"] .profile-field-card,
body[data-theme="dark"] .parent-config-card,
body[data-theme="dark"] .doc-slot-card,
body[data-theme="dark"] .documents-clean-section,
body[data-theme="dark"] .candidate-result-card,
body[data-theme="dark"] .selected-candidates-box,
body[data-theme="dark"] .selected-candidate-pill,
body[data-theme="dark"] .edit-tabs,
body[data-theme="dark"] .edit-photo-section,
body[data-theme="dark"] .premium-edit-form{
  background:#162033!important;
  color:#f8fafc!important;
  border-color:#334155!important;
  box-shadow:none!important;
}

body[data-theme="dark"] .card,
body[data-theme="dark"] .card.card-pro{
  background:#1e293b!important;
  color:#f8fafc!important;
  border-color:#334155!important;
  box-shadow:0 8px 18px rgba(0,0,0,.16)!important;
}

body[data-theme="dark"] .card.card-pro:hover,
body[data-theme="dark"] .card.card-pro:focus,
body[data-theme="dark"] .card.card-pro:active,
body[data-theme="dark"] .metric-stage:hover,
body[data-theme="dark"] .metric-stage:focus-visible{
  background:#223047!important;
  border-color:color-mix(in srgb, var(--metric-color, #f9a8d4) 32%, #334155)!important;
  box-shadow:0 12px 24px rgba(0,0,0,.22)!important;
  transform:translateY(-1px);
}

/* Buscador y controles: integrados, no parche negro */
body[data-theme="dark"] .search-box,
body[data-theme="dark"] input,
body[data-theme="dark"] select,
body[data-theme="dark"] textarea,
body[data-theme="dark"] .field input,
body[data-theme="dark"] .field select,
body[data-theme="dark"] .field textarea,
body[data-theme="dark"] .stage-row input[type=text],
body[data-theme="dark"] .parent-config-card textarea,
body[data-theme="dark"] .premium-data-row textarea{
  background:#111827!important;
  color:#f8fafc!important;
  border-color:#334155!important;
  box-shadow:none!important;
}

body[data-theme="dark"] input::placeholder,
body[data-theme="dark"] textarea::placeholder,
body[data-theme="dark"] .search-box input::placeholder{
  color:#94a3b8!important;
  opacity:1!important;
}

body[data-theme="dark"] .btn,
body[data-theme="dark"] .icon-btn,
body[data-theme="dark"] .modal-action,
body[data-theme="dark"] .cancel,
body[data-theme="dark"] .close,
body[data-theme="dark"] .metrics-toggle,
body[data-theme="dark"] .add-card,
body[data-theme="dark"] .btn-open-form,
body[data-theme="dark"] .form-btn{
  background:#111827!important;
  color:#f8fafc!important;
  border-color:#334155!important;
  box-shadow:none!important;
}

body[data-theme="dark"] .btn.primary,
body[data-theme="dark"] .save,
body[data-theme="dark"] .form-btn.primary,
body[data-theme="dark"] .nav-item.active,
body[data-theme="dark"] .sidebar-item-active{
  background:#f9a8d4!important;
  color:#03045e!important;
  border-color:#f9a8d4!important;
}

/* Textos: 3 niveles limpios */
body[data-theme="dark"] h1,
body[data-theme="dark"] h2,
body[data-theme="dark"] h3,
body[data-theme="dark"] .column-title,
body[data-theme="dark"] .card-name,
body[data-theme="dark"] .modal-head h2,
body[data-theme="dark"] .dashboard-card h2,
body[data-theme="dark"] .stage-row strong,
body[data-theme="dark"] .ranking-row strong,
body[data-theme="dark"] .recent-row strong,
body[data-theme="dark"] .bar-head,
body[data-theme="dark"] .funnel-name,
body[data-theme="dark"] .funnel-value,
body[data-theme="dark"] .info-box strong,
body[data-theme="dark"] .form-detail-row strong,
body[data-theme="dark"] .premium-data-row strong,
body[data-theme="dark"] .profile-row strong,
body[data-theme="dark"] .candidate-result-info strong,
body[data-theme="dark"] .doc-slot-head strong,
body[data-theme="dark"] .visibility-switch span{
  color:#f8fafc!important;
}

body[data-theme="dark"] .topbar p,
body[data-theme="dark"] .modal-head p,
body[data-theme="dark"] .profile-hero p,
body[data-theme="dark"] .profile-hero small,
body[data-theme="dark"] .card-place,
body[data-theme="dark"] .card-line,
body[data-theme="dark"] .card-line span,
body[data-theme="dark"] .premium-help,
body[data-theme="dark"] .edit-photo-box span,
body[data-theme="dark"] .candidate-result-info small,
body[data-theme="dark"] .metric span,
body[data-theme="dark"] .metric small,
body[data-theme="dark"] .stage-row span,
body[data-theme="dark"] .ranking-row span,
body[data-theme="dark"] .recent-row span,
body[data-theme="dark"] .alert-row span{
  color:#cbd5e1!important;
  opacity:1!important;
}

body[data-theme="dark"] .field label,
body[data-theme="dark"] .info-box span,
body[data-theme="dark"] .form-detail-row span,
body[data-theme="dark"] .profile-row small,
body[data-theme="dark"] .premium-data-row span,
body[data-theme="dark"] .card-meta-pills small,
body[data-theme="dark"] .muted{
  color:#94a3b8!important;
  opacity:1!important;
}

/* Badges y contadores: neutrales para reducir ruido */
body[data-theme="dark"] .count,
body[data-theme="dark"] .badge,
body[data-theme="dark"] .pill-soft,
body[data-theme="dark"] .user-badge,
body[data-theme="dark"] .copy-mini,
body[data-theme="dark"] .copy-field,
body[data-theme="dark"] .card-meta-pills span,
body[data-theme="dark"] .drop-empty{
  background:#0f172a!important;
  color:#e2e8f0!important;
  border-color:#334155!important;
}

/* Iconos de métricas: coinciden con la etapa sin verse chillones */
body[data-theme="dark"] .metric i{
  width:36px!important;
  height:36px!important;
  border-radius:12px!important;
  background:color-mix(in srgb, var(--metric-color, #bae6fd) 12%, #1e293b)!important;
  color:color-mix(in srgb, var(--metric-color, #bae6fd) 78%, #e2e8f0)!important;
  border:1px solid color-mix(in srgb, var(--metric-color, #bae6fd) 28%, #334155)!important;
  box-shadow:none!important;
}

body[data-theme="dark"] .metric i svg,
body[data-theme="dark"] .metric i svg *{
  color:currentColor!important;
  stroke:currentColor!important;
}

/* Mantener el color de etapa en una sola señal clara: línea inferior y borde superior de columna */
body[data-theme="dark"] .metric::after{
  background:color-mix(in srgb, var(--metric-color, #f9a8d4) 72%, #334155)!important;
  opacity:.78!important;
}

body[data-theme="dark"] .column-head{
  border-top-color:var(--col-color, var(--kb-pink))!important;
}

/* Acciones dentro de tarjetas: neutrales; WhatsApp conserva identidad funcional */
body[data-theme="dark"] .card-action-btn,
body[data-theme="dark"] .eye-icon,
body[data-theme="dark"] .delete-icon.delete-postulante.card-action-btn{
  background:#0f172a!important;
  color:#cbd5e1!important;
  border-color:#334155!important;
}

body[data-theme="dark"] .card-action-btn svg,
body[data-theme="dark"] .eye-icon svg,
body[data-theme="dark"] .delete-icon.delete-postulante.card-action-btn svg{
  color:currentColor!important;
  stroke:currentColor!important;
}

body[data-theme="dark"] .whatsapp-icon,
body[data-theme="dark"] .whatsapp-icon.card-action-btn{
  background:rgba(34,197,94,.10)!important;
  color:#86efac!important;
  border-color:rgba(134,239,172,.24)!important;
}

body[data-theme="dark"] .whatsapp-icon svg,
body[data-theme="dark"] .whatsapp-icon.card-action-btn svg,
body[data-theme="dark"] .wa svg,
body[data-theme="dark"] .card-line-whatsapp svg{
  color:#86efac!important;
  stroke:#86efac!important;
  fill:none!important;
}

body[data-theme="dark"] .modal-backdrop{
  background:rgba(15,23,42,.76)!important;
}

body[data-theme="dark"] .toast{
  background:#1e293b!important;
  color:#f8fafc!important;
  border:1px solid #334155!important;
}
