/**
 * @file bida-commercial-ui.css
 * Stylesheet for Commercial Billiards POS UI Extensions (Lane I2)
 *
 * Covers:
 * - Billiards Reservations dashboard, status badges, and collision warning alerts
 * - Billiards Pricing catalog matrix, active slot indicators, and transparent breakdown
 * - Package and combo selection cards, quota progress bars, and product redemption
 * - Order operations: partial item transfer steppers, move/merge modals, split bill views
 * - Recipe modifiers: size selectors, topping checklists, and cart line chips
 * - Full responsive styling and touch-friendly controls (>= 44px tap targets)
 */

/* ========================================================
   1. STATUS BADGES & GENERAL PILLS
   ======================================================== */

.bida-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.3;
  white-space: nowrap;
  border: 1px solid transparent;
}

.bida-badge-pending {
  background: #fef3c7;
  border-color: #fcd34d;
  color: #92400e;
}

.bida-badge-confirmed {
  background: #e0f2fe;
  border-color: #7dd3fc;
  color: #0369a1;
}

.bida-badge-arrived {
  background: #dcfce7;
  border-color: #86efac;
  color: #15803d;
}

.bida-badge-seated {
  background: #e0e7ff;
  border-color: #a5b4fc;
  color: #4338ca;
}

.bida-badge-cancelled {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #475569;
}

.bida-badge-noshow {
  background: #fee2e2;
  border-color: #fca5a5;
  color: #b91c1c;
}

.bida-badge-completed {
  background: #d1fae5;
  border-color: #6ee7b7;
  color: #047857;
}

/* ========================================================
   2. COLLISION VISUAL WARNING
   ======================================================== */

.bida-collision-warning {
  background: #fff5f5;
  border: 2px solid #ef4444;
  border-radius: 10px;
  padding: 12px 14px;
  margin: 10px 0;
  color: #991b1b;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.15);
  animation: bidaPulseBorder 2s infinite ease-in-out;
}

@keyframes bidaPulseBorder {
  0%, 100% { border-color: #ef4444; box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.2); }
  50% { border-color: #dc2626; box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.2); }
}

.bida-collision-warning .collision-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 700;
  color: #b91c1c;
  margin-bottom: 6px;
}

.bida-collision-warning .collision-header .warning-icon {
  font-size: 18px;
}

.bida-collision-warning p {
  margin: 4px 0;
  font-size: 13px;
  line-height: 1.4;
}

.collision-conflict-list {
  margin: 6px 0 8px 18px;
  padding: 0;
  font-size: 13px;
}

.collision-conflict-list li {
  margin: 3px 0;
}

.collision-action-hint {
  font-size: 12px;
  font-style: italic;
  color: #7f1d1d;
  margin-top: 6px !important;
}

.bida-submit-res.warn-submit {
  background: #dc2626 !important;
  border-color: #b91c1c !important;
  color: #fff !important;
}

/* ========================================================
   3. RESERVATIONS DASHBOARD & CARDS
   ======================================================== */

.bida-reservations-dashboard {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: min(650px, 90vw);
}

.bida-res-dash-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  padding-bottom: 10px;
  border-bottom: 1px solid #e2e8f0;
}

.bida-res-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.bida-tabs-bar {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  padding: 2px;
  border-radius: 8px;
  background: #f1f5f9;
}

.bida-filter-tab {
  border: none;
  background: transparent;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  color: #475569;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.bida-filter-tab:hover {
  color: #0f172a;
  background: #e2e8f0;
}

.bida-filter-tab.active {
  background: #fff;
  color: #0284c7;
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.bida-filter-select {
  padding: 6px 10px;
  border-radius: 6px;
  border: 1px solid #cbd5e1;
  font-size: 13px;
  background: #fff;
  min-height: 36px;
}

.bida-res-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
  max-height: 60vh;
  overflow-y: auto;
  padding: 2px;
}

.bida-res-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 12px;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.bida-res-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
}

