/* Badge pill + font fix */
.list-row-badge,
.badge {
  border-radius: 9999px !important;
  font-family: 'Inter', sans-serif !important;
}

/* Fix status dropdown bị chìm - dùng fixed positioning */
.status-dropdown-wrapper {
  position: relative !important;
  z-index: 50 !important;
}
.status-dropdown-wrapper > div {
  z-index: 99999 !important;
  position: fixed !important;
  box-shadow: 0 8px 24px rgba(0,0,0,0.18) !important;
  border-radius: 8px !important;
  min-width: 140px !important;
}

/* Keep table scrolling stable; dropdown menus use fixed positioning above. */
.table-responsive,
.table-wrap {
  overflow-x: auto !important;
  overflow-y: visible !important;
}

/* Ticket priority colors: keep them distinct from status colors. */
body .cx-ticket-table td:nth-child(6) .badge,
body .cx-ticket-priority-badge {
  min-width: 86px;
  justify-content: center;
  border: 1px solid transparent;
  letter-spacing: 0;
}

body .cx-ticket-priority-low {
  background: #ecfdf5 !important;
  border-color: #a7f3d0 !important;
  color: #047857 !important;
}

body .cx-ticket-table td:nth-child(6) .badge-warning,
body .cx-ticket-priority-medium {
  background: #dbeafe !important;
  border-color: #93c5fd !important;
  color: #1d4ed8 !important;
}

body .cx-ticket-priority-high {
  background: #ffe4e6 !important;
  border-color: #fecdd3 !important;
  color: #be123c !important;
}

body .cx-ticket-priority-urgent {
  background: #f5e8ff !important;
  border-color: #e9d5ff !important;
  color: #7e22ce !important;
}

body .cx-ticket-status-select {
  min-width: 116px;
  border-radius: 8px !important;
  font-weight: 700 !important;
}

body .cx-ticket-status-open {
  background: #dbeafe !important;
  color: #1d4ed8 !important;
  border-color: #bfdbfe !important;
}

body .cx-ticket-status-processing {
  background: #ffedd5 !important;
  color: #c2410c !important;
  border-color: #fdba74 !important;
}

body .cx-ticket-status-resolved {
  background: #dcfce7 !important;
  color: #15803d !important;
  border-color: #bbf7d0 !important;
}

/* Fix revenue table spacing on large screens */
.rev-table {
  width: 100% !important;
  table-layout: auto !important;
}
.rev-table th,
.rev-table td {
  padding: 12px 16px !important;
  white-space: nowrap;
}
.rev-table th:first-child,
.rev-table td:first-child {
  width: 40px !important;
  text-align: center;
}
.rev-table th:nth-child(2),
.rev-table td:nth-child(2) {
  min-width: 180px;
  white-space: normal;
}

/* QR ngân hàng trong modal Chi tiết hoàn tiền: tăng 1.25× (120 → 150) */
.modal img[alt="QR"] {
  width: 150px !important;
  height: 150px !important;
}

/* Schedules pending view refresh */
.cx-schedule-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: space-between;
  margin: 0 0 18px;
  padding: 18px;
  border-radius: 18px;
  border: 1px solid #f4dfbf;
  background: linear-gradient(135deg, #fffaf0 0%, #ffffff 60%, #f7fbff 100%);
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.05);
  position: relative;
  z-index: 6;
  pointer-events: auto;
}

.cx-schedule-toolbar button {
  position: relative;
  z-index: 7;
  pointer-events: auto;
}

.cx-schedule-toolbar__summary {
  display: grid;
  flex: 1 1 620px;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}

.cx-schedule-toolbar__metric {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 96px;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid #e5edf6;
  background: rgba(255, 255, 255, 0.92);
}

