/* Import Modern Reports CSS */
@import url('reports-modern.css');

/* General Reset */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* Body */
body {
  font-family: 'Inter', sans-serif;
  background-color: #f4f7fc;
  overflow-x: hidden;
}

.time-filter-booking-btn,
.time-filter-report-btn {
  flex: 1;
  min-width: 120px;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: 0.5rem;
  transition: all 0.2s ease;
  text-align: center;
  cursor: pointer;
  background-color: #f3f4f6;
  color: #4b5563;
}

/* Group layout for report buttons */
.time-filter-btn-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center; /* mobile: center */
}

@media (min-width: 768px) {
  .time-filter-btn-group {
    justify-content: flex-start; /* desktop: left */
  }
}

.time-filter-booking-btn.active,
.time-filter-report-btn.active {
  background-color: #0071e3;
  color: #ffffff;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.time-filter-booking-btn:hover,
.time-filter-report-btn:hover {
  background-color: #dbeafe;
  color: #0071e3;
}

.time-filter-booking-btn.active:hover,
.time-filter-report-btn.active:hover {
  background-color: #0071e3;
  color: #ffffff;
}

/* ====================== SPECIFIC SECTIONS FILTERS ====================== */

.booking-filter-container {
  display: flex;
}

@media (max-width: 640px) {
  #customStartDate,
  #customEndDate,
  #customStartBookingDate,
  #customEndBookingDate,
  #customStartReportDate,
  #customEndReportDate {
    width: 100%;
    border: 1.5px solid #d1d5db;
    padding: 8px;
  }
}

/* Buttons: Tạo hóa đơn, Sửa hóa đơn, Thanh toán, Up ảnh */

#reviewInvoiceDetailBtn,
#payInvoiceDetailBtn {
  font-size: 0.9rem;
  padding: 0.5rem 1rem;
  height: 2.25rem;
  min-width: 100px;
  border-radius: 0.5rem;
}

@media (max-width: 640px) {
  #reviewInvoiceDetailBtn,
  #payInvoiceDetailBtn {
    font-size: 0.75rem;
    padding: 0.2rem 0.4rem;
    height: 2rem;
    min-width: 80px;
  }
}

/* ============================================
   Table Container - Fix Overflow
   ============================================ */
#invoicesContent,
#bookingsContent {
  max-width: 100%;
  overflow: hidden;
}

#invoicesContent > .mkt-surface,
#invoicesContent > .overflow-x-auto,
#bookingsContent > .overflow-x-auto {
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* Override table width - let min-width control size */
#invoicesContent #invoicesListTabs,
#bookingsContent #bookingsListTabs {
  width: auto !important;
  min-width: 100%;
  table-layout: auto;
}

/* Time Filter Container Fix */
#invoicesContent .time-filter-container,
#bookingsContent .time-filter-container {
  border-radius: 0.5rem;
  margin-bottom: 0.5rem;
}

/* Invoices Table */
#invoicesListTabs {
  border-collapse: separate;
  border-spacing: 0;
  width: 100%;
}

#invoicesListTabs th,
#invoicesListTabs td {
  padding: 0.75rem;
  text-align: left;
  border-bottom: 1px solid #e5e7eb;
  white-space: nowrap;
  line-height: 1.4;
}

#invoicesListTabs th {
  background-color: #f9fafb;
  font-weight: 600;
  color: #374151;
  font-size: 0.95rem;
}

#invoicesListTabs td {
  font-size: 0.85rem;
}

#invoicesListTabs .status-paid {
  color: #16a34a;
  background-color: #dcfce7;
  padding: 0.25rem 0.5rem;
  border-radius: 0.25rem;
  font-size: 0.75rem;
  display: inline-block;
}

#invoicesListTabs .status-pending {
  color: #0071e3;
  background-color: #eff6ff;
  padding: 0.25rem 0.5rem;
  border-radius: 0.25rem;
  font-size: 0.75rem;
  display: inline-block;
}

/* ============================================
   Reconcile Badges (Đối soát)
   ============================================ */
.reconcile-badge {
  padding: 0.2rem 0.5rem;
  border-radius: 0.25rem;
  font-size: 0.7rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  white-space: nowrap;
}

.reconcile-matched {
  color: #15803d;
  background-color: #dcfce7;
}

.reconcile-unmatched {
  color: #dc2626;
  background-color: #fee2e2;
}

.reconcile-pending {
  color: #6b7280;
  background-color: #f3f4f6;
}

/* Nút đối soát */
#reconcileBtn {
  background-color: rgba(239, 68, 68, 0.14);
  color: #dc2626;
  padding: 0.4rem 0.75rem;
  border-radius: 0.5rem;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

#reconcileBtn:hover {
  background-color: rgba(239, 68, 68, 0.24);
}

#reconcileBtn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Dark mode */
body.mkt192-dark .reconcile-matched {
  color: #86efac;
  background-color: rgba(22, 163, 74, 0.2);
}

body.mkt192-dark .reconcile-unmatched {
  color: #fca5a5;
  background-color: rgba(220, 38, 38, 0.2);
}

body.mkt192-dark .reconcile-pending {
  color: #9ca3af;
  background-color: rgba(107, 114, 128, 0.15);
}

body.mkt192-dark #reconcileBtn {
  background-color: rgba(239, 68, 68, 0.18);
  color: #f87171;
}

body.mkt192-dark #reconcileBtn:hover {
  background-color: rgba(239, 68, 68, 0.3);
}

#invoicesListTabs .detail-btn {
  color: #0071e3;
  cursor: pointer;
  transition: color 0.2s ease;
}

#invoicesListTabs .detail-btn:hover {
  color: #005bb5;
}

#bookingsListTabs .status-success {
  color: #16a34a;
  background-color: #dcfce7;
  padding: 0.25rem 0.5rem;
  border-radius: 0.25rem;
  font-size: 0.75rem;
  display: inline-block;
}

#bookingsListTabs .status-deleted {
  color: #dc2626;
  background-color: #fee2e2;
  padding: 0.25rem 0.5rem;
  border-radius: 0.25rem;
  font-size: 0.75rem;
  display: inline-block;
}

#bookingsListTabs .status-pending {
  color: #0071e3;
  background-color: #eff6ff;
  padding: 0.25rem 0.5rem;
  border-radius: 0.25rem;
  font-size: 0.75rem;
  display: inline-block;
}

#bookingsListTabs .status-waiting {
  color: #d97706;
  background-color: #fef9c3;
  padding: 0.25rem 0.5rem;
  border-radius: 0.25rem;
  font-size: 0.75rem;
  display: inline-block;
}

#bookingsListTabs .status-message-success {
  color: #16a34a;
  background-color: #dcfce7;
  padding: 0.25rem 0.5rem;
  border-radius: 0.25rem;
  font-size: 0.75rem;
  display: inline-block;
}

#bookingsListTabs .status-message-failed {
  color: #dc2626;
  background-color: #fee2e2;
  padding: 0.25rem 0.5rem;
  border-radius: 0.25rem;
  font-size: 0.75rem;
  display: inline-block;
}

#bookingsListTabs .status-reminder-success {
  color: #16a34a;
  background-color: #dcfce7;
  padding: 0.25rem 0.5rem;
  border-radius: 0.25rem;
  font-size: 0.75rem;
  display: inline-block;
}

#bookingsListTabs .status-reminder-deleted {
  color: #dc2626;
  background-color: #fee2e2;
  padding: 0.25rem 0.5rem;
  border-radius: 0.25rem;
  font-size: 0.75rem;
  display: inline-block;
}

#bookingsListTabs .status-reminder-waiting {
  color: #d97706;
  background-color: #fef9c3;
  padding: 0.25rem 0.5rem;
  border-radius: 0.25rem;
  font-size: 0.75rem;
  display: inline-block;
}

#bookingsListTabs .status-reminder-failed {
  color: #dc2626;
  background-color: #fee2e2;
  padding: 0.25rem 0.5rem;
  border-radius: 0.25rem;
  font-size: 0.75rem;
  display: inline-block;
}

#bookingsListTabs .status-cancel-success {
  color: #16a34a;
  background-color: #dcfce7;
  padding: 0.25rem 0.5rem;
  border-radius: 0.25rem;
  font-size: 0.75rem;
  display: inline-block;
}

