/* Custom CSS for Project Management Dashboard - Updated */

/* Delete Tree Styles */
.delete-tree-item {
    transition: background-color 0.2s ease;
}

.delete-tree-item:hover {
    background-color: #f8f9fa;
}

.delete-tree-item.bg-primary {
    background-color: #0d6efd !important;
}

.delete-tree-item.bg-primary .text-white {
    color: white !important;
}

.delete-folder, .delete-file {
    user-select: none;
}

.delete-folder:hover, .delete-file:hover {
    background-color: rgba(0, 0, 0, 0.05);
    border-radius: 4px;
}

/* Base Styles */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: #333;
    background-color: #f8f9fa;
}

/* Navigation */
.navbar-brand {
    font-weight: 600;
    font-size: 1.25rem;
}

.nav-link {
    font-weight: 500;
    padding: 0.75rem 1rem !important;
}

.nav-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 0.375rem;
}

/* Cards */
.card {
    border: none;
    border-radius: 0.5rem;
    box-shadow: 0 0.15rem 1.75rem 0 rgba(58, 59, 69, 0.15);
    transition: all 0.3s ease-in-out;
}

.card:hover {
    /* transform: translateY(-2px); */
    box-shadow: 0 0.25rem 2rem 0 rgba(58, 59, 69, 0.2);
}

.card-header {
    background-color: #f8f9fc;
    border-bottom: 1px solid #e3e6f0;
    font-weight: 600;
    padding: 1rem 1.25rem;
}

.card-body {
    padding: 1.25rem;
}

/* Border Left Cards */
.border-left-primary {
    border-left: 0.25rem solid #4e73df !important;
}

.border-left-success {
    border-left: 0.25rem solid #1cc88a !important;
}

.border-left-info {
    border-left: 0.25rem solid #36b9cc !important;
}

.border-left-warning {
    border-left: 0.25rem solid #f6c23e !important;
}

.border-left-danger {
    border-left: 0.25rem solid #e74a3b !important;
}

/* Statistics Cards */
.text-xs {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.text-gray-800 {
    color: #5a5c69 !important;
}

.font-weight-bold {
    font-weight: 700 !important;
}

/* Progress Bars */
.progress {
    height: 0.5rem;
    border-radius: 0.35rem;
    background-color: #eaecf4;
}

.progress-bar {
    background-color: #4e73df;
    border-radius: 0.35rem;
}

/* Badges */
.badge {
    font-size: 0.75rem;
    font-weight: 500;
    padding: 0.375rem 0.75rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    vertical-align: middle;
}

/* Badge Types - Consistent Width */
.badge-status {
    min-width: 110px;
    height: 24px;
    line-height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-size: 0.7rem;
    padding: 0.25rem 0.5rem;
}

.badge-priority {
    min-width: 70px;
    height: 24px;
    line-height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-size: 0.7rem;
    padding: 0.25rem 0.5rem;
}

.badge-project {
    min-width: 90px;
    height: 24px;
    line-height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
}

.badge-type {
    min-width: 110px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.badge-relations {
    min-width: 110px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.badge-tags {
    min-width: 120px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

/* Buttons */
.btn {
    font-weight: 500;
    border-radius: 0.35rem;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.btn-sm {
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
}

/* Docs Tree */
.docs-tree-item {
    margin-bottom: 2px;
}

.docs-folder, .docs-file {
    padding: 4px 8px;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.docs-folder:hover {
    background-color: #f8f9fa;
}

.docs-file:hover {
    background-color: #e9ecef;
}

.docs-children {
    margin-left: 20px;
    border-left: 1px solid #dee2e6;
    padding-left: 10px;
}

/* Markdown Content */
#docsRenderedContent {
    line-height: 1.7;
    font-size: 1rem;
    color: #333;
}

#docsRenderedContent h1,
#docsRenderedContent h2,
#docsRenderedContent h3,
#docsRenderedContent h4,
#docsRenderedContent h5,
#docsRenderedContent h6 {
    margin-top: 2rem;
    margin-bottom: 0.85rem;
    font-weight: 700;
    color: #2c3e50;
}

#docsRenderedContent h1:first-child,
#docsRenderedContent h2:first-child,
#docsRenderedContent h3:first-child {
    margin-top: 0;
}

#docsRenderedContent h1 {
    font-size: 2.35rem;
    border-bottom: 3px solid #007bff;
    padding-bottom: 0.45rem;
}

#docsRenderedContent h2 {
    font-size: 1.85rem;
    color: #0d6efd;
    border-bottom: 1px solid #dbe7ff;
    padding-bottom: 0.35rem;
}

#docsRenderedContent h3 {
    font-size: 1.45rem;
    color: #495057;
}

