:root {
  --ink: #17202a;
  --muted: #64748b;
  --line: #d9e1ea;
  --page: #eef3f6;
  --panel: #fff;
  --brand: #0f766e;
  --brand-dark: #12343b;
  --accent: #d98b26;
  --danger: #dc2626;
  --good: #059669;
}

* {
  box-sizing: border-box;
}

body {
  background:
    linear-gradient(135deg, rgba(15, 118, 110, .08), transparent 34%),
    linear-gradient(315deg, rgba(217, 139, 38, .08), transparent 30%),
    var(--page);
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
  margin: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

input,
select,
textarea,
button {
  border: 1px solid var(--line);
  border-radius: 7px;
  font: inherit;
}

input,
select,
textarea {
  background: #fff;
  color: var(--ink);
  min-height: 36px;
  padding: 7px 9px;
  width: 100%;
}

button,
.topnav a,
.result-actions a,
.pagination a {
  align-items: center;
  background: var(--brand);
  border: 1px solid var(--brand);
  border-radius: 7px;
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  font-weight: 800;
  justify-content: center;
  min-height: 36px;
  padding: 8px 12px;
}

button:disabled {
  cursor: wait;
  opacity: .65;
}

.topbar {
  align-items: center;
  background: var(--brand-dark);
  color: #fff;
  display: flex;
  gap: 18px;
  justify-content: space-between;
  min-height: 70px;
  padding: 10px clamp(14px, 3vw, 34px);
}

.brand {
  align-items: center;
  display: flex;
  gap: 12px;
}

.brand-mark {
  align-items: center;
  background: var(--accent);
  border-radius: 7px;
  display: inline-flex;
  font-weight: 900;
  height: 42px;
  justify-content: center;
  width: 42px;
}

.brand strong,
.brand small {
  display: block;
}

.brand small,
.top-meta,
.topnav {
  color: #c6d5d7;
}

.topnav {
  align-items: center;
  display: flex;
  gap: 8px;
}

.topnav a {
  background: rgba(255, 255, 255, .08);
  border-color: rgba(255, 255, 255, .14);
}

.topnav a.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.top-meta {
  display: grid;
  gap: 3px;
  font-size: 12px;
  text-align: right;
}

.workspace {
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(250px, 300px) minmax(0, 1fr);
  margin: 0 auto;
  max-width: 1540px;
  padding: 18px;
}

.sidebar,
.result-head,
.table-wrap,
.empty {
  background: var(--panel);
  border: 1px solid rgba(18, 52, 59, .12);
  border-radius: 10px;
  box-shadow: 0 12px 28px rgba(18, 52, 59, .08);
}

.sidebar {
  align-self: start;
  max-height: calc(100vh - 104px);
  overflow: auto;
  padding: 14px;
  position: sticky;
  top: 14px;
}

.side-head,
.result-head {
  align-items: center;
  display: flex;
  justify-content: space-between;
}

.side-head h1,
.result-head h2 {
  font-size: 20px;
  margin: 0;
}

.side-head a {
  color: var(--brand);
  font-weight: 800;
}

.filter-form {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.filter-form label,
.update-form {
  display: grid;
  gap: 5px;
}

.filter-form span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.content {
  min-width: 0;
}

.result-head {
  margin-bottom: 12px;
  padding: 13px 14px;
}

.result-head p {
  color: var(--muted);
  margin: 3px 0 0;
}

.result-actions a {
  background: #fff;
  color: var(--brand);
}

.table-wrap {
  overflow-x: auto;
}

.bid-table {
  border-collapse: collapse;
  min-width: 1180px;
  width: 100%;
}

.bid-table th,
.bid-table td {
  border-bottom: 1px solid var(--line);
  font-size: 13px;
  padding: 7px 8px;
  text-align: left;
  vertical-align: top;
}

.bid-table th {
  background: #e6f0ef;
  color: #334155;
}

.bid-table td span,
.muted {
  color: var(--muted);
  font-size: 12px;
}

.sort-link {
  color: #334155;
  font-weight: 800;
}

.thumb {
  border-radius: 5px;
  display: block;
  height: 72px;
  object-fit: cover;
  width: 96px;
}

.money-stack {
  min-width: 116px;
}

.money-stack span {
  display: grid;
  gap: 8px;
  grid-template-columns: 36px 1fr;
}

.money-stack em {
  color: var(--muted);
  font-style: normal;
  font-weight: 800;
}

.money-stack strong {
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.money-stack .good strong {
  color: var(--good);
}

.money-stack .bad strong {
  color: var(--danger);
}

.status {
  border-radius: 999px;
  display: inline-flex;
  font-size: 12px;
  font-weight: 900;
  padding: 4px 8px;
  text-transform: uppercase;
}

.status-pending {
  background: #dbeafe;
  color: #1d4ed8;
}

.status-placed {
  background: #fef3c7;
  color: #92400e;
}

.status-won {
  background: #bbf7d0;
  color: #047857;
}

.status-lost,
.status-rejected,
.status-cancelled {
  background: #fee2e2;
  color: #b91c1c;
}

.notes {
  max-width: 210px;
  overflow-wrap: anywhere;
}

.update-form {
  min-width: 170px;
}

.update-form textarea {
  resize: vertical;
}

.empty {
  color: var(--muted);
  font-weight: 800;
  padding: 18px;
}

.pagination {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 14px;
}

.pagination a {
  background: #fff;
  color: var(--brand);
  min-width: 38px;
}

.pagination a.active {
  background: var(--brand);
  color: #fff;
}

.login-page {
  background:
    radial-gradient(circle at 18% 20%, rgba(217, 139, 38, .22), transparent 25%),
    radial-gradient(circle at 84% 12%, rgba(15, 118, 110, .25), transparent 26%),
    linear-gradient(135deg, var(--brand-dark), #0e2429 55%, #152f34);
  min-height: 100vh;
}

.login-shell {
  align-items: center;
  display: flex;
  justify-content: center;
  min-height: 100vh;
  padding: 24px;
}

.login-card {
  background: rgba(255, 255, 255, .96);
  border-radius: 18px;
  box-shadow: 0 30px 70px rgba(0, 0, 0, .28);
  max-width: 450px;
  overflow: hidden;
  padding: 30px;
  position: relative;
  width: 100%;
}

.login-card::before {
  background: linear-gradient(90deg, var(--brand), var(--accent));
  content: "";
  height: 5px;
  inset: 0 0 auto;
  position: absolute;
}

.login-card h1 {
  font-size: 30px;
  margin: 22px 0 6px;
}

.login-card p {
  color: var(--muted);
  margin: 0 0 20px;
}

.login-form {
  display: grid;
  gap: 14px;
}

.login-form label {
  display: grid;
  gap: 7px;
}

.login-form span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.login-form input,
.login-form button {
  min-height: 44px;
}

.alert {
  background: #fff1f2;
  border: 1px solid #fecdd3;
  border-radius: 8px;
  color: #9f1239;
  font-weight: 800;
  margin-bottom: 14px;
  padding: 10px 12px;
}

@media (max-width: 860px) {
  .topbar {
    align-items: flex-start;
    display: grid;
    gap: 10px;
  }

  .topnav {
    flex-wrap: wrap;
  }

  .top-meta {
    text-align: left;
  }

  .workspace {
    grid-template-columns: 1fr;
    padding: 10px;
  }

  .sidebar {
    max-height: none;
    position: static;
  }

  .bid-table,
  .bid-table tbody {
    display: block;
    min-width: 0;
    width: 100%;
  }

  .bid-table thead {
    display: none;
  }

  .bid-table tr {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    display: grid;
    gap: 4px 8px;
    grid-template-columns: 78px minmax(0, 1fr);
    margin-bottom: 8px;
    padding: 7px;
  }

  .bid-table td {
    border: 0;
    display: block;
    font-size: 11px;
    min-width: 0;
    padding: 0;
  }

  .bid-table td:first-child {
    grid-row: 1 / span 4;
  }

  .bid-table td:nth-child(n + 2) {
    grid-column: 2;
  }

  .bid-table td:last-child {
    grid-column: 1 / -1;
  }

  .thumb {
    height: 58px;
    width: 78px;
  }

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

  .update-form textarea,
  .update-form button {
    grid-column: 1 / -1;
  }
}
