.uspacy-shell {
  display: grid;
  gap: 16px;
}

.page-note {
  max-width: 760px;
  margin: 12px 0 0;
  color: var(--muted);
  line-height: 1.45;
}

.crm-link {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(13, 148, 136, 0.32);
  border-radius: 8px;
  padding: 0 14px;
  color: var(--accent-strong);
  background: #f0fdfa;
  font-weight: 700;
  text-decoration: none;
}

.period-panel {
  padding: 18px 20px;
}

.period-controls {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.period-btn,
.month-control input {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 0 13px;
  font: inherit;
}

.period-btn {
  cursor: pointer;
}

.period-btn.active {
  border-color: var(--accent);
  color: var(--accent-strong);
  background: #f0fdfa;
  font-weight: 700;
}

.month-control {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 12px;
}

.period-panel .panel-note {
  margin: 12px 0 0;
}

.uspacy-metrics {
  margin-top: 0;
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.uspacy-metrics article {
  min-width: 0;
}

.uspacy-metrics strong {
  display: block;
  margin-top: 6px;
  font-size: 28px;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px 0;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 12px 20px;
  border-top: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  white-space: nowrap;
}

th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

td {
  font-size: 14px;
}

td:first-child,
th:first-child {
  white-space: normal;
}

.lead-id {
  color: var(--accent-strong);
  font-weight: 800;
}

.empty-row {
  color: var(--muted);
  text-align: center;
}

@media (max-width: 980px) {
  .uspacy-metrics {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 620px) {
  .shell {
    width: min(100% - 20px, 1180px);
    padding-top: 10px;
  }

  .topbar,
  .panel-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .topbar {
    padding: 18px;
  }

  .topbar-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .uspacy-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  th,
  td {
    padding: 10px 14px;
  }
}