#docsRenderedContent h4 {
    font-size: 1.2rem;
    color: #5c6770;
}

#docsRenderedContent h5 {
    font-size: 1.05rem;
    color: #6c757d;
}

#docsRenderedContent h6 {
    font-size: 0.95rem;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

#docsRenderedContent p {
    margin-bottom: 1.2rem;
    text-align: justify;
}

#docsRenderedContent code {
    background-color: #f8f9fa;
    padding: 3px 6px;
    border-radius: 4px;
    font-size: 0.9em;
    color: #e83e8c;
    border: 1px solid #e9ecef;
}

#docsRenderedContent pre {
    background-color: #f8f9fa;
    padding: 1.5rem;
    border-radius: 8px;
    overflow-x: auto;
    border: 1px solid #e9ecef;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

#docsRenderedContent pre code {
    background: none;
    padding: 0;
    border: none;
    color: #333;
}

#docsRenderedContent blockquote {
    border-left: 4px solid #007bff;
    padding: 1rem 1.5rem;
    margin: 1.5rem 0;
    background-color: #f8f9fa;
    color: #495057;
    border-radius: 0 8px 8px 0;
}

#docsRenderedContent ul,
#docsRenderedContent ol {
    margin-bottom: 1.2rem;
    padding-left: 2.5rem;
}

#docsRenderedContent li {
    margin-bottom: 0.5rem;
}

#docsRenderedContent table {
    width: 100%;
    margin-bottom: 1.5rem;
    border-collapse: collapse;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    border-radius: 8px;
    overflow: hidden;
}

#docsRenderedContent table th,
#docsRenderedContent table td {
    padding: 0.75rem 1rem;
    border: 1px solid #dee2e6;
    text-align: left;
}

#docsRenderedContent table th {
    background-color: #007bff;
    color: white;
    font-weight: 600;
}

#docsRenderedContent table tr:nth-child(even) {
    background-color: #f8f9fa;
}

#docsRenderedContent table tr:hover {
    background-color: #e3f2fd;
}

#docsRenderedContent a {
    color: #007bff;
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: all 0.2s;
}

#docsRenderedContent a:hover {
    color: #0056b3;
    border-bottom-color: #0056b3;
}

#docsRenderedContent strong {
    font-weight: 700;
    color: #2c3e50;
}

#docsRenderedContent em {
    font-style: italic;
    color: #6c757d;
}

#docsRenderedContent hr {
    border: none;
    height: 2px;
    background: linear-gradient(to right, #007bff, #6c757d);
    margin: 2rem 0;
    border-radius: 1px;
}

/* Tables */
.table {
    font-size: 0.875rem;
}

.table tr {
    vertical-align: top;
}

.table th {
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
    border-top: none;
    color: #5a5c69;
    vertical-align: top;
}

.table td {
    vertical-align: top;
    border-top: 1px solid #e3e6f0;
}

/* Project Info Table - Consistent row height and borders */
.table.table-sm tr {
    height: 48px; /* Fixed height for all rows */
}

.table.table-sm td {
    border-top: none;
    border-bottom: 1px solid #e3e6f0;
    padding: 0.75rem 0.5rem;
}

.table.table-sm td:first-child {
    font-weight: 600;
    color: #5a5c69;
    width: 40%;
}

.table.table-sm td:last-child {
    width: 60%;
}

