/* Pilot Checklist Styles - v106 */

/* Hide merchant selected info display for pilot checklist search */
#merchantSearchContainer #merchantSearch_selectedInfo {
    display: none !important;
}

/* Match search button height to merchant input field */
#submitMerchantBtn,
#loadChecklistBtn,
#clearAllBtn {
    height: calc(1.5em + 0.5rem + 2px);
    line-height: 1.5;
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    justify-content: center;
    
}

/* Ensure merchant search input can display full merchant names - Fixed 340px width */
/* Constrain the flex-grow-1 parent div */
#merchantSelectionCard .flex-grow-1 {
    max-width: 340px;
    flex-grow: 0;
    flex-shrink: 0;
    flex-basis: 340px;
}

/* Set merchantSearchContainer to fixed width */
#merchantSearchContainer {
    width: 340px;
    max-width: 340px;
    min-width: 340px;
}

#merchantSearchContainer .merchant-autocomplete-container {
    width: 100%;
    max-width: 100%;
    min-width: 100%;
}

#merchantSearchContainer .merchant-autocomplete-input {
    min-width: 100%;
    max-width: 100%;
    width: 100%;
}

/* Remove gap between merchant search field and search button */
#merchantSelectionCard .d-flex.gap-2 {
    gap: 0 !important;
}

/* Minimize gap between Load Checklist button and Products section */
#merchantSelectionCard .col-md-4 > .mt-1,
#merchantSelectionCard .col-lg-5 > .mt-1 {
    margin-top: 0.25rem !important; /* Reduced spacing */
}

#productsSection {
    margin-top: 0.25rem !important; /* Reduced spacing */
}

/* Compact merchant selection card */
#merchantSelectionCard .card-body {
    padding-top: 0.5rem !important;
    padding-bottom: 0.5rem !important;
}

#merchantSelectionCard .form-label {
    margin-bottom: 0.25rem !important;
}

/* Progress indicator container - base styles for all viewports */
#progressCard .progress-container {
    display: flex !important;
    align-items: center !important;
    gap: 0.75rem !important;
    width: auto !important;
    height: auto !important;
    background-color: transparent !important;
    border-radius: 0 !important;
    overflow: visible !important;
    margin-bottom: 0 !important;
    flex-wrap: nowrap !important; /* Single line on desktop */
}

#progressCard .progress-container .progress-bar-container {
    flex: 1 1 auto !important;
    min-width: 0 !important;
    width: auto !important;
    margin-bottom: 0 !important;
}

#progressCard .progress-container .progress-bar-container .progress {
    width: 100% !important;
    height: 25px !important;
    margin: 0 !important;
    /* Preserve Bootstrap's progress bar background color */
    background-color: var(--bs-progress-bg, var(--bs-secondary-bg)) !important;
    border-radius: var(--bs-progress-border-radius, 0.375rem) !important;
}

#progressCard .progress-container .progress-percentage {
    flex-shrink: 0 !important;
    margin: 0 !important;
    min-width: 0 !important;
    padding: 0 !important;
}

/* Fix search button size from 768px to 1688px to match 1689px+ size */
@media (min-width: 768px) and (max-width: 1688px) {
    /* Ensure button containers maintain proper width */
    #merchantSelectionCard .col-md-auto {
        flex: 0 0 auto;
        width: auto;
    }
    
    #submitMerchantBtn,
    #loadChecklistBtn {
        min-width: 110px;
        white-space: nowrap;
        height: calc(1.5em + 0.5rem + 2px);
        flex-shrink: 0;
    }
    
    /* Ensure merchant search field maintains fixed 340px width */
    #merchantSelectionCard .flex-grow-1 {
        max-width: 340px;
        flex-grow: 0;
        flex-shrink: 0;
        flex-basis: 340px;
    }
    
    #merchantSearchContainer {
        width: 340px;
        max-width: 340px;
        min-width: 340px;
    }
    
    #merchantSearchContainer .merchant-autocomplete-container {
        width: 100%;
        max-width: 100%;
        min-width: 100%;
    }
    
    #merchantSearchContainer .merchant-autocomplete-input {
        min-width: 100%;
        max-width: 100%;
        width: 100%;
    }
}

/* Responsive adjustments for smaller screens */
@media (max-width: 991px) {
    #merchantSelectionCard .flex-grow-1 {
        max-width: 340px;
        flex-grow: 0;
        flex-shrink: 0;
        flex-basis: 340px;
    }
    
    #merchantSearchContainer {
        width: 340px;
        max-width: 340px;
        min-width: 340px;
    }
    
    #merchantSearchContainer .merchant-autocomplete-container {
        width: 100%;
        max-width: 100%;
        min-width: 100%;
    }
    
    #merchantSearchContainer .merchant-autocomplete-input {
        min-width: 100%;
        max-width: 100%;
        width: 100%;
    }
}

