/* ══ GIAO DIỆN MÁY HẸN ĐỔI (Apple Frosted Glass & Luxury Double-Bezel Architecture) ═════════════════
   Thiết kế chuẩn Awwwards / Apple SF Pro: thẻ gia công kép, luồng đổi trực quan, huy hiệu trạng thái có hiệu ứng thở,
   tự thích ứng 19 theme Sáng & Tối của hệ thống iTN Store. */

.hd-wrapper {
  display: flex;
  flex-direction: column;
  gap: 16px;
  animation: hd-fade-in 0.3s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes hd-fade-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ── 1. HEADER KHU VỰC HẸN ĐỔI ── */
.hd-header {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 14px !important;
  flex-wrap: wrap !important;
  padding-bottom: 2px !important;
}

.hd-header-left {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.hd-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.hd-title-row h2 {
  margin: 0 !important;
  font-size: clamp(20px, 2.2vw, 26px) !important;
  font-weight: 750 !important;
  letter-spacing: -0.03em !important;
  color: var(--text-main, #111827) !important;
  line-height: 1.2 !important;
}

.hd-count-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  background: var(--theme-accent-soft, rgba(0, 113, 227, 0.08));
  color: var(--theme-accent-strong, #0071e3);
  border: 1px solid color-mix(in srgb, var(--theme-accent-strong, #0071e3) 24%, transparent);
}

.hd-subtitle {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-muted, #64748b);
  margin: 0 !important;
  line-height: 1.4;
  flex-wrap: wrap;
}

.hd-scope-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-weight: 650;
  color: var(--text-main, #1e293b);
  background: var(--theme-header-layer, rgba(0, 0, 0, 0.04));
  padding: 1px 7px;
  border-radius: 6px;
  border: 1px solid var(--border-color, rgba(0,0,0,0.08));
}

.hd-header-actions button[data-action="sales"] {
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  height: 44px !important;
  min-height: 44px !important;
  padding: 0 16px !important;
  border-radius: 999px !important;
  background: var(--theme-header-layer, rgba(0, 113, 227, 0.08)) !important;
  color: var(--theme-accent-strong, #0071e3) !important;
  border: 1px solid color-mix(in srgb, var(--theme-accent-strong, #0071e3) 30%, transparent) !important;
  font-size: 13px !important;
  font-weight: 650 !important;
  cursor: pointer !important;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04) !important;
  transition: background-color 0.2s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.2s cubic-bezier(0.16, 1, 0.3, 1), color 0.2s cubic-bezier(0.16, 1, 0.3, 1), transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

.hd-header-actions button[data-action="sales"]:hover {
  background: var(--theme-accent-strong, #0071e3) !important;
  color: #ffffff !important;
  border-color: var(--theme-accent-strong, #0071e3) !important;
  transform: translateY(-1px) !important;
  box-shadow: 0 4px 12px color-mix(in srgb, var(--theme-accent-strong, #0071e3) 35%, transparent) !important;
}

/* ── 2. THANH LỌC LỊCH HẸN (FILTER BAR) ── */
.backend-mode form.hd-filter-toolbar,
form.hd-filter-toolbar {
  display: flex !important;
  flex-direction: row !important;
  align-items: flex-end !important;
  gap: 12px !important;
  padding: 12px 16px !important;
  border-radius: 14px !important;
  background: var(--bg-card, #ffffff) !important;
  border: 1px solid var(--border-color, rgba(0,0,0,0.08)) !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.02) !important;
  margin-bottom: 2px !important;
}

.hd-filter-toolbar label.hd-filter-field {
  display: flex !important;
  flex-direction: column !important;
  gap: 5px !important;
  flex: 1 1 200px !important;
  min-width: 0 !important;
  margin: 0 !important;
}

.hd-filter-toolbar label.hd-filter-field.is-narrow {
  flex: 0 0 160px !important;
  max-width: 160px !important;
}

.hd-filter-title {
  display: block !important;
  font-size: 12px !important;
  font-weight: 650 !important;
  color: var(--text-muted, #64748b) !important;
  letter-spacing: -0.01em !important;
  margin: 0 !important;
  line-height: 1.2 !important;
}

.hd-filter-toolbar select,
.hd-filter-toolbar input {
  height: 44px !important;
  min-height: 44px !important;
  width: 100% !important;
  box-sizing: border-box !important;
  padding: 0 12px !important;
  border-radius: 9px !important;
  background: var(--bg-input, #f8fafc) !important;
  border: 1px solid var(--border-color, #e2e8f0) !important;
  color: var(--text-main, #0f172a) !important;
  font-size: 14px !important;
  font-family: inherit !important;
  outline: none !important;
  margin: 0 !important;
  transition: border-color 0.15s ease, box-shadow 0.15s ease !important;
}

.hd-filter-toolbar select:focus,
.hd-filter-toolbar input:focus {
  border-color: var(--theme-accent-strong, #0071e3) !important;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--theme-accent-strong, #0071e3) 15%, transparent) !important;
}

.hd-filter-toolbar button {
  height: 44px !important;
  min-height: 44px !important;
  padding: 0 18px !important;
  border-radius: 9px !important;
  background: var(--theme-accent-strong, #0071e3) !important;
  color: #ffffff !important;
  font-size: 14px !important;
  font-weight: 650 !important;
  border: 1px solid var(--theme-accent-strong, #0071e3) !important;
  cursor: pointer !important;
  box-shadow: 0 2px 8px color-mix(in srgb, var(--theme-accent-strong, #0071e3) 30%, transparent) !important;
  transition: background-color 0.2s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.2s cubic-bezier(0.16, 1, 0.3, 1), color 0.2s cubic-bezier(0.16, 1, 0.3, 1), transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
  flex: 0 0 auto !important;
  align-self: flex-end !important;
  margin: 0 !important;
}
html[data-itn-theme="graphite"] .hd-filter-toolbar button,
html[data-itn-theme="gold-noir"] .hd-filter-toolbar button {
  color: var(--bg-app, #101216) !important;
}

.hd-filter-toolbar button:hover {
  background: color-mix(in srgb, var(--theme-accent-strong, #0071e3) 88%, black) !important;
  transform: translateY(-1px) !important;
  box-shadow: 0 4px 12px color-mix(in srgb, var(--theme-accent-strong, #0071e3) 38%, transparent) !important;
}

.hd-filter-toolbar button:active {
  transform: translateY(0) scale(0.98) !important;
}

/* ── 3. DANH SÁCH LỊCH HẸN (CARDS GRID) ── */
.hd-cards-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

/* ── 4. THẺ LỊCH HẸN CHI TIẾT (DOUBLE-BEZEL CARD) ── */
article.pilot-device.hd-card {
  position: relative !important;
  padding: 16px 18px !important;
  background: var(--bg-card, #ffffff) !important;
  border: 1px solid var(--border-color, rgba(0,0,0,0.08)) !important;
  border-radius: 18px !important;
  box-shadow: 0 3px 16px rgba(0, 0, 0, 0.03), inset 0 1px 1px rgba(255, 255, 255, 0.08) !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 12px !important;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s ease, border-color 0.2s ease !important;
  overflow: hidden !important;
}

article.pilot-device.hd-card:hover {
  transform: translateY(-2px) !important;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06) !important;
  border-color: color-mix(in srgb, var(--border-color, rgba(0,0,0,0.12)) 65%, var(--theme-accent-strong, #0071e3) 35%) !important;
}

/* Dải màu trạng thái trên cùng card */
article.pilot-device.hd-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--hd-accent-strip, transparent);
  border-radius: 18px 18px 0 0;
}

article.pilot-device.hd-card.is-overdue::before {
  background: linear-gradient(90deg, #ef4444, #dc2626);
}
article.pilot-device.hd-card.is-reminder::before {
  background: linear-gradient(90deg, #f59e0b, #d97706);
}
article.pilot-device.hd-card.is-pending::before {
  background: linear-gradient(90deg, var(--theme-accent-strong, #0071e3), color-mix(in srgb, var(--theme-accent-strong, #0071e3) 60%, #38bdf8));
}
article.pilot-device.hd-card.is-done::before {
  background: linear-gradient(90deg, #10b981, #059669);
}

/* Card Header: Mã HĐ + Khách hàng + Badge trạng thái */
.hd-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.hd-card-title-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

article.pilot-device.hd-card h3 {
  margin: 0 !important;
  font-size: 16px !important;
  font-weight: 750 !important;
  color: var(--text-main, #0f172a) !important;
  letter-spacing: -0.02em !important;
  line-height: 1.35 !important;
}

.hd-badge-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* Huy hiệu trạng thái với hiệu ứng pulse */
.hd-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 11px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.01em;
}

.hd-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  display: inline-block;
}

.hd-status-badge.badge-overdue {
  background: rgba(239, 68, 68, 0.12);
  color: #dc2626;
  border: 1px solid rgba(239, 68, 68, 0.3);
}
.hd-status-badge.badge-overdue .hd-status-dot {
  box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.25);
  animation: hd-pulse-red 1.8s infinite;
}

.hd-status-badge.badge-reminder {
  background: rgba(245, 158, 11, 0.12);
  color: #b45309;
  border: 1px solid rgba(245, 158, 11, 0.35);
}
.hd-status-badge.badge-reminder .hd-status-dot {
  box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.25);
  animation: hd-pulse-amber 1.8s infinite;
}

.hd-status-badge.badge-pending {
  background: var(--theme-accent-soft, rgba(0, 113, 227, 0.08));
  color: var(--theme-accent-strong, #0071e3);
  border: 1px solid color-mix(in srgb, var(--theme-accent-strong, #0071e3) 25%, transparent);
}

.hd-status-badge.badge-done {
  background: rgba(16, 185, 129, 0.12);
  color: #059669;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.hd-status-badge.badge-cancelled {
  background: var(--bg-input, rgba(148, 163, 184, 0.12));
  color: var(--text-muted, #64748b);
  border: 1px solid var(--border-color, rgba(148, 163, 184, 0.25));
}

@keyframes hd-pulse-red {
  0% { transform: scale(0.95); opacity: 0.8; }
  50% { transform: scale(1.3); opacity: 1; }
  100% { transform: scale(0.95); opacity: 0.8; }
}

@keyframes hd-pulse-amber {
  0% { transform: scale(0.95); opacity: 0.8; }
  50% { transform: scale(1.3); opacity: 1; }
  100% { transform: scale(0.95); opacity: 0.8; }
}

/* Metadata Chips: Khách, SĐT, Chi nhánh, Nhân viên */
.hd-meta-chips {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.hd-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 550;
  color: var(--text-muted, #475569);
  background: var(--bg-input, #f1f5f9);
  border: 1px solid color-mix(in srgb, var(--border-color, #e2e8f0) 60%, transparent);
}

.hd-chip-phone {
  font-variant-numeric: tabular-nums;
  color: var(--text-main, #0f172a);
  font-weight: 650;
}

/* ── 5. THE VISUAL EXCHANGE HUB (SO SÁNH 2 MÁY TRỰC QUAN) ── */
.hd-exchange-hub {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: stretch;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  background: var(--bg-input, #f8fafc);
  border: 1px solid var(--border-color, rgba(0,0,0,0.06));
}

.hd-hub-side {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 10px 12px;
  border-radius: 11px;
  background: var(--bg-card, #ffffff);
  border: 1px solid var(--border-color, rgba(0,0,0,0.06));
  box-shadow: 0 1px 4px rgba(0,0,0,0.02);
}

.hd-hub-eyebrow {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted, #64748b);
}

.hd-hub-side.is-target .hd-hub-eyebrow {
  color: var(--theme-accent-strong, #0071e3);
}

.hd-hub-model {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-main, #0f172a);
  line-height: 1.35;
}

.hd-hub-side.is-target .hd-hub-model {
  color: var(--theme-accent-strong, #0071e3);
  font-size: 14.5px;
}

.hd-imei-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 2px;
  font-size: 11px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-weight: 600;
  color: var(--text-muted, #64748b);
  background: var(--bg-input, #f1f5f9);
  padding: 2px 7px;
  border-radius: 6px;
  width: fit-content;
  border: 1px solid color-mix(in srgb, var(--border-color, #cbd5e1) 50%, transparent);
}

.hd-hub-due {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 3px;
  font-size: 12px;
  font-weight: 650;
  color: var(--text-main, #0f172a);
}

.hd-hub-due svg {
  color: var(--theme-accent-strong, #0071e3);
}

/* Khối chuyển tiếp giữa 2 máy (Icon ⇄ và nhãn) */
.hd-hub-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 0 2px;
}

.hd-exchange-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--theme-header-layer, rgba(0, 113, 227, 0.08));
  color: var(--theme-accent-strong, #0071e3);
  border: 1px solid color-mix(in srgb, var(--theme-accent-strong, #0071e3) 25%, transparent);
  font-size: 11px;
  font-weight: 750;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.hd-exchange-arrow {
  color: var(--text-muted, #94a3b8);
  font-size: 16px;
  line-height: 1;
}

/* ── 6. GHI CHÚ NỘI BỘ (CALLOUT MEMO) ── */
.hd-note-callout {
  display: flex !important;
  align-items: flex-start !important;
  gap: 8px !important;
  padding: 9px 12px !important;
  border-radius: 10px !important;
  background: color-mix(in srgb, var(--theme-accent-soft, rgba(0, 113, 227, 0.06)) 40%, var(--bg-input, #f8fafc)) !important;
  border: 1px solid color-mix(in srgb, var(--border-color, rgba(0,0,0,0.08)) 70%, var(--theme-accent-strong, #0071e3) 30%) !important;
  border-left: 3px solid var(--theme-accent-strong, #0071e3) !important;
  font-size: 13px !important;
  line-height: 1.45 !important;
  color: var(--text-main, #1e293b) !important;
  margin: 0 !important;
}

.hd-note-icon {
  color: var(--theme-accent-strong, #0071e3);
  flex-shrink: 0;
  font-size: 13px;
  line-height: 1.4;
}

.hd-note-content {
  flex: 1;
  min-width: 0;
}

.hd-note-content strong {
  font-weight: 700;
  color: var(--text-main, #0f172a);
}

/* ── 7. FOOTER CÁC NÚT THAO TÁC ── */
.hd-card-actions {
  display: flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 8px !important;
  flex-wrap: wrap !important;
  padding-top: 4px !important;
  border-top: 1px solid color-mix(in srgb, var(--border-color, rgba(0,0,0,0.06)) 60%, transparent) !important;
}

.hd-card-actions button {
  height: 36px !important;
  min-height: 36px !important;
  padding: 0 15px !important;
  border-radius: 9px !important;
  font-size: 13px !important;
  font-weight: 650 !important;
  cursor: pointer !important;
  transition: background-color 0.15s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.15s cubic-bezier(0.16, 1, 0.3, 1), color 0.15s cubic-bezier(0.16, 1, 0.3, 1), transform 0.15s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.15s cubic-bezier(0.16, 1, 0.3, 1) !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 5px !important;
  margin: 0 !important;
}

/* Nút Sửa lịch / ghi chú */
.hd-card-actions button[data-action="appointment-edit"] {
  background: var(--bg-input, #f1f5f9) !important;
  color: var(--text-main, #1e293b) !important;
  border: 1px solid var(--border-color, #cbd5e1) !important;
}
.hd-card-actions button[data-action="appointment-edit"]:hover {
  background: color-mix(in srgb, var(--bg-input, #f1f5f9) 70%, var(--theme-accent-strong, #0071e3) 30%) !important;
  border-color: var(--theme-accent-strong, #0071e3) !important;
  transform: translateY(-1px) !important;
}

/* Nút Đã đổi (Success emerald) */
.hd-card-actions button[data-action="appointment-done"] {
  background: #059669 !important;
  color: #ffffff !important;
  border: 1px solid #047857 !important;
  box-shadow: 0 2px 6px rgba(5, 150, 105, 0.25) !important;
}
.hd-card-actions button[data-action="appointment-done"]:hover {
  background: #047857 !important;
  transform: translateY(-1px) !important;
  box-shadow: 0 4px 12px rgba(5, 150, 105, 0.35) !important;
}

/* Nút Hủy hẹn (Danger ghost) */
.hd-card-actions button[data-action="appointment-cancel"] {
  background: transparent !important;
  color: #dc2626 !important;
  border: 1px solid rgba(239, 68, 68, 0.35) !important;
}
.hd-card-actions button[data-action="appointment-cancel"]:hover {
  background: rgba(239, 68, 68, 0.08) !important;
  border-color: #dc2626 !important;
  transform: translateY(-1px) !important;
}

/* ── 8. PHÂN TRANG VÀ NÚT TẢI LẠI ĐÁY BẢNG ── */
.hd-pagination-bar {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 12px !important;
  flex-wrap: wrap !important;
  padding: 10px 14px !important;
  border-radius: 12px !important;
  background: var(--bg-card, #ffffff) !important;
  border: 1px solid var(--border-color, rgba(0,0,0,0.08)) !important;
  margin-top: 2px !important;
}

.hd-pagination-info {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted, #64748b);
  font-variant-numeric: tabular-nums;
}

.hd-pagination-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.hd-pagination-bar button {
  height: 44px !important;
  min-height: 44px !important;
  padding: 0 13px !important;
  border-radius: 8px !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  background: var(--bg-input, #f1f5f9) !important;
  color: var(--text-main, #0f172a) !important;
  border: 1px solid var(--border-color, #cbd5e1) !important;
  cursor: pointer !important;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, opacity 0.15s ease !important;
  margin: 0 !important;
}

.hd-pagination-bar button:hover {
  border-color: var(--theme-accent-strong, #0071e3) !important;
  color: var(--theme-accent-strong, #0071e3) !important;
}

/* ── 9. TRẠNG THÁI RỖNG (EMPTY STATE) ── */
.hd-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px 20px;
  border-radius: 18px;
  background: var(--bg-card, #ffffff);
  border: 1px dashed var(--border-color, #cbd5e1);
  gap: 10px;
}

/* ── 10. FORM CHỈNH SỬA LỊCH HẸN (EDIT INTERNAL FORM) ── */
.hd-edit-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 680px;
  margin: 0 auto;
  animation: hd-fade-in 0.25s ease both;
}

.hd-edit-panel h2 {
  font-size: 20px !important;
  font-weight: 750 !important;
  letter-spacing: -0.02em !important;
  color: var(--text-main, #0f172a) !important;
  margin: 0 !important;
}

.hd-edit-card {
  padding: 20px;
  border-radius: 18px;
  background: var(--bg-card, #ffffff);
  border: 1px solid var(--border-color, rgba(0,0,0,0.08));
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.hd-edit-card label.bh-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.hd-edit-card textarea,
.hd-edit-card select,
.hd-edit-card input[type="text"],
.hd-edit-card input[type="datetime-local"] {
  border-radius: 9px;
  border: 1px solid var(--border-color, #cbd5e1);
  background: var(--bg-input, #f8fafc);
  color: var(--text-main, #0f172a);
  padding: 9px 12px;
  font-size: 13.5px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

.hd-edit-card textarea:focus,
.hd-edit-card select:focus,
.hd-edit-card input:focus {
  border-color: var(--theme-accent-strong, #0071e3);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--theme-accent-strong, #0071e3) 15%, transparent);
}

.hd-edit-card fieldset[data-hen-fields] {
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: 12px;
  padding: 16px;
  margin: 6px 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: var(--bg-input, #f8fafc);
}

.hd-edit-card fieldset legend {
  font-weight: 700;
  font-size: 12.5px;
  color: var(--theme-accent-strong, #0071e3);
  padding: 0 6px;
}

.hd-edit-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-top: 6px;
}

.hd-edit-actions button[data-action] {
  height: 44px !important;
  min-height: 44px !important;
  padding: 0 18px !important;
  border-radius: 9px !important;
  font-size: 13.5px !important;
  font-weight: 650 !important;
  cursor: pointer !important;
}

.hd-edit-actions button:not([data-action]) {
  height: 44px !important;
  min-height: 44px !important;
  padding: 0 22px !important;
  border-radius: 9px !important;
  background: var(--theme-accent-strong, #0071e3) !important;
  color: #ffffff !important;
  font-size: 13.5px !important;
  font-weight: 650 !important;
  border: 1px solid var(--theme-accent-strong, #0071e3) !important;
  cursor: pointer !important;
  box-shadow: 0 2px 8px color-mix(in srgb, var(--theme-accent-strong, #0071e3) 30%, transparent) !important;
}

/* ── 11. RESPONSIVE MOBILE TỐI ƯU (≤ 768px) ── */
@media (max-width: 768px) {
  .backend-mode form.hd-filter-toolbar,
  form.hd-filter-toolbar {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 10px !important;
  }
  .hd-filter-toolbar label.hd-filter-field,
  .hd-filter-toolbar label.hd-filter-field.is-narrow {
    flex: 1 1 100% !important;
    max-width: 100% !important;
  }
  .hd-filter-toolbar button {
    width: 100% !important;
    min-height: 44px !important;
  }
  /* Ô lọc Trạng thái / Tìm (40px) và nút phân trang Trang trước / Trang sau / Tải lại (34px) lên 44px — chuẩn ô bấm trên điện thoại
     (13/10/2026, đo 390px). Buộc dùng !important: quy tắc gốc ở mục 2 / mục 8 của tệp này đều !important, không có thì không thắng. */
  .hd-filter-toolbar select,
  .hd-filter-toolbar input {
    height: 44px !important;
    min-height: 44px !important;
  }
  .hd-pagination-bar button,
  .hd-header-actions button[data-action="sales"],
  .hd-edit-actions button[data-action],
  .hd-edit-actions button:not([data-action]) {
    height: 44px !important;
    min-height: 44px !important;
  }
  .hd-exchange-hub {
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 10px;
  }
  .hd-hub-center {
    flex-direction: row;
    padding: 2px 0;
  }
  .hd-exchange-arrow {
    transform: rotate(90deg);
  }
  .hd-card-actions {
    justify-content: stretch !important;
  }
  .hd-card-actions button {
    flex: 1 1 auto !important;
    justify-content: center !important;
    min-height: 44px !important;
  }
}
