:root {
  --bg: #f4f6f9;
  --card: #ffffff;
  --ink: #1f2933;
  --muted: #6b7684;
  --line: #e2e7ee;
  --accent: #1d4ed8;
  --accent-soft: #eff4ff;
  --head: #0f2a52;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.45;
}

.topbar {
  background: var(--head);
  color: #fff;
}
.topbar-inner {
  max-width: 1000px;
  margin: 0 auto;
  padding: 16px 20px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.topbar h1 { font-size: 18px; margin: 0; font-weight: 650; letter-spacing: .2px; }
.who { font-size: 13px; color: #c7d6ef; }
.who strong { color: #fff; }

.wrap {
  max-width: 1000px;
  margin: 0 auto;
  padding: 20px;
}

.auth-error {
  background: #fff4f4;
  border: 1px solid #f3c2c2;
  color: #8a1c1c;
  border-radius: 10px;
  padding: 18px 20px;
  font-size: 14px;
}
.auth-error strong { display: block; margin-bottom: 4px; font-size: 15px; }

.loading { color: var(--muted); padding: 30px 4px; }

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.count {
  font-weight: 650;
  font-size: 15px;
  background: var(--accent-soft);
  color: var(--accent);
  padding: 7px 14px;
  border-radius: 999px;
}
.controls { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.controls input[type="search"] {
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 14px;
  min-width: 180px;
}
.date-filter {
  font-size: 12px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 5px;
}
.date-filter input {
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 13px;
}
.btn-secondary {
  padding: 8px 14px;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  color: var(--ink);
}
.btn-secondary:hover { background: #f7f9fc; }

.table-scroll {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: auto;
  box-shadow: 0 1px 2px rgba(16,42,82,.04);
}

table { width: 100%; border-collapse: collapse; }
thead th {
  text-align: left;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .4px;
  color: var(--muted);
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  background: #fafbfd;
  white-space: nowrap;
}
th.sortable { cursor: pointer; user-select: none; }
th.sortable:hover { color: var(--ink); }
th .arrow { font-size: 10px; color: var(--accent); }

tbody td {
  padding: 11px 16px;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: #f8fafd; }
td.site { font-weight: 600; font-variant-numeric: tabular-nums; }
td.when { color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }

.badge {
  display: inline-block;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #eef1f6;
  color: #46525f;
}
.badge.intl { background: #fff2e6; color: #9a4a00; }
.badge.domestic { background: #e8f0ff; color: #1d4ed8; }

/* Hide the vendor + program columns unless admin (all-vendor) view. */
body:not(.admin) .col-vendor,
body:not(.admin) .col-source { display: none; }

.dl-btn {
  display: inline-block;
  padding: 5px 12px;
  border-radius: 7px;
  background: var(--accent-soft);
  color: var(--accent);
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  border: 1px solid #d4e1ff;
  white-space: nowrap;
}
.dl-btn:hover { background: #e2ecff; }
td.col-dl { text-align: right; white-space: nowrap; }
th.col-dl { text-align: right; }

.empty { padding: 28px 16px; color: var(--muted); }

.foot {
  max-width: 1000px;
  margin: 0 auto;
  padding: 18px 20px 40px;
  color: var(--muted);
  font-size: 12px;
}