#bookingsListTabs .status-cancel-failed {
  color: #dc2626;
  background-color: #fee2e2;
  padding: 0.25rem 0.5rem;
  border-radius: 0.25rem;
  font-size: 0.75rem;
  display: inline-block;
}

@media (max-width: 640px) {
  #invoicesListTabs th,
  #invoicesListTabs td {
    padding: 0.5rem;
  }

  #invoicesListTabs th {
    font-size: 0.85rem;
  }

  #invoicesListTabs td {
    font-size: 0.75rem;
  }
}

/* Customer Photos */
.customer-photo {
  height: 80px;
  object-fit: cover;
  border-radius: 0.5rem;
}

/* Customer Info */
#customerInfo .font-semibold.text-gray-800 {
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.4;
}

@media (max-width: 640px) {
  #customerInfo .font-semibold.text-gray-800,
  #customerPromo .text-sm.text-blue-500 {
    font-size: 0.7rem;
  }

  #customerDob .text-sm.text-gray-500,
  #customerLastVisit .text-sm.text-gray-500 {
    font-size: 0.65rem;
  }
}

button,
.button,
.service-group-btn,
.invoice-tab,
.modal button {
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
  border-color: transparent !important;
  background-clip: padding-box;
  transition:
    background-color 0.2s ease,
    transform 0.2s ease,
    box-shadow 0.2s ease;
}

/* Responsive Adjustments */
@media (max-width: 640px) {
  .time-filter-btn {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
  }

  .mb-6 {
    margin-bottom: 1rem;
  }
}

.promo-checkbox-option {
  border: 1px solid #e5e7eb;
  /* Viền nhẹ */
  background-color: #ffffff;
}

.promo-checkbox-option.selected {
  background-color: #dbeafe;
  /* Màu xanh nhạt khi chọn */
  border-color: #0071e3;
  /* Viền xanh đậm */
}

.promo-checkbox-option input[type='radio'] {
  accent-color: #0071e3;
  /* Màu xanh cho radio button */
  width: 16px;
  height: 16px;
}

.promo-checkbox-option label {
  cursor: pointer;
  user-select: none;
  font-size: 14px;
}

#promoStatus {
  font-size: 12px;
  color: #6b7280;
  /* Màu xám nhạt cho trạng thái */
}

#promoListSelect,
#paymentMethodSelect {
  max-width: 170px;
}

/* Đảm bảo bảng có thể cuộn ngang và bố cục cố định */
#invoicesListTabs.invoice-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

/* Cố định 3 cột đầu tiên (STT, Ảnh, Khách hàng) */

#invoicesListTabs th:nth-child(2),
#invoicesListTabs td:nth-child(2) {
  position: sticky;
  left: -10px;
  min-width: 50px;
  max-width: 50px;
  z-index: 30;
  border-right: 1px solid #e5e7eb;
}

#invoicesListTabs th:nth-child(3),
#invoicesListTabs td:nth-child(3) {
  position: sticky;
  left: 30px;
  min-width: 120px;
  max-width: 160px;
  z-index: 30;
  border-right: 1px solid #e5e7eb;
}

/* Cố định thead khi cuộn dọc */
#invoicesListTabs thead th {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 2px solid #e5e7eb;
}

/* Định nghĩa chiều rộng cho các cột còn lại */
#invoicesListTabs th:nth-child(1),
#invoicesListTabs td:nth-child(1) {
  min-width: 40px;
  max-width: 40px;
}

#invoicesListTabs th:nth-child(4),
#invoicesListTabs td:nth-child(4) {
  min-width: 120px;
  max-width: 120px;
}

#invoicesListTabs th:nth-child(5),
#invoicesListTabs td:nth-child(5) {
  min-width: 250px;
  max-width: 250px;
}

#invoicesListTabs th:nth-child(6),
#invoicesListTabs th:nth-child(7),
#invoicesListTabs th:nth-child(8),
#invoicesListTabs td:nth-child(6),
#invoicesListTabs td:nth-child(7),
#invoicesListTabs td:nth-child(8),
#invoicesListTabs th:nth-child(9),
#invoicesListTabs td:nth-child(9) {
  min-width: 100px;
  max-width: 100px;
}

#invoicesListTabs th:nth-child(10),
#invoicesListTabs th:nth-child(11),
#invoicesListTabs th:nth-child(12),
#invoicesListTabs th:nth-child(13),
#invoicesListTabs th:nth-child(14),
#invoicesListTabs td:nth-child(10),
#invoicesListTabs td:nth-child(11),
#invoicesListTabs td:nth-child(12),
#invoicesListTabs td:nth-child(13),
#invoicesListTabs td:nth-child(14) {
  min-width: 120px;
  max-width: 120px;
}

#invoicesListTabs th:nth-child(15),
#invoicesListTabs td:nth-child(15),
#invoicesListTabs th:nth-child(16),
#invoicesListTabs td:nth-child(16),
#invoicesListTabs th:nth-child(17),
#invoicesListTabs td:nth-child(17) {
  min-width: 150px;
  max-width: 150px;
}

/* Đảm bảo nội dung trong ô không bị tràn */
#invoicesListTabs td,
#invoicesListTabs th {
  white-space: inherit;
  padding: 0.75rem;
  border-bottom: 1px solid #e5e7eb;
  text-align: center;
  font-size: smaller;
}

/* Đảm bảo cột cố định không bị che khuất bởi nội dung khác */
#invoicesListTabs .sticky {
  position: sticky !important;
}

/* Responsive */
@media (max-width: 768px) {
  #invoicesListTabs th,
  #invoicesListTabs td {
    padding: 0.5rem;
    font-size: 0.65rem;
  }

  #invoicesListTabs th:nth-child(1),
  #invoicesListTabs td:nth-child(1) {
    min-width: 30px;
    max-width: 40px;
  }

  #invoicesListTabs th:nth-child(2),
  #invoicesListTabs td:nth-child(2) {
    min-width: 40px;
    max-width: 40px;
  }

  #invoicesListTabs th:nth-child(3),
  #invoicesListTabs td:nth-child(3) {
    min-width: 120px;
    max-width: 120px;
  }
}

/* Styling cho bảng bookings */
#bookingsListTabs {
  width: 100%;
  border-spacing: 0;
  -webkit-overflow-scrolling: touch;
  /* Tối ưu cuộn trên iOS */
  scrollbar-width: thin;
  /* Giảm độ rộng thanh cuộn trên Firefox */
  scrollbar-color: #cbd5e0 #f7fafc;
  /* Màu thanh cuộn trên Firefox */
}

#bookingsListTabs thead {
  background-color: #f7fafc;
}

#bookingsListTabs th {
  position: sticky;
  top: 0;
  background-color: #f7fafc;
  z-index: 10;
  padding: 12px;
  font-weight: 600;
  font-size: smaller;
  border-bottom: 2px solid #e2e8f0;
  will-change: transform;
  /* Tối ưu hóa hiệu suất */
  transform: translateZ(0);
}

#bookingsListTabs th:first-child {
  left: -1px;
  z-index: 11;
  /* Đảm bảo cột đầu tiên luôn nằm trên các cột khác khi cuộn ngang */
  border-right: 2px solid #e2e8f0;
}

#bookingsListTabs td {
  padding: 12px;
  font-size: smaller;
  border-bottom: 1px solid #edf2f7;
  vertical-align: middle;
  will-change: transform;
  /* Tối ưu hóa hiệu suất */
  transform: translateZ(0);
}

#bookingsListTabs tr {
  transition: background-color 0.2s;
}

#bookingsListTabs td:first-child {
  position: sticky;
  left: -1px;
  z-index: 11;
  border-right: 2px solid #e2e8f0;
  will-change: transform;
  /* Tối ưu hóa hiệu suất */
  transform: translateZ(0);
}

#bookingsListTabs td img {
  transition: transform 0.2s;
}

#bookingsListTabs td img:hover {
  transform: scale(1.1);
}

/* Định nghĩa min-width cho các cột để tránh bị bóp */
#bookingsListTabs th:nth-child(1),
#bookingsListTabs td:nth-child(1) {
  min-width: 50px;
  max-width: 50px;
}

