/* ============================================================
   Chiyalaya · Cashier & Serving Staff experience
   Modern styling for the POS, tables, orders and billing pages
   ============================================================ */

/* --- Billing and payments: merged overview, waiting list, receipt records */
body[data-page="cashier-billing"] .billing-overview { display: flex; flex-wrap: wrap; padding: 4px; }
body[data-page="cashier-billing"] .billing-overview-segment { flex: 1 1 220px; display: flex; align-items: center; gap: 14px; padding: 20px 24px; border-left: 1px solid var(--line); }
body[data-page="cashier-billing"] .billing-overview-segment:first-child { border-left: 0; }
body[data-page="cashier-billing"] .billing-overview-icon { width: 46px; height: 46px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 14px; background: var(--surface-2); color: var(--brand); font-size: 17px; }
body[data-page="cashier-billing"] .billing-overview-segment.warning .billing-overview-icon { background: #fff5dd; color: var(--warning); }
body[data-page="cashier-billing"] .billing-overview-segment.success .billing-overview-icon { background: #e8f7ef; color: var(--success); }
body[data-page="cashier-billing"] .billing-overview-text { display: flex; flex-direction: column; gap: 3px; }
body[data-page="cashier-billing"] .billing-overview-text strong { font-size: var(--fs-stat); font-weight: 800; letter-spacing: -.03em; line-height: 1; }
body[data-page="cashier-billing"] .billing-overview-text small { color: var(--muted); font-size: 10px; font-weight: 750; text-transform: uppercase; letter-spacing: .02em; }
@media (max-width: 720px) {
  body[data-page="cashier-billing"] .billing-overview-segment { flex: 1 1 100%; border-left: 0; border-top: 1px solid var(--line); }
  body[data-page="cashier-billing"] .billing-overview-segment:first-child { border-top: 0; }
}

body[data-page="cashier-billing"] .billing-waitlist { margin-top: 18px; }
body[data-page="cashier-billing"] .billing-waitlist-body { padding: 16px 18px; display: grid; gap: 20px; }
body[data-page="cashier-billing"] .billing-waitlist-group { display: grid; gap: 9px; }
body[data-page="cashier-billing"] .billing-waitlist-group-label { padding-left: 2px; color: var(--muted); font-size: 9px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; }
body[data-page="cashier-billing"] .billing-row { cursor: default; border-left: 3px solid transparent; }
body[data-page="cashier-billing"] .billing-row.needs-bill { border-left-color: var(--warning); }
body[data-page="cashier-billing"] .billing-row.awaiting-payment { border-left-color: var(--info); }
body[data-page="cashier-billing"] .order-source.needs-bill { background: #fff5dd; color: var(--warning); }
body[data-page="cashier-billing"] .order-source.awaiting-payment { background: #eaf2f8; color: var(--info); }
body[data-page="cashier-billing"] .billing-row-actions { display: flex; align-items: center; gap: 9px; }
@media (max-width: 560px) {
  body[data-page="cashier-billing"] .billing-row { grid-template-columns: 38px minmax(0, 1fr); grid-template-areas: "avatar main" "actions actions"; row-gap: 10px; }
  body[data-page="cashier-billing"] .billing-row .order-source { grid-area: avatar; }
  body[data-page="cashier-billing"] .billing-row .order-main { grid-area: main; }
  body[data-page="cashier-billing"] .billing-row-actions { grid-area: actions; justify-content: flex-start; flex-wrap: wrap; }
}

body[data-page="cashier-billing"] .billing-records { margin-top: 18px; }
body[data-page="cashier-billing"] .billing-records-grid { padding: 16px 18px; display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; }
body[data-page="cashier-billing"] .billing-record-tile { text-align: left; padding: 14px 15px; display: grid; gap: 7px; border: 1px solid var(--line); border-radius: 14px; background: #fff; cursor: pointer; font: inherit; color: inherit; transition: border-color .16s ease, transform .16s ease, box-shadow .16s ease; }
body[data-page="cashier-billing"] .billing-record-tile:hover,
body[data-page="cashier-billing"] .billing-record-tile:focus-visible { border-color: var(--success); transform: translateY(-2px); box-shadow: 0 10px 22px rgba(28, 48, 38, .08); }
body[data-page="cashier-billing"] .billing-record-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; color: var(--muted); font-size: 9px; font-weight: 750; text-transform: uppercase; letter-spacing: .02em; }
body[data-page="cashier-billing"] .billing-record-method { display: inline-flex; align-items: center; gap: 5px; color: var(--success); }
body[data-page="cashier-billing"] .billing-record-number { font-size: 13px; }
body[data-page="cashier-billing"] .billing-record-order { color: var(--muted); font-size: 10px; }
body[data-page="cashier-billing"] .billing-record-amount { margin-top: 2px; font-size: 15px; font-weight: 800; color: var(--ink); }
body[data-page="cashier-billing"] .billing-records-grid .empty-state { grid-column: 1 / -1; }

/* --- Staff attendance --------------------------------------------------- */
.attendance-row {
  padding: 11px;
  display: grid;
  grid-template-columns: 43px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #fff;
  transition: border-color .18s ease;
}
.attendance-row:hover { border-color: #b9ccc1; }
.attendance-row.status-in { border-color: color-mix(in srgb, var(--success) 40%, var(--line)); background: color-mix(in srgb, var(--success) 4%, #fff); }
.attendance-row .order-source { background: var(--surface-2); color: var(--brand); }
.attendance-actions { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; justify-content: flex-end; }
@media (max-width: 560px) {
  .attendance-row { grid-template-columns: 38px minmax(0, 1fr); grid-template-areas: "avatar main" "actions actions"; row-gap: 10px; }
  .attendance-row .order-source { grid-area: avatar; }
  .attendance-row .order-main { grid-area: main; }
  .attendance-actions { grid-area: actions; justify-content: flex-start; }
}

/* --- POS launch screen: how-it-works steps ----------------------------- */
.launch-steps {
  display: flex;
  gap: 8px;
  margin-top: 22px;
  flex-wrap: wrap;
}
.launch-step {
  min-height: 34px;
  padding: 0 11px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 999px;
  background: rgba(255, 255, 255, .08);
  color: #e9f3f9;
  font-size: 10px;
  font-weight: 750;
  white-space: nowrap;
}
.launch-step b {
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, .18);
  font-size: 9px;
}

/* --- Menu category strip with live counts ------------------------------ */
.filter-tab .chip-count {
  margin-left: 6px;
  padding: 1px 7px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--brand) 10%, transparent);
  color: var(--brand);
  font-size: 8px;
  font-weight: 850;
}
.filter-tab.active .chip-count {
  background: var(--brand);
  color: #fff;
}

/* --- POS search clear button ------------------------------------------- */
.toolbar-search .search-clear {
  position: absolute;
  right: 7px;
  top: 50%;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--muted);
  cursor: pointer;
}
.toolbar-search .search-clear:hover { background: #e3eae6; color: var(--ink); }
.pos-toolbar .toolbar-search input { padding-right: 40px; }

/* --- Menu cards: sold-out state and touch feedback --------------------- */
.menu-card { position: relative; }
.menu-card.sold-out { opacity: .58; }
.menu-card.sold-out .menu-visual { filter: grayscale(.85); }
.menu-card:active { transform: scale(.98); }
.menu-card:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--brand) 35%, transparent);
  outline-offset: 2px;
}
.menu-soldout {
  position: absolute;
  z-index: 2;
  top: 9px;
  left: 9px;
  min-height: 22px;
  padding: 0 8px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  background: var(--danger);
  color: #fff;
  font-size: 8px;
  font-weight: 850;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.menu-count.bump { animation: count-bump .3s ease; }
@keyframes count-bump { 50% { transform: scale(1.3); } }

/* --- Cart summary rows (tax / service / total) ------------------------- */
.cart-summary .summary-row small { color: var(--muted); font-weight: 600; }

/* --- Mobile cart bar pulse on add -------------------------------------- */
.mobile-cart-bar.pulse { animation: cart-pulse .35s ease; }
@keyframes cart-pulse { 40% { transform: scale(1.03); } }

/* --- Order detail: live service timeline ------------------------------- */
.order-timeline {
  padding: 8px 6px;
  display: block;
}
.order-timeline .timeline-step {
  flex: none;
  position: relative;
  padding: 0 0 18px 36px;
  text-align: left;
}
.order-timeline .timeline-step:last-child { padding-bottom: 4px; }
.order-timeline .timeline-step::before {
  content: "";
  position: absolute;
  top: 24px;
  bottom: -2px;
  left: 11px;
  width: 2px;
  height: auto;
  background: #e3eae5;
}
.order-timeline .timeline-step:last-child::before { display: none; }
.order-timeline .timeline-step.done::before { background: var(--success); }
.order-timeline .tl-dot {
  position: absolute;
  top: 0;
  left: 0;
  width: 24px;
  height: 24px;
  margin: 0;
}
.order-timeline .tl-label { margin-top: 0; font-size: 11px; font-weight: 800; }
.order-timeline .tl-label small { display: block; margin-top: 2px; font-weight: 600; color: var(--muted); }
.order-timeline .tl-time { margin-top: 2px; font-size: 9px; }
.timeline-steps {
  padding: 18px;
  display: flex;
  align-items: flex-start;
}
.timeline-step {
  flex: 1;
  min-width: 0;
  position: relative;
  text-align: center;
}
.timeline-step::before {
  content: "";
  position: absolute;
  top: 13px;
  left: calc(-50% + 13px);
  right: calc(50% + 13px);
  height: 2px;
  background: #e3eae5;
}
.timeline-step:first-child::before { display: none; }
.timeline-step.done::before { background: var(--success); }
.tl-dot {
  width: 26px;
  height: 26px;
  margin: 0 auto;
  display: grid;
  place-items: center;
  position: relative;
  z-index: 1;
  border: 2px solid #d5dfd9;
  border-radius: 50%;
  background: #fff;
  color: #9aa79f;
  font-size: 9px;
  font-weight: 850;
}
.timeline-step.done .tl-dot { border-color: var(--success); background: #e8f7ef; color: var(--success); }
.timeline-step.active .tl-dot {
  border-color: var(--brand);
  background: var(--brand);
  color: #fff;
  box-shadow: 0 0 0 5px color-mix(in srgb, var(--brand) 14%, transparent);
}
.tl-label { margin-top: 7px; display: block; color: var(--muted); font-size: 9px; font-weight: 750; }
.timeline-step.done .tl-label { color: var(--success); }
.timeline-step.active .tl-label { color: var(--brand); }
.tl-time { display: block; margin-top: 3px; color: var(--muted); font-size: 8px; }

/* --- Bill detail: quick payment amount chips --------------------------- */
.quick-pay {
  margin-bottom: 13px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.quick-pay .btn { flex: 1; min-width: 140px; }

/* --- Tables page: status legend and ready pulse ------------------------ */
.floor-legend {
  margin-bottom: 16px;
  padding: 12px 14px;
  display: flex;
  gap: 8px 18px;
  flex-wrap: wrap;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #fff;
}
.floor-legend span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 750;
}
.floor-legend i { width: 10px; height: 10px; border-radius: 3px; background: #98a69e; }
.floor-legend .legend-free { background: var(--success); }
.floor-legend .legend-occupied { background: var(--accent); }
.floor-legend .legend-reserved { background: var(--info); }
.floor-legend .legend-cleaning { background: #739dbf; }
.table-card.ready { animation: ready-glow 2.2s ease-in-out infinite; }
@keyframes ready-glow { 50% { box-shadow: 0 0 0 5px rgba(35, 136, 92, .14), var(--shadow); } }
.table-card .table-elapsed { margin-top: 9px; font-size: 9px; }
.table-card .table-elapsed b { color: var(--brand); }

/* --- Live list rows polish (billing / orders) -------------------------- */
.order-row .row-meta { color: var(--muted); font-size: 10px; }

/* --- Message auto-dismiss animation ------------------------------------ */
.message-stack .app-message { animation: msg-in .25s ease; }
.message-stack .app-message.dismissing { opacity: 0; transform: translateY(-6px); transition: .25s; }
@keyframes msg-in { from { opacity: 0; transform: translateY(-6px); } }

@media (max-width: 700px) {
  .order-timeline .timeline-step { padding-left: 32px; }
  .tl-label { font-size: 8px; }
  .launch-steps { margin-top: 16px; gap: 6px; }
  .launch-step { padding: 0 9px; font-size: 9px; }
}

/* --- Order item corrections ------------------------------------------- */
.order-items-head { align-items: flex-start; }
.order-adjust-head-actions { display: flex; gap: 7px; flex-wrap: wrap; justify-content: flex-end; }
.order-adjust-line {
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: start;
}
.order-adjust-line.adjusted { background: #fffcf2; }
.order-adjust-line.cancelled { text-decoration: none; background: #fafafa; }
.order-adjust-line.cancelled .order-main > strong,
.order-adjust-line.cancelled .effective-quantity-note { text-decoration: line-through; }
.order-item-check { width: 30px; height: 30px; display: grid; place-items: center; cursor: pointer; }
.order-item-check input { position: absolute; opacity: 0; pointer-events: none; }
.order-item-check span {
  width: 19px;
  height: 19px;
  display: grid;
  place-items: center;
  border: 1.5px solid #b9c7bf;
  border-radius: 6px;
  background: #fff;
  transition: .16s ease;
}
.order-item-check input:checked + span { border-color: var(--brand); background: var(--brand); }
.order-item-check input:checked + span::after { content: "✓"; color: #fff; font-size: 11px; font-weight: 900; }
.order-item-check input:focus-visible + span { outline: 3px solid color-mix(in srgb, var(--brand) 22%, transparent); outline-offset: 2px; }
.detail-line-side { min-width: 92px; display: grid; justify-items: end; gap: 7px; }
.line-adjust-button { min-height: 28px; padding: 0 8px; border: 1px solid #efd4d1; border-radius: 8px; background: #fff8f7; }
.item-route-badge {
  width: fit-content;
  min-height: 24px;
  margin-top: 7px;
  padding: 0 8px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  background: #eef5f1;
  color: var(--brand);
  font-size: 8px;
  font-weight: 800;
}
.item-route-badge.route-direct { background: #edf6ff; color: #276b9d; }
.effective-quantity-note { display: block; margin-top: 6px; color: #a06b12; font-size: 9px; font-weight: 750; }
.adjustment-history { margin-top: 8px; }
.adjustment-history summary { width: fit-content; color: var(--brand); cursor: pointer; font-size: 9px; font-weight: 800; }
.adjustment-history > div { margin-top: 7px; display: grid; gap: 6px; }
.adjustment-history > div > span { padding: 8px 9px; border-left: 3px solid #e4ae4c; border-radius: 0 8px 8px 0; background: #fff9ec; color: #68512c; font-size: 9px; line-height: 1.45; }
.adjustment-history b, .adjustment-history small { display: block; }
.adjustment-history small { margin-top: 3px; color: var(--muted); }

.adjustment-modal { width: min(760px, calc(100vw - 28px)); }
.adjustment-modal .modal-body { max-height: min(68vh, 650px); overflow-y: auto; scrollbar-width: none; -ms-overflow-style: none; }
.adjustment-modal .modal-body::-webkit-scrollbar { display: none; }

.order-popup-lead { margin-bottom: 16px; }
.order-popup-customer strong { color: var(--ink); }
.order-popup-substats { margin-top: 8px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; color: var(--muted); font-size: 11px; font-weight: 700; }

.order-popup-modal { width: min(920px, calc(100vw - 28px)); }
.order-popup-modal .modal-body { max-height: min(82vh, 780px); overflow-y: auto; scrollbar-width: none; -ms-overflow-style: none; }
.order-popup-modal .modal-body::-webkit-scrollbar { display: none; }
.order-popup-modal .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
#orderPopupModal #itemAdjustmentModal { z-index: 160; }
tr[data-order-url] { cursor: pointer; }
tr[data-order-url]:focus-visible { outline: 3px solid color-mix(in srgb, var(--brand) 35%, transparent); outline-offset: -3px; }
tr[data-order-url] .row-actions { cursor: default; }
.adjustment-action-grid { margin: 18px 0; padding: 0; border: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; }
.adjustment-action-grid.waiter-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.adjustment-action-grid legend { margin-bottom: 8px; color: var(--ink); font-size: 10px; font-weight: 850; }
.adjustment-action-grid label { position: relative; cursor: pointer; }
.adjustment-action-grid input { position: absolute; opacity: 0; pointer-events: none; }
.adjustment-action-grid label > span { min-height: 92px; padding: 12px; display: grid; align-content: center; gap: 4px; border: 1px solid var(--line); border-radius: 13px; background: #fff; transition: .16s ease; }
.adjustment-action-grid label i { color: var(--brand); font-size: 15px; }
.adjustment-action-grid label strong { margin-top: 3px; font-size: 11px; }
.adjustment-action-grid label small { color: var(--muted); font-size: 8px; line-height: 1.4; }
.adjustment-action-grid input:checked + span { border-color: var(--brand); background: var(--surface-2); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 10%, transparent); }
.adjustment-action-grid input:focus-visible + span { outline: 3px solid color-mix(in srgb, var(--brand) 25%, transparent); outline-offset: 2px; }
.adjustment-action-grid label.disabled { opacity: .45; cursor: not-allowed; }
.adjustment-reason { display: grid; gap: 7px; }
.adjustment-selected-list { margin-top: 15px; display: grid; gap: 9px; }
.adjustment-selected-line { padding: 12px; display: grid; grid-template-columns: minmax(150px, 1fr) 92px 150px; gap: 7px 12px; align-items: center; border: 1px solid var(--line); border-radius: 13px; background: #fafcfb; }
.adjustment-item-copy strong, .adjustment-item-copy small { display: block; }
.adjustment-item-copy strong { font-size: 11px; }
.adjustment-item-copy small { margin-top: 4px; color: var(--muted); font-size: 8px; }
.adjustment-quantity { display: grid; gap: 4px; color: var(--muted); font-size: 8px; font-weight: 750; }
.adjustment-quantity .field { min-height: 36px; }
.adjustment-restock { display: inline-flex; align-items: center; gap: 7px; cursor: pointer; font-size: 9px; font-weight: 750; }
.adjustment-restock input { width: 17px; height: 17px; accent-color: var(--brand); }
.adjustment-restock.disabled { opacity: .48; cursor: not-allowed; }
.adjustment-restock-help { grid-column: 2 / -1; color: var(--muted); font-size: 8px; line-height: 1.4; }

/* --- Live table map ---------------------------------------------------- */
.table-map-lead { margin-bottom: 14px; }
.table-map-summary { margin-bottom: 14px; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; }
.table-map-summary article { min-height: 74px; padding: 12px 14px; display: flex; align-items: center; gap: 11px; border: 1px solid var(--line); border-radius: 14px; background: #fff; box-shadow: 0 7px 22px rgba(25, 55, 41, .04); animation: table-in .3s cubic-bezier(.2, .7, .3, 1) backwards; }
.table-map-summary strong, .table-map-summary small { display: block; }
.table-map-summary strong { font-size: 18px; transition: color .2s ease; }
.table-map-summary small { margin-top: 2px; color: var(--muted); font-size: 8px; font-weight: 750; }
.table-summary-icon { width: 36px; height: 36px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 11px; background: #edf7f1; color: var(--success); }
.table-summary-icon.partially-seated { background: #eaf3fb; color: #2f6fa8; }
.table-summary-icon.occupied { background: #fff5e7; color: #c47b19; }
.table-summary-icon.ready { background: #e7f7ed; color: #16794c; }
.table-summary-icon.reserved { background: #edf5fd; color: #3276a8; }
.table-summary-icon.out-of-service { background: #f1f3f2; color: #7b8780; }
.table-map-panel { overflow: hidden; }
.table-map-toolbar { padding: 14px 16px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.table-map-toolbar h3 { margin: 0; font-size: 15px; }
.table-map-toolbar p { margin: 3px 0 0; color: var(--muted); font-size: 9px; }
.table-map-filters { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: thin; }
.table-filter { min-height: 34px; padding: 0 9px; display: inline-flex; align-items: center; gap: 6px; flex: 0 0 auto; border: 1px solid var(--line); border-radius: 9px; background: #fff; color: var(--muted); cursor: pointer; font: inherit; font-size: 8px; font-weight: 800; }
.table-filter span { min-width: 19px; min-height: 19px; padding: 0 5px; display: grid; place-items: center; border-radius: 999px; background: #eef2f0; font-size: 7px; }
.table-filter.active { border-color: var(--brand); background: var(--surface-2); color: var(--brand); }
.table-filter:focus-visible { outline: 3px solid color-mix(in srgb, var(--brand) 20%, transparent); outline-offset: 2px; }
.table-map-grid { padding: 16px; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); }
.table-map-card { min-height: 310px; padding: 15px; display: flex; flex-direction: column; border-top-width: 1px; overflow: hidden; animation: table-in .32s cubic-bezier(.2, .7, .3, 1) backwards; transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease, background .2s ease; }
.table-map-card[hidden] { display: none; }
.table-map-card:hover { transform: translateY(-2px); box-shadow: 0 13px 35px rgba(20, 48, 35, .1); }
.table-map-card.available { border-color: #bfe0ce; background: linear-gradient(180deg, #fbfffc, #fff 34%); }
.table-map-card.partially-seated { border-color: #b8d7ef; background: linear-gradient(180deg, #f3f9fd, #fff 36%); }
.table-map-card.occupied { border-color: #edd6af; background: linear-gradient(180deg, #fffaf2, #fff 34%); }
.table-map-card.ready { border-color: #9fd1b5; background: linear-gradient(180deg, #f2fcf6, #fff 38%); }
.table-map-card.reserved { border-color: #bed7eb; background: linear-gradient(180deg, #f6faff, #fff 34%); }
.table-map-card.out-of-service { border-color: #d9dfdc; background: #f7f8f7; opacity: .8; }
.table-identity { display: flex; align-items: center; gap: 10px; }
.table-identity > span:last-child small, .table-identity > span:last-child strong { display: block; }
.table-identity > span:last-child small { color: var(--muted); font-size: 7px; font-weight: 750; text-transform: uppercase; }
.table-identity > span:last-child strong { margin-top: 1px; font-size: 17px; }
.table-shape { width: 43px; height: 35px; display: grid; place-items: center; position: relative; border: 2px solid color-mix(in srgb, var(--brand) 40%, #dce5e0); border-radius: 11px; background: #fff; color: var(--brand); }
.table-shape b { font-size: 10px; }
.table-shape i { width: 7px; height: 4px; position: absolute; border-radius: 3px; background: #b7c7bf; }
.table-shape i:nth-of-type(1) { top: -6px; left: 8px; }
.table-shape i:nth-of-type(2) { top: -6px; right: 8px; }
.table-shape i:nth-of-type(3) { bottom: -6px; left: 8px; }
.table-shape i:nth-of-type(4) { right: 8px; bottom: -6px; }
.table-status-pill { min-height: 25px; padding: 0 8px; display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; background: #edf7f1; color: var(--success); font-size: 7px; font-weight: 850; text-transform: uppercase; white-space: nowrap; transition: background .2s ease, color .2s ease; }
.table-status-pill i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.table-status-pill.partially-seated { background: #e6f1fb; color: #2f6fa8; }
.table-status-pill.occupied { background: #fff2df; color: #ad6812; }
.table-status-pill.ready { background: #ddf4e7; color: #117443; animation: status-pulse 1.8s ease-in-out infinite; }
.table-status-pill.reserved { background: #e8f3fc; color: #2e6f9e; }
.table-status-pill.out-of-service { background: #e9edeb; color: #66716b; }
.table-card-meta { margin-top: 14px; padding-bottom: 10px; display: flex; gap: 13px; border-bottom: 1px dashed var(--line); color: var(--muted); font-size: 8px; }
.table-card-meta span { display: inline-flex; align-items: center; gap: 5px; }
.seat-meter { margin-top: 12px; display: flex; flex-direction: column; gap: 5px; }
.seat-meter-bar { height: 6px; border-radius: 999px; background: #eef2f0; overflow: hidden; }
.seat-meter-fill { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #3d82b3, var(--success)); transition: width .45s cubic-bezier(.2, .7, .3, 1); }
.table-map-card.occupied .seat-meter-fill, .table-map-card.ready .seat-meter-fill { background: linear-gradient(90deg, #e29a1f, #dd4b3c); }
.seat-meter-label { color: var(--muted); font-size: 7px; font-weight: 750; text-transform: uppercase; letter-spacing: .03em; }
.table-orders-list { display: flex; flex-direction: column; gap: 10px; margin-top: 11px; }
.table-orders-list .table-order-block { margin-top: 0; padding-top: 11px; border-top: 1px dashed var(--line); }
.table-orders-list .table-order-block:first-child { padding-top: 0; border-top: 0; }
.table-order-block { margin-top: 11px; }
.table-order-title { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.table-order-title small, .table-order-title strong { display: block; }
.table-order-title small { color: var(--muted); font-size: 7px; }
.table-order-title strong { margin-top: 2px; font-size: 11px; }
.table-order-facts { margin: 9px 0 0; display: grid; grid-template-columns: 1.25fr .55fr 1fr; gap: 6px; }
.table-order-facts div { min-width: 0; padding: 8px; border-radius: 9px; background: rgba(245, 248, 246, .9); }
.table-order-facts dt, .table-order-facts dd { margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.table-order-facts dt { color: var(--muted); font-size: 7px; }
.table-order-facts dd { margin-top: 3px; font-size: 8px; font-weight: 800; }
.table-card-actions { margin-top: auto; padding-top: 12px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
.table-card-actions > :only-child { grid-column: 1 / -1; }
.table-card-actions .btn { min-width: 0; }
.table-assigned-note { min-height: 38px; margin-top: auto; padding: 8px 10px; display: flex; align-items: center; justify-content: center; gap: 7px; border-radius: 9px; background: #f2f5f3; color: #647169; font-size: 10px; font-weight: 750; text-align: center; }
.table-availability-copy, .reservation-block { margin: 19px 0 14px; display: flex; align-items: flex-start; gap: 10px; }
.table-availability-copy strong, .reservation-block strong { display: block; font-size: 11px; }
.table-map-card p, .table-availability-copy p, .reservation-block p { min-height: 0; margin: 4px 0 0; color: var(--muted); font-size: 8px; line-height: 1.5; }
.table-state-icon { width: 34px; height: 34px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 10px; background: #e9f7ef; color: var(--success); }
.table-state-icon.reserved { background: #e9f3fb; color: #3776a3; }
.table-availability-copy.unavailable .table-state-icon { background: #e8ecea; color: #68736d; }
.reservation-block small { color: var(--muted); font-size: 7px; }
.next-reservation { margin: 0 0 12px; padding: 9px; display: flex; gap: 8px; border-radius: 9px; background: #f0f7fd; color: #326b94; }
.next-reservation span, .next-reservation small, .next-reservation strong { display: block; }
.next-reservation small { font-size: 7px; }
.next-reservation strong { margin-top: 2px; font-size: 8px; }
.table-map-card.available > .btn, .table-map-card.reserved > .btn { margin-top: auto; }
.table-disabled-action { min-height: 34px; margin-top: auto; display: grid; place-items: center; border: 1px dashed #cbd3cf; border-radius: 9px; color: #8a948f; font-size: 8px; font-weight: 800; }
.table-map-empty { grid-column: 1 / -1; min-height: 230px; }
.table-map-panel .floor-legend { margin: 0; border: 0; border-top: 1px solid var(--line); border-radius: 0; background: #fafcfb; }
.floor-legend .legend-available { background: var(--success); }
.floor-legend .legend-partially-seated { background: #2f6fa8; }
.floor-legend .legend-occupied { background: #d9891c; }
.floor-legend .legend-ready { background: #117443; box-shadow: 0 0 0 3px #dff2e7; }
.floor-legend .legend-reserved { background: #3d82b3; }
.floor-legend .legend-out-of-service { background: #7b8780; }

@keyframes table-in {
  from { opacity: 0; transform: translateY(10px); }
}
@keyframes status-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(17, 116, 67, .18); }
  50% { box-shadow: 0 0 0 5px rgba(17, 116, 67, 0); }
}

/* --- Finalized bill quantities and receipt audit ---------------------- */
.billing-finality-note { align-items: flex-start; }
.billing-finality-note > i { margin-top: 2px; }
.billing-finality-note div strong, .billing-finality-note div span { display: block; }
.billing-finality-note div span { margin-top: 3px; }
.bill-issue-form { padding: 0; overflow: hidden; }
.bill-issue-form form { padding: 18px; }
.receipt-item-line { align-items: flex-start !important; padding-block: 9px; }
.receipt-line-copy strong, .receipt-line-copy small { display: block; }
.receipt-line-copy > strong { font-size: 11px; }
.receipt-line-copy small { margin-top: 3px; color: var(--muted); font-size: 8px; }
.bill-adjustment-line { min-height: 0 !important; padding: 7px 9px; border-top: 0 !important; border-radius: 8px; background: #fff8e8; color: #805b19; }
.bill-adjustment-line > span { display: block; font-size: 8px; font-weight: 750; }
.bill-adjustment-line i { margin-right: 5px; }
.bill-adjustment-line small { display: block; margin: 3px 0 0 17px; color: #8c7650; font-size: 7px; font-weight: 500; }
.field-help { color: var(--muted); font-size: 8px; line-height: 1.45; }
.print-receipt .receipt-adjustment-row td { padding: 5px 3px; text-align: left; background: #faf7ee; color: #68593a; }
.print-receipt .receipt-adjustment-row strong { font-size: 7px; }

/* --- Kitchen adjustment alerts --------------------------------------- */
.kot-line.adjusted { border-left: 4px solid #e1a43c; background: #fffaf0; }
.kot-line .kot-quantity-change { margin: 5px 0; padding: 5px 7px; border-radius: 6px; background: #fff0cb; color: #875d13; font-weight: 800; }
.kot-line .kot-adjustment { margin-top: 5px; color: #9b4b3c; font-weight: 650; }
.kot-line .kot-adjustment strong { display: inline; font-size: inherit; }

@media (max-width: 1050px) {
  .table-map-summary { grid-template-columns: repeat(6, minmax(120px, 1fr)); overflow-x: auto; padding-bottom: 3px; }
  .table-map-toolbar { align-items: flex-start; flex-direction: column; }
  .table-map-filters { width: 100%; }
}

@media (max-width: 700px) {
  .order-items-head { align-items: stretch; flex-direction: column; }
  .order-adjust-head-actions { justify-content: flex-start; }
  .order-adjust-line { grid-template-columns: 28px minmax(0, 1fr); }
  .order-adjust-line .detail-line-side { grid-column: 2; width: 100%; display: flex; align-items: center; justify-content: space-between; }
  .adjustment-modal { width: 100%; max-height: 94dvh; margin-top: auto; border-radius: 22px 22px 0 0; }
  .adjustment-modal .modal-head, .adjustment-modal .modal-foot { position: sticky; z-index: 2; background: #fff; }
  .adjustment-modal .modal-head { top: 0; }
  .adjustment-modal .modal-foot { bottom: 0; padding-bottom: calc(13px + env(safe-area-inset-bottom)); }
  .order-popup-modal { width: 100%; max-height: 96dvh; margin-top: auto; border-radius: 22px 22px 0 0; }
  .order-popup-modal .modal-head { position: sticky; top: 0; z-index: 2; background: #fff; }
  .order-popup-modal .modal-body { max-height: none; }
  .order-popup-modal .stats-grid { grid-template-columns: 1fr; }
  .adjustment-action-grid { grid-template-columns: 1fr; }
  .adjustment-action-grid.waiter-actions { grid-template-columns: 1fr; }
  .adjustment-action-grid label > span { min-height: 68px; grid-template-columns: 24px minmax(0, 1fr); align-items: center; }
  .adjustment-action-grid label i { grid-row: 1 / 3; }
  .adjustment-selected-line { grid-template-columns: minmax(0, 1fr) 82px; }
  .adjustment-restock { grid-column: 1 / -1; }
  .adjustment-restock-help { grid-column: 1 / -1; }
  .table-map-summary { grid-template-columns: repeat(6, 128px); }
  .table-map-summary article { padding: 10px; }
  .table-map-grid { padding: 11px; grid-template-columns: 1fr; gap: 10px; }
  .table-map-card { min-height: 290px; }
  .table-map-toolbar { padding-inline: 12px; }
  .table-filter { min-height: 38px; }
}

@media (max-width: 420px) {
  .table-order-facts { grid-template-columns: 1fr 60px; }
  .table-order-facts div:last-child { grid-column: 1 / -1; }
  .table-card-actions { grid-template-columns: 1fr; }
  .adjustment-selected-line { grid-template-columns: 1fr; }
  .adjustment-quantity { width: 100%; }
}

/* Keep operational metadata legible on handheld service screens. */
.adjustment-history summary,
.adjustment-history > div > span,
.adjustment-item-copy small,
.adjustment-quantity,
.adjustment-restock,
.adjustment-restock-help,
.table-map-summary small,
.table-map-toolbar p,
.table-filter,
.table-status-pill,
.table-identity > span:last-child small,
.table-card-meta,
.seat-meter-label,
.table-order-title small,
.table-order-facts dt,
.table-order-facts dd,
.table-map-card p,
.reservation-block small,
.next-reservation small,
.next-reservation strong,
.table-disabled-action,
.receipt-line-copy small,
.bill-adjustment-line > span,
.bill-adjustment-line small,
.field-help { font-size: 10px; }

@media (prefers-reduced-motion: reduce) {
  .table-map-card, .table-map-summary article, .table-status-pill.ready { animation: none !important; transition-duration: .01ms !important; }
  .seat-meter-fill { transition: none !important; }
}
