:root {
  /* Paleta Blanca Empresarial / Estilo Blanco */
  --bg: #F8FAFC;
  --surface: #FFFFFF;
  --surface-subtle: #F1F5F9;
  --surface-hover: #E2E8F0;

  --border: #E2E8F0;
  --border-strong: #CBD5E1;
  --border-focus: #0F172A;

  --text-primary: #0F172A;
  --text-secondary: #475569;
  --text-muted: #94A3B8;

  /* Identidad Bosque Esmeralda · #0F7A4A */
  --brand: #0F7A4A;
  --brand-hover: #0A5A36;
  --brand-light: #E6F4ED;
  --brand-accent: #14A063;

  /* Canales de Mensajería */
  --wa: #1F8A4C;
  --wa-light: #E8F5E9;
  --tg: #2481CC;
  --tg-light: #E1F5FE;
  --sms: #7C5CBF;
  --sms-light: #F3E8FF;

  /* Alertas y Estados */
  --ambar: #B45309;
  --ambar-light: #FEF3C7;
  --danger: #DC2626;
  --danger-light: #FEE2E2;

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;

  --sombra-card: 0 1px 3px 0 rgba(15, 23, 42, 0.06), 0 1px 2px -1px rgba(15, 23, 42, 0.04);
  --sombra-elevada: 0 4px 6px -1px rgba(15, 23, 42, 0.08), 0 2px 4px -2px rgba(15, 23, 42, 0.04);

  --font-titulo: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --font-texto: 'Inter', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;

  --alto-nav-abajo: 64px;
}

/* Reset y Reglas Nativas para Celular */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
}

html, body {
  width: 100%;
  height: 100%;
  height: 100dvh;
  overflow: hidden;
  background-color: var(--bg);
  color: var(--text-primary);
  font: 15px/1.45 var(--font-texto);
  -webkit-tap-highlight-color: transparent;
  -webkit-text-size-adjust: 100%;
  overscroll-behavior: none;
}

[hidden] {
  display: none !important;
}

button {
  font: inherit;
  color: inherit;
  cursor: pointer;
  border: 0;
  background: none;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

input, textarea, select {
  font-family: var(--font-texto);
  font-size: 16px; /* Evita zoom forzado en Safari iOS */
  color: var(--text-primary);
  width: 100%;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 13px 14px;
  outline: none;
  transition: border-color 150ms ease;
}

input:focus, textarea:focus, select:focus {
  border-color: var(--brand);
}

label {
  display: block;
  font-weight: 600;
  font-size: 14px;
  color: var(--text-secondary);
  margin: 14px 0 6px;
}

/* Iconos SVG Oficiales Lucide */
.icono-svg {
  width: 22px;
  height: 22px;
  stroke-width: 2px;
  flex: none;
  display: inline-block;
  vertical-align: middle;
}

.icono-svg.chico {
  width: 18px;
  height: 18px;
}

.icono-svg.grande {
  width: 28px;
  height: 28px;
}

.icono-svg.extra-grande {
  width: 44px;
  height: 44px;
}

/* Botones Base con Mínimo 48px Táctil */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 50px;
  padding: 0 20px;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 15px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  color: var(--text-primary);
  transition: transform 100ms ease-out, background-color 150ms ease;
}

.btn:active {
  transform: scale(0.98);
  background: var(--surface-subtle);
}

.btn.primario {
  background: var(--brand);
  border-color: var(--brand);
  color: #FFFFFF;
}

.btn.primario:active {
  background: var(--brand-hover);
}

.btn.ambar {
  background: var(--ambar-light);
  border-color: #FDE68A;
  color: var(--ambar);
}

.btn.peligroso {
  background: var(--danger-light);
  border-color: #FECACA;
  color: var(--danger);
}

.btn.secundario {
  background: var(--surface-subtle);
  border-color: var(--border);
  color: var(--text-primary);
}

.btn.bloque {
  width: 100%;
}

.btn.grande {
  min-height: 54px;
  font-size: 16px;
}

.btn.chico {
  min-height: 42px;
  padding: 0 14px;
  font-size: 14px;
  border-radius: var(--radius-sm);
}

.btn-icono {
  width: 44px;
  height: 44px;
  display: inline-grid;
  place-items: center;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
}

.btn-icono:active {
  background: var(--surface-subtle);
}

/* Pantalla General */
.pantalla {
  width: 100%;
  height: 100%;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  max-width: 540px;
  margin: 0 auto;
  position: relative;
  background: var(--bg);
}

