:root {
  --bg: #0f172a;
  --card: #1e293b;
  --border: #334155;
  --text: #f8fafc;
  --muted: #94a3b8;
  --accent: #3b82f6;
  --accent-dark: #2563eb;
  --ok: #22c55e;
  --warn: #f97316;
  --danger: #ef4444;
  --radius: 12px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  font-family: "Segoe UI", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100dvh;
  height: 100%;
  overflow-x: hidden;
}

.waiter-splash {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.85rem;
  background: #0f1b3d;
  padding:
    max(1rem, env(safe-area-inset-top))
    max(1rem, env(safe-area-inset-right))
    max(1rem, env(safe-area-inset-bottom))
    max(1rem, env(safe-area-inset-left));
}

.waiter-splash.hidden {
  display: none;
}

.waiter-splash-logo {
  width: 72px;
  height: 72px;
  border-radius: 16px;
  object-fit: cover;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
}

.waiter-splash-label {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.55);
}

.screen {
  display: none;
  width: 100%;
  min-height: 100dvh;
  height: 100dvh;
  flex-direction: column;
}
#screen-pin.screen.active {
  display: flex;
  flex-direction: column;
}

.screen.active:not(#screen-pin) { display: flex; }

.waiter-header {
  padding: 1rem 1rem 0.75rem;
  padding-top: max(1rem, env(safe-area-inset-top));
  background: var(--card);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 20;
}

.waiter-header h1 {
  margin: 0;
  font-size: 1.2rem;
}

.waiter-header .sub {
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 0.2rem;
}

.waiter-header-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  justify-content: flex-end;
}

.waiter-main {
  flex: 1;
  min-height: 0;
  padding: 1rem;
  padding-bottom: calc(1rem + var(--safe-bottom));
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.login-box {
  max-width: 400px;
  margin: 2rem auto;
  padding: 1.25rem;
  background: var(--card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.login-box label {
  display: block;
  font-size: 0.85rem;
  margin-bottom: 0.35rem;
  color: var(--muted);
}

.login-box input,
.login-box select {
  width: 100%;
  padding: 0.85rem;
  font-size: 1rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  margin-bottom: 1rem;
}

.pin-box {
  max-width: 320px;
}

.pin-display {
  text-align: center;
  font-size: 2rem;
  letter-spacing: 0.45em;
  font-weight: 800;
  padding: 0.75rem 0 1rem;
  color: var(--text);
  min-height: 3rem;
}

.pin-keypad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.55rem;
  margin-bottom: 1rem;
}

.pin-key {
  aspect-ratio: 1.35;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg);
  color: var(--text);
  font-size: 1.35rem;
  font-weight: 700;
  cursor: pointer;
  touch-action: manipulation;
  font-family: inherit;
}

.pin-key:active {
  transform: scale(0.97);
  background: rgba(59, 130, 246, 0.12);
}

.pin-key-muted {
  font-size: 1rem;
  color: var(--muted);
}

.pin-submit {
  margin-top: 0.25rem;
}

.lock-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(15, 23, 42, 0.88);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.lock-overlay.hidden {
  display: none;
}

.lock-overlay-box {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.5rem 2rem;
  text-align: center;
  max-width: 320px;
}

.lock-overlay-box p {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.85rem 1rem;
  font-size: 1rem;
  font-weight: 600;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  touch-action: manipulation;
  font-family: inherit;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  width: 100%;
}

.btn-primary:active { background: var(--accent-dark); }
.btn-primary:disabled { opacity: 0.5; cursor: wait; }

.btn-ghost {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border);
  padding: 0.5rem 0.75rem;
  font-size: 0.85rem;
}

