/* POS + KDS — tablet-first */

.pos-shell {
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 4rem);
  background: #f0f4f2;
  margin: -1rem;
  padding: 0;
  border-radius: 12px;
  overflow: hidden;
}

.pos-offline-banner {
  background: #f59e0b;
  color: #1a1a2e;
  padding: 0.5rem 1rem;
  text-align: center;
  font-weight: 600;
}

.pos-offline-banner[data-mode="hub"] {
  background: #10b981;
  color: #fff;
}

/* Header */
.pos-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 1.25rem;
  background: #fff;
  border-bottom: 1px solid #e5e7eb;
  flex-wrap: wrap;
}

.pos-header-title {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
  flex: 1;
  text-align: center;
}

.pos-header-btn {
  border: 1px solid #d1d5db;
  background: #fff;
  border-radius: 10px;
  padding: 0.45rem 0.85rem;
  cursor: pointer;
  font-size: 0.9rem;
}

.pos-view-tabs {
  display: flex;
  gap: 0.25rem;
  background: #f3f4f6;
  padding: 0.2rem;
  border-radius: 10px;
}

.pos-tab {
  border: 0;
  background: transparent;
  padding: 0.4rem 0.85rem;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.85rem;
}

.pos-tab.active {
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  font-weight: 600;
}

/* Main 3-column layout — cart left, menu center, orders right (visual) */
.pos-main {
  flex: 1;
  padding: 0.75rem;
  min-height: 0;
}

.pos-layout-v2 {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(280px, 2.2fr) minmax(220px, 1fr);
  gap: 0.75rem;
  height: 100%;
  min-height: 520px;
  direction: ltr;
}

.pos-layout-v2 > .pos-col {
  direction: rtl;
}

@media (max-width: 1024px) {
  .pos-layout-v2 {
    grid-template-columns: 1fr;
    min-height: auto;
  }
}

.pos-col {
  background: #fff;
  border-radius: 16px;
  border: 1px solid #e8ecea;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.pos-col-head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid #f0f0f0;
  flex-shrink: 0;
}

.pos-col-head h3 {
  margin: 0;
  font-size: 1rem;
  flex: 1;
}

.pos-col-icon {
  font-size: 1.1rem;
}

.pos-service-select {
  max-width: 9rem;
  font-size: 0.85rem;
  padding: 0.35rem 0.5rem;
}

.pos-new-order-btn {
  margin-inline-start: auto;
}

/* Cart */
.pos-cart-lines {
  flex: 1;
  overflow-y: auto;
  padding: 0.5rem 0.75rem;
  min-height: 120px;
}

.pos-cart-line {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 0;
  border-bottom: 1px solid #f3f4f6;
}

.pos-cart-line-info {
  min-width: 0;
}

.pos-cart-line-name {
  font-weight: 600;
  font-size: 0.92rem;
  display: block;
}

.pos-cart-line-price {
  font-size: 0.8rem;
  color: #6b7280;
}

.pos-qty-controls {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  background: #f3f4f6;
  border-radius: 8px;
  padding: 0.15rem;
}

.pos-qty-btn {
  width: 28px;
  height: 28px;
  border: 0;
  background: #fff;
  border-radius: 6px;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
}

.pos-qty-val {
  min-width: 1.5rem;
  text-align: center;
  font-weight: 600;
  font-size: 0.9rem;
}

.pos-cart-line-remove {
  border: 0;
  background: transparent;
  color: #ef4444;
  cursor: pointer;
  font-size: 1.1rem;
  padding: 0.25rem;
}

.pos-cart-empty {
  text-align: center;
  color: #9ca3af;
  padding: 2rem 1rem;
  font-size: 0.9rem;
}

.pos-cart-footer {
  padding: 0.75rem 1rem;
  border-top: 1px solid #f0f0f0;
  flex-shrink: 0;
}

.pos-cart-total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 1.05rem;
  margin-bottom: 0.75rem;
}

.pos-cart-total-row strong {
  font-size: 1.2rem;
  color: #166534;
}

.pos-actions {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.pos-action-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.7rem 1rem;
  border-radius: 12px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  border: 2px solid transparent;
}

.pos-action-primary {
  background: #166534;
  color: #fff;
  border-color: #166534;
}