.bida-res-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 6px;
  margin-bottom: 8px;
}

.bida-res-customer strong {
  font-size: 15px;
  color: #0f172a;
}

.bida-res-phone {
  display: block;
  font-size: 12px;
  color: #0284c7;
  text-decoration: none;
  margin-top: 2px;
}

.bida-res-card-body {
  font-size: 13px;
  color: #334155;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.bida-res-info-line {
  display: flex;
  justify-content: space-between;
  gap: 4px;
}

.bida-res-info-line .info-label {
  color: #64748b;
}

.bida-deposit-text {
  color: #16a34a;
  font-weight: 600;
}

.bida-res-note {
  margin-top: 4px;
  padding-top: 4px;
  border-top: 1px dashed #e2e8f0;
  color: #64748b;
}

.bida-res-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid #f1f5f9;
}

.bida-seat-btn {
  background: #106c64 !important;
  color: #fff !important;
  font-weight: 600;
}

/* Form controls */
.bida-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.bida-form-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
  font-weight: 500;
}

.bida-form-field span .req {
  color: #dc2626;
}

.bida-quick-chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.bida-duration-chip, .bida-people-chip {
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 12px;
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
}

.bida-duration-chip.active, .bida-people-chip.active {
  background: #106c64;
  color: #fff;
  border-color: #106c64;
}

/* ========================================================
   4. PRICING UI & TRANSPARENT BREAKDOWN
   ======================================================== */

.bida-pricing-catalog {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: min(600px, 90vw);
}

.bida-pricing-tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.bida-pricing-tab {
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.bida-pricing-tab.active {
  background: #106c64;
  color: #fff;
  border-color: #106c64;
  font-weight: 600;
}

.bida-pricing-card {
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 14px;
  background: #fff;
}

.bida-pricing-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
  flex-wrap: wrap;
  gap: 8px;
}

.bida-pricing-header h3 {
  margin: 0;
  font-size: 16px;
  color: #0f172a;
}

.bida-pricing-rules-pill {
  display: flex;
  gap: 6px;
  font-size: 12px;
  background: #f1f5f9;
  padding: 4px 8px;
  border-radius: 6px;
  color: #475569;
}

.bida-slot-row.is-active-slot {
  background: #ecfdf5 !important;
  border-left: 4px solid #10b981;
}

.slot-name-col {
  display: flex;
  align-items: center;
  gap: 6px;
}

.active-pulse-badge {
  font-size: 11px;
  background: #10b981;
  color: #fff;
  padding: 1px 6px;
  border-radius: 4px;
  font-weight: 600;
  animation: bidaFadeInOut 1.5s infinite ease-in-out;
}

@keyframes bidaFadeInOut {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

.bida-rate-highlight {
  color: #0284c7;
  font-size: 15px;
}

/* Pricing Breakdown Modal */
.bida-breakdown-modal {
  min-width: min(550px, 90vw);
}

.bida-breakdown-header-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px;
  border-radius: 10px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
}

.bida-breakdown-table-name {
  display: flex;
  align-items: center;
  gap: 10px;
}

.bida-breakdown-table-name .table-badge {
  font-size: 24px;
}

.bida-breakdown-table-name h3 {
  margin: 0;
  font-size: 16px;
}

.bida-breakdown-table-name p {
  margin: 2px 0 0;
  font-size: 13px;
  color: #64748b;
}

.bida-breakdown-total-hero .hero-amount {
  font-size: 22px;
  color: #106c64;
  display: block;
}

.bida-breakdown-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 10px 0;
}

.stat-box {
  background: #f1f5f9;
  border-radius: 8px;
  padding: 8px 10px;
  text-align: center;
}

.stat-box small {
  display: block;
  font-size: 11px;
  color: #64748b;
}

.stat-box strong {
  font-size: 14px;
  color: #0f172a;
}

.stat-box span {
  display: block;
  font-size: 11px;
  color: #94a3b8;
}