@media (max-width: 767px) {
    /* Hide Clear All button on mobile */
    #clearAllBtn {
        display: none !important;
    }
    
    #merchantSelectionCard .flex-grow-1 {
        max-width: 100%;
        flex-grow: 1;
        flex-shrink: 1;
        flex-basis: auto;
    }
    
    #merchantSearchContainer {
        width: 100%;
        max-width: 100%;
        min-width: 100%;
    }
    
    #merchantSearchContainer .merchant-autocomplete-container {
        width: 100%;
        max-width: 100%;
        min-width: 100%;
    }
    
    #merchantSearchContainer .merchant-autocomplete-input {
        min-width: 100%;
        max-width: 100%;
        width: 100%;
    }
    
    /* Progress indicator - 2 lines on mobile */
    #progressCard .progress-container {
        flex-wrap: wrap !important;
        align-items: flex-start !important;
    }
    
    /* First line: Label and Dropdown */
    #progressCard .progress-container > h6:first-of-type {
        order: 1 !important;
        flex: 0 0 auto !important;
    }
    
    #progressCard .progress-container #groupFilterDropdown {
        order: 2 !important;
        flex: 0 0 auto !important;
    }
    
    /* Force progress bar container to wrap to second line by making it full width */
    #progressCard .progress-container .progress-bar-container {
        order: 3 !important;
        flex-basis: 100% !important;
        width: 100% !important;
        margin-top: 0.5rem !important;
        display: flex !important;
        align-items: center !important;
        gap: 0.5rem !important;
    }
    
    #progressCard .progress-container .progress-bar-container .progress {
        height: 18px !important; /* Reduced size for mobile */
        flex: 1 1 auto !important;
        min-width: 0 !important;
        margin: 0 !important;
    }
    
    /* Hide percentage when it's still in progress-container (will be moved by JS) */
    #progressCard .progress-container > .progress-percentage {
        display: none !important;
    }
    
    /* Style percentage when it's inside progress bar container (moved by JS) */
    #progressCard .progress-container .progress-bar-container .progress-percentage {
        flex: 0 0 auto !important;
        margin: 0 !important;
        min-width: 0 !important;
        padding: 0 !important;
        text-align: left !important;
        font-size: 0.875rem !important;
        font-weight: 600 !important;
        line-height: 18px !important;
    }
}

.checklist-category-card {
    margin-bottom: 1.5rem;
}

.subcategory-section {
    margin-left: 1rem;
    padding-left: 1rem;
    border-left: 3px solid #dee2e6;
}

.subcategory-title {
    color: #6c757d;
    font-size: 1rem;
    margin-bottom: 0.75rem;
}

.checklist-table {
    margin-bottom: 0;
}

.checklist-table thead th {
    background-color: #c6f5f3;
    border-bottom: 2px solid #dee2e6;
    font-weight: 600;
    font-size: 0.9rem;
    padding: 0.5rem 0.75rem;
}

.checklist-table thead th:first-child {
    text-decoration: underline;
    padding: 0.5rem;
    width: 50px;
    text-align: center;
}

.checklist-table thead th:first-child i.fa-check {
    color: #000000;
}

.checklist-table thead th:nth-child(2) {
    /* Task column - wider */
    min-width: 200px;
    font-size: 13px;
}

.checklist-table thead th:nth-child(3) {
    /* Assignee column - minimized */
    width: 100px;
    padding: 0.5rem;
    font-size: 13px;
}

.checklist-table tbody td {
    padding: 0.75rem;
    vertical-align: middle;
}

.checklist-table tbody td:first-child {
    padding: 0.75rem 0.5rem;
    text-align: center;
    width: 50px;
}

.checklist-table tbody td:nth-child(3) {
    /* Assignee column - minimized */
    width: 100px;
    padding: 0.75rem 0.5rem;
}

/* Base row styles - exclude overdue rows (they have their own styling) */
.checklist-table tbody tr:not(.task-deadline-overdue) {
    transition: background-color 0.2s;
    background-color: #f5f0f8;
}

.checklist-table tbody tr:not(.task-deadline-overdue):nth-child(even) {
    background-color: #ede7f6;
}

.checklist-table tbody tr:not(.task-deadline-overdue):hover {
    background-color: #e1d5f0;
}

/* Override Bootstrap table-hover for overdue rows */
/* Ensure red border for all overdue rows */
.checklist-table.table-hover tbody tr.task-deadline-overdue:not(.task-inactive) {
    border-left: 4px solid #dc3545 !important;
}

/* Other overdue tasks (not assigned to me) - lighter */
.checklist-table.table-hover tbody tr.task-deadline-overdue:not(.task-inactive):not(.task-assigned-to-me),
.checklist-table.table-hover tbody tr.task-deadline-overdue:not(.task-inactive):not(.task-assigned-to-me) td {
    background-color: #ffe8e8 !important;
}

.checklist-table.table-hover tbody tr.task-deadline-overdue:not(.task-inactive):not(.task-assigned-to-me):nth-child(even),
.checklist-table.table-hover tbody tr.task-deadline-overdue:not(.task-inactive):not(.task-assigned-to-me):nth-child(even) td {
    background-color: #ffe8e8 !important;
}

.checklist-table.table-hover tbody tr.task-deadline-overdue:not(.task-inactive):not(.task-assigned-to-me):hover,
.checklist-table.table-hover tbody tr.task-deadline-overdue:not(.task-inactive):not(.task-assigned-to-me):hover td {
    background-color: #ffe0e0 !important;
}

/* Override completed styles when overdue (not assigned to me) - white background, no border */
.checklist-table.table-hover tbody tr.task-deadline-overdue.task-completed:not(.task-inactive):not(.task-assigned-to-me),
.checklist-table.table-hover tbody tr.task-deadline-overdue.task-completed:not(.task-inactive):not(.task-assigned-to-me) td {
    background-color: #ffffff !important;
}

