/**
 * Task Management System Styles
 * Professional task tracking with Kanban/Table views, filtering, and KPI dashboard
 */

/* ============================================
   CSS Variables - Director Colors (from Blueprint)
   ============================================ */
:root {
    --director-seo: #0e1369;
    --director-leadgen: #7c3aed;
    --director-ads: #dc2626;
    --director-social: #0891b2;
    --director-content: #059669;
    --director-design: #d946ef;
    --director-sales: #f59e0b;
    --director-competitors: #6366f1;
    
    --task-planned: #64748b;
    --task-in-progress: #0891b2;
    --task-completed: #059669;
    
    --priority-high: #dc2626;
    --priority-medium: #f59e0b;
    --priority-low: #64748b;
}

/* ============================================
   Task Management Container
   ============================================ */
.task-management-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    padding: 1rem 0;
}

/* ============================================
   KPI Stats Dashboard
   ============================================ */
.task-kpi-dashboard {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.kpi-card {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.kpi-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--kpi-color, #0e1369);
}

.kpi-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

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

.kpi-label {
    font-size: 0.8rem;
    color: #64748b;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.kpi-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--kpi-color, #0e1369);
    color: white;
    font-size: 0.9rem;
}

.kpi-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: #1e293b;
    line-height: 1;
}

.kpi-trend {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.75rem;
    font-weight: 500;
}

.kpi-trend.up {
    color: #059669;
}

.kpi-trend.down {
    color: #dc2626;
}

.kpi-trend.neutral {
    color: #64748b;
}

/* Completion Rate Ring */
.kpi-progress-ring {
    width: 48px;
    height: 48px;
    position: relative;
}

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

.kpi-progress-ring .ring-bg {
    fill: none;
    stroke: #e2e8f0;
    stroke-width: 4;
}

.kpi-progress-ring .ring-fill {
    fill: none;
    stroke: var(--kpi-color, #059669);
    stroke-width: 4;
    stroke-linecap: round;
    transition: stroke-dasharray 0.5s ease;
}

.kpi-progress-value {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 0.7rem;
    font-weight: 600;
    color: #1e293b;
}

/* Mini Bar Chart */
.kpi-mini-chart {
    display: flex;
    align-items: flex-end;
    gap: 3px;
    height: 40px;
    margin-top: 0.5rem;
}

.kpi-bar {
    flex: 1;
    border-radius: 2px 2px 0 0;
    min-height: 4px;
    transition: height 0.3s ease;
}

/* ============================================
   Toolbar - Filters & View Toggle
   ============================================ */
.task-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
}

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

.filter-group {
    position: relative;
}

.filter-select {
    appearance: none;
    padding: 0.5rem 2rem 0.5rem 0.75rem;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #f8fafc url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 0.5rem center;
    background-size: 1rem;
    font-size: 0.875rem;
    color: #334155;
    cursor: pointer;
    min-width: 140px;
    transition: all 0.2s ease;
}

.filter-select:hover {
    border-color: #0e1369;
}

.filter-select:focus {
    outline: none;
    border-color: #0e1369;
    box-shadow: 0 0 0 3px rgba(14, 19, 105, 0.1);
}

.filter-search {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #f8fafc;
    min-width: 200px;
}

.filter-search input {
    border: none;
    background: transparent;
    font-size: 0.875rem;
    color: #334155;
    width: 100%;
}

.filter-search input:focus {
    outline: none;
}

.filter-search i {
    color: #64748b;
    font-size: 0.875rem;
}

.filter-clear-btn {
    padding: 0.5rem 0.75rem;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: transparent;
    color: #64748b;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.filter-clear-btn:hover {
    background: #fee2e2;
    border-color: #fca5a5;
    color: #dc2626;
}

/* View Toggle */
.view-toggle-group {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem;
    background: #f1f5f9;
    border-radius: 8px;
}

.view-toggle-btn {
    padding: 0.5rem 0.75rem;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: #64748b;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.8rem;
    font-weight: 500;
}

.view-toggle-btn:hover {
    color: #334155;
}

.view-toggle-btn.active {
    background: #ffffff;
    color: #0e1369;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* ============================================
   Date Range Selector
   ============================================ */
.task-date-selector {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.25rem;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    flex-wrap: wrap;
}

.date-range-quick-filters {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.date-range-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: #334155;
    margin-right: 0.5rem;
}

.date-quick-btn {
    padding: 0.5rem 1rem;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #f8fafc;
    color: #64748b;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.date-quick-btn:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
    color: #334155;
}

.date-quick-btn.active {
    background: #0e1369;
    border-color: #0e1369;
    color: white;
}

.date-range-custom {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.date-picker-wrapper {
    position: relative;
}

.date-picker-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #ffffff;
    color: #334155;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.date-picker-btn:hover {
    border-color: #0e1369;
}

.date-picker-btn i {
    color: #64748b;
}

.date-range-display {
    font-weight: 500;
}

/* Calendar Popup */
.calendar-popup {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    padding: 1rem;
    z-index: 100;
    min-width: 300px;
    display: none;
}

.calendar-popup.open {
    display: block;
}

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

.calendar-popup-title {
    font-weight: 600;
    color: #1e293b;
}

.calendar-popup-nav {
    display: flex;
    gap: 0.5rem;
}

.calendar-nav-btn {
    width: 28px;
    height: 28px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    background: #ffffff;
    color: #64748b;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.calendar-nav-btn:hover {
    background: #f1f5f9;
    border-color: #0e1369;
    color: #0e1369;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
}

.calendar-grid-header {
    font-size: 0.7rem;
    font-weight: 600;
    color: #64748b;
    text-align: center;
    padding: 0.5rem 0;
    text-transform: uppercase;
}

.calendar-grid-day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
    color: #334155;
}

