/* Weekly Auction Performance table (statistics.html) */
.wr { --wr-green: #058d3b; --wr-ink: #101828; --wr-muted: #667085; --wr-line: #eaecf0; box-sizing: border-box; }
.wr *, .wr *::before, .wr *::after { box-sizing: border-box; }

.wr-head { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-end; justify-content: space-between; padding-bottom: 16px; border-bottom: 1px solid #e2e8f0; }
.wr-head .container-title { margin: 0; }
.wr-sub { margin: 6px 0 0; color: var(--wr-muted); font-size: 14px; }
.wr-actions { display: flex; gap: 8px; }
.wr-btn {
  display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 8px 16px;
  border: 1px solid var(--wr-green); border-radius: 8px; background: #fff; color: var(--wr-green);
  font: inherit; font-weight: 600; font-size: 14px; cursor: pointer;
}
.wr-btn:hover:not(:disabled) { background: var(--wr-green); color: #fff; }
.wr-btn:disabled { opacity: .5; cursor: not-allowed; }
.wr-btn.is-busy { cursor: progress; opacity: .7; }

.wr-filters { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px 16px; margin: 18px 0 14px; }
.wr-filters label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; font-weight: 600; color: #344054; }
.wr-filters select {
  min-width: 150px; height: 40px; padding: 0 10px; border: 1px solid #d0d5dd; border-radius: 8px;
  background: #fff; font: inherit; font-weight: 400; font-size: 14px; color: var(--wr-ink);
}
.wr-filters select:focus { outline: none; border-color: var(--wr-green); box-shadow: 0 0 0 3px rgba(5, 141, 59, .15); }
.wr-status { margin-left: auto; font-size: 13px; color: var(--wr-muted); }
.wr-status.is-warn { color: #b54708; }

.wr-summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; margin-bottom: 14px; }
.wr-kpi { border: 1px solid var(--wr-line); border-radius: 10px; padding: 12px 14px; background: #fcfcfd; }
.wr-kpi b { display: block; font-size: 20px; color: var(--wr-ink); font-variant-numeric: tabular-nums; }
.wr-kpi span { font-size: 12.5px; color: var(--wr-muted); }

.wr-table-wrap { overflow-x: auto; border: 1px solid var(--wr-line); border-radius: 10px; max-height: 560px; overflow-y: auto; }
.wr-table-wrap:focus-visible { outline: 2px solid var(--wr-green); outline-offset: 2px; }
.wr-table { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 0; }
.wr-table th, .wr-table td { padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--wr-line); white-space: nowrap; }
.wr-table thead th { position: sticky; top: 0; z-index: 1; background: #f9fafb; color: #344054; font-size: 12.5px; font-weight: 600; line-height: 1.3; }
.wr-table thead th span { font-weight: 400; color: var(--wr-muted); }
.wr-table .wr-num { text-align: right; font-variant-numeric: tabular-nums; }
.wr-table tbody tr:hover { background: #f9fafb; }
.wr-table td small { color: var(--wr-muted); margin-left: 6px; }
.wr-table tr.is-latest { background: #f6fef9; }
.wr-table tr.is-latest td:first-child { box-shadow: inset 3px 0 0 var(--wr-green); }
.wr-badge { display: inline-block; margin-left: 8px; padding: 1px 8px; border-radius: 999px; background: #dcfae6; color: #067647; font-size: 11.5px; font-weight: 600; }
.wr-table tfoot td { position: sticky; bottom: 0; background: #f2f4f7; font-weight: 700; border-top: 2px solid #d0d5dd; border-bottom: 0; }
.wr-empty { text-align: center !important; color: var(--wr-muted); padding: 28px !important; }
.wr-note { margin: 14px 0 0; font-size: 13px; color: var(--wr-muted); }
.wr-note a { color: var(--wr-green); font-weight: 600; }

@media (max-width: 640px) {
  .wr-summary { grid-template-columns: 1fr 1fr; }
  .wr-kpi b { font-size: 17px; }
  .wr-actions { width: 100%; }
  .wr-btn { flex: 1; justify-content: center; }
  .wr-filters label { flex: 1 1 140px; }
  .wr-filters select { min-width: 0; width: 100%; }
  .wr-status { margin-left: 0; width: 100%; }
}

/* CTC / Orthodox market checkboxes */
.wr-markets { display: flex; flex-direction: column; gap: 4px; }
.wr-mkt-label { font-size: 13px; font-weight: 600; color: #344054; }
.wr-mkt-row { display: flex; gap: 8px; }
.wr-filters .wr-check {
  display: inline-flex; flex-direction: row; align-items: center; gap: 8px; height: 40px; padding: 0 14px;
  border: 1px solid #d0d5dd; border-radius: 8px; background: #fff; cursor: pointer;
  font-size: 14px; font-weight: 600; color: #344054; user-select: none;
}
.wr-check input { width: 16px; height: 16px; margin: 0; accent-color: #058d3b; cursor: pointer; }
.wr-check:has(input:checked) { border-color: #058d3b; background: #ecfdf3; color: #05603a; }
.wr-check:has(input:focus-visible) { box-shadow: 0 0 0 3px rgba(5, 141, 59, .2); }
.wr-check:has(input:disabled) { opacity: .6; cursor: not-allowed; }
@media (max-width: 640px) {
  .wr-markets { flex: 1 1 100%; }
  .wr-filters .wr-check { flex: 1; justify-content: center; }
}

/* three columns fit a phone without sideways scrolling */
@media (max-width: 640px) {
  .wr-table th, .wr-table td { padding: 10px 10px; }
  .wr-table td:first-child { white-space: normal; }
  .wr-table td small { display: block; margin: 2px 0 0; }
  .wr-badge { margin: 4px 0 0; }
}

/* "Upcoming: Sale 1 of 2027" — new year before its first auction */
.wr-upcoming { display: flex; align-items: flex-start; gap: 16px; max-width: 520px; margin: 8px auto; text-align: left; white-space: normal; }
.wr-upcoming svg { flex-shrink: 0; width: 44px; height: 44px; padding: 9px; border-radius: 12px; background: #ecfdf3; fill: none; stroke: #058d3b; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.wr-upcoming strong { display: block; font-size: 17px; color: #101828; margin-bottom: 4px; }
.wr-upcoming p { margin: 0 0 12px; font-size: 14px; line-height: 1.5; color: #475467; }

/* Auction Date column ("12 October 2026") */
.wr-table td.wr-date { color: #344054; }
@media (max-width: 640px) {
  .wr-table { font-size: 13px; }
  .wr-table th, .wr-table td { padding: 10px 6px; }
  .wr-table thead th { white-space: normal; font-size: 11.5px; }
  .wr-table td.wr-date { white-space: normal; }
  .wr-table th:first-child, .wr-table td:first-child { padding-left: 10px; }
  .wr-table th:last-child, .wr-table td:last-child { padding-right: 10px; }
}

/* striped rows, and the current (latest / live) sale clearly picked out */
.wr-table tbody tr:nth-child(even) { background: #f2f4f7; }
.wr-table tbody tr:hover { background: #e4e7ec; }
.wr-table tbody tr.is-latest,
.wr-table tbody tr.is-latest:hover { background: #dcfae6; }
.wr-table tbody tr.is-latest td { color: #05603a; font-weight: 700; border-bottom-color: #abefc6; }
.wr-table tbody tr.is-latest td:first-child { box-shadow: inset 4px 0 0 #058d3b; }
.wr-table tbody tr.is-latest .wr-badge { background: #058d3b; color: #fff; }
.wr-badge.is-live { display: inline-flex; align-items: center; gap: 5px; background: #d92d20 !important; color: #fff; }
.wr-badge.is-live::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #fff; animation: wr-blink 1.4s ease-in-out infinite; }
@keyframes wr-blink { 50% { opacity: .25; } }
@media (prefers-reduced-motion: reduce) { .wr-badge.is-live::before { animation: none; } }
