/* ======================================================================
 * ASU RICO · ETAPA 14
 * Mobile-first para perfiles operativos y Control de mesas
 * ====================================================================== */

/* Acciones rápidas: reemplaza botones heredados que se veían comprimidos. */
.rest-quick-actions {
  display: flex;
  align-items: stretch;
  justify-content: flex-end;
  gap: 10px;
}
.rest-quick-action {
  min-width: 142px;
  min-height: 58px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border: 1px solid #dbe7e8;
  border-radius: 14px;
  background: #fff;
  color: #164e55;
  box-shadow: 0 5px 14px rgba(8, 51, 68, .07);
  text-decoration: none !important;
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.rest-quick-action:hover,
.rest-quick-action:focus {
  color: #0f766e;
  border-color: #9bd5d1;
  box-shadow: 0 8px 18px rgba(8, 51, 68, .11);
  transform: translateY(-1px);
}
.rest-quick-icon {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: #e8f8f6;
  color: #0f766e;
  font-size: 16px;
}
.rest-quick-action strong,
.rest-quick-action small { display: block; }
.rest-quick-action strong { font-size: 13px; line-height: 1.15; }
.rest-quick-action small { margin-top: 3px; color: #64748b; font-size: 10px; font-weight: 600; }
.rest-quick-action-admin .rest-quick-icon { background: #eef2ff; color: #4f46e5; }

/* Los indicadores ahora también son filtros táctiles. */
button.rest-summary-card {
  width: 100%;
  text-align: left;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  outline: 0;
  font-family: inherit;
}
button.rest-summary-card.active {
  border-color: #0f766e;
  box-shadow: 0 0 0 2px rgba(15, 118, 110, .13), 0 8px 18px rgba(8, 51, 68, .07);
}
button.rest-summary-card:focus-visible { box-shadow: 0 0 0 3px rgba(15, 118, 110, .2); }

/* Navegación inferior: solo se muestra en teléfonos/tablets pequeñas. */
.asurico-mobile-nav { display: none; }

@media (max-width: 767px) {
  body.asurico-operativo {
    padding-bottom: 76px;
    background: #f6faf9;
  }

  /* AdminLTE ya usa sidebar off-canvas en móvil; reforzamos el área útil. */
  body.asurico-operativo .content-wrapper,
  body.asurico-operativo .main-footer {
    margin-left: 0 !important;
  }

  body.asurico-operativo .content-wrapper {
    min-height: calc(100vh - 50px) !important;
    padding-bottom: 10px;
  }

  .asurico-mobile-nav {
    position: fixed;
    z-index: 1100;
    left: max(8px, env(safe-area-inset-left));
    right: max(8px, env(safe-area-inset-right));
    bottom: max(8px, env(safe-area-inset-bottom));
    min-height: 62px;
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 1fr;
    align-items: stretch;
    padding: 5px;
    border: 1px solid rgba(15, 118, 110, .14);
    border-radius: 18px;
    background: rgba(255, 255, 255, .97);
    box-shadow: 0 12px 30px rgba(8, 51, 68, .18);
    backdrop-filter: blur(12px);
  }
  .asurico-mobile-nav a {
    min-width: 0;
    min-height: 50px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    border-radius: 13px;
    color: #64748b;
    text-decoration: none !important;
    font-size: 10px;
    font-weight: 800;
    line-height: 1;
  }
  .asurico-mobile-nav a i { font-size: 18px; }
  .asurico-mobile-nav a.active {
    background: #e6f7f4;
    color: #0f766e;
  }

  /* Encabezado de Control de Mesas */
  .rest-mobile-page-heading {
    padding: 14px 12px 9px !important;
    gap: 12px !important;
  }
  .rest-heading-copy .rest-eyebrow { font-size: 10px; letter-spacing: .09em; }
  .rest-mobile-page-heading h1 {
    margin: 3px 0 4px;
    font-size: 22px !important;
    line-height: 1.15;
  }
  .rest-mobile-page-heading h1 i { margin-right: 4px; }
  .rest-mobile-page-heading p {
    max-width: 520px;
    font-size: 12.5px;
    line-height: 1.35;
  }

  .rest-quick-actions {
    width: 100%;
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
  }
  .rest-quick-action {
    min-width: 0;
    min-height: 58px;
    padding: 9px 10px;
    border-radius: 14px;
  }
  .rest-quick-action:nth-child(3):last-child { grid-column: 1 / -1; }
  .rest-quick-icon {
    width: 36px;
    height: 36px;
    flex-basis: 36px;
  }
  .rest-quick-action strong { font-size: 12.5px; }
  .rest-quick-action small { display: none; }

  .rest-operation-page .panel-medio {
    padding-left: 10px !important;
    padding-right: 10px !important;
  }

  /* Indicadores compactos, 2 columnas; el último ocupa todo el ancho. */
  .rest-operation-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 8px !important;
    margin-bottom: 10px !important;
  }
  .rest-operation-summary .rest-summary-card:last-child:nth-child(odd) {
    grid-column: 1 / -1;
  }
  .rest-summary-card {
    min-height: 74px !important;
    padding: 11px 12px !important;
    border-radius: 13px !important;
  }
  .rest-summary-card span { font-size: 11px !important; }
  .rest-summary-card strong { margin-top: 3px !important; font-size: 23px !important; }
  .rest-summary-card > i { right: 10px !important; bottom: 9px !important; font-size: 25px !important; }

  /* Filtros y búsqueda optimizados para dedo. */
  .rest-operation-box { border-radius: 15px !important; overflow: hidden; }
  .rest-operation-toolbar {
    padding: 10px !important;
    gap: 9px !important;
  }
  .rest-area-filters {
    width: 100%;
    gap: 7px;
    padding-bottom: 1px;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
  }
  .rest-area-filters::-webkit-scrollbar { display: none; }
  .btn-rest-filter {
    min-height: 40px;
    padding: 8px 12px !important;
    scroll-snap-align: start;
    font-size: 11px !important;
  }
  .rest-table-search { width: 100% !important; }
  .rest-table-search .form-control {
    height: 44px;
    padding-left: 38px !important;
    border-radius: 12px !important;
    font-size: 14px;
  }
  .rest-table-search i { top: 14px !important; left: 14px !important; }

  .rest-operation-box > .box-body { padding: 10px !important; }
  .rest-status-legend {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px 10px !important;
    margin: 0 0 10px !important;
    padding: 8px 9px;
    border-radius: 11px;
    background: #f8fafc;
    font-size: 11px !important;
  }

  /* Una mesa por fila: lectura rápida con una mano. */
  .rest-operation-grid {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
  }
  .rest-operation-table {
    min-height: 0 !important;
    display: grid !important;
    grid-template-columns: 66px minmax(0, 1fr);
    column-gap: 11px;
    row-gap: 5px;
    padding: 11px !important;
    border-radius: 15px !important;
    border-top-width: 4px !important;
    transform: none !important;
  }
  .rest-operation-table:hover { transform: none !important; }
  .rest-operation-table-head {
    grid-column: 1 / -1;
    margin-bottom: 2px;
  }
  .rest-table-area { max-width: 60%; font-size: 9px !important; }
  .rest-table-state { padding: 4px 8px !important; font-size: 9px !important; }
  .rest-table-round {
    grid-column: 1;
    grid-row: 2 / span 2;
    width: 62px !important;
    height: 62px !important;
    margin: 3px 0 0 !important;
    border-width: 6px !important;
  }
  .rest-table-round i { font-size: 17px !important; }
  .rest-table-round strong { margin-top: 2px !important; font-size: 10px !important; }
  .rest-operation-table h3 {
    grid-column: 2;
    margin: 2px 0 0 !important;
    text-align: left !important;
    font-size: 17px !important;
    line-height: 1.15;
  }
  .rest-operation-meta {
    grid-column: 2;
    min-height: 0 !important;
    gap: 3px !important;
    font-size: 11px !important;
  }
  .rest-operation-meta span { min-width: 0; }
  .rest-operation-total {
    grid-column: 1 / -1;
    margin: 7px 0 2px !important;
    padding-top: 8px !important;
  }
  .rest-operation-total strong { font-size: 18px !important; }
  .rest-operation-table > .btn,
  .rest-operation-table > a.btn {
    grid-column: 1 / -1;
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    margin-top: 5px;
    border-radius: 12px !important;
    font-size: 14px;
    font-weight: 900;
  }
  .rest-operation-table > .btn i,
  .rest-operation-table > a.btn i { font-size: 15px; }

  .rest-operation-table.is-delayed::after {
    top: 31px !important;
    right: -35px !important;
  }

  .rest-no-results { padding: 25px 10px !important; }

  /* Modal Abrir mesa: ocupa casi toda la pantalla y botones grandes. */
  #modalAbrirPedidoMesa .modal-dialog {
    width: auto !important;
    margin: 12px !important;
  }
  #modalAbrirPedidoMesa .modal-content { border-radius: 17px !important; overflow: hidden; }
  #modalAbrirPedidoMesa .modal-header { padding: 14px 15px !important; }
  #modalAbrirPedidoMesa .modal-title { font-size: 18px; font-weight: 800; }
  #modalAbrirPedidoMesa .modal-body { padding: 14px 15px !important; }
  #modalAbrirPedidoMesa label { font-size: 13px; }
  #modalAbrirPedidoMesa .form-control { min-height: 46px; border-radius: 11px; font-size: 16px; }
  #modalAbrirPedidoMesa textarea.form-control { min-height: 74px; }
  #modalAbrirPedidoMesa .modal-footer {
    display: grid;
    grid-template-columns: 1fr 1.35fr;
    gap: 8px;
    padding: 12px 15px 15px !important;
  }
  #modalAbrirPedidoMesa .modal-footer .btn {
    width: 100%;
    min-height: 48px;
    margin: 0 !important;
    border-radius: 11px !important;
    font-weight: 800;
  }

  /* La nota técnica no debe robar espacio en operación móvil. */
  .rest-operation-page .rest-stage-alert { margin-top: 10px; font-size: 11px; }
}

@media (max-width: 370px) {
  .rest-quick-actions { grid-template-columns: 1fr; }
  .rest-quick-action:nth-child(3):last-child { grid-column: auto; }
  .rest-operation-summary { grid-template-columns: 1fr 1fr !important; }
  .asurico-mobile-nav a { font-size: 9px; }
}

/* ======================================================================
 * ASU RICO · ETAPA 15
 * Pedido de mesa 100% táctil + modales legibles + cambio de mesa directo
 * ====================================================================== */

