/* Entrana / Careworks – mismo tema que proyecto principal (demo_v1) */
:root {
  --primary: #0d9488;
  --primary-dark: #0f766e;
  --primary-light: #ccfbf1;
  --secondary: #64748b;
  --danger: #dc2626;
  --success: #0d9488;
  --warning: #b45309;
  --body: #334155;
  --border: #e2e8f0;
  --bs-primary: #0d9488;
  --bs-border-radius: 0.5rem;
  --bs-border-radius-lg: 0.5rem;
  --bs-box-shadow-sm: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}

* {
  box-sizing: border-box;
}

html {
  overflow-x: hidden;
  max-width: 100%;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  color: var(--body);
  background: #f8fafc;
  min-height: 100vh;
  overflow-x: hidden;
  max-width: 100%;
}

/* Forzar teal en botones primary (igual que layout principal) */
.btn-primary,
.btn-primary:hover,
.btn-primary:focus {
  background-color: #0d9488 !important;
  border-color: #0d9488 !important;
}
.btn-outline-primary {
  color: #0d9488 !important;
  border-color: #0d9488 !important;
}
.btn-outline-primary:hover {
  background-color: #0d9488 !important;
  border-color: #0d9488 !important;
  color: #fff !important;
}

.container {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 1rem;
  width: 100%;
  min-width: 0;
}

/* Main content: nunca más ancho que la pantalla */
.main {
  max-width: 100vw;
  min-width: 0;
  overflow-x: hidden;
}

.main.container {
  max-width: min(720px, 100%);
}

/* Escritorio/tablet grande: más ancho para la demo en dos columnas */
@media (min-width: 768px) {
  .main.container {
    max-width: min(1280px, calc(100vw - 2rem));
  }
}

/* Espaciador bajo navbar fija: evita que el banner quede tapado por el header */
.demo-spacer {
  min-height: 80px;
  height: 80px;
  flex-shrink: 0;
}

/* Navbar: botones siempre visibles (sin hamburguesa). Altura mínima para evitar solapamiento. */
.navbar.fixed-top {
  min-height: 72px;
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
}
.navbar.fixed-top .container.navbar-container {
  max-width: 720px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  flex-wrap: wrap;
  min-height: 56px;
}

.navbar-logo-img { height: 44px; }
.navbar-letters-img { height: 36px; }

@media (max-width: 575.98px) {
  .navbar.fixed-top {
    min-height: 88px;
  }
  .navbar.fixed-top .container.navbar-container {
    min-height: 72px;
  }
  .navbar-logo-img { height: 32px !important; }
  .navbar-letters-img { height: 26px !important; }
  .navbar .container.navbar-container {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }
  .navbar-actions {
    gap: 0.35rem;
  }
  .navbar-actions .btn-sm {
    font-size: 0.8125rem;
    padding: 0.3rem 0.5rem;
  }
  .badge-demo {
    font-size: 0.8125rem;
    padding: 0.2rem 0.4rem;
  }
  .demo-spacer {
    min-height: 116px;
    height: 116px;
  }
}

