:root {
  --ink: #30251e;
  --charcoal: #392c24;
  --paper: #f1e9de;
  --cream: #fbf6ed;
  --line: #dac8b3;
  --gold: #e2b261;
  --rust: #8c492f;
  --text-muted: #6b5243;
  --surface-quiet: #f0e4d4;
  --surface-tint: #f5ebdc;
  --surface-dark-hover: #544034;
  --dark-line: #8f715b;
  --on-dark-muted: #e9d4b9;
  --control-line: #a98c70;
  --control-radius: .75rem;
  --action-height: 44px;
  --control-shadow: 0 2px 0 rgb(78 49 27 / 10%);
  --control-focus: #895031;
  --control-highlight: #edc786;
  --selected-fill: #f0dec0;
  --selected-ink: #4b321d;
  --success-fill: #e2e9da;
  --success-ink: #38513d;
  --success-line: #86977b;
  --danger-fill: #f1dfd9;
  --danger-ink: #803e34;
  --danger-line: #ad776a;
  --warning-fill: #f0e1c4;
  --warning-ink: #61431f;
  --carta-bg: #382B22;
  --carta-surface: #49372B;
  --carta-surface-2: #594335;
  --carta-accent: #E5B260;
  --carta-text: #FFF5E7;
  --carta-text-muted: #D8BEA0;
  --carta-border: #80654E;
  --carta-overlay: rgba(0, 0, 0, 0.60);
  --display: 'Barlow Condensed', 'Arial Narrow', Impact, sans-serif;
}

body { background: var(--paper); color: var(--ink); }
:where(button, a, input, select, textarea):focus-visible {
  outline: 3px solid var(--control-focus);
  outline-offset: 3px;
}
:where(button):not(:disabled) { cursor: pointer; }
:where(button):disabled { opacity: .65; cursor: wait; }

.customer-hero :focus-visible, .menu-browser :focus-visible {
  outline-color: var(--gold);
}
#modal-customize::backdrop { background: rgb(48 37 30 / 68%); }

.customer-hero {
  position: relative; isolation: isolate; overflow: hidden;
  display: flex; align-items: end; justify-content: space-between; flex-wrap: wrap;
  min-height: 203px; gap: 1rem 1.5rem; padding: clamp(1rem, 2.8vw, 2rem);
  border: 1px solid var(--dark-line); border-radius: 1.05rem;
  background: var(--charcoal); color: var(--cream);
  box-shadow: 0 6px 18px -12px rgb(71 49 33 / 25%);
}
.customer-hero::before {
  content: ''; position: absolute; z-index: -2; inset: 0 0 0 auto;
  width: min(61%, 650px); background: url('./carta/burger-carta.webp') 68% 26% / cover no-repeat;
  mask-image: linear-gradient(90deg, transparent, black 29%);
}
.customer-hero::after {
  content: ''; position: absolute; z-index: -1; inset: 0;
  background: linear-gradient(90deg, #32261f 27%, rgb(50 38 31 / .86) 49%, rgb(50 38 31 / .22) 100%);
}
.customer-hero h1 { font: 800 clamp(2.6rem, 5.8vw, 5rem)/.88 var(--display); text-transform: uppercase; max-width: 10ch; }
.customer-hero p { margin-top: .65rem; font-size: .83rem; color: var(--on-dark-muted); }
.customer-hero-controls { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.order-modes { display: flex; padding: 3px; gap: 3px; border-radius: 11px; background: #2c211b; border: 1px solid #594437; }
.customer-hero-controls button, .customer-hero-controls select { min-height: 44px; }
.customer-hero-controls select { background: #2c211b; color: var(--control-highlight); border-color: var(--dark-line); }
#btn-show-qr { background: var(--surface-dark-hover); border: 1px solid var(--dark-line); color: var(--cream); }
#btn-show-qr:hover { background: #654a38; }
.order-modes button[aria-pressed="true"] { background: var(--gold); color: var(--ink); }

.menu-browser {
  background: var(--carta-bg);
  color: var(--carta-text);
  border-color: var(--carta-border);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.menu-browser :is(button, a, input, select):focus-visible {
  outline: 2px solid var(--carta-accent);
  outline-offset: 2px;
}

/* MenuHeader */
.carta-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  min-height: 56px;
  padding: .5rem .875rem;
  background: var(--carta-surface);
  border-bottom: 1px solid rgb(128 101 78 / 45%);
}
.carta-header-brand {
  display: flex;
  align-items: center;
  gap: .55rem;
  min-width: 0;
}
.carta-brand-icon {
  display: grid;
  place-items: center;
  color: var(--carta-accent);
  flex: none;
}
.carta-header-title {
  font: 800 clamp(1.35rem, 2.4vw, 1.75rem)/1 var(--display);
  letter-spacing: .01em;
  color: var(--carta-text);
  white-space: nowrap;
}
.menu-order-context {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: .2rem .68rem;
  border-radius: 999px;
  border: 1px solid var(--carta-border);
  background: var(--carta-surface-2);
  color: var(--carta-accent);
  font-size: .76rem;
  font-weight: 750;
  white-space: nowrap;
}
.menu-order-context[hidden] { display: none; }

.carta-header-right {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  margin-inline-start: auto;
  flex: none;
}
.carta-tracker-pill {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  min-height: 36px;
  padding: .25rem .72rem;
  border-radius: 999px;
  border: 1px solid rgb(229 178 96 / 55%);
  background: var(--carta-surface-2);
  color: var(--carta-text);
  font-size: .75rem;
  font-weight: 750;
  white-space: nowrap;
  touch-action: manipulation;
  transition: background-color .16s ease, border-color .16s ease;
}
.carta-tracker-pill[hidden] { display: none; }
.carta-tracker-pill:hover { border-color: var(--carta-accent); background: #664c3b; }
.carta-tracker-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  flex: none;
  background: #4ade80;
  box-shadow: 0 0 0 3px rgb(74 222 128 / 22%);
}
.carta-tracker-pill[data-has-active="false"] .carta-tracker-dot {
  background: var(--carta-accent);
  box-shadow: 0 0 0 3px rgb(229 178 96 / 20%);
}
@media (max-width: 359px) {
  .carta-header { gap: .4rem; padding-inline: .6rem; }
  .carta-header-brand { gap: .38rem; }
  .menu-order-context { padding-inline: .5rem; font-size: .72rem; }
  .carta-tracker-pill { padding-inline: .52rem; font-size: .72rem; }
}

.carta-header-actions {
  display: none;
  align-items: center;
  gap: .65rem;
}
.carta-mode-switch {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px;
  border-radius: .75rem;
  background: var(--carta-bg);
  border: 1px solid var(--carta-border);
}
.carta-mode-switch button {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  min-height: 38px;
  padding: .35rem .85rem;
  border-radius: .55rem;
  font-size: .84rem;
  font-weight: 700;
  color: var(--carta-text-muted);
  background: transparent;
  transition: background-color .16s ease, color .16s ease;
}
.carta-mode-switch button svg { width: 1rem; height: 1rem; }
.carta-mode-switch button:hover:not([aria-pressed="true"]) {
  color: var(--carta-text);
  background: rgb(89 67 53 / 60%);
}
.carta-mode-switch button[aria-pressed="true"] {
  background: var(--carta-text);
  color: #2B1D16;
  font-weight: 800;
}

.carta-order-btn {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  min-height: 44px;
  padding: .45rem 1rem;
  border-radius: .75rem;
  font-size: .85rem;
  font-weight: 800;
  background: var(--carta-surface-2);
  color: var(--carta-text);
  border: 1px solid var(--carta-border);
  transition: transform .18s ease, background-color .16s ease, color .16s ease;
}
.carta-order-btn svg { width: 1.05rem; height: 1.05rem; }
.carta-order-btn[data-has-items="true"] {
  background: var(--carta-accent);
  color: #2B1D16;
  border-color: transparent;
}
.carta-order-btn:hover { background: var(--control-highlight); color: #2B1D16; border-color: transparent; }
.carta-order-btn[hidden] { display: none; }
.is-updated { animation: cart-link-pop .28s ease; }
@keyframes cart-link-pop {
  0% { transform: scale(1); }
  50% { transform: scale(1.06); }
  100% { transform: scale(1); }
}

/* Desktop Sidebar + Main Stage */
.carta-desktop-shell {
  display: block;
  flex: 1;
  min-height: 0;
}
.carta-sidebar {
  display: none;
}
.carta-main-stage {
  min-width: 0;
  padding: .625rem .5rem .85rem;
}
.carta-visual-shell { display: grid; }
.carta-visual-shell[hidden],
.carta-explore-panel[hidden] { display: none; }

.carta-cat-main {
  display: inline-flex;
  align-items: center;
  gap: .65rem;
  min-width: 0;
}
.carta-cat-icon {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  flex: none;
}
.carta-cat-icon svg { width: 1.15rem; height: 1.15rem; }
.carta-cat-label { overflow-wrap: anywhere; }

/* Explore View (Explorar) */
.carta-explore-panel {
  display: grid;
  gap: .875rem;
  max-width: 72rem;
  margin-inline: auto;
  padding: .35rem .35rem 1rem;
}
.carta-explore-controls {
  display: grid;
  gap: .65rem;
  padding: .85rem;
  border-radius: .95rem;
  background: var(--carta-surface);
  border: 1px solid var(--carta-border);
}
.carta-search-field {
  position: relative;
  display: flex;
  align-items: center;
}
.carta-search-field svg {
  position: absolute;
  left: .85rem;
  width: 1rem;
  height: 1rem;
  color: var(--carta-text-muted);
  pointer-events: none;
}
.carta-search-field input {
  width: 100%;
  min-height: 44px;
  padding: .55rem .9rem .55rem 2.5rem;
  border-radius: .75rem;
  background: var(--carta-bg);
  color: var(--carta-text);
  border: 1px solid var(--carta-border);
  font-size: .92rem;
}
.carta-search-field input::placeholder { color: var(--carta-text-muted); opacity: .85; }
.carta-explore-cats {
  display: flex;
  align-items: center;
  gap: .45rem;
  overflow-x: auto;
  padding-bottom: .15rem;
  scrollbar-width: thin;
}
.carta-explore-chip {
  min-height: 40px;
  padding: .35rem .85rem;
  border-radius: 999px;
  background: var(--carta-surface-2);
  color: var(--carta-text-muted);
  border: 1px solid rgb(128 101 78 / 45%);
  font-size: .8rem;
  font-weight: 700;
  white-space: nowrap;
  transition: background-color .16s ease, color .16s ease;
}
.carta-explore-chip:hover:not([aria-pressed="true"]) {
  color: var(--carta-text);
  border-color: var(--carta-border);
}
.carta-explore-chip[aria-pressed="true"] {
  background: var(--carta-accent);
  color: #2B1D16;
  border-color: transparent;
  font-weight: 800;
}
.carta-explore-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr));
  gap: .75rem;
}
.carta-product-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: .75rem;
  padding: .95rem;
  border-radius: .95rem;
  background: var(--cream);
  color: var(--ink);
  border: 1px solid var(--line);
}
.carta-product-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: .5rem;
}
.carta-product-card-head h3 {
  font-size: .95rem;
  font-weight: 800;
  line-height: 1.3;
  color: var(--ink);
}
.carta-station-tag {
  padding: .16rem .48rem;
  border-radius: .4rem;
  font-size: .66rem;
  font-weight: 800;
  letter-spacing: .03em;
  flex: none;
}
.carta-station-tag.is-kitchen { background: var(--warning-fill); color: var(--warning-ink); }
.carta-station-tag.is-bar { background: var(--success-fill); color: var(--success-ink); }
.carta-product-card-desc {
  margin-top: .35rem;
  font-size: .8rem;
  line-height: 1.45;
  color: var(--text-muted);
}
.carta-product-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  padding-top: .6rem;
  border-top: 1px solid var(--line);
}
.carta-product-card-price {
  font-size: 1rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}
.carta-product-add {
  min-height: 44px;
  padding: .45rem .95rem;
  border-radius: .7rem;
  background: var(--carta-accent);
  color: #2B1D16;
  border: 1px solid #ac7c40;
  font-size: .82rem;
  font-weight: 800;
}
.carta-product-add:hover { background: var(--control-highlight); }
.carta-explore-empty {
  grid-column: 1 / -1;
  padding: 2rem 1rem;
  text-align: center;
  color: var(--carta-text-muted);
  font-size: .9rem;
}

.menu-browser .carta-spot { border-inline-start-color: var(--carta-accent); }
.menu-browser .carta-spot:focus-visible { outline-color: white; }

/* Accessible interactive book presentation */
.carta-book-stage {
  position: relative;
  perspective: 2200px;
  touch-action: pan-y pinch-zoom;
  user-select: none;
  -webkit-user-select: none;
}
.carta-sheet {
  position: relative;
  margin-inline: auto;
  border-radius: 10px;
  background: #140e0b;
  border: 2px solid #5a3c29;
  box-shadow: 0 18px 38px rgb(10 6 4 / 55%);
}
.carta-sheet[data-book-mode="single"] {
  max-width: 590px;
  border-radius: 5px 12px 12px 5px;
}
.carta-sheet[data-book-mode="single"][data-remaining="1"] {
  box-shadow: 3px 3px 0 #d4bba0, 5px 5px 0 #3f2b1e, 0 16px 32px rgb(10 6 4 / 50%);
}
.carta-sheet[data-book-mode="single"][data-remaining="2"] {
  box-shadow: 3px 3px 0 #d4bba0, 5px 5px 0 #3f2b1e, 8px 7px 0 #b89f80, 10px 9px 0 #3a271b, 0 18px 36px rgb(10 6 4 / 52%);
}
.carta-sheet[data-book-mode="single"][data-remaining="3"],
.carta-sheet[data-book-mode="single"][data-remaining="4"] {
  box-shadow: 3px 3px 0 #d4bba0, 5px 5px 0 #3f2b1e, 8px 7px 0 #c6ad8f, 10px 9px 0 #3a271b, 13px 11px 0 #a98f70, 0 20px 38px rgb(10 6 4 / 55%);
}
.carta-sheet[data-book-mode="spread"] {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  max-width: 100%;
  border: 4px solid #3d281b;
  box-shadow:
    inset 0 0 0 1px #674934,
    -4px 4px 0 #d4bba0,
    4px 4px 0 #d4bba0,
    0 20px 42px rgb(8 5 3 / 62%);
}
.carta-page-leaf {
  position: relative;
  width: 100%;
  aspect-ratio: 559 / 790;
  overflow: hidden;
  background: #121212;
  container-type: inline-size;
}
.carta-page-leaf--single { border-radius: 3px 10px 10px 3px; }
.carta-page-leaf--left { border-radius: 6px 0 0 6px; }
.carta-page-leaf--right { border-radius: 0 6px 6px 0; }
.carta-page-leaf--single::before {
  content: '';
  position: absolute;
  inset: 0 auto 0 0;
  width: 18px;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(90deg, rgb(0 0 0 / 55%), rgb(255 245 220 / 12%) 35%, transparent 100%);
}
.carta-page-leaf--left::after {
  content: '';
  position: absolute;
  inset: 0 0 0 auto;
  width: 24px;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(270deg, rgb(0 0 0 / 55%), rgb(0 0 0 / 16%) 45%, transparent 100%);
}
.carta-page-leaf--right::before {
  content: '';
  position: absolute;
  inset: 0 auto 0 0;
  width: 24px;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(90deg, rgb(0 0 0 / 55%), rgb(0 0 0 / 14%) 45%, transparent 100%);
}
.carta-book-spine {
  position: absolute;
  inset: 0 auto 0 50%;
  width: 6px;
  transform: translateX(-50%);
  z-index: 2;
  pointer-events: none;
  background: linear-gradient(90deg, rgb(12 8 6 / 80%), rgb(140 100 66 / 45%) 50%, rgb(12 8 6 / 80%));
}
.carta-leaf-number {
  position: absolute;
  bottom: .45rem;
  right: .55rem;
  z-index: 1;
  pointer-events: none;
  min-width: 1.55rem;
  padding: .12rem .42rem;
  border-radius: 999px;
  background: rgb(24 19 17 / 82%);
  border: 1px solid rgb(255 195 70 / 45%);
  color: var(--cream);
  font-size: .72rem;
  font-weight: 800;
  text-align: center;
  line-height: 1.2;
}
.carta-page-leaf--left .carta-leaf-number { right: auto; left: .55rem; }

/* 3D Page-Flip Overlay (decorative, pointer-events: none) */
.carta-book-flip {
  position: absolute;
  inset: 0;
  margin-inline: auto;
  pointer-events: none;
  z-index: 4;
  transform-style: preserve-3d;
}
.carta-book-flip[data-book-mode="single"] { max-width: 590px; }
.carta-book-flip[data-book-mode="spread"] { max-width: 100%; }
.carta-flip-sheet, .carta-flip-spread-leaf {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
}
.carta-flip-sheet { transform-origin: left center; }
.carta-flip-sheet--next { animation: carta-turn-single-next .42s cubic-bezier(.22, .61, .36, 1) forwards; }
.carta-flip-sheet--prev { animation: carta-turn-single-prev .4s cubic-bezier(.22, .61, .36, 1) forwards; }
.carta-flip-spread-leaf--next {
  left: 50%;
  width: 50%;
  transform-origin: left center;
  z-index: 2;
  animation: carta-turn-spread-next .48s cubic-bezier(.22, .61, .36, 1) forwards;
}
.carta-flip-spread-leaf--prev {
  left: 0;
  width: 50%;
  transform-origin: right center;
  z-index: 2;
  animation: carta-turn-spread-prev .48s cubic-bezier(.22, .61, .36, 1) forwards;
}
.carta-flip-underlay {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 50%;
  z-index: 1;
  overflow: hidden;
  animation: carta-underlay-hold .48s linear forwards;
}
.carta-flip-underlay--left { left: 0; border-radius: 6px 0 0 6px; }
.carta-flip-underlay--right { right: 0; border-radius: 0 6px 6px 0; }
.carta-flip-underlay img { display: block; width: 100%; height: 100%; object-fit: cover; }
.carta-flip-face {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  overflow: hidden;
  border-radius: 6px;
  background: #140e0b;
  box-shadow: 0 10px 28px rgb(0 0 0 / 48%);
}
.carta-flip-face img { display: block; width: 100%; height: 100%; object-fit: cover; }
.carta-flip-face--back { transform: rotateY(180deg); }
.carta-flip-cardstock {
  background: linear-gradient(135deg, #271a13, #17100c);
  border: 1px solid #593b29;
}

@keyframes carta-turn-single-next {
  0% { transform: rotateY(0deg); opacity: 1; }
  65% { transform: rotateY(-102deg); opacity: 1; }
  100% { transform: rotateY(-150deg); opacity: 0; }
}
@keyframes carta-turn-single-prev {
  0% { transform: rotateY(-115deg); opacity: .25; }
  35% { opacity: 1; }
  100% { transform: rotateY(0deg); opacity: 1; }
}
@keyframes carta-turn-spread-next {
  0% { transform: rotateY(0deg); }
  100% { transform: rotateY(-180deg); }
}
@keyframes carta-turn-spread-prev {
  0% { transform: rotateY(0deg); }
  100% { transform: rotateY(180deg); }
}
@keyframes carta-underlay-hold {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0; }
}

