/* Mesas module. Every rule is scoped under .mod-mesas. Looks follow TableNode / TablesView / TableDetailModal of apps/webapp. */
.hv2 .mod-mesas { --mm-occ: var(--a-err); --mm-att: var(--a-warn); --mm-res: var(--a-info); --mm-free: var(--a-brand); background: var(--a-bg); color: var(--a-ink); font-family: var(--font-body); }
.hv2 .mod-mesas .mm { display: grid; grid-template-rows: auto auto minmax(0, 1fr); gap: var(--space-xs); height: 100%; padding: var(--space-sm) var(--space-md) var(--space-sm); box-sizing: border-box; }
.hv2 .mod-mesas .num { font-variant-numeric: tabular-nums; }
.hv2 .mod-mesas button { font: inherit; color: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.hv2 .mod-mesas button:focus-visible, .hv2 .mod-mesas textarea:focus-visible { outline: 2px solid var(--a-brand); outline-offset: 2px; }

/* header: title and the TablesView actions */
.hv2 .mod-mesas .mm-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-sm); min-width: 0; }
.hv2 .mod-mesas .mm-title { margin: 0; font-size: 18px; font-weight: 700; letter-spacing: -0.2px; }
.hv2 .mod-mesas .mm-acts { display: flex; flex-wrap: wrap; gap: var(--space-2xs); justify-content: flex-end; }
.hv2 .mod-mesas .mm-btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2xs); min-height: 44px; padding: 0 var(--space-sm); border: 1px solid var(--a-line); border-radius: 12px; background: var(--a-surface); color: var(--a-ink); font-size: 13px; font-weight: 600; text-align: center; line-height: 1.15; transition: background-color var(--dur) var(--ease-out), transform 160ms var(--ease-out); }
.hv2 .mod-mesas .mm-btn:hover { background: var(--a-raised); }
.hv2 .mod-mesas .mm-btn:active, .hv2 .mod-mesas .mm-prim:active, .hv2 .mod-mesas .mm-node:active { transform: scale(0.97); }
.hv2 .mod-mesas .mm-sm { min-height: 34px; padding: 0 var(--space-sm); border-radius: 10px; font-size: 12px; }
.hv2 .mod-mesas .mm-ghost { border-color: transparent; background: none; color: var(--a-ink2); }
.hv2 .mod-mesas .mm-prim { display: flex; align-items: center; justify-content: center; width: 100%; min-height: 48px; padding: 0 var(--space-sm); border: 0; border-radius: 12px; background: var(--a-brand); color: var(--a-on); font-size: 15px; font-weight: 700; letter-spacing: -0.1px; transition: background-color var(--dur) var(--ease-out), transform 160ms var(--ease-out); }
.hv2 .mod-mesas .mm-prim:hover { background: var(--a-text); }

/* zone chips and state chips (ZoneChip, StatusSummary) */
.hv2 .mod-mesas .mm-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-xs); min-width: 0; }
.hv2 .mod-mesas .mm-zones, .hv2 .mod-mesas .mm-sum { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2xs); }
.hv2 .mod-mesas .mm-zone { display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 0 var(--space-sm); border: 1px solid var(--a-line); border-radius: 999px; background: none; color: var(--a-ink2); font-size: 12px; font-weight: 600; }
.hv2 .mod-mesas .mm-zone span { min-width: 18px; padding: 1px 6px; border-radius: 999px; background: var(--a-surface); color: var(--a-muted); font-size: 11px; font-weight: 700; }
.hv2 .mod-mesas .mm-zone.is-on { border-color: var(--a-brand); background: var(--a-soft); color: var(--a-ink); }
.hv2 .mod-mesas .mm-zone.is-on span { background: var(--a-brand); color: var(--a-on); }
.hv2 .mod-mesas .mm-sc { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; color: var(--c); background: color-mix(in srgb, var(--c) 14%, transparent); }
.hv2 .mod-mesas .mm-sc i { width: 6px; height: 6px; border-radius: 50%; background: var(--c); }
.hv2 .mod-mesas .is-free { --c: var(--mm-free); }
.hv2 .mod-mesas .is-occupied { --c: var(--mm-occ); }
.hv2 .mod-mesas .is-attention { --c: var(--mm-att); }
.hv2 .mod-mesas .is-reserved { --c: var(--mm-res); }
.hv2 .mod-mesas .mm-sc.is-free { color: var(--a-text); }

