/* ============================================================================
   Baqqo Restaurante · Panel admin — estilo Revolut con template Baqqo.
   Fondo blanco/hueso, menú lateral fijo, tarjetas de dato con nº grande, radios
   grandes, acento rojo Baqqo en detalles/menú (nunca intrusivo). Sans Urbanist.
   ============================================================================ */
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; font-family: var(--bq2-font); color: var(--bq2-ink); background: var(--bq2-bg-sunken);
  -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button { font: inherit; }

/* ── Login (de un paso, estilo Revolut) ── */
.gate { position: fixed; inset: 0; display: grid; place-items: center; background: var(--bq2-bg); padding: 20px; z-index: 100; }
.gate__card { width: 100%; max-width: 400px; background: var(--bq2-bg-elev); border: 1px solid var(--bq2-line);
  border-radius: var(--bq2-r-l); box-shadow: var(--bq2-shadow-lg); padding: 40px; text-align: center; }
.gate__card img { height: 30px; margin: 0 auto 22px; }
.gate__card h1 { font-size: 1.5rem; font-weight: 800; letter-spacing: -0.02em; margin: 0 0 6px; }
.gate__card p { color: var(--bq2-ink-soft); margin: 0 0 24px; font-size: .95rem; }
.gate__card input { width: 100%; padding: 13px 15px; margin-bottom: 12px; border-radius: var(--bq2-r-s);
  border: 1.5px solid var(--bq2-line); background: var(--bq2-bg-sunken); font: inherit; outline: none; }
.gate__card input:focus { border-color: var(--bq2-accent); }

/* ── Layout: menú lateral fijo + contenido ── */
.layout { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }
/* Sin rebote (overscroll): al llegar al límite superior o inferior ni la página ni el menú se mueven ni dejan ver el fondo. */
html, body { overscroll-behavior: none; }
.side { position: sticky; top: 0; align-self: start; height: 100vh; height: 100dvh; overflow-y: auto; overscroll-behavior: contain; background: var(--bq2-bg-elev);
  border-right: 1px solid var(--bq2-line); display: flex; flex-direction: column; padding: 22px 16px; gap: 6px; }
.side__brand { display: flex; align-items: center; gap: 10px; padding: 6px 10px 20px; }
.side__brand img { height: 22px; }
.side__rest { font-weight: 700; font-size: .9rem; color: var(--bq2-ink-soft);
  padding: 0 10px 14px; border-bottom: 1px solid var(--bq2-line); margin-bottom: 10px; }
.side__rest b { display: block; color: var(--bq2-ink); font-size: 1rem; }
.nav-item { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: var(--bq2-r-m);
  color: var(--bq2-ink-soft); font-weight: 600; cursor: pointer; border: 0; background: transparent; width: 100%; text-align: left;
  transition: background .18s, color .18s; }
.nav-item:hover { background: var(--bq2-bg-sunken); color: var(--bq2-ink); }
.nav-item.on { background: var(--bq2-accent-soft); color: var(--bq2-accent); }
.nav-item:focus-visible { outline: 2px solid var(--bq2-accent); outline-offset: 2px; }
/* Iconos Solar (inline, fill=currentColor) SIEMPRE en rojo Baqqo; el texto mantiene su gris
   y solo se vuelve rojo en la sección activa. Prueba de "rojo no intrusivo" (owner, 2026-10-22). */
.nav-item .ic { width: 20px; height: 20px; flex: 0 0 20px; color: var(--bq2-accent); }
.side__nav { display: flex; flex-direction: column; gap: 6px; }
/* divisor: misma línea que la de debajo del nombre del restaurante (.side__rest) */
.side__divider { height: 1px; background: var(--bq2-line); margin: 10px 10px; }
/* el indicador deslizante solo existe en la píldora móvil */
.side__thumb { display: none; }
@media (prefers-reduced-motion: reduce) { .side__thumb { transition: none !important; } }
.side__spacer { flex: 1; }
.side__foot { padding: 10px; border-top: 1px solid var(--bq2-line); }
.side__logout { display: block; text-align: center; color: var(--bq2-ink-faint); font-size: .82rem; margin-top: 10px; }

.main { padding: 32px clamp(20px, 3.5vw, 44px) 64px; max-width: min(1440px, max(75vw, 1100px)); }   /* v18: antes 1100 fijo; en pantallas anchas aprovecha el 75 % (tope de lectura 1440) */
.topbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 28px; gap: 16px; }
.topbar h1 { font-size: 1.7rem; font-weight: 800; letter-spacing: -0.02em; margin: 0; }
.topbar p { color: var(--bq2-ink-soft); margin: 4px 0 0; font-size: .92rem; }

/* ── Botones ── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .5em; font-weight: 700;
  padding: .7em 1.3em; border-radius: var(--bq2-r-pill); border: 1.5px solid transparent; cursor: pointer;
  transition: transform .16s, background .18s, border-color .18s; }
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--bq2-accent); color: var(--bq2-accent-ink); }
.btn-primary:hover { background: var(--bq2-accent-deep); }
.btn-ghost { background: transparent; color: var(--bq2-ink); border-color: var(--bq2-line); }
.btn-ghost:hover { border-color: var(--bq2-ink); }
.btn-sm { padding: .5em .95em; font-size: .85rem; }

/* ── Tarjetas de dato (número grande, estilo Revolut) ── */
.stat-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 28px; }
@media (max-width: 920px) { .stat-row { grid-template-columns: repeat(2, 1fr); } }
.stat { background: var(--bq2-bg-elev); border: 1px solid var(--bq2-line); border-radius: var(--bq2-r-m);
  padding: 20px; box-shadow: var(--bq2-shadow); }
.stat .k { color: var(--bq2-ink-soft); font-size: .82rem; font-weight: 600; }
.stat .v { font-size: 2.1rem; font-weight: 800; letter-spacing: -0.03em; margin-top: 6px; }
.stat .d { font-size: .8rem; color: var(--bq2-ink-faint); margin-top: 2px; }
.stat.accent .v { color: var(--bq2-accent); }

/* ── Panel / card genérica ── */
.card { background: var(--bq2-bg-elev); border: 1px solid var(--bq2-line); border-radius: var(--bq2-r-l);
  box-shadow: var(--bq2-shadow); overflow: hidden; }
.card + .card { margin-top: 20px; }
.card__head { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px; border-bottom: 1px solid var(--bq2-line); }
.card__head h2 { font-size: 1.05rem; font-weight: 700; margin: 0; }
.muted { color: var(--bq2-ink-soft); font-size: .9rem; }

