:root {
  --navy: #0b3a6f;
  --navy-dark: #08294f;
  --gold: #c8963e;
  --gold-light: #f1c679;
  --ink: #4a5a72;
  --line: #d5deea;
  --soft: #eef2f8;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  color: #1b2a41;
  background: var(--soft);
}

[hidden] {
  display: none !important;
}

/* The site's banner across the top, with who is signed in on the right. */
.top {
  position: relative;
  height: 96px;
  overflow: hidden;
  background: var(--navy);
  border-bottom: 3px solid var(--gold);
}

.banner {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: left top;
  display: block;
}

.who {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  gap: 12px;
  align-items: center;
  background: rgba(255, 255, 255, 0.9019607843);
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--navy);
}

.link {
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  color: var(--navy);
  text-decoration: underline;
  cursor: pointer;
}

.btn {
  font: inherit;
  font-weight: 700;
  padding: 9px 18px;
  border-radius: 8px;
  border: 2px solid var(--gold-light);
  background: var(--gold);
  color: var(--navy-dark);
  cursor: pointer;
}
.btn:hover {
  background: var(--navy);
  border-color: var(--navy);
  color: #fff;
}

.message {
  color: var(--ink);
  line-height: 1.5;
}

.error {
  max-width: 640px;
  margin: 24px auto;
  padding: 12px 16px;
  background: #fdecea;
  color: #8a1c13;
  border-radius: 8px;
}

.login {
  display: grid;
  place-items: center;
  padding: 48px 16px;
}

.card {
  width: 100%;
  max-width: 440px;
  background: #fff;
  border-radius: 12px;
  padding: 28px 32px;
  box-shadow: 0 4px 24px rgba(10, 30, 60, 0.1215686275);
}
.card h1 {
  margin: 0 0 8px;
  color: var(--navy);
}
.card p {
  line-height: 1.5;
}

#google-button {
  margin: 20px 0 4px;
  min-height: 44px;
}

.dashboard {
  max-width: 1400px;
  margin: 0 auto;
  padding: 20px 16px 48px;
}

.head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.head h1 {
  margin: 0;
  color: var(--navy);
}

/* One card per website: its total and how many came in this week. Clicking one filters to it. */
.sites {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(210px, 45%), 1fr));
  gap: 12px;
  margin: 16px 0;
}

.site {
  text-align: left;
  font: inherit;
  background: #fff;
  border: 2px solid transparent;
  border-radius: 10px;
  padding: 12px 14px;
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(10, 30, 60, 0.0784313725);
}
.site.on {
  border-color: var(--gold);
}
.site .name {
  font-size: 0.85rem;
  color: var(--ink);
  overflow-wrap: anywhere;
}
.site .total {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--navy);
}
.site .week {
  font-size: 0.8rem;
  color: var(--ink);
}

.filters {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.filters input, .filters select {
  font: inherit;
  font-size: 1rem;
  padding: 9px 12px;
  border: 1px solid #c3cddc;
  border-radius: 8px;
  background: #fff;
}
.filters input {
  flex: 1 1 260px;
}

.count {
  font-size: 0.85rem;
  color: var(--ink);
  margin: 12px 0 6px;
}

.table-wrap {
  overflow-x: auto;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 1px 4px rgba(10, 30, 60, 0.0784313725);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

th {
  position: sticky;
  top: 0;
  background: var(--navy);
  color: #fff;
  text-align: left;
  padding: 9px 10px;
  white-space: nowrap;
}

td {
  padding: 9px 10px;
  border-top: 1px solid var(--line);
  vertical-align: top;
}

tbody tr.lead {
  cursor: pointer;
}
tbody tr.lead:hover {
  background: #f7f9fc;
}
tbody tr.lead.open {
  background: #fff8e8;
}

td a {
  color: var(--navy);
}

.tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--soft);
  color: var(--navy);
  font-size: 0.8rem;
  white-space: nowrap;
}

/* A lead's details, shown under it when clicked. */
tr.details td {
  background: #fffdf6;
  padding: 12px 16px 16px;
}

dl {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px 24px;
  margin: 0;
}
dl div {
  min-width: 0;
}
dl dt {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink);
}
dl dd {
  margin: 2px 0 0;
  font-weight: 600;
  overflow-wrap: anywhere;
}

@media (max-width: 640px) {
  .top {
    height: 64px;
  }
  .who {
    right: 8px;
    padding: 6px 10px;
    font-size: 0.8rem;
  }
  .who #agent-name {
    display: none;
  }
  .card {
    padding: 22px 20px;
  }
}