.pos-action-primary:hover {
  background: #14532d;
}

.pos-action-outline {
  background: #fff;
  color: #166534;
  border-color: #166534;
}

.pos-open-strip {
  border-top: 1px solid #f0f0f0;
  padding: 0.5rem 0.75rem 0.75rem;
  flex-shrink: 0;
  max-height: 140px;
  overflow-y: auto;
}

.pos-open-strip-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  color: #6b7280;
  margin-bottom: 0.35rem;
}

.pos-badge {
  background: #166534;
  color: #fff;
  font-size: 0.75rem;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
}

.pos-open-mini {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.pos-open-mini-btn {
  text-align: start;
  border: 1px solid #e5e7eb;
  background: #fafafa;
  border-radius: 8px;
  padding: 0.4rem 0.6rem;
  font-size: 0.8rem;
  cursor: pointer;
}

.pos-open-mini-btn.selected {
  border-color: #166534;
  background: #ecfdf5;
}

/* Menu */
.pos-menu-col {
  padding-bottom: 0;
}

/* Toolbar — tables + service type (always visible above columns) */
.pos-toolbar {
  background: #fff;
  border: 1px solid #e8ecea;
  border-radius: 14px;
  padding: 0.65rem 0.85rem;
  margin-bottom: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.pos-toolbar-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.pos-service-toggle {
  display: inline-flex;
  flex-wrap: wrap;
  background: #f3f4f6;
  border-radius: 10px;
  padding: 0.2rem;
  gap: 0.15rem;
}

.pos-service-btn {
  border: 0;
  background: transparent;
  padding: 0.4rem 0.65rem;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
  color: #4b5563;
}

.pos-service-btn.active {
  background: #fff;
  color: #166534;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.pos-customer-select {
  min-width: 9rem;
  max-width: 14rem;
  font-size: 0.82rem;
}

.pos-item-kds {
  font-size: 0.75rem;
  opacity: 0.85;
}

.pos-table-chip {
  padding: 0.35rem 0.75rem;
  background: #ecfdf5;
  border: 1px solid #86efac;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 600;
  color: #166534;
}

.pos-toolbar-tables {
  display: flex;
  align-items: stretch;
  gap: 0.5rem;
  min-height: 52px;
}

.pos-toolbar-tables.hidden {
  display: none;
}

.pos-add-table-btn {
  flex: 0 0 auto;
  align-self: center;
  border: 2px dashed #22c55e;
  background: #ecfdf5;
  color: #166534;
  border-radius: 12px;
  padding: 0.55rem 1rem;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

.pos-add-table-btn:hover {
  background: #d1fae5;
}

.pos-toolbar-table-grid {
  flex: 1;
  display: flex;
  flex-wrap: nowrap;
  gap: 0.4rem;
  overflow-x: auto;
  align-items: center;
  min-width: 0;
  padding: 0.15rem 0;
}

.pos-toolbar-table-grid .pos-table-btn {
  flex: 0 0 auto;
  min-width: 68px;
}

.pos-toolbar-table-grid .hint-msg {
  margin: 0;
  font-size: 0.82rem;
  align-self: center;
}

/* Simpler menu — tabs + items */
.pos-menu-head h3 {
  margin: 0;
  font-size: 1rem;
}

.pos-menu-tabs {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.35rem;
  padding: 0 0.75rem 0.5rem;
  overflow-x: auto;
  border-bottom: 1px solid #eef0ef;
  flex-shrink: 0;
}

.pos-menu-tab {
  flex: 0 0 auto;
  border: 1px solid #e5e7eb;
  background: #f9fafb;
  border-radius: 999px;
  padding: 0.4rem 0.85rem;
  font-size: 0.82rem;
  cursor: pointer;
  white-space: nowrap;
}

.pos-menu-tab.active {
  background: #166534;
  border-color: #166534;
  color: #fff;
  font-weight: 600;
}

.pos-menu-items {
  flex: 1;
  overflow-y: auto;
  padding: 0.75rem 1rem 1rem;
  margin-top: 0;
  align-content: start;
}

.pos-menu-empty {
  padding: 1rem;
  text-align: center;
}

.pos-item-name {
  font-size: 0.85rem;
  line-height: 1.25;
}

.pos-pay-open-btn {
  width: 100%;
  margin-top: 0.25rem;
  font-weight: 800;
}

.pos-pay-modal-card {
  max-width: 420px;
}

.pos-pay-modal-total,
.pos-pay-modal-change {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border-radius: 12px;
  margin-bottom: 0.85rem;
}

.pos-pay-modal-total {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
}

.pos-pay-modal-total strong {
  font-size: 1.35rem;
  color: #166534;
}

.pos-pay-modal-change {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
}

.pos-pay-modal-change strong {
  font-size: 1.2rem;
  color: #0f172a;
}

.pos-pay-modal-change.pos-pay-change-due strong {
  color: #b45309;
}

.pos-pay-modal-change.pos-pay-change-ok strong {
  color: #15803d;
}

.pos-pay-tendered-input {
  font-size: 1.25rem;
  font-weight: 700;
  text-align: center;
}

.pos-pay-modal-methods {
  margin: 1rem 0 0.5rem;
}

.pos-pay-modal-methods-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 700;
  color: #6b7280;
  margin-bottom: 0.5rem;
}

.pos-pay-modal-methods-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.45rem;
}

.pos-pay-method-btn {
  border: 1px solid #d1d5db;
  background: #fff;
  color: #111827;
  border-radius: 10px;
  padding: 0.65rem 0.5rem;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.pos-pay-method-btn:hover {
  border-color: var(--brand-500, #16a34a);
  background: #f0fdf4;
}

.pos-pay-method-btn.active {
  border-color: var(--brand-500, #16a34a);
  background: var(--brand-500, #16a34a);
  color: #fff;
}

.pos-pay-methods {
  display: grid;
  grid-template-columns: auto 1fr 1fr;
  gap: 0.35rem;
  align-items: center;
  width: 100%;
  margin-top: 0.25rem;
}

.pos-pay-label {
  grid-column: 1 / -1;
  font-size: 0.75rem;
  font-weight: 600;
  color: #6b7280;
}

.pos-pay-btn {
  font-size: 0.8rem;
  padding: 0.45rem 0.35rem;
}

@media (min-width: 900px) {
  .pos-pay-methods {
    grid-template-columns: auto repeat(4, 1fr);
  }

  .pos-pay-label {
    grid-column: auto;
  }
}

.pos-category-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  overflow-y: auto;
  flex: 1;
}

@media (max-width: 640px) {
  .pos-category-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.pos-cat-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.85rem 0.35rem;
  border: 1px solid #e8ecea;
  border-radius: 14px;
  background: #fafafa;
  cursor: pointer;
  min-height: 88px;
  transition: background 0.15s, border-color 0.15s;
}

.pos-cat-btn:hover,
.pos-cat-btn.active {
  background: #ecfdf5;
  border-color: #86efac;
}

.pos-cat-icon {
  font-size: 1.75rem;
  line-height: 1;
}

.pos-cat-label {
  font-size: 0.72rem;
  text-align: center;
  line-height: 1.2;
  color: #374151;
}

.pos-item-panel {
  padding: 0 1rem 1rem;
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.pos-item-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.pos-item-btn {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.85rem 0.5rem;
  min-height: 72px;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  background: #fff;
  cursor: pointer;
  text-align: center;
}

.pos-item-btn:hover {
  border-color: #166534;
  background: #f0fdf4;
}

.pos-item-price {
  font-size: 0.85rem;
  color: #166534;
  font-weight: 600;
}

/* Orders column */
.pos-orders-list {
  flex: 1;
  overflow-y: auto;
  padding: 0.5rem 0.75rem 0.75rem;
}

.pos-order-card {
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 0.75rem;
  margin-bottom: 0.5rem;
  cursor: pointer;
  background: #fafafa;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.pos-order-card:hover {
  border-color: #86efac;
}

.pos-order-card.selected {
  border-color: #166534;
  background: #ecfdf5;
  box-shadow: 0 0 0 2px rgba(22, 101, 52, 0.15);
}

.pos-order-card.has-bill-request {
  border-color: #fdba74;
  background: #fffbeb;
}

.pos-bill-badge {
  display: inline-block;
  margin-bottom: 0.35rem;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  background: #ffedd5;
  color: #c2410c;
  font-size: 0.72rem;
  font-weight: 800;
}

.pos-order-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.35rem;
}

.pos-order-id {
  font-weight: 700;
  font-size: 0.95rem;
}

.pos-order-status {
  font-size: 0.7rem;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  background: #dbeafe;
  color: #1e40af;
}

.pos-order-status.status-preparing {
  background: #fef3c7;
  color: #92400e;
}

.pos-order-status.status-ready,
.pos-order-status.status-served {
  background: #dcfce7;
  color: #166534;
}

.pos-order-meta {
  font-size: 0.82rem;
  color: #6b7280;
  margin-bottom: 0.35rem;
}

.pos-order-items-preview {
  font-size: 0.78rem;
  color: #374151;
  line-height: 1.4;
}

.pos-order-total {
  font-weight: 700;
  color: #166534;
  margin-top: 0.35rem;
  font-size: 0.9rem;
}

.pos-orders-empty {
  text-align: center;
  padding: 2.5rem 1rem;
  color: #9ca3af;
}

.pos-orders-empty-icon {
  font-size: 3rem;
  margin-bottom: 0.75rem;
  opacity: 0.5;
}

/* Footer */
.pos-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 1.25rem;
  background: #fff;
  border-top: 1px solid #e5e7eb;
  font-size: 0.85rem;
  color: #6b7280;
  flex-shrink: 0;
}

.pos-footer-left {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.pos-conn-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #9ca3af;
}

.pos-conn-dot.online {
  background: #22c55e;
}

.pos-conn-dot.hub {
  background: #10b981;
}

.pos-conn-dot.offline {
  background: #ef4444;
}

.pos-footer-sep {
  opacity: 0.4;
}

/* Settings drawer */
.pos-settings-drawer {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
}

.pos-settings-drawer.hidden {
  display: none;
}

.pos-settings-backdrop {
  flex: 1;
  background: rgba(0, 0, 0, 0.35);
}

.pos-settings-panel {
  width: min(380px, 92vw);
  background: #fff;
  padding: 1rem;
  overflow-y: auto;
  box-shadow: -4px 0 24px rgba(0, 0, 0, 0.12);
}

.pos-settings-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.pos-settings-head h3 {
  margin: 0;
}

.pos-settings-body section {
  margin-bottom: 1.25rem;
}

.pos-settings-label {
  font-size: 0.9rem;
  margin: 0 0 0.5rem;
}

.pos-cart-totals {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 0.75rem;
}

.pos-cart-discount-row span:last-child {
  color: #dc2626;
  font-weight: 600;
}

.pos-cart-subtotal-row {
  color: #6b7280;
  font-size: 0.9rem;
}

.pos-customer-panel .pos-customer-hint {
  margin: 0 0 0.35rem;
  font-size: 0.78rem;
}

.pos-customer-panel {
  padding: 0.5rem 0.75rem 0.75rem;
  border-top: 1px solid #e5e7eb;
  background: #fafafa;
}

.pos-customer-panel-table {
  background: #f0fdf4;
  border-top-color: #86efac;
}

.pos-customer-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  grid-column: 1 / -1;
}

.pos-customer-search-row {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 0.5rem;
}

.pos-customer-search-row .input {
  flex: 1;
  min-width: 0;
}

.pos-customer-results {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  max-height: 160px;
  overflow-y: auto;
  margin-bottom: 0.5rem;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 0.25rem;
}

.pos-customer-hit {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.1rem;
  width: 100%;
  text-align: start;
  padding: 0.45rem 0.6rem;
  border: none;
  border-radius: 6px;
  background: transparent;
  cursor: pointer;
  font-size: 0.82rem;
}

.pos-customer-hit:hover {
  background: #ecfdf5;
}

.pos-customer-hit span {
  color: #6b7280;
  font-size: 0.75rem;
}

.pos-customer-fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.5rem;
  align-items: center;
}

.pos-delivery-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.pos-delivery-view {
  padding: 1rem;
  overflow: auto;
  max-height: calc(100vh - 120px);
}

.pos-delivery-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.pos-delivery-filter {
  border: 1px solid #d1d5db;
  background: #fff;
  border-radius: 999px;
  padding: 0.35rem 0.9rem;
  font-size: 0.85rem;
  cursor: pointer;
}

.pos-delivery-filter.active {
  background: #1a1a2e;
  color: #fff;
  border-color: #1a1a2e;
}

.pos-tab {
  position: relative;
}

.pos-delivery-tab-badge,
.sidebar-nav-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.25rem;
  height: 1.25rem;
  padding: 0 0.35rem;
  margin-inline-start: 0.35rem;
  border-radius: 999px;
  background: #16a34a;
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  line-height: 1;
  vertical-align: middle;
}

