:root {
  --primary: #00BDD6;      /* Turquesa Premium */
  --primary-dark: #008CA1;
  --primary-light: #E0F7FA;
  --accent: #F78DA7;       /* Rosa Pastel */
  --accent-dark: #D85D7B;
  --bg-gradient: linear-gradient(135deg, #F0FDFA 0%, #FFF1F2 50%, #ECFDF5 100%);
  --white: rgba(255, 255, 255, 0.8);
  --glass-bg: rgba(255, 255, 255, 0.45);
  --border: rgba(255, 255, 255, 0.55);
  --shadow: 0 10px 40px rgba(0, 189, 214, 0.08);
  --text-dark: #1E293B;    /* Slate 800 */
  --text-muted: #64748B;   /* Slate 500 */
  --success: #10B981;
  --danger: #EF4444;
  --warning: #F59E0B;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Inter', 'Outfit', sans-serif;
  background: var(--bg-gradient);
  color: var(--text-dark);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
  padding: 20px;
}

/* Círculos flotantes de fondo */
.bg-circle {
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
  z-index: 0;
  opacity: 0.55;
  pointer-events: none;
}

.bg-circle-1 {
  width: 500px;
  height: 500px;
  background: #C4F1F9;
  top: -100px;
  left: -100px;
}

.bg-circle-2 {
  width: 600px;
  height: 600px;
  background: #FFE4E6;
  bottom: -150px;
  right: -100px;
}

.bg-circle-3 {
  width: 400px;
  height: 400px;
  background: #D1FAE5;
  top: 40%;
  left: 30%;
}

/* Clases Comunes */
.hidden {
  display: none !important;
}

.text-center {
  text-align: center;
}

.m-0 {
  margin: 0 !important;
}

.w-full {
  width: 100%;
}

/* Tarjeta Glassmorphic Común */
.glass-card {
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: var(--shadow);
  z-index: 5;
  transition: all 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.glass-card:hover {
  box-shadow: 0 15px 45px rgba(0, 189, 214, 0.12);
}

/* 1. PANTALLA DE AUTENTICACIÓN */
.auth-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 90vh;
  z-index: 10;
  position: relative;
}

.auth-card {
  padding: 45px 35px;
  max-width: 440px;
  width: 100%;
  text-align: center;
}

.brand-header-auth {
  margin-bottom: 30px;
}

.auth-logo-img {
  width: 90px;
  height: 90px;
  object-fit: contain;
  margin-bottom: 15px;
  animation: logo-bounce 3s infinite ease-in-out;
}

.brand-title {
  font-size: 24px;
  font-weight: 700;
  color: var(--primary-dark);
  letter-spacing: -0.5px;
}

.brand-subtitle {
  font-size: 14px;
  color: var(--text-muted);
  font-weight: 500;
}

.input-group {
  margin-bottom: 20px;
  text-align: left;
}

.input-group label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 6px;
  letter-spacing: 0.5px;
}

.input-group input, .input-group select, .input-wrapper-weight input {
  width: 100%;
  padding: 12px 16px;
  border-radius: 12px;
  border: 1px solid rgba(0, 189, 214, 0.25);
  background: rgba(255, 255, 255, 0.7);
  font-family: inherit;
  font-size: 15px;
  color: var(--text-dark);
  transition: all 0.25s ease;
}

.input-group input:focus, .input-group select:focus, .input-wrapper-weight input:focus {
  outline: none;
  border-color: var(--primary);
  background: white;
  box-shadow: 0 0 10px rgba(0, 189, 214, 0.2);
}


.auth-error-msg {
  color: var(--danger);
  font-size: 13px;
  margin-top: 12px;
  font-weight: 500;
}

/* BOTONES */
.btn {
  font-family: inherit;
  padding: 12px 20px;
  border-radius: 12px;
  border: none;
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  transition: all 0.25s ease;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: white;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(0, 189, 214, 0.3);
}

.btn-danger {
  background: rgba(239, 68, 68, 0.15);
  color: var(--danger);
}

.btn-danger:hover {
  background: rgba(239, 68, 68, 0.25);
}

.btn-block {
  width: 100%;
}

/* 2. PANTALLA PRINCIPAL */
.app-wrapper {
  max-width: 1440px;
  margin: 0 auto;
  position: relative;
  z-index: 5;
}

/* BARRA SUPERIOR */
.app-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 25px;
  margin-bottom: 20px;
}