.lang-switcher {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.lang-btn {
  background: none;
  border: none;
  color: var(--secondary);
  cursor: pointer;
  font-size: 0.875rem;
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
}

.lang-btn:hover {
  color: var(--primary);
}

.lang-btn.active {
  font-weight: 600;
  color: var(--primary);
}

.lang-sep {
  color: var(--border);
  font-size: 0.875rem;
}

.badge-demo {
  background: var(--primary-light);
  color: var(--primary-dark);
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
  font-size: 0.875rem;
  font-weight: 500;
}

.btn-sm {
  padding: 0.35rem 0.65rem;
  font-size: 0.875rem;
}


/* Demo banner: debajo del header, sin quedar tapado */
.demo-banner {
  background: linear-gradient(90deg, var(--primary-light), #e0f2fe);
  padding: 0.875rem 0;
  border-bottom: 1px solid var(--border);
}

.demo-banner-text {
  margin: 0;
  font-size: 0.9375rem;
  color: var(--body);
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.stepper-scroll {
  margin: 0 -0.25rem;
  padding: 0 0.25rem;
  min-width: 0;
  max-width: 100%;
}

/* Stepper: en móvil puede hacer scroll horizontal para ver los 6 pasos */
.stepper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: nowrap;
  gap: 0.5rem;
  margin: 1.5rem 0;
  padding: 0.5rem 0;
  min-width: 0;
}

.stepper-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  flex-shrink: 0;
}

.stepper-num {
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: var(--border);
  color: var(--secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.875rem;
}

.stepper-step.current .stepper-num {
  background: var(--primary);
  color: #fff;
}

.stepper-step.done .stepper-num {
  background: var(--success);
  color: #fff;
}

.stepper-label {
  font-size: 0.75rem;
  color: var(--secondary);
  text-align: center;
}

.stepper-step.current .stepper-label {
  color: var(--primary-dark);
  font-weight: 500;
}

.stepper-line {
  flex: 1;
  min-width: 0.25rem;
  height: 2px;
  background: var(--border);
  flex-shrink: 1;
}

.stepper-step.done + .stepper-line {
  background: var(--success);
}

/* Step message: texto completo visible, sin cortes */
.step-message {
  padding: 0.75rem 1rem;
  background: var(--primary-light);
  border-radius: 8px;
  margin-bottom: 1.5rem;
  font-size: 0.9375rem;
  border-left: 4px solid var(--primary);
  word-wrap: break-word;
  overflow-wrap: break-word;
  hyphens: auto;
  min-width: 0;
}

/* Panels */
.main {
  padding: 1rem 0 3rem;
}

.step-panel {
  display: none;
}

.step-panel.active {
  display: block;
}

.step-panel {
  min-width: 0;
}

.step-panel h2 {
  font-size: 1.5rem;
  margin: 0 0 0.5rem;
  color: var(--body);
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.step-panel .lead {
  color: var(--secondary);
  margin: 0 0 1.25rem;
  font-size: 1rem;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

/* Cards – mismo estilo que proyecto principal */
.card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--bs-border-radius-lg);
  box-shadow: var(--bs-box-shadow-sm);
  margin-bottom: 1.25rem;
  overflow: hidden;
  min-width: 0;
  max-width: 100%;
}
.card-header {
  background-color: #f8fafc;
  border-bottom: 1px solid var(--border);
}
.card-body {
  padding: 1.25rem;
}

.card-body h3 {
  margin: 0 0 0.25rem;
  font-size: 1.25rem;
}

.text-muted {
  color: var(--secondary);
  font-size: 0.9375rem;
}

.small {
  font-size: 0.8125rem;
}

/* Session list */
.session-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.session-list li {
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.session-list li:last-child {
  border-bottom: none;
}

.session-list .session-date {
  font-weight: 500;
}

.session-list .session-status {
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
  font-size: 0.8125rem;
}

.session-status.completed {
  background: var(--primary-light);
  color: var(--primary-dark);
}

.session-status.scheduled {
  background: #e0e7ff;
  color: #4338ca;
}

.session-status.missed {
  background: #fee2e2;
  color: var(--danger);
}

/* Buttons – forma y color como proyecto principal (Bootstrap + teal) */
.btn {
  border-radius: var(--bs-border-radius);
  font-weight: 500;
}

.btn-demo-cta {
  margin-top: 0.5rem;
}

.btn-demo-cta.demo-highlight {
  box-shadow: 0 0 0 3px var(--primary);
  animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 3px var(--primary); }
  50% { box-shadow: 0 0 0 6px var(--primary-light); }
}

/* Dashboard stats */
.dashboard-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}

.stat-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.25rem;
  text-align: center;
}

.stat-card .stat-value {
  display: block;
  font-size: 2rem;
  font-weight: 700;
  color: var(--body);
}

.stat-card .stat-label {
  font-size: 0.875rem;
  color: var(--secondary);
}

.stat-card.stat-active .stat-value { color: var(--primary); }
.stat-card.stat-risky .stat-value { color: var(--warning); }
.stat-card.stat-abandoned .stat-value { color: var(--danger); }
.stat-card.stat-recovered .stat-value { color: var(--success); }
.stat-card.stat-appointments .stat-value { color: var(--primary); }

.demo-progress-card .card-subtitle,
.demo-alerts-card .card-subtitle,
.demo-recovery-stats .card-subtitle {
  font-size: 0.8125rem;
}