.pos-tab.pos-tab-has-ready {
  animation: posDeliveryTabPulse 1.6s ease-in-out infinite;
}

@keyframes posDeliveryTabPulse {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(22, 163, 74, 0);
  }
  50% {
    box-shadow: 0 0 0 4px rgba(22, 163, 74, 0.35);
  }
}

.pos-delivery-board-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1rem;
}

.pos-delivery-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.pos-delivery-card.can-deliver {
  border-color: #22c55e;
  box-shadow: 0 0 0 2px #22c55e33;
}

.pos-delivery-card-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.pos-delivery-card-head strong {
  font-size: 1.05rem;
}

.pos-delivery-customer {
  font-weight: 600;
}

.pos-delivery-address,
.pos-delivery-phone {
  font-size: 0.9rem;
  color: #4b5563;
}

.pos-delivery-items {
  list-style: none;
  margin: 0;
  padding: 0.5rem 0 0;
  border-top: 1px solid #f3f4f6;
}

.pos-delivery-line {
  padding: 0.2rem 0;
  font-size: 0.92rem;
}

.pos-delivery-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: auto;
  padding-top: 0.75rem;
  border-top: 1px solid #f3f4f6;
}

.pos-delivery-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
}

.pos-delivery-deliver-btn {
  animation: kitchen-ready-pulse 1.4s ease-in-out infinite;
}