#bookingsListTabs th:nth-child(2),
#bookingsListTabs td:nth-child(2),
#bookingsListTabs th:nth-child(3),
#bookingsListTabs td:nth-child(3),
#bookingsListTabs th:nth-child(8),
#bookingsListTabs td:nth-child(8),
#bookingsListTabs th:nth-child(9),
#bookingsListTabs td:nth-child(9),
#bookingsListTabs th:nth-child(10),
#bookingsListTabs td:nth-child(10) {
  min-width: 120px;
}

#bookingsListTabs th:nth-child(4),
#bookingsListTabs td:nth-child(4),
#bookingsListTabs th:nth-child(5),
#bookingsListTabs td:nth-child(5) {
  min-width: 150px;
}

#bookingsListTabs th:nth-child(6),
#bookingsListTabs td:nth-child(6) {
  min-width: 130px;
}

#bookingsListTabs th:nth-child(7),
#bookingsListTabs td:nth-child(7) {
  min-width: 150px;
}

#bookingsListTabs th:nth-child(11),
#bookingsListTabs td:nth-child(11),
#bookingsListTabs th:nth-child(12),
#bookingsListTabs td:nth-child(12) {
  min-width: 100px;
}

/* Responsive */
@media (max-width: 768px) {
  #bookingsListTabs th,
  #bookingsListTabs td {
    padding: 8px;
    font-size: 12px;
  }
}

/* ====================== REPORTS & CHARTS ====================== */
.reports-charts-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}

@media (min-width: 768px) {
  .reports-charts-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.report-chart-card {
  background: var(--surface);
  padding: 16px;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.report-chart-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 16px;
}

/* Chart container cho Reports - không áp dụng cho Dashboard */
.reports-section .chart-container {
  position: relative;
  max-width: 600px;
  margin: 0 auto;
}

.card-report {
  min-height: 120px;
  text-align: center;
  align-content: center;
}

.sub-card {
  background-color: #f9fafb;
  color: #0071e3;
  padding: 1rem;
  border-radius: 0.5rem;
  margin-top: 0.5rem;
}

@media (max-width: 640px) {
  .reports-section .chart-container {
    max-width: 100%;
  }
}

/* Revenue Chart Container Responsive - Reports Section */
#revenueChartContainer {
  overflow: hidden;
  transition: max-height 0.3s ease;
}

#revenueChartContainer canvas {
  max-width: 100%;
  width: 100% !important;
}

@media (max-width: 640px) {
  #revenueChartContainer {
    padding: 0.5rem;
  }

  #monthlyRevenueChart,
  #detailedRevenueChart {
    max-height: 220px !important;
  }
}

@media (max-width: 480px) {
  #monthlyRevenueChart,
  #detailedRevenueChart {
    max-height: 180px !important;
  }
}

/* Services and Payment Sections */
.section-title {
  text-align: left;
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

.service-item {
  display: flex;
  justify-content: space-between;
  padding: 0.5rem 0;
  border-bottom: 1px solid #e5e7eb; /* gray-200 */
}

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

.service-name {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text);
}

.staff-name {
  font-size: 0.75rem;
  color: var(--muted);
  text-align: left;
}

.service-price {
  font-size: 0.875rem;
  color: var(--text);
}

.no-services {
  font-size: 0.875rem;
  color: var(--muted);
}

/* Payment Details */
.payment-item {
  display: flex;
  justify-content: space-between;
  padding: 0.25rem 0;
  font-size: 0.875rem;
}

.payment-label {
  color: var(--text);
}

.payment-value {
  color: var(--text);
}

.payment-discount {
  color: #dc2626; /* red-600 */
}

.payment-total {
  font-weight: 600;
  color: #16a34a; /* green-600 */
}

.payment-total-label {
  color: var(--text);
}

/* Images Section */
.images-container {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.image-wrapper {
  position: relative;
  flex-shrink: 0;
}

.invoice-image {
  width: 5rem; /* 80px */
  height: 5rem;
  object-fit: cover;
  border-radius: 0.375rem;
  transition: transform 0.2s ease;
}

.invoice-image:hover {
  transform: scale(1.05);
  cursor: pointer;
}

@media (min-width: 640px) {
  .invoice-image {
    width: 6rem; /* 96px */
    height: 6rem;
  }
}

@media (min-width: 768px) {
  .invoice-image {
    width: 7rem; /* 112px */
    height: 7rem;
  }
}

.no-images {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  color: #6b7280; /* gray-500 */
}

.no-images-icon {
  font-size: 1.875rem;
  margin-bottom: 0.5rem;
}

/* Action Buttons */
.actions-container {
  margin-top: 1.5rem;
  display: flex;
  justify-content: center;
  gap: 0.5rem;
}

.action-btn {
  padding: 4px 8px;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  color: white;
  transition: background-color 0.2s ease;
}

.upload-image-btn {
  background-color: #0071e3; /* blue-500 */
}

.upload-image-btn:hover {
  background-color: #0071e3; /* blue-600 */
}

.upload-feedback-btn {
  background-color: #6b7280; /* gray-500 */
}

.upload-feedback-btn:hover {
  background-color: #4b5563; /* gray-600 */
}

.not-image-btn {
  background-color: #ef4444; /* red-500 */
}

.not-image-btn:hover {
  background-color: #dc2626; /* red-600 */
}

.review-btn {
  background-color: #eab308 !important; /* yellow-500 */
  padding: 0.5rem 1.5rem;
}

.review-btn:hover {
  background-color: #ca8a04 !important; /* yellow-600 */
}

.pay-btn {
  background-color: #16a34a !important; /* green-600 */
  padding: 0.5rem 1.5rem;
}

.pay-btn:hover {
  background-color: #15803d !important; /* green-700 */
}

/* Search and Refresh Container */
.search-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

/* Search Input */
.search-input {
  width: 50%;
  border: 1px solid #d1d5db; /* gray-300 */
  border-radius: 0.375rem;
  padding: 0.25rem 0.75rem;
  font-size: 0.875rem;
  color: #374151; /* gray-700 */
  outline: none;
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}

.search-input:focus {
  border-color: #0071e3; /* blue-500 */
  box-shadow: 0 0 0 2px rgba(0, 113, 227, 0.5);
}

.search-input::placeholder {
  color: #9ca3af; /* gray-400 */
}

/* Refresh Button */
.refresh-btn {
  background-color: #0071e3; /* blue-500 */
  color: white;
  padding: 0.25rem 0.75rem;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  transition: background-color 0.2s ease;
}

.refresh-btn:hover {
  background-color: #0071e3; /* blue-600 */
}

.report-fillter {
  display: flex;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  justify-content: flex-start;
  align-items: baseline;
}

@media (min-width: 768px) {
  .report-fillter {
    display: flex;
    justify-content: center;
    flex-flow: row;
    gap: 20px;
  }
}

/* ====================== Modern Select: paymentMethodFilter ====================== */
/* Make the payment method select modern, touch-friendly and responsive while
   keeping its position in the layout unchanged. */
#paymentMethodFilter {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  display: inline-block;
  padding: 8px;
  height: 2.4rem;
  line-height: 1.2;
  border-radius: 0.5rem;
  border: 1px solid #d1d5db;
  background-color: #ffffff;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='%236b7280' stroke-width='2'><path d='M6 8l4 4 4-4'/></svg>");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 1em;
  font-size: small;
  color: #111827;
  cursor: pointer;
  transition:
    border-color 0.15s ease,
    box-shadow 0.12s ease,
    transform 0.08s ease;
}

#paymentMethodFilter::-ms-expand {
  display: none; /* hide default IE arrow */
}

#paymentMethodFilter:hover {
  border-color: #b3d7f7;
  box-shadow: 0 1px 2px rgba(0, 113, 227, 0.06);
}

#paymentMethodFilter:focus {
  outline: none;
  border-color: #0071e3;
  box-shadow: 0 0 0 4px rgba(0, 113, 227, 0.12);
}

/* ensure other small filter selects follow the same visual language but
   keep their width so layout/position is preserved */
.invoice-filters-grid .filter-item select,
.invoice-filters-grid .filter-item .flex-1,
.invoice-filters-grid .filter-item select.flex-1 {
  -webkit-appearance: none;
  appearance: none;
  padding: 0.4rem 1.6rem 0.4rem 0.5rem;
  height: 2.2rem;
  border-radius: 0.45rem;
  border: 1px solid #d1d5db;
  background-color: #fff;
  font-size: 0.9rem;
  color: #111827;
  transition:
    border-color 0.15s ease,
    box-shadow 0.12s ease;
}

