/* レポーティングダッシュボードのスタイル */
.reporting-dashboard {
  margin-top: 20px;
}

.dashboard-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.dashboard-header h2 {
  margin: 0;
  color: var(--primary-color);
}

.dashboard-controls {
  display: flex;
  gap: 10px;
}

.time-span-selector {
  display: flex;
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid var(--border-color);
}

.time-span-btn {
  background-color: var(--light-gray);
  color: var(--text-color);
  border: none;
  padding: 6px 12px;
  font-size: 0.85rem;
  cursor: pointer;
  border-right: 1px solid var(--border-color);
}

.time-span-btn:last-child {
  border-right: none;
}

.time-span-btn.active {
  background-color: var(--primary-color);
  color: white;
}

.dashboard-tabs {
  display: flex;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 20px;
}

.tab-btn {
  padding: 10px 15px;
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  color: var(--text-color);
  cursor: pointer;
  font-size: 1rem;
  transition: all 0.2s ease;
}

.tab-btn:hover {
  background-color: var(--light-gray);
}

.tab-btn.active {
  border-bottom-color: var(--primary-color);
  color: var(--primary-color);
  font-weight: bold;
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

/* オーバービュータブ */
.overview-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.overview-row {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
}

.overview-card {
  flex: 1;
  min-width: 220px;
  background-color: var(--card-background);
  border-radius: 8px;
  padding: 15px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.overview-card h3 {
  margin-top: 0;
  margin-bottom: 15px;
  color: var(--primary-color);
  font-size: 1.1rem;
}

/* 生産性スコアカード */
.productivity-score {
  display: flex;
  flex-direction: column;
}

.score-display {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 15px;
  margin-bottom: 15px;
}

.score-value {
  font-size: 3rem;
  font-weight: bold;
  color: var(--primary-color);
}

.score-rank {
  font-size: 2.5rem;
  font-weight: bold;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}

.score-rank.rank-s {
  background-color: #4caf50;
  color: white;
}

.score-rank.rank-a {
  background-color: #2196f3;
  color: white;
}

.score-rank.rank-b {
  background-color: #ff9800;
  color: white;
}

.score-rank.rank-c {
  background-color: #f44336;
  color: white;
}

.score-rank.rank-d, .score-rank.rank-e {
  background-color: #9e9e9e;
  color: white;
}

.score-details {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.score-component {
  display: flex;
  align-items: center;
  gap: 10px;
}

.component-label {
  flex: 1;
  font-size: 0.9rem;
}

.component-bar {
  flex: 2;
  height: 8px;
  background-color: var(--chart-progress-bg);
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}

.component-progress {
  position: absolute;
  height: 100%;
  background-color: var(--primary-color);
  border-radius: 4px;
}

.component-value {
  width: 40px;
  text-align: right;
  font-size: 0.9rem;
  color: var(--light-text-color);
}

/* 完了率カード */
.completion-rate {
  text-align: center;
}

.rate-display {
  display: flex;
  align-items: center;
  justify-content: space-around;
}

.rate-chart-container {
  flex: 1;
  max-width: 120px;
  margin: 0 auto;
}

.rate-info {
  margin-left: 10px;
}

.rate-value {
  font-size: 2rem;
  font-weight: bold;
  color: var(--primary-color);
}

.rate-details {
  font-size: 0.9rem;
  color: var(--light-text-color);
}

/* 完了時間カード */
.completion-time {
  text-align: center;
}

.time-display {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.avg-time {
  font-size: 1.2rem;
}

.time-label {
  font-size: 0.9rem;
  color: var(--light-text-color);
  margin-right: 5px;
}

.time-value {
  font-weight: bold;
}

.time-range {
  display: flex;
  justify-content: space-around;
}

.priority-times {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.priority-time {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 5px;
  border-radius: 4px;
}

.priority-time.high {
  background-color: rgba(231, 76, 60, 0.1);
}

.priority-time.medium {
  background-color: rgba(243, 156, 18, 0.1);
}

.priority-time.low {
  background-color: rgba(106, 168, 79, 0.1);
}

.priority-label {
  font-size: 0.9rem;
}

/* 優先度別完了率カード */
.priority-stats {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 15px;
}

.priority-stat {
  display: flex;
  align-items: center;
  gap: 10px;
}

.priority-label {
  width: 40px;
  text-align: center;
  padding: 2px 0;
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: bold;
  color: white;
}

.priority-stat.high .priority-label {
  background-color: var(--priority-high);
}

.priority-stat.medium .priority-label {
  background-color: var(--priority-medium);
}

.priority-stat.low .priority-label {
  background-color: var(--priority-low);
}

.rate-value {
  font-weight: bold;
  width: 50px;
}

.count-value {
  font-size: 0.9rem;
  color: var(--light-text-color);
}

/* タグ別完了率カード */
.tag-stats {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 250px;
  overflow-y: auto;
}

.tag-stat {
  background-color: var(--light-gray);
  border-radius: 4px;
  padding: 10px;
}

.tag-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 5px;
}

.tag-name {
  font-weight: bold;
}

.tag-rate {
  font-weight: bold;
  color: var(--primary-color);
}

.tag-progress-bar {
  height: 6px;
  background-color: var(--chart-progress-bg);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 5px;
}

.tag-progress {
  height: 100%;
  background-color: var(--secondary-color);
  border-radius: 3px;
}

.tag-count {
  font-size: 0.8rem;
  color: var(--light-text-color);
  text-align: right;
}

/* タスク分析タブ */
.tasks-analysis-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.analysis-row {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
}

.analysis-card {
  flex: 1;
  min-width: 280px;
  background-color: var(--card-background);
  border-radius: 8px;
  padding: 15px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.analysis-card.full-width {
  flex-basis: 100%;
  min-width: 100%;
}

.analysis-card h3 {
  margin-top: 0;
  margin-bottom: 15px;
  color: var(--primary-color);
  font-size: 1.1rem;
}

.chart-container {
  height: 250px;
  position: relative;
}

/* データテーブル */
.table-container {
  max-height: 300px;
  overflow-y: auto;
}

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

.data-table th,
.data-table td {
  padding: 8px 12px;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}

.data-table th {
  background-color: var(--light-gray);
  position: sticky;
  top: 0;
  z-index: 1;
}

.data-table tr:hover {
  background-color: var(--light-gray);
}

.table-progress-bar {
  height: 6px;
  width: 100%;
  background-color: var(--chart-progress-bg);
  border-radius: 3px;
  overflow: hidden;
  position: relative;
}

.table-progress {
  height: 100%;
  background-color: var(--secondary-color);
  border-radius: 3px;
}

.progress-text {
  position: absolute;
  right: 0;
  top: -18px;
  font-size: 0.8rem;
  color: var(--light-text-color);
}

/* 最近完了したタスク */
.recent-tasks {
  max-height: 300px;
  overflow-y: auto;
}

.recent-tasks-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.recent-task-item {
  padding: 10px;
  border-radius: 4px;
  background-color: var(--light-gray);
}

.task-header {
  display: flex;
  gap: 10px;
  margin-bottom: 5px;
}

.task-priority {
  width: 4px;
  border-radius: 2px;
}

.priority-high {
  background-color: var(--priority-high);
}

.priority-medium {
  background-color: var(--priority-medium);
}

.priority-low {
  background-color: var(--priority-low);
}

.task-title {
  font-weight: bold;
}

.task-details {
  display: flex;
  justify-content: space-between;
  font-size: 0.9rem;
  color: var(--light-text-color);
}

/* 時間分析タブ */
.time-analysis-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.time-summary {
  text-align: center;
}

.total-time-display {
  margin-bottom: 20px;
}

.time-label {
  font-size: 1rem;
  color: var(--light-text-color);
}

.time-value {
  font-size: 2rem;
  font-weight: bold;
  color: var(--primary-color);
  display: block;
  margin: 10px 0;
}

.time-distribution h4 {
  margin-top: 0;
  margin-bottom: 10px;
  font-size: 1rem;
}

.time-distribution-stats {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 15px;
}

.time-stat {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 5px 10px;
  border-radius: 4px;
}

.time-stat.high {
  background-color: rgba(231, 76, 60, 0.1);
}

.time-stat.medium {
  background-color: rgba(243, 156, 18, 0.1);
}

.time-stat.low {
  background-color: rgba(106, 168, 79, 0.1);
}

.percentage {
  font-size: 0.9rem;
  color: var(--light-text-color);
}

.task-time-chart-container {
  height: 300px;
  margin-bottom: 20px;
}

.task-time-table {
  max-height: 200px;
}

/* 生産性洞察 */
.insights-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.insight-item {
  padding: 10px;
  border-radius: 4px;
  background-color: var(--light-gray);
  border-left: 4px solid var(--primary-color);
}

/* ポモドーロ分析タブ */
.pomodoro-analysis-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.pomodoro-summary {
  text-align: center;
}

.pomodoro-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  justify-content: space-around;
}

.pomodoro-stat {
  flex: 1;
  min-width: 100px;
  padding: 10px;
  background-color: var(--light-gray);
  border-radius: 4px;
}

.stat-label {
  font-size: 0.9rem;
  color: var(--light-text-color);
  margin-bottom: 5px;
}

.stat-value {
  font-size: 1.5rem;
  font-weight: bold;
  color: var(--primary-color);
}

.stat-detail {
  font-size: 0.8rem;
  color: var(--light-text-color);
}

/* ノーデータ表示 */
.no-data {
  padding: 20px;
  text-align: center;
  color: var(--light-text-color);
  background-color: var(--light-gray);
  border-radius: 4px;
  margin: 10px 0;
}

/* レスポンシブデザイン */
@media (max-width: 768px) {
  .overview-card,
  .analysis-card {
    min-width: 100%;
  }
  
  .dashboard-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
  
  .time-display {
    flex-direction: column;
  }
  
  .score-display {
    flex-direction: column;
  }
  
  .dashboard-tabs {
    overflow-x: auto;
    white-space: nowrap;
    padding-bottom: 5px;
  }
  
  .pomodoro-stats {
    flex-direction: column;
  }
  
  .task-details {
    flex-direction: column;
    gap: 5px;
  }
}