/* ================================================================
 * Task Management Module — assets/css/chat_page/tasks.css
 * Uses existing CSS variables for full Dark/Light theme support.
 * ================================================================ */

/* ── Task Management container ─────────────────────────────────── */
.task_management_module {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
    position: relative;
    background: var(--left-side-content-primary-bg-color);
    color: var(--left-side-content-primary-text-color);
    font-size: var(--left-side-content-primary-font-size);
}

/* ── View wrapper shared ───────────────────────────────────────── */
.task_view {
    display: none;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

.task_view.active {
    display: flex;
}

/* ── View header bar ───────────────────────────────────────────── */
.task_view_header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid var(--left-side-content-primary-border-color);
    flex-shrink: 0;
    background: var(--left-side-content-secondary-bg-color);
    gap: 10px;
}

.task_view_header .view_title {
    font-weight: 600;
    font-size: var(--left-side-content-secondary-font-size, 16px);
    color: var(--nav-theme-accent, var(--left-side-content-denary-bg-color));
    margin: 0;
}

.task_view_header .view_actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.task_menu_btn,
.task_back_btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--left-side-content-tertiary-bg-color);
    color: var(--left-side-content-primary-text-color);
    cursor: pointer;
    border: none;
    outline: none;
    font-size: 16px;
    transition: background 0.15s;
}

.task_menu_btn:hover,
.task_back_btn:hover {
    background: var(--left-side-content-quaternary-bg-color);
    color: var(--left-side-content-senary-text-color);
}

.task_refresh_btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--left-side-content-tertiary-bg-color);
    color: var(--left-side-content-primary-text-color);
    cursor: pointer;
    border: none;
    outline: none;
    transition: background 0.15s;
}

.task_refresh_btn:hover {
    background: var(--left-side-content-quaternary-bg-color);
    color: var(--left-side-content-senary-text-color);
}

.task_refresh_btn.spinning svg {
    animation: task_spin 0.8s linear infinite;
}

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

/* ── Scrollable content area ───────────────────────────────────── */
.task_view_body {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 12px 14px 70px 14px;
}

.task_view_body::-webkit-scrollbar { width: 5px; }
.task_view_body::-webkit-scrollbar-track  { background: transparent; }
.task_view_body::-webkit-scrollbar-thumb  { background: var(--left-side-content-primary-border-color); border-radius: 3px; }

/* ── VIEW 1 — Status Summary ───────────────────────────────────── */
.task_status_list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.task_status_row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 8px;
    background: var(--left-side-content-tertiary-bg-color);
    cursor: pointer;
    transition: background 0.15s, box-shadow 0.15s;
    border: 1px solid var(--left-side-content-primary-border-color);
}

.task_status_row:hover {
    background: var(--left-side-content-denary-bg-color);
    border-color: var(--nav-theme-accent, var(--left-side-content-quaternary-border-color));
}

.task_status_icon {
    width: 44px;
    height: 44px;
    flex-shrink: 0;
    border-radius: 50%;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    /* background set inline from PHP/JS */
    color: #fff;
}

.task_status_icon img {
    width: 44px;
    height: 44px;
    object-fit: cover;
    border-radius: 50%;
}

.task_status_info {
    flex: 1 1 auto;
    min-width: 0;
}

.task_status_title {
    font-weight: 600;
    font-size: var(--left-side-content-tertiary-font-size, 14px);
    color: var(--left-side-content-primary-text-color);
    margin-bottom: 2px;
}

.task_status_counts {
    font-size: var(--left-side-content-quinary-font-size, 12px);
    color: var(--left-side-content-secondary-text-color);
    line-height: 1.5;
}

.task_status_counts .count_total {
    display: block;
    font-weight: 500;
}

.task_status_counts .count_assigned {
    display: block;
    color: var(--nav-theme-accent, var(--left-side-content-denary-bg-color));
}

.task_status_row_dots {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    color: var(--left-side-content-secondary-text-color);
    cursor: pointer;
    padding: 4px;
}

/* ── VIEW 2 — Task Cards ───────────────────────────────────────── */

/* Filter bar */
.task_filter_bar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 0 2px 0;
    flex-shrink: 0;
}

.task_filter_select {
    background: var(--left-side-content-tertiary-bg-color);
    color: var(--left-side-content-primary-text-color);
    border: 1px solid var(--left-side-content-primary-border-color);
    border-radius: 6px;
    padding: 6px 10px;
    font-size: var(--left-side-content-primary-font-size);
    outline: none;
    cursor: pointer;
    flex: 1 1 auto;
    /* Force <option> elements to inherit the select's own theme colors.
       Without this the browser renders options in system default colors,
       which are invisible when the page bg is dark. */
    color-scheme: inherit;
}

.task_filter_select option {
    background: var(--left-side-content-secondary-bg-color, var(--left-side-content-tertiary-bg-color));
    color: var(--left-side-content-primary-text-color);
}

.task_filter_select:focus {
    border-color: var(--nav-theme-accent, var(--left-side-content-quaternary-border-color));
}

/* Project filter dropdown (View 1 — Summary) */
.task_project_filter_bar {
    display: flex;
    align-items: center;
    padding: 10px 0 6px 0;
    flex-shrink: 0;
}

.task_project_select {
    background: var(--left-side-content-tertiary-bg-color);
    color: var(--left-side-content-primary-text-color);
    border: 1px solid var(--left-side-content-primary-border-color);
    border-radius: 6px;
    padding: 6px 10px;
    font-size: var(--left-side-content-primary-font-size);
    outline: none;
    cursor: pointer;
    flex: 1 1 auto;
    width: 100%;
    color-scheme: inherit;
}

.task_project_select option {
    background: var(--left-side-content-secondary-bg-color, var(--left-side-content-tertiary-bg-color));
    color: var(--left-side-content-primary-text-color);
}

.task_project_select:focus {
    border-color: var(--nav-theme-accent, var(--left-side-content-quaternary-border-color));
}

/* ── Task card context menu (three-dot) ────────────────────── */
.task_card_menu_btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 4px;
    background: transparent;
    border: none;
    padding: 0;
    cursor: pointer;
    color: var(--left-side-content-secondary-text-color);
    opacity: 0.8;
    transition: opacity 0.15s, background 0.15s, color 0.15s;
    flex-shrink: 0;
    position: relative;
    z-index: 2;
}