/* Paso 9: etiqueta audiencia clínica; lista equipo en misma columna; paciente = tarjeta sin badge “app” */
.alerts-step9-audience {
  display: inline-block;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
  padding: 0.3rem 0.65rem;
  border-radius: 6px;
  background: #e0f2fe;
  color: #0369a1;
}

.demo-alerts-card--patient {
  border-left: 4px solid #34d399;
  background: linear-gradient(to right, #f0fdf4 0%, #fff 14%);
}

.alerts-list--patient-app .alert-badge--patient-copy {
  font-weight: 600;
}

.message-reassurance-box {
  background: #ecfdf5;
  border-left: 3px solid #0d9488;
  color: var(--body);
}

.alerts-panel-patient-app.active {
  padding-top: 0;
}

@media (max-width: 767.98px) {
  .alerts-panel-patient-app.active {
    padding-top: 0.75rem;
    border-top: 1px solid var(--border);
    margin-top: 0.25rem;
  }
}

.progress-wrap {
  margin-top: 0.5rem;
}

.progress-bar-wrap {
  height: 10px;
  background: #e9ecef;
  border-radius: 999px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: #0d9488 !important;
  border-radius: 999px;
  transition: width 0.4s ease;
}

.progress-label {
  font-size: 0.875rem;
  color: var(--secondary);
  margin-top: 0.35rem;
  display: inline-block;
}

.alerts-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.alerts-list li {
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.9375rem;
}

.alerts-list li:last-child {
  border-bottom: none;
}

.alerts-list .alert-badge {
  display: inline-block;
  background: #fef3c7;
  color: #92400e;
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
  font-size: 0.75rem;
  margin-right: 0.5rem;
}

.demo-recovery-stats {
  background: #f0fdfa;
  border-color: var(--primary-light);
}

.demo-complete {
  font-size: 0.9375rem;
}

/* Modal recarga: obliga a reiniciar la demo */
.demo-reload-modal {
  position: fixed;
  inset: 0;
  z-index: 1100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.demo-reload-modal[hidden] {
  display: none !important;
}
.demo-reload-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
}
.demo-reload-modal-dialog {
  position: relative;
  width: 100%;
  max-width: 420px;
}
.demo-reload-modal-content {
  background: #fff;
  border-radius: var(--bs-border-radius-lg);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
  padding: 1.5rem;
}
.demo-reload-modal-title {
  margin: 0 0 0.75rem;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--body);
}
.demo-reload-modal-body {
  margin: 0 0 1.25rem;
  font-size: 1rem;
  color: var(--secondary);
  line-height: 1.45;
}
.demo-reload-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
}

/* Overlay cambio de modo (clínica ↔ paciente), centrado */
.mode-transition-overlay {
  position: fixed;
  inset: 0;
  z-index: 1050;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
}

.mode-transition-overlay[hidden] {
  display: none !important;
}

.mode-transition-overlay__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.48);
  opacity: 0;
  transition: opacity 0.32s ease;
}

.mode-transition-overlay--visible .mode-transition-overlay__backdrop {
  opacity: 1;
}

.mode-transition-overlay--out .mode-transition-overlay__backdrop {
  opacity: 0;
}

.mode-transition-overlay__dialog {
  position: relative;
  z-index: 1;
  max-width: 420px;
  width: 100%;
  padding: 1.65rem 1.5rem 1.5rem;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 24px 56px rgba(0, 0, 0, 0.2);
  text-align: center;
  border-top: 4px solid var(--border);
  transform: scale(0.94) translateY(16px);
  opacity: 0;
  transition:
    opacity 0.38s cubic-bezier(0.4, 0, 0.2, 1),
    transform 0.38s cubic-bezier(0.34, 1.15, 0.64, 1),
    border-color 0.3s ease;
}

.mode-transition-overlay--visible .mode-transition-overlay__dialog {
  opacity: 1;
  transform: scale(1) translateY(0);
}

.mode-transition-overlay--out .mode-transition-overlay__dialog {
  opacity: 0;
  transform: scale(0.96) translateY(-8px);
  transition-duration: 0.3s;
}

