/* ===================================
   RESUMEN VISUAL SUPERIOR
   =================================== */

:root {
  /* Colores principales del sistema */
  --color: #29c178;
  --coloro: #29c17870;
  --coloro2: #29c17850;
  --colort: #ffffff;
  --colorto: #ffffffAA;
  --color2: #092825;
  --color2o: #09282570;
  --color2t: #ffffff;
  --color2to: #ffffffAA;

  /* Variables de compatibilidad */
  --primary-color: #29c178;
  --primary-dark: #092825;
  --text-primary: #2d3748;
  --text-secondary: #718096;
  --border-color: #e2e8f0;
  --success-color: #29c178;
  --info-color: #29c178;
  --warning-color: #29c178;
  --danger-color: #e53e3e;
  --bg-light: #f8f9fa;
  --bg-lighter: #f7fafc;
}

.resumen-container {
  margin: 20px 0;
  padding: 0;
}

.resumen-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 15px;
  margin-bottom: 20px;
}

.resumen-stat-card {
  background: white;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 15px;
  transition: all 0.3s ease;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.resumen-stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(117, 187, 173, 0.15);
  border-color: var(--primary-color);
}

.resumen-stat-icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f8f9fa;
  border-radius: 8px;
  flex-shrink: 0;
}

.resumen-stat-icon svg {
  width: 24px;
  height: 24px;
  stroke: #718096;
}

.resumen-stat-content {
  flex: 1;
}

.resumen-stat-value {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
  margin-bottom: 4px;
}

.resumen-stat-label {
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ===================================
   SISTEMA DE TABS
   =================================== */

.tabs-container {
  margin-top: 30px;
}

.tabs-header {
  display: flex;
  gap: 8px;
  border-bottom: 2px solid var(--border-color);
  margin-bottom: 0;
  flex-wrap: wrap;
  background: var(--bg-light);
  padding: 10px 10px 0 10px;
  border-radius: 8px 8px 0 0;
}

.tab-btn {
  background: transparent;
  border: none;
  padding: 12px 20px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  border-radius: 6px 6px 0 0;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid transparent;
  border-bottom: none;
  position: relative;
  top: 2px;
}

.tab-btn svg {
  transition: all 0.2s ease;
}

.tab-btn:hover {
  background: white;
  color: var(--text-primary);
  border-color: var(--border-color);
}

.tab-btn.active {
  background: white;
  color: var(--primary-color);
  border-color: var(--border-color);
  box-shadow: 0 -2px 4px rgba(0,0,0,0.05);
}

.tab-btn.active svg {
  stroke: var(--primary-color);
}

.tabs-content {
  background: white;
  border: 1px solid #e2e8f0;
  border-top: none;
  border-radius: 0 0 8px 8px;
  min-height: 400px;
  overflow: visible;
  position: relative;
}

.tab-pane {
  display: none;
  animation: fadeIn 0.3s ease;
  overflow: visible;
  position: relative;
}

.tab-pane.active {
  display: block;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ===================================
   BOTONES DE EXPORTAR MEJORADOS
   =================================== */

.export-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  border-bottom: 1px solid #e2e8f0;
  background: #f8f9fa;
  margin: -1px -1px 0 -1px;
}

.export-header .example-title {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: #2d3748;
}

.botonExportarExcel {
  background: var(--color);
  color: white;
  padding: 10px 20px;
  border-radius: 6px;
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
  box-shadow: 0 2px 4px rgba(41, 193, 120, 0.2);
}

.botonExportarExcel:hover {
  background: var(--color2);
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(41, 193, 120, 0.3);
  color: white;
  text-decoration: none;
}

.botonExportarExcel h4 {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
}

.botonExportarExcel svg {
  flex-shrink: 0;
}

/* ===================================
   FILTRO DE DURACIÓN MEJORADO
   =================================== */

.filtro-duracion-mejorado {
  display: flex;
  align-items: center;
  gap: 8px;
  background: white;
  padding: 8px;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  transition: all 0.2s ease;
}

.filtro-duracion-mejorado:focus-within {
  border-color: var(--color);
  box-shadow: 0 0 0 3px rgba(41, 193, 120, 0.1);
}

.filtro-select {
  border: 1px solid #e2e8f0;
  border-radius: 4px;
  padding: 6px 10px;
  font-size: 13px;
  color: #2d3748;
  background: white;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.filtro-select:focus {
  outline: none;
  border-color: var(--color);
}

.filtro-number {
  border: 1px solid #e2e8f0;
  border-radius: 4px;
  padding: 6px 10px;
  font-size: 13px;
  color: #2d3748;
  width: 80px;
  text-align: center;
  transition: all 0.2s ease;
}

.filtro-number:focus {
  outline: none;
  border-color: var(--color);
}

.filtro-clear-btn {
  background: #f7fafc;
  border: 1px solid #e2e8f0;
  border-radius: 4px;
  padding: 6px 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.filtro-clear-btn:hover {
  background: #fee;
  border-color: #fc8181;
  color: #e53e3e;
}

.filtro-clear-btn svg {
  stroke: currentColor;
}

/* Ocultar divs innecesarios del filtro antiguo */
.BuscarPorDuracion1,
.BuscarPorDuracion2,
.BuscarPorDuracion3 {
  display: contents;
}

/* ===================================
   GRÁFICOS RESPONSIVE MEJORADOS
   =================================== */

#GraficosDiv {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  margin-bottom: 30px;
}

#GraficosDiv1,
#GraficosDiv2 {
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

/* Desktop: Pie pequeño (30%) y Barras grande (70%) */
@media (min-width: 769px) {
  #GraficosDiv1 {
    flex: 0 0 30%;
    max-width: 30%;
  }

  #GraficosDiv2 {
    flex: 0 0 calc(70% - 20px);
    max-width: calc(70% - 20px);
  }
}

