:root {
  --font-family-body: "Poppins", sans-serif;
}

html {
  scroll-behavior: auto;
  will-change: scroll-position;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-family-body);
  font-size: 14px;
}

/* Estilos de mensajes alert */
.swal2-toast.custom-success {
  background-color: #28a745 !important;
  /* Verde Bootstrap */
  color: white;
}

.swal2-toast.custom-error {
  background-color: #dc3545 !important;
  /* Rojo */
  color: white;
}

.swal2-toast.custom-warning {
  background-color: #e0a800 !important;
  color: white;
}

.swal2-toast.custom-warning .swal2-warning {
  color: white !important;
}

.swal2-toast.custom-info {
  background-color: #17a2b8 !important;
  /* Azul Bootstrap tipo "info" */
  color: white;
}

.swal2-toast.custom-info .swal2-icon {
  color: white !important;
}

/* Estilos para el logo en el dashboard */
.logo {
  max-width: 300px;
  margin: 0 auto 20px;
  display: block;
}

/* Colores de resaltado temporales para filas en DataTables */
table.dataTable tbody tr.highlight-success > td {
  background-color: #d1e7dd !important;
}
table.dataTable tbody tr.highlight-warning > td {
  background-color: #fff3cd !important;
}
table.dataTable tbody tr.highlight-danger > td {
  background-color: #f8d7da !important;
}

/* Separador */
hr {
  margin-top: 1rem;
  margin-bottom: 1rem;
  border: 0;
  border-top: 1px solid rgba(0, 0, 0, 0.1);
}

/* En tu CSS */
.export-ignore {
}

#reporteTodosLista {
  column-count: 2;
  column-gap: 1rem;
}

#reporteTodosLista .masonry-item {
  display: inline-block;
  width: 100%;
  margin-bottom: 1rem;
  break-inside: avoid; /* <- súper importante para que no se partan las cards */
}

/* Responsive */
@media (max-width: 768px) {
  #reporteTodosLista {
    column-count: 1;
  }
}

@media (min-width: 1200px) {
  #reporteTodosLista {
    column-count: 3;
  }
}

.form-check-lg .form-check-input {
  width: 1.4em;
  height: 1.4em;
  margin-top: 0.2em;
  cursor: pointer;
}

.form-check-lg .form-check-label {
  font-size: 14px;
  margin-left: 0.4em;
  cursor: pointer;
}

#grupoRayosX.is-valid {
  border: 2px solid #198754; /* verde Bootstrap */
}

#grupoRayosX.is-invalid {
  border: 2px solid #dc3545; /* rojo Bootstrap */
}

/* PDF */
#plantillaOrden {
  width: 650px;
}

#pdfMotivos div {
  font-size: 14px; /* aumenta tamaño */
  line-height: 1.6; /* más espacio entre filas */
}

.facebook {
  color: #1877f2; /* Azul Facebook */
}

.instagram {
  color: #e4405f; /* Rosa Instagram */
}

.tiktok {
  color: #000000; /* Negro TikTok */
}

.youtube {
  color: #ff0000; /* Rojo YouTube */
}

/* Pacientes */
/* Fila de info en 3 columnas: icono - label - valor */
.info-row {
  display: grid;
  grid-template-columns: 28px auto 1fr;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

/* Fila para texto largo (Mensaje / Notas) */
.info-row-start {
  display: grid;
  grid-template-columns: 28px 1fr;
  align-items: start;
  gap: 8px;
}

/* Alinear iconos al centro vertical */
.info-row i,
.info-row-start i {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}

/* Fondo degradado en el header del modal */
.bg-gradient {
  background: linear-gradient(135deg, #ffcc70, #ff5757);
}

/* Animación de contador */
#contadorSesion {
  animation: pulse 1s infinite;
}

@keyframes pulse {
  0% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.2);
    opacity: 0.7;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

/* Tiny MCE */
.tox-tinymce {
  width: 100% !important;
}
.tox-editor-container,
.tox-edit-area iframe {
  width: 100% !important;
}

/* Hace que Select2 se comporte como form-select dentro de input-group */
.input-group .select2-container {
  flex: 1 1 auto !important;
  width: 1% !important; /* evita que rompa el ancho */
}

.select2-container .select2-selection--single {
  height: calc(2.5rem + 2px) !important; /* igual que .form-select */
  line-height: 2.3rem !important;
  padding-left: 0.5rem !important;
}

.select2-container--default
  .select2-selection--single
  .select2-selection__rendered {
  line-height: 2.3rem !important; /* centra el texto */
}

/* Solo afecta al input date de Doctor */
.date-doctor {
  width: 60% !important;
  height: calc(2.5rem + 2px) !important; /* mismo alto que select */
  line-height: 2.3rem !important;
}

#plantillaConstancia {
  width: 794px; /* A4 en px a 96dpi */
  max-width: 100%;
  margin: 0 auto;
}

