/* ==========================================================================
   ASISTENTE IA EL MAYOREO — ESTILOS DEL PANEL DE ADMINISTRACIÓN
   Identidad Visual: Azul Marino Escolar, Blanco Limpio y Dorado Institucional
   Adaptable a Computadora, Tableta y Celular
   ========================================================================== */

:root {
  --navy-950: #0a1931;
  --navy-900: #0f2547;
  --navy-800: #1b3b6f;
  --navy-700: #254e8e;
  --navy-600: #2e62b0;
  --navy-100: #e8effa;
  --navy-50: #f3f7fd;

  --gold-600: #b45309;
  --gold-500: #d97706;
  --gold-400: #f59e0b;
  --gold-100: #fef3c7;
  --gold-50: #fffbeb;

  --emerald-700: #047857;
  --emerald-600: #059669;
  --emerald-100: #d1fae5;
  --emerald-50: #ecfdf5;

  --red-700: #b91c1c;
  --red-600: #dc2626;
  --red-100: #fee2e2;
  --red-50: #fef2f2;

  --slate-900: #0f172a;
  --slate-800: #1e293b;
  --slate-700: #334155;
  --slate-600: #475569;
  --slate-500: #64748b;
  --slate-400: #94a3b8;
  --slate-300: #cbd5e1;
  --slate-200: #e2e8f0;
  --slate-100: #f1f5f9;
  --slate-50: #f8fafc;

  --white: #ffffff;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 3px rgba(15, 37, 71, 0.06), 0 1px 2px rgba(15, 37, 71, 0.04);
  --shadow-md: 0 4px 12px rgba(15, 37, 71, 0.08);
  --shadow-lg: 0 12px 28px rgba(15, 37, 71, 0.14);
  --sidebar-width: 290px;
}

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

body {
  font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, Roboto, Helvetica, Arial, sans-serif;
  background-color: var(--slate-50);
  color: var(--slate-800);
  line-height: 1.55;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ==========================================================================
   LAYOUT PRINCIPAL
   ========================================================================== */

.app-shell {
  display: flex;
  min-height: 100vh;
  width: 100%;
}

/* BARRA LATERAL (SIDEBAR) */
.sidebar {
  width: var(--sidebar-width);
  background: linear-gradient(180deg, var(--navy-900) 0%, var(--navy-950) 100%);
  color: var(--white);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  z-index: 100;
  box-shadow: 2px 0 12px rgba(0, 0, 0, 0.15);
}

.brand-header {
  padding: 22px 20px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-crest {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--gold-400) 0%, var(--gold-600) 100%);
  color: var(--navy-950);
  font-weight: 800;
  font-size: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.25);
  flex-shrink: 0;
  border: 2px solid rgba(255, 255, 255, 0.4);
}

.brand-text h1 {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 0.2px;
  color: var(--white);
}

.brand-text p {
  font-size: 0.76rem;
  color: #cbd5e1;
  margin-top: 2px;
}

.stage-pill-sidebar {
  margin: 14px 16px 6px;
  padding: 10px 12px;
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.45);
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  color: #fde68a;
}

.stage-pill-sidebar strong {
  display: block;
  color: #fef3c7;
  font-size: 0.82rem;
  margin-bottom: 2px;
}

.nav-group-label {
  padding: 16px 20px 6px;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #94a3b8;
  font-weight: 700;
}

.nav-list {
  list-style: none;
  padding: 0 10px;
}

.nav-item {
  margin-bottom: 4px;
}

.nav-btn {
  width: 100%;
  background: transparent;
  border: none;
  color: #e2e8f0;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 500;
  text-align: left;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  cursor: pointer;
  transition: all 0.18s ease;
  font-family: inherit;
}

.nav-btn-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav-icon {
  font-size: 1.1rem;
  width: 24px;
  text-align: center;
}

.nav-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--white);
}

