/* ===== Projects Page — Brutalist ===== */

.projects-layout {
    display: flex;
    gap: 0;
    flex: 1;
    min-height: 0;
    background: var(--card-bg);
    border: var(--border-w) solid var(--border-color);
    border-radius: var(--radius);
    overflow: hidden;
}

/* ── Sidebar ── */
.projects-sidebar {
    width: 220px;
    flex-shrink: 0;
    background: var(--bg-secondary);
    border-right: var(--border-w) solid var(--border-color);
    padding: 12px 8px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    overflow-y: auto;
}

.sidebar-section {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.sidebar-divider {
    height: 2px;
    background: var(--border-color);
    margin: 6px 8px;
}

.sidebar-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-radius: var(--radius);
    border: none;
    background: transparent;
    cursor: pointer;
    width: 100%;
    text-align: left;
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    transition: background-color 0.05s;
}

.sidebar-item:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.sidebar-item.active {
    background: var(--text-heading);
    color: var(--card-bg);
}

.sidebar-item-icon svg {
    width: 15px;
    height: 15px;
    fill: currentColor;
    display: block;
    flex-shrink: 0;
}

.sidebar-item-dot {
    width: 10px;
    height: 10px;
    border-radius: var(--radius);
    flex-shrink: 0;
}

.sidebar-item-label {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 600;
}

.sidebar-item-count {
    font-size: 10px;
    font-family: var(--font-mono);
    color: var(--text-muted);
    flex-shrink: 0;
    font-weight: 700;
}

.sidebar-project-actions {
    display: flex;
    gap: 2px;
    opacity: 0;
    transition: opacity 0.1s;
}

.sidebar-item:hover .sidebar-project-actions {
    opacity: 1;
}

.btn-sidebar-action {
    width: 20px;
    height: 20px;
    border: 1px solid var(--border-light);
    background: transparent;
    cursor: pointer;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.btn-sidebar-action:hover {
    background: var(--bg-color);
}

.btn-sidebar-action svg {
    width: 13px;
    height: 13px;
    fill: var(--text-muted);
}

.btn-sidebar-action.delete:hover {
    background: #d32f2f;
    border-color: #d32f2f;
}

.btn-sidebar-action.delete:hover svg {
    fill: white;
}

/* ── Main area ── */
.projects-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow: hidden;
}

/* Toolbar */
.tasks-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: var(--border-w) solid var(--border-color);
    gap: 12px;
    flex-shrink: 0;
}

