:root {
  --bg-app: #f0f2f5;
  --wa-bg: #efeae2;
  --wa-green: #075e54;
  --wa-header: #008069;
  --wa-bubble-in: #ffffff;
  --wa-bubble-out: #d9fdd3;
  --primary: #8b5cf6;
  --primary-dark: #6d28d9;
  --text-dark: #1f2937;
  --text-muted: #6b7280;
  --border: #e5e7eb;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

body {
  background: var(--bg-app);
  color: var(--text-dark);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* TOPBAR */
.topbar {
  background: #1e1e2d;
  color: white;
  padding: 12px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 2px solid #2d2d3f;
}
.logo { font-size: 1.1rem; font-weight: 700; margin-right: 12px; }
.badge { background: #3b82f6; font-size: 0.75rem; padding: 4px 8px; border-radius: 999px; text-transform: uppercase; font-weight: 600; }
.badge-gemini { background: #10b981; }
.btn-api-key {
  background: #374151; color: #facc15; border: 1px solid #4b5563; font-size: 0.78rem; padding: 4px 10px; border-radius: 6px; cursor: pointer; font-weight: 600; margin-left: 8px;
}
.btn-api-key:hover { background: #4b5563; }
.topbar-reloj { display: flex; align-items: center; gap: 8px; font-size: 0.9rem; }
.btn-time {
  background: #374151; color: white; border: none; padding: 6px 12px; border-radius: 6px; cursor: pointer; font-size: 0.8rem; font-weight: 600;
}
.btn-time:hover { background: #4b5563; }
.btn-reset { background: #ef4444; }
.btn-reset:hover { background: #dc2626; }

/* LAYOUT PRINCIPAL */
.simulador-layout {
  display: flex;
  flex: 1;
  padding: 16px;
  gap: 20px;
  max-width: 1600px;
  margin: 0 auto;
  width: 100%;
}

/* PANEL IZQUIERDO: WHATSAPP */
.panel-whatsapp {
  flex: 0 0 460px;
  display: flex;
  justify-content: center;
}
.celular-frame {
  position: relative;
  width: 100%;
  max-width: 440px;
  height: calc(100vh - 100px);
  background: var(--wa-bg);
  border-radius: 24px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.15);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 8px solid #262626;
}

.wa-header {
  background: var(--wa-header);
  color: white;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.wa-avatar {
  width: 40px; height: 40px; border-radius: 50%; background: #ffffff33; display: flex; align-items: center; justify-content: center; font-size: 1.2rem;
}
.wa-info { flex: 1; min-width: 0; }
.wa-info h3 { font-size: 0.95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wa-status { font-size: 0.72rem; opacity: 0.9; }
.wa-selector-cliente select {
  background: white; border: none; font-size: 0.75rem; padding: 4px 6px; border-radius: 6px; outline: none; cursor: pointer;
}

.wa-mensajes {
  flex: 1;
  padding: 14px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.msg {
  max-width: 85%;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 0.88rem;
  line-height: 1.35;
  position: relative;
  word-break: break-word;
  white-space: pre-wrap;
}
.msg-in {
  align-self: flex-start;
  background: var(--wa-bubble-in);
  border-top-left-radius: 0;
  box-shadow: 0 1px 1px rgba(0,0,0,0.06);
}
.msg-out {
  align-self: flex-end;
  background: var(--wa-bubble-out);
  border-top-right-radius: 0;
  box-shadow: 0 1px 1px rgba(0,0,0,0.06);
}
.msg-time {
  font-size: 0.68rem; color: #8696a0; float: right; margin-left: 8px; margin-top: 4px;
}

.wa-quick-actions {
  background: #f0f2f5;
  padding: 8px 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  border-top: 1px solid #e2e8f0;
}
.wa-quick-actions span { font-size: 0.72rem; color: var(--text-muted); font-weight: 600; }
.chip {
  background: white; border: 1px solid #cbd5e1; font-size: 0.75rem; padding: 4px 8px; border-radius: 12px; cursor: pointer;
}
.chip:hover { background: #e2e8f0; }
.chip-foto { background: #fef08a; border-color: #facc15; font-weight: 600; min-height: 44px; }
.chip[hidden] { display: none; }
.wa-quick-actions:not(:has(> :not([hidden]))) { display: none; } /* sin nada que mostrar, no deja una franja vacía */
/* «✅ Comprobante enviado»: ya está, no se toca */
.chip-foto.chip-listo, .chip-foto.chip-listo:disabled { background: #d9f7e3; border-color: #10b981; color: #0b6b33; cursor: default; opacity: 1; }

.wa-input-bar {
  background: #f0f2f5;
  padding: 10px;
  display: flex;
  gap: 8px;
}
.wa-input-bar input {
  flex: 1; border: none; padding: 10px 14px; border-radius: 20px; font-size: 0.9rem; outline: none; background: white;
}
.wa-input-bar button {
  background: var(--wa-header); color: white; border: none; width: 40px; height: 40px; border-radius: 50%; cursor: pointer; font-size: 1rem;
}

/* PANEL DERECHO: DUEÑA */
.panel-control[hidden] { display: none; }
.panel-control {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow-y: auto;
  max-height: calc(100vh - 100px);
}
.control-header {
  background: white; padding: 16px 20px; border-radius: 12px; display: flex; justify-content: space-between; align-items: center; box-shadow: 0 2px 4px rgba(0,0,0,0.04);
}
.control-header h2 { font-size: 1.25rem; font-weight: 700; }

.estado-asistente { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 0.9rem; }
.switch { position: relative; display: inline-block; width: 44px; height: 24px; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: #ccc; transition: .3s; border-radius: 24px; }
.slider:before { position: absolute; content: ""; height: 18px; width: 18px; left: 3px; bottom: 3px; background-color: white; transition: .3s; border-radius: 50%; }
input:checked + .slider { background-color: #10b981; }
input:checked + .slider:before { transform: translateX(20px); }

/* GRID RESUMEN */
.grid-resumen {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px;
}
.kpi-card {
  background: white; padding: 14px; border-radius: 10px; box-shadow: 0 1px 3px rgba(0,0,0,0.05); display: flex; flex-direction: column; border-left: 4px solid #10b981;
}
.kpi-pendiente { border-left-color: #f59e0b; }
.kpi-alerta { border-left-color: #ef4444; }
.kpi-espera { border-left-color: #8b5cf6; }
.kpi-num { font-size: 1.6rem; font-weight: 800; color: #111827; }
.kpi-label { font-size: 0.8rem; color: var(--text-muted); font-weight: 600; }

/* SECCIONES Y LISTAS */
.card-seccion {
  background: white; border-radius: 12px; padding: 16px; box-shadow: 0 1px 3px rgba(0,0,0,0.04); display: flex; flex-direction: column; gap: 12px;
}
.card-seccion h3 { font-size: 1rem; font-weight: 700; color: #1f2937; }
.sec-header-flex { display: flex; justify-content: space-between; align-items: center; }
.sub-aviso { font-size: 0.8rem; color: var(--text-muted); }

.lista-items { display: flex; flex-direction: column; gap: 8px; }
.txt-vacio { font-size: 0.85rem; color: var(--text-muted); font-style: italic; }

/* ITEM COMPROBANTE */
.item-comprobante {
  background: #fefce8; border: 1px solid #fef08a; padding: 10px 14px; border-radius: 8px; display: flex; justify-content: space-between; align-items: center;
}
.comp-info h4 { font-size: 0.9rem; font-weight: 700; }
.comp-info p { font-size: 0.8rem; color: #4b5563; }
.comp-acciones { display: flex; gap: 6px; }
.btn-ok { background: #10b981; color: white; border: none; padding: 6px 12px; border-radius: 6px; font-weight: 600; font-size: 0.8rem; cursor: pointer; }
.btn-rechazar { background: #ef4444; color: white; border: none; padding: 6px 10px; border-radius: 6px; font-weight: 600; font-size: 0.8rem; cursor: pointer; }

/* SLOTS DE AGENDA */
.agenda-slots {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 10px;
}
.slot-turno {
  padding: 10px; border-radius: 8px; border: 1px solid #e5e7eb; background: #f9fafb; display: flex; flex-direction: column; gap: 4px;
}
.slot-confirmado { background: #ecfdf5; border-color: #a7f3d0; }
.slot-reservado { background: #fffbeb; border-color: #fde68a; }
.slot-header { display: flex; justify-content: space-between; font-weight: 700; font-size: 0.85rem; }
.slot-detalles { font-size: 0.8rem; color: #4b5563; }
.tag-seña { font-size: 0.72rem; padding: 2px 6px; border-radius: 4px; font-weight: 600; }
.tag-ok { background: #d1fae5; color: #065f46; }
.tag-pend { background: #fef3c7; color: #92400e; }
.tag-comp { background: #e0e7ff; color: #3730a3; }

/* ITEM LISTA ESPERA */
.item-espera {
  background: #f5f3ff; border: 1px solid #ddd6fe; padding: 10px; border-radius: 8px; display: flex; justify-content: space-between; align-items: center; font-size: 0.85rem;
}

/* ADJUNTAR FOTOS */
.btn-adjuntar { background: transparent !important; color: #54656f !important; font-size: 1.25rem !important; }
.btn-adjuntar:hover { background: #e2e8f0 !important; }
.msg-img { display: block; max-width: 220px; max-height: 260px; border-radius: 6px; margin-bottom: 4px; cursor: zoom-in; }
.visor-foto { position: fixed; inset: 0; background: rgba(10,10,12,0.88); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; z-index: 50; }
.visor-foto[hidden] { display: none; }
.visor-marco { width: min(92vw, 720px); height: min(72vh, 720px); overflow: hidden; border-radius: 10px; background: #111; touch-action: none; cursor: grab; display: flex; align-items: center; justify-content: center; }
.visor-marco.arrastrando { cursor: grabbing; }
.visor-marco img { max-width: 100%; max-height: 100%; user-select: none; transform-origin: center center; will-change: transform; }
.visor-barra { display: flex; align-items: center; gap: 8px; background: rgba(255,255,255,0.1); padding: 6px 10px; border-radius: 999px; color: #fff; font-size: 0.9rem; }
.visor-barra button { width: 40px; height: 40px; border-radius: 50%; border: none; background: rgba(255,255,255,0.15); color: #fff; font-size: 1.1rem; cursor: pointer; }
.visor-barra button:hover { background: rgba(255,255,255,0.3); }
.visor-barra button:focus-visible { outline: 2px solid #fff; }
.visor-barra button[hidden] { display: none; }
#visorAngulo { min-width: 110px; text-align: center; }
.visor-sep { width: 1px; height: 24px; background: rgba(255,255,255,0.3); }
.visor-ayuda { color: rgba(255,255,255,0.75); font-size: 0.8rem; margin: 0; }
@media (prefers-reduced-motion: no-preference) { .visor-marco img.anim { transition: transform .15s ease-out; } }

/* DISEÑOS PARA REVISAR */
.item-diseno { display: grid; grid-template-columns: 120px 1fr; gap: 14px; background: #fdf4ff; border: 1px solid #f5d0fe; border-radius: 10px; padding: 12px; }
.item-diseno img { width: 120px; height: 150px; object-fit: cover; border-radius: 8px; cursor: zoom-in; }
.diseno-info h4 { font-size: 0.92rem; }
.diseno-info .coment { font-size: 0.8rem; color: #4b5563; font-style: italic; }
.ficha-ia { background: white; border: 1px solid #e9d5ff; border-radius: 8px; padding: 8px 10px; margin: 8px 0; font-size: 0.8rem; line-height: 1.45; }
.ficha-ia .titulo { font-weight: 700; color: #7e22ce; font-size: 0.75rem; text-transform: uppercase; letter-spacing: .02em; }
.ficha-ia .alerta { color: #b45309; font-weight: 600; }
.dif-baja { color: #047857; font-weight: 700; } .dif-media { color: #b45309; font-weight: 700; } .dif-alta { color: #b91c1c; font-weight: 700; }
.form-diseno { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 6px; margin-top: 6px; }
.form-diseno label { font-size: 0.72rem; color: #6b7280; font-weight: 600; display: flex; flex-direction: column; gap: 2px; }
.form-diseno select, .form-diseno input { border: 1px solid #d1d5db; border-radius: 6px; padding: 5px 6px; font-size: 0.82rem; }
.form-diseno .nota { grid-column: 1 / -1; }
.acciones-diseno { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.btn-parecido { background: #8b5cf6; color: white; border: none; padding: 6px 12px; border-radius: 6px; font-weight: 600; font-size: 0.8rem; cursor: pointer; }
.estado-diseno { font-size: 0.78rem; font-weight: 700; }

/* PREGUNTAS PARA CARO */
.item-consulta { background: #eff6ff; border: 1px solid #bfdbfe; border-radius: 8px; padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; }
.item-consulta .preg { font-size: 0.88rem; }
.item-consulta .tip { font-size: 0.74rem; color: #6b7280; }
.item-consulta .fila { display: flex; gap: 6px; }
.item-consulta input { flex: 1; border: 1px solid #d1d5db; border-radius: 6px; padding: 6px 8px; font-size: 0.85rem; }
.chip-demo { background: #fdf4ff !important; border-color: #e9d5ff !important; color: #7e22ce !important; }
.auto { font-size: 0.8rem; border-radius: 6px; padding: 6px 8px; margin-top: 6px; }
.auto-si { background: #ecfdf5; color: #065f46; }
.auto-no { background: #fef2f2; color: #991b1b; }
.auto-duda { background: #fffbeb; color: #92400e; }

/* Mi catálogo */
.form-catalogo { display: grid; gap: 8px; margin: 8px 0 12px; }
.form-catalogo label { display: grid; gap: 4px; font-size: 0.85rem; }
.form-catalogo input[type=text], .form-catalogo select { padding: 6px 8px; border: 1px solid #d0d7de; border-radius: 6px; font: inherit; }
.form-catalogo fieldset { border: 1px solid #e3e6ea; border-radius: 6px; padding: 6px 8px; margin: 0; }
.form-catalogo legend { font-size: 0.85rem; padding: 0 4px; }
.cat-tecnicas { display: flex; flex-wrap: wrap; gap: 4px 12px; }
.cat-tecnicas .chk { display: inline-flex; align-items: center; gap: 4px; font-size: 0.8rem; }
.lista-catalogo { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.cat-item { position: relative; margin: 0; }
.cat-item img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 6px; cursor: zoom-in; display: block; }
.cat-item img:focus-visible { outline: 2px solid #128c7e; outline-offset: 2px; }
.cat-item figcaption { font-size: 0.72rem; line-height: 1.25; margin-top: 3px; }
.cat-item .btn-x { position: absolute; top: 4px; right: 4px; width: 24px; height: 24px; border-radius: 50%; border: 0; background: rgba(0,0,0,.6); color: #fff; cursor: pointer; }

/* Calendario dentro del chat */
.msg-cal { max-width: 92%; white-space: normal; }
.cal { font-size: 0.8rem; }
.cal-tit { font-weight: 600; margin-bottom: 6px; text-transform: none; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-cab { text-align: center; font-size: 0.7rem; color: #667781; }
.cal-dia { display: flex; align-items: center; justify-content: center; height: 30px; border-radius: 6px; font: inherit; font-weight: 600; border: 1px solid transparent; }
button.cal-dia, .cal-hora, .cal-espera { cursor: pointer; }
.cal-dia.cal-libre, .cal-hora.cal-libre { background: #d9f7e3; color: #0b6b33; border-color: #8fd6a8; }
.cal-dia.cal-lleno, .cal-hora.cal-lleno { background: #fde2e1; color: #a5221b; border-color: #f2a8a4; }
.cal-hora.cal-lleno { text-decoration: line-through; cursor: not-allowed; opacity: .8; }
.cal-dia.cal-cerrado { background: #eef0f2; color: #9aa4ad; }
.cal-dia.cal-pasado { color: #c2c8ce; }
.cal-dia.cal-sel { outline: 2px solid #128c7e; outline-offset: 1px; }
.cal-dia:focus-visible, .cal-hora:focus-visible, .cal-espera:focus-visible { outline: 2px solid #128c7e; outline-offset: 2px; }
.cal-ley { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; margin-top: 6px; font-size: 0.7rem; color: #54656f; }
.cal-pt { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-left: 6px; border: 1px solid transparent; }
.cal-pt.cal-libre { background: #d9f7e3; border-color: #8fd6a8; } .cal-pt.cal-lleno { background: #fde2e1; border-color: #f2a8a4; } .cal-pt.cal-cerrado { background: #eef0f2; }
.cal-horas-tit { margin: 8px 0 4px; font-weight: 600; }
.cal-horas { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
.cal-hora { padding: 6px 0; border-radius: 6px; font: inherit; font-size: 0.75rem; border: 1px solid; }
.cal-espera { margin-top: 6px; width: 100%; padding: 6px; border-radius: 6px; border: 1px solid #128c7e; background: #fff; color: #128c7e; font: inherit; }

/* Enlace con vista previa (como WhatsApp) */
.msg-enlace { max-width: 85%; }
.enlace-prev { display: flex; gap: 10px; align-items: center; width: 100%; text-align: left; background: #f0f2f5; border: 0; border-radius: 8px; padding: 8px; cursor: pointer; font: inherit; color: inherit; }
.enlace-prev:hover { background: #e7eaee; }
.enlace-prev:focus-visible { outline: 2px solid #128c7e; outline-offset: 2px; }
.enlace-img { font-size: 1.8rem; width: 48px; height: 48px; display: flex; align-items: center; justify-content: center; background: #fff; border-radius: 6px; flex: none; }
.enlace-txt { display: grid; gap: 2px; font-size: 0.78rem; }
.enlace-txt strong { font-size: 0.82rem; }
.enlace-dom { color: #667781; font-size: 0.7rem; }
.enlace-url { display: block; margin-top: 4px; color: #027eb5; font-size: 0.78rem; word-break: break-all; }
/* Navegador del celular */
.web-reserva { position: absolute; inset: 0; background: #fff; z-index: 20; display: flex; flex-direction: column; }
.web-barra { display: flex; align-items: center; gap: 8px; padding: 8px 10px; background: #f1f3f4; border-bottom: 1px solid #dadce0; }
.web-barra button { border: 0; background: none; font-size: 1rem; cursor: pointer; width: 32px; height: 32px; border-radius: 50%; }
.web-barra button:hover { background: #e2e5e8; }
.web-url { flex: 1; background: #fff; border-radius: 16px; padding: 6px 12px; font-size: 0.78rem; color: #3c4043; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.web-cuerpo { flex: 1; overflow: auto; padding: 16px; }
.web-marca { font-weight: 700; font-size: 1.05rem; margin-bottom: 10px; }
.web-resumen { margin-top: 12px; padding: 10px; border-radius: 8px; background: #f6f8f9; font-size: 0.85rem; line-height: 1.5; }
.web-btn { margin-top: 10px; width: 100%; padding: 12px; border: 0; border-radius: 8px; background: #128c7e; color: #fff; font: inherit; font-weight: 600; cursor: pointer; }
.web-btn:hover { background: #0f7a6e; }
/* «Reservar turno» queda fijo abajo del calendario, siempre a la vista; los horarios se pueden recorrer por encima */
.web-fijo { position: sticky; bottom: 0; z-index: 3; margin: 12px -16px -16px; padding: 10px 16px 16px; background: #fff; box-shadow: 0 -8px 12px -6px rgba(0,0,0,.15); }
.web-fijo .web-btn { margin-top: 0; }
.web-error { color: #a5221b; font-size: 0.85rem; margin-top: 8px; }
.cal-hora.cal-sel { outline: 2px solid #128c7e; outline-offset: 1px; font-weight: 700; }
.web-reserva[hidden] { display: none; }

.web-ayuda { font-size: 0.8rem; color: #54656f; margin: -4px 0 10px; }
.web-paso { margin: 14px 0 6px; font-weight: 600; font-size: 0.9rem; }
.web-servicios { display: grid; gap: 6px; }
.web-serv { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 8px; border: 1px solid #d0d7de; background: #fff; font: inherit; font-size: 0.82rem; text-align: left; cursor: pointer; }
.web-serv span { color: #54656f; white-space: nowrap; }
.web-serv:hover:not(:disabled) { border-color: #128c7e; }
.web-serv:disabled { background: #f3f4f6; color: #9aa4ad; cursor: not-allowed; }
.web-serv:disabled span { color: #a5221b; }
.web-serv.cal-sel { border: 2px solid #128c7e; background: #eefaf7; }
.web-serv:focus-visible { outline: 2px solid #128c7e; outline-offset: 2px; }

/* Reservas sin seña */
.kpi-link { text-decoration: none; color: inherit; cursor: pointer; }
.kpi-link:hover { filter: brightness(0.97); }
.item-sinsena { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 10px 12px; border: 1px solid #f3d9a6; background: #fffaf0; border-radius: 8px; font-size: 0.85rem; }
.item-sinsena.urgente { border-color: #f2a8a4; background: #fff5f5; }
.item-sinsena + .item-sinsena { margin-top: 8px; }
.ss-info { display: grid; gap: 3px; min-width: 0; }
.ss-fila { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ss-cod { font-family: ui-monospace, monospace; font-size: 0.75rem; background: #fff; border: 1px dashed #c9a24a; border-radius: 4px; padding: 1px 6px; color: #7a5a12; }
.ss-info a { color: #128c7e; }
.ss-vence { color: #7a5a12; }
.item-sinsena.urgente .ss-vence { color: #a5221b; }
.ss-acciones { display: grid; gap: 6px; flex: none; }
@media (max-width: 600px) { .item-sinsena { flex-direction: column; align-items: stretch; } }

/* ===== Pensado para tocar con el dedo (móvil) ===== */
button, input, select, .chip { min-height: 44px; }
input, select, textarea { font-size: 16px; }            /* evita el zoom automático en iPhone */
.fila-hab { display: grid; grid-template-columns: 1fr; gap: 8px; padding: 12px 0; border-bottom: 1px solid #e5e9ee; }
.hab-toggle { width: 100%; text-align: left; padding: 12px 14px; border-radius: 10px; border: 2px solid #d0d7de; background: #fff; font: inherit; font-weight: 600; cursor: pointer; }
.hab-toggle[aria-pressed="true"] { background: #d9f7e3; border-color: #10b981; color: #0b6b33; }
.hab-toggle[aria-pressed="false"] { color: #6b7780; }
.hab-paso { display: grid; grid-template-columns: 1fr 52px 1fr 52px; align-items: center; gap: 6px; }
.hab-lbl { grid-column: 1 / -1; font-size: 0.85rem; color: #5b6770; margin-top: 4px; }
.hab-menos, .hab-mas { font-size: 1.4rem; font-weight: 700; border-radius: 10px; border: 1px solid #c7ced6; background: #f4f6f8; cursor: pointer; }
.hab-mas { background: #10b981; color: #fff; border-color: #10b981; }
.hab-val { text-align: center; font-size: 1.1rem; font-weight: 700; min-width: 0; }
.hab-paso { grid-template-columns: 52px 1fr 52px; }
.hab-paso .hab-lbl { display: block; }
#btnGuardarHabilidades { width: 100%; font-size: 1rem; padding: 12px; margin-top: 8px; }
.cat-tecnicas .chk { min-height: 44px; padding: 6px 10px; border: 1px solid #d0d7de; border-radius: 10px; font-size: 0.95rem; }
.cal-dia { height: 46px; font-size: 1rem; }
.cal-grid { gap: 6px; }
.cal-horas { grid-template-columns: repeat(3, 1fr); gap: 8px; }
.cal-hora { min-height: 48px; font-size: 1rem; padding: 10px 0; }
.cal-espera { min-height: 48px; width: 100%; margin-top: 8px; }
/* Pasa a columna antes de que el panel de login (460px fijo) se aplaste entre 701 y 1024px */
@media (max-width: 1024px) {
  .simulador-layout { flex-direction: column; }
}
@media (max-width: 700px) {
  .btn-time, .btn-api-key { min-height: 44px; padding: 10px 14px; }
  .chip { padding: 10px 14px; }
}

/* Cabecera en el móvil: se parte en varias filas, sin cortarse */
@media (max-width: 700px) {
  .topbar { flex-wrap: wrap; gap: 8px; padding: 8px 10px; }
  .topbar-left, .topbar-reloj { flex-wrap: wrap; gap: 6px; }
  .topbar-reloj { gap: 4px; }
  .topbar-reloj span { font-size: 0.85rem; }
  .topbar-reloj strong { font-size: 0.95rem; }
  .badge { font-size: 0.68rem; white-space: nowrap; padding: 4px 6px; }
  .topbar .btn-time, .topbar .btn-api-key { font-size: 0.8rem; padding: 8px 10px; }
  .topbar-reloj { width: 100%; justify-content: space-between; }
}


/* Foto del comprobante en el panel de Caro */
.comp-foto { display:block; max-width:160px; width:100%; border-radius:8px; margin:6px 0; border:1px solid #ddd; }

/* Resumen mensual */
.tabla-resumen-wrap { overflow-x: auto; }
.tabla-resumen { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.tabla-resumen th, .tabla-resumen td { padding: 6px 8px; border-bottom: 1px solid #eee; text-align: right; white-space: nowrap; }
.tabla-resumen th:first-child, .tabla-resumen td:first-child { text-align: left; text-transform: capitalize; }


/* Acceso al panel (estilo Rejilla: fondo oscuro, serif grande, tarjeta crema) */
.login-overlay { position: relative; min-height: 620px; border-radius: 14px; background: #3a2430; color: #fbf3ef; display: flex; align-items: center; justify-content: center; padding: clamp(20px, 5vw, 64px); overflow-y: auto; }
.login-overlay[hidden] { display: none; }
.login-marca { position: absolute; top: 24px; left: max(4vw, 20px); font-size: 13px; letter-spacing: .08em; text-transform: uppercase; opacity: .7; }
.login-grid { width: 100%; max-width: 1080px; display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: clamp(32px, 6vw, 96px); align-items: center; }
.login-texto small { color: #e8b4bc; font-size: 13px; letter-spacing: .12em; text-transform: uppercase; }
.login-texto h1 { font-family: Georgia, 'Times New Roman', serif; font-weight: 400; font-size: clamp(44px, 6.5vw, 88px); line-height: 1; margin: 14px 0 18px; }
.login-texto p { opacity: .75; max-width: 30ch; font-size: 17px; line-height: 1.5; }
.login-card { background: #fbf3ef; color: #3a2430; border-radius: 18px; padding: clamp(24px, 3vw, 36px); display: flex; flex-direction: column; gap: 14px; box-shadow: 0 30px 80px rgba(0, 0, 0, .35); }
.login-card h2 { font-family: Georgia, 'Times New Roman', serif; font-weight: 400; font-size: 32px; margin: 0; }
.login-demo { font-size: 13px; opacity: .7; margin: 0; }
.login-card label { display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
.login-card input[type="tel"], .login-card input[type="password"], .login-card input[type="email"] { background: #fff; border: 1px solid #e6cfd3; border-radius: 10px; padding: 12px 14px; font-size: 16px; }
.login-card input:focus { outline: 2px solid #e8b4bc; outline-offset: 1px; }
.login-recordar { flex-direction: row !important; align-items: center; gap: 8px !important; }
.login-card button[type="submit"] { background: #3a2430; color: #fbf3ef; border: 0; border-radius: 999px; padding: 14px; font-size: 16px; cursor: pointer; }
.login-card button[type="submit"]:hover { background: #55374a; }
.login-error { color: #a3262b; font-size: 14px; min-height: 1em; margin: 0; }
@media (max-width: 760px) {
  .login-grid { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  .login-tarjetas, .login-card { min-width: 0; }
  .login-card input:not([type="checkbox"]) { width: 100%; min-width: 0; }
  .login-texto h1 { font-size: clamp(40px, 12vw, 56px); }
  .login-overlay { flex-direction: column; align-items: stretch; justify-content: flex-start; }
  .login-marca { position: static; margin-bottom: 16px; }
  .login-texto h1 { font-size: clamp(34px, 10vw, 56px); overflow-wrap: anywhere; }
}

.login-tarjetas { width: 100%; display: flex; flex-direction: column; gap: 12px; }
.login-link { background: none; border: 0; padding: 6px 0; color: #3a2430; text-decoration: underline; font: inherit; font-size: 14px; cursor: pointer; text-align: center; }
#formUnete textarea { background: #fff; border: 1px solid #e6cfd3; border-radius: 10px; padding: 10px 12px; font: inherit; font-size: 15px; }
.login-card[hidden] { display: none; }

/* Ejemplos de diseños (lado de la clienta) */
.wa-portfolio { border-bottom: 1px solid #eee; background: linear-gradient(180deg, #fbf3ef, #fff); }
.wa-portfolio[open] { padding-bottom: 6px; max-height: 48vh; overflow-y: auto; }
.wa-portfolio-titulo { display: flex; align-items: center; justify-content: space-between; min-height: 44px; padding: 0 12px; font-size: 13px; color: #55374a; cursor: pointer; list-style: none; }
.wa-portfolio-titulo::-webkit-details-marker { display: none; }
.wa-portfolio-titulo:focus-visible { outline: 2px solid #55374a; outline-offset: -2px; }
.wa-portfolio-flecha { display: inline-block; transition: transform .2s; }
.wa-portfolio[open] .wa-portfolio-flecha { transform: rotate(180deg); }
.wa-portfolio .pf-filtros { padding: 0 12px; }
.wa-portfolio .portfolio-strip { padding-left: 12px; padding-right: 12px; }
.pf-filtros { display: flex; gap: 6px; overflow-x: auto; margin-bottom: 10px; }
.pf-filtros button { flex: 0 0 auto; border: 1px solid #e6cfd3; background: #fff; color: #3a2430; border-radius: 999px; padding: 4px 12px; font: inherit; font-size: 12px; cursor: pointer; }
.pf-filtros button.activo { background: #3a2430; color: #fbf3ef; border-color: #3a2430; }
.portfolio-strip { display: flex; gap: 12px; overflow-x: auto; padding: 6px 4px 12px; scroll-snap-type: x mandatory; }
.pf-card { flex: 0 0 150px; scroll-snap-align: start; background: #fff; border-radius: 14px; box-shadow: 0 6px 18px rgba(58,36,48,.12); overflow: hidden; cursor: pointer; border: 0; padding: 0; font: inherit; text-align: left; transition: transform .35s cubic-bezier(.2,.7,.2,1), box-shadow .35s; transform-style: preserve-3d; will-change: transform; }
.pf-card:hover, .pf-card:focus-visible { box-shadow: 0 14px 30px rgba(58,36,48,.2); }
.pf-card .pf-img { width: 100%; height: 150px; object-fit: cover; display: block; transition: opacity .25s; touch-action: pan-y; }
.pf-card span { display: block; padding: 8px 10px 10px; font-size: 13px; color: #3a2430; }
.pf-card small { display: block; color: #8a6d7a; font-size: 11px; margin-top: 2px; }
.portfolio-modal { position: fixed; inset: 0; background: rgba(40, 24, 32, .6); backdrop-filter: blur(4px); display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 1100; animation: pfFade .25s ease; }
.portfolio-modal[hidden] { display: none; }
@keyframes pfFade { from { opacity: 0; } to { opacity: 1; } }
.portfolio-card { position: relative; background: #fbf3ef; border-radius: 20px; padding: 16px; width: 100%; max-width: 400px; display: flex; flex-direction: column; gap: 10px; animation: pfSube .35s cubic-bezier(.2,.7,.2,1); }
@keyframes pfSube { from { transform: translateY(18px) scale(.98); opacity: 0; } to { transform: none; opacity: 1; } }
.pf-visor { position: relative; border-radius: 14px; overflow: hidden; background: #3a2430; touch-action: pan-y; cursor: ew-resize; user-select: none; }
.portfolio-card #pfFoto { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; display: block; transition: opacity .2s; }
.pf-pista { position: absolute; left: 0; right: 0; bottom: 8px; text-align: center; font-size: 12px; color: #fff; text-shadow: 0 1px 4px rgba(0,0,0,.6); pointer-events: none; }
.portfolio-card h3 { font-family: Georgia, 'Times New Roman', serif; font-weight: 400; margin: 0; color: #3a2430; font-size: 26px; }
.pf-datos { margin: 0; font-size: 14px; color: #55374a; }
.pf-angulos { display: flex; gap: 6px; }
.pf-angulos img { width: 56px; height: 56px; object-fit: cover; border-radius: 10px; cursor: pointer; border: 2px solid transparent; opacity: .75; transition: opacity .2s, border-color .2s; }
.pf-angulos img.activa { border-color: #e8b4bc; opacity: 1; }
.portfolio-cerrar { position: absolute; top: 12px; right: 12px; z-index: 2; background: #fff; border: 0; border-radius: 999px; width: 44px; height: 44px; cursor: pointer; font-size: 17px; display: flex; align-items: center; justify-content: center; box-shadow: 0 2px 8px rgba(0,0,0,.15); }
@media (prefers-reduced-motion: reduce) { .pf-card, .portfolio-modal, .portfolio-card { transition: none !important; animation: none !important; } }

.pf-visor { perspective: 800px; transition: transform .25s ease; }
.pf-visor.inclinada { transition: transform .08s linear; }
.pf-visor #pfFoto { transform-style: preserve-3d; }
.pf-brillo { position: absolute; inset: 0; pointer-events: none; background: radial-gradient(circle at var(--bx, 50%) var(--by, 30%), rgba(255,255,255,.45), rgba(255,255,255,0) 55%); mix-blend-mode: soft-light; opacity: 0; transition: opacity .3s; }
.pf-visor.inclinada .pf-brillo { opacity: 1; }

.login-card[hidden] { display: none; }
#formRecuperar input[type="text"] { background: #fff; border: 1px solid #e6cfd3; border-radius: 10px; padding: 12px 14px; font-size: 16px; }

/* Agenda: abrir la conversación de un turno */
.slot-clickable { cursor: pointer; transition: transform .15s, box-shadow .15s; }
.slot-clickable:hover, .slot-clickable:focus-visible { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(58,36,48,.15); }
.conv-card { background: #fbf3ef; border-radius: 16px; padding: 16px; width: 100%; max-width: 460px; max-height: 86vh; display: flex; flex-direction: column; gap: 8px; position: relative; }
.conv-cabecera { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.conv-cabecera h3 { font-family: Georgia, 'Times New Roman', serif; font-weight: 400; margin: 0; color: #3a2430; font-size: 22px; }
.conv-cabecera .portfolio-cerrar { position: static; }
.conv-cuerpo { overflow-y: auto; display: flex; flex-direction: column; gap: 8px; padding: 6px 2px; }
.conv-msj { max-width: 82%; padding: 8px 10px; border-radius: 12px; font-size: 14px; line-height: 1.4; }
.conv-msj small { display: block; font-size: 11px; opacity: .6; margin-top: 4px; }
.conv-bot { background: #fff; align-self: flex-start; border: 1px solid #efe0e4; }
.conv-clienta { background: #e8f5e9; align-self: flex-end; }
.conv-foto { display: block; width: 180px; max-width: 100%; border-radius: 10px; margin-bottom: 6px; }

/* Agenda: el título elige la fecha */
.btn-fecha-agenda { font: inherit; color: inherit; background: none; border: 0; padding: 4px 0; min-height: 44px; cursor: pointer; text-align: left; }
.btn-fecha-agenda:focus-visible { outline: 2px solid #55374a; outline-offset: 2px; }
.input-fecha-agenda { font: inherit; padding: 8px 10px; border: 1px solid #e6cfd3; border-radius: 10px; min-height: 44px; }

/* Campo de clave con botón para verla (js/ver-clave.js) */
.campo-clave { position: relative; display: flex; }
.campo-clave .input-clave { flex: 1; min-width: 0; padding-right: 48px; }
.btn-ver-clave { position: absolute; right: 0; top: 50%; transform: translateY(-50%); width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center; background: transparent; border: 0; border-radius: 10px; color: #6b4a57; cursor: pointer; }
.btn-ver-clave:hover { color: #3a2430; }
/* Gana a estilos genéricos de botones (p. ej. .admin-form button) */
.campo-clave .btn-ver-clave { background: transparent; padding: 0; border-radius: 10px; color: #6b4a57; justify-self: auto; }
.btn-ver-clave:focus-visible { outline: 2px solid #b0697a; outline-offset: -2px; }
.login-card input[type="text"], .login-card .input-clave { background: #fff; border: 1px solid #e6cfd3; border-radius: 10px; padding: 12px 14px; font-size: 16px; color: #3a2430; }
.login-card .campo-clave .input-clave { padding-right: 48px; }
