* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

hr {
    border: none;
    height: 5px;
    background: linear-gradient(to right, #1e3a8a, #60a5fa);
}

.titulos{
    text-align: left;
    background: linear-gradient(to right, #1e3a8a, #60a5fa);
    padding: 10px;
    color: white;
    margin: 10px;
    margin-bottom: 40px;
    font-size: 1.5rem;
    text-transform: uppercase;
    font-weight: bold;
    padding-left: 20px;
}

/* ================================================= HEADER STYLES =================================================*/
.menu-dropdown {
    position: relative;
}

.menu-btn {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    padding: 10px 16px;
    border-radius: 10px;
    font-size: 0.95rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: 0.2s;
}

.menu-btn:hover {
    background: #3b82f640;
}

.dropdown-content {
    display: none;
    position: absolute;
    right: 0;
    top: 125%;
    background: linear-gradient(135deg, #274797, #0c1322); /* mismo estilo header */
    min-width: 360px;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    z-index: 2000;
}

.dropdown-content a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    color: white;
    text-decoration: none;
    font-size: 0.9rem;
    transition: 0.2s;
}

.dropdown-content a:hover {
    background: #2193f3
}

.dropdown-content hr {
    margin: 5px 0;
    border: none;
    border-top: 1px solid #e5e7eb;
}

.dropdown-content.show {
    display: block;
}

/* Logout rojo dentro del dropdown */
.dropdown-content .logout-link {
    color: #e6c7c7;
}

.app-header {
    width: 100%;
    min-height: 65px;
    background: linear-gradient(135deg, #2193f3, #0f172a); /* azul claro → azul oscuro */
    color: white;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 28px;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.18);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.app-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: white;
}

.app-brand img {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: 12px;
    border: 2px solid rgba(255, 255, 255, 0.35);
}

.app-name {
    display: block;
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.app-brand small {
    display: block;
    font-size: 0.75rem;
    color: #d1fae5;
    margin-top: -2px;
}

.app-nav {
    display: flex;
    align-items: center;
    gap: 8px;
}

.app-nav a {
    color: #ecfeff;
    text-decoration: none;
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 0.95rem;
    transition: all 0.2s ease;
}

.app-nav a:hover {
    background: rgba(255, 255, 255, 0.14);
    color: white;
    transform: translateY(-1px);
}

.app-nav i {
    margin-right: 6px;
}

.logout-link {
    background: rgba(220, 38, 38, 0.85);
}

.logout-link:hover {
    background: #dc2626 !important;
}

.menu-toggle {
    display: none;
    background: transparent;
    border: none;
    color: white;
    font-size: 1.5rem;
}

/* Responsive */
@media (max-width: 768px) {
    .app-header {
        padding: 12px 18px;
        flex-wrap: wrap;
    }

    .menu-toggle {
        display: block;
    }

    .app-nav {
        display: none;
        width: 100%;
        flex-direction: column;
        align-items: stretch;
        margin-top: 14px;
    }

    .app-nav.show {
        display: flex;
    }

    .app-nav a {
        width: 100%;
        padding: 12px;
    }
}
/* ================================================= END HEADER STYLES =================================================*/

/** ================================================    PAGINA INICIO LOGIN     ***************************/
.login-wrapper {
    min-height: calc(100vh - 70px); /* resta altura del header */
    display: flex;
    justify-content: center;
    align-items: center;
    background: #f1f5f9; /* fondo suave */
}

.login-container {
    background: white;
    padding: 35px;
    border-radius: 14px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
    width: 100%;
    max-width: 400px;
}

.login-container h2 {
    text-align: center;
    margin-bottom: 20px;
    color: #1e3a8a;
}

.login-container label {
    font-weight: 600;
    margin-top: 10px;
}

.login-container input {
    width: 100%;
    padding: 10px;
    margin-top: 5px;
    margin-bottom: 12px;
    border-radius: 8px;
    border: 1px solid #cbd5e1;
}

.login-container button {
    width: 100%;
    padding: 10px;
    background: #1e3a8a;
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    margin-top: 10px;
}

.login-container button:hover {
    background: #1d4ed8;
}

.link {
    text-align: center;
    margin-top: 12px;
}

.error-msg {
    color: #dc2626;
    margin-bottom: 10px;
    text-align: center;
}
/*** ================================================   PAGINA LOGIN   END  ***************************/

/*** ================================================   PAGINA DASHBOARD  ***************************/
.dashboard-container {
    padding: 20px;
    max-width: 1000px;
    margin: auto;
}
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-top: 30px;
}
.card {
    background: white;
    border-radius: 10px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transition: transform 0.2s ease;
}
.card:hover {
    transform: scale(1.03);
}
.card a {
    text-decoration: none;
    color: #004080;
    font-weight: bold;
}

/***************************     PESTA;A SUPERIOR     ***************************/
.tab-buttons {
    display: flex;
    justify-content: center;
    gap: 10px;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background-color: white;
    padding: 17px 17px 2px 17px;
    border-bottom: 1px solid #ccc;
    margin-top: 65px;
    flex-wrap: wrap;
}

.tab-btn {
    padding: 10px 20px;
    background: linear-gradient(135deg, #7cbef5, #3ea3f5);
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
}

.tab-btn.active {
  background: linear-gradient(135deg, #0f172a, #2193f3);
  color: white;
  font-weight: bold;
  border-bottom: 2px solid #333;
}

.tab-content {
    display: none;
}
.tab-content input[type="text"],
.tab-content input[type="number"],
.tab-content select {
    width: 100%;
    margin-bottom: 12px;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 6px;
}

/* Animación de desvanecimiento opcional */
.fade-out {
  transition: opacity 1s ease;
  opacity: 0;
}

/*********************************************     REGISTRO PACIENTE     ***************************/

.tabs-container {
  width: 100%;
  max-width: 100%;
  padding: 20px;
  margin: 0;
  background: linear-gradient(135deg, #e5e9f3,#c9e9fc);
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  min-height: calc(100vh - 65px);
  overflow-y: auto;
  position: relative;
  padding-bottom: 100px !important;
}

.form-row {
    display: flex;
    gap: 20px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.form-group {
    flex: 1;
    min-width: 200px;
}

.form-group label {
    display: block;
    font-weight: bold;
    margin-bottom: 5px;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 6px;
}

.registro-consulta {
  padding-bottom: 10px !important;
}
/*******************************************************     EDITAR PACIENTE     ***************************/
.accordion-section {
  margin-top: 18px;
  border-radius: 14px;
  border: 2px solid #2193f3;
  overflow: hidden;
  background: #ffffff;
}

.accordion-header {
  width: 100%;
  background: linear-gradient(135deg, #e5e9f3,#afdffa);
  color: #0f172a;
  border: none;
  padding: 14px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
}

.accordion-header:hover {
  background: #bfdbfe;
}

.accordion-title {
  display: flex;
  flex-direction: column;
  text-align: left;
}

.accordion-title strong {
  font-size: 1rem;
  color: #1e3a8a;
}

.accordion-title small {
  font-size: 0.8rem;
  color: #475569;
  margin-top: 2px;
}

.accordion-action {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #1e3a8a;
  color: white;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
}

.accordion-icon {
  font-size: 1.2rem;
  font-weight: bold;
}

.accordion-content {
  display: none;
  padding: 18px;
  background: #f8fcff;
  border-top: 1px solid #bfdbfe;
}

.accordion-content.show {
  display: block;
}

#form_editar_paciente {
  padding-bottom: 90px !important;
}

.alergias-box {
  border: 1px solid #ddd;
  padding: 12px;
  border-radius: 12px;
  background: #fafafa;
}

.titulo-alergias {
  font-weight: bold;
  display: block;
  margin-bottom: 8px;
}

.alergias-col1 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;   
  gap: 10px;
  margin-bottom: 10px;
}

.alergias-col2 {
  display: grid;
  grid-template-columns: 1fr 1fr;   
  gap: 10px;
  margin-bottom: 10px;
}

.input-buscar-alergia,
.input-alergia-manual,
.campo-reaccion-general input {
  width: 100%;
  padding: 8px;
  border: 1px solid #bbb;
  border-radius: 8px;
}

.campo-reaccion-general {
  margin-bottom: 10px;
}

.campo-reaccion-general label {
  font-size: 13px;
  font-weight: bold;
}

.lista-alergias-compacta {
  max-height: 50px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 4px;
  border: 1px solid #ddd;
  border-radius: 8px;
  background: white;
}

.item-alergia-farmaco {
  font-size: 13px;
  padding: 6px 8px;
  border-radius: 8px;
  background: #f3f4f6;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.item-alergia-farmaco input[type="checkbox"] {
  order: 2;
  margin-left: 10px;
}

.item-alergia-farmaco span {
  order: 1;
}

.item-alergia-farmaco.seleccionado {
  background: #fee2e2;
  border: 1px solid #b91c1c;
  color: #7f1d1d;
  font-weight: bold;
}

.alergias-resumen {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.badge-alergia {
  background: #b91c1c;
  color: white;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: bold;
}
/***    CHECK BOX    *****/
.resp-check-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
  gap: 10px;
}

.resp-item {
  background: #f9fafb;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 8px;
}

.resp-item label {
  font-weight: bold;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.resp-item input[type="text"] {
  margin-top: 6px;
  width: 100%;
  display: none;
}

@media (max-width: 700px) {
  .alergias-row {
    grid-template-columns: 1fr;
  }
}

.cirugias-box {
  width: 100%;
}

.cirugia-previa-row {
  display: grid;
  grid-template-columns: 1.4fr 0.9fr 1fr 1.2fr 38px;
  gap: 8px;
  align-items: center;
  margin-bottom: 6px;
}

.cirugia-previa-row input {
  width: 100%;
  padding: 7px;
  border: 1px solid #bbb;
  border-radius: 8px;
  font-size: 13px;
}

.btn-agregar-cirugia {
  margin-top: 6px;
  padding: 7px 12px;
  border: none;
  border-radius: 8px;
  background: #1f2937;
  color: white;
  cursor: pointer;
  font-size: 13px;
}

.btn-eliminar-cirugia {
  border: none;
  border-radius: 8px;
  background: #b91c1c;
  color: white;
  cursor: pointer;
  height: 34px;
}

@media (max-width: 900px) {
  .cirugia-previa-row {
    grid-template-columns: 1fr;
  }
}

.cirugia-previa-header {
  display: grid;
  grid-template-columns: 1.4fr 0.9fr 1fr 1.2fr 38px;
  gap: 8px;
  margin-bottom: 6px;
  font-size: 12px;
  font-weight: bold;
  color: #555;
  padding: 0 4px;
}
/***    diabetes hipertension    *****/
/* ===================== METABÓLICOS ===================== */
/* ================= METABÓLICOS: LAYOUT SIMÉTRICO ================= */

#metabolicos .diabetes-layout {
  display: grid;
  grid-template-columns: 480px 1fr;
  gap: 18px;
  align-items: start;
}

#metabolicos .diabetes-lateral {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

#metabolicos .diabetes-campo {
  min-height: auto;
}

#metabolicos .detalle-resp {
  margin-top: 10px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
}

#metabolicos .detalle-resp label {
  margin-top: 4px;
  font-size: 12px;
  color: #334155;
}

#metabolicos .detalle-resp select,
#metabolicos .detalle-resp input {
  width: 100%;
  margin-bottom: 6px;
}

#metabolicos .diabetes-medicamentos {
  background: #f9fafb;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 8px;
}