.task_card_menu_btn i {
    font-size: 14px;
    line-height: 1;
}

.task_card:hover .task_card_menu_btn,
.tasks_card:hover .task_card_menu_btn,
.task_card_menu_btn:focus,
.task_card_menu_btn.open,
.task_card_menu_btn:hover {
    opacity: 1;
}

.task_card_menu_btn:hover {
    background: var(--left-side-content-primary-border-color);
    color: var(--left-side-content-primary-text-color);
}

.tasks_card:has(.task_card_menu_dropdown.open),
.task_card:has(.task_card_menu_dropdown.open),
.tasks_card.menu_active,
.task_card.menu_active {
    z-index: 50;
}

.task_card_menu_dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    z-index: 100;
    background: var(--left-side-content-secondary-bg-color, var(--left-side-content-tertiary-bg-color));
    border: 1px solid var(--left-side-content-primary-border-color);
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.18);
    min-width: 150px;
    padding: 4px 0;
    list-style: none;
    margin: 0;
}

body.dark_mode .task_card_menu_dropdown {
    background: #1e293b;
    border-color: #334155;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

body.light_mode .task_card_menu_dropdown {
    background: #ffffff;
    border-color: #e2e8f0;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.task_card_menu_dropdown.open {
    display: block;
}

.task_card_menu_dropdown li {
    padding: 8px 14px;
    font-size: 13px;
    color: var(--left-side-content-primary-text-color);
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.12s;
}

body.dark_mode .task_card_menu_dropdown li {
    color: #e2e8f0;
}

body.dark_mode .task_card_menu_dropdown li:hover {
    background: rgba(99, 102, 241, 0.2);
    color: #ffffff;
}

body.light_mode .task_card_menu_dropdown li {
    color: #1e293b;
}

body.light_mode .task_card_menu_dropdown li:hover {
    background: #f1f5f9;
}

/* Read-only project/start-date field in edit mode — visually locked but value still submits */
.task_field_readonly {
    pointer-events: none;
    opacity: 0.6;
    cursor: default;
    background: var(--left-side-content-tertiary-bg-color) !important;
}

/* Wrap the header right side to position the dropdown correctly */
.task_card_header_right {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    flex-shrink: 0;
    position: relative;
}

/* Responsive card grid */
.task_cards_grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 12px;
    padding: 12px 0;
}

@media (max-width: 767px) {
    .task_cards_grid {
        grid-template-columns: 1fr;
    }
}

@media (min-width: 768px) and (max-width: 1199px) {
    .task_cards_grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Individual card */
.task_card {
    background: var(--left-side-content-tertiary-bg-color);
    border: 1px solid var(--left-side-content-primary-border-color);
    border-radius: 10px;
    padding: 14px;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-height: 140px;
}

.task_card:hover {
    border-color: var(--nav-theme-accent, var(--left-side-content-quaternary-border-color));
    background: var(--left-side-content-denary-bg-color, var(--left-side-content-tertiary-bg-color));
}

.task_card_header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
}

.task_card_id {
    font-size: var(--left-side-content-quinary-font-size, 12px);
    font-weight: 600;
    color: var(--left-side-content-secondary-text-color);
    letter-spacing: 0.02em;
}

.task_card_title {
    font-weight: 600;
    font-size: var(--left-side-content-tertiary-font-size, 14px);
    color: var(--left-side-content-primary-text-color);
    margin: 0 0 2px 0;
    line-height: 1.4;
}