/* Interactive book workspace, discrete arrows, single pagination pill */
.carta-book-workspace {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 44px;
  align-items: center;
  gap: .625rem .5rem;
  width: 100%;
  container-type: inline-size;
}
#carta-book-stage {
  grid-column: 1 / -1;
  grid-row: 1;
  width: 100%;
  display: grid;
  place-items: center;
}
.carta-book-workspace .carta-sheet[data-book-mode="single"] {
  width: min(100%, 34rem, calc(var(--carta-book-max-h, 70dvh) * 559 / 790));
  max-width: 100%;
}
.carta-nav-prev { grid-column: 1; grid-row: 2; justify-self: start; }
.carta-pagination-bar {
  grid-column: 2;
  grid-row: 2;
  justify-self: center;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: .35rem .55rem;
  min-width: 0;
}
.carta-nav-next { grid-column: 3; grid-row: 2; justify-self: end; }
.carta-nav-btn {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 999px;
  background: var(--carta-surface);
  color: var(--carta-text);
  border: 1px solid var(--carta-border);
  transition: background-color .16s ease, color .16s ease, border-color .16s ease, opacity .16s ease, transform .16s ease;
}
.carta-nav-btn svg { width: 1.25rem; height: 1.25rem; stroke-width: 2.25; }
.carta-nav-btn:hover:not([aria-disabled="true"]) {
  background: var(--carta-surface-2);
  border-color: var(--carta-accent);
  color: var(--carta-accent);
}
.carta-nav-btn:active:not([aria-disabled="true"]) { transform: scale(.96); }
.carta-nav-btn[aria-disabled="true"] { opacity: .36; cursor: not-allowed; }
.carta-page-counter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: .2rem .85rem;
  border-radius: 999px;
  background: var(--carta-surface);
  border: 1px solid var(--carta-border);
  color: var(--carta-text);
  font-size: .82rem;
  font-weight: 700;
  letter-spacing: .01em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.carta-drinks-note {
  font-size: .75rem;
  color: var(--carta-text-muted);
  padding: .15rem .55rem;
  border-radius: 999px;
  background: rgb(229 178 96 / 12%);
  border: 1px solid rgb(229 178 96 / 30%);
}
.carta-drinks-note[hidden] { display: none; }

/* Mobile & Tablet fixed Bottom Navigation Bar */
.carta-mobile-nav {
  position: fixed;
  inset: auto 0 0 0;
  z-index: 45;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: stretch;
  min-height: calc(4.25rem + env(safe-area-inset-bottom));
  padding: .25rem max(.35rem, env(safe-area-inset-left)) env(safe-area-inset-bottom) max(.35rem, env(safe-area-inset-right));
  background: var(--carta-surface);
  border-top: 1px solid rgb(128 101 78 / 55%);
}
.carta-mobile-nav button {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .22rem;
  min-width: 48px;
  min-height: 54px;
  padding: .35rem .25rem;
  border: 0;
  border-radius: .625rem;
  background: transparent;
  color: var(--carta-text-muted);
  font-size: .72rem;
  font-weight: 600;
  line-height: 1.1;
  transition: color .16s ease, background-color .16s ease;
}
.carta-mobile-nav button:hover { color: var(--carta-text); }
.carta-mobile-nav button:focus-visible { outline: 2px solid var(--carta-accent); outline-offset: -2px; }
.carta-mobile-nav button[aria-pressed="true"] {
  color: var(--carta-accent);
  font-weight: 700;
}
.carta-nav-icon-wrap {
  position: relative;
  display: grid;
  place-items: center;
  width: 28px;
  height: 24px;
}
.carta-nav-icon-wrap svg { width: 1.25rem; height: 1.25rem; stroke-width: 2; }
.carta-nav-badge {
  position: absolute;
  top: -4px;
  right: -9px;
  min-width: 18px;
  height: 18px;
  padding: 0 .28rem;
  border-radius: 999px;
  display: inline-grid;
  place-items: center;
  font-size: .68rem;
  font-weight: 800;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  background: var(--carta-surface-2);
  color: var(--carta-text);
  border: 1px solid var(--carta-border);
}
.carta-nav-badge[data-has-items="true"] {
  background: var(--carta-accent);
  color: #2B1D16;
  border-color: var(--carta-surface);
}

/* Category Bottom Sheet (Mobile & Tablet) */
#carta-sheet-backdrop[hidden],
#carta-category-sheet[hidden] { display: none; }
body[data-category-sheet-open] { overflow: hidden; }
.carta-sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 55;
  background: var(--carta-overlay);
  backdrop-filter: blur(2px);
}
.carta-category-sheet {
  position: fixed;
  inset: auto 0 0 0;
  z-index: 60;
  margin-inline: auto;
  width: min(100%, 34rem);
  max-height: 82dvh;
  overflow-y: auto;
  overscroll-behavior: contain;
  display: flex;
  flex-direction: column;
  gap: .625rem;
  padding: .5rem 1rem calc(1.125rem + env(safe-area-inset-bottom));
  background: var(--carta-surface);
  color: var(--carta-text);
  border-top: 1px solid var(--carta-border);
  border-radius: 1.125rem 1.125rem 0 0;
  box-shadow: 0 -16px 40px rgb(0 0 0 / 50%);
  animation: cart-drawer-in-up .22s cubic-bezier(.22, .61, .36, 1);
}
@media (min-width: 560px) {
  .carta-category-sheet { border-inline: 1px solid var(--carta-border); }
}
.carta-sheet-grabber {
  display: grid;
  place-items: center;
  flex: none;
  width: 100%;
  min-height: 22px;
  padding: .25rem 0;
  cursor: grab;
  touch-action: none;
}
.carta-sheet-grabber span {
  display: block;
  width: 40px;
  height: 4px;
  border-radius: 999px;
  background: var(--carta-border);
}
.carta-sheet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  touch-action: none;
}
.carta-sheet-title-wrap {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
}
.carta-sheet-title-wrap svg {
  width: 1.15rem;
  height: 1.15rem;
  color: var(--carta-accent);
}
.carta-sheet-title-wrap h2 {
  margin: 0;
  font: 700 1.35rem/1.1 var(--display);
  color: var(--carta-text);
}
.carta-sheet-close {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: .625rem;
  border: 1px solid var(--carta-border);
  background: var(--carta-surface-2);
  color: var(--carta-text);
  transition: border-color .16s ease, color .16s ease;
}
.carta-sheet-close svg { width: 1.15rem; height: 1.15rem; }
.carta-sheet-close:hover { border-color: var(--carta-accent); color: var(--carta-accent); }
.carta-sheet-list {
  display: grid;
  gap: .5rem;
}
.carta-sheet-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  width: 100%;
  min-height: 52px;
  padding: .75rem 1rem;
  border-radius: .75rem;
  border: 1px solid var(--carta-border);
  background: var(--carta-surface-2);
  color: var(--carta-text);
  text-align: left;
  font-size: .95rem;
  font-weight: 650;
  transition: background-color .16s ease, color .16s ease, border-color .16s ease;
}
.carta-sheet-item:hover:not([aria-pressed="true"]) { border-color: var(--carta-accent); }
.carta-sheet-item[aria-pressed="true"] {
  background: var(--carta-accent);
  color: #2B1D16;
  border-color: transparent;
  font-weight: 750;
}
.carta-sheet-trail {
  display: inline-flex;
  align-items: center;
  flex: none;
}
.carta-sheet-trail svg { width: 1.1rem; height: 1.1rem; }
.carta-sheet-item .carta-cat-check { display: none; }
.carta-sheet-item[aria-pressed="true"] .carta-cat-check { display: block; }
.carta-sheet-item[aria-pressed="true"] .carta-cat-chevron { display: none; }

@media (min-width: 768px) {
  .carta-main-stage { padding: .875rem 1rem 1rem; }
  .carta-book-workspace {
    grid-template-columns: minmax(44px, 1fr) auto minmax(44px, 1fr);
    gap: .75rem .875rem;
    align-content: center;
    justify-items: center;
  }
  .carta-nav-prev { grid-column: 1; grid-row: 1; justify-self: end; }
  #carta-book-stage { grid-column: 2; grid-row: 1; width: auto; max-width: 100%; }
  .carta-nav-next { grid-column: 3; grid-row: 1; justify-self: start; }
  .carta-pagination-bar { grid-column: 1 / -1; grid-row: 2; width: 100%; }
  .carta-book-workspace .carta-sheet[data-book-mode="single"] {
    width: min(calc(100cqw - 116px), 42rem, calc(var(--carta-book-max-h, 74dvh) * 559 / 790));
    max-width: 100%;
  }
  .carta-book-workspace .carta-sheet[data-book-mode="spread"] {
    width: min(calc(100cqw - 116px), calc(var(--carta-book-max-h, 74dvh) * 1118 / 790));
    max-width: 100%;
  }
}

@media (min-width: 1024px) {
  .carta-header { min-height: 64px; padding: .625rem 1.25rem; }
  .carta-header-actions { display: inline-flex; }
  .carta-mobile-nav { display: none; }
  .carta-desktop-shell {
    display: grid;
    grid-template-columns: 224px minmax(0, 1fr);
    align-items: stretch;
  }
  .carta-sidebar {
    display: flex;
    flex-direction: column;
    gap: .75rem;
    padding: 1rem .75rem;
    background: var(--carta-surface);
    border-right: 1px solid rgb(128 101 78 / 38%);
  }
  .carta-sidebar-title {
    margin: 0 .35rem;
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--carta-text-muted);
  }
  .carta-sidebar-nav {
    display: grid;
    gap: .375rem;
  }
  .carta-sidebar-item {
    display: flex;
    align-items: center;
    width: 100%;
    min-height: 44px;
    padding: .6rem .8rem;
    border-radius: .75rem;
    border: 1px solid transparent;
    background: transparent;
    color: var(--carta-text-muted);
    font-size: .88rem;
    font-weight: 600;
    text-align: left;
    transition: background-color .16s ease, color .16s ease, border-color .16s ease;
  }
  .carta-sidebar-item:hover:not([aria-pressed="true"]) {
    background: var(--carta-surface-2);
    color: var(--carta-text);
    border-color: rgb(128 101 78 / 45%);
  }
  .carta-sidebar-item[aria-pressed="true"] {
    background: var(--carta-accent);
    color: #2B1D16;
    font-weight: 750;
    border-color: transparent;
  }
  .carta-main-stage {
    padding: 1rem 1.25rem;
    display: flex;
    flex-direction: column;
  }
  .carta-visual-shell:not([hidden]) {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
  }
  .carta-book-workspace {
    flex: 1;
    min-height: 0;
  }
}

@media (min-width: 1440px) {
  .carta-desktop-shell { grid-template-columns: 240px minmax(0, 1fr); }
  .carta-sidebar { padding: 1.125rem .875rem; }
  .carta-main-stage { padding: 1.125rem 1.5rem; }
}

/* Order Form (#client-cart) — Desktop & Mobile */
#client-cart {
  border-color: var(--line);
  background: var(--cream);
  overflow: hidden;
  box-shadow: 0 10px 26px rgb(24 19 17 / 8%);
}
#client-cart:not([hidden]) {
  display: flex;
  flex-direction: column;
}
.checkout-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  padding: .9rem 1rem;
  background: var(--charcoal);
  color: var(--cream);
  border-bottom: 1px solid #4a3123;
}
.checkout-header-title { min-width: 0; }
#client-cart .cart-heading { font-size: 1.75rem; color: var(--cream); }
.checkout-origin {
  display: inline-block;
  margin-top: .22rem;
  color: var(--gold);
  font-size: .82rem;
  font-weight: 750;
}
.checkout-header-actions {
  display: flex;
  align-items: center;
  gap: .45rem;
  flex: none;
}
.checkout-clear {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  flex: none;
  min-height: 40px;
  padding: .4rem .75rem;
  border-radius: .6rem;
  border: 1px solid #7d5d48;
  background: #33231a;
  color: #ffd7c9;
  font-size: .8rem;
  font-weight: 750;
}
.checkout-clear:hover { background: #4a3225; border-color: #b7775f; }
.checkout-clear[hidden] { display: none; }
.checkout-close {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: .65rem;
  border: 1px solid #866d5d;
  background: #33231a;
  color: var(--cream);
}
.checkout-close:hover { background: #4a3225; border-color: var(--gold); }
.checkout-close[hidden] { display: none; }

#client-cart-items {
  display: grid;
  gap: .65rem;
  padding: .9rem 1rem;
}
.checkout-empty {
  display: grid;
  gap: .3rem;
  padding: 1.5rem 1rem;
  border: 1.5px dashed var(--line);
  border-radius: .8rem;
  background: #fffcf6;
  text-align: center;
}
.checkout-empty p { font-size: .95rem; font-weight: 800; color: var(--ink); }
.checkout-empty span { font-size: .82rem; color: var(--text-muted); line-height: 1.4; }
.checkout-empty-browse {
  justify-self: center;
  margin-top: .45rem;
  min-height: 44px;
  padding: .5rem 1.1rem;
  border-radius: .65rem;
  background: var(--gold);
  color: var(--ink);
  font-size: .85rem;
  font-weight: 800;
}
.checkout-empty-browse:hover { background: #ffda82; }

.checkout-item {
  display: grid;
  gap: .4rem;
  padding: .75rem .85rem;
  border: 1px solid var(--line);
  border-radius: .8rem;
  background: #fffcf6;
}
.checkout-item-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: .65rem;
}
.checkout-item-title {
  display: grid;
  gap: .1rem;
  min-width: 0;
}
.checkout-item-title strong {
  font-size: .9rem;
  font-weight: 800;
  line-height: 1.3;
  color: var(--ink);
  overflow-wrap: anywhere;
}
.checkout-item-unit {
  font-size: .75rem;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}
.checkout-item-price {
  flex: none;
  font-size: .92rem;
  font-weight: 850;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.checkout-item-meta {
  font-size: .78rem;
  line-height: 1.35;
  color: var(--text-muted);
  overflow-wrap: anywhere;
}
.checkout-item-flavors {
  color: #7c3518;
  font-weight: 700;
}
.checkout-item-note {
  justify-self: start;
  padding: .2rem .5rem;
  border-radius: .4rem;
  background: #ffedbc;
  color: #5e380b;
  font-size: .76rem;
  font-weight: 700;
  overflow-wrap: anywhere;
}
.checkout-item-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  margin-top: .2rem;
}
.checkout-stepper {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: .6rem;
  background: #ffffff;
  overflow: hidden;
}
#client-cart [data-cc-inc], #client-cart [data-cc-dec] {
  width: 38px;
  height: 38px;
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--ink);
  background: transparent;
}
#client-cart [data-cc-inc]:hover, #client-cart [data-cc-dec]:hover { background: var(--paper); }
.checkout-qty-num {
  min-width: 1.9rem;
  text-align: center;
  font-size: .88rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.checkout-item-del {
  min-height: 38px;
  padding: .35rem .65rem;
  border-radius: .55rem;
  font-size: .78rem;
  font-weight: 750;
  color: var(--danger-ink);
}
.checkout-item-del:hover { background: var(--danger-fill); }

#client-checkout[hidden] { display: none; }
#client-checkout {
  display: grid;
  container-type: inline-size;
}
.checkout-fields {
  display: grid;
  gap: .85rem;
  padding: .9rem 1rem;
  border-top: 1px solid var(--line);
}
.checkout-field {
  display: grid;
  gap: .35rem;
  min-width: 0;
}
.checkout-field label {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: .5rem;
  font-size: .84rem;
  font-weight: 750;
  color: var(--ink);
}
.checkout-badge-opt {
  font-size: .74rem;
  font-weight: 600;
  color: var(--text-muted);
}
.checkout-badge-req {
  font-size: .72rem;
  font-weight: 750;
  color: var(--danger-ink);
}
.checkout-badge-opt[hidden], .checkout-badge-req[hidden] { display: none; }

#client-checkout input:not([type="checkbox"]) {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  padding: .55rem .75rem;
  border: 1.5px solid #cbb497;
  border-radius: .65rem;
  background: #ffffff;
  color: var(--ink);
  font-size: 1rem;
  line-height: 1.35;
  transition: border-color .15s ease, box-shadow .15s ease;
}
#client-checkout input:not([type="checkbox"]):focus {
  border-color: #a7521c;
}
#client-checkout input[aria-invalid="true"] {
  border-color: #b91c1c;
  background: #fff5f5;
}
#client-cart input::placeholder, #client-cart textarea::placeholder { color: #8b725d; }

.checkout-option {
  display: flex;
  align-items: center;
  gap: .65rem;
  min-height: 46px;
  padding: .55rem .8rem;
  border: 1.5px solid var(--line);
  border-radius: .7rem;
  background: #fffcf6;
  font-size: .9rem;
  font-weight: 750;
  cursor: pointer;
}
.checkout-option input {
  width: 1.2rem;
  height: 1.2rem;
  flex: none;
  accent-color: #8c351d;
}
.checkout-option:has(input:checked) {
  border-color: #946018;
  background: #ffedbc;
}
.checkout-option[hidden] { display: none; }

.checkout-tapers {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  padding: .6rem .8rem;
  border: 1px solid var(--line);
  border-radius: .7rem;
  background: #fffcf6;
}
.checkout-tapers[hidden] { display: none; }
.checkout-tapers-info {
  display: grid;
  gap: .1rem;
}
.checkout-tapers-info label {
  font-size: .86rem;
  font-weight: 750;
  color: var(--ink);
}
.checkout-tapers-info span {
  font-size: .75rem;
  color: var(--text-muted);
}
.checkout-taper-stepper {
  display: inline-flex;
  align-items: center;
  gap: .25rem;
}
.checkout-taper-stepper button {
  width: 40px;
  height: 40px;
  border: 1px solid #cbb497;
  border-radius: .55rem;
  background: #ffffff;
  color: var(--ink);
  font-size: 1.05rem;
  font-weight: 800;
}
.checkout-taper-stepper button:hover:not(:disabled) { background: var(--paper); }
.checkout-taper-stepper button:disabled { opacity: .45; cursor: not-allowed; }
#client-checkout input#client-tapers {
  width: 3.4rem;
  text-align: center;
  padding: .4rem .25rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  appearance: textfield;
  -moz-appearance: textfield;
}
#client-checkout input#client-tapers::-webkit-inner-spin-button,
#client-checkout input#client-tapers::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

