/* ═══════════════════════════════════════════════════════════
   Views — List, Board, Timeline, Dashboard, Empty states
   ═══════════════════════════════════════════════════════════ */

/* ─── List View ─── */

.list-view {
  display: flex;
  flex-direction: column;
  min-height: 100%;
}

.list-header {
  display: flex;
  align-items: center;
  height: 32px;
  padding: 0 12px;
  gap: 4px;
  border-bottom: 1px solid var(--border-default);
  background: var(--bg-1);
  position: sticky;
  top: 0;
  z-index: 10;
}

.list-header span {
  font-size: 0.615rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-tertiary);
  white-space: nowrap;
  user-select: none;
}

.lh-checkbox { width: 20px; flex-shrink: 0; }
.lh-priority { width: 16px; flex-shrink: 0; }
.lh-id { width: 68px; flex-shrink: 0; }
.lh-status { width: 16px; flex-shrink: 0; }
.lh-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.lh-assignee { width: 24px; flex-shrink: 0; text-align: center; }
.lh-phase { width: 85px; flex-shrink: 0; }
.lh-labels { width: 44px; flex-shrink: 0; text-align: center; }
.lh-estimate { width: 28px; flex-shrink: 0; text-align: center; }

.list-body {
  flex: 1;
}

/* ─── Board View ─── */

.board-view {
  display: flex;
  gap: 12px;
  padding: 16px;
  overflow-x: auto;
  overflow-y: hidden;
  height: 100%;
  align-items: stretch;
}

.board-column {
  min-width: 260px;
  width: 260px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  max-height: 100%;
}

.board-column.drag-over {
  background: var(--bg-2);
  border-radius: var(--radius-lg);
}

.board-column.drag-over .board-col-body {
  border: 1px dashed var(--accent-primary);
  border-radius: var(--radius-md);
}

.board-card.dragging {
  opacity: 0.4;
}

.board-col-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  margin-bottom: 8px;
  border-radius: var(--radius-md);
  background: var(--bg-1);
}

.board-col-header svg {
  display: inline;
  flex-shrink: 0;
}

.board-col-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.board-col-title {
  font-size: 0.846rem;
  font-weight: 600;
  color: var(--text-primary);
  flex: 1;
}

.board-col-count {
  font-size: 0.692rem;
  font-family: var(--font-mono);
  color: var(--text-tertiary);
}