.checklist-table.table-hover tbody tr.task-deadline-overdue.task-completed:not(.task-inactive):not(.task-assigned-to-me) {
    border-left: none !important;
}

.checklist-table.table-hover tbody tr.task-deadline-overdue.task-completed:not(.task-inactive):not(.task-assigned-to-me):nth-child(even),
.checklist-table.table-hover tbody tr.task-deadline-overdue.task-completed:not(.task-inactive):not(.task-assigned-to-me):nth-child(even) td {
    background-color: #ffffff !important;
}

.checklist-table.table-hover tbody tr.task-deadline-overdue.task-completed:not(.task-inactive):not(.task-assigned-to-me):hover,
.checklist-table.table-hover tbody tr.task-deadline-overdue.task-completed:not(.task-inactive):not(.task-assigned-to-me):hover td {
    background-color: #ffffff !important;
}

/* Assigned to me and overdue - darker */
.checklist-table.table-hover tbody tr.task-assigned-to-me.task-deadline-overdue:not(.task-inactive),
.checklist-table.table-hover tbody tr.task-assigned-to-me.task-deadline-overdue:not(.task-inactive) td {
    background-color: #ff9999 !important;
}

.checklist-table.table-hover tbody tr.task-assigned-to-me.task-deadline-overdue:not(.task-inactive):nth-child(even),
.checklist-table.table-hover tbody tr.task-assigned-to-me.task-deadline-overdue:not(.task-inactive):nth-child(even) td {
    background-color: #ff9999 !important;
}

.checklist-table.table-hover tbody tr.task-assigned-to-me.task-deadline-overdue:not(.task-inactive):hover,
.checklist-table.table-hover tbody tr.task-assigned-to-me.task-deadline-overdue:not(.task-inactive):hover td {
    background-color: #ff8080 !important;
}


/* Base styles - can be overridden by more specific rules below */
/* Completed task styles - exclude overdue rows */
.checklist-table tbody tr.task-completed:not(.task-assigned-to-me):not(.task-deadline-overdue) {
    background-color: #e7d1f5 !important;
}

.checklist-table tbody tr.task-completed:not(.task-assigned-to-me):not(.task-deadline-overdue):nth-child(even) {
    background-color: #d9b8f0 !important;
}

.checklist-table tbody tr.task-completed:not(.task-assigned-to-me):not(.task-deadline-overdue):hover {
    background-color: #d1a8eb !important;
}

/* Inactive task styling - grayed out */
.checklist-table tbody tr.task-inactive {
    background-color: #e9ecef !important;
    opacity: 0.6;
    color: #6c757d;
}

.checklist-table tbody tr.task-inactive:nth-child(even) {
    background-color: #dee2e6 !important;
}

.checklist-table tbody tr.task-inactive:hover {
    background-color: #ced4da !important;
}

.checklist-table tbody tr.task-inactive.task-completed {
    background-color: #d6d8db !important;
    opacity: 0.5;
}

.checklist-table tbody tr.task-inactive.task-completed:nth-child(even) {
    background-color: #c8cbcf !important;
}

.checklist-table tbody tr.task-inactive.task-completed:hover {
    background-color: #bdc0c4 !important;
}

.checklist-table tbody tr.task-inactive .task-name-text,
.checklist-table tbody tr.task-inactive .assignee-display {
    color: #6c757d;
    text-decoration: line-through;
}

.checklist-table tbody tr.task-inactive .task-drag-handle {
    color: #adb5bd;
    cursor: not-allowed;
}

.checklist-table tbody tr.task-inactive .task-help-icon {
    background-color: #adb5bd;
    opacity: 0.7;
}

/* Task assigned to me (not overdue) - consistent blue highlight */
table.checklist-table tbody tr.task-assigned-to-me:not(.task-inactive):not(.task-deadline-overdue),
.checklist-table tbody tr.task-assigned-to-me:not(.task-inactive):not(.task-deadline-overdue) {
    border-left: 4px solid #1976d2 !important;
    font-weight: 500 !important;
    opacity: 1 !important;
}

table.checklist-table tbody tr.task-assigned-to-me.task-completed:not(.task-inactive):not(.task-deadline-overdue),
.checklist-table tbody tr.task-assigned-to-me.task-completed:not(.task-inactive):not(.task-deadline-overdue),
tbody tr.task-assigned-to-me.task-completed:not(.task-inactive):not(.task-deadline-overdue),
tr.task-assigned-to-me.task-completed:not(.task-inactive):not(.task-deadline-overdue) {
    border-left: 4px solid #198754 !important;
    border-left-color: #198754 !important;
    opacity: 1 !important;
}

.checklist-table tbody tr.task-assigned-to-me .task-name-text {
    color: #1976d2;
    font-weight: 600;
}

.checklist-table tbody tr.task-assigned-to-me.task-completed .task-name-text {
    color: #198754;
}

.checklist-table tbody tr.task-assigned-to-me .assignee-display {
    color: #1976d2;
    font-weight: 600;
}

.checklist-table tbody tr.task-assigned-to-me.task-completed .assignee-display {
    color: #198754;
}

/* Task assigned to me but inactive - muted highlight */
.checklist-table tbody tr.task-assigned-to-me.task-inactive {
    background-color: #e9ecef !important;
    border-left-color: #6c757d;
    opacity: 0.7;
}