#client-delivery-fields:not(.hidden) {
  display: grid;
  gap: .8rem;
  padding: .9rem;
  border: 1px solid #bed1ae;
  border-radius: .85rem;
  background: #eff5e9;
}
.checkout-delivery-head {
  display: flex;
  align-items: center;
  gap: .45rem;
  font-size: .84rem;
  font-weight: 800;
  color: #193324;
}
.checkout-payment {
  display: grid;
  gap: .6rem;
  min-width: 0;
  padding-top: .35rem;
  border-top: 1px solid #cde0be;
}
.checkout-payment legend {
  font-size: .84rem;
  font-weight: 800;
  color: #193324;
  margin-bottom: .35rem;
}
.checkout-methods {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .4rem;
}
.del-pay-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: .35rem .25rem;
  border: 1.5px solid #b6c8a8;
  border-radius: .65rem;
  background: #ffffff;
  color: var(--ink);
  font-size: .84rem;
  font-weight: 800;
  line-height: 1.15;
}
.del-pay-btn span { font-size: .7rem; font-weight: 700; color: #783318; }
.del-pay-btn[aria-pressed="true"] {
  background: var(--charcoal);
  border-color: var(--charcoal);
  color: var(--cream);
}
.del-pay-btn[aria-pressed="true"] span { color: var(--gold); }
.checkout-pay-info {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: .45rem .65rem;
  padding: .6rem .75rem;
  border-radius: .6rem;
  border: 1px solid #cde0be;
  background: #ffffff;
  font-size: .8rem;
  line-height: 1.35;
  color: #193324;
}
p.checkout-pay-info { display: block; }
.checkout-pay-info[hidden] { display: none; }
.checkout-copy-btn {
  min-height: 34px;
  padding: .25rem .65rem;
  border-radius: .5rem;
  border: 1px solid #96b086;
  background: #ecf1df;
  color: #193324;
  font-size: .75rem;
  font-weight: 800;
}
.checkout-copy-btn:hover { background: #dce7cb; }

.checkout-remote-modes {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .45rem;
}
.checkout-remote-modes[hidden] { display: none; }
.checkout-remote-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  min-height: var(--action-height);
  padding: .45rem .6rem;
  border: 1.5px solid var(--line);
  border-radius: .7rem;
  background: #fffcf6;
  color: var(--ink);
  font-size: .82rem;
  font-weight: 800;
  line-height: 1.15;
  text-align: center;
  touch-action: manipulation;
  transition: background-color .16s ease, border-color .16s ease, color .16s ease;
}
.checkout-remote-btn svg { width: 1rem; height: 1rem; flex: none; }
.checkout-remote-btn:hover:not([aria-pressed="true"]) { border-color: #a77d49; background: #fff6e6; }
.checkout-remote-btn[aria-pressed="true"] {
  background: var(--charcoal);
  border-color: var(--charcoal);
  color: var(--cream);
}
.checkout-remote-btn[aria-pressed="true"] svg { color: var(--gold); }

.checkout-recojo-card {
  display: grid;
  gap: .7rem;
  padding: .85rem .9rem;
  border: 1px solid #d4bba0;
  border-radius: .85rem;
  background: #fffcf6;
}
.checkout-recojo-card[hidden] { display: none; }
.checkout-recojo-head {
  display: flex;
  align-items: flex-start;
  gap: .55rem;
  color: var(--ink);
}
.checkout-recojo-head svg {
  width: 1.15rem;
  height: 1.15rem;
  flex: none;
  margin-top: .1rem;
  color: #946018;
}
.checkout-recojo-title { font-size: .85rem; font-weight: 800; margin: 0; }
.checkout-recojo-sub { font-size: .76rem; color: var(--text-muted); margin: .15rem 0 0; }

.checkout-location-field { gap: .45rem; }
.checkout-location-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: .5rem;
  font-size: .84rem;
  font-weight: 750;
  color: var(--ink);
}
.checkout-location-prompt {
  margin: 0;
  font-size: .78rem;
  font-weight: 600;
  color: #244732;
}
.checkout-location-modes {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .4rem;
}
.checkout-loc-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .38rem;
  min-height: var(--action-height);
  padding: .45rem .55rem;
  border: 1.5px solid #b6c8a8;
  border-radius: .65rem;
  background: #ffffff;
  color: #193324;
  font-size: .78rem;
  font-weight: 800;
  line-height: 1.2;
  text-align: center;
  touch-action: manipulation;
  transition: background-color .16s ease, border-color .16s ease, color .16s ease;
}
.checkout-loc-btn svg { width: 1rem; height: 1rem; flex: none; }
.checkout-loc-btn:hover:not([aria-pressed="true"]) { border-color: #6b9e78; background: #f6faf2; }
.checkout-loc-btn[aria-pressed="true"] {
  background: var(--charcoal);
  border-color: var(--charcoal);
  color: var(--cream);
}
.checkout-loc-btn[aria-pressed="true"] svg { color: var(--gold); }
.checkout-loc-panel { display: grid; gap: .6rem; margin-top: .15rem; }
.checkout-loc-panel[hidden] { display: none; }
.checkout-gps-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .55rem;
  padding: .55rem .7rem;
  border-radius: .65rem;
  border: 1px solid #cde0be;
  background: #ffffff;
  font-size: .78rem;
  font-weight: 650;
  color: #193324;
}
.checkout-gps-status[data-state="ready"] {
  border-color: #6b9e78;
  background: #f2fbf4;
  color: #164e2e;
}
.checkout-gps-status[data-state="error"] {
  border-color: #d98282;
  background: #fff5f5;
  color: #991b1b;
}
.checkout-gps-action {
  min-height: 36px;
  padding: .25rem .65rem;
  flex: none;
  border-radius: .5rem;
  border: 1px solid #96b086;
  background: #ecf1df;
  color: #193324;
  font-size: .74rem;
  font-weight: 800;
  touch-action: manipulation;
}
.checkout-gps-action:hover:not(:disabled) { background: #dce7cb; }
.checkout-gps-action:disabled { opacity: .6; cursor: wait; }
.checkout-gps-link {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  width: fit-content;
  min-height: 32px;
  font-size: .78rem;
  font-weight: 750;
  color: #1d4ed8;
  text-decoration: underline;
}
.checkout-gps-link svg { width: .9rem; height: .9rem; flex: none; }
.checkout-gps-link[hidden] { display: none; }
@media (max-width: 359px) {
  .checkout-remote-modes,
  .checkout-location-modes {
    grid-template-columns: minmax(0, 1fr);
  }
}

.checkout-summary {
  display: grid;
  gap: .65rem;
  padding: .95rem 1rem 1rem;
  border-top: 1px solid var(--line);
  background: var(--paper);
}
.checkout-total {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: .5rem;
  font-size: 1.02rem;
  font-weight: 800;
  color: var(--ink);
}
#client-cart-total {
  font-size: 1.4rem;
  font-weight: 900;
  color: var(--rust);
  font-variant-numeric: tabular-nums;
}
#client-checkout-error:empty { display: none; }
#client-checkout-error {
  padding: .6rem .75rem;
  border: 1px solid #e0a096;
  border-radius: .6rem;
  background: #fbeae7;
  color: #7f1d1d;
  font-size: .83rem;
  font-weight: 750;
  line-height: 1.35;
}
#btn-submit-client-order, #btn-chef-complete-code {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  width: 100%;
  background: var(--gold); color: var(--ink); box-shadow: none; min-height: 52px; font-weight: 850;
  border-radius: .8rem;
  font-size: .98rem;
}
#btn-submit-client-order:hover, #btn-chef-complete-code:hover { background: #ffda82; }
#view-cliente input:not([type="hidden"]), #view-cliente select, #modal-customize input, #modal-customize select { font-size: 1rem; }

@media (min-width: 1024px) {
  body:not([data-public-menu]) .client-workspace-grid:not(:has(> #client-cart[hidden])) {
    grid-template-columns: minmax(0, 1fr) 24.5rem;
  }
  body:not([data-public-menu]) .client-workspace-grid:not(:has(> #client-cart[hidden])) > .menu-catalog-col,
  body:not([data-public-menu]) .client-workspace-grid:not(:has(> #client-cart[hidden])) > #client-cart {
    grid-column: auto;
    min-width: 0;
  }
  body:not([data-public-menu]) #client-cart:not([hidden]) {
    position: sticky;
    top: 5rem;
    max-height: calc(100dvh - 6rem);
    overflow-y: auto;
    overscroll-behavior: contain;
  }
  .checkout-header {
    position: sticky;
    top: 0;
    z-index: 2;
  }
  .checkout-summary {
    position: sticky;
    bottom: 0;
    z-index: 2;
    box-shadow: 0 -6px 16px rgb(24 19 17 / 8%);
  }
}

@media (min-width: 1380px) {
  body:not([data-public-menu]):has(#view-cliente:not(.hidden)) main {
    max-width: 90rem;
  }
  body:not([data-public-menu]) .client-workspace-grid:not(:has(> #client-cart[hidden])) {
    grid-template-columns: minmax(0, 1fr) 26rem;
  }
}

.operator-head { border-left: 4px solid #c77c31; box-shadow: none; }
.operator-title { color: var(--ink); }
.operator-caption { font-size: .875rem; line-height: 1.5; }
#admin-filter-tabs { flex-wrap: wrap; }
#admin-filter-tabs button, .gestion-tab { min-height: 40px; }
#admin-orders-grid > div, #chef-orders-list > div { box-shadow: none; }
.chef-keypad { background: var(--ink); border-color: #5d432e; color: var(--cream); box-shadow: none; }
.chef-keypad h2 { color: var(--cream); }
.chef-keypad .numpad-btn { min-height: 50px; }
.chef-keypad input { color: var(--gold); }
.management-nav .gestion-tab { display: flex; align-items: center; gap: .45rem; white-space: nowrap; }
.management-nav svg { width: 16px; height: 16px; }
.gestion-panel table th, .gestion-panel table td { padding-block: .75rem; }
.gestion-panel table tbody tr:hover { background: #f8ecda; }
.gestion-panel table thead { color: #564333; }
#modal-customize { background: var(--cream); color: var(--ink); border: 1px solid var(--line); }

@media (max-width: 600px) {
  .customer-hero { min-height: 0; gap: .85rem; }
  .customer-hero::before { width: 65%; }
  .customer-hero::after { background: linear-gradient(90deg, #1c130f 10%, rgb(28 19 15 / .82) 47%, rgb(28 19 15 / .22) 100%); }
  .customer-hero h1 { max-width: 8em; font-size: clamp(2.55rem, 10.5vw, 3.4rem); }
  .customer-hero p { margin-top: .4rem; }
  .customer-hero-controls { gap: .35rem; }
  .customer-hero-controls button, .customer-hero-controls select { font-size: .73rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
@media print {
  body { background: #fff; color: #000; }
}

@media screen and (max-width: 767px), screen and (max-height: 500px) {
  main {
    padding-top: max(.9rem, env(safe-area-inset-top));
    padding-inline-start: env(safe-area-inset-left);
    padding-inline-end: env(safe-area-inset-right);
    padding-bottom: max(1rem, env(safe-area-inset-bottom));
  }
  #toast-container { bottom: max(1rem, env(safe-area-inset-bottom)); }
  #admin-filter-tabs button, .gestion-tab,
  #view-admin button, #view-chef button, #view-gestion button,
  #client-cart button, #client-categories button, #client-menu-grid button,
  [id^="modal-"] button { min-height: 44px; }
  [data-close-modal] { min-width: 44px; }
  #client-cart :is([data-cc-inc], [data-cc-dec]) { width: 44px; height: 44px; }
  .checkout-taper-stepper button { width: 44px; height: 44px; }
  #client-cart-items { max-height: none; }
  #client-cart :is(input, select),
  [id^="modal-"] :is(input:not([type="checkbox"]):not([type="hidden"]), select, textarea) {
    font-size: 16px;
    min-width: 0;
  }
  .role-view, #client-cart, #view-cliente .grid > div,
  #view-chef .grid > div, .gestion-panel .grid > div { min-width: 0; }
  .gestion-panel [role="region"] { max-width: 100%; }
  .gestion-panel table { min-width: 30rem; }
  div[id^="modal-"].fixed {
    padding: max(.5rem, env(safe-area-inset-top)) max(.5rem, env(safe-area-inset-right))
      max(.5rem, env(safe-area-inset-bottom)) max(.5rem, env(safe-area-inset-left));
  }
  div[id^="modal-"].fixed > div {
    max-height: 100%;
    overflow: auto;
    overscroll-behavior: contain;
  }
  #bixolon-modal-body { flex: 0 0 auto; padding: .75rem; }
  #bixolon-modal-body > div, #bixolon-modal-body .thermal-paper { max-width: 100%; overflow-wrap: anywhere; }
}

.staff-alerts:not([hidden]) {
  display: flex; align-items: center; justify-content: space-between; gap: .65rem;
  padding: .35rem .65rem .35rem .9rem; margin-bottom: .85rem;
  border: 1px solid var(--line); border-radius: .75rem; background: var(--cream);
  color: var(--ink); font-size: .78rem;
}
.staff-alerts p { min-width: 0; overflow-wrap: anywhere; }
.admin-tool {
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
  min-height: 44px; padding: .5rem .8rem; border-radius: .65rem;
  border: 1px solid var(--line); background: var(--cream); color: var(--ink);
  font-size: .85rem; font-weight: 700;
}
.admin-tool svg, #admin-orders-grid button svg {
  width: 1rem; height: 1rem; flex: none; display: inline-block; vertical-align: middle;
}
.admin-tool-primary { background: var(--gold); border-color: transparent; }
.module-hero {
  display: flex;
  flex-direction: column;
  gap: .85rem;
  padding: clamp(.95rem, 2.5vw, 1.35rem);
  border: 1px solid var(--dark-line);
  border-radius: 1.05rem;
  background: var(--charcoal);
  color: var(--cream);
  box-shadow: 0 6px 18px -12px rgb(71 49 33 / 25%);
}
.module-hero-back {
  display: grid;
  place-items: center;
  flex: none;
  width: 44px;
  height: 44px;
  border: 1px solid rgb(255 212 146 / 28%);
  border-radius: .7rem;
  background: rgb(255 249 236 / 8%);
  color: var(--cream);
  transition: background-color .15s ease, border-color .15s ease;
}
.module-hero-back:hover { background: rgb(255 249 236 / 16%); border-color: var(--gold); }
.module-hero-back svg { width: 1.1rem; height: 1.1rem; }
.operator-title { color: var(--cream); }
.operator-caption { color: var(--on-dark-muted); margin-top: .25rem; font-size: .88rem; }
.gestion-tabs { display: flex; flex-wrap: wrap; gap: .45rem; }
.gestion-tab {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  min-height: 44px;
  padding: .45rem .9rem;
  border: 1px solid rgb(255 212 146 / 22%);
  border-radius: .7rem;
  background: rgb(255 249 236 / 8%);
  color: var(--cream);
  font-size: .82rem;
  font-weight: 750;
  transition: background-color .15s ease, border-color .15s ease;
}
.gestion-tab svg { width: .95rem; height: .95rem; flex: none; }
.gestion-tab:hover:not([aria-pressed="true"]) { background: rgb(255 249 236 / 16%); border-color: var(--gold); }
.gestion-tab[aria-pressed="true"] {
  border-color: transparent;
  background: var(--gold);
  color: var(--ink);
}
#view-admin .admin-filter-btn { min-height: 44px; }
#admin-orders-grid { align-items: start; }
#admin-orders-grid > div { min-width: 0; }
#admin-orders-grid button { min-height: 44px; }
#admin-orders-grid .admin-order-items { font-size: .875rem; line-height: 1.5; overflow-wrap: anywhere; }
#admin-orders-grid .admin-order-actions { justify-content: flex-start; }
#chef-access-dialog::backdrop { background: rgb(24 19 17 / 77%); }
@media (max-width: 600px) {
  #admin-order-search { flex-basis: 100%; }
}

body[data-public-menu] #staff-menu-hero,
body[data-public-menu] #staff-alerts,
#carta-cart-link[hidden], #client-cart[hidden], #cart-drawer-backdrop[hidden] { display: none; }

/* Public fullscreen Carta + slide-over Checkout Drawer */
body[data-public-menu] {
  background: var(--carta-bg);
}
body[data-public-menu][data-cart-open] {
  overflow: hidden;
}
body[data-public-menu] main {
  max-width: none;
  width: 100%;
  padding: 0;
}
body[data-public-menu] #view-cliente {
  display: flex;
  flex-direction: column;
  gap: 0;
}
body[data-public-menu] #view-cliente > * + * {
  margin-top: 0;
}
body[data-public-menu] #view-cliente .client-workspace-grid {
  grid-template-columns: minmax(0, 1fr);
}
body[data-public-menu] #view-cliente .client-workspace-grid > .menu-catalog-col {
  grid-column: 1;
  width: 100%;
  max-width: none;
  margin: 0;
}
body[data-public-menu] .menu-browser {
  width: 100%;
  margin-inline: auto;
  border: 0;
  border-radius: 0;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0;
  overflow-x: clip;
}
body[data-public-menu] #carta-list {
  width: 100%;
  max-width: 72rem;
  margin-inline: auto;
}

.cart-drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 55;
  background: var(--carta-overlay);
  backdrop-filter: blur(2px);
}
body[data-public-menu] #client-cart:not([hidden]) {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: auto;
  z-index: 60;
  width: min(27.5rem, 100vw);
  max-height: 100dvh;
  overflow-y: auto;
  overscroll-behavior: contain;
  border: 0;
  border-left: 1px solid var(--line);
  border-radius: 1.1rem 0 0 1.1rem;
  box-shadow: -16px 0 42px rgb(10 6 4 / 50%);
  animation: cart-drawer-in-right .22s cubic-bezier(.22, .61, .36, 1);
}
body[data-public-menu] #client-cart .checkout-header {
  position: sticky;
  top: 0;
  z-index: 2;
}
body[data-public-menu] #client-cart .checkout-summary {
  position: sticky;
  bottom: 0;
  z-index: 2;
  box-shadow: 0 -6px 16px rgb(24 19 17 / 8%);
}
@keyframes cart-drawer-in-right {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}
@keyframes cart-drawer-in-up {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

@media (min-width: 1024px) {
  body[data-public-menu] #view-cliente .menu-browser:has(> #carta-visual:not([hidden])) {
    height: 100dvh;
  }
}
@media (min-width: 1024px) and (max-width: 1279px) {
  body:not([data-public-menu]) .client-workspace-grid:not(:has(> #client-cart[hidden])) .carta-desktop-shell {
    grid-template-columns: 196px minmax(0, 1fr);
  }
}

body[data-public-menu] #client-cart { scroll-margin-top: 1rem; }

@media screen and (max-width: 1023px) {
  body[data-public-menu] .carta-header {
    padding-top: max(.5rem, env(safe-area-inset-top));
  }
  body[data-public-menu] .menu-browser {
    padding-bottom: calc(4.75rem + env(safe-area-inset-bottom));
  }
  body:not([data-public-menu]):has(#view-cliente:not(.hidden)) main {
    padding-bottom: calc(5.5rem + env(safe-area-inset-bottom));
  }
  body[data-public-menu] #toast-container {
    bottom: calc(5.1rem + env(safe-area-inset-bottom));
  }
  body[data-public-menu][data-cart-open] #toast-container,
  body[data-category-sheet-open] #toast-container {
    bottom: max(1rem, env(safe-area-inset-bottom));
  }
}

@media screen and (max-width: 767px) {
  body[data-public-menu] .carta-sheet[data-book-mode="single"][data-remaining="1"],
  body[data-public-menu] .carta-sheet[data-book-mode="single"][data-remaining="2"],
  body[data-public-menu] .carta-sheet[data-book-mode="single"][data-remaining="3"],
  body[data-public-menu] .carta-sheet[data-book-mode="single"][data-remaining="4"] {
    box-shadow: 2px 2px 0 #d4bba0, 4px 4px 0 #3f2b1e, 0 12px 26px rgb(10 6 4 / 48%);
  }
  body[data-public-menu] #client-cart:not([hidden]) {
    top: auto;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    max-height: 92dvh;
    border-left: 0;
    border-top: 1px solid var(--line);
    border-radius: 1.15rem 1.15rem 0 0;
    box-shadow: 0 -14px 36px rgb(10 6 4 / 52%);
    animation: cart-drawer-in-up .22s cubic-bezier(.22, .61, .36, 1);
  }
  body[data-public-menu] #client-cart .checkout-summary {
    padding-bottom: max(1rem, env(safe-area-inset-bottom));
  }
}

/* Shared scales for staff controls and surfaces. */
:root {
  --space-2: .5rem;
  --space-3: .75rem;
  --space-4: 1rem;
  --radius-3: .75rem;
  --radius-4: 1rem;
  --control-height: 44px;
  --surface-raised: var(--cream);
  --surface-border: var(--line);
  --action-accent: var(--gold);
}

.staff-alerts p { flex: 1; }
.staff-alerts:not([hidden]):has(p:empty) {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  margin: 0;
  padding: 0;
  border: 0;
}

#admin-filter-tabs {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-2);
}
#admin-filter-tabs .admin-filter-btn {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center;
  gap: var(--space-2); min-height: var(--control-height);
  border: 1px solid var(--surface-border); border-radius: var(--radius-3);
  background: var(--surface-raised); color: var(--ink);
  padding: var(--space-3); text-align: start; font-size: .82rem; font-weight: 750;
}
#admin-filter-tabs .admin-filter-btn:hover { border-color: var(--rust); }
#admin-filter-tabs .admin-filter-btn[aria-pressed="true"] {
  background: var(--charcoal); color: var(--cream); border-color: var(--charcoal);
}
.admin-filter-btn svg { width: 1rem; height: 1rem; }
.admin-filter-btn [data-order-count] {
  min-width: 1.5rem; text-align: center; border-radius: .4rem;
  padding: .1rem .25rem; background: var(--paper); color: var(--ink);
}
.admin-filter-btn[aria-pressed="true"] [data-order-count] { background: var(--action-accent); }
.admin-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }
.admin-order-card {
  background: var(--surface-raised); border: 1px solid var(--surface-border);
  border-radius: var(--radius-4); overflow: hidden;
}
.admin-order-status { color: var(--text-muted); font-size: .75rem; margin-block-start: .2rem; }
.admin-tool, #admin-order-search { min-height: var(--control-height); border-radius: var(--radius-3); }
@media (max-width: 640px) {
  #admin-filter-tabs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #admin-filter-tabs .admin-filter-btn { padding: var(--space-2); }
  .admin-toolbar input { flex-basis: 100%; }
}