/* Pantalla de Acceso */
#login {
  display: grid;
  place-items: center;
  padding: 24px;
  background: #FFFFFF;
}

.login-caja {
  width: 100%;
  max-width: 380px;
}

.login-caja .btn {
  margin-top: 18px;
}

.logo {
  width: 40px;
  height: 18px;
  color: var(--brand);
  flex: none;
}

.logo.grande {
  width: 120px;
  height: 52px;
  display: block;
  margin: 0 auto 12px;
}

.marca.grande {
  text-align: center;
  font: 800 42px/1 var(--font-titulo);
  letter-spacing: -0.03em;
  color: var(--brand);
}

.lema {
  text-align: center;
  color: var(--text-secondary);
  font-weight: 500;
  margin: 8px 0 28px;
}

.error {
  color: var(--danger);
  font-size: 14px;
  margin-top: 8px;
  text-align: center;
}

/* Cabecera Superior Fija */
.barra-superior {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: max(12px, env(safe-area-inset-top)) 16px 12px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  flex: none;
  z-index: 20;
}

.cabecera-izq {
  display: flex;
  align-items: center;
  gap: 12px;
}

.pastilla-tienda {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 14px;
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  font-weight: 700;
  font-size: 14px;
  color: var(--text-primary);
}

.pastilla-tienda:active {
  background: var(--surface-hover);
}

.punto-estado {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--wa);
  display: inline-block;
}

.punto-estado.desconectado {
  background: var(--text-muted);
}

/* Botón Pausar (Mínimo 48px Táctil, Siempre Visible) */
.btn-pausar {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 48px;
  padding: 0 16px;
  border-radius: var(--radius-full);
  background: #FEE2E2;
  color: var(--danger);
  border: 1.5px solid #FECACA;
  font-weight: 700;
  font-size: 14px;
  transition: transform 100ms ease, background-color 150ms ease;
}

.btn-pausar:active {
  transform: scale(0.96);
  background: #FCA5A5;
}

body.pausado .btn-pausar {
  background: var(--danger);
  color: #FFFFFF;
  border-color: var(--danger);
}

/* Banda de Alerta Pausa */
.banda-pausa {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  background: var(--danger);
  color: #FFFFFF;
  flex: none;
  z-index: 15;
}

.banda-texto strong {
  display: block;
  font-size: 14px;
}

.banda-texto p {
  font-size: 12.5px;
  opacity: 0.92;
}

.btn-despertar {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  padding: 0 14px;
  border-radius: var(--radius-full);
  background: #FFFFFF;
  color: var(--danger);
  font-weight: 700;
  font-size: 13.5px;
}

.btn-despertar:active {
  transform: scale(0.96);
  background: #F8FAFC;
}

/* Contenedor de Vistas */
.contenedor-vistas {
  flex: 1;
  position: relative;
  overflow: hidden;
}

.vista {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  padding: 16px 16px calc(var(--alto-nav-abajo) + env(safe-area-inset-bottom) + 20px);
}

.vista:not(.activa) {
  display: none !important;
}

/* Botones de Acción Inmediata: Dictar y Foto */
.acciones-inmediatas {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
}

.boton-accion {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 98px;
  padding: 14px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--sombra-card);
  text-align: center;
  transition: transform 100ms ease, border-color 150ms ease;
}

.boton-accion:active {
  transform: scale(0.97);
  background: var(--surface-subtle);
  border-color: var(--brand);
}

.boton-accion.dictar .icono-circulo {
  background: var(--brand-light);
  color: var(--brand);
}

.boton-accion.foto .icono-circulo {
  background: #E0F2FE;
  color: #0284C7;
}

.icono-circulo {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: grid;
  place-items: center;
}

.texto-accion .titulo {
  display: block;
  font: 700 16px/1.2 var(--font-titulo);
  color: var(--text-primary);
}

.texto-accion .detalle {
  display: block;
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 2px;
}

/* Indicador de Grabación */
.indicador-voz {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #FEE2E2;
  border: 1.5px solid #FECACA;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  margin-bottom: 16px;
  color: var(--danger);
  font-weight: 600;
  font-size: 13.5px;
}

.pulso-grabacion {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--danger);
  animation: pulso 1s infinite alternate ease-in-out;
  flex: none;
}

@keyframes pulso {
  from { opacity: 0.3; transform: scale(0.85); }
  to { opacity: 1; transform: scale(1.15); }
}