.invoice-filters-grid .filter-item select:hover {
  border-color: #c7ddff;
}

/* Keep the desktop width/position unchanged but make selects full-width on small screens */
.invoice-filters-grid .filter-item select {
  min-width: 100px;
  max-width: 220px;
}

@media (max-width: 640px) {
  .invoice-filters-grid .filter-item {
    width: 100%;
  }

  .invoice-filters-grid .filter-item select,
  #paymentMethodFilter {
    width: 100%;
    background-position: right 6px center;
  }
}

/* ============================================================================== */

/* Sync styles for review filters so they match the modern select look
   while keeping layout/position and `.hidden` handling intact */
.review-filter-group select,
#reviewTypeFilter,
#reviewRatingFilter {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  padding: 2px 10px;
  height: 2.2rem;
  border-radius: 0.45rem;
  border: 1px solid #d1d5db;
  background-color: #ffffff;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='%236b7280' stroke-width='2'><path d='M6 8l4 4 4-4'/></svg>");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 0.95em;
  font-size: small;
  color: #111827;
  transition:
    border-color 0.15s ease,
    box-shadow 0.12s ease;
}

.review-filter-group select:hover,
#reviewTypeFilter:hover,
#reviewRatingFilter:hover {
  border-color: #c7ddff;
}

#reviewTypeFilter:focus,
#reviewRatingFilter:focus {
  outline: none;
  border-color: #0071e3;
  box-shadow: 0 0 0 4px rgba(0, 113, 227, 0.08);
}

/* Do not override `.hidden` - keep it functional (some selects intentionally hidden) */
.review-filter-group select.hidden,
#reviewRatingFilter.hidden {
  display: none !important;
}

@media (max-width: 640px) {
  .review-filter-group select,
  #reviewTypeFilter {
    width: 100% !important;
    max-width: none;
    background-position: right 6px center;
  }
  #reviewRatingFilter {
    min-width: 70px !important;
    max-width: 120px !important;
  }
}

/* ====================== Pill Select Component ====================== */
/* ====================== PILL SELECT - MOVED TO modals.css ====================== */
/* CSS đã được di chuyển sang modals.css để tránh trùng lặp */
/* Chỉ giữ lại CSS đặc biệt cho staff selection */

.staff-option-content {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Staff option CSS đã di chuyển sang modals.css */

/* Animation */
@keyframes mkt192-fadeIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Responsive */
@media (max-width: 640px) {
  .mkt192-modal-container {
    max-width: 95%;
    margin: 10px;
  }
  .mkt192-modal-header h3 {
    font-size: 16px;
  }

  .mkt192-pill-select-value-wrapper {
    padding: 10px 12px;
    min-height: 44px;
  }

  .mkt192-pill {
    padding: 6px 10px;
    font-size: 13px;
  }

  .mkt192-pill-option {
    padding: 10px 12px;
    font-size: 13px;
  }
}

/* Dark mode CSS has been moved to dark-mode.css */

/* Tables adapt to variables for consistent dark look */
#invoicesListTabs,
#bookingsListTabs {
  background: transparent;
  border-collapse: separate;
}

#invoicesListTabs thead th,
#bookingsListTabs thead th {
  background-color: var(--table-header-bg) !important;
  color: var(--text) !important;
  border-bottom-color: var(--table-border) !important;
}

#invoicesListTabs td,
#invoicesListTabs th,
#bookingsListTabs td,
#bookingsListTabs th {
  background-color: var(--table-row-bg);
  border-color: var(--table-border) !important;
  color: var(--text) !important;
}

/* Alerts / toasts (if exists) */
.toast-info,
.alert-info {
  background-color: var(--alert-info-bg) !important;
  color: var(--alert-info-text) !important;
}

.toast-error,
.alert-error {
  background-color: var(--alert-error-bg) !important;
  color: var(--alert-error-text) !important;
}

/* Subtle border use across components */
.border,
.rounded,
.modal,
.input,
select,
button {
  border-color: var(--border) !important;
}

/* Table headers and other subtle surfaces */
#invoicesListTabs thead th,
#bookingsListTabs thead th,
.modal-header,
.mkt192-modal-header {
  background-color: var(--surface) !important;
}

/* Text muted color */
.text-muted,
.muted,
.customer-promo,
.user-role {
  color: var(--muted) !important;
}

/* ============================================================================== */

/* ====================== INVOICE TIME FILTER BUTTONS - HIỆN ĐẠI ====================== */
.invoice-time-filter-container {
  background: transparent;
  padding: 0.5rem 0;
  margin-bottom: 1rem;
}

.invoice-filter-buttons {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  align-items: center;
}

.invoice-filter-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 0.85rem;
  border: 1.5px solid #e2e8f0;
  border-radius: 0.5rem;
  background: #ffffff;
  color: #4b5563;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.invoice-filter-btn i {
  font-size: 0.875rem;
  transition: transform 0.25s ease;
}

.invoice-filter-btn span {
  white-space: nowrap;
}

.invoice-filter-btn:hover {
  border-color: #b3d7f7;
  background: #eff6ff;
  color: #0071e3;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0, 113, 227, 0.1);
}

.invoice-filter-btn:hover i {
  transform: scale(1.1);
}

.invoice-filter-btn.active {
  border-color: #0071e3;
  background: linear-gradient(135deg, #0071e3 0%, #0071e3 100%);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(0, 113, 227, 0.3);
}

.invoice-filter-btn.active i {
  animation: pulse-icon 1.5s ease-in-out infinite;
}

@keyframes pulse-icon {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.1);
  }
}

/* Custom Date Container */
.invoice-custom-date-container {
  margin-top: 0.75rem;
  padding: 0.75rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 0.5rem;
  animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.invoice-custom-date-inputs {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
}

.invoice-date-input {
  flex: 1;
  min-width: 120px;
  padding: 0.5rem 0.75rem;
  border: 1.5px solid #d1d5db;
  border-radius: 0.5rem;
  background: #ffffff;
  font-size: 0.875rem;
  transition: all 0.2s ease;
}

.invoice-date-input:focus {
  outline: none;
  border-color: #0071e3;
  box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.1);
}

.date-separator {
  color: #9ca3af;
  font-size: 0.875rem;
  padding: 0 0.25rem;
}

.invoice-apply-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1rem;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #ffffff;
  border: none;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s ease;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.2);
}

