.simulate-tab-btn {
  /* Use flex behaviour instead of float to avoid overflow on small screens */
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: auto;
  margin-right: 0;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(20, 63, 106, 0.10);
  transition: box-shadow 0.2s;
  border-radius: 5px;
  background: #143f6a;
  color: white;
  padding: 8px 12px;
  max-width: 100%;
  box-sizing: border-box;
}

.simulate-tab-btn:hover {
  box-shadow: 0 4px 16px rgba(20, 63, 106, 0.18);
  background-color: #143f6a;
  color: white;
}

.form-tab-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.tab-btn-group {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.tab-btn-simulate {
  margin-left: auto;
  display: flex;
  align-items: center;
}

.clear-tab-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 12px;
  border-radius: 5px;
  background: #f1f1f1;
  color: var(--text);
  box-sizing: border-box;
  max-width: 100%;
}

#simulatePatientBtn {
  margin-left: 16px;
  border-radius: 5px;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(20, 63, 106, 0.10);
  transition: box-shadow 0.2s;
  padding: 8px 12px;
  box-sizing: border-box;
}

#simulatePatientBtn:hover {
  box-shadow: 0 4px 16px rgba(20, 63, 106, 0.18);
  background-color: #143f6a;
}

/* Mejoras visuales para el header */
.header-main-info {
  flex: 2 1 0;
  text-align: center;
  color: #fff;
  padding: 0 16px;
}

.header-title {
  font-size: 2.4rem;
  font-weight: 700;
  margin-bottom: 6px;
  letter-spacing: 2px;
}

.header-subtitle {
  font-size: 1.2rem;
  font-weight: 500;
  margin-bottom: 8px;
  opacity: 0.95;
}

.header-description {
  font-size: 1rem;
  font-weight: 400;
  margin-bottom: 14px;
  opacity: 0.85;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

/* Header layout improvements */
.header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: 32px;
}

.header-left {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  margin-left: 20px;
}

/* Ensure header images scale and respect container instead of inline height */
header .header-left img {
  height: auto !important;
  max-height: 60px;
  width: auto;
}

.header-center {
  flex: 1 1 auto;
  text-align: center;
}

.header-title {
  font-size: 2.2rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: #fff;
  letter-spacing: 2px;
}

.header-right {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

.user-panel {
  background: rgba(255, 255, 255, 0.7);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  padding: 0 4px;
  margin: 0;
  margin-top: 20px;
  margin-right: 20px;
  border-radius: 18px;
  /* allow shrinking on small screens */
  min-width: 0;
  max-width: 100%;
  overflow: visible;
}

/* user info layout: allow truncation on small widths */
.user-info {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex-wrap: wrap;
}

.user-details {
  min-width: 0;
  /* allow truncation */
  overflow: hidden;
}

.user-name,
.user-email {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

:root {
  --primary: #143f6a;
  --primary-light: #4d7bb6;
  --primary-dark: #0c2a4a;
  --secondary: #26a69a;
  --danger: #d32f2f;
  --warning: #ffa000;
  --warning-light: #ffc046;
  /* Versión 30% más clara */
  --warning-dark: #e69100;
  /* Versión 10% más oscura para hover */
  --success: #388e3c;
  --success-light: #80c283;
  /* 40% más claro */
  --success-dark: #1c5a20;
  /* 40% oscuro */
  --info: #1976d2;
  --light: #f5f5f5;
  --dark: #212121;
  --gray: #757575;
  --text: #424242;
  --border: #e0e0e0;
  --background: #f9f6fc;
  --card-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

html,
body,
#root,
#app,
#mainAppContent {
  margin: 0 !important;
  padding: 0 !important;
}

/* Reset y estilos base */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Roboto', 'Poppins', sans-serif;
}

body {
  background-color: var(--background);
  color: var(--text);
  line-height: 1.6;
  font-size: 16px;
}

.container {
  width: 90%;
  max-width: 100%;
  margin: 0 auto;
  padding: 20px;
  margin-top: 24px;
  /* antes: 120px */
}

/* Header */
header {
  text-align: center;
  margin-bottom: 40px;
  padding: 30px 0 24px;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: white;
  box-shadow: var(--card-shadow);
  top: auto;
  /* quita top:0 */
  left: auto;
  /* quita left:0 */
  z-index: auto;
  /* ya no es necesario */
  overflow: hidden;
  position: relative;
  /* parte del flujo normal */
  width: 100% !important;
  /* evita 100vw (crea franjas) */
  margin: 0 !important;
  border-top-left-radius: 0 !important;
  border-top-right-radius: 0 !important;
}

/* 3) Si algún wrapper mete aire arriba, lo anulamos */
.page,
.page-shell,
.shell,
.layout,
.container,
main {
  padding-top: 0 !important;
  margin-top: 0 !important;
}

header {
  box-shadow: var(--card-shadow, 0 2px 8px rgba(0, 0, 0, .08));
}

header::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="0 0 100 100" fill="rgba(255,255,255,0.05)"><path d="M30,10L50,30L70,10L90,30L70,50L90,70L70,90L50,70L30,90L10,70L30,50L10,30L30,10Z"/></svg>');
}


/* Make media (images, videos, iframes) responsive by default */
img,
picture,
video,
iframe {
  max-width: 100%;
  height: auto;
  display: block;

}

h1 {
  font-size: 2.4rem;
  margin-bottom: 10px;
  font-weight: 600;
  position: relative;
}

.subtitle {
  font-size: 1.1rem;
  opacity: 0.9;
  max-width: 800px;
  margin: 0 auto;
  position: relative;
  font-weight: 300;
  border-radius: 18px;
  /* allow shrinking on small screens */
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}

  .clinic-id {
    background-color: rgba(0, 0, 0, 0.1);
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 0.9rem;
    margin-top: 15px;
    display: inline-block;
    font-weight: 500;
  }

  /* Formularios */
  .form-container {
    background-color: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: var(--card-shadow);
    margin-bottom: 30px;
  }

/* Ajustes para la pantalla de login: reducir espacio entre logo y formulario */
.auth-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding-top: 12px;
  padding-bottom: 12px;
}

.login-logo {
  max-height: 72px;
  width: auto;
  margin: 16px 0 0 0;
  display: block;
}

