/* Staff Counter POS Layout — BLAB Design System */
html.staff-order-mode #store-header-box,
html.staff-order-mode #dining-option-wrapper,
html.staff-order-mode #checkout-dining-option-group,
html.staff-order-mode #dinein-table-input-group,
html.staff-order-mode #staff-bar-legend,
html.staff-order-mode .powered-by-blab-wrap,
html.staff-order-mode #desktop-auth-bar,
html.staff-order-mode #desktop-center-auth-overlay,
html.staff-order-mode #pickup-time-dinein-notice,
html.staff-order-mode #pickup-time-asap-notice,
html.staff-order-mode #pickup-time-section-title,
html.staff-order-mode #sec-checkout > .checkout-section-title,
html.staff-order-mode .footer {
  display: none !important;
}

html.staff-order-mode,
html.staff-order-mode body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: #f1f5f9;
  color: #0f172a;
  overscroll-behavior: none;
}

html.staff-order-mode #page-body-content {
  max-width: 100%;
  height: 100%;
  margin: 0 auto;
  padding: 6px 10px 8px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 0;
  overflow: hidden;
}

@media (min-width: 700px) {
  html.staff-order-mode,
  html.staff-order-mode body {
    height: 100% !important;
    overflow: hidden !important;
  }

  html.staff-order-mode #page-body-content {
    height: 100% !important;
    overflow: hidden !important;
  }
}

/* 1. Top Table & Dining Mode Bar (Inside Left Menu Column) */
html.staff-order-mode #staff-table-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  background: #ffffff;
  border: none;
  border-bottom: 1px solid #e2e8f0;
  border-radius: 0;
  padding: 8px 10px;
  box-shadow: none;
  flex-shrink: 0;
  overflow-x: auto;
}

html.staff-order-mode .staff-table-chips {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  flex: 1;
  min-width: 0;
}

/* Centered table number inside chip */
html.staff-order-mode .staff-chip {
  min-width: 48px;
  min-height: 48px;
  padding: 6px 13px;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  color: #334155;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 6px;
  transition: all 0.14s ease;
  user-select: none;
  line-height: 1.2;
  box-sizing: border-box;
}

html.staff-order-mode .staff-chip:hover {
  border-color: #cbd5e1;
  background: #f1f5f9;
}

html.staff-order-mode .staff-chip.on {
  background: #0f172a;
  border-color: #0f172a;
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.14);
}

html.staff-order-mode .staff-dot-occupied {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: #f59e0b;
  display: inline-block;
  flex-shrink: 0;
  pointer-events: none;
}

html.staff-order-mode #dinein-table-input-group {
  margin: 0 !important;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  padding: 0;
  border: none;
  box-shadow: none;
  background: transparent;
}

html.staff-order-mode #dinein-table-input-group > label {
  display: none !important;
}

html.staff-order-mode #dinein-table-number {
  width: auto;
  min-width: 128px;
  min-height: 48px;
  height: 48px;
  padding: 4px 28px 4px 10px;
  font-size: 13px;
  font-weight: 700;
  color: #0f172a;
  background-color: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  cursor: pointer;
}

html.staff-order-mode .staff-bar-legend {
  margin-left: auto;
  font-size: 12px;
  font-weight: 600;
  color: #64748b;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}

/* 2. Two-Column Counter Workspace */
html.staff-order-mode .container.main-order-layout {
  max-width: none !important;
  width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 10px !important;
  flex: 1;
  min-height: 0;
  box-sizing: border-box !important;
}

@media (min-width: 700px) {
  html.staff-order-mode .container.main-order-layout {
    flex-direction: row !important;
    align-items: stretch !important;
    gap: 10px !important;
    overflow: hidden !important;
    height: 100% !important;
    max-height: 100% !important;
  }

  html.staff-order-mode .menu-catalog-col {
    height: 100% !important;
    max-height: 100% !important;
    align-self: stretch !important;
  }
}

/* Left Column: Category Tabs + Tile Grid */
html.staff-order-mode .menu-catalog-col {
  flex: 1;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
}

html.staff-order-mode #main-nav.sticky-nav {
  position: static !important;
  top: auto !important;
  margin: 0 !important;
  padding: 6px 8px !important;
  background: #ffffff !important;
  border-bottom: 1px solid #e2e8f0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  display: flex;
  align-items: center;
  justify-content: flex-start !important;
  gap: 6px;
  overflow-x: auto;
  flex-shrink: 0;
}