/* Acciones principales del pedido: eliminamos dropdowns pequeños. */
.rest-order-actions-mobile {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  justify-content: flex-end;
  gap: 8px;
}
.rest-order-action {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 13px;
  border: 1px solid transparent;
  border-radius: 11px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 900;
  line-height: 1.1;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(15,23,42,.07);
}
.rest-order-action i { font-size: 14px; }
.rest-order-action b {
  min-width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: rgba(255,255,255,.22);
  font-size: 10px;
}
.rest-order-action-secondary { background:#fff; color:#0f5f63; border-color:#cfe2e3; }
.rest-order-action-primary { background:#0f766e; color:#fff; border-color:#0f766e; }
.rest-order-action-charge { background:#5b2cff; color:#fff; border-color:#5b2cff; }
.rest-order-action-wide { min-width: 190px; }
.rest-order-action:disabled { opacity:.48; cursor:not-allowed; box-shadow:none; }
.rest-order-action:not(:disabled):hover,
.rest-order-action:not(:disabled):focus { filter:brightness(.98); outline:0; transform:translateY(-1px); }

/* Selección visual de mesa de destino. */
.rest-move-help { margin:0 0 12px; color:#64748b; font-size:13px; line-height:1.45; }
.rest-destination-list { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:9px; }
.rest-destination-option {
  width:100%; min-height:76px; display:flex; align-items:center; gap:10px;
  padding:10px; border:2px solid #e2e8f0; border-radius:13px; background:#fff;
  color:#17212b; text-align:left; cursor:pointer; outline:0;
}
.rest-destination-icon {
  width:42px; height:42px; flex:0 0 42px; display:flex; align-items:center; justify-content:center;
  border-radius:12px; background:#ecfdf5; color:#0f766e; font-size:17px;
}
.rest-destination-copy { flex:1; min-width:0; display:flex; flex-direction:column; }
.rest-destination-copy small { color:#64748b; font-size:9px; font-weight:800; text-transform:uppercase; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.rest-destination-copy strong { margin-top:2px; color:#17212b; font-size:14px; line-height:1.15; }
.rest-destination-copy em { margin-top:3px; color:#16803d; font-size:10px; font-style:normal; font-weight:800; }
.rest-destination-check { color:#0f766e; font-size:18px; opacity:0; transform:scale(.8); transition:.15s ease; }
.rest-destination-option.active { border-color:#0f766e; background:#effcf8; box-shadow:0 0 0 3px rgba(15,118,110,.12); }
.rest-destination-option.active .rest-destination-check { opacity:1; transform:scale(1); }

/* En las presentaciones, el check solo aparece cuando realmente se eligió una. */
.rest-presentation-option b { opacity:0; transform:scale(.8); transition:.14s ease; }
.rest-presentation-option.active b { opacity:1; transform:scale(1); }
.rest-presentation-option.active { border-width:2px !important; }

@media (max-width: 767px) {
  /* La barra inferior no debe aparecer encima de un modal. */
  body.modal-open .asurico-mobile-nav { display:none !important; }
  .asurico-mobile-nav { z-index:1030 !important; }

  /* Cabecera de pedido: el foco es mesa + acciones, sin botones diminutos. */
  .rest-order-page .rest-page-heading {
    padding:12px 12px 10px !important;
    gap:10px !important;
    background:#fff;
    border-bottom:1px solid #e7edf0;
  }
  .rest-order-heading .rest-back-link { font-size:11px; margin-bottom:4px; }
  .rest-order-heading .rest-eyebrow { font-size:9px; letter-spacing:.08em; }
  .rest-order-heading h1 {
    margin:3px 0 5px !important;
    font-size:21px !important;
    line-height:1.1 !important;
  }
  .rest-order-heading h1 small { font-size:10px !important; margin-left:4px; }
  .rest-order-heading p { gap:7px !important; margin:0 !important; font-size:11px; }

  .rest-order-actions-mobile {
    width:100%;
    display:grid !important;
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:8px;
  }
  .rest-order-action {
    width:100%; min-width:0; min-height:48px; padding:9px 8px;
    border-radius:12px; font-size:11.5px;
  }
  .rest-order-action i { font-size:15px; }
  .rest-order-action-charge,
  .rest-order-action-wide:last-child { grid-column:1 / -1; }

  /* Catálogo: más compacto para mostrar más productos sin perder legibilidad. */
  .rest-order-page .panel-medio { padding-left:8px !important; padding-right:8px !important; }
  .rest-order-layout > [class*="col-"] { padding-left:0 !important; padding-right:0 !important; }
  .rest-catalog-box,
  .rest-ticket-box { border-radius:15px !important; overflow:hidden; }
  .rest-catalog-header { padding:13px 12px !important; }
  .rest-catalog-header h3 { font-size:18px !important; }
  .rest-catalog-header small { font-size:12px !important; line-height:1.35; }
  .rest-product-search .form-control { min-height:44px; border-radius:12px !important; font-size:14px; }
  .rest-category-strip {
    display:flex !important; gap:7px; overflow-x:auto; margin-bottom:11px !important;
    padding:2px 0 5px; scrollbar-width:none; scroll-snap-type:x proximity;
  }
  .rest-category-strip::-webkit-scrollbar { display:none; }
  .rest-category-strip .btn-rest-category {
    flex:0 0 auto; min-height:38px; padding:7px 11px !important; border-radius:999px !important;
    font-size:10px !important; white-space:nowrap; scroll-snap-align:start;
  }
  .rest-product-grid { gap:9px !important; }
  .rest-product-card {
    min-height:94px !important; border-radius:13px !important; box-shadow:0 3px 10px rgba(15,23,42,.04);
  }
  .rest-product-image { flex-basis:82px !important; }
  .rest-product-copy { padding:9px !important; }
  .rest-product-copy strong { font-size:12.5px !important; -webkit-line-clamp:2 !important; }
  .rest-product-copy em { font-size:13.5px !important; }

  /* Modales operativos tipo panel móvil, siempre por encima y con alto contraste. */
  #modalAgregarProductoRest .modal-dialog,
  #modalDatosPedido .modal-dialog,
  #modalMoverPedido .modal-dialog,
  #modalFusionarPedido .modal-dialog,
  #modalIndicacionRest .modal-dialog {
    width:auto !important;
    margin:10px !important;
  }
  #modalAgregarProductoRest .modal-content,
  #modalDatosPedido .modal-content,
  #modalMoverPedido .modal-content,
  #modalFusionarPedido .modal-content,
  #modalIndicacionRest .modal-content {
    background:#fff !important;
    border-radius:18px !important;
    overflow:hidden;
    box-shadow:0 18px 44px rgba(15,23,42,.30) !important;
  }
  #modalAgregarProductoRest .modal-header,
  #modalDatosPedido .modal-header,
  #modalMoverPedido .modal-header,
  #modalFusionarPedido .modal-header,
  #modalIndicacionRest .modal-header {
    padding:14px 15px !important;
  }
  #modalAgregarProductoRest .modal-title,
  #modalDatosPedido .modal-title,
  #modalMoverPedido .modal-title,
  #modalFusionarPedido .modal-title,
  #modalIndicacionRest .modal-title { font-size:17px !important; }
  #modalAgregarProductoRest .modal-body,
  #modalDatosPedido .modal-body,
  #modalMoverPedido .modal-body,
  #modalFusionarPedido .modal-body,
  #modalIndicacionRest .modal-body {
    padding:14px !important;
    background:#fff !important;
    color:#17212b !important;
    max-height:calc(100vh - 185px);
    overflow-y:auto;
  }
  #modalAgregarProductoRest label,
  #modalDatosPedido label,
  #modalMoverPedido label,
  #modalFusionarPedido label { color:#27313c !important; font-size:13px !important; font-weight:800 !important; }
  #modalAgregarProductoRest .form-control,
  #modalDatosPedido .form-control,
  #modalMoverPedido .form-control,
  #modalFusionarPedido .form-control,
  #modalIndicacionRest .form-control {
    min-height:48px; border:1px solid #cbd5e1 !important; border-radius:11px !important;
    background:#fff !important; color:#17212b !important; font-size:16px !important;
  }
  #modalAgregarProductoRest textarea.form-control,
  #modalDatosPedido textarea.form-control,
  #modalIndicacionRest textarea.form-control { min-height:82px; }
  #modalAgregarProductoRest .modal-footer,
  #modalDatosPedido .modal-footer,
  #modalMoverPedido .modal-footer,
  #modalFusionarPedido .modal-footer,
  #modalIndicacionRest .modal-footer {
    display:grid !important; grid-template-columns:1fr 1.25fr; gap:8px;
    padding:11px 14px 14px !important; background:#f8fafc !important;
  }
  #modalAgregarProductoRest .modal-footer .btn,
  #modalDatosPedido .modal-footer .btn,
  #modalMoverPedido .modal-footer .btn,
  #modalFusionarPedido .modal-footer .btn,
  #modalIndicacionRest .modal-footer .btn {
    width:100%; min-height:48px; margin:0 !important; border-radius:11px !important; font-weight:900;
  }
  #modalAgregarProductoRest .rest-selected-product { margin:0 0 3px; font-size:17px; }
  #modalAgregarProductoRest .rest-selected-price { margin:0 0 13px; font-size:22px; color:#e14a2f; }

  .rest-presentation-list { gap:9px !important; }
  .rest-presentation-option {
    min-height:64px; padding:10px 11px !important; border-radius:12px !important;
    background:#fff !important;
  }
  .rest-presentation-option strong { font-size:14px !important; }
  .rest-presentation-option small { margin-top:3px !important; font-size:11px !important; }
  .rest-presentation-option.active {
    background:#ecfdf5 !important; border-color:#0f766e !important;
    box-shadow:0 0 0 3px rgba(15,118,110,.12) !important;
  }

  .rest-destination-list { grid-template-columns:1fr; gap:8px; }
  .rest-destination-option { min-height:70px; padding:9px 10px; }
  .rest-destination-copy strong { font-size:15px; }
  .rest-mobile-modal-actions { position:sticky; bottom:0; }
}

/* ================================================================
 * ETAPA 16 - FIX MODAL TÁCTIL / BACKDROP EN MÓVIL
 * El modal debe estar siempre por encima del backdrop de Bootstrap.
 * ================================================================ */
#modalAgregarProductoRest,
#modalIndicacionRest,
#modalDatosPedido,
#modalMoverPedido,
#modalFusionarPedido,
#modalAbrirPedidoMesa {
  z-index: 1060 !important;
  pointer-events: none;
}
#modalAgregarProductoRest.in,
#modalIndicacionRest.in,
#modalDatosPedido.in,
#modalMoverPedido.in,
#modalFusionarPedido.in,
#modalAbrirPedidoMesa.in,
#modalAgregarProductoRest.show,
#modalIndicacionRest.show,
#modalDatosPedido.show,
#modalMoverPedido.show,
#modalFusionarPedido.show,
#modalAbrirPedidoMesa.show {
  pointer-events: auto !important;
}
#modalAgregarProductoRest .modal-dialog,
#modalIndicacionRest .modal-dialog,
#modalDatosPedido .modal-dialog,
#modalMoverPedido .modal-dialog,
#modalFusionarPedido .modal-dialog,
#modalAbrirPedidoMesa .modal-dialog,
#modalAgregarProductoRest .modal-content,
#modalIndicacionRest .modal-content,
#modalDatosPedido .modal-content,
#modalMoverPedido .modal-content,
#modalFusionarPedido .modal-content,
#modalAbrirPedidoMesa .modal-content {
  position: relative;
  z-index: 1;
  pointer-events: auto !important;
  touch-action: manipulation;
}
/* ETAPA 17 HOTFIX
 * Bootstrap 3 usa modal=1050 y backdrop=1040. En ETAPA 16 el backdrop
 * quedó en 1050 y bloqueaba los modales generales (Usuarios, Productos, etc.).
 * Restauramos el nivel correcto del fondo oscuro. */
