/* ── Tasks ──────────────────────────────────────────────────────────────────── */
.tasks-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.task-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.15s;
    gap: 8px;
}
.task-card:hover {
    background: color-mix(in srgb, var(--primary) 6%, transparent);
    border-color: color-mix(in srgb, var(--primary) 30%, transparent);
}
.task-card-left {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 0;
}
.task-card-title {
    font-size: var(--text-xs);
    font-weight: 500;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.task-card-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}
.task-card-due {
    font-size: var(--text-3xs);
    color: var(--text-muted);
}
.task-card-due.overdue {
    color: var(--danger);
    font-weight: 600;
}
.task-card-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: color-mix(in srgb, var(--primary) 15%, transparent);
    color: var(--primary);
    font-size: var(--text-4xs);
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
}
.task-check-progress {
    font-size: var(--text-3xs);
    color: var(--text-muted);
    background: var(--surface);
    padding: 1px 6px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}

/* ── Multi-select dropdown ──────────────────────────────────────────────── */
.multi-select-dropdown {
    position: relative;
}
.msd-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    cursor: pointer;
    min-height: 36px;
    user-select: none;
}
.msd-label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--text-muted);
    font-size: var(--text-sm);
}
.multi-select-dropdown .msd-trigger:has(~ .msd-dropdown input:checked) .msd-label {
    color: var(--text);
}
.msd-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 100;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow);
    backdrop-filter: var(--glass-blur);
    max-height: 200px;
    overflow-y: auto;
    margin-top: 4px;
    padding: 4px 0;
}
.multi-select-dropdown.open .msd-dropdown {
    display: block;
}
.multi-select-dropdown.open .msd-trigger svg {
    transform: rotate(180deg);
}
.msd-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    cursor: pointer;
    font-size: var(--text-sm);
    color: var(--text);
    transition: background var(--transition-fast);
}
.msd-item:hover {
    background: var(--surface2);
}
.msd-item input[type="checkbox"] {
    accent-color: var(--primary);
    width: 15px;
    height: 15px;
    cursor: pointer;
    flex-shrink: 0;
}

/* Task Status Badge */
.task-status-badge {
    font-size: var(--text-3xs);
    font-weight: 600;
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

/* Task Detail Modal */
.task-detail-modal {
    max-width: 900px !important;
    width: 90vw !important;
}
.task-detail-body {
    display: flex;
    gap: 20px;
    padding: 20px;
    max-height: 65vh;
    overflow-y: auto;
}
.task-detail-left {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-width: 0;
}
.task-detail-fields {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.task-detail-fields .modal-two-col {
    gap: 12px;
}
.task-detail-right {
    width: 320px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
}
.task-detail-section {
    border-top: 1px solid var(--border);
    padding-top: 12px;
}

/* Task Chat — Bubble Style */
.task-chat {
    flex: 1;
    overflow-y: auto;
    max-height: 400px;
    min-height: 200px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 12px;
    background: rgba(0,0,0,0.15);
    border: 1px solid rgba(255,255,255,0.04);
    border-radius: var(--radius);
    scrollbar-width: thin;
}
.task-chat .comment-item {
    padding: 8px 12px; border-radius: var(--radius);
    background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.05);
    transition: background 0.15s;
}
.task-chat .comment-item:hover {
    background: rgba(255,255,255,0.07);
}
.task-chat .comment-item.comment-system {
    background: color-mix(in srgb, var(--primary) 4%, transparent); border-color: color-mix(in srgb, var(--primary) 8%, transparent);
    font-style: italic;
}

/* Task Checklist */
.task-check-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    font-size: var(--text-xs);
    color: var(--text);
    border-radius: var(--radius-sm);
    margin: 1px 0;
    transition: background 0.15s;
}
.task-check-item:hover {
    background: rgba(255,255,255,0.03);
}
.task-check-item.done .task-check-text {
    text-decoration: line-through;
    opacity: 0.5;
}
.task-check-item input[type="checkbox"] {
    accent-color: var(--primary);
    cursor: pointer;
}
.task-check-text {
    flex: 1;
}
.task-check-delete {
    background: none !important;
    border: none !important;
    color: var(--text-muted);
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.15s;
    padding: 2px !important;
}
.task-check-item:hover .task-check-delete {
    opacity: 1;
}

