:root {
  color-scheme: light;
  --bg: #f4f6f8;
  --text: #172026;
  --muted: #65717a;
  --line: #d8dee4;
  --panel: #ffffff;
  --head: #eef2f5;
  --ink: #164b60;
  --accent: #9a4f22;
  --focus: #2b7aa0;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
  letter-spacing: 0;
}

.topbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  padding: 24px clamp(16px, 4vw, 44px) 20px;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: 27px;
  line-height: 1.15;
}

main {
  width: min(1440px, calc(100% - 28px));
  margin: 18px auto 40px;
}

.source-control,
.toolbar,
.status-row,
.pager {
  display: flex;
  align-items: center;
  gap: 10px;
}

.source-control input {
  width: min(320px, 40vw);
}

label,
.metric span,
.status-row {
  color: var(--muted);
  font-size: 13px;
}

input,
select,
button {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
  color: var(--text);
  font: inherit;
}

input,
select {
  padding: 0 12px;
}

button {
  padding: 0 13px;
  border-color: var(--ink);
  background: var(--ink);
  color: #ffffff;
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

input:focus,
select:focus,
button:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.status-row {
  justify-content: space-between;
  margin-bottom: 14px;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.metric,
.table-wrap {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.metric {
  min-height: 78px;
  padding: 14px;
}

.metric strong {
  display: block;
  margin-top: 8px;
  color: var(--ink);
  font-size: 24px;
  line-height: 1.1;
}

.toolbar {
  margin-bottom: 14px;
}

.toolbar input {
  flex: 1;
  min-width: 240px;
}

#departmentFilter {
  width: min(380px, 34vw);
}

.table-wrap {
  max-height: calc(100vh - 280px);
  overflow: auto;
}

table {
  width: 100%;
  min-width: 1060px;
  border-collapse: collapse;
}

th,
td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--head);
  color: #26343c;
  font-size: 13px;
}

td {
  font-size: 14px;
  line-height: 1.35;
}

tbody tr:hover {
  background: #f8fafb;
}

.sort-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: auto;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font-size: inherit;
  font-weight: 700;
}

.sort-button::after {
  content: "";
  color: var(--accent);
}

.sort-button[data-active="true"][data-direction="asc"]::after {
  content: "^";
}

.sort-button[data-active="true"][data-direction="desc"]::after {
  content: "v";
}

.bid-number,
.date-cell,
.number {
  white-space: nowrap;
}

.number {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

a {
  color: var(--ink);
  font-weight: 700;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.empty {
  padding: 26px;
  color: var(--muted);
  text-align: center;
}

@media (max-width: 860px) {
  .topbar,
  .source-control,
  .status-row,
  .toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .source-control input,
  #departmentFilter {
    width: 100%;
  }

  .metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .pager {
    justify-content: space-between;
  }

  .table-wrap {
    max-height: none;
  }
}

@media (max-width: 520px) {
  .metrics {
    grid-template-columns: 1fr;
  }
}