.topbar-logo-area {
  display: flex;
  align-items: center;
  gap: 15px;
}

.topbar-logo {
  width: 48px;
  height: 48px;
  object-fit: contain;
}

.topbar-app-name {
  font-size: 20px;
  font-weight: 700;
  color: var(--primary-dark);
}

.topbar-tagline {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 600;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 20px;
}

.doctor-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.6);
  padding: 6px 14px;
  border-radius: 30px;
  border: 1px solid var(--border);
}

.doctor-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  border: 1.5px solid var(--primary);
}

.doctor-badge .doctor-name {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-dark);
}

.btn-logout {
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 8px 14px;
  border-radius: 30px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-logout:hover {
  background: rgba(239, 68, 68, 0.1);
  color: var(--danger);
  border-color: rgba(239, 68, 68, 0.2);
}

/* GRID TRIDIMENSIONAL DE LA ESTACIÓN */
.workstation-grid {
  display: grid;
  grid-template-columns: 430px 1fr 370px;
  gap: 20px;
  margin-bottom: 20px;
}

.grid-column {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* COLUMNA IZQUIERDA */
.left-pane {
  background: rgba(255, 255, 255, 0.5);
}

.section-card {
  background: rgba(255, 255, 255, 0.65);
  border-radius: 16px;
  padding: 16px;
  border: 1px solid var(--border);
}

.section-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--primary-dark);
  margin-bottom: 12px;
  border-left: 3px solid var(--accent);
  padding-left: 8px;
}

.grid-2-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.input-wrapper-weight {
  display: flex;
  align-items: center;
  position: relative;
}

.input-wrapper-weight input {
  padding-right: 40px;
}

.unit-label {
  position: absolute;
  right: 14px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
}

/* Checklist de Guía Clínica */
.template-dropdown {
  width: 100%;
  padding: 10px;
  border-radius: 8px;
  border: 1px solid rgba(0, 189, 214, 0.2);
  margin-bottom: 10px;
  background: white;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 600;
}

.checklist-container {
  background: rgba(255, 255, 255, 0.4);
  border-radius: 10px;
  padding: 10px;
  border: 1px solid rgba(0, 189, 214, 0.1);
}

.checklist-desc {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 8px;
}

.checklist-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.checklist-item {
  font-size: 12.5px;
  color: var(--text-dark);
  display: flex;
  align-items: flex-start;
  gap: 8px;
  line-height: 1.3;
}

.checklist-check {
  color: var(--primary);
  font-weight: bold;
}

/* Grabación de Audio */
.record-card {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.recording-visualizer {
  background: rgba(0, 189, 214, 0.04);
  border: 1px dashed rgba(0, 189, 214, 0.2);
  border-radius: 14px;
  padding: 15px;
  width: 100%;
  text-align: center;
  margin-bottom: 15px;
}

.waves-animation {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 4px;
  height: 35px;
  margin-bottom: 10px;
}

.wave-bar {
  width: 3px;
  height: 4px;
  background: var(--primary);
  border-radius: 2px;
  transition: height 0.15s ease;
}

.waves-animation.active .wave-bar {
  animation: wave-pulse 1s infinite ease-in-out;
}

.waves-animation.active .wave-bar:nth-child(2) { animation-delay: 0.1s; }
.waves-animation.active .wave-bar:nth-child(3) { animation-delay: 0.2s; }
.waves-animation.active .wave-bar:nth-child(4) { animation-delay: 0.3s; }
.waves-animation.active .wave-bar:nth-child(5) { animation-delay: 0.4s; }
.waves-animation.active .wave-bar:nth-child(6) { animation-delay: 0.5s; }
.waves-animation.active .wave-bar:nth-child(7) { animation-delay: 0.6s; }
.waves-animation.active .wave-bar:nth-child(8) { animation-delay: 0.7s; }

.timer-display {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-dark);
}

.status-msg {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}

.mic-trigger-area {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 20px;
  margin-bottom: 15px;
}

