/* Admin stats: stat tiles, the period table, feature usage bars (shared
   .bar-container/.bar-fill from insights.css) and the daily table. */

.admin-stats-section + .admin-stats-section {
  margin-top: 36px;
}

.admin-stats-section h2 {
  margin-bottom: 14px;
  font-size: 1.2rem;
  font-weight: 700;
}

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

.stat-tile {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.stat-label {
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 600;
}

.stat-value {
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 1.9rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.stat-note {
  color: var(--faint);
  font-size: 0.8rem;
}

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

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  font-variant-numeric: tabular-nums;
}

.admin-table th,
.admin-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--line-soft);
  text-align: right;
  white-space: nowrap;
}

.admin-table thead th {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 600;
}

.admin-table tbody th {
  color: var(--ink-soft);
  font-weight: 600;
  text-align: left;
}

.admin-table tbody tr:last-child > * {
  border-bottom: none;
}

.admin-note {
  margin-top: 12px;
  color: var(--body);
  font-size: 0.9rem;
}

.usage-row {
  display: grid;
  grid-template-columns: 110px 1fr auto;
  align-items: center;
  gap: 12px;
}

.activation-row {
  grid-template-columns: minmax(120px, 190px) 1fr auto;
}

.usage-row + .usage-row {
  margin-top: 12px;
}

.usage-label {
  color: var(--ink-soft);
  font-size: 0.9rem;
  font-weight: 600;
}

.usage-count {
  color: var(--muted);
  font-size: 0.85rem;
  font-variant-numeric: tabular-nums;
}

.admin-daily td:nth-child(2) {
  width: 40%;
}

.daily-active {
  display: flex;
  align-items: center;
  gap: 8px;
}

.daily-track {
  flex: 1;
  min-width: 40px;
}

.daily-bar {
  display: block;
  height: 8px;
  min-width: 2px;
  border-radius: 999px;
  background: var(--gradient-bar);
}

@media (max-width: 480px) {
  .admin-table th,
  .admin-table td {
    padding: 7px 6px;
    font-size: 0.82rem;
  }
}

.admin-nav {
  min-width: 200px;
}

.admin-nav .segmented-option {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 6px 12px;
  border-radius: 9px;
  color: var(--body);
  font-size: 0.86rem;
  font-weight: 600;
  text-decoration: none;
}

.admin-nav .segmented-option:hover {
  color: var(--ink);
}

.admin-nav .segmented-option[aria-current="page"] {
  background: var(--surface);
  color: var(--primary-ink);
  box-shadow: var(--shadow-sm);
}

.admin-feedback .feedback-message {
  min-width: 260px;
  max-width: 480px;
  color: var(--ink-soft);
  text-align: left;
  white-space: normal;
  overflow-wrap: anywhere;
}

.admin-feedback .feedback-message p + p {
  margin-top: 6px;
}

.admin-feedback td:nth-child(4),
.admin-feedback td:nth-child(5) {
  text-align: left;
}

.feedback-score {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-weight: 700;
}

.feedback-score-1,
.feedback-score-2 {
  background: var(--danger-wash);
  color: var(--danger-ink);
}

.feedback-score-3 {
  background: var(--amber-wash);
  color: var(--amber-ink);
}

.feedback-score-4,
.feedback-score-5 {
  background: var(--green-wash);
  color: var(--green);
}