html.staff-order-mode #main-nav .nav-btn {
  min-height: 38px;
  padding: 4px 12px !important;
  font-size: 13px !important;
  font-weight: 700 !important;
  border-radius: 8px !important;
  border: 1px solid #e2e8f0 !important;
  background: #f8fafc !important;
  color: #475569 !important;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.02) !important;
  transition: all 0.14s ease;
  user-select: none;
}

html.staff-order-mode #main-nav .nav-btn:hover {
  background: #f1f5f9 !important;
  border-color: #cbd5e1 !important;
  color: #0f172a !important;
}

html.staff-order-mode #main-nav .nav-btn.active {
  background: #ecfdf5 !important;
  color: #059669 !important;
  border-color: #10b981 !important;
  box-shadow: 0 1px 3px rgba(16, 185, 129, 0.15) !important;
}

html.staff-order-mode .catalog-sections-wrapper {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 10px;
}

html.staff-order-mode #catalog-sections .section-container {
  margin: 0 !important;
  padding: 0 !important;
  border: none !important;
  box-shadow: none !important;
  background: transparent !important;
}

html.staff-order-mode #catalog-sections .section-container.staff-tab-hidden {
  display: none !important;
}

html.staff-order-mode #catalog-sections .section-container:not(#sec-order-option) > .section-title {
  display: none !important;
}

/* Counter Dish Tile Grid — Compact, non-stretching layout */
html.staff-order-mode #catalog-sections .grid {
  display: grid !important;
  grid-template-columns: repeat(auto-fill, minmax(116px, 1fr)) !important;
  gap: 8px !important;
  align-content: start !important;
  align-items: start !important;
}

html.staff-order-mode #catalog-sections .card {
  position: relative;
  margin: 0 !important;
  padding: 8px 10px !important;
  border-radius: 10px !important;
  border: 1px solid #e2e8f0 !important;
  background: #ffffff !important;
  box-shadow: none !important;
  transition: border-color 0.12s ease, background-color 0.12s ease, transform 0.08s ease;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 64px !important;
  height: auto !important;
  box-sizing: border-box;
}

html.staff-order-mode #catalog-sections .card:active {
  transform: scale(0.985);
}

html.staff-order-mode #catalog-sections .card.staff-tile-has {
  border-color: var(--primary, #059669) !important;
  background: #f0fdf4 !important;
}

html.staff-order-mode #catalog-sections .card .item-img,
html.staff-order-mode #catalog-sections .card .qty-control,
html.staff-order-mode #catalog-sections .card .customize-btn,
html.staff-order-mode #catalog-sections .card .bundle-edit-btn,
html.staff-order-mode #catalog-sections .card [id^="combo-container-"] {
  display: none !important;
}

html.staff-order-mode .staff-tile-badges {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 3px;
  min-width: 0;
  margin-top: 2px;
}

html.staff-order-mode .staff-tile-badges .badge {
  display: inline-block;
  box-sizing: border-box;
  max-width: 100%;
  margin: 0;
  font-size: 10px !important;
  padding: 1px 5px !important;
  border-radius: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}

html.staff-order-mode #catalog-sections .card .card-main {
  display: flex !important;
  flex-direction: column !important;
  justify-content: space-between !important;
  min-height: 48px;
  height: 100%;
  padding: 0 !important;
  gap: 4px !important;
}

