/* ===== TRACKER CONTAINER ===== */
.tracker-container {
    padding: 20px;
    height: 100vh;
    display: flex;
    flex-direction: column;
    background: #f5f5f5;
}

/* ===== HEADER ===== */
.tracker-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.tracker-header h1 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #001E46;
    margin: 0;
}

.tracker-actions {
    display: flex;
    gap: 8px;
}

/* ===== FILTERS ===== */
.tracker-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: flex-end;
    padding: 16px;
    background: white;
    border-radius: 8px;
    margin-bottom: 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.filter-group label {
    font-size: 0.75rem;
    font-weight: 600;
    color: #666;
    text-transform: uppercase;
}

.filter-group select,
.filter-group input {
    padding: 8px 12px;
    border: 1px solid #d4d4d4;
    border-radius: 4px;
    font-size: 0.875rem;
    min-width: 120px;
}

.filter-group.search input {
    min-width: 200px;
}

.filter-count {
    margin-left: auto;
    font-size: 0.875rem;
    color: #666;
}

/* ===== TABLE WRAPPER ===== */
.tracker-table-wrapper {
    flex: 1;
    overflow: auto;
    background: white;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    margin-bottom: 60px; /* Space for unsaved changes bar */
}

/* ===== TABLE ===== */
.tracker-table {
    width: max-content;
    min-width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.tracker-table th {
    background: #001E46;
    color: white;
    font-weight: 600;
    padding: 12px 8px;
    text-align: left;
    white-space: nowrap;
    position: sticky;
    top: 0;
    z-index: 10;
}

/* Sortable Headers */
.tracker-table th.sortable {
    cursor: pointer;
    user-select: none;
    transition: background 0.15s ease;
}

.tracker-table th.sortable:hover {
    background: #002855;
}

.tracker-table th.sortable.sorted {
    background: #003366;
}

.tracker-table th.sortable::after {
    content: '';
    display: inline-block;
    margin-left: 4px;
    opacity: 0.4;
}

.tracker-table td {
    padding: 6px 8px;
    border-bottom: 1px solid #e5e5e5;
    vertical-align: middle;
}

/* ===== FROZEN COLUMNS ===== */
.frozen {
    position: sticky;
    background: white;
    z-index: 5;
}

th.frozen {
    background: #001E46;
    z-index: 15;
}

.col-checkbox { left: 0; width: 40px; min-width: 40px; }
.col-expand { left: 40px; width: 30px; min-width: 30px; }
.col-id { left: 70px; width: 50px; min-width: 50px; }
.col-tool { left: 120px; width: 220px; min-width: 220px; max-width: 220px; overflow: hidden; text-overflow: ellipsis; }

.col-tool::after {
    content: '';
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    box-shadow: 4px 0 8px rgba(0,0,0,0.1);
}

/* ===== ROWS ===== */
.project-row:hover {
    background: #f8f9fa;
}

.project-row:hover .frozen {
    background: #f8f9fa;
}

.project-row.selected {
    background: #e3f2fd;
}

.project-row.selected .frozen {
    background: #e3f2fd;
}

.project-row.expanded {
    background: #f0f7ff;
}

.project-row.expanded .frozen {
    background: #f0f7ff;
}

/* ===== PHASES CONTAINER ROW ===== */
.phases-container-row {
    background: #f8fafc;
}

.phases-container-row .frozen {
    background: #f8fafc;
}

.phases-indent {
    border-right: 2px solid #e2e8f0;
}

.phases-cell {
    padding: 12px 16px !important;
}

/* ===== PHASES TIMELINE ===== */
.phases-timeline {
    display: flex;
    align-items: stretch;
    gap: 0;
    overflow-x: auto;
    padding: 4px 0;
}

.phase-connector {
    width: 24px;
    min-width: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.phase-connector::before {
    content: '';
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, #cbd5e1, #94a3b8);
}

/* ===== PHASE CARD ===== */
.phase-card {
    background: white;
    border-radius: 8px;
    padding: 10px 14px;
    min-width: 160px;
    max-width: 180px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    border: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    gap: 6px;
    transition: all 0.2s ease;
}

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

.phase-card-complete {
    border-color: #10b981;
    background: linear-gradient(135deg, #f0fdf4 0%, #ecfdf5 100%);
}

.phase-card-active {
    border-color: #3b82f6;
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.15);
}

.phase-card-pending {
    border-color: #e2e8f0;
    background: #f8fafc;
    opacity: 0.7;
}

/* ===== PHASE HEADER ===== */
.phase-header {
    display: flex;
    align-items: center;
    gap: 6px;
}

.phase-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.dot-complete {
    background: #10b981;
    box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.2);
}

.dot-active {
    background: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
    animation: pulse 2s infinite;
}

.dot-pending {
    background: #cbd5e1;
}

@keyframes pulse {
    0%, 100% { box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2); }
    50% { box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1); }
}