/* Mobile: Stack vertical */
@media (max-width: 768px) {
  #GraficosDiv {
    flex-direction: column;
  }

  #GraficosDiv1,
  #GraficosDiv2 {
    width: 100% !important;
    max-width: 100%;
    flex: 1;
  }

  .resumen-stats {
    grid-template-columns: repeat(2, 1fr);
  }

  .tabs-header {
    overflow-x: auto;
    flex-wrap: nowrap;
  }

  .tab-btn {
    white-space: nowrap;
  }
}

@media (max-width: 480px) {
  .resumen-stats {
    grid-template-columns: 1fr;
  }
}

/* ===================================
   MEJORAS GENERALES
   =================================== */

.TitleDiv {
  border-bottom: 2px solid #e2e8f0;
  padding-bottom: 10px;
  margin-bottom: 20px;
}

.TitleDiv .example-title {
  color: #2d3748;
  font-weight: 600;
  font-size: 16px;
  margin: 0;
}

/* Mejorar tablas dentro de tabs */
.tab-pane .TablaChecklist {
  padding: 20px;
  overflow: visible;
}

.tab-pane table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  overflow: hidden;
}

.tab-pane table th {
  background: var(--color);
  padding: 14px 20px;
  text-align: left;
  font-weight: 600;
  color: white;
  border-bottom: none;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.tab-pane table td {
  padding: 14px 20px;
  border-bottom: 1px solid #e2e8f0;
  font-size: 14px;
  color: #2d3748;
  vertical-align: middle;
}

.tab-pane table tbody tr {
  transition: all 0.2s ease;
}

.tab-pane table tbody tr:hover {
  background: #f8f9fa;
}

.tab-pane table tbody tr:last-child td {
  border-bottom: none;
}

.tab-pane table tfoot tr {
  background: #f8f9fa;
  font-weight: 600;
}

.tab-pane table tfoot td {
  padding: 14px 20px;
  color: #2d3748;
  border-top: 2px solid #e2e8f0;
  font-size: 14px;
}

.large-fontDuracion {
  color: var(--color) !important;
  font-weight: 600;
}

.large-fontCantidad {
  color: var(--color) !important;
  font-weight: 700;
  font-size: 15px;
}

/* Animaciones suaves */
* {
  scroll-behavior: smooth;
}

/* ===================================
   MODAL CHECKPOINT - DISEÑO SOBRIO
   =================================== */

/* Modal Header Simple */
.modal-header {
  background: white !important;
  border-bottom: 3px solid var(--color) !important;
  padding: 30px 35px !important;
  border-radius: 0 !important;
}

.modal-header h4 {
  color: #2d3748 !important;
  font-weight: 600 !important;
  font-size: 18px !important;
  letter-spacing: -0.3px;
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0;
}

.modal-header .close {
  color: #718096 !important;
  opacity: 1 !important;
  text-shadow: none !important;
  font-size: 28px !important;
  font-weight: 300 !important;
  transition: color 0.2s ease;
}

.modal-header .close:hover {
  color: #2d3748 !important;
}

/* Cards de Métricas Sobrias */
.modal-body > div:first-child {
  background: #f8f9fa !important;
  padding: 25px 35px !important;
  border-bottom: 1px solid #e2e8f0 !important;
}

.modal-body > div:first-child > .row {
  margin: 0 -10px;
}

.modal-body > div:first-child > .row > div {
  padding: 0 10px;
  margin-bottom: 20px;
}

.modal-body > div:first-child > .row > div > div {
  background: white !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 8px !important;
  padding: 25px !important;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05) !important;
  transition: all 0.2s ease;
  min-height: 110px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.modal-body > div:first-child > .row > div > div:hover {
  box-shadow: 0 2px 8px rgba(0,0,0,0.08) !important;
  border-color: var(--color) !important;
}

/* Números sobrios */
#modalTotalProcesos,
#modalDuracionPromedio,
#modalTasaConversion,
#modalProcesosEnCurso {
  color: var(--color) !important;
  font-weight: 700 !important;
  font-size: 32px !important;
  line-height: 1.2;
  margin-bottom: 8px;
}