.pause-btn {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  border: none;
  background: white;
  box-shadow: 0 4px 15px rgba(0, 189, 214, 0.1);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.pause-btn:hover {
  background: #f8fafc;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 189, 214, 0.15);
}

.pause-btn:active {
  transform: scale(0.95);
}

.pause-btn .pause-icon {
  font-size: 20px;
  color: var(--text-dark);
}

.pause-btn.paused {
  background: #f59e0b; /* Color naranja/ámbar para pausa */
  box-shadow: 0 0 15px rgba(245, 158, 11, 0.4);
}

.pause-btn.paused .pause-icon {
  color: white;
}

.mic-btn-large {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  border: none;
  background: white;
  box-shadow: 0 6px 20px rgba(0, 189, 214, 0.15);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.mic-btn-large .mic-icon {
  font-size: 32px;
}

.mic-btn-large::before {
  content: '';
  position: absolute;
  top: -8px;
  left: -8px;
  right: -8px;
  bottom: -8px;
  border-radius: 50%;
  border: 1.5px solid rgba(0, 189, 214, 0.2);
  transition: all 0.3s ease;
}

.mic-btn-large.recording {
  background: var(--danger);
  box-shadow: 0 0 25px rgba(239, 68, 68, 0.4);
  transform: scale(0.95);
}

.mic-btn-large.recording .mic-icon {
  animation: pulse-mic 1s infinite alternate;
}

.mic-btn-large.recording::before {
  border-color: rgba(239, 68, 68, 0.3);
  animation: pulse-ring-glow 1.5s infinite ease-out;
}

.record-actions-panel {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  width: 100%;
}

/* COLUMNA CENTRAL (EDITOR DE TRABAJO PEDIÁTRICO) */
.center-pane {
  background: rgba(255, 255, 255, 0.7);
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.04);
}

.workspace-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(0, 189, 214, 0.1);
  padding-bottom: 12px;
}

.workspace-title-area {
  display: flex;
  align-items: center;
  gap: 12px;
}

.live-badge {
  background: var(--primary-light);
  color: var(--primary-dark);
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  text-transform: uppercase;
}

/* Selector de Idiomas */
.translation-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
}

.trans-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
}

.lang-flags {
  display: flex;
  gap: 4px;
}

.flag-btn {
  background: white;
  border: 1.5px solid rgba(0, 189, 214, 0.15);
  border-radius: 8px;
  width: 34px;
  height: 34px;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.flag-btn:hover {
  background: var(--primary-light);
  transform: scale(1.1);
}

.flag-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  box-shadow: 0 4px 10px rgba(0, 189, 214, 0.2);
}

/* Área de Edición Directa */
.editor-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* Barra de Refinamiento por IA */
.refine-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(to right, #F0FDFA, #E0F7FA);
  padding: 10px 15px;
  border-radius: 12px 12px 0 0;
  border: 1px solid rgba(0, 189, 214, 0.2);
  border-bottom: none;
}

.refine-toolbar.hidden {
  display: none !important;
}

.refine-label {
  font-weight: 600;
  color: var(--primary-dark);
  font-size: 13px;
  white-space: nowrap;
}

.refine-input {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid rgba(0, 189, 214, 0.3);
  border-radius: 8px;
  font-size: 13px;
  outline: none;
  transition: all 0.2s;
}

.refine-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(0, 189, 214, 0.1);
}

.refine-btn {
  border: none;
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 6px;
}

.refine-mic {
  background: white;
  border: 1px solid #e2e8f0;
  color: #334155;
}

.refine-mic:hover {
  background: #f1f5f9;
}

.refine-mic.recording {
  background: var(--danger);
  color: white;
  animation: pulse-mic 1s infinite alternate;
  border-color: transparent;
}

.refine-submit {
  background: var(--primary);
  color: white;
}

.refine-submit:hover {
  background: var(--primary-dark);
}

.rich-text-editor {
  flex: 1;
  background: white;
  border: 1px solid rgba(0, 189, 214, 0.15);
  border-radius: 16px;
  padding: 24px;
  font-family: 'Inter', sans-serif;
  font-size: 15.5px;
  line-height: 1.65;
  color: #334155;
  overflow-y: auto;
  outline: none;
  min-height: 400px;
  box-shadow: inset 0 2px 8px rgba(0, 189, 214, 0.02);
  transition: all 0.25s ease;
}

.rich-text-editor:focus {
  border-color: var(--primary);
  box-shadow: 0 0 15px rgba(0, 189, 214, 0.1), inset 0 2px 8px rgba(0, 189, 214, 0.02);
}

.rich-text-editor[placeholder]:empty:before {
  content: attr(placeholder);
  color: var(--text-muted);
  font-style: italic;
}