.invoice-apply-btn:hover {
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.invoice-apply-btn:active {
  transform: translateY(0);
}

/* Responsive - Mobile */
@media (max-width: 640px) {
  .invoice-filter-btn {
    flex: 1 1 calc(50% - 0.25rem);
    min-width: 0;
    justify-content: center;
    padding: 0.45rem 0.6rem;
    font-size: 0.8rem;
  }

  .invoice-filter-btn span {
    display: none;
  }

  .invoice-filter-btn i {
    font-size: 1rem;
  }

  .invoice-custom-date-inputs {
    flex-direction: column;
    width: 100%;
  }

  .invoice-date-input {
    width: 100%;
  }

  .date-separator {
    display: none;
  }

  .invoice-apply-btn {
    width: 100%;
    justify-content: center;
  }
}

/* Dark mode support */
.mkt192-dark .invoice-filter-btn {
  background: #1f2937;
  border-color: #374151;
  color: #d1d5db;
}

.mkt192-dark .invoice-filter-btn:hover {
  background: #374151;
  border-color: #409cff;
  color: #b3d7f7;
}

.mkt192-dark .invoice-filter-btn.active {
  background: linear-gradient(135deg, #0071e3 0%, #0071e3 100%);
  border-color: #0071e3;
  color: #ffffff;
}

.mkt192-dark .invoice-custom-date-container {
  background: #1f2937;
  border-color: #374151;
}

.mkt192-dark .invoice-date-input {
  background: #111827;
  border-color: #374151;
  color: #d1d5db;
}

.mkt192-dark .date-separator {
  color: #6b7280;
}

/* ====================== SERVICE FILTER BUTTONS ====================== */

.service-filter-buttons {
  display: flex;
  gap: 0.5rem;
  margin: 5px 0;
  overflow: auto;
  padding: 0.75rem;
  border-radius: 0.5rem;
}

.mkt192-dark .service-filter-buttons {
  background: #2d3748;
}

.service-time-filter-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 0.95rem;
  border: 1.5px solid #d1d5db;
  border-radius: 0.5rem;
  background: #f5f5f7;
  color: #374151;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.25s ease;
  white-space: nowrap;
}

.service-time-filter-btn:hover {
  background: #f9fafb;
  border-color: #409cff;
  color: #0071e3;
  box-shadow: 0 2px 8px rgba(0, 113, 227, 0.15);
}

.service-time-filter-btn.active {
  background: linear-gradient(135deg, #0071e3 0%, #0071e3 100%);
  border-color: #0071e3;
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(0, 113, 227, 0.3);
}

.service-time-filter-btn i {
  font-size: 1rem;
  transition: transform 0.2s ease;
}

.service-time-filter-btn:hover i {
  transform: scale(1.1);
}

.service-time-filter-btn span {
  display: inline;
}

.time-filter-select {
  min-width: 160px;
  padding: 0.625rem 1rem;
  border: 1.5px solid #d1d5db;
  border-radius: 0.5rem;
  background: #ffffff;
  font-size: 0.875rem;
  font-weight: 500;
  color: #374151;
  cursor: pointer;
  transition: all 0.2s ease;
  appearance: none;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
  background-position: right 0.5rem center;
  background-repeat: no-repeat;
  background-size: 1.5em 1.5em;
  padding-right: 2.5rem;
}

.time-filter-select:hover {
  border-color: #0071e3;
  box-shadow: 0 2px 8px rgba(0, 113, 227, 0.15);
}

.time-filter-select:focus {
  outline: none;
  border-color: #0071e3;
  box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.15);
}

.time-filter-container {
  padding: 0.75rem;
  border-radius: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 5px;
  animation: slideDown 0.3s ease-out;
}

.custom-time-filter-select {
  padding: 0.75rem;
  display: flex;
}

.hidden {
  display: none;
}

/* Dark mode for service buttons */
.mkt192-dark .service-time-filter-btn {
  background: #1f2937;
  border-color: #374151;
  color: #d1d5db;
}

.mkt192-dark .service-time-filter-btn:hover {
  background: #374151;
  border-color: #409cff;
  color: #b3d7f7;
  box-shadow: 0 2px 8px rgba(64, 156, 255, 0.15);
}

.mkt192-dark .service-time-filter-btn.active {
  background: linear-gradient(135deg, #0071e3 0%, #0071e3 100%);
  border-color: #0071e3;
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(0, 113, 227, 0.3);
}

/* Mobile responsive */
@media (max-width: 640px) {
  .service-filter-buttons {
    gap: 0.35rem;
    padding: 0.5rem;
  }

  .service-time-filter-btn {
    padding: 0.5rem 0.6rem;
    font-size: 0.75rem;
  }

  .service-time-filter-btn i {
    font-size: 1rem;
  }
}

/* ====================== INVOICE FILTERS - TỐI ƯU CHO MOBILE & DESKTOP ====================== */

/* Container chính */
.invoice-filters-grid {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 10px;
}

/* Mỗi hàng có 2 cột */
.filter-row-2cols {
  display: grid;
  grid-template-columns: 1fr 1fr; /* 2 cột đều nhau trên mobile */
  gap: 0.2rem;
  align-items: center;
}

/* Desktop: Gom gọn, canh trái, không dàn trải */
@media (min-width: 768px) {
  .invoice-filters-grid {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 1rem;
    flex-wrap: wrap;
  }

  .filter-row-2cols {
    display: flex;
    gap: 0.75rem;
    flex-wrap: nowrap;
  }

  .filter-item {
    min-width: 180px;
    max-width: 250px;
  }
}

/* Input & Select chung */
.filter-item input,
.filter-item select {
  width: 100%;
  padding: 0.55rem 0.75rem;
  border: 1.5px solid #d1d5db;
  border-radius: 0.5rem;
  background: #f9fafb;
  font-size: 16px;
  transition: all 0.2s ease;
}

.filter-item input:focus,
.filter-item select:focus {
  outline: none;
  border-color: #409cff;
  box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.12);
  background: #ffffff;
}

/* Review group nhỏ gọn */
.review-filter-group {
  display: flex;
  gap: 0.35rem;
}

.review-filter-group select {
  flex: 1;
  font-size: 0.8rem;
  padding: 0.45rem 0.5rem;
  height: 38px;
  min-width: 100px;
}

/* ====================== TABLE CONTROLS ====================== */
.table-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.75rem;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
  gap: 5px;
  padding: 10px;
}

.table-controls-left {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
  font-size: 0.875rem;
  color: #4b5563;
}

.items-per-page-select {
  padding: 0.25rem 0.2rem;
  border: 1px solid #d1d5db;
  border-radius: 0.375rem;
  background: #ffffff;
  font-size: 0.875rem;
  min-width: 60px;
}

.table-controls-right {
  display: flex;
  justify-content: flex-end;
}

/* ====================== PAGINATION ====================== */
.pagination-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  margin-top: 1rem;
  font-size: 0.875rem;
  color: #4b5563;
}

.pagination-info {
  font-weight: 500;
}

.pagination-buttons {
  display: flex;
  gap: 0.35rem;
}

.pagination-btn {
  min-width: 36px;
  height: 36px;
  padding: 0 0.5rem;
  border: 1px solid #d1d5db;
  background: #ffffff;
  color: #374151;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pagination-btn:hover {
  background: #f3f4f6;
  border-color: #94a3b8;
}

.pagination-btn.active {
  background: #0071e3;
  color: white;
  border-color: #0071e3;
}

.pagination-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.pagination-current {
  padding: 0 12px;
  font-size: 0.875rem;
  color: var(--text);
  font-weight: 500;
}

/* ====================== RESPONSIVE ====================== */
@media (max-width: 480px) {
  .filter-pair {
    grid-template-columns: 1fr;
  }
  .pagination-container {
    text-align: center;
  }
}

@media (min-width: 768px) {
  .pagination-container {
    flex-direction: row;
    justify-content: space-between;
  }
}

/* ====================== CUSTOM DATE RANGE STYLES ====================== */
#customDateRangeContainer {
  transition: all 0.2s ease;
}
#customDateRangeContainer input {
  min-width: 120px;
  max-width: 120px;
}

/* Desktop: Thu gọn custom date range, canh trái */
@media (min-width: 768px) {
  #customDateRangeContainer {
    display: inline-flex;
    width: auto;
  }

  #customDateRangeContainer .flex {
    width: auto;
  }

  #customDateRangeContainer input {
    max-width: 150px;
  }
}

/* === BOOKINGS: ẨN TEXT TRÊN MOBILE === */
@media (max-width: 640px) {
  #booking-table-settings-btn span {
    display: none;
  }
  #booking-table-settings-btn {
    padding: 8px !important;
  }
}

/* === CUSTOM DATE: RESPONSIVE === */
#customBookingDateContainer input {
  min-width: 110px;
}
@media (max-width: 480px) {
  #customBookingDateContainer .date-separator {
    display: none;
  }
}

/* Styles for the new toggle switch in Truy Thu modal */
#mkt192-change-staff-toggle:checked ~ .block {
  background-color: #0071e3; /* blue-600 */
}

#mkt192-change-staff-toggle:checked ~ .dot {
  transform: translateX(1.5rem);
}

/* Red penalty icon */
.actions-column .truy-thu-btn.has-penalty i {
  color: red !important;
}

/* Loading state for buttons */
.truy-thu-btn.loading,
button.loading {
  opacity: 0.6;
  cursor: not-allowed;
  pointer-events: none;
}

.truy-thu-btn.loading:hover,
button.loading:hover {
  opacity: 0.6;
}

/* ============================================================================== */
/* All dark mode styles moved to dark-mode.css for better organization */
/* ============================================================================== */

/* =============================================
   🎨 MEMBERSHIP BADGE STYLES - VIP Customer
   ============================================= */

/* Badge container with premium gradient */
.membership-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.25rem;
  height: 1.25rem;
  background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 50%, #d97706 100%);
  color: #ffffff;
  border-radius: 50%;
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.4);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: help;
  flex-shrink: 0;
}

