:root {
  color-scheme: light;
  --bg: #f7f7f5;
  --surface: #ffffff;
  --ink: #111111;
  --muted: #6b6b6b;
  --line: #e3e3e0;
  --accent: #1a1a1a;
  --soft: rgba(0, 0, 0, 0.04);
  --shadow: 0 12px 30px rgba(0, 0, 0, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Space Grotesk', system-ui, -apple-system, sans-serif;
  background: radial-gradient(circle at 20% 20%, #ffffff 0%, #f3f3f1 55%, #ededeb 100%);
  color: var(--ink);
}

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

header {
  position: sticky;
  top: 0;
  z-index: 30;
  backdrop-filter: blur(14px);
  background: rgba(247, 247, 245, 0.9);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px 24px 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.title-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
}

.subtitle {
  font-size: 14px;
  color: var(--muted);
}

.filters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.filter-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
}

.filter-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tab {
  border: 1px solid var(--line);
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 13px;
  cursor: pointer;
  background: var(--surface);
  color: var(--ink);
  transition: all 0.2s ease;
}

.tab.active {
  background: var(--ink);
  color: #ffffff;
  border-color: var(--ink);
}

main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 30px 24px 80px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.spinner {
  width: 18px;
  height: 18px;
  border: 2px solid var(--line);
  border-top: 2px solid var(--ink);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}

.metric-card {
  padding: 18px 20px;
  background: var(--surface);
  border-radius: 18px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.metric-label {
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.metric-value {
  margin-top: 8px;
  font-size: 26px;
  font-weight: 600;
}

.section {
  padding: 20px 22px;
  background: var(--surface);
  border-radius: 20px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.section-title {
  font-size: 16px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 14px;
}

.list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.list-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--soft);
}

.list-label {
  font-size: 14px;
}

.list-value {
  font-size: 13px;
  color: var(--muted);
}

.bar {
  position: relative;
  flex: 1;
  height: 6px;
  border-radius: 999px;
  background: #e7e7e5;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  background: var(--ink);
}

.visitor {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px;
}

.visitor summary {
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.visitor-details {
  margin-top: 10px;
  font-size: 13px;
  color: var(--muted);
  display: grid;
  gap: 6px;
}

.visitor-pages {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.visitor-pages-label {
  font-weight: 500;
  color: var(--muted);
}

.visitor-page {
  padding: 4px 8px;
  border-radius: 999px;
  background: #f0f0ee;
  color: #111111;
  font-size: 12px;
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.table th,
.table td {
  padding: 10px 8px;
  text-align: left;
  border-bottom: 1px solid var(--line);
}

.empty {
  padding: 16px;
  border-radius: 12px;
  background: var(--soft);
  font-size: 13px;
  color: var(--muted);
}

.pagination {
  margin-top: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.pagination .pager-info {
  font-size: 13px;
  color: var(--muted);
}

.pager-buttons {
  display: flex;
  gap: 8px;
}

.pager-button {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  padding: 6px 12px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 12px;
  transition: all 0.2s ease;
}

.pager-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

footer {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

@media (max-width: 720px) {
  .header-inner {
    padding: 16px;
  }

  main {
    padding: 24px 16px 60px;
  }
}