.modal-backdrop { z-index: 1040 !important; }
.modal.in, .modal.show { z-index: 1055 !important; }
.swal2-container { z-index: 20000 !important; }

/* Controles táctiles dentro del modal de producto. */
#modalAgregarProductoRest button,
#modalAgregarProductoRest input,
#modalAgregarProductoRest textarea,
#modalAgregarProductoRest .rest-presentation-option {
  pointer-events: auto !important;
  touch-action: manipulation;
}
#modalAgregarProductoRest .rest-presentation-option {
  position: relative;
  z-index: 2;
  cursor: pointer;
  -webkit-tap-highlight-color: rgba(15,118,110,.12);
}
#modalAgregarProductoRest .rest-presentation-option:active {
  transform: scale(.99);
}
#modalAgregarProductoRest .rest-presentation-option.active {
  background: #ecfdf5 !important;
  border-color: #0f766e !important;
  color: #17212b !important;
}
#modalAgregarProductoRest .rest-presentation-option.active b {
  opacity: 1 !important;
  color: #0f766e !important;
}

@media (max-width: 767px) {
  #modalAgregarProductoRest .modal-dialog {
    margin: 8px !important;
    min-height: calc(100vh - 16px);
    display: flex;
    align-items: center;
  }
  #modalAgregarProductoRest .modal-content {
    width: 100%;
    max-height: calc(100vh - 16px);
    display: flex;
    flex-direction: column;
  }
  #modalAgregarProductoRest form {
    display: flex;
    min-height: 0;
    flex: 1;
    flex-direction: column;
  }
  #modalAgregarProductoRest .modal-body {
    min-height: 0;
    flex: 1;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
  }
  #modalAgregarProductoRest .modal-footer {
    flex: 0 0 auto;
    position: relative !important;
    bottom: auto !important;
  }
}

/* ======================================================================
 * ASU RICO · ETAPA 18
 * Perfil CAJERO: monitor de cuentas + acceso directo al cobro
 * ====================================================================== */