/* Crown icon styling */
.membership-badge i {
  font-size: 0.65rem;
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.2));
}

/* Hover effect - subtle scale and glow */
.membership-badge:hover {
  transform: scale(1.15);
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.6);
}

/* Animation for initial appearance */
@keyframes badge-appear {
  from {
    opacity: 0;
    transform: scale(0.6);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.membership-badge {
  animation: badge-appear 0.4s ease-out;
}

/* Row hover effect enhancement for VIP customers */
tr:has(.membership-badge):hover {
  background: linear-gradient(90deg, rgba(251, 191, 36, 0.08) 0%, rgba(255, 255, 255, 0) 100%);
}

/* Dark mode support */
body.mkt192-dark .membership-badge {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 50%, #b45309 100%);
  box-shadow: 0 2px 8px rgba(217, 119, 6, 0.5);
}

body.mkt192-dark .membership-badge:hover {
  box-shadow: 0 4px 12px rgba(217, 119, 6, 0.7);
}

body.mkt192-dark tr:has(.membership-badge):hover {
  background: linear-gradient(90deg, rgba(217, 119, 6, 0.12) 0%, rgba(0, 0, 0, 0) 100%);
}

/* Mobile responsive adjustments */
@media (max-width: 640px) {
  .membership-badge {
    font-size: 0.65rem;
    padding: 0.2rem 0.5rem;
    gap: 0.2rem;
  }

  .membership-badge i {
    font-size: 0.7rem;
  }
}

/* =============================================
   🎫 PROMO BADGE STYLES - Promotion Code
   ============================================= */

/* Base promo badge styling */
.promo-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.25rem;
  height: 1.25rem;
  color: #ffffff;
  border-radius: 50%;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: help;
  flex-shrink: 0;
}

/* Valid promo - Blue gradient */
.promo-badge-valid {
  background: linear-gradient(135deg, #0071e3 0%, #0071e3 50%, #0071e3 100%);
  box-shadow: 0 2px 8px rgba(0, 113, 227, 0.4);
}

.promo-badge-valid:hover {
  box-shadow: 0 4px 12px rgba(0, 113, 227, 0.6);
  transform: scale(1.15);
}

/* Invalid promo - Red gradient */
.promo-badge-invalid {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 50%, #b91c1c 100%);
  box-shadow: 0 2px 8px rgba(220, 38, 38, 0.4);
}

.promo-badge-invalid:hover {
  box-shadow: 0 4px 12px rgba(220, 38, 38, 0.6);
  transform: scale(1.15);
}

/* Expired promo - Gray gradient */
.promo-badge-expired {
  background: linear-gradient(135deg, #9ca3af 0%, #6b7280 50%, #4b5563 100%);
  box-shadow: 0 2px 8px rgba(107, 114, 128, 0.4);
}

.promo-badge-expired:hover {
  box-shadow: 0 4px 12px rgba(107, 114, 128, 0.6);
  transform: scale(1.15);
}

/* Promo icon styling */
.promo-badge i {
  font-size: 0.65rem;
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.2));
}

/* Animation for promo badge */
@keyframes promo-badge-appear {
  from {
    opacity: 0;
    transform: scale(0.6);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.promo-badge {
  animation: promo-badge-appear 0.4s ease-out 0.1s backwards;
}

/* Dark mode support for promo badges */
body.mkt192-dark .promo-badge-valid {
  background: linear-gradient(135deg, #0071e3 0%, #0071e3 50%, #005bb5 100%);
  box-shadow: 0 2px 8px rgba(0, 113, 227, 0.5);
}

body.mkt192-dark .promo-badge-invalid {
  background: linear-gradient(135deg, #dc2626 0%, #b91c1c 50%, #991b1b 100%);
  box-shadow: 0 2px 8px rgba(185, 28, 28, 0.5);
}

body.mkt192-dark .promo-badge-expired {
  background: linear-gradient(135deg, #6b7280 0%, #4b5563 50%, #374151 100%);
  box-shadow: 0 2px 8px rgba(75, 85, 99, 0.5);
}

/* Mobile responsive for promo badge */
@media (max-width: 640px) {
  .promo-badge {
    width: 1.1rem;
    height: 1.1rem;
  }

  .promo-badge i {
    font-size: 0.6rem;
  }
}

/* ============================================================
   📱 MOBILE CARD LIST v3 — CSS GRID, vùng cố định từng ô
   Hoá đơn & Lịch hẹn dạng card native. Desktop giữ nguyên bảng.
   ============================================================ */
:root {
  --mcard-bg: #ffffff;
  --mcard-border: rgba(0, 0, 0, 0.07);
  --mcard-muted: #8a94a6;
  --mcard-text: #1f2937;
  --mcard-chip-bg: rgba(125, 135, 155, 0.12);
  --mcard-accent: #0071e3;
  --mcard-accent-soft: rgba(0, 113, 227, 0.12);
  --mcard-money: #16a34a;
  --mcard-shadow: 0 1px 4px rgba(0, 0, 0, 0.07);
}
body.mkt192-dark {
  --mcard-bg: #101827;
  --mcard-border: rgba(255, 255, 255, 0.08);
  --mcard-muted: #71809a;
  --mcard-text: #e5e7eb;
  --mcard-chip-bg: rgba(148, 163, 184, 0.14);
  --mcard-accent: #409cff;
  --mcard-accent-soft: rgba(64, 156, 255, 0.16);
  --mcard-money: #4ade80;
  --mcard-shadow: 0 1px 6px rgba(0, 0, 0, 0.4);
}

@media (max-width: 767px) {
  #invoicesListTabs,
  #bookingsListTabs {
    display: block;
    min-width: 0 !important;
  }
  #invoicesListTabs thead,
  #bookingsListTabs thead {
    display: none;
  }
  #invoicesListTabs tbody,
  #bookingsListTabs tbody {
    display: flex;
    flex-direction: column;
    gap: 12px;
  }
  #invoicesListTabs tbody tr,
  #bookingsListTabs tbody tr {
    background: var(--mcard-bg);
    border: 0.5px solid var(--mcard-border);
    border-radius: 16px;
    padding: 12px 14px;
    box-shadow: var(--mcard-shadow);
    animation: mcardIn 0.25s cubic-bezier(0.2, 0.8, 0.2, 1) both;
    transition: transform 0.15s ease;
  }
  #invoicesListTabs tbody tr:active,
  #bookingsListTabs tbody tr:active {
    transform: scale(0.985);
  }
  @keyframes mcardIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: none; }
  }
  /* Reset ô: bỏ mọi style bảng desktop */
  #invoicesListTabs tbody td,
  #bookingsListTabs tbody td {
    padding: 0 !important;
    border: none !important;
    position: static !important;
    min-width: 0 !important;
    max-width: none !important; /* đè max-width 120/160px của cột sticky desktop */
    background: transparent !important;
    color: var(--mcard-text);
    text-align: left !important;
  }
  /* Ô loading/thông báo (colspan) */
  #invoicesListTabs tbody tr:has(td[colspan]),
  #bookingsListTabs tbody tr:has(td[colspan]) {
    display: block;
    text-align: center;
  }

  /* ════════════ 🧾 HOÁ ĐƠN ════════════
     ┌──────┬──────────────┬────────────┐
     │ ảnh  │ TÊN KHÁCH    │  150.000 đ │
     │ 48px │ HDxxxx  mờ   │ [trạng thái]│
     ├──────┴──────────────┴────────────┤
     │ dịch vụ — thợ                    │
     ├───────────────┬──────────────────┤
     │ [PTTT] [giờ]  │        [số... ]🗑│
     └───────────────┴──────────────────┘ */
  #invoicesListTabs tbody tr:not(:has(td[colspan])) {
    display: grid;
    grid-template-columns: 48px auto auto minmax(0, 1fr) auto;
    grid-template-areas:
      'img   name  name  name   total'
      'img   id    time  time   status'
      'svc   svc   svc   svc    svc'
      'chips chips chips chips  act';
    column-gap: 8px;
    row-gap: 3px;
    align-items: center;
    position: relative; /* neo cho tem giảm giá trên mép card */
  }
  #invoicesListTabs tbody td.stt-column,
  #invoicesListTabs tbody td.subtotal-column,
  #invoicesListTabs tbody td.result-column,
  #invoicesListTabs tbody td.review-online-column,
  #invoicesListTabs tbody td.review-offline-column,
  #invoicesListTabs tbody td.reconcile-column,
  #invoicesListTabs tbody td.payment-column,
  #invoicesListTabs tbody td.zns-column,
  #invoicesListTabs tbody td.tips-column,
  #invoicesListTabs tbody td.discount-column[data-has='0'] {
    display: none !important;
  }

  /* Cụm 3 badge gộp: canh trái, khoảng cách nhỏ đều nhau */
  #invoicesListTabs tbody td.mobile-badges-cell {
    grid-area: chips;
    display: flex !important;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
    justify-self: start;
    margin-top: 4px;
  }
  #invoicesListTabs tbody td.mobile-badges-cell .mb-badge {
    display: inline-flex;
    align-items: center;
    font-size: 11px;
    font-weight: 700;
    border-radius: 999px;
    padding: 3px 10px;
    white-space: nowrap;
    background: var(--mcard-chip-bg);
    color: var(--mcard-muted);
  }
  .mb-badge.mb-pay[data-pm='cash'] { background: rgba(52, 211, 153, 0.16); color: #10b981; }
  .mb-badge.mb-pay[data-pm='bank'] { background: rgba(96, 165, 250, 0.16); color: #3b82f6; }
  .mb-badge.mb-pay[data-pm='momo'] { background: rgba(244, 114, 182, 0.16); color: #ec4899; }
  .mb-badge.mb-pay[data-pm='combined'] { background: rgba(167, 139, 250, 0.16); color: #8b5cf6; }
  body.mkt192-dark .mb-badge.mb-pay[data-pm='cash'] { color: #6ee7b7; }
  body.mkt192-dark .mb-badge.mb-pay[data-pm='bank'] { color: #93c5fd; }
  body.mkt192-dark .mb-badge.mb-pay[data-pm='momo'] { color: #f9a8d4; }
  body.mkt192-dark .mb-badge.mb-pay[data-pm='combined'] { color: #c4b5fd; }
  .mb-badge.mb-zns[data-mtype='zbs_uid'] { background: rgba(45, 212, 191, 0.16); color: #0d9488; }
  .mb-badge.mb-zns[data-mtype='zbs_phone'] { background: rgba(129, 140, 248, 0.18); color: #6366f1; }
  body.mkt192-dark .mb-badge.mb-zns[data-mtype='zbs_uid'] { color: #5eead4; }
  body.mkt192-dark .mb-badge.mb-zns[data-mtype='zbs_phone'] { color: #a5b4fc; }
  .mb-badge.mb-tips { background: rgba(251, 191, 36, 0.16); color: #d97706; }
  body.mkt192-dark .mb-badge.mb-tips { color: #fbbf24; }
  #invoicesListTabs tbody td.image-column {
    grid-area: img;
    align-self: start;
  }
  #invoicesListTabs tbody td.image-column img {
    width: 48px !important;
    height: 48px !important;
    border-radius: 12px;
    object-fit: cover;
    border: none;
  }
  #invoicesListTabs tbody td.customer-column {
    grid-area: name;
    font-size: smaller;
    font-weight: 700;
    line-height: 1.3;
    word-break: break-word; /* tên hiển thị FULL, dài quá thì xuống dòng */
  }
  #invoicesListTabs tbody td.customer-column .flex {
    justify-content: flex-start !important;
    flex-wrap: nowrap;
    gap: 5px !important;
  }
  #invoicesListTabs tbody td.customer-column .membership-badge,
  #invoicesListTabs tbody td.customer-column .promo-badge {
    transform: scale(0.85);
    flex-shrink: 0;
  }
  #invoicesListTabs tbody td.customer-column .customer-name-text {
    min-width: 0;
  }
  #invoicesListTabs tbody td.invoice-id-column {
    grid-area: id;
    font-size: 11.5px;
    color: var(--mcard-muted);
  }
  #invoicesListTabs tbody td.total-column {
    grid-area: total;
    justify-self: end;
    font-size: 14.5px;
    font-weight: 800;
    color: var(--mcard-money) !important;
    border: none !important;
  }
  #invoicesListTabs tbody td.status-column {
    grid-area: status;
    justify-self: end;
  }
  /* Chip trạng thái kiểu native: dot màu + nền tint nhẹ, gọn để tên khách đủ chỗ */
  #invoicesListTabs tbody td.status-column span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 10px;
    font-weight: 700;
    padding: 3px 8px !important;
    border-radius: 999px;
    box-shadow: none !important;
    text-shadow: none !important;
    white-space: nowrap;
    background: var(--mcard-chip-bg) !important;
    color: var(--mcard-muted) !important;
  }
  #invoicesListTabs tbody td.status-column span::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
    flex-shrink: 0;
  }
  #invoicesListTabs tbody td.status-column span.status-paid {
    background: rgba(34, 197, 94, 0.16) !important;
    color: #22c55e !important;
  }
  body.mkt192-dark #invoicesListTabs tbody td.status-column span.status-paid {
    color: #4ade80 !important;
  }
  #invoicesListTabs tbody td.status-column span.status-pending {
    background: rgba(245, 158, 11, 0.16) !important;
    color: #d97706 !important;
  }
  body.mkt192-dark #invoicesListTabs tbody td.status-column span.status-pending {
    color: #fbbf24 !important;
  }
  #invoicesListTabs tbody td.services-column {
    grid-area: svc;
    font-size: 13px;
    color: var(--mcard-muted);
    line-height: 1.6;
    border-top: 0.5px solid var(--mcard-border) !important;
    padding-top: 8px !important;
    margin-top: 6px;
  }
  /* Thời gian: mờ nhỏ ngay cạnh mã hoá đơn */
  #invoicesListTabs tbody td.time-column {
    grid-area: time;
    justify-self: start;
    font-size: 11.5px !important;
    color: var(--mcard-muted);
    white-space: nowrap;
  }
  #invoicesListTabs tbody td.time-column::before {
    content: '·  ';
    font-weight: 700;
  }


  /* 🏷 TEM GIẢM GIÁ: đóng dấu kẹp trên mép card, xoay nhẹ như con dấu */
  #invoicesListTabs tbody td.discount-column {
    position: absolute !important;
    top: -10px;
    right: 14px;
    transform: rotate(3deg);
    display: inline-flex;
    align-items: center;
    width: fit-content;
    font-size: 10.5px;
    font-weight: 800;
    letter-spacing: 0.2px;
    padding: 3px 10px !important;
    border-radius: 8px;
    border: 1.5px dashed #fb7185;
    background: #ffe4e6 !important;
    color: #e11d48;
    white-space: nowrap;
    z-index: 2;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
  }
  #invoicesListTabs tbody td.discount-column::before {
    content: 'GIẢM -';
    margin-right: 2px;
  }
  body.mkt192-dark #invoicesListTabs tbody td.discount-column {
    background: #3d1a26 !important;
    color: #fda4af;
    border-color: #9f1239;
  }
  #invoicesListTabs tbody td.actions-column {
    grid-area: act;
    justify-self: end;
    display: flex;
    gap: 2px;
    margin-top: 4px;
  }
  #invoicesListTabs tbody td.actions-column button {
    font-size: 14px;
    padding: 6px 8px;
    opacity: 0.85;
  }

  /* ════════════ 📅 LỊCH HẸN ════════════
     ┌──────┬───────────────┬───────────┐
     │ ảnh  │ TÊN KHÁCH     │[trạng thái]│
     │ 44px │ 0909 xxx mờ   │           │
     ├──────┴───────────────┴───────────┤
     │ [🗓 5/7/2026 16:00]               │
     │ ✂ dịch vụ            Thợ: x      │
     │ [đã gửi] [đã nhắc]            🗑 │
     │ ghi chú đỏ (ẩn khi trống)        │
     └──────────────────────────────────┘ */
  #bookingsListTabs tbody tr:not(:has(td[colspan])) {
    display: grid;
    grid-template-columns: auto auto minmax(0, 1fr) auto;
    grid-template-areas:
      'img   name   name   status'
      'img   phone  date   date'
      'svc   svc    svc    staff'
      'chips chips  chips  act'
      'note  note   note   note';
    column-gap: 10px;
    row-gap: 3px;
    align-items: center;
  }
  #bookingsListTabs tbody td.id-column,
  #bookingsListTabs tbody td.cancel-column {
    display: none !important;
  }
  #bookingsListTabs tbody td.image-column {
    grid-area: img;
    align-self: start;
  }
  #bookingsListTabs tbody td.image-column img {
    width: 44px !important;
    height: 44px !important;
    border-radius: 50%;
    object-fit: cover;
  }
  #bookingsListTabs tbody td.customer-column {
    grid-area: name;
    font-size: smaller;
    font-weight: 700;
    line-height: 1.3;
    word-break: break-word; /* tên hiển thị FULL, dài quá thì xuống dòng */
  }
  #bookingsListTabs tbody td.phone-column {
    grid-area: phone;
    font-size: 12px;
    color: var(--mcard-muted);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
  }
  /* Mobile bỏ SĐT trên card (đã có trong modal chi tiết), chỉ giữ chip ID */
  #bookingsListTabs tbody td.phone-column .phone-text {
    display: none;
  }
  /* Chip ID booking + nút copy */
  #bookingsListTabs tbody td.phone-column .booking-id-copy {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 10.5px;
    font-weight: 700;
    color: var(--mcard-accent);
    background: var(--mcard-accent-soft);
    border: none;
    border-radius: 999px;
    padding: 2px 8px;
    cursor: pointer;
    line-height: 1.4;
  }
  #bookingsListTabs tbody td.phone-column .booking-id-copy i {
    font-size: 10px;
  }
  #bookingsListTabs tbody td.phone-column .booking-id-copy:active {
    opacity: 0.6;
  }
  /* Đã copy: chip chuyển xanh lá + icon tick */
  #bookingsListTabs tbody td.phone-column .booking-id-copy.copied {
    color: #16a34a;
    background: rgba(22, 163, 74, 0.14);
    transition:
      color 0.2s ease,
      background 0.2s ease;
  }
  body.mkt192-dark #bookingsListTabs tbody td.phone-column .booking-id-copy.copied {
    color: #4ade80;
    background: rgba(74, 222, 128, 0.16);
  }
  #bookingsListTabs tbody td.status-column {
    grid-area: status;
    justify-self: end;
    align-self: start;
  }
  #bookingsListTabs tbody td.status-column span {
    font-size: 11px;
    padding: 3px 9px;
    border-radius: 999px;
  }
  #bookingsListTabs tbody td.date-column {
    grid-area: date;
    justify-self: end;
    background: var(--mcard-accent-soft) !important;
    color: var(--mcard-accent);
    font-weight: 700;
    font-size: 11.5px;
    border-radius: 999px;
    padding: 3px 10px !important;
    white-space: nowrap;
  }
  #bookingsListTabs tbody td.date-column::before {
    content: '\f073  ';
    font-family: 'Font Awesome 6 Free', 'Font Awesome 5 Free';
    font-weight: 900;
    font-size: 11px;
  }
  #bookingsListTabs tbody td.service-column {
    grid-area: svc;
    font-size: 13px;
    color: var(--mcard-muted);
    line-height: 1.5;
    border-top: 0.5px solid var(--mcard-border) !important;
    padding-top: 8px !important;
    margin-top: 6px;
  }
  #bookingsListTabs tbody td.service-column::before {
    content: '\f0c4  ';
    font-family: 'Font Awesome 6 Free', 'Font Awesome 5 Free';
    font-weight: 900;
    font-size: 11px;
  }
  #bookingsListTabs tbody td.staff-column {
    grid-area: staff;
    justify-self: end;
    align-self: end;
    font-size: 12.5px;
    color: var(--mcard-muted);
    padding-top: 8px !important;
    margin-top: 6px;
    white-space: nowrap;
  }
  #bookingsListTabs tbody td.staff-column::before {
    content: 'Thợ: ';
    font-weight: 700;
  }
  #bookingsListTabs tbody td.message-column,
  #bookingsListTabs tbody td.reminder-column {
    display: none !important;
  }
  /* Cụm badge gộp: canh trái, khoảng cách nhỏ đều */
  #bookingsListTabs tbody td.booking-badges-cell {
    grid-area: chips;
    display: flex !important;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
    justify-self: start;
    margin-top: 2px;
  }
  #bookingsListTabs tbody td.booking-badges-cell span {
    font-size: 10.5px;
    font-weight: 700;
    padding: 3px 9px;
    border-radius: 999px;
    white-space: nowrap;
  }
  #bookingsListTabs tbody td.booking-badges-cell button {
    font-size: 13px;
    padding: 2px 4px;
  }
  #bookingsListTabs tbody td.actions-column {
    grid-area: act;
    justify-self: end;
    display: flex;
    gap: 4px;
  }
  #bookingsListTabs tbody td.actions-column button {
    font-size: 14px;
    padding: 6px 8px;
  }
  #bookingsListTabs tbody td.note-column {
    grid-area: note;
    font-size: 12.5px;
  }
  #bookingsListTabs tbody td.note-column:not(:has(span:not(:empty))) {
    display: none !important;
  }

  .overflow-x-auto:has(#invoicesListTabs),
  .overflow-x-auto:has(#bookingsListTabs) {
    overflow-x: visible;
  }
}