.indicador-voz span {
  flex: 1;
}

/* Tarjeta de Propuesta Interactiva */
.tarjeta-propuesta {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--sombra-elevada);
  padding: 16px;
  margin-bottom: 20px;
}

.propuesta-cabecera {
  margin-bottom: 12px;
}

.etiqueta-estado {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  margin-bottom: 6px;
}

.etiqueta-estado.nueva {
  background: var(--brand-light);
  color: var(--brand);
}

.propuesta-info h2 {
  font: 700 19px/1.2 var(--font-titulo);
  color: var(--text-primary);
}

.propuesta-meta {
  font-size: 14px;
  color: var(--text-secondary);
  margin-top: 4px;
}

.propuesta-meta b, .propuesta-meta span:first-child {
  font-weight: 700;
  color: var(--brand);
}

/* Contenedor WhatsApp Preview */
.wa-contenedor {
  background: #EFEAE2;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  margin: 12px 0 16px;
}

.wa-header-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: #005D4B;
  color: #FFFFFF;
}

.wa-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #128C7E;
  display: grid;
  place-items: center;
  font: 700 14px var(--font-titulo);
  color: #FFFFFF;
}

.wa-header-info {
  display: flex;
  flex-direction: column;
}

.wa-titulo-linea {
  font-weight: 700;
  font-size: 13px;
  line-height: 1.2;
}

.wa-sub-linea {
  font-size: 11px;
  opacity: 0.85;
}

.wa-globo-fondo {
  padding: 12px;
  display: flex;
  justify-content: flex-start;
}

.wa-burbuja {
  background: #FFFFFF;
  border-radius: 4px 14px 14px 14px;
  box-shadow: 0 1px 1.5px rgba(11, 20, 26, 0.13);
  padding: 6px 8px 6px 8px;
  max-width: 90%;
}

.wa-imagen-marco {
  width: 100%;
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 6px;
  background: #E2E8F0;
  min-height: 140px;
  display: grid;
  place-items: center;
}

.wa-imagen-marco img {
  width: 100%;
  height: auto;
  display: block;
}

.wa-placeholder-img {
  color: var(--text-muted);
}

.wa-copia {
  font-size: 13.5px;
  line-height: 1.35;
  color: #111B21;
}

.wa-pie-mensaje {
  display: flex;
  justify-content: flex-end;
  margin-top: 4px;
}

.wa-hora-envio {
  font-size: 11px;
  color: #667781;
}

/* Botones de Decisión */
.botones-decision {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 10px;
}

