.stats-page {
  background: var(--gray-50);
  min-height: 100vh;
}

.stats-header {
  background: linear-gradient(135deg, var(--blue-deep), #1e3a5f);
  color: #fff;
  padding: 1.25rem 0;
}

.stats-header-inner h1 {
  margin: 0.35rem 0 0.15rem;
  font-size: clamp(1.25rem, 4vw, 1.75rem);
}

.stats-header-inner p {
  margin: 0;
  opacity: 0.85;
  font-size: 0.85rem;
}

.stats-back {
  color: #93c5fd;
  font-size: 0.82rem;
  font-weight: 700;
  text-decoration: none;
}

.stats-back:hover {
  text-decoration: underline;
}

.stats-main {
  padding: 1.25rem 1rem 2rem;
}

.stats-login {
  max-width: 420px;
  margin: 0 auto;
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: 12px;
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
}

.stats-login h2 {
  margin: 0 0 0.35rem;
  font-size: 1.1rem;
}

.stats-form {
  display: grid;
  gap: 0.5rem;
  margin-top: 1rem;
}

.stats-form label {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--gray-500);
}

.stats-form input {
  padding: 0.55rem 0.65rem;
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  font-family: inherit;
}

.stats-hint {
  margin: 0.75rem 0 0;
  font-size: 0.72rem;
  color: var(--gray-500);
}

.stats-hint code {
  background: var(--gray-100);
  padding: 0.1rem 0.3rem;
  border-radius: 4px;
}

.stats-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.65rem;
  margin-bottom: 1rem;
}

.stats-card {
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: 10px;
  padding: 0.85rem;
}

.stats-card--accent {
  border-color: #059669;
  background: linear-gradient(135deg, #ecfdf5, #fff);
}

.stats-card-label {
  display: block;
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--gray-500);
  text-transform: uppercase;
}

.stats-card-value {
  display: block;
  margin-top: 0.25rem;
  font-size: clamp(1.5rem, 5vw, 2rem);
  color: var(--blue-deep);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.stats-panel {
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: 10px;
  padding: 0.85rem;
}

.stats-panel h3 {
  margin: 0 0 0.65rem;
  font-size: 0.9rem;
}

.stats-country-row {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) 1fr auto;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 0.45rem;
  font-size: 0.78rem;
}

.stats-country-name {
  font-weight: 600;
}

.stats-country-code {
  margin-left: 0.2rem;
  font-size: 0.68rem;
  font-weight: 500;
  color: var(--gray-500);
}

.stats-bar {
  height: 8px;
  background: var(--gray-100);
  border-radius: 999px;
  overflow: hidden;
}

.stats-bar span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--blue), #059669);
  border-radius: 999px;
}

.stats-week-chart {
  display: flex;
  align-items: flex-end;
  gap: 0.35rem;
  height: 120px;
  padding-top: 0.5rem;
}

.stats-week-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
  justify-content: flex-end;
  font-size: 0.62rem;
  color: var(--gray-500);
}

.stats-week-bar {
  width: 100%;
  max-width: 36px;
  background: linear-gradient(180deg, #3b82f6, #1e3a5f);
  border-radius: 4px 4px 0 0;
  min-height: 8px;
}

.stats-week-col em {
  font-style: normal;
  font-weight: 800;
  color: var(--blue-deep);
}

.stats-table-wrap {
  overflow-x: auto;
}

.stats-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.72rem;
}

.stats-table th,
.stats-table td {
  padding: 0.4rem 0.35rem;
  border-bottom: 1px solid var(--gray-100);
  text-align: left;
}

.stats-updated {
  margin: 0.75rem 0 0.5rem;
  font-size: 0.75rem;
  color: var(--gray-500);
}

.stats-error {
  margin-top: 1rem;
  padding: 0.75rem;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 8px;
  color: #991b1b;
  font-size: 0.82rem;
}

.stats-empty {
  margin: 0;
  color: var(--gray-500);
  font-size: 0.82rem;
}

.btn-primary {
  background: var(--blue-deep);
  color: #fff;
  border: none;
  cursor: pointer;
}

.btn-ghost {
  background: transparent;
  border: 1px solid var(--gray-200);
  color: var(--blue-deep);
  cursor: pointer;
}
