.analytics-admin-page {
  background: #f7f6f3;
}

.analytics-header {
  align-items: flex-start;
}

.analytics-header-actions {
  flex-wrap: wrap;
}

.analytics-periods {
  display: grid;
  grid-template-columns: repeat(4, minmax(68px, 1fr));
  gap: 6px;
  margin: 0;
  padding: 0;
  border: 0;
}

.analytics-periods label {
  position: relative;
  min-width: 0;
  cursor: pointer;
}

.analytics-periods input {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
}

.analytics-periods span {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid rgba(23, 23, 19, 0.12);
  border-radius: 8px;
  background: #fff;
  color: rgba(23, 23, 19, 0.66);
  font-size: 1.12rem;
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1;
}

.analytics-periods input:checked + span {
  border-color: #171713;
  background: #171713;
  color: #fbfafa;
}

.analytics-periods input:focus-visible + span {
  outline: 2px solid #171713;
  outline-offset: 3px;
}

.analytics-status-panel {
  display: flex;
  align-items: center;
  min-height: 48px;
  margin: 4px 0 14px;
  padding: 0 16px;
  border: 1px solid rgba(23, 23, 19, 0.08);
  border-radius: 8px;
  background: #fff;
  color: rgba(23, 23, 19, 0.62);
  font-size: 1.18rem;
  font-weight: 650;
}

.analytics-status-panel.is-error {
  border-color: rgba(132, 35, 26, 0.18);
  background: #fff8f6;
  color: #84231a;
}

.analytics-status-panel.is-ok {
  border-color: rgba(64, 80, 58, 0.16);
  background: #f3f8f1;
  color: #40503a;
}

.analytics-overview {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(300px, 0.65fr);
  gap: 16px;
  margin-bottom: 16px;
}

.analytics-summary,
.analytics-insights {
  min-width: 0;
  border: 1px solid rgba(23, 23, 19, 0.08);
  border-radius: 8px;
  background: #fff;
}

.analytics-summary {
  padding: clamp(22px, 3vw, 34px);
}

.analytics-summary h2 {
  max-width: 780px;
  margin: 0;
  color: #171713;
  font-size: clamp(3rem, 4.2vw, 5.4rem);
  font-weight: 650;
  letter-spacing: 0;
  line-height: 0.98;
}

.analytics-summary p:not(.admin-eyebrow) {
  max-width: 760px;
  margin: 18px 0 0;
  color: rgba(23, 23, 19, 0.62);
  font-size: clamp(1.22rem, 1.2vw, 1.42rem);
  font-weight: 600;
  line-height: 1.5;
}

.analytics-insights {
  display: grid;
  align-content: start;
  gap: 14px;
  padding: 22px;
}