/* Margen para los audios de respaldo en pantalla */
.backup-audio-card {
  background: rgba(255, 255, 255, 0.8);
  border-radius: 12px;
  padding: 12px;
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
}

.backup-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--primary-dark);
}

/* BARRA DE BOTONES DE ACCIONES CLÍNICAS */
.utilities-toolbar {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
}

.util-btn {
  background: white;
  border: 1px solid rgba(0, 189, 214, 0.2);
  color: var(--text-dark);
  font-size: 12.5px;
  font-weight: 600;
  padding: 10px 8px;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.15);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.util-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}

.btn-icon-label {
  font-size: 18px;
}

.util-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 189, 214, 0.1);
}

.btn-telegram:hover {
  background: #E0F2FE;
  color: #0284C7;
  border-color: #7DD3FC;
}

.btn-print:hover {
  background: #F0FDF4;
  color: #16A34A;
  border-color: #86EFAC;
}

.btn-copy:hover {
  background: #FFFBEB;
  color: #D97706;
  border-color: #FCD34D;
}

.btn-docline:hover {
  background: #FAF5FF;
  color: #9333EA;
  border-color: #D8B4FE;
}

.btn-finalize:hover {
  background: #FFF1F2;
  color: #E11D48;
  border-color: #FDA4AF;
}

/* COLUMNA DERECHA (GRAFICO PERCENTIL OMS) */
.right-pane {
  background: rgba(255, 255, 255, 0.55);
}

.percentile-subtitle {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: -15px;
  margin-bottom: 10px;
}

.percentile-visual-box {
  background: white;
  border-radius: 16px;
  padding: 15px;
  border: 1px solid rgba(0, 189, 214, 0.12);
  display: flex;
  flex-direction: column;
  gap: 15px;
  align-items: center;
}

.percentile-svg-container {
  width: 100%;
  min-height: 250px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.percentile-placeholder {
  text-align: center;
  padding: 20px;
  color: var(--text-muted);
}

.placeholder-icon {
  font-size: 48px;
  display: block;
  margin-bottom: 15px;
  opacity: 0.5;
}

.percentile-placeholder p {
  font-size: 13px;
  line-height: 1.5;
}

/* Tarjeta del Percentil Calculado */
.percentile-badge-card {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: white;
  padding: 8px 18px;
  border-radius: 30px;
  box-shadow: 0 4px 15px rgba(0, 189, 214, 0.25);
  font-weight: 700;
  font-size: 14px;
}

/* PIE DE PÁGINA */
.workstation-footer {
  margin-top: 25px;
  padding-top: 15px;
  border-top: 1px solid rgba(0, 189, 214, 0.1);
  font-size: 11px;
  text-align: justify;
  line-height: 1.5;
  color: var(--text-muted);
}

/* ESTILOS CLÍNICOS ESTRUCTURADOS (MARKDOWN PARSADO O FORMATO HTML) */
.rich-text-editor h3 {
  color: var(--primary-dark);
  font-size: 18px;
  margin-top: 18px;
  margin-bottom: 10px;
  border-bottom: 1.5px solid rgba(0, 189, 214, 0.15);
  padding-bottom: 4px;
}

.rich-text-editor table {
  width: 100%;
  border-collapse: collapse;
  margin: 15px 0;
  font-size: 14px;
}

.rich-text-editor th {
  background: var(--primary-light);
  color: var(--primary-dark);
  font-weight: 700;
  text-align: left;
  padding: 8px 12px;
  border: 1px solid rgba(0, 189, 214, 0.15);
}

.rich-text-editor td {
  padding: 8px 12px;
  border: 1px solid rgba(0, 189, 214, 0.1);
}

.rich-text-editor tr:nth-child(even) {
  background: rgba(0, 189, 214, 0.02);
}

.rich-text-editor ul, .rich-text-editor ol {
  margin-left: 20px;
  margin-bottom: 12px;
}

.rich-text-editor li {
  margin-bottom: 4px;
}

/* ANIMACIONES */
@keyframes logo-bounce {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-10px) rotate(2deg); }
}

@keyframes wave-pulse {
  0%, 100% { height: 4px; }
  50% { height: 35px; }
}

@keyframes pulse-mic {
  0% { transform: scale(1); opacity: 0.9; }
  100% { transform: scale(1.15); opacity: 1; }
}

@keyframes pulse-ring-glow {
  0% { transform: scale(1); opacity: 1; }
  100% { transform: scale(1.35); opacity: 0; }
}