.rest-cashier-heading .rest-heading-copy h1 i { color:#0f766e; }
.rest-quick-action-cashier { border-color:#b8e4cf; background:#f2fcf7; }
.rest-quick-action-cashier .rest-quick-icon { background:#dff7e9; color:#15803d; }
.rest-cashier-summary { grid-template-columns:repeat(3,minmax(0,1fr)) !important; }
.rest-cashier-legend { grid-template-columns:repeat(2,minmax(0,1fr)) !important; }
.rest-cashier-charge-btn {
  background:#15803d !important;
  border-color:#15803d !important;
  color:#fff !important;
  font-weight:900 !important;
}
.rest-cashier-charge-btn:hover,.rest-cashier-charge-btn:focus { background:#166534 !important; border-color:#166534 !important; }
.rest-cashier-wait-btn {
  opacity:1 !important;
  background:#f8fafc !important;
  color:#64748b !important;
  border:1px solid #dbe3ea !important;
  font-weight:800 !important;
  cursor:default !important;
}

@media (max-width:767px) {
  .rest-cashier-heading .rest-quick-actions { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .rest-cashier-summary {
    grid-template-columns:repeat(2,minmax(0,1fr)) !important;
  }
  .rest-cashier-summary .rest-summary-card:first-child {
    grid-column:1 / -1;
  }
  .rest-cashier-summary .rest-summary-card {
    min-height:76px !important;
  }
  .rest-cashier-legend {
    grid-template-columns:repeat(2,minmax(0,1fr)) !important;
  }
  .rest-cashier-charge-btn,
  .rest-cashier-wait-btn { min-height:50px !important; }

  /* Caja: una columna y controles táctiles. */
  .caja-rest-page .rest-header {
    padding:14px 12px 10px !important;
    gap:10px !important;
  }
  .caja-rest-page .rest-header h1 { font-size:22px !important; line-height:1.15; }
  .caja-rest-page .rest-header p { font-size:12.5px; line-height:1.4; }
  .caja-rest-page .rest-header-actions {
    width:100%; display:grid !important; grid-template-columns:1fr 1fr; gap:8px;
  }
  .caja-rest-page .rest-header-actions .btn { min-height:46px; margin:0 !important; border-radius:12px; font-weight:800; }
  .caja-rest-page .content { padding:10px !important; }
  .caja-rest-page .rest-safe-note { font-size:11.5px; line-height:1.4; padding:10px 12px; border-radius:12px; }
  .caja-rest-page .rest-caja-grid > [class*="col-"] { width:100% !important; float:none !important; }
  .caja-rest-page .rest-box { border-radius:15px; overflow:hidden; }
  .caja-rest-page .rest-cuentas-lista { max-height:none !important; }
  .caja-rest-page .rest-cuenta-card {
    min-height:82px; border-radius:13px; padding:11px 12px !important;
  }
  .caja-rest-page .rest-cuenta-total { font-size:19px !important; }
  .caja-rest-page #restCajaDetalle { scroll-margin-top:10px; }
  .caja-rest-page .rest-caja-resumen {
    display:grid !important; grid-template-columns:1fr 1fr; gap:8px; align-items:stretch;
  }
  .caja-rest-page .rest-caja-resumen > div,
  .caja-rest-page .rest-caja-resumen > a {
    min-height:54px; border-radius:11px; margin:0 !important;
  }
  .caja-rest-page .rest-caja-resumen #btnPrecuenta {
    display:flex; align-items:center; justify-content:center; gap:6px;
  }
  .caja-rest-page .rest-tabla-cobro { min-width:620px; }
  .caja-rest-page .rest-caja-quick { gap:7px; flex-wrap:wrap; }
  .caja-rest-page .rest-caja-quick .btn { min-height:42px; }
  .caja-rest-page .rest-caja-form [class*="col-"],
  .caja-rest-page .rest-cliente-caja [class*="col-"] { width:100% !important; float:none !important; }
  .caja-rest-page .form-control { min-height:46px; border-radius:10px; font-size:16px; }
  .caja-rest-page .rest-pago-row [class*="col-"] { width:100% !important; float:none !important; }
  .caja-rest-page .rest-pago-row .btn { width:100%; min-height:44px; }
  .caja-rest-page #btnEmitirCobro { width:100%; min-height:54px; border-radius:13px; font-size:15px; font-weight:900; }
}

/* ======================================================================
 * ETAPA 20 - Cuenta visible al entrar a una mesa (mobile-first)
 * ====================================================================== */
.rest-mobile-account-card { display:none; }

@media (max-width: 767px) {
  .rest-mobile-account-card {
    display:block;
    margin:0 0 12px;
    background:#fff;
    border:1px solid #cfe2e5;
    border-radius:16px;
    overflow:hidden;
    box-shadow:0 7px 20px rgba(15,23,42,.08);
  }
  .rest-mobile-account-head {
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:10px;
    padding:12px 13px 10px;
    background:linear-gradient(135deg,#f0fbfc,#ffffff);
    border-bottom:1px solid #e1ecee;
  }
  .rest-mobile-account-head > div:first-child {
    min-width:0;
    display:flex;
    flex-direction:column;
    gap:3px;
  }
  .rest-mobile-account-kicker {
    color:#0f766e;
    font-size:11px;
    font-weight:900;
    text-transform:uppercase;
    letter-spacing:.04em;
  }
  .rest-mobile-account-head strong {
    color:#334155;
    font-size:12px;
    font-weight:800;
  }
  .rest-mobile-account-total {
    flex:0 0 auto;
    min-width:104px;
    text-align:right;
  }
  .rest-mobile-account-total small {
    display:block;
    color:#64748b;
    font-size:10px;
    font-weight:800;
    text-transform:uppercase;
  }
  .rest-mobile-account-total b {
    display:block;
    color:#0b5563;
    font-size:23px;
    line-height:1.05;
    font-weight:950;
  }
  .rest-mobile-account-lines {
    max-height:174px;
    overflow-y:auto;
    -webkit-overflow-scrolling:touch;
    padding:3px 12px;
  }
  .rest-mobile-account-line {
    display:grid;
    grid-template-columns:34px minmax(0,1fr) auto;
    align-items:center;
    gap:7px;
    min-height:42px;
    padding:7px 0;
    border-bottom:1px dashed #e5eaee;
  }
  .rest-mobile-account-line:last-child { border-bottom:0; }
  .rest-mobile-account-qty {
    display:flex;
    align-items:center;
    justify-content:center;
    min-width:30px;
    height:28px;
    border-radius:8px;
    background:#ecf8f7;
    color:#0f766e;
    font-size:11px;
    font-weight:900;
  }
  .rest-mobile-account-name {
    min-width:0;
    color:#1f2937;
    font-size:12.5px;
    line-height:1.25;
    font-weight:750;
  }
  .rest-mobile-account-line > strong {
    color:#17212b;
    font-size:12.5px;
    white-space:nowrap;
  }
  .rest-mobile-account-empty {
    display:flex;
    align-items:center;
    gap:9px;
    padding:14px 13px;
    color:#64748b;
    font-size:12.5px;
  }
  .rest-mobile-account-empty i { color:#0f766e; }
  .rest-mobile-account-detail {
    display:flex;
    align-items:center;
    justify-content:center;
    gap:8px;
    min-height:44px;
    padding:9px 12px;
    border-top:1px solid #e1ecee;
    background:#f8fbfc;
    color:#0b5563 !important;
    font-size:12px;
    font-weight:900;
    text-decoration:none !important;
  }
  .rest-mobile-account-detail .fa-chevron-down { margin-left:auto; font-size:10px; }
  #restTicketCuentaActual { scroll-margin-top:10px; }

  /* La cuenta debe aparecer antes de avisos y antes de la carta en móvil. */
  .rest-order-page .panel-medio { padding-top:8px !important; }
}

/* ======================================================================
 * ASU RICO · ETAPA 25
 * Caja visual: comprobantes y pagos como botones llamativos
 * ====================================================================== */
.caja-rest-page .rest-caja-step-block{
  margin-top:16px;
  padding:16px;
  border:1px solid #dce9ea;
  border-radius:18px;
  background:linear-gradient(180deg,#ffffff 0%, #fbfefe 100%);
}
.caja-rest-page .rest-step-title{display:flex;align-items:flex-start;gap:12px;margin-bottom:14px;}
.caja-rest-page .rest-step-number{width:34px;height:34px;flex:0 0 34px;border-radius:50%;background:#0f766e;color:#fff;display:inline-flex;align-items:center;justify-content:center;font-weight:800;box-shadow:0 6px 14px rgba(15,118,110,.23);}
.caja-rest-page .rest-step-title h4{margin:0;font-size:24px;font-weight:800;color:#103240;}
.caja-rest-page .rest-step-title p{margin:2px 0 0;color:#64748b;font-size:13px;}
.caja-rest-page .rest-caja-label{display:block;margin:0 0 9px;font-size:13px;font-weight:800;color:#334155;}
.caja-rest-page .rest-choice-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;margin-bottom:14px;}
.caja-rest-page .rest-choice-btn{
  width:100%; border:1px solid #d8e4e7; background:#fff; color:#17404a; border-radius:18px; padding:14px 14px;
  display:flex; gap:12px; align-items:center; text-align:left; transition:.18s ease; box-shadow:0 4px 14px rgba(15,23,42,.05);
}
.caja-rest-page .rest-choice-btn:hover,.caja-rest-page .rest-choice-btn:focus{transform:translateY(-1px); border-color:#93d0ce; box-shadow:0 8px 18px rgba(15,118,110,.12);}
.caja-rest-page .rest-choice-btn.active{border-color:#0f766e;background:linear-gradient(135deg,#f1fcfb 0%,#e7faf7 100%);box-shadow:0 0 0 2px rgba(15,118,110,.15),0 10px 20px rgba(15,118,110,.08);}
.caja-rest-page .rest-choice-icon{width:44px;height:44px;flex:0 0 44px;border-radius:14px;background:#ecf8f7;color:#0f766e;display:inline-flex;align-items:center;justify-content:center;font-size:18px;}
.caja-rest-page .rest-choice-btn.active .rest-choice-icon{background:#0f766e;color:#fff;}
.caja-rest-page .rest-choice-copy strong,.caja-rest-page .rest-choice-copy small{display:block;}
.caja-rest-page .rest-choice-copy strong{font-size:14px;line-height:1.15;}
.caja-rest-page .rest-choice-copy small{font-size:11px;color:#64748b;margin-top:4px;}
.caja-rest-page .rest-doc-validate{display:flex;gap:8px;align-items:stretch;}
.caja-rest-page .rest-doc-validate .form-control{flex:1 1 auto;}
.caja-rest-page .rest-doc-validate .btn{min-width:106px;font-weight:800;border-radius:12px;}
.caja-rest-page .rest-paymethod-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;}
.caja-rest-page .rest-paymethod-btn{
  width:100%; border:1px solid #dae6ea; background:#fff; border-radius:16px; min-height:84px; padding:10px 8px;
  display:flex; flex-direction:column; align-items:center; justify-content:center; gap:8px; text-align:center;
  color:#124050; font-weight:800; font-size:12px; transition:.18s ease; box-shadow:0 4px 12px rgba(15,23,42,.04);
}
.caja-rest-page .rest-paymethod-btn:hover,.caja-rest-page .rest-paymethod-btn:focus{transform:translateY(-1px); border-color:#a9d6df; box-shadow:0 8px 18px rgba(17,24,39,.08);}
.caja-rest-page .rest-paymethod-btn.active{border-color:#3b82f6;background:linear-gradient(180deg,#eff6ff 0%,#eef9ff 100%);box-shadow:0 0 0 2px rgba(59,130,246,.13),0 10px 20px rgba(59,130,246,.08);}
.caja-rest-page .rest-paymethod-icon{width:40px;height:40px;border-radius:14px;background:#f1f5f9;color:#2563eb;display:inline-flex;align-items:center;justify-content:center;font-size:18px;}
.caja-rest-page .rest-paymethod-btn.active .rest-paymethod-icon{background:#2563eb;color:#fff;}
.caja-rest-page .rest-pay-logo{font-size:17px;font-weight:900;letter-spacing:.02em;}
.caja-rest-page .rest-paymethod-text{line-height:1.2;}
.caja-rest-page .rest-pago-row{padding:14px 14px 8px;border:1px solid #d9e8e8;border-radius:16px;background:#fff;margin-bottom:12px;}
.caja-rest-page .rest-pago-remove .btn{width:100%;min-height:42px;border-radius:12px;margin-top:0;}
.caja-rest-page .rest-pagos-total{margin-top:8px;font-size:18px;font-weight:800;color:#103240;text-align:right;}
.caja-rest-page .rest-caja-actions{display:flex;justify-content:flex-end;margin-top:18px;}
.caja-rest-page .rest-caja-actions .btn{min-height:52px;padding:12px 24px;border-radius:14px;font-weight:800;box-shadow:0 8px 20px rgba(22,163,74,.18);}
.caja-rest-page .rest-cliente-caja{margin-top:14px;padding:16px;border:1px solid #dce9ea;border-radius:18px;background:#fff;}
.caja-rest-page .rest-cliente-caja h4{margin:0 0 12px;color:#103240;font-size:22px;font-weight:800;}
.caja-rest-page .rest-caja-form.compact .form-group{margin-bottom:0;}

@media (max-width: 991px){
  .caja-rest-page .rest-choice-grid{grid-template-columns:1fr;}
  .caja-rest-page .rest-paymethod-grid{grid-template-columns:repeat(3,minmax(0,1fr));}
}
@media (max-width: 767px){
  .caja-rest-page .rest-caja-step-block,
  .caja-rest-page .rest-cliente-caja{padding:13px;border-radius:16px;}
  .caja-rest-page .rest-step-title h4{font-size:20px;}
  .caja-rest-page .rest-step-title p{font-size:12px;line-height:1.35;}
  .caja-rest-page .rest-choice-grid{grid-template-columns:1fr;gap:9px;}
  .caja-rest-page .rest-choice-btn{padding:12px;border-radius:15px;}
  .caja-rest-page .rest-paymethod-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;}
  .caja-rest-page .rest-paymethod-btn{min-height:74px;padding:9px 6px;font-size:11px;border-radius:14px;}
  .caja-rest-page .rest-paymethod-icon{width:34px;height:34px;font-size:16px;border-radius:12px;}
  .caja-rest-page .rest-doc-validate{flex-direction:column;}
  .caja-rest-page .rest-doc-validate .btn{width:100%;min-height:44px;}
  .caja-rest-page .rest-pago-row{padding:11px 11px 4px;border-radius:15px;}
  .caja-rest-page .rest-pagos-total{text-align:left;font-size:16px;}
  .caja-rest-page .rest-caja-actions{justify-content:stretch;}
  .caja-rest-page .rest-caja-actions .btn{width:100%;}
}

/* ======================================================================
 * ASU RICO · ETAPA 27
 * Imágenes centradas en medios de pago
 * ====================================================================== */
.caja-rest-page .rest-paymethod-btn{
  min-height: 112px;
  justify-content: flex-start;
  padding-top: 12px;
}
.caja-rest-page .rest-paymethod-icon{
  width: 68px;
  height: 68px;
  border-radius: 16px;
  background: #ffffff;
  border: 1px solid #e2eef3;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.8);
  overflow: hidden;
}
.caja-rest-page .rest-paymethod-btn.active .rest-paymethod-icon{
  background:#ffffff;
  color:inherit;
}
.caja-rest-page .rest-paymethod-img{
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center center;
  display: block;
  margin: 0 auto;
  padding: 6px;
}
.caja-rest-page .rest-paymethod-text{
  font-size: 12px;
  font-weight: 800;
  color: #103240;
}
@media (max-width: 767px){
  .caja-rest-page .rest-paymethod-btn{min-height:98px;padding-top:10px;}
  .caja-rest-page .rest-paymethod-icon{width:58px;height:58px;border-radius:14px;}
  .caja-rest-page .rest-paymethod-text{font-size:11px;}
}

/* ETAPA 27 · Formas de pago con imágenes centradas */
.caja-rest-page .rest-paymethod-grid{
  align-items:stretch;
}
.caja-rest-page .rest-paymethod-btn{
  justify-content:flex-start;
  padding:12px 10px;
  min-height:118px;
}
.caja-rest-page .rest-paymethod-art{
  width:68px;
  height:52px;
  display:flex;
  align-items:center;
  justify-content:center;
  margin:0 auto 4px auto;
}
.caja-rest-page .rest-paymethod-art img{
  max-width:100%;
  max-height:100%;
  object-fit:contain;
  display:block;
  margin:0 auto;
}
.caja-rest-page .rest-paymethod-art i{
  width:42px;
  height:42px;
  border-radius:12px;
  background:#eef2ff;
  color:#2563eb;
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:18px;
}
.caja-rest-page .rest-paymethod-text{
  display:block;
  width:100%;
  text-align:center;
  font-size:12px;
  font-weight:800;
  color:#1e293b;
}
.caja-rest-page .rest-paymethod-btn.active .rest-paymethod-text{
  color:#0f172a;
}
.caja-rest-page .rest-paymethod-btn.active .rest-paymethod-art{
  transform:scale(1.02);
}
.caja-rest-page .rest-pago-ref-wrap{transition:all .18s ease;}

@media (max-width: 767px){
  .caja-rest-page .rest-paymethod-btn{min-height:104px;padding:10px 8px;}
  .caja-rest-page .rest-paymethod-art{width:58px;height:44px;}
  .caja-rest-page .rest-paymethod-text{font-size:11px;}
}

/* ======================================================================
 * ASU RICO · ETAPA 28
 * Ajuste visual de Datos del cliente y limpieza de pasos 2 / 3
 * ====================================================================== */
.caja-rest-page .rest-cliente-caja,
.caja-rest-page .rest-caja-step-block{
  clear: both;
  position: relative;
  overflow: hidden;
}
.caja-rest-page .rest-section-title-client{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin-bottom:14px;
}
.caja-rest-page .rest-section-title-client h4{
  margin:0;
  display:flex;
  align-items:center;
  gap:8px;
  color:#103240;
  font-size:22px;
  font-weight:800;
}
.caja-rest-page .rest-client-status{
  display:inline-flex;
  align-items:center;
  gap:6px;
  padding:8px 12px;
  border-radius:999px;
  font-size:13px;
  font-weight:800;
  white-space:nowrap;
}
.caja-rest-page .rest-client-status-pending{background:#fff7ed;color:#9a3412;border:1px solid #fed7aa;}
.caja-rest-page .rest-client-status-ok{background:#ecfdf5;color:#166534;border:1px solid #bbf7d0;}
.caja-rest-page .rest-client-status-generic{background:#eff6ff;color:#1d4ed8;border:1px solid #bfdbfe;}
.caja-rest-page .rest-phone-field{display:flex;align-items:center;}
.caja-rest-page .rest-phone-prefix{
  height:42px; min-width:50px; padding:0 12px; display:inline-flex; align-items:center; justify-content:center;
  border:1px solid #d7e4e8; border-right:0; border-radius:12px 0 0 12px; background:#f8fbfc; color:#475569; font-weight:700;
}
.caja-rest-page .rest-phone-field .form-control{border-radius:0 12px 12px 0;}
.caja-rest-page .rest-envios-cliente{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin-top:6px;}
.caja-rest-page .rest-send-card{
  display:flex; align-items:center; gap:12px; padding:14px; border:1px solid #dbe6ea; border-radius:16px; background:#fff;
  text-decoration:none; color:#103240; cursor:pointer; transition:.18s ease; min-height:78px;
}
.caja-rest-page .rest-send-card:hover{border-color:#9ed7d2; box-shadow:0 8px 16px rgba(15,118,110,.08);}
.caja-rest-page .rest-send-card.disabled{opacity:.6; cursor:not-allowed; background:#f8fafc;}
.caja-rest-page .rest-send-card input{width:18px;height:18px;margin:0;flex:0 0 18px;}
.caja-rest-page .rest-send-icon{
  width:42px;height:42px;flex:0 0 42px;border-radius:14px;background:#eff8f7;color:#0f766e;display:inline-flex;align-items:center;justify-content:center;font-size:18px;
}
.caja-rest-page .rest-send-copy strong,.caja-rest-page .rest-send-copy small{display:block;line-height:1.2;}
.caja-rest-page .rest-send-copy strong{font-size:15px;font-weight:800;color:#103240;}
.caja-rest-page .rest-send-copy small{font-size:12px;color:#64748b;margin-top:4px;}
.caja-rest-page .rest-send-note{margin-top:10px;font-size:13px;color:#475569;display:flex;align-items:center;gap:8px;}
.caja-rest-page .rest-send-note i{color:#0f766e;}
/* defensivo contra números sueltos de pasos */
.caja-rest-page > section > .content > .container-fluid > .row > .col-xs-12 > .box-body > .rest-caja-contenido > .rest-cliente-caja + *:not(.rest-caja-step-block):not(.rest-caja-actions){display:none;}

@media (max-width: 767px){
  .caja-rest-page .rest-section-title-client{align-items:flex-start;flex-direction:column;}
  .caja-rest-page .rest-client-status{font-size:12px;padding:7px 11px;}
  .caja-rest-page .rest-envios-cliente{grid-template-columns:1fr;gap:10px;}
  .caja-rest-page .rest-send-card{padding:12px;min-height:72px;}
  .caja-rest-page .rest-send-icon{width:38px;height:38px;font-size:16px;border-radius:12px;}
  .caja-rest-page .rest-send-copy strong{font-size:14px;}
  .caja-rest-page .rest-send-copy small{font-size:11px;}
}


/* ======================================================================
 * ASU RICO · ETAPA 30
 * Mesero móvil: acciones simétricas + acceso inmediato al detalle consumo
 * ====================================================================== */
.rest-order-action-consumption {
  text-decoration: none !important;
}

/* El detalle inferior ahora es también un botón real, sin apariencia nativa. */
button.rest-mobile-account-detail {
  width: 100%;
  border: 0;
  outline: 0;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
}

/* Modal de consumo: pensado para consulta rápida del mesero. */
.rest-consumption-modal .modal-dialog {
  max-width: 520px;
}
.rest-consumption-modal-header {
  padding: 15px 17px 12px !important;
  border-bottom: 1px solid #e2ecee !important;
  background: linear-gradient(135deg,#eefbf9,#ffffff);
}
.rest-consumption-modal-kicker {
  display:block;
  margin-bottom:3px;
  color:#0f766e;
  font-size:9px;
  font-weight:900;
  letter-spacing:.10em;
}
.rest-consumption-modal-header .modal-title {
  margin:0;
  color:#16343d;
  font-size:20px;
  font-weight:900;
}
.rest-consumption-modal-header .modal-title small {
  margin-left:5px;
  color:#64748b;
  font-size:10px;
  font-weight:800;
}
.rest-consumption-modal-body { padding:14px !important; }
.rest-consumption-modal-summary {
  display:grid;
  grid-template-columns:1fr 1fr 1.2fr;
  gap:8px;
  margin-bottom:10px;
}
.rest-consumption-modal-summary > div {
  min-width:0;
  padding:9px 10px;
  border:1px solid #dce9ea;
  border-radius:12px;
  background:#f8fbfc;
}
.rest-consumption-modal-summary small {
  display:block;
  color:#64748b;
  font-size:9px;
  font-weight:800;
  text-transform:uppercase;
}
.rest-consumption-modal-summary strong {
  display:block;
  margin-top:2px;
  color:#17212b;
  font-size:12px;
  font-weight:900;
}
.rest-consumption-modal-summary .rest-consumption-modal-total {
  background:#ecf9f7;
  border-color:#bfe3de;
  text-align:right;
}
.rest-consumption-modal-summary .rest-consumption-modal-total strong {
  color:#0f766e;
  font-size:18px;
}
.rest-consumption-modal-list {
  max-height:42vh;
  overflow-y:auto;
  -webkit-overflow-scrolling:touch;
  border:1px solid #e1e8eb;
  border-radius:13px;
  background:#fff;
}
.rest-consumption-modal-line {
  display:grid;
  grid-template-columns:38px minmax(0,1fr) auto;
  align-items:center;
  gap:8px;
  min-height:50px;
  padding:9px 10px;
  border-bottom:1px dashed #e5eaee;
}
.rest-consumption-modal-line:last-child { border-bottom:0; }
.rest-consumption-modal-qty {
  display:inline-flex;
  align-items:center;
  justify-content:center;
  height:30px;
  border-radius:9px;
  background:#eaf8f6;
  color:#0f766e;
  font-size:11px;
  font-weight:900;
}
.rest-consumption-modal-copy { min-width:0; }
.rest-consumption-modal-copy strong {
  display:block;
  color:#1f2937;
  font-size:12.5px;
  line-height:1.25;
  font-weight:850;
}
.rest-consumption-modal-copy small {
  display:block;
  margin-top:3px;
  color:#64748b;
  font-size:10px;
  line-height:1.25;
}
.rest-consumption-modal-price {
  color:#17212b;
  font-size:12px;
  font-weight:900;
  white-space:nowrap;
}
.rest-consumption-modal-totals {
  margin-top:10px;
  padding:9px 11px;
  border-radius:12px;
  background:#f8fbfc;
}
.rest-consumption-modal-totals > div {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  padding:3px 0;
  color:#475569;
  font-size:11px;
}
.rest-consumption-modal-totals .rest-consumption-modal-grand {
  margin-top:5px;
  padding-top:8px;
  border-top:1px solid #dbe7e9;
  color:#103640;
  font-size:14px;
  font-weight:900;
}
.rest-consumption-modal-totals .rest-consumption-modal-grand strong {
  color:#0f766e;
  font-size:20px;
}
.rest-consumption-modal-empty {
  display:flex;
  align-items:center;
  gap:8px;
  padding:18px 12px;
  border:1px solid #e1e8eb;
  border-radius:12px;
  color:#64748b;
}
.rest-consumption-modal-footer {
  padding:10px 14px 14px !important;
  border-top:0 !important;
}

@media (max-width: 767px) {
  /*
   * La cabecera del pedido debe usar todo el ancho disponible.
   * Evita la sensación de que el bloque se "encoge".
   */
  .rest-order-page .rest-order-heading {
    width:100% !important;
    max-width:none !important;
    box-sizing:border-box !important;
    overflow:visible !important;
  }
  .rest-order-page .rest-order-heading > div:first-child {
    width:100%;
    min-width:0;
  }
  .rest-order-page .rest-order-actions-mobile {
    width:100% !important;
    min-width:0 !important;
    max-width:none !important;
    box-sizing:border-box !important;
    grid-template-columns:minmax(0,1fr) minmax(0,1fr) !important;
    gap:8px !important;
    align-items:stretch !important;
  }
  .rest-order-page .rest-order-action {
    width:100% !important;
    min-width:0 !important;
    max-width:none !important;
    min-height:56px !important;
    margin:0 !important;
    padding:10px 7px !important;
    box-sizing:border-box !important;
    overflow:hidden;
    white-space:normal;
    text-align:center;
  }
  .rest-order-page .rest-order-action span {
    min-width:0;
    line-height:1.15;
  }
  .rest-order-page .rest-order-action-charge,
  .rest-order-page .rest-order-action-wide:last-child {
    grid-column:1 / -1 !important;
    min-height:58px !important;
  }

  /* Cuando existe Unir mesas, Detalle consumo ocupa naturalmente el casillero contiguo. */
  .rest-order-action-consumption {
    background:#f8fbfc;
    color:#0b5563;
    border-color:#cfe2e3;
  }

  .rest-consumption-modal .modal-dialog {
    width:auto !important;
    margin:10px !important;
  }
  .rest-consumption-modal .modal-content {
    border-radius:17px !important;
    overflow:hidden;
  }
  .rest-consumption-modal-summary {
    grid-template-columns:1fr 1fr;
  }
  .rest-consumption-modal-summary .rest-consumption-modal-total {
    grid-column:1 / -1;
    display:flex;
    align-items:center;
    justify-content:space-between;
    text-align:left;
  }
  .rest-consumption-modal-list {
    max-height:47vh;
  }
}


/* ======================================================================
 * ASU RICO · ETAPA 31
 * FIX MODAL DETALLE CONSUMO BLOQUEADO POR BACKDROP
 * ====================================================================== */
#modalDetalleConsumoRest {
  z-index: 1060 !important;
  pointer-events: none;
}
#modalDetalleConsumoRest.in,
#modalDetalleConsumoRest.show {
  pointer-events: auto !important;
}
#modalDetalleConsumoRest .modal-dialog,
#modalDetalleConsumoRest .modal-content,
#modalDetalleConsumoRest button {
  position: relative;
  pointer-events: auto !important;
  touch-action: manipulation;
}
#modalDetalleConsumoRest .modal-dialog,
#modalDetalleConsumoRest .modal-content {
  z-index: 1;
}
/* Mantener el fondo oscuro debajo del modal. */
.modal-backdrop {
  z-index: 1040 !important;
}
#modalDetalleConsumoRest.in,
#modalDetalleConsumoRest.show {
  z-index: 1060 !important;
}


/* ======================================================================
 * ASU RICO · ETAPA 32
 * MESERO MOBILE-FIRST: BUSCADOR RAPIDO POR NUMERO DE MESA
 * ====================================================================== */
.rest-waiter-table-finder {
  display:none;
}

@media (max-width: 767px) {
  .rest-operation-page .panel-medio {
    padding-top: 8px !important;
  }

  .rest-waiter-table-finder {
    display:block;
    margin:0 0 10px;
    padding:11px;
    border:1px solid #bcdedb;
    border-radius:16px;
    background:linear-gradient(135deg,#effbf9 0%,#ffffff 72%);
    box-shadow:0 8px 20px rgba(15,118,110,.08);
  }

  .rest-waiter-table-finder-title {
    display:flex;
    align-items:center;
    gap:9px;
    margin-bottom:8px;
  }

  .rest-waiter-table-finder-icon {
    width:38px;
    height:38px;
    flex:0 0 38px;
    display:inline-flex;
    align-items:center;
    justify-content:center;
    border-radius:12px;
    background:#0f766e;
    color:#fff;
    font-size:16px;
    box-shadow:0 5px 12px rgba(15,118,110,.20);
  }

  .rest-waiter-table-finder-title strong,
  .rest-waiter-table-finder-title small {
    display:block;
    line-height:1.15;
  }

  .rest-waiter-table-finder-title strong {
    color:#12343d;
    font-size:15px;
    font-weight:900;
  }

  .rest-waiter-table-finder-title small {
    margin-top:3px;
    color:#64748b;
    font-size:10px;
    font-weight:700;
  }

  .rest-waiter-table-finder-control {
    position:relative;
    display:grid;
    grid-template-columns:auto minmax(0,1fr);
    align-items:center;
    min-height:54px;
    overflow:hidden;
    border:2px solid #9dd7d1;
    border-radius:15px;
    background:#fff;
    transition:border-color .16s ease, box-shadow .16s ease;
  }

  .rest-waiter-table-finder-control:focus-within {
    border-color:#0f766e;
    box-shadow:0 0 0 3px rgba(15,118,110,.12);
  }

  .rest-waiter-table-number-prefix {
    height:100%;
    display:flex;
    align-items:center;
    padding:0 10px 0 13px;
    color:#0f766e;
    background:#eef9f7;
    border-right:1px solid #d6ece9;
    font-size:12px;
    font-weight:900;
    letter-spacing:.05em;
  }

  .rest-waiter-table-finder-control .form-control {
    height:52px !important;
    min-width:0;
    padding:0 46px 0 12px !important;
    border:0 !important;
    border-radius:0 !important;
    background:#fff !important;
    color:#102f38;
    box-shadow:none !important;
    font-size:23px !important;
    font-weight:900;
    letter-spacing:.04em;
  }

  .rest-waiter-table-finder-control .form-control::placeholder {
    color:#a1adb5;
    font-size:16px;
    font-weight:700;
    letter-spacing:0;
  }

  .rest-waiter-table-clear {
    position:absolute;
    right:7px;
    top:50%;
    transform:translateY(-50%);
    width:38px;
    height:38px;
    padding:0;
    border:0;
    border-radius:11px;
    background:#eef2f4;
    color:#51616a;
    font-size:14px;
    touch-action:manipulation;
  }

  .rest-waiter-table-finder-result {
    display:flex;
    align-items:flex-start;
    gap:7px;
    min-height:24px;
    margin-top:8px;
    padding:6px 8px;
    border-radius:10px;
    background:#f8fafc;
    color:#64748b;
    font-size:10.5px;
    line-height:1.3;
  }

  .rest-waiter-table-finder-result i {
    margin-top:2px;
    color:#0f766e;
  }

  .rest-waiter-table-finder-result.is-found {
    background:#ecfdf5;
    color:#166534;
  }

  .rest-waiter-table-finder-result.is-found i {
    color:#16a34a;
  }

  .rest-waiter-table-finder-result.is-empty {
    background:#fff7ed;
    color:#9a3412;
  }

  .rest-waiter-table-finder-result.is-empty i {
    color:#ea580c;
  }

  /* Mientras el mesero busca, resaltar claramente la mesa encontrada. */
  .rest-operation-table.is-search-hit {
    border-color:#0f766e !important;
    box-shadow:0 0 0 3px rgba(15,118,110,.14), 0 10px 22px rgba(15,118,110,.12) !important;
  }

  .rest-operation-table.is-search-hit h3 {
    color:#0f766e !important;
  }
}


/* ======================================================================
 * ASU RICO · ETAPA 33
 * MOBILE-FIRST: UNIFICAR CONSUMO + CAMBIOS DESPUES DE COMANDA
 * ====================================================================== */
.rest-consumption-action-copy {
  display:flex;
  flex-direction:column;
  align-items:flex-start;
  gap:1px;
  min-width:0;
}
.rest-consumption-action-copy strong {
  font-size:inherit;
  font-weight:900;
  line-height:1.05;
}
.rest-consumption-action-copy small {
  color:#0f766e;
  font-size:10px;
  font-weight:900;
  line-height:1.05;
}
.rest-order-action-consumption {
  background:#f1fbfa;
  border-color:#b8ddda;
}

.rest-post-command-help {
  display:flex;
  align-items:flex-start;
  gap:9px;
  margin:0 0 10px;
  padding:9px 10px;
  border:1px solid #cde7e3;
  border-radius:12px;
  background:#f0faf8;
  color:#31545b;
}
.rest-post-command-help > i {
  flex:0 0 auto;
  margin-top:2px;
  color:#0f766e;
  font-size:15px;
}
.rest-post-command-help strong,
.rest-post-command-help span {
  display:block;
  line-height:1.3;
}
.rest-post-command-help strong {
  margin-bottom:4px;
  color:#153d45;
  font-size:11px;
  font-weight:900;
}
.rest-post-command-help span {
  margin-top:2px;
  font-size:9.5px;
}

.rest-consumption-modal-line {
  display:block !important;
  min-height:0 !important;
  padding:10px !important;
}
.rest-consumption-modal-line-main {
  display:grid;
  grid-template-columns:38px minmax(0,1fr) auto;
  align-items:center;
  gap:8px;
}
.rest-consumption-modal-name-row {
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:6px;
}
.rest-consumption-modal-name-row > strong {
  min-width:0;
}
.rest-consumption-state {
  flex:0 0 auto;
  display:inline-flex;
  align-items:center;
  gap:3px;
  padding:3px 5px;
  border-radius:999px;
  font-size:7.5px;
  line-height:1;
  font-weight:950;
  white-space:nowrap;
}
.rest-consumption-state.is-pending {
  background:#fff7ed;
  color:#b45309;
}
.rest-consumption-state.is-sent {
  background:#ecfdf5;
  color:#047857;
}
.rest-consumption-modal-actions {
  display:flex;
  align-items:center;
  flex-wrap:wrap;
  gap:6px;
  margin-top:8px;
  padding-top:8px;
  border-top:1px dashed #e3eaec;
}
.rest-consumption-qty-control {
  flex:0 0 auto;
}
.rest-consumption-action-btn {
  min-height:36px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:5px;
  padding:7px 9px;
  border:1px solid #d5e4e6;
  border-radius:10px;
  background:#fff;
  color:#31545b;
  font-size:9.5px;
  font-weight:900;
  touch-action:manipulation;
}
.rest-consumption-action-btn.is-danger {
  border-color:#fecaca;
  background:#fff7f7;
  color:#b91c1c;
}
.rest-consumption-locked,
.rest-consumption-auth-note {
  display:inline-flex;
  align-items:center;
  gap:5px;
  min-height:32px;
  padding:5px 7px;
  border-radius:9px;
  font-size:9px;
  font-weight:850;
}
.rest-consumption-locked {
  background:#f1f5f9;
  color:#64748b;
}
.rest-consumption-auth-note {
  margin-left:auto;
  background:#fff7ed;
  color:#9a3412;
}

@media (max-width: 767px) {
  /*
   * Un solo detalle de consumo para Mesero:
   * el modal de arriba reemplaza la tarjeta duplicada y el ticket lateral.
   */
  .rest-mobile-account-card {
    display:none !important;
  }
  .rest-order-page #restTicketCuentaActual {
    display:none !important;
  }

  .rest-order-action-consumption {
    justify-content:flex-start !important;
    padding-left:12px !important;
  }
  .rest-order-action-consumption > i {
    flex:0 0 auto;
  }
  .rest-consumption-action-copy {
    flex:1 1 auto;
  }

  #modalDetalleConsumoRest .modal-dialog {
    margin:6px !important;
  }
  #modalDetalleConsumoRest .modal-content {
    max-height:calc(100vh - 12px);
    display:flex;
    flex-direction:column;
  }
  #modalDetalleConsumoRest .modal-body {
    flex:1 1 auto;
    min-height:0;
    overflow-y:auto;
    -webkit-overflow-scrolling:touch;
  }
  .rest-consumption-modal-list {
    max-height:none !important;
    overflow:visible !important;
  }
  .rest-consumption-modal-actions {
    gap:5px;
  }
  .rest-consumption-action-btn {
    flex:1 1 auto;
    min-width:82px;
  }
  .rest-consumption-auth-note {
    width:100%;
    margin-left:0;
    justify-content:center;
  }
}


/* ======================================================================
 * ASU RICO · ETAPA 33 REVISADA
 * CAMBIO RAPIDO POST-COMANDA POR EL MESERO
 * ====================================================================== */
.rest-consumption-action-btn.is-change {
  border-color:#b7dcd8;
  background:#effaf8;
  color:#0f766e;
}
.rest-quick-change-banner {
  position:relative;
  display:flex;
  align-items:flex-start;
  gap:10px;
  margin:0 0 10px;
  padding:11px 42px 11px 11px;
  border:2px solid #0f766e;
  border-radius:15px;
  background:linear-gradient(135deg,#e9fbf8,#ffffff);
  box-shadow:0 8px 20px rgba(15,118,110,.12);
}
.rest-quick-change-icon {
  width:40px;height:40px;flex:0 0 40px;
  display:flex;align-items:center;justify-content:center;
  border-radius:12px;background:#0f766e;color:#fff;font-size:16px;
}
.rest-quick-change-copy {min-width:0;}
.rest-quick-change-copy small,
.rest-quick-change-copy strong,
.rest-quick-change-copy span {display:block;line-height:1.2;}
.rest-quick-change-copy small {color:#0f766e;font-size:8px;font-weight:950;letter-spacing:.08em;}
.rest-quick-change-copy strong {margin-top:2px;color:#153d45;font-size:13px;font-weight:950;}
.rest-quick-change-copy span {margin-top:3px;color:#64748b;font-size:9.5px;}
.rest-quick-change-cancel {
  position:absolute;right:8px;top:8px;width:32px;height:32px;
  border:0;border-radius:10px;background:#e8f1f1;color:#425b61;
  touch-action:manipulation;
}

@media (max-width:767px) {
  .rest-quick-change-banner {
    margin:0 0 8px;
    border-radius:14px;
  }
  .rest-consumption-modal-actions .rest-consumption-action-btn.is-change,
  .rest-consumption-modal-actions .rest-consumption-action-btn.is-danger {
    min-height:40px;
  }
  #modalAgregarProductoRest input[readonly] {
    background:#eef7f6 !important;
    color:#0f766e !important;
    font-weight:900;
  }
}


/* ======================================================================
 * ASU RICO · ETAPA 36
 * MESERO MOBILE-FIRST: SALONES VISUALMENTE DISTINTOS + FILTRO REAL
 * ====================================================================== */

/* Color del ambiente en cada tarjeta. El borde superior sigue siendo el estado. */
.rest-operation-table {
  border-left: 6px solid var(--rest-card-area-color, #0f766e) !important;
}

.rest-table-area {
  display:inline-flex !important;
  align-items:center;
  gap:5px;
  max-width:72% !important;
  padding:4px 7px !important;
  border:1px solid var(--area-color, #0f766e);
  border-radius:999px;
  background:#fff;
  color:#263c43 !important;
  font-weight:900 !important;
}

.rest-table-area::before {
  width:9px !important;
  height:9px !important;
  margin-right:0 !important;
  background:var(--area-color, #0f766e) !important;
}

.rest-table-area > i {
  color:var(--area-color, #0f766e);
  font-size:9px;
}

/* Filtros por salón usan el color propio configurado en Administración. */
#filtrosAreasMesas .btn-rest-filter {
  --rest-area-filter-color:#0f766e;
  display:inline-flex;
  align-items:center;
  gap:6px;
  border-width:2px !important;
  border-color:color-mix(in srgb, var(--rest-area-filter-color) 50%, #d8e2e5) !important;
  background:#fff !important;
  color:#243b43 !important;
}

#filtrosAreasMesas .btn-rest-filter > i {
  color:var(--rest-area-filter-color);
}

#filtrosAreasMesas .rest-area-filter-dot {
  width:11px !important;
  height:11px !important;
  margin:0 !important;
  background:var(--rest-area-filter-color) !important;
  box-shadow:0 0 0 3px color-mix(in srgb, var(--rest-area-filter-color) 15%, transparent);
}

#filtrosAreasMesas .rest-area-filter-label {
  white-space:nowrap;
}

#filtrosAreasMesas .rest-area-filter-count {
  min-width:22px;
  padding:2px 6px;
  border-radius:999px;
  background:#edf3f5;
  color:#42545b;
  font-size:9px;
  font-weight:900;
  text-align:center;
}

#filtrosAreasMesas .btn-rest-filter.active {
  border-color:var(--rest-area-filter-color) !important;
  background:var(--rest-area-filter-color) !important;
  color:#fff !important;
  box-shadow:0 5px 14px color-mix(in srgb, var(--rest-area-filter-color) 28%, transparent);
}

#filtrosAreasMesas .btn-rest-filter.active > i,
#filtrosAreasMesas .btn-rest-filter.active .rest-area-filter-label {
  color:#fff !important;
}

#filtrosAreasMesas .btn-rest-filter.active .rest-area-filter-dot {
  background:#fff !important;
  box-shadow:none;
}

#filtrosAreasMesas .btn-rest-filter.active .rest-area-filter-count {
  background:rgba(255,255,255,.22);
  color:#fff;
}

.rest-area-filter-feedback {
  display:none;
}

@media (max-width: 767px) {
  /* El selector de salón es operativo: grande, táctil y fácil de distinguir. */
  .rest-operation-toolbar {
    display:block !important;
  }

  .rest-area-filters {
    display:flex !important;
    width:100%;
    gap:7px !important;
    padding:2px 0 4px !important;
    overflow-x:auto;
    -webkit-overflow-scrolling:touch;
    scroll-snap-type:x proximity;
  }

  #filtrosAreasMesas .btn-rest-filter {
    min-height:46px !important;
    padding:8px 11px !important;
    font-size:11px !important;
    scroll-snap-align:start;
  }

  .rest-area-filter-feedback {
    display:flex;
    align-items:center;
    gap:7px;
    margin:7px 0 0;
    padding:8px 10px;
    border-radius:10px;
    background:#f1f7f8;
    color:#4b626a;
    font-size:10px;
    line-height:1.25;
  }

  .rest-area-filter-feedback i {
    color:#0f766e;
  }

  .rest-area-filter-feedback strong {
    color:#173c44;
  }

  /* En móvil la señal del salón queda muy visible a la izquierda. */
  .rest-operation-table {
    border-left-width:7px !important;
  }

  .rest-table-area {
    max-width:74% !important;
    font-size:9px !important;
  }
}


/* ======================================================================
 * ASU RICO · ETAPA 37
 * MOBILE-FIRST: FILTROS DE SALON SIN HORIZONTAL SCROLL
 * Aplica a MESERO y CAJERO.
 * ====================================================================== */
@media (max-width: 767px) {
  /*
   * Ya no usamos carrusel horizontal para los salones.
   * En pantallas angostas eso comprimía "Zona Exterior" / "Salón Principal"
   * y obligaba a deslizar lateralmente.
   */
  .rest-operation-page .rest-area-filters,
  .rest-operation-page #filtrosAreasMesas {
    display:grid !important;
    grid-template-columns:repeat(2, minmax(0, 1fr)) !important;
    gap:8px !important;
    width:100% !important;
    max-width:100% !important;
    padding:2px 0 4px !important;
    margin:0 !important;
    overflow:visible !important;
    scrollbar-width:none;
  }

  .rest-operation-page #filtrosAreasMesas::-webkit-scrollbar {
    display:none !important;
  }

  /*
   * "Todas" queda arriba ocupando todo el ancho.
   * Los salones se distribuyen debajo en 2 columnas y siguen bajando
   * automáticamente si en el futuro se agregan más ambientes.
   */
  .rest-operation-page #filtrosAreasMesas .btn-rest-filter[data-area="todas"] {
    grid-column:1 / -1 !important;
  }

  .rest-operation-page #filtrosAreasMesas .btn-rest-filter {
    width:100% !important;
    min-width:0 !important;
    max-width:none !important;
    min-height:50px !important;
    margin:0 !important;
    padding:8px 9px !important;
    display:grid !important;
    grid-template-columns:auto minmax(0,1fr) auto !important;
    align-items:center !important;
    justify-content:stretch !important;
    gap:7px !important;
    border-radius:14px !important;
    white-space:normal !important;
    overflow:hidden !important;
    text-align:left !important;
    box-sizing:border-box !important;
  }

  .rest-operation-page #filtrosAreasMesas .btn-rest-filter[data-area="todas"] {
    grid-template-columns:auto minmax(0,1fr) auto !important;
  }

  .rest-operation-page #filtrosAreasMesas .rest-area-filter-label {
    min-width:0 !important;
    overflow:hidden !important;
    text-overflow:ellipsis !important;
    white-space:normal !important;
    line-height:1.08 !important;
    font-size:11px !important;
    font-weight:900 !important;
  }

  .rest-operation-page #filtrosAreasMesas .rest-area-filter-count {
    min-width:26px !important;
    height:25px !important;
    padding:0 6px !important;
    display:inline-flex !important;
    align-items:center !important;
    justify-content:center !important;
    border-radius:999px !important;
    font-size:10px !important;
    line-height:1 !important;
    flex:0 0 auto !important;
  }

  .rest-operation-page #filtrosAreasMesas .rest-area-filter-dot {
    width:12px !important;
    height:12px !important;
    flex:0 0 12px !important;
  }

  .rest-operation-page #filtrosAreasMesas .btn-rest-filter > i {
    width:16px !important;
    text-align:center !important;
    flex:0 0 16px !important;
  }

  .rest-operation-page .rest-area-filter-feedback {
    margin-top:8px !important;
    min-height:38px !important;
    padding:8px 10px !important;
    border-radius:11px !important;
    font-size:10px !important;
  }
}

/* En móviles muy angostos, cada salón ocupa una fila completa. */
@media (max-width: 370px) {
  .rest-operation-page .rest-area-filters,
  .rest-operation-page #filtrosAreasMesas {
    grid-template-columns:1fr !important;
  }

  .rest-operation-page #filtrosAreasMesas .btn-rest-filter[data-area="todas"] {
    grid-column:1 !important;
  }

  .rest-operation-page #filtrosAreasMesas .btn-rest-filter {
    min-height:48px !important;
  }
}


/* ======================================================================
 * ASU RICO · ETAPA 38
 * FIX DEFINITIVO FILTROS DE SALON
 * La ETAPA 37 solo corregía <=767px. Esta corrección aplica también
 * a escritorio/tablet y elimina el carrusel horizontal en TODOS los tamaños.
 * ====================================================================== */

/* ---- BASE: escritorio, tablet y móvil ---- */
.rest-operation-page .rest-operation-toolbar {
  display:grid !important;
  grid-template-columns:minmax(0, 1fr) minmax(250px, 330px) !important;
  align-items:start !important;
  gap:12px !important;
  width:100% !important;
  box-sizing:border-box !important;
}

.rest-operation-page #filtrosAreasMesas,
.rest-operation-page .rest-area-filters {
  display:grid !important;
  grid-template-columns:repeat(auto-fit, minmax(155px, 1fr)) !important;
  align-items:stretch !important;
  gap:8px !important;
  width:100% !important;
  min-width:0 !important;
  max-width:none !important;
  margin:0 !important;
  padding:0 !important;
  overflow:visible !important;
  overflow-x:visible !important;
  white-space:normal !important;
  scroll-snap-type:none !important;
  scrollbar-width:none !important;
}

.rest-operation-page #filtrosAreasMesas::-webkit-scrollbar,
.rest-operation-page .rest-area-filters::-webkit-scrollbar {
  display:none !important;
  width:0 !important;
  height:0 !important;
}

.rest-operation-page #filtrosAreasMesas .btn-rest-filter {
  width:100% !important;
  min-width:0 !important;
  max-width:none !important;
  min-height:44px !important;
  margin:0 !important;
  padding:8px 10px !important;
  display:grid !important;
  grid-template-columns:auto minmax(0, 1fr) auto !important;
  align-items:center !important;
  justify-content:stretch !important;
  gap:7px !important;
  border-radius:12px !important;
  box-sizing:border-box !important;
  overflow:hidden !important;
  white-space:normal !important;
  text-align:left !important;
  line-height:1.15 !important;
}

.rest-operation-page #filtrosAreasMesas .rest-area-filter-label {
  min-width:0 !important;
  width:auto !important;
  display:block !important;
  overflow:visible !important;
  text-overflow:clip !important;
  white-space:normal !important;
  word-break:normal !important;
  line-height:1.1 !important;
  font-size:11px !important;
  font-weight:900 !important;
}

.rest-operation-page #filtrosAreasMesas .rest-area-filter-count {
  min-width:25px !important;
  height:24px !important;
  padding:0 6px !important;
  display:inline-flex !important;
  align-items:center !important;
  justify-content:center !important;
  margin:0 !important;
  flex:0 0 auto !important;
}

.rest-operation-page .rest-table-search {
  width:100% !important;
  min-width:0 !important;
  max-width:330px !important;
  justify-self:end !important;
  align-self:start !important;
}

/* ---- Tablet / ancho medio: búsqueda debajo, filtros completos arriba ---- */
@media (max-width: 1050px) {
  .rest-operation-page .rest-operation-toolbar {
    grid-template-columns:1fr !important;
  }

  .rest-operation-page .rest-table-search {
    max-width:none !important;
    justify-self:stretch !important;
  }

  .rest-operation-page #filtrosAreasMesas,
  .rest-operation-page .rest-area-filters {
    grid-template-columns:repeat(auto-fit, minmax(145px, 1fr)) !important;
  }
}

/* ---- Móvil ---- */
@media (max-width: 767px) {
  .rest-operation-page .rest-operation-toolbar {
    display:block !important;
    padding:10px !important;
  }

  .rest-operation-page #filtrosAreasMesas,
  .rest-operation-page .rest-area-filters {
    display:grid !important;
    grid-template-columns:repeat(2, minmax(0, 1fr)) !important;
    gap:8px !important;
    overflow:visible !important;
  }

  .rest-operation-page #filtrosAreasMesas .btn-rest-filter[data-area="todas"] {
    grid-column:1 / -1 !important;
  }

  .rest-operation-page #filtrosAreasMesas .btn-rest-filter {
    min-height:50px !important;
    padding:8px 9px !important;
    border-radius:14px !important;
  }

  .rest-operation-page #filtrosAreasMesas .rest-area-filter-label {
    font-size:11px !important;
  }

  .rest-operation-page .rest-table-search {
    margin-top:9px !important;
    max-width:none !important;
  }
}

/* Teléfonos muy angostos: una opción por fila. */
@media (max-width: 370px) {
  .rest-operation-page #filtrosAreasMesas,
  .rest-operation-page .rest-area-filters {
    grid-template-columns:1fr !important;
  }

  .rest-operation-page #filtrosAreasMesas .btn-rest-filter[data-area="todas"] {
    grid-column:1 !important;
  }
}


/* ======================================================================
 * ASU RICO · ETAPA 39
 * FIX FUNCIONAL DEL FILTRO + CUADRADO EN PC
 * ====================================================================== */

/* CRITICO: debe ganar incluso cuando la tarjeta usa display:grid !important. */
.rest-operation-page #gridMesasOperacion .rest-operation-table.rest-filter-hidden {
  display:none !important;
}

/* ----------------------------------------------------------------------
 * ESCRITORIO
 * Filtros a la izquierda, búsqueda a la derecha, todos en una sola banda.
 * ---------------------------------------------------------------------- */
@media (min-width: 1051px) {
  .rest-operation-page .rest-operation-toolbar {
    display:flex !important;
    flex-direction:row !important;
    flex-wrap:wrap !important;
    align-items:center !important;
    justify-content:space-between !important;
    gap:12px 18px !important;
    width:100% !important;
    min-height:66px !important;
    padding:12px 14px !important;
    box-sizing:border-box !important;
    text-align:left !important;
  }

  .rest-operation-page #filtrosAreasMesas,
  .rest-operation-page .rest-area-filters {
    flex:1 1 650px !important;
    width:auto !important;
    min-width:0 !important;
    max-width:760px !important;
    display:grid !important;
    grid-template-columns:repeat(3, minmax(150px, 1fr)) !important;
    gap:8px !important;
    margin:0 !important;
    padding:0 !important;
    overflow:visible !important;
    justify-self:auto !important;
    justify-content:stretch !important;
  }

  .rest-operation-page #filtrosAreasMesas .btn-rest-filter {
    min-height:42px !important;
    width:100% !important;
    min-width:0 !important;
    padding:7px 10px !important;
    display:grid !important;
    grid-template-columns:auto minmax(0,1fr) auto !important;
    align-items:center !important;
    gap:7px !important;
    border-radius:11px !important;
    white-space:normal !important;
    overflow:hidden !important;
    text-align:left !important;
  }

  .rest-operation-page #filtrosAreasMesas .rest-area-filter-label {
    min-width:0 !important;
    white-space:normal !important;
    overflow:visible !important;
    text-overflow:clip !important;
    font-size:10.5px !important;
    line-height:1.08 !important;
  }

  .rest-operation-page .rest-table-search {
    flex:0 0 300px !important;
    width:300px !important;
    max-width:300px !important;
    margin:0 !important;
    justify-self:auto !important;
    align-self:center !important;
  }

  .rest-operation-page .rest-table-search .form-control {
    height:42px !important;
  }

  /* Mesero no tiene buscador general; el mensaje queda debajo y no deforma filtros. */
  .rest-operation-page .rest-area-filter-feedback {
    flex:1 0 100% !important;
  }
}