.tables-grid {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.waiter-area-block {
  margin-bottom: 0.25rem;
}

.waiter-area-title {
  margin: 0 0 0.5rem;
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.tables-grid-area {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  gap: 0.5rem;
  width: 100%;
}

.table-card {
  min-height: 72px;
  aspect-ratio: 1 / 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
  border-radius: var(--radius);
  border: 2px solid var(--border);
  background: var(--card);
  cursor: pointer;
  touch-action: manipulation;
  padding: 0.5rem;
  font-family: inherit;
  color: inherit;
}

.table-card.free { border-color: var(--ok); background: #052e16; }
.table-card.occupied { border-color: var(--danger); background: #450a0a; }
.table-card.occupied.source-warn { border-color: var(--warn); background: #422006; }
.table-card.reserved { border-color: #6366f1; box-shadow: 0 0 0 1px rgba(99, 102, 241, 0.35); }
.table-card.reserved.free { background: #1e1b4b; }

.table-reserve-icon {
  margin-left: 0.15rem;
  font-size: 0.85em;
}

.table-reserve-meta {
  font-size: 0.72rem;
  color: #a5b4fc;
}

.table-card .num {
  font-size: 1.75rem;
  font-weight: 800;
  line-height: 1;
}

.table-card .meta {
  font-size: 0.65rem;
  color: var(--muted);
  text-align: center;
  line-height: 1.2;
  width: 100%;
}

.waiter-online-zone {
  margin-top: 1.25rem;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(148, 163, 184, 0.2);
}

.online-slots-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  gap: 0.5rem;
  width: 100%;
}

.online-slot-card .online-slot-label {
  font-size: 1.05rem;
  font-weight: 800;
  line-height: 1.1;
}

.online-slot-card.free {
  opacity: 0.92;
  cursor: default;
}

.online-slot-card.pending-online,
.table-card.pending-cloud.pending-online {
  border-color: #f97316;
  background: #422006;
  box-shadow: 0 0 0 1px rgba(249, 115, 22, 0.35);
  animation: waiter-online-pulse 1.8s ease-in-out infinite;
}

.online-slot-card.accepted-online {
  border-color: var(--danger);
  background: #450a0a;
}

.table-status-pill.pending-online-pill {
  background: rgba(249, 115, 22, 0.28);
  color: #fdba74;
}

.online-slot-hint {
  font-size: 0.62rem;
  color: #fed7aa;
  text-align: center;
  line-height: 1.15;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.online-slot-action {
  font-size: 0.58rem;
  color: #fdba74;
  text-align: center;
  line-height: 1.2;
  margin-top: 0.1rem;
}

.online-slot-action.muted {
  color: var(--muted);
}

.tables-live-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.5rem;
  margin-top: 0.5rem;
  font-size: 0.8rem;
  color: var(--muted);
}

.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 6px var(--ok);
  animation: live-pulse 1.8s ease-in-out infinite;
}

@keyframes live-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.55; transform: scale(0.92); }
}

.live-label {
  font-weight: 800;
  color: var(--ok);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 0.72rem;
}

.live-sep {
  opacity: 0.45;
}

.tables-live-bar.has-online-pending .live-dot {
  background: var(--warn);
  box-shadow: 0 0 6px var(--warn);
}

.tables-live-bar.has-online-pending .live-label {
  color: var(--warn);
}

.tables-online-banner {
  margin: 0 0 0.75rem;
  padding: 0.65rem 0.85rem;
  border-radius: 10px;
  border: 1px solid rgba(251, 191, 36, 0.45);
  background: linear-gradient(135deg, #422006 0%, #1c1408 100%);
  color: #fde68a;
  font-size: 0.88rem;
}

.tables-online-banner.hidden {
  display: none !important;
}

.online-banner-inner strong {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.92rem;
}

.online-banner-item {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.2rem 0;
  color: #fef3c7;
  font-size: 0.85rem;
}

.online-banner-item + .online-banner-item {
  border-top: 1px solid rgba(251, 191, 36, 0.2);
  margin-top: 0.15rem;
  padding-top: 0.35rem;
}

.online-banner-inner small {
  display: block;
  margin-top: 0.35rem;
  opacity: 0.85;
}

.table-status-pill {
  display: inline-block;
  font-size: 0.62rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 0.12rem 0.4rem;
  border-radius: 999px;
  line-height: 1.2;
}

.table-status-pill.free { background: rgba(34, 197, 94, 0.2); color: #86efac; }
.table-status-pill.occupied { background: rgba(239, 68, 68, 0.25); color: #fca5a5; }
.table-status-pill.reserved { background: rgba(99, 102, 241, 0.25); color: #a5b4fc; }

.table-source-badge {
  display: block;
  font-size: 0.62rem;
  font-weight: 700;
  margin-top: 0.15rem;
  padding: 0.1rem 0.35rem;
  border-radius: 6px;
  line-height: 1.25;
}

.table-source-badge.source-qr { background: rgba(59, 130, 246, 0.25); color: #93c5fd; }
.table-source-badge.source-takeaway { background: rgba(249, 115, 22, 0.25); color: #fdba74; }
.table-source-badge.source-kiosk { background: rgba(168, 85, 247, 0.25); color: #d8b4fe; }
.table-source-badge.source-pos { background: rgba(148, 163, 184, 0.2); color: #cbd5e1; }

.table-stats {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  margin-top: 0.2rem;
}

.table-stat {
  font-size: 0.62rem;
}

.table-total {
  font-weight: 800;
  color: var(--text);
  font-size: 0.72rem;
}

.order-layout {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  height: 100%;
  min-height: 0;
}

#screen-order {
  height: 100dvh;
  max-height: 100dvh;
  overflow: hidden;
}

#screen-order .order-main {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  padding-bottom: 0;
  display: flex;
  flex-direction: column;
}

#screen-order.has-cart .order-main {
  padding-bottom: var(--cart-bar-height, 12rem);
}

.cart-badge {
  min-width: 1.75rem;
  height: 1.75rem;
  padding: 0 0.45rem;
  border-radius: 999px;
  background: var(--ok);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Menu POS — shiko public/css/menu-pos.css */

.menu-pos-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  height: 100%;
  min-height: 0;
}

.menu-empty-msg {
  text-align: center;
  color: var(--muted);
}

.menu-item-btn .emri,
.menu-item-btn .cmimi,
.menu-item-btn .cmimi-badge,
.menu-item-photo-wrap,
.menu-item-photo,
.menu-item-letter-ph,
.menu-item-emoji-ph {
  pointer-events: none;
}

.menu-item-btn.is-sold-out,
.menu-item-btn.menu-item-sold-out-btn {
  opacity: 0.72;
  cursor: not-allowed;
}


.cat-tabs {
  display: flex;
  gap: 0.35rem;
  overflow-x: auto;
  padding-bottom: 0.25rem;
  -webkit-overflow-scrolling: touch;
}

.cat-tab {
  flex: 0 0 auto;
  padding: 0.55rem 0.85rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--muted);
  font-size: 0.85rem;
  cursor: pointer;
  white-space: nowrap;
  touch-action: manipulation;
  font-family: inherit;
}

.cat-tab.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.menu-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 8px;
  overflow-y: auto;
  flex: 1;
  align-content: start;
  -webkit-overflow-scrolling: touch;
}

.menu-item {
  background: var(--card);
  border: 2px solid var(--border);
  border-radius: 12px;
  padding: 0.85rem 0.75rem;
  min-height: 4.25rem;
  text-align: left;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-user-select: none;
  user-select: none;
  font-family: inherit;
  color: inherit;
  width: 100%;
  display: block;
}

.menu-item strong,
.menu-item span,
.table-card .num,
.table-card .meta {
  pointer-events: none;
}

.menu-item:active,
.menu-item.menu-item-flash {
  transform: scale(0.97);
  border-color: var(--ok);
  background: rgba(34, 197, 94, 0.12);
}

.menu-item strong { display: block; font-size: 0.95rem; margin-bottom: 0.3rem; line-height: 1.25; }
.menu-item span { font-size: 0.85rem; color: var(--ok); font-weight: 800; }

.cart-bar {
  background: var(--card);
  border-top: 2px solid var(--ok);
  padding: 0.75rem 1rem calc(0.85rem + var(--safe-bottom));
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 100;
  box-shadow: 0 -8px 28px rgba(0, 0, 0, 0.45);
  max-height: min(55dvh, 420px);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

.cart-bar-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.45rem;
}

.cart-bar-title {
  font-weight: 800;
  font-size: 0.95rem;
}

.cart-count-label {
  color: var(--ok);
  font-size: 0.8rem;
  font-weight: 700;
}

.cart-lines {
  flex: 1;
  min-height: 0;
  max-height: 140px;
  overflow-y: auto;
  margin-bottom: 0.5rem;
  font-size: 0.88rem;
  -webkit-overflow-scrolling: touch;
}

.cart-line {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0;
  border-bottom: 1px solid var(--border);
}

.cart-unit-price {
  color: var(--muted);
  font-weight: 600;
}

.cart-line-total {
  color: var(--accent);
  font-weight: 700;
  font-size: 0.82rem;
  white-space: nowrap;
}

.cart-line-actions {
  display: flex;
  align-items: center;
  gap: 0.15rem;
}

.cart-qty-btn {
  min-width: 2.1rem;
  min-height: 2.1rem;
  padding: 0.35rem 0.5rem !important;
  touch-action: manipulation;
}

.cart-total {
  display: flex;
  justify-content: space-between;
  font-weight: 800;
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
}

.cart-msg {
  padding: 0.65rem 0.75rem;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.cart-msg.ok {
  color: #bbf7d0;
  background: #14532d;
  border: 1px solid var(--ok);
}

.cart-msg.err {
  color: #fecaca;
  background: #450a0a;
  border: 1px solid var(--danger);
}

.btn-send-order {
  background: var(--ok);
  color: #fff;
  width: 100%;
  padding: 1rem 1.1rem;
  font-size: 1.1rem;
  font-weight: 800;
  border: none;
  border-radius: 12px;
  margin-bottom: 0.45rem;
  touch-action: manipulation;
  font-family: inherit;
  cursor: pointer;
}

.btn-send-order:active { background: #16a34a; }
.btn-send-order:disabled { opacity: 0.55; cursor: wait; }

.cart-table-bill {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.55rem 0.15rem 0.35rem;
  margin-top: 0.35rem;
  border-top: 1px dashed rgba(255, 255, 255, 0.25);
  font-size: 0.9rem;
  font-weight: 700;
  color: #fde68a;
}

.cart-table-bill.hidden { display: none; }

.cart-pay-row {
  margin-top: 0.5rem;
  position: sticky;
  bottom: 0;
  z-index: 2;
  background: var(--card);
  padding-top: 0.35rem;
}

.cart-pay-row.hidden { display: none; }

.cart-pay-label {
  margin: 0 0 0.45rem;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #cbd5e1;
  text-align: center;
}

.cart-pay-btns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.45rem;
}

.btn-pay-cash,
.btn-pay-card {
  min-height: 48px;
  border: none;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 800;
  font-family: inherit;
  cursor: pointer;
  touch-action: manipulation;
}

.btn-pay-cash {
  background: linear-gradient(135deg, #15803d 0%, #22c55e 100%);
  color: #fff;
}

.btn-pay-card {
  background: linear-gradient(135deg, #1d4ed8 0%, #3b82f6 100%);
  color: #fff;
}

.btn-pay-cash:disabled,
.btn-pay-card:disabled {
  opacity: 0.55;
  cursor: wait;
}

.btn-close-secondary {
  padding: 0.65rem 1rem;
  font-size: 0.85rem;
}

.success-toast {
  position: fixed;
  top: max(0.85rem, env(safe-area-inset-top));
  left: 1rem;
  right: 1rem;
  z-index: 2500;
  padding: 1rem 1.1rem;
  border-radius: 12px;
  background: #14532d;
  border: 2px solid var(--ok);
  color: #bbf7d0;
  font-size: 1rem;
  font-weight: 700;
  text-align: center;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  align-items: stretch;
}

.success-toast.hidden {
  display: none;
}

.btn-cancel-order {
  width: 100%;
  min-height: 48px;
  padding: 0.65rem 1rem;
  border: 2px solid #fecaca;
  border-radius: 10px;
  background: #991b1b;
  color: #fff;
  font-size: 1rem;
  font-weight: 800;
  font-family: inherit;
  cursor: pointer;
  touch-action: manipulation;
}

.btn-cancel-order:active {
  transform: scale(0.98);
}

.cancel-countdown {
  font-size: 0.85rem;
  font-weight: 600;
  color: #86efac;
}

.cart-actions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.btn-close {
  background: var(--warn);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 0.85rem 1rem;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  touch-action: manipulation;
  width: 100%;
}

.btn-close:disabled { opacity: 0.6; }

.receipt-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(15, 23, 42, 0.92);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  padding-bottom: calc(1rem + var(--safe-bottom));
}

.receipt-sheet {
  background: #fff;
  color: #111;
  width: min(320px, 100%);
  max-width: 80mm;
  padding: 0;
  border-radius: 8px;
  font-family: "Courier New", Courier, monospace;
  font-size: 12px;
  line-height: 1.35;
  overflow: hidden;
}

.receipt-thermal {
  width: 100%;
  padding: 0.45rem 0.4rem 0.55rem;
  box-sizing: border-box;
}

.receipt-thermal[data-width-mm="58"] {
  max-width: 58mm;
  font-size: 11px;
}

.receipt-thermal[data-width-mm="80"] {
  max-width: 80mm;
  font-size: 12px;
}

.rc-header {
  text-align: center;
  margin-bottom: 0.2rem;
}

.rc-business-name {
  font-weight: 800;
  font-size: 1.15em;
  line-height: 1.15;
  margin-bottom: 0.15rem;
}

.rc-business-meta {
  font-size: 0.9em;
  color: #222;
  line-height: 1.25;
}

.rc-meta-line {
  margin: 0.05rem 0;
}

.rc-divider {
  border: none;
  border-top: 1px dashed #333;
  margin: 0.22rem 0;
  height: 0;
}

.rc-divider-strong {
  border-top-style: solid;
}

.rc-order-meta {
  font-size: 0.92em;
  line-height: 1.25;
}

.rc-order-meta div {
  margin: 0.04rem 0;
}

.rc-meta-label {
  font-weight: 700;
}

.rc-items-compact .rc-item-line {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.35rem;
  font-size: 0.95em;
  line-height: 1.2;
  margin: 0.06rem 0;
}

.rc-items-compact .rc-item-name {
  flex: 1;
  min-width: 0;
  word-break: break-word;
  font-weight: 600;
}

.rc-items-compact .rc-item-calc {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.rc-items {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92em;
  table-layout: fixed;
}

.rc-items th {
  font-size: 0.72em;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px solid #333;
  padding: 0.2rem 0.15rem 0.35rem;
  color: #333;
}

.rc-items th.rc-name,
.rc-items td.rc-name {
  text-align: left;
  width: 46%;
}

.rc-items th.rc-qty,
.rc-items td.rc-qty {
  text-align: center;
  width: 12%;
}

.rc-items th.rc-price,
.rc-items td.rc-price {
  text-align: right;
  width: 20%;
}

.rc-items th.rc-value,
.rc-items td.rc-value {
  text-align: right;
  width: 22%;
}

.rc-items td {
  padding: 0.28rem 0.15rem;
  vertical-align: top;
  font-variant-numeric: tabular-nums;
}

.rc-items td.rc-name {
  word-break: break-word;
  padding-right: 0.25rem;
  line-height: 1.25;
}

.rc-items-narrow .rc-item-name {
  font-weight: 700;
  margin-bottom: 0.15rem;
}

.rc-items-narrow .rc-item-sub {
  display: flex;
  justify-content: space-between;
  gap: 0.35rem;
  font-size: 0.92em;
  color: #333;
}

.rc-items-narrow .rc-item-line-total {
  font-weight: 800;
  white-space: nowrap;
}

.rc-empty {
  text-align: center;
  color: #888;
  padding: 0.5rem 0;
}

.rc-total {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.35rem;
  font-weight: 800;
  font-size: 1.1em;
  margin: 0.15rem 0 0.1rem;
  padding: 0;
}

.rc-total-label {
  letter-spacing: 0.02em;
}

.rc-total-value {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.rc-payment {
  font-weight: 700;
  font-size: 0.95em;
  margin: 0.05rem 0 0.1rem;
}

.rc-footer {
  text-align: center;
  font-size: 0.92em;
  line-height: 1.3;
  padding-top: 0.05rem;
}

.rc-thanks {
  font-weight: 800;
  font-size: 1em;
  margin: 0.1rem 0 0;
  text-align: center;
}

.rc-printed {
  color: #444;
  font-size: 0.88em;
  font-variant-numeric: tabular-nums;
}

.receipt-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 1rem;
  width: min(320px, 100%);
}

.receipt-actions:has(#btn-print.hidden) {
  justify-content: stretch;
}

.receipt-actions:has(#btn-print.hidden) #btn-receipt-done {
  flex: 1;
  width: 100%;
}

@media print {
  @page {
    margin: 0;
    size: 80mm auto;
  }

  html, body {
    margin: 0 !important;
    padding: 0 !important;
    background: #fff !important;
    width: auto !important;
    height: auto !important;
    overflow: visible !important;
  }

  body.print-receipt #screen-pin,
  body.print-receipt #screen-tables,
  body.print-receipt #screen-order,
  body.print-receipt #success-toast {
    display: none !important;
  }

  body.print-receipt #receipt-modal,
  body.print-receipt #receipt-modal.hidden {
    display: block !important;
    position: static !important;
    inset: auto !important;
    background: transparent !important;
    padding: 0 !important;
    margin: 0 !important;
    min-height: 0 !important;
    height: auto !important;
  }

  body.print-receipt #receipt-print,
  body.print-receipt .receipt-sheet {
    display: block !important;
    position: static !important;
    width: 80mm !important;
    max-width: 80mm !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    background: #fff !important;
    overflow: visible !important;
  }

  body.print-receipt-w58 #receipt-print,
  body.print-receipt-w58 .receipt-sheet {
    width: 58mm !important;
    max-width: 58mm !important;
  }

  body.print-receipt #receipt-print .receipt-thermal {
    padding: 2mm 2mm 3mm !important;
    font-size: 11pt !important;
    line-height: 1.18 !important;
    color: #000 !important;
  }

  body.print-receipt .rc-business-name {
    font-size: 12pt !important;
  }

  body.print-receipt .rc-total {
    font-size: 12pt !important;
  }

  body.print-receipt .rc-divider {
    margin: 1mm 0 !important;
  }

  .no-print,
  .receipt-actions {
    display: none !important;
  }
}

.err {
  color: #fecaca;
  background: #450a0a;
  border: 1px solid var(--danger);
  padding: 0.75rem;
  border-radius: 8px;
  font-size: 0.85rem;
  margin-bottom: 0.75rem;
}

.hint {
  color: var(--muted);
  font-size: 0.8rem;
  text-align: center;
  margin-top: 0.5rem;
}

.waiter-online-banner {
  display: none !important;
}

.waiter-online-banner--alert {
  background: rgba(249, 115, 22, 0.14);
  border-color: rgba(249, 115, 22, 0.55);
  animation: waiter-online-pulse 1.6s ease-in-out infinite;
}

.waiter-online-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  font-size: 0.82rem;
  color: var(--text);
}

.waiter-online-text strong {
  font-size: 0.9rem;
}

.waiter-online-text span {
  color: var(--muted);
}

.waiter-online-badge {
  min-width: 1.75rem;
  height: 1.75rem;
  border-radius: 999px;
  background: var(--warn);
  color: #fff;
  font-weight: 700;
  font-size: 0.85rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

@keyframes waiter-online-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(249, 115, 22, 0.35); }
  50% { box-shadow: 0 0 0 6px rgba(249, 115, 22, 0); }
}

.hidden { display: none !important; }

/* Modal pranimi porosie — pa PIN */
.accept-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.accept-modal.hidden { display: none !important; }

.accept-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(4, 10, 30, 0.72);
}

.accept-modal-card {
  position: relative;
  width: min(440px, 100%);
  max-height: calc(100vh - 2rem);
  overflow: auto;
  background: #fff;
  color: #0f1b3d;
  border-radius: 16px;
  padding: 1.25rem;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
  border: 3px solid #ef4444;
}

.accept-modal-card h2 {
  margin: 0 0 0.5rem;
  font-size: 1.3rem;
  text-align: center;
  color: #dc2626;
}

.accept-modal-source {
  text-align: center;
  font-weight: 700;
  font-size: 1.05rem;
  margin-bottom: 0.5rem;
}

.accept-modal-table-row {
  font-size: 1.05rem;
  margin-bottom: 0.5rem;
}

.accept-modal-items {
  list-style: none;
  margin: 0 0 0.5rem;
  padding: 0.5rem 0;
  border-top: 1px dashed #cbd5e1;
  border-bottom: 1px dashed #cbd5e1;
}

.accept-modal-items li {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.2rem 0;
  font-size: 0.98rem;
}

.accept-modal-items .qty { font-weight: 700; }
.accept-modal-items .item-name { flex: 1; }

.accept-modal-total {
  font-size: 1.15rem;
  font-weight: 800;
  text-align: right;
  margin: 0.5rem 0 1rem;
}

.accept-modal-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
}

.accept-modal-actions button {
  padding: 0.85rem 0.5rem;
  font-size: 1rem;
  font-weight: 800;
  border-radius: 10px;
  border: none;
  cursor: pointer;
}

.accept-btn-yes {
  background: #16a34a;
  color: #fff;
}

.accept-btn-no {
  background: #dc2626;
  color: #fff;
}

.accept-btn-pay-cash {
  background: #16a34a;
  color: #fff;
}

.accept-btn-pay-card {
  background: #2563eb;
  color: #fff;
}

.online-close-actions {
  margin-top: 0.25rem;
}
@media (max-width: 600px) {
  .tables-grid-area,
  .online-slots-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .table-card .num {
    font-size: 1.25rem;
  }
}

@media (max-width: 768px) {
  html, body {
    width: 100%;
    min-height: 100dvh;
    height: 100%;
  }

  .screen.active {
    width: 100%;
    min-height: 100dvh;
    height: 100dvh;
    max-height: 100dvh;
  }

  #screen-tables.active,
  #screen-order.active {
    overflow: hidden;
  }
}

@media (max-width: 900px) {
  #screen-pin.staff-login-screen {
    padding: 0;
    width: 100%;
    align-items: stretch;
    justify-content: stretch;
    min-height: 100dvh;
    max-height: 100dvh;
    height: 100dvh;
    overflow: hidden;
  }

  #screen-pin .staff-login-shell {
    width: 100%;
    max-width: 100%;
    min-height: 100dvh;
    max-height: none;
    height: 100dvh;
    border-radius: 0;
    box-shadow: none;
    display: flex;
    flex-direction: column;
  }
}