.nav-btn.active {
  background: var(--navy-600);
  color: var(--white);
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.nav-badge {
  font-size: 0.7rem;
  padding: 2px 7px;
  border-radius: 999px;
  font-weight: 600;
  white-space: nowrap;
}

.nav-badge.stage1 {
  background: rgba(16, 185, 129, 0.22);
  color: #6ee7b7;
  border: 1px solid rgba(16, 185, 129, 0.4);
}

.nav-badge.pending {
  background: rgba(245, 158, 11, 0.22);
  color: #fcd34d;
  border: 1px solid rgba(245, 158, 11, 0.35);
}

.nav-badge.future {
  background: rgba(148, 163, 184, 0.18);
  color: #cbd5e1;
}

.sidebar-footer {
  margin-top: auto;
  padding: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 0.76rem;
  color: #94a3b8;
  background: rgba(0, 0, 0, 0.15);
}

/* ==========================================================================
   CONTENIDO PRINCIPAL Y BARRA SUPERIOR
   ========================================================================== */

.main-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.topbar {
  background: var(--white);
  border-bottom: 1px solid var(--slate-200);
  padding: 12px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 80;
  box-shadow: var(--shadow-sm);
  flex-wrap: wrap;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.mobile-menu-btn {
  display: none;
  background: var(--navy-50);
  border: 1px solid var(--slate-300);
  color: var(--navy-900);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
}

.environment-banner-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--gold-50);
  border: 1px solid #fcd34d;
  color: #92400e;
  padding: 6px 13px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 600;
}

.status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  display: inline-block;
}

.status-dot.amber {
  background: var(--gold-500);
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.25);
}

.status-dot.green {
  background: var(--emerald-600);
  box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.22);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.save-indicator {
  font-size: 0.82rem;
  color: var(--slate-600);
  background: var(--slate-100);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  gap: 7px;
}

/* ==========================================================================
   CONTENEDOR DE SECCIONES
   ========================================================================== */

.content-container {
  padding: 28px;
  max-width: 1240px;
  width: 100%;
  margin: 0 auto;
}

.section-view {
  display: none;
  animation: fadeIn 0.2s ease-in-out;
}

.section-view.active {
  display: block;
}

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

.section-header {
  margin-bottom: 24px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.section-header h2 {
  font-size: 1.6rem;
  color: var(--navy-900);
  font-weight: 800;
  margin-bottom: 6px;
}

.section-header p {
  color: var(--slate-600);
  font-size: 0.96rem;
  max-width: 780px;
}

/* ==========================================================================
   ALERTAS Y AVISOS DE AYUDA
   ========================================================================== */

.notice-box {
  border-radius: var(--radius-md);
  padding: 16px 20px;
  margin-bottom: 22px;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  border: 1px solid transparent;
}

.notice-box.info {
  background: var(--navy-50);
  border-color: #bfdbfe;
  color: var(--navy-900);
}

.notice-box.warning {
  background: var(--gold-50);
  border-color: #fde68a;
  color: #78350f;
}

.notice-box.success {
  background: var(--emerald-50);
  border-color: #a7f3d0;
  color: #065f46;
}

.notice-icon {
  font-size: 1.4rem;
  line-height: 1;
  flex-shrink: 0;
  margin-top: 2px;
}

.notice-content h4 {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.notice-content p {
  font-size: 0.88rem;
}

/* ==========================================================================
   TARJETAS Y REJILLAS (CARDS & GRIDS)
   ========================================================================== */

.card {
  background: var(--white);
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-md);
  padding: 24px;
  margin-bottom: 22px;
  box-shadow: var(--shadow-sm);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--slate-100);
  flex-wrap: wrap;
}

.card-title {
  font-size: 1.12rem;
  font-weight: 700;
  color: var(--navy-900);
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-subtitle {
  font-size: 0.86rem;
  color: var(--slate-500);
  margin-top: 2px;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

/* ==========================================================================
   FORMULARIOS INTUITIVOS Y ETIQUETAS DE ESTADO
   ========================================================================== */

.form-group {
  margin-bottom: 18px;
}

.form-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
  flex-wrap: wrap;
}

.form-label {
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--slate-800);
}