/* ----------------------------------------------------------------------
 * TABLET
 * Filtros arriba y búsqueda debajo, sin compresión.
 * ---------------------------------------------------------------------- */
@media (min-width: 768px) and (max-width: 1050px) {
  .rest-operation-page .rest-operation-toolbar {
    display:grid !important;
    grid-template-columns:1fr !important;
    gap:9px !important;
    padding:11px !important;
  }

  .rest-operation-page #filtrosAreasMesas,
  .rest-operation-page .rest-area-filters {
    width:100% !important;
    max-width:none !important;
    display:grid !important;
    grid-template-columns:repeat(3, minmax(0,1fr)) !important;
    gap:8px !important;
    overflow:visible !important;
  }

  .rest-operation-page .rest-table-search {
    width:100% !important;
    max-width:none !important;
    margin:0 !important;
  }
}

/* ----------------------------------------------------------------------
 * MOVIL
 * Mantener el diseño aprobado: Todas arriba, salones debajo.
 * ---------------------------------------------------------------------- */
@media (max-width: 767px) {
  .rest-operation-page .rest-operation-toolbar {
    display:block !important;
    width:100% !important;
    padding:10px !important;
  }

  .rest-operation-page #filtrosAreasMesas,
  .rest-operation-page .rest-area-filters {
    display:grid !important;
    grid-template-columns:repeat(2, minmax(0,1fr)) !important;
    width:100% !important;
    max-width:100% !important;
    gap:8px !important;
    margin:0 !important;
    padding:0 !important;
    overflow:visible !important;
  }

  .rest-operation-page #filtrosAreasMesas .btn-rest-filter[data-area="todas"] {
    grid-column:1 / -1 !important;
  }

  .rest-operation-page #filtrosAreasMesas .btn-rest-filter {
    width:100% !important;
    min-width:0 !important;
    min-height:50px !important;
  }
}