.calendar-grid-day:hover {
    background: #f1f5f9;
}

.calendar-grid-day.other-month {
    color: #cbd5e1;
}

.calendar-grid-day.today {
    background: #0e1369;
    color: white;
    font-weight: 600;
}

.calendar-grid-day.selected {
    background: #0891b2;
    color: white;
}

.calendar-grid-day.in-range {
    background: rgba(8, 145, 178, 0.1);
}

.calendar-grid-day.range-start,
.calendar-grid-day.range-end {
    background: #0891b2;
    color: white;
}

/* ============================================
   Kanban Board View
   ============================================ */
.task-kanban-board {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
    min-height: 500px;
}

.kanban-column {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.kanban-column-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    background: #ffffff;
    border-bottom: 1px solid #e2e8f0;
}

.kanban-column-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    font-size: 0.9rem;
    color: #334155;
}

.kanban-column-title i {
    font-size: 0.8rem;
}

.kanban-column.planned .kanban-column-title i { color: var(--task-planned); }
.kanban-column.in-progress .kanban-column-title i { color: var(--task-in-progress); }
.kanban-column.completed .kanban-column-title i { color: var(--task-completed); }

.kanban-column-count {
    background: #e2e8f0;
    color: #64748b;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

.kanban-column.planned .kanban-column-count { background: rgba(100, 116, 139, 0.1); color: var(--task-planned); }
.kanban-column.in-progress .kanban-column-count { background: rgba(8, 145, 178, 0.1); color: var(--task-in-progress); }
.kanban-column.completed .kanban-column-count { background: rgba(5, 150, 105, 0.1); color: var(--task-completed); }

.kanban-column-content {
    flex: 1;
    padding: 0.75rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-height: 520px;
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 transparent;
}

.kanban-column-content::-webkit-scrollbar {
    width: 6px;
}

.kanban-column-content::-webkit-scrollbar-track {
    background: transparent;
    border-radius: 3px;
}

.kanban-column-content::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

.kanban-column-content::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* ============================================
   Task Cards
   ============================================ */
.task-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.task-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    border-color: #cbd5e1;
}

.task-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    border-radius: 10px 0 0 10px;
    background: var(--director-color, #64748b);
}

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

.task-director-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 600;
    background: var(--director-bg, rgba(14, 19, 105, 0.1));
    color: var(--director-color, #0e1369);
}

.task-priority-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.task-priority-dot.high { background: var(--priority-high); }
.task-priority-dot.medium { background: var(--priority-medium); }
.task-priority-dot.low { background: var(--priority-low); }

.task-card-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 0.5rem;
    line-height: 1.3;
}

.task-card-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.75rem;
    color: #64748b;
}

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

.task-card-actions {
    display: flex;
    gap: 0.25rem;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid #f1f5f9;
}

.task-action-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.2rem 0.4rem;
    background: #f1f5f9;
    border-radius: 4px;
    font-size: 0.65rem;
    color: #64748b;
}

/* Director Color Variations */
.task-card[data-director="organic-search"] { --director-color: var(--director-seo); --director-bg: rgba(14, 19, 105, 0.1); }
.task-card[data-director="lead-gen"] { --director-color: var(--director-leadgen); --director-bg: rgba(124, 58, 237, 0.1); }
.task-card[data-director="paid-ads"] { --director-color: var(--director-ads); --director-bg: rgba(220, 38, 38, 0.1); }
.task-card[data-director="social-media"] { --director-color: var(--director-social); --director-bg: rgba(8, 145, 178, 0.1); }
.task-card[data-director="website-content"] { --director-color: var(--director-content); --director-bg: rgba(5, 150, 105, 0.1); }
.task-card[data-director="website-design"] { --director-color: var(--director-design); --director-bg: rgba(217, 70, 239, 0.1); }
.task-card[data-director="sales"] { --director-color: var(--director-sales); --director-bg: rgba(245, 158, 11, 0.1); }

/* ============================================
   Table List View
   ============================================ */
.task-table-container {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
}

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

.task-table th {
    text-align: left;
    padding: 1rem;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #64748b;
    cursor: pointer;
    user-select: none;
    transition: all 0.2s ease;
}

.task-table th:hover {
    background: #f1f5f9;
    color: #334155;
}

.task-table th.sorted {
    color: #0e1369;
}

.task-table th i {
    margin-left: 0.375rem;
    font-size: 0.7rem;
}

.task-table td {
    padding: 1rem;
    border-bottom: 1px solid #f1f5f9;
    font-size: 0.875rem;
    color: #334155;
    vertical-align: middle;
}

.task-table tr {
    cursor: pointer;
    transition: background 0.2s ease;
}

.task-table tbody tr:hover {
    background: #f8fafc;
}

.task-table-title {
    font-weight: 600;
    color: #1e293b;
}

.task-table-status {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.25rem 0.625rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
}