.field-status {
  font-size: 0.74rem;
  font-weight: 700;
  padding: 2px 9px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.field-status.configured {
  background: var(--emerald-100);
  color: var(--emerald-700);
}

.field-status.pending {
  background: var(--gold-100);
  color: var(--gold-600);
}

.form-help {
  font-size: 0.81rem;
  color: var(--slate-500);
  margin-bottom: 8px;
  display: block;
}

.form-control {
  width: 100%;
  padding: 11px 14px;
  font-size: 0.94rem;
  font-family: inherit;
  color: var(--slate-900);
  background-color: var(--white);
  border: 1.5px solid var(--slate-300);
  border-radius: var(--radius-sm);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-control:focus {
  outline: none;
  border-color: var(--navy-600);
  box-shadow: 0 0 0 3px rgba(46, 98, 176, 0.15);
}

.form-control.is-pending {
  border-color: #f59e0b;
  background-color: #fffdf7;
}

textarea.form-control {
  resize: vertical;
  min-height: 92px;
  line-height: 1.5;
}

textarea.form-control.large-textarea {
  min-height: 150px;
}

/* ==========================================================================
   BOTONES Y CHIPS DE AYUDA RÁPIDA
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  font-size: 0.9rem;
  font-weight: 600;
  font-family: inherit;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.16s ease;
  text-decoration: none;
}

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

.btn-primary:hover {
  background: var(--navy-900);
  box-shadow: 0 3px 10px rgba(15, 37, 71, 0.2);
}

.btn-gold {
  background: var(--gold-500);
  color: var(--white);
}

.btn-gold:hover {
  background: var(--gold-600);
}

.btn-success {
  background: var(--emerald-600);
  color: var(--white);
}

.btn-success:hover {
  background: var(--emerald-700);
}

.btn-secondary {
  background: var(--white);
  border-color: var(--slate-300);
  color: var(--slate-700);
}

.btn-secondary:hover {
  background: var(--slate-100);
  color: var(--slate-900);
}

.btn-danger {
  background: var(--red-50);
  border-color: #fecaca;
  color: var(--red-700);
}

.btn-danger:hover {
  background: var(--red-100);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.82rem;
}

.quick-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.chip-btn {
  background: var(--slate-100);
  border: 1px solid var(--slate-300);
  color: var(--slate-700);
  font-size: 0.78rem;
  padding: 4px 10px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.15s;
}

.chip-btn:hover {
  background: var(--navy-100);
  border-color: var(--navy-600);
  color: var(--navy-900);
}

/* ==========================================================================
   TARJETAS DE EJEMPLOS DE CONVERSACIÓN (TONO DE VOZ)
   ========================================================================== */

.example-card {
  border: 2px solid var(--slate-200);
  border-radius: var(--radius-md);
  padding: 18px;
  background: var(--slate-50);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: all 0.18s ease;
}

.example-card.selected {
  border-color: var(--navy-600);
  background: var(--navy-50);
  box-shadow: var(--shadow-md);
}

.example-card h4 {
  color: var(--navy-900);
  font-size: 1rem;
  margin-bottom: 4px;
}

.example-tag {
  display: inline-block;
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--navy-700);
  background: var(--navy-100);
  padding: 2px 8px;
  border-radius: 999px;
  margin-bottom: 12px;
}

.chat-preview-box {
  background: var(--white);
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-sm);
  padding: 12px;
  margin-bottom: 14px;
  font-size: 0.85rem;
}

.bubble-client {
  background: var(--slate-100);
  color: var(--slate-800);
  padding: 8px 11px;
  border-radius: 10px 10px 10px 2px;
  margin-bottom: 8px;
}

.bubble-bot {
  background: #e0ecff;
  color: var(--navy-950);
  padding: 8px 11px;
  border-radius: 10px 10px 2px 10px;
}

/* ==========================================================================
   TARJETAS DE LAS 3 SUCURSALES
   ========================================================================== */

.branch-card {
  border: 2px solid var(--slate-200);
  border-radius: var(--radius-md);
  background: var(--white);
  padding: 22px;
  position: relative;
  transition: all 0.2s ease;
}

.branch-card.is-main-branch {
  border-color: var(--gold-500);
  box-shadow: 0 6px 20px rgba(217, 119, 6, 0.12);
}

.main-branch-ribbon {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, var(--gold-500), var(--gold-600));
  color: var(--white);
  font-size: 0.78rem;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: 999px;
  margin-bottom: 12px;
}

/* ==========================================================================
   CATÁLOGO DE PRODUCTOS Y CATEGORÍAS
   ========================================================================== */

.categories-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 16px;
}

.category-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--navy-50);
  border: 1px solid #bfdbfe;
  color: var(--navy-900);
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
}

.category-pill button {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--slate-500);
  font-size: 0.85rem;
  padding: 0 2px;
}

.category-pill button:hover {
  color: var(--red-600);
}

.product-card {
  background: var(--white);
  border: 1.5px solid var(--slate-200);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}