/* Contenedor oculto en pantalla pero visible en impresión */
.print-only-container {
  display: none;
}

/* ==========================================
   🖨️ ESTILO PROFESIONAL DE IMPRESIÓN (A4)
   ========================================== */
@media print {
  /* @page margin aplica a TODAS las páginas impresas (incluidas 2ª, 3ª, etc.) */
  @page {
    size: A4;
    margin: 20mm 18mm;
  }

  html {
    margin: 0 !important;
    padding: 0 !important;
  }

  body {
    background: white !important;
    color: black !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
    overflow: visible !important;
    height: auto !important;
    min-height: auto !important;
    position: static !important;
    margin: 0 !important;
    padding: 0 !important;
    box-sizing: border-box !important;
    font-size: 12pt !important;
  }

  /* Ocultar TODOS los elementos de interfaz que no son contenido imprimible */
  .bg-circle,
  .auth-wrapper,
  .app-topbar,
  .left-pane,
  .right-pane,
  .utilities-toolbar,
  .backup-audio-card,
  .workstation-footer,
  .live-badge,
  .translation-toolbar,
  .top-template-selector,
  #checklist-container-wrapper,
  .workspace-checklist-column,
  .checklist-container,
  .checklist-list,
  .report-mode-bar,
  .katia-avatar-card,
  .percentile-type-selector,
  #percentile-badge-box,
  .workspace-header,
  .refine-toolbar,
  .print-watermark,
  .modal,
  #percentile-modal,
  canvas,
  #brain-canvas,
  #waveform,
  .waves-animation,
  .recording-visualizer,
  /* Ocultar posibles inyecciones de extensiones de Chrome (lectores RSS, etc.) */
  [id*="feedly"],
  [class*="rss-"],
  [class*="feed-"],
  [id*="extension-"],
  img[src*="rss"],
  img[src*="feed"],
  link[rel="alternate"][type="application/rss+xml"],
  link[rel="alternate"][type="application/atom+xml"] {
    display: none !important;
  }

  .app-wrapper {
    max-width: 100% !important;
    width: 100% !important;
    overflow: visible !important;
    height: auto !important;
    position: static !important;
  }

  .workstation-grid {
    display: block !important;
    margin: 0 !important;
  }

  .center-pane {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin: 0 !important;
    width: 100% !important;
    display: block !important;
  }

  .center-pane::before {
    display: none !important;
  }

  /* ESTILOS DE IMPRESIÓN NORMAL (Reporte) */
  body:not(.print-mode-clean-percentiles) .print-clean-header {
    display: none !important;
  }

  body:not(.print-mode-clean-percentiles) .print-header-container {
    display: flex !important;
    justify-content: flex-start !important;
    align-items: center !important;
    width: 100% !important;
    border-bottom: 2px solid #00BDD6 !important;
    margin-bottom: 25px !important;
    padding-bottom: 8px !important;
  }
  
  body.print-mode-clean-percentiles .print-header-container {
    display: none !important;
  }

  .print-logo {
    height: 80px !important;
    width: auto !important;
    display: block !important;
  }

  .print-header-text h2 {
    margin: 0 0 4px 0 !important;
    font-size: 16pt !important;
    color: #1e293b !important;
  }

  .print-header-text p {
    margin: 0 !important;
    font-size: 10pt !important;
    color: #64748b !important;
    line-height: 1.4 !important;
  }



  .rich-text-editor {
    border: none !important;
    padding: 0 !important;
    font-size: 12pt !important;
    line-height: 1.6 !important;
    color: black !important;
  }

  /* Mostrar y dar formato al contenedor de percentiles para padres */
  body:not(.print-mode-clean-percentiles) .print-only-container {
    display: block;
    page-break-before: always;
    break-before: page;
    break-inside: avoid;
    padding: 0 !important;
    margin: 0 !important;
  }

  body.print-mode-clean-percentiles .print-only-container {
    display: block;
    page-break-before: auto !important;
    margin-top: 10px !important;
  }

  .print-section-title {
    font-size: 16pt !important;
    color: #00BDD6 !important;
    margin-bottom: 5px !important;
    border-bottom: 2px solid #e2e8f0 !important;
    padding-bottom: 5px !important;
    font-family: 'Outfit', sans-serif !important;
    font-weight: 600 !important;
  }

  .print-section-subtitle {
    font-size: 10pt !important;
    color: #64748b !important;
    margin-bottom: 20px !important;
  }

  .print-charts-grid {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    gap: 24px !important;
    width: 100% !important;
    page-break-inside: auto !important;
    break-inside: auto !important;
  }

  .print-chart-box {
    width: 90% !important;
    max-width: 700px !important;
    page-break-inside: avoid !important;
    break-inside: avoid !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 8px !important;
    padding: 15px !important;
    background: #f8fafc !important;
    margin: 0 auto !important;
  }

  .print-chart-box h4 {
    font-size: 10pt !important;
    margin-top: 0 !important;
    margin-bottom: 8px !important;
    color: #1e293b !important;
    font-family: 'Outfit', sans-serif !important;
    text-align: center !important;
  }

  .print-svg-wrapper {
    width: 100% !important;
    display: block !important;
    text-align: center !important;
  }

  .print-svg-wrapper svg {
    width: 100% !important;
    height: auto !important;
    max-height: 350px !important;
    display: inline-block !important;
  }





  /* ESTILOS DE IMPRESIÓN LIMPIA (Solo Percentiles) */
  body.print-mode-clean-percentiles .editor-wrapper,
  body.print-mode-clean-percentiles .print-section-subtitle {
    display: none !important;
  }

  body.print-mode-clean-percentiles .print-clean-header {
    display: block !important;
    font-family: 'Inter', sans-serif;
    margin-bottom: 20px;
    font-size: 14pt;
  }
  
  body.print-mode-clean-percentiles .print-clean-header p {
    margin: 5px 0;
  }
  

}