.task-table-status.planned {
    background: rgba(100, 116, 139, 0.1);
    color: var(--task-planned);
}

.task-table-status.in-progress {
    background: rgba(8, 145, 178, 0.1);
    color: var(--task-in-progress);
}

.task-table-status.completed {
    background: rgba(5, 150, 105, 0.1);
    color: var(--task-completed);
}

.task-table-director {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
}

.task-table-director-icon {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    color: white;
}

/* ============================================
   Task Detail Panel (Slide-out)
   ============================================ */
.task-detail-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.task-detail-overlay.open {
    opacity: 1;
    visibility: visible;
}

.task-detail-panel {
    position: fixed;
    top: 0;
    right: -500px;
    width: 500px;
    max-width: 90vw;
    height: 100vh;
    background: #ffffff;
    box-shadow: -4px 0 24px rgba(0, 0, 0, 0.15);
    z-index: 1001;
    display: flex;
    flex-direction: column;
    transition: right 0.3s ease;
}

.task-detail-overlay.open .task-detail-panel {
    right: 0;
}

.task-detail-header {
    padding: 1.5rem;
    background: linear-gradient(135deg, var(--director-color, #0e1369) 0%, var(--director-dark, #0a0e4a) 100%);
    color: white;
    position: relative;
}

.task-detail-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.task-detail-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

.task-detail-director-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.625rem;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 500;
    margin-bottom: 0.75rem;
}

.task-detail-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    line-height: 1.3;
}

.task-detail-status {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.25rem 0.625rem;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
}

.task-detail-body {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
}

.task-detail-section {
    margin-bottom: 1.5rem;
}

.task-detail-section-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #64748b;
    margin-bottom: 0.75rem;
}

.task-detail-section-title i {
    color: var(--director-color, #0e1369);
}

/* Why We Need This */
.task-why-needed {
    background: linear-gradient(135deg, #fef9c3 0%, #fef3c7 100%);
    border: 1px solid #fde047;
    border-radius: 10px;
    padding: 1rem;
}

.task-why-needed-icon {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    color: #a16207;
    margin-bottom: 0.5rem;
}

.task-why-needed-text {
    font-size: 0.9rem;
    color: #78350f;
    line-height: 1.5;
}

/* Agent Hierarchy */
.task-agent-hierarchy {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: #f8fafc;
    border-radius: 10px;
}

.agent-node {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.375rem;
}

.agent-node-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: white;
}

.agent-node-name {
    font-size: 0.75rem;
    font-weight: 600;
    color: #334155;
    text-align: center;
}

.agent-node-role {
    font-size: 0.65rem;
    color: #64748b;
}

.agent-connector {
    display: flex;
    align-items: center;
    color: #cbd5e1;
}

.agent-connector i {
    font-size: 1.25rem;
}

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

.task-timeline::before {
    content: '';
    position: absolute;
    left: 0.5rem;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #e2e8f0;
}

.task-timeline-item {
    position: relative;
    padding-bottom: 1rem;
    padding-left: 1rem;
}

.task-timeline-item::before {
    content: '';
    position: absolute;
    left: -1.125rem;
    top: 0.25rem;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #e2e8f0;
    border: 2px solid white;
}

.task-timeline-item.completed::before {
    background: var(--task-completed);
}

.task-timeline-item.in-progress::before {
    background: var(--task-in-progress);
}

.task-timeline-item.planned::before {
    background: var(--task-planned);
}

.task-timeline-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
}

.task-timeline-value {
    font-size: 0.875rem;
    color: #334155;
}

.task-timeline-duration {
    font-size: 0.75rem;
    color: #64748b;
    margin-top: 0.125rem;
}

/* Action Groups */
.task-action-groups {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.action-group-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.5rem 0.75rem;
    background: #f1f5f9;
    border-radius: 8px;
    font-size: 0.8rem;
    color: #475569;
    transition: all 0.2s ease;
}

.action-group-chip i {
    color: var(--director-color, #0e1369);
}

.action-group-chip:hover {
    background: #e2e8f0;
}

/* Completion Report */
.task-completion-report {
    background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
    border: 1px solid #6ee7b7;
    border-radius: 10px;
    padding: 1rem;
}

.task-completion-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    color: #047857;
    margin-bottom: 0.75rem;
}

.task-completion-summary {
    font-size: 0.9rem;
    color: #065f46;
    line-height: 1.5;
    margin-bottom: 1rem;
}

.task-completion-actions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.completion-action-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 6px;
    font-size: 0.8rem;
    color: #065f46;
}

.completion-action-item i {
    color: #059669;
}

/* Live Link - Task Card */
.task-card-live-link {
    margin-top: 0.5rem;
    padding: 0.4rem 0.75rem;
    background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
    border: 1px solid #6ee7b7;
    border-radius: 6px;
}

.task-card-live-link a {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    color: #047857;
    font-size: 0.8rem;
    font-weight: 600;
    text-decoration: none;
    transition: color 0.2s;
}

.task-card-live-link a:hover {
    color: #059669;
    text-decoration: underline;
}

/* Live Link - Completion Report Detail */
.task-completion-live-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    margin-bottom: 0.75rem;
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid #6ee7b7;
    border-radius: 8px;
}

.task-completion-live-link a {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    color: #047857;
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    transition: color 0.2s;
}