.product-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.product-media {
  height: 155px;
  background: linear-gradient(135deg, var(--navy-50) 0%, #e2e8f0 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  border-bottom: 1px solid var(--slate-200);
  overflow: hidden;
}

.product-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-placeholder-icon {
  font-size: 3.2rem;
}

.product-source-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
}

.product-source-badge.demo {
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #f59e0b;
}

.product-source-badge.tiendanube {
  background: #dcfce7;
  color: #166534;
  border: 1px solid #22c55e;
}

.product-availability-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
}

.avail-disponible {
  background: var(--emerald-100);
  color: var(--emerald-700);
}

.avail-pocas_piezas {
  background: var(--gold-100);
  color: var(--gold-600);
}

.avail-agotado {
  background: var(--red-100);
  color: var(--red-700);
}

.avail-sobre_pedido {
  background: var(--navy-100);
  color: var(--navy-800);
}

.product-body {
  padding: 16px;
  flex: 1;
}

.product-category-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--navy-600);
  font-weight: 700;
  margin-bottom: 4px;
}

.product-title {
  font-size: 1.02rem;
  font-weight: 700;
  color: var(--navy-900);
  margin-bottom: 6px;
}

.product-price {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--emerald-700);
  margin-bottom: 10px;
}

.product-meta-list {
  font-size: 0.82rem;
  color: var(--slate-600);
  margin-bottom: 12px;
}

.product-meta-list div {
  margin-bottom: 4px;
}

.product-footer {
  padding: 12px 16px;
  background: var(--slate-50);
  border-top: 1px solid var(--slate-200);
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

/* ==========================================================================
   EDITOR VISUAL DE REGLAS DEL CHATBOT
   ========================================================================== */

.rule-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 16px;
  border: 1.5px solid var(--slate-200);
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
  background: var(--white);
}

.rule-item.disabled {
  opacity: 0.6;
  background: var(--slate-50);
}

.rule-item.locked-rule {
  border-left: 4px solid var(--navy-700);
}

.switch {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 26px;
  flex-shrink: 0;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: var(--slate-300);
  transition: 0.2s;
  border-radius: 26px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.2s;
  border-radius: 50%;
}

input:checked + .slider {
  background-color: var(--emerald-600);
}

input:checked + .slider:before {
  transform: translateX(22px);
}

/* ==========================================================================
   MODAL PARA PRODUCTOS Y RESPALDOS
   ========================================================================== */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(10, 25, 49, 0.6);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 200;
}

.modal-backdrop.open {
  display: flex;
}

.modal-box {
  background: var(--white);
  border-radius: var(--radius-lg);
  max-width: 720px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  padding: 26px;
  box-shadow: var(--shadow-lg);
}

/* ==========================================================================
   TOAST NOTIFICATION
   ========================================================================== */

.toast-container {
  position: fixed;
  bottom: 22px;
  right: 22px;
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  background: var(--navy-900);
  color: var(--white);
  padding: 13px 18px;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 10px;
  border-left: 4px solid var(--emerald-600);
}

/* ==========================================================================
   PROMPT OPERATIVO / GENERADOR DE VISTA PREVIA
   ========================================================================== */

.prompt-preview {
  background: var(--navy-950);
  color: #e2e8f0;
  padding: 20px;
  border-radius: var(--radius-md);
  font-family: 'Consolas', 'Courier New', monospace;
  font-size: 0.86rem;
  white-space: pre-wrap;
  line-height: 1.6;
  max-height: 540px;
  overflow-y: auto;
  border: 1px solid var(--navy-700);
}

/* ==========================================================================
   ETAPA 2: SIMULADOR DE CONVERSACIONES Y EVALUACIÓN DE RESPUESTAS
   ========================================================================== */

.simulator-layout {
  display: grid;
  grid-template-columns: 1.55fr 1fr;
  gap: 22px;
  align-items: start;
}

.chat-window-card {
  background: var(--white);
  border: 1.5px solid var(--slate-200);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.chat-header-bar {
  background: linear-gradient(135deg, var(--navy-900) 0%, var(--navy-800) 100%);
  color: var(--white);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.chat-header-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.chat-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--gold-400);
  color: var(--navy-950);
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}

