/* «Время в CRM» — таблица активности по отделам ОП-1..3. */
.analytics-content:has(.activity-report) { min-width: 0; padding: 24px; }
.activity-report { min-width: 0; color: var(--text); }
.activity-heading-actions { display: flex; align-items: center; gap: 12px; }

.activity-period { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; margin: 0 0 18px; padding: 14px 16px; background: var(--surface-soft); border: 1px solid var(--line); border-radius: 18px; }
.activity-presets { display: flex; flex-wrap: wrap; gap: 6px; }
.activity-presets .button { padding: 6px 12px; border-radius: 20px; font-size: 10px; color: var(--text-soft); background: transparent; border: 1px solid var(--line); }
.activity-presets .button:hover { background: var(--surface-strong); color: var(--text); }
.activity-presets .button.active { color: var(--text); border-color: var(--line-strong); background: var(--surface-strong); }
.activity-dates { display: flex; gap: 8px; }
.activity-dates label { position: relative; }
.activity-dates label > span { display: block; margin: 0 0 6px 4px; color: var(--text-muted); font-size: 10px; }
.activity-dates .control { min-width: 138px; min-height: 38px; padding: 6px 10px; font: inherit; font-size: 12px; }

.activity-table-wrap { max-height: 72vh; overflow-y: auto; }
.activity-table th, .activity-table td { text-align: center; }
.activity-table .activity-group { font-size: 10px; letter-spacing: .8px; text-transform: uppercase; border-bottom: 2px solid var(--line-strong); }
.activity-table .activity-group-calls { border-bottom-color: #d2b76b; }
.activity-table .activity-group-total { border-bottom-color: var(--success); }
.activity-table .activity-count { color: var(--text-soft); font-variant-numeric: tabular-nums; }
.activity-table .activity-total { font-weight: 800; font-variant-numeric: tabular-nums; }
.activity-table .activity-grand-total th, .activity-table .activity-grand-total td { background: var(--surface-strong); border-top: 2px solid var(--line-strong); font-weight: 800; }
.activity-table .activity-empty { padding: 26px 12px; color: var(--text-muted); text-align: center; }

.activity-note, .activity-error, .activity-loading { margin: 0 0 16px; padding: 12px 14px; border-radius: 12px; font-size: 12px; }
.activity-note { color: var(--text-soft); background: var(--surface-soft); border: 1px solid var(--line); }
.activity-error { color: #ffb4a8; background: color-mix(in srgb, #ff6b53 12%, var(--surface)); border: 1px solid color-mix(in srgb, #ff6b53 34%, var(--line)); }
.activity-loading { color: var(--text-muted); }

/* Модальное окно настроек — как «Значения графика» / «Столбцы для выгрузки». */
.activity-settings-modal { width: min(720px, calc(100vw - 32px)); max-height: min(86vh, 780px); display: flex; flex-direction: column; }
.activity-settings-modal .modal-header { padding: 18px 22px; }
.activity-settings-modal .modal-title { font-size: 18px; letter-spacing: -.2px; }
.activity-settings-modal .modal-body { overflow-y: auto; gap: 14px; padding: 18px 22px 20px; }
.activity-settings-intro { margin: 0; color: var(--text-soft); font-size: 12px; line-height: 1.55; }
.activity-settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.activity-settings-row { display: grid; grid-template-columns: minmax(0, 1fr) 104px; gap: 12px; align-items: center; padding: 10px 12px; background: var(--surface-soft); border: 1px solid var(--line); border-radius: 12px; cursor: text; }
.activity-settings-row:hover { border-color: var(--line-strong); }
.activity-settings-name { min-width: 0; font-size: 12px; font-weight: 700; color: var(--text); }
.activity-settings-name small { display: block; margin-top: 3px; color: var(--text-muted); font-size: 10px; font-weight: 400; line-height: 1.45; }
.activity-settings-input { display: flex; align-items: center; gap: 6px; }
.activity-settings-input .control { width: 100%; min-height: 34px; padding: 5px 8px; font: inherit; font-size: 12px; text-align: right; font-variant-numeric: tabular-nums; }
.activity-settings-input em { color: var(--text-muted); font-size: 10px; font-style: normal; }
.activity-settings-note { margin: 0; color: var(--text-muted); font-size: 11px; line-height: 1.55; }
.activity-settings-modal .modal-actions { flex-wrap: wrap; }
.activity-settings-modal .modal-actions .button { min-height: 34px; }

@media (max-width: 900px) {
  .activity-period { align-items: stretch; }
  .activity-dates { width: 100%; }
  .activity-dates label { flex: 1; }
  .activity-dates .control { width: 100%; min-width: 0; }
  .activity-heading-actions { width: 100%; justify-content: space-between; }
  .activity-settings-grid { grid-template-columns: minmax(0, 1fr); }
  .activity-settings-modal { max-height: 92vh; }
  .activity-settings-modal .modal-actions .button { flex: 1; }
}