#plantillaConstancia {
  font-size: 10pt; /* más grande que el 12px típico */
  line-height: 1.6;
}
#plantillaConstancia h3 {
  font-size: 20pt;
  font-weight: bold;
}

/* Pintar icono y borde del span según validación */
.input-group-text.is-valid {
  border-color: #198754 !important;
  color: #198754 !important;
}

.input-group-text.is-invalid {
  border-color: #dc3545 !important;
  color: #dc3545 !important;
}

/* ============================
   KPI BASE (para pacientes y leads)
=============================== */

.kpi-card {
  position: relative;
  background: #fff;
  border-radius: 12px;
  padding: 18px 18px 18px 20px;
  overflow: hidden;
  display: flex;
  align-items: center;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.kpi-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

/* Icono redondo */
.kpi-icon {
  position: absolute;
  left: 85%;
  top: 14px;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 16px;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.kpi-card:hover .kpi-icon {
  transform: scale(1.12);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.18);
}

.kpi-body h3 {
  font-size: 22px;
  margin-bottom: 4px;
  font-weight: 600;
}

/* Línea lateral */
.kpi-side-bar {
  position: absolute;
  left: 0;
  top: 0;
  width: 6px;
  height: 100%;
  border-radius: 12px 0 0 12px;
  transition: filter 0.25s ease;
}

.kpi-card:hover .kpi-side-bar {
  filter: brightness(1.15);
}

/* Badge superior */
.badge-kpi {
  position: absolute;
  top: 10px;
  right: 15px;
  background: #007bff;
  color: #fff;
  padding: 4px 10px;
  font-size: 12px;
  border-radius: 8px;
}

.badge-month {
  background: #2d9cdb !important;
  font-size: 0.7rem !important;
  padding: 4px 10px !important;
  border-radius: 50px !important;
}

/* Ranking general */
.kpi-ranking-bar {
  height: 6px !important;
  border-radius: 4px !important;
}

.kpi-ranking-bg {
  background: #eee !important;
  border-radius: 4px !important;
}

/* Morado */
.bg-purple {
  background: #7b61ff;
}

/* ============================
   ESPECÍFICO para PACIENTES
=============================== */

#kpiPacientes .card {
  border-radius: 12px;
  border: 1px solid #f0f0f0 !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04) !important;
}

#kpiPacientes h6 {
  color: #0a7bdd;
  font-weight: 600;
}

#kpiPacientes .card i {
  color: #0a7bdd;
}

#kpiPacientes table tbody tr:hover {
  background: #f7faff;
  transition: 0.2s;
}

/* ============================
   ESPECÍFICO para LEADS
=============================== */

#kpiLeads h6 {
  color: #0a7bdd;
  font-weight: 600;
}

#kpiLeads .card i {
  color: #0a7bdd;
}

#kpiLeads table tbody tr:hover {
  background: #fafafa;
  transition: 0.2s;
}

#kpiLeads h3 {
  color: #111;
}

/* ============================================================
   ESTILO GENERAL DE BLOQUES KPI – DISEÑO PROFESIONAL
   ============================================================ */

.kpi-box {
  background: #ffffff;
  border-radius: 18px;
  padding: 18px 20px;
  border: 1px solid #e9edf3;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.04);
  transition: all 0.2s ease;
}

.kpi-box:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.08);
}

/* Encabezado */
.kpi-header {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: #475569;
}

.kpi-header i {
  font-size: 1rem;
}

/* Valor principal */
.kpi-value {
  font-size: 22px;
  font-weight: 700;
  color: #111827;
  line-height: 1.1;
}

/* Subtexto (porcentaje, rango, totales) */
.kpi-sub {
  font-size: 0.85rem;
  font-weight: 500;
  margin-top: 2px;
  color: #64748b;
}