.demo-mode-strip {
  background: #fffbeb;
  border-bottom: 1px solid #fcd34d;
  color: #92400e;
  padding: 8px 16px;
  font-size: 0.79rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.scenarios-bar {
  background: var(--slate-50);
  border-bottom: 1px solid var(--slate-200);
  padding: 12px 16px;
}

.scenarios-bar-title {
  font-size: 0.77rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--slate-500);
  margin-bottom: 8px;
}

.scenarios-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.scenario-btn {
  background: var(--white);
  border: 1px solid var(--slate-300);
  color: var(--navy-900);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 6px 11px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: inherit;
}

.scenario-btn:hover {
  background: var(--navy-600);
  color: var(--white);
  border-color: var(--navy-600);
}

.chat-messages-area {
  height: 450px;
  overflow-y: auto;
  padding: 18px;
  background: #f1f5f9;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.msg-row {
  display: flex;
  flex-direction: column;
  max-width: 86%;
}

.msg-row.user {
  align-self: flex-end;
  align-items: flex-end;
}

.msg-row.assistant {
  align-self: flex-start;
  align-items: flex-start;
}

.msg-bubble {
  padding: 12px 15px;
  border-radius: 14px;
  font-size: 0.92rem;
  line-height: 1.5;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  white-space: pre-wrap;
}

.msg-row.user .msg-bubble {
  background: var(--navy-800);
  color: var(--white);
  border-bottom-right-radius: 3px;
}

.msg-row.assistant .msg-bubble {
  background: var(--white);
  color: var(--slate-900);
  border: 1px solid var(--slate-200);
  border-bottom-left-radius: 3px;
}

.msg-source-tag {
  font-size: 0.71rem;
  font-weight: 700;
  color: #92400e;
  background: #fef3c7;
  border: 1px solid #fde68a;
  padding: 2px 8px;
  border-radius: 999px;
  margin-bottom: 5px;
  display: inline-block;
}

.msg-meta-footer {
  margin-top: 6px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 0.75rem;
  color: var(--slate-500);
}

.eval-trigger-btn {
  background: var(--white);
  border: 1px solid var(--slate-300);
  color: var(--navy-800);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.15s;
}

.eval-trigger-btn:hover {
  background: var(--gold-50);
  border-color: var(--gold-500);
  color: var(--gold-600);
}

.eval-trigger-btn.evaluated-ok {
  background: var(--emerald-100);
  border-color: #6ee7b7;
  color: var(--emerald-700);
}

.eval-trigger-btn.evaluated-issue {
  background: var(--red-100);
  border-color: #fca5a5;
  color: var(--red-700);
}

.chat-input-bar {
  padding: 14px 16px;
  background: var(--white);
  border-top: 1px solid var(--slate-200);
  display: flex;
  gap: 10px;
  align-items: center;
}

.chat-input-bar input {
  flex: 1;
}

.history-list-item {
  padding: 10px 12px;
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  background: var(--slate-50);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  cursor: pointer;
  transition: all 0.15s;
}

.history-list-item:hover {
  background: var(--navy-50);
  border-color: #bfdbfe;
}

.history-list-item.active {
  background: var(--navy-50);
  border-color: var(--navy-600);
  box-shadow: var(--shadow-sm);
}

.rating-options-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}

.rating-option-label {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px 12px;
  border: 1.5px solid var(--slate-200);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.88rem;
  font-weight: 600;
  background: var(--slate-50);
  transition: all 0.15s;
}

.rating-option-label:hover {
  border-color: var(--navy-600);
  background: var(--navy-50);
}

.rating-option-label input {
  width: 17px;
  height: 17px;
}

.evaluation-record-card {
  border: 1.5px solid var(--slate-200);
  border-radius: var(--radius-md);
  padding: 18px;
  background: var(--white);
  margin-bottom: 14px;
}

/* ==========================================================================
   DISEÑO RESPONSIVO (CELULAR Y TABLETA)
   ========================================================================== */

@media (max-width: 980px) {
  .grid-3, .grid-4, .simulator-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .sidebar {
    position: fixed;
    left: -100%;
    top: 0;
    bottom: 0;
    transition: left 0.25s ease;
  }

  .sidebar.open {
    left: 0;
  }

  .mobile-menu-btn {
    display: inline-flex;
  }

  .grid-2, .grid-3, .grid-4, .rating-options-grid {
    grid-template-columns: 1fr;
  }

  .content-container {
    padding: 16px;
  }

  .topbar {
    padding: 12px 16px;
  }
}