/* Ocultar pie de página, membrete y marca de agua clínicos en pantalla normal */
.print-header-container,
.print-watermark {
  display: none;
}

/* RESPONSIVIDAD GENERAL */
@media (max-width: 1100px) {
  .workstation-grid {
    grid-template-columns: 1fr;
  }
}

/* SELECTOR DE PERCENTILES (PILLS) */
.percentile-type-selector {
  display: flex;
  background: rgba(0, 189, 214, 0.08);
  padding: 4px;
  border-radius: 12px;
  border: 1px solid rgba(0, 189, 214, 0.15);
  margin-bottom: 10px;
  gap: 4px;
}

.curve-tab {
  flex: 1;
  border: none;
  background: transparent;
  padding: 8px 12px;
  border-radius: 8px;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
}

.curve-tab.active {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: white;
  box-shadow: 0 4px 10px rgba(0, 189, 214, 0.25);
  transform: scale(1.02);
}

.curve-tab:hover:not(.active) {
  background: rgba(0, 189, 214, 0.12);
  color: var(--primary-dark);
}

/* MODAL / LIGHTBOX ZOOM */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 9999;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: all 0.3s ease;
}

.modal.hidden {
  display: none !important;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.modal-content {
  position: relative;
  background: rgba(255, 255, 255, 0.85);
  width: 90%;
  max-width: 850px;
  border-radius: 24px;
  padding: 30px;
  z-index: 10000;
  animation: modal-enter 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.modal-close-btn {
  position: absolute;
  top: 20px;
  right: 20px;
  border: none;
  background: rgba(0, 0, 0, 0.05);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 20px;
  line-height: 36px;
  text-align: center;
  color: var(--text-dark);
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  justify-content: center;
  align-items: center;
}

.modal-close-btn:hover {
  background: rgba(239, 68, 68, 0.15);
  color: var(--danger);
  transform: rotate(90deg);
}

.modal-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--primary-dark);
  margin-bottom: 20px;
  border-left: 4px solid var(--accent);
  padding-left: 10px;
}

.modal-body {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  background: white;
  border-radius: 16px;
  padding: 20px;
  border: 1px solid var(--border);
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.02);
}

.modal-body svg {
  width: 100%;
  max-width: 100%;
  height: auto;
  max-height: 550px;
}

}

/* ============================================================
   BOTÓN PE — MODO PADRES ESTRESADOS (Sutil y discreto)
   ============================================================ */
.report-mode-bar {
  display: flex;
  justify-content: flex-end;
  padding: 8px 4px 4px;
}

.mode-pill {
  background: rgba(200, 200, 210, 0.25);
  border: 1.5px solid rgba(200, 200, 210, 0.4);
  color: var(--text-muted);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  padding: 3px 10px;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.25s ease;
  backdrop-filter: blur(4px);
}