/* Order cards keep context, payment, and actions in fixed visual positions. */
#admin-orders-grid { align-items: stretch; }
.admin-order-card {
  display: flex; flex-direction: column;
  border-block-start: 1px solid var(--surface-border);
}
.admin-card-content { padding: var(--space-4); flex: 1; }
.admin-card-summary {
  display: grid; grid-template-columns: minmax(0, 1fr) max-content;
  gap: .75rem .55rem; align-items: start;
}
.admin-order-channel, .admin-order-status {
  display: inline-flex; width: fit-content; align-items: center; gap: .3rem;
  border-radius: .4rem; padding: .25rem .45rem;
  color: var(--ink); background: var(--paper); font-size: .69rem; font-weight: 750;
}
.admin-order-channel svg { width: .85rem; height: .85rem; flex: none; }
.admin-order-status { justify-self: end; margin: 0; white-space: nowrap; }
.admin-order-status[data-status="POR_APROBAR"] { color: var(--danger-ink); background: var(--danger-fill); }
.admin-order-status[data-status="EN_COCINA"] { color: var(--warning-ink); background: var(--warning-fill); }
.admin-order-status[data-status="LISTO_CHEF"] { color: var(--success-ink); background: var(--success-fill); }
.admin-order-customer { font-size: 1rem; line-height: 1.15; font-weight: 800; overflow-wrap: anywhere; }
.admin-order-code { font-size: .72rem; color: var(--text-muted); margin-top: .25rem; overflow-wrap: anywhere; }
.admin-order-payment { text-align: end; white-space: nowrap; }
.admin-order-total { font-weight: 850; font-size: 1.16rem; line-height: 1; font-variant-numeric: tabular-nums; }
.admin-order-payment span { display: block; margin-top: .28rem; color: var(--text-muted); font-size: .69rem; }
.admin-order-payment [data-paid="true"] { color: var(--success-ink); font-weight: 750; }
.admin-order-address { font-size: .78rem; color: var(--text-muted); margin-top: .65rem; overflow-wrap: anywhere; }
.admin-maps-link {
  display: inline-flex;
  align-items: center;
  margin-left: .25rem;
  font-weight: 800;
  color: #9a4510;
  text-decoration: underline;
}
.admin-card-content > .bg-emerald-50 { margin-top: .7rem; }
#admin-orders-grid .admin-order-items { margin-top: .9rem; border-top: 1px solid var(--surface-border); }
.admin-order-line {
  display: grid; grid-template-columns: auto minmax(0, 1fr); gap: .55rem;
  padding: .55rem 0; border-bottom: 1px solid rgb(153 115 75 / 14%);
}
.admin-order-line:last-child { border-bottom: 0; padding-bottom: 0; }
.admin-item-qty {
  min-width: 1.65rem; height: 1.55rem; display: grid; place-items: center;
  background: var(--paper); border-radius: .35rem; font-size: .72rem; font-weight: 800;
}
.admin-item-heading { display: flex; align-items: baseline; flex-wrap: wrap; gap: 0 .5rem; }
.admin-item-heading small { font-size: .62rem; color: var(--text-muted); }
.admin-order-line p, .admin-item-note { font-size: .76rem; line-height: 1.4; color: var(--text-muted); }
.admin-item-note { color: #75370f; }
.admin-general-note { margin-top: .75rem; padding: .5rem; background: var(--warning-fill); border-radius: .4rem; }
.admin-general-note strong { display: block; }
#admin-orders-grid .admin-order-actions {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 6.25rem), 1fr));
  gap: .4rem; padding: .65rem .75rem;
}
#admin-orders-grid .admin-order-actions button { line-height: 1.2; padding-inline: .35rem; justify-content: center; }
#admin-orders-grid [data-admin-approve], #admin-orders-grid [data-admin-pay-mesa],
#admin-orders-grid [data-admin-deliver] { grid-column: 1 / -1; margin-top: .15rem; }
#admin-orders-grid [data-admin-approve] { background: var(--gold); color: var(--ink); }
#admin-orders-grid [data-admin-approve]:hover { background: #ffda82; }

.print-dialog {
  width: min(56rem, calc(100% - 1.25rem)); max-height: calc(100dvh - 1.25rem);
  margin: auto; padding: 0; overflow: auto; overscroll-behavior: contain;
  border: 1px solid var(--surface-border); border-radius: var(--radius-4);
  background: var(--surface-raised); color: var(--ink);
}
.print-dialog::backdrop { background: rgb(24 19 17 / 74%); }
.print-dialog-header {
  position: sticky; top: 0; z-index: 1; display: flex; align-items: center;
  justify-content: space-between; gap: .75rem; padding: .65rem 1rem;
  background: var(--charcoal); color: var(--cream);
}
.print-dialog-header h3 { font: 800 1.65rem/1 var(--display); }
.print-dialog-header p { color: var(--on-dark-muted); font-size: .78rem; margin-top: .2rem; overflow-wrap: anywhere; }
.print-close {
  display: grid; place-items: center; width: 44px; height: 44px; flex: none;
  border: 1px solid #805731; border-radius: .65rem;
}
.print-close svg, .print-connection > svg { width: 1.1rem; height: 1.1rem; }
.print-dialog-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(15rem, 17rem); }
.print-dialog-sidebar {
  grid-column: 2; grid-row: 1; align-self: start; padding: 1rem; min-width: 0;
}
.print-controls { display: grid; gap: .75rem; }
.print-connection { display: flex; gap: .5rem; align-items: start; }
.print-connection h4 { font-weight: 800; font-size: .95rem; }
.print-connection p { color: var(--text-muted); font-size: .78rem; line-height: 1.4; overflow-wrap: anywhere; }
.print-buttons { display: grid; gap: .45rem; }
.print-buttons button, .print-options summary {
  min-height: 44px; border: 1px solid var(--surface-border); padding: .45rem .65rem;
  border-radius: .55rem; font-size: .82rem; font-weight: 750; line-height: 1.25;
}
.print-buttons button[hidden], .print-buttons button.hidden { display: none; }
.print-primary { background: var(--gold); border-color: transparent !important; }
.print-primary:not(:disabled):hover { background: #ffda82; }
.print-primary:disabled { background: var(--paper); color: var(--text-muted); opacity: 1; }
.print-options { font-size: .78rem; color: var(--text-muted); }
.print-options summary { cursor: pointer; padding-block: .77rem; }
.print-alternatives { margin-top: .6rem; }
.print-options .print-buttons { margin-top: .5rem; }
.print-options input:not([type="checkbox"]) { max-width: 100%; font-size: 1rem; }
.print-preview { grid-column: 1; grid-row: 1; padding: 1rem; min-width: 0; background: var(--paper); }
.print-preview h4 { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .4rem; margin-bottom: 1rem; font-weight: 800; }
.print-preview h4 span { color: var(--text-muted); font-size: .75rem; font-weight: 650; }
#bixolon-modal-body { display: grid; justify-items: center; gap: 1rem; padding: 0; }
#bixolon-modal-body > div, #bixolon-modal-body .thermal-paper { max-width: 100%; overflow-wrap: anywhere; }
@media screen and (max-width: 640px) {
  .print-dialog-layout { display: block; }
  .print-dialog-sidebar, .print-preview { padding: .75rem; }
  .print-controls .print-buttons { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.order-breakdown { display: grid; gap: .35rem; font-size: .82rem; color: var(--text-muted); }
.order-breakdown[hidden], .order-breakdown div[hidden] { display: none; }
.order-breakdown div { display: flex; justify-content: space-between; gap: .5rem; }
.order-breakdown dd { font-variant-numeric: tabular-nums; }
.product-customize[open] {
  display: flex;
  flex-direction: column;
  width: min(30rem, calc(100% - 2rem));
  max-height: calc(100dvh - 2rem);
  overflow: hidden;
}
.product-customize-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: .75rem;
  padding: .9rem 1rem;
  background: var(--charcoal);
  color: var(--cream);
}
.product-customize-header h3 { font: 800 1.8rem/1.05 var(--display); }
.product-customize-header p { margin-top: .3rem; color: #f4dfbe; font-size: .875rem; }
.product-customize-close {
  flex-shrink: 0;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid #7c6657;
  border-radius: .75rem;
}
.product-customize-close:focus-visible { outline-color: var(--gold); }
#form-customize {
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.product-customize-body {
  overflow: auto;
  overscroll-behavior: contain;
  padding: .85rem 1rem 1rem;
  font-size: .875rem;
}
.product-customize-body > :not([hidden], .hidden, input) ~ :not([hidden], .hidden) { margin-top: .85rem; }
.product-customize-body fieldset { min-width: 0; }
.product-customize-body legend { margin-bottom: .45rem; font-weight: 800; }
.customize-optional { margin-inline-start: .25rem; color: #735c48; font-size: .75rem; font-weight: 500; }
.customize-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .4rem; }
.customize-option {
  display: flex;
  align-items: center;
  gap: .45rem;
  min-height: 44px;
  padding: .4rem .6rem;
  border: 1px solid var(--line);
  border-radius: .65rem;
  background: #fffcf6;
  text-align: left;
}
.customize-extra {
  display: grid;
  align-content: space-between;
  gap: .2rem;
  line-height: 1.25;
  font-weight: 700;
}
.customize-extra-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .3rem;
  white-space: nowrap;
  color: #783318;
  font-size: .75rem;
}
.customize-extra-meta svg { width: .9rem; height: .9rem; flex-shrink: 0; }
.customize-extra[aria-pressed="false"] .customize-extra-check,
.customize-extra[aria-pressed="true"] .customize-extra-add { display: none; }
.customize-extra[aria-pressed="true"], .customize-cream:has(input:checked) {
  border-color: #946018;
  background: #ffedbc;
}
.customize-cream { cursor: pointer; }
.customize-cream-check { width: 1rem; height: 1rem; flex-shrink: 0; accent-color: #8c351d; }
#cust-flavors-grid button, #cust-note { min-height: 44px; }
.product-customize-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  gap: .75rem;
  padding: .65rem 1rem;
  border-top: 1px solid var(--line);
  background: var(--cream);
}
.customize-total { display: grid; color: #735c48; font-size: .75rem; line-height: 1.2; }
.customize-total strong { color: var(--ink); font-size: 1.1rem; white-space: nowrap; }
#customize-submit-label {
  min-height: 48px;
  padding: .55rem 1rem;
  border-radius: .75rem;
  background: var(--gold);
  color: var(--ink);
  font-size: .9rem;
  font-weight: 800;
}
#customize-submit-label:hover { background: #ffb826; }
@media (max-width: 640px) {
  .product-customize[open] {
    inset-block-start: auto;
    width: 100%;
    max-width: 100%;
    max-height: calc(100dvh - max(.5rem, env(safe-area-inset-top)));
    border-radius: 1rem 1rem 0 0;
  }
  .product-customize-footer {
    padding-bottom: max(.65rem, env(safe-area-inset-bottom));
  }
  #customize-submit-label { flex: 1; }
}
.carta-spot::after {
  content: '+'; position: absolute; top: .15rem; right: .2rem;
  border-radius: 50%; width: .9rem; height: .9rem; display: grid; place-items: center;
  font-size: .72rem; line-height: 1; font-weight: 850; color: var(--ink); background: var(--gold);
}
.carta-spot-priced::after { display: none; }
.carta-spot-priced span {
  position: absolute; top: 1%; right: 2%;
  padding: .1em .35em; border: 1px solid #8f7956; border-radius: .18em;
  background: #fff3d4; color: #17100c; white-space: nowrap;
  font-size: clamp(8px, 2.25cqw, 13px); font-weight: 850; line-height: 1.25;
}

.prep-board { display: grid; gap: 1rem; }
.prep-board.hidden { display: none; }
.prep-header {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .8rem;
  padding: clamp(.95rem, 2.5vw, 1.35rem);
  border: 1px solid var(--dark-line);
  border-radius: 1.05rem;
  background: var(--charcoal); color: var(--cream);
  box-shadow: 0 6px 18px -12px rgb(71 49 33 / 25%);
}
.prep-header .operator-title { color: var(--cream); }
.prep-header p:not(.modules-eyebrow) { color: var(--on-dark-muted); font-size: .85rem; }
.prep-switch, .prep-filters { display: flex; gap: .5rem; flex-wrap: wrap; }
.prep-switch button, .prep-filters button, .prep-code button, .prep-card button {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  min-height: 44px; padding: .55rem .85rem; border-radius: .7rem; font-weight: 750;
  border: 1px solid var(--surface-border); background: var(--cream); color: var(--ink);
}
.prep-switch button[aria-pressed="true"], .prep-card button { background: var(--gold); border-color: transparent; color: var(--ink); }
.prep-filters button[aria-pressed="true"] { background: var(--gold); border-color: transparent; color: var(--ink); }
.prep-board svg { width: 1rem; height: 1rem; flex: none; }
.prep-code {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: .45rem .6rem;
  padding: .25rem .75rem .75rem;
}
.prep-code label { grid-column: 1 / -1; font-size: .83rem; font-weight: 800; }
.prep-code input { min-width: 0; font: 700 1rem/1.2 monospace; min-height: 44px; border-radius: .55rem; border: 1px solid var(--line); padding: .5rem; }
.prep-history-controls {
  padding: .75rem;
  border: 1px solid var(--line);
  border-radius: .8rem;
  background: var(--cream);
}
.prep-history-fields { display: flex; align-items: end; flex-wrap: wrap; gap: .55rem; }
.prep-history-fields label { display: grid; flex: 1 1 10rem; gap: .25rem; min-width: 0; font-size: .84rem; font-weight: 750; }
.prep-history-fields label:first-child { flex-grow: 2; }
.prep-history-fields input {
  width: 100%; min-width: 0; min-height: 44px; padding: .45rem .6rem;
  border: 1px solid var(--line); border-radius: .55rem; background: white;
  color: var(--ink); font-size: 1rem;
}
.prep-history-fields button, .prep-history-pagination button {
  display: inline-flex; align-items: center; justify-content: center; gap: .25rem;
  min-height: 44px; padding: .4rem .65rem; border: 1px solid var(--line); border-radius: .55rem;
  background: var(--cream); color: var(--ink); font-size: .8rem; font-weight: 750;
}
.prep-history-fields button[hidden], .prep-history-pagination[hidden] { display: none; }
#prep-history-results { margin-top: .5rem; color: var(--text-muted); font-size: .85rem; font-variant-numeric: tabular-nums; }
.prep-history-pagination { display: flex; align-items: center; justify-content: center; gap: .5rem; flex-wrap: wrap; }
#prep-history-page { padding-inline: .2rem; font-size: .82rem; font-weight: 750; }
.prep-history-pagination button:disabled { cursor: default; }
.prep-history-detail { margin-top: .25rem; }
.prep-history-detail summary {
  min-height: 44px; padding: .65rem .9rem; cursor: pointer;
  color: var(--success-ink); font-size: .88rem; font-weight: 750;
}
.prep-history-detail summary:hover { background: var(--success-fill); }
.prep-history-detail summary:focus-visible { outline-offset: -3px; }
.prep-card .prep-history-time { color: var(--success-ink); font-weight: 700; }
.prep-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(19rem, 100%), 1fr)); gap: .8rem; }
.prep-card { display: flex; flex-direction: column; min-width: 0; overflow-wrap: anywhere; background: var(--cream); border: 1px solid var(--line); border-radius: .8rem; overflow: hidden; }
.prep-card > header { display: flex; align-items: start; justify-content: space-between; gap: .5rem; padding: .65rem .9rem; background: #efe0c9; }
.prep-card h3 { font: 800 1.35rem/1.15 var(--display); }
.prep-card header p { color: var(--text-muted); font-size: .75rem; margin-top: .15rem; }
.prep-clock, .prep-done { display: flex; align-items: center; gap: .3rem; padding: .3rem .5rem; border-radius: .4rem; background: var(--cream); font-size: .76rem; font-weight: 800; white-space: nowrap; }
.prep-clock.prep-late { background: var(--danger-fill); color: var(--danger-ink); }
.prep-done { background: var(--success-fill); color: var(--success-ink); }
.prep-card ul { padding: .25rem .9rem; }
.prep-card li { display: grid; gap: .55rem; grid-template-columns: auto minmax(0, 1fr); padding: .65rem 0; }
.prep-card li + li { border-top: 1px solid var(--line); }
.prep-qty { display: grid; place-items: center; align-self: start; min-width: 1.8rem; border-radius: .35rem; background: var(--paper); }
.prep-card li p { font-size: .84rem; line-height: 1.45; color: var(--text-muted); }
.prep-card .prep-note { color: #71350c; font-weight: 700; }
.prep-order-note { margin: 0 .9rem .7rem; padding: .5rem; border-radius: .35rem; background: var(--warning-fill); }
.prep-card button { margin: auto .9rem .9rem; width: calc(100% - 1.8rem); }
.prep-empty { grid-column: 1 / -1; padding: 1.25rem; background: var(--cream); border: 1px dashed var(--line); border-radius: .75rem; }

body[data-prep-view] #staff-alerts:not([hidden]),
#view-chef[data-hide-timers] .prep-clock { display: none; }
#view-chef[data-large-text] .prep-card li { font-size: 1.15rem; }
#view-chef[data-large-text] .prep-card li p { font-size: 1rem; }
.prep-header-actions { display: flex; align-items: flex-start; gap: .5rem; }
.prep-menu { position: relative; }
.prep-menu summary, .prep-dialog header button {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid #866d5d;
  border-radius: .65rem;
  color: var(--cream);
  cursor: pointer;
  list-style: none;
}
.prep-menu summary::-webkit-details-marker { display: none; }
.prep-menu summary svg { width: 1.25rem; height: 1.25rem; }
.prep-menu-actions {
  position: absolute;
  inset-inline-end: 0;
  top: calc(100% + .5rem);
  z-index: 5;
  width: max-content;
  max-width: calc(100vw - 2rem);
  max-height: calc(100dvh - 7rem - env(safe-area-inset-bottom));
  overflow: auto;
  overscroll-behavior: contain;
  padding: .3rem;
  border: 1px solid var(--line);
  border-radius: .7rem;
  background: var(--cream);
  color: var(--ink);
  box-shadow: 0 .5rem 1.5rem rgb(24 19 17 / 19%);
}
.prep-menu-actions button, .prep-config-actions button {
  display: flex;
  align-items: center;
  gap: .6rem;
  min-height: 44px;
  padding: .55rem .7rem;
  border-radius: .5rem;
  font-size: .88rem;
  font-weight: 700;
  text-align: left;
}
.prep-menu-actions button { width: 100%; }
.prep-menu-actions button:hover { background: var(--paper); }
.prep-dialog {
  width: min(100% - 1.5rem, 30rem);
  max-height: calc(100dvh - 1.5rem);
  margin: auto;
  overflow: auto;
  overscroll-behavior: contain;
  border: 1px solid var(--line);
  border-radius: .9rem;
  background: var(--cream);
  color: var(--ink);
}
.prep-dialog::backdrop { background: rgb(24 19 17 / 77%); }
.prep-dialog header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  padding: .65rem .85rem;
  background: var(--charcoal);
  color: var(--cream);
}
.prep-dialog header button { flex: none; }
.prep-dialog :is(h2, h3) { font: 800 1.5rem/1.05 var(--display); }
.prep-settings-content { display: grid; gap: .8rem; padding: .85rem; }
.prep-settings-content fieldset { display: grid; gap: .4rem; min-width: 0; }
.prep-settings-content fieldset[hidden] { display: none; }
.prep-settings-content fieldset + fieldset { border-top: 1px solid var(--line); }
.prep-settings-content legend { margin-bottom: .35rem; padding-inline-end: .6rem; font-weight: 800; }
.prep-settings-content p { color: var(--text-muted); font-size: .85rem; }
.prep-settings-content p:empty, #prep-code-error:empty { display: none; }
.prep-config-actions { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: .3rem; }
.prep-config-actions button { border: 1px solid var(--line); }
.prep-config-actions button:first-child, .prep-code button { background: var(--gold); }
.prep-settings-content input { accent-color: var(--rust); }
#prep-volume { min-height: 28px; }
#prep-volume-value { margin-inline-start: .4rem; font-weight: 750; }
.prep-setting-check, .prep-setting-select { display: flex; align-items: center; gap: .6rem; min-height: 44px; font-size: .9rem; }
.prep-setting-check input { flex: none; width: 1.1rem; height: 1.1rem; }
.prep-setting-select { justify-content: space-between; }
.prep-setting-select select {
  min-height: 44px;
  min-width: 7.5rem;
  padding-inline: .5rem;
  border: 1px solid var(--line);
  border-radius: .5rem;
  background: white;
  font-size: 1rem;
}
.prep-dialog .prep-code { padding: .85rem; }
#prep-code-error { grid-column: 1 / -1; color: var(--danger-ink); font-size: .88rem; }
@media (max-width: 480px) {
  .prep-header { position: relative; }
  .prep-header > div:first-child { padding-inline-end: 3rem; }
  .prep-header-actions { width: 100%; }
  .prep-menu { position: absolute; inset-block-start: .8rem; inset-inline-end: .8rem; }
  .prep-code { grid-template-columns: minmax(0, 1fr); }
}

body[data-prep-view] main { max-width: 100rem; }
.prep-heading { display: flex; align-items: center; gap: .75rem; }
#prep-back { flex: none; }
.prep-alert-message:empty { display: none; }
.prep-alert-message {
  padding: .55rem .8rem;
  border: 1px solid var(--line);
  border-radius: .65rem;
  background: var(--cream);
  font-size: .88rem;
}
.prep-card[data-ready] { border-color: var(--success-line); background: #eff4ea; }
.prep-card[data-ready] > header { background: var(--success-fill); }
.prep-card[data-ready] li + li { border-color: #c7d4be; }
.prep-card[data-ready] .prep-done { background: var(--success-ink); color: var(--cream); }
.prep-channel {
  align-self: flex-start;
  margin: .5rem .9rem 0;
  padding: .2rem .5rem;
  border-radius: .35rem;
  background: var(--warning-fill);
  color: var(--warning-ink);
  font-size: .75rem;
  font-weight: 750;
}
.prep-card[data-delivery]:not([data-ready]) > header { background: var(--surface-quiet); }
.inventory-toolbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: .65rem;
  padding: 1rem;
  border-bottom: 1px solid var(--line);
}
.inventory-actions { display: flex; flex-wrap: wrap; gap: .4rem; }
.inventory-search { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; padding: .65rem 1rem; }
.inventory-search label, .inventory-form label { font-size: .85rem; font-weight: 750; }
.inventory-search input, .inventory-form input, .inventory-form select {
  width: 100%;
  min-height: 44px;
  padding: .5rem .65rem;
  border: 1px solid var(--line);
  border-radius: .55rem;
  background: #fff;
  font-size: 1rem;
}
.inventory-search input { flex: 0 1 18rem; }
.inventory-form { display: grid; gap: .5rem; padding: .85rem; }
.inventory-form p { font-size: .83rem; color: var(--text-muted); }
.inventory-form p:empty, #recipe-current:empty { display: none; }
.inventory-form #ingredient-error { color: var(--danger-ink); }
.inventory-form ul { display: grid; gap: .25rem; padding: .6rem .75rem; background: var(--paper); border-radius: .5rem; font-size: .85rem; }
.inventory-form button[type="submit"] { justify-content: center; margin-top: .35rem; }

body[data-public-menu] #staff-sync-notice { display: none; }
#staff-sync-notice:not([hidden]) { border-color: #c88d52; background: #fff1d7; }

/* Staff launcher */
.staff-skip-link {
  position: fixed;
  z-index: 100;
  inset-block-start: max(.5rem, env(safe-area-inset-top));
  inset-inline-start: max(.5rem, env(safe-area-inset-left));
  padding: .65rem 1rem;
  border-radius: .5rem;
  background: var(--gold);
  color: var(--ink);
  font-weight: 750;
}
.staff-skip-link:not(:focus-visible) { clip-path: inset(50%); }
body[data-public-menu] .staff-skip-link { display: none; }
#pos-content { scroll-margin-block-start: 1rem; }

body[data-staff-workspace] {
  min-height: 100dvh;
  background:
    radial-gradient(ellipse at top, var(--cream), transparent 52rem),
    var(--paper);
}
body[data-staff-workspace] main { padding-block: clamp(.9rem, 2.4vw, 2rem) 2.5rem; }

/* Raised staff surfaces */
body[data-staff-workspace] :is(
  #admin-filter-tabs .admin-filter-btn,
  #admin-orders-grid .admin-order-card,
  #admin-orders-grid > .col-span-full,
  #admin-order-search,
  #inv-kpis > div,
  #caja-kpis > div,
  #subtab-inventario > div:last-child,
  #subtab-kardex,
  #subtab-proveedores > div,
  #subtab-caja > .grid:last-child > div,
  .prep-history-controls,
  .prep-card,
  .prep-empty,
  #view-cliente #admin-order-entry,
  #view-cliente .menu-browser,
  #view-cliente #client-cart
) {
  border-color: var(--line);
  border-radius: 1.05rem;
  box-shadow: 0 6px 18px -12px rgb(71 49 33 / 25%);
}
body[data-staff-workspace] #caja-kpis > div.bg-slate-900 {
  border-color: var(--charcoal);
}
body[data-staff-workspace] #admin-order-search-summary { color: var(--text-muted); }
body[data-staff-workspace] .prep-alert-message {
  color: var(--text-muted);
  border-color: var(--line);
  background: var(--cream);
}
body[data-staff-workspace] #admin-filter-tabs .admin-filter-btn[aria-pressed="true"] {
  border-color: transparent;
  background: var(--gold);
  color: var(--ink);
}
body[data-staff-workspace] #admin-filter-tabs .admin-filter-btn[aria-pressed="true"] [data-order-count] {
  background: var(--charcoal);
  color: var(--cream);
}
body[data-staff-workspace] #prep-history-page { color: var(--ink); }

