/* Timeline / Gantt */
.timeline-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.timeline-zoom {
  display: flex;
  gap: 0;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.timeline-zoom button {
  padding: 6px 12px;
  background: var(--bg-primary);
  border: none;
  border-right: 1px solid var(--border-color);
  font-size: var(--font-xs);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.timeline-zoom button:last-child { border-right: none; }
.timeline-zoom button:hover { background: var(--bg-secondary); }
.timeline-zoom button.active {
  background: var(--primary);
  color: white;
}

.timeline-wrapper {
  overflow-x: auto;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  background: var(--bg-primary);
}

.timeline-header {
  display: flex;
  border-bottom: 2px solid var(--border-color);
  position: sticky;
  top: 0;
  background: var(--bg-secondary);
  z-index: 2;
}

.timeline-header-cell {
  min-width: var(--cell-width, 40px);
  max-width: var(--cell-width, 40px);
  padding: 8px 4px;
  text-align: center;
  font-size: var(--font-xs);
  color: var(--text-secondary);
  border-right: 1px solid var(--border-light);
  flex-shrink: 0;
}

.timeline-header-cell.weekend {
  background: var(--bg-tertiary);
}

.timeline-header-cell.today {
  background: var(--primary-bg);
  color: var(--primary);
  font-weight: var(--font-semibold);
}

.timeline-body {
  position: relative;
}

.timeline-row {
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--border-light);
  min-height: 40px;
  position: relative;
}

.timeline-row:hover {
  background: var(--bg-secondary);
}

.timeline-row-label {
  width: 220px;
  min-width: 220px;
  padding: 8px 12px;
  font-size: var(--font-sm);
  border-right: 2px solid var(--border-color);
  position: sticky;
  left: 0;
  background: var(--bg-primary);
  z-index: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.timeline-row:hover .timeline-row-label {
  background: var(--bg-secondary);
}

.timeline-row-cells {
  display: flex;
  flex: 1;
  position: relative;
  min-height: 40px;
}

.timeline-cell {
  min-width: var(--cell-width, 40px);
  max-width: var(--cell-width, 40px);
  border-right: 1px solid var(--border-light);
  flex-shrink: 0;
}

.timeline-cell.weekend {
  background: rgba(0,0,0,0.02);
}

.timeline-cell.today {
  background: var(--primary-bg);
}

.timeline-bar {
  position: absolute;
  height: 24px;
  top: 8px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  padding: 0 8px;
  font-size: var(--font-xs);
  color: white;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: opacity var(--transition-fast);
  z-index: 1;
}

.timeline-bar:hover {
  opacity: 0.85;
}

.timeline-bar[data-priority="critical"] { background: var(--error); }
.timeline-bar[data-priority="high"] { background: var(--warning); }
.timeline-bar[data-priority="medium"] { background: var(--primary); }
.timeline-bar[data-priority="low"] { background: var(--success); }
.timeline-bar[data-priority="none"] { background: var(--text-tertiary); }

.timeline-today-line {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--error);
  z-index: 3;
  pointer-events: none;
}

.timeline-empty {
  padding: 48px;
  text-align: center;
  color: var(--text-tertiary);
  font-size: var(--font-sm);
}

@media (max-width: 768px) {
  .timeline-row-label {
    width: 140px;
    min-width: 140px;
    font-size: var(--font-xs);
  }
}