.cx-schedule-toolbar__metric.is-total {
  border-color: #dbeafe;
  background: linear-gradient(180deg, #eff6ff 0%, #ffffff 100%);
}

.cx-schedule-toolbar__metric.is-create {
  border-color: #fde68a;
  background: linear-gradient(180deg, #fffbeb 0%, #ffffff 100%);
}

.cx-schedule-toolbar__metric.is-delete {
  border-color: #fecaca;
  background: linear-gradient(180deg, #fef2f2 0%, #ffffff 100%);
}

.cx-schedule-toolbar__metric.is-tip {
  border-style: dashed;
}

.cx-schedule-toolbar__metric-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #64748b;
}

.cx-schedule-toolbar__metric-value {
  font-size: 22px;
  line-height: 1.2;
  color: #0f172a;
}

.cx-schedule-toolbar__metric.is-tip .cx-schedule-toolbar__metric-value {
  font-size: 14px;
  line-height: 1.5;
  font-weight: 600;
}

.cx-schedule-toolbar__actions {
  display: flex;
  flex: 0 1 320px;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  align-content: flex-start;
}

.cx-schedule-toolbar__actions .btn {
  min-width: 132px;
  justify-content: center;
}

.cx-schedule-toolbar__actions .btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none !important;
}

.cx-schedule-toolbar__status {
  flex-basis: 100%;
  font-size: 12px;
  color: #64748b;
  text-align: right;
}

.cx-schedule-toolbar__status[data-tone="success"] {
  color: #047857;
}

.cx-schedule-toolbar__status[data-tone="warning"] {
  color: #b45309;
}

.cx-schedule-toolbar__status[data-tone="danger"] {
  color: #b91c1c;
}

.cx-schedule-pending-section {
  margin-top: 18px;
}

.cx-schedule-section-title {
  margin-bottom: 14px !important;
  font-size: 15px !important;
  font-weight: 700 !important;
  letter-spacing: -0.01em;
}

.cx-schedule-card-grid {
  display: grid !important;
  gap: 14px !important;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.cx-schedule-pending-card {
  height: 100%;
  padding: 16px !important;
  border: 1px solid #fde2b4 !important;
  border-radius: 18px !important;
  background: linear-gradient(180deg, #fffaf1 0%, #ffffff 100%) !important;
  box-shadow: 0 16px 32px rgba(245, 158, 11, 0.08) !important;
}

.cx-schedule-pending-card.is-delete {
  border-color: #fecaca !important;
  background: linear-gradient(180deg, #fff7f7 0%, #ffffff 100%) !important;
  box-shadow: 0 16px 32px rgba(220, 38, 38, 0.08) !important;
}

.cx-schedule-pending-card__row {
  display: grid !important;
  grid-template-columns: auto minmax(0, 1fr) !important;
  align-items: start !important;
  gap: 14px !important;
}

.cx-schedule-pending-card__info {
  min-width: 0;
}

.cx-schedule-pending-card__headline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.cx-schedule-pending-card__name {
  font-size: 17px !important;
  font-weight: 700 !important;
  color: #0f172a !important;
}

.cx-schedule-status-badge {
  display: inline-flex;
  align-items: center;
  height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  background: #fef3c7;
  color: #b45309;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.cx-schedule-status-badge.is-delete {
  background: #fee2e2;
  color: #b91c1c;
}

.cx-schedule-pending-card__meta {
  display: flex !important;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 0 !important;
}

.cx-schedule-meta-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 6px 10px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid #e2e8f0;
}

.cx-schedule-meta-chip.is-date {
  border-color: #fde68a;
  background: #fffdf6;
}

.cx-schedule-meta-chip.is-time {
  border-color: #bfdbfe;
  background: #f8fbff;
}

.cx-schedule-meta-chip__label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #94a3b8;
}

.cx-schedule-meta-chip__value {
  font-size: 12px;
  font-weight: 700;
  color: #0f172a;
}

.cx-schedule-pending-card__note {
  margin-top: 12px !important;
  padding: 10px 12px;
  border: 1px dashed #d6deea;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.92);
  color: #64748b !important;
  font-size: 12px !important;
  line-height: 1.5;
}

.cx-schedule-pending-card__actions {
  display: flex !important;
  grid-column: 1 / -1;
  padding-top: 12px;
  margin-top: 8px;
  border-top: 1px solid rgba(226, 232, 240, 0.9);
  flex-direction: row !important;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px !important;
  min-width: 0;
}

@media (max-width: 960px) {
  .cx-schedule-toolbar__actions {
    flex: 1 1 100%;
    justify-content: flex-start;
  }

  .cx-schedule-toolbar__status {
    text-align: left;
  }

  .cx-schedule-card-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .cx-schedule-toolbar {
    padding: 14px;
    border-radius: 16px;
  }

  .cx-schedule-card-grid {
    grid-template-columns: 1fr;
  }

  .cx-schedule-pending-card__row {
    grid-template-columns: 1fr !important;
  }

  .cx-schedule-pending-card__actions {
    width: 100%;
    justify-content: stretch;
  }

  .cx-schedule-pending-card__actions .btn {
    min-width: 0;
    flex: 1 1 100%;
    width: 100%;
  }
}

/* Revenue: person row drill-down */
.__rev_hint {
  padding: 8px 16px 0;
  font-size: 12px;
  color: var(--text-muted, #6b7280);
  font-style: italic;
}
.rev-table tbody tr.__rev_person_row {
  cursor: pointer;
}
.rev-table tbody tr.__rev_person_row:hover td {
  background: #eef5ff !important;
}
.rev-table tbody tr.__rev_open td {
  background: #e8f1ff !important;
}
tr.__rev_detail td {
  padding: 0 !important;
  background: #f8fafc !important;
  white-space: normal !important;
}
.__rev_detail_box {
  padding: 12px 16px 16px;
}
.__rev_detail_head {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  align-items: baseline;
  margin-bottom: 10px;
  font-size: 13px;
}
.__rev_detail_head strong {
  font-size: 14px;
  color: #111827;
}
.__rev_detail_head span,
.__rev_note,
.__rev_loading,
.__rev_empty {
  color: #6b7280;
  font-size: 12px;
}
.__rev_detail_scroll {
  overflow-x: auto;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #fff;
}
.__rev_detail_table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.__rev_detail_table th {
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  color: #6b7280;
  text-transform: uppercase;
  padding: 8px 12px;
  background: #f3f4f6;
  border-bottom: 1px solid #e5e7eb;
}
.__rev_detail_table td {
  padding: 8px 12px;
  border-bottom: 1px solid #f3f4f6;
  white-space: nowrap;
}
.__rev_detail_table td:nth-child(2) {
  white-space: normal;
  min-width: 160px;
}
.__rev_oid {
  font-size: 12px;
  color: #0066dd;
  background: #ebf5ff;
  padding: 1px 6px;
  border-radius: 4px;
}
.__rev_amt {
  font-weight: 700;
  color: #0066dd;
}
.__rev_st {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
}
.__rev_st_active { background: #d1fae5; color: #047857; }
.__rev_st_expired { background: #fee2e2; color: #b91c1c; }
.__rev_st_pending_payment { background: #fef3c7; color: #b45309; }
.__rev_st_cancelled { background: #f3f4f6; color: #4b5563; }

/* ===== Brand icons (#0066DD) + fluid / collapsible shell ===== */
html {
  font-size: clamp(13px, 0.32vw + 12px, 16px);
}
.cx-icon {
  color: #0066DD;
}
.cx-icon svg {
  display: block;
}
.nav-item:hover .cx-icon,
.nav-item.active .cx-icon {
  color: #0052B3;
}
.btn-icon.danger .cx-icon,
.btn-icon.danger:hover .cx-icon {
  color: #DC2626;
}

.sidebar,
.main {
  transition: width .2s ease, min-width .2s ease, max-width .2s ease, margin-left .2s ease;
}
.main {
  width: auto;
  min-width: 0;
}
.stats-grid,
.revenue-summary-grid {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)) !important;
}
.card-body,
.table-wrap,
.main {
  max-width: 100%;
}
.card-body,
.table-wrap {
  overflow-x: auto;
}

.cx-sidebar-toggle {
  position: absolute;
  right: -11px;
  top: 26px;
  z-index: 120;
  width: 22px;
  height: 22px;
  border: 1px solid var(--border-light, #d1d5db);
  border-radius: 999px;
  background: #fff;
  color: #0066DD;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 4px rgba(0,0,0,.08);
  padding: 0;
}
.cx-sidebar-toggle:hover {
  background: #EBF5FF;
}
.sidebar-header {
  position: relative;
}

@media (min-width: 992px) {
  .cx-sidebar-toggle {
    display: flex;
  }
  :root {
    --sidebar-w: clamp(200px, 18vw, 240px);
  }
  .sidebar {
    width: var(--sidebar-w) !important;
    min-width: var(--sidebar-w) !important;
    max-width: var(--sidebar-w) !important;
  }
  .main {
    margin-left: var(--sidebar-w) !important;
    padding: clamp(14px, 1.6vw, 26px) clamp(16px, 1.8vw, 26px) !important;
  }
  html.cx-sidebar-collapsed {
    --sidebar-w: 72px;
  }
  html.cx-sidebar-collapsed .sidebar-brand,
  html.cx-sidebar-collapsed .nav-section-title,
  html.cx-sidebar-collapsed .user-info {
    display: none !important;
  }
  html.cx-sidebar-collapsed .nav-item {
    justify-content: center;
    gap: 0;
    padding: 10px 8px;
    font-size: 0 !important;
  }
  html.cx-sidebar-collapsed .nav-icon {
    margin: 0;
  }
  html.cx-sidebar-collapsed .sidebar-header {
    justify-content: center;
    padding: 16px 8px;
  }
  html.cx-sidebar-collapsed .user-card {
    justify-content: center;
    padding: 10px 6px;
  }
  html.cx-sidebar-collapsed .nav-item[title]:hover::after {
    content: attr(title);
    position: absolute;
    left: calc(100% + 10px);
    top: 50%;
    transform: translateY(-50%);
    background: #111827;
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    padding: 6px 10px;
    border-radius: 8px;
    z-index: 200;
    pointer-events: none;
  }
  html.cx-sidebar-collapsed .nav-item {
    position: relative;
  }
  html.cx-sidebar-collapsed .cx-sidebar-toggle svg {
    transform: rotate(180deg);
  }
}

@media (max-width: 991px) {
  html.cx-sidebar-collapsed .sidebar,
  html.cx-sidebar-collapsed .main {
    width: auto;
  }
  html.cx-sidebar-collapsed {
    --sidebar-w: 0px;
  }
}