html.staff-order-mode #catalog-sections .card .card-info {
  display: flex !important;
  flex-direction: column !important;
  justify-content: space-between !important;
  height: 100%;
  width: 100%;
  gap: 4px;
}

html.staff-order-mode #catalog-sections .card .card-title {
  font-size: 13.5px !important;
  font-weight: 700 !important;
  color: #0f172a !important;
  line-height: 1.25 !important;
  min-height: 32px;
  max-height: 34px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  padding-right: 20px;
}

html.staff-order-mode #catalog-sections .card .card-info > div:first-child > div:not(.card-title) {
  display: none !important;
}

html.staff-order-mode #catalog-sections .card .card-footer {
  margin-top: 2px !important;
  padding-top: 0 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 4px;
  flex-wrap: wrap;
}

html.staff-order-mode #catalog-sections .card .card-footer > div:not(.card-price):not(.qty-control) {
  flex-shrink: 0;
  white-space: nowrap;
  font-size: 11px !important;
  padding: 3px 6px !important;
  line-height: 1.4;
}

html.staff-order-mode #catalog-sections .card .card-price {
  font-size: 13px !important;
  font-weight: 800 !important;
  color: #059669 !important;
}

html.staff-order-mode .staff-tile-qty {
  position: absolute;
  top: 6px;
  right: 6px;
  min-width: 20px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--primary, #059669);
  color: #ffffff;
  font-size: 10.5px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

html.staff-order-mode .staff-tile-req {
  font-size: 10px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 4px;
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #e2e8f0;
  margin-left: auto;
  white-space: nowrap;
}

/* Right Column: Counter Cart Panel */
html.staff-order-mode .checkout-sidebar-col {
  width: 100%;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  min-height: 0;
  position: static !important;
  top: auto !important;
  padding: 0 !important;
  margin: 0 !important;
  z-index: auto !important;
}

@media (min-width: 700px) {
  html.staff-order-mode .checkout-sidebar-col {
    width: 300px !important;
    max-width: 300px !important;
    height: 100% !important;
    max-height: 100% !important;
    align-self: stretch !important;
    flex: 0 0 300px !important;
  }

  html.staff-order-mode #sec-checkout.checkout-sidebar-card {
    height: 100% !important;
    max-height: 100% !important;
    flex: 1 1 0px !important;
  }
}

html.staff-order-mode #sec-checkout.checkout-sidebar-card {
  animation: none !important;
  transform: none !important;
  position: static !important;
  top: auto !important;
  margin: 0 !important;
  padding: 10px !important;
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 12px !important;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03) !important;
  display: flex !important;
  flex-direction: column !important;
  flex: 1;
  min-height: 0;
  overflow: hidden !important;
  box-sizing: border-box !important;
}

html.staff-order-mode #staff-cart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-bottom: 4px;
  flex-shrink: 0;
}

html.staff-order-mode #staff-cart-target {
  font-size: 14px;
  font-weight: 800;
  color: #0f172a;
}

html.staff-order-mode #staff-cart-round {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 999px;
  background: #fffbeb;
  color: #b45309;
  border: 1px solid #fde68a;
  white-space: nowrap;
}

html.staff-order-mode #staff-order-status {
  display: none !important;
}

@keyframes staffAttentionPulse {
  0% {
    background-color: #fef2f2;
    box-shadow: inset 0 0 0 2px #ef4444;
  }
  50% {
    background-color: #fee2e2;
    box-shadow: inset 0 0 0 2px #dc2626;
  }
  100% {
    background-color: #ffffff;
    box-shadow: inset 0 0 0 0 transparent;
  }
}

html.staff-order-mode #staff-table-bar.staff-attention-pulse {
  animation: staffAttentionPulse 1s ease;
}