.phase-title {
    font-size: 0.75rem;
    font-weight: 600;
    color: #334155;
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.phase-progress-badge {
    font-size: 0.65rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 10px;
    white-space: nowrap;
}

.progress-badge-complete {
    background: #10b981;
    color: white;
}

.progress-badge-good {
    background: #3b82f6;
    color: white;
}

.progress-badge-started {
    background: #f59e0b;
    color: white;
}

.progress-badge-pending {
    background: #e2e8f0;
    color: #64748b;
}

/* ===== PHASE PROGRESS BAR ===== */
.phase-progress-bar {
    height: 4px;
    background: #e2e8f0;
    border-radius: 2px;
    overflow: hidden;
}

.phase-progress-fill {
    height: 100%;
    border-radius: 2px;
    transition: width 0.3s ease;
}

.fill-complete {
    background: linear-gradient(90deg, #10b981, #059669);
}

.fill-active {
    background: linear-gradient(90deg, #3b82f6, #2563eb);
}

.fill-pending {
    background: #cbd5e1;
}

/* ===== PHASE DATES ===== */
.phase-dates {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 2px;
}

.phase-date-input {
    font-size: 0.65rem;
    padding: 2px 4px;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    background: white;
    color: #475569;
    width: 90px;
}

.phase-date-input:focus {
    border-color: #3b82f6;
    outline: none;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
}

.phase-date-separator {
    color: #94a3b8;
    font-size: 0.7rem;
}

/* ===== PHASE COMMENT ===== */
.phase-comment {
    font-size: 0.65rem;
    color: #64748b;
    background: #f1f5f9;
    padding: 3px 6px;
    border-radius: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ===== PHASE ROWS V2 (Compact Table Format) ===== */
.phase-row-v2 {
    background: #fafbfc;
    font-size: 0.75rem;
    line-height: 1.2;
}

.phase-row-v2 td {
    padding: 4px 6px !important;
    border-bottom: 1px solid #eef1f4;
    height: 28px;
    vertical-align: middle;
}

.phase-row-v2 .frozen {
    background: #fafbfc;
}

.phase-row-v2.phase-complete {
    background: #f0fdf4;
}

.phase-row-v2.phase-complete .frozen {
    background: #f0fdf4;
}

.phase-row-v2.phase-in-progress {
    background: #eff6ff;
}

.phase-row-v2.phase-in-progress .frozen {
    background: #eff6ff;
}

.phase-row-v2.phase-pending {
    background: #f8fafc;
    opacity: 0.8;
}

.phase-row-v2.phase-pending .frozen {
    background: #f8fafc;
}

/* Phase ID column */
.phase-row-v2 .phase-id {
    color: #94a3b8;
    font-size: 0.7rem;
}

/* Phase Name Cell */
.phase-name-cell {
    padding-left: 12px !important;
}

.phase-name-content {
    display: flex;
    align-items: center;
    gap: 8px;
}

.phase-indent {
    color: #cbd5e1;
    font-family: monospace;
    font-size: 0.9rem;
}

.phase-status-indicator {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
}

.phase-status-indicator.dot-complete {
    background: #10b981;
}

.phase-status-indicator.dot-active {
    background: #3b82f6;
    animation: pulse-dot 1.5s ease-in-out infinite;
}

.phase-status-indicator.dot-pending {
    background: #cbd5e1;
}

@keyframes pulse-dot {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.2); opacity: 0.8; }
}

.phase-name-text {
    font-weight: 500;
    color: #334155;
    white-space: nowrap;
}

/* Phase Progress Cell */
.phase-progress-cell {
    min-width: 120px;
}

.phase-progress-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
}

.phase-progress-bar-v2 {
    flex: 1;
    height: 4px;
    background: #e2e8f0;
    border-radius: 2px;
    overflow: hidden;
    min-width: 50px;
}

.phase-progress-fill-v2 {
    height: 100%;
    border-radius: 3px;
    transition: width 0.3s ease;
}

.phase-progress-fill-v2.fill-complete {
    background: linear-gradient(90deg, #10b981, #059669);
}

.phase-progress-fill-v2.fill-active {
    background: linear-gradient(90deg, #3b82f6, #2563eb);
}

.phase-progress-fill-v2.fill-pending {
    background: #cbd5e1;
}

.phase-progress-text {
    font-size: 0.7rem;
    font-weight: 600;
    min-width: 32px;
    text-align: right;
}

.phase-progress-text.progress-badge-complete {
    color: #059669;
}

.phase-progress-text.progress-badge-good {
    color: #2563eb;
}

.phase-progress-text.progress-badge-started {
    color: #d97706;
}

.phase-progress-text.progress-badge-pending {
    color: #94a3b8;
}

/* Phase Status Badge */
.phase-status-cell {
    min-width: 90px;
}

.phase-status-badge {
    display: inline-block;
    padding: 1px 6px;
    border-radius: 3px;
    font-size: 0.6rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.phase-badge-complete {
    background: #d1fae5;
    color: #065f46;
}

.phase-badge-active {
    background: #dbeafe;
    color: #1e40af;
}

.phase-badge-pending {
    background: #f1f5f9;
    color: #64748b;
}

/* Phase Date Inputs */
.phase-date-cell {
    min-width: 100px;
}

.phase-date-input-v2 {
    width: 100%;
    padding: 2px 4px;
    border: 1px solid #e2e8f0;
    border-radius: 3px;
    font-size: 0.7rem;
    color: #475569;
    background: white;
    height: 22px;
}

.phase-date-input-v2:focus {
    border-color: #3b82f6;
    outline: none;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
}

/* Phase Comment Input */
.phase-comment-cell {
    min-width: 180px;
}

.phase-comment-input {
    width: 100%;
    padding: 2px 6px;
    border: 1px solid #e2e8f0;
    border-radius: 3px;
    font-size: 0.7rem;
    color: #475569;
    background: white;
    height: 22px;
}

.phase-comment-input::placeholder {
    color: #94a3b8;
    font-style: italic;
}

.phase-comment-input:focus {
    border-color: #3b82f6;
    outline: none;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
}

/* ===== LEGACY PHASE ROWS (keeping for compatibility) ===== */
.phase-row {
    background: #fafafa;
}

.phase-row .frozen {
    background: #fafafa;
}

.phase-row .phase-name {
    padding-left: 24px;
    color: #666;
    font-size: 0.8rem;
    white-space: nowrap;
}

.phase-row.phase-complete {
    background: #f0fff4;
}

.phase-row.phase-complete .frozen {
    background: #f0fff4;
}

.phase-row.phase-in-progress {
    background: #fff8e6;
}

.phase-row.phase-in-progress .frozen {
    background: #fff8e6;
}

.phase-row.phase-pending {
    background: #fafafa;
}

/* ===== EXPAND BUTTON ===== */
.expand-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.75rem;
    color: #666;
    padding: 4px;
    border-radius: 4px;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.expand-btn:hover {
    background: #e5e5e5;
}

/* ===== EDITABLE CELLS ===== */
.cell-editable input,
.cell-editable select,
.cell-editable textarea {
    width: 100%;
    padding: 4px 8px;
    border: 1px dashed #d4d4d4;
    border-radius: 4px;
    background: transparent;
    font-size: 0.8rem;
    font-family: inherit;
}

.cell-editable input:focus,
.cell-editable select:focus,
.cell-editable textarea:focus {
    border-color: #1010EB;
    border-style: solid;
    outline: 2px solid rgba(16, 16, 235, 0.2);
    background: white;
}

.cell-editable .dirty {
    background: #fffde7 !important;
    border-color: #ffc107 !important;
    border-style: solid !important;
}

.cell-editable textarea {
    resize: none;
    min-height: 28px;
}

.col-wide {
    min-width: 200px;
}

/* ===== BADGES ===== */
.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    white-space: nowrap;
}

/* Priority */
.badge-priority-high { background: #dc3545; color: white; }
.badge-priority-medium { background: #ffc107; color: black; }
.badge-priority-low { background: #28a745; color: white; }

/* Status */
.badge-status-in-progress { background: #cce5ff; color: #004085; }
.badge-status-complete { background: #d4edda; color: #155724; }
.badge-status-on-hold { background: #fff3cd; color: #856404; }
.badge-status-cancelled { background: #f8d7da; color: #721c24; }

/* Type */
.badge-type-replacement { background: #e2e3e5; color: #383d41; }
.badge-type-refurbishment { background: #d1ecf1; color: #0c5460; }
.badge-type-repair { background: #fff3cd; color: #856404; }
.badge-type-eol { background: #f8d7da; color: #721c24; }
.badge-type-duplication { background: #d4edda; color: #155724; }

/* Phase */
.badge-phase { background: #1010EB; color: white; }

/* FY */
.badge-fy { background: #FFCE00; color: black; font-weight: 700; }

/* ABC Codes */
.badge-abc-aplus { background: #7c3aed; color: white; font-weight: 700; }
.badge-abc-a { background: #10b981; color: white; }
.badge-abc-b { background: #3b82f6; color: white; }
.badge-abc-c { background: #94a3b8; color: white; }

/* CDP/SCC Code */
.cdp-code {
    font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
    font-size: 0.75rem;
    background: #f1f5f9;
    padding: 2px 6px;
    border-radius: 3px;
    color: #475569;
    white-space: nowrap;
}

/* Confidence - for select styling */
.select-confidence-high { background: #f8d7da; }
.select-confidence-medium { background: #fff3cd; }
.select-confidence-low { background: #d4edda; }
.select-confidence-no-chance { background: #e2e3e5; }
.select-confidence-na { background: #f8f9fa; }

/* ===== CHECKLIST STATUS (CDP/SCC, PPAP, GRR/TMV/MSA) ===== */
.select-checklist-not-ready { background: #e2e8f0; color: #475569; }
.select-checklist-development { background: #dbeafe; color: #1e40af; }
.select-checklist-wip { background: #fef3c7; color: #92400e; }
.select-checklist-approved { background: #d1fae5; color: #065f46; }
.select-checklist-drafted { background: #ede9fe; color: #5b21b6; }

/* ===== EXECUTION STATUS (Supplier OQ Pass) ===== */
.select-execution-not-started { background: #f1f5f9; color: #64748b; }
.select-execution-in-progress { background: #dbeafe; color: #1e40af; }
.select-execution-passed { background: #d1fae5; color: #065f46; }
.select-execution-failed { background: #fee2e2; color: #b91c1c; }
.select-execution-no-data { background: #fef3c7; color: #92400e; }

/* ===== DATE CHANGES BADGE ===== */
.badge-date-changes {
    background: #f59e0b;
    color: white;
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: 700;
}

/* ===== PART/ASSET CODES ===== */
.part-code {
    font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
    font-size: 0.7rem;
    background: #f1f5f9;
    padding: 2px 4px;
    border-radius: 3px;
    color: #475569;
    white-space: nowrap;
}

/* ===== CURRENCY FORMATTING ===== */
.cell-currency {
    text-align: right;
    font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
    font-size: 0.8rem;
    color: #059669;
    font-weight: 500;
}

/* ===== PROGRESS BAR ===== */
.progress-bar-container {
    display: flex;
    align-items: center;
    gap: 4px;
    width: 70px;
}

.progress-bar-container.small {
    width: 60px;
}

.progress-bar-fill {
    height: 6px;
    background: #e5e5e5;
    border-radius: 3px;
    flex: 1;
    position: relative;
    overflow: hidden;
}

.progress-bar-fill::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: inherit;
    background: #1010EB;
    border-radius: 3px;
}

.progress-bar-text {
    font-size: 0.7rem;
    color: #666;
    min-width: 28px;
    text-align: right;
}

/* Alternative progress bar implementation */
.progress-bar-container {
    display: flex;
    align-items: center;
    gap: 6px;
}

.progress-bar-container .progress-bar-fill {
    width: 40px;
    height: 6px;
    background: linear-gradient(to right, #1010EB var(--progress, 0%), #e5e5e5 var(--progress, 0%));
    border-radius: 3px;
}

/* ===== PHASE ICONS ===== */
.phase-icon {
    font-size: 0.9rem;
}

/* ===== TOAST ===== */
.toast-success {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #d4edda;
    color: #155724;
    padding: 12px 24px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 2000;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* ===== UNSAVED CHANGES BAR ===== */
.unsaved-changes-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    border-top: 3px solid #ffc107;
    padding: 12px 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: 0 -4px 12px rgba(0,0,0,0.15);
    z-index: 1000;
}

.unsaved-changes-bar .warning-icon {
    font-size: 1.25rem;
}

.unsaved-changes-bar .actions {
    margin-left: auto;
    display: flex;
    gap: 12px;
}

/* ===== BUTTONS ===== */
.btn {
    padding: 8px 16px;
    border-radius: 4px;
    font-weight: 500;
    cursor: pointer;
    border: none;
    font-size: 0.875rem;
    transition: background 0.2s;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary {
    background: #1010EB;
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background: #0d0dbd;
}

.btn-secondary {
    background: #e5e5e5;
    color: #333;
}

.btn-secondary:hover:not(:disabled) {
    background: #d4d4d4;
}

.btn-outline-secondary {
    background: transparent;
    border: 1px solid #d4d4d4;
    color: #333;
}

.btn-outline-secondary:hover:not(:disabled) {
    background: #f5f5f5;
}

.btn-outline-primary {
    background: transparent;
    border: 1px solid #1010EB;
    color: #1010EB;
}

.btn-outline-primary:hover:not(:disabled) {
    background: #f0f0ff;
}

/* ===== SCROLLBAR STYLING ===== */
.tracker-table-wrapper::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.tracker-table-wrapper::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.tracker-table-wrapper::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

.tracker-table-wrapper::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* ===== COMMENT INDICATOR ===== */
.comment-indicator-wrapper {
    position: relative;
    display: inline-flex;
}

.comment-indicator {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 6px;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    background: #f8fafc;
    cursor: pointer;
    transition: all 0.15s ease;
    font-size: 0.75rem;
    color: #64748b;
}

.comment-indicator:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
}

.comment-indicator.has-comments {
    background: #eff6ff;
    border-color: #bfdbfe;
    color: #3b82f6;
}

.comment-indicator.has-comments:hover {
    background: #dbeafe;
}

.comment-indicator.has-new {
    background: #fef3c7;
    border-color: #fcd34d;
    color: #d97706;
    animation: pulse-new 2s ease-in-out infinite;
}

@keyframes pulse-new {
    0%, 100% { box-shadow: 0 0 0 0 rgba(251, 191, 36, 0.4); }
    50% { box-shadow: 0 0 0 4px rgba(251, 191, 36, 0); }
}

.comment-icon {
    font-size: 0.85rem;
    line-height: 1;
}

.comment-count {
    font-weight: 600;
    font-size: 0.7rem;
}

.comment-new-badge {
    width: 6px;
    height: 6px;
    background: #ef4444;
    border-radius: 50%;
    position: absolute;
    top: -2px;
    right: -2px;
}

/* Size variations */
.comment-indicator.size-sm {
    padding: 2px 5px;
    font-size: 0.7rem;
}

.comment-indicator.size-md {
    padding: 4px 8px;
    font-size: 0.8rem;
}

.comment-indicator.size-lg {
    padding: 6px 10px;
    font-size: 0.9rem;
}

/* Comment Preview (on hover) */
.comment-preview {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #1e293b;
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.7rem;
    width: 220px;
    z-index: 100;
    margin-bottom: 6px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.comment-indicator-wrapper:hover .comment-preview {
    opacity: 1;
    visibility: visible;
}

.comment-preview::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: #1e293b;
}

.preview-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 4px;
    font-size: 0.65rem;
    opacity: 0.8;
}

.preview-author {
    font-weight: 600;
}

.preview-text {
    line-height: 1.4;
}

/* ===== COMMENTS MODAL ===== */
.comments-modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.comments-modal {
    background: white;
    border-radius: 12px;
    width: 90%;
    max-width: 520px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    animation: slideUp 0.25s ease;
}

@keyframes slideUp {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.comments-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #e5e7eb;
    background: linear-gradient(135deg, #001E46 0%, #002855 100%);
    border-radius: 12px 12px 0 0;
}

.header-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.modal-title {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: white;
    display: flex;
    align-items: center;
    gap: 8px;
}

.context-badge {
    font-size: 0.65rem;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 600;
    text-transform: uppercase;
}

.context-project {
    background: #dbeafe;
    color: #1e40af;
}

.context-phase {
    background: #d1fae5;
    color: #065f46;
}

.context-task {
    background: #fef3c7;
    color: #92400e;
}

.close-btn {
    background: transparent;
    border: none;
    color: rgba(255,255,255,0.8);
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.15s ease;
}

.close-btn:hover {
    background: rgba(255,255,255,0.1);
    color: white;
}

.comments-modal-subheader {
    padding: 10px 20px;
    background: #f8fafc;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    gap: 10px;
}

.item-name {
    font-weight: 600;
    color: #1e293b;
    font-size: 0.9rem;
}

.item-id {
    font-size: 0.75rem;
    padding: 2px 6px;
    background: #e2e8f0;
    border-radius: 4px;
    color: #475569;
}

.comments-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px 20px;
    max-height: 350px;
}

.no-comments {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    color: #94a3b8;
    text-align: center;
}

.no-comments i {
    font-size: 2.5rem;
    margin-bottom: 12px;
    opacity: 0.5;
}

.no-comments p {
    margin: 0;
    font-weight: 600;
    color: #64748b;
}

.no-comments span {
    font-size: 0.85rem;
    margin-top: 4px;
}

.comments-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.comment-item {
    display: flex;
    gap: 12px;
    padding: 12px;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    transition: all 0.15s ease;
}

.comment-item:hover {
    background: #f1f5f9;
}

.comment-item.is-new {
    background: #fffbeb;
    border-color: #fcd34d;
}

.comment-item.legacy {
    background: #f5f5f5;
    border-style: dashed;
}

.comment-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 700;
    color: white;
    flex-shrink: 0;
}

.comment-item.legacy .comment-avatar {
    background: #94a3b8;
}

.comment-content {
    flex: 1;
    min-width: 0;
}

.comment-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
    flex-wrap: wrap;
}

.comment-author {
    font-weight: 600;
    font-size: 0.85rem;
    color: #1e293b;
}

.comment-date {
    font-size: 0.75rem;
    color: #94a3b8;
}

.comment-type-badge {
    font-size: 0.6rem;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 600;
}

.comment-type-badge.status {
    background: #dbeafe;
    color: #1e40af;
}

.comment-type-badge.delay {
    background: #fee2e2;
    color: #b91c1c;
}

.comment-type-badge.escalation {
    background: #fef3c7;
    color: #92400e;
}

.comment-type-badge.resolution {
    background: #d1fae5;
    color: #065f46;
}

.new-badge {
    font-size: 0.6rem;
    padding: 1px 5px;
    background: #ef4444;
    color: white;
    border-radius: 3px;
    font-weight: 700;
}

.comment-text {
    font-size: 0.85rem;
    color: #374151;
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-word;
}

.comments-modal-footer {
    padding: 16px 20px;
    border-top: 1px solid #e5e7eb;
    background: #f8fafc;
    border-radius: 0 0 12px 12px;
}

.new-comment-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.comment-type-selector {
    display: flex;
    gap: 4px;
}

.type-btn {
    padding: 6px 10px;
    border: 1px solid #e2e8f0;
    background: white;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
    font-size: 0.85rem;
}

.type-btn:hover {
    background: #f1f5f9;
}

.type-btn.active {
    background: #001E46;
    color: white;
    border-color: #001E46;
}

.comment-input-wrapper {
    display: flex;
    gap: 8px;
}

.comment-input {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.875rem;
    resize: none;
    font-family: inherit;
    transition: border-color 0.15s ease;
}

.comment-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.send-btn {
    padding: 10px 16px;
    background: #001E46;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.send-btn:hover:not(:disabled) {
    background: #002855;
}

.send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ===== HORIZONTAL SCROLL INDICATORS ===== */
.tracker-table-wrapper {
    position: relative;
}

.tracker-table-wrapper.has-scroll-right::after {
    content: '';
    position: absolute;
    right: 0;
    top: 0;
    bottom: 8px;
    width: 40px;
    background: linear-gradient(to left, rgba(0,0,0,0.08), transparent);
    pointer-events: none;
    z-index: 20;
}

.tracker-table-wrapper.has-scroll-left::before {
    content: '';
    position: absolute;
    left: 340px; /* After frozen columns */
    top: 0;
    bottom: 8px;
    width: 20px;
    background: linear-gradient(to right, rgba(0,0,0,0.05), transparent);
    pointer-events: none;
    z-index: 20;
}

/* Scroll hint animation */
@keyframes scrollHint {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.6; }
}

.tracker-table-wrapper.has-scroll-right::after {
    animation: scrollHint 2s ease-in-out infinite;
}
