/* ===== Tabs modernos (formal + limpio) ===== */
:root {
  --brand-dark: #1a524f;
  --brand-primary: #2e7d32;
  --brand-accent: #4caf50;
  --tab-bg: #ffffff;
  --tab-border: #e9ecef;
  --tab-text: #30424a;
}

.tabs-modern {
  gap: 0.5rem;
  border-bottom: 0 !important;
  background: var(--tab-bg);
  padding: 0.35rem;
  border-radius: 14px;
  box-shadow: inset 0 0 0 1px var(--tab-border);
}

.tabs-modern .nav-item {
  margin: 0 0.15rem;
}

.tabs-modern .nav-link {
  position: relative;
  border: 0 !important;
  border-radius: 12px !important;
  color: var(--tab-text);
  font-weight: 600;
  letter-spacing: 0.2px;
  padding: 0.65rem 0.9rem;
  transition: all 0.2s ease;
  background: transparent;
  /* sutil borde interior al pasar */
  box-shadow: inset 0 0 0 1px transparent;
}

.tabs-modern .nav-link:hover {
  color: var(--brand-dark);
  background: rgba(76, 175, 80, 0.06);
  box-shadow: inset 0 0 0 1px rgba(76, 175, 80, 0.25);
}

.tabs-modern .nav-link.active {
  color: #fff !important;
  background: #e7607b;
  box-shadow:
    0 6px 16px rgba(26, 82, 79, 0.18),
    inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.tabs-modern .nav-link.active::after {
  content: "";
  position: absolute;
  left: 10%;
  right: 10%;
  bottom: -6px;
  /* delicado indicador bajo el tab activo */
  height: 4px;
  border-radius: 4px;
  background: #e7607b;
  filter: saturate(1.1);
}

/* Accesibilidad: foco visible y elegante */
.tabs-modern .nav-link:focus-visible {
  outline: none;
  box-shadow:
    0 0 0 3px rgba(76, 175, 80, 0.15),
    inset 0 0 0 1px rgba(76, 175, 80, 0.35);
}

/* Tabs “bordered” de Bootstrap suelen agregar líneas.
   Las limpiamos para este estilo. */
.nav-bordered .nav-link {
  border: 0 !important;
}

.nav-bordered {
  border-bottom: 0 !important;
}

/* Responsive: asegúrate que los tabs no se rompan en móviles */
@media (max-width: 576px) {
  .tabs-modern .nav-link {
    padding: 0.55rem 0.65rem;
    font-weight: 600;
  }
}

/* Columna 4 = Observaciones (th/td) */
#basic-datatable th:nth-child(8),
#basic-datatable td:nth-child(8) {
  width: 380px;
  /* ← ajusta: 320–480px suele ir bien */
}

/* Truncado en múltiples líneas (3 líneas) con ellipsis */
#basic-datatable td:nth-child(8) {
  white-space: normal;
  /* permite saltos de línea */
  word-break: break-word;
  /* corta palabras largas */
  overflow: hidden;

  display: -webkit-box;
  /* line-clamp */
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  /* ← nº de líneas visibles */
}

/* ====== Panel moderno (colores de marca) ====== */
.modern-shell {
  --brand-1: #1a524f;
  --brand-2: #2e7d32;
  --brand-3: #4caf50;
  --ring: rgba(255, 255, 255, 0.45);

  position: relative;
  border: 0;
  border-radius: 1rem;
  /* 2xl */
  padding: 1rem 1rem 1.25rem;
  color: #fff;
  background: #4a4c50;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.18);
  overflow: hidden;

  /* nitidez texto */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* brillo sutil superior */
.modern-shell::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(
      1200px 400px at -10% -20%,
      rgba(255, 255, 255, 0.18),
      transparent 55%
    ),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.1), rgba(0, 0, 0, 0));
  pointer-events: none;
}

/* overlay sin blur para conservar nitidez */
.modern-shell::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.04),
    rgba(0, 0, 0, 0)
  );
  pointer-events: none;
}

@media (min-width: 768px) {
  .modern-shell {
    padding: 1.25rem 1.25rem 1.5rem;
  }
}

/* ====== Formularios dentro del panel ====== */
.modern-shell .form-label {
  color: #eaf7ef;
  font-weight: 600;
  letter-spacing: 0.2px;
  margin-bottom: 0.35rem;
}

.modern-shell .form-select,
.modern-shell .form-control {
  color: #fff;
  background-color: rgba(0, 0, 0, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 0.75rem;
}

.modern-shell .form-select:focus,
.modern-shell .form-control:focus {
  color: #fff;
  background-color: rgba(0, 0, 0, 0.24);
  border-color: rgba(255, 255, 255, 0.55);
  box-shadow: 0 0 0 0.2rem var(--ring);
}

/* Opciones del select legibles al abrir el menú nativo */
.modern-shell .form-select option {
  color: #111;
}

/* Mensajes de error sobre fondo oscuro */
.modern-shell .invalid-feedback {
  color: #ffecec;
}

/* Ajuste vertical para alinear controles al final de la fila si usas .align-items-end en .row */
.modern-shell .mb-3 {
  margin-bottom: 0.9rem !important;
}

/* ====== Botón con gradiente de marca ====== */
.btn-gradient-brand {
  --btn-shadow: rgba(0, 0, 0, 0.25);
  background: #6FAE37;
  color: #fff;
  border: 0;
  border-radius: 999px;
  padding: 0.85rem 1.25rem;
  font-weight: 700;
  letter-spacing: 0.3px;
  box-shadow: 0 10px 18px var(--btn-shadow);
  transition:
    transform 0.12s ease,
    box-shadow 0.12s ease,
    filter 0.2s ease;
}

.btn-gradient-brand:hover {
  transform: translateY(-1px);
  filter: brightness(1.03);
  background-color: #4caf50;
}

.btn-gradient-brand:active {
  transform: translateY(0);
  box-shadow: 0 6px 12px var(--btn-shadow);
}

@media (prefers-reduced-motion: reduce) {
  .btn-gradient-brand {
    transition: none;
  }
}

/* opcional: estilo para botón solo-icono */
.btn-icon {
  width: 4.25rem;
  height: 2.25rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border-radius: 0.5rem;
}

#basic-datatable-asig td.dtr-control {
  cursor: pointer;
}