.board-col-body {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* ─── Timeline View ─── */

.timeline-view {
  overflow: hidden;
  height: 100%;
}

.timeline-content {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.tl-phase-group {
  background: var(--bg-1);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.tl-phase-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: var(--bg-2);
  border-bottom: 1px solid var(--border-subtle);
}

.tl-phase-name {
  font-size: 0.923rem;
  font-weight: 600;
  color: var(--text-primary);
  flex-shrink: 0;
}

.tl-phase-progress {
  font-size: 0.769rem;
  font-family: var(--font-mono);
  font-weight: 500;
  color: var(--accent-primary);
  flex-shrink: 0;
}

.tl-phase-bar {
  flex: 1;
  height: 4px;
  background: var(--bg-0);
  border-radius: 2px;
  overflow: hidden;
  min-width: 60px;
}

.tl-phase-fill {
  height: 100%;
  border-radius: 2px;
  transition: width var(--duration-slow) var(--ease-out);
}

.tl-issues {
  padding: 4px 0;
}

.tl-issue {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  cursor: pointer;
  transition: background var(--duration-fast) var(--ease-in-out);
  border-bottom: 1px solid var(--border-subtle);
}

.tl-issue:last-child {
  border-bottom: none;
}

.tl-issue:hover {
  background: var(--bg-2);
}

.tl-status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

.tl-status-icon {
  flex-shrink: 0;
  display: flex;
  align-items: center;
}

.tl-status-icon svg {
  display: inline;
}

.tl-id {
  font-family: var(--font-mono);
  font-size: 0.692rem;
  font-weight: 500;
  color: var(--text-tertiary);
  flex-shrink: 0;
  min-width: 48px;
}

.tl-title {
  font-size: 0.846rem;
  color: var(--text-primary);
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ─── Dashboard View ─── */

.dashboard-view {
  padding: 16px;
  overflow-y: auto;
  min-height: 100%;
}

/* Dashboard top row: stats + small charts side by side */

.dash-top-row {
  display: flex;
  gap: 12px;
  margin-bottom: 12px;
  align-items: stretch;
}

.dash-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  flex-shrink: 0;
  width: 280px;
}

.dash-chart-sm {
  flex: 1;
  min-width: 0;
}

.dash-chart-sm .status-chart {
  justify-content: flex-start;
}

.dash-bottom-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.stat-card {
  padding: 12px;
  background: var(--bg-1);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  transition: border-color var(--duration-fast) var(--ease-in-out);
}

.stat-card:hover {
  border-color: var(--border-default);
}

.stat-card-value {
  font-size: 1.846rem;
  font-weight: 700;
  font-family: var(--font-mono);
  color: var(--text-primary);
  letter-spacing: -0.02em;
  line-height: 1;
  margin-bottom: 4px;
}

.stat-card-done .stat-card-value {
  color: var(--status-done);
}

.stat-card-progress .stat-card-value {
  color: var(--status-in-progress);
}

.stat-card-pct .stat-card-value {
  color: var(--accent-primary);
}

.stat-card-label {
  font-size: 0.769rem;
  font-weight: 500;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.stat-card-bar {
  margin-top: 10px;
  height: 4px;
  background: var(--bg-3);
  border-radius: 2px;
  overflow: hidden;
}

.stat-card-fill {
  height: 100%;
  border-radius: 2px;
  background: var(--accent-primary);
  transition: width var(--duration-slow) var(--ease-out);
}

/* Dashboard chart cards */

/* .dash-charts removed — replaced by .dash-top-row + .dash-bottom-row */

.dash-chart-card {
  background: var(--bg-1);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 16px;
  transition: border-color var(--duration-fast);
}

.dash-chart-card:hover {
  border-color: var(--border-default);
}

.dash-chart-card h3 {
  font-size: 0.923rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 16px;
}

.dash-chart-wide {
  grid-column: auto;
}

/* Phase progress bars */

.phase-progress-chart {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.phase-bar-row {
  display: grid;
  grid-template-columns: 120px 48px 1fr 32px;
  align-items: center;
  gap: 10px;
}

.phase-bar-pct {
  font-size: 0.7rem;
  font-family: var(--font-mono);
  color: var(--text-tertiary);
  min-width: 32px;
  text-align: right;
}

.phase-bar-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.769rem;
  font-weight: 500;
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.phase-bar-count {
  font-size: 0.692rem;
  font-family: var(--font-mono);
  color: var(--text-tertiary);
  text-align: right;
}

.phase-bar-track {
  height: 6px;
  background: var(--bg-3);
  border-radius: 3px;
  display: flex;
  overflow: hidden;
}

.phase-bar-fill {
  height: 100%;
  transition: width var(--duration-slow) var(--ease-out);
}

.phase-bar-done {
  border-radius: 3px 0 0 3px;
}

.phase-bar-ip {
  /* in-progress portion, no left radius */
}

/* Status donut */

.status-chart {
  display: flex;
  justify-content: center;
}

.donut-wrap {
  display: flex;
  align-items: center;
  gap: 16px;
}

.donut-wrap svg {
  flex-shrink: 0;
}

.donut-legend {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.donut-legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.769rem;
  color: var(--text-secondary);
  white-space: nowrap;
}

.donut-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  display: inline-block;
}

.donut-count {
  font-family: var(--font-mono);
  font-size: 0.692rem;
  color: var(--text-tertiary);
  margin-left: 4px;
}

/* Assignee chart */

.assignee-chart {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.assignee-bar-row {
  display: grid;
  grid-template-columns: 80px 1fr 48px;
  align-items: center;
  gap: 10px;
}

.assignee-bar-label {
  font-size: 0.769rem;
  font-weight: 500;
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.assignee-bar-track {
  height: 6px;
  background: var(--bg-3);
  border-radius: 3px;
  position: relative;
  overflow: hidden;
}

.assignee-bar-total {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  border-radius: 3px;
  transition: width var(--duration-slow) var(--ease-out);
}

.assignee-bar-done {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  border-radius: 3px;
  transition: width var(--duration-slow) var(--ease-out);
}

.assignee-bar-count {
  font-size: 0.692rem;
  font-family: var(--font-mono);
  color: var(--text-tertiary);
  text-align: right;
}

/* Burndown chart */

.burndown-chart {
  width: 100%;
}

.burndown-chart svg {
  width: 100%;
  height: auto;
}

/* Empty chart placeholder */

.empty-chart {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px;
  font-size: 0.846rem;
  color: var(--text-tertiary);
}

/* ─── List Phase Groups ─── */

.list-phase-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: var(--bg-1);
  border-bottom: 1px solid var(--border-subtle);
  cursor: pointer;
  user-select: none;
  position: sticky;
  top: 0;
  z-index: 5;
}

.list-phase-header:hover {
  background: var(--bg-2);
}

.list-phase-name {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-primary);
}

.list-phase-count {
  font-size: 0.7rem;
  font-family: var(--font-mono);
  color: var(--text-tertiary);
  margin-left: auto;
}

.collapse-chevron {
  color: var(--text-tertiary);
  transition: transform 150ms;
}

.list-phase-issues.collapsed {
  display: none;
}

.list-phase-header.collapsed .collapse-chevron {
  transform: rotate(-90deg);
}

/* ─── Gantt View ─── */

.gantt-container {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

.gantt-scroll-area {
  flex: 1;
  overflow: auto;
  position: relative;
}

/* ── Sticky timeline header ── */

.gantt-timeline-header {
  display: flex;
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--bg-1);
  border-bottom: 1px solid var(--border-default);
  flex-shrink: 0;
  min-width: max-content;
}

.gantt-label-header {
  width: 280px;
  min-width: 280px;
  flex-shrink: 0;
  padding: 0 12px;
  display: flex;
  align-items: center;
  height: 32px;
  font-size: 0.692rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-tertiary);
  position: sticky;
  left: 0;
  z-index: 11;
  background: var(--bg-1);
  border-right: 1px solid var(--border-subtle);
}

.gantt-dates-header {
  display: flex;
  position: relative;
  flex-shrink: 0;
}

.gantt-month {
  flex-shrink: 0;
  height: 32px;
  display: flex;
  align-items: center;
  padding: 0 8px;
  font-size: 0.692rem;
  font-weight: 600;
  color: var(--text-tertiary);
  border-left: 1px solid var(--border-subtle);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  box-sizing: border-box;
}

/* ── Today marker in header ── */

.gantt-today-marker {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 1px;
  background: var(--accent-primary);
  z-index: 12;
  pointer-events: none;
}

.gantt-today-dot {
  position: absolute;
  bottom: -2px;
  left: -3px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent-primary);
}

/* ── Body ── */

.gantt-body {
  min-width: max-content;
}

.gantt-phase-group {
  margin-bottom: 0;
}

/* ── Phase row ── */

.gantt-phase-row {
  display: flex;
  align-items: center;
  height: 34px;
  border-bottom: 1px solid var(--border-default);
  background: var(--bg-1);
  min-width: max-content;
}

.gantt-phase-row .gantt-label-cell {
  background: var(--bg-1);
  font-weight: 600;
}

.gantt-phase-name {
  font-size: 0.846rem;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gantt-phase-pct {
  font-size: 0.692rem;
  font-family: var(--font-mono);
  font-weight: 500;
  color: var(--accent-primary);
  margin-left: auto;
  flex-shrink: 0;
}

/* ── Issue row ── */

.gantt-issue-row {
  display: flex;
  align-items: center;
  height: 32px;
  border-bottom: 1px solid var(--border-subtle);
  cursor: pointer;
  transition: background 80ms ease;
  min-width: max-content;
}

.gantt-issue-row:hover {
  background: var(--bg-2);
}

.gantt-issue-row:hover .gantt-label-cell {
  background: var(--bg-2);
}

/* ── Label cell (sticky left column) ── */

.gantt-label-cell {
  width: 280px;
  min-width: 280px;
  flex-shrink: 0;
  padding: 0 12px;
  display: flex;
  align-items: center;
  gap: 6px;
  overflow: hidden;
  position: sticky;
  left: 0;
  z-index: 5;
  background: var(--bg-0);
  border-right: 1px solid var(--border-subtle);
  height: 100%;
}

/* ── Bars cell ── */

.gantt-bars-cell {
  flex-shrink: 0;
  position: relative;
  height: 100%;
}

/* ── Bar styles ── */

.gantt-bar {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  border-radius: 3px;
  min-width: 4px;
  transition: opacity 80ms ease;
}

.gantt-issue-row:hover .gantt-bar {
  opacity: 1 !important;
  filter: brightness(1.15);
}

.gantt-phase-bar {
  position: absolute;
  height: 4px;
  top: 50%;
  transform: translateY(-50%);
  border-radius: 2px;
  opacity: 0.25;
}

/* ── Today line in rows ── */

.gantt-today-line {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 1px;
  background: var(--accent-primary);
  opacity: 0.35;
  z-index: 3;
  pointer-events: none;
}

/* ── Issue ID & title inside label cell ── */

.gantt-id {
  font-family: var(--font-mono);
  font-size: 0.692rem;
  font-weight: 500;
  color: var(--text-tertiary);
  min-width: 52px;
  flex-shrink: 0;
}

.gantt-title {
  font-size: 0.808rem;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  min-width: 0;
}

/* ─── Empty State ─── */

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  text-align: center;
  gap: 12px;
}

.empty-state svg {
  margin-bottom: 8px;
}

.empty-state p {
  font-size: 0.923rem;
  font-weight: 500;
  color: var(--text-secondary);
}

/* ─── Loading State ─── */

/* (loading-state and loading-spinner are in components.css) */