@media (max-width: 370px) {
  .rest-operation-page #filtrosAreasMesas,
  .rest-operation-page .rest-area-filters {
    grid-template-columns:1fr !important;
  }

  .rest-operation-page #filtrosAreasMesas .btn-rest-filter[data-area="todas"] {
    grid-column:1 !important;
  }
}


/* ================================================================
 * ETAPA 73 - LIBERAR MESA SIN CONSUMO
 * Acción secundaria dentro de Detalle consumo para no saturar móvil.
 * ================================================================ */
.rest-no-consumption-zone{
  margin:0 14px 5px;
  padding:12px;
  border:1px solid #fed7aa;
  border-radius:13px;
  background:#fffaf3;
}

.rest-no-consumption-copy{
  display:flex;
  gap:10px;
  align-items:flex-start;
  margin-bottom:10px;
  color:#7c2d12;
}

.rest-no-consumption-copy > i{
  width:34px;
  height:34px;
  flex:0 0 34px;
  border-radius:10px;
  display:flex;
  align-items:center;
  justify-content:center;
  background:#ffedd5;
  color:#c2410c;
  font-size:15px;
}

.rest-no-consumption-copy div{
  min-width:0;
}

.rest-no-consumption-copy strong{
  display:block;
  font-size:12px;
  font-weight:900;
  line-height:1.25;
}