#basic-datatable-asig td.dtr-control::before {
  margin-right: 0.4rem;
}

/* Tabla moderna */
.table-modern {
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.table-modern thead {
  background: linear-gradient(135deg, #34495e, #2c3e50);
  color: #fff;
  font-size: 1rem;
  text-align: center;
}

.table-modern tbody tr {
  transition: background-color 0.2s ease-in-out;
}

.table-modern thead tr th {
  color: #fff !important;
}

.table-modern tbody tr:hover {
  background-color: #f0f5f5;
}
.form-select {
  text-transform: uppercase;
}

.body-fondo {
  background-image: url("assets/images/fondo-x.png");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  /* opcional: que el fondo no se desplace al hacer scroll */
  /* background-attachment: fixed; */
}

/* Evita scroll horizontal global dentro del modal fullscreen */
#fullscreeexampleModal,
#fullscreeexampleModal .modal-dialog,
#fullscreeexampleModal .modal-content,
#fullscreeexampleModal .modal-body {
  overflow-x: hidden;
}

/* Estructura en columna para que header y footer fijen su alto y el body crezca */
#fullscreeexampleModal .modal-content {
  display: flex;
  flex-direction: column;
}

#fullscreeexampleModal .modal-header,
#fullscreeexampleModal .modal-footer {
  flex: 0 0 auto;
}

#fullscreeexampleModal .modal-body {
  flex: 1 1 auto;
  /* ocupa el resto */
  min-height: 0;
  /* permite que los hijos gestionen su scroll */
  padding-bottom: 1rem;
  /* pequeño respiro */
}

/* La fila ocupa todo el alto disponible */
#fullscreeexampleModal .modal-body .row {
  height: 100%;
  margin-right: 0;
  /* cinturón y tirantes para evitar overflow */
  margin-left: 0;
}

/* Columnas a 100% de alto */
#fullscreeexampleModal .modal-body .col-12,
#fullscreeexampleModal .modal-body .col-lg-6 {
  height: 100%;
}

/* Tarjeta izquierda (profile) y derecha deben poder hacer scroll vertical interno si crecen */
.mdocs-profile,
.mdocs-right {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow-y: auto;
  overflow-x: auto;

  /* sin scroll horizontal interno */
}

/* Estilo de “card” para la izquierda */
.mdocs-profile {
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 16px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.04);
}

/* Título */
/* Tokens (ajústalos a tu paleta) */
:root {
  --brand-700: #1a524f;
  --brand-500: #4caf50;
  --brand-300: #90d7a1;
  --text-strong: #1f2937;
  /* gris oscuro elegante */
}

/* Título principal */
.mdocs-name {
  /* tipografía */
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: 0.2px;

  /* tamaño fluido (se adapta de móvil a desktop) */
  font-size: clamp(1.125rem, 1rem + 1.2vw, 1.75rem);
  color: #fff;

  /* micro-detalle de elegancia sin recargar */
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.02);
  margin-bottom: 0.35rem;
  /* compacta ligeramente */
}

/* Variante compacta si el espacio es reducido (opcional) */
.mdocs-name.is-compact {
  font-size: clamp(1rem, 0.95rem + 0.8vw, 1.375rem);
  letter-spacing: 0.1px;
}

/* Soporte dark mode */
@media (prefers-color-scheme: dark) {
  :root {
    --text-strong: #e5e7eb;
  }

  .mdocs-name {
    text-shadow: 0 1px 0 rgba(0, 0, 0, 0.15);
    color: #fff;
  }
}

/* Truncado elegante en una línea (opcional) */
.mdocs-name.truncate-1 {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Imagen más chica y centrada */
.mdocs-photo {
  display: flex;
  justify-content: center;
}

.mdocs-photo-sm {
  width: 140px;
  height: 140px;
  object-fit: cover;
  display: block;
  border-radius: 16px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.06);
}

/* Previene desbordes por imágenes u otros elementos */
#fullscreeexampleModal img {
  max-width: 100%;
  height: auto;
}

/* Opcional: ajustes finos */
.mdocs-header {
  --bs-border-opacity: 0.25;
  background-color: #4d4d4d;
}

@media (max-width: 420px) {
  .mdocs-header {
    flex-wrap: wrap;
    row-gap: 0.25rem;
  }

  .mdocs-brand {
    width: 100%;
    display: flex;
    justify-content: flex-end;
  }
}

@media (prefers-color-scheme: dark) {
  .mdocs-id {
    color: rgba(255, 255, 255, 0.7) !important;
  }
}

/* Truncado a 2 líneas para el key/ruta */
.text-truncate-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Opcional: asegura que las miniaturas no rompan el layout */
.mdocs-thumb,
.mdocs-thumb img {
  max-width: 56px;
  /* ajusta a tu tamaño */
  max-height: 56px;
  object-fit: cover;
  border-radius: 0.5rem;
}

/* Oculta tabs */
a[href="#hospital-b2"],
a[href="#medicos-b2"] {
  display: none !important;
}

/* Oculta contenido */
#hospital-b2,
#medicos-b2 {
  display: none !important;
}