html.staff-order-mode .staff-toast {
  position: fixed;
  top: 14px;
  left: 50%;
  transform: translateX(-50%) translateY(-24px);
  z-index: 999999;
  max-width: min(92vw, 440px);
  padding: 10px 18px;
  border-radius: 10px;
  background: #0f172a;
  color: #ffffff;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.4;
  text-align: center;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.28);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s cubic-bezier(0.16, 1, 0.3, 1), transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

html.staff-order-mode .staff-toast.staff-toast-show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

html.staff-order-mode .staff-toast-warning {
  background: #d97706 !important;
  color: #ffffff !important;
}

html.staff-order-mode .staff-toast-error {
  background: #dc2626 !important;
  color: #ffffff !important;
}

html.staff-order-mode .staff-toast-success {
  background: #059669 !important;
  color: #ffffff !important;
}

html.staff-order-mode .staff-cart-order-options {
  margin-top: 6px;
  padding: 6px 0;
  border-top: 1px dashed #e2e8f0;
  display: grid;
  gap: 3px;
}

html.staff-order-mode .staff-cart-order-group {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 6px;
  font-size: 11px;
  color: #64748b;
}

html.staff-order-mode .staff-cart-order-label {
  font-weight: 600;
  color: #475569;
}

html.staff-order-mode .staff-cart-order-choice {
  display: flex;
  align-items: baseline;
  gap: 4px;
  font-weight: 700;
  color: #0f172a;
}

html.staff-order-mode .staff-cart-order-extra {
  color: #059669;
}

html.staff-order-mode #pickup-time-section {
  margin: 0 !important;
  flex-shrink: 0;
}

html.staff-order-mode #pickup-time-picker-group {
  margin-bottom: 6px !important;
}

html.staff-order-mode #pickup-time-picker-group > label {
  display: none !important;
}

html.staff-order-mode .pickup-time-trigger-card {
  padding: 6px 8px !important;
  border-radius: 8px !important;
  min-height: 34px !important;
}

/* Scrollable Cart Summary that flexes and never pushes the submit button */
html.staff-order-mode #cart-summary {
  flex: 1 1 0px !important;
  min-height: 0 !important;
  overflow-y: auto !important;
  margin: 0 !important;
  padding: 2px 0 !important;
  border: none !important;
  box-shadow: none !important;
  background: transparent !important;
  border-radius: 0 !important;
}

html.staff-order-mode .staff-cart-empty {
  padding: 24px 10px;
  text-align: center;
  font-size: 12.5px;
  font-weight: 600;
  color: #94a3b8;
}

html.staff-order-mode .staff-cart-line {
  padding: 6px 0;
  border-bottom: 1px solid #f1f5f9;
}

html.staff-order-mode .staff-cart-line.staff-cart-has-opts {
  cursor: pointer;
  border-radius: 6px;
  padding: 6px 4px;
  margin: 0 -4px;
  transition: background-color 0.12s ease;
}

html.staff-order-mode .staff-cart-line.staff-cart-has-opts:hover {
  background-color: #f8fafc;
}

