/* === REPORTS.CSS ===
   assets/css/reports.css
   НАЗНАЧЕНИЕ: Стили раздела еженедельных отчетов
   РАЗМЕР: ~200 строк */

/* --- Layout --- */
.tf-reports { display: grid; grid-template-columns: 280px 1fr; height: 100%; gap: 0; }
.tf-reports-sidebar { border-right: 1px solid var(--border-color); overflow-y: auto; display: flex; flex-direction: column; }
.tf-reports-detail { padding: 10px; overflow-y: auto; }

/* --- Filters --- */
.tf-reports-filters { padding: 10px; border-bottom: 1px solid var(--border-color); display: flex; flex-direction: column; gap: 8px; }
.tf-reports-period-chips { display: flex; gap: 4px; }
.tf-reports-period-chip {
    padding: 4px 12px; border-radius: 12px; font-size: 12px; cursor: pointer;
    background: var(--card-bg); border: 1px solid var(--border-color); color: var(--text-secondary);
    transition: all 0.15s;
}
.tf-reports-period-chip.active {
    background: var(--color-primary); border-color: var(--color-primary); color: #fff;
}
.tf-reports-user-select {
    width: 100%; padding: 5px 8px; border-radius: 6px; font-size: 12px;
    background: var(--card-bg); border: 1px solid var(--border-color); color: var(--text-primary);
}