/* Headers de Secciones Simples */
.modal-body h5 {
  font-weight: 600 !important;
  font-size: 15px !important;
  color: #2d3748 !important;
  margin-bottom: 20px !important;
  padding: 0 35px !important;
  margin-top: 25px !important;
}

/* Secciones con más padding */
.modal-body > div:not(:first-child) {
  padding: 0 35px 25px 35px !important;
}

/* Tablas Simples */
.table-responsive {
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
  border: 1px solid #e2e8f0;
}

.table {
  margin-bottom: 0 !important;
  border-collapse: separate;
  border-spacing: 0;
}

.table thead {
  background: var(--color) !important;
}

.table thead th {
  color: white !important;
  font-weight: 600 !important;
  font-size: 12px !important;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 14px 18px !important;
  border: none !important;
}

.table tbody tr {
  transition: background 0.2s ease;
  border-bottom: 1px solid #e2e8f0;
}

.table tbody tr:hover {
  background: #f8f9fa !important;
}

.table tbody td {
  padding: 12px 18px !important;
  border: none !important;
  vertical-align: middle;
  color: #2d3748;
  font-size: 13px;
}

/* Correlativo con color */
.table tbody td:first-child {
  font-weight: 600;
  color: var(--color);
}

/* Sin datos */
.table tbody td[colspan] {
  text-align: center !important;
  padding: 40px !important;
  color: #718096 !important;
  font-style: italic;
}

/* Gráficos simples */
#modalDistribucionUsuarios,
#modalDistribucionTemporal,
#modalDistribucionFormularios {
  background: white;
  border-radius: 8px;
  padding: 25px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
  border: 1px solid #e2e8f0;
  margin-bottom: 20px;
}

/* Modal Footer */
.modal-footer {
  background: #f8f9fa !important;
  border-top: 1px solid #e2e8f0 !important;
  padding: 20px 35px !important;
}

.modal-footer .btn-default {
  background: white;
  border: 1px solid #cbd5e0;
  color: #2d3748;
  font-weight: 500;
  padding: 10px 24px;
  border-radius: 6px;
  transition: all 0.2s ease;
}

.modal-footer .btn-default:hover {
  background: var(--color);
  color: white;
  border-color: var(--color);
}

/* Animación de entrada del modal */
#modalDetalleCheckpoint.modal.fade .modal-dialog {
  transform: scale(0.98);
  transition: transform 0.2s ease;
}