html.staff-order-mode .staff-cart-line.staff-cart-has-opts:hover .staff-cart-name {
  color: var(--primary, #059669);
}

html.staff-order-mode .staff-cart-line.staff-cart-has-opts:hover .staff-cart-opt-link {
  text-decoration: underline;
}

html.staff-order-mode .staff-cart-line .staff-cart-stepper {
  cursor: default;
}

html.staff-order-mode .staff-cart-line-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

html.staff-order-mode .staff-cart-line-info {
  flex: 1;
  min-width: 0;
}

html.staff-order-mode .staff-cart-name {
  font-size: 13px;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

html.staff-order-mode .staff-cart-price {
  font-size: 12px;
  font-weight: 700;
  color: #059669;
  margin-top: 1px;
}

html.staff-order-mode .staff-cart-stepper {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

html.staff-order-mode .staff-step-btn {
  width: 28px !important;
  height: 28px !important;
  min-width: 28px !important;
  min-height: 28px !important;
  padding: 0 !important;
  border-radius: 6px;
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  color: #0f172a;
  font-size: 14px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  user-select: none;
}

html.staff-order-mode .staff-step-btn:hover {
  background: #f1f5f9;
}

html.staff-order-mode .staff-step-qty {
  min-width: 18px;
  text-align: center;
  font-size: 13px;
  font-weight: 700;
  color: #0f172a;
}

html.staff-order-mode .staff-cart-portions {
  margin-top: 2px;
  display: flex;
  flex-direction: column;
}

html.staff-order-mode .staff-cart-portion-group {
  display: none !important;
}

html.staff-order-mode .staff-cart-opt-link {
  min-width: auto;
  margin-top: 2px;
  padding: 1px 0;
  min-height: 20px !important;
  border: none;
  background: none;
  color: #059669;
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  text-align: left;
  display: inline-flex;
  align-items: center;
}

/* Collapsible Note — Text-only toggle (no box border) */
html.staff-order-mode #staff-note-wrap {
  padding-top: 4px;
  border-top: 1px solid #f1f5f9;
  flex-shrink: 0;
}

html.staff-order-mode #staff-note-toggle {
  min-height: 24px !important;
  min-width: auto !important;
  padding: 2px 0 !important;
  border: none !important;
  border-radius: 0 !important;
  background: transparent !important;
  color: #64748b !important;
  font-size: 12px !important;
  font-weight: 700 !important;
  cursor: pointer !important;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

html.staff-order-mode #staff-note-toggle:hover {
  color: #0f172a !important;
}

html.staff-order-mode #note {
  margin-top: 4px;
  padding: 6px 8px !important;
  font-size: 12.5px !important;
  min-height: 36px !important;
  height: 36px;
  border-radius: 8px !important;
  resize: none;
}

html.staff-order-mode #staff-note-wrap:not(.staff-note-open) #note {
  display: none !important;
}

/* Pinned Submit Footer — Always visible at bottom */
html.staff-order-mode .desktop-sidebar-submit-wrap {
  display: flex !important;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px !important;
  padding-top: 8px !important;
  border-top: 1px solid #e2e8f0 !important;
  flex-shrink: 0 !important;
}

html.staff-order-mode .desktop-sidebar-total-row {
  display: flex !important;
  align-items: baseline;
  justify-content: space-between !important;
  margin: 0 !important;
}

html.staff-order-mode #staff-cart-count {
  font-size: 12.5px;
  font-weight: 600;
  color: #64748b;
}

html.staff-order-mode .desktop-sidebar-price {
  font-size: 21px !important;
  font-weight: 900 !important;
  color: #0f172a !important;
}

html.staff-order-mode #btn-desktop-submit {
  display: flex !important;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 48px !important;
  padding: 10px 14px !important;
  border-radius: 10px !important;
  font-size: 14.5px !important;
  font-weight: 800 !important;
  border: none;
  background: var(--primary, #059669);
  color: #fff;
  cursor: pointer;
  flex-shrink: 0;
}

html.staff-order-mode #staff-access-error {
  max-width: 480px;
  margin: 15vh auto;
  padding: 24px;
  font-family: sans-serif;
}

@media (max-width: 699px) {
  html.staff-order-mode #page-body-content {
    padding-bottom: calc(128px + env(safe-area-inset-bottom, 0px));
  }

  html.staff-order-mode .staff-table-chips {
    flex: 1 0 100%;
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  html.staff-order-mode .staff-chip {
    flex-shrink: 0;
  }

  html.staff-order-mode #dinein-table-input-group {
    flex: 1;
    min-width: 0;
  }

  html.staff-order-mode #dinein-table-number {
    width: 100%;
  }

  html.staff-order-mode .desktop-sidebar-submit-wrap {
    position: fixed;
    inset: auto 0 0;
    z-index: 100;
    margin: 0 !important;
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px)) !important;
    background: #fff;
    box-shadow: 0 -4px 16px rgba(15, 23, 42, 0.06);
  }
}
