/* ==========================================================================
   Estilos Globales
   ========================================================================== */

.title-select {
  font-weight: bold;
  color: #000;
}

/* ==========================================================================
   Botones y Controles de Filtro
   ========================================================================== */

.no-caret-dropdown .dropdown-toggle::after {
  display: none !important;
}

.apply-button {
  border-radius: 25px;
  padding: 0.2rem 1rem;
  line-height: 1.5;
  background-color: #000;
  color: #fff;
  border: 1px solid #000;
  transition: background-color 0.2s, color 0.2s;
  box-shadow: none !important;
}

.apply-button:hover,
.apply-button:focus,
.apply-button.focus,
.apply-button:active {
  background: #ffffff !important;
  color: #000000 !important;
  border: 1px solid #000;
  box-shadow: none !important;
  outline: none !important;
}

.export-button {
  border-radius: 25px;
  padding: 0.2rem 1rem;
  line-height: 1.5;
  background-color: #ffffff;
  color: #000000;
  border: 1px solid #000;
  transition: background-color 0.2s, color 0.2s;
  box-shadow: none !important;
}

.export-button:hover,
.export-button:focus,
.export-button.focus,
.export-button:active {
  background: #000000 !important;
  color: #ffffff !important;
  border: 1px solid #000;
  box-shadow: none !important;
  outline: none !important;
}
.apply-button[disabled] {
  background: #000000 !important;
  color: #ffffff !important;
  border: 1px solid #000;
  box-shadow: none !important;
  outline: none !important;
  cursor: not-allowed;
}

.export-button[disabled] {
  background: #ffffff !important;
  color: #000000 !important;
  border: 1px solid #000;
  box-shadow: none !important;
  outline: none !important;
  cursor: not-allowed;
}

.export-button {
  border-radius: 25px;
  font-weight: 500;
  padding: 0.2rem 2rem;
  line-height: 1.5;
  background-color: #ffffff;
  color: #000000;
  border: 1px solid #000;
  transition: background-color 0.2s, color 0.2s;
  box-shadow: none !important;
}

.export-button:hover,
.export-button:focus,
.export-button:active,
.export-button.focus {
  background: #000000 !important;
  color: #ffffff !important;
  border: 1px solid #000;
  box-shadow: none !important;
  outline: rgb(255, 255, 255);
}

.custom-date-input {
  /* Propiedades que ya tenías */
  border-radius: 25px;
  border: 1px solid #000;
  height: 30px;
  max-width: 200px;
  box-sizing: border-box; /* Importante para que el padding no aumente el tamaño */

  /* 1. Vuelve a text-align para el centrado principal */
  text-align: center;

  /* 2. Ajusta el padding para dar espacio al texto */
  /* Le damos más padding a la izquierda para "empujar" el texto hacia el centro,
     dejando espacio a la derecha para el ícono del calendario. */
  padding-left: 1rem;
  padding-right: 0.5rem; /* Menos padding a la derecha */
}

.custom-date-input::-webkit-date-and-time-value {
  text-align: center;
  margin: auto; /* Truco adicional para el centrado */
}

.custom-date {
  text-align: center !important;
  border-radius: 25px;
  border: 1px solid #000;
  height: 30px;
  max-width: 200px;
}

.loading-overlay {
  position: fixed;
  inset: 0; /* top:0; right:0; bottom:0; left:0; */
  z-index: 1050;

  /* Centrado del spinner */
  display: flex;
  justify-content: center;
  align-items: center;

  /* Capa blanca semitransparente */
  background: rgba(255, 255, 255, 0.7);

  /* Desenfocar lo que hay detrás */
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px); /* Safari */
}

.no-caret-dropdown .dropdown-toggle::after {
  display: none !important;
}

.no-caret-dropdown .dropdown-menu {
  padding: 0 !important;
  min-width: auto !important;
}

.no-caret-dropdown .dropdown-item {
  text-align: center !important;
  padding: 0.5rem 0.75rem !important;
}

.no-caret-dropdown .dropdown-item:focus,
.no-caret-dropdown .dropdown-item:active {
  background-color: transparent !important;
  color: inherit !important;
  box-shadow: none !important;
}

/* --- Contenedor Principal de las Tabs --- */
#tabs-main {
  display: flex;
  overflow: hidden;
  border: 1px solid #000000 !important;
  border-radius: 25px;
  height: auto;
  box-shadow: none !important;
}

#tabs-main:focus,
#tabs-main:focus-within,
#tabs-main:active {
  outline: none !important;
  box-shadow: none !important;
}

