/* ==========================================================================
   Ticket Opener & Back-Bar Product Ticket Modals
   ========================================================================== */

.ticket-opener-card {
  max-width: 500px;
  width: 92vw;
  border-radius: 16px;
  border: 1px solid var(--theme-border, #9ab7ce);
  background: linear-gradient(180deg, var(--theme-panel, #c8dcf0) 0%, var(--theme-panel, #bcd4e6) 100%);
  box-shadow: 0 24px 64px color-mix(in srgb, var(--theme-text, #21133d) 28%, transparent);
}

.ticket-opener-options {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px 16px;
}

.ticket-opener-card-button {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
  padding: 16px 18px;
  border: 1.5px solid var(--theme-border, #cad9e6);
  border-radius: 14px;
  background: var(--theme-panel, #ffffff);
  cursor: pointer;
  text-align: left;
  transition: all 0.18s ease;
  box-shadow: 0 4px 12px color-mix(in srgb, var(--theme-text, #21133d) 6%, transparent);
}

.ticket-opener-card-button:hover,
.ticket-opener-card-button:focus-visible {
  border-color: var(--mobile-coral, #ec665c);
  background: #fffbfa;
  transform: translateY(-2px);
  box-shadow: 0 8px 20px color-mix(in srgb, var(--theme-accent, #ec665c) 16%, transparent);
}

.ticket-opener-card-button:active {
  transform: translateY(0);
  background: #fff5f4;
}

.ticket-opener-icon-wrap {
  flex: 0 0 52px;
  width: 52px;
  height: 52px;
  border-radius: 12px;
  display: grid;
  place-items: center;
}

.ticket-opener-icon-wrap.service-icon {
  background: var(--theme-panel, #c3e1f2);
  border: 1px solid var(--theme-border, #9bc7df);
  color: var(--theme-text, #21133d);
}

.ticket-opener-icon-wrap.backbar-icon {
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  border: 1px solid #f59e0b;
  color: #92400e;
}

.ticket-opener-info {
  flex: 1;
  min-width: 0;
}

.ticket-opener-name {
  font-size: 1.08rem;
  font-weight: 800;
  color: var(--theme-text, #21133d);
}

.ticket-opener-desc {
  font-size: 0.8rem;
  color: var(--theme-quiet, #546c86);
  margin-top: 3px;
  line-height: 1.35;
}

.ticket-opener-arrow {
  font-size: 1.35rem;
  color: var(--theme-quiet, #6482a5);
  padding-left: 6px;
  transition: transform 0.18s ease, color 0.18s ease;
}

.ticket-opener-card-button:hover .ticket-opener-arrow {
  color: var(--mobile-coral, #ec665c);
  transform: translateX(3px);
}

.ticket-opener-actions {
  display: flex;
  justify-content: flex-end;
  padding: 0 16px 14px;
  border-top: 0;
}

.ticket-opener-actions .toolbar-button {
  min-height: 34px;
  padding: 0 18px;
  border-radius: 9999px;
  font-weight: 700;
}

/* Back-Bar Ticket Modal */
.backbar-ticket-card {
  max-width: 640px;
  width: 95vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  border-radius: 16px;
  border: 1px solid var(--theme-border, #9ab7ce);
  background: linear-gradient(180deg, var(--theme-panel, #c8dcf0) 0%, var(--theme-panel, #bcd4e6) 100%);
  box-shadow: 0 24px 64px color-mix(in srgb, var(--theme-text, #21133d) 28%, transparent);
  overflow: hidden;
}

.backbar-ticket-body {
  flex: 1;
  overflow-y: auto;
  padding: 12px 14px 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.backbar-meta-row {
  display: flex;
  gap: 14px;
  align-items: flex-end;
  justify-content: space-between;
  padding: 12px 14px;
  border: 1px solid var(--theme-border, #cad9e6);
  border-radius: 12px;
  background: var(--theme-panel, #ffffff);
  box-shadow: 0 2px 6px color-mix(in srgb, var(--theme-text, #21133d) 4%, transparent);
}

.backbar-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.backbar-field span,
.backbar-date-display span {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--theme-quiet, #546c86);
}

.backbar-select {
  height: 38px;
  border-radius: 8px;
  border: 1.5px solid var(--theme-border, #b8cde2);
  background: var(--theme-panel, #ffffff);
  padding: 0 10px;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--theme-text, #21133d);
}

.backbar-date-display {
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: flex-end;
}

.backbar-date-display strong {
  font-size: 0.92rem;
  font-weight: 800;
  color: var(--theme-text, #21133d);
}

.backbar-entry-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--theme-panel, #ffffff);
  border: 1px solid var(--theme-border, #cad9e6);
  border-radius: 12px;
  padding: 12px 14px;
  box-shadow: 0 2px 6px color-mix(in srgb, var(--theme-text, #21133d) 4%, transparent);
}

.backbar-entry-tabs {
  display: flex;
  gap: 6px;
  border-bottom: 1px solid var(--theme-border, #dce7f4);
  padding-bottom: 10px;
}

.backbar-tab-btn {
  min-height: 32px;
  padding: 5px 14px;
  border-radius: 9999px;
  border: 1px solid var(--theme-border, #b8cde2);
  background: var(--theme-panel, #f8fafd);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--theme-text, #21133d);
  cursor: pointer;
  transition: all 0.15s ease;
}

.backbar-tab-btn:hover:not(.is-active) {
  color: var(--theme-text, #21133d);
  background: var(--theme-panel, #eef6fc);
  border-color: var(--theme-accent, #221d3b);
}

.backbar-tab-btn.is-active {
  color: #ffffff;
  background: var(--mobile-coral, #ec665c);
  border-color: var(--mobile-coral, #ec665c);
  box-shadow: 0 2px 6px color-mix(in srgb, var(--theme-accent, #ec665c) 25%, transparent);
}

.backbar-tab-content {
  position: relative;
}

.backbar-input-group {
  position: relative;
  display: flex;
  align-items: center;
}

.backbar-input-icon {
  position: absolute;
  left: 14px;
  color: var(--theme-quiet, #6482a5);
  font-size: 0.9rem;
  pointer-events: none;
}

#backbar-search-input {
  width: 100%;
  height: 40px;
  padding: 0 14px 0 36px;
  border-radius: 9999px;
  border: 1.5px solid var(--theme-border, #b8cde2);
  background: var(--theme-panel, #ffffff);
  font-size: 0.88rem;
  color: var(--theme-text, #21133d);
  box-sizing: border-box;
}

#backbar-search-input:focus {
  outline: none;
  border-color: var(--mobile-coral, #ec665c);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--theme-accent, #ec665c) 16%, transparent);
}

.backbar-search-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 50;
  max-height: 220px;
  overflow-y: auto;
  border-radius: 12px;
  border: 1px solid var(--theme-border, #cad9e6);
  background: var(--theme-panel, #ffffff);
  box-shadow: 0 12px 28px color-mix(in srgb, var(--theme-text, #21133d) 18%, transparent);
  margin-top: 6px;
}

.backbar-search-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 10px 12px;
  border: none;
  border-bottom: 1px solid var(--theme-border, #e4edf6);
  background: none;
  text-align: left;
  cursor: pointer;
}

.backbar-search-item:hover,
.backbar-search-item:focus-visible {
  background: var(--theme-panel, #eef6fc);
}

.backbar-search-empty {
  padding: 14px 12px;
  font-size: 0.8rem;
  color: var(--theme-quiet, #64748b);
  text-align: center;
}

.backbar-brand-chip {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 9999px;
  background: var(--theme-panel, #c3e1f2);
  border: 1px solid var(--theme-border, #9bc7df);
  color: var(--theme-text, #21133d);
  text-transform: uppercase;
}

.backbar-item-meta {
  display: flex;
  gap: 8px;
  font-size: 0.74rem;
  color: var(--theme-quiet, #64748b);
  margin-top: 2px;
}

.backbar-barcode-chip {
  font-family: monospace;
  background: var(--theme-panel, #f1f5f9);
  padding: 1px 6px;
  border-radius: 6px;
}

.backbar-cost-tag {
  color: #059669;
  font-weight: 800;
}

.backbar-add-action {
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--theme-text, #21133d);
  padding: 4px 12px;
  border-radius: 9999px;
  background: var(--theme-panel, #c3e1f2);
  border: 1px solid var(--theme-border, #9bc7df);
}

.backbar-barcode-entry-row {
  display: flex;
  gap: 8px;
}

#backbar-barcode-input {
  flex: 1;
  height: 40px;
  padding: 0 14px;
  border-radius: 9999px;
  border: 1.5px solid var(--theme-border, #b8cde2);
  background: var(--theme-panel, #ffffff);
  font-size: 0.9rem;
  font-family: monospace;
}

.backbar-feedback-note {
  margin-top: 8px;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 600;
}

.backbar-feedback-note.is-success {
  background: #ecfdf5;
  color: #065f46;
  border: 1px solid #a7f3d0;
}

.backbar-feedback-note.is-info {
  background: var(--theme-panel, #eef6fc);
  color: var(--theme-text, #21133d);
  border: 1px solid var(--theme-border, #9bc7df);
}

.backbar-scanner-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.backbar-camera-viewfinder {
  position: relative;
  width: 100%;
  height: 180px;
  background: var(--theme-text, #221d3b);
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

#backbar-scanner-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.backbar-scanner-laser {
  position: absolute;
  top: 50%;
  left: 8%;
  right: 8%;
  height: 2px;
  background: var(--theme-accent, #ec665c);
  box-shadow: 0 0 10px var(--theme-accent, #ec665c);
  animation: backbar-laser-sweep 1.8s ease-in-out infinite alternate;
}

@keyframes backbar-laser-sweep {
  0% { transform: translateY(-40px); opacity: 0.4; }
  100% { transform: translateY(40px); opacity: 1; }
}

.backbar-scanner-overlay-text {
  position: absolute;
  bottom: 8px;
  left: 8px;
  right: 8px;
  background: rgba(34, 29, 59, 0.82);
  color: #ffffff;
  font-size: 0.75rem;
  padding: 4px 10px;
  border-radius: 9999px;
  text-align: center;
}

.backbar-scanner-controls {
  display: flex;
  justify-content: center;
}

.backbar-quick-test-bar {
  margin-top: 4px;
}

.quick-test-label {
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--theme-quiet, #546c86);
  display: block;
  margin-bottom: 4px;
}

.quick-test-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.backbar-test-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 9999px;
  border: 1px solid var(--theme-border, #cad9e6);
  background: var(--theme-panel, #ffffff);
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--theme-text, #21133d);
  cursor: pointer;
  transition: all 0.15s ease;
}

.backbar-test-chip:hover {
  background: var(--theme-panel, #eef6fc);
  border-color: var(--theme-accent, #221d3b);
}

.backbar-test-chip code {
  font-size: 0.68rem;
  background: var(--theme-panel, #f0f6fc);
  padding: 1px 5px;
  border-radius: 6px;
  color: var(--theme-quiet, #46617d);
}

.backbar-ledger-container {
  flex: 1;
  min-height: 140px;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--theme-border, #cad9e6);
  border-radius: 12px;
  background: var(--theme-panel, #ffffff);
  box-shadow: 0 2px 6px color-mix(in srgb, var(--theme-text, #21133d) 4%, transparent);
  overflow: hidden;
}

.backbar-ledger-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  background: linear-gradient(180deg, var(--theme-panel, #d6ebf7) 0%, var(--theme-panel, #c3e1f2) 100%);
  border-bottom: 1px solid var(--theme-border, #9bc7df);
}

.backbar-ledger-header h3 {
  margin: 0;
  font-size: 0.85rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--theme-text, #21133d);
}

.backbar-badge {
  font-size: 0.72rem;
  font-weight: 800;
  padding: 2px 9px;
  border-radius: 9999px;
  background: var(--theme-text, #221d3b);
  color: #ffffff;
}

.backbar-items-table-wrapper {
  flex: 1;
  overflow-y: auto;
  max-height: 220px;
}

.backbar-empty-ledger {
  padding: 28px 16px;
  text-align: center;
  color: var(--theme-quiet, #64748b);
}

.backbar-empty-icon {
  font-size: 2.2rem;
  margin-bottom: 6px;
}

.backbar-empty-hint {
  font-size: 0.76rem;
  color: var(--theme-quiet, #94a3b8);
  margin-top: 4px;
}

.backbar-items-list {
  display: flex;
  flex-direction: column;
}

.backbar-ledger-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-bottom: 1px solid var(--theme-border, #e4edf6);
  gap: 12px;
}

.backbar-ledger-item:last-child {
  border-bottom: none;
}

.backbar-ledger-item-main {
  flex: 1;
  min-width: 0;
}

.backbar-ledger-item-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--theme-text, #21133d);
}

.backbar-ledger-item-sub {
  display: flex;
  gap: 8px;
  font-size: 0.75rem;
  color: var(--theme-quiet, #64748b);
  margin-top: 3px;
}

.backbar-barcode-text {
  font-family: monospace;
}

.backbar-unit-cost {
  color: #047857;
  font-weight: 700;
}

.backbar-ledger-item-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}

.backbar-stepper {
  display: flex;
  align-items: center;
  border: 1px solid var(--theme-border, #b8cde2);
  border-radius: 9999px;
  overflow: hidden;
  background: var(--theme-panel, #ffffff);
}

.backbar-stepper-btn {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border: none;
  background: var(--theme-panel, #eef6fc);
  cursor: pointer;
  font-weight: 800;
  font-size: 0.95rem;
  color: var(--theme-text, #21133d);
  transition: background 0.15s ease;
}

.backbar-stepper-btn:hover {
  background: var(--theme-panel, #c3e1f2);
}

.backbar-stepper-val {
  min-width: 28px;
  text-align: center;
  font-weight: 800;
  font-size: 0.85rem;
  color: var(--theme-text, #21133d);
}

.backbar-line-total {
  min-width: 58px;
  text-align: right;
  font-weight: 800;
  font-size: 0.9rem;
  color: var(--theme-text, #21133d);
}

.backbar-item-remove-btn {
  border: none;
  background: none;
  color: var(--theme-quiet, #94a3b8);
  font-size: 1.25rem;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
  transition: color 0.15s ease;
}

.backbar-item-remove-btn:hover {
  color: var(--mobile-coral, #ec665c);
}

.backbar-ticket-summary-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  border-radius: 12px;
  background: var(--theme-panel, #ffffff);
  border: 1px solid var(--theme-border, #cad9e6);
  box-shadow: 0 2px 6px color-mix(in srgb, var(--theme-text, #21133d) 4%, transparent);
}

.backbar-summary-col {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.summary-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 800;
  color: var(--theme-quiet, #546c86);
}

.summary-val {
  font-size: 1.28rem;
  font-weight: 800;
  color: #059669;
}

.backbar-ticket-actions {
  display: flex;
  gap: 8px;
}

.backbar-ticket-actions .toolbar-button {
  min-height: 36px;
  padding: 0 18px;
  border-radius: 9999px;
  font-weight: 800;
}

.backbar-ticket-actions .primary-button {
  border-color: #b86b11;
  background: linear-gradient(180deg, var(--theme-accent, #e59a38) 0%, var(--theme-accent, #d98c2b) 100%);
  color: #ffffff;
  box-shadow: 0 2px 6px color-mix(in srgb, var(--theme-accent, #ec665c) 25%, transparent);
}