.modules-page, .modules-page section { min-width: 0; }
.modules-page { max-width: 72rem; margin-inline: auto; padding-bottom: 1.5rem; }
.modules-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
}
.modules-heading { min-width: 0; }
.module-hero .modules-eyebrow, .prep-header .modules-eyebrow { color: var(--control-highlight); }
.modules-eyebrow {
  color: var(--rust);
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.modules-header h1 {
  margin-top: .2rem;
  font: 800 clamp(2.1rem, 4.8vw, 3.35rem)/.98 var(--display);
  letter-spacing: .015em;
  color: var(--ink);
  text-wrap: balance;
}
#modules-title:focus-visible,
.role-view :is(h1, h2)[tabindex="-1"]:focus-visible {
  outline: 3px solid var(--control-focus);
  outline-offset: 4px;
}
:is(.module-hero, .prep-header, .customer-hero) :is(h1, h2)[tabindex="-1"]:focus-visible {
  outline-color: var(--control-highlight);
}
.modules-subtitle {
  margin-top: .35rem;
  color: var(--text-muted);
  font-size: .92rem;
  font-weight: 600;
}

.modules-account {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .5rem;
}
.modules-profile-pill {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  min-height: 44px;
  padding: .45rem .8rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-tint);
  color: var(--ink);
  font-size: .85rem;
  font-weight: 750;
}
.modules-profile-pill svg { width: 1rem; height: 1rem; color: var(--rust); flex: none; }
.modules-header-btn {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  min-height: 44px;
  padding: .45rem .85rem;
  border: 1px solid var(--control-line);
  border-radius: 999px;
  background: var(--cream);
  color: var(--ink);
  font-size: .84rem;
  font-weight: 750;
  transition: background-color .16s ease, border-color .16s ease;
}
.modules-header-btn svg { width: 1rem; height: 1rem; flex: none; color: var(--text-muted); }
.modules-header-btn:hover { background: var(--surface-tint); border-color: var(--rust); }
.modules-header-btn[aria-pressed="true"] {
  border-color: var(--success-line);
  background: var(--success-fill);
  color: var(--success-ink);
}
.modules-header-btn[aria-pressed="true"] svg { color: var(--success-ink); }

.modules-kpi-strip {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin-top: .9rem;
}
.modules-kpi-chip {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  min-height: 44px;
  padding: .4rem .8rem;
  border: 1px solid var(--control-line);
  border-radius: .75rem;
  background: var(--cream);
  color: var(--ink);
  font-size: .84rem;
  font-weight: 650;
  touch-action: manipulation;
  transition: background-color .15s ease, border-color .15s ease;
}
.modules-kpi-chip[hidden] { display: none; }
.modules-kpi-chip svg { width: .95rem; height: .95rem; color: var(--text-muted); flex: none; }
.modules-kpi-chip strong { font-weight: 850; font-variant-numeric: tabular-nums; }
.modules-kpi-chip[data-alert="true"] {
  border-color: var(--control-line);
  background: var(--warning-fill);
  color: var(--warning-ink);
}
.modules-kpi-chip[data-alert="true"] svg { color: var(--rust); }
.modules-kpi-chip:hover { background: var(--surface-tint); border-color: var(--rust); }

.modules-section-title {
  margin: clamp(1.35rem, 2.8vw, 1.85rem) 0 .75rem;
  color: var(--ink);
  font-size: .82rem;
  font-weight: 800;
  letter-spacing: .09em;
  text-transform: uppercase;
}
.modules-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(.65rem, 1.8vw, 1rem);
}
.module-tile {
  --tile-fill: var(--surface-quiet);
  --tile-ink: var(--ink);
  position: relative;
  display: flex;
  min-width: 0;
  min-height: 9.25rem;
  flex-direction: column;
  align-items: stretch;
  gap: .35rem;
  padding: clamp(.8rem, 2vw, 1.15rem);
  border: 1px solid var(--line);
  border-radius: 1.05rem;
  background: var(--cream);
  color: var(--ink);
  text-align: start;
  box-shadow: 0 6px 16px -11px rgb(71 49 33 / 34%);
  touch-action: manipulation;
  overflow-wrap: anywhere;
  scroll-margin-block: 5rem 1rem;
  transition: box-shadow .16s ease, border-color .16s ease, background-color .16s ease;
}
.module-tile[hidden] { display: none; }
.module-tile:focus-visible {
  outline: 3px solid var(--control-focus);
  outline-offset: 3px;
}
.module-tile:active { background: var(--selected-fill); border-color: var(--control-focus); }
@media (hover: hover) {
  .module-tile:hover {
    background: #fdf9f2;
    border-color: var(--rust);
    transform: translateY(-2px);
    box-shadow: 0 12px 24px -14px rgb(71 49 33 / 28%);
  }
}

[data-tone="gold"], [data-tone="orange"] { --tile-fill: var(--warning-fill); --tile-ink: var(--warning-ink); }
[data-tone="rust"], [data-tone="plum"] { --tile-fill: var(--danger-fill); --tile-ink: var(--danger-ink); }
[data-tone="green"], [data-tone="teal"] { --tile-fill: var(--success-fill); --tile-ink: var(--success-ink); }
[data-tone="blue"], [data-tone="indigo"] { --tile-fill: var(--selected-fill); --tile-ink: var(--selected-ink); }
[data-tone="stone"], [data-tone="charcoal"] { --tile-fill: #e7dcd0; --tile-ink: var(--charcoal); }

.module-tile-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: .5rem;
  margin-bottom: .3rem;
}
.module-icon {
  position: relative;
  overflow: hidden;
  width: 3.25rem;
  height: 3.25rem;
  display: grid;
  place-items: center;
  flex: none;
  border-radius: .88rem;
  background: var(--tile-fill);
  color: var(--tile-ink);
  border: 1px solid rgb(65 42 26 / 12%);
}
.module-icon-sm {
  width: 2.75rem;
  height: 2.75rem;
  border-radius: .78rem;
}
.module-icon-sm svg { width: 1.35rem; height: 1.35rem; }
.module-icon svg { position: relative; z-index: 1; width: 1.55rem; height: 1.55rem; stroke-width: 2.15; }

.module-badge {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  padding: .22rem .52rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-quiet);
  color: var(--text-muted);
  font-size: .7rem;
  font-weight: 800;
  line-height: 1.25;
  font-variant-numeric: tabular-nums;
}
.module-badge[data-alert="true"] {
  border-color: var(--control-line);
  background: var(--warning-fill);
  color: var(--warning-ink);
}
.module-badge[data-active="true"] {
  border-color: var(--success-line);
  background: var(--success-fill);
  color: var(--success-ink);
}

.module-title {
  font-size: clamp(.98rem, 2vw, 1.15rem);
  font-weight: 800;
  line-height: 1.2;
  color: var(--ink);
}
.module-description {
  color: #5c4331;
  font-size: .82rem;
  line-height: 1.38;
}
.module-go {
  margin-top: auto;
  padding-top: .25rem;
  align-self: flex-end;
  color: #8c6a4d;
  transition: transform .16s ease, color .16s ease;
}
.module-go svg { width: 1rem; height: 1rem; }
@media (hover: hover) {
  .module-tile:hover .module-go,
  .module-tile:focus-visible .module-go {
    color: var(--rust);
    transform: translateX(3px);
  }
}

.module-tile-compact { min-height: 7.75rem; }
.module-tile-compact .module-icon { width: 2.75rem; height: 2.75rem; border-radius: .75rem; }
.module-tile-compact .module-icon svg { width: 1.3rem; height: 1.3rem; }

.role-directory { width: min(calc(100% - 1.5rem), 41rem); }
.role-directory-list { display: grid; gap: .7rem; padding: .85rem; }
.role-profile { padding: .85rem; border: 1px solid var(--line); border-radius: .65rem; }
.role-profile h3 { display: flex; align-items: center; gap: .55rem; }
.role-profile h3 svg { width: 1.15rem; height: 1.15rem; color: var(--rust); flex: none; }
.role-profile ul { margin-top: .55rem; padding-inline-start: 1.15rem; list-style: disc; font-size: .92rem; line-height: 1.5; }
.role-profile li + li { margin-top: .2rem; }