.checklist-table tbody tr.task-assigned-to-me.task-inactive:nth-child(even) {
    background-color: #dee2e6 !important;
}

.checklist-table tbody tr.task-assigned-to-me.task-inactive:hover {
    background-color: #ced4da !important;
}

.checklist-table tbody tr.task-assigned-to-me.task-inactive .task-name-text,
.checklist-table tbody tr.task-assigned-to-me.task-inactive .assignee-display {
    color: #6c757d;
    font-weight: 500;
}

/* Task deadline overdue or today - red warning styling (HIGHEST PRIORITY) */
/* Hierarchy: Overdue (red) > Assigned to me (Complete: green, Not complete: yellow) */
/* Other overdue tasks (not assigned to me) - lighter background */
.checklist-table tbody tr.task-deadline-overdue:not(.task-inactive):not(.task-assigned-to-me),
.checklist-table tbody tr.task-deadline-overdue:not(.task-inactive):not(.task-assigned-to-me) td {
    background-color: #ffe8e8 !important;
}

.checklist-table tbody tr.task-deadline-overdue:not(.task-inactive):not(.task-assigned-to-me) {
    border-left: 4px solid #dc3545 !important;
}

.checklist-table tbody tr.task-deadline-overdue:not(.task-inactive):not(.task-assigned-to-me):nth-child(even),
.checklist-table tbody tr.task-deadline-overdue:not(.task-inactive):not(.task-assigned-to-me):nth-child(even) td {
    background-color: #ffe8e8 !important;
}

.checklist-table tbody tr.task-deadline-overdue:not(.task-inactive):not(.task-assigned-to-me):hover,
.checklist-table tbody tr.task-deadline-overdue:not(.task-inactive):not(.task-assigned-to-me):hover td {
    background-color: #ffe0e0 !important;
}

/* Override completed styles when overdue (not assigned to me) - white background, no border */
.checklist-table tbody tr.task-deadline-overdue.task-completed:not(.task-inactive):not(.task-assigned-to-me),
.checklist-table tbody tr.task-deadline-overdue.task-completed:not(.task-inactive):not(.task-assigned-to-me) td {
    background-color: #ffffff !important;
}

.checklist-table tbody tr.task-deadline-overdue.task-completed:not(.task-inactive):not(.task-assigned-to-me) {
    border-left: none !important;
}

.checklist-table tbody tr.task-deadline-overdue.task-completed:not(.task-inactive):not(.task-assigned-to-me):nth-child(even),
.checklist-table tbody tr.task-deadline-overdue.task-completed:not(.task-inactive):not(.task-assigned-to-me):nth-child(even) td {
    background-color: #ffffff !important;
}

.checklist-table tbody tr.task-deadline-overdue.task-completed:not(.task-inactive):not(.task-assigned-to-me):hover,
.checklist-table tbody tr.task-deadline-overdue.task-completed:not(.task-inactive):not(.task-assigned-to-me):hover td {
    background-color: #ffffff !important;
}

/* Text styling for overdue rows (but not completed - completed ones are green) */
.checklist-table tbody tr.task-deadline-overdue:not(.task-inactive):not(.task-completed) .task-name-text,
.checklist-table tbody tr.task-deadline-overdue:not(.task-inactive):not(.task-completed) .assignee-display {
    color: #721c24 !important;
    font-weight: 600 !important;
}

/* Task assigned to me with overdue deadline - red warning overrides assigned-to-me styling */
/* Darker background to emphasize urgency */
.checklist-table tbody tr.task-assigned-to-me.task-deadline-overdue:not(.task-inactive),
.checklist-table tbody tr.task-assigned-to-me.task-deadline-overdue:not(.task-inactive) td {
    background-color: #ff9999 !important;
}

.checklist-table tbody tr.task-assigned-to-me.task-deadline-overdue:not(.task-inactive):not(.task-completed) {
    border-left: 4px solid #dc3545 !important;
}

/* Green border for completed overdue assigned-to-me tasks */
.checklist-table tbody tr.task-assigned-to-me.task-deadline-overdue.task-completed:not(.task-inactive) {
    border-left: 4px solid #198754 !important;
}

.checklist-table tbody tr.task-assigned-to-me.task-deadline-overdue:not(.task-inactive):nth-child(even),
.checklist-table tbody tr.task-assigned-to-me.task-deadline-overdue:not(.task-inactive):nth-child(even) td {
    background-color: #ff9999 !important;
}

.checklist-table tbody tr.task-assigned-to-me.task-deadline-overdue:not(.task-inactive):hover,
.checklist-table tbody tr.task-assigned-to-me.task-deadline-overdue:not(.task-inactive):hover td {
    background-color: #ff8080 !important;
}

/* Text styling for assigned-to-me overdue rows (but not completed - completed ones are green) */
.checklist-table tbody tr.task-assigned-to-me.task-deadline-overdue:not(.task-inactive):not(.task-completed) .task-name-text,
.checklist-table tbody tr.task-assigned-to-me.task-deadline-overdue:not(.task-inactive):not(.task-completed) .assignee-display {
    color: #721c24 !important;
    font-weight: 600 !important;
}


/* Force white background for completed overdue tasks - override all other rules */
/* This applies to BOTH assigned-to-me and not-assigned-to-me cases */
.checklist-table tbody tr.task-deadline-overdue.task-completed:not(.task-inactive),
.checklist-table tbody tr.task-deadline-overdue.task-completed:not(.task-inactive) td {
    background-color: #ffffff !important;
}