#metabolicos .diabetes-header,
#metabolicos .diabetes-row {
  display: grid;
  grid-template-columns: 1.4fr 0.8fr 1fr 38px;
  gap: 8px;
  align-items: center;
}

#metabolicos .metabolicos-secundarios {
  display: grid;
  grid-template-columns: repeat(2, minmax(440px, 1fr));
  gap: 14px;
  margin-top: 16px;
}

#metabolicos .metabolicos-secundarios .resp-item {
  min-height: auto;
}

@media (max-width: 950px) {
  #metabolicos .diabetes-layout {
    grid-template-columns: 1fr;
  }

  #metabolicos .metabolicos-secundarios {
    grid-template-columns: 1fr;
  }
}
/***************************     LISTA PACIENTE     ***************************/
.titulo-seccion {
  font-size: 1.8rem;
  margin-bottom: 20px;
  color: #2c3e50;
}

.tabla-contenedor {
  overflow-x: auto;
  background-color: #fff;
  padding: 15px;
  border-radius: 10px;
  box-shadow: 0 0 10px #ddd;
}

.tabla-pacientes {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.tabla-pacientes th,
.tabla-pacientes td {
  padding: 12px 16px;
  border-bottom: 1px solid #ddd;
  text-align: left;
}

.tabla-pacientes th {
  background-color: #f2f2f2;
  font-weight: bold;
  color: #333;
}

.tabla-pacientes tr:hover {
  background-color: #f9f9f9;
}

.btn-accion {
  margin-right: 8px;
  color: #007BFF;
  text-decoration: none;
  font-weight: bold;
}

.btn-accion:hover {
  text-decoration: underline;
}

.btn-eliminar {
  color: #d9534f;
}

.busqueda-paginacion {
  margin-bottom: 15px;
  margin-top: 15px;
  margin-left: 25px;
}

.buscador-input {
  padding: 8px 12px;
  width: 100%;
  max-width: 300px;
  border: 1px solid #ccc;
  border-radius: 6px;
}

.paginacion {
  margin-top: 20px;
  text-align: center;
}

.paginacion button {
  background-color: #e0e0e0;
  border: none;
  padding: 6px 12px;
  margin: 0 4px;
  cursor: pointer;
  border-radius: 4px;
}

.paginacion button.active {
  background-color: #007BFF;
  color: white;
}

.paginacion button:hover {
  background-color: #cfcfcf;
}

.consulta-card {
  border: 1px solid #ddd;
  padding: 15px;
  margin-bottom: 20px;
  border-radius: 8px;
  background: #fff;
}

.form-grid {
  display: flex;
  gap: 20px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.form-grid.columnas-3 > div {
  flex: 1 1 30%;
}

textarea {
  width: 100%;
  resize: vertical;
}

button[type="submit"] {
  margin-top: 15px;
  padding: 10px 20px;
}

.form-card {
  background: #c9e9fc;
  padding: 10px;
  border-radius: 10px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.1);
  margin-bottom: 1px;
}

.form-grid {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.form-grid.columnas-3 > div {
  flex: 1 1 30%;
}

textarea {
  width: 100%;
  resize: vertical;
}

.form-group3 {
  min-width: 240px;
  font-size: 18px;
}

#label2 {
  font-weight: bold;
}

/************************  HISTORIAL PACIENTE     ********************************** */
  .seccion-titulo {
    font-size: 1.2rem;
    font-weight: bold;
    color: #004080;
    margin-bottom: 10px;
    border-left: 5px solid #004080;
    padding-left: 10px;
  }

/************************  HISTORIAL PACIENTE     ********************************** */
.dosis-container {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.dosis-item {
  display: flex;
  gap: 4px;
  align-items: center;
  padding: 2px 4px;
  border: 1px solid #ccc;
  border-radius: 5px;
  background-color: #f3f3f3;
}

.dosis-item input[type="text"] {
  width: 45px;
  height: 30px;
  font-size: 14px;
  text-align: center;
}

.dosis-item input[type="time"] {
  height: 30px;
  font-size: 14px;
}

.farmaco-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.btn-agregar-dosis {
  padding: 4px 8px;
  border: 1px solid #28a745;
  background-color: #e9fbe9;
  color: #28a745;
  border-radius: 5px;
  cursor: pointer;
}

.btn-agregar-dosis:hover {
  background-color: #d1f2d1;
}

/* boton info farmacos */
.boton-info-farmaco {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  border: 1px solid #ccc;
  border-radius: 50%;
  background-color: #f3f3f3;
  cursor: pointer;
  padding: 0;
  transition: background-color 0.2s ease;
}

.boton-info-farmaco:hover {
  background-color: #e0e0ff;
}

.btn-actualizar {
  padding: 8px 16px;
  background-color: #007bff;
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
  transition: background-color 0.3s;
}

.btn-actualizar:hover {
  background-color: #0056b3;
}

/* ========================    ======================== */

/* ======================== BOTÓN FLOTANTE FIJO INTERIOR ========================= */
.boton-inferior-fijo {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background: white;
  padding: 10px 10px;
  display: flex;
  justify-content: center;
  box-shadow: 0 -2px 6px rgba(0,0,0,0.15);
  z-index: 999;
  min-height: 65px;
}

.boton-inferior-fijo button {
  background: #1e88e5;
  color: white;
  border: none;
  padding: 10px 25px;
  font-size: 16px;
  border-radius: 8px;
  cursor: pointer;
}

.boton-inferior-fijo button:hover {
  background: #1565c0;
}

/* ========== Paginación horizontal mejorada ========== */
#paginacion {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 25px;
  padding: 10px;
}

#paginacion button {
  appearance: none;
  background-color: white;
  border: 1px solid #007BFF;
  border-radius: 8px;
  padding: 8px 16px;
  font-size: 14px;
  color: #007BFF;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

#paginacion button.active {
  background-color: #007BFF;
  color: white;
}