.pos-delivery-empty {
  text-align: center;
  padding: 3rem 1rem;
  color: #6b7280;
}

.pos-delivery-approve {
  background: #fffbeb;
  border-radius: 8px;
  padding: 0.75rem;
}

/* Tables (in settings) */
.pos-table-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.pos-table-btn {
  border: 2px solid #e5e7eb;
  border-radius: 10px;
  padding: 0.5rem 0.35rem;
  background: #f9fafb;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
  font-size: 0.75rem;
}

.pos-table-btn.status-free {
  border-color: #22c55e;
}

.pos-table-btn.status-occupied {
  border-color: #ef4444;
  background: #fef2f2;
}

.pos-table-btn.selected {
  outline: 3px solid #166534;
}

.pos-hub-setup {
  margin-bottom: 0.75rem;
}

.local-hub-download-wrap {
  margin-bottom: 0.75rem;
}

.local-hub-download .local-hub-download-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-bottom: 0.35rem;
}

.local-hub-cmd-label {
  margin-top: 0.75rem;
  margin-bottom: 0.35rem;
}

.local-hub-install-cmd {
  margin: 0 0 0.75rem;
  padding: 0.75rem 1rem;
  font-family: ui-monospace, Consolas, monospace;
  font-size: 0.82rem;
  line-height: 1.45;
  background: var(--surface-muted, #f3f4f6);
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 8px;
  overflow-x: auto;
  white-space: pre;
  text-align: left;
}

.local-hub-steps {
  margin: 0.5rem 0 0;
  padding-right: 1.25rem;
  text-align: right;
}

.local-hub-update-notice {
  margin-bottom: 0.75rem;
}

.local-hub-update-msg {
  margin: 0;
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  background: #fffbeb;
  border: 1px solid #fcd34d;
  color: #92400e;
  font-size: 0.875rem;
}

.pos-channel-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.pos-channel-order {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 0.75rem 1rem;
}

.pos-channel-head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}