.checklist-table tbody tr.task-deadline-overdue.task-completed:not(.task-inactive):nth-child(even),
.checklist-table tbody tr.task-deadline-overdue.task-completed:not(.task-inactive):nth-child(even) td {
    background-color: #ffffff !important;
}

.checklist-table tbody tr.task-deadline-overdue.task-completed:not(.task-inactive):hover,
.checklist-table tbody tr.task-deadline-overdue.task-completed:not(.task-inactive):hover td {
    background-color: #ffffff !important;
}

/* Specifically override assigned-to-me + overdue + completed */
.checklist-table tbody tr.task-assigned-to-me.task-deadline-overdue.task-completed:not(.task-inactive),
.checklist-table tbody tr.task-assigned-to-me.task-deadline-overdue.task-completed:not(.task-inactive) td {
    background-color: #ffffff !important;
}

.checklist-table tbody tr.task-assigned-to-me.task-deadline-overdue.task-completed:not(.task-inactive):nth-child(even),
.checklist-table tbody tr.task-assigned-to-me.task-deadline-overdue.task-completed:not(.task-inactive):nth-child(even) td {
    background-color: #ffffff !important;
}

.checklist-table tbody tr.task-assigned-to-me.task-deadline-overdue.task-completed:not(.task-inactive):hover,
.checklist-table tbody tr.task-assigned-to-me.task-deadline-overdue.task-completed:not(.task-inactive):hover td {
    background-color: #ffffff !important;
}

.checklist-table.table-hover tbody tr.task-deadline-overdue.task-completed:not(.task-inactive),
.checklist-table.table-hover tbody tr.task-deadline-overdue.task-completed:not(.task-inactive) td {
    background-color: #ffffff !important;
}

.checklist-table.table-hover tbody tr.task-deadline-overdue.task-completed:not(.task-inactive):nth-child(even),
.checklist-table.table-hover tbody tr.task-deadline-overdue.task-completed:not(.task-inactive):nth-child(even) td {
    background-color: #ffffff !important;
}

.checklist-table.table-hover tbody tr.task-deadline-overdue.task-completed:not(.task-inactive):hover,
.checklist-table.table-hover tbody tr.task-deadline-overdue.task-completed:not(.task-inactive):hover td {
    background-color: #ffffff !important;
}

/* Specifically override assigned-to-me + overdue + completed for table-hover */
.checklist-table.table-hover tbody tr.task-assigned-to-me.task-deadline-overdue.task-completed:not(.task-inactive),
.checklist-table.table-hover tbody tr.task-assigned-to-me.task-deadline-overdue.task-completed:not(.task-inactive) td {
    background-color: #ffffff !important;
}

.checklist-table.table-hover tbody tr.task-assigned-to-me.task-deadline-overdue.task-completed:not(.task-inactive):nth-child(even),
.checklist-table.table-hover tbody tr.task-assigned-to-me.task-deadline-overdue.task-completed:not(.task-inactive):nth-child(even) td {
    background-color: #ffffff !important;
}

.checklist-table.table-hover tbody tr.task-assigned-to-me.task-deadline-overdue.task-completed:not(.task-inactive):hover,
.checklist-table.table-hover tbody tr.task-assigned-to-me.task-deadline-overdue.task-completed:not(.task-inactive):hover td {
    background-color: #ffffff !important;
}

/* Text color for overdue completed tasks - green for both assigned and not assigned */
.checklist-table tbody tr.task-deadline-overdue.task-completed:not(.task-inactive) .task-name-text,
.checklist-table tbody tr.task-deadline-overdue.task-completed:not(.task-inactive) .assignee-display {
    color: #198754 !important;
    font-weight: 600 !important;
}

.checklist-table tbody tr.task-assigned-to-me.task-deadline-overdue.task-completed:not(.task-inactive) .task-name-text,
.checklist-table tbody tr.task-assigned-to-me.task-deadline-overdue.task-completed:not(.task-inactive) .assignee-display {
    color: #198754 !important;
    font-weight: 600 !important;
}

/* Task name container with help icon */
.task-name-container {
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
    gap: 0.75rem;
    flex-wrap: nowrap;
    flex: 1 1 auto;
    min-width: 0;
}

.task-name-left {
    display: flex;
    align-items: center;
    gap: 0;
    flex: 1 1 auto;
    min-width: 0;
}

.task-drag-handle {
    color: #6c757d;
    cursor: grab;
    font-size: 0.875rem;
    opacity: 0.6;
    transition: opacity 0.2s, color 0.2s;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    flex-shrink: 0;
    padding: 0.25rem;
    margin-right: 0.25rem;
}

/* Hide drag handle on mobile */
@media (max-width: 767px) {
    .task-drag-handle {
        display: none !important;
    }
}

.task-drag-handle:hover {
    opacity: 1;
    color: #0d6efd;
}

.task-drag-handle:active {
    cursor: grabbing;
    opacity: 1;
}

.checklist-table tbody tr:hover .task-drag-handle {
    opacity: 0.8;
}

.checklist-table tbody tr:hover .task-drag-handle:hover {
    opacity: 1;
}

/* Disable drag handle on inactive tasks */
.checklist-table tbody tr.task-inactive .task-drag-handle {
    opacity: 0.3;
    cursor: not-allowed;
}