/* Ensure badges align properly in table cells */
.table.table-sm .badge {
    vertical-align: middle;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Project Info Table - Vertical divider between columns */
.table.table-sm .col-md-6:first-child {
    border-right: 1px solid #e3e6f0;
    padding-right: 1rem;
}

.table.table-sm .col-md-6:last-child {
    padding-left: 1rem;
}

/* Statistics Section - Consistent height and borders */
.stats-grid .col-6 {
    min-height: 80px; /* Fixed minimum height for all stat boxes */
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 1rem 0.75rem;
}

.stats-grid .col-6.border-end {
    border-right: 1px solid #e3e6f0 !important;
    padding-right: 1rem;
}

.stats-grid .col-6:not(.border-end) {
    padding-left: 1rem;
}

/* Ensure consistent spacing in stat boxes */
.stats-grid .h4 {
    margin-bottom: 0.25rem;
    line-height: 1.2;
}

.stats-grid small {
    margin-bottom: 0.25rem;
    display: block;
}

.stats-grid .small {
    margin-bottom: 0;
}

/* Project Hierarchy Tree Styling */
.hierarchy-tree {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 0.375rem;
    padding: 1rem;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.9rem;
    line-height: 1.6;
}

/* Planning Section Styling */
.phases-list .border {
    border-color: #e3e6f0 !important;
    transition: all 0.2s ease;
}

.phases-list .border:hover {
    border-color: #007bff !important;
    box-shadow: 0 2px 4px rgba(0,123,255,0.1);
}

.phase-filter-checkbox {
    cursor: pointer;
    width: 1.2rem;
    height: 1.2rem;
    flex-shrink: 0;
}

.phase-item label {
    cursor: pointer;
    user-select: none;
}

.phase-item:has(.phase-filter-checkbox:checked) {
    background-color: #e7f3ff;
    border-color: #007bff !important;
}

.quarters-container {
    display: grid;
    gap: 1rem;
}

.quarter-block .card {
    border-left: 4px solid #17a2b8 !important;
    transition: all 0.2s ease;
}

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

.quarter-goals-list .bg-light {
    background-color: #f8f9fa !important;
    border: 1px solid #e9ecef;
    transition: all 0.2s ease;
}

.quarter-goals-list .bg-light:hover {
    background-color: #e9ecef !important;
    border-color: #17a2b8;
}

.border-left-primary {
    border-left: 4px solid #007bff !important;
}

.border-left-info {
    border-left: 4px solid #17a2b8 !important;
}

.hierarchy-tree a {
    transition: all 0.2s ease;
    border-radius: 0.25rem;
    padding: 0.25rem 0.5rem;
    margin: 0.125rem 0;
    display: inline-block;
}

.hierarchy-tree a:hover {
    background-color: rgba(0, 123, 255, 0.1);
    transform: translateX(2px);
}

.hierarchy-tree .badge {
    font-size: 0.65rem;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
}

/* Project status colors in hierarchy */
.hierarchy-tree .text-success {
    color: #28a745 !important;
}

.hierarchy-tree .text-muted {
    color: #6c757d !important;
}

/* Indentation for hierarchy levels */
.hierarchy-tree div {
    position: relative;
}

/* Add connecting lines for better visual hierarchy */
.hierarchy-tree div:not(:last-child)::after {
    content: '';
    position: absolute;
    left: -1rem;
    top: 0;
    bottom: 0;
    width: 1px;
    background: #dee2e6;
}

/* Status Indicators */
.status-pending {
    color: #6c757d;
}

.status-in-progress {
    color: #fd7e14;
}

.status-completed {
    color: #198754;
}

.status-blocked {
    color: #dc3545;
}

.status-cancelled {
    color: #6c757d;
}

/* Priority Indicators */
.priority-high {
    color: #dc3545;
    font-weight: 600;
}

.priority-medium {
    color: #fd7e14;
    font-weight: 500;
}

.priority-low {
    color: #6c757d;
}

/* Timeline */
.timeline {
    position: relative;
    padding-left: 2rem;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 0.75rem;
    top: 0;
    bottom: 0;
    width: 2px;
    background-color: #e3e6f0;
}

.timeline-item {
    position: relative;
    margin-bottom: 1.5rem;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -1.75rem;
    top: 0.25rem;
    width: 0.75rem;
    height: 0.75rem;
    border-radius: 50%;
    background-color: #4e73df;
    border: 3px solid #fff;
    box-shadow: 0 0 0 3px #e3e6f0;
}

/* Calendar */
.calendar {
    background-color: #fff;
    border-radius: 0.5rem;
    box-shadow: 0 0.15rem 1.75rem 0 rgba(58, 59, 69, 0.15);
}

.calendar-header {
    background-color: #4e73df;
    color: #495057;
    padding: 1rem;
    border-radius: 0.5rem 0.5rem 0 0;
    text-align: center;
    font-weight: 600;
}

.calendar-body {
    padding: 1rem;
}

.calendar-day {
    min-height: 100px;
    border: 1px solid #e3e6f0;
    padding: 0.5rem;
    position: relative;
}

.calendar-day.today {
    background-color: #f8f9fc;
    border-color: #4e73df;
}

.calendar-day.has-tasks {
    background-color: #e3f2fd;
}

/* Responsive */
@media (max-width: 768px) {
    .container-fluid {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    .h3 {
        font-size: 1.5rem;
    }
}

/* Loading States */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.spinner-border-sm {
    width: 1rem;
    height: 1rem;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Task details form styling */
.task-details-form {
    padding: 0;
}

.task-details-form .form-label {
    font-weight: 600;
    color: #495057;
    margin-bottom: 0.5rem;
}

/* Select2 Bootstrap 5 Theme Customization */
.select2-container--bootstrap-5 .select2-selection {
    min-height: calc(1.5em + 0.75rem + 2px) !important;
    border: 1px solid #dee2e6 !important;
    border-radius: 0.375rem !important;
}

.select2-container--bootstrap-5 .select2-selection--single {
    height: calc(1.5em + 0.75rem + 2px) !important;
    padding: 0 !important;
}

.select2-container--bootstrap-5 .select2-selection--single .select2-selection__rendered {
    line-height: 1.5 !important;
    padding: 0.375rem 0.75rem !important;
    padding-right: 2.25rem !important;
    color: #212529 !important;
}

.select2-container--bootstrap-5 .select2-selection--single .select2-selection__arrow {
    height: 100% !important;
    top: 0 !important;
    right: 0 !important;
    width: 2.25rem !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.select2-container--bootstrap-5 .select2-selection--single .select2-selection__arrow b {
    border-color: #495057 transparent transparent transparent !important;
    border-width: 5px 4px 0 4px !important;
}

.select2-container--bootstrap-5 .select2-dropdown {
    border-color: #dee2e6 !important;
    border-radius: 0.375rem !important;
}

.select2-container--bootstrap-5.select2-container--focus .select2-selection,
.select2-container--bootstrap-5.select2-container--open .select2-selection {
    border-color: #86b7fe !important;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25) !important;
}

.select2-container--bootstrap-5 .select2-results__option {
    padding: 6px 12px !important;
}

.select2-container--bootstrap-5 .select2-results__option--highlighted {
    background-color: #0d6efd !important;
    color: white !important;
}

.select2-container--bootstrap-5 .select2-selection--multiple .select2-selection__rendered .select2-selection__choice {
    font-size: 0.75rem !important;
}

/* Modal adjustments for Select2 */
.modal-body {
    max-height: 75vh !important;
    overflow-y: auto;
}
.modal-fullscreen .modal-body {
    max-height: 100vh !important;
}

/* Badge in Select2 */
.select2-container--bootstrap-5 .select2-selection--single .select2-selection__rendered .badge {
    font-size: 0.875rem;
    padding: 0.35em 0.65em;
    font-weight: 600;
}

.select2-container--bootstrap-5 .select2-results__option .badge {
    font-size: 0.875rem;
    padding: 0.35em 0.65em;
    font-weight: 600;
}

/* Alert nested info styling */
.alert-info {
    background-color: #cfe2ff;
    border-color: #b6d4fe;
}

.alert-info .badge {
    font-size: 0.875rem;
}

/* Print Styles */
@media print {
    .navbar,
    .btn,
    .card-header .btn {
        display: none !important;
    }
    
    .card {
        box-shadow: none;
        border: 1px solid #dee2e6;
    }
    
    .container-fluid {
        padding: 0;
    }
}

/* Đảm bảo editNoteModal nổi trên mọi modal cha */
#editNoteModal {
    z-index: 1080 !important;
}
.modal-backdrop.edit-note-z {
    z-index: 1075 !important;
}

/* Calendar Navigation Styles */
.calendar-header {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 1px solid #dee2e6;
    border-radius: 0.5rem;
    padding: 1rem 1.5rem;
    margin-bottom: 1rem;
}

.calendar-header h6 {
    font-weight: 600;
    color: #495057;
    min-width: 150px;
    text-align: center;
    margin: 0;
}

.calendar-header .btn {
    font-size: 0.875rem;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    transition: all 0.2s ease;
    border: 1px solid #6c757d;
    background-color: white;
    color: #6c757d;
    font-weight: 500;
}

.calendar-header .btn:hover {
    background-color: #6c757d;
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
    border-color: #6c757d;
}

.calendar-header .btn:focus {
    box-shadow: 0 0 0 0.2rem rgba(108, 117, 125, 0.25);
}

.calendar-header .btn i {
    font-size: 0.875rem;
}

/* Dashboard Analytics Styles */

/* Insights Cards */
.insights-card {
    border: none;
    border-radius: 0.5rem;
    box-shadow: 0 0.15rem 1.75rem 0 rgba(58, 59, 69, 0.15);
    transition: all 0.3s ease-in-out;
}

.insights-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 0.25rem 2rem 0 rgba(58, 59, 69, 0.2);
}

/* Priority Score - Simplified */
.priority-score {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-weight: 600;
    font-size: 0.7rem;
    min-width: 50px;
    height: 24px;
    line-height: 24px;
    text-align: center;
    color: white;
    letter-spacing: 0.5px;
}

.priority-score.high {
    background-color: #dc3545;
}

.priority-score.medium {
    background-color: #fd7e14;
}

.priority-score.low {
    background-color: #ffc107;
    color: #212529;
}

.priority-score.minimal {
    background-color: #6c757d;
}

/* Timeline Container - Improved */
.timeline-container {
    min-height: 180px;
    padding: 0.5rem 0;
}

.timeline-horizontal {
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    padding: 0.75rem 0;
    scrollbar-width: thin;
    scrollbar-color: #cbd5e0 #f1f5f9;
}

.timeline-horizontal::-webkit-scrollbar {
    height: 6px;
}

.timeline-horizontal::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 3px;
}

.timeline-horizontal::-webkit-scrollbar-thumb {
    background: #cbd5e0;
    border-radius: 3px;
}

.timeline-day {
    flex-shrink: 0;
    min-width: 220px;
    border: 1px solid #e3e6f0;
    border-radius: 0.5rem;
    padding: 1rem;
    background-color: #fff;
    box-shadow: 0 0.15rem 1rem 0 rgba(58, 59, 69, 0.08);
    transition: all 0.2s ease;
}

.timeline-day:hover {
    box-shadow: 0 0.15rem 1.5rem 0 rgba(58, 59, 69, 0.15);
    transform: translateY(-2px);
}

.timeline-day.today {
    border-color: #4e73df;
    border-width: 2px;
    background-color: #f8f9fc;
}

.timeline-day.overdue {
    border-color: #e74a3b;
    border-width: 2px;
    background-color: #f8d7da;
}

.timeline-date {
    text-align: center;
    margin-bottom: 0.875rem;
    padding-bottom: 0.625rem;
    border-bottom: 2px solid #e3e6f0;
}

.timeline-date strong {
    display: block;
    font-size: 0.95rem;
    font-weight: 700;
    color: #5a5c69;
}

.timeline-date small {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.7rem;
    font-weight: 600;
}

.timeline-items {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.timeline-item {
    padding: 0.625rem;
    border-radius: 0.375rem;
    border: 1px solid #e3e6f0;
    background-color: #fff;
    transition: all 0.15s ease;
    cursor: pointer;
}

.timeline-item:hover {
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
    transform: translateX(2px);
    border-color: #4e73df;
}

.timeline-item.danger {
    border-left: 3px solid #e74a3b;
}

.timeline-item.warning {
    border-left: 3px solid #f6c23e;
}

.timeline-item.success {
    border-left: 3px solid #1cc88a;
}

.timeline-item.secondary {
    border-left: 3px solid #858796;
}

.timeline-item-content {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.timeline-item-title {
    font-weight: 600;
    font-size: 0.8125rem;
    color: #5a5c69;
    line-height: 1.4;
    margin-bottom: 0.375rem;
}

.timeline-item-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    align-items: center;
}

.timeline-item-meta .badge {
    font-size: 0.65rem;
    padding: 0.25rem 0.5rem;
    font-weight: 600;
}

.project-badge {
    font-size: 0.65rem;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    color: white;
    font-weight: 600;
}

/* Timeline Task Cards - Kanban Style */
.timeline-task-card {
    background: #fff;
    border: 1px solid #e3e6f0;
    border-radius: 0.5rem;
    padding: 0.875rem;
    margin-bottom: 0.75rem;
    box-shadow: 0 0.1rem 0.5rem 0 rgba(58, 59, 69, 0.05);
    transition: all 0.15s ease;
    cursor: pointer;
    position: relative;
}

.timeline-task-card:hover {
    box-shadow: 0 0.15rem 1rem 0 rgba(58, 59, 69, 0.12);
    transform: translateY(-2px);
    border-color: #4e73df;
}

.timeline-task-card.danger {
    border-left: 3px solid #e74a3b;
}

.timeline-task-card.warning {
    border-left: 3px solid #f6c23e;
}

.timeline-task-card.secondary {
    border-left: 3px solid #858796;
}

.timeline-task-header {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.timeline-task-header i {
    font-size: 0.875rem;
    margin-top: 0.125rem;
    flex-shrink: 0;
}

.timeline-task-title {
    font-weight: 600;
    font-size: 0.875rem;
    color: #5a5c69;
    line-height: 1.4;
    flex: 1;
}

.timeline-task-description {
    font-size: 0.75rem;
    color: #858796;
    line-height: 1.4;
    margin-bottom: 0.75rem;
}

.timeline-task-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.timeline-task-project {
    flex: 1;
}

.timeline-task-badges {
    display: flex;
    gap: 0.25rem;
    align-items: center;
}

.timeline-task-badges .badge {
    font-size: 0.6rem;
    padding: 0.2rem 0.4rem;
    font-weight: 600;
}

.timeline-task-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 0.5rem;
    border-top: 1px solid #e3e6f0;
}

.timeline-task-dates {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.7rem;
    color: #858796;
}

.timeline-task-dates i {
    font-size: 0.65rem;
}

.timeline-task-progress {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.timeline-task-progress .progress {
    background-color: #e3e6f0;
}

.timeline-task-progress small {
    font-size: 0.65rem;
    color: #858796;
}

/* Bottleneck & Risk Items - Improved */
.bottleneck-item, .risk-item {
    border: 1px solid #e3e6f0;
    border-radius: 0.5rem;
    transition: all 0.15s ease;
    box-shadow: 0 0.1rem 0.5rem 0 rgba(58, 59, 69, 0.05);
}

.bottleneck-item:hover, .risk-item:hover {
    box-shadow: 0 0.15rem 1rem 0 rgba(58, 59, 69, 0.12);
    transform: translateY(-2px);
}

.bottleneck-item {
    border-left: 3px solid #f6c23e;
}

.risk-item {
    border-left: 3px solid #e74a3b;
}

.bottleneck-item h6, .risk-item h6 {
    font-size: 0.875rem;
    font-weight: 600;
    color: #5a5c69;
    margin-bottom: 0.25rem;
}

.bottleneck-item small, .risk-item small {
    font-size: 0.75rem;
    color: #858796;
}

/* Chart Containers */
.chart-container {
    position: relative;
    height: 300px;
    margin: 1rem 0;
}

.chart-container canvas {
    max-height: 300px;
}

/* Responsive Design for Dashboard */
@media (max-width: 768px) {
    .timeline-horizontal {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .timeline-day {
        min-width: 100%;
    }
    
    .timeline-item-meta {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .priority-score {
        font-size: 0.75rem;
        padding: 0.2rem 0.4rem;
    }
    
    .insights-card .table-responsive {
        font-size: 0.8rem;
    }
    
    .bottleneck-item, .risk-item {
        padding: 0.75rem;
    }
}

@media (max-width: 576px) {
    .timeline-item-title {
        font-size: 0.8rem;
    }
    
    .timeline-item-meta .badge {
        font-size: 0.65rem;
        padding: 0.2rem 0.4rem;
    }
    
    .chart-container {
        height: 250px;
    }
}

/* Loading States for Dashboard */
.dashboard-loading {
    opacity: 0.6;
    pointer-events: none;
}

.dashboard-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 2rem;
    height: 2rem;
    margin: -1rem 0 0 -1rem;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Filter Buttons */
.btn-group .btn[data-filter] {
    transition: all 0.2s ease;
}

.btn-group .btn[data-filter].active {
    background-color: #007bff;
    border-color: #007bff;
    color: white;
}

.btn-group .btn[data-filter]:not(.active):hover {
    background-color: #e9ecef;
    border-color: #adb5bd;
}

/* Table Enhancements for Insights */
.table.table-sm th {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #858796;
    border-bottom: 2px solid #e3e6f0;
    padding: 0.75rem 0.75rem;
    background-color: #f8f9fc;
}

.table.table-sm td {
    font-size: 0.8125rem;
    vertical-align: middle;
    padding: 0.875rem 0.75rem;
    border-bottom: 1px solid #e3e6f0;
}

.table.table-sm .fw-bold {
    font-weight: 600;
    color: #5a5c69;
    font-size: 0.875rem;
}

.table.table-sm tbody tr:hover {
    background-color: #f8f9fc;
    cursor: pointer;
}

/* Recommendation Cards - Compact Design */
.recommendation-card {
    border: 1px solid #e3e6f0;
    border-radius: 0.5rem;
    padding: 1rem;
    background-color: #fff;
    box-shadow: 0 0.1rem 0.5rem 0 rgba(58, 59, 69, 0.05);
    transition: all 0.15s ease;
    height: 100%;
}

.recommendation-card:hover {
    box-shadow: 0 0.15rem 1rem 0 rgba(58, 59, 69, 0.12);
    transform: translateY(-2px);
}

.recommendation-card.urgent {
    border-left: 3px solid #e74a3b;
}

.recommendation-card.bottleneck {
    border-left: 3px solid #f6c23e;
}

.recommendation-card.risk {
    border-left: 3px solid #36b9cc;
}

.recommendation-card.success {
    border-left: 3px solid #28a745;
}

.recommendation-card .icon {
    font-size: 1.75rem;
    margin-bottom: 0.5rem;
}

.recommendation-card .icon.urgent {
    color: #e74a3b;
}

.recommendation-card .icon.bottleneck {
    color: #f6c23e;
}

.recommendation-card .icon.risk {
    color: #36b9cc;
}

.recommendation-card .icon.success {
    color: #28a745;
}

.recommendation-card .count {
    font-size: 1.5rem;
    font-weight: 700;
    color: #5a5c69;
    margin-bottom: 0.25rem;
}

.recommendation-card .title {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    color: #858796;
    letter-spacing: 0.5px;
    margin-bottom: 0.5rem;
}

.recommendation-card .description {
    font-size: 0.8125rem;
    color: #5a5c69;
    line-height: 1.4;
}

/* Task Cards - Kanban Style */
.task-card {
    background: #fff;
    border: 1px solid #e3e6f0;
    border-radius: 0.5rem;
    padding: 1rem;
    margin-bottom: 1rem;
    box-shadow: 0 0.1rem 0.5rem 0 rgba(58, 59, 69, 0.05);
    transition: all 0.15s ease;
    position: relative;
    cursor: pointer;
}

.task-card:hover {
    box-shadow: 0 0.15rem 1rem 0 rgba(58, 59, 69, 0.12);
    transform: translateY(-2px);
}

.task-card .task-card-actions {
    opacity: 0;
    transition: opacity 0.15s ease;
}

.task-card:hover .task-card-actions {
    opacity: 1;
}

.task-card-header {
    margin-bottom: 0.75rem;
}

.task-card-header .task-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: #5a5c69;
    margin: 0;
    line-height: 1.3;
}

.task-card-description {
    margin-bottom: 0.75rem;
}

.task-card-description p {
    font-size: 0.8rem;
    color: #858796;
    margin: 0;
    line-height: 1.4;
}

.task-card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.task-project .badge {
    font-size: 0.7rem;
    padding: 0.25rem 0.5rem;
}

.task-badges {
    display: flex;
    gap: 0.25rem;
    flex-wrap: wrap;
}

.task-badges .badge {
    font-size: 0.7rem;
    padding: 0.25rem 0.5rem;
}

.task-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.task-dates {
    display: flex;
    align-items: center;
    font-size: 0.75rem;
    color: #858796;
}

.task-dates i {
    margin-right: 0.25rem;
}

.task-progress {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.task-progress .progress {
    border-radius: 0.25rem;
}

.task-card-actions {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
}

.task-card-actions .btn {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
}

/* Priority Score in Cards */
.task-card .priority-score {
    font-size: 0.7rem;
    padding: 0.2rem 0.4rem;
    border-radius: 0.25rem;
    font-weight: 600;
    color: white;
}

/* Clickable Task Title */
.task-title-clickable {
    font-size: 0.9rem;
    font-weight: 600;
    color: #5a5c69;
    margin: 0;
    line-height: 1.3;
    cursor: pointer;
}

/* Responsive Task Cards */
@media (max-width: 768px) {
    .task-card-meta {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .task-card-footer {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
}

/* Alert Enhancements (keeping for other alerts) */
.alert .d-flex .flex-shrink-0 i {
    font-size: 1.25rem;
}

.alert .d-flex .flex-grow-1 h6 {
    margin-bottom: 0.25rem;
    font-weight: 600;
}

.alert .d-flex .flex-shrink-0 .badge {
    font-size: 0.875rem;
    padding: 0.5rem 0.75rem;
}

/* Bottleneck Detection Styles */
.bottleneck-item {
    border: 1px solid #e3e6f0;
    border-radius: 0.5rem;
    padding: 1rem;
    background: #fff;
}

.blocking-tasks-section {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid #e3e6f0;
}

.blocked-tasks-list {
    max-height: 200px;
    overflow-y: auto;
}

.blocked-task-item {
    background: #f8f9fa;
    border-left: 3px solid #ffc107;
    transition: background-color 0.2s ease;
}

.blocked-task-item:hover {
    background: #e9ecef;
}

/* Time Filter Dropdown Styles */
#timeFilter {
    border: 1px solid #d1d3e2;
    border-radius: 0.5rem;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    background-color: #fff;
    transition: all 0.2s ease;
}

#timeFilter:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
    outline: 0;
}

#timeFilter:hover {
    border-color: #b8bcc8;
}

/* Tasks Tabs Styling */
#tasksTabs {
    border-bottom: 1px solid #e3e6f0;
    margin-bottom: 1rem;
}

#tasksTabs .nav-link {
    color: #6c757d;
    font-weight: 500;
    padding: 0.75rem 1rem;
    border: none;
    border-bottom: 2px solid transparent;
    transition: all 0.2s ease;
}

#tasksTabs .nav-link:hover {
    color: #495057;
    border-bottom-color: #dee2e6;
}

#tasksTabs .nav-link.active {
    color: #007bff;
    border-bottom-color: #007bff;
    background-color: transparent;
}

#tasksTabs .nav-link:focus {
    box-shadow: none;
    outline: none;
}

.tab-content {
    border: none;
    padding: 0;
}