.pos-channel-badge {
  background: #dbeafe;
  color: #1e40af;
  font-size: 0.75rem;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
}

/* KDS */
.kds-ticket-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}

.kds-ticket {
  background: #1e293b;
  color: #f8fafc;
  border-radius: 12px;
  padding: 1rem;
  border-left: 6px solid #f59e0b;
}

.kds-ticket.status-preparing {
  border-left-color: #f59e0b;
}

.kds-ticket.status-ready {
  border-left-color: #22c55e;
}

.kds-ticket-head {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.75rem;
  font-size: 1.1rem;
}

.kds-ticket-items {
  list-style: none;
  padding: 0;
  margin: 0 0 1rem;
}

.kds-ticket-items li {
  padding: 0.25rem 0;
}

.kds-empty {
  text-align: center;
  padding: 3rem;
  color: #6b7280;
}

.kds-station-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  background: #0f172a;
  border-bottom: 1px solid #334155;
}

.kds-station-tab {
  border: 1px solid #475569;
  background: #1e293b;
  color: #e2e8f0;
  border-radius: 999px;
  padding: 0.35rem 0.9rem;
  cursor: pointer;
  font-size: 0.9rem;
}

.kds-station-tab.active {
  background: #f59e0b;
  border-color: #f59e0b;
  color: #1e293b;
  font-weight: 600;
}