.mode-transition-overlay--clinic .mode-transition-overlay__dialog {
  border-top-color: #0ea5e9;
}

.mode-transition-overlay--patient .mode-transition-overlay__dialog {
  border-top-color: #10b981;
}

.mode-transition-overlay__badge {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin: 0 0 0.5rem;
  color: var(--secondary);
}

.mode-transition-overlay__title {
  font-size: 1.35rem;
  font-weight: 700;
  margin: 0 0 0.65rem;
  line-height: 1.25;
  color: var(--body);
}

.mode-transition-overlay__sub {
  font-size: 0.95rem;
  line-height: 1.45;
  color: var(--secondary);
}

/* Toast */
.toast-container {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
}

.toast {
  padding: 0.75rem 1.25rem;
  background: var(--body);
  color: #fff;
  border-radius: 10px;
  font-size: 0.9375rem;
  box-shadow: 0 4px 14px rgba(0,0,0,0.2);
  animation: toastIn 0.3s ease-out;
}

.toast.toast--success {
  background: var(--success);
}

.toast.toast--warning {
  background: var(--warning);
}

.toast.toast--info {
  background: #e0f2fe;
  color: #0c4a6e;
  border: 1px solid #7dd3fc;
}

/* Tema global clínica / paciente (fondo + barra superior) */
body.demo-theme-clinic,
body.demo-theme-patient {
  transition:
    background 0.38s ease,
    background-color 0.38s ease;
}