@media (max-width: 639px) {
  .module-tile { min-height: 8.4rem; padding: .75rem; }
  .module-tile-top { flex-wrap: wrap; gap: .35rem; }
  .module-icon { width: 2.8rem; height: 2.8rem; border-radius: .75rem; }
  .module-icon svg { width: 1.35rem; height: 1.35rem; }
  .module-tile-compact { min-height: 7.35rem; }
  .module-tile-compact .module-icon { width: 2.45rem; height: 2.45rem; }
  .module-description { font-size: .78rem; }
}
@media (min-width: 640px) {
  .modules-grid { grid-template-columns: repeat(auto-fill, minmax(min(12.25rem, 100%), 1fr)); }
  .modules-grid-compact { grid-template-columns: repeat(auto-fill, minmax(min(11.25rem, 100%), 1fr)); }
}
@media (min-width: 1080px) {
  .modules-grid:not(.modules-grid-compact) { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .modules-grid-compact { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (prefers-reduced-motion: reduce) {
  .module-tile, .module-go, .modules-header-btn, .modules-kpi-chip { transition: none; transform: none; }
  .module-tile:hover, .module-tile:hover .module-go { transform: none; }
}

@media (any-pointer: coarse) {
  #admin-filter-tabs button, .gestion-tab, #view-admin .admin-tool,
  #admin-orders-grid button, #view-gestion .admin-tool,
  #view-chef :is(button, summary), .prep-dialog button,
  #client-cart button, .carta-sidebar-item, .carta-sheet-item,
  .carta-explore-chip, .carta-mode-switch button, .carta-order-btn,
  [id^="modal-"] [data-close-modal] {
    min-height: 48px;
    touch-action: manipulation;
  }
  .carta-nav-btn {
    width: 48px;
    height: 48px;
    touch-action: manipulation;
  }
  #client-cart :is([data-cc-inc], [data-cc-dec]), .checkout-taper-stepper button,
  [id^="modal-"] [data-close-modal] { min-width: 48px; }
}

.management-dialog { max-width: 28rem; }
.management-dialog form { font-size: .9rem; }
.management-dialog form :is(input, select) { min-height: 44px; font-size: 1rem; }
.management-dialog form button { min-height: 44px; }

/* The session page has its own layout, including when the app bundles are slow. */
#staff-loading { display: none; }
html[data-staff-loading] :is(.role-view, .staff-alerts) { display: none; }
html[data-staff-loading] #staff-loading {
  display: grid;
  justify-items: center;
  gap: 1rem;
  padding: 12vh 1rem 2rem;
  text-align: center;
  font: 600 1rem/1.5 system-ui, sans-serif;
}
#staff-loading-retry {
  min-height: 48px;
  padding: .5rem 1rem;
  border: 1px solid var(--line);
  border-radius: .5rem;
  background: var(--cream);
}

.staff-login-page {
  box-sizing: border-box;
  margin: 0;
  padding: max(1.25rem, env(safe-area-inset-top)) max(1.25rem, env(safe-area-inset-right))
    max(1.25rem, env(safe-area-inset-bottom)) max(1.25rem, env(safe-area-inset-left));
  display: grid;
  min-height: 100dvh;
  place-items: center;
  font: 400 1rem/1.5 system-ui, sans-serif;
  background:
    radial-gradient(ellipse at top, var(--cream), transparent 52rem),
    var(--paper);
}
.staff-login-page *, .staff-login-page *::before, .staff-login-page *::after { box-sizing: inherit; }
.staff-login-card {
  width: min(100%, 27.5rem);
  padding: clamp(1.25rem, 5vw, 2rem);
  border: 1px solid var(--line);
  border-top: 5px solid var(--gold);
  border-radius: 1.05rem;
  background: var(--cream);
  box-shadow: 0 12px 36px -20px rgb(71 49 33 / 32%);
}
.staff-login-heading { display: flex; align-items: center; gap: .85rem; margin-bottom: 1.15rem; }
.staff-login-heading img { border-radius: 50%; flex: none; }
.staff-login-eyebrow {
  margin: 0 0 .15rem;
  color: var(--rust);
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.staff-login-heading h1 { margin: 0; font-size: clamp(1.3rem, 5vw, 1.75rem); line-height: 1.15; text-wrap: balance; }
.staff-active-session {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: .65rem;
  margin-bottom: 1rem;
  padding: .7rem .85rem;
  border: 1px solid var(--success-line);
  border-radius: .75rem;
  background: var(--success-fill);
  color: var(--success-ink);
  font-size: .85rem;
  font-weight: 700;
}
.staff-active-session[hidden] { display: none; }
.staff-active-session p { margin: 0; }
.staff-active-session-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: .35rem .85rem;
  border-radius: .55rem;
  background: var(--success-ink);
  color: var(--cream);
  font-size: .82rem;
  font-weight: 800;
  text-decoration: none;
}
.staff-active-session-cta:hover { background: #2c4030; }
.staff-login-card form { display: grid; gap: .5rem; }
.staff-login-card label { font-size: .9rem; font-weight: 750; }
.staff-login-card :is(input, select, button) {
  width: 100%;
  min-height: 48px;
  padding: .6rem .75rem;
  border: 1px solid var(--control-line);
  border-radius: .55rem;
  background: #fdf9f2;
  color: inherit;
  font: inherit;
}
.staff-login-card :is(input, select) { margin-bottom: .35rem; }
.staff-login-card input[aria-invalid="true"] { border-color: var(--rust); }
#staff-login-error { margin: 0; color: var(--danger-ink); font-size: .9rem; font-weight: 650; }
#staff-login-error:empty { display: none; }
.staff-login-card button { margin-top: .2rem; border-color: transparent; background: var(--gold); font-weight: 800; }
.staff-login-card button:hover:not(:disabled) { background: var(--control-highlight); }
.staff-login-return {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  margin-top: .45rem;
  color: var(--text-muted);
  font-size: .9rem;
  font-weight: 650;
  text-underline-offset: .2em;
}

/* Action hierarchy shared by customer and staff screens. */
:is(
  .admin-tool, .modules-header-btn, .modules-kpi-chip, .module-hero-back,
  .gestion-tab, .admin-filter-btn, .print-buttons button, .print-options summary,
  .checkout-clear, .checkout-close, .checkout-copy-btn, .checkout-empty-browse,
  .checkout-stepper button, .checkout-taper-stepper button, .del-pay-btn, .customize-option,
  .prep-filters button, .prep-switch button, .prep-card button, .prep-code button,
  .prep-config-actions button, .prep-history-fields button, .prep-history-pagination button,
  #admin-orders-grid .admin-order-actions button, #cust-flavors-grid button,
  #client-categories button, #client-menu-grid button, #btn-show-qr,
  #btn-submit-client-order, #customize-submit-label, #staff-login-submit,
  #btn-export-kardex, #btn-open-purchase, #btn-open-expense,
  #btn-qr-simulate-scan, #btn-qr-download-png, #btn-qr-copy-link,
  #modal-edit-order form button, .management-dialog form button, #form-pay-mesa button
) {
  min-height: var(--action-height);
  border-radius: var(--control-radius);
  touch-action: manipulation;
  transition: background-color .16s ease, border-color .16s ease, box-shadow .16s ease, color .16s ease;
}

:is(
  .admin-tool, .modules-header-btn, .modules-kpi-chip, .gestion-tab,
  .print-buttons button, .print-options summary, .checkout-stepper button, .checkout-taper-stepper button,
  .checkout-copy-btn, .checkout-empty-browse, .del-pay-btn,
  .prep-filters button, .prep-config-actions button, .prep-history-fields button,
  .prep-history-pagination button, #admin-filter-tabs .admin-filter-btn,
  #admin-orders-grid .admin-order-actions button, #cust-flavors-grid button,
  #client-categories button, #btn-export-kardex, #btn-open-expense,
  #btn-qr-download-png, #btn-qr-copy-link, #edit-order-cancel,
  .management-dialog form button, #form-pay-mesa button
) {
  border: 1px solid var(--control-line);
  background: var(--cream);
  color: var(--ink);
  box-shadow: var(--control-shadow);
}

:is(.module-hero-back, .prep-switch button, #btn-show-qr) {
  border: 1px solid var(--dark-line);
  background: var(--surface-dark-hover);
  color: var(--cream);
  box-shadow: none;
}
:is(.module-hero-back, .prep-switch button, #btn-show-qr):hover:not(:disabled) {
  background: #654a38;
  border-color: var(--control-highlight);
}
:is(.module-hero, .prep-header, .menu-browser, .customer-hero, .prep-dialog > header, .print-dialog-header)
  :focus-visible { outline-color: var(--control-highlight); }
.menu-browser :is(#client-categories, #client-menu-grid, #carta-list) :focus-visible {
  outline-color: var(--control-focus);
}

:is(
  .admin-tool-primary, .print-buttons .print-primary, .prep-card button,
  .prep-code button, .prep-config-actions button:first-child, #btn-submit-client-order,
  #customize-submit-label, #staff-login-submit, #btn-open-purchase, #btn-qr-simulate-scan,
  #client-menu-grid [data-open-cust], #admin-orders-grid button[data-admin-approve],
  #modal-edit-order button[type="submit"], .management-dialog form button[type="submit"]
) {
  border: 1px solid #ac7c40;
  background: var(--gold);
  color: var(--ink);
  box-shadow: var(--control-shadow);
}

:is(#admin-orders-grid button[data-admin-pay-mesa], #admin-orders-grid button[data-admin-deliver],
    #form-pay-mesa button[type="submit"], .modules-header-btn[aria-pressed="true"]) {
  border: 1px solid var(--success-line);
  background: var(--success-fill);
  color: var(--success-ink);
}

:is(#admin-orders-grid button[data-admin-cancel], .checkout-clear, .checkout-item-del,
    #modal-expense button[type="submit"]) {
  border: 1px solid var(--danger-line);
  background: var(--danger-fill);
  color: var(--danger-ink);
}

:is(
  .gestion-tab, .del-pay-btn, .prep-filters button, .prep-switch button,
  #cust-flavors-grid button, #client-categories button,
  body[data-staff-workspace] #admin-filter-tabs .admin-filter-btn
)[aria-pressed="true"] {
  border: 1px solid #a77d49;
  background: var(--selected-fill);
  color: var(--selected-ink);
  box-shadow: inset 0 0 0 1px #a77d49;
}
.del-pay-btn[aria-pressed="true"] span { color: var(--selected-ink); }

@media (hover: hover) {
  :is(
    .admin-tool, .modules-header-btn, .modules-kpi-chip, .gestion-tab, .print-buttons button,
    .checkout-copy-btn, .checkout-empty-browse, .checkout-stepper button, .checkout-taper-stepper button, .del-pay-btn,
    .prep-filters button, .prep-config-actions button, .prep-history-fields button,
    .prep-history-pagination button, .admin-filter-btn, #admin-orders-grid .admin-order-actions button,
    #cust-flavors-grid button, #client-categories button, #btn-export-kardex, #btn-open-expense,
    #btn-qr-download-png, #btn-qr-copy-link, #edit-order-cancel, .management-dialog form button
  ):hover:not(:disabled, [aria-pressed="true"]) { box-shadow: 0 3px 0 rgb(78 49 27 / 16%); }
  :is(
    .admin-tool-primary, .print-buttons .print-primary, .prep-card button, .prep-code button,
    #btn-submit-client-order, #customize-submit-label, #staff-login-submit,
    #btn-open-purchase, #btn-qr-simulate-scan, #client-menu-grid [data-open-cust],
    #admin-orders-grid button[data-admin-approve], .management-dialog form button[type="submit"]
  ):hover:not(:disabled) {
    border-color: #92602a;
    background: var(--control-highlight);
  }
  #modal-expense button[type="submit"]:hover:not(:disabled) { background: #ebd1c9; }
}
:is(.admin-tool, .module-hero-back, .modules-header-btn, .modules-kpi-chip, .gestion-tab,
    .admin-filter-btn, .print-buttons button, .del-pay-btn, .prep-card button,
    #btn-submit-client-order, #customize-submit-label):active:not(:disabled) {
  box-shadow: inset 0 2px 2px rgb(78 49 27 / 15%);
}
:is(.admin-tool, .print-buttons button, .prep-card button, #btn-submit-client-order,
    #customize-submit-label, #staff-login-submit):disabled {
  border-color: var(--line);
  background: var(--surface-quiet);
  color: var(--text-muted);
  box-shadow: none;
  cursor: not-allowed;
}

@media (any-pointer: coarse) {
  :root { --action-height: 48px; }
}
@media (prefers-reduced-motion: reduce) {
  :is(.admin-tool, .module-tile, .modules-header-btn, .modules-kpi-chip, .gestion-tab,
      .admin-filter-btn, .print-buttons button, .del-pay-btn, #btn-submit-client-order,
      #customize-submit-label, #staff-login-submit) { transition: none; }
}

:is(#admin-order-search, #client-search, .prep-history-fields input, .management-dialog input)::placeholder {
  color: var(--text-muted);
  opacity: 1;
}

.business-closed-modal {
  margin: auto;
  padding: 0;
  border: 0;
  background: transparent;
  width: min(25rem, calc(100vw - 2rem));
  max-width: calc(100vw - 2rem);
  max-height: calc(100dvh - 2rem);
  overflow: visible;
}
.business-closed-modal[open] {
  animation: business-closed-pop .18s cubic-bezier(.22, .61, .36, 1);
}
.business-closed-modal::backdrop {
  background: var(--carta-overlay);
  backdrop-filter: blur(3px);
}
.business-closed-modal-card {
  display: grid;
  gap: 1rem;
  padding: 1.15rem 1.25rem 1.25rem;
  border-radius: 1.2rem;
  border: 1px solid var(--carta-border);
  background: var(--carta-surface);
  color: var(--carta-text);
  box-shadow: 0 24px 56px rgb(0 0 0 / 55%);
}
.business-closed-modal-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
}
.business-closed-pill {
  display: inline-flex;
  align-items: center;
  padding: .24rem .68rem;
  border: 1px solid var(--danger-line);
  border-radius: 999px;
  background: var(--danger-fill);
  color: var(--danger-ink);
  font-size: .72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.business-closed-x {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  flex: none;
  border-radius: .65rem;
  border: 1px solid var(--carta-border);
  background: var(--carta-surface-2);
  color: var(--carta-text);
  touch-action: manipulation;
  transition: border-color .16s ease, color .16s ease, background-color .16s ease;
}
.business-closed-x svg { width: 1.15rem; height: 1.15rem; }
.business-closed-x:hover { border-color: var(--carta-accent); color: var(--carta-accent); }
.business-closed-modal-body {
  display: grid;
  justify-items: center;
  text-align: center;
  gap: .5rem;
  padding-inline: .25rem;
}
.business-closed-modal-icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 999px;
  background: rgb(229 178 96 / 14%);
  border: 1px solid rgb(229 178 96 / 35%);
  color: var(--carta-accent);
  margin-bottom: .15rem;
}
.business-closed-modal-icon svg { width: 1.4rem; height: 1.4rem; }
.business-closed-modal-body h2 {
  margin: 0;
  font: 700 1.45rem/1.12 var(--display);
  color: var(--carta-text);
}
.business-closed-modal-body p {
  margin: 0;
  font-size: .92rem;
  font-weight: 650;
  line-height: 1.42;
  color: var(--carta-text);
}
.business-closed-modal-body .business-closed-sub {
  font-size: .82rem;
  font-weight: 500;
  color: var(--carta-text-muted);
}
.business-closed-modal-cta {
  width: 100%;
  min-height: 46px;
  padding: .65rem 1rem;
  border: 0;
  border-radius: .75rem;
  background: var(--carta-accent);
  color: #2B1D16;
  font-size: .92rem;
  font-weight: 800;
  touch-action: manipulation;
  transition: background-color .16s ease, transform .15s ease;
}
.business-closed-modal-cta:hover { background: var(--control-highlight); }
.business-closed-modal-cta:active { transform: scale(.985); }
.business-closed-modal :is(button):focus-visible {
  outline: 2px solid var(--carta-accent);
  outline-offset: 2px;
}
@keyframes business-closed-pop {
  from { opacity: 0; transform: scale(.96); }
  to { opacity: 1; transform: scale(1); }
}
@media (prefers-reduced-motion: reduce) {
  .business-closed-modal[open] { animation: none; }
  .business-closed-modal-x, .business-closed-modal-cta { transition: none; }
}

.client-tracker-modal {
  width: min(27rem, calc(100vw - 2rem));
}
.client-tracker-modal-titlewrap {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
}
.client-tracker-modal-titlewrap h2 {
  margin: 0;
  font: 700 1.35rem/1.1 var(--display);
  color: var(--carta-text);
}
.client-tracker-modal-sub {
  margin: -.35rem 0 0;
  font-size: .8rem;
  color: var(--carta-text-muted);
}
.client-tracker-list {
  display: grid;
  gap: .55rem;
  max-height: 50dvh;
  overflow-y: auto;
}
.client-tracker-item {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .45rem .65rem;
  padding: .75rem .85rem;
  border-radius: .85rem;
  border: 1px solid var(--carta-border);
  background: var(--carta-surface-2);
}
.client-tracker-meta {
  display: grid;
  gap: .15rem;
  min-width: 0;
}
.client-tracker-code {
  font-size: .82rem;
  font-weight: 800;
  color: var(--carta-text);
}
.client-tracker-total {
  font-size: .78rem;
  font-weight: 700;
  color: var(--carta-accent);
  font-variant-numeric: tabular-nums;
}
.client-tracker-badge {
  display: inline-flex;
  align-items: center;
  padding: .28rem .65rem;
  border-radius: 999px;
  font-size: .72rem;
  font-weight: 800;
  white-space: nowrap;
  background: #fef3c7;
  color: #78350f;
}
.client-tracker-badge[data-tone="cooking"] {
  background: #ffedd5;
  color: #9a3412;
}
.client-tracker-badge[data-tone="ready"] {
  background: #d1fae5;
  color: #065f46;
}
.client-tracker-badge[data-tone="closed"] {
  background: #fee2e2;
  color: #991b1b;
}
.client-tracker-empty {
  margin: 0;
  font-size: .86rem;
  color: var(--carta-text-muted);
}

.checkout-tracker-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .65rem;
  padding: .65rem 1rem;
  background: #fffcf6;
  border-bottom: 1px solid var(--line);
}
.checkout-tracker-bar[hidden] { display: none; }
.checkout-tracker-copy {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  min-width: 0;
  font-size: .78rem;
  font-weight: 750;
  color: var(--ink);
}
.checkout-tracker-copy span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.checkout-tracker-btn {
  flex: none;
  min-height: 36px;
  padding: .25rem .75rem;
  border-radius: .6rem;
  border: 1px solid #ac7c40;
  background: var(--gold);
  color: var(--ink);
  font-size: .76rem;
  font-weight: 800;
  touch-action: manipulation;
}
.checkout-tracker-btn:hover { background: var(--control-highlight); }

.business-closed-inline {
  margin-top: .5rem;
  padding: .65rem .8rem;
  border: 1px solid var(--danger-line);
  border-radius: .75rem;
  background: var(--danger-fill);
  color: var(--danger-ink);
  font-size: .78rem;
  font-weight: 700;
}
.business-closed-inline[hidden] { display: none; }

.shift-control-card {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .85rem 1.25rem;
  padding: 1rem 1.15rem;
  border: 1px solid var(--line);
  border-radius: 1rem;
  background: var(--cream);
  box-shadow: var(--control-shadow);
}
.shift-control-info { min-width: min(100%, 260px); flex: 1 1 320px; }
.shift-control-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .55rem;
}
.shift-control-actions button { min-height: var(--action-height); }

.reports-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: .75rem 1rem;
}
.reports-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .5rem;
}
.reports-controls input[type="date"] {
  min-height: var(--action-height);
  border-color: var(--control-line);
  background: var(--cream);
  color: var(--ink);
}
.reports-period-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
}
.reports-methods {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
}
.reports-methods span {
  display: inline-flex;
  align-items: center;
  gap: .28rem;
  padding: .28rem .72rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-tint);
  color: var(--ink);
  font-size: .75rem;
}

#qr-delivery-card {
  border-color: var(--line);
  background: var(--surface-tint);
}
#qr-delivery-card #btn-open-delivery-menu {
  border: 1px solid #ac7c40;
  background: var(--gold);
  color: var(--ink);
}
#qr-delivery-card #btn-copy-delivery-link {
  border: 1px solid var(--control-line);
  background: var(--cream);
  color: var(--ink);
}

@media (max-width: 640px) {
  .shift-control-card { padding: .85rem .95rem; }
  .shift-control-actions { width: 100%; }
  .reports-controls { width: 100%; }
}

/* ==================== POS V2.0 DESIGN SYSTEM & APP SHELL ==================== */
:root {
  --pos-bg: #F3EDE3;
  --pos-surface: #FFFBF5;
  --pos-surface-2: #E9DFD1;
  --pos-nav-bg: #382B22;
  --pos-nav-surface: #4B3A2E;
  --pos-primary: #E5B260;
  --pos-primary-hover: #D7A24F;
  --pos-text-primary: #382B22;
  --pos-text-secondary: #725941;
  --pos-border: #DDCFBE;
  --pos-error: #AD4D3A;
  --pos-error-ink: #8E3726;
  --pos-error-bg: #F7E9E6;
  --pos-success: #46734F;
  --pos-success-ink: #32583A;
  --pos-success-bg: #E7EFE8;
  --pos-warning: #A37731;
  --pos-warning-ink: #755118;
  --pos-warning-bg: #F6EAD4;
  --pos-neutral: #897666;
  --pos-radius-sm: 6px;
  --pos-radius-md: 8px;
  --pos-radius-lg: 12px;
  --pos-radius-xl: 16px;
  --pos-shadow: 0 2px 8px rgba(56, 43, 34, 0.06);
  --pos-transition: 180ms cubic-bezier(0.2, 0.7, 0.2, 1);
}

/* Strict isolation: public QR Carta never loads POS Shell chrome */
body:not([data-staff-shell]) .pos-shell-chrome { display: none !important; }
body[data-staff-shell] [hidden],
.pos-shell-chrome[hidden] { display: none !important; }
body:not([data-staff-shell]) .pos-app-shell,
body:not([data-staff-shell]) .pos-shell-main-col { display: block; }

body[data-staff-shell] {
  background: var(--pos-bg);
  color: var(--pos-text-primary);
  overflow-x: clip;
  font-variant-numeric: tabular-nums;
}

body[data-staff-shell] .pos-app-shell {
  display: flex;
  min-height: 100dvh;
  width: 100%;
  background: var(--pos-bg);
}

body[data-staff-shell] .pos-shell-main-col {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
}

body[data-staff-shell] main#pos-content {
  flex: 1 1 auto;
  width: 100%;
  max-width: none;
  margin: 0;
  padding: clamp(12px, 1.8vw, 24px);
}

@media (max-width: 767px) {
  body[data-staff-shell] main#pos-content {
    padding: 12px 12px calc(84px + env(safe-area-inset-bottom, 0px));
  }
}