.checklist-table tbody tr.task-inactive:hover .task-drag-handle {
    opacity: 0.3;
}

/* Sortable states */
.sortable-ghost {
    opacity: 0.4;
    background-color: #e7f1ff !important;
}

.sortable-chosen {
    background-color: #e7f1ff !important;
}

.sortable-drag {
    opacity: 0.8;
}

.task-name-text {
    flex: 1 1 auto;
    font-size: 0.875rem;
    display: block;
    white-space: normal;
    word-break: break-word;
    overflow-wrap: anywhere;
}

.task-help-icon {
    color: #fff;
    background-color: #6c757d;
    border-radius: 50%;
    width: 1.25rem;
    height: 1.25rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: help;
    font-size: 0.7rem;
    font-weight: 600;
    transition: background-color 0.2s;
    flex-shrink: 0;
    margin-left: 0.25rem;
}

.task-na-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.125rem 0.375rem;
    font-size: 0.7rem;
    font-weight: 500;
    color: #d3d3d3;
    background-color: #ffffff;
    border: 1px solid #dee2e6;
    border-radius: 0.25rem;
    white-space: nowrap;
    flex-shrink: 0;
    transition: background-color 0.2s, border-color 0.2s, color 0.2s;
    cursor: pointer;
    pointer-events: auto;
    user-select: none;
}

.task-na-badge:hover {
    background-color: #f8f9fa;
    border-color: #adb5bd;
}

.task-na-badge.inactive {
    background-color: #6c757d;
    color: #ffffff;
    border-color: #6c757d;
}

.task-na-badge.inactive:hover {
    background-color: #5a6268;
    border-color: #5a6268;
}

/* Ensure badge is always clickable even when row is inactive (unless TaskActive is 0) */
.task-inactive .task-na-badge:not(.disabled) {
    pointer-events: auto !important;
    cursor: pointer !important;
    opacity: 1;
}

/* Disabled badge styling (when TaskActive is 0) */
.task-na-badge.disabled {
    opacity: 0.5;
    cursor: not-allowed !important;
    pointer-events: none !important;
    background-color: #e9ecef !important;
    color: #adb5bd !important;
    border-color: #dee2e6 !important;
}

.task-na-badge.disabled.inactive {
    background-color: #adb5bd !important;
    color: #ffffff !important;
    border-color: #adb5bd !important;
}

.task-help-icon:hover {
    background-color: #0d6efd !important;
    color: #fff !important;
}

/* Assignee header column - clickable with bulk assign dropdown */
.assignee-header-cell {
    position: relative;
    cursor: pointer;
    user-select: none;
}

.assignee-header-container {
    position: relative;
    display: flex;
    align-items: center;
}

.assignee-header-text {
    flex: 1;
}

.assignee-header-select {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    z-index: 100;
    background-color: #fff;
    border: 2px solid #0d6efd;
    box-shadow: 0 0.25rem 0.75rem rgba(0, 0, 0, 0.2);
    margin-top: 0.25rem;
    cursor: pointer;
}

/* Assignee column - clickable with dropdown */
.assignee-cell {
    position: relative;
    padding: 0.5rem !important;
    overflow: visible;
    box-sizing: border-box;
}

.assignee-display {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    transition: background-color 0.2s;
    min-width: 50px;
    color: #212529;
    cursor: pointer;
    width: 100%;
}

.assignee-display:hover {
    background-color: #e9ecef;
    color: #0d6efd;
}

.assignee-select {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 10;
    background-color: #fff;
    border: 2px solid #0d6efd;
    box-shadow: 0 0.125rem 0.5rem rgba(0, 0, 0, 0.15);
    padding: 0.25rem 0.5rem;
    cursor: pointer;
    box-sizing: border-box;
}

/* Checkbox styling - green when checked (traffic signal style) */
.task-completed-checkbox {
    width: 1.25rem;
    height: 1.25rem;
    cursor: pointer;
    border: 2px solid #6c757d;
    border-radius: 0.25rem;
}

.task-completed-checkbox:checked {
    background-color: #198754;
    border-color: #198754;
}

.task-completed-checkbox:focus {
    box-shadow: 0 0 0 0.25rem rgba(25, 135, 84, 0.25);
}

/* Responsive checklist layout - Pinterest-style masonry */
.checklist-grid-container {
    position: relative;
    margin-bottom: 1rem;
}

.checklist-grid-container .checklist-category-card {
    margin-bottom: 0;
}

/* Remove padding inside category cards */
.checklist-grid-container .checklist-category-card .card-body {
    padding: 0;
}

@media (max-width: 1200px) {
    .checklist-grid-container {
        grid-template-columns: repeat(2, 1fr);
    }
}

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

/* Progress bar styling */
.progress {
    border-radius: 0.5rem;
    overflow: hidden;
}

.progress-bar {
    transition: width 0.6s ease, background-color 0.3s ease;
    animation: none !important;
}

/* Progress bar color coding */
.progress-bar.progress-red,
.category-progress-fill.progress-red {
    background-color: #dc3545 !important;
}

.progress-bar.progress-amber,
.category-progress-fill.progress-amber {
    background-color: #ffc107 !important;
}

.progress-bar.progress-green,
.category-progress-fill.progress-green {
    background-color: #198754 !important;
}