.mode-pill:hover {
  background: rgba(247, 141, 167, 0.15);
  border-color: var(--accent);
  color: var(--accent-dark);
}

.mode-pill.active {
  background: linear-gradient(135deg, rgba(247,141,167,0.25), rgba(247,141,167,0.1));
  border-color: var(--accent);
  color: var(--accent-dark);
  box-shadow: 0 0 12px rgba(247, 141, 167, 0.35);
}

/* ============================================================
   AVATAR INTERACTIVO DRA. KATIA
   ============================================================ */
.katia-avatar-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 16px 12px 12px;
  margin-top: 14px;
  background: rgba(255, 255, 255, 0.35);
  border: 1.5px solid rgba(247, 141, 167, 0.25);
  border-radius: 20px;
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 20px rgba(247, 141, 167, 0.1);
  animation: avatar-float 4s ease-in-out infinite;
}

@keyframes avatar-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}

.avatar-greeting {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent-dark);
  text-align: center;
  min-height: 1.2em;
  transition: opacity 0.3s;
}

.katia-img-wrapper {
  position: relative;
  width: 190px;
  height: 230px;
  cursor: pointer;
  transition: transform 0.3s ease;
  filter: drop-shadow(0 8px 20px rgba(247, 141, 167, 0.3));
}

.katia-img-wrapper:hover {
  transform: scale(1.05) translateY(-4px);
  filter: drop-shadow(0 14px 28px rgba(247, 141, 167, 0.45));
}

.katia-pose {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.katia-pose-hidden {
  opacity: 0;
  pointer-events: none;
  transform: scale(0.96);
}

.avatar-hint {
  font-size: 0.68rem;
  color: var(--text-muted);
  text-align: center;
  opacity: 0.7;
}

/* =========================================================
   📱 RESPONSIVIDAD MÓVIL Y TABLET
   ========================================================= */
@media (max-width: 1024px) {
  /* Apilar columnas de la estación de trabajo */
  .workstation-grid {
    grid-template-columns: 1fr;
    gap: 15px;
  }
  
  /* Ajustar la barra superior para que mida exactamente igual que las demás tarjetas */
  .app-topbar {
    width: 100%;
    box-sizing: border-box;
    flex-direction: column;
    gap: 15px;
    align-items: center;
    text-align: center;
  }
  
  /* Ocultar el botón de manos libres obligatoriamente en móvil y tablet */
  .hf-mobile-hide {
    display: none !important;
  }
  
  .topbar-actions {
    flex-wrap: wrap;
    justify-content: center;
  }
  
  .topbar-logo-area {
    flex-direction: column;
    gap: 10px;
  }

  /* Ocultar el avatar animado en dispositivos móviles para ahorrar espacio */
  .katia-avatar-card {
    display: none !important;
  }

  /* Ajustar los campos divididos en dos columnas */
  .split-inputs {
    flex-direction: column;
  }
}

/* =========================================
   SELECTOR DE TIPO DE DOCUMENTO (Píldoras)
   ========================================= */
.doc-type-selector {
  margin-top: 15px;
  margin-bottom: 5px;
}

.doc-type-label {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 8px;
  display: block;
}

.doc-type-pills {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.doc-type-pills input[type="radio"] {
  display: none;
}

.doc-pill {
  padding: 6px 12px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid rgba(255, 126, 158, 0.3);
  color: var(--text-dark);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.doc-pill:hover {
  background: rgba(255, 255, 255, 0.9);
  transform: translateY(-1px);
}

.doc-type-pills input[type="radio"]:checked + .doc-pill {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
  box-shadow: 0 2px 6px rgba(255, 126, 158, 0.4);
}

/* =========================================
   ANIMACIÓN DEL LOGO ESTÁTICO (FLOTANTE)
   ========================================= */
.floating-logo {
  animation: float-logo 4s ease-in-out infinite;
  transition: transform 0.3s ease;
}

.floating-logo:hover {
  animation-play-state: paused;
  transform: scale(1.05);
}

@keyframes float-logo {
  0% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-8px);
  }
  100% {
    transform: translateY(0px);
  }
}

/* =========================================
   PLACEHOLDER MULTILINEA DEL EDITOR
   ========================================= */
.rich-text-editor:empty:before {
  content: attr(placeholder);
  color: #a0aec0;
  pointer-events: none;
  display: block;
  white-space: pre-wrap;
  font-size: 0.9em;
  line-height: 1.5;
}