/* --- List --- */
.tf-reports-list { flex: 1; overflow-y: auto; }
.tf-reports-item {
    padding: 10px; border-bottom: 1px solid var(--border-color); cursor: pointer;
    transition: background 0.1s;
}
.tf-reports-item:hover { background: var(--bg-hover, hsla(220, 13%, 15%, 0.5)); }
.tf-reports-item.active { background: hsla(217, 91%, 60%, 0.08); border-left: 3px solid var(--color-primary); }
.tf-reports-item-name { font-size: 13px; font-weight: 600; color: var(--text-primary); }
.tf-reports-item-period { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.tf-reports-item-stats { display: flex; gap: 8px; margin-top: 4px; font-size: 11px; }
.tf-reports-item-done { color: var(--ai-green, #10b981); }
.tf-reports-item-overdue { color: var(--color-danger); }
.tf-reports-item-score {
    margin-left: auto; font-weight: 700; font-size: 12px;
    padding: 1px 6px; border-radius: 4px;
}
.tf-reports-item-score.high { color: var(--ai-green); background: hsla(160, 60%, 45%, 0.1); }
.tf-reports-item-score.mid { color: var(--color-warning, #f59e0b); background: hsla(40, 96%, 53%, 0.1); }
.tf-reports-item-score.low { color: var(--color-danger); background: hsla(0, 84%, 60%, 0.1); }

/* --- Empty state --- */
.tf-reports-empty {
    display: flex; align-items: center; justify-content: center; height: 100%;
    color: var(--text-muted); font-size: 13px;
}

/* --- Detail header --- */
.tf-report-header { margin-bottom: 10px; }
.tf-report-title { font-size: 15px; font-weight: 700; color: var(--text-primary); }
.tf-report-subtitle { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

/* --- Metrics grid --- */
.tf-report-metrics { display: flex; flex-wrap: wrap; gap: 10px; margin: 10px 0; }
.tf-report-metric {
    flex: 0 0 auto; white-space: nowrap; padding: 8px 10px;
    background: var(--card-bg); border: 1px solid var(--border-color); border-radius: 6px;
    display: flex; align-items: baseline; gap: 6px;
}
.tf-report-metric-value { font-size: 20px; font-weight: 700; color: var(--text-primary); }
.tf-report-metric-label { font-size: 11px; color: var(--text-muted); }
.tf-report-metric-delta { font-size: 11px; font-weight: 600; }
.tf-report-metric-delta.positive { color: var(--ai-green, #10b981); }
.tf-report-metric-delta.negative { color: var(--color-danger); }

/* --- Progress bar --- */
.tf-report-progress { height: 5px; background: var(--border-color); border-radius: 3px; margin: 10px 0; overflow: hidden; }
.tf-report-progress-fill { height: 100%; border-radius: 3px; transition: width 0.3s; }
.tf-report-progress-fill.green { background: var(--ai-green, #10b981); }
.tf-report-progress-fill.yellow { background: var(--color-warning, #f59e0b); }
.tf-report-progress-fill.red { background: var(--color-danger); }

/* --- Score badge --- */
.tf-report-score { display: inline-flex; align-items: center; gap: 4px; font-size: 14px; font-weight: 700; padding: 2px 8px; border-radius: 6px; }
.tf-report-score.high { color: var(--ai-green); background: hsla(160, 60%, 45%, 0.1); }
.tf-report-score.mid { color: var(--color-warning, #f59e0b); background: hsla(40, 96%, 53%, 0.1); }
.tf-report-score.low { color: var(--color-danger); background: hsla(0, 84%, 60%, 0.1); }

/* --- Task lists --- */
.tf-report-section { margin-top: 12px; }
.tf-report-section-title { font-size: 12px; font-weight: 600; color: var(--text-secondary); margin-bottom: 6px; display: flex; align-items: center; gap: 4px; }
.tf-report-task-item { font-size: 12px; padding: 4px 0; color: var(--text-primary); display: flex; align-items: center; gap: 6px; }
.tf-report-task-item .block-tag { font-size: 10px; color: var(--text-muted); }

/* --- AI Insight --- */
.tf-report-ai {
    border: 1px solid var(--ai-green, #10b981); border-radius: 6px; padding: 10px;
    margin: 12px 0; background: hsla(160, 60%, 45%, 0.04);
}
.tf-report-ai-title {
    color: var(--ai-green, #10b981); font-size: 12px; font-weight: 600;
    display: flex; align-items: center; gap: 4px; margin-bottom: 6px;
}
.tf-report-ai-text { font-size: 12px; color: var(--text-primary); line-height: 1.5; white-space: pre-line; }

/* --- Comments --- */
.tf-report-comments { margin-top: 12px; }
.tf-report-comment {
    padding: 8px 10px; border-bottom: 1px solid var(--border-color);
    font-size: 12px;
}
.tf-report-comment-meta { font-size: 10px; color: var(--text-muted); margin-bottom: 3px; }
.tf-report-comment-text { color: var(--text-primary); line-height: 1.4; }
.tf-report-comment-form { display: flex; gap: 6px; margin-top: 8px; }
.tf-report-comment-input {
    flex: 1; padding: 6px 8px; border-radius: 6px; font-size: 12px;
    background: var(--card-bg); border: 1px solid var(--border-color); color: var(--text-primary);
    outline: none; resize: none; min-height: 32px;
}
.tf-report-comment-input:focus { border-color: var(--color-primary); }
.tf-report-comment-send {
    padding: 6px 12px; border-radius: 6px; font-size: 12px; font-weight: 600;
    background: var(--color-primary); color: #fff; border: none; cursor: pointer;
    white-space: nowrap;
}
.tf-report-comment-send:hover { opacity: 0.85; }

/* --- By block breakdown --- */
.tf-report-blocks { margin-top: 10px; }
.tf-report-block-row { display: flex; align-items: center; gap: 8px; padding: 3px 0; font-size: 12px; }
.tf-report-block-name { flex: 0 0 120px; color: var(--text-secondary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tf-report-block-bar { flex: 1; height: 4px; background: var(--border-color); border-radius: 2px; overflow: hidden; }
.tf-report-block-bar-fill { height: 100%; background: var(--color-primary); border-radius: 2px; }
.tf-report-block-count { flex: 0 0 auto; font-size: 11px; color: var(--text-muted); }

/* --- Light theme --- */
html.light-theme .tf-reports-item:hover { background: hsla(220, 20%, 90%, 0.5); }
html.light-theme .tf-reports-item.active { background: hsla(217, 91%, 55%, 0.06); }
html.light-theme .tf-report-ai { background: hsla(160, 60%, 45%, 0.03); }

/* --- Responsive --- */
@media (max-width: 768px) {
    .tf-reports { grid-template-columns: 1fr; }
    .tf-reports-sidebar { max-height: 250px; border-right: none; border-bottom: 1px solid var(--border-color); }
}