#paginacion button:hover:not(.active) {
  background-color: #e6f0ff;
  border-color: #0056b3;
}

#paginacion {
  display: flex;
  flex-wrap: nowrap;
  overflow-x: auto;
  gap: 6px;
  padding: 10px;
  margin-top: 15px;
  justify-content: start;
  scrollbar-width: thin;
  scrollbar-color: #ccc transparent;
}

#paginacion::-webkit-scrollbar {
  height: 6px;
}
#paginacion::-webkit-scrollbar-thumb {
  background: #aaa;
  border-radius: 4px;
}
#paginacion::-webkit-scrollbar-track {
  background: transparent;
}

#paginacion button {
  flex: 0 0 auto;
  background-color: white;
  border: 1px solid #007BFF;
  border-radius: 6px;
  padding: 6px 12px;
  font-size: 13px;
  color: #007BFF;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.2s ease;
}

#paginacion button.active {
  background-color: #007BFF;
  color: white;
}

#paginacion button:hover:not(.active) {
  background-color: #e6f0ff;
}

#paginacion {
  display: flex;
  flex-wrap: nowrap;
  overflow-x: auto;
  gap: 8px;
  padding: 10px;
  margin-top: 20px;
  justify-content: center;
  scrollbar-width: thin;
  scrollbar-color: #ccc transparent;
}