/* banner pendiente de revisión */
.banner-pending { margin-bottom: 20px; padding: 14px 18px; border-radius: var(--bq2-r-m);
  background: var(--bq2-blanco-bg); color: #7a5a12; font-size: .9rem; border: 1px solid #ecd9a8; }

/* ── Lista de vinos (carta) ── */
.wine-tools { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; gap: 12px; flex-wrap: wrap; }
.wine-filter { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { padding: 8px 14px; border-radius: var(--bq2-r-pill); border: 1.5px solid var(--bq2-line);
  background: var(--bq2-bg-elev); color: var(--bq2-ink-soft); font-weight: 600; font-size: .85rem; cursor: pointer; }
.chip.on { background: var(--bq2-accent); color: var(--bq2-accent-ink); border-color: transparent; }

.wines { display: grid; gap: 12px; }
.wine { display: grid; grid-template-columns: 54px 1fr auto; gap: 16px; align-items: center;
  background: var(--bq2-bg-elev); border: 1px solid var(--bq2-line); border-radius: var(--bq2-r-m);
  padding: 14px 18px; box-shadow: var(--bq2-shadow); cursor: pointer; transition: border-color .16s, transform .16s; }
.wine:hover { border-color: var(--bq2-accent); transform: translateY(-1px); }
.wine__shot { width: 54px; height: 72px; display: grid; place-items: center; background: var(--bq2-photo-bg); border: 1px solid var(--bq2-photo-line);
  border-radius: 10px; overflow: hidden; }
.wine__shot img { max-height: 66px; width: auto; }
.wine__main .n { font-weight: 700; }
.wine__main .m { color: var(--bq2-ink-soft); font-size: .85rem; margin-top: 2px; }
.wine__tags { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.tag { font-size: .72rem; font-weight: 700; padding: 3px 9px; border-radius: var(--bq2-r-pill); }
.tag.type-tinto { background: var(--bq2-tinto-bg); color: var(--bq2-tinto-ink); }
.tag.type-blanco { background: var(--bq2-blanco-bg); color: var(--bq2-blanco-ink); }
.tag.type-rosado { background: var(--bq2-rosado-bg); color: var(--bq2-rosado-ink); }
.tag.type-espumoso { background: var(--bq2-espumoso-bg); color: var(--bq2-espumoso-ink); }
.tag.type-dulce { background: var(--bq2-dulce-bg); color: var(--bq2-dulce-ink); }
.tag.type-generoso { background: var(--bq2-generoso-bg); color: var(--bq2-generoso-ink); }
.tag.type-otros { background: var(--bq2-otros-bg); color: var(--bq2-otros-ink); }
.tag.serve { background: var(--bq2-bg-sunken); color: var(--bq2-ink-soft); }
.tag.pending { background: #fde9c8; color: #8a5a12; }
.wine__right { text-align: right; }
.wine__price { font-weight: 800; font-size: 1.05rem; }
.wine__price small { font-weight: 600; color: var(--bq2-ink-faint); font-size: .72rem; display: block; }
.wine__vis { margin-top: 8px; display: flex; align-items: center; gap: 6px; justify-content: flex-end; }
.vis-bar { width: 70px; height: 6px; border-radius: 999px; background: var(--bq2-bg-sunken); overflow: hidden; }
.vis-bar i { display: block; height: 100%; background: var(--bq2-accent); }
.vis-lbl { font-size: .7rem; color: var(--bq2-ink-faint); }

/* ── Estadísticas: agregados por tipo + tabla ── */
.type-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 22px; }
.type-card { padding: 16px; border-radius: var(--bq2-r-m); border: 1px solid var(--bq2-line); }
.type-card .t { font-weight: 700; font-size: .85rem; }
.type-card .big { font-size: 1.6rem; font-weight: 800; margin-top: 6px; }
.type-card .sub { font-size: .75rem; color: var(--bq2-ink-soft); }
table.tb { width: 100%; border-collapse: collapse; }
table.tb th, table.tb td { padding: 13px 16px; text-align: left; border-bottom: 1px solid var(--bq2-line); font-size: .9rem; }
table.tb th { color: var(--bq2-ink-soft); font-weight: 700; font-size: .78rem; text-transform: uppercase; letter-spacing: .03em; cursor: pointer; user-select: none; }
table.tb th.num, table.tb td.num { text-align: right; }
table.tb tbody tr:hover { background: var(--bq2-bg-sunken); }
.conv { font-weight: 700; }
.conv.hi { color: var(--bq2-ok); }

/* ── Formularios (personalización + editor) ── */
.form-grid { padding: 22px; display: grid; gap: 16px; }
.field { display: flex; flex-direction: column; gap: 7px; }
.field label { font-weight: 600; font-size: .85rem; color: var(--bq2-ink-soft); }
.field input, .field select, .field textarea { font: inherit; padding: 12px 14px; border-radius: var(--bq2-r-s);
  border: 1.5px solid var(--bq2-line); background: var(--bq2-bg-sunken); color: var(--bq2-ink); outline: none; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--bq2-accent); background: var(--bq2-bg-elev); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.inline-toggle { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: .9rem; }

/* ── Drawer / editor de vino (panel lateral deslizante, estilo Revolut) ── */
.drawer-ov { position: fixed; inset: 0; background: rgba(20,15,13,.4); opacity: 0; visibility: hidden;
  transition: opacity .3s; z-index: 200; backdrop-filter: blur(2px); }
.drawer-ov.open { opacity: 1; visibility: visible; }
.drawer { position: fixed; top: 0; right: 0; height: 100vh; width: min(520px, 100%); background: var(--bq2-bg);
  box-shadow: -10px 0 40px rgba(0,0,0,.18); transform: translateX(100%); transition: transform .32s var(--bq2-ease);
  z-index: 201; overflow-y: auto; }
.drawer.open { transform: none; }
.drawer__head { position: sticky; top: 0; background: var(--bq2-bg); display: flex; align-items: center; justify-content: space-between;
  padding: 18px 22px; border-bottom: 1px solid var(--bq2-line); z-index: 2; }
.drawer__head h2 { font-size: 1.15rem; font-weight: 800; margin: 0; }
.drawer__close { width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--bq2-line); background: var(--bq2-bg-elev); cursor: pointer; font-size: 1.1rem; }
.drawer__body { padding: 22px; display: grid; gap: 16px; }
.cat-link { display: flex; gap: 14px; padding: 14px; border-radius: var(--bq2-r-m); background: var(--bq2-bg-sunken); border: 1px solid var(--bq2-line); }
.cat-link .thumb { width: 48px; height: 64px; display: grid; place-items: center; background: var(--bq2-photo-bg); border: 1px solid var(--bq2-photo-line); border-radius: 8px; overflow: hidden; }
.cat-link .thumb img { max-height: 60px; }
.cat-link .k { font-size: .72rem; font-weight: 700; color: var(--bq2-accent); text-transform: uppercase; letter-spacing: .03em; }
.cat-link .n { font-weight: 700; margin-top: 2px; }
.cat-link .id { font-size: .78rem; color: var(--bq2-ink-faint); margin-top: 2px; }
.cat-link .score { margin-left: auto; align-self: center; text-align: center; }
.cat-link .score b { font-size: 1.3rem; font-weight: 800; color: var(--bq2-accent); display: block; }
.cat-link .score span { font-size: .68rem; color: var(--bq2-ink-faint); }
.sec-label { font-weight: 800; font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--bq2-ink-soft); margin-top: 6px; }
.manual-fold { border: 1px solid var(--bq2-line); border-radius: var(--bq2-r-m); padding: 4px 14px; background: var(--bq2-bg-elev); }
.manual-fold summary { cursor: pointer; font-weight: 700; padding: 10px 0; font-size: .9rem; }
.warn-note { font-size: .8rem; color: #7a5a12; background: var(--bq2-blanco-bg); padding: 10px 12px; border-radius: 10px; margin-bottom: 10px; }
.feature-note { font-size: .78rem; color: var(--bq2-ink-faint); }
.drawer__foot { position: sticky; bottom: 0; background: var(--bq2-bg); padding: 16px 22px; border-top: 1px solid var(--bq2-line);
  display: flex; gap: 10px; justify-content: flex-end; }

/* chips de tema/acento */

/* QR grid */

/* toast */
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(20px); opacity: 0;
  background: var(--bq2-ink); color: #fff; padding: 12px 20px; border-radius: var(--bq2-r-pill); font-weight: 600;
  font-size: .9rem; box-shadow: var(--bq2-shadow-lg); z-index: 300; transition: opacity .25s, transform .25s; }
.toast.show { opacity: 1; transform: translateX(-50%); }

.tab-pane { display: none; }
.tab-pane.on { display: block; }

/* ── Móvil: el menú lateral se convierte en una PÍLDORA GLASS flotante en el footer ──
   Solo iconos, misma distribución que en escritorio (5 secciones · divisor · Vista de
   cliente). Las etiquetas siguen en el DOM (aria-label en cada botón) pero no se ven.
   El body queda a pantalla completa y optimizado para lectura en el móvil. */
@media (max-width: 760px) {
  /* CAUSA RAÍZ del descuadre en Estadísticas (2026-10-22): un ítem de grid tiene
     min-width:auto, así que .main no podía ser más estrecho que la tabla (min-width 560px) y
     ensanchaba toda la página; el scroll de la tarjeta no llegaba a actuar y la píldora fija
     quedaba fuera de la pantalla. minmax(0,1fr) + min-width:0 lo contiene; overflow-x:clip
     (no 'hidden', que rompería los position:sticky) es la red de seguridad. */
  html, body { overflow-x: clip; }
  .layout { grid-template-columns: minmax(0, 1fr); }
  .main { min-width: 0; }
  .side {
    position: fixed; z-index: 150; top: auto; left: 50%; bottom: calc(14px + env(safe-area-inset-bottom, 0px));
    transform: translateX(-50%); height: auto; overflow: visible; width: max-content; max-width: calc(100vw - 24px);
    flex-direction: row; align-items: center; gap: 0; padding: 6px;
    border: 1px solid rgba(255, 255, 255, .7); border-radius: var(--bq2-r-pill);
    background: rgba(255, 255, 255, .62);
    backdrop-filter: blur(18px) saturate(170%); -webkit-backdrop-filter: blur(18px) saturate(170%);
    box-shadow: 0 10px 30px rgba(20, 15, 13, .16), 0 1px 0 rgba(255, 255, 255, .8) inset;
  }
  .side__brand, .side__rest, .side__spacer, .side__foot { display: none; }
  .side__nav { position: relative; flex-direction: row; align-items: center; gap: 2px; }
  .nav-item { position: relative; z-index: 1; width: 46px; height: 46px; padding: 0; justify-content: center; border-radius: 50%; gap: 0; }
  .nav-item:hover, .nav-item.on { background: transparent; }
  /* Indicador deslizante (como la pastilla del chat): un único círculo bajo los iconos que
     viaja hasta el activo. La posición la pone el JS (offsetLeft del botón activo) porque el
     divisor rompe la equidistancia; misma curva y duración que el chat (.32s). */
  .side__thumb { display: block; position: absolute; top: 0; left: 0; width: 46px; height: 46px;
    border-radius: 50%; background: var(--bq2-accent-soft); pointer-events: none;
    transition: translate .32s cubic-bezier(.3, .7, .4, 1); }
  .side__thumb.no-anim { transition: none; }
  .nav-item .ic { width: 22px; height: 22px; flex-basis: 22px; }
  .nav-item__label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .side__divider { width: 1px; height: 26px; margin: 0 6px; }

  /* body optimizado: menos márgenes, cabecera compacta, hueco abajo para la píldora */
  .main { padding: 20px 16px calc(100px + env(safe-area-inset-bottom, 0px)); max-width: none; }
  .topbar { margin-bottom: 18px; flex-wrap: wrap; gap: 12px; }
  .topbar h1 { font-size: 1.4rem; }
  .topbar p { font-size: .85rem; }
  .stat-row { grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 18px; }
  .stat { padding: 14px; }
  .stat .v { font-size: 1.6rem; }
  .card__head { padding: 14px 16px; flex-wrap: wrap; gap: 4px; }
  .wine { grid-template-columns: 44px 1fr auto; gap: 12px; padding: 12px 14px; }
  .wine__shot { width: 44px; height: 60px; }
  .wine__shot img { max-height: 54px; }
  .wine__vis { display: none; }
  /* Estadísticas · highlights por tipo en rejilla de 2; si queda uno suelto, a ancho completo */
  .type-cards { grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 16px; }
  .type-card:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .type-card { padding: 14px; }
  .type-card .big { font-size: 1.4rem; }
  /* Estadísticas · SOLO la tabla se desliza en horizontal (como los carruseles de la slide 3
     de la landing); la página sigue con scroll vertical normal y nunca se ensancha.
     overscroll-behavior evita que el gesto horizontal acabe en "atrás" del navegador. */
  .tb-scroll { overflow-x: auto; overscroll-behavior-x: contain; -webkit-overflow-scrolling: touch;
    scrollbar-width: none; }
  .tb-scroll::-webkit-scrollbar { display: none; }
  table.tb { min-width: 560px; }
  table.tb th, table.tb td { padding: 11px 12px; white-space: nowrap; }
  /* la columna "Vino" se queda fija al deslizar, para no perder a qué vino es cada dato */
  table.tb th:first-child, table.tb td:first-child {
    position: sticky; left: 0; z-index: 1; background: var(--bq2-bg-elev);
    max-width: 150px; overflow: hidden; text-overflow: ellipsis;
    box-shadow: 1px 0 0 var(--bq2-line); }
  table.tb tbody tr:hover td:first-child { background: var(--bq2-bg-sunken); }
  .form-grid { padding: 16px; }
  .field-row { grid-template-columns: 1fr; }
  /* el toast sube para no quedar debajo de la píldora */
  .toast { bottom: calc(86px + env(safe-area-inset-bottom, 0px)); }
}
/* móviles muy estrechos (~320px): la píldora (~311px) no cabría con botones de 46px */
@media (max-width: 360px) {
  .nav-item, .side__thumb { width: 42px; height: 42px; }
  .side__divider { margin: 0 4px; }
}

/* embudo Mostrado → Recomendado → Convertido (F1): explicación al inicio de Estadísticas */
.funnel-note { margin: 0 0 18px; padding: 12px 14px; border-radius: var(--bq2-r-m); background: var(--bq2-bg-elev);
  border: 1px solid var(--bq2-line); color: var(--bq2-ink-soft); font-size: .85rem; line-height: 1.5; }
.funnel-note b { color: var(--bq2-ink); }
.sub-n { display: block; font-size: .7rem; font-weight: 500; color: var(--bq2-ink-faint); }

/* ════════════ F2 · ficha de vino, foto y alertas ════════════ */
.tag.custom { background: var(--bq2-accent-soft); color: var(--bq2-accent); }
.tag.nophoto { background: #fff3d6; color: #8a5a12; }

/* feed de alertas (Resumen) */
.alerts { margin-bottom: 20px; }
.alerts__list { list-style: none; margin: 0; padding: 6px 10px; }
.alert { width: 100%; display: flex; align-items: center; gap: 12px; text-align: left; padding: 12px; border: 0; background: transparent;
  border-radius: var(--bq2-r-m); cursor: pointer; color: var(--bq2-ink); min-height: 48px; }
.alert:hover { background: var(--bq2-bg-sunken); }
.alert:focus-visible { outline: 2px solid var(--bq2-accent); outline-offset: -2px; }
.alert__dot { flex: 0 0 10px; height: 10px; border-radius: 50%; background: #d9a441; }
.alert--required .alert__dot { background: var(--bq2-danger); }
.alert__body { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.alert__body b { font-size: .92rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.alert__body span { font-size: .82rem; color: var(--bq2-ink-soft); }
.alert__go { width: 18px; height: 18px; color: var(--bq2-ink-faint); flex: 0 0 18px; }
.alerts__more { display: block; width: 100%; border: 0; border-top: 1px solid var(--bq2-line); background: transparent; padding: 13px;
  font-weight: 700; font-size: .85rem; color: var(--bq2-accent); cursor: pointer; min-height: 44px; }

/* cabecera del editor: foto sobre blanco */
.fh { display: flex; gap: 16px; align-items: center; }
.fh__photo { flex: 0 0 84px; width: 84px; height: 112px; display: grid; place-items: center; background: var(--bq2-photo-bg);
  border: 1px solid var(--bq2-photo-line); border-radius: 12px; overflow: hidden; }
.fh__photo img { max-height: 104px; max-width: 76px; width: auto; }
.fh__main { min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.fh__chips { display: flex; flex-wrap: wrap; gap: 6px; }
.fh__meta { font-size: .85rem; color: var(--bq2-ink-soft); }
.fh__actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.fh__actions label.btn { cursor: pointer; }
.photo-msg { font-size: .85rem; color: var(--bq2-ink-soft); }
.photo-msg.is-error { padding: 10px 12px; border-radius: var(--bq2-r-m); background: #fdecea; color: #8c2f2a; }
.photo-msg ul { margin: 4px 0 0; padding-left: 18px; }

/* margen calculado */
.margin { padding: 12px 14px; border-radius: var(--bq2-r-m); background: var(--bq2-bg-sunken); font-size: .85rem; color: var(--bq2-ink-soft); }
.margin__t { font-weight: 800; font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; color: var(--bq2-ink-soft); }
.margin__v { display: flex; flex-wrap: wrap; gap: 4px 18px; margin: 4px 0 2px; color: var(--bq2-ink); }
.margin__v b { font-size: 1.05rem; }
.margin__s { font-size: .78rem; }
.muted-s { font-weight: 500; color: var(--bq2-ink-faint); }

/* campos personalizados + restablecer */
.sec-label--row { display: flex; align-items: center; justify-content: space-between; }
.field.is-custom input, .field.is-custom textarea, .field.is-custom select { border-color: var(--bq2-accent); }
.custom-dot { font-size: .7rem; font-weight: 700; color: var(--bq2-accent); }
.link-reset { border: 0; background: none; padding: 4px 2px; font: inherit; font-size: .8rem; font-weight: 700; color: var(--bq2-accent);
  text-decoration: underline; cursor: pointer; }
.link-reset:focus-visible { outline: 2px solid var(--bq2-accent); outline-offset: 2px; border-radius: 4px; }

/* ── F3 · Organizar carta ── */
.seg { display: inline-flex; gap: 4px; padding: 4px; margin-bottom: 16px; border-radius: var(--bq2-r-pill); background: var(--bq2-bg-elev); border: 1px solid var(--bq2-line); }
.seg button { border: 0; background: transparent; padding: 8px 16px; border-radius: var(--bq2-r-pill); font: inherit; font-size: .85rem; font-weight: 700; color: var(--bq2-ink-soft); cursor: pointer; min-height: 40px; }
.seg button.on { background: var(--bq2-accent); color: var(--bq2-accent-ink); }
.seg button:focus-visible { outline: 2px solid var(--bq2-accent); outline-offset: 2px; }
[hidden] { display: none !important; }

.org__bar { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 16px; }
.org__tip { flex-basis: 100%; }
.org-sec { background: var(--bq2-bg-elev); border: 1px solid var(--bq2-line); border-radius: 14px; padding: 12px; margin-bottom: 14px; position: relative; }
.org-sec__h, .org-sub__h { display: flex; align-items: center; gap: 8px; }
.org-title { flex: 1; min-width: 0; font: inherit; font-weight: 700; color: var(--bq2-ink); background: transparent; border: 1px solid transparent; border-radius: 8px; padding: 8px; }
.org-title:hover { border-color: var(--bq2-line); }
.org-title:focus-visible { outline: 2px solid var(--bq2-accent); border-color: transparent; background: var(--bq2-bg); }
.org-un { margin: 0; flex: 1; font-size: 1rem; }
.org-count { font-size: .78rem; color: var(--bq2-ink-soft); white-space: nowrap; }
.org-sec__tools { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 8px 44px; }
.org-t { border: 1px solid var(--bq2-line); background: transparent; color: var(--bq2-ink-soft); border-radius: var(--bq2-r-pill); padding: 6px 12px; font: inherit; font-size: .78rem; font-weight: 700; cursor: pointer; min-height: 34px; }
.org-t:hover { border-color: var(--bq2-ink); color: var(--bq2-ink); }
.org-t--del:hover { border-color: #b3261e; color: #b3261e; }
.org-t:focus-visible, .org-b:focus-visible, .org-grip:focus-visible, .org-move:focus-visible { outline: 2px solid var(--bq2-accent); outline-offset: 2px; }
.org-sub { margin: 10px 0 0 22px; padding: 8px; border-left: 2px solid var(--bq2-line); border-radius: 6px; position: relative; }
.org-sub .org-title { font-size: .92rem; }
.org-list { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 4px; position: relative; }
.org-empty { padding: 10px 12px; font-size: .82rem; color: var(--bq2-ink-faint); border: 1px dashed var(--bq2-line); border-radius: 8px; }
.org-wine { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 10px; background: var(--bq2-bg); border: 1px solid var(--bq2-line); position: relative; }
.org-wine__t { flex: 1; min-width: 0; display: grid; }
.org-wine__t b { font-size: .88rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.org-wine__t small { color: var(--bq2-ink-soft); font-size: .74rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.org-ops { display: inline-flex; align-items: center; gap: 4px; }
.org-b, .org-grip { width: 40px; height: 40px; display: grid; place-items: center; border: 0; background: transparent; color: var(--bq2-ink-soft); border-radius: 10px; cursor: pointer; padding: 0; }
.org-b:hover, .org-grip:hover { background: var(--bq2-line); color: var(--bq2-ink); }
.org-b svg, .org-grip svg { width: 20px; height: 20px; }
.org-grip { cursor: grab; touch-action: none; }
.org-move { max-width: 120px; font: inherit; font-size: .76rem; padding: 6px; border: 1px solid var(--bq2-line); border-radius: 8px; background: var(--bq2-bg); color: var(--bq2-ink); min-height: 34px; }
.is-dragging { opacity: .35; }
.org-ghost { opacity: .95; box-shadow: 0 10px 30px rgba(0,0,0,.25); background: var(--bq2-bg-elev); border-radius: 12px; }
body.is-dragging-org { user-select: none; cursor: grabbing; }
.drop-before::before, .drop-after::after { content: ""; position: absolute; left: 0; right: 0; height: 3px; background: var(--bq2-accent); border-radius: 2px; }
.drop-before::before { top: -3px; } .drop-after::after { bottom: -3px; }
.drop-end { outline: 2px dashed var(--bq2-accent); outline-offset: 2px; }
@media (max-width: 560px) { .org-move { max-width: 92px; } .org-sec__tools { margin-left: 0; } .org-sub { margin-left: 8px; } }

/* ════════════ F4 · Maridajes ════════════ */
.mar-sum { margin: 0 0 14px; font-size: .85rem; color: var(--bq2-ink-soft); font-weight: 600; }
.dishes { display: grid; gap: 12px; margin-bottom: 16px; }
.dish { background: var(--bq2-bg-elev); border: 1px solid var(--bq2-line); border-radius: 14px; padding: 14px; display: grid; gap: 10px; }
.dish__h { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.dish-name { flex: 1 1 200px; min-width: 0; font: inherit; font-weight: 700; color: var(--bq2-ink); background: transparent; border: 1px solid transparent; border-radius: 8px; padding: 8px; }
.dish-name:hover { border-color: var(--bq2-line); }
.dish-name:focus-visible, .dish-ing:focus-visible, .dish-course:focus-visible { outline: 2px solid var(--bq2-accent); outline-offset: 1px; }
.dish-course, .dish-ing { font: inherit; font-size: .85rem; color: var(--bq2-ink); background: var(--bq2-bg); border: 1px solid var(--bq2-line); border-radius: 8px; padding: 8px 10px; min-height: 40px; }
.dish-ing { width: 100%; box-sizing: border-box; }
.cat-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.cat-chip { border: 1.5px solid var(--bq2-line); background: transparent; color: var(--bq2-ink-soft); border-radius: var(--bq2-r-pill); padding: 6px 12px; min-height: 36px; font: inherit; font-size: .8rem; font-weight: 700; cursor: pointer; }
.cat-chip:hover { border-color: var(--bq2-ink); color: var(--bq2-ink); }
.cat-chip.on { background: var(--bq2-accent); color: var(--bq2-accent-ink); border-color: transparent; }
.cat-chip:focus-visible { outline: 2px solid var(--bq2-accent); outline-offset: 2px; }
.dish-match { margin: 0; font-size: .82rem; color: var(--bq2-ink-soft); line-height: 1.45; }
.dish-match b { color: var(--bq2-ink); }
.dish-warn { color: #8a5a12; }

/* móviles estrechos: con Maridajes la píldora tiene 7 iconos; se estrecha para caber en 320 px */
@media (max-width: 360px) {
  .nav-item, .side__thumb { width: 40px; height: 40px; }
  .side__nav { gap: 0; }
  .side { padding: 5px; }
}
@media (max-width: 340px) {
  .nav-item, .side__thumb { width: 36px; height: 36px; }
  .nav-item .ic { width: 20px; height: 20px; flex-basis: 20px; }
  .side__divider { margin: 0 3px; }
}

/* F5 · aviso de cuenta sin publicar */
.ob-banner { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; margin: 0 0 18px; padding: 12px 16px; border-radius: var(--bq2-r-m); background: var(--bq2-accent-soft); color: var(--bq2-ink); font-size: .9rem; font-weight: 600; }
.ob-banner a { color: var(--bq2-accent); text-decoration: underline; font-weight: 700; }

/* Barra permanente de demo (panel): deja claro que los datos no se guardan en Baqqo */
.demo-bar { margin: 0 0 14px; padding: 10px 14px; border-radius: var(--bq2-r-m); background: var(--bq2-bg-elev); border: 1px dashed var(--bq2-line);
  color: var(--bq2-ink-soft); font-size: .84rem; line-height: 1.4; }
.demo-bar b { color: var(--bq2-ink); }

/* ════════════ Fase 1 · tabla de platos mínima (vista única de Maridajes) ════════════
   Solo tokens existentes. */
.sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.mar-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; margin-bottom: 14px; }
.mar-bar .mar-sum { margin: 0; }
.dishes--table { display: block; }
.dt-wrap { background: var(--bq2-bg-elev); border: 1px solid var(--bq2-line); border-radius: var(--bq2-r-m); }
.dt { width: 100%; border-collapse: collapse; font-size: .88rem; }
.dt th { text-align: left; font-size: .7rem; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; color: var(--bq2-ink-soft); padding: 12px 6px; border-bottom: 1px solid var(--bq2-line); white-space: nowrap; }
.dt td { padding: 8px 6px; border-bottom: 1px solid var(--bq2-line); vertical-align: middle; }
.dt tbody tr:last-child td { border-bottom: 0; }
.dt tbody tr:hover { background: var(--bq2-bg); }
.dt--table { table-layout: fixed; }
.dt-c-name { width: 24%; } .dt-c-ing { width: 17%; } .dt-c-course { width: 10%; } .dt-c-cats { width: 21%; } .dt-c-wines { width: 20%; } .dt-c-act { width: 8%; white-space: nowrap; text-align: right; }
.dt-name { display: flex; align-items: center; gap: 6px; }
.dt .dish-name { flex: 1 1 auto; width: 100%; min-height: 40px; padding: 6px 8px; box-sizing: border-box; }
.dt .dish-name:focus-visible, .dt .dish-course:focus-visible { outline: 2px solid var(--bq2-accent); outline-offset: 1px; }
.dt .dish-course { width: 100%; min-height: 40px; background: transparent; border-color: transparent; padding: 6px 4px; }
.dt .dish-course:hover { border-color: var(--bq2-line); }
.dt .tag { flex: none; }
.dish-fam { display: block; margin: 2px 8px 0; font-size: .7rem; font-weight: 600; letter-spacing: .02em; color: var(--bq2-ink-faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* ingredientes: una línea, tags recortados con +N */
.ing-cell { position: relative; }
.ing-btn { display: flex; align-items: center; width: 100%; min-height: 40px; padding: 4px 8px; border: 1px solid transparent; border-radius: 8px; background: transparent; font: inherit; color: var(--bq2-ink); cursor: pointer; text-align: left; overflow: hidden; }
.ing-btn:hover { border-color: var(--bq2-line); background: var(--bq2-bg); }
.ing-btn:focus-visible { outline: 2px solid var(--bq2-accent); outline-offset: 1px; }
.ing-tags { display: flex; align-items: center; gap: 4px; min-width: 0; white-space: nowrap; overflow: hidden; }
.ing-tag { font-size: .76rem; font-weight: 600; padding: 2px 8px; border-radius: var(--bq2-r-pill); background: var(--bq2-bg-sunken); color: var(--bq2-ink); max-width: 110px; overflow: hidden; text-overflow: ellipsis; flex: 0 1 auto; }
.ing-more { font-size: .76rem; font-weight: 700; color: var(--bq2-ink-soft); flex: none; }
.ing-empty { font-size: .8rem; color: var(--bq2-ink-soft); text-decoration: underline; text-decoration-color: var(--bq2-line); text-underline-offset: 3px; }
.ing-pop { position: absolute; z-index: 30; top: calc(100% - 2px); left: 0; width: min(340px, 86vw); background: var(--bq2-bg-elev); border: 1px solid var(--bq2-line); border-radius: var(--bq2-r-s); box-shadow: var(--bq2-shadow-lg); padding: 10px; display: grid; gap: 8px; }
.ing-pop__list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 8px; max-height: 220px; overflow-y: auto; }
.ing-opt { display: flex; align-items: center; gap: 8px; min-height: 36px; padding: 0 6px; border-radius: 6px; font-size: .85rem; cursor: pointer; }
.ing-opt:hover { background: var(--bq2-bg); }
.ing-opt input { width: 18px; height: 18px; accent-color: var(--bq2-accent); flex: none; }
.ing-opt input:focus-visible { outline: 2px solid var(--bq2-accent); outline-offset: 2px; }
.ing-opt[hidden] { display: none; }
.ing-pop { display: flex; flex-direction: column; gap: 8px; }
.ing-search { font: inherit; font-size: .88rem; color: var(--bq2-ink); background: var(--bq2-bg); border: 1px solid var(--bq2-line); border-radius: 8px; padding: 8px 10px; min-height: 40px; box-sizing: border-box; width: 100%; }
.ing-search:focus-visible { outline: 2px solid var(--bq2-accent); outline-offset: 1px; }
.ing-pop__sel { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 8px; padding-bottom: 6px; border-bottom: 1px solid var(--bq2-line); }
.ing-pop__h { grid-column: 1 / -1; font-size: .66rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--bq2-ink-soft); padding: 2px 6px; }
.ing-pop__add { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ing-pop__add:not(:has(:not([hidden]))) { display: none; }
.ing-none { font-size: .82rem; color: var(--bq2-ink-soft); }
.ing-pop__foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.ing-hint { font-size: .72rem; color: var(--bq2-ink-soft); line-height: 1.3; }
/* categorías: solo las activas + «Cambiar» */
.cat-chips--c { align-items: center; gap: 4px; }
.cat-chip--s { padding: 3px 10px; min-height: 28px; font-size: .74rem; }
.cat-none, .cat-hint { font-size: .74rem; color: var(--bq2-ink-soft); }
.cat-hint { font-style: italic; }
.cat-more { border: 0; background: transparent; font: inherit; font-size: .76rem; font-weight: 700; color: var(--bq2-accent); cursor: pointer; padding: 6px 6px; min-height: 32px; border-radius: 6px; text-decoration: underline; text-underline-offset: 3px; }
.cat-more:hover { color: var(--bq2-accent-deep); }
.cat-more:focus-visible { outline: 2px solid var(--bq2-accent); outline-offset: 1px; }
/* vinos que casan */
.wn-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.wn-list li { display: flex; align-items: baseline; gap: 6px; font-size: .8rem; min-width: 0; }
.wn-name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wn-pct { flex: none; font-weight: 700; color: var(--bq2-ink); font-variant-numeric: tabular-nums; }
.wn-more { font-size: .72rem; color: var(--bq2-ink-soft); }
.dt .dish-warn { font-size: .78rem; color: var(--bq2-warn); }
/* móvil / ancho medio: cada fila pasa a bloque apilado y denso, sin scroll horizontal.
   Fila: nombre + Quitar / ingredientes + tipo / categorías / vinos que casan. */
@media (max-width: 900px) {
  .dt--table { display: block; }
  .dt--table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .dt--table tbody { display: block; }
  .dt--table tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 10px; padding: 10px 12px; border-bottom: 1px solid var(--bq2-line); }
  .dt--table tbody tr:last-child { border-bottom: 0; }
  .dt--table td { display: block; padding: 0; border: 0; width: auto; min-width: 0; }
  .dt--table td[class] { width: auto; }
  .dt--table td::before { content: none; }
  .dt--table td.dt-c-wines::before { content: attr(data-label); display: block; font-size: .66rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--bq2-ink-soft); margin: 6px 0 2px; }
  .dt--table td.dt-c-name { grid-column: 1; grid-row: 1; }
  .dt--table td.dt-c-act { grid-column: 2; grid-row: 1; align-self: center; text-align: right; }
  .dt--table td.dt-c-ing { grid-column: 1; grid-row: 2; }
  .dt--table td.dt-c-course { grid-column: 2; grid-row: 2; width: auto; }
  .dt--table td.dt-c-cats, .dt--table td.dt-c-wines { grid-column: 1 / -1; }
  .dt--table td.dt-c-ing:has(.ing-pop) { grid-column: 1 / -1; }
  .ing-pop { position: static; width: auto; margin-top: 4px; box-shadow: none; }
  .dt .dish-course { border-color: var(--bq2-line); width: auto; max-width: 110px; }
  .cat-chip--s { min-height: 36px; }
  .cat-more { min-height: 36px; }
}
/* ════════════ Bloque B · ficha plegable, disponibilidad, Personal, logo, cartel QR ════════════ */
/* Cajón en columna: el pie de guardado queda SIEMPRE pegado abajo, aunque las secciones estén plegadas. */
.drawer { display: flex; flex-direction: column; height: 100vh; height: 100dvh; overflow-x: hidden; }
.drawer__body { flex: 1 1 auto; align-content: start; gap: 12px; }
.drawer__head, .drawer__foot { flex: none; }
.drawer__body { min-width: 0; grid-template-columns: minmax(0, 1fr); }
.dsec__b, .dsec__b > *, .field-row > * { min-width: 0; }
.dsec__b .field input, .dsec__b .field select, .dsec__b .field textarea { width: 100%; min-width: 0; box-sizing: border-box; }
.drawer__foot { box-shadow: 0 -10px 24px rgba(60,40,30,.07); }

.photo-state .muted-s, .dsec__b .muted-s { font-size: .82rem; font-weight: 500; color: var(--bq2-ink-soft); }
.dtop { display: flex; gap: 14px; align-items: center; }
.dtop__photo { flex: 0 0 52px; width: 52px; height: 70px; display: grid; place-items: center; background: var(--bq2-photo-bg);
  border: 1px solid var(--bq2-photo-line); border-radius: 10px; overflow: hidden; }
.dtop__photo img { max-height: 62px; max-width: 44px; width: auto; }
.dtop__main { min-width: 0; display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }

.dsec { border: 1px solid var(--bq2-line); border-radius: var(--bq2-r-m); background: var(--bq2-bg-elev); }
.dsec > summary { list-style: none; display: flex; align-items: center; gap: 10px; padding: 12px 16px; min-height: 48px; cursor: pointer; border-radius: var(--bq2-r-m); }
.dsec > summary::-webkit-details-marker { display: none; }
.dsec > summary::after { content: ""; flex: none; width: 8px; height: 8px; margin: -3px 2px 0 4px; border-right: 2px solid var(--bq2-ink-soft);
  border-bottom: 2px solid var(--bq2-ink-soft); transform: rotate(45deg); transition: transform .2s var(--bq2-ease); }
.dsec[open] > summary::after { transform: rotate(-135deg); margin-top: 3px; }
.dsec > summary:focus-visible { outline: 2px solid var(--bq2-accent); outline-offset: 2px; }
.dsec__t { font-weight: 800; font-size: .95rem; }
.dsec__h { margin-left: auto; color: var(--bq2-ink-faint); font-size: .8rem; font-weight: 600; text-align: right; }
.dsec__b { padding: 2px 16px 18px; display: grid; gap: 14px; }
.dsec__b .sec-label--row { margin: 0; }
.avail-toggle small { font-weight: 500; }

/* Disponible / Agotado: interruptor en la fila de la carta */
.avail { position: relative; display: inline-flex; align-items: center; gap: 8px; margin-top: 8px; min-height: 32px; padding: 4px 12px 4px 6px;
  border: 1px solid var(--bq2-line); border-radius: var(--bq2-r-pill); background: var(--bq2-bg-elev); font: inherit; font-size: .74rem; font-weight: 700;
  color: var(--bq2-ink-soft); cursor: pointer; }
.avail::before { content: ""; position: absolute; inset: -6px 0; }
.avail i { position: relative; width: 26px; height: 16px; border-radius: var(--bq2-r-pill); background: var(--bq2-ok); transition: background .16s; }
.avail i::after { content: ""; position: absolute; top: 2px; left: 12px; width: 12px; height: 12px; border-radius: 50%; background: var(--bq2-bg-elev); transition: left .16s var(--bq2-ease); }
.avail.is-off { color: var(--bq2-danger); border-color: var(--bq2-danger); }
.avail.is-off i { background: var(--bq2-ink-faint); }
.avail.is-off i::after { left: 2px; }
.avail:focus-visible { outline: 2px solid var(--bq2-accent); outline-offset: 2px; }
.wine.is-off .wine__shot, .wine.is-off .wine__main, .wine.is-off .wine__price { opacity: .5; }
.tag.ok { background: var(--bq2-bg-sunken); color: var(--bq2-ok); }
.tag.off { background: var(--bq2-tinto-bg); color: var(--bq2-danger); }

/* Foto: aviso de formato antes de subir y estado «sin foto» */
.photo-rules { padding: 10px 14px; border-radius: var(--bq2-r-s); background: var(--bq2-bg-sunken); font-size: .82rem; color: var(--bq2-ink-soft); }
.photo-rules ul { margin: 4px 0 0; padding-left: 18px; }
.photo-rules p { margin: 6px 0 0; }
.photo-rules p:empty { display: none; }
.photo-msg.is-ok { color: var(--bq2-ok); }
.photo-state { display: flex; gap: 14px; align-items: center; }
.photo-state__img { flex: 0 0 72px; height: 96px; display: grid; place-items: center; background: var(--bq2-photo-bg); border: 1px solid var(--bq2-photo-line); border-radius: 12px; overflow: hidden; }
.photo-state__img img { max-height: 88px; max-width: 60px; width: auto; }
.photo-state__t { font-weight: 700; }
.photo-rules-line { font-size: .82rem; color: var(--bq2-ink-soft); margin: 0 0 12px; }
.field-err { color: var(--bq2-danger); font-size: .8rem; font-weight: 600; }
.field input[aria-invalid="true"] { border-color: var(--bq2-danger); }

/* Personal / subcuentas */
.staff-form { display: grid; grid-template-columns: 1.4fr 1fr auto; gap: 12px; align-items: end; padding: 16px 18px 0; }
.staff-form .btn { min-height: 46px; }
.staff-msg { margin: 10px 18px 0; font-size: .85rem; color: var(--bq2-ok); min-height: 1.2em; }
.staff-msg.is-error { color: var(--bq2-danger); }
.staff-full { margin: 6px 18px 0; font-size: .85rem; color: var(--bq2-warn); }
.staff-list { list-style: none; margin: 10px 0 0; padding: 0 18px 8px; }
.staff-row { display: grid; grid-template-columns: 1fr auto auto minmax(110px, auto); gap: 12px; align-items: center; padding: 12px 0; border-top: 1px solid var(--bq2-line); }
.staff-row__who { min-width: 0; display: flex; flex-direction: column; }
.staff-row__who b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.staff-row__who span { font-size: .8rem; color: var(--bq2-ink-soft); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.staff-rm { min-height: 40px; justify-self: end; }
.staff-rm.is-armed { color: var(--bq2-danger); font-weight: 700; }
.staff-empty { margin: 0; padding: 4px 18px 18px; color: var(--bq2-ink-soft); font-size: .88rem; }

/* Logo del restaurante */
.logo-card { display: grid; gap: 12px; }
.logo-card__row { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.logo-card__prev { min-width: 120px; min-height: 64px; padding: 12px 18px; border: 1px solid var(--bq2-line); border-radius: var(--bq2-r-m);
  background: var(--bq2-bg-elev); display: grid; place-items: center; font-size: 1.05rem; }
.logo-card__img { height: 40px; }
.logo-card__act { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }

/* Cartel QR: cada mesa es un botón */

@media (max-width: 760px) {
  .staff-form { grid-template-columns: 1fr; }
  .avail { min-height: 36px; }
  .dsec__h { display: none; }
  /* La píldora ahora lleva 8 botones (con Personal): el tamaño se reparte según el ancho disponible. */
  .nav-item, .side__thumb { width: min(46px, calc((100vw - 64px) / 8)); height: min(46px, calc((100vw - 64px) / 8)); }
  .side__divider { margin: 0 4px; }
}
/* 320 px: sin huecos entre botones y margen lateral mínimo para conservar objetivos táctiles de 36 px */
@media (max-width: 340px) {
  .side { max-width: calc(100vw - 8px); padding: 3px; }
  .side__nav { gap: 0; }
  .nav-item, .side__thumb { width: min(46px, calc((100vw - 8px - 6px - 9px) / 8)); height: min(46px, calc((100vw - 8px - 6px - 9px) / 8)); }
}


/* ════════════ Tanda 2 (2026-10-30) · D5-D11 ════════════ */
/* Etiqueta / píldora ÚNICA (D9a). Causa raíz del desalineo de «Invitado»: la clase .pending del aviso de revisión de la carta
   (margin-bottom 20px, padding 14px 18px, borde) también casaba con <span class="tag pending">. El aviso pasó a .banner-pending.
   Altura e interlineado fijos y centrado propio: todas las píldoras miden y se alinean igual en cualquier contenedor. */
.tag { display: inline-flex; align-items: center; justify-content: center; box-sizing: border-box; min-height: 24px; padding: 2px 10px;
  line-height: 1.2; white-space: nowrap; align-self: center; margin: 0; }
.fh__chips, .wine__tags { align-items: center; align-content: flex-start; }
.field-help { font-size: .76rem; color: var(--bq2-ink-soft); line-height: 1.35; }
.chk { display: flex; align-items: center; gap: 8px; font-size: .88rem; font-weight: 600; color: var(--bq2-ink); cursor: pointer; min-height: 36px; }
.chk input { width: 18px; height: 18px; accent-color: var(--bq2-accent); flex: none; }
.chk input:focus-visible { outline: 2px solid var(--bq2-accent); outline-offset: 2px; }
.btn-danger { background: var(--bq2-danger); color: #fff; }
.btn-danger:hover { background: #82241e; }
.btn:disabled, .btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn:focus-visible { outline: 2px solid var(--bq2-accent); outline-offset: 2px; }
.link-reset--danger { color: var(--bq2-danger); }
.link-reset { min-height: 32px; }
.chip { min-height: 40px; display: inline-flex; align-items: center; gap: 6px; }
.chip:focus-visible { outline: 2px solid var(--bq2-accent); outline-offset: 2px; }
.chip__n { font-size: .74rem; font-weight: 700; opacity: .75; font-variant-numeric: tabular-nums; }
.chip.on .chip__n { opacity: .9; }

/* Modales (confirmación y tendencia) */
.modal-ov { position: fixed; inset: 0; z-index: 300; background: rgba(28, 23, 20, .5); display: grid; place-items: center; padding: 16px; overscroll-behavior: contain; }
.modal-ov[hidden] { display: none; }
body.modal-open { overflow: hidden; }
.confirm { width: min(440px, 100%); background: var(--bq2-bg-elev); border-radius: var(--bq2-r-m); box-shadow: var(--bq2-shadow-lg); padding: 24px; outline: none; }
.confirm h2 { margin: 0 0 8px; font-size: 1.1rem; font-weight: 800; }
.confirm p { margin: 0 0 20px; color: var(--bq2-ink-soft); font-size: .92rem; line-height: 1.45; }
.confirm__act { display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }

/* Estadísticas: periodo y tendencia (D7) */
.stats-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; margin-bottom: 18px; }
.period { display: inline-flex; gap: 4px; padding: 4px; border-radius: var(--bq2-r-pill); background: var(--bq2-bg-elev); border: 1px solid var(--bq2-line); max-width: 100%; overflow-x: auto; }
.period__b { border: 0; background: transparent; padding: 8px 14px; min-height: 40px; border-radius: var(--bq2-r-pill); font: inherit; font-size: .85rem; font-weight: 700; color: var(--bq2-ink-soft); cursor: pointer; white-space: nowrap; }
.period__b.on { background: var(--bq2-accent); color: var(--bq2-accent-ink); }
.period__b:focus-visible { outline: 2px solid var(--bq2-accent); outline-offset: 2px; }
.period-sum { margin: 0; font-size: .9rem; font-weight: 700; color: var(--bq2-ink); }
.wine-link { border: 0; background: none; padding: 6px 0; font: inherit; font-weight: 700; color: var(--bq2-ink); text-align: left; cursor: pointer; min-height: 32px; text-decoration: underline; text-decoration-color: var(--bq2-line); text-underline-offset: 3px; }
.wine-link:hover { color: var(--bq2-accent); text-decoration-color: var(--bq2-accent); }
.wine-link:focus-visible { outline: 2px solid var(--bq2-accent); outline-offset: 2px; border-radius: 4px; }
#stats-body tr { cursor: pointer; }
.trend { width: min(760px, 100%); max-height: calc(100dvh - 32px); overflow-y: auto; background: var(--bq2-bg-elev); border-radius: var(--bq2-r-m); box-shadow: var(--bq2-shadow-lg); padding: 22px 24px 24px; outline: none; overscroll-behavior: contain; }
.trend__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.trend__head h2 { margin: 0; font-size: 1.2rem; font-weight: 800; }
.trend__sub { margin: 4px 0 0; font-size: .82rem; color: var(--bq2-ink-soft); }
.trend__head .drawer__close { flex: none; width: 40px; height: 40px; }
.trend__tools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.trend__tools .seg { margin: 0; }
.trend__lbl { font-size: .8rem; font-weight: 700; color: var(--bq2-ink-soft); }
.tchart__legend { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.tchart__lg { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 4px 12px; border: 1px solid var(--bq2-line); border-radius: var(--bq2-r-pill); background: var(--bq2-bg-elev); font: inherit; font-size: .8rem; font-weight: 600; color: var(--bq2-ink); cursor: pointer; }
.tchart__lg b { font-variant-numeric: tabular-nums; color: var(--bq2-ink-soft); }
.tchart__lg.is-off { opacity: .5; text-decoration: line-through; }
.tchart__lg:focus-visible, .tchart__plot:focus-visible { outline: 2px solid var(--bq2-accent); outline-offset: 2px; border-radius: 6px; }
.tchart__plot { position: relative; width: 100%; touch-action: pan-y; }
.tchart__plot[hidden], .tchart__empty[hidden], .tchart__note[hidden] { display: none; }
.tchart__tip { position: absolute; pointer-events: none; background: var(--bq2-bg-elev); border: 1px solid var(--bq2-line); border-radius: 12px; box-shadow: var(--bq2-shadow); padding: 8px 12px; font-size: .78rem; display: grid; gap: 3px; min-width: 150px; z-index: 2; }
.tchart__tip[hidden] { display: none; }
.tchart__tip strong { font-size: .8rem; }
.tchart__row { display: flex; align-items: center; gap: 6px; }
.tchart__row i { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.tchart__row b { margin-left: auto; padding-left: 12px; font-variant-numeric: tabular-nums; }
.tchart__empty { display: grid; place-items: center; min-height: 160px; border: 1px dashed var(--bq2-line); border-radius: var(--bq2-r-m); color: var(--bq2-ink-soft); font-size: .92rem; }
.tchart__note { margin: 8px 0 0; font-size: .8rem; color: var(--bq2-warn); }

/* QR del restaurante, por mesa y diseñador (D8) */
.qr-rest { display: flex; gap: 20px; align-items: center; padding: 20px 22px; flex-wrap: wrap; }
.qr-rest__qr { width: 132px; height: 132px; flex: none; border: 1px solid var(--bq2-line); border-radius: 14px; overflow: hidden; background: #fff; }
.qr-rest__qr svg { display: block; width: 100%; height: 100%; }
.qr-rest__info { min-width: 0; flex: 1 1 260px; }
.qr-rest__lead { margin: 0 0 6px; font-weight: 600; }
.qr-url { margin: 0 0 12px; font-size: .82rem; color: var(--bq2-ink-soft); word-break: break-all; }
.qr-url code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.qr-rest__act, .qd__act { display: flex; flex-wrap: wrap; gap: 8px; }
.qr-add { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: end; padding: 16px 22px 0; }
.qr-add .btn { min-height: 46px; }
#tab-qr .staff-msg { margin-inline: 22px; }
.qr-list { list-style: none; margin: 10px 0 0; padding: 0 22px 10px; }
.qr-row { display: flex; align-items: center; gap: 14px; padding: 12px 0; border-top: 1px solid var(--bq2-line); flex-wrap: wrap; }
.qr-row__qr { width: 60px; height: 60px; flex: none; border: 1px solid var(--bq2-line); border-radius: 10px; overflow: hidden; background: #fff; }
.qr-row__qr svg { display: block; width: 100%; height: 100%; }
.qr-row__who { min-width: 0; flex: 1 1 160px; display: flex; flex-direction: column; }
.qr-row__who b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qr-row__who span { font-size: .76rem; color: var(--bq2-ink-faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qr-row__act { display: flex; flex-wrap: wrap; gap: 2px 14px; align-items: center; }
.qr-row__edit { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; flex: 1 1 260px; }
.qr-row__edit input { flex: 1 1 160px; min-width: 0; font: inherit; padding: 10px 12px; min-height: 44px; border: 1.5px solid var(--bq2-line); border-radius: var(--bq2-r-s); background: var(--bq2-bg); box-sizing: border-box; }
.qr-row__edit input:focus-visible { outline: 2px solid var(--bq2-accent); outline-offset: 1px; }
.qd { padding: 20px 22px 24px; }
.qd__grid { display: grid; gap: 22px; grid-template-columns: minmax(0, 1fr); }
.qd__prev { display: grid; gap: 8px; align-content: start; justify-items: center; }
.qd__sheet { width: 100%; max-width: 360px; background: var(--bq2-bg-sunken); border-radius: 14px; padding: 14px; box-sizing: border-box; display: grid; place-items: center; }
.qd__sheet svg { display: block; width: 100%; height: auto; max-height: 60vh; box-shadow: 0 6px 22px rgba(60, 40, 30, .18); }
.qd__meta { margin: 0; font-size: .8rem; color: var(--bq2-ink-soft); text-align: center; }
.qd__ctl { display: grid; gap: 16px; align-content: start; min-width: 0; }
.qd-f { display: grid; gap: 8px; }
.qd-f__l { font-weight: 600; font-size: .85rem; color: var(--bq2-ink-soft); }
.qd .seg { margin: 0; flex-wrap: wrap; border-radius: var(--bq2-r-m); }
.qd .seg button { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; }
.qd-shape { display: inline-block; border: 1.8px solid currentColor; border-radius: 2px; flex: none; }
.qd-shape--qr { width: 12px; height: 12px; border-style: dotted; }
.qd-shape--square { width: 13px; height: 13px; }
.qd-shape--portrait { width: 10px; height: 15px; }
.qd-shape--landscape { width: 16px; height: 10px; }
.qd-pal { display: flex; flex-wrap: wrap; gap: 10px; }
.qd-sw { width: 48px; height: 48px; border-radius: 12px; border: 2px solid var(--bq2-line); background: var(--sw-bg); color: var(--sw-ink); font: inherit; font-weight: 800; cursor: pointer; display: grid; place-items: center; }
.qd-sw.on { border-color: var(--bq2-accent); box-shadow: 0 0 0 2px var(--bq2-accent); }
.qd-sw:focus-visible { outline: 2px solid var(--bq2-ink); outline-offset: 3px; }
.qd-text { display: grid; gap: 10px; }
.qd-text[hidden], .qd-table[hidden] { display: none; }
.qd__note { margin: 0; font-size: .82rem; color: var(--bq2-ink-soft); min-height: 1.2em; }
@media (min-width: 900px) {
  .qd__grid { grid-template-columns: minmax(280px, 380px) minmax(0, 1fr); }
  .qd__prev { position: sticky; top: 16px; align-self: start; }
}

/* Personal (D9): tres zonas por fila (quién · píldoras · acciones) */
.staff-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 8px 16px; align-items: center; padding: 12px 0; border-top: 1px solid var(--bq2-line); }
.staff-row__tags { display: flex; gap: 6px; align-items: center; }
.staff-row__act { display: flex; flex-wrap: wrap; gap: 0 12px; align-items: center; justify-content: flex-end; }
.staff-row__who .staff-row__date { font-size: .74rem; color: var(--bq2-ink-faint); white-space: normal; }
.staff-row__edit { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; min-width: 0; }
.staff-row__edit input { flex: 1 1 180px; min-width: 0; font: inherit; padding: 10px 12px; min-height: 44px; border: 1.5px solid var(--bq2-line); border-radius: var(--bq2-r-s); background: var(--bq2-bg); box-sizing: border-box; }
.staff-row__edit input:focus-visible { outline: 2px solid var(--bq2-accent); outline-offset: 1px; }
.staff-row__mail { font-size: .78rem; color: var(--bq2-ink-soft); }
.staff-row__btns { display: inline-flex; gap: 8px; }
.staff-rm { justify-self: auto; margin-left: 0; }
@media (max-width: 640px) {
  .staff-row { grid-template-columns: minmax(0, 1fr); }
  .staff-row__act { justify-content: flex-start; }
  .qr-add { grid-template-columns: minmax(0, 1fr); }
  .qr-add .btn { justify-self: start; }
  .qr-rest, .qr-list, .qd { padding-inline: 16px; }
  .trend { padding: 18px 16px 20px; }
  .modal-ov:has(.trend) { place-items: end center; padding: 0; }
  .modal-ov:has(.trend) .trend { border-radius: var(--bq2-r-m) var(--bq2-r-m) 0 0; max-height: 92dvh; width: 100%; }
}

/* Vista previa de la cabecera del comensal (D10b): MISMO fondo claro que la cabecera real (--bq2-bg) */
.live-head { margin-top: 10px; padding: 16px 18px 14px; border-radius: var(--bq2-r-m); background: var(--bq2-bg); border: 1px solid var(--bq2-line); color: var(--bq2-ink); text-align: center; max-width: 420px; }
.live-head__brand { display: flex; justify-content: center; align-items: center; }
.live-head img.rlogo { height: 42px; width: auto; }
.live-head .brand-mark { font-size: 1rem; }
.live-head__sub { margin-top: 6px; font-size: .85rem; color: var(--bq2-ink-soft); min-height: 1.2em; }
.live-head__pw { margin-top: 4px; font-size: .68rem; color: var(--bq2-ink-faint); }
.live-head__pw b { color: var(--bq2-ink-soft); }
.live-head__msg { margin-top: 12px; padding: 10px 14px; border-radius: 16px 16px 16px 6px; background: var(--bq2-bg-elev); border: 1px solid var(--bq2-line); font-size: .85rem; text-align: left; line-height: 1.4; }

@media print { #print-root { display: block; } }

/* ════════════ Tanda 3 (2026-10-31) ════════════ */

/* Pestañas por tipo (Carta de vinos): etiqueta y contador en dos cajas con la MISMA altura de línea y centrado flex.
   Causa raíz del desalineo: el contador (.74rem) era texto en línea suelto junto a texto de .85rem dentro de un flex; sus cajas de línea
   tenían alturas distintas y la menor quedaba más alta. Ahora ambos son inline-flex con line-height:1 y centrados. */
.chip { display: inline-flex; align-items: center; gap: 8px; line-height: 1; }
.chip__t { display: inline-flex; align-items: center; line-height: 1; }
.chip__n { display: inline-flex; align-items: center; justify-content: center; line-height: 1; min-width: 22px; height: 22px; padding: 0 7px; box-sizing: border-box;
  border-radius: var(--bq2-r-pill); background: var(--bq2-bg-sunken); color: var(--bq2-ink-soft); opacity: 1; font-size: .74rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.chip.on .chip__n { background: rgba(255, 255, 255, .22); color: var(--bq2-accent-ink); opacity: 1; }

/* Resumen: cabecera del periodo */
.res-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin: 0 0 14px; }
.res-head h2 { margin: 0; font-size: 1.05rem; font-weight: 800; }
.res-head .link-reset { margin-left: auto; }

/* Estado vacío y alta reciente en la carta */
.empty-card { text-align: center; padding: 40px 24px; background: var(--bq2-bg-elev); border: 1px dashed var(--bq2-line); border-radius: var(--bq2-r-m); }
.empty-card h3 { margin: 0 0 6px; font-size: 1.1rem; }
.empty-card p { margin: 0 auto 18px; max-width: 46ch; color: var(--bq2-ink-soft); font-size: .92rem; }
.wine.is-new { border-color: var(--bq2-accent); box-shadow: 0 0 0 3px var(--bq2-accent-soft), var(--bq2-shadow); }
.wine:focus-visible { outline: 2px solid var(--bq2-accent); outline-offset: 2px; }

/* Añadir vino (cajón) */
.aw-intro p { margin: 0 0 8px; color: var(--bq2-ink-soft); font-size: .9rem; line-height: 1.45; }
.aw-note { margin: 0; padding: 10px 14px; border-radius: var(--bq2-r-s); background: var(--bq2-bg-sunken); color: var(--bq2-ink); font-size: .85rem; line-height: 1.45; }
.aw-note--pending { background: #fff3d6; color: #6e4a0e; }
.aw-q input { width: 100%; box-sizing: border-box; }
.aw-hint { margin: 4px 0 0; color: var(--bq2-ink-soft); font-size: .88rem; }
.aw-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.aw-item { display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; gap: 12px; align-items: center; width: 100%; text-align: left; font: inherit; color: inherit;
  padding: 10px 12px; background: var(--bq2-bg-elev); border: 1px solid var(--bq2-line); border-radius: var(--bq2-r-m); cursor: pointer; transition: border-color .16s; }
.aw-item:hover:not([disabled]) { border-color: var(--bq2-accent); }
.aw-item:focus-visible { outline: 2px solid var(--bq2-accent); outline-offset: 2px; }
.aw-item[disabled] { opacity: .6; cursor: not-allowed; }
.aw-item__img, .aw-pick__img { width: 48px; height: 64px; display: grid; place-items: center; background: var(--bq2-photo-bg); border: 1px solid var(--bq2-photo-line); border-radius: 10px; overflow: hidden; }
.aw-item__img img, .aw-pick__img img { max-height: 58px; width: auto; max-width: 100%; }
.aw-item__t { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.aw-item__t b { overflow-wrap: anywhere; }
.aw-item__t small { color: var(--bq2-ink-soft); font-size: .78rem; }
.aw-item__tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; align-items: center; }
.aw-item__pct { font-size: .74rem; font-weight: 700; color: var(--bq2-ink-faint); font-variant-numeric: tabular-nums; }
.aw-own { display: grid; gap: 8px; justify-items: start; padding-top: 6px; border-top: 1px solid var(--bq2-line); }
.aw-own p { margin: 0; }
.aw-pick { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 14px; align-items: center; padding: 12px; background: var(--bq2-bg-elev); border: 1px solid var(--bq2-line); border-radius: var(--bq2-r-m); }
.aw-pick__img { width: 64px; height: 86px; }
.aw-pick__img img { max-height: 78px; }
.aw-pick__t { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.aw-pick__t > span { color: var(--bq2-ink-soft); font-size: .85rem; }
.aw-pick__g { font-size: .78rem; }
.aw-block { display: grid; gap: 12px; }
.aw-h { margin: 0; font-size: .82rem; text-transform: uppercase; letter-spacing: .04em; color: var(--bq2-ink-soft); }
.aw-rules-p { margin: 6px 0 4px; font-size: .82rem; color: var(--bq2-ink-soft); }
.field-err[hidden] { display: none; }

/* QR: botones unificados + formato de descarga */
.btn-ghost--danger { color: var(--bq2-danger); border-color: rgba(163, 48, 40, .35); }
.btn-ghost--danger:hover { border-color: var(--bq2-danger); }
.qr-fmt { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 14px; margin: 0 0 16px; }
.qr-fmt .seg { margin: 0; }
.qr-row__act { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.qr-row__edit .btn, .qr-rest__act .btn, .qd__act .btn { white-space: nowrap; }

/* Diseñar cartel */
.qd__global { margin: 0 0 16px; padding: 10px 14px; border-radius: var(--bq2-r-s); background: var(--bq2-bg-sunken); font-size: .85rem; color: var(--bq2-ink); line-height: 1.45; }
.qd-lbl { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.qd-count { font-size: .74rem; font-weight: 700; color: var(--bq2-ink-faint); font-variant-numeric: tabular-nums; }
.qd__warn { margin: 0; font-size: .82rem; color: var(--bq2-warn); min-height: 0; }
.qd__warn:empty { display: none; }
.qd-switch { display: flex; align-items: center; gap: 10px; min-height: 40px; cursor: pointer; font-size: .88rem; font-weight: 600; }
.qd-switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.qd-switch__track { position: relative; flex: none; width: 40px; height: 24px; border-radius: var(--bq2-r-pill); background: var(--bq2-line); transition: background .18s; }
.qd-switch__track i { position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform .18s; }
.qd-switch input:checked + .qd-switch__track { background: var(--bq2-accent); }
.qd-switch input:checked + .qd-switch__track i { transform: translateX(16px); }
.qd-switch input:focus-visible + .qd-switch__track { outline: 2px solid var(--bq2-accent); outline-offset: 2px; }
.qd-switch input:disabled ~ * { opacity: .5; cursor: not-allowed; }
@media (prefers-reduced-motion: reduce) { .qd-switch__track, .qd-switch__track i { transition: none; } }

/* Personal: tabla alineada; la fila abre la ficha */
.staff-form { grid-template-columns: 1.4fr 1fr 1fr auto; }
.staff-wrap { padding: 8px 18px 8px; overflow-x: auto; }
.staff-tb { width: 100%; border-collapse: separate; border-spacing: 0; table-layout: fixed; }
.staff-tb th { text-align: left; font-size: .76rem; font-weight: 700; color: var(--bq2-ink-faint); text-transform: uppercase; letter-spacing: .04em; padding: 8px 12px; border-bottom: 1px solid var(--bq2-line); }
.staff-tb th:nth-child(1) { width: 52%; }
.staff-tb th:nth-child(2) { width: 24%; }
.staff-tb th:nth-child(3) { width: 24%; }
.staff-tb td { padding: 12px; vertical-align: middle; border-bottom: 1px solid var(--bq2-line); }
.staff-tb tr:last-child td { border-bottom: 0; }
.staff-tb td .tag { vertical-align: middle; }
.staff-who { display: flex; flex-direction: column; min-width: 0; text-align: left; }
.staff-who b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.staff-who span { font-size: .8rem; color: var(--bq2-ink-soft); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.staff-row--link { cursor: pointer; transition: background .16s; }
.staff-row--link:hover, .staff-row--link:focus-within { background: var(--bq2-accent-soft); }
.staff-row--link:hover td:first-child, .staff-row--link:focus-within td:first-child { border-top-left-radius: 12px; border-bottom-left-radius: 12px; }
.staff-row--link:hover td:last-child, .staff-row--link:focus-within td:last-child { border-top-right-radius: 12px; border-bottom-right-radius: 12px; }
.staff-open { display: block; width: 100%; max-width: 100%; margin: 0; padding: 0; border: 0; background: none; font: inherit; color: inherit; text-align: left; cursor: pointer; }
.staff-open:focus-visible { outline: 2px solid var(--bq2-accent); outline-offset: 4px; border-radius: 6px; }
.stf-top { display: flex; align-items: center; gap: 14px; }
.stf-avatar { flex: none; width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; background: var(--bq2-accent-soft); color: var(--bq2-accent); font-weight: 800; font-size: 1.3rem; }
.stf-top__n { font-size: 1.05rem; overflow-wrap: anywhere; }
.seg--stf { margin: 0; }
.stf-state { display: grid; gap: 10px; padding: 14px; border: 1px solid var(--bq2-line); border-radius: var(--bq2-r-m); background: var(--bq2-bg-elev); }
.stf-state__row { display: flex; align-items: center; gap: 8px; }
.stf-state__p { margin: 0; color: var(--bq2-ink-soft); font-size: .86rem; line-height: 1.45; }
.stf-state .btn { justify-self: start; }

@media (max-width: 760px) {
  .staff-form { grid-template-columns: minmax(0, 1fr); }
  .staff-wrap { padding: 8px 14px; overflow: visible; }
  /* la tabla degrada a tarjetas legibles: cada fila, un bloque con sus etiquetas */
  .staff-tb, .staff-tb tbody { display: block; }
  .staff-tb thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .staff-tb tr { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 12px; padding: 12px 14px; margin: 0 0 10px; border: 1px solid var(--bq2-line); border-radius: var(--bq2-r-m); background: var(--bq2-bg-elev); }
  .staff-tb td { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 0; border: 0; }
  .staff-tb td:first-child { grid-column: 1 / -1; }
  .staff-tb td::before { content: attr(data-label); font-size: .68rem; font-weight: 700; color: var(--bq2-ink-faint); text-transform: uppercase; letter-spacing: .04em; }
  .staff-tb td:first-child::before { display: none; }
  .staff-row--link:hover td:first-child, .staff-row--link:focus-within td:first-child, .staff-row--link:hover td:last-child, .staff-row--link:focus-within td:last-child { border-radius: 0; }
  .res-head .link-reset { margin-left: 0; }
  .qr-row__act { width: 100%; }
}

@media (min-width: 761px) { .staff-tb tr.staff-row { display: table-row; padding: 0; border-top: 0; } }

/* ═══ Fase 3 · bloque B (1.9, 1.10, 1.13) ═══ */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* 1.9 · «Cl por copa» / «Copas por botella»: la pastilla compacta sustituye al título del campo (mismo tamaño que una etiqueta) */
.seg--sm { padding: 2px; gap: 2px; margin: 0; }
.seg--sm button { padding: 0 8px; min-height: 28px; height: 28px; line-height: 1; font-size: .74rem; white-space: nowrap; }
.gu { gap: 6px; }
.gu .gu__seg { align-self: flex-start; }
.gu input { width: 100%; box-sizing: border-box; }
.gu__eq { font-size: .78rem; min-height: 1.2em; }
.gu__eq.is-error { color: var(--bq2-danger); font-weight: 600; }

/* 1.10 · Agotados en el Resumen */
.soldout { margin-top: 20px; }
.soldout__list { list-style: none; margin: 0; padding: 8px 16px 14px; display: grid; gap: 8px; }
.soldout__row { display: grid; grid-template-columns: 54px 1fr auto; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--bq2-line); }
.soldout__row:last-child { border-bottom: 0; }
.soldout__img { width: 54px; height: 72px; display: grid; place-items: center; background: var(--bq2-photo-bg); border: 1px solid var(--bq2-photo-line); border-radius: var(--bq2-r-s); overflow: hidden; }
.soldout__img img { max-height: 66px; width: auto; }
.soldout__main { display: grid; min-width: 0; }
.soldout__main b { font-size: .95rem; overflow-wrap: anywhere; }
.soldout__main small { color: var(--bq2-ink-soft); }
@media (max-width: 560px) { .soldout__row { grid-template-columns: 54px 1fr; } .soldout__row .btn { grid-column: 1 / -1; justify-self: start; } }

/* Banda «operando como soporte» con «Volver al backoffice» y «Salir» (mockup 16; el selector de 1.13 lo sustituye el backoffice) */
.support-bar { position: sticky; top: 0; z-index: 30; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 14px; margin: 0 0 14px; padding: 10px 16px;
  border-radius: var(--bq2-r-m); background: var(--bq2-ink); color: var(--bq2-bg-elev); font-size: .9rem; }
.support-bar b { font-weight: 800; }
.support-bar .btn { border-color: currentColor; color: inherit; background: transparent; min-height: 40px; }
.support-bar__acts { display: flex; gap: 8px; flex-wrap: wrap; }
.support-bar .btn-light { background: var(--bq2-bg-elev); color: var(--bq2-ink); border-color: transparent; }
.support-bar .btn-light:hover { background: var(--bq2-accent-soft); }
@media (max-width: 760px) { .support-bar__acts { width: 100%; } .support-bar__acts .btn { flex: 1; } }