.adjustment-row {
  display: flex;
  justify-content: space-between;
  padding: 6px 10px;
  background: #f8fafc;
  border-radius: 6px;
  font-size: 13px;
}

.adjustment-row.highlight-notice {
  background: #fffbeb;
  border: 1px solid #fde68a;
  color: #92400e;
}

/* ========================================================
   5. PACKAGES & COMBOS UI
   ======================================================== */

.bida-packages-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
  max-height: 60vh;
  overflow-y: auto;
  padding: 2px;
}

.bida-pkg-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 12px;
  background: #fff;
  transition: all 0.15s ease;
}

.bida-pkg-card:hover {
  border-color: #106c64;
  box-shadow: 0 4px 12px rgba(16, 108, 100, 0.12);
}

.bida-pkg-card.selected {
  border: 2px solid #106c64;
  background: #f0fdfa;
}

.bida-pkg-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.bida-pkg-type-pill {
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 4px;
  background: #e2e8f0;
  color: #334155;
  font-weight: 500;
}

.bida-pkg-price {
  font-size: 16px;
  color: #106c64;
}

.bida-pkg-title {
  margin: 4px 0 2px;
  font-size: 15px;
  color: #0f172a;
}

.bida-pkg-desc {
  font-size: 12px;
  color: #64748b;
  margin-bottom: 8px;
}

.bida-pkg-features {
  font-size: 13px;
  margin-bottom: 8px;
}

.pkg-products-list {
  margin: 4px 0 0 16px;
  padding: 0;
  font-size: 12px;
  color: #334155;
}

.bida-pkg-member-tag {
  background: #fef3c7;
  color: #92400e;
  font-size: 11px;
  padding: 3px 6px;
  border-radius: 4px;
  font-weight: 500;
  margin-bottom: 8px;
}

/* Applied Package Widget on Table Context */
.bida-applied-package-widget {
  background: #f0fdfa;
  border: 1px solid #99f6e4;
  border-radius: 8px;
  padding: 10px 12px;
  margin: 8px 0;
}

.bida-pkg-widget-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.bida-pkg-widget-title {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #0f766e;
}

.bida-pkg-progress-wrap {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.bida-progress-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
}

.bida-percent-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 4px;
}