#paginacion::-webkit-scrollbar {
  height: 6px;
}
#paginacion::-webkit-scrollbar-thumb {
  background: #bbb;
  border-radius: 4px;
}
#paginacion::-webkit-scrollbar-track {
  background: transparent;
}

#paginacion button {
  flex: 0 0 20%;         /* Cada botón ocupa el 20% del contenedor */
  max-width: 80px;       /* Pero con un límite máximo */
  min-width: 40px;
  text-align: center;
  background-color: white;
  border: 1px solid #007BFF;
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 0.9rem;
  color: #007BFF;
  font-weight: bold;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

#paginacion button.active {
  background-color: #007BFF;
  color: white;
}

#paginacion button:hover:not(.active) {
  background-color: #e6f0ff;
}

.encabezado-fijo {
  position: fixed;
  top: 110px; /* justo debajo del topbar */
  left: 0;
  width: 100%;
  background-color: #f0f4f8;
  z-index: 999;
  padding: 10px 20px;
  border-bottom: 1px solid #ccc;
  text-align: center;
}

.encabezado-fijo h2 {
  margin: 0;
  color: #004080;
  font-size: 1.2rem;
  font-weight: bold;
}

/* ======================================================= MODALES DE AYUDA ================== */
#modalEscala,
#modalPeso,
#modalLaboratorio {
  display: none;
  position: fixed;
  z-index: 9999;
  top: 0; left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0,0,0,0.6);
  overflow-y: auto;
}

