/* ==========================================
   SALON PAYROLL DASHBOARD SCOPED STYLES (.pr-)
   Standardized with system theme & typography
   ========================================== */

/* 4 Summary KPI Stat Cards */
.pr-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 16px;
}

.pr-kpi-card {
  background-color: var(--bs-surface-bg, #ffffff);
  border: 1px solid var(--pos-border, #e2e8f0);
  border-radius: var(--radius-md, 10px);
  padding: 16px 18px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 128px;
  position: relative;
  transition: all 0.2s ease;
}

.pr-kpi-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.pr-kpi-card--profit {
  border: 1.5px solid #a7d99d;
  background-color: #f7fbf6;
}

.pr-kpi-card--profit-neg {
  border: 1.5px solid #fca5a5;
  background-color: #fef2f2;
}

.pr-kpi-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.pr-kpi-title-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pr-kpi-icon {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  flex-shrink: 0;
}

.pr-kpi-icon--profit {
  background-color: var(--bs-main, #3a9821);
  color: #ffffff;
}

.pr-kpi-icon--profit-neg {
  background-color: #ef4444;
  color: #ffffff;
}

.pr-kpi-icon--payout {
  background-color: #f3e8ff;
  color: #7c3aed;
}

.pr-kpi-icon--gross {
  background-color: #e0f2fe;
  color: #0284c7;
}

.pr-kpi-icon--sales {
  background-color: #ffedd5;
  color: #ea580c;
}

.pr-kpi-title {
  font-size: 12px;
  font-weight: 600;
  color: #374151;
  letter-spacing: 0.1px;
}

.pr-kpi-subtitle {
  font-size: 11px;
  color: #9ca3af;
  font-weight: 500;
}

.pr-kpi-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.pr-kpi-val-main {
  font-size: 22px;
  font-weight: 700;
  line-height: 28px;
  color: #111827;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.3px;
}

.pr-kpi-val-sub {
  font-size: 13px;
  font-weight: 600;
  color: #4b5563;
  font-variant-numeric: tabular-nums;
}

.pr-kpi-progress {
  width: 100%;
  height: 6px;
  background-color: #e5e7eb;
  border-radius: 9999px;
  margin-top: 10px;
  overflow: hidden;
  display: flex;
}

.pr-kpi-progress-bar {
  height: 100%;
  border-radius: 9999px;
  transition: width 0.3s ease;
}

.pr-kpi-progress-bar--green {
  background-color: var(--bs-main, #3a9821);
}

.pr-kpi-progress-bar--red {
  background-color: #ef4444;
}

.pr-kpi-progress-split {
  width: 100%;
  height: 6px;
  background-color: #e5e7eb;
  border-radius: 9999px;
  margin-top: 10px;
  overflow: hidden;
  display: flex;
}

.pr-kpi-progress-segment--check {
  background-color: #2563eb;
  height: 100%;
}

.pr-kpi-progress-segment--cash {
  background-color: #f59e0b;
  height: 100%;
}

.pr-kpi-legend {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  margin-top: 8px;
  font-variant-numeric: tabular-nums;
}

.pr-kpi-legend-item {
  display: flex;
  align-items: center;
  gap: 5px;
}

.pr-kpi-legend-dot {
  width: 7px;
  height: 7px;
  border-radius: 2px;
  display: inline-block;
}

.pr-kpi-legend-dot--check {
  background-color: #2563eb;
}

.pr-kpi-legend-dot--cash {
  background-color: #f59e0b;
}

.pr-kpi-footer-note {
  font-size: 11px;
  color: #9ca3af;
  margin-top: 18px;
}

.pr-summary-container {
  background-color: var(--bs-surface-bg, #ffffff);
  border: 1px solid var(--pos-border, #e2e8f0);
  border-radius: var(--radius-md, 8px);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  overflow-x: auto;
  margin-top: 4px;
}

.pr-summary-table,
.pr-table {
  width: 100%;
  border-collapse: collapse;
  font: 400 12px/18px "QP Sora", Sora, var(--font-family), sans-serif;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.pr-summary-table {
  table-layout: fixed;
}

.pr-summary-table col.pr-col-category {
  width: 32%;
}

.pr-summary-table col.pr-col-num {
  width: 17%;
}

.pr-summary-table th,
.pr-table th {
  background-color: #f7f7f5;
  color: #6b7280;
  font-weight: 600;
  font-size: 11px;
  line-height: 16.5px;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  padding: 8px 12px;
  border-bottom: 1px solid #e7e7e4;
  vertical-align: middle;
}

.pr-summary-table td,
.pr-table td {
  padding: 8px 12px;
  border-bottom: 1px solid #f1f1ee;
  color: var(--bs-body-color, #1f2328);
  font-weight: 400;
  vertical-align: middle;
  height: 38px;
  box-sizing: border-box;
}

.pr-table tr {
  height: 38px;
  box-sizing: border-box;
}

.pr-table tr:hover:not(.pr-row--highlight):not(.pr-row--total):not(.pr-row--header-total) {
  background-color: #f7fbf5;
}

/* ==========================================================================
   COMMISSION & WAGES TABLE STYLING (THEME MATCHING MAGICPATTERNS DESIGN)
   ========================================================================== */

/* Info banner above table (đồng bộ hoàn toàn với tab Stats .rpt-appt-hint) */
.pr-table-banner {
  display: flex;
  align-items: center;
  gap: 6px;
  background-color: #ffffff;
  border: none;
  border-bottom: 1px solid var(--pos-border, #e5ece2);
  border-radius: 0;
  padding: 7px 12px;
  margin-bottom: 0;
  font: 400 11.5px/17px "QP Sora", Sora, sans-serif;
  color: var(--pos-muted, #6b7280);
}

.pr-table-banner .rpt-appt-hint__icon {
  color: var(--pos-primary, #287e20);
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
}

/* Header Action button (Show/hide detail lines) */
.pr-btn-toggle-details {
  background: transparent;
  border: none;
  border-radius: 4px;
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #8a8f98;
  cursor: pointer;
  transition: all 0.15s ease;
  margin-left: 6px;
  padding: 0;
}

.pr-btn-toggle-details:hover {
  background-color: rgba(0, 0, 0, 0.05);
  color: #1f2328;
}

.pr-btn-toggle-details.is-active {
  color: var(--bs-main, #3a9821);
  background-color: var(--bs-main-light, #edf6eb);
}

/* Dòng tổng Total đầu bảng */
.pr-row--header-total {
  background-color: #f2f8ef !important;
  border-bottom: 1px solid #ddebd6 !important;
  height: 38px;
}

.pr-row--header-total td {
  font-weight: 600 !important;
  color: #1f2328 !important;
  border-bottom: 1px solid #ddebd6 !important;
  padding: 8px 12px;
  height: 38px;
  box-sizing: border-box;
}

/* Tech link styling */
.pr-tech-name-link {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  text-decoration: none;
  font-weight: 600;
  transition: all 0.15s ease;
}

.pr-tech-name-main {
  color: var(--bs-main, #3a9821);
  text-decoration: underline;
  text-decoration-color: rgba(58, 152, 33, 0.3);
  text-underline-offset: 3px;
}

.pr-tech-name-link:hover .pr-tech-name-main {
  text-decoration-color: var(--bs-main, #3a9821);
}

.pr-tech-name-sub {
  color: #8a8f98;
  font-weight: 400;
  font-size: 11.5px;
}

/* Guarantee Link Button */
button.pr-btn-guarantee,
.pr-btn-guarantee {
  background: transparent !important;
  border: none !important;
  padding: 0 !important;
  margin: 0 !important;
  height: auto !important;
  min-height: 0 !important;
  width: auto !important;
  display: inline-block !important;
  font-weight: 600;
  color: var(--bs-main, #3a9821) !important;
  text-decoration: underline;
  text-decoration-color: rgba(58, 152, 33, 0.4);
  text-underline-offset: 3px;
  cursor: pointer;
  font-variant-numeric: tabular-nums;
  font-family: inherit;
  font-size: inherit;
  line-height: inherit !important;
  text-align: right;
  border-radius: 0 !important;
}

.pr-dash-cell {
  display: inline-block;
  color: #b0b4ba;
  font-weight: 400;
  line-height: inherit;
  text-align: right;
}

/* Detail Modal modern card styling */
/* Subline in cells when details are expanded (Commission & Wages) */
.pr-cell-subline {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  font-size: 11px;
  line-height: 1.3;
  margin-top: 2px;
}

.pr-cell-subline-label {
  color: #8a8f98;
  font-size: 10px;
  text-transform: uppercase;
}

.pr-cell-subline-val {
  color: #374151;
  font-weight: 500;
}

/* Master total & header adjustments */
.pr-table-banner .pr-wages-hint-text {
  font-size: 12px;
  color: #4b5563;
}

.pr-modal-modern-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 16px;
  font-family: inherit;
}

.pr-modal-card {
  background: #ffffff;
  border: 1px solid #e7e7e4;
  border-radius: 12px;
  overflow: hidden;
}

.pr-modal-card--green {
  border-color: #ddebd6;
}

.pr-modal-card--green .pr-modal-card__header {
  background-color: #f2f8ef;
  border-bottom: 1px solid #ddebd6;
}

.pr-modal-card--green .pr-modal-card__icon-box {
  color: var(--bs-main, #287e20);
}

.pr-modal-card--blue {
  border-color: #dce6f7;
}

.pr-modal-card--blue .pr-modal-card__header {
  background-color: #f4f7fe;
  border-bottom: 1px solid #dce6f7;
}

.pr-modal-card--blue .pr-modal-card__icon-box {
  color: #3b5ba5;
}

.pr-modal-card--amber {
  border-color: #f3e2c7;
}

.pr-modal-card--amber .pr-modal-card__header {
  background-color: #fff9ef;
  border-bottom: 1px solid #f3e2c7;
}

.pr-modal-card--amber .pr-modal-card__icon-box {
  color: #b45309;
}

.pr-modal-card__icon-box {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  background-color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  flex-shrink: 0;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.pr-modal-card--blue-border {
  border-color: #dce6f7;
}

.pr-modal-card__header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background-color: #f4f7fe;
  border-bottom: 1px solid #dce6f7;
}

.pr-modal-card__header i {
  color: #3b5ba5;
  font-size: 13px;
}

.pr-modal-card__title {
  font-size: 13px;
  font-weight: 600;
  color: #1f2328;
}

.pr-modal-card__badge {
  font-size: 11px;
  color: #6b7280;
  margin-left: auto;
}

.pr-modal-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.pr-modal-grid-cell {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 7px 12px;
  border-bottom: 1px solid #f1f1ee;
  font-size: 12.5px;
}

.pr-modal-grid-cell:nth-child(odd) {
  border-right: 1px solid #f1f1ee;
}

.pr-modal-kpi-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  padding: 12px;
}

.pr-modal-kpi-box {
  border-radius: 8px;
  padding: 8px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.pr-modal-kpi-box--gross {
  background-color: #eef4ff;
  color: #3b5ba5;
}

.pr-modal-kpi-box--cashhold {
  background-color: #fff7ea;
  color: #b45309;
}

.pr-modal-kpi-box--net {
  background-color: var(--bs-main, #3a9821);
  color: #ffffff;
}

.pr-modal-kpi-label {
  font-size: 11px;
  font-weight: 500;
  opacity: 0.9;
}

.pr-modal-kpi-val {
  font-size: 17px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.pr-modal-kpi-note {
  font-size: 10.5px;
  font-variant-numeric: tabular-nums;
  opacity: 0.9;
}

/* Modal Commission & Wage Styling */
.pr-modal-section-title {
  color: var(--bs-main, #3a9821) !important;
  font-size: 13px;
  font-weight: 700;
  margin: 0 0 12px 0;
  text-transform: uppercase;
  letter-spacing: 0.2px;
}

.pr-modal-info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid #f1f5f9;
  font-size: 13px;
}

.pr-modal-info-label {
  color: #64748b;
  font-weight: 500;
}

.pr-modal-info-val {
  font-weight: 600;
  color: var(--bs-body-color, #1e293b);
  font-variant-numeric: tabular-nums;
}

.pr-modal-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.pr-modal-table th {
  background-color: #f7f7f5;
  color: #6b7280;
  font-weight: 600;
  font-size: 11px;
  padding: 8px 10px;
  border-bottom: 1px solid #e7e7e4;
  text-align: right;
}

.pr-modal-table th:first-child,
.pr-modal-table th:nth-child(2) {
  text-align: left;
}

.pr-modal-table td {
  padding: 8px 10px;
  border-bottom: 1px solid #f1f1ee;
  color: var(--bs-body-color, #1f2328);
  text-align: right;
}

.pr-modal-table td:first-child,
.pr-modal-table td:nth-child(2) {
  text-align: left;
}

.pr-modal-table tfoot tr {
  background-color: var(--bs-main-light, #edf6eb);
  font-weight: 700;
  border-top: 1px solid #cce2c6;
}

.pr-modal-table tfoot td {
  color: var(--bs-body-color, #1f2328);
}

.pr-summary-table tr:hover:not(.pr-row--highlight):not(.pr-row--total) {
  background-color: #f7fbf5;
}

/* Hàng tiêu điểm quan trọng */
.pr-row--sales {
  background-color: var(--bs-surface-bg, #ffffff);
  font-weight: 600 !important;
}

.pr-row--sales td {
  font-weight: 600 !important;
  color: var(--bs-body-color, #1f2328);
}

.pr-row--net-payout {
  background-color: #fafbfc;
  border-top: 1px solid #e2e8f0;
}

.pr-row--net-payout td {
  font-weight: 600 !important;
}

.pr-row--profit {
  background-color: var(--bs-main-light, #edf6eb) !important;
  border-top: 1px solid #ddebd6 !important;
  border-bottom: 1px solid #ddebd6 !important;
}

.pr-row--profit td {
  font-weight: 700 !important;
  color: var(--bs-body-color, #1f2328) !important;
}

.pr-row--percentage td {
  padding-top: 6px;
  padding-bottom: 12px;
}

/* Highlight (Loan...) theo theme */
.pr-row--highlight {
  background-color: var(--bs-main-light, #edf6eb) !important;
}

.pr-row--highlight td {
  color: var(--bs-body-color, #1f2328);
}

/* Typography & colors */
.pr-font-bold {
  font-weight: 600 !important;
}

.pr-text-muted {
  color: #6b7280 !important;
}

.pr-text-payout {
  color: #c2410c !important; /* Dịu mắt hơn màu hồng cứng */
  font-weight: 500;
}

.pr-text-profit-pos {
  color: var(--bs-main, #3a9821) !important;
  font-weight: 600;
}

.pr-text-profit-neg {
  color: #dc2626 !important;
  font-weight: 600;
}

.pr-profit-badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 11.5px;
  font-weight: 700;
  line-height: 1;
}

.pr-profit-badge--pos {
  background: var(--bs-main-light, #edf6eb);
  color: var(--bs-main, #3a9821);
  border: 1px solid color-mix(in srgb, var(--bs-main, #3a9821) 30%, transparent);
}

.pr-profit-badge--neg {
  background: #fef2f2;
  color: #dc2626;
  border: 1px solid #fecaca;
}

.pr-text-pink {
  color: #c2410c !important;
}

.pr-text-cyan {
  color: var(--bs-main, #3a9821) !important;
}

/* Top Bar Payroll Actions Styling */
.rpt-payroll-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.rpt-payroll-action-btn {
  background: none;
  border: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  color: #334155;
  cursor: pointer;
  padding: 2px 6px;
  transition: color 0.15s ease;
}

.rpt-payroll-action-btn:hover {
  color: #3bbbc4;
}

.rpt-payroll-action-btn i {
  font-size: 18px;
}

.rpt-payroll-action-btn span {
  font-size: 10px;
  font-weight: 700;
  color: #64748b;
}

.rpt-payroll-action-btn:hover span {
  color: #3bbbc4;
}

/* --- LAYOUT CHÍNH CHO TAB PAYROLL SETTING (MAGIC DESIGN PARITY) --- */
.pr-setting-wrapper {
  display: flex;
  flex-direction: column;
  flex: 1 1 0%;
  min-height: 0;
  width: 100%;
  height: 100%;
  max-height: 100%;
  background-color: var(--pos-surface2, #f8fafc);
  box-sizing: border-box;
  overflow: hidden;
}

/* Header bar đồng bộ Magic Patterns */
.pr-setting-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: #ffffff;
  border-bottom: 1px solid #e7e7e4;
  flex-shrink: 0;
}

.pr-setting-title {
  font-size: 14px;
  font-weight: 600;
  line-height: 20px;
  color: #1f2328;
  margin: 0;
}

.pr-setting-subtitle {
  font-size: 11px;
  line-height: 16px;
  color: #8a8f98;
  margin: 0;
}

.pr-setting-container {
  flex: 1 1 0%;
  min-height: 0;
  overflow-y: auto;
  padding: 12px 16px;
  background-color: transparent;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-sizing: border-box;
}

/* 3 Cột trên cùng */
.pr-setting-top-grid {
  display: grid;
  grid-template-columns: 1.15fr 1fr 1fr;
  gap: 12px;
}

@media (max-width: 1200px) {
  .pr-setting-top-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 860px) {
  .pr-setting-top-grid {
    grid-template-columns: 1fr;
  }
}

/* Card Block chung */
.pr-setting-card-block {
  background: #ffffff;
  border: 1px solid #e7e7e4;
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
}

.pr-setting-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid #f1f1ee;
  background: #ffffff;
}

/* Icon wrap với các màu pastel */
.pr-setting-icon-wrap {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  font-size: 14px;
  flex-shrink: 0;
}

.pr-setting-icon--green {
  background-color: #f2f8ef;
  color: var(--bs-main, #3a9821);
}

.pr-setting-icon--blue {
  background-color: #eef4ff;
  color: #3b5ba5;
}

.pr-setting-icon--orange {
  background-color: #fff7ea;
  color: #b45309;
}

.pr-setting-icon--purple {
  background-color: #f5f0ff;
  color: #6d4ac7;
}

.pr-setting-icon--gray {
  background-color: #f3f3f1;
  color: #4b5563;
}

.pr-setting-header-titles {
  min-width: 0;
  flex: 1;
}

.pr-setting-card-title {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  color: #1f2328;
  line-height: 1.3;
}

.pr-setting-card-sub {
  margin: 2px 0 0 0;
  font-size: 11px;
  color: #8a8f98;
  line-height: 1.2;
}

.pr-setting-card-body {
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
}

/* Card 1: Overview fields */
.pr-setting-overview-body {
  gap: 10px;
}

.pr-setting-field-row {
  display: grid;
  grid-template-columns: 110px 1fr;
  align-items: center;
  gap: 12px;
}

.pr-setting-field-label {
  font-size: 13px;
  color: #4b5563;
  font-weight: 400;
}

.pr-setting-select-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.pr-setting-select {
  width: 100%;
  height: 36px;
  border: 1px solid #e2e4e8;
  border-radius: 8px;
  background-color: #ffffff;
  padding: 0 32px 0 12px;
  font-size: 13px;
  color: #1f2328;
  outline: none;
  cursor: pointer;
  appearance: none;
  transition: border-color 0.15s ease;
}

.pr-setting-select:focus {
  border-color: var(--bs-main, #3a9821);
}

.pr-setting-select:disabled {
  background-color: #f7f7f5;
  cursor: not-allowed;
  color: #1f2328;
  font-weight: 600;
}

.pr-setting-select-chevron {
  position: absolute;
  right: 12px;
  pointer-events: none;
  font-size: 11px;
  color: #6b7280;
}

.pr-setting-help-note {
  background-color: #f7fbf5;
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 11px;
  color: #4b5563;
  line-height: 1.4;
  margin-top: 4px;
}

/* Card 2 & 3: Lists (Checkbox & Radio) */
.pr-setting-check-list,
.pr-setting-radio-list {
  padding: 6px;
  gap: 2px;
}

.pr-setting-item-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px;
  border-radius: 8px;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.pr-setting-item-row:hover {
  background-color: #f7f7f5;
}

.pr-setting-item-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}

.pr-setting-item-name {
  font-size: 13px;
  font-weight: 500;
  color: #1f2328;
  line-height: 1.3;
}

.pr-setting-item-name--bold {
  font-weight: 600;
}

.pr-setting-item-desc {
  font-size: 11px;
  color: #8a8f98;
  line-height: 1.2;
}

/* Custom Checkbox & Radio */
.pr-setting-custom-check {
  width: 18px !important;
  height: 18px !important;
  visibility: visible !important;
  opacity: 1 !important;
  display: inline-block !important;
  position: static !important;
  appearance: auto !important;
  -webkit-appearance: checkbox !important;
  cursor: pointer;
  accent-color: var(--bs-main, #3a9821);
  border-radius: 5px;
  margin: 0 !important;
  flex-shrink: 0;
}

.pr-setting-custom-radio {
  width: 18px !important;
  height: 18px !important;
  visibility: visible !important;
  opacity: 1 !important;
  display: inline-block !important;
  position: static !important;
  appearance: auto !important;
  -webkit-appearance: radio !important;
  cursor: pointer;
  accent-color: var(--bs-main, #3a9821);
  margin: 0 !important;
  flex-shrink: 0;
}

/* Cột 3 Stack: 2 Card xếp dọc */
.pr-setting-col-stack {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* Card 4: Tips Management Body */
.pr-setting-tips-body {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
}

/* iOS-style Switch Toggle */
.pr-setting-switch {
  position: relative;
  display: inline-block;
  width: 36px;
  height: 20px;
  flex-shrink: 0;
  margin: 0;
  cursor: pointer;
}

.pr-setting-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.pr-setting-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #cbd5e1;
  transition: 0.2s;
  border-radius: 20px;
}

.pr-setting-slider:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 2px;
  bottom: 2px;
  background-color: white;
  transition: 0.2s;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.pr-setting-switch input:checked + .pr-setting-slider {
  background-color: var(--bs-main, #3a9821);
}

.pr-setting-switch input:checked + .pr-setting-slider:before {
  transform: translateX(16px);
}

/* PHẦN ADJUSTMENT REASONS SECTION */
.pr-setting-reasons-block {
  background: #ffffff;
  border: 1px solid #e7e7e4;
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
}

.pr-setting-reasons-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  padding: 10px;
}

@media (max-width: 1200px) {
  .pr-setting-reasons-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .pr-setting-reasons-grid {
    grid-template-columns: 1fr;
  }
}

.pr-setting-reason-card {
  border: 1px solid #e7e7e4;
  border-radius: 10px;
  overflow: hidden;
  background: #ffffff;
  display: flex;
  flex-direction: column;
  position: relative;
  min-height: 140px;
}

.pr-setting-reason-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 12px;
  border-bottom: 1px solid #e2e8f0;
}

.pr-setting-reason-title-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pr-setting-reason-title {
  font-size: 13px;
  font-weight: 600;
}

.pr-setting-count-badge {
  background: rgba(255, 255, 255, 0.85);
  padding: 1px 6px;
  border-radius: 12px;
  font-size: 10px;
  font-weight: 600;
  color: #4b5563;
  font-variant-numeric: tabular-nums;
}

/* Phối màu đặc thù từng card theo Magic Patterns design */
.pr-setting-reason--bonus .pr-setting-reason-card-header {
  background-color: #eef7ea;
  border-color: #ddebd6;
  color: #2f7322;
}
.pr-setting-reason--bonus .pr-setting-reason-title { color: #2f7322; }
.pr-setting-reason--bonus .pr-edit-reason-btn { color: #2f7322; }
.pr-setting-reason--bonus .pr-setting-bullet { background-color: var(--bs-main, #3a9821); }

.pr-setting-reason--reimb .pr-setting-reason-card-header {
  background-color: #eef4ff;
  border-color: #dce6f7;
  color: #3b5ba5;
}
.pr-setting-reason--reimb .pr-setting-reason-title { color: #3b5ba5; }
.pr-setting-reason--reimb .pr-edit-reason-btn { color: #3b5ba5; }
.pr-setting-reason--reimb .pr-setting-bullet { background-color: #5b7bd5; }

.pr-setting-reason--loan .pr-setting-reason-card-header {
  background-color: #f3eeff;
  border-color: #e6def8;
  color: #6d4ac7;
}
.pr-setting-reason--loan .pr-setting-reason-title { color: #6d4ac7; }
.pr-setting-reason--loan .pr-edit-reason-btn { color: #6d4ac7; }
.pr-setting-reason--loan .pr-setting-bullet { background-color: #8b6bdb; }

.pr-setting-reason--deduction .pr-setting-reason-card-header {
  background-color: #fff1e8;
  border-color: #f6dfcf;
  color: #c2410c;
}
.pr-setting-reason--deduction .pr-setting-reason-title { color: #c2410c; }
.pr-setting-reason--deduction .pr-edit-reason-btn { color: #c2410c; }
.pr-setting-reason--deduction .pr-setting-bullet { background-color: #e8743b; }

.pr-edit-reason-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  font-size: 12px;
  transition: background-color 0.15s ease;
}

.pr-edit-reason-btn:hover {
  background-color: rgba(255, 255, 255, 0.7);
}

.pr-setting-reason-list {
  list-style: none;
  padding: 4px 8px;
  margin: 0;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.pr-setting-reason-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 6px;
  border-bottom: 1px solid #f1f1ee;
  font-size: 13px;
  color: #1f2328;
}

.pr-setting-reason-item:last-child {
  border-bottom: none;
}

.pr-setting-bullet {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

.pr-setting-reason-text {
  flex: 1;
  min-width: 0;
}

/* FOOTER BAR GẮN CỐ ĐỊNH Ở ĐÁY TRANG */
.pr-setting-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  min-height: 56px;
  padding: 10px 24px;
  border-top: 1px solid #e7e7e4;
  background: #ffffff;
  flex: 0 0 auto;
  flex-shrink: 0;
  width: 100%;
  box-sizing: border-box;
  z-index: 10;
  position: relative;
}

.pr-setting-footer-status {
  margin-right: auto;
  font-size: 13px;
  color: #8a8f98;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.pr-setting-footer-status.has-changes {
  color: #c2410c;
}

.pr-btn-discard-setting {
  background-color: #ffffff;
  color: #374151;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  height: 38px;
  padding: 0 18px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.pr-btn-discard-setting:hover {
  background-color: #f3f4f6;
  border-color: #9ca3af;
}

.pr-btn-save-setting {
  background-color: var(--bs-main, #3a9821);
  color: #ffffff;
  border: none;
  border-radius: 8px;
  height: 38px;
  padding: 0 24px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.pr-btn-save-setting:hover:not(:disabled) {
  background-color: #2f7322;
}

.pr-btn-save-setting:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  background-color: var(--bs-main, #3a9821);
}

/* --- POPOVER EDIT REASON --- */
.pr-popover {
  position: absolute;
  top: -1px;
  left: -1px;
  right: -1px;
  background: #fff;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  z-index: 10;
  display: none;
  padding-bottom: 12px;
}

.pr-popover-header {
  text-align: center;
  color: #3bbbc4;
  font-weight: bold;
  font-size: 13px;
  padding: 12px;
  border-bottom: 1px solid #f1f5f9;
}

.pr-popover-body {
  padding: 12px 16px;
  max-height: 200px;
  overflow-y: auto;
}

.pr-reason-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  border-bottom: 1px solid #f1f5f9;
  padding-bottom: 4px;
}

.pr-del-reason-btn {
  background: #ef4444;
  color: #fff;
  border: none;
  border-radius: 4px;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 10px;
}

.pr-reason-input {
  border: none;
  outline: none;
  font-size: 13px;
  color: #334155;
  flex: 1;
  width: 100%;
}

.pr-add-reason-wrapper {
  display: flex;
  justify-content: flex-end;
  padding: 0 16px;
  margin-bottom: 16px;
}

.pr-add-reason-btn {
  color: #3bbbc4;
  background: transparent;
  border: none;
  font-size: 16px;
  cursor: pointer;
}

.pr-popover-footer {
  display: flex;
  justify-content: center;
  gap: 10px;
  padding: 0 16px;
}

.pr-btn-cancel {
  background: #f97316;
  color: #fff;
  border: none;
  padding: 6px 16px;
  border-radius: 4px;
  font-weight: bold;
  font-size: 12px;
  cursor: pointer;
}

.pr-btn-save {
  background: #3bbbc4;
  color: #fff;
  border: none;
  padding: 6px 16px;
  border-radius: 4px;
  font-weight: bold;
  font-size: 12px;
  cursor: pointer;
}

/* ==========================================
   ADJUSTMENTS MODAL SCOPED STYLES (.adj-)
   ========================================== */
.adj-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(2px);
  z-index: 99999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.adj-modal-container {
  background: #ffffff;
  border-radius: 8px;
  width: 95%;
  max-width: 1200px;
  height: 85vh;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.15), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  overflow: hidden;
  font-family: inherit;
}

/* Modal Header */
.adj-modal-header {
  padding: 16px 20px 12px 20px;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: #ffffff;
}

.adj-modal-header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
}

.adj-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.adj-date-nav {
  display: flex;
  align-items: center;
  height: 34px;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  overflow: hidden;
  background: #ffffff;
  box-sizing: border-box;
}

.adj-date-nav-btn {
  border: none;
  background: #ffffff;
  height: 100%;
  padding: 0 12px;
  cursor: pointer;
  color: #475569;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s;
  box-sizing: border-box;
  outline: none;
}

.adj-date-nav-btn:hover {
  background: #f1f5f9;
  color: #1e293b;
}

.adj-date-nav-btn + .adj-date-nav-btn {
  border-left: 1px solid #e2e8f0;
}

.adj-date-display {
  height: 100%;
  padding: 0 16px;
  border-left: 1px solid #e2e8f0;
  border-right: 1px solid #e2e8f0;
  font-size: 13px;
  font-weight: 700;
  color: #3bbbc4;
  display: flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  box-sizing: border-box;
  background: #ffffff;
}

.adj-period-select {
  height: 34px;
  padding: 0 28px 0 12px;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 700;
  color: #334155;
  background: #ffffff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23475569'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2.5' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E") no-repeat right 8px center;
  background-size: 14px;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  cursor: pointer;
  box-sizing: border-box;
  outline: none;
  transition: border-color 0.15s;
}

.adj-period-select:hover {
  border-color: #94a3b8;
}

.adj-period-select:focus {
  border-color: #3bbbc4;
}

.adj-header-title {
  font-size: 16px;
  font-weight: 800;
  color: #3bbbc4;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}

.adj-header-right-actions {
  display: flex;
  align-items: center;
  gap: 18px;
  color: #334155;
}

.adj-header-icon {
  font-size: 18px;
  cursor: pointer;
  color: #334155;
  transition: color 0.15s;
}

.adj-header-icon:hover {
  color: #3bbbc4;
}

.adj-modal-header-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
}

/* ADD NEW + Button & Dropdown */
.adj-add-new-wrapper {
  position: relative;
}

.adj-btn-add-new {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #287e20;
  color: #ffffff;
  border: 1px solid #236f1c;
  padding: 8px 14px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s ease;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.adj-btn-add-new:hover {
  background: #1f6419;
}

.adj-btn-add-new .adj-btn-chevron {
  font-size: 11px;
  margin-left: 2px;
  transition: transform 0.2s ease;
}

.adj-btn-add-new.is-open .adj-btn-chevron {
  transform: rotate(180deg);
}

.adj-add-new-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  background: #ffffff;
  border: 1px solid #e7e7e4;
  border-radius: 10px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12);
  z-index: 1050;
  width: 250px;
  display: none;
  padding: 4px;
  overflow: hidden;
}

.adj-dropdown-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 6px;
  text-decoration: none;
  transition: background 0.12s ease;
  cursor: pointer;
}

.adj-dropdown-item:hover {
  background: #f7f7f5;
}

.adj-dropdown-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-top: 5px;
  flex-shrink: 0;
}

.adj-dropdown-dot--bonus {
  background: #287e20;
}

.adj-dropdown-dot--reimbursement {
  background: #3b5ba5;
}

.adj-dropdown-dot--deduction {
  background: #e06a2e;
}

.adj-dropdown-dot--loan {
  background: #7c5bd3;
}

.adj-dropdown-item-content {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.adj-dropdown-item-title {
  font-size: 12.5px;
  font-weight: 600;
  color: #1f2328;
  line-height: 1.3;
}

.adj-dropdown-item-desc {
  font-size: 11px;
  color: #8a8f98;
  line-height: 1.3;
  margin-top: 1px;
}

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

.adj-dropdown-item:hover {
  background: #f8fafc;
  color: #3bbbc4;
}

/* Modal Body & Table */
.adj-modal-body {
  padding: 0;
  overflow-y: auto;
  flex: 1;
}

.adj-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}

.adj-table th {
  background: #f8fafc;
  color: #475569;
  font-weight: 800;
  font-size: 11px;
  text-transform: uppercase;
  padding: 12px 14px;
  border-bottom: 2px solid #e2e8f0;
  position: sticky;
  top: 0;
  z-index: 10;
  white-space: nowrap;
}

.adj-table td {
  padding: 10px 14px;
  border-bottom: 1px solid #f1f5f9;
  color: #1e293b;
  vertical-align: top;
  font-weight: 600;
}

.adj-table tbody tr:hover {
  background: #f0fdfa;
}

.adj-table .adj-total-row {
  background: #fff;
  font-weight: 800;
  border-bottom: 2px solid #e2e8f0;
}

/* Text Utility Classes */
.adj-text-orange {
  color: #f97316 !important;
  font-weight: 700;
}

.adj-text-cyan {
  color: #3bbbc4 !important;
  font-weight: 700;
}

.adj-sub-detail {
  display: none;
  font-size: 11px;
  margin-top: 3px;
  font-weight: 600;
}/* Adjustment interactions: fixed columns, stable scrollbar, scoped nested dialogs. */
#adjustmentsModalOverlay .adj-table { table-layout: fixed; min-width: 900px; }
#adjustmentsModalOverlay .adj-table th { white-space: normal; overflow-wrap: anywhere; }
#adjustmentsModalOverlay .adj-table td { overflow-wrap: anywhere; }
#adjustmentsModalOverlay .adj-modal-body { overflow: auto; scrollbar-gutter: stable; }
#adjustmentsModalOverlay .adj-date-display { cursor: pointer; border-top: 0; border-bottom: 0; }
#adjustmentsModalOverlay .adj-staff-detail { border: 0; padding: 0; background: transparent; font: inherit; color: inherit; text-align: left; cursor: pointer; }
#adjustmentsModalOverlay .adj-staff-detail:hover { color: #2ea7b0; text-decoration: underline; }
#adjSearchBtn { border: 0; background: transparent; padding: 0; }
#adjSearchInput { width: 100%; border: none !important; background: transparent; padding: 0; outline: none; }
.adj-child-overlay { position: fixed; inset: 0; background: #0f172a66; z-index: 100000; display: flex; align-items: center; justify-content: center; padding: 20px; }
.adj-child { background: white; color: #334155; border-radius: 8px; width: min(650px,95vw); max-height: 90vh; display: flex; flex-direction: column; box-shadow: 0 15px 40px #0003; }
.adj-child header,.adj-child footer { display: flex; align-items: center; justify-content: space-between; padding: 16px; gap: 12px; border-bottom: 1px solid #e2e8f0; }
.adj-child h3 { margin: 0; font-size: 17px; color: #2ea7b0; }
.adj-child-body { padding: 18px; overflow: auto; }
.adj-child label { display: block; font-weight: 600; margin-bottom: 14px; }
.adj-child label input,.adj-child label select { display: block; width: 100%; padding: 8px; border: 1px solid #cbd5e1; border-radius: 4px; margin-top: 5px; }
.adj-child label select[multiple] { min-height: 130px; }
.adj-child button { border: 1px solid #cbd5e1; border-radius: 4px; background: #fff; padding: 7px 12px; cursor: pointer; }
.adj-child button[type=submit],#adjDateApply { background: #3bbbc4; color: white; }
.adj-child button:disabled { opacity: .5; cursor: not-allowed; }
.adj-detail-table { width: 100%; border-collapse: collapse; margin-bottom: 18px; }
.adj-detail-table th,.adj-detail-table td { text-align: left; padding: 8px; border-bottom: 1px solid #e2e8f0; }
#adjCreateStatus { color: #b45309; }
@media(max-width: 700px) { #adjustmentsModalOverlay { padding: 8px; } #adjustmentsModalOverlay .adj-modal-container { width: 100%; } #adjustmentsModalOverlay .adj-modal-header-top { flex-wrap: wrap; gap: 12px; } #adjustmentsModalOverlay .adj-header-left { flex-wrap: wrap; } }
#adjustmentsModalOverlay .btn-toggle-eye { border: 0; background: transparent; min-width: 24px; min-height: 24px; padding: 2px; }
.adj-notice-dialog { z-index: 100002 !important; }
#adjSearchBtn { min-width: 24px; min-height: 24px; }
/* Reuse Report date-picker classes above the independently owned Adjustment overlay. */
#adjDateEditor { position: fixed; z-index: 100001; max-width: calc(100vw - 16px); }
#adjDateEditor .date-picker-modal { width: 580px; max-width: calc(100vw - 16px); box-sizing: border-box; }
@media(max-width: 620px) {
  #adjDateEditor { max-height: calc(100vh - 16px); overflow: auto; }
  #adjDateEditor .date-picker__calendars { gap: 6px; }
  #adjDateEditor .calendar-box { padding: 6px 3px; }
  #adjDateEditor .date-picker-modal { padding: 10px; }
  #adjDateEditor .day-cell { width: 23px; height: 28px; }
}

/* Explicit close control: independent of icon fonts and inherited button text colors. */
.adj-child > header > .adj-child-close {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; min-width: 36px; flex: 0 0 36px;
  padding: 0; margin: 0; border: 0; border-radius: 6px;
  background: transparent; color: #64748b; line-height: 1;
}
.adj-child > header > .adj-child-close svg { display: block; pointer-events: none; }
.adj-child > header > .adj-child-close:hover { color: #334155; background: #f1f5f9; }
.adj-child > header > .adj-child-close:focus-visible { outline: 2px solid #2ea7b0; outline-offset: 2px; }

/* Employee adjustment detail: compact ledger, scoped to this dialog only. */
#adjEmployeeDetail { padding: 24px; }
#adjEmployeeDetail .adj-child { width: min(720px, 100%); max-height: min(88vh, 840px); border-radius: 16px; overflow: hidden; font-size: 14px; }
#adjEmployeeDetail .adj-child > header { flex-shrink: 0; padding: 18px 24px; background: #fff; }
#adjEmployeeDetail .adj-child h3 { color: #164e56; font-size: 18px; font-weight: 700; line-height: 1.4; }
#adjEmployeeDetail .adj-child-body { min-height: 0; padding: 20px 24px; background: #f7f9fb; overscroll-behavior: contain; scrollbar-gutter: stable; }
#adjEmployeeDetail .adj-detail-period { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin-bottom: 16px; }
#adjEmployeeDetail .adj-detail-period > span { font-size: 11px; font-weight: 700; letter-spacing: .08em; color: #64748b; }
#adjEmployeeDetail .adj-detail-period > strong { font-weight: 600; color: #334155; font-size: 13px; }
#adjEmployeeDetail .adj-detail-fees { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 18px; }
#adjEmployeeDetail .adj-detail-fees > div { border: 1px solid #dce6e9; background: #fff; border-radius: 10px; padding: 14px 16px; display: flex; flex-direction: column; gap: 5px; }
#adjEmployeeDetail .adj-detail-fees > div > span { font-size: 13px; color: #526275; font-weight: 600; }
#adjEmployeeDetail .adj-detail-fees strong { font-size: 22px; font-weight: 700; line-height: 1.3; }
#adjEmployeeDetail .adj-detail-groups { display: grid; gap: 10px; }
#adjEmployeeDetail .adj-detail-group { border: 1px solid #e0e7ef; border-radius: 10px; background: #fff; overflow: hidden; }
#adjEmployeeDetail summary { display: flex; align-items: center; list-style: none; gap: 14px; padding: 13px 16px; min-height: 58px; box-sizing: border-box; cursor: pointer; }
#adjEmployeeDetail summary::-webkit-details-marker { display: none; }
#adjEmployeeDetail summary:hover { background: #f0f9fa; }
#adjEmployeeDetail summary:focus-visible { outline: 2px solid #2ea7b0; outline-offset: -3px; border-radius: 9px; }
#adjEmployeeDetail .adj-detail-group-label { flex: 1; font-weight: 700; font-size: 14px; }
#adjEmployeeDetail .adj-detail-group-label small { display: block; color: #64748b; font-size: 12px; font-weight: 400; margin-top: 2px; }
#adjEmployeeDetail summary > strong { font-size: 15px; font-variant-numeric: tabular-nums; }
#adjEmployeeDetail .adj-detail-chevron { width: 7px; height: 7px; border-right: 1.5px solid #64748b; border-bottom: 1.5px solid #64748b; transform: rotate(45deg); margin: -4px 2px 0 3px; flex-shrink: 0; }
#adjEmployeeDetail details[open] > summary .adj-detail-chevron { transform: rotate(225deg); margin-top: 3px; }
#adjEmployeeDetail details[open] > summary { border-bottom: 1px solid #e8edf2; }
#adjEmployeeDetail .adj-detail-table-wrap { padding: 0 14px 8px; }
#adjEmployeeDetail .adj-detail-table { margin: 0; table-layout: fixed; font-family: inherit; font-size: 13px; }
#adjEmployeeDetail .adj-detail-table th { color: #64748b; font-size: 11px; font-weight: 600; background: #fff; }
#adjEmployeeDetail .adj-detail-table th:first-child { width: 28%; }
#adjEmployeeDetail .adj-detail-table th:last-child { width: 24%; }
#adjEmployeeDetail .adj-detail-table th,#adjEmployeeDetail .adj-detail-table td { padding: 10px 6px; overflow-wrap: anywhere; font-family: inherit; }
#adjEmployeeDetail .adj-detail-table th:last-child,#adjEmployeeDetail .adj-detail-table td:last-child { text-align: right; font-variant-numeric: tabular-nums; }
#adjEmployeeDetail .adj-detail-table tbody tr:last-child td { border-bottom: 0; }
#adjEmployeeDetail .adj-detail-empty { margin: 0; padding: 14px 16px; color: #64748b; font-size: 13px; }
#adjEmployeeDetail .adj-detail-loan-metrics { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); padding: 14px 16px; gap: 12px; background: #f8fafc; }
#adjEmployeeDetail .adj-detail-loan-metrics span { display: block; color: #64748b; font-size: 12px; }
#adjEmployeeDetail .adj-detail-loan-metrics strong { font-size: 14px; font-variant-numeric: tabular-nums; }
#adjEmployeeDetail .adj-detail-loan-ledger h4 { font-size: 12px; font-weight: 700; margin: 14px 16px 4px; color: #475569; }
#adjEmployeeDetail .adj-detail-balance { margin: 0; padding: 12px 16px; font-weight: 600; border-top: 1px solid #e8edf2; }
#adjEmployeeDetail .adj-detail-footer { flex-shrink: 0; border: 0; border-top: 1px solid #dce6e9; padding: 18px 24px; background: #edf8f8; gap: 16px; }
#adjEmployeeDetail .adj-detail-footer span { display: block; color: #164e56; font-size: 12px; letter-spacing: .04em; font-weight: 700; }
#adjEmployeeDetail .adj-detail-footer small { color: #526775; display: block; font-size: 12px; margin-top: 3px; }
#adjEmployeeDetail .adj-detail-total { color: #164e56; font-size: 27px; font-variant-numeric: tabular-nums; line-height: 1.2; overflow-wrap: anywhere; }
#adjEmployeeDetail .adj-detail-total.adj-detail-negative { color: #c2410c; }
@media(max-width: 600px) {
  #adjEmployeeDetail { padding: 12px; }
  #adjEmployeeDetail .adj-child { max-height: calc(100dvh - 24px); border-radius: 12px; }
  #adjEmployeeDetail .adj-child > header { padding: 12px 16px; }
  #adjEmployeeDetail .adj-child-body { padding: 16px 12px; }
  #adjEmployeeDetail .adj-child h3 { font-size: 16px; }
  #adjEmployeeDetail .adj-detail-fees { gap: 8px; }
  #adjEmployeeDetail .adj-detail-fees > div { padding: 12px; }
  #adjEmployeeDetail .adj-detail-fees strong { font-size: 20px; }
  #adjEmployeeDetail .adj-detail-footer { padding: 16px; }
  #adjEmployeeDetail .adj-detail-total { font-size: 24px; }
}

/* Commission-only toolbar filter; never changes payroll totals or selection. */
#payrollCommissionSearchWrap { align-items:center; gap:8px; border:1px solid #d5e0e5; border-radius:6px; background:#fff; padding:7px 10px; color:#64748b; margin:0 10px 0 0; }
#payrollCommissionSearchWrap:not([style*="none"]) { display:inline-flex !important; }
#payrollCommissionSearch { border:0; outline:none; font:inherit; font-size:13px; color:#334155; background:transparent; min-height:24px; }
#payrollCommissionSearchWrap:focus-within { border-color:#2ea7b0; box-shadow:0 0 0 2px #2ea7b022; }
#tabContentContainer .pr-commission-tech-row[hidden],#payrollCommissionSearchEmpty[hidden] { display:none !important; }
@media(max-width:600px) { #payrollActions { flex-wrap:wrap; } #payrollCommissionSearch { width:120px; max-width:35vw; } }

/* ==========================================================================
   NEW REDESIGN STYLING (COMMISSION GRID VIEW, ADJUSTMENTS & NESTED MODAL)
   Matching Magicpatterns Design Reference (Images 1, 2, 3)
   ========================================================================== */

/* 1. Header Action Buttons & View Toggle (Image 1) */
.rpt-payroll-btn--icon-only {
  width: 36px;
  height: 36px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #ffffff;
  color: #64748b;
  cursor: pointer;
  transition: all 0.15s ease;
}
.rpt-payroll-btn--icon-only:hover {
  background: #f8fafc;
  color: #1e293b;
  border-color: #cbd5e1;
}

.pr-view-toggle-group {
  display: inline-flex;
  align-items: center;
  background: #f1f5f9;
  border-radius: 8px;
  padding: 3px;
  gap: 2px;
}
.pr-view-toggle-btn {
  border: none;
  background: transparent;
  width: 30px;
  height: 30px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #64748b;
  cursor: pointer;
  font-size: 13px;
  transition: all 0.15s ease;
  padding: 0;
}
.pr-view-toggle-btn:hover {
  color: #1e293b;
}
.pr-view-toggle-btn.is-active {
  background: #ffffff;
  color: #16a34a;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.rpt-payroll-actions .rpt-payroll-btn--adjustment {
  display: inline-flex !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px !important;
  height: 36px !important;
  padding: 0 16px !important;
  background-color: #FFF7EA !important;
  border: 1px solid #FED7AA !important;
  color: #B45309 !important;
  border-radius: 8px !important;
  font-weight: 600 !important;
  font-size: 13px !important;
  white-space: nowrap !important;
  cursor: pointer !important;
  box-shadow: none !important;
  transition: all 0.15s ease !important;
}
.rpt-payroll-actions .rpt-payroll-btn--adjustment:hover {
  background-color: #FEEBC8 !important;
  border-color: #FDBA74 !important;
}
.rpt-payroll-actions .rpt-payroll-btn--adjustment i {
  font-size: 14px !important;
  color: #B45309 !important;
  line-height: 1 !important;
}
.rpt-payroll-actions .rpt-payroll-btn--adjustment span {
  font-size: 13px !important;
  font-weight: 600 !important;
  color: #B45309 !important;
  line-height: 1 !important;
}

.rpt-payroll-actions .rpt-payroll-btn--run {
  display: inline-flex !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px !important;
  height: 36px !important;
  padding: 0 16px !important;
  background-color: #2E7D32 !important;
  border: none !important;
  color: #ffffff !important;
  border-radius: 8px !important;
  font-weight: 600 !important;
  font-size: 13px !important;
  white-space: nowrap !important;
  cursor: pointer !important;
  transition: all 0.15s ease !important;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08) !important;
}
.rpt-payroll-actions .rpt-payroll-btn--run:hover {
  background-color: #256629 !important;
}
.rpt-payroll-actions .rpt-payroll-btn--run i,
.rpt-payroll-actions .rpt-payroll-btn--run span {
  color: #ffffff !important;
  font-size: 13px !important;
  line-height: 1 !important;
}
.rpt-payroll-actions .rpt-payroll-btn--run i.pr-btn-dropdown-arrow {
  font-size: 10px !important;
  margin-left: 2px !important;
}

.rpt-payroll-actions .rpt-payroll-btn--more {
  display: inline-flex !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: center !important;
  width: 36px !important;
  height: 36px !important;
  padding: 0 !important;
  background-color: #ffffff !important;
  border: 1px solid #E2E4E8 !important;
  border-radius: 8px !important;
  color: #475569 !important;
  cursor: pointer !important;
  box-shadow: none !important;
  transition: all 0.15s ease !important;
}
.rpt-payroll-actions .rpt-payroll-btn--more:hover {
  background-color: #F8FAFC !important;
  border-color: #CBD5E1 !important;
}
.rpt-payroll-actions .rpt-payroll-btn--more span {
  font-size: 16px !important;
  font-weight: bold !important;
  color: #475569 !important;
  letter-spacing: -1px !important;
  line-height: 1 !important;
}

/* 2. Grid View Layout (Standardized with POS Theme & Cards) */
#commissionGridView {
  padding: 16px 20px 24px 20px;
}

/* Grid Summary Card matching Design */
/* ==========================================================================
   CARDS & GRID VIEW (100% FAITHFUL TO MAGIC PATTERNS COMPONENT FL & Q_E)
   ========================================================================== */

/* Outer scroll container for Grid view */
.pr-grid-outer-scroll {
  padding: 8px;
  overflow-y: auto;
}

/* Master Totals Section (q_e) */
.pr-grid-summary-card {
  margin-bottom: 8px;
  border-radius: 12px;
  border: 1px solid #cfe3c5;
  background-color: #e4f1dd;
  padding: 6px;
  color: #1f2328;
  box-shadow: none;
}

.pr-grid-summary-card__top {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 2px 4px 0 4px;
  background: transparent;
  border-bottom: none;
}

.pr-grid-summary-card__staff {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1 1 0%;
}

.pr-grid-summary-card__icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #ffffff;
  color: #287e20;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  font-size: 15px;
}

.pr-grid-summary-card__title {
  font-size: 13px;
  font-weight: 600;
  line-height: 16px;
  color: #1f2328;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pr-grid-summary-card__payout {
  text-align: right;
  flex-shrink: 0;
  display: block;
}

.pr-grid-summary-card__payout-lbl {
  display: block;
  font-size: 10px;
  line-height: 12px;
  color: #5b6b54;
  font-weight: 500;
}

.pr-grid-summary-card__payout-val {
  display: block;
  font-size: 18px;
  font-weight: 700;
  line-height: 24px;
  color: #287e20;
  font-variant-numeric: tabular-nums;
}

.pr-grid-summary-card__bottom {
  margin-top: 6px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-radius: 8px;
  background-color: #ffffff;
  padding: 6px 0;
  border: none;
}

.pr-grid-summary-card__col {
  min-width: 0;
  padding: 0 8px;
  border-right: 1px solid #e3ecde;
  display: block;
}

.pr-grid-summary-card__col:last-child {
  border-right: none;
}

.pr-grid-summary-card__col-lbl {
  display: block;
  font-size: 10px;
  line-height: 12px;
  color: #8a8f98;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 400;
}

.pr-grid-summary-card__col-val {
  margin-top: 2px;
  display: block;
  font-size: 12px;
  font-weight: 600;
  line-height: 16px;
  color: #1f2328;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Tech Cards Grid Layout */
.pr-cards-grid {
  display: grid;
  grid-template-columns: repeat(1, minmax(0, 1fr));
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

@media (min-width: 520px) {
  .pr-cards-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 768px) {
  .pr-cards-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (min-width: 1280px) {
  .pr-cards-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (min-width: 1600px) {
  .pr-cards-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}

/* Individual Staff Card Button */
.pr-tech-card {
  display: flex;
  height: 100%;
  width: 100%;
  flex-direction: column;
  gap: 6px;
  border-radius: 12px;
  border: 1px solid #e3ecde;
  background-color: #f5f9f3;
  padding: 6px;
  text-align: left;
  transition: all 0.15s ease;
  cursor: pointer;
  box-shadow: none;
  min-width: 0;
  box-sizing: border-box;
}

.pr-tech-card:hover {
  border-color: #c9dfbe;
  background-color: #eef6ea;
  transform: none;
  box-shadow: none;
}

.pr-tech-card:focus-visible {
  border-color: #287e20;
  outline: none;
}

.pr-tech-card-header {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 8px;
  padding: 2px 4px 0 4px;
}

.pr-tech-profile {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1 1 0%;
}

.pr-tech-avatar-thumb {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: none;
  box-shadow: 0 0 0 2px #ffffff;
}

.pr-tech-avatar-placeholder {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background-color: #e4f1dd;
  color: #287e20;
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
  border: none;
  box-shadow: 0 0 0 2px #ffffff;
}

.pr-tech-info-col {
  display: block;
  min-width: 0;
  flex: 1 1 0%;
}

.pr-tech-card-name {
  display: block;
  font-size: 13px;
  font-weight: 600;
  line-height: 16px;
  color: #1f2328;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pr-tech-card-sub {
  display: block;
  font-size: 11px;
  line-height: 16px;
  color: #6b7280;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 0;
}

.pr-tech-payout-col {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
  text-align: right;
}

.pr-tech-payout-inner {
  display: block;
  text-align: right;
}

.pr-tech-payout-col .pr-card-payout-label {
  display: block;
  font-size: 10px;
  line-height: 12px;
  color: #6b7280;
  font-weight: 400;
}

.pr-tech-payout-col .pr-card-payout-val {
  display: block;
  font-size: 15px;
  font-weight: 700;
  line-height: 20px;
  color: #287e20;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.pr-card-arrow {
  color: #9aae90;
  font-size: 13px;
  margin-left: 2px;
  transition: color 0.15s ease;
  flex-shrink: 0;
}

.pr-tech-card:hover .pr-card-arrow {
  color: #287e20;
}

.pr-tech-card-metrics {
  margin-top: auto;
  display: grid;
  width: 100%;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-radius: 8px;
  background-color: #ffffff;
  padding: 6px 0;
  border-top: none;
  gap: 0;
}

.pr-metric-box {
  min-width: 0;
  padding: 0 8px;
  border-right: 1px solid #eef1ec;
  display: block;
}

.pr-metric-box:last-child {
  border-right: none;
}

.pr-metric-lbl {
  display: block;
  font-size: 10px;
  line-height: 12px;
  color: #8a8f98;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 400;
}

.pr-metric-val {
  margin-top: 2px;
  display: block;
  font-size: 12px;
  font-weight: 600;
  line-height: 16px;
  color: #1f2328;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 3. Adjustments Main Modal (Image 2) */
.adj-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(4px);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.adj-modal-container {
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  width: min(1080px, 95vw);
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.adj-modal-title-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 12px 24px;
}
.adj-modal-title {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  color: #0f172a;
}
.adj-modal-close-icon-btn {
  border: none;
  background: transparent;
  color: #64748b;
  font-size: 18px;
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}
.adj-modal-close-icon-btn:hover {
  color: #0f172a;
  background: #f1f5f9;
}

.adj-modal-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px 16px 24px;
  gap: 16px;
  flex-wrap: wrap;
}
.adj-toolbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
}
.adj-date-nav {
  display: inline-flex;
  align-items: center;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 2px;
}
.adj-date-nav-btn {
  border: none;
  background: transparent;
  color: #64748b;
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border-radius: 6px;
  font-size: 12px;
}
.adj-date-nav-btn:hover {
  background: #e2e8f0;
  color: #0f172a;
}
.adj-date-nav-btn.adj-btn-today {
  width: auto;
  padding: 0 10px;
  font-weight: 600;
  font-size: 12px;
}
.adj-date-display {
  border: none;
  background: transparent;
  padding: 0 10px;
  font-size: 13px;
  font-weight: 600;
  color: #0f172a;
  display: inline-flex;
  align-items: center;
  cursor: pointer;
}
.adj-period-select {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 600;
  color: #0f172a;
  background: #ffffff;
  outline: none;
  cursor: pointer;
}

.adj-toolbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}
.adj-search-wrap {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 6px 12px;
  width: 220px;
  height: 38px;
  box-sizing: border-box;
}
.adj-search-wrap button {
  border: none;
  background: transparent;
  color: #94a3b8;
  padding: 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.adj-search-wrap input {
  border: none !important;
  outline: none !important;
  font-size: 13px;
  width: 100%;
  color: #0f172a;
  background: transparent !important;
  padding: 0 !important;
  box-shadow: none !important;
}
.adj-search-wrap input::placeholder {
  color: #94a3b8;
}
.adj-btn-add-new {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #16a34a;
  color: #ffffff;
  border: none;
  border-radius: 8px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}
.adj-btn-add-new:hover {
  background: #15803d;
}

.adj-table-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #f0fdf4;
  border-top: 1px solid #dcfce7;
  border-bottom: 1px solid #dcfce7;
  padding: 10px 24px;
  font-size: 12px;
  color: #166534;
  font-weight: 500;
}
.adj-table-banner i {
  color: #22c55e;
}

.adj-modal-body {
  overflow: auto;
  max-height: calc(90vh - 180px);
}
.adj-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.adj-table thead th {
  background: #f8fafc;
  color: #64748b;
  font-weight: 600;
  padding: 10px 14px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px solid #e2e8f0;
}
.adj-table tbody td {
  padding: 12px 14px;
  border-bottom: 1px solid #f1f5f9;
  color: #1e293b;
  font-variant-numeric: tabular-nums;
}
.adj-total-row {
  background: #f8fafc !important;
  font-weight: 700;
}
.adj-total-badge {
  display: inline-block;
  background: #e2e8f0;
  color: #334155;
  padding: 3px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 700;
}
.adj-staff-detail {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  color: #0f172a;
  text-decoration: none;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
}
.adj-staff-detail:hover .adj-staff-name-text {
  color: #16a34a;
  text-decoration: underline;
}
.adj-count-badge {
  background: #f1f5f9;
  color: #64748b;
  font-size: 11px;
  padding: 1px 6px;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
}
.adj-text-orange {
  color: #ea580c !important;
}
.adj-text-green {
  color: #16a34a !important;
}

/* 4. Nested Staff Adjustment Detail Dialog (Image 3) */
#adjEmployeeDetail .adj-child {
  width: 480px !important;
  border-radius: 16px !important;
  box-shadow: 0 20px 45px -10px rgba(0, 0, 0, 0.25) !important;
  border: 1px solid #e2e8f0 !important;
  background: #ffffff !important;
}
#adjEmployeeDetail .adj-child header {
  padding: 16px 20px !important;
  border-bottom: 1px solid #f1f5f9 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
}
.adj-nested-header-title {
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.adj-nested-emp-name {
  font-size: 16px;
  font-weight: 700;
  color: #0f172a;
}
.adj-nested-date-range {
  font-size: 12px;
  color: #64748b;
}
.adj-nested-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.adj-btn-add-nested {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #16a34a;
  color: #ffffff;
  border: none;
  border-radius: 6px;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}
.adj-btn-add-nested:hover {
  background: #15803d;
}
#adjEmployeeDetail .adj-child-body {
  padding: 0 !important;
  background: #ffffff !important;
}

.adj-nested-rows {
  display: flex;
  flex-direction: column;
}
.adj-nested-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  border-bottom: 1px solid #f8fafc;
}
.adj-nested-row-group {
  border-bottom: 1px solid #f8fafc;
}
.adj-nested-row-group .adj-nested-row {
  border-bottom: none;
  padding-bottom: 4px;
}
.adj-nested-label {
  font-size: 13px;
  font-weight: 500;
  color: #334155;
}
.adj-nested-val {
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  color: #0f172a;
}

.adj-nested-sub-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 20px 8px 32px;
}
.adj-sub-label {
  font-size: 12px;
  color: #64748b;
}
.adj-sub-right {
  display: flex;
  align-items: center;
  gap: 6px;
}
.adj-sub-amount {
  font-size: 12px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: #0f172a;
}
.adj-sub-action-btn {
  border: none;
  background: transparent;
  color: #94a3b8;
  cursor: pointer;
  padding: 2px 4px;
  font-size: 11px;
}
.adj-sub-action-btn:hover {
  color: #0f172a;
}
.adj-sub-del:hover {
  color: #ef4444;
}

.adj-nested-loan-row {
  align-items: flex-start;
  padding: 12px 20px;
}
.adj-nested-loan-breakdown {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 180px;
}
.adj-loan-stat-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
}
.adj-loan-stat-label {
  color: #64748b;
}
.adj-loan-stat-val {
  font-variant-numeric: tabular-nums;
  color: #0f172a;
}

.adj-nested-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px !important;
  background: #f8fafc !important;
  border-top: 1px solid #e2e8f0 !important;
}
.adj-nested-footer-label {
  font-size: 13px;
  font-weight: 700;
  color: #0f172a;
}
.adj-nested-footer-val {
  font-size: 16px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

/* ==========================================================================
   WAGES TAB REDESIGN (.pr-wages-)
   Modern Clean Aesthetics for Run Payroll -> Wages Tab
   ========================================================================== */

:root {
  --pr-wages-main: #3a9821;
  --pr-wages-main-subtle: #edf6eb;
  --pr-wages-border: #e7e7e4;
  --pr-wages-ot-bg: #fff7ed;
  --pr-wages-ot-text: #c2410c;
  --pr-wages-hourly-bg: #f0fdf4;
  --pr-wages-hourly-text: #166534;
  --pr-wages-salary-bg: #f5f3ff;
  --pr-wages-salary-text: #6b21a8;
  --pr-wages-neg-text: #dc2626;
  --pr-wages-neg-bg: #fef2f2;
}

/* Container */
.pr-wages-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
}

/* 4 KPI Cards Grid */
.pr-wages-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 4px;
}

@media (max-width: 1024px) {
  .pr-wages-kpi-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .pr-wages-kpi-grid {
    grid-template-columns: 1fr;
  }
}

.pr-wages-kpi-card {
  background: #ffffff;
  border: 1px solid var(--pr-wages-border, #e7e7e4);
  border-radius: 12px;
  padding: 16px 18px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 110px;
  transition: all 0.2s ease;
  position: relative;
}

.pr-wages-kpi-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  border-color: #cbd5e1;
}

.pr-wages-kpi-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.pr-wages-kpi-title-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pr-wages-kpi-title {
  font-size: 12px;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

/* Icon Pills */
.pr-wages-kpi-pill {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  flex-shrink: 0;
}

.pr-wages-kpi-pill--hours {
  background-color: #f1f5f9;
  color: #475569;
}

.pr-wages-kpi-pill--gross {
  background-color: var(--pr-wages-main-subtle, #edf6eb);
  color: var(--pr-wages-main, #3a9821);
}

.pr-wages-kpi-pill--regular {
  background-color: #eff6ff;
  color: #2563eb;
}

.pr-wages-kpi-pill--ot {
  background-color: var(--pr-wages-ot-bg, #fff7ed);
  color: var(--pr-wages-ot-text, #c2410c);
}

.pr-wages-kpi-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.pr-wages-kpi-value {
  font-size: 22px;
  font-weight: 700;
  color: #0f172a;
  letter-spacing: -0.3px;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}

.pr-wages-kpi-meta {
  font-size: 11.5px;
  color: #94a3b8;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Wages Table Wrapper Card */
.pr-wages-table-card {
  background: #ffffff;
  border: 1px solid var(--pr-wages-border, #e7e7e4);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
}

.pr-wages-table-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.pr-wages-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 12.5px;
  line-height: 1.4;
  color: #1e293b;
}

.pr-wages-table th {
  background-color: #fafbfc;
  color: #64748b;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--pr-wages-border, #e7e7e4);
  white-space: nowrap;
  user-select: none;
}

.pr-wages-table td {
  padding: 10px 14px;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
  font-variant-numeric: tabular-nums;
  transition: background-color 0.15s ease;
}

.pr-wages-table tbody tr:hover td {
  background-color: #f7fbf6;
}

/* Master Total Row */
.pr-wages-master-total {
  background-color: #f8fafc !important;
  font-weight: 700;
}

.pr-wages-master-total td {
  background-color: #f8fafc !important;
  color: #0f172a !important;
  font-weight: 700 !important;
  padding: 12px 14px;
  border-top: 1px solid var(--pr-wages-border, #e7e7e4);
  border-bottom: 3px double var(--pr-wages-border, #e7e7e4) !important;
}

.pr-wages-table tfoot .pr-wages-master-total td {
  border-top: 2px solid var(--pr-wages-border, #e7e7e4);
  border-bottom: none !important;
}

/* Tech cell & Avatar */
.pr-wages-tech-cell {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  cursor: pointer;
}

.pr-wages-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11.5px;
  font-weight: 700;
  flex-shrink: 0;
  letter-spacing: -0.2px;
}

.pr-wages-avatar--mint {
  background-color: #dcfce7;
  color: #15803d;
}

.pr-wages-avatar--sky {
  background-color: #e0f2fe;
  color: #0369a1;
}

.pr-wages-avatar--purple {
  background-color: #f3e8ff;
  color: #7e22ce;
}

.pr-wages-avatar--amber {
  background-color: #fef3c7;
  color: #b45309;
}

.pr-wages-avatar--rose {
  background-color: #ffe4e6;
  color: #be123c;
}

.pr-wages-tech-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.pr-wages-tech-name {
  color: #0f172a;
  font-weight: 600;
  font-size: 12.5px;
  transition: color 0.15s ease;
}

.pr-wages-tech-cell:hover .pr-wages-tech-name {
  color: var(--pr-wages-main, #3a9821);
}

.pr-wages-tech-badges {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Badges */
.pr-badge {
  display: inline-flex;
  align-items: center;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 600;
  line-height: 1.3;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.pr-badge-hourly {
  background-color: var(--pr-wages-hourly-bg, #f0fdf4);
  color: var(--pr-wages-hourly-text, #166534);
  border: 1px solid rgba(22, 101, 52, 0.15);
}

.pr-badge-salary {
  background-color: var(--pr-wages-salary-bg, #f5f3ff);
  color: var(--pr-wages-salary-text, #6b21a8);
  border: 1px solid rgba(107, 33, 168, 0.15);
}

.pr-badge-ot {
  background-color: var(--pr-wages-ot-bg, #fff7ed);
  color: var(--pr-wages-ot-text, #c2410c);
  border: 1px solid rgba(194, 65, 12, 0.15);
}

/* Numeric alignment & special colors */
.pr-wages-num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.pr-wages-num--negative {
  color: var(--pr-wages-neg-text, #dc2626) !important;
  font-weight: 600;
}

.pr-wages-num--payout {
  font-weight: 700;
  color: #0f172a;
}

/* ==========================================================================
   PAYROLL RECORD TAB (Design parity with Magic Patterns component Ape)
   ========================================================================== */

.pr-record-container {
  display: flex;
  flex-direction: column;
  background: #ffffff;
  border: 1px solid #e7e7e4;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  margin-top: 4px;
}

.pr-record-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: #fafaf9;
  border-bottom: 1px solid #e7e7e4;
  font-size: 11.5px;
  color: #6b7280;
  font-weight: 500;
}

.pr-record-banner i {
  color: #8a8f98;
  font-size: 13px;
}

.pr-record-table-wrap {
  overflow-x: auto;
  width: 100%;
}

.pr-record-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
  min-width: 820px;
}

.pr-record-table thead th {
  background: #f7f7f5;
  color: #6b7280;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 10px 14px;
  border-bottom: 1px solid #e7e7e4;
  white-space: nowrap;
}

.pr-record-table thead th.pr-record-col--payout {
  color: #287e20 !important;
}

.pr-record-table tbody tr.pr-record-master-row {
  cursor: pointer;
  background: #ffffff;
  border-bottom: 1px solid #f1f1ee;
  transition: background-color 0.15s ease;
}

.pr-record-table tbody tr.pr-record-master-row:hover {
  background: #fafaf9;
}

.pr-record-table tbody tr.pr-record-master-row.is-expanded {
  background: #f7fbf5;
}

.pr-record-table tbody tr.pr-record-master-row td {
  padding: 12px 14px;
  vertical-align: middle;
}

.pr-record-period-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: #1f2328;
  text-align: left;
}

.pr-record-chevron {
  width: 16px;
  height: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #8a8f98;
  transition: transform 0.2s ease, color 0.2s ease;
  flex-shrink: 0;
}

.pr-record-master-row.is-expanded .pr-record-chevron {
  transform: rotate(90deg);
  color: #287e20;
}

/* Badges for Run Type & Status */
.pr-badge-run-type {
  display: inline-flex;
  align-items: center;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  background: #f1f5f9;
  color: #475569;
}

.pr-badge-run-type--weekly {
  background: #eff6ff;
  color: #1d4ed8;
}

.pr-badge-run-type--biweekly {
  background: #f3e8ff;
  color: #7e22ce;
}

.pr-badge-run-type--semimonthly {
  background: #ecfdf5;
  color: #047857;
}

.pr-badge-status {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 9999px;
  font-size: 11px;
  font-weight: 600;
}

.pr-badge-status--paid {
  background: #e6f6ef;
  color: #11785a;
}

.pr-badge-status--processing {
  background: #fff4e0;
  color: #b45309;
}

/* Master row Payout amount */
.pr-record-payout-total {
  font-weight: 700;
  color: #287e20;
  font-size: 13px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* Action button in master row */
.pr-record-action-btn {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: none;
  background: transparent;
  color: #6b7280;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.pr-record-action-btn:hover {
  background: #f1f1ef;
  color: #1f2328;
}

.pr-record-action-btn.is-active {
  background: #287e20;
  color: #ffffff;
}

/* Accordion Detail Area */
.pr-record-detail-panel {
  display: none;
}

.pr-record-detail-panel.is-open {
  display: table-row;
}

.pr-record-detail-panel > td {
  padding: 12px 16px 16px 28px !important;
  background: #fafaf9;
  border-bottom: 1px solid #e7e7e4;
}

.pr-record-detail-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.pr-record-detail-title {
  font-size: 12px;
  font-weight: 600;
  color: #1f2328;
  margin: 0;
}

.pr-record-btn-toggle-eye {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 4px;
  border: 1px solid #e7e7e4;
  background: #ffffff;
  color: #6b7280;
  font-size: 11px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.pr-record-btn-toggle-eye:hover {
  border-color: #cbd5e1;
  color: #1f2328;
}

.pr-record-btn-toggle-eye.is-active {
  background: #f1f5f9;
  color: #0f172a;
}

.pr-record-editing-badge {
  margin-left: auto;
  border-radius: 9999px;
  background: #fff4e0;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 600;
  color: #b45309;
}

/* Staff Table inside Accordion */
.pr-record-staff-card {
  border-radius: 8px;
  border: 1px solid #e7e7e4;
  background: #ffffff;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
}

.pr-record-staff-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.pr-record-staff-table thead th {
  background: #f7f7f5;
  color: #6b7280;
  font-size: 11px;
  font-weight: 600;
  padding: 8px 12px;
  border-bottom: 1px solid #f1f1ee;
  text-transform: none;
}

.pr-record-staff-table thead th.pr-record-staff-col--payout {
  color: #287e20 !important;
}

.pr-record-staff-row {
  cursor: pointer;
  border-top: 1px solid #f1f1ee;
  transition: background-color 0.12s ease;
}

.pr-record-staff-row:hover {
  background: #f7fbf5;
}

.pr-record-staff-row td {
  padding: 9px 12px;
  vertical-align: middle;
}

/* Staff Info in table */
.pr-record-staff-info {
  display: flex;
  align-items: center;
  gap: 8px;
  text-align: left;
}

.pr-record-staff-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #e2e8f0;
  display: inline-grid;
  place-items: center;
  font-size: 10px;
  font-weight: 700;
  color: #475569;
  flex-shrink: 0;
  overflow: hidden;
}

.pr-record-staff-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.pr-record-staff-name-wrap {
  display: flex;
  align-items: baseline;
  gap: 6px;
  min-width: 0;
}

.pr-record-staff-name {
  font-size: 12px;
  font-weight: 600;
  color: #0f172a;
}

.pr-record-staff-title {
  font-size: 11px;
  color: #64748b;
}

.pr-record-staff-kind-pill {
  font-size: 10px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 4px;
  letter-spacing: 0.02em;
}

.pr-record-staff-kind-pill--com {
  background: #e6f6ef;
  color: #11785a;
}

.pr-record-staff-kind-pill--hrl {
  background: #fff4e0;
  color: #b45309;
}

/* Staff Sublines (PB & Check) */
.pr-record-staff-subline {
  display: block;
  font-size: 11px;
  font-weight: normal;
  color: #64748b;
  margin-top: 2px;
}

.pr-record-staff-subline-label {
  color: #8a8f98;
  margin-right: 3px;
}

.pr-record-staff-subline-val {
  font-weight: 600;
}

/* Staff Table Footer */
.pr-record-staff-table tfoot tr {
  border-top: 1px solid #e7e7e4;
  background: #f7f7f5;
  font-weight: 600;
}

.pr-record-staff-table tfoot td {
  padding: 9px 12px;
  vertical-align: middle;
}

.pr-record-remove-btn {
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 6px;
  border: none;
  background: transparent;
  color: #8a8f98;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.pr-record-remove-btn:hover {
  background: #fdf1f1;
  color: #e5484d;
}


