/* Panel de sala: lectura rápida, alto contraste, sobrio */
body.sala { background: #f3f1ee; color: #1c1a18; font-size: 15px; }
.ayuda { color: #5d5650; font-size: .9rem; }
.error { color: var(--error); font-weight: 600; min-height: 1.2em; margin: 6px 0; }
code { background: #e7e3dd; padding: 1px 5px; border-radius: 4px; }

.login { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: var(--escena); }
.login-caja { width: min(380px, 100%); background: #fff; border-radius: 18px; padding: 28px; display: grid; gap: 10px; }
.login-marca { font-size: .78rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--acento-papel); }
.login-caja h1 { font-size: 1.8rem; }
.login-caja input { min-height: 50px; border: 2px solid #cfc8bf; border-radius: 12px; padding: 0 14px; font-size: 1.2rem; letter-spacing: .3em; }
.volver-portada { text-align: center; font-size: .9rem; color: #5d5650; }

.fecha-nav { display: flex; align-items: center; gap: 4px; }
.fecha-nav input { min-height: 40px; border-radius: 10px; border: 1px solid #5a514a; background: #24201c; color: var(--escena-texto); padding: 0 8px; color-scheme: dark; }
.icono { width: 40px; height: 40px; border-radius: 10px; border: 1px solid #5a514a; background: transparent; color: var(--escena-texto); font-size: 1.3rem; cursor: pointer; }
.btn-chico { min-height: 40px; padding: 0 12px; border-radius: 10px; border: 1px solid currentColor; background: transparent; cursor: pointer; font-weight: 600; }
.btn-chico-alto { min-height: 42px; padding: 0 16px; font-size: .95rem; }

.contador { background: var(--acento); color: var(--sobre-acento); border-radius: 999px; padding: 0 7px; font-size: .78rem; margin-left: 4px; }

.vistas { max-width: 1200px; margin: 0 auto; padding: 16px; }
.vista-cab { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 6px; }
.vista-cab h2 { font-size: 1.4rem; }

.filtros { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.filtros button { min-height: 40px; padding: 0 14px; border-radius: 999px; border: 1px solid #cfc8bf; background: #fff; font-weight: 700; cursor: pointer; }
.filtros button[aria-pressed="true"] { background: #1c1a18; color: #fff; border-color: #1c1a18; }

.servicio-bloque { background: #fff; border: 1px solid #e2dcd4; border-radius: 16px; margin-bottom: 18px; overflow: hidden; }
.sb-cab { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 8px; padding: 14px 16px 6px; }
.sb-cab h2 { font-size: 1.35rem; }
.sb-cab .horas { color: #6a625b; font-size: .9rem; margin-left: 8px; font-family: var(--fuente-texto); font-weight: 500; }
.kpis { display: flex; gap: 16px; font-size: .9rem; color: #4a433d; }
.kpis b { color: #1c1a18; font-size: 1.05rem; }

.ocupacion { display: flex; gap: 3px; padding: 6px 16px 14px; overflow-x: auto; }
.franja { flex: 1 0 54px; display: grid; gap: 3px; text-align: center; font-size: .72rem; color: #5d5650; }
.franja .barra-oc { height: 44px; border-radius: 6px; background: #ece7e0; position: relative; overflow: hidden; display: flex; flex-direction: column-reverse; }
.franja .oc { background: #c98a3a; }
.franja .bl { background: repeating-linear-gradient(45deg, #9a928a 0 4px, #b9b1a8 4px 8px); }
.franja .num { font-weight: 700; color: #1c1a18; font-size: .78rem; }
.leyenda { display: flex; gap: 14px; padding: 0 16px 10px; font-size: .78rem; color: #5d5650; flex-wrap: wrap; }
.leyenda i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; vertical-align: -2px; margin-right: 4px; }

.tabla { width: 100%; border-collapse: collapse; }
.tabla th { text-align: left; font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; color: #6a625b; padding: 8px 10px; border-top: 1px solid #ece7e0; background: #faf8f5; }
.tabla td { padding: 10px; border-top: 1px solid #ece7e0; vertical-align: middle; }
.tabla tr.inactiva td { color: #8d857d; }
.tabla tr.inactiva .t-nombre { text-decoration: line-through; }
.t-hora { font-weight: 800; font-size: 1.05rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.t-hora small { display: block; font-weight: 500; color: #8d857d; font-size: .75rem; }
.t-nombre { font-weight: 700; }
.t-notas { font-size: .82rem; color: #6a625b; max-width: 260px; }
.t-mesa { font-weight: 700; white-space: nowrap; }
.canal { font-size: .75rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: #efeae3; color: #4a433d; white-space: nowrap; }
.canal.online { background: #e7eef8; color: #1f4a7a; }
.estado-sel { min-height: 38px; border-radius: 10px; border: 2px solid #d4ccc2; padding: 0 8px; font-weight: 700; background: #fff; }
.estado-sel.confirmada { border-color: #c98a3a; }
.estado-sel.llegada { border-color: var(--ok); background: var(--ok-fondo); }
.estado-sel.completada { border-color: #8d857d; }
.estado-sel.cancelada, .estado-sel.no_asistio { border-color: #c9b9b5; color: #8d3a30; }
.vacio-sala { padding: 18px 16px; color: #6a625b; }

@media (max-width: 760px) {
  .tabla thead { display: none; }
  .tabla, .tabla tbody, .tabla tr, .tabla td { display: block; }
  .tabla tr { display: grid; grid-template-columns: auto 1fr auto; gap: 4px 12px; padding: 12px 14px; border-top: 1px solid #ece7e0; }
  .tabla td { border: 0; padding: 0; }
  .tabla td.c-hora { grid-row: span 2; }
  .tabla td.c-nombre { grid-column: 2; }
  .tabla td.c-pers { grid-column: 3; text-align: right; }
  .tabla td.c-mesa { grid-column: 2; }
  .tabla td.c-canal { grid-column: 3; text-align: right; }
  .tabla td.c-estado { grid-column: 1 / 3; }
  .tabla td.c-acc { grid-column: 3; text-align: right; }
}

.pedido { background: #fff; border: 1px solid #e2dcd4; border-radius: 14px; padding: 14px 16px; margin-bottom: 10px; display: grid; gap: 6px; }
.pedido-cab { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.pedido-num { font-family: ui-monospace, Menlo, Consolas, monospace; font-weight: 800; font-size: 1.1rem; }
.pedido ul { margin: 0; padding-left: 18px; }
.pedido .total { font-weight: 800; }
.chip-prueba { font-size: .72rem; font-weight: 800; background: #fbefd9; color: #6b4610; padding: 2px 8px; border-radius: 999px; }

.bloqueo { display: flex; justify-content: space-between; align-items: center; gap: 10px; background: #fff; border: 1px solid #e2dcd4; border-left: 5px solid #9a928a; border-radius: 12px; padding: 12px 14px; margin-bottom: 8px; }
.tarjeta-form, .dialogo form { display: grid; gap: 10px; }
.tarjeta-form { background: #fff; border: 1px solid #e2dcd4; border-radius: 16px; padding: 16px; margin-top: 16px; max-width: 720px; }
.tarjeta-form h3, .dialogo h2 { font-family: var(--fuente-titulos); font-size: 1.3rem; }
label { display: grid; gap: 4px; font-weight: 700; font-size: .9rem; }
label small { font-weight: 500; color: #6a625b; }
.tarjeta-form input, .tarjeta-form select, .dialogo input, .dialogo select, .dialogo textarea { min-height: 44px; border: 2px solid #d4ccc2; border-radius: 10px; padding: 0 10px; background: #fff; font-weight: 500; width: 100%; }
.dialogo textarea { padding: 8px 10px; }
.fila { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }

.dialogo { width: min(560px, calc(100% - 20px)); border: 0; border-radius: 18px; padding: 20px; max-height: 92vh; }
.dialogo::backdrop { background: rgba(20,18,16,.55); }
.acciones { display: flex; justify-content: flex-end; gap: 8px; margin-top: 6px; }

.embudo { width: 100%; border-collapse: collapse; background: #fff; border-radius: 14px; overflow: hidden; }
.embudo th, .embudo td { padding: 10px 12px; border-top: 1px solid #ece7e0; text-align: right; font-variant-numeric: tabular-nums; }
.embudo th:first-child, .embudo td:first-child { text-align: left; }
.embudo thead th { background: #faf8f5; font-size: .78rem; text-transform: uppercase; color: #6a625b; }
.config-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.config-grid section { background: #fff; border: 1px solid #e2dcd4; border-radius: 14px; padding: 14px; }
.config-grid h3 { font-family: var(--fuente-texto); font-size: 1rem; margin-bottom: 8px; }
.config-grid table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.config-grid td, .config-grid th { padding: 6px; border-top: 1px solid #f0ebe4; text-align: left; }

.toasts { position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%); display: grid; gap: 8px; z-index: 60; width: min(480px, calc(100% - 24px)); }
.toast { background: #1c1a18; color: #fff; padding: 12px 16px; border-radius: 12px; box-shadow: var(--sombra); animation: subir 180ms var(--curva); }
.toast.mal { background: #7a231b; }
@keyframes subir { from { transform: translateY(12px); opacity: 0; } }

/* Informe y tickets (loop 8) */
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; margin: 12px 0 18px; }
.kpi { background: #fff; border: 1px solid #e3dcd2; border-radius: 12px; padding: 12px; display: grid; gap: 2px; }
.kpi-t { font-size: .8rem; color: #6b635c; font-weight: 600; }
.kpi strong { font-size: 1.5rem; font-variant-numeric: tabular-nums; }
.kpi small { color: #6b635c; }
#medicion h3, #impresoras-admin h3 { margin: 18px 0 8px; font-size: 1.05rem; }
.barras { display: flex; align-items: flex-end; gap: 6px; height: 140px; padding: 8px 0 22px; overflow-x: auto; }
.barra-h { position: relative; width: 26px; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; }
.barra-h i { display: block; width: 100%; background: var(--acento, #c2410c); border-radius: 4px 4px 0 0; min-height: 2px; }
.barra-h span { position: absolute; bottom: -20px; font-size: .75rem; color: #6b635c; }
.barra-h b { font-size: .7rem; }
.tickets { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 14px; }
.ticket { margin: 0; background: #fffdf8; border: 1px solid #e3dcd2; border-radius: 6px; box-shadow: 0 2px 8px rgba(0,0,0,.06); }
.ticket figcaption { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 8px 10px; border-bottom: 1px dashed #d4ccc2; font-size: .8rem; font-weight: 600; }
.ticket pre { margin: 0; padding: 10px 12px; font: 12px/1.35 ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace; white-space: pre; overflow-x: auto; }
.ticket pre .grande { font-weight: 800; font-size: 15px; }
.ticket.t-error, .ticket.t-pendiente { border-color: #e7b9a6; }
