/* Financial lists cover salespeople, bosses, and administrators; purchaser/printer layouts stay unchanged. */
.filter-card.records-filters { grid-template-columns: repeat(auto-fit, minmax(155px, 1fr)); }
.records-filters label { margin-top: 0; }
.records-filters select, .records-filters input { width: 100%; }
.record-filter-actions { display: flex; gap: 8px; align-items: center; }
.record-filter-actions button { flex: 1; padding-inline: 10px; white-space: nowrap; }
@media (max-width: 480px) {
  .filter-card.records-filters { grid-template-columns: minmax(0, 1fr); }
}

.financial-records-wrap {
  max-height: min(640px, 68vh);
  border: 1px solid #dfe7ef;
  border-radius: 10px;
  isolation: isolate;
}

.financial-records-table {
  border-collapse: separate;
  border-spacing: 0;
  font-variant-numeric: tabular-nums;
}

.salesperson-records-table { min-width: 1450px; }

.financial-records-table th,
.financial-records-table td {
  padding: 9px 12px;
  border-right: 1px solid #edf1f5;
  text-align: center;
}

.financial-records-table th {
  position: sticky;
  top: 0;
  z-index: 3;
  background: #f7f9fc;
  color: #334155;
  font-weight: 700;
  border-bottom-color: #cbd5e1;
}

.financial-records-table tbody tr { --record-row-background: #fff; }
.financial-records-table .record-unconfirmed { --record-row-background: #eff6ff; }
.financial-records-table .record-refund { --record-row-background: #faf5ff; }
.financial-records-table .record-pending { --record-row-background: #fffbeb; }
.financial-records-table .record-rejected { --record-row-background: #fff1f2; }
.financial-records-table tbody tr:hover { --record-row-background: #edf7ff; }
.financial-records-table td { background: var(--record-row-background); color: #334155; }

.financial-records-table th:first-child,
.financial-records-table .record-order-number {
  position: sticky;
  left: 0;
  z-index: 2;
  min-width: 135px;
  text-align: left;
  font-weight: 700;
  box-shadow: 2px 0 0 #dfe7ef;
}

.financial-records-table th:first-child { z-index: 4; }
.financial-records-table .money-cell { text-align: right; font-weight: 700; }
.financial-records-table .payment-method-cell { text-align: left; }
.financial-records-table .record-type-tag {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 99px;
  background: #e0f2fe;
  color: #0369a1;
  font-weight: 700;
}

.financial-records-table .record-type-refund { background: #f3e8ff; color: #7e22ce; }
.financial-records-table .balance-tag { display: inline-block; padding: 3px 8px; border-radius: 99px; }
.financial-records-table .balance-due { background: #fff7ed; color: #c2410c; }
.financial-records-table .balance-over { background: #f0fdf4; color: #15803d; }
.financial-records-table .actions-cell { display: table-cell; min-width: 135px; }
.financial-records-table .row-action {
  background: #fff;
  color: #36506d;
  border: 1px solid #cbd9e8;
  padding: 5px 14px;
  margin: 0 2px;
  font-weight: 600;
}

.financial-records-table .row-action:hover { background: #e0f2fe; border-color: #1687cf; }
.financial-records-table .row-action:focus-visible { outline: 2px solid #1687cf; outline-offset: 2px; }
.financial-records-table .empty-records { text-align: center; font-weight: 400; color: #7b879b; }
/* Compact normal desktop rows, but retain scrolling for large values and narrow screens. */
.boss-records-wrap { scrollbar-gutter: stable; scroll-padding-inline: 115px 190px; }
.boss-records-table { min-width: 1280px; }
.boss-records-table th,
.boss-records-table td { padding: 8px 6px; }
.boss-records-table th:first-child,
.boss-records-table .record-order-number { min-width: 105px; width: 105px; white-space: normal; overflow-wrap: anywhere; }
.boss-records-table th:nth-child(2),
.boss-records-table th:nth-child(3) { width: 65px; }
.boss-records-table td:nth-child(2),
.boss-records-table td:nth-child(3) { white-space: normal; overflow-wrap: anywhere; max-width: 100px; }
.boss-records-table th:nth-child(4) { width: 60px; }
.boss-records-table th:nth-child(5) { width: 92px; }
.boss-records-table th:nth-child(11) { width: 120px; }
.boss-records-table .payment-method-cell { white-space: normal; overflow-wrap: anywhere; max-width: 160px; }
.boss-records-table th:nth-child(12) { width: 115px; }
.boss-records-table .status { display: inline-block; max-width: 100%; white-space: normal; }
.boss-records-table .record-type-tag { padding: 4px 8px; }
.boss-records-table .balance-tag { padding: 3px 5px; }
.boss-records-table .actions-heading,
.boss-records-table .actions-cell {
  position: sticky;
  right: 0;
  z-index: 2;
  width: 180px;
  min-width: 180px;
  box-shadow: -2px 0 0 #dfe7ef;
}
.boss-records-table .actions-heading { z-index: 4; }
.boss-records-table .record-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 4px; }
.boss-records-table .row-action { flex-shrink: 0; padding: 5px 8px; margin: 0; }
.boss-records-table .correction-action { border-color: #1687cf; color: #0369a1; }
.boss-records-table .approve-action { background: #16a34a; border-color: #16a34a; color: #fff; }
.boss-records-table .approve-action:hover { background: #15803d; border-color: #15803d; }
.boss-records-table .reject-action { background: #dc2626; border-color: #dc2626; color: #fff; }
.boss-records-table .reject-action:hover { background: #b91c1c; border-color: #b91c1c; }
.boss-records-table .arrival-action { background: #1687cf; border-color: #1687cf; color: #fff; }
.boss-records-table .arrival-action:hover { background: #0369a1; border-color: #0369a1; }

.summary-card-link { text-align: left; color: inherit; font: inherit; transition: border-color .15s, background-color .15s; }
.summary-card-link:hover { background: #f0f8ff; border-color: #8fc8ee; }
.summary-card-link.active { background: #eef8ff; border-color: #1687cf; box-shadow: inset 0 0 0 1px #1687cf; }
.summary-card-link:focus-visible { outline: 3px solid #1687cf; outline-offset: 3px; }
.record-filter-status { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 12px 0; padding: 10px 14px; border-radius: 10px; background: #eaf5fe; color: #245779; font-size: 13px; }
.record-filter-status button { flex-shrink: 0; padding: 6px 10px; }
