/* Project Enhancements Styles */

/* Project list data quality indicator */
.project-quality-head { width: 46px; }
.projects-table-container { overflow: visible; }
.project-quality-cell { width: 46px; text-align: center; position: relative; overflow: visible; }
.project-issue-indicator {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    font-weight: 700;
    font-size: 13px;
    border: 1px solid transparent;
    cursor: default;
    z-index: 50;
}
.project-issue-indicator[data-variant="error"] {
    color: #b91c1c;
    background: #fff0f0;
    border-color: #f8b4b4;
}
.project-issue-indicator[data-variant="warning"] {
    color: #92400e;
    background: #fff7e6;
    border-color: #f6c969;
}
.project-issue-indicator:focus-visible {
    outline: 2px solid var(--primary, #0aa);
    outline-offset: 2px;
}
.project-issue-tooltip {
    display: none;
    position: absolute;
    left: calc(100% + 10px);
    top: 50%;
    transform: translateY(-50%);
    background: #fffef8;
    color: #0f172a;
    padding: 10px 12px;
    border-radius: 10px;
    box-shadow: 0 16px 36px rgba(15, 23, 42, 0.18);
    border: 1px solid rgba(248, 180, 83, 0.35);
    white-space: normal;
    font-size: 12px;
    z-index: 9999;
    min-width: 200px;
    max-width: 320px;
}
.project-issue-tooltip::after {
    content: '';
    position: absolute;
    left: -8px;
    top: 50%;
    transform: translateY(-50%);
    border-top: 8px solid transparent;
    border-bottom: 8px solid transparent;
    border-right: 8px solid #fffef8;
}
.project-issue-indicator:hover .project-issue-tooltip,
.project-issue-indicator:focus .project-issue-tooltip,
.project-issue-indicator:focus-visible .project-issue-tooltip {
    display: block;
}
.project-issue-tooltip-item {
    display: flex;
    align-items: center;
    gap: 6px;
    line-height: 1.4;
}
.project-issue-tooltip-item::before {
    content: '•';
    color: #d97706;
    font-weight: 700;
}

/* Project overview stat tiles: denser layout on detail page */
.project-detail-content .project-stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.project-detail-content .project-stat-grid .stat-card {
    padding: 1rem;
    gap: 0.75rem;
}

.project-detail-content .project-stat-grid .stat-icon {
    width: 40px;
    height: 40px;
    font-size: 1rem;
    border-radius: 8px;
}

.project-detail-content .project-stat-grid .stat-value {
    font-size: 1.35rem;
    line-height: 1.15;
}

.project-detail-content .project-stat-grid .stat-label {
    font-size: 0.8rem;
}

@media (min-width: 1200px) {
    /* Ensure up to four tiles line up on wide screens */
    .project-detail-content .project-stat-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

/* Gantt Chart Styles */
.gantt-container {
    overflow-x: auto;
    overflow-y: visible;
    min-height: 400px;
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    transition: cursor 0.2s ease;
}

.gantt-container.gantt-pan-enabled {
    cursor: grab;
}

.gantt-container.is-panning {
    cursor: grabbing;
}

.gantt-timeline {
    min-width: 800px;
    background: white;
}

.gantt-timeline-header {
    display: grid;
    grid-template-columns: 300px 1fr;
    background: #f8f9fa;
    border-bottom: 2px solid #dee2e6;
    position: sticky;
    top: 0;
    z-index: 10;
}

.gantt-project-name {
    padding: 1rem;
    font-weight: 600;
    border-right: 1px solid #dee2e6;
}

.gantt-timeline-months {
    display: flex;
}

.gantt-month {
    flex: 1;
    padding: 1rem;
    text-align: center;
    border-right: 1px solid #dee2e6;
    font-weight: 500;
    color: #495057;
}

.gantt-row {
    display: grid;
    grid-template-columns: 300px 1fr;
    border-bottom: 1px solid #e9ecef;
    min-height: 60px;
}

.gantt-project-info {
    padding: 1rem;
    border-right: 1px solid #dee2e6;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.gantt-project-title {
    display: flex;
    flex-direction: column;
    margin-bottom: 0.5rem;
}

.gantt-project-title .project-number {
    font-size: 0.75rem;
    color: #6c757d;
    font-weight: 500;
}

.gantt-project-title .project-name {
    font-weight: 600;
    color: #212529;
}

.gantt-project-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.gantt-timeline-row {
    position: relative;
    padding: 1rem 0;
}

.gantt-timeline-row.has-task-lanes {
    padding-bottom: 3.25rem;
}

/* Alternate row shading for readability */
.gantt-body .gantt-row:nth-child(even) {
    background: #fbfcfe;
}

.gantt-baseline {
    position: absolute;
    height: 10px;
    top: 50%;
    transform: translateY(-50%);
    border-radius: 6px;
    background: repeating-linear-gradient(90deg, rgba(0,0,0,0.15), rgba(0,0,0,0.15) 6px, rgba(0,0,0,0.05) 6px, rgba(0,0,0,0.05) 12px);
}

.gantt-bar {
    position: absolute;
    height: 24px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    top: 50%;
    transform: translateY(-50%);
}

.gantt-bar:hover {
    transform: translateY(-50%) scale(1.05);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.gantt-bar-handle {
    position: absolute;
    top: 0;
    width: 8px;
    height: 100%;
    cursor: ew-resize;
}
.gantt-bar-handle[data-role="left"] { left: -6px; }
.gantt-bar-handle[data-role="right"] { right: -6px; }

.gantt-bar-planning {
    background: linear-gradient(45deg, #6c757d, #495057);
}

.gantt-bar-active {
    background: linear-gradient(45deg, #00B2CC, #007ba3);
}

.gantt-bar-completed {
    background: linear-gradient(45deg, #28a745, #1e7e34);
}

.gantt-bar-on-hold {
    background: linear-gradient(45deg, #ffc107, #e0a800);
}

.gantt-bar-progress {
    height: 100%;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 12px;
    transition: width 0.3s ease;
}

.gantt-bar-label {
    position: absolute;
    top: 50%;
    left: 8px;
    transform: translateY(-50%);
    color: white;
    font-size: 0.75rem;
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    right: 8px; /* allow ellipsis within bar */
}

.gantt-milestone {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    z-index: 5;
}

.gantt-milestone-marker {
    font-size: 1.25rem;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.gantt-milestone-marker:hover {
    transform: scale(1.2);
}

.gantt-milestone-marker.completed {
    filter: hue-rotate(120deg);
}

.gantt-dependency {
    position: absolute;
    height: 2px;
    background: #9aa1a9;
    top: calc(50% + 14px);
}

/* Simple hover tooltip for milestones */
.gantt-tooltip {
    position: absolute;
    left: 50%;
    top: -22px;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.75);
    color: #fff;
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 4px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity .15s ease;
}
.gantt-milestone:hover .gantt-tooltip { opacity: 1; }

/* Legend tweaks */
.gantt-legend .gantt-legend-toggle[aria-expanded="true"]::before {
    content: '▾ ';
}
.gantt-legend .gantt-legend-toggle[aria-expanded="false"]::before {
    content: '▸ ';
}

/* Improve spacing for toggles and milestone checkboxes in the Gantt legend */
.gantt-legend {
    display: flex;
    flex-wrap: wrap;
    gap: .75rem;
    align-items: center;
}

.gantt-legend label.checkbox,
.gantt-legend .checkbox-label {
    display: inline-flex;
    align-items: center;
    gap: .5rem; /* space between the checkbox and its text */
    margin: 0 .75rem .5rem 0; /* space between sibling toggles and rows */
    flex: 0 0 auto; /* prevent shrinking that can cause overlap */
    white-space: nowrap; /* keep each toggle on a single line */
}

.gantt-legend label.checkbox input[type="checkbox"],
.gantt-legend .checkbox-label input[type="checkbox"] {
    margin: 0; /* reset browser default */
    flex: 0 0 auto;
}

/* Defensive resets so checkboxes never inherit odd component styles */
.gantt-legend .checkbox-label input[type="checkbox"] {
    appearance: checkbox;
    -webkit-appearance: checkbox;
    width: 16px;
    height: 16px;
    position: static;
    opacity: 1;
}

/* Ensure the legend body never spills into the timeline */
.gantt-legend-body {
    display: flex;
    flex-wrap: wrap;
    gap: .75rem;
    align-items: center;
    max-width: 100%;
}

/* Today marker line */
.gantt-today-line {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #e55353; /* subtle red */
    opacity: 0.8;
    pointer-events: none;
}

/* Phase bars within a project row */
.gantt-phase-bar {
    position: absolute;
    height: 6px;
    background: #8884d8;
    border-radius: 4px;
    top: calc(50% + 18px);
}

.gantt-task-chip {
    position: absolute;
    min-height: 18px;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 11px;
    line-height: 1.2;
    background: var(--primary-cyan, #00b2cc);
    color: #fff;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.18);
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: transform 0.15s ease;
}

.gantt-task-chip:hover {
    transform: translateY(-1px);
}

.gantt-task-chip[data-status="done"] {
    background: #16a34a;
}

.gantt-task-chip[data-status="in-progress"] {
    background: #f59e0b;
}

.gantt-task-chip[data-status="on-hold"] {
    background: #d97706;
}

.gantt-task-chip[data-status="todo"] {
    background: #0ea5e9;
}

.gantt-task-chip[data-status="backlog"] {
    background: #6b7280;
}

.gantt-task-chip-label {
    overflow: hidden;
    text-overflow: ellipsis;
}

.gantt-task-chip--phase {
    background: var(--primary-indigo, #6366f1);
}

/* Resource Allocation Styles */
.resource-overview {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Kanban (Planner) Enhancements */
.kanban-col,
.kanban-column {
    position: relative;
    background: linear-gradient(180deg, rgba(255,255,255,0.95), #ffffff);
    border: 1px solid rgba(148, 163, 184, 0.26);
    border-radius: 18px;
    padding: 1rem;
    box-shadow: 0 28px 50px rgba(15, 23, 42, 0.08);
    overflow: hidden;
}

.kanban-column::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 6px;
    border-radius: 16px 16px 0 0;
    background: linear-gradient(90deg, var(--primary-cyan), #7ce7d3);
    opacity: 0.9;
}

.kanban-column[data-planner-col="backlog"] {
    background: linear-gradient(180deg, rgba(248,249,252,0.95), #ffffff);
}
.kanban-column[data-planner-col="backlog"]::before { background: linear-gradient(90deg, #9aa1a9, #c8ccd4); }
.kanban-column[data-planner-col="todo"] {
    background: linear-gradient(180deg, rgba(0,178,204,0.08), #ffffff);
}
.kanban-column[data-planner-col="todo"]::before { background: linear-gradient(90deg, #00b2cc, #5de0dd); }
.kanban-column[data-planner-col="in-progress"] {
    background: linear-gradient(180deg, rgba(245,158,11,0.08), #ffffff);
}
.kanban-column[data-planner-col="in-progress"]::before { background: linear-gradient(90deg, #f97316, #facc15); }
.kanban-column[data-planner-col="on-hold"] {
    background: linear-gradient(180deg, rgba(234,179,8,0.08), #ffffff);
}
.kanban-column[data-planner-col="on-hold"]::before { background: linear-gradient(90deg, #eab308, #fde047); }
.kanban-column[data-planner-col="done"] {
    background: linear-gradient(180deg, rgba(16,185,129,0.08), #ffffff);
}
.kanban-column[data-planner-col="done"]::before { background: linear-gradient(90deg, #059669, #34d399); }

/* Column header */
.kanban-header {
    position: sticky;
    top: 0;
    z-index: 1;
    background: rgba(255,255,255,0.92);
    backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.35rem 0.25rem 0.6rem 0.25rem;
    border-bottom: 1px solid var(--border-color);
}

.kanban-title { font-weight: 600; }
.kanban-actions { display: flex; align-items: center; gap: 6px; }
.kanban-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 26px;
    height: 24px;
    padding: 0 8px;
    font-weight: 600;
    font-size: 0.75rem;
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 999px;
    color: var(--text-gray);
}

.kanban-dropzone {
    min-height: 80px;
    padding-top: 0.35rem;
    padding-right: 0.1rem;
    max-height: 70vh;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: rgba(148, 163, 184, 0.45) transparent;
}
.kanban-dropzone::-webkit-scrollbar {
    width: 6px;
}
.kanban-dropzone::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.45);
    border-radius: 999px;
}

.kanban-dropzone.is-dragover {
    outline: 2px dashed var(--primary-cyan);
    outline-offset: -4px;
    background: rgba(0, 178, 204, 0.06);
}

.kanban-card {
    background: linear-gradient(180deg, #ffffff 0%, #fdfdfd 80%);
    border: 1px solid rgba(148, 163, 184, 0.3);
    border-left: 4px solid var(--primary-cyan);
    border-radius: 14px;
    padding: 0.65rem 0.75rem;
    margin-bottom: 0.75rem;
    box-shadow: 0 20px 35px rgba(15, 23, 42, 0.12);
    cursor: grab;
    transition: box-shadow 0.15s ease, transform 0.15s ease;
    position: relative;
}

.kanban-card:hover {
    box-shadow: 0 25px 45px rgba(15, 23, 42, 0.18);
    transform: translateY(-2px);
}

/* Flash highlight when restored */
.kanban-card.flash-highlight {
    animation: flashHighlight 1.6s ease-out 1;
}
@keyframes flashHighlight {
    0% { box-shadow: 0 0 0 3px rgba(0,178,204,0.35); background: rgba(0,178,204,0.08); }
    40% { box-shadow: 0 0 0 0 rgba(0,178,204,0.0); background: #fff; }
    100% { box-shadow: var(--shadow-sm); background: #fff; }
}

.kanban-card-title {
    font-weight: 600;
    line-height: 1.25;
    cursor: pointer;
    font-size: 0.97rem;
    color: #0f172a;
}
.kanban-card-title:hover { color: var(--primary-cyan); text-decoration: underline; }

/* Accent by column */
.kanban-card[data-col="backlog"] { border-left-color: #9aa1a9; }
.kanban-card[data-col="todo"] { border-left-color: var(--primary-cyan); }
.kanban-card[data-col="in-progress"] { border-left-color: #f59e0b; }
.kanban-card[data-col="on-hold"] { border-left-color: #eab308; }
.kanban-card[data-col="done"] { border-left-color: #10b981; }

/* Label chips (fallback styles; color comes inline) */
.kanban-card .labels, .kanban-card [style*="flex-wrap:wrap"] {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 4px;
}
.label-chip {
    color: #000;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 0.75rem;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 1px solid rgba(0,0,0,0.06);
}
.label-chip .label-remove {
    background: transparent;
    border: none;
    color: #333;
    cursor: pointer;
}

/* Card meta */
.kanban-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px dashed rgba(148, 163, 184, 0.4);
}
.kanban-meta .meta-left {
    display: flex;
    align-items: center;
    gap: 4px;
}
.kanban-meta .meta-right {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}
.pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #f1f5f9;
    color: #475569;
    border: none;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
}
.pill + .pill { margin-left: 4px; }
.pill-icon { font-size: 0.85rem; line-height: 1; }
.time-pill {
    background: rgba(0, 178, 204, 0.15);
    color: #036672;
}
.comment-pill {
    background: rgba(59, 130, 246, 0.15);
    color: #1d4ed8;
}
.due-pill.due-overdue {
    background: #fee2e2;
    color: #b91c1c;
}
.due-pill.due-soon {
    background: #fef3c7;
    color: #92400e;
}
.due-pill.due-far {
    background: #e0f2fe;
    color: #075985;
}

/* Chips row for status/phase */
.chips { display:flex; gap:6px; flex-wrap:wrap; margin-top: 4px; }
.chip {
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 0.7rem;
    line-height: 1.2;
    border: 1px solid var(--border-color);
    color: var(--text-gray);
    background: #fff;
}
.chip-status.status-backlog { background: #eef2f7; color: #334155; border-color: transparent; }
.chip-status.status-todo { background: rgba(0, 178, 204, 0.12); color: var(--primary-cyan); border-color: transparent; }
.chip-status.status-in-progress { background: rgba(245, 158, 11, 0.12); color: var(--warning); border-color: transparent; }
.chip-status.status-on-hold { background: rgba(234, 179, 8, 0.15); color: #a16207; border-color: transparent; }
.chip-status.status-done { background: rgba(16, 185, 129, 0.12); color: var(--success); border-color: transparent; }
.chip-phase { background: var(--primary-silver); color: var(--text-gray); }

.avatar-extra { font-size: 0.75rem; color: var(--text-gray); }

/* Optional grid wrapper if present */
.kanban-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(240px, 1fr));
    gap: 1.5rem;
    align-items: start;
}

@media (max-width: 1200px) {
    .kanban-grid { grid-template-columns: repeat(3, minmax(240px, 1fr)); }
}
@media (max-width: 900px) {
    .kanban-grid { grid-template-columns: repeat(2, minmax(240px, 1fr)); }
}
@media (max-width: 640px) {
    .kanban-grid { grid-template-columns: 1fr; }
}

.kanban-scroll {
    overflow-x: auto;
    padding: 0.5rem 0.25rem 0.75rem 0.25rem;
    -webkit-overflow-scrolling: touch;
    background: linear-gradient(120deg, rgba(248,249,255,0.9), rgba(255,255,255,0.95));
    border-radius: 16px;
}

.kanban-scroll .kanban-grid {
    grid-template-columns: repeat(5, minmax(240px, 1fr));
    min-width: 1200px;
    padding-bottom: 0.5rem;
}

.resource-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
}

.resource-stat-card {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 8px;
    text-align: center;
}

.resource-stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #00B2CC;
}

.resource-stat-label {
    font-size: 0.875rem;
    color: #6c757d;
    margin-top: 0.25rem;
}

.resource-allocation-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}

.resource-card {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    overflow: hidden;
}

.resource-header {
    display: flex;
    align-items: center;
    padding: 1rem;
    background: #f8f9fa;
}

.resource-avatar {
    width: 40px;
    height: 40px;
    background: #00B2CC;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    margin-right: 1rem;
}

.resource-info {
    flex: 1;
}

.resource-name {
    font-weight: 600;
    color: #212529;
}

.resource-role {
    font-size: 0.875rem;
    color: #6c757d;
}

.resource-utilization {
    font-weight: 700;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.875rem;
}

.resource-utilization.normal {
    background: #d4edda;
    color: #155724;
}

.resource-utilization.high {
    background: #fff3cd;
    color: #856404;
}

.resource-utilization.overallocated {
    background: #f8d7da;
    color: #721c24;
}

.resource-projects {
    padding: 1rem;
}

.resource-projects-header {
    font-weight: 600;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
}

.resource-project {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.25rem 0;
}

.resource-project-name {
    font-size: 0.875rem;
    color: #495057;
}

.resource-project-allocation {
    font-size: 0.875rem;
    font-weight: 600;
    color: #00B2CC;
}

/* Template Styles */
.templates-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
}

.template-card {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.template-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.template-header {
    padding: 1.5rem 1rem 1rem;
    text-align: center;
}

.template-icon {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.template-title {
    font-size: 1.125rem;
    font-weight: 600;
    margin: 0.5rem 0;
    color: #212529;
}

.template-description {
    color: #6c757d;
    font-size: 0.875rem;
    margin: 0;
}

.template-details {
    padding: 1rem;
    border-top: 1px solid #e9ecef;
}

.template-meta {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: 1rem;
}

.template-stat {
    text-align: center;
}

.template-stat .label {
    display: block;
    font-size: 0.75rem;
    color: #6c757d;
    margin-bottom: 0.25rem;
}

.template-stat .value {
    font-weight: 600;
    color: #212529;
    font-size: 0.875rem;
}

.template-phases {
    margin-top: 1rem;
}

.template-phases-label {
    font-size: 0.75rem;
    color: #6c757d;
    margin-bottom: 0.5rem;
}

.template-phases-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
}

.template-phase-tag {
    background: #e9ecef;
    color: #495057;
    padding: 0.125rem 0.5rem;
    border-radius: 12px;
    font-size: 0.75rem;
}

.template-phase-more {
    color: #6c757d;
    font-size: 0.75rem;
    font-style: italic;
}

.template-actions {
    padding: 1rem;
    border-top: 1px solid #e9ecef;
    display: flex;
    gap: 0.5rem;
    justify-content: center;
}

/* Milestone Styles */
.milestones-timeline {
    position: relative;
}

.milestone-item {
    display: flex;
    position: relative;
    margin-bottom: 1.5rem;
    padding-left: 4rem;
}

.milestone-item:not(:last-child)::before {
    content: '';
    position: absolute;
    left: 1.5rem;
    top: 3rem;
    bottom: -1.5rem;
    width: 2px;
    background: #dee2e6;
}

.milestone-marker {
    position: absolute;
    left: 0;
    top: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 3rem;
}

.milestone-number {
    background: #e9ecef;
    color: #495057;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.milestone-status {
    font-size: 1.25rem;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid;
}

.milestone-item.completed .milestone-status {
    background: #28a745;
    color: white;
    border-color: #28a745;
}

.milestone-item.overdue .milestone-status {
    background: #dc3545;
    color: white;
    border-color: #dc3545;
}

.milestone-item.upcoming .milestone-status {
    background: white;
    color: #6c757d;
    border-color: #dee2e6;
}

.milestone-content {
    flex: 1;
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 1rem;
}

.milestone-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.milestone-title {
    margin: 0;
    color: #212529;
    font-size: 1rem;
}

.milestone-date {
    color: #6c757d;
    font-size: 0.875rem;
    font-weight: 500;
}

.milestone-actions {
    display: flex;
    gap: 0.25rem;
}

.milestone-description {
    margin: 0.5rem 0;
    color: #495057;
    font-size: 0.875rem;
}

.milestone-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 0.5rem;
}

.milestone-type {
    font-size: 0.75rem;
}

.milestone-priority {
    font-size: 0.75rem;
    font-weight: 600;
}

.priority-high {
    color: #dc3545;
}

.priority-medium {
    color: #ffc107;
}

.priority-low {
    color: #28a745;
}

.milestone-assignee {
    font-size: 0.75rem;
    color: #6c757d;
}

.milestone-deliverables {
    margin-top: 1rem;
    font-size: 0.875rem;
}

.milestone-deliverables ul {
    margin: 0.5rem 0 0 1rem;
    padding: 0;
}

.milestone-deliverables li.completed {
    text-decoration: line-through;
    color: #6c757d;
}

/* Document Styles */
.documents-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
}

.document-stat {
    text-align: center;
}

.document-stat .stat-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: #00B2CC;
    display: block;
}

.document-stat .stat-label {
    font-size: 0.875rem;
    color: #6c757d;
    margin-top: 0.25rem;
}

.documents-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}

.document-card {
    display: flex;
    align-items: center;
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 1rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.document-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.document-icon {
    font-size: 2rem;
    margin-right: 1rem;
}

.document-info {
    flex: 1;
    min-width: 0;
}

.document-name {
    font-weight: 600;
    color: #212529;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 0.25rem;
}

.document-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.25rem;
}

.document-size, .document-date {
    font-size: 0.75rem;
    color: #6c757d;
}

.document-category {
    margin-top: 0.25rem;
}

.document-actions {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    margin-left: 1rem;
}

/* Empty State Styles */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
}

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

.empty-state-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: #495057;
    margin-bottom: 0.5rem;
}

.empty-state-description {
    color: #6c757d;
    margin-bottom: 1.5rem;
}

/* Button Group Styles */
.btn-group {
    display: flex;
    border-radius: 4px;
    overflow: hidden;
}

.btn-group .btn {
    border-radius: 0;
    border-right: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-group .btn:first-child {
    border-top-left-radius: 4px;
    border-bottom-left-radius: 4px;
}

.btn-group .btn:last-child {
    border-top-right-radius: 4px;
    border-bottom-right-radius: 4px;
    border-right: none;
}

/* Phase Workflow Styles */
.phases-workflow {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.workflow-header {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 8px;
}

.workflow-progress-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow-x: auto;
    padding: 1rem 0;
}

.workflow-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    flex: 1;
    min-width: 120px;
}

.workflow-step-marker {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 0.5rem;
}

.workflow-step-number {
    background: #e9ecef;
    color: #495057;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.workflow-step-status {
    width: 32px;
    height: 32px;
    border: 3px solid #dee2e6;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    font-size: 1rem;
    font-weight: 600;
}

.workflow-step.active .workflow-step-status {
    border-color: #00B2CC;
    background: #00B2CC;
    color: white;
}

.workflow-step.completed .workflow-step-status {
    border-color: #28a745;
    background: #28a745;
    color: white;
}

.workflow-step-content {
    text-align: center;
}

.workflow-step-title {
    font-weight: 600;
    color: #212529;
    font-size: 0.875rem;
    margin-bottom: 0.25rem;
}

.workflow-step-meta {
    font-size: 0.75rem;
    color: #6c757d;
}

.workflow-connector {
    position: absolute;
    top: 46px;
    left: 50%;
    width: 100%;
    height: 3px;
    background: #dee2e6;
    z-index: -1;
}

.workflow-step.completed + .workflow-step .workflow-connector {
    background: #28a745;
}

.phases-details {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.phase-card {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 1.5rem;
    position: relative;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.phase-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.phase-card.completed {
    border-left: 4px solid #28a745;
    background: linear-gradient(90deg, #f8fff8 0%, white 20%);
}

.phase-card.in-progress {
    border-left: 4px solid #00B2CC;
    background: linear-gradient(90deg, #f0fdff 0%, white 20%);
}

.phase-card.not-started {
    border-left: 4px solid #6c757d;
}

.phase-header {
    display: flex;
    justify-content: between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.phase-info {
    flex: 1;
}

.phase-title {
    margin: 0 0 0.5rem 0;
    color: #212529;
    font-size: 1.125rem;
    font-weight: 600;
}

.phase-description {
    margin: 0;
    color: #6c757d;
    font-size: 0.875rem;
    line-height: 1.4;
}

.phase-status {
    margin-left: 1rem;
}

.phase-metrics {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 1rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 6px;
}

.phase-metric {
    text-align: center;
}

.metric-label {
    font-size: 0.75rem;
    color: #6c757d;
    margin-bottom: 0.25rem;
    font-weight: 500;
}

.metric-value {
    font-size: 1rem;
    font-weight: 600;
    color: #212529;
}

.metric-value.over-budget {
    color: #dc3545;
}

.phase-progress {
    margin-bottom: 1rem;
}

.phase-progress .progress {
    height: 8px;
    background: #e9ecef;
    border-radius: 4px;
    overflow: hidden;
}

.phase-progress .progress-bar {
    background: linear-gradient(45deg, #00B2CC, #007ba3);
    height: 100%;
    transition: width 0.3s ease;
}

.phase-tasks {
    margin-bottom: 1rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 6px;
}

.phase-tasks-header {
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: #495057;
    font-size: 0.875rem;
}

.phase-tasks-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.phase-task {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
}

.phase-task.completed .task-name {
    text-decoration: line-through;
    color: #6c757d;
}

.task-status {
    color: #28a745;
}

.phase-tasks-more {
    font-size: 0.75rem;
    color: #6c757d;
    font-style: italic;
    margin-top: 0.25rem;
}

.phase-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #e9ecef;
}

.phase-actions-left {
    display: flex;
    gap: 0.5rem;
}

.phase-actions-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.phase-completed {
    color: #28a745;
    font-weight: 600;
    font-size: 0.875rem;
}

.phase-blocked {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(248, 249, 250, 0.95);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.phase-blocked-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.phase-blocked-text {
    color: #6c757d;
    font-weight: 500;
}

/* Budget Tracking Enhancement */
.budget-overview-enhanced {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.budget-metric-card {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 1rem;
    text-align: center;
}

.budget-metric-value {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.budget-metric-value.positive {
    color: #28a745;
}

.budget-timeline-card .timeline-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}
.budget-timeline-card .timeline-summary .stat-label {
    font-size: 12px;
    color: #6c757d;
}
.budget-timeline-card .timeline-summary .stat-value {
    font-weight: 600;
    font-size: 1.05rem;
    font-family: inherit;
    line-height: 1.2;
}
.budget-timeline-card .timeline-rows {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.budget-timeline-card .timeline-chart {
    width: 100%;
    overflow-x: auto;
}
.budget-timeline-card .timeline-chart svg {
    width: 100%;
    height: auto;
}
.budget-timeline-card .timeline-grid-line {
    stroke: var(--border-color);
    stroke-width: 1;
    opacity: 0.6;
    shape-rendering: crispEdges;
    pointer-events: none;
}
.budget-timeline-card .timeline-point {
    fill: #0ea5e9;
    stroke: #0ea5e9;
    cursor: pointer;
}
.budget-timeline-card .timeline-point:hover {
    fill: #0284c7;
}
.budget-timeline-card .timeline-row {
    display: grid;
    grid-template-columns: 100px 1fr 180px;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: #fff;
}
.budget-timeline-card .timeline-day {
    font-weight: 600;
    color: var(--text-gray);
}
.budget-timeline-card .timeline-range {
    width: 100%;
    accent-color: var(--primary);
}
.budget-timeline-card .timeline-range:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}
.budget-timeline-card .timeline-value {
    font-size: 0.9rem;
    text-align: right;
}
@media (max-width: 900px) {
    .budget-timeline-card .timeline-row {
        grid-template-columns: 90px 1fr;
    }
    .budget-timeline-card .timeline-value {
        text-align: left;
        grid-column: span 2;
    }
}

.budget-metric-value.negative {
    color: #dc3545;
}

.budget-metric-value.warning {
    color: #ffc107;
}

.budget-metric-label {
    font-size: 0.875rem;
    color: #6c757d;
    font-weight: 500;
}

.budget-progress-indicator {
    margin-top: 0.5rem;
}

.budget-progress-bar {
    height: 6px;
    background: #e9ecef;
    border-radius: 3px;
    overflow: hidden;
}

.budget-progress-fill {
    height: 100%;
    background: #00B2CC;
    transition: width 0.3s ease;
}

.budget-progress-fill.over-budget {
    background: #dc3545;
}

/* Utility Classes */
.btn-xs {
    padding: 0.125rem 0.25rem;
    font-size: 0.75rem;
    border-radius: 3px;
}

.gantt-baseline {
    position: absolute;
    height: 4px;
    top: -6px;
    background: repeating-linear-gradient(90deg, #64748b, #64748b 6px, transparent 6px, transparent 12px);
    border-radius: 3px;
    opacity: 0.8;
    pointer-events: none;
}

.gantt-bar-critical {
    outline: 2px solid #ef4444;
    box-shadow: 0 0 6px rgba(239,68,68,0.6);
}

.gantt-dep-connector {
    position: absolute;
    height: 2px;
    background: #64748b;
    opacity: 0.9;
    pointer-events: none;
}

.gantt-dep-connector .gantt-dep-arrow {
    position: absolute;
    right: -6px;
    top: -4px;
    width: 0;
    height: 0;
    border-top: 5px solid transparent;
    border-bottom: 5px solid transparent;
    border-left: 6px solid #64748b;
}

.gantt-dep-connector.critical {
    background: #ef4444;
}
.gantt-dep-connector.critical .gantt-dep-arrow {
    border-left-color: #ef4444;
}

.gantt-variance-pill {
    background: rgba(239,68,68,0.15);
    color: #b91c1c;
    border: 1px solid rgba(239,68,68,0.4);
    border-radius: 999px;
    padding: 1px 6px;
    font-size: 11px;
    line-height: 1.3;
}

/* Responsive Design */
@media (max-width: 768px) {
    .gantt-timeline-header,
    .gantt-row {
        grid-template-columns: 200px 1fr;
    }
    
    .gantt-project-name {
        padding: 0.75rem;
    }
    
    .templates-grid,
    .documents-grid {
        grid-template-columns: 1fr;
    }
    
    .resource-allocation-grid {
        grid-template-columns: 1fr;
    }
    
    .milestone-item {
        padding-left: 3rem;
    }
    
    .milestone-marker {
        width: 2.5rem;
    }
}