/* the plan: a logical canvas scaled to fit its box (FloorCanvas) */
.hv2 .mod-mesas .mm-stage { position: relative; display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-sm); min-height: 0; }
.hv2 .mod-mesas .has-panel .mm-stage { grid-template-columns: minmax(0, 1fr) 360px; }
.hv2 .mod-mesas .mm-box { position: relative; min-width: 0; min-height: 0; overflow: hidden; border: 1px solid var(--a-line); border-radius: 16px; background: var(--a-well); background-image: radial-gradient(circle, color-mix(in srgb, var(--a-line) 80%, transparent) 1px, transparent 1.5px); background-size: 24px 24px; }
.hv2 .mod-mesas .mm-canvas { position: absolute; width: var(--cw); height: var(--ch); transform: scale(var(--k, 1)); transform-origin: top left; }
.hv2 .mod-mesas .mm-el { position: absolute; left: var(--x); top: var(--y); width: var(--w); height: var(--h); display: flex; align-items: center; justify-content: center; gap: 6px; box-sizing: border-box; border: 1px dashed var(--a-line-strong); border-radius: 10px; background: color-mix(in srgb, var(--a-surface) 60%, transparent); color: var(--a-muted); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.6px; }

/* TableNode */
.hv2 .mod-mesas .mm-node { position: absolute; left: var(--x); top: var(--y); width: var(--w); height: var(--h); display: flex; flex-direction: column; box-sizing: border-box; overflow: hidden; padding: 0; border: 2px solid var(--c); border-radius: 12px; background: color-mix(in srgb, var(--c) 14%, var(--a-surface)); color: var(--a-ink); text-align: center; transition: transform 150ms var(--ease-out), box-shadow 150ms var(--ease-out); }
.hv2 .mod-mesas .mm-round { border-radius: 50%; }
.hv2 .mod-mesas .mm-node.is-free { border-width: 1px; border-color: var(--a-line); background: var(--a-surface); }
.hv2 .mod-mesas .mm-node.is-occupied { background: var(--mm-occ); border-color: var(--mm-occ); color: #fff; box-shadow: 0 8px 12px color-mix(in srgb, var(--mm-occ) 40%, transparent); }
.hv2 .mod-mesas .mm-node.is-sel { box-shadow: 0 0 0 3px var(--a-soft), 0 0 0 1px var(--a-brand); }
.hv2 .mod-mesas .mm-node.is-occupied.is-sel { box-shadow: 0 8px 12px color-mix(in srgb, var(--mm-occ) 40%, transparent), 0 0 0 3px var(--a-soft), 0 0 0 5px var(--a-brand); }
.hv2 .mod-mesas .mm-strip { position: absolute; inset: 0 0 auto; height: 3px; background: var(--c); }
.hv2 .mod-mesas .mm-dot { position: absolute; left: 8px; top: 8px; width: 6px; height: 6px; border-radius: 50%; background: var(--mm-free); opacity: 0.5; }
.hv2 .mod-mesas .mm-round .mm-dot { left: 50%; top: 9px; margin-left: -3px; }
.hv2 .mod-mesas .mm-badge { position: absolute; right: 6px; top: 6px; display: grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; background: var(--a-well); font-size: 10px; font-weight: 700; }
.hv2 .mod-mesas .is-occupied .mm-badge { background: rgb(255 255 255 / 0.18); }
.hv2 .mod-mesas .mm-round .mm-badge { right: 50%; top: 4px; margin-right: -9px; }
.hv2 .mod-mesas .mm-round.is-occupied .mm-badge { display: none; }
.hv2 .mod-mesas .mm-in { display: flex; flex: 1; min-height: 0; flex-direction: column; align-items: center; justify-content: center; padding: 6px 8px; }
.hv2 .mod-mesas .mm-in > * { flex-shrink: 0; }
.hv2 .mod-mesas .mm-num { font-weight: 700; line-height: 0.875; letter-spacing: -0.6px; }
.hv2 .mod-mesas .mm-row { display: flex; align-items: center; justify-content: center; gap: 4px; max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hv2 .mod-mesas .mm-sub { height: 16px; color: var(--a-ink2); font-size: 11px; font-weight: 500; }
.hv2 .mod-mesas .mm-clock { font-size: 10px; font-weight: 600; }
.hv2 .mod-mesas .mm-clock svg + svg, .hv2 .mod-mesas .mm-clock svg:nth-of-type(2) { margin-left: 4px; }
.hv2 .mod-mesas .mm-resname { height: 14px; font-size: 10px; }
.hv2 .mod-mesas .mm-total { height: 18px; color: var(--a-text); font-size: 12px; font-weight: 700; }
.hv2 .mod-mesas .mm-word { height: 14px; color: var(--c); font-size: 9px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; }
.hv2 .mod-mesas .is-free .mm-word { color: var(--a-text); }
.hv2 .mod-mesas .is-occupied .mm-sub, .hv2 .mod-mesas .is-occupied .mm-word, .hv2 .mod-mesas .is-occupied .mm-total { color: rgb(255 255 255 / 0.88); }
.hv2 .mod-mesas .is-occupied .mm-total { color: #fff; }

/* the side panel (TableDetailModal, placement side) */
.hv2 .mod-mesas .mm-panel { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; min-height: 0; overflow: hidden; border: 1px solid var(--a-line); border-radius: 16px; background: var(--a-surface); animation: mod-mesas-in 220ms var(--ease-out); }
@keyframes mod-mesas-in { from { opacity: 0; transform: translateX(12px); } }
.hv2 .mod-mesas .mm-dhead { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--space-xs); padding: var(--space-sm) var(--space-sm) var(--space-xs) var(--space-md); }
.hv2 .mod-mesas .mm-dt { display: flex; flex-direction: column; min-width: 0; }
.hv2 .mod-mesas .mm-dr { display: flex; align-items: center; gap: var(--space-2xs); }
.hv2 .mod-mesas .mm-eyebrow { color: var(--a-muted); font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 2px; }
.hv2 .mod-mesas .mm-big { font-size: 40px; font-weight: 700; line-height: 1; letter-spacing: -1px; }
.hv2 .mod-mesas .mm-cap { margin-top: 4px; color: var(--a-muted); font-size: 12px; white-space: pre; }
.hv2 .mod-mesas .mm-ptitle { font-size: 18px; font-weight: 700; }
.hv2 .mod-mesas .mm-back { display: inline-flex; align-items: center; gap: 4px; align-self: flex-start; min-height: 32px; margin: 0 0 2px -6px; padding: 0 6px; border: 0; border-radius: 8px; background: none; color: var(--a-ink2); font-size: 12px; font-weight: 600; }
.hv2 .mod-mesas .mm-pill { display: inline-flex; align-items: center; height: 24px; padding: 0 10px; border: 1px solid var(--c); border-radius: 12px; color: var(--c); font-size: 12px; font-weight: 700; white-space: nowrap; }
.hv2 .mod-mesas .mm-pill.is-free { color: var(--a-text); }
.hv2 .mod-mesas .mm-x { display: grid; place-items: center; width: 44px; height: 44px; margin: -6px -6px 0 0; border: 0; border-radius: 12px; background: none; color: var(--a-ink2); }
.hv2 .mod-mesas .mm-x:hover { background: var(--a-raised); }
.hv2 .mod-mesas .mm-scroll { min-height: 0; overflow-y: auto; padding: 0 var(--space-md) var(--space-xs); overscroll-behavior: contain; }
.hv2 .mod-mesas .mm-foot { display: flex; flex-direction: column; gap: var(--space-2xs); padding: var(--space-xs) var(--space-md) var(--space-sm); border-top: 1px solid var(--a-line); }
.hv2 .mod-mesas .mm-foot--row { flex-direction: row; }
.hv2 .mod-mesas .mm-foot--row .mm-btn { flex: none; }
.hv2 .mod-mesas .mm-foot--row .mm-prim { flex: 1; width: auto; }
.hv2 .mod-mesas .mm-grid3, .hv2 .mod-mesas .mm-grid2 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-2xs); }
.hv2 .mod-mesas .mm-grid2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.hv2 .mod-mesas .mm-grid3 .mm-btn, .hv2 .mod-mesas .mm-grid2 .mm-btn { padding: 0 6px; font-size: 12px; }
.hv2 .mod-mesas .mm-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; margin-bottom: var(--space-xs); }
.hv2 .mod-mesas .mm-stat { display: flex; flex-direction: column; gap: 2px; min-width: 0; padding: 6px; border-radius: 10px; background: var(--a-well); }
.hv2 .mod-mesas .mm-stat small { overflow: hidden; color: var(--a-muted); font-size: 9px; font-weight: 600; text-transform: uppercase; letter-spacing: 0; text-overflow: ellipsis; white-space: nowrap; }
.hv2 .mod-mesas .mm-stat b { overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.hv2 .mod-mesas .mm-alert { margin-bottom: var(--space-xs); padding: 8px 12px; border: 1px solid var(--mm-att); border-radius: 10px; background: color-mix(in srgb, var(--mm-att) 12%, transparent); color: var(--mm-att); font-size: 13px; font-weight: 600; }
.hv2 .mod-mesas .mm-items { display: flex; flex-direction: column; }
.hv2 .mod-mesas .mm-it { display: flex; align-items: flex-start; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--a-line); font-size: 13px; }
.hv2 .mod-mesas .mm-q { min-width: 28px; padding: 1px 6px; border-radius: 6px; background: var(--a-well); font-weight: 600; text-align: center; box-sizing: border-box; }
.hv2 .mod-mesas .mm-in2 { display: flex; flex: 1; flex-direction: column; gap: 1px; min-width: 0; }
.hv2 .mod-mesas .mm-in2 b { font-weight: 600; }
.hv2 .mod-mesas .mm-in2 small { color: var(--a-muted); font-size: 12px; }
.hv2 .mod-mesas .mm-tot { display: flex; align-items: baseline; justify-content: space-between; padding: 10px 0 4px; font-size: 14px; font-weight: 600; }
.hv2 .mod-mesas .mm-tot b { font-size: 20px; }
.hv2 .mod-mesas .mm-res { display: flex; align-items: flex-start; gap: 10px; padding: 12px; border: 1px solid color-mix(in srgb, var(--mm-res) 45%, transparent); border-radius: 12px; background: color-mix(in srgb, var(--mm-res) 10%, transparent); color: var(--mm-res); }
.hv2 .mod-mesas .mm-res div { display: flex; flex-direction: column; gap: 2px; color: var(--a-ink); font-size: 13px; }
.hv2 .mod-mesas .mm-res span { color: var(--a-ink2); font-size: 12px; }
.hv2 .mod-mesas .mm-hint { margin: 6px 0 0; color: var(--a-muted); font-size: 12px; line-height: 1.4; }
.hv2 .mod-mesas .mm-free { margin: 0; font-size: 13px; color: var(--a-ink2); }
.hv2 .mod-mesas .mm-label { display: block; margin: var(--space-xs) 0 6px; color: var(--a-ink2); font-size: 13px; font-weight: 500; }
.hv2 .mod-mesas .mm-label:first-child { margin-top: 0; }
.hv2 .mod-mesas .mm-modes { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.hv2 .mod-mesas .mm-mode, .hv2 .mod-mesas .mm-method { min-height: 44px; border: 1px solid var(--a-line); border-radius: 10px; background: var(--a-well); color: var(--a-ink2); font-size: 13px; font-weight: 600; }
.hv2 .mod-mesas .mm-mode.is-on, .hv2 .mod-mesas .mm-method.is-on { border-color: var(--a-brand); background: var(--a-soft); color: var(--a-ink); }
.hv2 .mod-mesas .mm-gcs { display: flex; flex-wrap: wrap; gap: 6px; }
.hv2 .mod-mesas .mm-gc { width: 44px; height: 44px; border: 1px solid var(--a-line); border-radius: 50%; background: var(--a-well); font-size: 15px; font-weight: 600; }
.hv2 .mod-mesas .mm-gc.is-on { border-color: var(--a-brand); background: var(--a-brand); color: var(--a-on); }
.hv2 .mod-mesas .mm-note { width: 100%; box-sizing: border-box; resize: none; padding: 8px 12px; border: 1px solid var(--a-line); border-radius: 10px; background: var(--a-well); color: var(--a-ink); font: inherit; font-size: 13px; }
.hv2 .mod-mesas .mm-note::placeholder { color: var(--a-muted); }
.hv2 .mod-mesas .mm-due { display: flex; flex-direction: column; gap: 2px; margin: 0 var(--space-md); padding: 12px 14px; border-radius: 12px; background: var(--a-well); }
.hv2 .mod-mesas .mm-due small { color: var(--a-muted); font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.4px; }
.hv2 .mod-mesas .mm-due b { font-size: 30px; font-weight: 700; letter-spacing: -0.6px; }
.hv2 .mod-mesas .mm-due span { color: var(--a-muted); font-size: 12px; }
.hv2 .mod-mesas .mm-panel > .mm-label { margin: var(--space-sm) var(--space-md) 6px; }
.hv2 .mod-mesas .mm-methods { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; align-content: start; padding: 0 var(--space-md); }
.hv2 .mod-mesas .mm-method { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-height: 64px; font-size: 12px; }
.hv2 .mod-mesas .mm-panel:has(.mm-methods) { grid-template-rows: auto auto auto minmax(0, 1fr) auto; }

/* narrow screens (phone, Celular frame): the plan becomes a grid of the same cards, stacked, and the panel covers the stage.
   ponytail: the app pans a scaled plan on phones; a grid keeps every card tappable without a pan/zoom layer. */
@container screen (max-width: 600px) {
  .hv2 .mod-mesas .mm { padding: var(--space-sm); }
  .hv2 .mod-mesas .mm-head { flex-wrap: wrap; }
  .hv2 .mod-mesas .mm-acts { justify-content: flex-start; }
  .hv2 .mod-mesas .mm-bar { flex-direction: column; align-items: flex-start; }
  .hv2 .mod-mesas .has-panel .mm-stage { grid-template-columns: minmax(0, 1fr); }
  .hv2 .mod-mesas .mm-box { overflow-y: auto; background-image: none; }
  .hv2 .mod-mesas .mm-canvas { position: static; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: center; gap: 10px; width: auto; height: auto; padding: 10px; transform: none; }
  .hv2 .mod-mesas .mm-el { display: none; }
  .hv2 .mod-mesas .mm-node { position: relative; left: auto; top: auto; width: 100%; height: var(--h); }
  .hv2 .mod-mesas .mm-round { justify-self: center; width: var(--w); }
  .hv2 .mod-mesas .mm-rectangle { grid-column: span 2; }
  .hv2 .mod-mesas .mm-panel { position: absolute; inset: 0; z-index: 2; }
  .hv2 .mod-mesas .mm-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@container screen (max-width: 760px) and (min-width: 601px) {
  .hv2 .mod-mesas .has-panel .mm-stage { grid-template-columns: minmax(0, 1fr) 300px; }
}
@media (prefers-reduced-motion: reduce) {
  .hv2 .mod-mesas .mm-panel { animation: none; }
}
.hv2 .mod-mesas .mm-more { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-2xs); margin-top: var(--space-xs); }
.hv2 .mod-mesas .mm-more .mm-btn:only-child { grid-column: span 2; }
