/* Clean Fullscreen Gantt Styles - No Layout Conflicts */
.gantt-fullscreen {
    height: 100vh;
    width: 100vw;
    display: flex;
    flex-direction: column;
    background: #f8fafc;
    overflow: hidden; /* Keep this for main container to prevent body scroll */
    position: relative;
}

.gantt-container {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.gantt-header {
    background: white;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    border-bottom: 3px solid #667eea;
    flex-shrink: 0;
}

/* Financial Summary Section */
.financial-summary-section {
    background: white;
    margin: 0 20px 15px 20px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    padding: 15px;
    border-left: 3px solid #667eea;
}

/* Financial Summary Section - Only for Gantt Report */
.gantt-fullscreen .summary-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
    align-items: stretch;
}

.gantt-fullscreen .summary-card {
    background: linear-gradient(135deg, #f8fafc, #e2e8f0);
    border-radius: 8px;
    padding: 12px;
    border: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.gantt-fullscreen .summary-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.gantt-fullscreen .summary-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 3px;
    height: 100%;
    background: var(--accent-color);
}

.gantt-fullscreen .summary-card.total-planned {
    --accent-color: #3b82f6;
}

.gantt-fullscreen .summary-card.total-planned .summary-icon {
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
}

.gantt-fullscreen .summary-card.total-paid {
    --accent-color: #10b981;
}

.gantt-fullscreen .summary-card.total-paid .summary-icon {
    background: linear-gradient(135deg, #10b981, #059669);
}

.gantt-fullscreen .summary-card.total-balance {
    --accent-color: #f59e0b;
}

.gantt-fullscreen .summary-card.total-balance .summary-icon {
    background: linear-gradient(135deg, #f59e0b, #d97706);
}

.gantt-fullscreen .summary-card.completion-status {
    --accent-color: #8b5cf6;
}

.gantt-fullscreen .summary-card.completion-status .summary-icon {
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
}

.gantt-fullscreen .summary-card.tba-items {
    --accent-color: #8e44ad;
}

.gantt-fullscreen .summary-card.tba-items .summary-icon {
    background: linear-gradient(135deg, #8e44ad, #9b59b6);
}

.gantt-fullscreen .summary-icon {
    width: 35px;
    height: 35px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 16px;
    flex-shrink: 0;
}

.gantt-fullscreen .summary-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.gantt-fullscreen .summary-label {
    font-size: 10px;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.gantt-fullscreen .summary-amount {
    font-size: 18px;
    font-weight: 700;
    color: #1f2937;
    line-height: 1;
}

.gantt-fullscreen .summary-count,
.gantt-fullscreen .summary-progress,
.gantt-fullscreen .summary-remaining,
.gantt-fullscreen .summary-detail {
    font-size: 9px;
    color: #6b7280;
    font-weight: 500;
}

.gantt-fullscreen .summary-status {
    font-size: 14px;
    font-weight: 700;
    color: #1f2937;
    line-height: 1;
}

.gantt-fullscreen .summary-card.total-paid .summary-progress {
    color: #059669;
    font-weight: 600;
}

.gantt-fullscreen .summary-card.total-balance .summary-remaining {
    color: #d97706;
    font-weight: 600;
}

.gantt-fullscreen .summary-card.completion-status .summary-detail {
    color: #7c3aed;
    font-weight: 600;
}

/* Responsive adjustments for summary */
@media (max-width: 768px) {
    .gantt-fullscreen .summary-cards {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .gantt-fullscreen .summary-card {
        padding: 10px;
    }
    
    .gantt-fullscreen .summary-icon {
        width: 30px;
        height: 30px;
        font-size: 14px;
    }
    
    .gantt-fullscreen .summary-amount {
        font-size: 16px;
    }
    
    .financial-summary-section {
        margin: 0 15px 10px 15px;
        padding: 12px;
    }
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.gantt-title {
    font-size: 28px;
    font-weight: 700;
    color: #2d3748;
    margin: 0;
}

.controls-section {
    display: flex;
    gap: 20px;
    align-items: center;
    flex-wrap: wrap;
}

.project-selector select {
    padding: 8px 15px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    background: white;
    color: #4a5568;
    min-width: 200px;
}

.gantt-controls {
    display: flex;
    gap: 10px;
    align-items: center;
}

.zoom-indicator {
    background: #f1f5f9;
    padding: 5px 10px;
    border-radius: 4px;
    border: 1px solid #cbd5e0;
    color: #2d3748;
    font-size: 12px;
    font-weight: 600;
    min-width: 80px;
    text-align: center;
}

.btn-control {
    padding: 8px 15px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
}

.btn-control:hover {
    background: #5a67d8;
    transform: translateY(-1px);
}

/* Project Information Header Styles */
.project-info-header {
    background: white;
    margin: 0 20px 0 20px;
    border-radius: 8px 8px 0 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    border-bottom: 2px solid #667eea;
    padding: 20px;
}

.project-info-table {
    width: 100%;
    border-collapse: collapse;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.project-info-table td {
    padding: 8px 15px;
    border: 1px solid #e2e8f0;
    font-size: 14px;
}

.project-info-label {
    background-color: #f8fafc;
    font-weight: 600;
    color: #4a5568;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    width: 200px;
    text-align: left;
}

.project-info-value {
    background-color: white;
    color: #2d3748;
    font-weight: 500;
}

.gantt-content {
    flex: 1;
    overflow: auto; /* Both vertical and horizontal scrolling */
    background: white;
    margin: 0 20px 20px 20px;
    border-radius: 0 0 12px 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    /* Ensure scrollbars are always visible when needed */
    scrollbar-width: auto;
    -webkit-overflow-scrolling: touch;
}

.gantt-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    min-width: max-content; /* Allow table to grow as wide as needed */
    table-layout: auto;
    /* Ensure table can grow horizontally for many date columns */
    white-space: nowrap;
}

.gantt-table thead {
    position: sticky;
    top: 0;
    z-index: 100;
}

.gantt-table th, .gantt-table td {
    border: 1px solid #e2e8f0;
    padding: calc(2px * var(--zoom-level, 1)) calc(4px * var(--zoom-level, 1));
    text-align: center;
    vertical-align: middle;
    font-size: calc(10px * var(--zoom-level, 1));
    line-height: 1.2;
}

.info-header {
    background: #f7fafc;
    border: 1px solid #e2e8f0;
    padding: 6px 4px;
    text-align: center;
    font-weight: 600;
    color: #2d3748;
    white-space: nowrap;
    position: sticky;
    left: 0;
    z-index: 101;
    font-size: 11px;
}

/* Task Description Column - Increased Width for Better Text Display */
.task-description-header {
    width: 250px;
    min-width: 250px;
    max-width: 250px;
}

/* Row Number Column - Compact */
.row-number-header {
    width: 40px;
    min-width: 40px;
    max-width: 40px;
    text-align: center;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    font-weight: 600;
}

.row-number-cell {
    width: 40px;
    min-width: 40px;
    max-width: 40px;
    text-align: center;
    font-weight: 600;
    color: #495057;
    font-size: 12px;
    background: #f8f9fa;
    border-right: 2px solid #dee2e6;
}

.task-description-cell {
    width: 250px;
    min-width: 250px;
    max-width: 250px;
    height: 72px;
    overflow: hidden;
    white-space: normal;
    word-wrap: break-word;
    line-height: 1.2;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px;
    text-align: center;
}

/* Quantity Column - Compact */
.quantity-header {
    width: 60px;
    min-width: 60px;
    max-width: 60px;
}

.quantity-cell {
    width: 60px;
    min-width: 60px;
    max-width: 60px;
    text-align: center;
}

/* UOM Column - Compact */
.uom-header {
    width: 60px;
    min-width: 60px;
    max-width: 60px;
}

.uom-cell {
    width: 60px;
    min-width: 60px;
    max-width: 60px;
    text-align: center;
}

/* Vendor Column - Increased Width for Better Text Display */
.vendor-header {
    width: 150px;
    min-width: 150px;
    max-width: 150px;
}

.vendor-cell {
    width: 150px;
    min-width: 150px;
    max-width: 150px;
}

/* Amount Column - Fixed Width */
.amount-header {
    width: 90px;
    min-width: 90px;
    max-width: 90px;
}

.amount-cell {
    width: 90px;
    min-width: 90px;
    max-width: 90px;
    text-align: right;
}

/* Paid Column - Fixed Width */
.paid-header {
    width: 90px;
    min-width: 90px;
    max-width: 90px;
}

.paid-cell {
    width: 90px;
    min-width: 90px;
    max-width: 90px;
    text-align: right;
    color: #059669;
    font-weight: 600;
}

/* Balance Column - Fixed Width */
.balance-header {
    width: 90px;
    min-width: 90px;
    max-width: 90px;
}

.balance-cell {
    width: 90px;
    min-width: 90px;
    max-width: 90px;
    text-align: right;
    color: #dc2626;
    font-weight: 600;
}

/* Status Column - Reduced Width */
.status-header {
    width: 140px;
    min-width: 140px;
    max-width: 140px;
}

.status-cell {
    width: 140px;
    min-width: 140px;
    max-width: 140px;
}

/* Progress Status Column - Wider for Better Display */
.progress-status-header {
    width: 140px;
    min-width: 140px;
    max-width: 140px;
}

.progress-status-cell {
    width: 140px;
    min-width: 140px;
    max-width: 140px;
}

/* Progress Percentage Column - Reduced Width */
.progress-percentage-header {
    width: 80px;
    min-width: 80px;
    max-width: 80px;
}

.progress-percentage-cell {
    width: 80px;
    min-width: 80px;
    max-width: 80px;
    text-align: center;
}

/* Start Date Column - Fixed Width */
.start-date-header {
    width: 100px;
    min-width: 100px;
    max-width: 100px;
}

.start-date-cell {
    width: 100px;
    min-width: 100px;
    max-width: 100px;
}

/* End Date Column - Fixed Width */
.end-date-header {
    width: 100px;
    min-width: 100px;
    max-width: 100px;
}

.end-date-cell {
    width: 100px;
    min-width: 100px;
    max-width: 100px;
}

.month-header {
    background: #667eea;
    color: white;
    padding: 4px;
    text-align: center;
    font-weight: 600;
    border: 1px solid #5a67d8;
    white-space: nowrap;
    min-width: 50px;
    font-size: 10px;
}

.day-header {
    background: #edf2f7;
    border: 1px solid #e2e8f0;
    padding: 4px 2px;
    text-align: center;
    font-size: calc(9px * var(--zoom-level, 1));
    font-weight: 500;
    color: #4a5568;
    min-width: calc(35px * var(--zoom-level, 1));
    max-width: calc(35px * var(--zoom-level, 1));
    white-space: nowrap;
    transition: all 0.3s ease;
}

.day-header.weekend {
    background: #fed7d7;
    color: #c53030;
}

.day-header.today {
    background: #bee3f8;
    color: #2b6cb0;
    font-weight: 700;
}

.task-row {
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.task-row:hover {
    background: #f7fafc;
}

.task-description-cell,
.quantity-cell,
.uom-cell,
.vendor-cell,
.amount-cell,
.paid-cell,
.balance-cell,
.status-cell,
.progress-percentage-cell {
    border: 1px solid #e2e8f0;
    padding: 4px;
    vertical-align: middle;
    font-size: 11px;
}

/* Hierarchical Task Styles */
.task-description {
    width: calc(230px * var(--zoom-level, 1));
    display: flex;
    align-items: center;
    justify-content: center;
    gap: calc(6px * var(--zoom-level, 1));
    height: 100%;
    text-align: center;
}

.task-hierarchy-level {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: calc(6px * var(--zoom-level, 1));
    width: 100%;
    flex-wrap: wrap;
    text-align: center;
}

.task-indent {
    margin-left: calc(15px * var(--zoom-level, 1));
}

.task-parent {
    font-weight: 700;
    background: #f8f9fa;
    border-left: 4px solid #007bff;
}

.task-child {
    font-weight: 500;
    border-left: 2px solid #e9ecef;
    margin-left: 10px;
}

.task-expand-icon {
    width: 12px;
    height: 12px;
    cursor: pointer;
    margin-right: 3px;
    font-size: 10px;
    color: #6c757d;
}

.task-number {
    background: #667eea;
    color: white;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: bold;
    flex-shrink: 0;
}

.task-parent .task-number {
    background: #007bff;
    width: 20px;
    height: 20px;
}

.task-child .task-number {
    background: #6c757d;
    width: 16px;
    height: 16px;
    font-size: 8px;
}

.task-title {
    font-weight: 500;
    color: #2d3748;
    flex: 1;
    font-size: 11px;
    white-space: normal;
    word-wrap: break-word;
    line-height: 1.3;
    max-width: 100%;
    text-align: center;
}

.task-parent .task-title {
    font-weight: 700;
    color: #1a202c;
    font-size: 12px;
    white-space: normal;
    word-wrap: break-word;
    line-height: 1.3;
    text-align: center;
}

.task-child .task-title {
    font-weight: 400;
    color: #4a5568;
    font-size: 14px;
    white-space: normal;
    word-wrap: break-word;
    line-height: 1.3;
    text-align: center;
}

.status-content {
    display: flex;
    flex-direction: column;
    gap: 2px;
    align-items: center;
}

.progress-percent {
    font-size: 10px;
    font-weight: 600;
    color: #4a5568;
}

.assignee-initials {
    background: #48bb78;
    color: white;
    border-radius: 50%;
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 8px;
    font-weight: bold;
    cursor: pointer;
    position: relative;
}

/* Tooltip styles for assignee names */
.assignee-tooltip {
    position: relative;
    display: inline-block;
}

.assignee-tooltip .tooltip-text {
    visibility: hidden;
    width: 200px;
    background-color: #333;
    color: #fff;
    text-align: center;
    border-radius: 6px;
    padding: 8px;
    position: absolute;
    z-index: 1000;
    bottom: 125%;
    left: 50%;
    margin-left: -100px;
    opacity: 0;
    transition: opacity 0.3s;
    font-size: 12px;
    font-weight: normal;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.assignee-tooltip .tooltip-text::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: #333 transparent transparent transparent;
}

.assignee-tooltip:hover .tooltip-text {
    visibility: visible;
    opacity: 1;
}

.priority-indicator {
    border-radius: 4px;
    padding: 2px 6px;
    font-size: 9px;
    font-weight: bold;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 16px;
    height: 16px;
    text-transform: uppercase;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease;
}

.priority-indicator:hover {
    transform: scale(1.1);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.priority-critical {
    background: linear-gradient(135deg, #f56565, #e53e3e);
    color: white;
    animation: pulse-critical 2s infinite;
}

.priority-high {
    background: linear-gradient(135deg, #fed7d7, #feb2b2);
    color: #c53030;
    border: 1px solid #fc8181;
}

.priority-medium {
    background: linear-gradient(135deg, #feebc8, #fbd38d);
    color: #dd6b20;
    border: 1px solid #f6ad55;
}

.priority-low {
    background: linear-gradient(135deg, #c6f6d5, #9ae6b4);
    color: #38a169;
    border: 1px solid #68d391;
}

/* Pulse animation for critical priority */
@keyframes pulse-critical {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.8;
        transform: scale(1.05);
    }
}

.timeline-cell {
    border: 1px solid #e2e8f0;
    padding: 0;
    position: relative;
    min-width: calc(35px * var(--zoom-level, 1));
    max-width: calc(35px * var(--zoom-level, 1));
    height: 28px;
    vertical-align: middle;
    overflow: hidden;
    transition: all 0.3s ease;
}

.timeline-cell.weekend {
    background: #f9f9f9;
}

.gantt-bar {
    height: 100%;
    width: 100%;
    margin: 0;
    border-radius: 0;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 9px;
    font-weight: 500;
    box-shadow: none;
    border: none;
    min-height: 28px;
}

.gantt-bar.completed {
    background: #48bb78;
}

.gantt-bar.in-progress {
    background: #4299e1;
}

.gantt-bar.not-started {
    background: #4a5568;
}

.gantt-bar.on-hold {
    background: #f6ad55;
}

.gantt-bar.cancelled {
    background: #e53e3e;
}

/* Enhanced Progress Visualization */
.gantt-bar.progress-completed {
    position: relative;
}

.gantt-bar.progress-completed.completed {
    background: #38a169; /* Darker green for completed tasks */
}

.gantt-bar.progress-completed.in-progress {
    background: #3182ce; /* Darker blue for completed portion of in-progress tasks */
}

.gantt-bar.progress-completed.not-started {
    background: #2d3748; /* Dark grey for completed portion */
}

.gantt-bar.progress-completed.on-hold {
    background: #d69e2e; /* Darker orange for completed portion of on-hold tasks */
}

.gantt-bar.progress-completed.cancelled {
    background: #c53030; /* Darker red for completed portion of cancelled tasks */
}

.gantt-bar.progress-remaining {
    position: relative;
    opacity: 0.3; /* More transparent for remaining portion */
}

.gantt-bar.progress-remaining.completed {
    background: #9ae6b4; /* Medium green shade for remaining portion */
}

.gantt-bar.progress-remaining.in-progress {
    background: #90cdf4; /* Medium blue shade for remaining portion */
}

.gantt-bar.progress-remaining.not-started {
    background: #718096; /* Medium-dark grey for not started remaining portion */
}

.gantt-bar.progress-remaining.on-hold {
    background: #fbd38d; /* Medium orange shade for on-hold remaining portion */
}

.gantt-bar.progress-remaining.cancelled {
    background: #fc8181; /* Medium red shade for cancelled remaining portion */
}

/* Status-based Gantt Bar Colors */
.gantt-bar.completed {
    background-color: #48bb78 !important; /* Green for completed tasks */
}

.gantt-bar.in-progress {
    background-color: #4299e1 !important; /* Blue for in progress tasks */
}

.gantt-bar.cancelled,
.gantt-bar.on-hold {
    background-color: #f6ad55 !important; /* Orange for cancelled or on hold tasks */
}

.gantt-bar.not-started {
    background-color: #a0aec0 !important; /* Grey for not started tasks */
}

/* Priority Selection Visual Feedback */
.form-select.priority-critical {
    border-color: #e53e3e;
    box-shadow: 0 0 5px rgba(229, 62, 62, 0.3);
}

.form-select.priority-high {
    border-color: #c53030;
    box-shadow: 0 0 3px rgba(197, 48, 48, 0.2);
}

.form-select.priority-medium {
    border-color: #dd6b20;
    box-shadow: 0 0 3px rgba(221, 107, 32, 0.15);
}

.form-select.priority-low {
    border-color: #38a169;
    box-shadow: 0 0 3px rgba(56, 161, 105, 0.1);
}

/* Priority Select Container */
.priority-select-container {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
}

.priority-preview {
    display: flex;
    align-items: center;
    justify-content: center;
}

.priority-preview .priority-indicator {
    margin: 0;
}

.task-bar-label {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    padding: 0 4px;
    position: relative;
    z-index: 2; /* Ensure text appears above progress stripe */
}

.progress-overlay {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 0;
    transition: width 0.3s ease;
    border-right: 2px solid rgba(255, 255, 255, 0.6);
}

.progress-display {
    display: flex;
    justify-content: center;
    align-items: center;
}

.progress-circle {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 8px;
    font-weight: 600;
    color: #4a5568;
}

/* Actions Column Styles */
.actions-header {
    width: 80px;
    min-width: 80px;
    max-width: 80px;
    text-align: center;
}

.actions-cell {
    border: 1px solid #e2e8f0;
    padding: 4px;
    vertical-align: middle;
    text-align: center;
    width: 80px;
    min-width: 80px;
}

.action-buttons {
    display: flex;
    gap: 4px;
    justify-content: center;
    align-items: center;
}

.action-btn {
    padding: 4px 6px;
    border-radius: 4px;
    font-size: 10px;
    line-height: 1;
    border: 1px solid transparent;
    transition: all 0.2s ease;
    min-width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.action-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.btn-outline-primary.action-btn {
    color: #007bff;
    border-color: #007bff;
}

.btn-outline-primary.action-btn:hover {
    background-color: #007bff;
    color: white;
}

.btn-outline-danger.action-btn {
    color: #dc3545;
    border-color: #dc3545;
}

.btn-outline-danger.action-btn:hover {
    background-color: #dc3545;
    color: white;
}

/* Task Edit Modal Styles */
.task-edit-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: modalFadeIn 0.3s ease-out;
}

@keyframes modalFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.task-edit-modal-content {
    background: white;
    border-radius: 16px;
    width: 95%;
    max-width: 900px;
    max-height: 95vh;
    overflow: hidden;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
    animation: modalSlideIn 0.3s ease-out;
    border: 1px solid #e2e8f0;
}

@keyframes modalSlideIn {
    from { 
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    to { 
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.task-edit-modal-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1.5rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #e2e8f0;
}

.task-edit-modal-header h4 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.2rem;
    transition: all 0.2s ease;
}

.btn-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.task-edit-modal-body {
    padding: 2rem;
    max-height: calc(95vh - 140px);
    overflow-y: auto;
}

.edit-section {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    transition: all 0.2s ease;
}

.edit-section:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-color: #cbd5e0;
}

.highlight-section {
    background: linear-gradient(135deg, #f7fafc 0%, #edf2f7 100%);
    border: 2px solid #667eea;
    position: relative;
}

.highlight-section::before {
    content: "⭐";
    position: absolute;
    top: -10px;
    right: 15px;
    background: #667eea;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}

.section-title {
    color: #2d3748;
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #e2e8f0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.form-label {
    font-weight: 600;
    color: #4a5568;
    margin-bottom: 0.5rem;
    display: block;
}

.form-control, .form-select {
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    padding: 0.75rem;
    font-size: 0.875rem;
    transition: all 0.2s ease;
}

.form-control:focus, .form-select:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    outline: none;
}

.progress-control {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1rem;
}

.progress-slider {
    margin: 1rem 0;
}

.form-range {
    width: 100%;
    height: 8px;
    border-radius: 4px;
    background: #e2e8f0;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
}

.form-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #667eea;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    transition: all 0.2s ease;
}

.form-range::-webkit-slider-thumb:hover {
    background: #5a67d8;
    transform: scale(1.1);
}

.form-range::-moz-range-thumb {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #667eea;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.progress-display {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 1rem;
    padding: 0.75rem;
    background: #f7fafc;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.progress-percentage {
    font-size: 1.5rem;
    font-weight: 700;
    color: #667eea;
}

.progress-status {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.progress-presets {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.btn-group-sm {
    display: flex;
    gap: 0.25rem;
    flex-wrap: wrap;
}

.btn-outline-primary.btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.btn-outline-primary.btn-sm:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(102, 126, 234, 0.3);
}

.staff-dropdown-container {
    position: relative;
}

.dropdown-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 48px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.dropdown-toggle:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.dropdown-menu {
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    padding: 1rem;
    min-width: 100%;
}

.staff-filter input {
    border: 1px solid #cbd5e0;
    border-radius: 6px;
    padding: 0.5rem;
    font-size: 0.875rem;
}

.staff-filter input:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.1);
    outline: none;
}

.dropdown-item-checkbox {
    display: flex;
    align-items: center;
    padding: 0.75rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: 0.25rem;
}

.dropdown-item-checkbox:hover {
    background-color: #f7fafc;
    transform: translateX(4px);
}

.dropdown-item-checkbox.selected {
    background-color: #ebf8ff;
    border: 1px solid #667eea;
}

.staff-checkbox {
    margin-right: 0.75rem;
    width: 18px;
    height: 18px;
    accent-color: #667eea;
}

.staff-info {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.staff-name {
    font-weight: 600;
    color: #2d3748;
    font-size: 0.875rem;
}

.staff-department {
    font-size: 0.75rem;
    color: #718096;
    margin-top: 0.125rem;
}

.staff-id {
    font-size: 0.75rem;
    color: #a0aec0;
    margin-left: 0.5rem;
}

.form-check {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    width: 100%;
}

.form-check-input {
    margin-top: 0.125rem;
    flex-shrink: 0;
}

.form-check-label {
    flex: 1;
    cursor: pointer;
}

.task-edit-modal-footer {
    background: #f8fafc;
    padding: 1.5rem 2rem;
    border-top: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.footer-left {
    display: flex;
    gap: 0.5rem;
}

.footer-right {
    display: flex;
    gap: 1rem;
}

.task-edit-modal-footer .btn {
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    border-radius: 8px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.task-edit-modal-footer .btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Delete Modal Styles */
.delete-modal-content {
    background: white;
    border-radius: 12px;
    max-width: 500px;
    width: 90vw;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    transform: scale(1);
}

.spinner-border-sm {
    width: 1rem;
    height: 1rem;
}

/* Status badge colors */
.bg-primary { background-color: #667eea !important; }
.bg-success { background-color: #48bb78 !important; }
.bg-warning { background-color: #ed8936 !important; }
.bg-danger { background-color: #e53e3e !important; }
.bg-secondary { background-color: #a0aec0 !important; }

/* Recent Activity Panel Styles */
.recent-activity-panel {
    position: fixed;
    top: 0;
    right: -400px;
    width: 400px;
    height: 100vh;
    background: white;
    box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
    z-index: 9999;
    transition: right 0.3s ease;
    overflow-y: auto;
}

.recent-activity-panel.open {
    right: 0;
}

.activity-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
}

.activity-header h5 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
}

.activity-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.2s ease;
}

.activity-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.activity-content {
    padding: 1.5rem;
}

.activity-item {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    border-bottom: 1px solid #e2e8f0;
    transition: background-color 0.2s ease;
}

.activity-item:hover {
    background-color: #f7fafc;
}

.activity-item:last-child {
    border-bottom: none;
}

.activity-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    color: white;
    flex-shrink: 0;
}

.activity-icon.task-created { background-color: #48bb78; }
.activity-icon.task-updated { background-color: #4299e1; }
.activity-icon.task-completed { background-color: #38a169; }
.activity-icon.project-created { background-color: #667eea; }

.activity-details {
    flex: 1;
}

.activity-title {
    font-weight: 600;
    color: #2d3748;
    font-size: 0.875rem;
    margin-bottom: 0.25rem;
}

.activity-description {
    color: #718096;
    font-size: 0.75rem;
    margin-bottom: 0.5rem;
}

.activity-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.75rem;
    color: #a0aec0;
}

.activity-time {
    font-weight: 500;
}

.no-activity {
    text-align: center;
    padding: 2rem;
    color: #718096;
}

.no-activity i {
    font-size: 2rem;
    margin-bottom: 1rem;
    color: #cbd5e0;
}

.activity-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 9998;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.activity-overlay.open {
    opacity: 1;
    visibility: visible;
}

.delete-modal-header {
    background: linear-gradient(135deg, #fee2e2 0%, #fef2f2 100%);
    padding: 1.5rem 2rem;
    border-bottom: 1px solid #fca5a5;
    border-radius: 12px 12px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.delete-modal-header h4 {
    margin: 0;
    color: #dc2626;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.delete-modal-body {
    padding: 2rem;
}

.warning-content {
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
}

.warning-icon {
    background: #fee2e2;
    color: #dc2626;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
}

.warning-text {
    flex: 1;
}

.warning-text h5 {
    color: #1f2937;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.warning-text .task-name {
    font-weight: 700;
    color: #dc2626;
    font-size: 1.1rem;
    margin-bottom: 1rem;
    padding: 0.5rem;
    background: #fef2f2;
    border: 1px solid #fca5a5;
    border-radius: 6px;
    display: inline-block;
}

.child-tasks-warning {
    background: #fffbeb;
    border: 1px solid #f59e0b;
    border-radius: 8px;
    padding: 1rem;
    margin: 1rem 0;
}

.child-tasks-warning p {
    margin-bottom: 0.5rem;
    color: #92400e;
}

.child-tasks-list {
    margin: 0.5rem 0 0 1rem;
    padding: 0;
}

.child-tasks-list li {
    color: #6b7280;
    margin-bottom: 0.25rem;
    font-weight: 500;
}

.deletion-warning {
    background: #fef2f2;
    border: 1px solid #fca5a5;
    border-radius: 6px;
    padding: 0.75rem;
    margin-top: 1.5rem;
    color: #dc2626;
    font-weight: 500;
}

.delete-modal-footer {
    background: #f9fafb;
    padding: 1.5rem 2rem;
    border-top: 1px solid #e5e7eb;
    border-radius: 0 0 12px 12px;
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
}

.delete-modal-footer .btn {
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    border-radius: 8px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.delete-modal-footer .btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Enhanced Scrollbar Styling for Better UX */
.gantt-content::-webkit-scrollbar {
    width: 12px;
    height: 12px;
}

.gantt-content::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 6px;
}

.gantt-content::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: 6px;
    border: 2px solid #f1f5f9;
}

.gantt-content::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #5a67d8, #6b46c1);
}

.gantt-content::-webkit-scrollbar-corner {
    background: #f1f5f9;
}

/* Firefox scrollbar styling */
.gantt-content {
    scrollbar-width: auto;
    scrollbar-color: #667eea #f1f5f9;
}

/* Ensure table cells don't break scrolling */
.gantt-table td, .gantt-table th {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Better text handling for vendor and project columns */
.vendor-cell {
    white-space: normal;
    word-wrap: break-word;
    overflow: visible;
    text-align: left;
    padding: 8px 6px;
}

.task-description-cell {
    white-space: normal;
    word-wrap: break-word;
    overflow: visible;
    text-align: left;
}

.task-title {
    display: block;
    line-height: 1.3;
    max-width: 100%;
}

/* Payment Timeline Styles */
.payment-timeline-cell {
    border: 1px solid #e2e8f0;
    padding: 2px;
    position: relative;
    min-width: calc(40px * var(--zoom-level, 1));
    max-width: calc(40px * var(--zoom-level, 1));
    height: 32px;
    vertical-align: middle;
    text-align: center;
    background: #fafafa;
    transition: all 0.3s ease;
}

.payment-timeline-cell:hover {
    background: #f0f9ff;
    border-color: #3b82f6;
}

.payment-marker {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    border-radius: 6px;
    color: white;
    font-weight: 600;
    font-size: calc(8px * var(--zoom-level, 1));
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.payment-marker:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.payment-marker.payment-planned {
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    border: 2px solid #2563eb;
}

.payment-marker.payment-paid {
    background: linear-gradient(135deg, #10b981, #059669);
    border: 2px solid #047857;
}

.payment-marker.payment-month-only {
    border-style: dashed;
    opacity: 0.8;
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
}

.payment-marker.payment-month-only::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: repeating-linear-gradient(
        45deg,
        transparent,
        transparent 2px,
        rgba(255, 255, 255, 0.1) 2px,
        rgba(255, 255, 255, 0.1) 4px
    );
}

.payment-amount {
    font-size: calc(7px * var(--zoom-level, 1));
    font-weight: bold;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.payment-period-indicator {
    font-size: calc(8px * var(--zoom-level, 1));
    margin-top: 1px;
    color: rgba(255, 255, 255, 0.9);
    transition: all 0.3s ease;
}

.payment-period-indicator i {
    font-size: calc(8px * var(--zoom-level, 1));
    cursor: help;
}

.payment-period-indicator i:hover {
    color: #fff;
    transform: scale(1.2);
}

.payment-marker.payment-month-only .payment-period-indicator i.fa-sticky-note {
    color: #fbbf24;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.payment-marker.payment-month-only .payment-period-indicator i.fa-calendar-alt {
    color: rgba(255, 255, 255, 0.8);
}

/* Enhanced Payment Date Headers for Month-Only */
.payment-date-header[data-month-only="true"] {
    background: linear-gradient(135deg, #f8fafc, #e2e8f0);
    border-left: 3px solid #8b5cf6;
    position: relative;
}

.payment-date-header[data-month-only="true"]::before {
    content: "📅";
    position: absolute;
    top: 2px;
    right: 2px;
    font-size: 8px;
    opacity: 0.7;
}