.task_card_desc {
    font-size: var(--left-side-content-quinary-font-size, 12px);
    color: var(--left-side-content-secondary-text-color);
    line-height: 1.5;
    flex: 1 1 auto;
    word-break: break-word;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

body.dark_mode .task_card_title { color: #f8fafc; }
body.light_mode .task_card_title { color: #0f172a; }

body.dark_mode .task_card_id { color: #94a3b8; }
body.light_mode .task_card_id { color: #64748b; }

body.dark_mode .task_card_desc { color: #94a3b8; }
body.light_mode .task_card_desc { color: #64748b; }

.task_card_footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
    padding-top: 8px;
    border-top: 1px solid var(--left-side-content-primary-border-color);
    gap: 8px;
}

body.dark_mode .task_card_footer { border-top-color: #1e293b; }
body.light_mode .task_card_footer { border-top-color: #e2e8f0; }

.task_card_due {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: var(--left-side-content-quinary-font-size, 12px);
    color: var(--left-side-content-secondary-text-color);
}

body.dark_mode .task_card_due { color: #94a3b8; }
body.light_mode .task_card_due { color: #64748b; }

.task_card_due i,
.task_card_due svg {
    flex-shrink: 0;
    opacity: 0.8;
    font-size: 13px;
}

.task_card_avatar {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    border: 2px solid var(--left-side-content-primary-border-color);
}

/* Priority badges */
.task_priority_badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    flex-shrink: 0;
}

.task_priority_badge.badge-danger    { background: rgba(220,53,69,0.15);  color: #dc3545; }
.task_priority_badge.badge-warning   { background: rgba(255,193,7,0.15);  color: #ffc107; }
.task_priority_badge.badge-info      { background: rgba(13,202,240,0.15); color: #0dcaf0; }
.task_priority_badge.badge-secondary { background: rgba(108,117,125,0.15); color: #6c757d; }

/* Load more */
.task_load_more_btn {
    display: block;
    width: 100%;
    margin: 12px 0 4px;
    padding: 8px;
    background: var(--left-side-content-tertiary-bg-color);
    border: 1px solid var(--left-side-content-primary-border-color);
    border-radius: 6px;
    color: var(--left-side-content-primary-text-color);
    text-align: center;
    cursor: pointer;
    font-size: var(--left-side-content-primary-font-size);
    transition: background 0.15s;
}

.task_load_more_btn:hover {
    background: var(--left-side-content-denary-bg-color);
}

/* ── VIEW 3 — Task Details ─────────────────────────────────────── */
.task_detail_card {
    background: var(--left-side-content-tertiary-bg-color);
    border: 1px solid var(--left-side-content-primary-border-color);
    border-radius: 10px;
    padding: 16px;
    margin-bottom: 12px;
}

.task_detail_header_row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.task_detail_header_left {
    flex: 1 1 auto;
    min-width: 0;
}

.task_detail_title {
    font-size: var(--left-side-content-secondary-font-size, 16px);
    font-weight: 700;
    color: var(--left-side-content-primary-text-color);
    margin: 0 0 6px 0;
    line-height: 1.4;
    word-break: break-word;
}

/* Timer Button */
.task_timer_btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #4f46e5, #6366f1);
    color: #ffffff !important;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 8px;
    padding: 6px 14px;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.25);
    user-select: none;
    position: relative;
    outline: none;
    isolation: isolate;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

.task_timer_btn:hover {
    background: linear-gradient(135deg, #4338ca, #4f46e5);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(79, 70, 229, 0.35);
    color: #ffffff !important;
}

.task_timer_icon {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.22);
    color: #ffffff !important;
    flex-shrink: 0;
}

.task_timer_icon svg {
    width: 15px;
    height: 15px;
    fill: #ffffff !important;
    color: #ffffff !important;
    display: block;
}

.task_timer_display {
    position: relative;
    z-index: 2;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    letter-spacing: 0.05em;
    font-size: 14px;
    font-weight: 700;
    line-height: 1;
    color: #ffffff !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
}

/* Circling beam border animation when active */
.task_timer_btn.running {
    background: #3730a3;
    border: none;
    box-shadow: 0 0 16px rgba(99, 102, 241, 0.5), 0 4px 12px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

.task_timer_btn.running::before {
    content: "";
    position: absolute;
    inset: 2px;
    background: linear-gradient(135deg, #4338ca, #6366f1);
    border-radius: 6px;
    z-index: 1;
    pointer-events: none;
}

.task_timer_btn .beam-container {
    position: absolute;
    inset: -150%;
    z-index: 0;
    pointer-events: none;
    display: none;
    align-items: center;
    justify-content: center;
}

.task_timer_btn.running .beam-container {
    display: flex;
}

.task_timer_btn .beam-slide {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.task_timer_btn .beam-conic {
    width: 100%;
    height: 100%;
    background: conic-gradient(from 0deg, transparent 0deg, transparent 270deg, #c7d2fe 320deg, #ffffff 360deg);
    animation: task-beam-spin 2.5s linear infinite;
}

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

.task_detail_meta_row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
    padding: 12px 0;
    border-top: 1px solid var(--left-side-content-primary-border-color);
    border-bottom: 1px solid var(--left-side-content-primary-border-color);
    margin: 10px 0;
}

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

.task_detail_meta_label {
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--left-side-content-secondary-text-color);
    display: flex;
    align-items: center;
    gap: 5px;
}

.task_detail_meta_value {
    font-size: var(--left-side-content-primary-font-size);
    color: var(--left-side-content-primary-text-color);
    font-weight: 500;
}

.task_assignee_list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}

.task_assignee_chip {
    display: flex;
    align-items: center;
    gap: 5px;
    background: var(--left-side-content-secondary-bg-color);
    border-radius: 20px;
    padding: 3px 8px 3px 4px;
    font-size: 12px;
    color: var(--left-side-content-primary-text-color);
}

.task_assignee_chip img {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    object-fit: cover;
}

/* Overview */
.task_overview_text {
    font-size: var(--left-side-content-primary-font-size);
    color: var(--left-side-content-secondary-text-color);
    line-height: 1.7;
    white-space: pre-wrap;
    word-break: break-word;
}

.task_section_label {
    font-weight: 600;
    font-size: var(--left-side-content-tertiary-font-size, 14px);
    color: var(--left-side-content-primary-text-color);
    margin-bottom: 8px;
}

/* Tags */
.task_tags_container {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}

.task_tag_chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: var(--left-side-content-secondary-bg-color);
    border: 1px solid var(--left-side-content-primary-border-color);
    border-radius: 4px;
    padding: 2px 8px;
    font-size: 12px;
    color: var(--nav-theme-accent, var(--left-side-content-denary-bg-color));
}

.task_tag_remove {
    cursor: pointer;
    color: var(--left-side-content-secondary-text-color);
    font-size: 14px;
    line-height: 1;
    transition: color 0.1s;
}

.task_tag_remove:hover { color: #dc3545; }

.task_tag_input_wrap {
    display: flex;
    gap: 6px;
    margin-top: 8px;
}

.task_tag_input {
    flex: 1 1 auto;
    background: var(--left-side-content-secondary-bg-color);
    border: 1px solid var(--left-side-content-primary-border-color);
    border-radius: 6px;
    padding: 5px 10px;
    font-size: var(--left-side-content-primary-font-size);
    color: var(--left-side-content-primary-text-color);
    outline: none;
}

.task_tag_input:focus {
    border-color: var(--nav-theme-accent, var(--left-side-content-quaternary-border-color));
}

.task_tag_add_btn {
    background: var(--left-side-content-quaternary-bg-color);
    color: var(--left-side-content-senary-text-color);
    border: none;
    border-radius: 6px;
    padding: 5px 12px;
    cursor: pointer;
    font-size: var(--left-side-content-primary-font-size);
    transition: background 0.15s;
}

.task_tag_add_btn:hover {
    background: var(--nav-theme-accent, var(--left-side-content-quaternary-bg-color));
}

/* Checklist */
.task_checklist {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.task_checklist_item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 10px;
    border-radius: 6px;
    background: var(--left-side-content-secondary-bg-color);
    transition: background 0.1s;
}

.task_checklist_item:hover {
    background: var(--left-side-content-denary-bg-color);
}

.task_checklist_item input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: var(--nav-theme-accent, var(--left-side-content-quaternary-bg-color));
    flex-shrink: 0;
}

.task_checklist_text {
    flex: 1 1 auto;
    font-size: var(--left-side-content-primary-font-size);
    color: var(--left-side-content-primary-text-color);
}

.task_checklist_text.completed_item {
    text-decoration: line-through;
    opacity: 0.5;
}

.task_checklist_remove {
    cursor: pointer;
    color: var(--left-side-content-secondary-text-color);
    font-size: 16px;
    transition: color 0.1s;
    flex-shrink: 0;
}

.task_checklist_remove:hover { color: #dc3545; }

.task_new_checklist_row {
    display: flex;
    gap: 6px;
    margin-top: 8px;
}

.task_new_checklist_input {
    flex: 1 1 auto;
    background: var(--left-side-content-secondary-bg-color);
    border: 1px solid var(--left-side-content-primary-border-color);
    border-radius: 6px;
    padding: 5px 10px;
    font-size: var(--left-side-content-primary-font-size);
    color: var(--left-side-content-primary-text-color);
    outline: none;
}

.task_new_checklist_input:focus {
    border-color: var(--nav-theme-accent, var(--left-side-content-quaternary-border-color));
}

.task_checklist_add_btn {
    background: var(--left-side-content-quaternary-bg-color);
    color: var(--left-side-content-senary-text-color);
    border: none;
    border-radius: 6px;
    padding: 5px 12px;
    cursor: pointer;
    font-size: var(--left-side-content-primary-font-size);
    transition: background 0.15s;
}

.task_checklist_add_btn:hover {
    background: var(--nav-theme-accent, var(--left-side-content-quaternary-bg-color));
}

/* Attachments */
.task_dropzone {
    border: 2px dashed var(--left-side-content-primary-border-color);
    border-radius: 8px;
    padding: 24px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
    background: var(--left-side-content-secondary-bg-color);
    margin-bottom: 10px;
    position: relative;
}

.task_dropzone:hover,
.task_dropzone.dragover {
    border-color: var(--nav-theme-accent, var(--left-side-content-quaternary-border-color));
    background: var(--left-side-content-denary-bg-color);
}

.task_dropzone input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

.task_dropzone_text {
    font-size: var(--left-side-content-primary-font-size);
    color: var(--left-side-content-secondary-text-color);
    pointer-events: none;
}

.task_attachment_list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.task_attachment_item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: 6px;
    background: var(--left-side-content-secondary-bg-color);
    border: 1px solid var(--left-side-content-primary-border-color);
}

.task_attachment_icon {
    width: 36px;
    height: 36px;
    border-radius: 6px;
    background: var(--left-side-content-quaternary-bg-color);
    color: var(--left-side-content-senary-text-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    flex-shrink: 0;
}

.task_attachment_info {
    flex: 1 1 auto;
    min-width: 0;
}

.task_attachment_name {
    font-size: var(--left-side-content-primary-font-size);
    font-weight: 500;
    color: var(--left-side-content-primary-text-color);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.task_attachment_size {
    font-size: 11px;
    color: var(--left-side-content-secondary-text-color);
}

.task_attachment_actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.task_attachment_view {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--left-side-content-secondary-text-color);
    transition: color 0.15s;
    text-decoration: none;
}

.task_attachment_view:hover {
    color: var(--nav-theme-accent, #3b82f6);
}

.task_attachment_remove {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--left-side-content-secondary-text-color);
    flex-shrink: 0;
    transition: color 0.1s;
}

.task_attachment_remove:hover { color: #dc3545; }

/* ── Upload progress ───────────────────────────────────────────── */
.task_upload_progress {
    display: none;
    background: var(--left-side-content-tertiary-bg-color);
    border-radius: 6px;
    padding: 8px 12px;
    margin-bottom: 8px;
    font-size: var(--left-side-content-primary-font-size);
    color: var(--left-side-content-primary-text-color);
}

.task_upload_progress .progress {
    height: 6px;
    border-radius: 3px;
    background: var(--left-side-content-primary-border-color);
    margin-top: 6px;
    overflow: hidden;
}

.task_upload_progress .progress-bar {
    height: 100%;
    background: var(--nav-theme-accent, var(--left-side-content-quaternary-bg-color));
    transition: width 0.2s;
}

/* ── Zero state / error ────────────────────────────────────────── */
.task_empty_state {
    text-align: center;
    padding: 40px 20px;
    color: var(--left-side-content-secondary-text-color);
}

.task_empty_state svg {
    opacity: 0.3;
    margin-bottom: 12px;
}

/* ── Loader spinner ────────────────────────────────────────────── */
.task_loader {
    text-align: center;
    padding: 30px;
    color: var(--left-side-content-secondary-text-color);
    font-size: var(--left-side-content-primary-font-size);
}

/* ── Status badge ─────────────────────────────────────────────── */
.task_status_badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.task_status_badge.badge-info    { background: rgba(13,202,240,0.15); color: #0dcaf0; }
.task_status_badge.badge-warning { background: rgba(255,193,7,0.15); color: #ffc107; }
.task_status_badge.badge-success { background: rgba(25,135,84,0.15); color: #198754; }
.task_status_badge.badge-secondary { background: rgba(108,117,125,0.15); color: #6c757d; }

/* ── New Task button in Dock ───────────────────────────────────────── */
.task_new_task_btn.task_fab_hidden {
    opacity: 0.35;
    pointer-events: none;
}

/* ── Aside panel integration ──────────────────────────────────── */
.task_summary_panel {
    display: none;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

.task_summary_panel.active {
    display: flex;
}

/* ── Responsive adjustments ───────────────────────────────────── */
@media (max-width: 991px) {
    .task_detail_meta_row {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 575px) {
    .task_detail_meta_row {
        grid-template-columns: 1fr;
    }
    .task_view_header {
        padding: 10px 12px;
    }
    .task_view_body {
        padding: 10px;
    }
}

/* ================================================================
 * STANDARDIZED TASKS DESIGN SYSTEM (BrightSaaS / Notes Pattern)
 * ================================================================ */

/* ── 1. ASIDE SIDEBAR (Column 1) ─────────────────────────────────── */
.task_management_module {
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 100%;
    position: relative;
    overflow: hidden;
}

body.dark_mode .task_management_module {
    background: #0b0f19 !important;
    color: #e2e8f0 !important;
}

body.light_mode .task_management_module {
    background: #ffffff !important;
    color: #334155 !important;
}

.task_sidebar_header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 16px 12px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    flex-shrink: 0;
}

body.light_mode .task_sidebar_header {
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.task_header_title_wrap {
    display: flex;
    align-items: center;
    gap: 10px;
}

.task_header_icon_box {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: linear-gradient(135deg, #4f46e5, #6366f1);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    box-shadow: 0 2px 6px rgba(79, 70, 229, 0.35);
}

.task_view_title {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.01em;
    margin: 0;
}

body.dark_mode .task_view_title {
    color: #ffffff !important;
}

body.light_mode .task_view_title {
    color: #0f172a !important;
}

.task_view_actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.task_btn_icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
    font-size: 15px;
}

body.dark_mode .task_btn_icon {
    background: #1e293b !important;
    border: 1px solid #334155 !important;
    color: #cbd5e1 !important;
}

body.dark_mode .task_btn_icon:hover {
    background: rgba(99, 102, 241, 0.25) !important;
    color: #ffffff !important;
    border-color: #6366f1 !important;
}

body.light_mode .task_btn_icon {
    background: #f8fafc !important;
    border: 1px solid #e2e8f0 !important;
    color: #475569 !important;
}

body.light_mode .task_btn_icon:hover {
    background: rgba(99, 102, 241, 0.1) !important;
    color: #4338ca !important;
    border-color: #6366f1 !important;
}

.task_sidebar_body {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 14px 14px 70px 14px;
    scrollbar-width: thin;
}

/* ── Project Pill Dropdown (matching Notes style notes_sort_dropdown_wrap) ── */
.task_project_dropdown_wrap {
    position: relative;
    margin-bottom: 14px;
    width: 100%;
}

.task_project_select {
    width: 100% !important;
    border-radius: 20px !important;
    padding: 8px 36px 8px 16px !important;
    font-size: 13.5px !important;
    font-weight: 600 !important;
    outline: none !important;
    cursor: pointer !important;
    appearance: none !important;
    -webkit-appearance: none !important;
    transition: all 0.2s ease !important;
    background-repeat: no-repeat !important;
    background-position: right 14px center !important;
    background-size: 14px !important;
}

body.dark_mode .task_project_select {
    background-color: #1e293b !important;
    border: 1px solid #334155 !important;
    color: #f8fafc !important;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23cbd5e1' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e") !important;
}

body.dark_mode .task_project_select:focus {
    border-color: #6366f1 !important;
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.25) !important;
}

body.dark_mode .task_project_select option {
    background-color: #0f172a !important;
    color: #ffffff !important;
    padding: 8px 12px;
}

body.light_mode .task_project_select {
    background-color: #f8fafc !important;
    border: 1px solid #cbd5e1 !important;
    color: #0f172a !important;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23475569' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e") !important;
}

body.light_mode .task_project_select option {
    background-color: #ffffff !important;
    color: #0f172a !important;
    padding: 8px 12px;
}

/* ── 4 Status Tiles in Aside ─────────────────────────────────────── */
.task_status_list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.task_status_tile {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    user-select: none;
}

body.dark_mode .task_status_tile {
    background: #151d30;
    border: 1px solid #1e293b;
    color: #cbd5e1;
}

body.dark_mode .task_status_tile:hover {
    background: rgba(99, 102, 241, 0.14);
    border-color: rgba(99, 102, 241, 0.35);
    color: #ffffff;
    transform: translateX(2px);
}

body.dark_mode .task_status_tile.active {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.22), rgba(139, 92, 246, 0.16)) !important;
    border: 1px solid rgba(99, 102, 241, 0.5) !important;
    color: #ffffff !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

body.light_mode .task_status_tile {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    color: #334155;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

body.light_mode .task_status_tile:hover {
    background: rgba(99, 102, 241, 0.06);
    border-color: rgba(99, 102, 241, 0.25);
    color: #1e293b;
    transform: translateX(2px);
}

body.light_mode .task_status_tile.active {
    background: rgba(99, 102, 241, 0.1) !important;
    border: 1px solid rgba(99, 102, 241, 0.4) !important;
    color: #312e81 !important;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.12);
}

.task_tile_icon_box {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.task_tile_icon_box.icon_todo {
    background: rgba(239, 68, 68, 0.18);
    color: #ef4444;
}

.task_tile_icon_box.icon_in_progress {
    background: rgba(59, 130, 246, 0.18);
    color: #3b82f6;
}

.task_tile_icon_box.icon_in_review {
    background: rgba(245, 158, 11, 0.18);
    color: #f59e0b;
}

.task_tile_icon_box.icon_completed {
    background: rgba(16, 185, 129, 0.18);
    color: #10b981;
}

.task_tile_content {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.task_tile_title {
    font-size: 14.5px;
    font-weight: 700;
    line-height: 1.25;
    margin-bottom: 2px;
}

body.dark_mode .task_tile_title { color: #f8fafc; }
body.light_mode .task_tile_title { color: #0f172a; }

.task_tile_sub {
    font-size: 11.5px;
    color: #94a3b8;
    line-height: 1.35;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

body.light_mode .task_tile_sub {
    color: #64748b;
}

.task_tile_badge {
    min-width: 24px;
    height: 24px;
    padding: 0 6px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11.5px;
    font-weight: 700;
    flex-shrink: 0;
}

body.dark_mode .task_tile_badge {
    background: rgba(99, 102, 241, 0.3);
    border: 1px solid rgba(99, 102, 241, 0.4);
    color: #e0e7ff;
}

body.light_mode .task_tile_badge {
    background: rgba(99, 102, 241, 0.12);
    border: 1px solid rgba(99, 102, 241, 0.25);
    color: #4338ca;
}

/* ── 2. MIDDLE VIEW CANVAS (Column 2) ────────────────────────────── */
.task_middle_view {
    height: 100%;
    width: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    box-sizing: border-box;
}

body.dark_mode .task_middle_view {
    background: #0b0f19;
    color: #e2e8f0;
}

body.light_mode .task_middle_view {
    background: #f8fafc;
    color: #1e293b;
}

.task_main_container {
    max-width: 1540px;
    margin: 0 auto;
    padding: 22px 26px;
    width: 100%;
    box-sizing: border-box;
}

/* Page Header */
.task_page_header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 4px;
}

.task_page_title {
    font-size: 1.6rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin: 0;
}

body.dark_mode .task_page_title { color: #f8fafc; }
body.light_mode .task_page_title { color: #0f172a; }

.task_header_right {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

/* Segmented View Switcher [ List | Board ] */
.task_view_toggle_wrap {
    display: inline-flex;
    align-items: center;
    padding: 3px;
    border-radius: 8px;
}

body.dark_mode .task_view_toggle_wrap {
    background: #151d30;
    border: 1px solid #1e293b;
}

body.light_mode .task_view_toggle_wrap {
    background: #e2e8f0;
    border: 1px solid #cbd5e1;
}

.task_view_toggle_btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 14px;
    border-radius: 6px;
    border: none;
    background: transparent;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.18s ease;
}

body.dark_mode .task_view_toggle_btn {
    color: #94a3b8;
}

body.dark_mode .task_view_toggle_btn:hover {
    color: #f8fafc;
}

body.dark_mode .task_view_toggle_btn.active {
    background: #4f46e5;
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(79, 70, 229, 0.4);
}

body.light_mode .task_view_toggle_btn {
    color: #64748b;
}

body.light_mode .task_view_toggle_btn:hover {
    color: #0f172a;
}

body.light_mode .task_view_toggle_btn.active {
    background: #ffffff;
    color: #4f46e5;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.08);
}

.task_new_task_btn:not(.icon) {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 16px;
    border-radius: 8px;
    font-size: 13.5px;
    font-weight: 600;
    border: none;
    background: linear-gradient(135deg, #4f46e5, #6366f1);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
    cursor: pointer;
    transition: all 0.2s ease;
}

.task_new_task_btn:not(.icon):hover {
    background: linear-gradient(135deg, #4338ca, #4f46e5);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(79, 70, 229, 0.4);
    color: #ffffff;
}

.task_page_sub {
    font-size: 13.5px;
    color: #94a3b8;
    margin: 0 0 16px 0;
}

body.light_mode .task_page_sub {
    color: #64748b;
}

/* ── Filter Toolbar ──────────────────────────────────────────────── */
.task_toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border-radius: 12px;
    margin-bottom: 20px;
}

body.dark_mode .task_toolbar {
    background: #111827;
    border: 1px solid #1e293b;
}

body.light_mode .task_toolbar {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.task_search_wrap {
    position: relative;
    min-width: 200px;
    flex: 1 1 200px;
}

.task_search_wrap i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #64748b;
    font-size: 13px;
    pointer-events: none;
}

.task_search_input {
    width: 100%;
    height: 36px;
    border-radius: 8px;
    padding: 6px 12px 6px 34px;
    font-size: 13px;
    outline: none;
    box-sizing: border-box;
    transition: all 0.18s ease;
}

body.dark_mode .task_search_input {
    background: #151d30;
    border: 1px solid #1e293b;
    color: #ffffff;
}

body.dark_mode .task_search_input::placeholder { color: #64748b; }

body.dark_mode .task_search_input:focus {
    border-color: #6366f1;
    background: #1a233a;
}

body.light_mode .task_search_input {
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    color: #0f172a;
}

body.light_mode .task_search_input::placeholder { color: #94a3b8; }

body.light_mode .task_search_input:focus {
    border-color: #6366f1;
    background: #ffffff;
}

.task_filter_select_wrap {
    position: relative;
}

.task_filter_select {
    height: 36px;
    border-radius: 8px;
    padding: 6px 28px 6px 10px;
    font-size: 12.5px;
    font-weight: 500;
    outline: none;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    transition: all 0.18s ease;
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 12px;
}

body.dark_mode .task_filter_select {
    background-color: #151d30;
    border: 1px solid #1e293b;
    color: #cbd5e1;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
}

body.dark_mode .task_filter_select:focus {
    border-color: #6366f1;
}

body.dark_mode .task_filter_select option {
    background-color: #0f172a;
    color: #f8fafc;
}

body.light_mode .task_filter_select {
    background-color: #ffffff;
    border: 1px solid #cbd5e1;
    color: #334155;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
}

body.light_mode .task_filter_select:focus {
    border-color: #6366f1;
}

body.light_mode .task_filter_select option {
    background-color: #ffffff;
    color: #0f172a;
}

/* ── 3. KANBAN BOARD VIEW ────────────────────────────────────────── */
.tasks_board_grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(260px, 1fr));
    gap: 16px;
    align-items: start;
    width: 100%;
}

.tasks_board_grid.filtered_single_col {
    grid-template-columns: minmax(320px, 680px);
}

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

@media (max-width: 600px) {
    .tasks_board_grid {
        grid-template-columns: 1fr;
    }
}

.tasks_col {
    border-radius: 14px;
    padding: 14px;
    min-height: 480px;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
}

body.dark_mode .tasks_col {
    background: #111827;
    border: 1px solid #1e293b;
}

body.light_mode .tasks_col {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}

.tasks_col {
    transition: opacity 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.tasks_col.filter_dimmed {
    opacity: 0.35;
}

body.dark_mode .tasks_col.filter_active_col {
    border-color: rgba(99, 102, 241, 0.7) !important;
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.35), 0 8px 24px rgba(0, 0, 0, 0.3);
}

body.light_mode .tasks_col.filter_active_col {
    border-color: rgba(99, 102, 241, 0.6) !important;
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.25), 0 8px 20px rgba(99, 102, 241, 0.12);
}

.tasks_col_head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 10px;
    margin-bottom: 12px;
    border-bottom: 1px solid;
}

body.dark_mode .tasks_col_head { border-bottom-color: #1e293b; }
body.light_mode .tasks_col_head { border-bottom-color: #e2e8f0; }

.tasks_col_title_wrap {
    display: flex;
    align-items: center;
    gap: 8px;
}

.tasks_col_accent {
    width: 4px;
    height: 16px;
    border-radius: 2px;
    display: inline-block;
}

.tasks_col_accent.accent_todo { background: #3b82f6; }
.tasks_col_accent.accent_in_progress { background: #06b6d4; }
.tasks_col_accent.accent_in_review { background: #f59e0b; }
.tasks_col_accent.accent_completed { background: #10b981; }

.tasks_col_title {
    font-size: 14.5px;
    font-weight: 700;
}

body.dark_mode .tasks_col_title { color: #f8fafc; }
body.light_mode .tasks_col_title { color: #0f172a; }

.tasks_col_count {
    font-size: 11.5px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 10px;
}

body.dark_mode .tasks_col_count {
    background: #1e293b;
    color: #94a3b8;
}

body.light_mode .tasks_col_count {
    background: #f1f5f9;
    color: #64748b;
}

/* Dropzone */
.tasks_col_cards {
    flex: 1 1 auto;
    min-height: 400px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    transition: background 0.2s ease, outline 0.2s ease;
    border-radius: 8px;
    padding: 2px;
}

.tasks_col_cards.drag_over {
    background: rgba(99, 102, 241, 0.08) !important;
    outline: 2px dashed #6366f1 !important;
    outline-offset: -2px;
}

/* Kanban Task Card */
.tasks_card {
    border-radius: 10px;
    padding: 14px;
    cursor: grab;
    transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease, border-color 0.15s ease, background 0.15s ease;
    user-select: none;
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-height: 140px;
}

body.dark_mode .tasks_card {
    background: #151d30;
    border: 1px solid #1e293b;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

body.dark_mode .tasks_card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35);
    border-color: rgba(99, 102, 241, 0.4);
}

body.light_mode .tasks_card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}

body.light_mode .tasks_card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.08);
    border-color: rgba(99, 102, 241, 0.3);
}

.tasks_card.is_dragging {
    opacity: 0.4;
    cursor: grabbing;
    transform: scale(0.98);
}

.tasks_card_title {
    font-size: 13.5px;
    font-weight: 600;
    line-height: 1.35;
    margin: 0 0 8px 0;
}

body.dark_mode .tasks_card_title { color: #f8fafc; }
body.light_mode .tasks_card_title { color: #0f172a; }

.tasks_card_meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.tasks_project_chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 5px;
    max-width: 160px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

body.dark_mode .tasks_project_chip {
    background: rgba(99, 102, 241, 0.2);
    color: #a5b4fc;
}

body.light_mode .tasks_project_chip {
    background: rgba(99, 102, 241, 0.1);
    color: #4f46e5;
}

.tasks_project_chip .dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: currentColor;
    flex-shrink: 0;
}

.tasks_priority_pill {
    font-size: 11px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 5px;
    letter-spacing: 0.02em;
}

.tasks_priority_pill.priority_p0 {
    background: rgba(239, 68, 68, 0.18);
    color: #ef4444;
}

.tasks_priority_pill.priority_p1 {
    background: rgba(245, 158, 11, 0.18);
    color: #f59e0b;
}

.tasks_priority_pill.priority_p2 {
    background: rgba(59, 130, 246, 0.18);
    color: #3b82f6;
}

.tasks_priority_pill.priority_p3 {
    background: rgba(148, 163, 184, 0.18);
    color: #94a3b8;
}

.tasks_card_foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 8px;
    border-top: 1px dashed;
}

body.dark_mode .tasks_card_foot { border-top-color: #1e293b; }
body.light_mode .tasks_card_foot { border-top-color: #e2e8f0; }

.tasks_card_assignees_due {
    display: flex;
    align-items: center;
    gap: 8px;
}

.tasks_card_assignees {
    display: flex;
    align-items: center;
}

.tasks_card_avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    margin-right: -6px;
    object-fit: cover;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 700;
    color: #ffffff;
    background: #4f46e5;
    border: 2px solid;
}

body.dark_mode .tasks_card_avatar { border-color: #151d30; }
body.light_mode .tasks_card_avatar { border-color: #ffffff; }

.tasks_card_due {
    font-size: 11.5px;
    font-weight: 500;
    color: #94a3b8;
}

body.light_mode .tasks_card_due { color: #64748b; }

.tasks_card_due.overdue {
    color: #ef4444;
    font-weight: 600;
}

.tasks_card_open_btn {
    padding: 3px 10px;
    font-size: 11.5px;
    font-weight: 600;
    border-radius: 6px;
    background: transparent;
    cursor: pointer;
    transition: all 0.15s ease;
}

body.dark_mode .tasks_card_open_btn {
    border: 1px solid rgba(99, 102, 241, 0.5);
    color: #a5b4fc;
}

body.dark_mode .tasks_card_open_btn:hover {
    background: #6366f1;
    color: #ffffff;
    border-color: #6366f1;
}

body.light_mode .tasks_card_open_btn {
    border: 1px solid #6366f1;
    color: #4f46e5;
}

body.light_mode .tasks_card_open_btn:hover {
    background: #6366f1;
    color: #ffffff;
}

/* ── 4. LIST VIEW (Tabular) ──────────────────────────────────────── */
.task_table_wrap {
    border-radius: 12px;
    overflow: hidden;
}

body.dark_mode .task_table_wrap {
    border: 1px solid #1e293b;
    background: #111827;
}

body.light_mode .task_table_wrap {
    border: 1px solid #e2e8f0;
    background: #ffffff;
}

.task_table {
    margin: 0;
    font-size: 13px;
    width: 100%;
    table-layout: auto;
}

.task_table thead th {
    font-size: 11.5px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
    padding: 12px 14px;
    border-bottom: 1px solid;
    white-space: nowrap;
}

body.dark_mode .task_table thead th {
    background: #151d30;
    border-bottom-color: #1e293b;
    color: #94a3b8;
}

body.light_mode .task_table thead th {
    background: #f8fafc;
    border-bottom-color: #e2e8f0;
    color: #64748b;
}

.task_table tbody tr {
    cursor: pointer;
    transition: background 0.15s ease;
}

body.dark_mode .task_table tbody tr {
    border-bottom: 1px solid #1e293b;
    color: #cbd5e1;
}

body.dark_mode .task_table tbody tr:hover {
    background: #151d30;
}

body.light_mode .task_table tbody tr {
    border-bottom: 1px solid #e2e8f0;
    color: #334155;
}

body.light_mode .task_table tbody tr:hover {
    background: #f8fafc;
}

.task_table td {
    padding: 12px 14px;
    vertical-align: middle;
}

/* Specific column styling matching listview.jpg */
.task_table .task_col_num {
    width: 70px;
    white-space: nowrap;
}

.task_table .task_table_num {
    font-size: 12px;
    font-weight: 500;
    color: #94a3b8;
    letter-spacing: 0.02em;
}

.task_table .task_col_title {
    min-width: 200px;
    max-width: 380px;
}

.task_table .task_table_title_text {
    font-size: 13.5px;
    font-weight: 500;
    line-height: 1.4;
    display: inline-block;
}

body.dark_mode .task_table .task_table_title_text {
    color: #f1f5f9;
}

body.light_mode .task_table .task_table_title_text {
    color: #1e293b;
}

.task_table .task_col_project {
    min-width: 140px;
    max-width: 220px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.task_table .task_table_proj {
    font-size: 13px;
    color: #94a3b8;
}

.task_table .task_col_status {
    width: 110px;
    white-space: nowrap;
}

.task_table .task_table_status_text {
    font-size: 12.5px;
    color: #cbd5e1;
}

body.light_mode .task_table .task_table_status_text {
    color: #475569;
}

.task_table .task_col_priority {
    width: 100px;
    white-space: nowrap;
}

.task_table .task_col_due {
    width: 100px;
    white-space: nowrap;
}

.task_table .task_table_due {
    font-size: 12.5px;
    color: #94a3b8;
}

.task_table .task_table_due.overdue {
    color: #ef4444 !important;
    font-weight: 600;
}

.task_table .task_col_assignees {
    width: 110px;
    white-space: nowrap;
}

.task_table .task_table_assignees {
    display: inline-flex;
    align-items: center;
}

.task_table .task_table_avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    margin-right: -6px;
    object-fit: cover;
    border: 2px solid;
    display: inline-block;
    vertical-align: middle;
}

body.dark_mode .task_table .task_table_avatar {
    border-color: #111827;
}

body.light_mode .task_table .task_table_avatar {
    border-color: #ffffff;
}

.task_table .task_col_actions {
    width: 130px;
    text-align: right;
    white-space: nowrap;
}

.task_table .task_table_actions_wrap {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    justify-content: flex-end;
}

.task_table .tasks_card_view_btn,
.task_table .tasks_card_edit_btn {
    padding: 3px 12px;
    font-size: 11.5px;
    font-weight: 600;
    border-radius: 6px;
    background: transparent;
    cursor: pointer;
    transition: all 0.15s ease;
}

body.dark_mode .task_table .tasks_card_view_btn,
body.dark_mode .task_table .tasks_card_edit_btn {
    border: 1px solid rgba(99, 102, 241, 0.5);
    color: #a5b4fc;
}

body.dark_mode .task_table .tasks_card_view_btn:hover,
body.dark_mode .task_table .tasks_card_edit_btn:hover {
    background: #6366f1;
    color: #ffffff;
    border-color: #6366f1;
}

body.light_mode .task_table .tasks_card_view_btn,
body.light_mode .task_table .tasks_card_edit_btn {
    border: 1px solid #6366f1;
    color: #4f46e5;
}

body.light_mode .task_table .tasks_card_view_btn:hover,
body.light_mode .task_table .tasks_card_edit_btn:hover {
    background: #6366f1;
    color: #ffffff;
}

/* ── 4. DESKTOP TASK DETAILS VIEW ───────────────────────────────── */
.task_desktop_details_panel {
    width: 100%;
}

.task_desktop_details_wrap {
    display: flex;
    flex-direction: column;
    width: 100%;
}

.task_dt_top_header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
    gap: 16px;
}

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

.task_dt_num_badge_row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.task_dt_number {
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.01em;
    margin: 0;
    line-height: 1.2;
}

body.dark_mode .task_dt_number { color: #f8fafc; }
body.light_mode .task_dt_number { color: #0f172a; }

.task_dt_title {
    font-size: 14.5px;
    font-weight: 500;
    line-height: 1.4;
    margin: 0;
}

body.dark_mode .task_dt_title { color: #94a3b8; }
body.light_mode .task_dt_title { color: #475569; }

.task_desktop_close_btn {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: #6366f1;
    border: none;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.15s ease;
    flex-shrink: 0;
}

.task_desktop_close_btn:hover {
    background: #4f46e5;
    transform: scale(1.04);
}

.task_dt_subhead_bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 18px;
    border-radius: 10px;
    margin-bottom: 20px;
    gap: 12px;
    flex-wrap: wrap;
}

body.dark_mode .task_dt_subhead_bar {
    background: #151d30;
    border: 1px solid #1e293b;
}

body.light_mode .task_dt_subhead_bar {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.task_dt_status_text {
    font-size: 12.5px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

body.dark_mode .task_dt_status_text { color: #cbd5e1; }
body.light_mode .task_dt_status_text { color: #475569; }

.task_dt_actions_group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.task_desktop_edit_btn {
    font-size: 12.5px;
    font-weight: 600;
    padding: 5px 12px;
    border-radius: 6px;
    border: 1px solid rgba(16, 185, 129, 0.4);
    color: #10b981;
    background: transparent;
    transition: all 0.15s ease;
}

.task_desktop_edit_btn:hover {
    background: #10b981;
    color: #ffffff;
    border-color: #10b981;
}

.task_dt_grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
    align-items: start;
    width: 100%;
}

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

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

.task_dt_col {
    display: flex;
    flex-direction: column;
    gap: 18px;
    min-width: 0;
}

.task_dt_card {
    border-radius: 12px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    box-sizing: border-box;
}

body.dark_mode .task_dt_card {
    background: #151d30;
    border: 1px solid #1e293b;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

body.light_mode .task_dt_card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}

.task_dt_card_title {
    font-size: 15px;
    font-weight: 700;
    margin: 0 0 2px 0;
}

body.dark_mode .task_dt_card_title { color: #f8fafc; }
body.light_mode .task_dt_card_title { color: #0f172a; }

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

.task_dt_field_label {
    font-size: 11px;
    font-weight: 700;
    color: #64748b;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 4px;
}

.task_dt_field_val {
    font-size: 13.5px;
    font-weight: 500;
}

body.dark_mode .task_dt_field_val { color: #cbd5e1; }
body.light_mode .task_dt_field_val { color: #1e293b; }

.task_dt_two_col_row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.task_dt_user_box {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.task_dt_user_chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13.5px;
    font-weight: 500;
}

body.dark_mode .task_dt_user_chip { color: #cbd5e1; }
body.light_mode .task_dt_user_chip { color: #1e293b; }

.task_dt_avatar {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.task_dt_overview_section {
    margin-top: 4px;
    padding-top: 14px;
    border-top: 1px solid;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

body.dark_mode .task_dt_overview_section { border-top-color: #1e293b; }
body.light_mode .task_dt_overview_section { border-top-color: #e2e8f0; }

.task_dt_overview_title {
    font-size: 13.5px;
    font-weight: 700;
}

body.dark_mode .task_dt_overview_title { color: #f8fafc; }
body.light_mode .task_dt_overview_title { color: #0f172a; }

.task_dt_overview_content {
    font-size: 13px;
    line-height: 1.6;
    white-space: pre-wrap;
    word-break: break-word;
}

body.dark_mode .task_dt_overview_content { color: #94a3b8; }
body.light_mode .task_dt_overview_content { color: #475569; }