.rest-no-consumption-copy span{
  display:block;
  margin-top:3px;
  font-size:10px;
  line-height:1.4;
  color:#9a5b3d;
}

.rest-btn-release-no-consumption{
  min-height:44px;
  border:1px solid #d97706!important;
  border-radius:10px!important;
  background:#fff!important;
  color:#b45309!important;
  font-weight:900!important;
}

.rest-btn-release-no-consumption:hover,
.rest-btn-release-no-consumption:focus{
  background:#fff7ed!important;
  color:#9a3412!important;
}

.rest-order-status.sin-consumo{
  background:#fff7ed!important;
  color:#9a3412!important;
  border-color:#fed7aa!important;
}

.rest-history-reason.is-no-consumption td{
  background:#fffaf3!important;
  color:#8a431f!important;
}

@media(max-width:767px){
  .rest-no-consumption-zone{
    margin:0 10px 5px;
    padding:11px;
  }

  .rest-btn-release-no-consumption{
    min-height:48px;
    font-size:12px!important;
  }
}


/* ================================================================
 * ETAPA 77 - CARGO AUTOMÁTICO POR EMPAQUE PARA LLEVAR
 * ================================================================ */

.rest-cargo-recojo-config{
  margin-top:14px;
  padding:14px;
  border:1px solid #cfe7e3;
  border-radius:14px;
  background:#f6fbfa;
}