.bida-percent-badge.success { background: #dcfce7; color: #15803d; }
.bida-percent-badge.warning { background: #fef3c7; color: #b45309; }
.bida-percent-badge.danger { background: #fee2e2; color: #b91c1c; }

.bida-progress-track {
  width: 100%;
  height: 10px;
  background: #e2e8f0;
  border-radius: 5px;
  overflow: hidden;
}

.bida-progress-fill {
  height: 100%;
  transition: width 0.3s ease;
}

.bida-progress-fill.success { background: #10b981; }
.bida-progress-fill.warning { background: #f59e0b; }
.bida-progress-fill.danger { background: #ef4444; }

.bida-pkg-products-box {
  margin-top: 8px;
  padding-top: 6px;
  border-top: 1px dashed #ccfbf1;
}

.bida-box-sub {
  font-size: 11px;
  color: #64748b;
  margin-bottom: 4px;
}

.bida-pkg-item-quota-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  padding: 3px 0;
}

/* ========================================================
   6. ORDER OPERATIONS UI (TRANSFERS, MERGE, SPLIT)
   ======================================================== */

.bida-ops-form {
  min-width: min(520px, 90vw);
}

.bida-ops-notice-box {
  display: flex;
  gap: 10px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  padding: 10px;
  font-size: 13px;
  color: #1e40af;
}

.bida-ops-notice-box .box-icon {
  font-size: 20px;
}

.bida-ops-notice-box p {
  margin: 3px 0 0;
  font-size: 12px;
  color: #3b82f6;
}

.bida-ops-item-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #fff;
}

.bida-ops-item-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.bida-transfer-qty-input {
  width: 70px;
  min-height: 38px;
  text-align: center;
  font-size: 15px;
  font-weight: 600;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
}

.bida-all-in-btn {
  min-height: 38px;
}

/* Split Bill Views */
.bida-split-bill-dialog {
  min-width: min(560px, 90vw);
}

.bida-split-tabs-wrap {
  display: flex;
  gap: 6px;
  background: #f1f5f9;
  padding: 3px;
  border-radius: 8px;
}

.bida-split-tab {
  flex: 1;
  border: none;
  background: transparent;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  text-align: center;
  transition: all 0.15s ease;
}

.bida-split-tab.active {
  background: #fff;
  color: #106c64;
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.bida-split-item-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  cursor: pointer;
}

.bida-split-preview-boxes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 10px;
}

.split-preview-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 10px;
  text-align: center;
}

.split-preview-card small {
  display: block;
  font-size: 12px;
  color: #64748b;
}

.split-preview-card strong {
  font-size: 17px;
  color: #106c64;
  margin-top: 4px;
  display: block;
}

.equal-hero-box {
  background: #f0fdfa;
  border: 1px solid #99f6e4;
  border-radius: 8px;
  padding: 14px;
  text-align: center;
}

.equal-hero-box strong {
  font-size: 24px;
  color: #106c64;
  display: block;
  margin-top: 4px;
}

/* ========================================================
   7. RECIPE MODIFIERS & CART LINE CHIPS
   ======================================================== */

.bida-mod-form {
  min-width: min(480px, 90vw);
}

.bida-mod-product-hero {
  padding-bottom: 8px;
  border-bottom: 1px solid #e2e8f0;
}

.bida-mod-product-hero h3 {
  margin: 0;
  font-size: 17px;
}

.bida-mod-scroll-area {
  max-height: 55vh;
  overflow-y: auto;
  padding: 4px 2px;
}

.bida-mod-group-box {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 10px;
  background: #fff;
}

.bida-mod-group-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.req-badge {
  font-size: 11px;
  color: #dc2626;
  background: #fee2e2;
  padding: 1px 6px;
  border-radius: 4px;
}

.opt-badge {
  font-size: 11px;
  color: #64748b;
  background: #f1f5f9;
  padding: 1px 6px;
  border-radius: 4px;
}

.bida-mod-options-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.bida-mod-option-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid #f1f5f9;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s ease;
  min-height: 44px; /* Touch target */
}

.bida-mod-option-row:hover {
  background: #f8fafc;
}

.bida-mod-option-row input:checked ~ .bida-mod-option-body .mod-opt-name {
  font-weight: 600;
  color: #106c64;
}

.bida-mod-option-body {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  font-size: 14px;
}

.mod-opt-price {
  font-weight: 500;
  color: #0284c7;
}

/* Modifiers on Cart Lines */
.cart-line-modifiers {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 3px;
}

.bida-modifier-chip {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  font-weight: 500;
  background: #e0f2fe;
  color: #0369a1;
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid #bae6fd;
}

/* ========================================================
   8. MOBILE RESPONSIVENESS & TOUCH OPTIMIZATIONS
   ======================================================== */

@media (max-width: 640px) {
  .bida-reservations-dashboard,
  .bida-pricing-catalog,
  .bida-breakdown-modal,
  .bida-ops-form,
  .bida-split-bill-dialog,
  .bida-mod-form {
    min-width: 100%;
  }

  .bida-form-grid {
    grid-template-columns: 1fr;
  }

  .bida-res-list {
    grid-template-columns: 1fr;
  }

  .bida-packages-grid {
    grid-template-columns: 1fr;
  }

  .bida-breakdown-stats-grid {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .bida-split-preview-boxes {
    grid-template-columns: 1fr;
  }

  .bida-modal-actions {
    flex-direction: column-reverse;
  }

  .bida-modal-actions .btn {
    width: 100%;
    min-height: 48px;
    font-size: 15px;
  }

  .bida-transfer-qty-input {
    min-height: 44px;
    font-size: 16px;
  }

  .bida-all-in-btn {
    min-height: 44px;
    padding: 0 14px;
  }
}
