.table-wrap {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow-x: auto;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

table.gantt-matrix {
    width: 100%;
    table-layout: fixed !important;
    border-collapse: collapse;
    font-size: 13.5px;
}

table.gantt-matrix th, table.gantt-matrix td {
    border: 1px solid var(--border-color);
    padding: 6px 8px;
    box-sizing: border-box;
}

table.gantt-matrix th {
    background: #0f172a;
    color: var(--text-secondary);
    font-weight: 700;
    font-size: 13px;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Row Hover & Pointer */
.row-project {
    cursor: pointer;
    transition: background 0.15s ease;
}
.row-project:hover {
    background: rgba(56, 189, 248, 0.08) !important;
}

/* Category Badges */
.cat-design { background: #1e3a8a; color: #93c5fd; font-weight: 800; font-size: 14px; text-align: center; }
.cat-supervision { background: #065f46; color: #6ee7b7; font-weight: 800; font-size: 14px; text-align: center; }
.cat-planning { background: #581c87; color: #d8b4fe; font-weight: 800; font-size: 14px; text-align: center; }
.cat-holding { background: #78350f; color: #fde68a; font-weight: 800; font-size: 14px; text-align: center; }
.cat-closed { background: #374151; color: #9ca3af; font-weight: 800; font-size: 14px; text-align: center; }

/* Column Alignments */
.col-pj { font-weight: 800; color: #fff; font-size: 14px; overflow: hidden; text-overflow: ellipsis; cursor: pointer; }
.pj-name-link {
    color: #f1f5f9;
    text-decoration: none;
    transition: color 0.15s ease;
    display: inline-block;
}
.row-project:hover .pj-name-link {
    color: #38bdf8;
    text-decoration: underline;
}
.col-mgr { color: #38bdf8; font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.col-client { color: var(--text-secondary); font-size: 13px; overflow: hidden; text-overflow: ellipsis; }
.col-progress {
    color: #f8fafc;
    font-size: 13.5px;
    line-height: 1.5;
    word-break: keep-all;
}
.col-planned {
    color: #cbd5e1;
    font-size: 13.5px;
    line-height: 1.5;
    word-break: keep-all;
}
.col-notes { color: var(--text-secondary); font-size: 13px; text-align: left; line-height: 1.4; word-break: break-all; }

/* Unified Continuous Gantt Track */
.gantt-unified-container {
    position: relative !important;
    width: 100% !important;
    height: 30px;
    padding: 0 !important;
    vertical-align: middle !important;
    overflow: hidden !important;
    background: transparent !important;
}

.gantt-unified-container.multi-track {
    height: 52px !important;
}

/* 13개월 롤링 배경 그리드 */
.gantt-grid-col {
    position: absolute;
    top: 0;
    bottom: 0;
    border-right: 1px solid var(--border-color);
    box-sizing: border-box;
    pointer-events: none;
    z-index: 0;
}
.gantt-grid-col.cur-grid {
    background: rgba(234, 179, 8, 0.08);
    border-left: 1px solid rgba(234, 179, 8, 0.3);
    border-right: 1px solid rgba(234, 179, 8, 0.3);
}

/* 온전한 단일 연속 바 (1줄 또는 겹칠 때 2줄) */
.unified-gantt-bar {
    position: absolute;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    z-index: 2;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
    padding: 0 6px;
    transition: transform 0.1s ease;
}

.unified-bar-text {
    font-size: 11.5px;
    font-weight: 800;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    letter-spacing: -0.2px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
}

/* 색상 체계: 초록-설계, 빨강-인허가, 파랑-공사, 보라-기획, 회색-홀딩, 흰색-사후관리 */
.bar-green { background: #059669; color: #ecfdf5; border: 1px solid #10b981; }      /* 초록 - 설계 */
.bar-red { background: #dc2626; color: #fef2f2; border: 1px solid #ef4444; }        /* 빨강 - 인허가 */
.bar-blue { background: #2563eb; color: #eff6ff; border: 1px solid #3b82f6; }       /* 파랑 - 공사 */
.bar-purple { background: #7c3aed; color: #f5f3ff; border: 1px solid #8b5cf6; }     /* 보라 - 기획 */
.bar-gray { background: #475569; color: #f1f5f9; border: 1px solid #64748b; }       /* 회색 - 홀딩 */
.bar-white { background: #f8fafc; color: #0f172a; border: 1px solid #cbd5e1; }      /* 흰색 - 사후관리 */
.bar-cyan { background: #0891b2; color: #ecfeff; border: 1px solid #06b6d4; }

/* 📱 Mobile & Tablet Responsive for Gantt */
@media (max-width: 992px) {
    .dashboard-body div[style*="grid-template-columns: 1fr 1fr"] {
        grid-template-columns: 1fr !important;
        gap: 12px !important;
    }
}
@media (max-width: 768px) {
    table.gantt-matrix {
        font-size: 11.5px;
    }
    table.gantt-matrix th, table.gantt-matrix td {
        padding: 4px 6px;
    }
    .table-wrap {
        -webkit-overflow-scrolling: touch;
    }
}

