/* Client report page keeps the shared report data contract while presenting a
   denser client worklist. Tokens follow DESIGN.md. */
.client-table-shell { min-width: 0; }
.client-table-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 20px 12px;
  border-bottom: 1px solid var(--border);
}
.client-table-header > div:first-child { min-width: 0; }
.client-table-header strong { display: block; color: var(--blue-black); font-size: 16px; font-weight: 500; }
.client-table-header span { display: block; margin-top: 3px; color: var(--muted); font-size: 12px; }
.client-table-title { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; min-width: 0; }
/* Applied-filter chips inline with the table title: smaller tags + font than the standard chip row. */
.client-table-title .report-applied { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin: 0; min-width: 0; }
.client-table-title .report-applied .chip { font-size: 11px; min-height: 22px; padding: 0 8px; gap: 4px; border-radius: 11px; }
.client-table-title .report-applied .chip svg { width: 10px; height: 10px; }
.client-table-title .report-applied .report-text-button { font-size: 11px; }
.client-table-tools { display: flex; align-items: center; gap: 8px; flex: none; }

/* Quick filter row: campaign combobox + four selects — all equal width */
.client-quick-filters {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 20px;
  border-bottom: 1px solid var(--border);
  background: #fbfdff;
}
.client-quick-field { position: relative; flex: 1 1 0; min-width: 0; }
.client-quick-field .aff-dd { display: block; }
.client-quick-field .aff-dd-trigger {
  font-size: 12px;
  border-color: #d6dee8;
}
/* Open state: transparent border + single soft halo (same treatment as combobox), brand chevron */
.client-quick-field:has(.aff-dd-trigger[aria-expanded="true"]) .aff-dd-trigger {
  border-color: transparent;
  box-shadow: 0 0 0 3px rgba(0, 91, 255, 0.22), 0 1px 2px rgba(15, 34, 58, 0.04);
}
.client-quick-field:has(.aff-dd-trigger[aria-expanded="true"])::after {
  border-right-color: var(--brand);
  border-bottom-color: var(--brand);
}
.client-quick-field select {
  min-height: 34px;
  padding: 0 28px 0 10px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: #fff;
  color: var(--text);
  font-size: 12px;
  appearance: none;
  cursor: pointer;
}
/* Focus indication is carried by the trigger's soft halo (see dropdown.css). */
.client-quick-field::after {
  content: "";
  position: absolute;
  right: 10px;
  top: 50%;
  width: 7px;
  height: 7px;
  border-right: 1.5px solid var(--muted);
  border-bottom: 1.5px solid var(--muted);
  transform: translateY(-70%) rotate(45deg);
  pointer-events: none;
}
/* Chevron flips while the dropdown inside is expanded (aria-expanded lives on the trigger). */
.client-quick-field:has(.aff-dd-trigger[aria-expanded="true"])::after {
  transform: translateY(-30%) rotate(225deg);
}
.client-quick-combobox { position: relative; flex: 1 1 0; min-width: 0; }
.client-quick-combobox input[type="search"] {
  width: 100%;
  min-height: 34px;
  padding: 0 30px 0 10px;
  border: 1px solid #d6dee8;
  border-radius: 4px;
  background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
  color: var(--text);
  font-size: 12px;
  box-shadow: 0 1px 2px rgba(15, 34, 58, 0.04);
  transition: border-color 0.15s ease, background 0.15s ease;
}
.client-quick-combobox input[type="search"]:hover { border-color: #b9c7d6; background: #fff; }
.client-quick-combobox input[type="search"]:focus-visible {
  outline: none;
  border-color: transparent;
  box-shadow: 0 0 0 3px rgba(0, 91, 255, 0.22), 0 1px 2px rgba(15, 34, 58, 0.04);
}
/* While the option list is open, keep the soft halo even when focus moves to options */
.client-quick-combobox [data-rp-quick-combo-input][aria-expanded="true"] {
  border-color: transparent;
  box-shadow: 0 0 0 3px rgba(0, 91, 255, 0.22), 0 1px 2px rgba(15, 34, 58, 0.04);
}
.client-quick-combobox-toggle {
  position: absolute;
  right: 0;
  top: 0;
  width: 34px;
  height: 34px;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}
/* Chevron drawn as the same thin-line V as the global .aff-dd-trigger::after — one visual language site-wide. */
.client-quick-combobox-toggle::after {
  content: "";
  position: absolute;
  right: 12px;
  top: 50%;
  width: 7px;
  height: 7px;
  border-right: 1.5px solid var(--muted);
  border-bottom: 1.5px solid var(--muted);
  transform: translateY(-70%) rotate(45deg);
  pointer-events: none;
  transition: transform 0.15s ease, border-color 0.15s ease;
}
/* aria-expanded lives on the search input; flip + brand color while open. */
.client-quick-combobox [data-rp-quick-combo-input][aria-expanded="true"] ~ .client-quick-combobox-toggle::after,
.client-quick-combobox-toggle[aria-expanded="true"]::after {
  transform: translateY(-30%) rotate(225deg);
  border-right-color: var(--brand);
  border-bottom-color: var(--brand);
}
.client-quick-combobox-toggle:hover { color: var(--text); }
.client-quick-combobox-list {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 30;
  max-height: 240px;
  margin: 0;
  padding: 4px;
  list-style: none;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: #fff;
  box-shadow: 0 8px 20px rgba(15, 34, 58, 0.12);
  overflow-y: auto;
}
.client-quick-combobox-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 10px;
  border-radius: 3px;
  font-size: 12px;
  color: var(--text);
  cursor: pointer;
}
.client-quick-combobox-list li:hover, .client-quick-combobox-list li:focus { background: #f0f6ff; }
.client-quick-combobox-list li[aria-selected="true"] { color: var(--brand); font-weight: 500; }
.client-quick-combobox-list li small { color: var(--muted); font-size: 11px; }
.client-quick-combobox-empty { color: var(--muted); cursor: default; }
.client-quick-combobox-empty:hover { background: transparent; }

.report-client-table { border-collapse: separate; border-spacing: 0; }

.report-client-scroll .report-client-table { min-width: 1190px; }
.report-client-col-clientId { width: 142px; }
.report-client-col-registeredAt { width: 98px; }
.report-client-col-campaign { width: 112px; }
.report-client-col-kyc { width: 60px; }
.report-client-col-stage { width: 100px; }
.report-client-col-quality { width: 68px; }
.report-client-col-expected { width: 94px; }
.report-client-col-settled { width: 94px; }
.report-client-col-progress { width: 74px; }
.report-client-col-commissionStatus { width: 128px; }
.report-client-col-riskHandlingStatus { width: 86px; }
.report-client-col-actions { width: 116px; }

.report-client-scroll .report-client-table th,
.report-client-scroll .report-client-table td { padding: 11px 10px; }
.report-client-table tbody tr { --row-accent: var(--surface); }
.report-client-table tbody tr:nth-child(even) { --row-accent: #fbfdff; }
.report-client-table tbody tr:hover { --row-accent: var(--row-hover); }
.report-client-table tbody td { background: var(--row-accent); }
.report-client-table tbody tr:hover td { background: var(--row-hover); }
.report-client-table thead th:first-child,
.report-client-table tbody td:first-child { position: sticky; left: 0; z-index: 2; }
.report-client-table thead th:first-child { z-index: 5; }
.report-client-table thead th:not(:first-child):not(:last-child) {
  position: relative;
  z-index: 6;
  background: #f8fbff;
}
.report-client-table thead th:first-child,
.report-client-table thead th:last-child { z-index: 8; }

.client-identity-inner { display: flex; align-items: center; gap: 9px; }
.client-avatar {
  display: grid;
  place-items: center;
  flex: none;
  width: 34px;
  height: 34px;
  border-radius: 4px;
  background: #eaf1ff;
  color: var(--brand);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
}
.client-id-box { min-width: 0; display: grid; gap: 2px; }
.client-id-box .report-text-button { color: var(--brand); font-weight: 500; justify-self: start; }
.client-id-box small,
.client-registration-cell small,
.report-campaign-cell small,
.client-stage-cell small,
.report-expected-cell small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}
.client-id-box small, .report-campaign-cell strong, .client-registration-cell strong { overflow-wrap: anywhere; }
.client-registration-inner, .report-campaign-inner, .client-stage-inner { display: grid; gap: 3px; }
.client-registration-cell strong { color: var(--text); font-size: 12px; font-variant-numeric: tabular-nums; }
.report-campaign-cell strong { color: var(--blue-black); font-size: 12px; font-weight: 600; }
.client-stage-inner .tag { justify-self: start; }
.client-risk-inner { display: grid; gap: 3px; }
.client-risk-inner small { color: var(--muted); font-size: 11px; line-height: 1.35; }
.report-expected-inner { display: grid; gap: 2px; text-align: right; }
.report-expected-cell strong { color: var(--blue-black); font-size: 13px; }
.report-settled-inner { display: grid; justify-items: end; text-align: right; }
.report-settled-cell strong { color: var(--blue-black); font-size: 13px; }
.report-client-table th.numeric .report-header-content { display: flex; justify-content: flex-end; width: 100%; }
.report-client-table th.numeric .report-sort-button { justify-content: flex-end; text-align: right; }
.report-client-table td.report-expected-cell,
.report-client-table td.report-settled-cell { text-align: right; }
.report-progress strong {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 2px 8px;
  border: 1px solid #b8cdf7;
  border-radius: 4px;
  background: #f5f9ff;
  color: var(--brand);
  font-size: 12px;
  font-weight: 500;
}

/* Keep the semantic worklist row-based at all sizes. The wrapper scrolls
   horizontally while identity and actions stay anchored. */
@media (max-width: 767px) {
  .client-table-header { flex-wrap: wrap; gap: 10px; padding: 14px 12px; }
  .client-quick-filters { padding: 10px 12px; }
  .client-quick-combobox { flex: 1 1 100%; max-width: none; }
  .report-table-scroll.report-client-scroll {
    max-height: none;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-padding-inline: 158px 120px;
    -webkit-overflow-scrolling: touch;
  }
    .report-client-scroll .report-client-table { width: 1190px; min-width: 1190px; table-layout: fixed; }
  .report-client-table thead th:first-child,
  .report-client-table tbody td:first-child { position: sticky; left: 0; }
  .report-client-table thead th:last-child,
  .report-client-table tbody td:last-child { position: sticky; right: 0; }
  .report-client-actions { display: flex; justify-content: center; }
  .report-client-actions .button { min-height: 32px; }
  .report-client-table thead th button.report-help-button { min-width: 36px; min-height: 36px; }
}