#modalDetalleCheckpoint.modal.show .modal-dialog {
  transform: scale(1);
}

/* Scrollbar simple */
.modal-body::-webkit-scrollbar {
  width: 8px;
}

.modal-body::-webkit-scrollbar-track {
  background: #f8f9fa;
}

.modal-body::-webkit-scrollbar-thumb {
  background: #cbd5e0;
  border-radius: 4px;
}

.modal-body::-webkit-scrollbar-thumb:hover {
  background: #a0aec0;
}

/* ===================================
   SECUENCIAS DE PROCESO
   =================================== */

.sequence-container {
  margin: 30px 0;
  padding: 0;
}

/* Estilos para secciones colapsables */
.collapsible-section {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  margin: 15px 0;
  overflow: visible;
  background: white;
  position: relative;
}

.collapsible-header {
  background: white;
  padding: 15px 20px;
  border-bottom: 2px solid #e2e8f0;
  transition: background 0.2s ease;
  border-top-left-radius: 8px;
  border-top-right-radius: 8px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.collapsible-header:hover {
  background: #edf2f7;
}

.collapse-icon {
  display: inline-block;
  font-size: 14px;
  font-weight: bold;
  color: var(--color);
  transition: transform 0.2s ease;
  width: 20px;
  text-align: center;
}

.collapsible-content {
  padding: 10px;
}

.sequence-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 25px;
  padding-bottom: 15px;
  border-bottom: 2px solid #e2e8f0;
}

.sequence-header h5 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: #2d3748;
}

.sequence-stats {
  font-size: 13px;
  color: #718096;
}

.sequences-content {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.sequence-card {
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
  transition: all 0.2s ease;
}

.sequence-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0,0,0,0.12);
  border-color: var(--color);
  cursor: pointer;
}

.sequence-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 15px;
  border-bottom: 1px solid #f7fafc;
}

.sequence-number {
  font-size: 14px;
  font-weight: 600;
  color: #2d3748;
}

.sequence-stats-inline {
  display: flex;
  gap: 20px;
  font-size: 12px;
}

.sequence-count {
  color: var(--color);
  font-weight: 600;
}

.sequence-percentage {
  color: #718096;
  font-weight: 500;
}

.sequence-duration {
  color: #2d3748;
  font-weight: 500;
}

/* Mini Timeline */
.mini-timeline {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  overflow-x: auto;
  padding: 10px 0;
  gap: 0;
}

.mini-timeline-node {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 120px;
  flex-shrink: 0;
}

.mini-node-circle {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: white;
  border: 2px solid var(--color);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
  transition: all 0.2s ease;
}

.mini-node-circle:hover {
  transform: scale(1.1);
  box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}

.mini-node-circle svg {
  width: 24px;
  height: 24px;
  stroke: var(--color);
}

.mini-node-label {
  margin-top: 10px;
  font-size: 11px;
  font-weight: 500;
  color: #2d3748;
  text-align: center;
  max-width: 110px;
  line-height: 1.3;
  word-wrap: break-word;
}

/* Flecha y duración entre nodos */
.mini-timeline-arrow {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 100px;
  position: relative;
  margin: 0 -10px;
}

.arrow-line {
  width: 100%;
  height: 3px;
  background: var(--color);
  position: relative;
}

.arrow-line::after {
  content: '';
  position: absolute;
  right: -6px;
  top: 50%;
  transform: translateY(-50%);
  width: 0;
  height: 0;
  border-left: 8px solid var(--color);
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
}

.arrow-duration {
  position: absolute;
  top: -25px;
  background: white;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 600;
  color: #2d3748;
  border: 1px solid #e2e8f0;
  white-space: nowrap;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

/* Responsive */
@media (max-width: 768px) {
  .sequence-card-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .sequence-stats-inline {
    flex-direction: column;
    gap: 5px;
  }

  .mini-timeline {
    justify-content: flex-start;
  }

  .mini-timeline-node {
    min-width: 100px;
  }

  .mini-node-circle {
    width: 40px;
    height: 40px;
  }

  .mini-node-circle svg {
    width: 20px;
    height: 20px;
  }

  .mini-timeline-arrow {
    min-width: 60px;
  }
}