.tasks-toolbar-left {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.tasks-project-name {
    font-size: 14px;
    font-weight: 700;
    font-family: var(--font-display);
    color: var(--text-heading);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.tasks-toolbar-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.view-toggle {
    display: flex;
    gap: 0;
    border: var(--border-w) solid var(--border-color);
    border-radius: var(--radius);
    padding: 0;
    background: transparent;
}

.btn-view-toggle {
    width: 32px;
    height: 28px;
    border: none;
    background: transparent;
    border-radius: var(--radius);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-view-toggle:hover {
    background: var(--bg-secondary);
}

.btn-view-toggle.active {
    background: var(--text-heading);
}

.btn-view-toggle svg {
    width: 16px;
    height: 16px;
    fill: var(--text-muted);
}

.btn-view-toggle.active svg {
    fill: var(--card-bg);
}

.filter-group {
    display: flex;
    gap: 0;
}

.btn-filter-chip {
    padding: 5px 12px;
    border: var(--border-w) solid var(--border-color);
    background: transparent;
    border-radius: var(--radius);
    font-size: 10px;
    font-weight: 600;
    font-family: var(--font-mono);
    color: var(--text-primary);
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn-filter-chip:hover {
    background: var(--text-heading);
    color: var(--card-bg);
}

.btn-filter-chip.active {
    background: var(--theme-color);
    border-color: var(--theme-color);
    color: white;
}

/* Add task form */
.task-add-form {
    padding: 10px 16px;
    border-bottom: var(--border-w) solid var(--border-color);
    background: var(--bg-secondary);
    flex-shrink: 0;
}

.task-add-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.btn-task-check {
    width: 20px;
    height: 20px;
    border: none;
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: var(--border-color);
    padding: 0;
}

.btn-task-check.placeholder { cursor: default; }

.btn-task-check svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

.task-add-input {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 13px;
    font-family: var(--font-mono);
    color: var(--text-primary);
    outline: none;
    min-width: 0;
}

.task-add-input::placeholder {
    color: var(--text-muted);
}

.task-add-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.meta-select,
.meta-date {
    padding: 5px 8px;
    border: var(--border-w) solid var(--border-color);
    border-radius: var(--radius);
    background: var(--card-bg);
    font-size: 11px;
    font-family: var(--font-mono);
    color: var(--text-primary);
    outline: none;
    cursor: pointer;
}

.meta-select:focus,
.meta-date:focus {
    border-color: var(--theme-color);
    box-shadow: 2px 2px 0 var(--theme-color);
}

.btn-add-task {
    padding: 6px 14px;
    background: var(--theme-color);
    border: var(--border-w) solid var(--theme-color);
    border-radius: var(--radius);
    font-size: 11px;
    font-weight: 700;
    font-family: var(--font-mono);
    color: white;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 1px;
    white-space: nowrap;
}

.btn-add-task:hover {
    filter: brightness(0.9);
}

/* Tasks view */
.tasks-view {
    flex: 1;
    overflow-y: auto;
    padding: 0;
}

/* ── List View ── */
.task-list {
    display: flex;
    flex-direction: column;
}

.task-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    border-bottom: 1px solid var(--border-light);
    cursor: default;
    transition: background-color 0.05s;
}

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

.task-item:hover {
    background: var(--bg-secondary);
}

.task-item.task-item-selected {
    background: var(--accent);
    color: #fff;
}
.task-item.task-item-selected .task-name,
.task-item.task-item-selected .task-state-badge,
.task-item.task-item-selected .task-priority-badge,
.task-item.task-item-selected .task-project-tag,
.task-item.task-item-selected .task-due-date { color: rgba(255,255,255,.85); background: rgba(255,255,255,.15); border-color: transparent; }
.task-item.task-item-selected .task-check-btn { border-color: rgba(255,255,255,.6); }
.task-item.task-item-selected .task-check-btn svg { stroke: rgba(255,255,255,.8); }
.task-item.task-item-selected .btn-task-action { color: rgba(255,255,255,.7); }
.task-item.task-item-selected .btn-task-action:hover { color: #fff; }

.task-item.completed .task-name {
    text-decoration: line-through;
    color: var(--text-muted);
}

.task-check-btn {
    width: 20px;
    height: 20px;
    border: none;
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: var(--text-muted);
    padding: 0;
}

.task-check-btn:hover { color: var(--theme-color); }
.task-check-btn.checked { color: var(--theme-color); }

.task-check-btn svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

.task-info {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    cursor: pointer;
}

.task-name {
    font-size: 12px;
    font-weight: 600;
    font-family: var(--font-mono);
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.task-project-tag {
    font-size: 9px;
    font-weight: 700;
    font-family: var(--font-mono);
    padding: 2px 6px;
    border-radius: var(--radius);
    white-space: nowrap;
    flex-shrink: 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.task-priority-badge {
    display: inline-flex;
    align-items: center;
    font-size: 9px;
    font-weight: 700;
    font-family: var(--font-mono);
    padding: 2px 6px;
    border-radius: var(--radius);
    flex-shrink: 0;
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.priority-high   { background: #d32f2f; color: white; }
.priority-medium { background: #f57c00; color: white; }
.priority-low    { background: #388e3c; color: white; }

.task-due-date {
    font-size: 10px;
    font-family: var(--font-mono);
    color: var(--text-muted);
    white-space: nowrap;
    flex-shrink: 0;
}

.task-due-date.overdue {
    color: #d32f2f;
    font-weight: 700;
}

.task-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
    opacity: 0;
    transition: opacity 0.1s;
}

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

.btn-task-action {
    width: 26px;
    height: 26px;
    border: 1px solid transparent;
    background: transparent;
    cursor: pointer;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
}

.task-item:hover .btn-task-action {
    border-color: var(--border-light);
}

.btn-task-action:hover {
    background: var(--bg-tertiary);
}

.btn-task-action.timer:hover {
    background: var(--theme-color);
    border-color: var(--theme-color);
}

.btn-task-action.timer svg {
    fill: var(--text-muted);
}

.btn-task-action.timer:hover svg {
    fill: white;
}

.btn-task-action.delete:hover {
    background: #d32f2f;
    border-color: #d32f2f;
}

.btn-task-action svg {
    width: 14px;
    height: 14px;
    fill: var(--text-muted);
}

.btn-task-action.delete:hover svg {
    fill: white;
}

.task-list-empty {
    padding: 48px 24px;
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
    font-family: var(--font-mono);
}

/* ── Kanban Board ── */
.kanban-board {
    display: flex;
    gap: 12px;
    padding: 12px 16px;
    min-height: 100%;
    align-items: flex-start;
}

.kanban-col {
    flex: 1;
    min-width: 0;
    background: var(--bg-secondary);
    border: var(--border-w) solid var(--border-color);
    border-radius: var(--radius);
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.kanban-col-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 4px 4px 8px;
    border-bottom: 3px solid var(--border-color);
    margin-bottom: 4px;
}

.kanban-col-title {
    font-size: 10px;
    font-weight: 700;
    font-family: var(--font-mono);
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--text-heading);
}

.kanban-col-count {
    font-size: 11px;
    font-weight: 700;
    font-family: var(--font-mono);
    color: var(--text-muted);
    background: var(--bg-tertiary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    padding: 1px 6px;
}

.kanban-cards {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-height: 40px;
}

.kanban-card {
    background: var(--card-bg);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    padding: 10px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 6px;
    transition: border-color 0.05s;
}

.kanban-card:hover {
    border-color: var(--border-color);
}

.kanban-card-title {
    font-size: 12px;
    font-weight: 600;
    font-family: var(--font-mono);
    color: var(--text-primary);
    line-height: 1.4;
}

.kanban-card-title.completed {
    text-decoration: line-through;
    color: var(--text-muted);
}

.kanban-card-meta {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
}

.kanban-card-actions {
    display: flex;
    gap: 4px;
    justify-content: flex-end;
    margin-top: 4px;
    opacity: 0;
    transition: opacity 0.1s;
}

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

.btn-kanban-add {
    width: 100%;
    padding: 8px;
    border: 2px dashed var(--border-color);
    background: transparent;
    border-radius: var(--radius);
    font-size: 11px;
    font-family: var(--font-mono);
    color: var(--text-muted);
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 4px;
}

.btn-kanban-add:hover {
    border-style: solid;
    border-color: var(--theme-color);
    color: var(--theme-color);
    background: var(--theme-color-light);
}

/* ── Project Modal ── */
.modal-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.modal-form-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

.project-color-options {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 4px;
}

.project-color-swatch {
    width: 28px;
    height: 28px;
    border-radius: var(--radius);
    border: 3px solid transparent;
    cursor: pointer;
}

.project-color-swatch:hover {
    border-color: var(--text-muted);
}

.project-color-swatch.selected {
    border-color: var(--text-heading);
}

/* ── State Badge (clickable) ── */
.task-state-badge {
    display: inline-flex;
    align-items: center;
    font-size: 9px;
    font-weight: 700;
    font-family: var(--font-mono);
    padding: 2px 8px;
    border: var(--border-w) solid var(--border-color);
    border-radius: var(--radius);
    flex-shrink: 0;
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    background: var(--bg-secondary);
    cursor: pointer;
    user-select: none;
}

.task-state-badge:hover {
    background: var(--text-heading);
    color: var(--card-bg);
    border-color: var(--text-heading);
}

/* Color-coded state badges */
.task-state-badge.state-todo {
    color: #6b7280;
    background: #f3f4f6;
    border-color: #d1d5db;
}

.task-state-badge.state-progress {
    color: #b45309;
    background: #fef3c7;
    border-color: #fcd34d;
}

.task-state-badge.state-done {
    color: #047857;
    background: #d1fae5;
    border-color: #6ee7b7;
}

.task-state-badge.small {
    font-size: 8px;
    padding: 1px 5px;
}

/* ── State Group Headers (ClickUp-style grouped list) ── */
.state-group-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    cursor: pointer;
    user-select: none;
    border-bottom: var(--border-w) solid var(--border-color);
    transition: background 0.1s;
}

.state-group-header:first-child {
    border-top: none;
}

.state-group-header:hover {
    background: var(--bg-secondary);
}

.state-group-chevron {
    display: inline-flex;
    align-items: center;
    transition: transform 0.15s;
}

.state-group-chevron svg {
    fill: var(--text-muted);
}

.state-group-header.collapsed .state-group-chevron {
    transform: rotate(-90deg);
}

.state-group-name {
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.state-group-count {
    font-family: var(--font-mono);
    font-size: 10px;
    color: var(--text-muted);
    background: var(--bg-secondary);
    padding: 1px 7px;
    border: var(--border-w) solid var(--border-color);
}

/* Color themes for group headers */
.state-group-todo .state-group-name {
    color: #6b7280;
}
.state-group-todo {
    border-left: 3px solid #9ca3af;
}

.state-group-progress .state-group-name {
    color: #b45309;
}
.state-group-progress {
    border-left: 3px solid #f59e0b;
}

.state-group-done .state-group-name {
    color: #047857;
}
.state-group-done {
    border-left: 3px solid #10b981;
}

.state-group-tasks {
    border-bottom: var(--border-w) solid var(--border-color);
}

.state-group-tasks .task-item {
    padding-left: 28px;
}

.state-group-empty {
    padding: 12px 28px;
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-muted);
    font-style: italic;
}

/* ── Task Status Picker ── */
.task-status-picker {
    position: relative;
    flex-shrink: 0;
}

.task-status-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 3px 8px;
    border: var(--border-w) solid var(--border-color);
    background: var(--bg-secondary);
    color: var(--text-secondary);
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.1s, border-color 0.1s;
}

.task-status-btn:hover {
    background: var(--bg-color);
    border-color: var(--text-muted);
}

.task-status-btn .task-status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    flex-shrink: 0;
}

.task-status-btn.state-todo .task-status-dot { background: #9ca3af; }
.task-status-btn.state-progress .task-status-dot { background: #f59e0b; }
.task-status-btn.state-done .task-status-dot { background: #10b981; }

.task-status-chevron {
    fill: var(--text-muted);
    flex-shrink: 0;
}

/* Dropdown */
.task-status-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    z-index: 100;
    min-width: 150px;
    background: var(--card-bg);
    border: var(--border-w) solid var(--border-color);
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
    padding: 4px 0;
}

.task-status-dropdown.open {
    display: block;
}

.task-status-option {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 7px 12px;
    border: none;
    background: none;
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-secondary);
    cursor: pointer;
    text-align: left;
}

.task-status-option:hover {
    background: var(--bg-secondary);
}

.task-status-option.current {
    color: var(--text-heading);
    font-weight: 700;
}

.task-status-option.current svg {
    fill: var(--text-heading);
    margin-left: auto;
}

.task-status-option .task-status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    flex-shrink: 0;
}

.task-status-option.state-opt-first .task-status-dot { background: #9ca3af; }
.task-status-option.state-opt-middle .task-status-dot { background: #f59e0b; }
.task-status-option.state-opt-last .task-status-dot { background: #10b981; }

/* ── State Editor (Manage States modal) ── */
.state-item-info {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 0;
}

.state-order-badge {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 700;
    font-family: var(--font-mono);
    color: var(--text-muted);
    border: 1px solid var(--border-light);
    background: var(--bg-secondary);
    flex-shrink: 0;
}

.state-terminal-tag {
    font-size: 8px;
    font-weight: 700;
    font-family: var(--font-mono);
    padding: 1px 6px;
    background: var(--theme-color);
    color: white;
    text-transform: uppercase;
    letter-spacing: 1px;
    flex-shrink: 0;
}

.state-item-actions {
    display: flex;
    gap: 2px;
    flex-shrink: 0;
}

.state-item-actions .btn-task-action {
    width: 24px;
    height: 24px;
    border: 1px solid var(--border-light);
}

.state-item-actions .btn-task-action:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.state-item-actions .btn-task-action:disabled:hover {
    background: transparent;
    border-color: var(--border-light);
}

/* Responsive */
@media (max-width: 600px) {
    .projects-layout {
        flex-direction: column;
    }

    .projects-sidebar {
        width: 100%;
        flex-direction: row;
        flex-wrap: nowrap;
        overflow-x: auto;
        border-right: none;
        border-bottom: var(--border-w) solid var(--border-color);
        padding: 8px;
        gap: 2px;
        /* Smooth scrolling on iOS */
        -webkit-overflow-scrolling: touch;
    }

    .sidebar-divider {
        width: 2px;
        height: auto;
        margin: 4px;
    }

    .kanban-board {
        flex-direction: column;
    }

    /* Task add form: stack priority/date below input on mobile */
    .task-add-row {
        flex-wrap: wrap;
    }

    .task-add-input {
        min-width: 0;
        flex: 1 1 100%;
        order: 1;
        border: var(--border-w) solid var(--border-color);
        background: var(--card-bg);
        padding: 8px 10px;
    }

    .btn-task-check.placeholder {
        order: 0;
    }

    .task-add-meta {
        flex-wrap: nowrap;
        order: 2;
        width: 100%;
        margin-top: 6px;
    }

    .meta-select,
    .meta-date {
        flex: 1;
        min-width: 0;
        font-size: 11px;
    }

    .tasks-toolbar {
        flex-wrap: wrap;
        gap: 8px;
        padding: 10px 12px;
    }

    .tasks-toolbar-left {
        flex: 1;
        min-width: 0;
    }

    /* Task actions: always visible on touch (no hover) */
    .task-actions {
        opacity: 1;
    }

    .task-item:hover .btn-task-action {
        border-color: transparent;
    }

    /* Sidebar project actions: always visible on touch */
    .sidebar-project-actions {
        opacity: 1;
    }

    /* Kanban card actions: always visible on touch */
    .kanban-card-actions {
        opacity: 1;
    }

    /* Sidebar item: shrink so more fit */
    .sidebar-item {
        flex-shrink: 0;
        padding: 6px 10px;
    }

    .sidebar-item-label {
        white-space: nowrap;
        max-width: 80px;
    }
}

/* ── Projects Overview ── */
.projects-overview {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}

.projects-overview-empty {
    padding: 48px 24px;
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
    font-family: var(--font-mono);
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}

.project-card {
    border: var(--border-w) solid var(--border-color);
    background: var(--card-bg);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: transform 0.08s, box-shadow 0.08s;
}

.project-card:hover {
    transform: translateY(-2px);
    box-shadow: 3px 3px 0 var(--border-color);
}

.project-card-accent {
    height: 5px;
    flex-shrink: 0;
}

.project-card-body {
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.project-card-name {
    font-size: 13px;
    font-weight: 700;
    font-family: var(--font-display);
    color: var(--text-heading);
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.project-card-stats {
    display: flex;
    gap: 14px;
    font-size: 11px;
    font-family: var(--font-mono);
    color: var(--text-muted);
}

.project-card-stats strong {
    color: var(--text-primary);
}

.project-card-progress-track {
    height: 3px;
    background: var(--border-color);
    overflow: hidden;
}

.project-card-progress-bar {
    height: 100%;
}

/* ── Drag handle for task reordering ── */
.drag-handle {
    cursor: grab;
    display: flex;
    align-items: center;
    color: var(--text-muted);
    padding: 2px;
    opacity: 0.3;
    flex-shrink: 0;
}
.drag-handle:active { cursor: grabbing; }
.drag-handle:hover { opacity: 1; }
.task-item.dragging { opacity: 0.3; }
.task-item.drag-over { box-shadow: 0 -2px 0 0 var(--theme-color); }
.btn-task-action.reorder-up,
.btn-task-action.reorder-down { opacity: 0; }
.task-item:hover .btn-task-action.reorder-up,
.task-item:hover .btn-task-action.reorder-down { opacity: 0.5; }
.btn-task-action.reorder-up:hover,
.btn-task-action.reorder-down:hover { opacity: 1; }

@media (max-width: 600px) {
    .projects-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 8px;
    }
}
