
/*==============================
 CSS — ESTILO PREMIUM ANCESTRÍA
============================== */

.ancestry-card {
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid #e3e6ef;
}

.ancestry-card-header {
  padding: 16px 24px;
  background: #f7f9fc;
  border-bottom: 1px solid #e3e6ef;
  display: flex;
  align-items: center;
  gap: 8px;
}

.ancestry-card-header i {
  font-size: 20px;
  color: #5cb85c;
}

.ancestry-card-header h5 {
  margin: 0;
  font-weight: 600;
  color: #374151;
}

.ancestry-summary-text {
  font-size: 0.9rem;
  color: #6b7280;
  margin: 4px 0 0;
}

.ancestry-body {
  padding: 16px 24px 20px;
}

.ancestry-layout {
  display: grid;
  grid-template-columns: minmax(0, 320px) minmax(0, 1fr);
  gap: 24px;
}

@media (max-width: 991px) {
  .ancestry-layout {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Tarjeta del gráfico */
.ancestry-chart-card {
  border-radius: 16px;
  border: 1px solid #e5e7eb;
  padding: 16px;
  background: #ffffff;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.04);
}

.ancestry-chart-title {
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 8px;
  color: #374151;
}

.ancestry-chart-sub {
  font-size: 0.8rem;
  color: #9ca3af;
}

.ancestry-legend {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ancestry-legend-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.8rem;
  color: #4b5563;
}

.ancestry-legend-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.ancestry-legend-color {
  width: 10px;
  height: 10px;
  border-radius: 999px;
}

/* Listado detallado */
.ancestry-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.ancestry-continent-block {
  border-radius: 14px;
  border: 1px solid #e5e7eb;
  background: #ffffff;
  overflow: hidden;
}

.ancestry-continent-header {
  padding: 10px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #f9fafb;
}

.ancestry-continent-name {
  font-size: 0.9rem;
  font-weight: 600;
  color: #374151;
}

.ancestry-continent-total {
  font-size: 0.8rem;
  color: #6b7280;
}

.ancestry-continent-total strong {
  color: #111827;
}

.ancestry-items {
  padding: 8px 14px 10px;
}

.ancestry-item {
  display: grid;
  grid-template-columns: minmax(0, 55%) minmax(0, 45%);
  align-items: center;
  padding: 6px 0;
  gap: 8px;
}

.ancestry-item-left {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: #374151;
}

.ancestry-flag {
  font-size: 18px;
  line-height: 1;
}

.ancestry-country {
  font-weight: 500;
}

.ancestry-item-right {
  text-align: right;
}

.ancestry-progress {
  position: relative;
  height: 6px;
  background: #e5e7eb;
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 4px;
}

.ancestry-progress-bar {
  height: 6px;
  border-radius: 999px;
  background: linear-gradient(90deg, #4ade80, #16a34a);
  width: 0;
  transition: width 0.7s ease-out;
}

.ancestry-percent {
  font-size: 0.8rem;
  color: #4b5563;
  font-weight: 500;
}

/* Estado vacío */
.ancestry-empty {
  padding: 20px;
  text-align: center;
  color: #9ca3af;
  font-size: 0.9rem;
}


/* ====== CARD ====== */
.report-card {
  border-radius: 16px;
  border: 1px solid #e3e6ef;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
  background: #ffffff;

  /* 💎 NUEVOS MÁRGENES EXTERNOS (elegantes y modernos) */
  margin: 24px 20px;
}


.report-card-header {
  padding: 12px 20px;
  background: linear-gradient(90deg, #1d4ed8, #0ea5e9);
  color: #fff;
  display: flex;
  align-items: center;
  gap: 8px;
  text-transform: uppercase;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  font-weight: 600;
}

.report-card-body {
  padding: 28px 40px !important; /* 💎 margen lateral + superior premium */
}


/* ====== TABLA ====== */
.table-report {
  margin-bottom: 0;
  font-size: 0.9rem;
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 10px; /* 💎 filas separadas */
}

.table-report thead th {
  background: #f9fafb;
  border-bottom: none;
  font-weight: 600;
  color: #4b5563;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 12px 10px;
}

.table-report tbody tr {
  background: #ffffff;
  box-shadow: 0 2px 6px rgba(0,0,0,0.06);
  border-radius: 8px;
  overflow: hidden;
}

.table-report tbody td {
  padding: 14px 10px;
  vertical-align: middle;
}

.table-report tbody tr:hover {
  background-color: #f0f7ff;
  transform: translateY(-1px);
  transition: 0.2s ease;
}


/* ====== TYPE LABEL ====== */
.report-type {
  display: flex;
  align-items: center;
  gap: 8px;
}

.report-type-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 999px;
  background: #eff6ff;
  color: #1d4ed8;
  font-weight: 600;
}


/* ====== STATUS BADGE ====== */

.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  font-size: 0.68rem;
  line-height: 1;
  padding: 4px 12px;
  font-weight: 600;
  white-space: nowrap;
}

/* Colores */
.status-pill--pending {
  background: #facc15;
  color: #92400e;
}

.status-pill--info {
  background: #16c6d8;
  color: white;
}

.status-pill--success {
  background: #22c55e;
  color: #14532d;
}

.status-pill--error {
  background: #ef4444;
  color: #fff;
}



/* ====== ACTION BUTTON ====== */
.btn-report {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: none;
  background: #e0f2fe;
  color: #0369a1;
  transition: 0.15s ease;
}

.btn-report:hover {
  background: #0ea5e9;
  color: #ffffff;
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(37, 99, 235, 0.35);
}

.btn-report i {
  font-size: 14px;
}


/* ====== ACTION CELL ====== */
.td-actions {
  text-align: center;
}

/* ====== Selector de idioma ====== */
.language-selector {
  display: flex;
  align-items: center;
  gap: 10px;
}

.lang-option {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  background: #f3f4f6;
  border: 2px solid transparent;
  transition: 0.2s ease;
}

.lang-option img {
  width: 20px;
  height: 20px;
  border-radius: 50%;
}

.lang-option:hover {
  background: #e5e7eb;
}

.lang-option.active {
  border-color: #1d4ed8;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.25);
}


/* ============ SELECTOR DE IDIOMA ============ */

.language-selector {
  display: flex;
  align-items: center;
  gap: 10px;
}

.lang-option {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  background: #f3f4f6;
  border: 2px solid transparent;
  transition:
    background 0.15s ease,
    transform 0.15s ease,
    box-shadow 0.15s ease,
    border-color 0.15s ease;
}

.lang-option img {
  width: 22px;
  height: 22px;
  border-radius: 50%;
}

/* Hover suave */
.lang-option:hover {
  background: #e0f2fe;
  transform: translateY(-1px) scale(1.04);
  box-shadow: 0 4px 10px rgba(37, 99, 235, 0.25);
}

/* Estado activo (seleccionado) */
.lang-option.active {
  background: #ffffff;
  border-color: #1d4ed8;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.3);
  transform: translateY(-1px);
}


/* ================================
   BADGE — SUMMARY
================================ */

.report-summary-badge {
  display: inline-block; 
  background: #0ea5e9;         /* azul premium */
  color: #ffffff;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;        /* forma de píldora */
  margin-left: 8px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  box-shadow: 0 2px 6px rgba(14, 165, 233, 0.25);
}

/* Icono estrella antes del nombre */
.star-summary {
  color: #fbbf24;              /* amarillo premium */
  margin-right: 5px;
  font-size: 0.85rem;
}

/* =====================================
   RESPONSIVE — TABLA DE REPORTES
   ===================================== */

/* 📱 Tablets y móviles grandes */
@media (max-width: 991px) {

  /* La card un poco más compacta */
  .report-card {
    margin: 16px 12px;
  }

  .report-card-body {
    padding: 20px 20px !important;
  }

  /* Texto un poco más pequeño en la tabla */
  .table-report {
    font-size: 0.82rem;
  }

  .table-report thead th {
    padding: 10px 8px;
  }

  .table-report tbody td {
    padding: 10px 8px;
  }

  /* Badges y labels más compactos */
  .report-type-label {
    font-size: 0.72rem;
  }

  .report-summary-badge {
    font-size: 0.68rem;
    padding: 2px 6px;
    margin-left: 6px;
  }

  /* Selector de idioma más pequeño */
  .language-selector {
    gap: 6px;
  }

  .lang-option {
    width: 28px;
    height: 28px;
  }

  .lang-option img {
    width: 18px;
    height: 18px;
  }

  /* Botón de descarga un poco más compacto */
  .btn-report {
    width: 30px;
    height: 30px;
  }

  .btn-report i {
    font-size: 13px;
  }
}

/* 📲 Móviles pequeños / muy angostos */
@media (max-width: 576px) {

  /* Card casi a borde de pantalla */
  .report-card {
    margin: 12px 8px;
  }

  .report-card-header {
    padding: 10px 12px;
    font-size: 0.72rem;
  }

  .report-card-body {
    padding: 14px 12px !important;
  }

  /* Hacemos la tabla scrolleable horizontalmente
     para NO romper la estructura */
  .report-card-body {
    overflow-x: auto;
  }

  .table-report {
    min-width: 520px; /* fuerza scroll si la pantalla es muy angosta */
  }

  /* Un poco más de espacio entre filas para que se vean "cards" */
  .table-report tbody tr {
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
  }

  /* Ajustes de texto */
  .report-type-label {
    font-size: 0.7rem;
  }

  .status-pill {
    font-size: 0.65rem;
    padding: 3px 8px;
  }

  .language-selector {
    gap: 4px;
  }

  .lang-option {
    width: 26px;
    height: 26px;
  }

  .lang-option img {
    width: 16px;
    height: 16px;
  }

  .td-actions {
    text-align: right;
  }
}


/* ===================================================
   CARD — AGENDAMIENTO CITA MÉDICA (ACORDEÓN UX)
   =================================================== */

.schedule-card {
  border-radius: 16px;
  border: 1px solid #e5e7eb;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
  overflow: hidden;
  background: #ffffff;
}

/* HEADER clickable */
.schedule-header {
  width: 100%;
  border: none;
  background: linear-gradient(90deg, #059669, #10b981);
  color: #ffffff;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  outline: none;
}

.schedule-header-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.schedule-header-icon {
  font-size: 1.1rem;
}

.schedule-header-title {
  font-size: 0.95rem;
  font-weight: 600;
}

.schedule-header-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.schedule-header-tag {
  font-size: 0.7rem;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.16);
  color: #ecfdf5;
  letter-spacing: 0.06em;
}

.schedule-chevron {
  transition: transform 0.2s ease;
}

.schedule-chevron.open {
  transform: rotate(180deg);
}

/* BODY */
.schedule-body {
  background: #f9fafb;
}

.schedule-body-inner {
  padding: 18px 20px;
  text-align: center;
}

.schedule-body-title {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 8px;
  color: #111827;
}

.schedule-body-text {
  font-size: 0.85rem;
  color: #4b5563;
  margin-bottom: 14px;
}

.schedule-cta {
  font-size: 0.85rem;
  font-weight: 600;
  padding: 8px 18px;
  border-radius: 999px;
}

/* RESPONSIVE */
@media (max-width: 576px) {
  #agendarAsesoria {
    margin-top: 12px;
  }

  .schedule-body-inner {
    padding: 14px 12px;
  }

  .schedule-header-title {
    font-size: 0.9rem;
  }

  .schedule-body-text {
    font-size: 0.8rem;
  }
}