.kds-station-label {
  display: inline-block;
  padding: 0.5rem 1rem;
  color: #cbd5e1;
  font-size: 0.95rem;
}

.kds-live-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-inline-start: 0.5rem;
  border-radius: 50%;
  vertical-align: middle;
}

.kds-live-dot.kds-live-on {
  background: #22c55e;
  box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.35);
}

.kds-live-dot.kds-live-off {
  background: #94a3b8;
}

.cart-kitchen-ready-badge {
  display: inline-block;
  margin-inline-start: 0.35rem;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  background: #dcfce7;
  color: #166534;
  font-size: 0.72rem;
  font-weight: 700;
  white-space: nowrap;
}

.cart-kitchen-served-badge {
  display: inline-block;
  margin-inline-start: 0.35rem;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  background: #e0e7ff;
  color: #3730a3;
  font-size: 0.72rem;
  font-weight: 700;
  white-space: nowrap;
}

.waiter-cart-line.served-line {
  opacity: 0.88;
}

.waiter-deliver-ready-btn,
.pos-deliver-ready-btn {
  animation: kitchen-ready-pulse 1.4s ease-in-out infinite;
  box-shadow: 0 0 0 2px #22c55e66;
}

@keyframes kitchen-ready-pulse {
  0%,
  100% {
    box-shadow: 0 0 0 2px #22c55e44;
  }
  50% {
    box-shadow: 0 0 0 6px #22c55e22;
  }
}

.kds-stations-setup-card {
  margin-top: 1rem;
  padding: 1.25rem;
}

.kds-stations-setup-card .form-actions {
  margin-top: 1rem;
  padding-top: 0;
}

.kds-stations-editor {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.kds-station-row {
  display: grid;
  grid-template-columns: 1fr minmax(80px, 120px) auto;
  gap: 0.5rem;
  align-items: center;
}

.pos-settings-card {
  margin-top: 1rem;
  padding: 1.25rem;
}

.pos-payment-methods-editor {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin: 0.75rem 0;
}

.pos-pay-method-row {
  display: grid;
  grid-template-columns: 52px 1fr minmax(80px, 120px) auto auto;
  gap: 0.5rem;
  align-items: center;
}

.pos-pay-method-icon {
  text-align: center;
}

.pos-pay-method-enabled-row {
  margin: 0;
  white-space: nowrap;
  font-size: 0.85rem;
}

@media (max-width: 720px) {
  .pos-pay-method-row {
    grid-template-columns: 1fr 1fr;
  }
  .pos-pay-method-icon {
    grid-column: 1;
  }
  .pos-pay-method-label {
    grid-column: 2;
  }
  .pos-pay-method-id {
    grid-column: 1 / -1;
  }
}

.kds-channel-badge {
  background: #fef3c7;
  color: #92400e;
  font-size: 0.75rem;
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  margin-inline-start: 0.35rem;
}

.waiter-standalone {
  min-height: 100vh;
  background: #f3f4f6;
}

.waiter-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem;
  background: #1a1a2e;
  color: #fff;
}

.waiter-header h1 {
  margin: 0;
  font-size: 1.25rem;
  flex: 1;
}

.waiter-grid {
  padding: 1rem;
}

