* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
}

header {
    background: white;
    padding: 30px;
    border-radius: 10px;
    margin-bottom: 20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

header h1 {
    color: #667eea;
    margin-bottom: 10px;
}

header p {
    color: #666;
    font-size: 14px;
}

.form-section {
    background: white;
    padding: 30px;
    border-radius: 10px;
    margin-bottom: 20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

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

.form-header h2 {
    color: #333;
    margin: 0;
}

.form-group {
    margin-bottom: 15px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

input[type="text"],
input[type="date"],
select,
textarea {
    width: 100%;
    padding: 10px;
    border: 2px solid #e0e0e0;
    border-radius: 5px;
    font-size: 14px;
    transition: border-color 0.3s;
}

input[type="text"]:focus,
input[type="date"]:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: #667eea;
}

textarea {
    resize: vertical;
    font-family: inherit;
}

.form-actions {
    margin-top: 20px;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 5px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-primary {
    background: #667eea;
    color: white;
}

.btn-primary:hover {
    background: #5568d3;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(102, 126, 234, 0.3);
}

.btn-secondary {
    background: #48bb78;
    color: white;
}

.btn-secondary:hover {
    background: #38a169;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(72, 187, 120, 0.3);
}

.btn-secondary.active {
    background: #2f855a;
    box-shadow: 0 0 0 3px rgba(72, 187, 120, 0.3);
}

.btn-danger {
    background: #f56565;
    color: white;
}

.btn-danger:hover {
    background: #e53e3e;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(245, 101, 101, 0.3);
}

/* Icon control buttons - compact and colorful */
.btn-icon-control {
    width: 42px;
    height: 42px;
    padding: 8px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    position: relative;
}

.btn-icon-control:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn-icon-control:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.btn-icon-control svg {
    stroke-width: 2.5;
}

/* Zoom In - Green */
.btn-zoom-in {
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
    color: white;
}

.btn-zoom-in:hover {
    background: linear-gradient(135deg, #38a169 0%, #2f855a 100%);
}

/* Zoom Out - Blue */
.btn-zoom-out {
    background: linear-gradient(135deg, #4299e1 0%, #3182ce 100%);
    color: white;
}

.btn-zoom-out:hover {
    background: linear-gradient(135deg, #3182ce 0%, #2c5282 100%);
}

/* Reset Zoom - Purple */
.btn-reset-zoom {
    background: linear-gradient(135deg, #9f7aea 0%, #805ad5 100%);
    color: white;
}

.btn-reset-zoom:hover {
    background: linear-gradient(135deg, #805ad5 0%, #6b46c1 100%);
}

/* Export - Teal */
.btn-export {
    background: linear-gradient(135deg, #4fd1c5 0%, #38b2ac 100%);
    color: white;
}

.btn-export:hover {
    background: linear-gradient(135deg, #38b2ac 0%, #319795 100%);
}

/* Import - Cyan */
.btn-import {
    background: linear-gradient(135deg, #63b3ed 0%, #4299e1 100%);
    color: white;
}

.btn-import:hover {
    background: linear-gradient(135deg, #4299e1 0%, #3182ce 100%);
}

/* Download - Indigo */
.btn-download {
    background: linear-gradient(135deg, #667eea 0%, #5a67d8 100%);
    color: white;
}

.btn-download:hover {
    background: linear-gradient(135deg, #5a67d8 0%, #4c51bf 100%);
}

/* Reset Timeline - Orange */
.btn-reset-timeline {
    background: linear-gradient(135deg, #f6ad55 0%, #ed8936 100%);
    color: white;
}

.btn-reset-timeline:hover {
    background: linear-gradient(135deg, #ed8936 0%, #dd6b20 100%);
}

/* Clear - Red */
.btn-clear {
    background: linear-gradient(135deg, #fc8181 0%, #f56565 100%);
    color: white;
}

.btn-clear:hover {
    background: linear-gradient(135deg, #f56565 0%, #e53e3e 100%);
}

/* Control divider */
.control-divider {
    width: 1px;
    height: 30px;
    background: #e2e8f0;
    margin: 0 8px;
    display: inline-block;
}

/* Adjust timeline controls layout */
.timeline-controls {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    flex-wrap: wrap;
}

.control-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.control-label {
    font-size: 9px;
    color: #666;
    white-space: nowrap;
    font-weight: 500;
}

.control-divider {
    width: 1px;
    height: 40px;
    background: #e0e0e0;
    margin: 0 4px;
}


.items-list {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 2px solid #e0e0e0;
}

.items-list h3 {
    color: #333;
    margin-bottom: 15px;
}

/* Table styles */
.table-container {
    overflow-x: auto;
    margin-top: 20px;
}

.items-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    font-size: 12px; /* Reduced from 13px */
}

.items-table thead {
    background: #667eea;
    color: white;
    position: sticky;
    top: 0;
    z-index: 10;
}

.items-table th {
    padding: 8px 6px; /* Reduced from 12px 8px */
    text-align: left;
    font-weight: 600;
    font-size: 11px; /* Smaller font */
    border-right: 1px solid rgba(255, 255, 255, 0.2);
    line-height: 1.2;
}

.items-table th:last-child {
    border-right: none;
}

.items-table tbody tr {
    border-bottom: 1px solid #e0e0e0;
    transition: background 0.2s;
}

.items-table tbody tr:hover {
    background: #f7fafc;
}

.items-table td {
    padding: 3px 6px; /* Very compact - reduced from 6px 8px */
    vertical-align: middle;
    line-height: 1.3; /* Tighter line height */
}

.workstream-item td {
    padding: 2px 6px !important; /* Minimal padding for items */
}

.items-table input[type="text"],
.items-table input[type="date"],
.items-table select,
.items-table textarea {
    width: 100%;
    padding: 3px 5px; /* Minimal padding */
    border: 1px solid #e0e0e0;
    border-radius: 3px;
    font-size: 12px; /* Smaller font for compactness */
    font-family: inherit;
    transition: border-color 0.2s;
    line-height: 1.2; /* Tighter line height */
}

.items-table input[type="text"]:focus,
.items-table input[type="date"]:focus,
.items-table select:focus,
.items-table textarea:focus {
    outline: none;
    border-color: #667eea;
    background: #f0f4ff;
}

.items-table textarea {
    resize: vertical;
    min-height: 28px; /* Reduced from 36px */
}

.items-table select {
    cursor: pointer;
}

/* Workstream grouping styles */
.workstream-header-row {
    background: #f3f4f6;
    font-weight: 700;
}

.workstream-header-row td {
    padding: 5px 8px !important; /* Very compact padding */
    font-size: 14px; /* Increased from 12px */
    line-height: 1.2;
    font-weight: 600; /* Make workstream name bolder */
}

.workstream-header-row:hover {
    background: #e5e7eb;
}

.workstream-toggle-icon {
    display: inline-block;
    width: 16px; /* Smaller icon width */
    text-align: center;
    margin-right: 5px; /* Reduced margin */
    font-size: 12px; /* Smaller icon */
    color: #3b82f6;
}

.workstream-item {
    transition: background-color 0.2s;
}

.workstream-item:hover {
    background: #f9fafb;
}

/* Workstream resize handle */
/* Vertical resize handle (bottom edge) */
.workstream-resize-handle-vertical {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 8px;
    background: linear-gradient(to bottom, transparent, #3b82f6);
    cursor: ns-resize;
    opacity: 0;
    transition: opacity 0.2s;
    z-index: 10;
}

.timeline-workstream:hover .workstream-resize-handle-vertical {
    opacity: 0.3;
}

.workstream-resize-handle-vertical:hover {
    opacity: 0.6 !important;
    background: linear-gradient(to bottom, transparent, #2563eb);
}

.workstream-resize-handle-vertical:active {
    opacity: 0.8 !important;
    background: #2563eb;
}

/* Horizontal resize handle (right edge) */
.workstream-resize-handle-horizontal {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 8px;
    background: linear-gradient(to right, transparent, #3b82f6);
    cursor: ew-resize;
    opacity: 0;
    transition: opacity 0.2s;
    z-index: 10;
}

.timeline-workstream:hover .workstream-resize-handle-horizontal {
    opacity: 0.3;
}

.workstream-resize-handle-horizontal:hover {
    opacity: 0.6 !important;
    background: linear-gradient(to right, transparent, #2563eb);
}

.workstream-resize-handle-horizontal:active {
    opacity: 0.8 !important;
    background: #2563eb;
}

/* Timeline border resize handle (for extending timeline) */
.timeline-border-resize-handle {
    position: absolute;
    top: 0;
    right: -4px;
    bottom: 0;
    width: 12px;
    background: linear-gradient(to right, transparent, #3b82f6);
    cursor: ew-resize;
    opacity: 0;
    transition: opacity 0.2s;
    z-index: 100;
    border-radius: 0 8px 8px 0;
}

.timeline-bordered-container {
    position: relative;
}

.timeline-bordered-container:hover .timeline-border-resize-handle {
    opacity: 0.4;
}

.timeline-border-resize-handle:hover {
    opacity: 0.8 !important;
    background: linear-gradient(to right, transparent, #2563eb);
}

.timeline-border-resize-handle:active {
    opacity: 1 !important;
    background: #2563eb;
}

.table-actions {
    display: flex;
    gap: 3px; /* Reduced from 5px */
    justify-content: center;
}

.btn-table-action {
    padding: 4px 6px; /* Compact padding for icon buttons */
    border: none;
    border-radius: 3px;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-table-duplicate {
    background: #dbeafe;
    color: #1e40af;
    border: 1px solid #bfdbfe;
    margin-right: 5px;
}

.btn-table-duplicate:hover {
    background: #bfdbfe;
}

.btn-table-delete {
    background: #fee;
    color: #c00;
    border: 1px solid #fcc;
}

.btn-table-delete:hover {
    background: #fcc;
}

.empty-state-table {
    text-align: center;
    padding: 60px 20px;
    color: #999;
    display: none;
}

.empty-state-table.show {
    display: block;
}

/* Type indicator badge in table */
.type-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.type-badge.activity {
    background: #e0e7ff;
    color: #667eea;
}

.type-badge.milestone {
    background: #fed7aa;
    color: #ed8936;
}

/* Status colors in dropdown */
.status-not-started {
    color: #6b7280;
}

.status-in-progress {
    color: #10b981;
    font-weight: 600;
}

.status-at-risk {
    color: #ef4444;
    font-weight: 600;
}

.status-completed {
    color: #3b82f6;
    font-weight: 600;
}

#itemsContainer {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.item-card {
    background: #f7fafc;
    padding: 15px;
    border-radius: 5px;
    border-left: 4px solid #667eea;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.item-card.not-started {
    border-left-color: #9ca3af;
}

.item-card.in-progress {
    border-left-color: #10b981;
}

.item-card.at-risk {
    border-left-color: #ef4444;
}

.item-card.completed {
    border-left-color: #3b82f6;
}

.item-card.milestone {
    border-left-color: #ed8936;
    background: #fffaf0;
}

.item-info {
    flex: 1;
}

.item-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 5px;
}

.item-type-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.item-type-badge.activity {
    background: #667eea;
    color: white;
}

.item-type-badge.milestone {
    background: #ed8936;
    color: white;
}

.item-status-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.item-status-badge.not-started {
    background: #9ca3af;
    color: white;
}

.item-status-badge.in-progress {
    background: #10b981;
    color: white;
}

.item-status-badge.at-risk {
    background: #ef4444;
    color: white;
}

.item-status-badge.completed {
    background: #3b82f6;
    color: white;
}

.item-workstream {
    color: #666;
    font-size: 12px;
    font-weight: 600;
}

.item-name {
    font-weight: 600;
    color: #333;
    margin-bottom: 3px;
}

.item-dates {
    color: #666;
    font-size: 13px;
}

.item-description {
    color: #888;
    font-size: 12px;
    margin-top: 5px;
}

.item-actions {
    margin-left: 15px;
}

.btn-delete {
    background: #f56565;
    color: white;
    padding: 8px 15px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: background 0.3s;
}

.btn-delete:hover {
    background: #e53e3e;
}

.timeline-section {
    background: white;
    padding: 30px;
    border-radius: 16px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

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

.timeline-header h2 {
    color: #333;
}

.timeline-view-toggle {
    display: flex;
    gap: 5px;
    background: #f3f4f6;
    padding: 4px;
    border-radius: 8px;
}

.btn-view-toggle {
    padding: 8px 16px;
    border: none;
    background: transparent;
    color: #666;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s;
}

.btn-view-toggle:hover {
    background: #e5e7eb;
    color: #333;
}

.btn-view-toggle.active {
    background: white;
    color: #667eea;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.timeline-legend {
    display: flex;
    gap: 15px;
    align-items: center;
    flex-wrap: wrap;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    color: #666;
}

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

.legend-box.not-started {
    background: #9ca3af;
}

.legend-box.in-progress {
    background: #10b981;
}

.legend-box.at-risk {
    background: #ef4444;
}

.legend-box.completed {
    background: #3b82f6;
}

.legend-diamond {
    width: 12px;
    height: 12px;
    background: #ed8936;
    transform: rotate(45deg);
}

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

.timeline-canvas {
    min-height: 400px;
    border-radius: 12px;
    position: relative;
    overflow-x: auto;
    background: linear-gradient(to bottom, #ffffff 0%, #f9fafb 100%);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 400px;
    color: #999;
}

.empty-state svg {
    width: 100px;
    height: 100px;
    margin-bottom: 20px;
    opacity: 0.3;
}

.empty-state p {
    font-size: 16px;
}

/* Timeline rendering styles */
.timeline-content {
    padding: 20px;
    min-width: 100%;
}

.timeline-grid {
    position: relative;
    background: #f8fafc;
    overflow: visible; /* Allow TODAY label and content to show outside */
    width: 100%;
}
    padding: 5px 0; /* Small padding inside border */
}

.timeline-header-row {
    display: flex;
    position: sticky;
    top: 0;
    z-index: 10;
    margin-bottom: 10px;
}

.timeline-left-spacer {
    width: 200px;
    min-width: 200px;
    flex-shrink: 0;
}

.timeline-months-wrapper {
    flex: 1;
    overflow: hidden;
}

.timeline-months {
    display: flex;
    border-bottom: 3px solid #60a5fa;
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.timeline-month {
    padding: 12px 5px;
    font-weight: 700;
    font-size: 12px;
    border-right: 1px solid #93c5fd;
    text-align: center;
    color: #1e40af;
    background: transparent;
}

.timeline-workstream {
    display: flex;
    margin-bottom: 5px;
    position: relative; /* For resize handle positioning */
    border-bottom: 3px solid #3b82f6; /* Direct border - simpler approach */
}

.workstream-header {
    width: 200px;
    min-width: 200px;
    flex-shrink: 0;
    font-weight: 700;
    font-size: 14px; /* Increased from 13px */
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 8px; /* Added padding for better spacing */
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); /* Blue gradient background */
    color: white; /* White text */
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3); /* Text shadow for better readability */
    border-right: 2px solid #60a5fa; /* Blue border on right */
}

.workstream-move-buttons {
    display: flex;
    gap: 2px;
    opacity: 0;
    transition: opacity 0.2s;
}

.workstream-header:hover .workstream-move-buttons {
    opacity: 1;
}

.workstream-move-btn {
    background: rgba(255, 255, 255, 0.3); /* Semi-transparent white on blue background */
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.5);
    width: 20px;
    height: 20px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    padding: 0;
}

.workstream-move-btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.5); /* More opaque on hover */
    border-color: white;
}

.workstream-move-btn:disabled {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    cursor: not-allowed;
    opacity: 0.4;
}
    color: #1e40af;
    padding: 12px 16px;
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    display: flex;
    align-items: center;
    border-right: 2px solid #93c5fd;
    border-bottom: 1px solid #bfdbfe;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.workstream-header.milestones {
    background: linear-gradient(135deg, #fed7aa 0%, #fdba74 100%);
    color: #9a3412;
    border-right: 2px solid #fb923c;
    font-weight: 700;
}

.workstream-rows {
    flex: 1;
    position: relative;
    min-height: 100px;
    padding-top: 40px; /* Space for TODAY label at top - reduced to better align */
    overflow: visible; /* Allow gridlines to show through */
    background: transparent; /* Transparent to show gridlines */
    width: 100%; /* Ensure it fills the container */
    border-bottom: 3px solid #1e3a8a; /* Dark blue separator between workstreams */
}

.timeline-milestone {
    position: absolute;
    width: 70px; /* Reduced from 80px to match label */
    height: auto; /* Auto height for wrapped text */
    min-height: 60px; /* Reduced from 70px */
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    top: 5px;
    z-index: 5;
    left: 0; /* Explicit positioning */
}

.timeline-milestone.general {
    top: 5px; /* General milestones in milestone section */
}

.milestone-diamond {
    width: 20px;
    height: 20px;
    background: linear-gradient(135deg, #fb923c 0%, #f97316 100%);
    transform: rotate(45deg);
    box-shadow: 0 3px 8px rgba(249, 115, 22, 0.4);
    border: 2px solid #fff;
    flex-shrink: 0; /* Prevent shrinking */
}

/* Activity bar - simple 2pt line design */
.timeline-bar {
    position: absolute;
    height: 40px;
    overflow: visible !important;
    cursor: move;
    z-index: 3;
}

.timeline-bar.dragging {
    opacity: 0.7;
    cursor: grabbing !important;
    z-index: 999;
}

/* 10pt solid line for activity (5x thicker) */
.timeline-bar-line {
    position: absolute;
    top: 15px;
    left: 0;
    right: 0;
    height: 20px; /* 2x thickness: increased from 10px to 20px */
    z-index: 1;
    border-radius: 2px;
}

/* Activity description above the line in black */
.timeline-bar-description {
    position: absolute;
    top: -2px; /* Position immediately above the bar with no gap */
    left: 50%;
    transform: translateX(-50%);
    font-size: 12px; /* Same font size for all views */
    font-weight: 600;
    color: #000;
    white-space: nowrap;
    z-index: 4;
    pointer-events: none;
}

.timeline-bar:hover .timeline-bar-line {
    height: 24px; /* Hover effect: 2x from 12px to 24px */
}

/* Drag handles */
.timeline-bar-drag-handle-start,
.timeline-bar-drag-handle-end {
    position: absolute;
    width: 10px;
    height: 100%;
    top: 0;
    cursor: ew-resize;
    z-index: 10;
    background: transparent;
}

.timeline-bar-drag-handle-start {
    left: 0;
}

.timeline-bar-drag-handle-end {
    right: 0;
}

.timeline-bar-drag-handle-start:hover,
.timeline-bar-drag-handle-end:hover {
    background: rgba(0, 0, 0, 0.1);
}

.timeline-bar-label {
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    font-size: 11px !important;
    font-weight: 600 !important;
    color: white !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3) !important;
    white-space: nowrap !important;
    z-index: 4 !important;
    display: block !important;
    pointer-events: none !important;
    max-width: calc(100% - 20px) !important;
    overflow: visible !important;
}
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3) !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    max-width: 90% !important;
}

/* Label above bar for narrow bars */
.timeline-bar-label-above {
    position: absolute !important;
    top: -20px !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    font-size: 11px !important;
    font-weight: 400 !important;
    color: #000 !important;
    white-space: nowrap !important;
    z-index: 4 !important;
    display: block !important;
    pointer-events: none !important;
}

/* Start date - positioned inside the line start, centered vertically */
.timeline-bar-start-date {
    position: absolute !important;
    left: 5px !important;
    top: 50% !important; /* Center vertically inside the bar */
    transform: translateY(-50%) !important;
    font-size: 9px !important; /* Reduced from 10px */
    font-weight: 400 !important; /* Removed bold */
    color: white !important; /* White font color */
    white-space: nowrap !important;
    display: block !important;
    pointer-events: none !important;
    z-index: 5 !important;
}

/* End date - positioned inside the line end, centered vertically */
.timeline-bar-end-date {
    position: absolute !important;
    right: 5px !important;
    top: 50% !important; /* Center vertically inside the bar */
    transform: translateY(-50%) !important;
    font-size: 9px !important; /* Reduced from 10px */
    font-weight: 400 !important; /* Removed bold */
    color: white !important; /* White font color */
    white-space: nowrap !important;
    display: block !important;
    pointer-events: none !important;
    z-index: 5 !important;
}

/* Dates below bar for very short activities */
.timeline-bar.dates-below .timeline-bar-start-date {
    top: 38px !important; /* Below the bar */
    transform: none !important;
    left: 0 !important;
    font-size: 9px !important; /* Reduced from 10px */
    font-weight: 400 !important; /* Removed bold */
    color: #4b5563 !important; /* Grey color for below dates */
}

.timeline-bar.dates-below .timeline-bar-end-date {
    top: 38px !important; /* Below the bar */
    transform: none !important;
    right: 0 !important;
    font-size: 9px !important; /* Reduced from 10px */
    font-weight: 400 !important; /* Removed bold */
    color: #4b5563 !important; /* Grey color for below dates */
}

/* Stacked dates for short activities - centered */
.timeline-bar.stacked .timeline-bar-description {
    top: -2px !important; /* Keep same position immediately above bar */
    font-size: 12px !important; /* Same font size */
}

.timeline-bar.stacked .timeline-bar-start-date {
    top: 50% !important; /* Center vertically */
    transform: translateY(-50%) !important;
    font-size: 9px !important; /* Reduced from 10px */
    font-weight: 400 !important; /* Removed bold */
}

.timeline-bar.stacked .timeline-bar-end-date {
    top: 50% !important; /* Center vertically */
    transform: translateY(-50%) !important;
    font-size: 9px !important; /* Reduced from 10px */
    font-weight: 400 !important; /* Removed bold */
}

/* Single day activity - centered date */
.timeline-bar.single-day .timeline-bar-description {
    top: -2px !important; /* Keep same position immediately above bar */
    font-size: 12px !important; /* Same font size */
}

.timeline-bar-single-date {
    position: absolute !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    top: 50% !important; /* Center vertically inside the bar */
    font-size: 9px !important; /* Reduced from 10px */
    font-weight: 400 !important; /* Removed bold */
    color: white !important; /* White font color */
    white-space: nowrap !important;
    display: block !important;
    pointer-events: none !important;
    z-index: 5 !important;
}

/* Week separator lines */
.week-line {
    position: absolute;
    width: 1px;
    background: #d1d5db; /* Solid grey line */
    top: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 0; /* Behind activity bars */
    opacity: 0.4;
}

.month-end-line {
    position: absolute;
    width: 2px;
    background: #6b7280; /* Solid grey line from top to bottom */
    top: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 0; /* Behind activity bars (activity bars are z-index: 3) */
    opacity: 0.6;
}

.weekend-shade {
    position: absolute;
    background: rgba(200, 200, 200, 0.3); /* Light grey transparent overlay */
    top: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 0; /* Behind everything else */
}

/* Month separator lines (thicker) */
.month-line {
    position: absolute;
    width: 3px;
    background: linear-gradient(to bottom, transparent 0%, #3b82f6 10%, #3b82f6 90%, transparent 100%);
    top: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 2;
    opacity: 0.6;
    box-shadow: 0 0 4px rgba(59, 130, 246, 0.3);
}

.today-marker {
    position: absolute;
    width: 2px;
    background: linear-gradient(to bottom, transparent 0%, #ef4444 5%, #ef4444 95%, transparent 100%);
    top: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 2; /* Behind activity bars (z-index: 3) but above gridlines */
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.5);
}

.today-marker-label {
    position: absolute;
    top: -35px; /* Position above the workstreams, right below timeline headers */
    left: 50%;
    transform: translateX(-50%);
    background: #ef4444;
    color: white;
    font-size: 10px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 4px;
    white-space: nowrap;
    box-shadow: 0 2px 6px rgba(239, 68, 68, 0.4);
    z-index: 100;
    pointer-events: none;
}

.today-marker-label-bottom {
    position: absolute;
    transform: translateX(-50%);
    background: #ef4444;
    color: white;
    font-size: 10px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 4px;
    white-space: nowrap;
    box-shadow: 0 2px 6px rgba(239, 68, 68, 0.4);
    z-index: 100;
    pointer-events: none;
}

.timeline-bar:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.timeline-bar-name {
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.timeline-bar-dates {
    font-size: 9px;
    opacity: 0.9;
    margin-top: 1px;
}

.timeline-month {
    padding: 10px 5px;
    font-weight: 600;
    font-size: 12px;
    border-right: 1px solid #ddd;
    text-align: center;
    color: #333;
    background: #dbeafe;
}

.timeline-month-header {
    font-weight: 700;
    font-size: 11px;
    margin-bottom: 4px;
    border-bottom: 1px solid #ddd;
    padding-bottom: 4px;
}

.timeline-weeks {
    display: flex;
    font-size: 9px;
    color: #666;
    gap: 2px;
}

.timeline-week {
    flex: 1;
    text-align: center;
    padding: 2px 0;
}

.timeline-milestone {
    position: absolute;
    width: 24px;
    height: 80px;
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
}

.milestone-diamond {
    width: 20px;
    height: 20px;
    background: linear-gradient(135deg, #fb923c 0%, #f97316 100%);
    transform: rotate(45deg);
    box-shadow: 0 3px 8px rgba(249, 115, 22, 0.4);
    position: relative;
    border: 2px solid #fff;
}

.milestone-label {
    margin-top: 8px;
    font-size: 9px; /* Reduced from 10px */
    font-weight: 600;
    color: #000;
    white-space: nowrap; /* No wrapping */
    text-align: center;
    background: transparent;
    padding: 0;
    border-radius: 0;
}

.milestone-date {
    margin-top: 2px;
    font-size: 9px;
    font-weight: 400;
    color: #666;
    white-space: nowrap;
    background: transparent;
    padding: 0;
    border-radius: 0;
}

@media (max-width: 768px) {
    .form-row {
        grid-template-columns: 1fr;
    }

    .timeline-header {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }

    .timeline-controls {
        width: 100%;
        flex-direction: column;
    }

    .btn {
        width: 100%;
    }
}

/* Home page styles */
.home-section {
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    min-height: 400px;
}

.home-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 15px;
}

.home-header h2 {
    color: #333;
    margin: 0;
}

.roadmaps-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 20px;
}

.roadmap-card {
    background: #f7fafc;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s;
}

.roadmap-card:hover {
    border-color: #667eea;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
    transform: translateY(-2px);
}

.roadmap-info {
    flex: 1;
}

.roadmap-name {
    color: #333;
    font-size: 18px;
    font-weight: 700;
    margin: 0 0 8px 0;
}

.roadmap-meta {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.roadmap-count {
    color: #667eea;
    font-size: 13px;
    font-weight: 600;
}

.roadmap-date {
    color: #999;
    font-size: 12px;
}

.roadmap-actions {
    display: flex;
    gap: 8px;
    margin-left: 15px;
}

.btn-icon {
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    color: #666;
}

.btn-icon:hover {
    border-color: #667eea;
    color: #667eea;
    transform: scale(1.1);
}

.btn-icon.btn-danger:hover {
    border-color: #ef4444;
    color: #ef4444;
    background: #fef2f2;
}

/* Modal styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    max-width: 500px;
    width: 90%;
}

.modal-content h3 {
    color: #333;
    margin: 0 0 20px 0;
}

.modal-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    justify-content: flex-end;
}

.modal-actions .btn {
    min-width: 100px;
}

/* Roadmap page header */
.roadmap-page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.roadmap-title-container {
    display: flex;
    align-items: center;
    gap: 15px;
}

.current-roadmap-name {
    color: #667eea;
    font-size: 14px;
    font-weight: 600;
    background: #f0f4ff;
    padding: 8px 16px;
    border-radius: 6px;
}

.btn-back {
    background: #6b7280;
    color: white;
    display: flex;
    align-items: center;
    gap: 5px;
}

.btn-back:hover {
    background: #4b5563;
}

.btn-save-roadmap {
    background: #10b981;
    color: white;
}

.btn-save-roadmap:hover {
    background: #059669;
}

@media (max-width: 768px) {
    .roadmaps-list {
        grid-template-columns: 1fr;
    }

    .roadmap-card {
        flex-direction: column;
        align-items: flex-start;
    }

    .roadmap-actions {
        margin-left: 0;
        margin-top: 15px;
        width: 100%;
        justify-content: flex-end;
    }
}