.task-completion-live-link a:hover {
    color: #059669;
    text-decoration: underline;
}

.task-completion-url-text {
    font-size: 0.8rem;
    color: #6b7280;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.task-completion-post-id {
    font-size: 0.8rem;
    color: #6b7280;
    margin-bottom: 0.75rem;
}

.task-completion-post-id i {
    color: #9ca3af;
    margin-right: 0.25rem;
}

/* No URL state */
.task-completion-live-link.no-url {
    background: rgba(255, 255, 255, 0.4);
    border: 1px dashed #d1d5db;
}

.task-completion-no-url {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.85rem;
    color: #9ca3af;
    font-style: italic;
}

.task-completion-no-url i {
    font-size: 0.8rem;
}

/* Published Images */
.task-completion-images {
    margin-bottom: 0.75rem;
}

.task-completion-images-label {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: #047857;
    margin-bottom: 0.5rem;
}

.task-completion-images-grid {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.task-completion-image-thumb {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid #6ee7b7;
    background: #f0fdf4;
    transition: transform 0.2s, box-shadow 0.2s;
    text-decoration: none;
}

.task-completion-image-thumb:hover {
    transform: scale(1.08);
    box-shadow: 0 4px 12px rgba(5, 150, 105, 0.25);
    border-color: #059669;
}

.task-completion-image-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.task-completion-image-thumb.broken {
    flex-direction: column;
    gap: 0.2rem;
    cursor: default;
    border-color: #d1d5db;
    background: #f9fafb;
}

.task-completion-image-thumb.broken i {
    font-size: 1.2rem;
    color: #9ca3af;
}

.task-completion-image-thumb.broken span {
    font-size: 0.55rem;
    color: #9ca3af;
    text-align: center;
    line-height: 1.1;
}

/* ============================================
   Agent-Generated Files in Completion Report
   ============================================ */
.task-completion-files {
    margin-bottom: 0.75rem;
}

.task-completion-files-label {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: #0891b2;
    margin-bottom: 0.5rem;
}

.task-completion-file-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 0.6rem 0.75rem;
    margin-bottom: 0.4rem;
    transition: border-color 0.2s;
}

.task-completion-file-item:hover {
    border-color: #06b8a0;
}

.task-file-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #06b8a0, #0891b2);
    border-radius: 6px;
    color: #fff;
    font-size: 14px;
    flex-shrink: 0;
}

.task-file-info {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
}

.task-file-name {
    color: #1e293b !important;
    font-weight: 600;
    font-size: 0.8rem;
    text-decoration: none !important;
    cursor: pointer;
}

.task-file-name:hover {
    color: #06b8a0 !important;
}

.task-file-desc {
    color: #64748b;
    font-size: 0.7rem;
    margin-top: 1px;
}

.task-file-download-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: #06b8a0;
    border-radius: 6px;
    color: #fff !important;
    text-decoration: none !important;
    font-size: 12px;
    flex-shrink: 0;
    transition: background 0.2s;
}

.task-file-download-btn:hover {
    background: #059283;
}

/* Action Links in Completion Report */
.task-completion-action-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 0.75rem;
}

.task-action-link-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: #fff !important;
    text-decoration: none !important;
    padding: 0.4rem 0.75rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    transition: transform 0.15s, box-shadow 0.2s;
}

.task-action-link-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(59, 130, 246, 0.3);
}

.task-action-link-btn i {
    font-size: 0.65rem;
}

/* ============================================
   Template-Aware Completion Report Fields
   ============================================ */
.task-completion-template-fields {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #e5e7eb;
}

.task-template-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.3rem 0.75rem;
    background: linear-gradient(135deg, #0e1369 0%, #1e40af 100%);
    color: #ffffff;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    letter-spacing: 0.02em;
}

.task-template-badge i {
    font-size: 0.7rem;
    opacity: 0.85;
}