.waiter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
  gap: 0.65rem;
  padding: 1rem;
}

.waiter-order-sheet {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.waiter-order-sheet.hidden {
  display: none;
}

.waiter-sheet-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
}

.waiter-sheet-panel {
  position: relative;
  width: 100%;
  max-width: 520px;
  max-height: 92vh;
  overflow-y: auto;
  border-radius: 20px 20px 0 0;
  padding: 1rem 1rem 1.25rem;
  margin: 0;
}

.waiter-sheet-head {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.waiter-sheet-head h2 {
  margin: 0;
  font-size: 1.05rem;
  flex: 1;
}

.waiter-section-label {
  margin: 0 0 0.5rem;
  font-size: 0.85rem;
  font-weight: 700;
  color: #166534;
}

.waiter-cart-section {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 14px;
  padding: 0.75rem;
  margin-bottom: 0.85rem;
}

.waiter-cart-lines {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  max-height: 140px;
  overflow-y: auto;
}

.waiter-cart-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.88rem;
  padding: 0.35rem 0;
  border-bottom: 1px solid #dcfce7;
}

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

.waiter-cart-total {
  display: flex;
  justify-content: space-between;
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px solid #bbf7d0;
  font-weight: 700;
}

.waiter-cat-tabs {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.35rem;
  overflow-x: auto;
  margin-bottom: 0.5rem;
  padding-bottom: 0.15rem;
}

.waiter-cat-tab {
  flex: 0 0 auto;
  border: 1px solid #e5e7eb;
  background: #fff;
  border-radius: 999px;
  padding: 0.35rem 0.75rem;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
}

.waiter-cat-tab.active {
  background: #166534;
  border-color: #166534;
  color: #fff;
}

.waiter-item-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 0.45rem;
  max-height: 220px;
  overflow-y: auto;
  margin-bottom: 0.85rem;
}

.waiter-item-btn {
  border: 1px solid #e5e7eb;
  background: #fff;
  border-radius: 12px;
  padding: 0.55rem 0.4rem;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  min-height: 64px;
}

.waiter-item-btn:active {
  background: #ecfdf5;
  border-color: #86efac;
}

.waiter-item-name {
  font-size: 0.78rem;
  font-weight: 600;
  text-align: center;
  line-height: 1.2;
}

.waiter-item-price {
  font-size: 0.72rem;
  color: #166534;
  font-weight: 700;
}

.waiter-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}

.waiter-actions .btn-primary {
  grid-column: 1 / -1;
}

.waiter-pick-table {
  min-height: 80px;
}

.waiter-pick-table.waiter-called {
  border-color: #f59e0b !important;
  background: linear-gradient(145deg, #fffbeb 0%, #fff 70%) !important;
  animation: waiterTablePulse 1.5s ease-in-out infinite;
}

@keyframes waiterTablePulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.35); }
  50% { box-shadow: 0 0 0 8px rgba(245, 158, 11, 0); }
}

.btn-sm {
  padding: 0.35rem 0.75rem;
  font-size: 0.85rem;
}

/* POS table picker — select only */
.pos-table-picker {
  background: linear-gradient(135deg, #f0fdf4 0%, #fff 55%);
  border: 1px solid #bbf7d0;
  border-radius: 16px;
  padding: 0.75rem 0.85rem 0.85rem;
  margin-bottom: 0.5rem;
}

.pos-table-picker.hidden {
  display: none;
}

.pos-table-picker-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.65rem;
}

.pos-table-picker-label {
  font-size: 0.9rem;
  font-weight: 700;
  color: #166534;
}

.pos-floor-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.pos-floor-tabs.hidden {
  display: none;
}

.pos-floor-tab {
  border: 1px solid #d1d5db;
  background: #fff;
  color: #4b5563;
  border-radius: 999px;
  padding: 0.3rem 0.75rem;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
}

.pos-floor-tab.active {
  background: #166534;
  border-color: #166534;
  color: #fff;
}

.pos-table-picker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(76px, 1fr));
  gap: 0.5rem;
}

.pos-pick-table {
  position: relative;
  border: 2px solid #d1fae5;
  background: #fff;
  border-radius: 14px;
  min-height: 72px;
  padding: 0.55rem 0.35rem 0.45rem;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
  transition: transform 0.12s ease, box-shadow 0.12s ease, border-color 0.12s ease;
}

