/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Fallback utilities for Tailwind plugin-only classes */
/* Aspect ratio 16:9 support for .aspect-w-16.aspect-h-9 wrappers */
.aspect-w-16.aspect-h-9 {
    position: relative;
}
.aspect-w-16.aspect-h-9::before {
    content: "";
    display: block;
    width: 100%;
    padding-bottom: 56.25%; /* 9/16 = 0.5625 */
}
.aspect-w-16.aspect-h-9 > * {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
}

/* Line clamp fallbacks for .line-clamp-2 and .line-clamp-3 */
.line-clamp-2 {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    overflow: hidden;
}

.line-clamp-3 {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    overflow: hidden;
}

/* Override Tailwind defaults for form elements */
input, optgroup, select, textarea {
    color: #353535 !important;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
}

/* Dashboard Layout */
.dashboard {
    display: flex;
    min-height: 100vh;
    /* Scoped dark theme for SPA dashboard */
    background-color: #0f1419;
    color: #e6e6e6;
}

/* Sidebar */
.sidebar {
    width: 280px;
    background-color: #1a1f26;
    border-right: 1px solid #2d3748;
    padding: 0;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    transition: width 0.3s ease, transform 0.3s ease;
    z-index: 1000;
}

.sidebar.collapsed {
    width: 80px;
}

.sidebar.collapsed .logo-text,
.sidebar.collapsed .nav-link span {
    opacity: 0;
    width: 0;
    overflow: hidden;
    transition: opacity 0.2s ease, width 0.2s ease;
}

.sidebar-header {
    padding: 2rem 1.5rem;
    border-bottom: 1px solid #2d3748;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.5rem;
    font-weight: 700;
    color: #60a5fa;
}

.sidebar-toggle {
    background: none;
    border: none;
    color: #9ca3af;
    font-size: 1rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 0.375rem;
    transition: all 0.2s ease;
}

.sidebar-toggle:hover {
    background-color: #374151;
    color: #e6e6e6;
}

.sidebar.collapsed .sidebar-toggle i {
    transform: rotate(180deg);
}

.logo i {
    font-size: 1.75rem;
}

/* Brain Circuit Cortexta logo styling */
.cortexta-logo {
    display: inline-block;
    min-width: 64px;
    min-height: 50px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    filter: drop-shadow(0 2px 8px rgba(30, 64, 175, 0.2));
}

.cortexta-logo:hover {
    transform: scale(1.05) translateY(-1px);
    filter: drop-shadow(0 4px 16px rgba(30, 64, 175, 0.3));
}

/* Brain gradient enhancement */
.cortexta-logo path[fill*="brainGradient"] {
    transition: filter 0.3s ease;
}

.cortexta-logo:hover path[fill*="brainGradient"] {
    filter: brightness(1.1) saturate(1.2);
}