/* Progress text color coding */
.progress-percentage.progress-red,
.category-progress-text.progress-red {
    color: #dc3545 !important;
}

.progress-percentage.progress-amber,
.category-progress-text.progress-amber {
    color: #ffc107 !important;
}

.progress-percentage.progress-green,
.category-progress-text.progress-green {
    color: #198754 !important;
}

/* Progress text bold when no progress (0%) */
.progress-percentage.progress-zero,
.category-progress-text.progress-zero {
    font-weight: bold !important;
}

/* Remove all animations from overall progress bar */
#overallProgressBar,
#overallProgressBar.progress-bar-animated,
#overallProgressBar.progress-bar-striped {
    animation: none !important;
    background-image: none !important;
}

/* Breadcrumb styling - Minimized */
.breadcrumb-nav {
    margin-bottom: 0;
}

.breadcrumb {
    background-color: transparent;
    padding: 0;
    margin: 0;
    font-size: 0.875rem;
}

.breadcrumb.small {
    font-size: 0.8rem;
    padding: 0.25rem 0;
}

.breadcrumb-item a {
    color: #0d6efd;
    text-decoration: none;
    font-size: inherit;
}

.breadcrumb-item a:hover {
    text-decoration: underline;
}

.breadcrumb-item.active {
    color: #6c757d;
    font-size: inherit;
}

.breadcrumb-item + .breadcrumb-item::before {
    content: ">";
    padding: 0 0.5rem;
    color: #6c757d;
}

/* Card styling */
.card {
    border: 1px solid #dee2e6;
    border-radius: 0.5rem;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}

.card-header {
    background-color: #c6f5f3;
    border-bottom: 1px solid #dee2e6;
    font-weight: 600;
}

/* Ensure checklist category card headers use the same color */
.checklist-category-card .card-header {
    background-color: #c6f5f3;
}

/* Make category name bold */
.checklist-category-card .card-header h6 {
    font-weight: bold;
}

/* Category progress indicator - horizontal bar with text */
.category-progress-container {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.25rem;
    margin-left: auto;
}

.category-progress-bar {
    width: 70px;
    height: 12px;
    background-color: #d3d3d3;
    border-radius: 6px;
    overflow: hidden;
    position: relative;
    flex-shrink: 0;
}

.category-progress-fill {
    height: 100%;
    background-color: #007BFF;
    border-radius: 6px;
    transition: width 0.3s ease, background-color 0.3s ease;
}

.category-progress-text {
    font-size: 0.875rem;
    font-weight: 500;
    color: #8b6914;
    white-space: nowrap;
    min-width: 0;
    text-align: right;
    transition: color 0.3s ease;
    flex-shrink: 0;
    padding: 0;
    margin: 0;
}

.category-progress-text.progress-zero {
    font-weight: bold !important;
}

/* Category deadline input field */
.category-deadline-wrapper {
    position: relative;
    display: inline-block;
    overflow: visible !important;
}

.category-deadline-input {
    font-size: 0.75rem !important;
    padding: 0.2rem 0.4rem !important;
    height: calc(1.5em + 0.4rem + 2px) !important;
    cursor: pointer !important;
    transition: width 0.2s ease;
    overflow: visible !important;
    box-sizing: border-box !important;
}

/* When no value: shrink to show only calendar icon (only when visible) */
.category-deadline-input:not(.has-value):not([style*="display: none"]) {
    width: 40px !important;
    padding: 0.2rem 0.1rem 0.2rem 0.2rem !important;
    overflow: visible !important;
}

/* When has value: expand to show date */
.category-deadline-input.has-value {
    width: 110px !important;
}

.category-deadline-input[readonly] {
    cursor: pointer !important;
    background-color: #fff !important;
}

/* Calendar icon button - shown when no value */
.category-deadline-icon-btn {
    border: 1px solid #ced4da !important;
    background-color: #fff !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
}

.category-deadline-icon-btn:hover {
    background-color: #f8f9fa !important;
    border-color: #adb5bd !important;
}

.category-deadline-icon-btn:focus {
    outline: none !important;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25) !important;
}

.category-deadline-icon-btn i {
    transition: color 0.2s ease !important;
}

.category-deadline-icon-btn:hover i {
    color: #495057 !important;
}

/* When input has NO value: Hide native dd/mm/yyyy placeholder */
.category-deadline-input:not([value]):not(.has-value),
.category-deadline-input[value=""]:not(.has-value) {
    color: transparent !important;
}

.category-deadline-input:not([value]):not(.has-value)::-webkit-datetime-edit-text,
.category-deadline-input:not([value]):not(.has-value)::-webkit-datetime-edit-month-field,
.category-deadline-input:not([value]):not(.has-value)::-webkit-datetime-edit-day-field,
.category-deadline-input:not([value]):not(.has-value)::-webkit-datetime-edit-year-field,
.category-deadline-input[value=""]:not(.has-value)::-webkit-datetime-edit-text,
.category-deadline-input[value=""]:not(.has-value)::-webkit-datetime-edit-month-field,
.category-deadline-input[value=""]:not(.has-value)::-webkit-datetime-edit-day-field,
.category-deadline-input[value=""]:not(.has-value)::-webkit-datetime-edit-year-field {
    color: transparent !important;
}

.category-deadline-input:not([value]):not(.has-value)::-webkit-datetime-edit,
.category-deadline-input[value=""]:not(.has-value)::-webkit-datetime-edit {
    color: transparent !important;
}

