/* Oculta todas las “páginas” por defecto */
.page {
    display: none;
  }
  
  /* Sólo muestra la que tenga “active” */
  .page.active {
    display: block;
  }
/* --- ESTILOS CSS --- */
body { font-family: 'Inter', sans-serif; }
.page { display: none; } .page.active { display: block; }
#prescriptionContainer {
  position: relative;
  border: 1px solid #ccc;
  background-color: white;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  aspect-ratio: 210 / 297;   /* asegúrate de que esté presente */
  max-width: 794px;          /* y este también */
  width: 100%;
  margin: auto;
  overflow: hidden;
}


.data-element-wrapper {
    position: absolute;
    border: none; /* Sin borde */
    background-color: transparent;
    cursor: default; /* Cursor normal */
    overflow: hidden;
    min-width: 30px;
    min-height: 15px;
    box-sizing: border-box;
    border-radius: 3px;
}
.data-element-content { width: 100%; height: 100%; overflow: hidden; font-size: 10px; line-height: 1.25; padding: 2px 4px; box-sizing: border-box; user-select: none; -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; word-wrap: break-word; }
#data-diagnosisBlock .data-element-content, #data-cie10Block .data-element-content, #data-indications .data-element-content { white-space: pre-wrap; font-size: 11px; overflow: visible; height: auto; }
#data-formattedDocName .data-element-content { font-size: 15px; font-weight: 500; line-height: 1.3; } #data-formattedDocSpecialty .data-element-content { font-size: 13px; line-height: 1.3; }
[id^="data-treatment-"] .data-element-content { font-size: 10px; white-space: normal; }
.resize-handle {
    display: none; /* Oculta el cuadro azul */
}
#printPreviewPage { background-color: #ccc; padding: 20px 0; }
#printFinalContainer { position: relative; border: 1px solid #888; background-color: white; background-size: contain; background-repeat: no-repeat; background-position: center; aspect-ratio: 210 / 297; width: 794px; height: 1123px; margin: auto; overflow: hidden; box-shadow: 0 0 10px rgba(0,0,0,0.5); }
.static-data-element { position: absolute; font-size: 10pt; line-height: 1.15; white-space: pre-wrap; word-wrap: break-word; padding: 1px; box-sizing: border-box; color: black; overflow: hidden; }
#print-formattedDocName { font-size: 15pt !important; font-weight: 500 !important; } #print-formattedDocSpecialty { font-size: 13pt !important; } [id^="print-treatment-"] { font-size: 9pt !important; white-space: normal !important; }
/* Estilos para TODOS los modales */
.modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background-color: rgba(0, 0, 0, 0.6); display: none; /* Oculto por defecto */ justify-content: center; align-items: center; z-index: 1000; }
.modal-content { background-color: white; padding: 25px; border-radius: 8px; box-shadow: 0 5px 15px rgba(0,0,0,0.3); width: 90%; max-width: 500px; /* Ajustado ancho */ max-height: 90vh; display: flex; flex-direction: column; position: relative; }
.modal-close-btn { position: absolute; top: 10px; right: 15px; font-size: 1.5rem; color: #6b7280; cursor: pointer; border: none; background: none; }
/* Estilo específico para el contenedor de texto de términos */
#termsTextContainer { max-height: 60vh; overflow-y: auto; border: 1px solid #e5e7eb; padding: 15px; background-color: #f9fafb; margin-bottom: 15px; text-align: left; font-size: 0.8rem; }
#termsTextContainer h3 { font-weight: 600; margin-top: 10px; margin-bottom: 5px; font-size: 0.9rem;}
#termsTextContainer p, #termsTextContainer li { margin-bottom: 8px; line-height: 1.4; }
#termsTextContainer ul { list-style: disc; padding-left: 20px; }
/* --- Fin Estilos Términos --- */
/* Estilos para modal de Login */
#loginModal .modal-content { max-width: 400px; } /* Más pequeño */
.auth-form label { display: block; margin-bottom: 0.25rem; font-weight: 500; font-size: 0.875rem; color: #374151; }
.auth-form input[type="email"], .auth-form input[type="password"] { display: block; width: 100%; padding: 0.5rem 0.75rem; border: 1px solid #d1d5db; border-radius: 0.375rem; margin-bottom: 1rem; font-size: 0.875rem; box-shadow: sm; }
.auth-form button { width: 100%; padding: 0.6rem 1rem; border-radius: 0.375rem; font-weight: 600; font-size: 0.875rem; transition: background-color 0.2s; box-shadow: sm; }
.auth-button-primary { background-color: #10b981; /* Emerald-500 */ color: white; border: none; } .auth-button-primary:hover { background-color: #059669; /* Emerald-600 */ }
.auth-button-secondary { background-color: #e5e7eb; /* Gray-200 */ color: #374151; /* Gray-700 */ border: 1px solid #d1d5db; margin-top: 0.5rem; } .auth-button-secondary:hover { background-color: #d1d5db; /* Gray-300 */ }
.social-login-divider { text-align: center; margin: 1.5rem 0; font-size: 0.75rem; color: #6b7280; position: relative; } .social-login-divider::before, .social-login-divider::after { content: ''; display: block; width: 40%; height: 1px; background-color: #e5e7eb; position: absolute; top: 50%; } .social-login-divider::before { left: 0; } .social-login-divider::after { right: 0; }
.social-login-button { display: flex; align-items: center; justify-content: center; gap: 0.5rem; background-color: white; color: #374151; border: 1px solid #d1d5db; margin-top: 0.75rem; font-weight: 500; } .social-login-button:hover { background-color: #f9fafb; } .social-login-button img { height: 1.25rem; width: 1.25rem; }
#authMessage { margin-top: 1rem; text-align: center; font-size: 0.875rem; } .auth-message-error { color: #dc2626; /* Red-600 */ } .auth-message-success { color: #16a34a; /* Green-600 */}
/* --- Fin Estilos Login --- */
.list-item { display: flex; align-items: center; justify-content: space-between; padding: 8px; border: 1px solid #e5e7eb; border-radius: 4px; margin-bottom: 5px; background-color: #f9fafb; }
.list-item-content { flex-grow: 1; margin-right: 10px; font-size: 0.8rem; }
.list-item-controls { display: flex; gap: 5px; flex-shrink: 0; } .list-item-controls button, .list-item-controls a { padding: 3px 6px; font-size: 0.7rem; border-radius: 3px; cursor: pointer; transition: background-color 0.2s; }
.edit-btn { background-color: #e0e7ff; color: #3730a3; border: 1px solid #c7d2fe; } .edit-btn:hover { background-color: #c7d2fe; } .delete-btn { background-color: #fee2e2; color: #991b1b; border: 1px solid #fecaca; } .delete-btn:hover { background-color: #fecaca; }
.move-btn { background-color: #e5e7eb; color: #4b5563; border: 1px solid #d1d5db; } .move-btn:hover { background-color: #d1d5db; } .move-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.input-with-select { display: flex; gap: 0; } .input-with-select input { border-top-right-radius: 0; border-bottom-right-radius: 0; flex-grow: 1; min-width: 50px; } .input-with-select select { border-top-left-radius: 0; border-bottom-left-radius: 0; border-left: 0; background-color: #f9fafb; font-size: 0.875rem; }
@page { size: A4 portrait; margin: 0mm; }
@media print {
     /* Estilos de impresión completos */
    body { margin: 0 !important; padding: 0 !important; background-color: white !important; -webkit-print-color-adjust: exact !important; print-color-adjust: exact !important; }
    body > div:not(#printPreviewPage) { display: none !important; }
    #printPreviewPage { padding: 0 !important; background-color: white !important; width: 100% !important; height: 100% !important; position: absolute; top: 0; left: 0; }
    #printPreviewPage > .navigation-buttons { display: none !important; }
    #printFinalContainer { width: 210mm !important; height: 297mm !important; margin: 0 !important; padding: 0 !important; border: none !important; box-shadow: none !important; overflow: visible !important; position: absolute !important; top: 0; left: 0; background-image: var(--template-bg-image-url); background-size: contain; background-repeat: no-repeat; background-position: center; }
    .static-data-element { position: absolute !important; overflow: visible !important; border: none !important; background-color: transparent !important; color: black !important; font-family: Arial, sans-serif !important; white-space: pre-wrap !important; word-wrap: break-word !important; font-size: 10pt !important; line-height: 1.15 !important; padding: 1px !important; box-sizing: border-box !important; } /* Asegurar tamaño y wrap */
    #print-formattedDocName { font-size: 15pt !important; font-weight: 500 !important; }
    #print-formattedDocSpecialty { font-size: 13pt !important; }
    [id^="print-treatment-"] { font-size: 9pt !important; white-space: normal !important; } /* Permitir wrap en tratamiento */
    #printFinalContainer::before, #printFinalContainer::after { display: none !important; }
}