/* Trainer user statistics modal — layout (tr- prefix) */

/* Icon-only stats trigger above editor: symbol, no button chrome */
.trainer-page .tr-editor-stat-icon {
  width: 16px;
  height: 16px;
  padding: 0;
  margin-top: 0;
  margin-bottom: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  line-height: 1;
}

.trainer-page .tr-editor-stat-icon:hover {
  color: var(--primary-color);
  background: transparent;
}

.trainer-page .tr-editor-stat-icon:focus {
  outline: none;
}

.trainer-page .tr-editor-stat-icon:focus-visible {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

.trainer-page .tr-editor-stat-icon .bi {
  font-size: 16px;
  line-height: 1;
  display: block;
}


.tr-stat-modal-body {
  display: flex;
  flex-direction: column;
  min-height: 0;
  max-height: calc(100vh - 120px);
  overflow: hidden;
}

.tr-stat-root {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
  flex: 1 1 auto;
}

.tr-stat-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}

.tr-stat-desc {
  font-size: 12px;
  line-height: 1.4;
  color: var(--text-secondary);
  margin-bottom: 0;
}

.tr-stat-body {
  flex: 1 1 auto;
  min-height: 200px;
  min-width: 0;
  overflow-y: auto;
  overflow-x: hidden;
}

.tr-stat-kpi-row .card {
  border-color: var(--border-color);
  background: var(--background-color);
}

.tr-stat-kpi-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.02em;
  margin-bottom: 4px;
}

.tr-stat-kpi-value {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}

.tr-stat-section {
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: var(--background-color);
  overflow: hidden;
  min-width: 0;
}

.tr-stat-section-title {
  font-size: 13px;
  font-weight: 600;
  padding: 6px 10px;
  border-bottom: 1px solid var(--border-color);
  background: var(--accent-color);
  color: var(--text-primary);
}

.tr-stat-section-body {
  padding: 8px 10px;
  min-width: 0;
}

.tr-stat-activity-wrap {
  width: 100%;
  min-width: 0;
}

.tr-stat-activity {
  width: 100%;
  min-width: 0;
}

.tr-stat-activity-hint {
  margin-bottom: 0.5rem;
  line-height: 1.35;
}

.tr-stat-day-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: min(280px, 38vh);
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 2px;
}

.tr-stat-day-row {
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr) 32px;
  gap: 8px;
  align-items: center;
  min-width: 0;
}

.tr-stat-day-label {
  font-size: 11px;
  color: var(--text-secondary);
  white-space: nowrap;
}

.tr-stat-day-bar-track {
  height: 10px;
  border-radius: 5px;
  background: var(--accent-color);
  overflow: hidden;
  min-width: 0;
}

.tr-stat-day-bar-fill {
  height: 100%;
  border-radius: 5px;
  background: var(--primary-color);
  min-width: 0;
  transition: width 0.15s ease-out;
}

.tr-stat-day-count {
  font-size: 12px;
  font-weight: 600;
  text-align: right;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}

.tr-stat-table-wrap {
  max-height: min(420px, 45vh);
  overflow: auto;
}

@media (max-width: 991.98px) {
  .tr-stat-kpi-row .col {
    margin-bottom: 4px;
  }

  .tr-stat-table-wrap {
    max-height: 50vh;
  }
}