/* Task Files */
.task-file-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 4px 0;
    font-size: var(--text-xs);
}
.task-file-link {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--primary);
    text-decoration: none;
}
.task-file-link:hover {
    text-decoration: underline;
}
.task-file-delete {
    background: none !important;
    border: none !important;
    color: var(--text-muted);
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.15s;
    padding: 2px !important;
}
.task-file-item:hover .task-file-delete {
    opacity: 1;
}

/* .btn-success / .btn-danger определяются один раз в components.css
   (алиасы .btn-soft-success / .btn-soft-danger) */

@media (max-width: 768px) {
    .task-detail-body {
        flex-direction: column;
    }
    .task-detail-right {
        width: 100%;
    }
}

/* ── Tasks Split View ─────────────────────────────────────────────────── */
.tasks-toolbar {
    display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px;
}
.tasks-toolbar-row {
    display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.tasks-toolbar-top { justify-content: space-between; }
.tasks-toolbar-filters { color: var(--text-muted); }
.tasks-tabs {
    display: flex; background: var(--bg-light); border-radius: var(--radius-sm); padding: 3px;
    border: 1px solid var(--border);
}
.tasks-tab {
    border: none; background: transparent; color: var(--text-muted);
    padding: 6px 16px; font-size: var(--text-sm); font-weight: 500;
    border-radius: var(--radius-sm); cursor: pointer; transition: all 0.2s; white-space: nowrap;
}
.tasks-tab:hover:not(.active) {
    color: var(--primary); background: color-mix(in srgb, var(--primary) 5%, transparent);
}
.tasks-tab.active {
    background: linear-gradient(135deg, var(--primary), var(--primary-hover)); color: #fff;
    box-shadow: 0 2px 8px var(--primary-glow);
}
.tasks-search-wrap {
    position: relative; min-width: 200px;
}
.tasks-split {
    display: flex; gap: 0; border: 1px solid var(--border); border-radius: var(--radius);
    /* flex:1 + min-height:0 — секция задаёт высоту, панели скроллятся внутри.
       Иначе при длинном списке split рос за экран и обрезался без скролла. */
    overflow: hidden; background: var(--surface); flex: 1 1 auto; min-height: 0;
    box-shadow: 0 8px 32px rgba(0,0,0,0.2), inset 0 0 0 1px rgba(255,255,255,0.03);
    backdrop-filter: var(--glass-blur);
}
.tasks-list-panel {
    width: 360px; flex-shrink: 0; border-right: 1px solid var(--border);
    display: flex; flex-direction: column; overflow: hidden;
}
/* ── Task Badges (inline in toolbar) ──────────────────────────────────── */
.tasks-badges {
    display: flex; gap: 6px; align-items: center;
}
.tasks-badge {
    display: flex; align-items: center; gap: 4px; font-size: var(--text-2xs); font-weight: 700;
    padding: 4px 10px; border-radius: var(--radius); cursor: pointer;
    transition: all 0.2s; user-select: none;
}
.tasks-badge svg { flex-shrink: 0; }
.tasks-badge.overdue { background: var(--danger-bg); color: var(--danger); }
.tasks-badge.today { background: var(--warning-bg); color: var(--warning); }
.tasks-badge.in-progress { background: var(--info-bg); color: var(--info); }
.tasks-badge.reset { background: rgba(255,255,255,0.06); color: var(--text-muted); }
.tasks-badge:hover { transform: translateY(-1px); filter: brightness(1.15); }
.tasks-badge.badge-active { outline: 2px solid currentColor; outline-offset: -1px; }
/* overdue/today/in-progress в светлой теме — сами через токены */
[data-theme="light"] .tasks-badge.reset { background: rgba(0,0,0,0.04); color: #64748b; }
.tasks-groups {
    flex: 1; overflow-y: auto; padding: 0;
}
.tasks-group {
    border-bottom: 1px solid var(--border);
}
.tasks-group:last-child { border-bottom: none; }
.tasks-group-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 10px 16px; cursor: pointer; user-select: none;
    background: rgba(255,255,255,0.02); font-size: var(--text-xs); font-weight: 700;
    color: var(--text-muted); transition: all 0.2s;
    border-left: 3px solid transparent; letter-spacing: 0.3px;
}
.tasks-group[data-status="in_progress"] .tasks-group-header { border-left-color: var(--info); }
.tasks-group[data-status="pending"] .tasks-group-header { border-left-color: var(--warning); }
.tasks-group[data-status="completed"] .tasks-group-header { border-left-color: var(--success); }
.tasks-group[data-status="deferred"] .tasks-group-header { border-left-color: var(--text-muted); }
.tasks-group-header:hover { background: var(--surface2); }
.tasks-group-header .group-count {
    font-size: var(--text-3xs); padding: 1px 7px; border-radius: var(--radius-sm); font-weight: 600;
}
.tasks-group[data-status="in_progress"] .group-count { background: var(--info-bg); color: var(--info); }
.tasks-group[data-status="pending"] .group-count { background: var(--warning-bg); color: var(--warning); }
.tasks-group[data-status="completed"] .group-count { background: var(--success-bg); color: var(--success); }
.tasks-group[data-status="deferred"] .group-count { background: color-mix(in srgb, var(--text-muted) 12%, transparent); color: var(--text-muted); }
.tasks-group-body { display: flex; flex-direction: column; }
.tasks-group.collapsed .tasks-group-body { display: none; }
.tasks-group.collapsed .group-chevron { transform: rotate(-90deg); }
.group-chevron { transition: transform 0.15s; }

/* Task row in list — Glass Card Style */
.task-row {
    display: flex; align-items: center; gap: 10px; padding: 10px 16px;
    cursor: pointer; transition: all 0.2s ease; border-bottom: 1px solid rgba(255,255,255,0.03);
    position: relative; margin: 2px 8px; border-radius: var(--radius-sm);
    background: rgba(255,255,255,0.02);
}
.task-row:last-child { border-bottom: none; }
.task-row:hover {
    background: color-mix(in srgb, var(--primary) 6%, transparent);
    box-shadow: 0 2px 12px color-mix(in srgb, var(--primary) 8%, transparent), inset 0 0 0 1px color-mix(in srgb, var(--primary) 10%, transparent);
    transform: translateX(2px);
}
.task-row.selected {
    background: linear-gradient(135deg, color-mix(in srgb, var(--primary) 12%, transparent), color-mix(in srgb, var(--primary-hover) 6%, transparent));
    border-left: 3px solid var(--primary); padding-left: 13px;
    box-shadow: 0 4px 20px color-mix(in srgb, var(--primary) 12%, transparent), inset 0 0 0 1px color-mix(in srgb, var(--primary) 15%, transparent);
}
.task-row-priority {
    width: 6px; height: 32px; border-radius: var(--radius-xs); flex-shrink: 0;
    transition: height 0.2s, box-shadow 0.2s;
}
.task-row:hover .task-row-priority { height: 38px; }
.task-row-priority.high { background: var(--danger); box-shadow: 0 0 10px color-mix(in srgb, var(--danger) 40%, transparent); }
.task-row-priority.medium { background: var(--warning); box-shadow: 0 0 10px color-mix(in srgb, var(--warning) 30%, transparent); }
.task-row-priority.low { background: var(--text-muted); box-shadow: 0 0 4px color-mix(in srgb, var(--text-muted) 20%, transparent); }
.task-row-main {
    flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px;
}
.task-row-title {
    font-size: var(--text-sm); font-weight: 500; color: var(--text);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.task-row.completed .task-row-title { text-decoration: line-through; opacity: 0.5; }
.task-row-meta {
    display: flex; align-items: center; gap: 8px; font-size: var(--text-2xs); color: var(--text-muted);
}
.task-row-meta .overdue { color: var(--danger); font-weight: 600; }
.task-row-meta .due-label { padding: 2px 7px; border-radius: var(--radius-sm); font-size: var(--text-3xs); white-space: nowrap; border: 1px solid transparent; }
.task-row-meta .due-overdue { background: linear-gradient(135deg, #fef2f2, #fee2e2); color: #dc2626; font-weight: 600; border-color: #fecaca; }
.task-row-meta .due-today { background: linear-gradient(135deg, #fffbeb, #fef3c7); color: #b45309; font-weight: 600; border-color: #fde68a; }
.task-row-meta .due-tomorrow { background: linear-gradient(135deg, #eff6ff, #dbeafe); color: #2563eb; border-color: #bfdbfe; }
.task-row:focus { outline: 2px solid var(--primary); outline-offset: -2px; }
.task-row-avatars {
    display: flex; flex-shrink: 0; margin-left: 4px;
}
.task-row-avatars .task-row-avatar.co {
    margin-left: -8px; border: 2px solid var(--surface); font-size: var(--text-4xs); width: 24px; height: 24px;
}
.task-row-avatar {
    width: 30px; height: 30px; border-radius: 50%;
    background: linear-gradient(135deg, color-mix(in srgb, var(--primary) 20%, transparent), color-mix(in srgb, var(--primary-hover) 20%, transparent));
    color: var(--primary); border: 1.5px solid color-mix(in srgb, var(--primary) 25%, transparent);
    font-size: var(--text-3xs); font-weight: 700; display: flex;
    align-items: center; justify-content: center; flex-shrink: 0;
    transition: all 0.25s; letter-spacing: 0.5px;
}
.task-row:hover .task-row-avatar {
    background: linear-gradient(135deg, color-mix(in srgb, var(--primary) 30%, transparent), color-mix(in srgb, var(--primary-hover) 30%, transparent));
    border-color: color-mix(in srgb, var(--primary) 50%, transparent);
    box-shadow: 0 0 10px color-mix(in srgb, var(--primary) 20%, transparent);
}
/* Status icon in task row */
.task-row-status {
    display: flex; align-items: center; justify-content: center;
    width: 24px; height: 24px; flex-shrink: 0;
    border-radius: 50%; transition: all 0.2s;
}
.task-row-status i { width: 18px; height: 18px; }
.task-row-status.s-pending { color: var(--warning); }
.task-row-status.s-in_progress { color: var(--info); filter: drop-shadow(0 0 4px color-mix(in srgb, var(--info) 40%, transparent)); }
.task-row-status.s-completed { color: var(--success); filter: drop-shadow(0 0 4px color-mix(in srgb, var(--success) 40%, transparent)); }
.task-row-status.s-deferred { color: var(--text-muted); }
.task-row:hover .task-row-status { transform: scale(1.15); }
.task-row-status:hover { background: color-mix(in srgb, currentColor 15%, transparent); transform: scale(1.3) !important; }

/* Density toggle button state */
.u-icon-btn.active { color: var(--primary); background: color-mix(in srgb, var(--primary) 12%, transparent); border-radius: var(--radius-sm); }

/* Compact row density */
.tasks-list-panel.density-compact .task-row { padding: 6px 16px; gap: 8px; }
.tasks-list-panel.density-compact .task-row-main { gap: 1px; }
.tasks-list-panel.density-compact .task-row-priority { width: 5px; height: 22px; }
.tasks-list-panel.density-compact .task-row:hover .task-row-priority { height: 26px; }
.tasks-list-panel.density-compact .task-row-status { width: 20px; height: 20px; }
.tasks-list-panel.density-compact .task-row-status i { width: 15px; height: 15px; }
.tasks-list-panel.density-compact .task-row-title { font-size: var(--text-xs); }
.tasks-list-panel.density-compact .task-row-meta { font-size: var(--text-3xs); gap: 6px; }
.tasks-list-panel.density-compact .task-row-avatar { width: 22px; height: 22px; }
.tasks-list-panel.density-compact .task-row-avatars .task-row-avatar.co { width: 17px; height: 17px; }

/* Detail panel */
.tasks-detail-panel {
    flex: 1; min-width: 0; display: flex; flex-direction: column;
}
.tasks-detail-empty {
    flex: 1; display: flex; flex-direction: column; align-items: center;
    justify-content: center; color: var(--text-muted); gap: 12px; font-size: var(--text-base);
}
.tasks-detail-content {
    display: flex; flex-direction: column; height: 100%; overflow-y: auto;
}
.td-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 18px 24px; border-bottom: 1px solid var(--border); gap: 12px;
    background: linear-gradient(180deg, color-mix(in srgb, var(--primary) 3%, transparent), transparent);
    backdrop-filter: blur(12px);
}
.td-header-left { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
.td-title-input {
    font-size: 18px; font-weight: 700; border: none; background: transparent;
    color: var(--text); outline: none; width: 100%;
    padding: 6px 0; border-bottom: 2px solid transparent; transition: all 0.2s;
    letter-spacing: -0.3px;
}
.td-title-input:focus { border-bottom-color: var(--primary); box-shadow: 0 4px 12px color-mix(in srgb, var(--primary) 10%, transparent); }
.td-body {
    display: flex; flex: 1; overflow: hidden;
}
.td-fields {
    flex: 1; padding: 20px 24px; overflow-y: auto;
    display: flex; flex-direction: column; gap: 16px;
}
.td-sidebar {
    width: 280px; flex-shrink: 0; border-left: 1px solid var(--border);
    display: flex; flex-direction: column; overflow: hidden;
    transition: width 0.3s ease;
    background: linear-gradient(180deg, color-mix(in srgb, var(--primary) 2%, transparent), transparent);
}
.td-sidebar.expanded {
    width: 420px;
}
.td-sidebar-section {
    border-bottom: 1px solid var(--border); padding: 14px 18px;
}
.td-sidebar-section:last-child { border-bottom: none; flex: 1; display: flex; flex-direction: column; }
.td-sidebar-label {
    font-size: var(--text-3xs); font-weight: 700; color: var(--text-muted);
    text-transform: uppercase; letter-spacing: 1px; margin-bottom: 10px;
}
.td-field-row {
    display: flex; gap: 12px 20px; align-items: start; flex-wrap: wrap;
}
.td-field-row > * { flex: 1 1 190px; min-width: 190px; }
.td-field-label {
    font-size: var(--text-2xs); color: var(--text-muted); font-weight: 500; margin-bottom: 4px;
}
.td-priority-pills {
    display: flex; gap: 6px;
}
.td-priority-pill {
    padding: 4px 14px; border-radius: var(--radius-lg); font-size: var(--text-xs); font-weight: 500;
    border: 1px solid var(--border); background: transparent; cursor: pointer;
    transition: all 0.2s; color: var(--text-muted);
}
.td-priority-pill.active.high { background: linear-gradient(135deg, #fef2f2, #fee2e2); color: #dc2626; border-color: #fca5a5; box-shadow: 0 2px 8px rgba(239,68,68,0.15); }
.td-priority-pill.active.medium { background: linear-gradient(135deg, #fffbeb, #fef3c7); color: #b45309; border-color: #fcd34d; box-shadow: 0 2px 8px rgba(245,158,11,0.15); }
.td-priority-pill.active.low { background: linear-gradient(135deg, #f0f9ff, #e0f2fe); color: #475569; border-color: #94a3b8; box-shadow: 0 2px 8px rgba(100,116,139,0.1); }
.td-priority-pill:hover:not(.active) { transform: translateY(-1px); }
.td-priority-pill.high:hover:not(.active) { border-color: #fca5a5; color: var(--danger); background: color-mix(in srgb, var(--danger) 5%, transparent); }
.td-priority-pill.medium:hover:not(.active) { border-color: #fcd34d; color: var(--warning); background: color-mix(in srgb, var(--warning) 5%, transparent); }
.td-priority-pill.low:hover:not(.active) { border-color: #cbd5e1; color: var(--text-muted); background: color-mix(in srgb, var(--text-muted) 5%, transparent); }
/* Pipeline статусов */
.td-status-pipeline {
    display: flex; align-items: center; gap: 4px 0; min-width: 0; flex-wrap: wrap;
    overflow-x: auto; overflow-y: hidden; scrollbar-width: none;
}
.td-status-pipeline::-webkit-scrollbar { display: none; }
.td-step-line {
    flex: 0 0 14px; height: 2px; background: var(--border); transition: background 0.3s;
}
.td-status-step {
    display: flex; flex-direction: column; align-items: center; gap: 6px;
    background: none; border: none; cursor: pointer; padding: 6px 8px;
    transition: all 0.25s; position: relative; border-radius: var(--radius);
    flex-shrink: 0;
}
.td-status-step:hover {
    background: rgba(255,255,255,0.04);
}
.td-step-dot {
    width: 18px; height: 18px; border-radius: 50%;
    border: 2.5px solid var(--border); background: var(--surface);
    transition: all 0.25s ease;
}
.td-step-label {
    font-size: var(--text-3xs); font-weight: 600; color: var(--text-muted);
    white-space: nowrap; transition: all 0.2s; letter-spacing: 0.2px;
}
/* Passed steps */
.td-status-step.passed .td-step-dot { border-color: var(--success); background: var(--success); box-shadow: 0 0 6px color-mix(in srgb, var(--success) 30%, transparent); }
.td-status-step.passed .td-step-label { color: var(--success); }
.td-step-line.passed { background: var(--success); box-shadow: 0 0 4px color-mix(in srgb, var(--success) 30%, transparent); height: 3px; }
/* Active step */
.td-status-step.active .td-step-label { font-weight: 700; }
/* Pending — amber */
.td-status-step.active.s-pending { background: color-mix(in srgb, var(--warning) 8%, transparent); border-radius: var(--radius); }
.td-status-step.active.s-pending .td-step-dot { border-color: var(--warning); background: var(--warning); box-shadow: 0 0 14px color-mix(in srgb, var(--warning) 60%, transparent), 0 0 28px color-mix(in srgb, var(--warning) 20%, transparent); animation: stepPulse 2s ease-in-out infinite; }
.td-status-step.active.s-pending .td-step-label { color: var(--warning); font-weight: 800; text-shadow: 0 0 10px color-mix(in srgb, var(--warning) 40%, transparent); }
/* In progress — blue */
.td-status-step.active.s-in_progress { background: color-mix(in srgb, var(--info) 8%, transparent); border-radius: var(--radius); }
.td-status-step.active.s-in_progress .td-step-dot { border-color: var(--info); background: var(--info); box-shadow: 0 0 14px color-mix(in srgb, var(--info) 60%, transparent), 0 0 28px color-mix(in srgb, var(--info) 20%, transparent); animation: stepPulse 2s ease-in-out infinite; }
.td-status-step.active.s-in_progress .td-step-label { color: var(--info); font-weight: 800; text-shadow: 0 0 10px color-mix(in srgb, var(--info) 40%, transparent); }
/* Completed — green */
.td-status-step.active.s-completed { background: color-mix(in srgb, var(--success) 8%, transparent); border-radius: var(--radius); }
.td-status-step.active.s-completed .td-step-dot { border-color: var(--success); background: var(--success); box-shadow: 0 0 14px color-mix(in srgb, var(--success) 60%, transparent), 0 0 28px color-mix(in srgb, var(--success) 20%, transparent); }
.td-status-step.active.s-completed .td-step-label { color: var(--success); font-weight: 800; text-shadow: 0 0 10px color-mix(in srgb, var(--success) 40%, transparent); }
/* Deferred — gray */
.td-status-step.active.s-deferred { background: color-mix(in srgb, var(--text-muted) 8%, transparent); border-radius: var(--radius); }
.td-status-step.active.s-deferred .td-step-dot { border-color: var(--text-muted); background: var(--text-muted); box-shadow: 0 0 8px color-mix(in srgb, var(--text-muted) 40%, transparent); }
.td-status-step.active.s-deferred .td-step-label { color: var(--text-muted); font-weight: 800; }
/* Hover colors for inactive steps */
.td-status-step.s-pending:hover:not(.active) { background: color-mix(in srgb, var(--warning) 5%, transparent); }
.td-status-step.s-pending:hover:not(.active) .td-step-dot { border-color: var(--warning); }
.td-status-step.s-pending:hover:not(.active) .td-step-label { color: var(--warning); }
.td-status-step.s-in_progress:hover:not(.active) { background: color-mix(in srgb, var(--info) 5%, transparent); }
.td-status-step.s-in_progress:hover:not(.active) .td-step-dot { border-color: var(--info); }
.td-status-step.s-in_progress:hover:not(.active) .td-step-label { color: var(--info); }
.td-status-step.s-completed:hover:not(.active) { background: color-mix(in srgb, var(--success) 5%, transparent); }
.td-status-step.s-completed:hover:not(.active) .td-step-dot { border-color: var(--success); }
.td-status-step.s-completed:hover:not(.active) .td-step-label { color: var(--success); }
.td-status-step.s-deferred:hover:not(.active) { background: color-mix(in srgb, var(--text-muted) 5%, transparent); }
.td-status-step.s-deferred:hover:not(.active) .td-step-dot { border-color: var(--text-muted); }
.td-status-step.s-deferred:hover:not(.active) .td-step-label { color: var(--text-muted); }
@keyframes stepPulse {
    0%, 100% { box-shadow: 0 0 12px var(--glow-color, color-mix(in srgb, var(--info) 60%, transparent)), 0 0 24px var(--glow-color, color-mix(in srgb, var(--info) 20%, transparent)); }
    50% { box-shadow: 0 0 18px var(--glow-color, color-mix(in srgb, var(--info) 80%, transparent)), 0 0 36px var(--glow-color, color-mix(in srgb, var(--info) 30%, transparent)); }
}
/* Hover */
.td-status-step:hover:not(.active) .td-step-dot { transform: scale(1.25); }
/* Backward compat: keep old class for reference */
.td-status-select { display: flex; gap: 6px; flex-wrap: wrap; }
/* Quick edit inline */
.task-inline-date {
    position: absolute; top: 100%; left: 0; z-index: 100;
    font-size: var(--text-xs); padding: 4px; border-radius: var(--radius-sm);
    border: 1px solid var(--primary); background: var(--surface);
    color: var(--text); box-shadow: var(--shadow);
}
.due-label { cursor: pointer; }
.due-label.due-empty {
    font-size: var(--text-3xs); color: var(--text-muted); opacity: 0;
    border: 1px dashed var(--border); padding: 1px 6px; border-radius: var(--radius-xs);
    transition: opacity 0.15s;
}
.task-row:hover .due-label.due-empty,
.due-label.due-empty:focus { opacity: 0.6; }
.due-label.due-empty:hover { opacity: 1; border-color: var(--primary); color: var(--primary); }
.td-footer {
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px 20px; border-top: 1px solid var(--border);
}
.td-sticky-footer {
    position: sticky; bottom: 0; z-index: 10;
    display: flex; justify-content: flex-end; padding: 14px 24px;
    border-top: 1px solid var(--border);
    background: linear-gradient(180deg, transparent, var(--surface));
    backdrop-filter: var(--glass-blur);
}
.td-sticky-footer .btn-primary {
    box-shadow: 0 4px 16px color-mix(in srgb, var(--primary) 30%, transparent);
    padding: 8px 24px; font-size: var(--text-sm); font-weight: 600;
}

@media (max-width: 1100px) {
    .tasks-list-panel { width: 300px; }
    .td-sidebar { width: 230px; }
    .td-sidebar.expanded { width: 320px; }
}
@media (max-width: 768px) {
    .tasks-split { flex-direction: column; min-height: auto; position: relative; }
    .tasks-list-panel { width: 100%; border-right: none; border-bottom: 1px solid var(--border); max-height: none; }
    .tasks-detail-panel { display: none; }
    /* Когда задача выбрана — показать детали на весь экран */
    .tasks-split.mobile-detail-open .tasks-list-panel { display: none; }
    .tasks-split.mobile-detail-open .tasks-detail-panel {
        display: flex; position: absolute; top: 0; left: 0; right: 0; bottom: 0;
        z-index: 20; background: var(--bg);
    }
    .td-body { flex-direction: column; }
    .td-sidebar { width: 100%; border-left: none; border-top: 1px solid var(--border); }
    .td-sidebar.expanded { width: 100%; }
    .td-mobile-back { display: flex !important; }
    .td-status-pipeline { flex-wrap: wrap; gap: 4px; }
    .td-step-line { flex: 0 0 12px; }
    .td-step-label { font-size: var(--text-4xs); }
}
@media (min-width: 769px) {
    .td-mobile-back { display: none !important; }
}

/* ── Task Row: Mini Progress Bar (#3) ──────────────────────────────────── */
.task-row-progress-wrap {
    display: inline-flex; align-items: center; gap: 5px;
}
.task-row-progress-bar {
    width: 40px; height: 4px; border-radius: var(--radius-xs);
    background: var(--border); overflow: hidden; flex-shrink: 0;
}
.task-row-progress-fill {
    height: 100%; border-radius: var(--radius-xs);
    background: var(--primary); transition: width 0.4s ease;
}
.task-row-progress-fill.complete {
    background: var(--success);
}
.task-row-progress-text {
    font-size: var(--text-3xs); color: var(--text-muted); white-space: nowrap;
}

/* Old .tasks-counter styles removed — replaced by .tasks-badge */

/* ── Task Row Animations (#6) ──────────────────────────────────────────── */
.tasks-group-body {
    transition: opacity 0.2s;
}
.task-row {
    animation: taskRowIn 0.3s ease both;
}
@keyframes taskRowIn {
    from { opacity: 0; transform: translateX(-8px); }
    to   { opacity: 1; transform: translateX(0); }
}
.task-row:nth-child(1) { animation-delay: 0s; }
.task-row:nth-child(2) { animation-delay: 0.03s; }
.task-row:nth-child(3) { animation-delay: 0.06s; }
.task-row:nth-child(4) { animation-delay: 0.09s; }
.task-row:nth-child(5) { animation-delay: 0.12s; }
.task-row:nth-child(6) { animation-delay: 0.15s; }
.task-row:nth-child(7) { animation-delay: 0.18s; }
.task-row:nth-child(8) { animation-delay: 0.21s; }
.task-row:nth-child(n+9) { animation-delay: 0.24s; }

.tasks-group {
    animation: groupFadeIn 0.25s ease both;
}
@keyframes groupFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}
.tasks-group:nth-child(2) { animation-delay: 0.08s; }
.tasks-group:nth-child(3) { animation-delay: 0.16s; }
.tasks-group:nth-child(4) { animation-delay: 0.24s; }

/* Smooth checklist toggle */
.task-check-item {
    transition: opacity 0.2s, transform 0.2s;
}
.task-check-item.done {
    transform: translateX(4px);
}

/* Status change flash */
.task-row.status-flash {
    animation: statusFlash 0.5s ease;
}
@keyframes statusFlash {
    0%   { background: color-mix(in srgb, var(--primary) 15%, transparent); }
    100% { background: transparent; }
}

/* ── Nav Badge for Unseen Tasks (#7) ───────────────────────────────────── */
.task-nav-badge {
    position: absolute; top: 4px; right: 4px;
    min-width: 18px; height: 18px; padding: 0 5px;
    border-radius: var(--radius-sm); background: var(--danger); color: #fff;
    font-size: var(--text-3xs); font-weight: 700; line-height: 18px;
    text-align: center; pointer-events: none;
    box-shadow: 0 2px 6px color-mix(in srgb, var(--danger) 40%, transparent);
}
.task-nav-badge.badge-pulse {
    animation: badgePulse 2s ease-in-out infinite;
}
@keyframes badgePulse {
    0%, 100% { transform: scale(1); }
    50%      { transform: scale(1.15); }
}

/* Unseen task row indicator */
.task-row.task-unseen {
    border-left: 3px solid var(--info);
    padding-left: 13px;
}
.task-row.task-unseen::after {
    content: '';
    position: absolute; top: 8px; right: 8px;
    width: 6px; height: 6px; border-radius: 50%;
    background: var(--info);
}

/* 1C Integration UI Premium Styles */
.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: var(--radius);
    font-size: 11.5px;
    font-weight: 600;
    white-space: nowrap;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1);
}
.status-pill.sync-1c {
    background: var(--success-bg);
    color: var(--success);
    border: 1px solid var(--success-border);
}
.status-pill.sync-local {
    background: color-mix(in srgb, var(--text-muted) 15%, transparent);
    color: var(--text-muted);
    border: 1px solid color-mix(in srgb, var(--text-muted) 20%, transparent);
}
.status-pill.sync-error,
.status-pill.sync-unposted {
    background: var(--danger-bg);
    color: var(--danger);
    border: 1px solid var(--danger-border);
}
.status-pill.sync-edited {
    background: var(--warning-bg);
    color: var(--warning);
    border: 1px solid var(--warning-border);
}
.status-pill.sync-posted {
    background: color-mix(in srgb, var(--primary) 12%, transparent);
    color: var(--primary);
    border: 1px solid color-mix(in srgb, var(--primary) 30%, transparent);
}

.nom-details-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 6px;
}

.nom-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: var(--radius-sm);
    background: var(--surface2);
    border: 1px solid var(--border);
    font-size: var(--text-2xs);
    color: var(--text-muted);
}
.nom-badge strong {
    color: var(--text);
    font-weight: 500;
}
.nom-badge i {
    width: 12px;
    height: 12px;
    opacity: 0.7;
}

