* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: #f7f7f8;
  color: #111;
  font-size: 14px;
  line-height: 1.5;
}
a { color: #2563eb; text-decoration: none; }
a:hover { text-decoration: underline; }

.top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #fff;
  border-bottom: 1px solid #e5e7eb;
  padding: 0 24px;
  height: 56px;
}
.top .brand { font-weight: 600; color: #111; font-size: 16px; }
.top nav { display: flex; gap: 16px; align-items: center; }
.user { color: #6b7280; }

main { max-width: 1200px; margin: 0 auto; padding: 24px; }

button, .btn {
  background: #111;
  color: #fff;
  border: 0;
  border-radius: 6px;
  padding: 8px 14px;
  font-size: 14px;
  cursor: pointer;
}
button.link {
  background: transparent;
  color: #2563eb;
  padding: 0;
}
button.danger { background: #dc2626; }

input[type="text"], input[type="password"], input[type="email"] {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 14px;
  margin-top: 4px;
}
label { display: block; margin-bottom: 12px; color: #374151; }

.error {
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fecaca;
  padding: 8px 12px;
  border-radius: 6px;
  margin-bottom: 12px;
}

.auth-card {
  max-width: 360px;
  margin: 80px auto;
  background: #fff;
  padding: 32px;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
}
.auth-card h1 { margin-top: 0; font-size: 20px; }
.auth-card button { width: 100%; padding: 10px; font-size: 15px; }

.card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 16px;
}
.card h2 { margin-top: 0; font-size: 14px; font-weight: 600; color: #6b7280; text-transform: uppercase; letter-spacing: .5px; }

.row { display: flex; gap: 16px; flex-wrap: wrap; }
.col { flex: 1; min-width: 280px; }

.stats-wrap { margin-bottom: 16px; }
.stats {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}
@media (max-width: 900px) { .stats { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .stats { grid-template-columns: 1fr; } }
.stat {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 14px 16px;
}
.stat .label { font-size: 11px; color: #6b7280; text-transform: uppercase; letter-spacing: .5px; font-weight: 500; }
.stat .value { font-size: 22px; font-weight: 600; margin-top: 2px; font-variant-numeric: tabular-nums; }
.chart { width: 100%; height: 240px; }

table { width: 100%; border-collapse: collapse; }
th, td { padding: 8px 12px; text-align: left; border-bottom: 1px solid #f3f4f6; font-size: 13px; }
th { color: #6b7280; font-weight: 500; font-size: 12px; text-transform: uppercase; letter-spacing: .5px; }
td.num { text-align: right; font-variant-numeric: tabular-nums; }

.bar-row { display: flex; align-items: center; gap: 12px; padding: 6px 0; font-size: 13px; }
.bar-row .name { flex: 0 0 50%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-row .bar { flex: 1; height: 6px; background: #f3f4f6; border-radius: 3px; overflow: hidden; }
.bar-row .bar > div { height: 100%; background: #2563eb; }
.bar-row .count { flex: 0 0 60px; text-align: right; font-variant-numeric: tabular-nums; color: #6b7280; }

.toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; flex-wrap: wrap; gap: 12px; }
.toolbar h1 { margin: 0; font-size: 20px; font-weight: 600; }
.toolbar .title { display: flex; align-items: baseline; gap: 10px; }
.toolbar .title .domain { color: #6b7280; font-size: 13px; }
.toolbar .ranges { display: flex; gap: 4px; align-items: center; }
.toolbar .ranges a {
  padding: 6px 10px;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  background: #fff;
  color: #374151;
  font-size: 13px;
}
.toolbar .ranges a.active { background: #111; color: #fff; border-color: #111; }
.toolbar .ranges a:hover { text-decoration: none; }

.empty { color: #9ca3af; font-size: 13px; padding: 12px; }

.site-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
.site-tile { background: #fff; border: 1px solid #e5e7eb; border-radius: 8px; padding: 16px; }
.site-tile h3 { margin: 0 0 4px 0; font-size: 16px; }
.site-tile .domain { color: #6b7280; font-size: 13px; }

#chart { width: 100%; height: 240px; }