/* --- Botones dentro de las Tabs (Base) --- */
#tabs-main .btn {
  background-color: white;
  color: black;
  border-radius: 0;
  padding: 0.4rem 2rem;
  transition: background-color 0.2s, color 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  border: none;
  box-shadow: none !important;
  outline: none !important;
  white-space: nowrap;
  border-right: 1px solid #000;
}

/* --- Divisores entre botones --- */
#tabs-main .btn:not(:first-child) {
  border-left: 1px solid #000;
  border-right: 1px solid #000;
}

/* --- Estado Activo y Hover --- */
#tabs-main .btn.active {
  background-color: black;
  color: white;
  box-shadow: none !important;
}

#tabs-main .btn:not(.active):hover {
  background-color: #f0f0f0;
}

#tabs-main .btn.last-tab-button {
  border-right: none !important;
}
#tabs-main .btn:last-child {
  border-right: none !important;
}
/* Elimina el foco de los botones individuales */
#tabs-main .btn:focus {
  box-shadow: none !important;
  outline: none !important;
}
/* ==========================================================================
   Estilos para los Selectores Dropdown (Pacientes y Pestañas Móvil)
   ========================================================================== */

/* 1. Definimos los anchos específicos para cada selector */
.custom-select-patient {
  height: 30px;
  width: 340px;
}

.custom-select-tabs {
  height: 30px;
  max-width: 200px;
  width: 100%;
}

/* 3. Aplicamos los estilos visuales a la caja principal de ambos Dropdowns */
.custom-select-patient .Select-control,
.custom-select-tabs .Select-control {
  height: 30px !important;
  min-height: 30px !important;
  border-radius: 25px !important;
  border: 1px solid #000 !important;
  box-shadow: none !important;
  background-color: white !important;
}

.custom-select-patient .Select-input,
.custom-select-tabs .Select-input {
  height: 30px !important;
  min-height: 30px !important;
}

/* 4. Estilos para el texto (placeholder y valor seleccionado) en ambos Dropdowns */
.custom-select-patient .Select-placeholder,
.custom-select-patient .Select-value,
.custom-select-tabs .Select-placeholder,
.custom-select-tabs .Select-value {
  line-height: 18px !important;
  padding-left: 15px !important;
  font-size: 1rem !important;
  align-content: center;
}

/* 5. Estilos de foco para ambos Dropdowns */
.custom-select-patient.is-focused:not(.is-open) > .Select-control,
.custom-select-tabs.is-focused:not(.is-open) > .Select-control {
  box-shadow: none !important;
  border: 1px solid #000 !important;
}

/* 6. Estilos para el menú desplegable de ambos Dropdowns */
.custom-select-patient .Select-menu-outer,
.custom-select-tabs .Select-menu-outer {
  margin-top: 8px !important;
  border-radius: 12px !important;
  overflow: hidden;
}

/* Estilos para las OPCIONES individuales en el menú desplegable */
.custom-select-patient .Select-option,
.custom-select-tabs .Select-option {
  line-height: 1.2 !important;
  padding-top: 4px !important;
  padding-bottom: 4px !important;
  padding-left: 15px !important;
  font-size: 0.9rem !important;
}

.custom-select-patient .Select-menu,
.custom-select-tabs .Select-menu {
  padding: 0 !important;
}

.custom-select-patient .Select-menu-outer {
  line-height: 1 !important;
}
/* ==========================================================================
   REGLAS RESPONSIVE
   ========================================================================== */

/* --- Vista de Escritorio (≥ 768px) --- */
@media (min-width: 768px) {
  #tabs-main {
    height: 30px;
    max-width: 100%;
    flex-wrap: nowrap;
  }
  #tabs-main .btn {
    flex: 0 1 auto;
    font-size: 1rem;
  }
}

#tabs-content {
  /* Añade un margen superior para separarlo del título y el botón */
  margin-top: 3rem;
}

/* --- Vista Móvil (≤ 576px) --- */
@media (max-width: 576px) {
  /* 1. Estilos para los controles de filtro */
  /* La clase w-100 en los botones ya hace que ocupen el 100% de su columna (xs=3) */
  .custom-date-input {
    width: 100%;
  }

  .custom-date-input,
  .apply-button,
  .export-button {
    height: 25px;
    font-size: 0.65rem;
    padding: 0 5px;
    box-sizing: border-box;
    white-space: nowrap; /* Evita que el texto de los botones se parta */
  }

  /* 2. Título de la sección */
  .title-select {
    text-align: center;
    font-size: 1rem;
    margin-bottom: 0.5rem; /* Pequeño espacio antes de la fila de controles */
  }

  /* --- Mantenemos los otros estilos de móvil --- */
  .no-caret-dropdown .dropdown-item {
    font-size: 0.85rem;
    padding-top: 0.4rem !important;
    padding-bottom: 0.4rem !important;
  }
  .custom-select-tabs .Select-control {
    height: 25px !important;
    min-height: 25px !important;
  }
  .custom-select-tabs .Select-value {
    line-height: 25px !important;
  }

  .custom-select-patient {
    height: 25px !important;
  }

  .custom-select-patient .Select-control {
    height: 25px !important;
    min-height: 25px !important;
    border-radius: 25px !important;
    border: 1px solid #000 !important;
    box-shadow: none !important;
    background-color: white !important;
    width: 250px !important;
  }

  .custom-select-patient .Select-input,
  .custom-select-tabs .Select-input {
    height: 25px !important;
    min-height: 25px !important;
  }
}