/* Header (56-64px) */
.pos-header {
  position: sticky;
  top: 0;
  z-index: 35;
  height: 60px;
  padding: 0 clamp(12px, 2vw, 24px);
  background: var(--pos-surface);
  border-bottom: 1px solid var(--pos-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.pos-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.pos-header-brand-mobile {
  display: none;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--pos-radius-md);
  background: var(--pos-nav-bg);
  color: var(--pos-primary);
  font-weight: 800;
  font-size: 12px;
  letter-spacing: 0.04em;
  flex: none;
}

@media (max-width: 767px) {
  .pos-header { height: 56px; padding-inline: 12px; }
  .pos-header-brand-mobile { display: inline-flex; }
}

.pos-header-titles { min-width: 0; }
.pos-header-title {
  margin: 0;
  font-size: clamp(18px, 2vw, 22px);
  font-weight: 800;
  line-height: 1.15;
  color: var(--pos-text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pos-header-context {
  margin: 2px 0 0;
  font-size: 12px;
  color: var(--pos-text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pos-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: none;
}

.pos-header-sound {
  min-height: 44px;
  min-width: 44px;
  padding: 0 12px;
  border-radius: var(--pos-radius-md);
  border: 1px solid var(--pos-border);
  background: var(--pos-bg);
  color: var(--pos-text-primary);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
  transition: background var(--pos-transition), border-color var(--pos-transition);
}
.pos-header-sound[aria-pressed="true"] {
  background: var(--pos-success-bg);
  border-color: var(--pos-success);
  color: var(--pos-success-ink);
}
.pos-header-sound svg { width: 18px; height: 18px; flex: none; }
@media (max-width: 639px) {
  .pos-header-sound span { display: none; }
  .pos-header-sound { padding: 0; justify-content: center; }
}

.pos-account-wrap { position: relative; }
.pos-account-trigger {
  min-height: 44px;
  padding: 4px 10px 4px 6px;
  border-radius: 999px;
  border: 1px solid var(--pos-border);
  background: var(--pos-surface);
  color: var(--pos-text-primary);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
}
.pos-account-trigger:hover { background: var(--pos-surface-2); }
.pos-account-avatar {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  background: var(--pos-nav-bg);
  color: var(--pos-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 13px;
  flex: none;
}
.pos-account-meta { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.15; }
.pos-account-role { font-size: 11px; color: var(--pos-text-secondary); font-weight: 600; }
.pos-account-chevron { width: 16px; height: 16px; color: var(--pos-text-secondary); }
@media (max-width: 639px) {
  .pos-account-meta, .pos-account-chevron { display: none; }
  .pos-account-trigger { padding: 4px; }
}

.pos-account-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  width: 224px;
  padding: 6px;
  background: var(--pos-surface);
  border: 1px solid var(--pos-border);
  border-radius: var(--pos-radius-lg);
  box-shadow: 0 12px 28px rgba(56, 43, 34, 0.16);
  z-index: 60;
}
.pos-account-menu-head {
  padding: 8px 10px;
  border-bottom: 1px solid var(--pos-border);
  margin-bottom: 4px;
}
.pos-account-menu-head strong { display: block; font-size: 14px; color: var(--pos-text-primary); }
.pos-account-menu-head span { display: block; font-size: 12px; color: var(--pos-text-secondary); }
.pos-account-menu button {
  width: 100%;
  min-height: 44px;
  padding: 8px 10px;
  border-radius: var(--pos-radius-md);
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 600;
  color: var(--pos-text-primary);
  text-align: left;
}
.pos-account-menu button:hover { background: var(--pos-surface-2); }
.pos-account-menu button[data-tone="error"] { color: var(--pos-error-ink); }
.pos-account-menu button[data-tone="error"]:hover { background: var(--pos-error-bg); }
.pos-account-menu svg { width: 17px; height: 17px; flex: none; }

/* NavigationRail (768-1439px) & DesktopSidebar (>=1440px) */
.pos-nav-aside {
  position: sticky;
  top: 0;
  height: 100dvh;
  background: var(--pos-nav-bg);
  color: #FFFBF5;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 12px 8px;
  border-right: 1px solid rgba(255, 251, 245, 0.08);
  z-index: 40;
  flex: none;
  overflow-y: auto;
}

@media (max-width: 767px) {
  .pos-nav-aside { display: none !important; }
}

@media (min-width: 768px) and (max-width: 1439px) {
  .pos-nav-aside { width: 88px; }
  .pos-nav-desktop-only { display: none !important; }
}

@media (min-width: 1440px) {
  .pos-nav-aside { width: 240px; padding: 14px 12px; }
  .pos-nav-aside.is-collapsed { width: 88px; padding: 12px 8px; }
  .pos-nav-aside:not(.is-collapsed) .pos-nav-rail-only { display: none !important; }
  .pos-nav-aside.is-collapsed .pos-nav-desktop-only { display: none !important; }
}

.pos-nav-brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 4px 4px 14px;
  margin-bottom: 8px;
  border-bottom: 1px solid rgba(255, 251, 245, 0.1);
}
.pos-nav-aside.is-collapsed .pos-nav-brand { justify-content: center; flex-direction: column; }
@media (max-width: 1439px) {
  .pos-nav-brand { justify-content: center; flex-direction: column; }
}
.pos-nav-logo-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.pos-nav-logo-badge {
  width: 44px;
  height: 44px;
  border-radius: var(--pos-radius-lg);
  background: rgba(229, 178, 96, 0.14);
  border: 1px solid rgba(229, 178, 96, 0.35);
  color: var(--pos-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 13px;
  letter-spacing: 0.04em;
  flex: none;
}
.pos-nav-brand-text strong { display: block; font-size: 13px; letter-spacing: 0.03em; color: var(--pos-primary); line-height: 1.15; }
.pos-nav-brand-text span { display: block; font-size: 11px; color: #DDCFBE; }

.pos-sidebar-collapse-btn {
  width: 36px;
  height: 36px;
  border-radius: var(--pos-radius-md);
  color: #DDCFBE;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.pos-sidebar-collapse-btn:hover { background: var(--pos-nav-surface); color: #FFFBF5; }
@media (max-width: 1439px) {
  .pos-sidebar-collapse-btn { display: none; }
}

.pos-rail-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.pos-rail-btn {
  width: 100%;
  min-height: 58px;
  padding: 8px 4px;
  border-radius: var(--pos-radius-lg);
  color: #E9DFD1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 600;
  position: relative;
  transition: background var(--pos-transition), color var(--pos-transition);
}
.pos-rail-btn svg { width: 20px; height: 20px; flex: none; }
.pos-rail-btn:hover { background: var(--pos-nav-surface); color: #FFFBF5; }
.pos-rail-btn[aria-current="page"],
.pos-rail-btn[aria-expanded="true"] {
  background: var(--pos-primary);
  color: var(--pos-text-primary);
  font-weight: 800;
}

.pos-nav-badge {
  position: absolute;
  top: 6px;
  right: 8px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--pos-error);
  color: #FFFBF5;
  font-size: 11px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.pos-rail-btn[aria-current="page"] .pos-nav-badge {
  background: var(--pos-nav-bg);
  color: var(--pos-primary);
}

.pos-sidebar-groups {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.pos-sidebar-group-title {
  margin: 0 0 6px 10px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #C7B39C;
}
.pos-sidebar-list { display: flex; flex-direction: column; gap: 4px; }
.pos-sidebar-btn {
  width: 100%;
  min-height: 46px;
  padding: 8px 12px;
  border-radius: var(--pos-radius-md);
  color: #E9DFD1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  text-align: left;
  transition: background var(--pos-transition), color var(--pos-transition);
}
.pos-sidebar-btn-main { display: flex; align-items: center; gap: 10px; min-width: 0; }
.pos-sidebar-btn-main svg { width: 18px; height: 18px; flex: none; }
.pos-sidebar-btn:hover { background: var(--pos-nav-surface); color: #FFFBF5; }
.pos-sidebar-btn[aria-current="page"] {
  background: var(--pos-primary);
  color: var(--pos-text-primary);
  font-weight: 800;
}
.pos-sidebar-pill {
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--pos-error);
  color: #FFFBF5;
  font-size: 11px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.pos-sidebar-btn[aria-current="page"] .pos-sidebar-pill {
  background: var(--pos-nav-bg);
  color: var(--pos-primary);
}

/* Mobile Bottom Navigation (320-767px) */
.pos-mobile-nav {
  position: fixed;
  inset-inline: 0;
  bottom: 0;
  z-index: 45;
  height: calc(68px + env(safe-area-inset-bottom, 0px));
  padding: 6px 8px calc(6px + env(safe-area-inset-bottom, 0px));
  background: var(--pos-nav-bg);
  border-top: 1px solid rgba(255, 251, 245, 0.12);
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 4px;
}
@media (min-width: 768px) {
  .pos-mobile-nav { display: none !important; }
}
.pos-mobile-nav-btn {
  min-height: 48px;
  border-radius: var(--pos-radius-md);
  color: #E9DFD1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  font-size: 11px;
  font-weight: 600;
  position: relative;
}
.pos-mobile-nav-btn svg { width: 20px; height: 20px; }
.pos-mobile-nav-btn[aria-current="page"],
.pos-mobile-nav-btn[aria-expanded="true"] {
  background: rgba(229, 178, 96, 0.18);
  color: var(--pos-primary);
  font-weight: 800;
}
.pos-mobile-nav-btn .pos-nav-badge { top: 3px; right: calc(50% - 22px); }

/* Contextual More Drawer / Sheet */
.pos-drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(56, 43, 34, 0.56);
  z-index: 54;
}
.pos-more-drawer {
  position: fixed;
  z-index: 55;
  background: var(--pos-surface);
  color: var(--pos-text-primary);
  box-shadow: 0 18px 40px rgba(56, 43, 34, 0.24);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
@media (min-width: 768px) {
  .pos-more-drawer {
    top: 12px;
    bottom: 12px;
    left: 100px;
    width: min(360px, calc(100vw - 116px));
    border-radius: var(--pos-radius-xl);
    border: 1px solid var(--pos-border);
  }
}
@media (max-width: 767px) {
  .pos-more-drawer {
    inset-inline: 0;
    bottom: 0;
    max-height: 82dvh;
    border-radius: var(--pos-radius-xl) var(--pos-radius-xl) 0 0;
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }
}
.pos-more-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  border-bottom: 1px solid var(--pos-border);
  background: var(--pos-surface);
}
.pos-more-head h2 { margin: 0; font-size: 18px; font-weight: 800; }
.pos-more-close {
  width: 44px;
  height: 44px;
  border-radius: var(--pos-radius-md);
  border: 1px solid var(--pos-border);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--pos-text-primary);
}
.pos-more-close svg { width: 18px; height: 18px; display: block; flex: none; }
.pos-more-body {
  padding: 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.pos-more-group h3 {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--pos-text-secondary);
}
.pos-more-grid {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.pos-more-item {
  width: 100%;
  min-height: 52px;
  padding: 10px 12px;
  border-radius: var(--pos-radius-lg);
  border: 1px solid var(--pos-border);
  background: var(--pos-surface);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  text-align: left;
  transition: background var(--pos-transition), border-color var(--pos-transition);
}
.pos-more-item:hover { background: var(--pos-surface-2); }
.pos-more-item[aria-current="page"] {
  background: #F6EAD4;
  border-color: var(--pos-primary);
}
.pos-more-item-main { display: flex; align-items: center; gap: 12px; min-width: 0; }
.pos-more-item-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--pos-radius-md);
  background: var(--pos-surface-2);
  color: var(--pos-text-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
}
.pos-more-item-icon svg { width: 18px; height: 18px; display: block; flex: none; }
.pos-more-item[aria-current="page"] .pos-more-item-icon {
  background: var(--pos-primary);
  color: var(--pos-text-primary);
}
.pos-more-item-copy { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.pos-more-item-copy strong { display: block; font-size: 14px; font-weight: 700; color: var(--pos-text-primary); line-height: 1.25; }
.pos-more-item-copy > span { display: block; font-size: 12px; color: var(--pos-text-secondary); line-height: 1.3; }

/* Reusable POS V2.0 Components */
.pos-card {
  background: var(--pos-surface);
  border: 1px solid var(--pos-border);
  border-radius: var(--pos-radius-lg);
  box-shadow: var(--pos-shadow);
  padding: 16px;
}
.pos-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.pos-card-header h3 { margin: 0; font-size: 16px; font-weight: 800; color: var(--pos-text-primary); }

.pos-btn {
  min-height: 48px;
  padding: 0 16px;
  border-radius: var(--pos-radius-md);
  border: 1px solid var(--pos-border);
  background: var(--pos-surface);
  color: var(--pos-text-primary);
  font-size: 14px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  white-space: nowrap;
  transition: background var(--pos-transition), border-color var(--pos-transition), opacity var(--pos-transition);
}
.pos-btn svg { width: 18px; height: 18px; flex: none; }
.pos-btn-sm { min-height: 40px; padding: 0 12px; font-size: 13px; }
.pos-btn-lg { min-height: 52px; padding: 0 20px; font-size: 15px; font-weight: 800; }
.pos-btn-primary {
  background: var(--pos-primary);
  border-color: #C79440;
  color: var(--pos-text-primary);
  font-weight: 800;
}
.pos-btn-primary:hover:not(:disabled) { background: var(--pos-primary-hover); }
.pos-btn-secondary:hover:not(:disabled),
.pos-btn-subtle:hover:not(:disabled) { background: var(--pos-surface-2); }
.pos-btn-subtle { background: var(--pos-bg); }
.pos-btn-success {
  background: var(--pos-success);
  border-color: var(--pos-success-ink);
  color: #FFFBF5;
}
.pos-btn-success:hover:not(:disabled) { background: var(--pos-success-ink); }
.pos-btn-dark {
  background: var(--pos-nav-bg);
  border-color: var(--pos-nav-bg);
  color: #FFFBF5;
}
.pos-btn-danger {
  background: var(--pos-error-bg);
  border-color: #D79C90;
  color: var(--pos-error-ink);
}
.pos-btn-danger:hover:not(:disabled) { background: #EED5CF; }

.pos-text-link {
  min-height: 40px;
  padding: 0 8px;
  border-radius: var(--pos-radius-sm);
  color: var(--pos-text-secondary);
  font-size: 13px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.pos-text-link:hover { background: var(--pos-surface-2); color: var(--pos-text-primary); }

.pos-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
  border: 1px solid transparent;
  white-space: nowrap;
}
.pos-badge-sm { padding: 3px 8px; font-size: 11px; }
.pos-badge svg { width: 14px; height: 14px; flex: none; }
.pos-badge[data-tone="error"] { background: var(--pos-error-bg); border-color: #E2B5AC; color: var(--pos-error-ink); }
.pos-badge[data-tone="warning"] { background: var(--pos-warning-bg); border-color: #E0C28A; color: var(--pos-warning-ink); }
.pos-badge[data-tone="success"] { background: var(--pos-success-bg); border-color: #B4CCB8; color: var(--pos-success-ink); }
.pos-badge[data-tone="neutral"] { background: var(--pos-surface-2); border-color: var(--pos-border); color: var(--pos-text-secondary); }

.pos-station-chip {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: var(--pos-radius-sm);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  background: var(--pos-surface-2);
  color: var(--pos-text-primary);
}
.pos-station-chip[data-station="COCINA"] { background: var(--pos-error-bg); color: var(--pos-error-ink); }
.pos-station-chip[data-station="BARRA"] { background: var(--pos-success-bg); color: var(--pos-success-ink); }

.pos-empty-state {
  padding: 36px 20px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.pos-empty-icon {
  width: 52px;
  height: 52px;
  border-radius: 999px;
  background: var(--pos-surface-2);
  color: var(--pos-text-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.pos-empty-icon svg { width: 24px; height: 24px; }
.pos-empty-state h3 { margin: 0; font-size: 16px; font-weight: 800; color: var(--pos-text-primary); }
.pos-empty-state p { margin: 0; max-width: 38ch; font-size: 14px; color: var(--pos-text-secondary); line-height: 1.45; }

/* Tables vs Mobile Cards */
.pos-table-wrap { overflow-x: auto; max-width: 100%; border-radius: var(--pos-radius-md); border: 1px solid var(--pos-border); background: var(--pos-surface); }
.pos-table { width: 100%; border-collapse: collapse; text-align: left; font-size: 14px; }
.pos-table thead th {
  padding: 12px 14px;
  background: var(--pos-surface-2);
  color: var(--pos-text-secondary);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px solid var(--pos-border);
  white-space: nowrap;
}
.pos-table tbody td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--pos-border);
  vertical-align: middle;
}
.pos-dash-table-desktop .pos-table thead th,
.pos-dash-table-desktop .pos-table tbody td {
  padding: 10px 10px;
}
.pos-table tbody tr:last-child td { border-bottom: none; }
.pos-table tbody tr:hover { background: #F9F2E7; }
.pos-cell-title { display: block; font-size: 14px; font-weight: 700; color: var(--pos-text-primary); }
.pos-cell-code { font-size: 12px; color: var(--pos-text-secondary); }
.pos-cell-meta { font-size: 13px; color: var(--pos-text-secondary); }
.pos-num-cell { font-variant-numeric: tabular-nums; font-weight: 700; white-space: nowrap; }
.pos-num-cell[data-tone="error"] { color: var(--pos-error-ink); }
.pos-num-cell[data-tone="warning"] { color: var(--pos-warning-ink); }
.pos-num-cell[data-tone="success"] { color: var(--pos-success-ink); }
.pos-muted-cell { color: var(--pos-text-secondary); }

.pos-mobile-cards { display: flex; flex-direction: column; gap: 10px; }
.pos-mobile-card {
  background: var(--pos-surface);
  border: 1px solid var(--pos-border);
  border-radius: var(--pos-radius-lg);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.pos-mobile-card-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.pos-mobile-card-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 4px; font-size: 12px; color: var(--pos-text-secondary); }
.pos-mobile-card-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-top: 8px;
  border-top: 1px solid var(--pos-border);
  font-size: 14px;
}
.pos-truncate-doc { font-size: 13px; color: var(--pos-text-secondary); min-width: 0; overflow-wrap: anywhere; }
.pos-mobile-details summary {
  min-height: 40px;
  display: flex;
  align-items: center;
  font-size: 13px;
  font-weight: 700;
  color: var(--pos-text-secondary);
  cursor: pointer;
}
.pos-mobile-dl {
  margin: 6px 0 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 12px;
  font-size: 13px;
}
.pos-mobile-dl dt { font-size: 11px; color: var(--pos-text-secondary); text-transform: uppercase; }
.pos-mobile-dl dd { margin: 2px 0 0; font-weight: 700; color: var(--pos-text-primary); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }

@media (max-width: 767px) {
  .pos-responsive-table-desktop { display: none !important; }
  .pos-responsive-cards-mobile { display: block !important; }
}
@media (min-width: 768px) {
  .pos-responsive-table-desktop { display: block !important; }
  .pos-responsive-cards-mobile { display: none !important; }
}

/* Dashboard */
.pos-dash-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}
.pos-section-heading { margin: 0; font-size: 20px; font-weight: 800; color: var(--pos-text-primary); }
.pos-dash-cta-group { display: flex; flex-wrap: wrap; gap: 8px; }
@media (max-width: 639px) {
  .pos-dash-cta-group { width: 100%; }
  .pos-dash-cta-group .pos-btn { flex: 1 1 auto; }
}

.pos-kpi-grid {
  display: grid;
  gap: 12px;
  margin-bottom: 16px;
}
.pos-kpi-grid.is-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.pos-kpi-grid.is-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.pos-kpi-grid.is-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 1023px) {
  .pos-kpi-grid.is-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 639px) {
  .pos-kpi-grid.is-3 { grid-template-columns: 1fr; }
}

.pos-kpi-card {
  text-align: left;
  background: var(--pos-surface);
  border: 1px solid var(--pos-border);
  border-radius: var(--pos-radius-lg);
  padding: 14px 16px;
  box-shadow: var(--pos-shadow);
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: border-color var(--pos-transition), transform var(--pos-transition);
}
button.pos-kpi-card:hover { border-color: var(--pos-primary); }
.pos-kpi-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; }
.pos-kpi-label { font-size: 13px; font-weight: 700; color: var(--pos-text-secondary); }
.pos-kpi-icon {
  width: 34px;
  height: 34px;
  border-radius: var(--pos-radius-md);
  background: var(--pos-surface-2);
  color: var(--pos-text-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
}
.pos-kpi-icon svg { width: 18px; height: 18px; }
.pos-kpi-card[data-tone="error"] .pos-kpi-icon { background: var(--pos-error-bg); color: var(--pos-error-ink); }
.pos-kpi-card[data-tone="warning"] .pos-kpi-icon { background: var(--pos-warning-bg); color: var(--pos-warning-ink); }
.pos-kpi-card[data-tone="success"] .pos-kpi-icon { background: var(--pos-success-bg); color: var(--pos-success-ink); }
.pos-kpi-foot { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; width: 100%; }
.pos-kpi-value { font-size: clamp(24px, 3vw, 32px); font-weight: 800; line-height: 1.1; color: var(--pos-text-primary); }
.pos-kpi-card[data-tone="error"] .pos-kpi-value { color: var(--pos-error); }
.pos-kpi-card[data-tone="warning"] .pos-kpi-value { color: var(--pos-warning-ink); }
.pos-kpi-card[data-tone="success"] .pos-kpi-value { color: var(--pos-success); }
.pos-kpi-sub { font-size: 12px; color: var(--pos-text-secondary); font-weight: 600; }
.pos-kpi-arrow { width: 18px; height: 18px; color: var(--pos-text-secondary); }

.pos-dash-split {
  display: grid;
  grid-template-columns: minmax(0, 1.9fr) minmax(260px, 1fr);
  gap: 16px;
  align-items: start;
}
@media (max-width: 1023px) {
  .pos-dash-split { grid-template-columns: 1fr; }
}
.pos-dash-aside { display: flex; flex-direction: column; gap: 12px; }
@media (min-width: 640px) and (max-width: 1023px) {
  .pos-dash-aside { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.pos-summary-card {
  width: 100%;
  text-align: left;
  background: var(--pos-surface);
  border: 1px solid var(--pos-border);
  border-radius: var(--pos-radius-lg);
  padding: 16px;
  box-shadow: var(--pos-shadow);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.pos-summary-card:hover { border-color: var(--pos-primary); }
.pos-summary-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; }
.pos-summary-title { font-size: 15px; font-weight: 800; color: var(--pos-text-primary); }
.pos-summary-metric { font-size: 28px; font-weight: 800; color: var(--pos-text-primary); }
.pos-summary-card[data-tone="warning"] .pos-summary-metric { color: var(--pos-warning-ink); }
.pos-summary-card[data-tone="success"] .pos-summary-metric { color: var(--pos-success); }
.pos-summary-sub { margin: 0; font-size: 13px; color: var(--pos-text-secondary); }
.pos-summary-link { display: inline-flex; align-items: center; gap: 6px; margin-top: 4px; font-size: 13px; font-weight: 700; color: var(--pos-text-primary); }

.pos-dash-list-mobile { display: none; flex-direction: column; gap: 8px; }
.pos-mobile-row-btn {
  width: 100%;
  text-align: left;
  padding: 12px;
  border-radius: var(--pos-radius-md);
  border: 1px solid var(--pos-border);
  background: var(--pos-bg);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.pos-mobile-row-top { display: flex; justify-content: space-between; gap: 8px; }
.pos-mobile-row-bottom { display: flex; justify-content: space-between; align-items: center; }
.pos-link-hint { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 700; color: var(--pos-text-secondary); }
@media (max-width: 767px) {
  .pos-dash-table-desktop { display: none; }
  .pos-dash-list-mobile { display: flex; }
}

/* Pedidos Master-Detail */
.pos-admin-controls {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 16px;
}
.pos-admin-toolbar-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.pos-segmented-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
body[data-staff-shell] .admin-filter-btn,
.pos-tab-btn {
  min-height: 44px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--pos-border);
  background: var(--pos-surface);
  color: var(--pos-text-secondary);
  font-size: 13px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
body[data-staff-shell] .admin-filter-btn[aria-pressed="true"],
.pos-tab-btn[aria-pressed="true"] {
  background: var(--pos-primary);
  border-color: #C79440;
  color: var(--pos-text-primary);
  font-weight: 800;
}
body[data-staff-shell] .admin-filter-btn [data-order-count] {
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--pos-surface-2);
  color: var(--pos-text-primary);
  font-size: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
body[data-staff-shell] .admin-filter-btn[aria-pressed="true"] [data-order-count] {
  background: var(--pos-nav-bg);
  color: #FFFBF5;
}

.pos-search-input-wrap {
  position: relative;
  flex: 1 1 260px;
  min-width: 0;
}
.pos-search-input-wrap svg {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: var(--pos-text-secondary);
  pointer-events: none;
}
.pos-search-input-wrap input {
  width: 100%;
  min-height: 48px;
  padding: 0 14px 0 42px;
  border-radius: var(--pos-radius-md);
  border: 1px solid var(--pos-border);
  background: var(--pos-surface);
  color: var(--pos-text-primary);
  font-size: 15px;
}

.pos-master-detail {
  display: grid;
  grid-template-columns: minmax(300px, 0.9fr) minmax(0, 1.35fr);
  gap: 16px;
  align-items: start;
}
.pos-master-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: var(--pos-surface);
  border: 1px solid var(--pos-border);
  border-radius: var(--pos-radius-lg);
  padding: 10px;
  box-shadow: var(--pos-shadow);
}
.pos-master-item {
  width: 100%;
  min-height: 68px;
  padding: 12px;
  border-radius: var(--pos-radius-md);
  border: 1px solid transparent;
  background: var(--pos-bg);
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: background var(--pos-transition), border-color var(--pos-transition);
}
.pos-master-item:hover { background: var(--pos-surface-2); }
.pos-master-item.is-selected {
  background: #F6EAD4;
  border-color: var(--pos-primary);
  box-shadow: inset 3px 0 0 var(--pos-nav-bg);
}
.pos-master-row-top, .pos-master-row-mid, .pos-master-row-bot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.pos-master-origin { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 800; color: var(--pos-text-primary); }
.pos-master-origin svg { width: 15px; height: 15px; color: var(--pos-text-secondary); }
.pos-master-total { font-size: 15px; font-weight: 800; color: var(--pos-text-primary); }
.pos-master-customer { font-size: 13px; font-weight: 600; color: var(--pos-text-primary); }
.pos-master-time, .pos-master-code { font-size: 12px; color: var(--pos-text-secondary); }

.pos-detail-pane {
  position: sticky;
  top: 76px;
  background: var(--pos-surface);
  border: 1px solid var(--pos-border);
  border-radius: var(--pos-radius-lg);
  box-shadow: var(--pos-shadow);
  padding: 20px;
}
.pos-detail-mobile-back { display: none; margin-bottom: 12px; }
@media (max-width: 1023px) {
  .pos-master-detail { grid-template-columns: 1fr; }
  .pos-detail-pane { position: static; }
  .pos-master-detail:not([data-mobile-detail="true"]) .pos-detail-pane { display: none; }
  .pos-master-detail[data-mobile-detail="true"] .pos-master-list { display: none; }
  .pos-master-detail[data-mobile-detail="true"] .pos-detail-mobile-back { display: block; }
}

.pos-detail-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--pos-border);
}
.pos-detail-badges { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 6px; }
.pos-time-pill { font-size: 12px; font-weight: 700; color: var(--pos-text-secondary); background: var(--pos-surface-2); padding: 4px 8px; border-radius: 999px; }
.pos-detail-title { margin: 0; font-size: 20px; font-weight: 800; color: var(--pos-text-primary); }
.pos-detail-subtitle { margin: 4px 0 0; font-size: 13px; color: var(--pos-text-secondary); display: flex; flex-wrap: wrap; gap: 6px; }
.pos-detail-payment-box { text-align: right; }
.pos-detail-total { display: block; font-size: 24px; font-weight: 800; color: var(--pos-text-primary); }
.pos-pay-pill { display: inline-block; margin-top: 2px; font-size: 12px; font-weight: 700; color: var(--pos-warning-ink); }
.pos-pay-pill[data-paid="true"] { color: var(--pos-success-ink); }
.pos-station-progress, .pos-detail-logistics {
  margin-top: 12px;
  padding: 12px;
  border-radius: var(--pos-radius-md);
  background: var(--pos-bg);
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
}
.pos-station-progress { flex-direction: row; flex-wrap: wrap; gap: 8px; }
.pos-inline-map-link { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; color: var(--pos-error-ink); text-decoration: underline; }
.pos-detail-section { margin-top: 16px; }
.pos-detail-section h3 { margin: 0 0 10px; font-size: 14px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.04em; color: var(--pos-text-secondary); }
.pos-detail-items { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.pos-detail-item { padding: 10px 12px; border-radius: var(--pos-radius-md); background: var(--pos-bg); }
.pos-detail-item-main { display: flex; align-items: flex-start; gap: 10px; }
.pos-detail-qty { font-weight: 800; font-size: 15px; min-width: 28px; color: var(--pos-text-primary); }
.pos-detail-item-body { flex: 1 1 auto; min-width: 0; }
.pos-detail-item-name { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 15px; }
.pos-detail-meta, .pos-detail-note { margin: 3px 0 0; font-size: 13px; color: var(--pos-text-secondary); }
.pos-detail-note { color: var(--pos-warning-ink); font-weight: 600; }
.pos-detail-price { font-weight: 800; font-size: 15px; white-space: nowrap; }
.pos-detail-order-note { margin-top: 12px; padding: 10px 12px; border-radius: var(--pos-radius-md); background: var(--pos-warning-bg); color: var(--pos-warning-ink); font-size: 13px; }
.pos-detail-footer {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--pos-border);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.pos-detail-secondary-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.pos-detail-primary-action .pos-action-main { width: 100%; }

/* Staff Workspace overrides for Nuevo pedido & Carta administrativa (#view-cliente) */
body[data-staff-shell] #staff-menu-hero,
body[data-staff-shell] #carta-mobile-nav,
body[data-staff-shell] #admin-order-entry,
body[data-staff-shell] #btn-open-tracker,
body[data-staff-shell] #client-cart-tracker-bar {
  display: none !important;
}

.pos-entry-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  margin-bottom: 14px;
  background: var(--pos-surface);
  border: 1px solid var(--pos-border);
  border-radius: var(--pos-radius-lg);
  box-shadow: var(--pos-shadow);
}
.pos-entry-bar-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.pos-mode-pills {
  display: inline-flex;
  padding: 4px;
  border-radius: var(--pos-radius-md);
  background: var(--pos-surface-2);
  gap: 4px;
}
.pos-mode-pill {
  min-height: 40px;
  padding: 0 12px;
  border-radius: var(--pos-radius-sm);
  font-size: 13px;
  font-weight: 700;
  color: var(--pos-text-secondary);
}
.pos-mode-pill[aria-pressed="true"] {
  background: var(--pos-surface);
  color: var(--pos-text-primary);
  box-shadow: 0 1px 3px rgba(56, 43, 34, 0.12);
}
.pos-mesa-select {
  min-height: 44px;
  padding: 0 12px;
  border-radius: var(--pos-radius-md);
  border: 1px solid var(--pos-border);
  background: var(--pos-surface);
  color: var(--pos-text-primary);
  font-size: 14px;
  font-weight: 700;
}

body[data-staff-shell] #view-cliente .client-workspace-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(300px, 1fr);
  gap: 16px;
  align-items: start;
}
@media (max-width: 1023px) {
  body[data-staff-shell] #view-cliente .client-workspace-grid { grid-template-columns: 1fr; }
}
@media (min-width: 1024px) {
  body[data-staff-shell] #carta-cart-link { display: none !important; }
  body[data-staff-shell] #client-cart {
    position: sticky;
    top: 74px;
    max-height: calc(100dvh - 96px);
    overflow-y: auto;
  }
}

.pos-mobile-cart-bar {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: calc(76px + env(safe-area-inset-bottom, 0px));
  z-index: 42;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--pos-radius-lg);
  background: var(--pos-nav-bg);
  color: #FFFBF5;
  box-shadow: 0 10px 24px rgba(56, 43, 34, 0.25);
}
@media (min-width: 768px) and (max-width: 1023px) {
  .pos-mobile-cart-bar { left: 104px; bottom: 16px; }
}
@media (min-width: 1024px) {
  .pos-mobile-cart-bar { display: none !important; }
}

.pos-staff-cat-quickbar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  overflow-x: auto;
  background: #433227;
  border-bottom: 1px solid rgba(255, 251, 245, 0.08);
}
@media (min-width: 1024px) {
  .pos-staff-cat-quickbar { display: none; }
}

/* KDS (Cocina & Barra) */
.pos-kds-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  margin-bottom: 14px;
  background: var(--pos-surface);
  border: 1px solid var(--pos-border);
  border-radius: var(--pos-radius-lg);
  box-shadow: var(--pos-shadow);
}
.pos-kds-group { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.pos-kds-count { font-size: 14px; font-weight: 700; color: var(--pos-text-secondary); }
body[data-staff-shell] #view-chef .prep-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  align-items: start;
}
@media (min-width: 640px) {
  body[data-staff-shell] #view-chef .prep-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 1024px) {
  body[data-staff-shell] #view-chef .prep-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (min-width: 1440px) {
  body[data-staff-shell] #view-chef .prep-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
body[data-staff-shell] #view-chef .prep-card ul { font-size: 16px; line-height: 1.4; }
body[data-staff-shell] #view-chef[data-large-text] .prep-card ul { font-size: 18px; }
body[data-staff-shell] #view-chef .prep-card button[data-prep-complete] {
  min-height: 48px;
  background: var(--pos-primary);
  color: var(--pos-text-primary);
  font-weight: 800;
  border-color: #C79440;
}

body[data-staff-shell][data-kds-focus] .pos-nav-aside,
body[data-staff-shell][data-kds-focus] .pos-mobile-nav {
  display: none !important;
}
body[data-staff-shell][data-kds-focus] main#pos-content {
  padding-bottom: 20px;
}

/* Back Office Filters & QR Grid */
.pos-filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: var(--pos-surface);
  border: 1px solid var(--pos-border);
  border-radius: var(--pos-radius-lg);
}
.pos-filter-select {
  min-height: 48px;
  padding: 0 12px;
  border-radius: var(--pos-radius-md);
  border: 1px solid var(--pos-border);
  background: var(--pos-surface);
  color: var(--pos-text-primary);
  font-size: 14px;
  font-weight: 600;
}
.pos-filter-actions { margin-left: auto; display: flex; flex-wrap: wrap; gap: 8px; }
@media (max-width: 767px) {
  .pos-filter-actions { margin-left: 0; width: 100%; }
  .pos-filter-actions .pos-btn { flex: 1 1 auto; }
}

.pos-boleta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--pos-border);
}
.pos-boleta-row:last-child { border-bottom: none; }
.pos-boleta-num { font-weight: 800; color: var(--pos-text-primary); font-size: 14px; }
.pos-boleta-num span { color: var(--pos-text-secondary); font-weight: 600; }
.pos-boleta-meta { font-size: 12px; color: var(--pos-text-secondary); margin-top: 2px; }
.pos-boleta-actions { display: flex; align-items: center; gap: 10px; }

.pos-qr-top-panel { margin-bottom: 16px; }
.pos-qr-config-row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px 18px; }
.pos-qr-url-field { flex: 1 1 320px; display: flex; flex-direction: column; gap: 6px; }
.pos-qr-url-field label { font-size: 13px; font-weight: 700; color: var(--pos-text-primary); }
.pos-qr-url-field input {
  width: 100%;
  min-height: 48px;
  padding: 0 12px;
  border-radius: var(--pos-radius-md);
  border: 1px solid var(--pos-border);
  background: var(--pos-surface);
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
}
.pos-qr-hint { margin: 0; flex: 1 1 260px; font-size: 13px; color: var(--pos-text-secondary); }
.pos-qr-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}
@media (max-width: 1023px) { .pos-qr-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 639px) { .pos-qr-grid { grid-template-columns: 1fr; } }