.analytics-insights ul {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.analytics-insights li {
  display: grid;
  gap: 4px;
  padding: 0 0 12px;
  border-bottom: 1px solid rgba(23, 23, 19, 0.08);
  color: rgba(23, 23, 19, 0.7);
  font-size: 1.18rem;
  font-weight: 650;
  line-height: 1.35;
}

.analytics-insights li:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.analytics-insights strong {
  color: #171713;
  font-size: 1.28rem;
  font-weight: 800;
}

.analytics-kpis {
  display: grid;
  grid-template-columns: 1.15fr repeat(3, minmax(180px, 0.95fr));
  gap: 12px;
}

.analytics-kpi {
  display: grid;
  gap: 10px;
  min-height: 138px;
  padding: 18px;
  border: 1px solid rgba(23, 23, 19, 0.08);
  border-radius: 8px;
  background: #fff;
}

.analytics-kpi span {
  color: rgba(23, 23, 19, 0.56);
  font-size: 1.08rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.analytics-kpi strong {
  color: #171713;
  font-size: clamp(3rem, 4vw, 4.8rem);
  font-weight: 680;
  letter-spacing: 0;
  line-height: 0.9;
}

.analytics-kpi small {
  color: rgba(23, 23, 19, 0.52);
  font-size: 1.04rem;
  font-weight: 650;
  line-height: 1.3;
}

.analytics-kpi-main {
  background: #171713;
}

.analytics-kpi-main span,
.analytics-kpi-main small {
  color: rgba(251, 250, 250, 0.7);
}

.analytics-kpi-main strong {
  color: #fbfafa;
}

.analytics-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(300px, 0.75fr);
  gap: 16px;
  margin-top: 16px;
}

.analytics-chart-panel {
  min-height: 460px;
}

.analytics-chart-shell {
  position: relative;
  min-height: 330px;
  padding-top: 18px;
}

.analytics-chart {
  display: block;
  width: 100%;
  height: auto;
  min-height: 260px;
}

.analytics-chart .grid-line {
  stroke: rgba(23, 23, 19, 0.08);
  stroke-width: 1;
}

.analytics-chart .area {
  fill: rgba(101, 108, 92, 0.12);
}

.analytics-chart .line {
  fill: none;
  stroke: #40503a;
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.analytics-chart .dot {
  fill: #171713;
}

.analytics-chart .axis-label {
  fill: rgba(23, 23, 19, 0.54);
  font-family: Poppins, sans-serif;
  font-size: 16px;
  font-weight: 700;
}

.analytics-empty {
  position: absolute;
  inset: 18px 0 0;
  display: grid;
  margin: 0;
  place-items: center;
  color: rgba(23, 23, 19, 0.52);
  font-size: 1.3rem;
  font-weight: 700;
}

.analytics-empty[hidden] {
  display: none !important;
}

.analytics-side,
.analytics-detail-grid {
  display: grid;
  gap: 16px;
  align-content: start;
}

.analytics-detail-grid {
  grid-template-columns: minmax(0, 1.25fr) minmax(260px, 0.85fr) minmax(260px, 0.85fr);
  margin-top: 16px;
}

.analytics-setup {
  display: grid;
  gap: 12px;
  padding-top: 16px;
}

.analytics-setup p,
.analytics-setup li {
  margin: 0;
  color: rgba(23, 23, 19, 0.62);
  font-size: 1.16rem;
  font-weight: 600;
  line-height: 1.45;
}

.analytics-setup ul {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.analytics-setup code {
  padding: 3px 6px;
  border-radius: 6px;
  background: #f1eee8;
  color: #171713;
  font-size: 1.04rem;
}

.analytics-list,
.analytics-table {
  display: grid;
  gap: 10px;
  padding-top: 16px;
}

.analytics-list-row,
.analytics-table-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  min-height: 46px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(23, 23, 19, 0.08);
  position: relative;
}

.analytics-list-row:last-child,
.analytics-table-row:last-child {
  border-bottom: 0;
}

.analytics-list-row span,
.analytics-table-row span {
  min-width: 0;
  overflow: hidden;
  color: rgba(23, 23, 19, 0.7);
  font-size: 1.18rem;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.analytics-list-row strong,
.analytics-table-row strong {
  color: #171713;
  font-size: 1.34rem;
  font-weight: 800;
}

.analytics-table-row span {
  font-family: var(--mono, ui-monospace, SFMono-Regular, Menlo, monospace);
  font-size: 1.08rem;
}

.analytics-row-meter {
  grid-column: 1 / -1;
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(23, 23, 19, 0.06);
}

.analytics-row-meter::before {
  display: block;
  width: var(--bar-width, 0%);
  height: 100%;
  border-radius: inherit;
  background: #40503a;
  content: "";
}

.analytics-row-empty {
  margin: 0;
  padding-top: 14px;
  color: rgba(23, 23, 19, 0.52);
  font-size: 1.16rem;
  font-weight: 700;
}

@media (max-width: 1100px) {
  .analytics-overview,
  .analytics-kpis,
  .analytics-workspace,
  .analytics-detail-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .analytics-header-actions {
    align-items: stretch;
    width: 100%;
  }

  .analytics-periods {
    width: 100%;
  }

  .analytics-header-actions .admin-button {
    width: 100%;
  }
}
