.gantt-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 1rem;
    background: var(--rz-base-100);
    border-bottom: 1px solid var(--rz-base-300);
    border-radius: 8px 8px 0 0;
}

.gantt-zoom-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.gantt-view-toggle {
    display: flex;
    border: 1px solid var(--rz-base-300);
    border-radius: 6px;
    overflow: hidden;
}

.gantt-view-btn {
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 500;
    background: var(--rz-base-background-color);
    border: none;
    cursor: pointer;
    transition: all 0.15s ease;
    color: var(--rz-text-secondary-color);
}

.gantt-view-btn:not(:last-child) {
    border-right: 1px solid var(--rz-base-300);
}

.gantt-view-btn:hover {
    background: var(--rz-base-200);
}

.gantt-view-btn.active {
    background: var(--rz-primary);
    color: white;
}

.gantt-container {
    overflow-x: auto;
    overflow-y: auto;
    max-height: calc(100vh - 280px);
    border: 1px solid var(--rz-base-300);
    border-top: none;
    border-radius: 0 0 8px 8px;
    background: var(--rz-base-background-color);
    user-select: none;
}

.gantt-wrapper {
    display: flex;
    min-width: fit-content;
}

.gantt-task-list {
    flex-shrink: 0;
    width: 320px;
    border-right: 2px solid var(--rz-base-300);
    background: var(--rz-base-background-color);
    position: sticky;
    left: 0;
    z-index: 10;
}

.gantt-task-list-header {
    display: grid;
    grid-template-columns: 1fr 80px 80px;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: var(--rz-base-200);
    font-weight: 600;
    font-size: 0.8rem;
    color: var(--rz-text-secondary-color);
    border-bottom: 1px solid var(--rz-base-300);
    position: sticky;
    top: 0;
    z-index: 11;
}

.gantt-task-row {
    display: grid;
    grid-template-columns: 1fr 80px 80px;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-bottom: 1px solid var(--rz-base-200);
    align-items: center;
    min-height: 40px;
    cursor: pointer;
}

.gantt-task-row:hover { background: var(--rz-base-100); }
.gantt-task-row.dragging { background: var(--rz-primary-lighter); }

.task-name {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
    overflow: hidden;
}

.task-code {
    font-size: 0.7rem;
    color: var(--rz-text-tertiary-color);
    font-weight: 500;
}

.task-title {
    font-size: 0.85rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.task-date {
    font-size: 0.75rem;
    color: var(--rz-text-secondary-color);
    text-align: center;
}

.task-date.updated {
    color: var(--rz-success);
    font-weight: 600;
}

.gantt-timeline {
    flex: 1;
    min-width: 600px;
}

.gantt-timeline-header {
    display: flex;
    background: var(--rz-base-200);
    border-bottom: 1px solid var(--rz-base-300);
    position: sticky;
    top: 0;
    z-index: 9;
}

.gantt-days { display: flex; }

.gantt-day {
    flex-shrink: 0;
    width: var(--day-width, 24px);
    text-align: center;
    font-size: 0.65rem;
    padding: 0.25rem 0;
    border-right: 1px solid var(--rz-base-200);
    color: var(--rz-text-tertiary-color);
}

.gantt-day.weekend { background: var(--rz-base-100); }
.gantt-day.today {
    background: var(--rz-primary-lighter);
    font-weight: 700;
    color: var(--rz-primary);
}

.gantt-timeline-body { position: relative; }

.gantt-bar-row {
    display: flex;
    align-items: center;
    min-height: 40px;
    border-bottom: 1px solid var(--rz-base-200);
    position: relative;
}

.gantt-bar-row:hover { background: var(--rz-base-100); }

.gantt-grid-day {
    position: absolute;
    top: 0;
    bottom: 0;
    width: var(--day-width, 24px);
    border-right: 1px solid var(--rz-base-200);
}

.gantt-grid-day.weekend { background: rgba(0,0,0,0.02); }
.gantt-grid-day.today {
    background: rgba(var(--rz-primary-rgb), 0.08);
    border-right: 2px solid var(--rz-primary);
}

.gantt-bar {
    position: absolute;
    height: 24px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 500;
    color: white;
    cursor: grab;
    transition: transform 0.1s ease, box-shadow 0.1s ease;
    box-shadow: 0 1px 3px rgba(0,0,0,0.15);
    z-index: 5;
}

.gantt-bar:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(0,0,0,0.2);
}

.gantt-bar.dragging {
    cursor: grabbing;
    opacity: 0.9;
    transform: scale(1.02);
    box-shadow: 0 6px 16px rgba(0,0,0,0.25);
    z-index: 100;
}

.gantt-bar-progress {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    background: rgba(255,255,255,0.25);
    border-radius: 4px 0 0 4px;
    pointer-events: none;
}

.gantt-bar-label {
    position: relative;
    z-index: 1;
    padding: 0 0.5rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    pointer-events: none;
}

.gantt-bar-handle {
    position: absolute;
    top: -2px;
    bottom: -2px;
    width: 14px;
    cursor: ew-resize;
    z-index: 20;
    opacity: 0;
    transition: opacity 0.15s;
    background: rgba(255,255,255,0.2);
}

.gantt-bar:hover .gantt-bar-handle { opacity: 1; }

.gantt-bar-handle-left { left: -5px; border-radius: 4px 0 0 4px; }
.gantt-bar-handle-right { right: -5px; border-radius: 0 4px 4px 0; }
.gantt-bar-handle:hover { background: rgba(255,255,255,0.5); }

.gantt-bar-handle::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 4px;
    height: 10px;
    border-left: 2px solid rgba(255,255,255,0.7);
    border-right: 2px solid rgba(255,255,255,0.7);
}

.gantt-bar.priority-critical { background: linear-gradient(135deg, #DC2626, #B91C1C); }
.gantt-bar.priority-high { background: linear-gradient(135deg, #F59E0B, #D97706); }
.gantt-bar.priority-medium { background: linear-gradient(135deg, #6B7280, #4B5563); }
.gantt-bar.priority-low { background: linear-gradient(135deg, #10B981, #059669); }

.gantt-bar.status-done { opacity: 0.7; }

.gantt-bar.overdue { animation: pulse-red 2s infinite; }

@keyframes pulse-red {
    0%, 100% { box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.4); }
    50% { box-shadow: 0 0 0 4px rgba(220, 38, 38, 0); }
}

.gantt-milestone {
    position: absolute;
    width: 16px;
    height: 16px;
    background: var(--rz-primary);
    transform: rotate(45deg);
    z-index: 5;
    cursor: pointer;
}

.gantt-milestone:hover { transform: rotate(45deg) scale(1.1); }

.gantt-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    color: var(--rz-text-secondary-color);
}

.gantt-empty-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.gantt-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background: var(--rz-base-100);
    border-top: 1px solid var(--rz-base-300);
}

.gantt-legend {
    display: flex;
    gap: 1.5rem;
    font-size: 0.75rem;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.legend-color {
    width: 12px;
    height: 12px;
    border-radius: 2px;
}

.save-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    color: var(--rz-text-secondary-color);
}

.save-indicator.saving { color: var(--rz-warning); }
.save-indicator.saved { color: var(--rz-success); }
.save-indicator.error { color: var(--rz-danger); }

/* Month header for monthly view */
.gantt-month-header {
    display: flex;
    background: var(--rz-base-300);
    border-bottom: 1px solid var(--rz-base-400);
    position: sticky;
    top: 0;
    z-index: 10;
}

.gantt-month {
    text-align: center;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.375rem 0;
    border-right: 1px solid var(--rz-base-400);
    color: var(--rz-text-color);
}