@media (max-width: 520px) {
  #screen-pin.staff-login-screen {
    padding: 0;
    width: 100%;
    align-items: stretch;
    justify-content: stretch;
    min-height: 100dvh;
    max-height: 100dvh;
    height: 100dvh;
    overflow: hidden;
  }

  #screen-pin .staff-login-shell {
    width: 100%;
    max-width: 100%;
    min-height: 100dvh;
    max-height: none;
    height: 100dvh;
    border-radius: 0;
    box-shadow: none;
    display: flex;
    flex-direction: column;
    background: linear-gradient(175deg, #0f1b3d 0%, #162544 50%, #1a2d50 100%);
  }

  #screen-pin .staff-login-brand {
    padding: 1.2rem 1rem 0.6rem;
    padding-top: max(1.2rem, calc(env(safe-area-inset-top) + 0.5rem));
    min-height: 0;
    flex: 0 0 auto;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    text-align: center;
    background: transparent;
    border: none;
  }

  #screen-pin .staff-revolution-logo {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
  }

  #screen-pin .staff-brand-label {
    font-size: 0.65rem;
    letter-spacing: 0.1em;
    margin: 0.15rem 0 0;
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
  }

  #screen-pin .staff-login-brand .conn-status {
    margin: 0.2rem 0 0;
    font-size: 0.6rem;
    padding: 0.12rem 0.5rem;
  }

  #screen-pin .staff-venue-logo {
    width: 40px;
    height: 40px;
    margin: 0.15rem 0 0;
  }

  #screen-pin .staff-venue-name {
    font-size: 1.15rem;
    font-weight: 700;
    color: #ffffff;
    margin-top: 0.15rem;
  }

  #screen-pin .staff-venue-location {
    display: block;
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.45);
    margin-top: 0.1rem;
  }

  #screen-pin .staff-powered {
    display: block;
    font-size: 0.58rem;
    color: rgba(255, 255, 255, 0.25);
    margin-top: 0.25rem;
  }

  #screen-pin .staff-login-panel {
    padding: 0.5rem 1.2rem 0.8rem;
    padding-bottom: max(0.8rem, calc(env(safe-area-inset-bottom) + 0.5rem));
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: transparent;
    border: none;
  }

  #screen-pin .staff-login-panel h1 {
    font-size: 1.15rem;
    font-weight: 600;
    color: #ffffff;
    text-align: center;
  }

  #screen-pin .staff-login-lead {
    font-size: 0.78rem;
    margin-top: 0.15rem;
    color: rgba(255, 255, 255, 0.45);
    text-align: center;
  }

  #screen-pin .staff-login-panel .pin-box {
    margin-top: 0.6rem;
    width: 100%;
    max-width: 300px;
    background: transparent;
    border: none;
    padding: 0;
  }

  #screen-pin .staff-login-panel .pin-display,
  #screen-pin .pin-display {
    font-size: 1.8rem;
    letter-spacing: 0.35em;
    padding: 0.4rem 0 0.6rem;
    min-height: auto;
    color: #ffffff;
  }

  #screen-pin .pin-keypad {
    gap: 0.45rem;
    margin-bottom: 0.5rem;
  }

  #screen-pin .pin-key,
  #screen-pin .staff-login-panel .pin-key {
    aspect-ratio: 1.4;
    font-size: 1.25rem;
    font-weight: 600;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.06);
    color: #ffffff;
    transition: background 0.12s, transform 0.1s;
  }

  #screen-pin .pin-key:active {
    background: rgba(59, 130, 246, 0.3);
    transform: scale(0.95);
  }

  #screen-pin .pin-key-muted {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.5);
    background: rgba(255, 255, 255, 0.03);
  }

  #screen-pin .staff-login-panel .pin-submit,
  #screen-pin .pin-submit {
    padding: 0.7rem;
    font-size: 0.95rem;
    font-weight: 700;
    border-radius: 14px;
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    border: none;
    color: #ffffff;
    letter-spacing: 0.03em;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
  }

  #screen-pin .pin-submit:active {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    transform: scale(0.98);
  }

  #screen-pin .staff-login-panel .hint {
    margin-top: 0.45rem;
    font-size: 0.68rem;
    color: rgba(255, 255, 255, 0.35);
    text-align: center;
  }

  #screen-pin .staff-login-panel .err {
    padding: 0.45rem 0.6rem;
    font-size: 0.78rem;
    margin-bottom: 0.45rem;
    border-radius: 10px;
  }

  #screen-tables .staff-app-bar {
    padding: 0.32rem 0.65rem;
    gap: 0.35rem;
  }

  #screen-tables .staff-app-bar img {
    width: 22px;
    height: 22px;
  }

  #screen-tables .staff-app-bar > span:not(.staff-app-venue):not(.conn-status) {
    display: none;
  }

  #screen-tables .waiter-header {
    padding: 0.5rem 0.65rem;
    padding-top: max(0.5rem, env(safe-area-inset-top));
  }

  #screen-tables .waiter-header h1 {
    font-size: 1rem;
  }

  #screen-tables .waiter-main {
    padding: 0.55rem 0.65rem;
  }

  #screen-order:not(.kiosk-screen) .staff-app-bar {
    padding: 0.3rem 0.6rem;
    gap: 0.3rem;
  }

  #screen-order:not(.kiosk-screen) .staff-app-bar img {
    width: 22px;
    height: 22px;
  }

  #screen-order:not(.kiosk-screen) .staff-app-bar > span:not(.staff-app-venue):not(.conn-status) {
    display: none;
  }

  #screen-order:not(.kiosk-screen) .waiter-header {
    padding: 0.4rem 0.6rem;
    padding-top: max(0.4rem, env(safe-area-inset-top));
  }

  #screen-order:not(.kiosk-screen) .waiter-header h1 {
    font-size: 0.92rem;
  }

  #screen-order:not(.kiosk-screen) .waiter-header .btn-ghost {
    padding: 0.4rem 0.55rem;
    font-size: 0.78rem;
  }

  #screen-order:not(.kiosk-screen) .cart-badge {
    min-width: 1.45rem;
    height: 1.45rem;
    font-size: 0.72rem;
  }

  #screen-order:not(.kiosk-screen) .waiter-main.order-main {
    padding: 0;
    padding-bottom: 0;
  }
}