.rest-cargo-recojo-head{
  display:flex;
  align-items:center;
  gap:11px;
}

.rest-cargo-recojo-head > div{
  min-width:0;
  flex:1;
}

.rest-cargo-recojo-head strong{
  display:block;
  color:#17343c;
  font-size:12px;
  font-weight:900;
}

.rest-cargo-recojo-head small{
  display:block;
  margin-top:2px;
  color:#667b81;
  font-size:9px;
  line-height:1.4;
}

.rest-mini-toggle{
  position:relative;
  width:44px;
  height:24px;
  margin:0;
  flex:0 0 44px;
}

.rest-mini-toggle input{
  position:absolute;
  opacity:0;
}

.rest-mini-toggle span{
  display:block;
  width:44px;
  height:24px;
  border-radius:999px;
  background:#cbd5e1;
  cursor:pointer;
  transition:.2s;
}

.rest-mini-toggle span:before{
  content:"";
  position:absolute;
  width:18px;
  height:18px;
  top:3px;
  left:3px;
  border-radius:50%;
  background:#fff;
  box-shadow:0 1px 4px rgba(0,0,0,.18);
  transition:.2s;
}

.rest-mini-toggle input:checked + span{
  background:#0f766e;
}

.rest-mini-toggle input:checked + span:before{
  transform:translateX(20px);
}

.rest-cargo-recojo-amount{
  margin-top:12px;
  padding-top:12px;
  border-top:1px dashed #cfe0dd;
}

.rest-cargo-recojo-amount label{
  font-size:10px;
  color:#38565d;
}

.rest-cargo-recojo-amount .input-group{
  max-width:220px;
}

.rest-cargo-recojo-amount small{
  display:block;
  margin-top:4px;
  color:#74878c;
  font-size:9px;
}

.rest-order-item.is-takeaway-charge,
.rest-consumption-modal-line.is-takeaway-charge{
  background:#f7fbff!important;
  border-color:#cfe1f5!important;
}

.rest-item-state-charge{
  background:#eaf4ff!important;
  color:#1d4ed8!important;
  border-color:#bfdbfe!important;
}

.rest-item-charge-lock{
  color:#64748b!important;
}

.rest-cobro-cargo-recojo{
  background:#f8fbff;
}

.rest-cobro-cargo-recojo td{
  border-top-color:#dbeafe!important;
}

.rest-cargo-auto-badge{
  display:inline-flex;
  align-items:center;
  gap:4px;
  margin-top:3px;
  padding:3px 7px;
  border-radius:999px;
  background:#eaf4ff;
  color:#1d4ed8;
  font-size:8px;
  font-weight:900;
}

.js-cargo-llevar[readonly]{
  background:#f1f5f9!important;
  color:#475569!important;
  text-align:center;
  font-weight:900;
  cursor:not-allowed;
}

@media(max-width:767px){
  .rest-cargo-recojo-config{
    padding:12px;
  }

  .rest-cargo-recojo-head{
    align-items:flex-start;
  }

  .rest-cargo-recojo-amount .input-group{
    max-width:none;
  }
}

/* ASU RICO · ETAPA 88 · División POR CONSUMO */
@media(max-width:767px){
  .caja-rest-page .rest-division-consumo{display:grid;grid-template-columns:42px 1fr auto;gap:8px;padding:11px;margin:10px 0 15px}
  .caja-rest-page .rest-division-consumo-icon{grid-row:1 / span 2}
  .caja-rest-page .rest-division-consumo-copy strong{font-size:13px}
  .caja-rest-page .rest-division-consumo-copy span{font-size:9px}
  .caja-rest-page .rest-division-consumo-amount{font-size:18px;text-align:right}
  .caja-rest-page #btnCancelarDivision{grid-column:2 / 4;min-height:38px;width:100%;margin-top:2px}
  .caja-rest-page #btnDividirCuenta{min-height:42px;flex:1 1 145px}
}