/* Circuit line glow effects */
.cortexta-logo line[stroke="#3b82f6"] {
    filter: drop-shadow(0 0 2px #3b82f6);
    transition: all 0.3s ease;
}

.cortexta-logo:hover line[stroke="#3b82f6"] {
    filter: drop-shadow(0 0 4px #3b82f6) brightness(1.2);
}

/* Circuit node pulsing */
.cortexta-logo circle[fill="#3b82f6"] {
    filter: drop-shadow(0 0 3px #3b82f6);
    transition: all 0.3s ease;
}

.cortexta-logo:hover circle[fill="#3b82f6"] {
    filter: drop-shadow(0 0 6px #3b82f6) brightness(1.3);
}

/* Data flow particles */
.cortexta-logo circle[fill="#fbbf24"] {
    filter: drop-shadow(0 0 2px #fbbf24);
}

.cortexta-logo:hover circle[fill="#fbbf24"] {
    filter: drop-shadow(0 0 4px #fbbf24) brightness(1.2);
}

/* Central processing indicator */
.cortexta-logo circle[stroke="#60a5fa"] {
    filter: drop-shadow(0 0 4px #60a5fa);
}

.cortexta-logo:hover circle[stroke="#60a5fa"] {
    filter: drop-shadow(0 0 8px #60a5fa);
}

/* Brain details enhancement */
.cortexta-logo path[stroke="#60a5fa"] {
    transition: opacity 0.3s ease;
}

.cortexta-logo:hover path[stroke="#60a5fa"] {
    opacity: 1 !important;
    filter: drop-shadow(0 0 2px #60a5fa);
}

/* Subtle brain pulse */
.cortexta-logo {
    animation: brainPulse 4s ease-in-out infinite;
}

@keyframes brainPulse {
    0%, 100% { 
        transform: scale(1);
        filter: drop-shadow(0 2px 8px rgba(30, 64, 175, 0.2));
    }
    50% { 
        transform: scale(1.01);
        filter: drop-shadow(0 3px 10px rgba(30, 64, 175, 0.25));
    }
}

/* Pause pulse on hover */
.cortexta-logo:hover {
    animation-play-state: paused;
}

/* Logo responsiveness */
@media (max-width: 768px) {
    .cortexta-logo {
        min-width: 48px;
        min-height: 38px;
        filter: drop-shadow(0 1px 4px rgba(30, 64, 175, 0.15));
    }
    
    .cortexta-logo:hover {
        transform: scale(1.03) translateY(-1px);
        filter: drop-shadow(0 3px 8px rgba(30, 64, 175, 0.25));
    }
}

@media (max-width: 480px) {
    .cortexta-logo {
        min-width: 40px;
        min-height: 32px;
    }
}

/* High contrast mode adjustments */
@media (prefers-contrast: high) {
    .cortexta-logo path {
        stroke-width: 3px;
    }
    
    .cortexta-logo line {
        stroke-width: 3px;
    }
    
    .cortexta-logo circle {
        stroke: currentColor;
        stroke-width: 1px;
    }
}

/* Accessibility: Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    .cortexta-logo {
        animation: none;
    }
    
    .cortexta-logo circle,
    .cortexta-logo path,
    .cortexta-logo line {
        animation: none;
    }
    
    .cortexta-logo:hover {
        animation: none;
        transform: none;
    }
}

/* Dark mode adjustments */
@media (prefers-color-scheme: dark) {
    .cortexta-logo {
        filter: drop-shadow(0 2px 8px rgba(96, 165, 250, 0.3));
    }
    
    .cortexta-logo:hover {
        filter: drop-shadow(0 4px 16px rgba(96, 165, 250, 0.4));
    }
    
    .cortexta-logo line[stroke="#3b82f6"] {
        filter: drop-shadow(0 0 3px #60a5fa);
    }
    
    .cortexta-logo circle[fill="#3b82f6"] {
        filter: drop-shadow(0 0 4px #60a5fa);
    }
}

.sidebar-nav {
    list-style: none;
    padding: 1rem 0;
}

.nav-item {
    margin: 0.25rem 1rem;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    color: #9ca3af;
    text-decoration: none;
    transition: all 0.2s ease;
}

.nav-link:hover {
    background-color: #374151;
    color: #e6e6e6;
}

.nav-item.active .nav-link {
    background-color: #3b82f6;
    color: white;
}

.nav-link i {
    width: 1.25rem;
    text-align: center;
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: 280px;
    background-color: #0f1419;
    transition: margin-left 0.3s ease;
}

.sidebar.collapsed + .main-content {
    margin-left: 80px;
}

/* Header */
.header {
    background-color: #1a1f26;
    border-bottom: 1px solid #2d3748;
    padding: 2rem;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-left h1 {
    font-size: 2rem;
    font-weight: 700;
    color: #e6e6e6;
    margin-bottom: 0.5rem;
}

.header-left p {
    color: #9ca3af;
    font-size: 1rem;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background-color: #065f46;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #10b981;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.time-filter select {
    background-color: #374151;
    border: 1px solid #4b5563;
    color: #1a1a1a;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
}

/* Metrics Grid */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    padding: 2rem;
}

.metric-card {
    background-color: #1a1f26;
    border: 1px solid #2d3748;
    border-radius: 0.75rem;
    padding: 1.5rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.metric-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

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

.metric-label {
    color: #9ca3af;
    font-size: 0.875rem;
    font-weight: 500;
}

.metric-icon {
    color: #60a5fa;
    font-size: 1.25rem;
}

.metric-value {
    font-size: 2.25rem;
    font-weight: 700;
    color: #e6e6e6;
    margin-bottom: 0.75rem;
}

.metric-change {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.875rem;
    font-weight: 500;
}

.metric-change.positive {
    color: #10b981;
}

.metric-change.negative {
    color: #ef4444;
}

.metric-change.neutral {
    color: #9ca3af;
}

/* Charts Section */
.charts-section {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
    padding: 0 2rem 2rem;
}

.chart-container, .progress-ring-container {
    background-color: #1a1f26;
    border: 1px solid #2d3748;
    border-radius: 0.75rem;
    padding: 1.5rem;
}

.chart-container {
    height: 400px;
}

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

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

.chart-header h3 {
    color: #e6e6e6;
    font-size: 1.125rem;
    font-weight: 600;
}

.chart-controls {
    display: flex;
    gap: 0.5rem;
}

.chart-btn {
    padding: 0.25rem 0.75rem;
    background-color: #374151;
    border: none;
    border-radius: 0.375rem;
    color: #9ca3af;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.chart-btn:hover, .chart-btn.active {
    background-color: #3b82f6;
    color: white;
}

/* Progress Ring */
.progress-ring-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}

.progress-ring {
    transform: rotate(-90deg);
}

.progress-ring-background {
    fill: none;
    stroke: #374151;
    stroke-width: 8;
}

.progress-ring-progress {
    fill: none;
    stroke: #3b82f6;
    stroke-width: 8;
    stroke-linecap: round;
    stroke-dasharray: 502.4;
    stroke-dashoffset: 502.4;
    transition: stroke-dashoffset 0.5s ease;
}

.progress-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.progress-percentage {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    color: #e6e6e6;
}

.progress-label {
    display: block;
    font-size: 0.875rem;
    color: #9ca3af;
    margin-top: 0.25rem;
}

/* Task Management */
.task-management {
    padding: 0 2rem 2rem;
}

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

.section-header-left {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.section-header h2 {
    color: #e6e6e6;
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0;
}

.task-filters {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.filter-select {
    background-color: #374151;
    border: 1px solid #4b5563;
    border-radius: 0.5rem;
    padding: 0.5rem 1rem;
    color: #1a1a1a;
    font-size: 0.875rem;
    min-width: 160px;
}

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

/* Buttons */
.btn-primary, .btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.btn-primary {
    background-color: #3b82f6;
    color: white;
}

.btn-primary:hover {
    background-color: #2563eb;
}

.btn-secondary {
    background-color: #374151;
    color: #9ca3af;
}

.btn-secondary:hover {
    background-color: #4b5563;
    color: #e6e6e6;
}

/* Add Task Form */
.add-task-form {
    background-color: #1a1f26;
    border: 1px solid #2d3748;
    border-radius: 0.75rem;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.form-row {
    margin-bottom: 1rem;
}

.form-label {
    display: block;
    color: #e6e6e6;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.project-selection {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.form-select, .form-input {
    background-color: #374151;
    border: 1px solid #4b5563;
    border-radius: 0.5rem;
    padding: 0.75rem;
    color: #1a1a1a;
    font-size: 0.875rem;
    flex: 1;
}

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

.project-separator {
    color: #9ca3af;
    font-size: 0.875rem;
    font-weight: 500;
    white-space: nowrap;
}

.add-task-form textarea {
    width: 100%;
    background-color: #374151;
    border: 1px solid #4b5563;
    border-radius: 0.5rem;
    padding: 0.75rem;
    color: #1a1a1a;
    font-size: 0.875rem;
    resize: vertical;
    min-height: 100px;
}

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

.form-actions {
    display: flex;
    gap: 1rem;
}

/* Tasks Table */
.tasks-table-container {
    background-color: #1a1f26;
    border: 1px solid #2d3748;
    border-radius: 0.75rem;
    overflow: hidden;
}

.tasks-table {
    width: 100%;
    border-collapse: collapse;
}

.tasks-table th {
    background-color: #374151;
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    color: #e6e6e6;
    font-size: 0.875rem;
    border-bottom: 1px solid #4b5563;
}

.tasks-table td {
    padding: 1rem;
    border-bottom: 1px solid #2d3748;
    color: #e6e6e6;
    font-size: 0.875rem;
}

.tasks-table tr:hover {
    background-color: #262b34;
}

/* Task Content */
.task-content {
    max-width: 350px;
}

.task-header {
    cursor: pointer;
    transition: all 0.2s ease;
}

.task-header:hover {
    background-color: rgba(55, 65, 81, 0.3);
    border-radius: 0.375rem;
    padding: 0.25rem;
    margin: -0.25rem;
}

.task-toggle {
    float: right;
    font-size: 0.75rem;
    color: #9ca3af;
    transition: transform 0.2s ease;
}

.task-description-full {
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        max-height: 0;
    }
    to {
        opacity: 1;
        max-height: 200px;
    }
}

.date-info {
    min-width: 120px;
}

/* Status Badges */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
}

.status-badge.completed {
    background-color: #065f46;
    color: #10b981;
}

.status-badge.pending {
    background-color: #451a03;
    color: #f59e0b;
}

.status-badge.overdue {
    background-color: #7f1d1d;
    color: #ef4444;
}

.status-badge i {
    font-size: 0.625rem;
}

/* New item badge */
.new-badge {
    display: inline-block;
    margin-left: 8px;
    padding: 3px 8px;
    font-size: 0.7rem;
    font-weight: 800;
    color: #ffffff;
    background: linear-gradient(135deg, #ff6b6b, #ee5a24);
    border: 2px solid #ff4757;
    border-radius: 12px;
    vertical-align: middle;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    box-shadow: 0 2px 4px rgba(255, 107, 107, 0.3);
    animation: pulse-new 2s infinite;
    position: relative;
    overflow: hidden;
}

.new-badge::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    animation: shimmer 2s infinite;
}

@keyframes pulse-new {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 2px 4px rgba(255, 107, 107, 0.3);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 4px 8px rgba(255, 107, 107, 0.5);
    }
}

@keyframes shimmer {
    0% {
        left: -100%;
    }
    100% {
        left: 100%;
    }
}

/* New task highlight animation */
@keyframes newTaskHighlight {
    0% {
        background-color: rgba(255, 107, 107, 0.1);
        transform: scale(1);
    }
    25% {
        background-color: rgba(255, 107, 107, 0.2);
        transform: scale(1.02);
    }
    50% {
        background-color: rgba(255, 107, 107, 0.15);
        transform: scale(1.01);
    }
    75% {
        background-color: rgba(255, 107, 107, 0.1);
        transform: scale(1);
    }
    100% {
        background-color: transparent;
        transform: scale(1);
    }
}

/* Tags */
.task-tags {
    display: flex;
    gap: 0.375rem;
    flex-wrap: wrap;
}

.tag {
    background-color: #374151;
    color: #9ca3af;
    padding: 0.125rem 0.5rem;
    border-radius: 0.375rem;
    font-size: 0.75rem;
    white-space: nowrap;
}

.tag-created {
    background-color: #1f2937;
    color: #60a5fa;
    border: 1px solid #374151;
}

.tag-due {
    background-color: #451a03;
    color: #f59e0b;
    border: 1px solid #92400e;
}

.tag-overdue {
    background-color: #7f1d1d;
    color: #ef4444;
    border: 1px solid #dc2626;
}

.tag-completed {
    background-color: #065f46;
    color: #10b981;
    border: 1px solid #059669;
}

/* Project Badge */
.project-info {
    min-width: 120px;
}

.project-badge {
    background-color: #1e40af;
    color: #dbeafe;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
    white-space: nowrap;
    display: inline-block;
}

/* Priority Column Styles */
.priority-info {
    text-align: center;
    min-width: 80px;
}

.priority-score {
    font-size: 1.125rem;
    font-weight: 700;
    color: #e6e6e6;
    margin-bottom: 0.25rem;
}

.priority-level {
    font-size: 0.625rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.125rem 0.375rem;
    border-radius: 0.25rem;
    display: inline-block;
    white-space: nowrap;
}

.priority-critical {
    background-color: #dc2626;
    color: white;
}

.priority-high {
    background-color: #ea580c;
    color: white;
}

.priority-medium {
    background-color: #d97706;
    color: white;
}

.priority-low {
    background-color: #65a30d;
    color: white;
}

.priority-unset {
    background-color: #6b7280;
    color: white;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 0.5rem;
}

.action-btn {
    padding: 0.375rem;
    background-color: #374151;
    border: none;
    border-radius: 0.375rem;
    color: #9ca3af;
    cursor: pointer;
    transition: all 0.2s ease;
}

.action-btn:hover {
    background-color: #4b5563;
    color: #e6e6e6;
}

.action-btn.delete:hover {
    background-color: #7f1d1d;
    color: #ef4444;
}

/* Task Action Buttons */
.task-action-btn {
    background: none;
    border: 1px solid #4b5563;
    color: #9ca3af;
    padding: 0.375rem;
    border-radius: 0.375rem;
    cursor: pointer;
    font-size: 0.75rem;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
}

.task-action-btn:hover {
    background-color: #374151;
    border-color: #6b7280;
    color: #e6e6e6;
}

/* Results Container */
.results-container {
    margin-top: 1rem;
    padding: 1rem;
    background-color: #1a1f26;
    border: 1px solid #2d3748;
    border-radius: 0.75rem;
    display: none;
}

.results-container.loading {
    display: block;
    text-align: center;
    color: #9ca3af;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }
    
    .sidebar.collapsed {
        transform: translateX(-100%);
    }
    
    /* Mobile open state for off-canvas sidebar */
    .sidebar.open {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .sidebar.collapsed + .main-content {
        margin-left: 0;
    }
    
    .charts-section {
        grid-template-columns: 1fr;
    }
    
    .metrics-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }
    
    .section-header-left {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }
}

/* Mobile task card wrapping to prevent horizontal overflow */
@media (max-width: 640px) {
    .task-item {
        overflow-wrap: anywhere;
        word-break: break-word;
    }
    .task-item .flex {
        flex-wrap: wrap;
    }
}

@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }
    
    .header-right {
        flex-direction: column;
        gap: 1rem;
        width: 100%;
    }
    
    .section-header {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }
    
    .metrics-grid {
        grid-template-columns: 1fr;
    }
    
    .tasks-table-container {
        overflow-x: auto;
    }
    
    .form-actions {
        flex-direction: column;
    }
}

/* Loading Animation */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #374151;
    border-radius: 50%;
    border-top-color: #3b82f6;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Toast Notifications */
.toast {
    position: fixed;
    top: 2rem;
    right: 2rem;
    max-width: calc(100vw - 4rem);
    min-width: 300px;
    background-color: #1a1f26;
    border: 1px solid #2d3748;
    border-radius: 0.5rem;
    padding: 1rem 1.5rem;
    color: #e6e6e6;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* Responsive toast positioning */
@media (max-width: 768px) {
    .toast {
        right: 1rem;
        left: 1rem;
        max-width: none;
        min-width: auto;
    }
}

.toast.show {
    transform: translateX(0);
}

.toast.success {
    border-left: 4px solid #10b981;
}

.toast.error {
    border-left: 4px solid #ef4444;
}

/* View Management */
.view-content {
    padding: 2rem;
}

.view-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #2d3748;
}

.view-header-left {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.view-header h1 {
    color: #e6e6e6;
    font-size: 2rem;
    font-weight: 700;
    margin: 0;
}

.view-header p {
    color: #9ca3af;
    font-size: 1rem;
    margin: 0;
}

/* Today/Now View Styles */
.primary-recommendation {
    margin-bottom: 3rem;
}

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

.recommendation-header h2 {
    color: #e6e6e6;
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.recommendation-header i {
    color: #f59e0b;
}

.primary-task-card {
    background: linear-gradient(135deg, #1e40af 0%, #3b82f6 100%);
    border-radius: 1rem;
    padding: 2rem;
    color: white;
    display: flex;
    gap: 2rem;
    align-items: center;
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.2);
    transition: transform 0.2s ease;
}

.primary-task-card:hover {
    transform: translateY(-2px);
}

.task-priority {
    flex-shrink: 0;
}

.priority-badge {
    background-color: rgba(255, 255, 255, 0.2);
    padding: 0.375rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.priority-badge.high {
    background-color: rgba(239, 68, 68, 0.2);
    color: #fecaca;
}

.task-content {
    flex: 1;
}

.task-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 0 0.5rem 0;
}

.task-description {
    font-size: 1rem;
    opacity: 0.9;
    margin: 0 0 1rem 0;
    line-height: 1.5;
}

.task-meta {
    display: flex;
    gap: 1.5rem;
    font-size: 0.875rem;
    opacity: 0.8;
}

.task-actions {
    flex-shrink: 0;
}

.start-task-btn {
    background-color: rgba(255, 255, 255, 0.15);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    transition: all 0.2s ease;
}

.start-task-btn:hover {
    background-color: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.5);
}

.recommendation-rationale {
    background-color: #1a1f26;
    border: 1px solid #2d3748;
    border-radius: 0.75rem;
    padding: 1.5rem;
    margin-top: 1.5rem;
}

.recommendation-rationale h4 {
    color: #e6e6e6;
    font-size: 1.125rem;
    font-weight: 600;
    margin: 0 0 1rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.recommendation-rationale i {
    color: #f59e0b;
}

.recommendation-rationale p {
    color: #9ca3af;
    line-height: 1.6;
    margin: 0 0 1rem 0;
}

.evidence-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.evidence-link {
    background-color: #374151;
    color: #60a5fa;
    padding: 0.25rem 0.75rem;
    border-radius: 0.375rem;
    font-size: 0.75rem;
    text-decoration: none;
    transition: background-color 0.2s ease;
}

.evidence-link:hover {
    background-color: #4b5563;
}

.alternative-recommendations h3 {
    color: #e6e6e6;
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0 0 1rem 0;
}

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

.alternative-task-card {
    background-color: #1a1f26;
    border: 1px solid #2d3748;
    border-radius: 0.75rem;
    padding: 1.5rem;
    transition: all 0.2s ease;
}

.alternative-task-card:hover {
    border-color: #3b82f6;
    transform: translateY(-1px);
}

/* Project Management Styles */
.project-view-toggles {
    display: flex;
    gap: 0.5rem;
}

.view-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background-color: #374151;
    border: none;
    border-radius: 0.375rem;
    color: #9ca3af;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.view-toggle:hover, .view-toggle.active {
    background-color: #3b82f6;
    color: white;
}

.project-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.search-input {
    background-color: #374151;
    border: 1px solid #4b5563;
    border-radius: 0.5rem;
    padding: 0.5rem 1rem;
    color: #1a1a1a;
    font-size: 0.875rem;
    min-width: 250px;
}

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

/* Project Board */
.board-columns {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    min-height: 500px;
}

.board-column {
    background-color: #1a1f26;
    border: 1px solid #2d3748;
    border-radius: 0.75rem;
    padding: 1rem;
}

.column-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #2d3748;
}

.column-title {
    color: #e6e6e6;
    font-weight: 600;
    margin: 0;
}

.task-count {
    background-color: #374151;
    color: #9ca3af;
    padding: 0.125rem 0.5rem;
    border-radius: 9999px;
    font-size: 0.75rem;
}

.project-card {
    /*background-color: #262b34;
    border: 1px solid #374151;*/
    border-radius: 0.5rem;
    padding: 1rem;
    margin-bottom: 0.75rem;
    cursor: grab;
    transition: all 0.2s ease;
}

.project-card:hover {
    border-color: #3b82f6;
    transform: translateY(-1px);
}

.project-card.dragging {
    opacity: 0.5;
    cursor: grabbing;
}

/* Projects Table */
.projects-table-container {
    background-color: #1a1f26;
    border: 1px solid #2d3748;
    border-radius: 0.75rem;
    overflow: hidden;
}

.projects-table {
    width: 100%;
    border-collapse: collapse;
}

.projects-table th {
    background-color: #374151;
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    color: #e6e6e6;
    font-size: 0.875rem;
    border-bottom: 1px solid #4b5563;
}

.projects-table td {
    padding: 1rem;
    border-bottom: 1px solid #2d3748;
    color: #e6e6e6;
    font-size: 0.875rem;
}

.projects-table tr:hover {
    background-color: #262b34;
}

.progress-bar {
    background-color: #374151;
    border-radius: 9999px;
    height: 8px;
    overflow: hidden;
    position: relative;
}

.progress-fill {
    background-color: #3b82f6;
    height: 100%;
    border-radius: 9999px;
    transition: width 0.3s ease;
}

/* Timeline View */
.timeline-container {
    background-color: #1a1f26;
    border: 1px solid #2d3748;
    border-radius: 0.75rem;
    padding: 1.5rem;
    min-height: 500px;
}

.timeline-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #2d3748;
}

.timeline-controls {
    display: flex;
    gap: 0.5rem;
}

.timeline-btn {
    padding: 0.5rem 1rem;
    background-color: #374151;
    border: none;
    border-radius: 0.375rem;
    color: #9ca3af;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.timeline-btn:hover, .timeline-btn.active {
    background-color: #3b82f6;
    color: white;
}

.timeline-content {
    position: relative;
    min-height: 400px;
}

/* Inbox View Styles */
.inbox-controls {
    display: flex;
    gap: 1rem;
}

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

.stat-card {
    background-color: #1a1f26;
    border: 1px solid #2d3748;
    border-radius: 0.75rem;
    padding: 1.5rem;
    text-align: center;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: #3b82f6;
    margin-bottom: 0.5rem;
}

.stat-label {
    color: #9ca3af;
    font-size: 0.875rem;
    font-weight: 500;
}

.inbox-task-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.inbox-task-item {
    background-color: #1a1f26;
    border: 1px solid #2d3748;
    border-radius: 0.75rem;
    padding: 1.5rem;
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 1.5rem;
    align-items: center;
    transition: all 0.2s ease;
}

.inbox-task-item:hover {
    border-color: #3b82f6;
    transform: translateY(-1px);
}

.inbox-task-item.unprocessed {
    border-left: 4px solid #f59e0b;
}

.inbox-task-item.reviewed {
    border-left: 4px solid #10b981;
}

.inbox-task-info h4 {
    color: #e6e6e6;
    font-size: 1.125rem;
    font-weight: 600;
    margin: 0 0 0.5rem 0;
}

.inbox-task-info p {
    color: #9ca3af;
    margin: 0 0 0.75rem 0;
    line-height: 1.5;
}

.inbox-task-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.75rem;
    color: #6b7280;
}

.priority-score-badge {
    background-color: #374151;
    color: #e6e6e6;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    font-weight: 600;
    text-align: center;
    min-width: 80px;
}

.priority-score-badge.high {
    background-color: #ef4444;
    color: white;
}

.priority-score-badge.medium {
    background-color: #f59e0b;
    color: white;
}

.priority-score-badge.low {
    background-color: #6b7280;
    color: white;
}

.inbox-task-actions {
    display: flex;
    gap: 0.5rem;
}

/* Edit Task Modal Styles */
.edit-task-modal {
    width: 700px;
    max-height: 90vh;
}

.edit-task-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    padding: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-label {
    color: #e6e6e6;
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.form-input,
.form-select,
.form-textarea {
    background-color: #374151;
    border: 1px solid #4b5563;
    border-radius: 0.5rem;
    padding: 0.75rem;
    color: #1a1a1a;
    font-size: 0.875rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

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

.form-input::placeholder,
.form-textarea::placeholder {
    color: #6b7280;
}

.form-textarea {
    resize: vertical;
    min-height: 100px;
}

.project-selection {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 1rem;
    align-items: center;
}

.project-separator {
    color: #9ca3af;
    font-size: 0.75rem;
    text-align: center;
    font-weight: 500;
}

/* Tags Management */
.tags-input-container {
    background-color: #374151;
    border: 1px solid #4b5563;
    border-radius: 0.5rem;
    padding: 0.75rem;
}

.current-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.tag-item {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    background-color: #3b82f6;
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 0.375rem;
    font-size: 0.75rem;
    font-weight: 500;
}

.tag-remove {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.8);
    cursor: pointer;
    padding: 0;
    margin-left: 0.25rem;
    font-size: 0.75rem;
    line-height: 1;
    transition: color 0.2s ease;
}

.tag-remove:hover {
    color: white;
}

.tag-input-row {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    margin-bottom: 0.75rem;
}

.tag-input-row .form-input {
    flex: 1;
    margin: 0;
}

.btn-small {
    padding: 0.5rem;
    font-size: 0.75rem;
    min-width: auto;
}

.suggested-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
}

.suggested-tag {
    background-color: #4b5563;
    color: #e6e6e6;
    padding: 0.25rem 0.5rem;
    border-radius: 0.375rem;
    font-size: 0.75rem;
    cursor: pointer;
    transition: background-color 0.2s ease;
    border: none;
}

.suggested-tag:hover {
    background-color: #6b7280;
}

/* Priority Display */
.priority-display {
    display: flex;
    align-items: center;
    gap: 1rem;
    background-color: #374151;
    border: 1px solid #4b5563;
    border-radius: 0.5rem;
    padding: 0.75rem;
}

.current-priority-score {
    font-size: 1.5rem;
    font-weight: 700;
    color: #3b82f6;
}

.btn-link {
    background: none;
    border: none;
    color: #60a5fa;
    cursor: pointer;
    font-size: 0.875rem;
    text-decoration: none;
    transition: color 0.2s ease;
}

.btn-link:hover {
    color: #93c5fd;
    text-decoration: underline;
}

/* Task Meta Info */
.task-meta-info {
    background-color: #374151;
    border: 1px solid #4b5563;
    border-radius: 0.5rem;
    padding: 0.75rem;
}

.meta-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.25rem 0;
    border-bottom: 1px solid #4b5563;
}

.meta-row:last-child {
    border-bottom: none;
}

.meta-label {
    color: #9ca3af;
    font-size: 0.75rem;
    font-weight: 500;
}

.meta-row span:last-child {
    color: #e6e6e6;
    font-size: 0.75rem;
}

/* Button Variants */
.btn-danger {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    background-color: #ef4444;
    color: white;
    border: 1px solid #dc2626;
}

.btn-danger:hover {
    background-color: #dc2626;
    border-color: #b91c1c;
}

/* Task Tabs Styles */
.task-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid #2d3748;
    padding-bottom: 0;
}

.task-tab {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: none;
    border: none;
    color: #9ca3af;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    border-radius: 0.5rem 0.5rem 0 0;
    transition: all 0.2s ease;
    position: relative;
    margin-bottom: -2px;
}

.task-tab:hover {
    background-color: #374151;
    color: #e6e6e6;
}

.task-tab.active {
    background-color: #1a1f26;
    color: #e6e6e6;
    border-bottom: 2px solid #3b82f6;
}

.task-tab .task-count {
    background-color: #4b5563;
    color: #e6e6e6;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.25rem 0.5rem;
    border-radius: 1rem;
    min-width: 1.5rem;
    text-align: center;
}

.task-tab.active .task-count {
    background-color: #3b82f6;
    color: white;
}

/* Sortable Table Styles */
.sortable {
    cursor: pointer;
    user-select: none;
    position: relative;
    transition: background-color 0.2s ease;
}

.sortable:hover {
    background-color: #374151;
}

.sort-icon {
    margin-left: 0.5rem;
    opacity: 0.5;
    font-size: 0.75rem;
}

.sortable.sort-asc .sort-icon {
    opacity: 1;
}

.sortable.sort-desc .sort-icon {
    opacity: 1;
}

.sortable.sort-asc .sort-icon::before {
    content: "\f0de"; /* fa-sort-up */
}

.sortable.sort-desc .sort-icon::before {
    content: "\f0dd"; /* fa-sort-down */
}

/* Timeline/Gantt Chart Styles */
.timeline-controls {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.timeline-filters {
    display: flex;
    gap: 1rem;
}

.timeline-scale-controls {
    display: flex;
    gap: 0.25rem;
    background-color: #374151;
    border-radius: 0.5rem;
    padding: 0.25rem;
}

.timeline-scale-btn {
    padding: 0.5rem 1rem;
    background: none;
    border: none;
    color: #9ca3af;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    border-radius: 0.375rem;
    transition: all 0.2s ease;
}

.timeline-scale-btn:hover {
    color: #e6e6e6;
    background-color: #4b5563;
}

.timeline-scale-btn.active {
    background-color: #3b82f6;
    color: white;
}

.gantt-container {
    display: flex;
    background-color: #ffffff;
    border: 1px solid #d1d5db;
    border-radius: 0.75rem;
    overflow: hidden;
    margin-bottom: 1.5rem;
    min-height: 400px;
    max-height: 70vh;
}

.gantt-sidebar {
    width: 350px;
    border-right: 1px solid #d1d5db;
    background-color: #ffffff;
    flex-shrink: 0;
}

.gantt-sidebar-header {
    display: flex;
    background-color: #f9fafb;
    padding: 1rem;
    border-bottom: 1px solid #d1d5db;
    font-weight: 600;
    color: #374151;
    font-size: 0.875rem;
    height: 60px;
    min-height: 60px;
    align-items: center;
}

.task-column {
    flex: 2;
    min-width: 0;
}

.duration-column {
    flex: 1;
    min-width: 0;
    text-align: center;
}

.gantt-sidebar-content {
    overflow-y: auto;
    max-height: calc(70vh - 60px);
}

.gantt-task-row {
    display: flex;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #d1d5db;
    align-items: center;
    transition: background-color 0.2s ease;
    cursor: pointer;
    min-height: 60px;
    height: 60px;
}

.gantt-task-row:hover {
    background-color: #f3f4f6;
}

.gantt-task-row.selected {
    background-color: #3b82f6;
    color: white;
}

.gantt-task-info {
    flex: 2;
    min-width: 0;
}

.gantt-task-title {
    font-weight: 500;
    color: #374151;
    font-size: 0.875rem;
    margin-bottom: 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.gantt-task-status {
    font-size: 0.75rem;
    color: #6b7280;
}

.gantt-duration-info {
    flex: 1;
    text-align: center;
    font-size: 0.75rem;
    color: #6b7280;
}

.gantt-chart {
    flex: 1;
    overflow-x: auto;
    background-color: #ffffff;
}

.gantt-header {
    display: flex;
    background-color: #f9fafb;
    border-bottom: 1px solid #d1d5db;
    position: sticky;
    top: 0;
    z-index: 10;
    height: 60px;
    min-height: 60px;
}

.gantt-time-unit {
    min-width: 80px;
    padding: 1rem 0.5rem;
    border-right: 1px solid #d1d5db;
    text-align: center;
    font-size: 0.75rem;
    color: #6b7280;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.gantt-time-unit.today {
    background-color: #3b82f6;
    color: white;
    font-weight: 600;
}

.gantt-content {
    position: relative;
    min-height: 400px;
}

.gantt-row {
    display: flex;
    border-bottom: 1px solid #d1d5db;
    min-height: 60px;
    height: 60px;
    position: relative;
}

.gantt-cell {
    min-width: 80px;
    border-right: 1px solid #d1d5db;
    position: relative;
}

.gantt-cell.today {
    background-color: rgba(59, 130, 246, 0.1);
}

.gantt-bar {
    position: absolute;
    height: 28px;
    border-radius: 4px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    padding: 0 0.5rem;
    font-size: 0.75rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: visible;
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 5;
}

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

.gantt-bar.pending {
    background-color: #3b82f6;
    color: white;
    border: 1px solid #2563eb;
}

.gantt-bar.completed {
    background-color: #10b981;
    color: white;
    border: 1px solid #059669;
}

.gantt-bar.overdue {
    background-color: #ef4444;
    color: white;
    border: 1px solid #dc2626;
}

.gantt-bar.milestone {
    background-color: #f59e0b;
    color: white;
    border: 1px solid #d97706;
    height: 20px;
    border-radius: 50%;
    width: 20px;
    padding: 0;
    justify-content: center;
}

.gantt-today-line {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 2px;
    background-color: #3b82f6;
    z-index: 15;
    pointer-events: none;
    opacity: 0.8;
}

.timeline-legend {
    display: flex;
    gap: 2rem;
    padding: 1rem;
    background-color: #f9fafb;
    border-radius: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: #374151;
}

.legend-color {
    width: 16px;
    height: 16px;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.legend-color.pending {
    background-color: #3b82f6;
}

.legend-color.completed {
    background-color: #10b981;
}

.legend-color.overdue {
    background-color: #ef4444;
}

.legend-color.milestone {
    background-color: #f59e0b;
    border-radius: 50%;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .gantt-container {
        flex-direction: column;
        max-height: none;
    }
    
    .gantt-sidebar {
        width: 100%;
        max-height: 200px;
    }
    
    .timeline-controls {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }
    
    .timeline-filters {
        flex-direction: column;
    }
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.modal-content {
    background-color: #1a1f26;
    border: 1px solid #2d3748;
    border-radius: 1rem;
    max-width: 90vw;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.task-detail-modal {
    width: 1200px;
    height: 800px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid #2d3748;
}

.modal-header h2 {
    color: #e6e6e6;
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    color: #9ca3af;
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 0.375rem;
    transition: all 0.2s ease;
}

.modal-close:hover {
    background-color: #374151;
    color: #e6e6e6;
}

.modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 0;
}

.task-detail-content {
    display: grid;
    grid-template-columns: 1fr 400px;
    height: 100%;
}

.task-info-column {
    padding: 1.5rem;
    border-right: 1px solid #2d3748;
    overflow-y: auto;
}

.prioritization-column {
    padding: 1.5rem;
    background-color: #0f1419;
    overflow-y: auto;
}

.task-description-section,
.evidence-section,
.audit-section,
.priority-section {
    margin-bottom: 2rem;
}

.task-description-section h3,
.evidence-section h3,
.audit-section h3,
.priority-section h4 {
    color: #e6e6e6;
    font-size: 1.125rem;
    font-weight: 600;
    margin: 0 0 1rem 0;
}

.priority-inputs {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.priority-input {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.priority-input label {
    color: #9ca3af;
    font-size: 0.875rem;
    font-weight: 500;
}

.priority-input input[type="range"] {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: #374151;
    outline: none;
    appearance: none;
    -webkit-appearance: none;
}

.priority-input input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #3b82f6;
    cursor: pointer;
}

.priority-input input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #3b82f6;
    cursor: pointer;
    border: none;
}

.range-value {
    color: #3b82f6;
    font-weight: 600;
    font-size: 0.875rem;
    text-align: center;
    background-color: #374151;
    padding: 0.25rem 0.5rem;
    border-radius: 0.375rem;
    min-width: 30px;
}

.priority-description {
    color: #9ca3af;
    font-size: 0.75rem;
    line-height: 1.4;
    font-style: italic;
    margin-top: 0.25rem;
    padding: 0.25rem 0;
}

.priority-score-section {
    background-color: #1a1f26;
    border: 1px solid #2d3748;
    border-radius: 0.75rem;
    padding: 1.5rem;
    text-align: center;
}

.priority-score-display {
    margin-bottom: 1rem;
}

.score-value {
    display: block;
    font-size: 3rem;
    font-weight: 700;
    color: #3b82f6;
    margin-bottom: 0.5rem;
}

.score-label {
    color: #9ca3af;
    font-size: 0.875rem;
}

.score-breakdown {
    font-size: 0.75rem;
    color: #6b7280;
    line-height: 1.4;
    margin-bottom: 1rem;
}

.scoring-explanation {
    border-top: 1px solid #374151;
    padding-top: 1rem;
    margin-top: 1rem;
}

.scoring-explanation h5 {
    color: #e6e6e6;
    font-size: 0.875rem;
    font-weight: 600;
    margin: 0 0 0.75rem 0;
}

.scoring-formula {
    background-color: #0f1419;
    border: 1px solid #374151;
    border-radius: 0.5rem;
    padding: 0.75rem;
    margin-bottom: 0.75rem;
}

.formula-line {
    color: #9ca3af;
    font-size: 0.75rem;
    line-height: 1.5;
    margin-bottom: 0.25rem;
    font-family: 'Courier New', monospace;
}

.formula-line:last-child {
    margin-bottom: 0;
}

.scoring-tips {
    color: #9ca3af;
    font-size: 0.75rem;
    line-height: 1.4;
    background-color: #0f1419;
    border-left: 3px solid #3b82f6;
    padding: 0.5rem 0.75rem;
    border-radius: 0 0.375rem 0.375rem 0;
}

.evidence-span {
    background-color: #374151;
    border: 1px solid #4b5563;
    border-radius: 0.375rem;
    padding: 0.75rem;
    margin-bottom: 0.75rem;
    font-size: 0.875rem;
}

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

.evidence-type {
    color: #60a5fa;
    font-weight: 600;
}

.evidence-timestamp {
    color: #9ca3af;
    font-size: 0.75rem;
}

.evidence-content {
    color: #e6e6e6;
    line-height: 1.5;
}

.audit-entry {
    background-color: #374151;
    border-left: 3px solid #3b82f6;
    border-radius: 0.375rem;
    padding: 0.75rem;
    margin-bottom: 0.75rem;
    font-size: 0.875rem;
}

.audit-timestamp {
    color: #9ca3af;
    font-size: 0.75rem;
    margin-bottom: 0.25rem;
}

.audit-action {
    color: #e6e6e6;
    font-weight: 500;
}

.audit-details {
    color: #9ca3af;
    font-size: 0.75rem;
    margin-top: 0.25rem;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    padding: 1.5rem;
    border-top: 1px solid #2d3748;
}

/* Command-K Styles */
.command-k-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 2000;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 20vh;
}

.command-k-modal {
    background-color: #1a1f26;
    border: 1px solid #2d3748;
    border-radius: 0.75rem;
    width: 600px;
    max-height: 400px;
    overflow: hidden;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.command-k-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #2d3748;
}

.command-k-header i {
    color: #9ca3af;
    font-size: 1.125rem;
}

.command-k-header input {
    flex: 1;
    background: none;
    border: none;
    color: #1a1a1a;
    font-size: 1rem;
    outline: none;
}

.command-k-header input::placeholder {
    color: #4b5563;
}

.command-k-results {
    max-height: 300px;
    overflow-y: auto;
    padding: 0.5rem 0;
}

.command-category {
    margin-bottom: 1rem;
}

.category-title {
    color: #9ca3af;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.5rem 1.5rem;
    margin-bottom: 0.25rem;
}

.command-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1.5rem;
    color: #e6e6e6;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.command-item:hover,
.command-item.selected {
    background-color: #374151;
}

.command-item i {
    color: #9ca3af;
    width: 1rem;
    text-align: center;
}

.command-item span {
    flex: 1;
}

.command-item kbd {
    background-color: #374151;
    border: 1px solid #4b5563;
    border-radius: 0.25rem;
    padding: 0.125rem 0.375rem;
    font-size: 0.75rem;
    color: #9ca3af;
}

/* Scrollable tasks list on project page to prevent layout shift */
.tasks-scroll {
  max-height: 70vh;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 4px; /* avoid scrollbar overlaying content */
}

/* Optional: subtle fade-in for newly rendered items */
.task-item {
  animation: taskFadeIn 150ms ease-in;
}

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

/* Priority chip styles */
.priority-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  border: 1px solid transparent;
}
/* Use more specific selectors to avoid inheritance/utility overrides */
.priority-chip.priority-critical { color: #991b1b !important; background: #fee2e2 !important; border-color: #fca5a5 !important; }
.priority-chip.priority-high     { color: #9a3412 !important; background: #ffedd5 !important; border-color: #fdba74 !important; }
.priority-chip.priority-medium   { color: #92400e !important; background: #fef3c7 !important; border-color: #fcd34d !important; }
.priority-chip.priority-low      { color: #065f46 !important; background: #d1fae5 !important; border-color: #6ee7b7 !important; }

/* Overdue due-date style */
.due-overdue { color: #dc2626; /* red-600 */ font-weight: 600; }

/* Add 30px margin bottom to p-6 sections */
.p-6 {
  margin-bottom: 30px;
}

/* RAG System Styles */
.rag-insights-panel {
    position: fixed !important;
    top: 20px !important;
    right: 20px !important;
    width: 500px !important;
    max-width: 95vw !important;
    max-height: 90vh !important;
    background: white !important;
    border: 1px solid #e5e7eb !important;
    border-radius: 12px !important;
    box-shadow: 0 10px 25px rgba(0,0,0,0.15) !important;
    z-index: 9999 !important;
    overflow: hidden !important;
    display: block !important;
}

.rag-panel-header {
    background: #2563eb;
    color: white;
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.rag-panel-header h3 {
    margin: 0;
    font-size: 16px;
}

.close-btn {
    background: none;
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    padding: 0;
    width: 25px;
    height: 25px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-btn:hover {
    background: rgba(255,255,255,0.2);
    border-radius: 4px;
}

.rag-panel-content {
    max-height: 75vh;
    overflow-y: auto;
    padding: 24px;
    line-height: 1.5;
}

.rag-section {
    margin-bottom: 25px;
    border-bottom: 1px solid #eee;
    padding-bottom: 20px;
}

.rag-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.rag-section h4 {
    margin: 0 0 15px 0;
    color: #333;
    font-size: 14px;
    font-weight: 600;
}

.rag-stats {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: #f8f9fa;
    border-radius: 4px;
}

.stat-label {
    font-size: 13px;
    color: #666;
}

.stat-value {
    font-weight: 600;
    color: #2563eb;
}

.rag-search {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.rag-search input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 13px;
}

.rag-search button {
    padding: 8px 16px;
    background: #2563eb;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
}

.rag-search button:hover {
    background: #1d4ed8;
}

.rag-add-knowledge {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.rag-add-knowledge textarea {
    min-height: 80px;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    resize: vertical;
    font-size: 13px;
}

.rag-add-knowledge select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 13px;
}

.rag-add-knowledge button {
    padding: 10px 16px;
    background: #16a34a;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
}

.rag-add-knowledge button:hover {
    background: #15803d;
}

.rag-result {
    margin-bottom: 15px;
    padding: 12px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    background: #fafafa;
}

.rag-result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.rag-result-type {
    background: #2563eb;
    color: white;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    text-transform: uppercase;
}

.rag-result-score {
    font-size: 11px;
    color: #666;
}

.rag-result-content {
    font-size: 13px;
    line-height: 1.4;
    margin-bottom: 8px;
    color: #333;
}

.rag-result-meta {
    font-size: 11px;
    color: #888;
}

.loading {
    text-align: center;
    padding: 20px;
    color: #666;
    font-style: italic;
}

.no-results {
    text-align: center;
    padding: 20px;
    color: #888;
    font-style: italic;
}

.error {
    color: #dc2626;
    background: #fef2f2;
    padding: 10px;
    border-radius: 4px;
    font-size: 13px;
}

.feedback-buttons {
    display: flex;
    gap: 5px;
    justify-content: flex-end;
    margin-top: 10px;
}

.feedback-btn {
    background: none;
    border: 1px solid #ddd;
    padding: 5px 8px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

.feedback-btn:hover {
    background: #f0f0f0;
}

.feedback-btn.positive:hover {
    background: #dcfce7;
    border-color: #16a34a;
}

.feedback-btn.negative:hover {
    background: #fef2f2;
    border-color: #dc2626;
}

.feedback-btn.detailed:hover {
    background: #eff6ff;
    border-color: #2563eb;
}

/* Responsive adjustments for RAG panel */
@media (max-width: 768px) {
    .rag-insights-panel {
        width: 95vw;
        right: 2.5vw;
        max-height: 70vh;
    }
    
    .rag-search {
        flex-direction: column;
    }
    
    .rag-search button {
        width: 100%;
    }
}