.analytics-view {
  display: grid;
  gap: 14px;
  padding: 0 30px 30px;
}

.analytics-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(160px, 1fr));
  gap: 14px;
}

.analytics-tile,
.analytics-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.analytics-tile {
  min-height: 132px;
  display: grid;
  align-content: start;
  gap: 8px;
  border-top: 4px solid #a7b2ad;
  padding: 16px;
}

.analytics-tile.is-late,
.analytics-graph-panel.is-late {
  border-top-color: #e16958;
}

.analytics-tile.is-shift,
.analytics-graph-panel.is-shift {
  border-top-color: #d39122;
}

.analytics-tile.is-tasks {
  border-top-color: #438dac;
}

.analytics-tile.is-focus {
  border-top-color: #8064b6;
}

.analytics-tile span,
.analytics-tile p,
.analytics-panel > header span,
.analytics-chart-column span,
.analytics-matrix-head,
.analytics-matrix-row em {
  color: var(--muted);
}

.analytics-tile span {
  font-size: 0.8rem;
  font-weight: 900;
  text-transform: uppercase;
}

.analytics-tile strong {
  color: var(--ink);
  font-size: clamp(1.35rem, 2vw, 1.9rem);
  line-height: 1.1;
  overflow-wrap: anywhere;
}

.analytics-tile p {
  margin: 0;
  font-size: 0.82rem;
  line-height: 1.4;
}

.analytics-panel {
  display: grid;
  gap: 18px;
  border-top: 4px solid #a7b2ad;
  padding: 18px;
}

.analytics-panel > header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.analytics-panel > header span {
  font-size: 0.82rem;
  font-weight: 800;
}

.analytics-chart {
  min-height: 230px;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(82px, 1fr);
  gap: 10px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7faf8;
  padding: 16px 14px 12px;
}

.analytics-chart-column {
  min-width: 82px;
  display: grid;
  grid-template-rows: 1fr auto auto;
  gap: 7px;
  align-items: end;
  text-align: center;
}

.analytics-chart-bar {
  position: relative;
  width: 100%;
  min-height: 142px;
  overflow: hidden;
  border-radius: 8px;
  background:
    repeating-linear-gradient(
      to top,
      rgba(20, 32, 31, 0.06) 0,
      rgba(20, 32, 31, 0.06) 1px,
      transparent 1px,
      transparent 28px
    ),
    #eef3f0;
}

.analytics-chart-bar i {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 0;
  display: block;
  min-height: 4px;
  border-radius: 8px 8px 0 0;
}

.analytics-chart-bar.is-late i {
  background: #e16958;
}

.analytics-chart-bar.is-shift i {
  background: #d39122;
}

.analytics-chart-column strong {
  color: var(--ink);
  font-size: 1.05rem;
}

.analytics-chart-column span {
  font-size: 0.78rem;
  font-weight: 800;
}

.analytics-matrix {
  display: grid;
  gap: 6px;
  overflow-x: auto;
}

.analytics-matrix-head,
.analytics-matrix-row {
  display: grid;
  grid-template-columns: minmax(160px, 1.4fr) repeat(var(--week-count), minmax(58px, 1fr)) minmax(62px, 0.55fr);
  gap: 6px;
  align-items: center;
  min-width: 760px;
}

.analytics-matrix-head {
  font-size: 0.74rem;
  font-weight: 900;
  text-transform: uppercase;
}

.analytics-matrix-row {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 6px;
}

.analytics-matrix-row strong {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.analytics-matrix-row strong i {
  width: 9px;
  height: 9px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--dot);
}

.analytics-matrix-row span {
  min-height: 34px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  background: rgba(32, 148, 119, var(--intensity));
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 900;
}

.analytics-matrix-row em {
  font-style: normal;
  font-weight: 900;
  text-align: right;
}

@media (max-width: 1180px) {
  .analytics-summary {
    grid-template-columns: repeat(2, minmax(180px, 1fr));
  }
}

@media (max-width: 820px) {
  .analytics-view {
    padding: 0 18px 24px;
  }

  .analytics-summary {
    grid-template-columns: 1fr;
  }

  .analytics-panel > header {
    display: grid;
  }
}