.task-template-details {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.task-template-field {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    padding: 0.5rem 0.65rem;
    background: #f8fafc;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
}

.task-template-field-label {
    font-size: 0.7rem;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.task-template-field-label i {
    font-size: 0.65rem;
    color: #94a3b8;
}

.task-template-field-value {
    font-size: 0.85rem;
    color: #1e293b;
    font-weight: 500;
    word-break: break-word;
}

.task-template-field-link {
    font-size: 0.8rem;
    color: #2563eb;
    text-decoration: none;
    word-break: break-all;
    transition: color 0.15s;
}

.task-template-field-link:hover {
    color: #1d4ed8;
    text-decoration: underline;
}

.task-template-metrics {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.task-template-metric {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.15rem;
    padding: 0.5rem 0.75rem;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 8px;
    min-width: 80px;
    text-align: center;
}

.task-template-metric i {
    font-size: 0.75rem;
    color: #16a34a;
}

.task-template-metric-value {
    font-size: 0.95rem;
    font-weight: 700;
    color: #15803d;
}

.task-template-metric-label {
    font-size: 0.6rem;
    font-weight: 600;
    color: #4ade80;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* ============================================
   Empty States
   ============================================ */
.task-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    text-align: center;
    color: #64748b;
}

.task-empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.3;
}

.task-empty-state h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #334155;
    margin-bottom: 0.5rem;
}

.task-empty-state p {
    font-size: 0.875rem;
    max-width: 300px;
}

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 1024px) {
    .task-kanban-board {
        grid-template-columns: 1fr;
    }
    
    .kanban-column {
        max-height: 400px;
    }
    
    .task-kpi-dashboard {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .task-toolbar {
        flex-direction: column;
        align-items: stretch;
    }
    
    .task-filters {
        flex-direction: column;
    }
    
    .filter-select,
    .filter-search {
        width: 100%;
    }
    
    .task-kpi-dashboard {
        grid-template-columns: 1fr;
    }
    
    .task-detail-panel {
        width: 100%;
        max-width: 100%;
    }
    
    .task-table {
        display: block;
        overflow-x: auto;
    }
}

/* ============================================
   Animations
   ============================================ */
@keyframes taskCardEnter {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.task-card {
    animation: taskCardEnter 0.3s ease forwards;
}

@keyframes pulseProgress {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

.task-table-status.in-progress::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
    animation: pulseProgress 1.5s ease infinite;
}

/* ============================================
   Larger Director Badge (for task cards)
   ============================================ */
.task-director-badge-large {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.875rem;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    background: var(--director-bg, rgba(14, 19, 105, 0.15));
    color: var(--director-color, #0e1369);
}

.task-director-badge-large i {
    font-size: 1rem;
}

/* ============================================
   Start Task Button (on card)
   ============================================ */
.task-card-start-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    margin-top: 0.75rem;
    padding: 0.625rem 1rem;
    background: linear-gradient(135deg, #0e1369 0%, #1e40af 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.task-card-start-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(14, 19, 105, 0.3);
}

.task-card-start-btn:active {
    transform: translateY(0);
}

/* ============================================
   Start Task Button (in detail panel)
   ============================================ */
.task-detail-start-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.625rem;
    width: 100%;
    padding: 1rem 1.5rem;
    background: linear-gradient(135deg, #0e1369 0%, #1e40af 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.task-detail-start-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(14, 19, 105, 0.35);
}

.task-detail-start-btn:active {
    transform: translateY(0);
}

.task-detail-start-btn i {
    font-size: 1.1rem;
}

/* ============================================
   Task Plan Section (for planned/in_progress)
   ============================================ */
.task-plan-report {
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    border: 1px solid #93c5fd;
    border-radius: 10px;
    padding: 1rem;
}

.task-plan-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    color: #1e40af;
    margin-bottom: 0.75rem;
}

.task-plan-summary {
    font-size: 0.9rem;
    color: #1e3a8a;
    line-height: 1.6;
    margin-bottom: 1rem;
}

.task-plan-steps {
    margin-bottom: 1rem;
}

.task-plan-steps-title {
    font-size: 0.8rem;
    font-weight: 600;
    color: #1e40af;
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.plan-step-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.625rem;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 8px;
    margin-bottom: 0.5rem;
    font-size: 0.85rem;
    color: #1e3a8a;
}

.plan-step-number {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 24px;
    background: #1e40af;
    color: white;
    border-radius: 50%;
    font-size: 0.75rem;
    font-weight: 600;
}

.plan-step-text {
    flex: 1;
    line-height: 1.5;
}

.plan-step-text i {
    color: #1e40af;
    margin-right: 0.375rem;
}

.task-plan-outcome {
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 8px;
    font-size: 0.85rem;
    color: #1e3a8a;
    line-height: 1.5;
}

.task-plan-outcome i {
    color: #1e40af;
}

/* ============================================
   Recurring Task Indicators
   ============================================ */

/* Card meta - recurring indicator */
.task-card-meta-item.recurring {
    color: #7c3aed;
}

.task-card-meta-item.recurring i {
    color: #7c3aed;
}

.task-card-meta-item.single-run {
    color: #64748b;
}

.task-card-meta-item.single-run i {
    color: #64748b;
}

/* Detail panel badges container */
.task-detail-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

/* Detail panel recurring badge */
.task-detail-recurring {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.25rem 0.625rem;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
}

.task-detail-recurring.is-recurring {
    background: rgba(124, 58, 237, 0.3);
}

.task-detail-recurring.is-recurring i {
    animation: spin 2s linear infinite;
}

.task-detail-recurring.single-run {
    background: rgba(255, 255, 255, 0.15);
}

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

/* ============================================
   Approval Config Section
   ============================================ */
.task-approval-config {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.approval-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    font-size: 0.9rem;
}

.approval-status.auto {
    color: #059669;
}

.approval-status.auto i {
    color: #059669;
}

.approval-status.manual {
    color: #d97706;
}

.approval-status.manual i {
    color: #d97706;
}

.approval-approver,
.approval-type {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: #64748b;
}

.approval-approver i,
.approval-type i {
    color: #94a3b8;
    width: 16px;
}

/* Failed column styling */
.kanban-column.failed .kanban-column-header {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
}

.kanban-column.failed .kanban-column-count {
    background: rgba(255, 255, 255, 0.3);
}

/* ============================================
   Revise Button Styles
   ============================================ */

/* Kanban Card Revise Button */
.task-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.5rem;
}

.task-revise-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    color: #475569;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    flex-shrink: 0;
}