/* When input HAS a value: Display the date */
.category-deadline-input.has-value,
.category-deadline-input[value]:not([value=""]) {
    color: #212529 !important;
}

.category-deadline-input.has-value::-webkit-datetime-edit-text,
.category-deadline-input.has-value::-webkit-datetime-edit-month-field,
.category-deadline-input.has-value::-webkit-datetime-edit-day-field,
.category-deadline-input.has-value::-webkit-datetime-edit-year-field,
.category-deadline-input[value]:not([value=""])::-webkit-datetime-edit-text,
.category-deadline-input[value]:not([value=""])::-webkit-datetime-edit-month-field,
.category-deadline-input[value]:not([value=""])::-webkit-datetime-edit-day-field,
.category-deadline-input[value]:not([value=""])::-webkit-datetime-edit-year-field {
    color: #212529 !important;
}

.category-deadline-input.has-value::-webkit-datetime-edit,
.category-deadline-input[value]:not([value=""])::-webkit-datetime-edit {
    color: #212529 !important;
}

.category-deadline-input::-webkit-inner-spin-button,
.category-deadline-input::-webkit-calendar-picker-indicator {
    opacity: 1 !important;
    cursor: pointer !important;
    width: 18px !important;
    height: 18px !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
}

/* Ensure calendar icon is always visible, even when readonly or shrunk */
.category-deadline-input[readonly]::-webkit-calendar-picker-indicator,
.category-deadline-input:not(.has-value)::-webkit-calendar-picker-indicator {
    opacity: 1 !important;
    cursor: pointer !important;
    display: block !important;
    visibility: visible !important;
    width: 18px !important;
    height: 18px !important;
    position: relative !important;
    z-index: 10 !important;
    pointer-events: auto !important;
}

/* Firefox calendar icon */
.category-deadline-input::-moz-calendar-picker-indicator {
    opacity: 1 !important;
    cursor: pointer !important;
    width: 18px !important;
    height: 18px !important;
}

.category-deadline-input:not(.has-value)::-moz-calendar-picker-indicator {
    opacity: 1 !important;
    cursor: pointer !important;
    display: block !important;
    visibility: visible !important;
}

/* Hide date edit fields when no value (shrunk state) */
.category-deadline-input:not(.has-value)::-webkit-datetime-edit {
    display: none !important;
    width: 0 !important;
}

.category-deadline-input:not(.has-value)::-webkit-datetime-edit-text,
.category-deadline-input:not(.has-value)::-webkit-datetime-edit-month-field,
.category-deadline-input:not(.has-value)::-webkit-datetime-edit-day-field,
.category-deadline-input:not(.has-value)::-webkit-datetime-edit-year-field {
    display: none !important;
    width: 0 !important;
}

/* Firefox: Hide native placeholder when empty */
.category-deadline-input:not([value]):not(.has-value)::-moz-placeholder,
.category-deadline-input[value=""]:not(.has-value)::-moz-placeholder {
    color: transparent !important;
    opacity: 0 !important;
}

.category-deadline-input:not([value]):not(.has-value)::placeholder,
.category-deadline-input[value=""]:not(.has-value)::placeholder {
    color: transparent !important;
    opacity: 0 !important;
}


/* Subcategory progress indicator */
.subcategory-section .category-progress-container {
    margin-left: auto;
}

.subcategory-section .category-progress-bar {
    width: 80px;
    height: 10px;
}

.subcategory-section .category-progress-text {
    font-size: 0.8rem;
    min-width: 0;
    padding: 0;
    margin: 0;
}

/* Category status switch */
.category-status-switch {
    margin: 0;
    padding: 0;
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
    position: relative;
    z-index: 10;
    pointer-events: auto;
}

.category-status-switch .form-check-input {
    width: 2.5rem;
    height: 1.25rem;
    cursor: pointer;
    margin: 0;
    margin-top: 0;
    background-color: #6c757d;
    border-color: #6c757d;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%23fff'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: left center;
    background-size: contain;
    transition: background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, background-position 0.15s ease-in-out;
}

.category-status-switch .form-check-input:checked {
    background-color: #007BFF;
    border-color: #007BFF;
    background-position: right center;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%23fff'/%3e%3c/svg%3e");
}

.category-status-switch .form-check-input:focus {
    box-shadow: 0 0 0 0.25rem rgba(0, 123, 255, 0.25);
    border-color: #007BFF;
    outline: 0;
}

.category-status-switch .form-check-input:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    pointer-events: none;
}

.category-status-switch .form-check-input:hover:not(:disabled) {
    border-color: #007BFF;
}

/* Loading overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.progress-container {
    width: 200px;
    height: 4px;
    background-color: #fff;
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 1rem;
}

.loading-overlay .progress-bar {
    height: 100%;
    background-color: #0d6efd;
    animation: progress-animation 1.5s ease-in-out infinite;
}

@keyframes progress-animation {
    0% {
        width: 0%;
        margin-left: 0%;
    }
    50% {
        width: 70%;
        margin-left: 15%;
    }
    100% {
        width: 0%;
        margin-left: 100%;
    }
}

.loading-text {
    color: #fff;
    font-size: 1.1rem;
    font-weight: 500;
}

/* Toast Notifications */
.toast {
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.toast-header {
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.toast-icon {
    margin-right: 8px;
}