.pos-pick-table:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(22, 101, 52, 0.12);
}

.pos-pick-table.selected {
  border-color: #166534;
  background: #ecfdf5;
  box-shadow: 0 0 0 3px rgba(22, 101, 52, 0.2);
}

.pos-pick-table.status-busy {
  border-color: #fecaca;
  background: #fff5f5;
}

.pos-pick-table.status-bill {
  border-color: #fed7aa;
  background: #fffbeb;
}

.pos-pick-table-num {
  font-size: 1.25rem;
  font-weight: 800;
  color: #111827;
  line-height: 1;
}

.pos-pick-table-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
}

.pos-pick-table.status-busy .pos-pick-table-dot {
  background: #ef4444;
}

.pos-pick-table.status-bill .pos-pick-table-dot {
  background: #f97316;
}

.pos-pick-table-hint {
  font-size: 0.65rem;
  font-weight: 600;
  color: #6b7280;
}

.pos-tables-empty {
  margin: 0.5rem 0 0;
  text-align: center;
  font-size: 0.85rem;
  color: #6b7280;
}

.pos-tables-empty.hidden {
  display: none;
}

.pos-link-btn {
  border: 0;
  background: none;
  color: #166534;
  font-weight: 700;
  cursor: pointer;
  text-decoration: underline;
  padding: 0;
  font-size: inherit;
}

.pos-session-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-inline: auto;
}

.pos-session-status {
  font-size: 0.82rem;
  font-weight: 700;
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
}

.pos-session-status.pos-session-open {
  background: rgba(22, 101, 52, 0.15);
  color: #166534;
}

.pos-session-status.pos-session-closed {
  background: rgba(180, 83, 9, 0.12);
  color: #b45309;
}

.pos-session-btn {
  font-size: 0.82rem;
}

.pos-pay-methods.pos-pay-disabled,
.pos-pay-open-btn.pos-pay-disabled {
  opacity: 0.45;
  pointer-events: none;
}

.pos-print-receipt-btn {
  width: 100%;
  margin-top: 0.35rem;
  border-color: #86efac;
  background: #f0fdf4;
  color: #166534;
  font-weight: 800;
}

.pos-receipt-settings {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid #e5e7eb;
}

.pos-settings-subtitle {
  margin: 0 0 0.65rem;
  font-size: 0.92rem;
  font-weight: 800;
  color: #111827;
}

.pos-setting-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 0.5rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: #374151;
}

.pos-setting-field .input {
  width: 100%;
}

.pos-print-receipt-btn:hover {
  background: #dcfce7;
}

.pos-orders-tabs {
  display: flex;
  gap: 0.25rem;
  margin-right: auto;
  margin-bottom: 0.75rem;
}

.pos-orders-tab {
  border: 1px solid #d1d5db;
  background: #fff;
  color: #374151;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.2rem 0.45rem;
  border-radius: 999px;
  cursor: pointer;
}

.pos-orders-tab.active {
  background: #166534;
  border-color: #166534;
  color: #fff;
}

.pos-paid-card.is-refunded {
  opacity: 0.65;
  border-color: #fca5a5;
}

.pos-paid-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.35rem;
}

.pos-print-btn,
.pos-refund-btn,
.pos-paid-method-btn {
  flex: 1 1 calc(50% - 0.2rem);
  border-radius: 8px;
  padding: 0.35rem;
  font-weight: 700;
  cursor: pointer;
  font-size: 0.82rem;
}

.pos-paid-method-btn {
  border: 1px solid #bfdbfe;
  background: #eff6ff;
  color: #1d4ed8;
}

.pos-refund-confirm-btn {
  background: #b91c1c;
  border-color: #b91c1c;
}

.pos-print-btn {
  border: 1px solid #bbf7d0;
  background: #f0fdf4;
  color: #166534;
}

.pos-refund-btn {
  margin-top: 0;
  width: auto;
  border: 1px solid #fecaca;
  background: #fef2f2;
  color: #b91c1c;
}

.pos-session-stats {
  margin-bottom: 0.75rem;
}

.pos-orders-empty {
  padding: 0.75rem;
  text-align: center;
}