.task-revise-btn:hover {
    background: linear-gradient(135deg, #0e1369 0%, #1e3a8a 100%);
    border-color: #0e1369;
    color: #ffffff;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(14, 19, 105, 0.3);
}

.task-revise-icon {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    object-fit: contain;
}

/* Table View Revise Button */
.task-revise-btn-table {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    color: #475569;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.task-revise-btn-table:hover {
    background: linear-gradient(135deg, #0e1369 0%, #1e3a8a 100%);
    border-color: #0e1369;
    color: #ffffff;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(14, 19, 105, 0.3);
}

.task-revise-icon-small {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    object-fit: contain;
}

/* Task Parameters */
.task-params-grid {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.task-param-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.6rem 0.75rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.875rem;
}

.task-param-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    color: #475569;
    white-space: nowrap;
}

.task-param-label i {
    color: var(--director-color, #0e1369);
    width: 16px;
    text-align: center;
}

.task-param-value {
    color: #1e293b;
    text-align: right;
    max-width: 60%;
    overflow: hidden;
    text-overflow: ellipsis;
}

.task-param-template-select {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.task-param-dropdown {
    padding: 0.35rem 0.6rem;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 0.8rem;
    color: #1e293b;
    background: white;
    cursor: pointer;
    max-width: 200px;
    transition: border-color 0.2s;
}

.task-param-dropdown:hover,
.task-param-dropdown:focus {
    border-color: var(--director-color, #0e1369);
    outline: none;
}

.task-param-save-status {
    font-size: 0.8rem;
    min-width: 18px;
}

.task-param-save-status.saving {
    color: #3b82f6;
}

.task-param-save-status.saved {
    color: #22c55e;
}

.task-param-save-status.error {
    color: #ef4444;
}

.task-param-empty {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem;
    background: #f1f5f9;
    border-radius: 8px;
    color: #64748b;
    font-size: 0.85rem;
    font-style: italic;
    margin-bottom: 0.5rem;
}

.task-param-empty i {
    color: #94a3b8;
}

/* Dark mode */
[data-theme="dark"] .task-param-row {
    background: #1e293b;
    border-color: #334155;
}

[data-theme="dark"] .task-param-label {
    color: #94a3b8;
}

[data-theme="dark"] .task-param-value {
    color: #e2e8f0;
}

[data-theme="dark"] .task-param-dropdown {
    background: #0f172a;
    border-color: #475569;
    color: #e2e8f0;
}

[data-theme="dark"] .task-param-empty {
    background: #1e293b;
    color: #94a3b8;
}

/* ============================================
   Selection Mode
   ============================================ */

/* Select mode button */
.select-mode-btn {
    border-left: 1px solid #e2e8f0 !important;
    margin-left: 4px !important;
}

.select-mode-btn.active {
    background: #ef4444 !important;
    color: white !important;
    border-color: #ef4444 !important;
}

/* Task card checkbox */
.task-card.selection-mode {
    cursor: pointer;
    position: relative;
}

.task-card.selection-mode:hover {
    border-color: #3b82f6;
}

.task-card.selected {
    border-color: #3b82f6 !important;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.25), 0 2px 8px rgba(59, 130, 246, 0.15) !important;
    background: linear-gradient(135deg, #eff6ff 0%, #f8fafc 100%) !important;
}

.task-card-checkbox {
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 1.2rem;
    color: #94a3b8;
    cursor: pointer;
    z-index: 2;
    transition: color 0.15s;
}

.task-card.selected .task-card-checkbox {
    color: #3b82f6;
}

.task-card-checkbox:hover {
    color: #3b82f6;
}

/* Table row selection */
.task-table-checkbox-col {
    width: 36px;
    text-align: center !important;
    padding: 0.5rem !important;
}

.task-table-checkbox-col input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: #3b82f6;
}

.task-table tr.selected {
    background: #eff6ff !important;
}

.task-table tr.selected:hover {
    background: #dbeafe !important;
}

/* Floating selection toolbar */
.task-selection-toolbar {
    position: fixed;
    bottom: -80px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    transition: bottom 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.task-selection-toolbar.visible {
    bottom: 24px;
}

.selection-toolbar-content {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: #1e293b;
    color: white;
    padding: 0.75rem 1.25rem;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3), 0 2px 8px rgba(0, 0, 0, 0.15);
    white-space: nowrap;
}

.selection-count {
    font-weight: 600;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.selection-count i {
    color: #60a5fa;
}

.selection-actions {
    display: flex;
    gap: 0.5rem;
    border-left: 1px solid #475569;
    padding-left: 1rem;
}

.selection-btn {
    padding: 0.4rem 0.75rem;
    border: 1px solid #475569;
    border-radius: 6px;
    background: transparent;
    color: #e2e8f0;
    font-size: 0.8rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.35rem;
    transition: all 0.15s;
}

.selection-btn:hover {
    background: #334155;
    border-color: #64748b;
}

.selection-btn.delete-btn {
    background: #dc2626;
    border-color: #dc2626;
    color: white;
    font-weight: 600;
}

.selection-btn.delete-btn:hover {
    background: #b91c1c;
    border-color: #b91c1c;
}

/* Delete confirmation modal */
.task-delete-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10001;
    opacity: 0;
    transition: opacity 0.2s;
}

.task-delete-modal-overlay.open {
    opacity: 1;
}

.task-delete-modal {
    background: white;
    border-radius: 16px;
    width: 90%;
    max-width: 520px;
    max-height: 70vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    transform: scale(0.95);
    transition: transform 0.2s;
}

.task-delete-modal-overlay.open .task-delete-modal {
    transform: scale(1);
}

.task-delete-modal-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid #f1f5f9;
}

.task-delete-modal-header i {
    color: #dc2626;
    font-size: 1.4rem;
}

.task-delete-modal-header h3 {
    margin: 0;
    font-size: 1.15rem;
    color: #1e293b;
}

.task-delete-modal-desc {
    padding: 0 1.5rem;
    margin: 0.75rem 0;
    color: #64748b;
    font-size: 0.9rem;
    line-height: 1.5;
}

.task-delete-modal-list {
    max-height: 300px;
    overflow-y: auto;
    padding: 0 1.5rem;
    margin-bottom: 1rem;
}

.task-delete-modal-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.5rem 0.6rem;
    border-bottom: 1px solid #f1f5f9;
    font-size: 0.85rem;
}

.task-delete-modal-item:last-child {
    border-bottom: none;
}

.task-delete-modal-director {
    font-size: 0.9rem;
    width: 20px;
    text-align: center;
    flex-shrink: 0;
}

.task-delete-modal-title {
    flex: 1;
    color: #1e293b;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.task-delete-modal-status {
    font-size: 0.75rem;
    color: #94a3b8;
    text-transform: capitalize;
    flex-shrink: 0;
}

.task-delete-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    border-top: 1px solid #f1f5f9;
}

.task-delete-modal-cancel {
    padding: 0.6rem 1.25rem;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: white;
    color: #475569;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.15s;
}

.task-delete-modal-cancel:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
}