body.demo-theme-clinic {
  background: linear-gradient(180deg, #eff6ff 0%, #f1f5f9 140px, #f8f9fa 100%) !important;
}

body.demo-theme-patient {
  background: linear-gradient(180deg, #ecfdf5 0%, #f0fdf4 140px, #f8f9fa 100%) !important;
}

body.demo-theme-clinic .navbar.fixed-top {
  border-bottom-color: #bae6fd !important;
  transition: border-bottom-color 0.35s ease;
}

body.demo-theme-patient .navbar.fixed-top {
  border-bottom-color: #6ee7b7 !important;
  transition: border-bottom-color 0.35s ease;
}

/* Animación al cruzar entre modo clínica y paciente */
main.main.demo-main-mode-transition {
  animation: demoMainModeSwap 0.48s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes demoMainModeSwap {
  0% {
    opacity: 1;
    transform: translateY(0);
  }
  40% {
    opacity: 0.42;
    transform: translateY(12px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Panel transitions */
.step-panel {
  display: none;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.step-panel.active {
  display: block;
  animation: panelIn 0.35s ease-out forwards;
}

@keyframes panelIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Patient form */
.patient-form {
  min-width: 0;
  max-width: 100%;
}
.patient-form .form-row {
  margin-bottom: 1rem;
}

.patient-form .form-row:last-child {
  margin-bottom: 0;
}

.patient-form label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--body);
  margin-bottom: 0.35rem;
}

.patient-form .required {
  color: var(--danger);
}

.patient-form input,
.patient-form select {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 1rem;
  transition: border-color 0.2s ease;
  background: #fff;
}

.patient-form input:focus,
.patient-form select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary-light);
}

.patient-form input::placeholder {
  color: var(--secondary);
  opacity: 0.8;
}

.btn-link {
  background: none;
  border: none;
  color: var(--primary);
  font-size: 0.875rem;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
}

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

.json-preview {
  margin: 0.75rem 0 0;
  padding: 0.75rem;
  background: #f1f5f9;
  border-radius: 8px;
  font-size: 0.8125rem;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-word;
  border: 1px solid var(--border);
}

/* Patient card: preview (hidden until saved) */
.patient-card--preview {
  display: none;
  margin-top: 1rem;
}

.patient-card--preview.patient-card--filled {
  display: block;
  animation: cardPop 0.5s ease-out forwards;
}

@keyframes cardPop {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(-10px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* Session row: highlight when becomes missed */
.session-list li[data-session-id] {
  transition: background 0.25s ease, transform 0.2s ease;
}

.session-list li[data-clickable="true"] {
  cursor: pointer;
}

.session-list li[data-clickable="true"]:hover {
  background: #f8fafc;
}

.session-list li.session-row--updating {
  background: #fef3c7;
  transform: scale(1.02);
}

.session-list li.session-row--missed {
  background: #fef2f2;
}

/* Alert card entrance */
.alert-card--animate {
  animation: alertSlide 0.5s ease-out;
}

@keyframes alertSlide {
  from {
    opacity: 0;
    transform: translateX(-12px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Plan status card: recovered */
.plan-status-card.recovered {
  border-color: var(--success);
  background: var(--primary-light);
}

.plan-status-card.recovered .card-body {
  animation: statusPulse 0.6s ease-out;
}

@keyframes statusPulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.02); }
  100% { transform: scale(1); }
}

/* Hint text */
.hint {
  font-size: 0.875rem;
  color: var(--secondary);
  margin-bottom: 0.75rem;
}

/* Stepper clickable */
.stepper-step {
  cursor: pointer;
  transition: transform 0.15s ease;
}

.stepper-step:hover {
  transform: scale(1.05);
}

.stepper-line {
  transition: background 0.3s ease;
}

.stepper-num {
  transition: background 0.25s ease, color 0.25s ease;
}

@media (max-width: 600px) {
  .stepper-label { display: none; }
  .stepper-num { width: 1.75rem; height: 1.75rem; font-size: 0.75rem; }
}

/* ========== Responsive: móvil y tablet ========== */
@media (max-width: 767.98px) {
  .container {
    padding-left: 0.875rem;
    padding-right: 0.875rem;
  }
  .main.container {
    padding-left: 0.875rem;
    padding-right: 0.875rem;
  }

  /* Espaciador mayor para que el banner no quede tapado cuando el header ocupa dos líneas */
  .demo-spacer {
    min-height: 100px;
    height: 100px;
  }

  .demo-banner {
    padding: 0.65rem 0;
  }
  .demo-banner-text {
    font-size: 0.875rem;
    line-height: 1.4;
  }

  .main {
    padding: 0.75rem 0 2.5rem;
  }

  .stepper-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 4px;
    margin-left: -0.875rem;
    margin-right: -0.875rem;
    padding-left: 0.875rem;
    padding-right: 0.875rem;
    max-width: 100%;
  }
  .stepper-scroll::-webkit-scrollbar {
    height: 4px;
  }
  .stepper {
    margin: 1rem 0;
    gap: 0.25rem;
    min-width: max-content;
  }
  .stepper-line {
    min-width: 0.75rem;
  }

  .step-panel h2 {
    font-size: 1.25rem;
  }
  .step-panel .lead {
    font-size: 0.9375rem;
    margin-bottom: 1rem;
  }

  .step-message {
    padding: 0.6rem 0.75rem;
    font-size: 0.875rem;
    margin-bottom: 1rem;
    word-wrap: break-word;
    overflow-wrap: break-word;
  }

  .card-body {
    padding: 1rem;
  }

  .patient-form .form-row {
    margin-bottom: 0.875rem;
  }
  .patient-form input,
  .patient-form select {
    padding: 0.6rem 0.75rem;
  }

  .btn-demo-cta {
    width: 100%;
    padding: 0.6rem 1rem;
  }

  .dashboard-cards {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
  }
  .stat-card {
    padding: 1rem;
  }
  .stat-card .stat-value {
    font-size: 1.5rem;
  }
  .stat-card .stat-label {
    font-size: 0.8125rem;
  }

  .session-list li {
    flex-wrap: wrap;
    gap: 0.35rem;
    padding: 0.6rem 0;
  }
  .session-list .session-date {
    width: 100%;
    font-size: 0.9375rem;
  }
  .session-list .session-status {
    font-size: 0.75rem;
  }

  .alert-card .card-body,
  .demo-alerts-card .card-body {
    padding: 1rem;
  }
  .alert-card .card-body p {
    font-size: 0.9375rem;
  }

  .toast-container {
    left: 0.75rem;
    right: 0.75rem;
    bottom: 1rem;
    transform: none;
    max-width: calc(100vw - 1.5rem);
  }
  .toast {
    padding: 0.6rem 1rem;
    font-size: 0.875rem;
  }

  .demo-reload-modal {
    padding: 0.75rem;
  }
  .demo-reload-modal-content {
    padding: 1.25rem;
  }
  .demo-reload-modal-title {
    font-size: 1.125rem;
  }
  .demo-reload-modal-body {
    font-size: 0.9375rem;
  }
}

@media (max-width: 399px) {
  .dashboard-cards {
    grid-template-columns: 1fr;
  }
  .stepper-num {
    width: 1.5rem;
    height: 1.5rem;
    font-size: 0.7rem;
  }
  .stepper-line {
    min-width: 0.5rem;
  }
}

/* Patient Engagement System (demo) */
.engagement-system .card-header {
  background: linear-gradient(135deg, #f0fdfa 0%, #e0f2fe 100%);
  border-bottom: 1px solid var(--border);
}

.engagement-live-reaction {
  margin-top: 0.75rem;
  padding: 0.65rem 0.85rem;
  background: #fffbeb;
  border-left: 4px solid #f59e0b;
  border-radius: 0 8px 8px 0;
  font-size: 0.9375rem;
  font-weight: 500;
  color: #78350f;
  min-height: 2.75rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.engagement-live-reaction--flash {
  animation: engagementPulse 0.85s ease-out;
}

@keyframes engagementPulse {
  0% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.35);
  }
  40% {
    transform: scale(1.01);
    box-shadow: 0 0 0 6px rgba(245, 158, 11, 0.12);
  }
  100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(245, 158, 11, 0);
  }
}

.progress-preview-btn.active {
  background-color: var(--primary) !important;
  border-color: var(--primary) !important;
  color: #fff !important;
}

.star-rating {
  display: flex;
  gap: 0.15rem;
}

.star-btn {
  background: none;
  border: none;
  font-size: 1.5rem;
  line-height: 1;
  color: #cbd5e1;
  cursor: pointer;
  padding: 0.1rem 0.15rem;
  transition: color 0.15s ease, transform 0.15s ease;
}

.star-btn:hover {
  color: #fbbf24;
  transform: scale(1.08);
}

.star-btn.star-btn--active {
  color: #f59e0b;
}

/* Sin .ratio de Bootstrap: en escritorio el padding-top 16:9 crea una caja enorme que
   seguía capturando clics sobre los checkboxes pese a max-height (área invisible). */
.homework-video-placeholder {
  width: min(100%, 320px);
  height: 180px;
  max-width: 100%;
  flex-shrink: 0;
  background: #f1f5f9;
  border: 1px dashed var(--border);
  border-radius: var(--bs-border-radius);
  overflow: hidden;
}

.homework-video-inner {
  width: 100%;
  height: 100%;
  min-height: 0;
  background: #f8fafc;
}

.engagement-escalation {
  color: #b45309;
  font-weight: 500;
}

.alerts-list .alert-badge--behavior {
  background: #fee2e2;
  color: #991b1b;
}

.alerts-list .alert-badge--emotional {
  background: #ede9fe;
  color: #5b21b6;
}

.alerts-list .alert-badge--homework {
  background: #ffedd5;
  color: #9a3412;
}

.alerts-list .alert-badge--channel {
  background: #dbeafe;
  color: #1e40af;
}

.engagement-outcomes-card {
  background: #f8fafc;
  border-color: var(--border);
}

/* Modo clínica / paciente */
.experience-mode-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0 0 1.25rem;
  min-height: 2rem;
}

.experience-mode-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.experience-mode-pill--clinic {
  background: #e0f2fe;
  color: #0369a1;
  border: 1px solid #bae6fd;
}

.experience-mode-pill--patient {
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
}

.clinic-risk-narrative {
  border-left: 4px solid var(--primary);
  background: #f8fafc;
}

.stepper--compact .stepper-label {
  font-size: 0.58rem;
  max-width: 3.9rem;
  line-height: 1.12;
}

.stepper--compact .stepper-num {
  width: 1.75rem;
  height: 1.75rem;
  font-size: 0.75rem;
}

.alerts-list .alert-badge--positive {
  background: #d1fae5;
  color: #065f46;
}

.alerts-list .alert-badge--message-ok {
  background: #e0f2fe;
  color: #1e40af;
}

.session-ratings-container .session-rating-block {
  min-width: 0;
}

.session-rating-block--current {
  border-left: 4px solid var(--primary);
  background: #f0fdfa;
}

.patient-progress-floater .engagement-live-reaction--compact {
  padding: 0.5rem 0.65rem;
  font-size: 0.875rem;
  min-height: auto;
}

.patient-progress-floater .card-subtitle {
  font-size: 0.75rem;
}

.clinic-progress-floater .engagement-live-reaction--compact {
  padding: 0.5rem 0.65rem;
  font-size: 0.875rem;
  min-height: auto;
}

.clinic-progress-floater .card-subtitle {
  font-size: 0.75rem;
}

.engagement-live-reaction--clinic {
  background: #f1f5f9;
  border-left-color: #64748b;
  color: #334155;
}

/* Vista dual escritorio: clínica (izq.) + paciente (dcha.); móvil: una columna orden 1→11 */
.demo-dual-layout {
  min-width: 0;
}

@media (min-width: 768px) {
  .demo-dual-layout {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 1.5rem;
  }

  .demo-dual-column {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
  }

  .demo-split-heading {
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--secondary);
    margin-bottom: 0.65rem;
  }
}

@media (max-width: 767.98px) {
  .demo-dual-layout {
    display: flex;
    flex-direction: column;
  }

  .demo-dual-column {
    display: contents;
  }

  .demo-mo-p1 { order: 10; }
  .demo-mo-p2 { order: 20; }
  .demo-mo-floater { order: 25; }
  .demo-mo-p3 { order: 30; }
  .demo-mo-p4 { order: 40; }
  .demo-mo-p5 { order: 50; }
  .demo-mo-p6 { order: 60; }
  .demo-mo-p7 { order: 70; }
  .demo-mo-p8 { order: 80; }
  .demo-mo-p9 { order: 90; }
  .demo-mo-p10 { order: 100; }
  .demo-mo-p11 { order: 110; }
}

@media (min-width: 768px) {
  .demo-mo-p1,
  .demo-mo-p2,
  .demo-mo-p3,
  .demo-mo-p4,
  .demo-mo-p5,
  .demo-mo-p6,
  .demo-mo-p7,
  .demo-mo-p8,
  .demo-mo-p9,
  .demo-mo-p10,
  .demo-mo-p11,
  .demo-mo-floater {
    order: 0;
  }
}

.split-panel-desktop {
  display: none !important;
}

@media (min-width: 768px) {
  .split-panel-desktop:not([hidden]) {
    display: block !important;
  }
}

/* Calendario paso 5: elegir día de cita del plan */
.session-pick-calendar {
  max-width: 100%;
}

.session-pick-cal__toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.session-pick-cal__month-title {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--body);
  text-align: center;
  flex: 1;
  min-width: 0;
}