@media (max-width: 520px) and (max-height: 700px) {
  #screen-pin .staff-login-brand {
    padding: 0.4rem 0.65rem;
  }

  #screen-pin .staff-venue-name {
    font-size: 0.85rem;
  }

  #screen-pin .staff-login-panel {
    padding: 0.45rem 0.65rem 0.55rem;
  }

  #screen-pin .pin-key,
  #screen-pin .staff-login-panel .pin-key {
    aspect-ratio: 1.75;
    font-size: 0.92rem;
  }
}

/* Kalkulatorë */
.btn-calc-mini {
  min-width: 2.25rem;
  padding: 0.35rem 0.5rem;
  font-size: 1.1rem;
  line-height: 1;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #243044;
  color: var(--text);
}

.waiter-desktop-footer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 30;
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem 1rem calc(0.65rem + var(--safe-bottom));
  background: rgba(15, 23, 42, 0.96);
  border-top: 1px solid var(--border);
  backdrop-filter: blur(8px);
}

.btn-calc-desktop {
  min-width: 10rem;
  padding: 0.65rem 1.25rem;
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #243044;
  color: var(--text);
  cursor: pointer;
}

body.has-desktop-calc-footer #screen-tables .waiter-main,
body.has-desktop-calc-footer #screen-order .waiter-main {
  padding-bottom: calc(4.5rem + var(--safe-bottom));
}