.task-delete-modal-confirm {
    padding: 0.6rem 1.25rem;
    border: none;
    border-radius: 8px;
    background: #dc2626;
    color: white;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    transition: all 0.15s;
}

.task-delete-modal-confirm:hover {
    background: #b91c1c;
}

.task-delete-modal-confirm:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* Dark mode - selection */
[data-theme="dark"] .task-card.selected {
    background: linear-gradient(135deg, #1e3a5f 0%, #1e293b 100%) !important;
    border-color: #3b82f6 !important;
}

[data-theme="dark"] .task-table tr.selected {
    background: #1e3a5f !important;
}

[data-theme="dark"] .task-delete-modal {
    background: #1e293b;
}

[data-theme="dark"] .task-delete-modal-header {
    border-color: #334155;
}

[data-theme="dark"] .task-delete-modal-header h3 {
    color: #e2e8f0;
}

[data-theme="dark"] .task-delete-modal-desc {
    color: #94a3b8;
}

[data-theme="dark"] .task-delete-modal-item {
    border-color: #334155;
}

[data-theme="dark"] .task-delete-modal-title {
    color: #e2e8f0;
}

[data-theme="dark"] .task-delete-modal-actions {
    border-color: #334155;
}

[data-theme="dark"] .task-delete-modal-cancel {
    background: #334155;
    border-color: #475569;
    color: #e2e8f0;
}

[data-theme="dark"] .task-delete-modal-cancel:hover {
    background: #475569;
}

/* ============================================
   Editable Description
   ============================================ */
.task-description-display {
    padding: 0.75rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    color: #1e293b;
    font-size: 0.9rem;
    line-height: 1.6;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.task-description-display:hover {
    border-color: var(--director-color, #0e1369);
    background: #f1f5f9;
}

.task-description-display .edit-hint {
    position: absolute;
    top: 8px;
    right: 8px;
    color: #94a3b8;
    font-size: 0.75rem;
    opacity: 0;
    transition: opacity 0.2s;
}

.task-description-display:hover .edit-hint {
    opacity: 1;
}

.task-description-edit {
    width: 100%;
    min-height: 100px;
    padding: 0.75rem;
    background: white;
    border: 2px solid var(--director-color, #0e1369);
    border-radius: 8px;
    color: #1e293b;
    font-size: 0.9rem;
    line-height: 1.6;
    font-family: inherit;
    resize: vertical;
    outline: none;
}

.task-description-readonly {
    padding: 0.75rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    color: #1e293b;
    font-size: 0.9rem;
    line-height: 1.6;
}

/* ============================================
   Content Assets Section
   ============================================ */
.task-content-source {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.content-source-tabs {
    display: flex;
    gap: 0;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
}

.content-source-tab {
    flex: 1;
    padding: 0.6rem 0.5rem;
    background: #f8fafc;
    border: none;
    border-right: 1px solid #e2e8f0;
    font-size: 0.8rem;
    font-weight: 500;
    color: #64748b;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
}

.content-source-tab:last-child {
    border-right: none;
}

.content-source-tab:hover {
    background: #e2e8f0;
    color: #1e293b;
}

.content-source-tab.active {
    background: var(--director-color, #0e1369);
    color: white;
}

.content-source-panel {
    display: none;
    padding: 0.75rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
}

.content-source-panel.active {
    display: block;
}

/* Upload panel */
.content-upload-area {
    border: 2px dashed #cbd5e1;
    border-radius: 8px;
    padding: 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    background: white;
}

.content-upload-area:hover {
    border-color: var(--director-color, #0e1369);
    background: #f1f5f9;
}

.content-upload-area i {
    font-size: 2rem;
    color: #94a3b8;
    margin-bottom: 0.5rem;
}

.content-upload-area p {
    color: #64748b;
    font-size: 0.85rem;
    margin: 0;
}

.content-upload-area small {
    color: #94a3b8;
    font-size: 0.75rem;
}

/* Library picker panel */
.content-library-search {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.content-library-search input {
    flex: 1;
    padding: 0.5rem 0.75rem;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 0.85rem;
    outline: none;
}

.content-library-search input:focus {
    border-color: var(--director-color, #0e1369);
}

.content-library-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
    gap: 0.5rem;
    max-height: 220px;
    overflow-y: auto;
    padding: 2px;
}

.content-library-item {
    position: relative;
    border-radius: 6px;
    overflow: hidden;
    border: 2px solid transparent;
    cursor: pointer;
    aspect-ratio: 1;
    transition: all 0.2s;
    background: #1e293b;
}

.content-library-item:hover {
    border-color: var(--director-color, #0e1369);
    transform: scale(1.03);
}

.content-library-item.selected {
    border-color: var(--director-color, #0e1369);
    box-shadow: 0 0 0 2px rgba(14, 19, 105, 0.3);
}

.content-library-item.selected::after {
    content: '\f058';
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    position: absolute;
    top: 4px;
    right: 4px;
    color: white;
    background: var(--director-color, #0e1369);
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
}

.content-library-item img,
.content-library-item video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.content-library-item .media-type-icon {
    position: absolute;
    bottom: 4px;
    left: 4px;
    background: rgba(0,0,0,0.6);
    color: white;
    font-size: 0.6rem;
    padding: 2px 5px;
    border-radius: 3px;
}

.content-library-empty {
    text-align: center;
    padding: 1.5rem;
    color: #94a3b8;
    font-size: 0.85rem;
}

.content-library-loading {
    text-align: center;
    padding: 1.5rem;
    color: #94a3b8;
}

/* Template panel */
.content-template-select {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 0.85rem;
    color: #1e293b;
    background: white;
    cursor: pointer;
}

.content-template-select:focus {
    border-color: var(--director-color, #0e1369);
    outline: none;
}

/* Selected content preview */
.content-selected-preview {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    margin-top: 0.5rem;
}

.content-selected-thumb {
    width: 50px;
    height: 50px;
    border-radius: 6px;
    object-fit: cover;
    background: #1e293b;
    flex-shrink: 0;
}

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

.content-selected-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: #1e293b;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.content-selected-type {
    font-size: 0.75rem;
    color: #94a3b8;
}

.content-selected-remove {
    background: none;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    font-size: 1rem;
    padding: 4px;
    transition: color 0.15s;
}

.content-selected-remove:hover {
    color: #ef4444;
}

/* ============================================
   Task Detail Action Buttons (Save/Delete)
   ============================================ */
.task-detail-actions {
    display: flex;
    gap: 0.75rem;
    padding-top: 0.5rem;
}

.task-detail-save-btn {
    flex: 1;
    padding: 0.75rem 1.25rem;
    background: linear-gradient(135deg, var(--director-color, #0e1369), var(--director-dark, #0a0e4a));
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.2s;
}

.task-detail-save-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(14, 19, 105, 0.3);
}

.task-detail-save-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.task-detail-delete-btn {
    padding: 0.75rem 1.25rem;
    background: transparent;
    color: #dc2626;
    border: 1px solid #fecaca;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.2s;
}

.task-detail-delete-btn:hover {
    background: #dc2626;
    color: white;
    border-color: #dc2626;
}

/* Dark mode - new sections */
[data-theme="dark"] .task-description-display {
    background: #1e293b;
    border-color: #334155;
    color: #e2e8f0;
}

[data-theme="dark"] .task-description-display:hover {
    background: #263548;
}

[data-theme="dark"] .task-description-edit {
    background: #0f172a;
    color: #e2e8f0;
}

[data-theme="dark"] .content-source-tab {
    background: #1e293b;
    border-color: #334155;
    color: #94a3b8;
}

[data-theme="dark"] .content-source-tab:hover {
    background: #334155;
    color: #e2e8f0;
}

[data-theme="dark"] .content-source-panel {
    background: #1e293b;
    border-color: #334155;
}

[data-theme="dark"] .content-upload-area {
    background: #0f172a;
    border-color: #475569;
}

[data-theme="dark"] .content-upload-area:hover {
    background: #1e293b;
}

[data-theme="dark"] .content-library-search input {
    background: #0f172a;
    border-color: #475569;
    color: #e2e8f0;
}

[data-theme="dark"] .content-template-select {
    background: #0f172a;
    border-color: #475569;
    color: #e2e8f0;
}

[data-theme="dark"] .content-selected-preview {
    background: #0f172a;
    border-color: #334155;
}

[data-theme="dark"] .content-selected-name {
    color: #e2e8f0;
}

[data-theme="dark"] .task-detail-delete-btn {
    border-color: #7f1d1d;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .selection-toolbar-content {
        flex-direction: column;
        gap: 0.5rem;
        padding: 0.75rem 1rem;
    }

    .selection-actions {
        border-left: none;
        border-top: 1px solid #475569;
        padding-left: 0;
        padding-top: 0.5rem;
        flex-wrap: wrap;
        justify-content: center;
    }

    .task-selection-toolbar.visible {
        bottom: 16px;
        left: 8px;
        right: 8px;
        transform: none;
    }

    .task-delete-modal {
        width: 95%;
    }
}
