:root {
  --bg: #f5f7fb;
  --surface: #ffffff;
  --text: #101828;
  --muted: #667085;
  --line: #e4e7ec;
  --brand: #5b5cf0;
  --brand-dark: #4445d6;
  --success: #12b76a;
  --danger: #d92d20;
  --shadow: 0 18px 50px rgba(16, 24, 40, 0.08);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, system-ui, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(91, 92, 240, 0.1), transparent 32%),
    var(--bg);
}

button, input { font: inherit; }
.page-shell { width: min(1180px, calc(100% - 32px)); margin: 0 auto; padding: 58px 0 80px; }
.hero { display: flex; align-items: flex-start; justify-content: space-between; gap: 32px; margin-bottom: 28px; }
.eyebrow { display: inline-block; margin-bottom: 10px; color: var(--brand); font-size: 12px; font-weight: 800; letter-spacing: .16em; }
h1 { margin: 0; font-size: clamp(36px, 6vw, 64px); line-height: 1; letter-spacing: -.055em; }
.hero p { max-width: 650px; margin: 18px 0 0; color: var(--muted); font-size: 18px; line-height: 1.65; }
.status-pill { display: inline-flex; align-items: center; gap: 8px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 999px; background: rgba(255,255,255,.72); color: var(--muted); font-size: 13px; font-weight: 600; white-space: nowrap; }
.status-pill span { width: 8px; height: 8px; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 5px rgba(18,183,106,.12); }
.panel { background: var(--surface); border: 1px solid rgba(228,231,236,.9); border-radius: 24px; box-shadow: var(--shadow); }
.search-panel { padding: 22px; }
form { display: grid; grid-template-columns: 1.25fr 1fr 1fr auto; gap: 14px; align-items: end; }
label span { display: block; margin: 0 0 8px 2px; color: #344054; font-size: 13px; font-weight: 700; }
input { width: 100%; height: 52px; padding: 0 15px; border: 1px solid var(--line); border-radius: 14px; outline: none; background: #fff; color: var(--text); transition: .2s; }
input:focus { border-color: var(--brand); box-shadow: 0 0 0 4px rgba(91,92,240,.12); }
button { height: 52px; padding: 0 22px; border: 0; border-radius: 14px; background: var(--brand); color: #fff; font-weight: 800; cursor: pointer; transition: .2s; box-shadow: 0 10px 20px rgba(91,92,240,.25); }
button:hover { background: var(--brand-dark); transform: translateY(-1px); }
button:disabled { cursor: wait; opacity: .7; transform: none; }
.error { margin-top: 14px; padding: 13px 15px; border-radius: 12px; background: #fef3f2; color: var(--danger); font-size: 14px; }
.results { margin-top: 38px; }
.result-heading { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 16px; }
h2 { margin: 0; font-size: 30px; letter-spacing: -.03em; }
.result-heading p { margin: 0; color: var(--muted); }
.cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.metric-card { min-height: 190px; padding: 24px; border: 1px solid var(--line); border-radius: 22px; background: var(--surface); box-shadow: 0 10px 34px rgba(16,24,40,.05); display: flex; flex-direction: column; }
.metric-card.featured { background: linear-gradient(145deg, #6263f4, #4647d7); color: white; border: none; }
.metric-card.pickup-card { background: #111827; color: #fff; }
.metric-label { font-size: 14px; font-weight: 700; opacity: .72; }
.metric-card strong { margin-top: auto; font-size: clamp(30px, 5vw, 48px); letter-spacing: -.05em; }
.metric-card small { margin-top: 7px; color: var(--muted); font-size: 13px; }
.metric-card.featured small, .metric-card.pickup-card small { color: rgba(255,255,255,.68); }
.note { margin: 14px 4px 0; color: var(--muted); font-size: 13px; }

@media (max-width: 900px) {
  form { grid-template-columns: 1fr 1fr; }
  form label:first-child, button { grid-column: 1 / -1; }
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 620px) {
  .page-shell { width: min(100% - 20px, 1180px); padding-top: 32px; }
  .hero, .result-heading { display: block; }
  .status-pill { margin-top: 20px; }
  form, .cards { grid-template-columns: 1fr; }
  form label:first-child, button { grid-column: auto; }
  .search-panel { padding: 16px; }
  .result-heading p { margin-top: 8px; }
  .metric-card { min-height: 165px; }
}

.offers-field {
  min-width: 280px;
}

.offers-field small {
  display: block;
  margin-top: 7px;
  color: #8490a8;
  font-size: 12px;
}

.table-wrapper {
  width: 100%;
  overflow-x: auto;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 18px;
  background: rgba(15, 23, 42, 0.72);
}

.stats-table {
  width: 100%;
  min-width: 920px;
  border-collapse: collapse;
  font-size: 14px;
}

.stats-table th,
.stats-table td {
  padding: 17px 18px;
  text-align: right;
  white-space: nowrap;
  border-bottom: 1px solid rgba(148, 163, 184, 0.13);
}

.stats-table th:first-child,
.stats-table td:first-child {
  text-align: left;
}

.stats-table thead th {
  color: #94a3b8;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: rgba(30, 41, 59, 0.7);
}

.stats-table tbody td {
  color: #e5e7eb;
}

.stats-table tbody tr:hover {
  background: rgba(59, 130, 246, 0.07);
}

.stats-table tbody tr:last-child td {
  border-bottom: none;
}

.stats-table tfoot th {
  color: #ffffff;
  font-weight: 800;
  background: rgba(59, 130, 246, 0.12);
  border-top: 1px solid rgba(96, 165, 250, 0.25);
  border-bottom: none;
}

@media (max-width: 760px) {
  .stats-table th,
  .stats-table td {
    padding: 14px;
  }
}