.calc-modal {
  position: fixed;
  inset: 0;
  z-index: 1100;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
}

.calc-modal.hidden { display: none !important; }

.calc-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.calc-modal-card {
  position: relative;
  width: 100%;
  max-width: 400px;
  background: #1a1a2e;
  border-radius: 24px 24px 0 0;
  padding: 1.25rem 1rem 1.5rem;
  box-shadow: 0 -8px 40px rgba(0, 0, 0, 0.5);
  animation: calcSlideUp 0.25s ease-out;
}

@keyframes calcSlideUp {
  from { transform: translateY(100%); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.calc-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.85rem;
}

.calc-modal-head h2 {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.6);
  letter-spacing: 0.04em;
}

.calc-modal-close {
  border: none;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.5);
  font-size: 1.15rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.35rem 0.6rem;
  border-radius: 50%;
  transition: background 0.15s;
}

.calc-modal-close:active {
  background: rgba(255, 255, 255, 0.15);
}

.calc-display {
  background: #0f0f23;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 16px;
  padding: 1rem 1rem;
  margin-bottom: 0.85rem;
  font-size: 2.2rem;
  font-weight: 300;
  text-align: right;
  font-variant-numeric: tabular-nums;
  min-height: 3.25rem;
  word-break: break-all;
  color: #ffffff;
  letter-spacing: 0.02em;
}