.custom-select-patient .Select-menu-outer {
  line-height: 1 !important;
}

.export-button-icon {
  position: absolute; /* Posicionamiento absoluto relativo al contenedor .tabs-content */
  top: 6rem; /* Espacio desde arriba */
  right: 1rem; /* Espacio desde la derecha */

  background-color: black !important; /* Fondo negro */
  color: white !important; /* Icono blanco */
  border: none !important; /* Sin borde */

  width: 25px; /* Ancho fijo */
  height: 25px; /* Alto fijo */
  border-radius: 50% !important; /* ¡Esto lo hace redondo! */

  display: flex; /* Para centrar el icono */
  justify-content: center;
  align-items: center;

  z-index: 10; /* Para que esté por encima del contenido de la pestaña */

  /* Efecto de transición suave */
  transition: background-color 0.2s ease-in-out, transform 0.2s ease-in-out;
}

.export-button-icon:hover {
  background-color: #333 !important; /* Un poco más claro al pasar el mouse */
  transform: scale(1.05); /* Ligeramente más grande al pasar el mouse */
}

.export-button-icon i {
  font-size: 0.9rem; /* Tamaño del icono */
}

/* Contenedor principal de la cabecera (para desktop y móvil) */
.tab-header-container {
  /* Usamos Flexbox para el control del layout */
  display: flex;

  /* Por defecto (desktop), alineamos al centro y con espacio entre elementos */
  align-items: center; /* ALINEACIÓN VERTICAL */
  justify-content: space-between; /* Espacio entre título y botón */

  /* Espaciado general */
  padding: 1rem; /* Padding interno para que no se pegue a los bordes */
  gap: 1rem; /* Espacio mínimo entre título y botón */
}

/* Título de la pestaña (para desktop y móvil) */
.active-tab-title {
  /* Estilos de fuente */
  font-size: 1.2rem;
  font-weight: 600;
  color: #333;
  line-height: 1.3; /* Buen espaciado entre líneas si hay salto */

  /* Importante: Quitamos el control de salto de línea de aquí */
  /* Lo manejaremos en las reglas específicas de desktop/móvil */
}

/* Botón de exportar (para desktop y móvil) */
.export-button-icon {
  /* Estilos visuales */
  background-color: black !important;
  color: white !important;
  border: none !important;
  width: 40px;
  height: 40px;
  border-radius: 50% !important;

  /* Centrado del icono */
  display: flex;
  justify-content: center;
  align-items: center;

  /* Para que el botón no se encoja si el título es muy largo */
  flex-shrink: 0;
}

.export-button-icon i {
  font-size: 1rem;
}
/* Contenedor principal de la cabecera */
.tab-header-container {
  display: flex;
  align-items: center;
  padding: 1rem;
  position: relative;
  height: auto;
  min-height: 40px;
}

/* Título de la pestaña */
.active-tab-title {
  width: 100%;
  text-align: center;
  font-size: 1.2rem;
  font-weight: 400;
  color: #333;
  line-height: 1.3;

  /* Permitimos salto de línea */
  white-space: normal;
}

/* Botón de exportar */
.export-button-icon {
  position: absolute;
  right: 1rem;
  background-color: black !important;
  color: white !important;
  border: none !important;
  width: 30px;
  height: 30px;
  border-radius: 50% !important;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-shrink: 0;
}

.export-button-icon i {
  font-size: 0.8rem;
}

/* --- VISTA MÓVIL (pantallas más pequeñas que 767.98px) --- */
@media (max-width: 767.98px) {
  #tabs-content-wrapper {
    padding-top: 1rem;
  }

  .tab-header-container {
    flex-direction: column;
    align-items: end;
    padding: 0 1rem;
  }

  .active-tab-title {
    /* En móvil, el título ya no necesita estar centrado ni ocupar todo el ancho */
    text-align: center;
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
    margin-top: 10px;
  }

  .export-button-icon {
    /* En móvil, el botón vuelve al flujo normal del layout en columna */
    position: static;
  }

  #tabs-content {
    margin-top: 1rem;
  }
}