.panel-cambios {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.sub-cambios {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.grupo-chips-cambio {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip-ajuste {
  min-height: 38px;
  padding: 0 12px;
  border-radius: var(--radius-full);
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
}

.chip-ajuste:active {
  background: var(--surface-hover);
  color: var(--text-primary);
}

/* Resumen Diario */
.encabezado-dia {
  margin: 8px 0 14px;
}

.titulo-dia {
  font: 800 28px/1.1 var(--font-titulo);
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.sub-dia {
  color: var(--text-secondary);
  font-size: 14px;
  margin-top: 4px;
}

.rotulo-seccion {
  font: 700 16px/1.2 var(--font-titulo);
  color: var(--text-primary);
  margin-bottom: 10px;
}

/* Publicaciones de Hoy: 3 Tarjetas */
.tres-tarjetas {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 18px;
}

.tarjeta-publicacion {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  box-shadow: var(--sombra-card);
}

.info-pub strong {
  display: block;
  font-size: 14.5px;
  color: var(--text-primary);
}

.info-pub span {
  font-size: 13px;
  color: var(--text-secondary);
}

.badge-estado-pub {
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.badge-estado-pub.publicada {
  background: var(--wa-light);
  color: var(--wa);
}

.badge-estado-pub.lista {
  background: #E0F2FE;
  color: #0284C7;
}

.badge-estado-pub.espera, .badge-estado-pub.va-ahorita {
  background: var(--ambar-light);
  color: var(--ambar);
}

/* Tarjetas de Resumen */
.tarjeta-resumen {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 14px;
  box-shadow: var(--sombra-card);
}

.tarjeta-resumen.acento {
  border-left: 4px solid var(--brand);
}

.tarjeta-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.tarjeta-header h2 {
  font: 700 17px/1.2 var(--font-titulo);
  color: var(--text-primary);
}

.numero-destacado {
  font: 800 24px/1 var(--font-titulo);
  color: var(--brand);
  font-variant-numeric: tabular-nums;
}

.mini-lista > * {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-top: 1px solid var(--border);
}

.mini-lista > *:first-child {
  border-top: 0;
}

.mini-lista .titulo-item {
  font-weight: 600;
  font-size: 14px;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 220px;
}

.mini-lista .detalle-item {
  font-size: 13px;
  color: var(--text-secondary);
}

/* Vista Mensajes: Filtros y Buscador */
.filtros-canales {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 12px;
  scrollbar-width: none;
}

.filtros-canales::-webkit-scrollbar {
  display: none;
}

.chip-canal {
  flex: none;
  min-height: 42px;
  padding: 0 16px;
  border-radius: var(--radius-full);
  background: var(--surface);
  border: 1.5px solid var(--border);
  font-weight: 600;
  font-size: 13.5px;
  color: var(--text-secondary);
}

.chip-canal.activo {
  background: var(--text-primary);
  border-color: var(--text-primary);
  color: #FFFFFF;
}

.barra-herramientas {
  display: flex;
  gap: 10px;
  margin-bottom: 12px;
}

.caja-busqueda {
  position: relative;
  flex: 1;
}

.search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
}

.caja-busqueda input {
  padding-left: 42px;
  min-height: 44px;
}

/* Lista de Chats */
.lista-conversaciones {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--sombra-card);
}

.fila-chat {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 14px;
  border-top: 1px solid var(--border);
  cursor: pointer;
  transition: background 100ms ease;
}

.fila-chat:first-child {
  border-top: 0;
}

.fila-chat:active {
  background: var(--surface-subtle);
}

.avatar-chat {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--brand-light);
  color: var(--brand);
  display: grid;
  place-items: center;
  font: 700 16px var(--font-titulo);
  flex: none;
}

.cuerpo-chat {
  flex: 1;
  min-width: 0;
}

.fila-arriba-chat {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 2px;
}

.nombre-chat {
  font-weight: 600;
  font-size: 14.5px;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hora-chat {
  font-size: 11.5px;
  color: var(--text-muted);
  flex: none;
}

.fila-abajo-chat {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.ultimo-msg {
  font-size: 13px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.etiqueta-canal {
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: var(--radius-full);
  color: #FFFFFF;
  flex: none;
}

.etiqueta-canal.whatsapp { background: var(--wa); }
.etiqueta-canal.telegram { background: var(--tg); }
.etiqueta-canal.sms { background: var(--sms); }

.badge-no-leidos {
  background: var(--brand);
  color: #FFFFFF;
  font-size: 11px;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  padding: 0 4px;
  flex: none;
}

/* Vista Chat Activo */
.cabecera-chat {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 12px;
}

.chat-info-contacto {
  flex: 1;
}

.nombre-contacto {
  display: block;
  font-size: 15px;
  color: var(--text-primary);
}

.numero-contacto {
  font-size: 12.5px;
  color: var(--text-secondary);
}

.tag-canal-header {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  color: var(--text-secondary);
}

.area-mensajes {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-bottom: 70px;
}

.globo-mensaje {
  max-width: 82%;
  padding: 9px 12px;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.4;
  word-break: break-word;
}

.globo-mensaje.entrante {
  align-self: flex-start;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-primary);
  border-bottom-left-radius: 4px;
}

.globo-mensaje.saliente {
  align-self: flex-end;
  background: var(--brand);
  color: #FFFFFF;
  border-bottom-right-radius: 4px;
}

.globo-mensaje .hora-globo {
  display: block;
  font-size: 10.5px;
  text-align: right;
  margin-top: 4px;
  opacity: 0.75;
}

.barra-redaccion {
  position: absolute;
  bottom: calc(var(--alto-nav-abajo) + env(safe-area-inset-bottom) + 8px);
  left: 16px;
  right: 16px;
  display: flex;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 6px;
  box-shadow: var(--sombra-elevada);
}

.barra-redaccion textarea {
  border: 0;
  padding: 8px 10px;
  resize: none;
  font-size: 15px;
  min-height: 40px;
  max-height: 100px;
}

.btn-enviar {
  width: 44px;
  height: 44px;
  background: var(--brand);
  color: #FFFFFF;
  border-radius: var(--radius-sm);
  display: grid;
  place-items: center;
  flex: none;
}

.btn-enviar:active {
  background: var(--brand-hover);
}

/* Vista Clientes / Prospectos */
.lista-prospectos {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 14px;
}

.tarjeta-prospecto {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  box-shadow: var(--sombra-card);
}

.prospecto-arriba {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 4px;
}

.prospecto-nombre {
  font: 700 16px var(--font-titulo);
  color: var(--text-primary);
}

.prospecto-zona {
  font-size: 12.5px;
  color: var(--text-muted);
}

.prospecto-rubro {
  font-size: 13.5px;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.prospecto-acciones {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.btn-accion-prospecto {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 13.5px;
  border: 1px solid var(--border);
  background: var(--surface-subtle);
  color: var(--text-primary);
}

.btn-accion-prospecto:active {
  background: var(--surface-hover);
}

.btn-accion-prospecto.wa {
  background: var(--wa-light);
  border-color: #C8E6C9;
  color: var(--wa);
}

/* Vista Tienda */
.nombre-gran-tienda {
  font: 800 20px/1.2 var(--font-titulo);
  color: var(--text-primary);
}

.tienda-id-txt {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 4px;
}

.link-accion {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--brand);
}

.lista-cuentas {
  display: flex;
  flex-direction: column;
}

.cuenta-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-top: 1px solid var(--border);
}

.cuenta-item:first-child {
  border-top: 0;
}

.cuenta-item-info strong {
  display: block;
  font-size: 14px;
  color: var(--text-primary);
}

.cuenta-item-info span {
  font-size: 12.5px;
  color: var(--text-secondary);
}

/* Barra de Navegación Inferior Fija (Safe Area iPhone / Android) */
.barra-navegacion-inferior {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: calc(var(--alto-nav-abajo) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: var(--surface);
  border-top: 1px solid var(--border);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  z-index: 30;
}

.pestaña {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  height: var(--alto-nav-abajo);
  color: var(--text-muted);
  font-weight: 600;
  font-size: 11.5px;
  transition: color 150ms ease;
}

.pestaña:active {
  color: var(--text-primary);
}

.pestaña.activa {
  color: var(--brand);
}

.pestaña.activa .icono-svg {
  stroke-width: 2.3px;
}

.icono-con-badge {
  position: relative;
  display: inline-block;
}

.badge-contador {
  position: absolute;
  top: -4px;
  right: -8px;
  background: var(--danger);
  color: #FFFFFF;
  font-size: 10px;
  font-weight: 700;
  height: 16px;
  min-width: 16px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  padding: 0 4px;
}

/* Modales / Sheets */
.hoja-modal {
  border: 0;
  background: transparent;
  width: 100%;
  max-width: 480px;
  margin: auto auto 0;
  padding: 0 16px calc(16px + env(safe-area-inset-bottom));
}

.hoja-modal::backdrop {
  background: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(2px);
}

.caja-modal {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

.modal-cabecera {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.modal-cabecera h2 {
  font: 700 18px var(--font-titulo);
}

.btn-cerrar-modal {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  color: var(--text-muted);
}

.modal-cuerpo {
  margin-bottom: 16px;
}

.modal-pie {
  margin-top: 14px;
}

.modal-pie.dos-botones {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 10px;
}

.opciones-lista {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.opcion-tienda-btn {
  width: 100%;
  padding: 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface-subtle);
  text-align: left;
  font-weight: 600;
  font-size: 14.5px;
}

.opcion-tienda-btn:active {
  background: var(--brand-light);
  border-color: var(--brand);
}

/* Visor Foto Modal */
.visor-foto-modal {
  border: 0;
  background: rgba(0,0,0,0.85);
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  display: grid;
  place-items: center;
  padding: 20px;
}

.visor-foto-modal img {
  max-width: 100%;
  max-height: 80vh;
  border-radius: var(--radius-md);
}

.btn-cerrar-foto {
  position: absolute;
  top: 24px;
  right: 24px;
  width: 44px;
  height: 44px;
  background: rgba(255,255,255,0.2);
  color: #FFFFFF;
  border-radius: 50%;
  display: grid;
  place-items: center;
}

/* Toast de Aviso */
.toast-aviso {
  position: absolute;
  bottom: calc(var(--alto-nav-abajo) + env(safe-area-inset-bottom) + 16px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--text-primary);
  color: #FFFFFF;
  font-weight: 600;
  font-size: 13.5px;
  padding: 10px 18px;
  border-radius: var(--radius-full);
  box-shadow: var(--sombra-elevada);
  z-index: 50;
  white-space: nowrap;
}

/* ── Asistente de Diseño Gemini Tasks ── */
.tarjeta-asistente {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  margin-bottom: 16px;
  box-shadow: var(--sombra-card);
  transition: background-color 150ms ease, border-color 150ms ease;
}

.tarjeta-asistente.activo {
  background: #F0FDF4;
  border-color: #BBF7D0;
}

.tarjeta-asistente.apagado {
  background: #FFFBEB;
  border-color: #FDE68A;
  cursor: pointer;
}

.tarjeta-asistente.apagado:active {
  background: #FEF3C7;
}

.asistente-cabecera {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.asistente-estado-indicador {
  display: flex;
  align-items: center;
  gap: 8px;
}

.punto-latido {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex: none;
}

.tarjeta-asistente.activo .punto-latido {
  background: var(--brand);
  box-shadow: 0 0 0 3px rgba(15, 122, 74, 0.2);
}

.tarjeta-asistente.apagado .punto-latido {
  background: var(--ambar);
  box-shadow: 0 0 0 3px rgba(180, 83, 9, 0.2);
}

.asistente-titulo-estado {
  font: 700 14.5px var(--font-titulo);
}

.tarjeta-asistente.activo .asistente-titulo-estado {
  color: #14532D;
}

.tarjeta-asistente.apagado .asistente-titulo-estado {
  color: #78350F;
}

.asistente-badge-conteo {
  font-size: 12px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  background: rgba(0, 0, 0, 0.06);
  color: var(--text-secondary);
}

.asistente-detalle {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 4px;
}

.fila-botones-asistente {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 10px;
  margin-top: 12px;
}

.btn-hazlo-ya {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 0 16px;
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: 14px;
  background: var(--brand);
  border: 1.5px solid var(--brand);
  color: #FFFFFF;
  transition: transform 100ms ease;
}

.btn-hazlo-ya:active {
  transform: scale(0.97);
  background: var(--brand-hover);
}

.btn-instalar-asistente {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 46px;
  padding: 0 14px;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 13.5px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  color: var(--text-primary);
}

.btn-instalar-asistente:active {
  background: var(--surface-subtle);
}

/* ── Seguimiento de Pedidos de Diseño ── */
.bloque-pedidos-diseno {
  margin-bottom: 20px;
}

.lista-pedidos-diseno {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.tarjeta-pedido {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px;
  box-shadow: var(--sombra-card);
}

.pedido-arriba {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}

.pedido-titulo {
  font: 700 15px var(--font-titulo);
  color: var(--text-primary);
}

.badge-estado-pedido {
  font-size: 11.5px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: var(--radius-full);
  letter-spacing: 0.02em;
}

.badge-estado-pedido.pendiente {
  background: #F1F5F9;
  color: #475569;
}

.badge-estado-pedido.en-diseno {
  background: #E0F2FE;
  color: #0369A1;
}

.badge-estado-pedido.aprobar {
  background: #FEF3C7;
  color: #92400E;
}

.badge-estado-pedido.publicado {
  background: #DCFCE7;
  color: #15803D;
}

.pedido-detalle {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.35;
}

.pedido-acciones-aprobacion {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 8px;
}

/* Diálogo de Instalación del Asistente */
.paso-asistente {
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  margin-bottom: 12px;
}

.paso-asistente strong {
  display: block;
  font-size: 14px;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.paso-asistente p {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.35;
}

.lista-zips-descarga {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
}

.btn-zip-descarga {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: #FFFFFF;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-primary);
  text-decoration: none;
}

.btn-zip-descarga:active {
  background: var(--brand-light);
  border-color: var(--brand);
}

/* Acceso: enlaces, mensajes y formularios en línea */
.enlace-login {
  display: block;
  width: 100%;
  min-height: 48px;
  margin-top: 4px;
  text-align: center;
}
.ayuda-login {
  font-size: 14px;
  color: var(--text-secondary);
  text-align: center;
  margin-bottom: 4px;
}
.ok-msg {
  color: var(--brand);
  font-size: 14px;
  margin-top: 8px;
  text-align: center;
  font-weight: 600;
}
.form-linea {
  margin-top: 12px;
  padding: 4px 14px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}
.panel-cambios .form-linea { background: var(--surface-subtle); }
.fila-botones {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 12px;
}
.fila-botones .btn { min-height: 48px; }
#login { overflow-y: auto; }