.calc-keys {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem;
}

.calc-key {
  border: none;
  border-radius: 14px;
  background: #2a2a40;
  color: #e2e8f0;
  font-size: 1.2rem;
  font-weight: 500;
  padding: 1rem 0.25rem;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.12s, transform 0.1s;
}

.calc-key:active {
  transform: scale(0.93);
  background: #3d3d5c;
}

.calc-key-op {
  background: #1e3a5f;
  color: #7dd3fc;
  font-weight: 600;
}

.calc-key-op:active {
  background: #2563eb;
  color: #ffffff;
}

.calc-key-fn {
  background: #4a2020;
  color: #fca5a5;
  font-weight: 600;
}

.calc-key-fn:active {
  background: #7f1d1d;
}

.calc-key-eq {
  grid-column: 1 / -1;
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  color: #fff;
  font-size: 1.3rem;
  font-weight: 700;
  padding: 1rem;
  border-radius: 14px;
  letter-spacing: 0.02em;
}

.calc-key-eq:active {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  transform: scale(0.97);
}

/* Desktop — karta në qendër */
@media (min-width: 521px) {
  .calc-modal {
    align-items: center;
    padding: 1rem;
  }

  .calc-modal-card {
    border-radius: 24px;
    max-width: 340px;
    animation: calcFadeIn 0.2s ease-out;
  }

  @keyframes calcFadeIn {
    from { transform: scale(0.95); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
  }
}

/* Telefon — butona ma të mëdha */
@media (max-width: 520px) {
  .calc-modal-card {
    padding: 1rem 0.75rem calc(1rem + var(--safe-bottom, 0px));
  }

  .calc-display {
    font-size: 2rem;
    padding: 0.85rem 0.85rem;
    border-radius: 14px;
  }

  .calc-key {
    padding: 0.9rem 0.2rem;
    font-size: 1.1rem;
    border-radius: 12px;
  }

  .calc-keys {
    gap: 0.4rem;
  }

  .calc-key-eq {
    padding: 0.9rem;
    font-size: 1.2rem;
    border-radius: 12px;
  }
}