.pos-qr-card {
  background: var(--pos-surface);
  border: 1px solid var(--pos-border);
  border-radius: var(--pos-radius-lg);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: var(--pos-shadow);
}
.pos-qr-card-head { display: flex; align-items: center; justify-content: space-between; }
.pos-qr-card-head h3 { margin: 0; font-size: 17px; font-weight: 800; }
.pos-qr-preview {
  width: min(176px, 100%);
  aspect-ratio: 1;
  margin-inline: auto;
  padding: 10px;
  border-radius: var(--pos-radius-md);
  border: 2px solid var(--pos-text-primary);
  background: #ffffff;
}
.pos-qr-preview svg { width: 100%; height: 100%; display: block; }
.pos-qr-url {
  margin: 0;
  padding: 8px 10px;
  border-radius: var(--pos-radius-sm);
  background: var(--pos-bg);
  font-size: 11px;
  color: var(--pos-text-secondary);
  overflow-wrap: anywhere;
  text-align: center;
}
.pos-qr-card-actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }

.pos-qr-delivery-head h3 { margin: 8px 0 4px; font-size: 17px; font-weight: 800; }
.pos-qr-delivery-head p { margin: 0; font-size: 13px; color: var(--pos-text-secondary); }
.pos-qr-delivery-body { margin-top: 12px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.pos-qr-delivery-url {
  flex: 1 1 320px;
  padding: 10px 12px;
  border-radius: var(--pos-radius-md);
  background: var(--pos-bg);
  border: 1px solid var(--pos-border);
  font-size: 13px;
  overflow-wrap: anywhere;
}
.pos-qr-delivery-actions { display: flex; flex-wrap: wrap; gap: 8px; }

/* Settings & Roles Views */
.pos-settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
@media (max-width: 900px) { .pos-settings-grid { grid-template-columns: 1fr; } }
.pos-settings-section h3 { margin: 0 0 6px; font-size: 17px; font-weight: 800; }
.pos-settings-section p { margin: 0 0 12px; font-size: 13px; color: var(--pos-text-secondary); line-height: 1.45; }
.pos-settings-form { display: flex; flex-direction: column; gap: 10px; }
.pos-settings-form input {
  width: 100%;
  min-height: 48px;
  padding: 0 12px;
  border-radius: var(--pos-radius-md);
  border: 1px solid var(--pos-border);
  background: var(--pos-surface);
  font-size: 15px;
}

.pos-roles-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
@media (max-width: 1023px) { .pos-roles-grid { grid-template-columns: 1fr; } }
.pos-role-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.pos-role-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--pos-radius-md);
  background: var(--pos-surface-2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
}
.pos-role-icon svg { width: 22px; height: 22px; display: block; flex: none; }
.pos-role-icon[data-tone="error"] { background: var(--pos-error-bg); color: var(--pos-error-ink); }
.pos-role-icon[data-tone="warning"] { background: var(--pos-warning-bg); color: var(--pos-warning-ink); }
.pos-role-icon[data-tone="success"] { background: var(--pos-success-bg); color: var(--pos-success-ink); }
.pos-role-head h3 { margin: 0 0 4px; font-size: 17px; font-weight: 800; }
.pos-role-list { margin: 0; padding-left: 18px; list-style: disc; display: flex; flex-direction: column; gap: 6px; font-size: 14px; color: var(--pos-text-primary); }

@media (prefers-reduced-motion: reduce) {
  .pos-header-sound, .pos-rail-btn, .pos-sidebar-btn, .pos-more-item, .pos-btn, .pos-kpi-card, .pos-master-item {
    transition: none;
  }
}

/* Staff mobile (<1024px) cart drawer + toast & modal responsiveness */
@media (max-width: 1023px) {
  body[data-staff-shell] #view-cliente #client-cart:not([data-staff-cart-open="true"]) {
    display: none;
  }
  body[data-staff-shell][data-staff-cart-drawer] #view-cliente #cart-drawer-backdrop {
    display: block !important;
    position: fixed;
    inset: 0;
    z-index: 64;
    background: rgba(56, 43, 34, 0.56);
  }
  body[data-staff-shell][data-staff-cart-drawer] #view-cliente #client-cart {
    display: flex !important;
    flex-direction: column;
    position: fixed;
    inset: auto 0 0 0;
    max-height: 90dvh;
    z-index: 65;
    border-radius: 18px 18px 0 0;
    overflow-y: auto;
    padding-bottom: env(safe-area-inset-bottom, 12px);
    box-shadow: 0 -14px 34px rgba(56, 43, 34, 0.25);
  }
  body[data-staff-shell][data-staff-cart-drawer] #view-cliente #btn-close-cart-drawer {
    display: inline-flex !important;
    width: 44px;
    height: 44px;
    align-items: center;
    justify-content: center;
    padding: 0;
    flex: none;
  }
  body[data-staff-shell][data-staff-cart-drawer] .pos-mobile-cart-bar {
    display: none !important;
  }
}

@media (max-width: 767px) {
  body[data-staff-shell] #toast-container {
    bottom: calc(84px + env(safe-area-inset-bottom, 0px));
  }
  body[data-staff-shell] #view-cliente[data-staff-has-cart="true"] main,
  body[data-staff-shell] main#pos-content:has(#pos-mobile-cart-bar:not([hidden])) {
    padding-bottom: calc(144px + env(safe-area-inset-bottom, 0px));
  }
}

/* Back-office modal & confirmation dialog mobile polish */
dialog.pos-confirm-dialog {
  width: min(440px, calc(100% - 1.5rem));
  margin: auto;
  padding: 0;
  border: 1px solid var(--pos-border);
  border-radius: var(--pos-radius-xl);
  background: var(--pos-surface);
  color: var(--pos-text-primary);
  box-shadow: 0 24px 48px rgba(56, 43, 34, 0.28);
}
dialog.pos-confirm-dialog::backdrop { background: rgba(56, 43, 34, 0.62); }
.pos-confirm-head {
  padding: 16px 18px;
  border-bottom: 1px solid var(--pos-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.pos-confirm-head h2 { margin: 0; font-size: 17px; font-weight: 800; }
.pos-confirm-body { padding: 16px 18px; font-size: 14px; line-height: 1.5; color: var(--pos-text-secondary); }
.pos-confirm-foot {
  padding: 12px 18px 16px;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

@media (max-width: 639px) {
  dialog.management-dialog .grid-cols-2,
  dialog.prep-dialog .grid-cols-2 {
    grid-template-columns: 1fr !important;
  }
  dialog.management-dialog :is(input, select, button),
  dialog.prep-dialog :is(input, select, button) {
    min-height: 46px;
    font-size: 15px;
  }
  #modal-pay-mesa :is(select, button) {
    min-height: 48px;
    font-size: 15px;
  }
}