#modalEscala .modal-content,
#modalLaboratorio .modal-content {
  position: relative;
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  margin: 0;
  padding: 20px;
  background: white;
  width: 90%;
  max-width: 900px;       /* ancho máximo del cuadro */
  border-radius: 10px;
  text-align: left;
}

#modalPeso .modal-content {
  background-color: #fff;
  margin: 10% auto;
  padding: 20px;
  border-radius: 10px;
  width: 80%;
  max-width: 700px;
}

#modalEscala .close,
#modalAyuda .close,
#modalPeso .close,
#modalLaboratorio .close {
  position: absolute;
  top: 10px; right: 20px;
  font-size: 25px;
  font-weight: bold;
  cursor: pointer;
}

.input-fuera-rango {
  border: 2px solid red;
  background-color: #ffe5e5;
}

.input-fuera-rango {
  border: 2px solid red;
  background-color: #ffe5e5;
}

.cuadro-pa.selected {
  background-color: red;
}

/* ===== ESTILO PARA CAMPOS DE ANESTESIA ===== */
.campo-anestesia {
  background: #f5f9ff;
  border: 2px solid #004080;
  border-radius: 8px;
  padding: 10px;
  margin-bottom: 1px;
  box-shadow: 0 1px 5px rgba(0,0,0,0.1);
  transition: all 0.3s ease;
}

