/* Ajustes propios del panel del cliente (lo común está en assets/css/app.css). */

/* El escenario, la barra lateral y las tarjetas grandes están en assets/css/app.css (compartido con el Admin). */

/* Embebido en la web (marco de la home): sin barra inferior, alto fijo */
.app.is-embed { min-height: 0; height: 100dvh; overflow: hidden; }
.app.is-embed .main { height: 100dvh; overflow-y: auto; }
.app.is-embed .side { height: 100dvh; }
.app.is-embed .tabbar { display: none; }

/* Estado de una mesa, máquina o zona */
.state-dot { display: inline-block; width: 10px; height: 10px; border-radius: 3px; flex: none; }
.st-libre { background: #4fae84; }
.st-sin_atender { background: #e0a54a; }
.st-atendida { background: #e0504c; }
.st-sin_limpiar { background: #e8d36a; }
.st-off { background: #6b7c93; }

/* "Ahora" grande (puerta de Casa, aforo) */
.now-block { display: grid; gap: var(--s-3); padding: var(--s-6); border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); }
.now-block .big { font-family: var(--font-display); font-size: var(--t-3xl); font-weight: 640; letter-spacing: -0.025em; line-height: 1.05; }
.now-block .big .soft { color: var(--ink-soft); }
.now-block.is-alert { background: var(--vermilion-wash); border-color: rgb(224 80 76 / 0.35); }

/* Tarjetas de "Para mirar": lista con nivel, sin borde de color al costado */
.watch { display: grid; gap: 2px; }
.watch-item { display: grid; grid-template-columns: auto 1fr; gap: 4px var(--s-3); padding: 14px 0; border-top: 1px solid var(--line); }
.watch-item:first-child { border-top: 0; padding-top: 4px; }
.watch-item .badge { grid-row: span 2; align-self: start; margin-top: 1px; }
.watch-item b { font-weight: 600; }
.watch-item p { color: var(--ink-soft); font-size: var(--t-sm); }

/* Plan: comparación de planes */
.plan-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: var(--s-3); }
.plan-opt { display: grid; gap: var(--s-2); align-content: start; padding: var(--s-5); border-radius: var(--r-lg); border: 1px solid var(--line); background: var(--surface); }
.plan-opt.is-current { border-color: var(--link); }
.plan-opt h3 { font-size: var(--t-lg); }
.plan-opt .price { font-family: var(--font-display); font-size: var(--t-2xl); font-weight: 640; font-variant-numeric: tabular-nums; }
.plan-opt .price small { font-size: var(--t-sm); color: var(--ink-soft); font-weight: 500; }
.plan-opt ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; font-size: var(--t-sm); color: var(--ink-soft); }
.plan-opt li { display: flex; gap: 8px; }
.plan-opt li .i { color: var(--link); margin-top: 3px; }

/* Asistente */
.chat { display: grid; gap: var(--s-3); }
.msg { max-width: 72ch; padding: 12px 16px; border-radius: 16px; font-size: var(--t-md); }
.msg.me { justify-self: end; background: var(--navy); border-bottom-right-radius: 6px; }
.msg.ai { justify-self: start; background: var(--surface-2); border-bottom-left-radius: 6px; }
.msg.ai p + p { margin-top: 8px; }
.chat-input { display: flex; gap: var(--s-2); align-items: flex-end; }
.chips { display: flex; flex-wrap: wrap; gap: var(--s-2); }
.chips button { border: 1px solid var(--line-strong); background: transparent; color: var(--ink-soft); border-radius: var(--r-pill); padding: 7px 14px; font-size: var(--t-sm); cursor: pointer; }
.chips button:hover { color: var(--ink); background: var(--muted-wash); }

/* Pasos de un recorrido */
.route { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; font-size: var(--t-sm); }
.route span { padding: 4px 10px; border-radius: var(--r-pill); background: var(--surface-2); }
.route .i { color: var(--ink-faint); }

/* Embudo */
.funnel { display: grid; gap: 10px; }
.funnel-row { display: grid; grid-template-columns: minmax(140px, 240px) 1fr 4ch; gap: var(--s-3); align-items: center; font-size: var(--t-sm); }
.funnel-row .bar { height: 26px; border-radius: 8px; background: var(--chart-2); min-width: 4px; }
.funnel-row:first-child .bar { background: var(--chart-1); }
.funnel-row .val { text-align: right; font-variant-numeric: tabular-nums; color: var(--ink-soft); }
@media (max-width: 560px) {
  .funnel-row { grid-template-columns: 1fr 4ch; }
  .funnel-row .bar { grid-column: 1 / -1; grid-row: 2; height: 14px; }
}

/* ---------- Asistente flotante ---------- */
.ai-fab {
  position: fixed; z-index: 70; right: 24px; bottom: 24px;
  display: inline-flex; align-items: center; gap: 10px; height: 50px; padding: 0 22px 0 18px;
  border: 0; border-radius: var(--r-pill); background: var(--light); color: var(--on-light);
  font-size: 15px; font-weight: 500; cursor: pointer;
  box-shadow: 0 12px 40px -10px rgb(0 0 0 / 0.7);
  transition: background-color var(--fast) var(--ease), transform var(--fast) var(--ease);
}
.ai-fab:hover { background: #fff; }
.ai-fab:active { transform: scale(0.98); }
.ai-fab.is-open { background: var(--surface-3); color: var(--ink); }
.ai-panel {
  position: fixed; z-index: 70; right: 24px; bottom: 88px;
  width: min(400px, calc(100vw - 32px)); height: min(580px, calc(100dvh - 140px));
  display: grid; grid-template-rows: auto 1fr auto auto;
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: 28px;
  box-shadow: 0 30px 80px -20px rgb(0 0 0 / 0.85);
  opacity: 0; visibility: hidden; transform: translateY(12px) scale(0.98); transform-origin: bottom right;
  transition: opacity 240ms cubic-bezier(.32, .72, 0, 1), transform 320ms cubic-bezier(.32, .72, 0, 1), visibility 0s linear 320ms;
}
.ai-panel.open { opacity: 1; visibility: visible; transform: none; transition-delay: 0s; }
.ai-head { display: flex; align-items: center; gap: 8px; padding: 14px 12px 12px 20px; border-bottom: 1px solid var(--line); }
.ai-title { display: inline-flex; align-items: center; gap: 8px; margin-right: auto; font-weight: 560; color: var(--ink); }
.ai-body { display: grid; gap: 10px; align-content: start; padding: 18px; overflow-y: auto; }
.ai-body .msg { max-width: 88%; font-size: 14.5px; }
.ai-input { display: flex; align-items: flex-end; gap: 8px; padding: 10px 12px 6px; border-top: 1px solid var(--line); }
.ai-input .textarea { min-height: 44px; max-height: 120px; padding-top: 11px; border-radius: 22px; resize: none; }
.ai-note { padding: 0 20px 14px; font-size: 12px; color: var(--ink-faint); }
@media (max-width: 900px) {
  .ai-fab { right: 16px; bottom: calc(76px + env(safe-area-inset-bottom, 0px)); height: 46px; }
  .ai-fab span { display: none; }
  .ai-fab { width: 46px; padding: 0; justify-content: center; }
  .ai-panel { right: 16px; left: 16px; width: auto; bottom: calc(132px + env(safe-area-inset-bottom, 0px)); height: min(520px, calc(100dvh - 200px)); }
}
.ft-foot { display: flex; justify-content: flex-end; }

/* Modo real (servido por el equipo del local): selector de local encima de la tarjeta del local */
.side-local.has-switch { position: relative; }
.side-local-select { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; border: 0; }
.side-local:has(.side-local-select:focus-visible) { outline: 2px solid var(--link); outline-offset: 2px; }