.session-pick-cal__nav {
  flex-shrink: 0;
  padding: 0.2rem 0.55rem;
  line-height: 1.2;
}

.session-pick-cal__grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0.35rem;
}

.session-pick-cal__weekday {
  text-align: center;
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--secondary);
  padding: 0.25rem 0;
  text-transform: capitalize;
}

.session-pick-cal__cell {
  min-height: 3.4rem;
  min-width: 0;
}

.session-pick-cal__cell--pad {
  min-height: 0;
}

.session-pick-cal__cell--muted {
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: #f8fafc;
  color: #cbd5e1;
  font-size: 0.85rem;
}

.session-pick-cal__cell--day {
  padding: 0;
}

.session-pick-cal__day-btn {
  width: 100%;
  height: 100%;
  min-height: 3.4rem;
  margin: 0;
  padding: 0.35rem 0.2rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.15rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.session-pick-cal__day-btn:hover {
  border-color: #99f6e4;
  background: #f0fdfa;
}

.session-pick-cal__day-btn--selected {
  border-color: #0d9488;
  background: #ecfdf5;
  box-shadow: 0 0 0 2px rgba(13, 148, 136, 0.22);
}

.session-pick-cal__day-num {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--body);
  line-height: 1.1;
}

.session-pick-cal__session-tag {
  font-size: 0.62rem;
  font-weight: 600;
  color: #0d9488;
  line-height: 1.1;
  text-align: center;
}

.session-pick-cal__cell--selected .session-pick-cal__day-num {
  color: #0f766e;
}