.login-container {
  width: 100%;
  max-width: 460px;
  margin-top: 0;
  margin-bottom: 8px;
  padding: 22px;
}

  .form-section {
    margin-bottom: 40px;
  }

  .section-title {
    color: var(--primary);
    margin: 0 0 20px 0;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--primary-light);
    font-size: 1.4rem;
    display: flex;
    align-items: center;
    position: relative;
  }

  .section-title i {
    margin-right: 12px;
    font-size: 1.2em;
  }

  .section-subtitle {
    color: var(--gray);
    font-size: 0.95rem;
    margin-bottom: 20px;
    font-weight: 400;
  }

  .form-grid {
    display: grid;
    /* allow narrower min columns on small screens to avoid horizontal scroll */
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 25px;
  }

  .form-group {
    margin-bottom: 20px;
    position: relative;
  }

  label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--dark);
    font-size: 0.95rem;
  }

  .required::after {
    content: " *";
    color: var(--danger);
  }

  input,
  select,
  textarea {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 15px;
    transition: all 0.3s;
    background-color: white;
  }

  input:focus,
  select:focus,
  textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(94, 53, 177, 0.1);
  }

  /* Opciones de radio y checkbox */
  .radio-group,
  .checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-top: 8px;
  }

  .radio-option,
  .checkbox-option {
    display: flex;
    align-items: center;
    cursor: pointer;
  }

  .radio-option input,
  .checkbox-option input {
    width: auto;
    margin-right: 8px;
    cursor: pointer;
  }

  .radio-option label,
  .checkbox-option label {
    transform: translateY(0.5px);
    line-height: 1.2;
  }

  .radio-option input[type="radio"] {
    width: 16px;
    height: 16px;
    accent-color: var(--primary);
    cursor: pointer;
    margin-right: 10px;
  }

  .radio-option label {
    font-size: 1rem;
    cursor: pointer;
  }

  /* Checkbox personalizado */
  .checkbox-option input[type="checkbox"] {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    width: 10px;
    height: 10px;
    border: 2px solid var(--gray);
    border-radius: 4px;
    background: white;
    cursor: pointer;
    position: relative;
    margin: 0 10px 0 0;
    vertical-align: middle;
  }

  .checkbox-option input[type="checkbox"]:checked::before {
    content: "";
    position: absolute;
    top: 45%;
    left: 50%;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: translate(-50%, -50%) rotate(45deg);
  }

  .checkbox-option input[type="checkbox"]:checked {
    background-color: var(--primary);
    border-color: var(--primary);
  }

  /* Slider de rango */
  input[type="range"] {
    -webkit-appearance: none;
    width: 100%;
    height: 7px;
    background: var(--border);
    border-radius: 5px;
    outline: none;
    margin: 0;
    padding: 0;
  }

  input[type="range"]::-webkit-slider-runnable-track {
    height: 4px;
    background: var(--primary);
    border-radius: 2px;
  }

  input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    background: white;
    border: 2px solid var(--primary);
    border-radius: 50%;
    cursor: pointer;
    margin-top: -7px;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  }

  input[type="range"]:hover::-webkit-slider-thumb {
    transform: scale(1.1);
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.15);
  }

  input[type="range"]::-moz-range-progress {
    height: 4px;
    background: var(--primary);
    border-radius: 2px;
  }

  input[type="range"]::-moz-range-thumb {
    width: 14px;
    height: 14px;
    background: white;
    border: 2px solid var(--primary);
    border-radius: 50%;
    cursor: pointer;
    transition: transform 0.2s;
  }

  input[type="range"]:hover::-moz-range-thumb {
    transform: scale(1.1);
  }

  /* Componentes específicos */
  .pain-scale-container {
    margin-top: 15px;
    width: 100%;
    position: relative;
  }

  .pain-scale {
    display: flex;
    justify-content: space-between;
    margin-top: 5px;
    position: relative;
  }

  .pain-scale::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(to right, var(--success), var(--warning), var(--danger));
    transform: translateY(-50%);
    z-index: 0;
    border-radius: 2px;
  }

  .pain-scale-label {
    text-align: center;
    font-size: 0.8rem;
    color: var(--text);
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: white;
    border-radius: 50%;
    position: relative;
    z-index: 1;
  }

  .biomarker-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    align-items: end;
  }

  .biomarker-value {
    display: flex;
    align-items: center;
    position: relative;
  }

  .biomarker-value input {
    flex: 1;
    padding-right: 40px;
  }

  .biomarker-unit {
    position: absolute;
    right: 15px;
    color: var(--gray);
    font-size: 0.9rem;
    white-space: nowrap;
  }

  .normal-range {
    font-size: 0.8rem;
    color: var(--gray);
    margin-top: 5px;
    font-style: italic;
  }

  /* Botones
  button {
    background: linear-gradient(to right, var(--primary), var(--primary-light));
    color: white;
    border: none;
    padding: 16px 25px;
    font-size: 16px;
    font-weight: 500;
    border-radius: 8px;
    cursor: pointer;
    width: 100%;
    transition: all 0.3s;
    margin-top: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 8px rgba(94, 53, 177, 0.2);
  }
  
  button:hover {
    background: linear-gradient(to right, var(--primary-dark), var(--primary));
    box-shadow: 0 6px 12px rgba(94, 53, 177, 0.3);
    transform: translateY(-2px);
  }
  
  button:active {
    transform: translateY(0);
  }
  
  button i {
    margin-right: 10px;
  } */

  /* Resultados */
  .result-container {
    margin-top: 30px;
    /* reduce padding on small screens using clamp */
    padding: clamp(12px, 3vw, 30px);
    border-radius: 10px;
    display: none;
    animation: fadeIn 0.5s ease-out;
    position: relative;
    background-color: white;
    box-shadow: 0 4px 20px rgba(94, 53, 177, 0.15);
    border: 2px solid transparent;
    background: linear-gradient(white, white) padding-box,
      linear-gradient(to right, var(--primary), var(--primary-light)) border-box;
    background-origin: padding-box;
  }

  .result-header {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
  }

  .result-icon {
    font-size: 2.5rem;
    margin-right: 20px;
    min-width: 60px;
    text-align: center;
    color: var(--primary) !important;
  }

  .result-title {
    font-size: 1.6rem;
    font-weight: 600;
    color: var(--dark);
  }

  .result-description {
    margin-top: 5px;
    color: var(--gray);
  }

  .probability-container {
    display: flex;
    align-items: center;
    margin: 25px 0;
    flex-wrap: wrap;
  }

  /* Reemplazar el estilo existente de .probability-circle */
  .probability-circle {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    font-weight: 700;
  margin-right: 20px;
  flex-shrink: 0;
    position: relative;
    border: 5px solid;
    background-color: rgba(255, 255, 255, 0.1);
    color: white;
    transition: all 0.5s ease;
  }

  /* Colores según el porcentaje de riesgo */
  .probability-circle.low-risk {
    border-color: #4CAF50;
    /* Verde */
    background-color: rgba(76, 175, 80, 0.1);
    color: #2E7D32;
    /* Verde oscuro */
  }

  .probability-circle.low-moderate-risk {
    border-color: #8BC34A;
    /* Verde claro */
    background-color: rgba(139, 195, 74, 0.1);
    color: #558B2F;
    /* Verde oscuro claro */
  }

  .probability-circle.moderate-risk {
    border-color: #FFC107;
    /* Amarillo */
    background-color: rgba(255, 193, 7, 0.1);
    color: #FF8F00;
    /* Ámbar */
  }

  .probability-circle.high-moderate-risk {
    border-color: #FF9800;
    /* Naranja */
    background-color: rgba(255, 152, 0, 0.1);
    color: #E65100;
    /* Naranja oscuro */
  }

  .probability-circle.high-risk {
    border-color: #F44336;
    /* Rojo */
    background-color: rgba(244, 67, 54, 0.1);
    color: #C62828;
    /* Rojo oscuro */
  }

  .probability-circle.very-high-risk {
    border-color: #9C27B0;
    /* Morado */
    background-color: rgba(156, 39, 176, 0.1);
    color: #6A1B9A;
    /* Morado oscuro */
  }

  .probability-circle::before {
    content: "";
    position: absolute;
    top: 5px;
    left: 5px;
    right: 5px;
    bottom: 5px;
    border-radius: 50%;
    border: 2px dashed var(--primary-light);
    opacity: 0.5;
    pointer-events: none;
  }

  .result-details {
    flex: 1;
    /* allow shrinking on narrow screens */
    min-width: 0;
  }

  .risk-factors {
    background-color: rgba(0, 0, 0, 0.03);
    padding: 15px;
    border-radius: 8px;
    margin-top: 15px;
  }

  .risk-factors-title {
    font-weight: 500;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
  }

  .risk-factors-title i {
    margin-right: 8px;
    color: var(--primary);
  }

  .risk-factors-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
  }

  .risk-factor {
    background-color: white;
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 0.85rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    display: inline-flex;
    align-items: center;
    max-width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .risk-factor i {
    margin-right: 5px;
    font-size: 0.8rem;
  }

  .high-risk .risk-factor {
    background-color: rgba(211, 47, 47, 0.1);
    color: var(--danger);
  }

  .moderate-risk .risk-factor {
    background-color: rgba(255, 160, 0, 0.1);
    color: var(--warning);
  }

  .recommendations {
    margin-top: 30px;
  }

  .recommendations h3 {
    margin-bottom: 15px;
    color: var(--dark);
    display: flex;
    align-items: center;
    font-size: 1.2rem;
  }

  .recommendations h3 i {
    margin-right: 10px;
    color: var(--primary);
  }

  .recommendations ul {
    list-style-type: none;
    padding-left: 0;
    margin-left: 1.5rem;
  }

  .recommendations li {
    position: relative;
    padding-left: 1.5rem;
    margin-bottom: 0.8rem;
    text-indent: -1rem;
  }

  .recommendations li::before {
    content: "•";
    color: var(--primary);
    position: absolute;
    left: 0.5rem;
    font-size: 1.2em;
  }

  .patient-summary {
    background-color: #f5f5f5;
    padding: 25px;
    border-radius: 10px;
    margin-top: 40px;
    position: relative;
  }

  .patient-summary h3 {
    margin-bottom: 20px;
    color: var(--primary);
    display: flex;
    align-items: center;
    font-size: 1.2rem;
  }

  .patient-summary h3 i {
    margin-right: 10px;
  }

  .summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 15px;
  }

  .summary-item {
    background-color: white;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s, box-shadow 0.3s;
  }

  .summary-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  }

  .summary-label {
    font-size: 0.85rem;
    color: var(--gray);
    margin-bottom: 8px;
    font-weight: 500;
  }

  .summary-value {
    font-weight: 500;
    color: var(--dark);
    font-size: 1.1rem;
  }

  .clinical-guidelines {
    background-color: #e8f5e9;
    padding: 25px;
    border-radius: 10px;
    margin-top: 30px;
    border-left: 5px solid var(--success);
  }

  .clinical-guidelines h3 {
    color: var(--success);
    margin-bottom: 15px;
    display: flex;
    align-items: center;
  }

  .clinical-guidelines h3 i {
    margin-right: 10px;
  }

  .guideline {
    margin-bottom: 15px;
  }

  .guideline-title {
    font-weight: 500;
    color: var(--dark);
    margin-bottom: 5px;
    display: flex;
    align-items: center;
  }

  .guideline-title i {
    margin-right: 8px;
    color: var(--success);
    font-size: 0.9rem;
  }

  .guideline-content {
    font-size: 0.95rem;
    color: var(--text);
    padding-left: 25px;
  }

  /* Footer */
  footer {
    text-align: center;
    margin-top: 50px;
    padding: 30px 0;
    color: var(--text);
    font-size: 0.9rem;
    border-top: 1px solid var(--border);
  }

  .footer-links {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 15px;
  }

  .footer-links a {
    color: var(--primary);
    text-decoration: none;
    transition: color 0.3s;
  }

  .footer-links a:hover {
    color: var(--primary-dark);
    text-decoration: underline;
  }

  /* Tooltips */
  .info-tooltip {
    position: relative;
    display: inline-block;
    margin-left: 5px;
    color: var(--primary);
    cursor: help;
  }

  .info-tooltip .tooltip-text {
    visibility: hidden;
    width: 250px;
    background-color: var(--danger);
    color: white;
    text-align: center;
    border-radius: 6px;
    padding: 10px;
    position: absolute;
    z-index: 1;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    opacity: 0;
    transition: opacity 0.3s;
    font-size: 0.85rem;
    font-weight: normal;
  }

  .info-tooltip:hover .tooltip-text {
    visibility: visible;
    opacity: 1;
  }

  /* Validación */
  .invalid {
    border-color: #e74c3c !important;
  }

  .error-message {
    color: #e74c3c;
    font-size: 12px;
    margin-top: 5px;
    display: none;
  }

  /* Spinner */
  .spinner-container {
    display: flex;
    align-items: center;
    gap: 8px;
  }

  .loading-spinner {
    width: 20px;
    height: 20px;
    border: 3px solid rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    border-top: 3px solid #3498db;
    animation: spin 1s linear infinite;
  }

  /* Items críticos */
  .summary-item.critical {
    border-left: 3px solid var(--danger);
    padding-left: 8px;
  }

  .tooltip-icon {
    margin-left: 5px;
    color: var(--danger);
    font-size: 0.8em;
    cursor: help;
  }

  [data-tooltip]:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 0;
    width: 200px;
    background: var(--danger);
    color: white;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 0.8em;
    line-height: 1.4;
    z-index: 1000;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
    pointer-events: none;
  }

  .summary-item.critical .summary-label {
    font-weight: 600;
    color: var(--dark)
  }

  .summary-item.critical .summary-value {
    font-weight: 700;
    color: var(--dark);
  }

  /* Botón de descarga */
  .download-button {
    position: relative;
    transition: all 0.3s ease;
  }

  .download-button:disabled {
    opacity: 0.7;
    cursor: not-allowed;
  }

  /* Animaciones */
  @keyframes fadeIn {
    from {
      opacity: 0;
      transform: translateY(20px);
    }

    to {
      opacity: 1;
      transform: translateY(0);
    }
  }

  @keyframes spin {
    0% {
      transform: rotate(0deg);
    }

    100% {
      transform: rotate(360deg);
    }
  }

  /* Responsividad */
  @media (max-width: 768px) {

    .form-grid,
    .biomarker-row {
      grid-template-columns: 1fr;
    }

    .probability-container {
      flex-direction: column;
      align-items: center;
    }

    .probability-circle {
      width: 100px;
      height: 100px;
      font-size: 1.5rem;
      margin-right: 0;
      margin-bottom: 20px;
    }

    .result-details {
      min-width: 100%;
      text-align: center;
    }

    .result-header {
      flex-direction: column;
      align-items: flex-start;
    }

    .result-icon {
      margin-bottom: 15px;
      margin-right: 0;
    }

    header {
      padding: 20px 15px;
    }

    h1 {
      font-size: 1.8rem;
    }

    /* Animación para elementos que aparecen en móvil */
    @keyframes slideIn {
      from {
        transform: translateX(-20px);
        opacity: 0;
      }

      to {
        transform: translateX(0);
        opacity: 1;
      }
    }

    .form-group,
    .summary-item {
      animation: slideIn 0.3s ease-out forwards;
    }
  }

  /* Media query adicional para tablets */
  @media (min-width: 769px) and (max-width: 1024px) {
    .form-grid {
      grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    }

    .summary-grid {
      grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    }
  }

  /* Efecto hover para dispositivos con hover */
  @media (hover: hover) {

    button:hover,
    .summary-item:hover,
    input[type="range"]:hover::-webkit-slider-thumb,
    input[type="range"]:hover::-moz-range-thumb {
      transition: all 0.3s ease;
    }
  }

  /* Botones */
  .form-actions {
    display: flex;
    gap: 15px;
    /* Espacio entre botones */
    margin-top: 20px;
    width: 100%;
  }

  .form-actions button {
    background: linear-gradient(135deg, var(--success) 0%, var(--success-light) 100%);
    color: white;
    border: none;
    padding: 16px 25px;
    font-size: 16px;
    font-weight: 500;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 3px 6px rgba(94, 53, 177, 0.16);
    flex: 1;
    position: relative;
    overflow: hidden;
    z-index: 1;
  }

  /* Efecto hover con pseudo-elemento para transición suave */
  .form-actions button::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--success-dark) 0%, var(--success) 100%);
    opacity: 0;
    transition: opacity 0.4s ease;
    z-index: -1;
  }

  .form-actions button:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 16px rgba(94, 53, 177, 0.24);
  }

  .form-actions button:hover::after {
    opacity: 1;
  }

  .form-actions button:active {
    transform: translateY(1px);
    box-shadow: 0 2px 4px rgba(94, 53, 177, 0.24);
    transition: all 0.1s ease;
  }

  /* Animación para el icono */
  .form-actions button i {
    margin-right: 10px;
    transition: transform 0.3s ease;
  }

  .form-actions button:hover i {
    transform: scale(1.15);
  }

  /* Estilo específico para el botón Limpiar Todo con efectos mejorados */
  .clear-all-btn {
    background: linear-gradient(135deg, #f44336 0%, #ff7961 100%) !important;
    box-shadow: 0 3px 6px rgba(244, 67, 54, 0.16) !important;
  }

  .clear-all-btn::after {
    background: linear-gradient(135deg, #d32f2f 0%, #f44336 100%) !important;
  }

  .clear-all-btn:hover {
    transform: translateY(-3px) !important;
    box-shadow: 0 8px 16px rgba(244, 67, 54, 0.24) !important;
  }

  .clear-all-btn:active {
    transform: translateY(1px) !important;
    box-shadow: 0 2px 4px rgba(244, 67, 54, 0.24) !important;
  }

  /* Efecto de "onda" al hacer clic */
  @keyframes ripple {
    to {
      transform: scale(2.5);
      opacity: 0;
    }
  }

  .form-actions button:focus:not(:active)::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    background: rgba(255, 255, 255, 0.4);
    border-radius: 50%;
    transform: translate(-50%, -50%) scale(1);
    animation: ripple 0.6s ease-out;
    z-index: 0;
  }

  /* Estilo base del botón PDF */
  .download-button {
    background: linear-gradient(135deg, var(--primary));
    color: white;
    /* Texto oscuro para mejor contraste */
    border: none;
    padding: 16px 25px;
    font-size: 16px;
    font-weight: 600;
    /* Más grueso para mejor legibilidad */
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 3px 6px rgba(20, 63, 106, 0.10);
    position: relative;
    overflow: hidden;
    z-index: 1;
    margin-top: 15px;
    width: 100%;
  }

  /* Efecto hover con pseudo-elemento */
  .download-button::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    opacity: 0;
    transition: opacity 0.4s ease;
    z-index: -1;
  }

  .download-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 16px rgba(20, 63, 106, 0.18);
    color: white;
    /* Cambio de color de texto en hover */
  }

  .download-button:hover::after {
    opacity: 1;
  }

  .download-button:active {
    transform: translateY(1px);
    box-shadow: 0 2px 4px rgba(20, 63, 106, 0.18);
    transition: all 0.1s ease;
  }

  /* Estilo para el icono */
  .download-button i {
    margin-right: 10px;
    transition: transform 0.3s ease;
    color: white
      /* Hereda el color del texto */
  }

  .download-button:hover i {
    transform: scale(1.15);
  }

  /* Estado de carga */
  .download-button .spinner-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
  }

  .download-button .loading-spinner {
    width: 18px;
    height: 18px;
    border: 3px solid rgba(44, 62, 80, 0.3);
    border-radius: 50%;
    border-top-color: currentColor;
    animation: spin 1s ease-in-out infinite;
  }

  .download-button:hover .loading-spinner {
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
  }

  @keyframes spin {
    to {
      transform: rotate(360deg);
    }
  }

  /* Efecto ripple */
  .download-button:focus:not(:active)::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    background: rgba(44, 62, 80, 0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%) scale(1);
    animation: ripple 0.6s ease-out;
    z-index: 0;
  }

  .download-button:hover:focus:not(:active)::before {
    background: rgba(255, 255, 255, 0.3);
  }

  /* Añade esto al final de style.css */
  .save-button {
    background: linear-gradient(135deg, var(--primary));
    color: white;
    border: none;
    padding: 16px 25px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 3px 6px rgba(25, 118, 210, 0.2);
    position: relative;
    overflow: hidden;
    z-index: 1;
    margin-top: 15px;
    width: 100%;
  }

  .save-button::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    opacity: 0;
    transition: opacity 0.4s ease;
    z-index: -1;
  }

  .save-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 16px rgba(25, 118, 210, 0.3);
    color: white;
  }

  .save-button:hover::after {
    opacity: 1;
  }

  .save-button:active {
    transform: translateY(1px);
    box-shadow: 0 2px 4px rgba(25, 118, 210, 0.3);
    transition: all 0.1s ease;
  }

  .save-button i {
    margin-right: 10px;
    transition: transform 0.3s ease;
    color: white;
  }

  .save-button:hover i {
    transform: scale(1.15);
  }

  .main-tab-container {
    margin-bottom: 10px;
  }

  .main-tab-header {
    display: flex;
    border-bottom: 1px solid #ddd;
    margin-bottom: 20px;
    margin-top: 40px;
    flex-wrap: wrap;
  }

  .main-tab-btn {
    padding: 12px 25px;
    background: #e9ecef;
    border: none;
    border-radius: 5px 5px 0 0;
    margin-right: 5px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    font-size: 16px;
  }

  .main-tab-btn:hover {
    background: #e9ecef;
  }

  .main-tab-btn.active {
    background: #143f6a;
    color: white;
    border-bottom: 3px solid #0c2a4a;
  }

  .main-tab-content {
    display: none;
  }

  .main-tab-content.active {
    display: block;
  }

  /* Estilos para las pestañas del formulario */
  .form-tab-container {
    margin-bottom: 20px;
  }

  .form-tab-header {
    display: flex;
    flex-wrap: wrap;
    border-bottom: 1px solid #ddd;
    margin-bottom: 20px;
  }

  .form-tab-btn {
    padding: 12px 20px;
    background: #e9ecef;
    border: none;
    border-radius: 5px 5px 0 0;
    margin-right: 5px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
  }

  .form-tab-btn i {
    margin-right: 8px;
  }

  .form-tab-btn:hover {
    background: #e9ecef;
  }

  .form-tab-btn.active {
    background: #143f6a;
    color: white;
    border-bottom: 3px solid #0c2a4a;
  }

  .form-tab-content {
    display: none;
    animation: fadeIn 0.5s ease;
  }

  .form-tab-content.active {
    display: block;
  }

  @keyframes fadeIn {
    from {
      opacity: 0;
    }

    to {
      opacity: 1;
    }
  }

  .navigation-buttons {
    display: flex;
    justify-content: space-between;
    margin-top: 20px;
  }

  .nav-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
  }

  .nav-btn.prev {
    background: #f8f9fa;
  }

  .nav-btn.next {
    background: #143f6a;
    color: white;
  }

  .nav-btn:hover {
    opacity: 0.9;
  }

  .nav-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
  }

  .progress-container {
    width: 100%;
    background: linear-gradient(90deg, #e9ecef 60%, #f5f5f5 100%);
    border-radius: 8px;
    margin-bottom: 24px;
    box-shadow: 0 2px 8px rgba(20, 63, 106, 0.08);
  }

  .progress-bar {
    height: 16px;
    background: linear-gradient(90deg, #143f6a 0%, #4d7bb6 100%);
    border-radius: 8px;
    width: 0%;
    box-shadow: 0 2px 8px rgba(20, 63, 106, 0.15);
    transition: width 0.7s ease;
  }

  .progress-text {
    text-align: center;
    font-size: 15px;
    color: #143f6a;
    margin-top: 8px;
    font-weight: 500;
  }

  /* Estilos para el historial */
  .history-container {
    margin-top: 20px;
    padding: 20px;
    background-color: #f8f9fa;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  }

  .history-table {
    font-size: 0.9rem;
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin-top: 15px;
  }

  .history-table thead th {
    position: sticky;
    top: 0;
    background-color: var(--primary);
    color: white;
    z-index: 10;
  }

  .history-table tbody tr:nth-child(even) {
    background-color: rgba(0, 0, 0, 0.02);
  }

  .history-table tbody tr:hover {
    background-color: rgba(0, 0, 0, 0.05);
  }

  .history-table th {
    font-size: 0.85rem;
    padding: 10px 12px;
  }

  .history-table td {
    padding: 10px 12px;
    vertical-align: middle;
  }

  .history-btn {
    font-size: 0.8rem;
    padding: 5px 8px;
  }

  .history-table th,
  .history-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #ddd;
  }

  .history-table tr:hover {
    background-color: #f1f1f1;
  }

  .history-actions {
    display: flex;
    gap: 10px;
  }

  .history-btn {
    padding: 5px 10px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
  }

  .no-history {
    padding: 30px;
    text-align: center;
    color: var(--gray);
    font-style: italic;
    background-color: rgba(0, 0, 0, 0.03);
    border-radius: 8px;
    margin-top: 20px;
  }

  .no-history i {
    font-size: 2rem;
    margin-bottom: 10px;
    color: var(--gray);
    opacity: 0.5;
  }

  .view-btn {
    background-color: var(--primary);
    color: white;
  }

  .delete-btn {
    background-color: var(--primary);
    color: white;
  }

  .history-btn:hover {
    opacity: 0.8;
  }

  .search-container {
    display: flex;
    margin-bottom: 20px;
    gap: 10px;
  }

  .search-input {
    flex: 1;
    padding: 10px 15px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.95rem;
    transition: all 0.3s;
  }

  .search-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(94, 53, 177, 0.1);
  }

  .search-btn {
    padding: 10px 20px;
    background-color: var(--primary);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.95rem;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 8px;
  }

  .search-btn:hover {
    background-color: var(--primary-dark);
  }

  /* Ajustes responsivos */
  @media (max-width: 768px) {
    .history-table {
      font-size: 0.8rem;
    }

    .history-table th,
    .history-table td {
      padding: 8px 10px;
    }

    .history-actions {
      display: flex;
      flex-direction: column;
      gap: 5px;
    }

    .history-btn {
      padding: 3px 6px;
      font-size: 0.7rem;
    }
  }

  /* Estilos para el modal */
  .modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
  }

  .modal-content {
    background-color: #fff;
    margin: 2% auto;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 5px 30px rgba(0, 0, 0, 0.3);
    width: 85%;
    max-width: 900px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    animation: modalFadeIn 0.3s;
  }

  @keyframes modalFadeIn {
    from {
      opacity: 0;
      transform: translateY(-20px);
    }

    to {
      opacity: 1;
      transform: translateY(0);
    }
  }

  .modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 15px;
  }

  .modal-header h3 {
    color: var(--primary);
    margin: 0;
    font-size: 1.5rem;
  }

  .close-modal {
    color: var(--gray);
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s;
  }

  .close-modal:hover {
    color: var(--dark);
  }

  .modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 10px 5px;
  }

  .modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding-top: 15px;
    border-top: 1px solid var(--border);
    margin-top: 15px;
  }

  /* Pestañas del modal */
  .modal-tabs {
    display: flex;
    border-bottom: 1px solid var(--border);
    margin-bottom: 20px;
  }

  .modal-tab-btn {
    padding: 10px 20px;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    font-weight: 500;
    color: var(--gray);
    transition: all 0.3s;
  }

  .modal-tab-btn.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
  }

  .modal-tab-btn:hover:not(.active) {
    color: var(--dark);
  }

  .modal-tab-content {
    display: none;
  }

  .modal-tab-content.active {
    display: block;
  }

  /* Secciones del modal */
  .modal-section {
    margin-bottom: 25px;
  }

  .modal-section h4 {
    color: var(--primary);
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
  }

  .modal-section h4 i {
    font-size: 1.1em;
  }

  .modal-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
  }

  .modal-item {
    margin-bottom: 10px;
  }

  .modal-label {
    font-weight: 500;
    color: var(--dark);
    margin-bottom: 5px;
    display: flex;
    align-items: center;
    gap: 5px;
  }

  .modal-label i {
    color: var(--primary);
    font-size: 0.9em;
  }

  .modal-value {
    background-color: rgba(0, 0, 0, 0.03);
    padding: 8px 12px;
    border-radius: 6px;
    border-left: 3px solid var(--primary);
  }

  .modal-value.empty {
    color: var(--gray);
    font-style: italic;
  }

  /* Botones del modal */
  .modal-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 8px;
  }

  .modal-btn.print-btn {
    background-color: var(--primary);
    color: white;
  }

  .modal-btn.print-btn:hover {
    background-color: var(--primary-dark);
  }

  .modal-btn.close-btn {
    background-color: var(--light);
    color: var(--dark);
  }

  .modal-btn.close-btn:hover {
    background-color: #e0e0e0;
  }

  /* Estilos para checkboxes/booleanos */
  .boolean-value {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.9em;
  }

  .boolean-true {
    background-color: rgba(56, 142, 60, 0.1);
    color: var(--success);
  }

  .boolean-false {
    background-color: rgba(211, 47, 47, 0.1);
    color: var(--danger);
  }

  /* Responsividad */
  @media (max-width: 768px) {
    .modal-content {
      width: 95%;
      margin: 5% auto;
    }

    .modal-tabs {
      overflow-x: auto;
      white-space: nowrap;
      padding-bottom: 5px;
    }

    .modal-grid {
      grid-template-columns: 1fr;
    }
  }

  /* Modal de consentimiento */
  #consentModal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    overflow-y: auto;
  }

  .consent-content {
    padding: 20px;
    max-height: 60vh;
    overflow-y: auto;
  }

  .consent-section {
    margin-bottom: 20px;
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #6c757d;
  }

  .consent-section h4 {
    color: #495057;
    margin-top: 0;
  }

  .consent-checkbox {
    margin: 25px 0;
    padding: 15px;
    background-color: #e9ecef;
    border-radius: 8px;
    display: flex;
    align-items: center;
  }

  .consent-checkbox input {
    margin-right: 10px;
    min-width: 20px;
    min-height: 20px;
  }

  #consentAcceptBtn {
    background-color: var(--primary);
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s;
  }

  #consentAcceptBtn:disabled {
    background-color: var(--gray);
    cursor: not-allowed;
  }

  #consentAcceptBtn:hover:not(:disabled) {
    background-color: var(--primary-dark);
  }

  /* Botones de descarga */
  .modal-btn.download-btn {
    background-color: var(--primary);
    color: white;
    margin-right: 10px;
  }

  .modal-btn.download-btn:hover {
    background-color: var(--primary-dark);
  }

  .modal-btn.download-btn i {
    margin-right: 5px;
  }

  /* Login Container */
  .auth-container {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    max-width: 420px;
    margin: auto;
    padding: 0 20px;
  }

  /* Panel de usuario */
  /* Panel de usuario mejorado */
  .user-panel {
    position: relative;
    display: none;
    justify-content: flex-end;
    /* Alinea a la derecha */
    margin-bottom: 20px;
  }

  .user-info {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 10px 15px;
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
  }

  .user-info:hover {
    background: rgba(0, 0, 0, 0.05);
  }

  .user-avatar {
    width: 40px;
    height: 40px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 16px;
  }

  .user-details {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    /* Alinea texto a la derecha */
  }

  .user-name {
    font-weight: 600;
    color: #2c3e50;
    font-size: 14px;
    white-space: nowrap;
  }

  .user-email {
    color: #7f8c8d;
    font-size: 12px;
  }

  .dropdown-icon {
    font-size: 12px;
    color: #7f8c8d;
    transition: transform 0.3s ease;
    margin-left: 5px;
  }

  /* Menú desplegable */
  .user-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    min-width: 200px;
    z-index: 100;
    display: none;
    overflow: hidden;
    margin-top: 5px;
  }

  .user-menu ul {
    list-style: none;
    padding: 0;
    margin: 0;
  }

  .user-menu li {
    border-bottom: 1px solid #f0f0f0;
  }

  .user-menu li:last-child {
    border-bottom: none;
  }

  .user-menu a,
  .user-menu .logout-btn {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    text-decoration: none;
    color: #2c3e50;
    font-size: 14px;
    transition: all 0.2s ease;
    background: none;
    border: none;
    width: 100%;
    text-align: left;
    cursor: pointer;
  }

  .user-menu a:hover,
  .user-menu .logout-btn:hover {
    background: #f8f9fa;
    color: var(--primary);
  }

  .user-menu i {
    margin-right: 10px;
    width: 18px;
    text-align: center;
  }

  /* Cuando el menú está activo */
  .user-menu.active {
    display: block;
  }

  .user-info.active .dropdown-icon {
    transform: rotate(180deg);
  }

  /* Formulario de login */
  .login-container {
    background: #ffffff;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  }

  .login-header {
    text-align: center;
    margin-bottom: 30px;
  }

  .login-logo {
    width: 150px;
    height: 150px;
    object-fit: contain;
    margin: 0 auto;
    /* Centrado horizontal */
    display: block;
    /* Necesario para que funcione margin auto */
  }

  .login-title {
    color: #2c3e50;
    font-size: 24px;
    margin-bottom: 8px;
    font-weight: 600;
  }

  .login-subtitle {
    color: #7f8c8d;
    font-size: 14px;
    margin-bottom: 0;
  }

  .login-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
  }

  .form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
  }

  .input-label {
    font-size: 14px;
    color: #2c3e50;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
  }

  .icon {
    color: var(--primary);
    font-size: 14px;
  }

  .form-input {
    padding: 12px 15px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.2s ease;
  }

  .form-input:focus {
    border-color: var(--primary-dark);
    box-shadow: 0 0 0 3px rgba(58, 123, 213, 0.1);
    outline: none;
  }

  .forgot-password {
    font-size: 12px;
    color: var(--primary);
    text-decoration: none;
    text-align: right;
    margin-top: 5px;
  }

  .forgot-password:hover {
    text-decoration: underline;
  }

  .error-message {
    color: #e74c3c;
    font-size: 13px;
    text-align: center;
    min-height: 18px;
  }

  .btn-primary {
    background: var(--primary);
    color: white;
    border: none;
    padding: 14px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
  }

  .btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  }

  .btn-primary:disabled {
    background: #bdc3c7;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
  }

  /* Estilos carga por imagenes */
  .file-upload-container {
    border: 2px dashed var(--border);
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    transition: all 0.3s;
  }

  .file-upload-container:hover {
    border-color: var(--primary);
  }

  .file-input {
    display: none;
  }

  .file-upload-label {
    display: block;
    cursor: pointer;
    color: var(--primary);
    font-weight: 500;
  }

  .file-upload-label i {
    font-size: 24px;
    margin-bottom: 10px;
  }

  .file-hint {
    display: block;
    margin-top: 10px;
    color: var(--gray);
    font-size: 0.8rem;
  }

  .file-previews {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 15px;
  }

  .file-preview {
    width: 100px;
    height: 100px;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  }

  .file-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  .file-preview .remove-file {
    position: absolute;
    top: 5px;
    right: 5px;
    background: var(--danger);
    color: white;
    border: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  /* Estilos para la paginación */
  #paginationContainer {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 20px;
    gap: 15px;
  }

  .pagination {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
    justify-content: center;
  }

  .pagination-btn {
    width: 40px;
    height: 40px;
    border: 1px solid var(--border);
    background: white;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
  }

  .pagination-btn:hover:not(.active) {
    background-color: var(--primary-light);
    color: white;
    border-color: var(--primary-light);
  }

  .pagination-btn.active {
    background-color: var(--primary);
    color: white;
    border-color: var(--primary);
    font-weight: 600;
  }

  .pagination-btn i {
    font-size: 12px;
  }

  .pagination-ellipsis {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gray);
  }

  .pagination-counter {
    font-size: 0.9rem;
    color: var(--gray);
    margin-bottom: 5px;
  }

  /* Toast Notifications */
  .notification {
    position: fixed;
    top: 20px;
    right: 20px;
    min-width: 300px;
    max-width: 400px;
    background: white;
    border-radius: 8px;
    padding: 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: flex-start;
    gap: 12px;
    transform: translateX(120%);
    transition: all 0.3s ease-out;
    z-index: 1000;
    opacity: 0;
  }

  .notification.show {
    transform: translateX(0);
    opacity: 1;
  }

  .notification.hide {
    transform: translateX(120%);
    opacity: 0;
  }

  .notification i {
    font-size: 1.25rem;
    flex-shrink: 0;
  }

  .notification-content {
    flex: 1;
  }

  .notification-title {
    font-weight: 600;
    margin-bottom: 4px;
  }

  .notification-message {
    font-size: 0.9rem;
    color: var(--text);
    opacity: 0.9;
  }

  .notification-close {
    padding: 4px;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.2s;
  }

  .notification-close:hover {
    opacity: 1;
  }

  .notification-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: rgba(20, 63, 106, 0.7) !important;
  }
  /* Unified toast styling: muted semi-transparent blue for all types */
  .notification,
  .notification.success,
  .notification.error,
  .notification.warning,
  .notification.info {
    background: rgba(20, 63, 106, 0.85) !important;
    border-left: 4px solid rgba(20, 63, 106, 0.85) !important;
    color: rgba(255, 255, 255, 0.98) !important;
  }

  .notification i {
    color: rgba(255, 255, 255, 0.98) !important;
  }

  /* Ensure title/message remain readable over the stronger blue */
  .notification .notification-title,
  .notification .notification-message {
    color: rgba(255, 255, 255, 0.98) !important;
  }

  /* ALSO OVERRIDE common alert/toast classes from other libs to keep unified blue */
  .alert,
  .alert-success,
  .toast,
  .toast.show,
  .bg-success,
  .alert-dismissible {
    background: rgba(20, 63, 106, 0.85) !important;
    color: rgba(255,255,255,0.98) !important;
    border-color: rgba(20, 63, 106, 0.85) !important;
  }

  .alert .btn-close,
  .alert-dismissible .btn-close,
  .toast .btn-close {
    filter: invert(1) !important;
  }

  /* Confirm Modal */
  .confirm-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1100;
    backdrop-filter: blur(3px);
  }

  .confirm-content {
    background: white;
    border-radius: 12px;
    width: 90%;
    max-width: 400px;
    overflow: hidden;
    animation: modalFadeIn 0.3s ease-out;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  }

  .confirm-header {
    padding: 16px 24px;
    background: var(--light);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 12px;
  }

  .confirm-header i {
    font-size: 1.5rem;
  }

  .confirm-header h4 {
    font-size: 1.2rem;
    font-weight: 600;
    margin: 0;
  }

  .confirm-body {
    padding: 24px;
    color: var(--text);
  }

  .confirm-body p {
    margin: 0;
    line-height: 1.5;
  }

  .confirm-footer {
    padding: 16px 24px;
    background: var(--light);
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
  }

  .confirm-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
  }

  .confirm-btn i {
    font-size: 1rem;
  }

  .confirm-btn.cancel {
    background: var(--light);
    color: var(--text);
  }

  .confirm-btn.cancel:hover {
    background: var(--border);
  }

  .confirm-btn.accept {
    background: var(--primary);
    color: white;
  }

  .confirm-btn.accept:hover {
    background: var(--primary-dark);
  }

  @keyframes modalFadeIn {
    from {
      opacity: 0;
      transform: translateY(-20px);
    }

    to {
      opacity: 1;
      transform: translateY(0);
    }
  }

  /* Extra small-screen tweaks */
  @media (max-width: 420px) {
    body {
      font-size: 15px;
    }

    header {
      padding: 12px 10px;
    }

    .form-container {
      padding: 12px;
    }

    .section-title {
      font-size: 1.05rem;
    }

    .login-logo {
      max-width: 160px;
      margin: 0 auto 12px;
    }

    .main-tab-btn {
      padding: 10px 12px;
      font-size: 14px;
    }

    .form-actions {
      flex-direction: column;
    }

    .probability-circle {
      width: 90px;
      height: 90px;
    }
  }

  /* Animaciones */
  .notification,
  .confirm-modal {
    will-change: transform, opacity;
  }

  /* Media queries para responsive */
  @media (max-width: 768px) {
    .notification {
      min-width: auto;
      width: calc(100% - 32px);
      margin: 16px;
    }

    .confirm-content {
      margin: 16px;
    }
  }

  .confirm-btn.cancel:hover {
    background-color: #d0d0d0;
  }

  /* Modal and other inline-style overrides */
  .modal-content {
    /* allow modal to shrink on small screens; override inline max-width when needed */
    width: 90%;
    max-width: 800px !important;
    margin: 20px auto;
  }

  /* Breakpoints for Mobile L / M / S */
  /* Mobile L: up to 425px (e.g. 425x913) */
  @media (max-width: 425px) {
    .header-content {
      flex-direction: column;
      align-items: flex-start;
      gap: 8px;
    }
    .header-main-info { text-align: left; }
    /* Typography scale adjustments for Mobile L */
    body { font-size: 15px; }
    h1 { font-size: 1.6rem; }
    .header-title { font-size: 1.6rem; }
    .header-subtitle { font-size: 0.95rem; }
    .section-title { font-size: 1.15rem; }
    label { font-size: 0.95rem; }
    input, select, textarea { font-size: 0.95rem; }
    header .header-left img { max-height: 48px; width: auto; }
    .user-panel { margin-top: 8px; margin-right: 10px; }
    .user-avatar { width: 36px; height: 36px; font-size: 14px; }
    .form-container { padding: 18px; }
    .form-grid { grid-template-columns: 1fr; gap: 16px; }
    .main-tab-btn { padding: 10px 12px; font-size: 15px; }
    .navigation-buttons .nav-btn { width: 48%; }
    .probability-circle { width: 100px; height: 100px; }
    /* Ensure simulate/clear buttons don't overflow and can wrap */
    .simulate-tab-btn, .clear-tab-btn, #simulatePatientBtn {
      flex: 0 0 auto;
      width: auto;
      margin-left: 0;
      margin-top: 8px;
    }
  }

  /* Mobile M: up to 375px */
  @media (max-width: 375px) {
    /* Mobile M: tighten typography more */
    body { font-size: 14.5px; }
    h1 { font-size: 1.4rem; }
    .header-subtitle { display: none; }
    .header-main-info { display: none; }
    header .header-left img { max-height: 44px; }
    .user-panel { margin-right: 8px; }
    .user-avatar { width: 34px; height: 34px; font-size: 13px; }
    .section-title { font-size: 1.05rem; }
    label { font-size: 0.92rem; }
    input, select, textarea { font-size: 0.92rem; }
    .form-container { padding: 14px; }
    .navigation-buttons .nav-btn { width: 100%; margin-bottom: 8px; }
    .main-tab-btn { padding: 8px 10px; font-size: 13.5px; }
    .probability-circle { width: 90px; height: 90px; margin-right: 0; }
  }

  /* Mobile S: up to 320px */
  @media (max-width: 320px) {
    /* Mobile S: smallest readable sizes */
    body { font-size: 13.5px; }
    h1 { font-size: 1.2rem; }
    header { padding: 8px 8px; }
    header .header-left img { max-height: 36px; }
    .user-avatar { width: 30px; height: 30px; font-size: 12px; }
    .form-container { padding: 10px; }
    .section-title { font-size: 0.95rem; }
    label { font-size: 0.9rem; }
    input, select, textarea { padding: 10px 12px; font-size: 0.9rem; }
    .main-tab-btn { padding: 6px 8px; font-size: 12.5px; }
    .probability-circle { width: 80px; height: 80px; font-size: 1rem; }
  }

  .confirm-btn.accept {
    background-color: var(--primary);
    color: white;
  }

  .confirm-btn.accept:hover {
    background-color: var(--primary-dark);
  }

  /* Animación para el modal */
  @keyframes modalFadeIn {
    from {
      opacity: 0;
      transform: translateY(-20px);
    }

    to {
      opacity: 1;
      transform: translateY(0);
    }
  }