.restaurant-workspace{display:grid;grid-template-columns:minmax(0,1fr) 390px;gap:18px;align-items:start;margin-bottom:26px}
.restaurant-catalog{min-width:0;background:#fff;border:1px solid #d8e5f0;border-radius:18px;padding:18px;box-shadow:0 8px 24px #174f8510}
.restaurant-catalog-heading{display:flex;align-items:end;justify-content:space-between;gap:18px;margin-bottom:14px}
.restaurant-catalog-heading h3{margin:4px 0 0;color:#153a61;font-size:21px}
.restaurant-search{width:min(390px,48%);margin:0}.restaurant-search span{display:block;margin-bottom:4px}
.restaurant-search input{margin:0;background:#f8fbfe}
.restaurant-catalog-hint{margin:0 0 13px;padding:10px 12px;border-radius:11px;background:#fff6df;border:1px solid #f0dfae;color:#74591b;font-size:12px;line-height:1.4}
.restaurant-products{display:grid;grid-template-columns:repeat(auto-fill,minmax(170px,1fr));gap:11px;max-height:62dvh;overflow:auto;padding:2px 3px 4px 2px}
.restaurant-product{min-height:138px;display:flex;flex-direction:column;align-items:flex-start;justify-content:flex-start;gap:7px;padding:15px;text-align:left;background:#fff;border:1px solid #d6e3ee;border-radius:15px;color:#173b61;box-shadow:0 5px 14px #173b610b;font-weight:600}
.restaurant-product:hover{border-color:#79a9d8;box-shadow:0 9px 22px #0e509e1a;transform:translateY(-1px)}
.restaurant-product>span{font-size:10px;line-height:1.2;letter-spacing:1px;text-transform:uppercase;color:#6c8298}
.restaurant-product strong{font-size:16px;line-height:1.25;overflow-wrap:anywhere}
.restaurant-product b{margin-top:auto;color:#0e509e;font-size:20px}
.restaurant-product small{width:100%;padding-top:7px;border-top:1px solid #edf2f7;color:#57718b;font-size:11px}
.restaurant-products-empty{grid-column:1/-1;min-height:180px;display:grid;place-content:center;text-align:center;gap:7px;padding:25px;border:1px dashed #cbdce9;border-radius:14px;background:#f8fbfd;color:#547087}
.restaurant-products-empty strong{color:#173b61;font-size:17px}.restaurant-products-empty small{max-width:390px;line-height:1.45}
.restaurant-cart{position:sticky;top:84px;display:flex;flex-direction:column;max-height:calc(100dvh - 105px);min-height:390px;padding:18px!important;margin:0!important;border-color:#cddfeb!important;box-shadow:0 12px 30px #173b6114!important}
.restaurant-cart-heading{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;padding-bottom:14px;border-bottom:1px solid #e1eaf1}
.restaurant-cart-heading h3{margin:4px 0 2px!important;font-size:21px}.restaurant-cart-heading small{display:block;color:#6c8298;font-size:12px}
.restaurant-cart-heading button{flex:none;padding:9px 11px}
#restaurantLines{flex:1;min-height:95px;overflow:auto;padding:5px 1px}
.restaurant-line{display:grid;grid-template-columns:minmax(0,1fr) auto auto;gap:9px;align-items:center;padding:11px 0;border-bottom:1px solid #e7eef4}
.restaurant-line>div{min-width:0}.restaurant-line strong,.restaurant-line small{display:block}.restaurant-line small{margin-top:4px;color:#697f94;font-size:11px;overflow-wrap:anywhere}.restaurant-line button{padding:7px 10px}
.restaurant-cart-footer{display:grid;gap:9px;padding-top:14px;border-top:1px solid #e1eaf1}.restaurant-cart-footer>strong{display:flex;justify-content:space-between;color:#173b61;font-size:17px}.restaurant-cart-footer>strong span{color:#0e509e;font-size:21px}
.restaurant-tabs{margin-bottom:18px}
.restaurant-history-section{padding:18px;background:#fff;border:1px solid #d7e3ed;border-radius:18px;box-shadow:0 10px 26px rgba(14,80,158,.06)}
.restaurant-history-heading{display:flex;align-items:end;justify-content:space-between;gap:18px;margin-bottom:13px}.restaurant-history-heading h3{margin:3px 0 0}.restaurant-history-heading small{max-width:390px;color:#6b8094;text-align:right}
.restaurant-history-filters{display:grid;grid-template-columns:minmax(250px,1.6fr) minmax(150px,.8fr) minmax(135px,.65fr) minmax(135px,.65fr) auto;gap:10px;align-items:end;margin-bottom:12px;padding:12px;background:#f6f9fc;border:1px solid #dfebf3;border-radius:14px}.restaurant-history-filters label{min-width:0}.restaurant-history-filters input,.restaurant-history-filters select{width:100%}.restaurant-history-filters button{height:43px}
.restaurant-history-table{box-shadow:none}.restaurant-history-table td{vertical-align:middle}.restaurant-history-table td strong,.restaurant-history-table td small{display:block}.restaurant-history-table td small{max-width:310px;margin-top:3px;color:#6b8094;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.restaurant-history-pagination{margin:12px 0 0}.restaurant-history-empty{padding:26px;text-align:center}.restaurant-history-empty strong,.restaurant-history-empty small{display:block}.restaurant-history-empty small{margin-top:5px;color:#6b8094}
.restaurant-history-table .restaurant-status-error{min-width:190px;max-width:330px;margin-top:7px;padding:7px 8px;border-radius:8px;background:#fff0f2;color:#9f2636;white-space:normal;overflow:visible;text-overflow:clip;line-height:1.35;font-weight:500}
.restaurant-settings{grid-column:1/-1}.restaurant-settings form{display:grid;gap:14px}.restaurant-settings input[type=checkbox],.restaurant-dialog input[type=checkbox],.restaurant-dialog input[type=radio]{width:auto}
.restaurant-dialog{width:min(940px,95vw);max-height:90dvh;overflow:auto;padding:24px}.restaurant-dialog label{display:block;margin:12px 0}.restaurant-dialog small{display:block}.restaurant-dialog .dialog-actions{position:sticky;bottom:-24px;background:#fff;padding:14px 0;margin-top:14px}
.restaurant-table-dialog{width:min(820px,calc(100vw - 24px))}.restaurant-table-dialog form{padding:22px}.restaurant-table-dialog .dialog-heading h2{margin-top:0}
.restaurant-room{margin-top:20px}.restaurant-room h3{margin:0 0 9px;color:#60768b;font-size:12px;letter-spacing:1px;text-transform:uppercase}
.restaurant-table-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(125px,1fr));gap:10px}
.restaurant-table-choice{min-height:105px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:7px;padding:14px;background:#f8fbfe;border:1px solid #cfdeea;border-radius:15px;color:#173b61;text-align:center}
.restaurant-table-choice:hover{background:#edf6ff;border-color:#74a9d8}.restaurant-table-choice.selected{background:#e4f1ff;border-color:#0e509e;box-shadow:inset 0 0 0 1px #0e509e}
.restaurant-table-choice strong{font-size:16px}.restaurant-table-choice small{color:#668097;font-size:11px}
.restaurant-import{max-height:56dvh;overflow:auto}.restaurant-import input{min-width:100px}.restaurant-import select{min-width:160px}
@media(max-width:1050px){.restaurant-workspace{grid-template-columns:minmax(0,1fr) 330px}.restaurant-products{grid-template-columns:repeat(auto-fill,minmax(150px,1fr))}.restaurant-cart{position:static;max-height:max(520px,calc(100dvh - 120px))}}
@media(max-width:1050px){.restaurant-history-filters{grid-template-columns:minmax(260px,1.5fr) repeat(3,minmax(130px,1fr));}.restaurant-history-filters button{grid-column:4}}
@media(max-width:760px){.restaurant-workspace{grid-template-columns:1fr}.restaurant-catalog{padding:13px}.restaurant-catalog-heading{align-items:stretch;flex-direction:column;gap:10px}.restaurant-search{width:100%}.restaurant-products{grid-template-columns:repeat(2,minmax(0,1fr));max-height:none}.restaurant-product{min-height:126px;padding:12px}.restaurant-cart{max-height:58dvh;min-height:320px}.restaurant-dialog{padding:16px}.restaurant-table-dialog form{padding:17px}.restaurant-table-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.restaurant-history-section{padding:13px}.restaurant-history-heading{align-items:start;flex-direction:column;gap:5px}.restaurant-history-heading small{text-align:left}.restaurant-history-filters{grid-template-columns:1fr 1fr}.restaurant-history-query{grid-column:1/-1}.restaurant-history-filters button{grid-column:1/-1}}
@media(max-width:420px){.restaurant-products{grid-template-columns:1fr 1fr;gap:8px}.restaurant-product strong{font-size:14px}.restaurant-product b{font-size:18px}.restaurant-cart-heading{align-items:center}.restaurant-cart-heading h3{font-size:18px}}

/* Bloque de diagnóstico del detalle de comanda: texto plano, seleccionable y
   copiable de un tirón para que el usuario lo pegue en el mensaje a soporte. */
.restaurant-diagnostico{margin:14px 0 4px;border:1px solid #e2e8f0;border-radius:10px;background:#f8fafc}
.restaurant-diagnostico>summary{padding:10px 12px;cursor:pointer;font-weight:600;font-size:.9rem;color:#334155;list-style:none}
.restaurant-diagnostico>summary::-webkit-details-marker{display:none}
.restaurant-diagnostico>summary::before{content:'▸ ';color:#64748b}
.restaurant-diagnostico[open]>summary::before{content:'▾ '}
.restaurant-diagnostico pre{margin:0 12px;padding:10px;border-radius:8px;background:#fff;border:1px solid #e2e8f0;white-space:pre-wrap;word-break:break-word;font-size:.78rem;line-height:1.45;color:#1e293b;max-height:220px;overflow:auto}
.restaurant-diagnostico button{margin:10px 12px 12px}
@media (max-width:640px){.restaurant-diagnostico pre{font-size:.72rem;max-height:160px}}

/* ---- Salón: el mapa de mesas que abre la tablet ------------------------- */
.restaurant-salon{display:grid;gap:18px;margin-bottom:26px}
.restaurant-salon-summary{display:flex;gap:10px;flex-wrap:wrap}
.restaurant-salon-summary span{padding:7px 12px;border-radius:999px;background:#fff;border:1px solid #e1eaf1;color:#4b6075;font-size:13px}
.restaurant-salon-summary strong{color:#0f172a}
.restaurant-zone h3{margin:0 0 10px;font-size:15px;letter-spacing:.02em;color:#334155;text-transform:uppercase}
.restaurant-table-map{display:grid;grid-template-columns:repeat(auto-fill,minmax(150px,1fr));gap:12px}
.restaurant-table-card{display:flex;flex-direction:column;align-items:flex-start;gap:4px;min-height:118px;padding:14px 14px 12px;border-radius:18px;border:2px solid transparent;text-align:left;cursor:pointer;transition:transform .12s ease,box-shadow .12s ease;touch-action:manipulation}
.restaurant-table-card:active{transform:scale(.98)}
.restaurant-table-card strong{font-size:22px;line-height:1.1;color:#0f172a}
.restaurant-table-card b{font-size:18px;color:#0f172a}
.restaurant-table-card small{color:#4b6075;font-size:12.5px}
.restaurant-table-status{padding:3px 9px;border-radius:999px;font-size:11px;font-weight:800;letter-spacing:.04em;text-transform:uppercase}
.restaurant-table-card.libre{background:#f0fdf4;border-color:#bbf7d0}
.restaurant-table-card.libre .restaurant-table-status{background:#dcfce7;color:#166534}
.restaurant-table-card.ocupada{background:#fff7ed;border-color:#fdba74;box-shadow:0 6px 18px #f9731620}
.restaurant-table-card.ocupada .restaurant-table-status{background:#ffedd5;color:#9a3412}

/* ---- La mesa: en cocina, por enviar y total ----------------------------- */
.restaurant-cart-heading{align-items:center}
.restaurant-cart-heading>div{flex:1;min-width:0}
.restaurant-back{white-space:nowrap}
.restaurant-sent,.restaurant-new{padding-top:10px}
.restaurant-sent h4,.restaurant-new h4{margin:0 0 6px;font-size:12px;letter-spacing:.06em;text-transform:uppercase;color:#64748b}
/* Lo que está en cocina toma el espacio que quede y se desplaza por dentro;
   lo nuevo se queda a la vista sobre los botones. Sin el mínimo, una mesa con
   muchas comandas dejaba ver una sola línea. */
.restaurant-sent{flex:1 1 auto;min-height:150px;overflow:auto;border-bottom:1px solid #e1eaf1;padding-bottom:6px}
.restaurant-new{flex:0 1 auto;display:flex;flex-direction:column}
.restaurant-new #restaurantLines{flex:1 1 auto;min-height:56px}
.restaurant-sent[hidden]+.restaurant-new{flex:1 1 auto}
.restaurant-sent-command{padding:6px 0 4px}
.restaurant-sent-heading{display:flex;justify-content:space-between;gap:8px;color:#94a3b8;font-size:11.5px;padding:4px 0}
.restaurant-print-ok{color:#16a34a}
.restaurant-line.enviada b{color:#334155}
.restaurant-line.anulada{opacity:.75}
.restaurant-line.anulada s{text-decoration-thickness:2px;text-decoration-color:#dc2626}
.restaurant-line.anulada small{color:#b91c1c}
.restaurant-line.nueva{background:#f8fbff;border-radius:10px;padding-left:8px;padding-right:4px}
.restaurant-empty-hint{margin:6px 0;color:#94a3b8;font-size:13px}
.restaurant-totals{display:grid;grid-template-columns:1fr auto;align-items:baseline;gap:2px 10px}
.restaurant-totals span{color:#64748b;font-size:13px}
.restaurant-totals strong{font-size:24px;color:#0f172a}
.restaurant-totals small{grid-column:1/-1;color:#64748b}
.restaurant-void-reasons{display:flex;flex-wrap:wrap;gap:6px;margin:4px 0 10px}
.link-button{border:0;background:none;padding:0;color:#b91c1c;font-size:11.5px;text-decoration:underline;cursor:pointer}

/* Tablet en vertical y teléfono: el salón con tarjetas más grandes al tacto,
   y la mesa apilada, con el pedido debajo del menú. */
@media(max-width:760px){
  .restaurant-table-map{grid-template-columns:repeat(auto-fill,minmax(130px,1fr));gap:10px}
  .restaurant-table-card{min-height:104px}
  .restaurant-cart{max-height:none;min-height:0}
  .restaurant-sent,.restaurant-new{flex:none;min-height:0;max-height:none}
  /* En el teléfono la mesa va primero —cuál es y qué lleva— y el menú debajo.
     El total y los botones quedan fijos abajo: se agrega un plato y se envía
     sin volver a subir. */
  .restaurant-workspace{padding-bottom:calc(132px + env(safe-area-inset-bottom,0px))}
  .restaurant-cart{order:-1}
  .restaurant-cart-footer{position:fixed;right:8px;bottom:calc(8px + env(safe-area-inset-bottom,0px));left:8px;z-index:45;grid-template-columns:1fr 1fr;gap:8px;padding:10px 12px;background:#fff;border:1px solid #cddfeb;border-radius:16px;box-shadow:0 14px 34px #173b6133}
  .restaurant-cart-footer .restaurant-totals{grid-column:1/-1}
  .restaurant-cart-footer .restaurant-totals strong{font-size:20px}
  .restaurant-cart-footer button{min-height:46px}
  .restaurant-cart-footer:has(#restaurantCharge[hidden]) #restaurantConfirm,.restaurant-cart-footer:has(#restaurantPrecuenta:not([hidden])) #restaurantConfirm,.restaurant-cart-footer:has(#restaurantCharge[hidden]) #restaurantPrecuenta{grid-column:1/-1}
}
@media(max-width:420px){.restaurant-table-map{grid-template-columns:1fr 1fr}}
/* Agregar platos como en el POS: + y − en vez de escribir la cantidad. */
.restaurant-stepper{display:inline-flex;align-items:center;gap:6px}
.restaurant-stepper button,.restaurant-line .restaurant-stepper button{display:grid;place-items:center;width:38px;height:38px;min-height:0;padding:0;border:1px solid #cddfeb;border-radius:11px;background:#fff;color:#0e509e;font-size:21px;font-weight:800;line-height:1;touch-action:manipulation}
.restaurant-stepper button:active{background:#e8f1ff}
.restaurant-stepper b,.restaurant-stepper output{min-width:24px;color:#173b61;font-weight:850;text-align:center}
.is-touch .restaurant-stepper button,.is-touch .restaurant-line .restaurant-stepper button{width:44px;height:44px}
.restaurant-qty-picker{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-top:12px;padding:10px 12px;border:1px solid #dbe5ef;border-radius:13px;background:#f8fafc;color:#173b61;font-weight:800}
.restaurant-qty-picker .restaurant-stepper button{width:52px;height:52px;font-size:26px}
.restaurant-qty-picker output{min-width:44px;font-size:24px}
.restaurant-product-dialog .product-option-groups{margin-top:12px}
.restaurant-note{display:grid;gap:6px;margin-top:12px}
.restaurant-note small{color:#697f94;font-weight:600}
.restaurant-line .restaurant-line-note{display:inline-block;max-width:100%;margin-top:5px;padding:4px 10px;border:1px dashed #b9cde0;border-radius:999px;background:transparent;color:#0e509e;font-size:11px;font-weight:700;text-align:left;overflow-wrap:anywhere}
.restaurant-line .restaurant-line-note.con-nota{border-style:solid;background:#fff7e6;border-color:#f3d39b;color:#8a5a00}
.is-touch .restaurant-line .restaurant-line-note{min-height:32px}
.restaurant-product{touch-action:manipulation}
.restaurant-product.agregado{animation:restaurant-agregado .45s ease}
@keyframes restaurant-agregado{0%{transform:scale(1)}35%{transform:scale(.95);box-shadow:0 0 0 4px #16a34a55}100%{transform:scale(1)}}
@media(prefers-reduced-motion:reduce){.restaurant-product.agregado{animation:none}}
/* La ventana de un plato con opciones: angosta, opciones como botones (las del POS). */
.restaurant-dialog.restaurant-product-dialog{width:min(480px,95vw)}
.restaurant-product-dialog label.product-option-choice{display:flex;margin:0}
.restaurant-product-dialog .product-option-choice small{display:block}
.restaurant-product-dialog .product-option-choice input{width:18px}
@media(max-width:760px){
  .restaurant-dialog.restaurant-product-dialog{width:100vw;max-width:none;height:100dvh;max-height:none;margin:0;border-radius:0;padding:calc(16px + env(safe-area-inset-top,0px)) 14px calc(16px + env(safe-area-inset-bottom,0px))}
  .restaurant-product-dialog .product-option-group{grid-template-columns:1fr}
  .restaurant-product-dialog .product-option-choice{min-height:50px}
}
/* Indicaciones y motivos como botones: el teclado solo para escribir algo distinto. */
.restaurant-note>span{color:#173b61;font-weight:800}
.restaurant-chips{display:flex;flex-wrap:wrap;gap:7px}
.restaurant-chip,.restaurant-void-reasons button{min-height:38px;padding:7px 12px;border:1px solid #cddfeb;border-radius:999px;background:#fff;color:#173b61;font-size:13px;font-weight:700;touch-action:manipulation}
.restaurant-chip[aria-pressed=true],.restaurant-void-reasons button[aria-pressed=true]{border-color:#0e509e;background:#0e509e;color:#fff}
.is-touch .restaurant-chip,.is-touch .restaurant-void-reasons button{min-height:44px}
.restaurant-dialog .restaurant-qty-picker{margin:12px 0}
/* Mesas dentro del POS */
.pos-table-bar{display:flex;gap:8px;align-items:stretch;margin:10px 0 4px}.pos-table-choose{flex:1;display:grid;grid-template-columns:1fr auto;grid-template-areas:"zona cambio" "nombre cambio" "estado cambio";text-align:left;gap:1px 10px;background:var(--sky);color:var(--navy);border:1px solid #cfe5f6;padding:9px 12px}.pos-table-choose .eyebrow{grid-area:zona;font-size:10px}.pos-table-choose strong{grid-area:nombre;font-size:17px}.pos-table-choose small{grid-area:estado;color:var(--muted);font-weight:600}.pos-table-change{grid-area:cambio;align-self:center;font-size:12px;color:var(--blue);font-weight:800}.pos-mesa .pos-table-choose{background:#fff8e6;border-color:#f0d58a}.pos-table-pending{font-size:12px;margin:4px 0}
.pos-table-sent{border:1px solid var(--line);border-radius:12px;padding:8px 10px;margin:8px 0;max-height:240px;overflow:auto;background:var(--soft)}.pos-table-sent-heading{display:flex;justify-content:space-between;align-items:baseline;gap:8px}.pos-table-sent-heading h4{margin:0;color:var(--navy);font-size:13px}.pos-table-sent-heading strong{color:var(--navy);font-size:13px}.pos-table-new-title{margin:10px 0 0;color:var(--navy);font-size:13px}
.cart-line-note{display:inline-block;margin-top:4px;padding:3px 8px;font-size:11px;font-weight:700;background:transparent;color:var(--blue);border:1px dashed #b8d3e6;border-radius:8px}.cart-line-note.con-nota{border-style:solid;background:#fff8e6;color:#7a5a00}
#pos .cart-panel.pos-mesa .order-type-buttons,#pos .cart-panel.pos-mesa .cart-summary,#pos .cart-panel.pos-mesa-enviar .customer-picker,#pos .cart-panel.pos-mesa-enviar .payment-buttons,#pos .cart-panel.pos-mesa-enviar .payment-hint{display:none}
.pos-table-quick-choice{display:flex;flex-direction:column;align-items:flex-start;width:100%;margin:0 0 12px;background:#eef5fa;color:var(--navy);border:1px solid var(--line);padding:12px 14px}.pos-table-quick-choice small{color:var(--muted);font-weight:600;margin-top:3px}.pos-table-quick-choice.selected,.restaurant-table-card.selected{box-shadow:0 0 0 3px var(--blue)}.restaurant-table-pending{color:#7a5a00;font-weight:800}
.pos-parking-quick{font-size:12px;padding:6px 10px}
.restaurant-isyplus-number{display:block;margin-top:3px;font-weight:800;color:var(--navy)}