.campo-anestesia:hover {
  background: #eaf2ff;
  transform: translateY(-2px);
}

.campo-anestesia label {
  font-weight: bold;
  color: #004080;
  font-size: 0.85rem;
  margin-bottom: 6px;
  display: block;
}

.campo-anestesia select {
  width: 100%;
  padding: 8px;
  border-radius: 6px;
  border: 1px solid #ccc;
  font-size: 0.95rem;
}

.campo-anestesia h4 {
  margin-bottom: 8px;
  color: #002b5c;
  font-size: 1rem;
  border-bottom: 2px solid #004080;
  padding-bottom: 4px;
}

/* Imagen estándar dentro de las ayudas */
.img-ayuda {
  max-width: 100%;
  display: block;
  border-radius: 8px;
  margin-top: 5px;   /* separa el texto de la imagen */
}

/* ======================= MODAL AYUDA ESTÁNDAR ======================= */

#modalAyuda {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0,0,0,0.65);
  justify-content: center;
  align-items: center;
  padding: 20px;
}

/* Cuadro principal */
#modalAyuda .modal-content {

  position: relative;

  width: min(1000px, 95vw);

  max-height: 90vh;

  overflow-y: auto;

  background: #ffffff;

  border-radius: 16px;

  padding: 28px;

  box-shadow: 0 10px 40px rgba(0,0,0,0.25);

  animation: modalFade 0.18s ease;
}

/* Scroll bonito */
#modalAyuda .modal-content::-webkit-scrollbar {
  width: 10px;
}

#modalAyuda .modal-content::-webkit-scrollbar-thumb {
  background: #94a3b8;
  border-radius: 10px;
}

#modalAyuda .modal-content::-webkit-scrollbar-track {
  background: #e2e8f0;
}

/* Botón cerrar */
#modalAyuda .close {
  position: sticky;
  top: 0;
  float: right;
  z-index: 50;
  background: white;
  border-radius: 50%;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: bold;
  cursor: pointer;
  border: 2px solid #cbd5e1;
  transition: 0.2s;
}

#modalAyuda .close:hover {
  background: #ef4444;
  color: white;
  border-color: #ef4444;
}

/* Imágenes */
#modalAyuda img,
.img-ayuda {
  max-width: 100%;
  max-height: 65vh;
  object-fit: contain;
  display: block;
  margin: 18px auto;
  border-radius: 10px;
}

/* Animación */
@keyframes modalFade {
  from {
    opacity: 0;
    transform: scale(0.96);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Mis .MD */
.markdown-body p {
  text-align: justify;
  text-justify: inter-word;
}

.mini-tab {
  font-size: 0.85rem;
  padding: 4px 6px;
  border-radius: 8px;
  max-width: 300px;
}