/* ============================================================
   📱 MOBILE FILTER BAR — khu lọc gọn kiểu native (Hoá đơn/Lịch hẹn)
   ============================================================ */
.mobile-filter-toggle {
  display: none; /* chỉ hiện trên mobile */
}
#invoicesListTabs .mobile-badges-cell,
#bookingsListTabs .booking-badges-cell {
  display: none; /* ô badge gộp chỉ dành cho card mobile */
}
#bookingsListTabs .booking-id-copy {
  display: none; /* chip ID + copy chỉ dành cho card mobile, desktop đã có cột ID */
}
@media (max-width: 767px) {
  /* Ẩn: "Hiển thị X mục" + nút Cài đặt hiển thị (không cần trên mobile) */
  #invoicesContent .table-controls,
  #bookingsContent .table-controls {
    display: none !important;
  }

  /* Hàng đầu: [kỳ lọc] [nút Lọc] trên 1 hàng */
  #invoicesContent .time-filter-container {
    display: flex;
    align-items: center;
    gap: 8px;
  }
  #invoicesContent .time-filter-select {
    flex: 1;
    min-width: 0;
  }
  .mobile-filter-toggle {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 40px;
    padding: 0 14px;
    border: none;
    border-radius: 10px;
    background: var(--mcard-chip-bg);
    color: var(--mcard-text);
    font-size: 13px;
    font-weight: 600;
    -webkit-tap-highlight-color: transparent;
    transition: background 0.2s ease, color 0.2s ease;
  }
  .mobile-filter-toggle.active {
    background: var(--mcard-accent-soft);
    color: var(--mcard-accent);
  }

  /* Panel bộ lọc: mặc định thu gọn, bấm Lọc mới trượt xuống */
  #invoicesContent .search-filters-container {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s cubic-bezier(0.2, 0.8, 0.2, 1), margin 0.3s ease;
    margin: 0 !important;
  }
  #invoicesContent .search-filters-container.open {
    max-height: 520px;
    margin-top: 10px !important;
    margin-bottom: 6px !important;
  }
  /* Field gọn: ẩn label (placeholder tự nói), input pill */
  #invoicesContent .filter-item > label {
    display: none;
  }
  #invoicesContent .filter-item input,
  #invoicesContent .filter-item select {
    height: 40px;
    border-radius: 10px;
    font-size: 13px;
    margin-top: 0 !important;
  }
  /* Nút Đối soát: cùng hàng với nút Lọc, compact */
  #invoicesContent .time-filter-container #reconcileBtn {
    flex: 0 0 auto;
    height: 40px;
    padding: 0 12px;
    border-radius: 10px;
    font-size: 13px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
  }
  /* Khoảng ngày tuỳ chọn: canh giữa */
  .custom-time-filter-select {
    padding: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  #invoicesContent #customDateRangeContainer .flex {
    justify-content: center;
  }
  #invoicesContent #customDateRangeContainer input[type='date'] {
    max-width: 138px;
  }
}