/* Meta o textos auxiliares */
.kpi-meta {
  margin-top: 8px;
  font-size: 0.82rem;
  color: #334155;
  font-weight: 600;
}

/* Mensaje inteligente */
.kpi-msg {
  margin-top: 6px;
  font-size: 0.82rem;
  color: #475569;
  display: flex;
  align-items: flex-start;
  gap: 6px;
}

/* Barras de progreso */
.kpi-progress {
  height: 8px !important;
  border-radius: 20px !important;
  background: #e5e7eb !important;
  overflow: hidden;
  margin-top: 10px;
}

.kpi-progress .progress-bar {
  border-radius: 20px !important;
}

/* Paletas por tipo */
.kpi-primary .progress-bar {
  background: #3b82f6 !important;
}
.kpi-warning .progress-bar {
  background: #f59e0b !important;
}
.kpi-success .progress-bar {
  background: #10b981 !important;
}

/* Hover del título */
.kpi-header:hover {
  color: #0f172a;
}

/* Ajuste responsive */
@media (max-width: 768px) {
  .kpi-value {
    font-size: 1.6rem;
  }
}

/* ====== NOTIF DROPDOWN PRO (Bootstrap 5) ====== */
.qv-notif-menu {
  width: 380px;
  border: 0;
  border-radius: 16px;
  padding: 0.5rem;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.14);
  background: var(--bs-body-bg);
}

.qv-notif-head {
  position: relative;
  padding: 0.65rem 0.65rem 0.55rem 0.65rem;
  border-radius: 14px;
  background: color-mix(in srgb, var(--bs-primary) 6%, transparent);
}

.qv-notif-pill {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.18rem 0.5rem;
  border-radius: 999px;
  color: var(--bs-primary);
  background: color-mix(in srgb, var(--bs-primary) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--bs-primary) 18%, transparent);
}

.qv-notif-divider {
  height: 1px;
  margin: 0.45rem 0.25rem;
  background: color-mix(in srgb, var(--bs-secondary-color) 18%, transparent);
}

.qv-notif-list {
  padding: 0.25rem 0.25rem 0.15rem 0.25rem;
  max-height: 340px;
  overflow: auto;
}

/* Item */
.qv-notif-item {
  display: flex;
  gap: 0.7rem;
  padding: 0.6rem 0.6rem;
  border-radius: 14px;
  transition: background 0.15s ease, transform 0.15s ease;
  position: relative;
}
.qv-notif-item:hover {
  background: color-mix(in srgb, var(--bs-primary) 7%, transparent);
  transform: translateY(-1px);
}

.qv-notif-avatar {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  color: var(--bs-primary);
  background: color-mix(in srgb, var(--bs-primary) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--bs-primary) 14%, transparent);
  flex: 0 0 auto;
}

.qv-notif-name {
  font-weight: 800;
  line-height: 1.1;
}
.qv-notif-time {
  font-size: 0.78rem;
  color: var(--bs-secondary-color);
  white-space: nowrap;
  margin-left: 0.75rem;
}
.qv-notif-meta {
  font-size: 0.82rem;
  color: var(--bs-secondary-color);
  display: flex;
  gap: 0.4rem;
  align-items: center;
  flex-wrap: wrap;
}
.qv-sede-pill {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.16rem 0.45rem;
  border-radius: 999px;
  border: 1px solid
    color-mix(in srgb, var(--bs-secondary-color) 22%, transparent);
  background: color-mix(in srgb, var(--bs-secondary-color) 10%, transparent);
  color: var(--bs-body-color);
}

/* Empty state */
.qv-empty {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  padding: 0.9rem 0.75rem;
  border-radius: 14px;
  background: color-mix(in srgb, var(--bs-secondary-color) 6%, transparent);
}
.qv-empty i {
  font-size: 1.2rem;
  color: var(--bs-secondary-color);
  margin-top: 0.1rem;
}
.qv-empty-title {
  font-weight: 800;
}
.qv-empty-sub {
  font-size: 0.82rem;
  color: var(--bs-secondary-color);
}

.qv-dropdown-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  opacity: 0;
  transition: opacity 0.18s ease;
  z-index: 1040;
}

.qv-dropdown-backdrop.show {
  opacity: 1;
}

/* Asegura que el menú esté sobre el backdrop */
.qv-notif-menu {
  z-index: 1050;
}
