        /* (process-card removed — replaced by pipeline rows) */
        
        .task-card.pinned {
            background: linear-gradient(90deg, rgba(34, 197, 94, 0.08) 0%, var(--white) 100%);
            border-left: 4px solid var(--primary);
        }
        
        .task-card-header, .function-header, .user-header {
            display: flex;
            justify-content: space-between;
            align-items: flex-start;
            gap: 0.5rem;
            margin-bottom: 0.5rem;
        }
        
        .task-title, .function-title, .user-name { font-weight: 600; font-size: 0.95rem; flex: 1; color: var(--dark); }
        
        .pin-btn {
            background: none;
            border: none;
            cursor: pointer;
            font-size: 0.9rem;
            color: #d1d5db;
            padding: 0.2rem;
        }
        
        .pin-btn:hover, .pin-btn.pinned { color: var(--warning); }
        
        .task-meta, .function-description, .user-details {
            font-size: 0.8rem;
            color: var(--gray);
            margin-bottom: 0.5rem;
            line-height: 1.4;
        }
        
        .task-meta { display: flex; flex-wrap: wrap; gap: 0.5rem; }
        .task-meta-item { display: flex; align-items: center; gap: 0.2rem; }
        
        .task-badges, .function-assignees { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-bottom: 0.5rem; }
        
        .badge, .assignee-badge, .role-badge {
            padding: 0.2rem 0.5rem;
            border-radius: 10px;
            font-size: 0.7rem;
            font-weight: 500;
        }
        
        .badge-new { background: #eff6ff; color: #2563eb; }
        .badge-progress { background: #fef3c7; color: #d97706; }
        .badge-review { background: #fae8ff; color: #a855f7; }
        .badge-done { background: #f0fdf4; color: #16a34a; }
        .badge-high { background: #fef2f2; color: #dc2626; }
        .badge-medium { background: #fef3c7; color: #d97706; }
        .badge-low { background: #f0fdf4; color: #16a34a; }
        
        .assignee-badge { background: var(--primary); color: white; }
        .assignee-badge.head { background: var(--warning); }
        
        .role-badge { color: white; }
        .role-badge.owner { background: var(--danger); }
        .role-badge.manager { background: var(--warning); }
        .role-badge.employee { background: var(--info); }
        
        .task-actions, .function-stats, .user-stats { 
            display: flex; 
            gap: 0.4rem; 
            justify-content: flex-end;
            padding-top: 0.5rem;
        }
        
        .task-deadline-row {
            display: flex;
            gap: 0.75rem;
            align-items: center;
            font-size: 0.85rem;
            padding: 0.5rem 0;
            flex-wrap: wrap;
        }
        
        .task-deadline-row.overdue-text { color: #e74c3c; font-weight: 600; }
        .task-deadline-row.today-text { color: #2980b9; font-weight: 600; }
        
        .time-badge {
            background: #e8f4fd;
            color: #2980b9;
            padding: 0.15rem 0.5rem;
            border-radius: 10px;
            font-size: 0.75rem;
            font-weight: 500;
        }
        
        .task-detail {
            font-size: 0.8rem;
            color: #555;
            padding: 0.4rem 0.6rem;
            background: #f8f9fa;
            border-radius: 6px;
            margin-top: 0.4rem;
            line-height: 1.4;
        }
        
        .task-detail strong { color: #333; }
        
        .task-footer {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding-top: 0.5rem;
            margin-top: 0.5rem;
            border-top: 1px solid #ecf0f1;
        }
        
        .task-created {
            font-size: 0.7rem;
            color: #95a5a6;
        }
        
        .regular-schedule {
            font-size: 0.85rem;
            color: #2980b9;
            font-weight: 500;
            margin-bottom: 0.5rem;
            padding: 0.3rem 0.6rem;
            background: #e8f4fd;
            border-radius: 6px;
            display: inline-block;
        }
        
        .instruction-preview {
            cursor: pointer;
            transition: background 0.2s;
        }
        
        .instruction-preview:hover {
            background: #e8f4fd;
        }
        
        .task-card.overdue {
            border-left: 4px solid #e74c3c;
            background: linear-gradient(90deg, rgba(231, 76, 60, 0.05) 0%, var(--white) 100%);
        }
        
        .task-card.today {
            border-left: 4px solid #3498db;
            background: linear-gradient(90deg, rgba(52, 152, 219, 0.05) 0%, var(--white) 100%);
        }
        
        .total-time-badge {
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            color: white;
            padding: 0.5rem 1rem;
            border-radius: 20px;
            font-size: 0.85rem;
            font-weight: 500;
        }
        
        .total-time-container {
            padding: 0.5rem 1rem;
            text-align: right;
        }
        
        .filters-row {
            display: flex;
            flex-wrap: nowrap;
            gap: 0.35rem;
            align-items: center;
            overflow-x: auto;
            -webkit-overflow-scrolling: touch;
        }
        .filters-row::-webkit-scrollbar { display: none; }
        .filters-row { scrollbar-width: none; }
        
        .btn-clear {
            background: #95a5a6;
        }
        
        /* Table styles */
        .table-container {
            background: var(--white);
            border-radius: var(--radius);
            box-shadow: var(--shadow);
            overflow-x: auto; /* мобайл — скрол є */
        }

        @media (min-width: 768px) {
            #tasksTab .table-container,
            #regularTab .table-container {
                overflow-x: hidden; /* десктоп — колонки стискаються, не скрол */
            }
        }
        
        .tasks-table {
            width: 100%;
            border-collapse: collapse;
            min-width: 0;
            table-layout: auto;
        }

        /* Desktop: table-container breaks out of .container padding — full viewport width */
        /* Handled via #tasksTab rules in base.css */
        
        .tasks-table th {
            background: #34495e;
            color: white;
            padding: 1rem;
            text-align: left;
            font-weight: 500;
            font-size: 0.85rem;
            position: relative;
            user-select: none;
        }
        .tasks-table th.sortable { cursor: pointer; }
        .tasks-table th.sortable:hover { background: #2c3e50; }
        .tasks-table th .sort-icon { opacity: 0.4; margin-left: 4px; font-size: 0.75rem; }
        .tasks-table th.sort-active .sort-icon { opacity: 1; }
        .tasks-table th .col-resize-handle {
            position: absolute;
            right: 0;
            top: 0;
            bottom: 0;
            width: 6px;
            cursor: col-resize;
            background: transparent;
            z-index: 1;
        }
        .tasks-table th .col-resize-handle:hover,
        .tasks-table th .col-resize-handle.resizing { background: rgba(255,255,255,0.3); }
        
        .tasks-table td {
            padding: 0.75rem 1rem;
            border-bottom: 1px solid #ecf0f1;
            font-size: 0.85rem;
        }
        
        .tasks-table tr:hover {
            background: #f8f9fa;
        }
        
        .tasks-table .task-title-cell {
            max-width: 250px;
        }
        
        .tasks-table .task-title-text {
            font-weight: 500;
            color: var(--dark);
            cursor: pointer;
            transition: color 0.15s;
        }
        .tasks-table .task-title-text:hover {
            color: var(--primary-dark);
            text-decoration: underline;
        }
        
        .tasks-table .task-title-text.pinned {
            color: #e74c3c;
        }
        
        .btn-clear.active {
            background: var(--primary);
            color: white;
            border-color: var(--primary);
        }
        
        .status-badge {
            padding: 0.25rem 0.6rem;
            border-radius: 12px;
            font-size: 0.75rem;
            font-weight: 500;
            display: inline-block;
        }
        
        .status-new { background: #e3f2fd; color: #1976d2; }
        .status-progress { background: #fff3e0; color: #f57c00; }
        .status-review { background: #fce4ec; color: #c2185b; }
        .status-done { background: #e8f5e8; color: #388e3c; }
        /* Fallback: якщо статус невідомий або відсутній — нейтральний стиль */
        .status-badge:not(.status-new):not(.status-progress):not(.status-review):not(.status-done) {
            background: #f3f4f6; color: #6b7280;
        }
        
        .myday-item.review { background: #faf5ff; border-left: 3px solid #8b5cf6; }
        .myday-item.review .myday-item-title { color: #6b21a8; }
        
        .deadline-text.overdue { color: #e74c3c; font-weight: 600; }
        .deadline-text.today { color: #3498db; font-weight: 600; }
        
        .action-btns {
            display: flex;
            gap: 0.25rem;
        }
        
        .action-btn {
            background: none;
            border: none;
            cursor: pointer;
            font-size: 1rem;
            padding: 0.25rem;
            border-radius: 4px;
            transition: background 0.2s;
        }
        
        .action-btn:hover {
            background: #ecf0f1;
        }
        
        /* Dashboard subtitle */
        .dashboard-subtitle {
            font-size: 0.7rem;
            opacity: 0.85;
            margin-top: 0.25rem;
        }
        
        /* Analytics */
        .analytics-grid {
            display: grid;
            grid-template-columns: repeat(2, 1fr);
            gap: 1rem;
        }
        
        .analytics-card {
            background: #f8f9fa;
            border-radius: 12px;
            padding: 1.25rem;
            text-align: center;
        }
        
        .analytics-card h3 {
            font-size: 0.85rem;
            color: var(--gray);
            margin-bottom: 0.5rem;
        }
        
        .analytics-number {
            font-size: 2rem;
            font-weight: 700;
            color: var(--dark);
        }
        
        .analytics-number.green { color: #27ae60; }
        .analytics-number.blue { color: #3498db; }
        .analytics-number.orange { color: #f39c12; }
        
        @media (min-width: 768px) {
            .analytics-grid {
                grid-template-columns: repeat(4, 1fr);
            }
        }
        
        .controls-row {
            display: flex;
            flex-wrap: wrap;
            gap: 0.5rem;
            align-items: center;
        }
        
        .empty-table {
            text-align: center;
            padding: 3rem;
            color: var(--gray);
        }
        
        .empty-table h3 {
            margin-bottom: 0.5rem;
            color: var(--dark);
        }
        
        .function-stats, .user-stats {
            justify-content: space-between;
            border-top: 1px solid #ecf0f1;
            font-size: 0.8rem;
        }
        
        .empty-state { text-align: center; padding: 2.5rem 1.5rem; color: var(--gray); }
        .empty-state h3 { margin-bottom: 0.5rem; color: var(--dark); font-size: 1.1rem; }
        
        .modal { 
            display: none; 
            position: fixed; 
            z-index: 10010; 
            left: 0; top: 0; 
            width: 100%; height: 100%; 
            background: rgba(0,0,0,0.5); 
            backdrop-filter: blur(3px);
            overflow-y: auto;
            padding: 0.5rem;
        }
        
        .modal-content { 
            background: var(--white); 
            margin: 0 auto;
            border-radius: var(--radius); 
            width: 100%;
            max-width: 550px;
            max-height: calc(100vh - 1rem);
            overflow-y: auto;
            box-shadow: var(--shadow-lg);
        }
        

        /* ===== ROW DENSITY CONTROL ===== */
        /* Default = normal (current styles unchanged) */

        /* Compact */
        body.density-compact .tasks-table th {
            padding: 0.4rem 0.6rem;
            font-size: 0.75rem;
        }
        body.density-compact .tasks-table td {
            padding: 0.3rem 0.6rem;
            font-size: 0.78rem;
            line-height: 1.3;
        }
        body.density-compact .status-badge {
            padding: 0.15rem 0.4rem;
            font-size: 0.68rem;
        }
        body.density-compact .badge {
            padding: 0.1rem 0.35rem;
            font-size: 0.65rem;
        }
        body.density-compact .action-btns { gap: 0.1rem; }
        body.density-compact .action-btn { padding: 0.15rem; }
        body.density-compact .tasks-table .task-title-text { font-size: 0.8rem; }

        /* Normal — default, same as current */
        body.density-normal .tasks-table th {
            padding: 1rem;
            font-size: 0.85rem;
        }
        body.density-normal .tasks-table td {
            padding: 0.75rem 1rem;
            font-size: 0.85rem;
        }

        /* Spacious */
        body.density-spacious .tasks-table th {
            padding: 1.2rem 1rem;
            font-size: 0.9rem;
        }
        body.density-spacious .tasks-table td {
            padding: 1.1rem 1rem;
            font-size: 0.9rem;
            line-height: 1.6;
        }
        body.density-spacious .status-badge {
            padding: 0.35rem 0.75rem;
            font-size: 0.8rem;
        }
        body.density-spacious .tasks-table .task-title-text { font-size: 0.92rem; }

        /* Table always full-width on desktop — handled above in .tasks-table block */

        /* Density toggle buttons */
        .density-toggle {
            display: flex;
            gap: 1px;
            background: #f3f4f6;
            padding: 2px;
            border-radius: 8px;
            flex-shrink: 0;
        }
        .density-btn {
            height: 26px;
            padding: 0 7px;
            border: none;
            border-radius: 6px;
            cursor: pointer;
            background: transparent;
            color: #6b7280;
            transition: all 0.15s;
            display: inline-flex;
            align-items: center;
            gap: 3px;
            font-size: 11px;
            font-weight: 600;
            white-space: nowrap;
        }
        .density-btn:hover { background: #e5e7eb; color: #374151; }
        .density-btn.active { background: #22c55e; color: white; }
        .density-btn svg { width: 12px; height: 12px; }

        /* ===== AUTO VERTICAL DENSITY — реагує на висоту вікна ===== */
        /* Якщо вікно низьке — рядки автоматично стискуються, більше даних влізає */

        /* Великий екран (>800px висота) — просторо */
        @media (min-height: 800px) {
            body:not(.density-compact):not(.density-spacious) .tasks-table th {
                padding: 0.9rem 1rem;
            }
            body:not(.density-compact):not(.density-spacious) .tasks-table td {
                padding: 0.7rem 1rem;
            }
        }

        /* Середній екран (600–800px висота) — нормально */
        @media (max-height: 800px) {
            body:not(.density-compact):not(.density-spacious) .tasks-table th {
                padding: 0.6rem 1rem;
                font-size: 0.82rem;
            }
            body:not(.density-compact):not(.density-spacious) .tasks-table td {
                padding: 0.45rem 1rem;
                font-size: 0.82rem;
            }
            body:not(.density-compact):not(.density-spacious) .status-badge {
                padding: 0.18rem 0.5rem;
                font-size: 0.72rem;
            }
        }

        /* Малий екран (<600px висота) — компактно */
        @media (max-height: 600px) {
            body:not(.density-compact):not(.density-spacious) .tasks-table th {
                padding: 0.35rem 0.75rem;
                font-size: 0.78rem;
            }
            body:not(.density-compact):not(.density-spacious) .tasks-table td {
                padding: 0.25rem 0.75rem;
                font-size: 0.78rem;
                line-height: 1.3;
            }
            body:not(.density-compact):not(.density-spacious) .status-badge {
                padding: 0.12rem 0.4rem;
                font-size: 0.68rem;
            }
            body:not(.density-compact):not(.density-spacious) .badge {
                padding: 0.08rem 0.3rem;
                font-size: 0.65rem;
            }
            body:not(.density-compact):not(.density-spacious) .action-btn {
                padding: 0.15rem;
            }
        }

        /* Дуже малий екран (<450px висота — напр. DevTools відкриті) — мінімум */
        @media (max-height: 450px) {
            body:not(.density-compact):not(.density-spacious) .tasks-table th {
                padding: 0.2rem 0.6rem;
                font-size: 0.75rem;
            }
            body:not(.density-compact):not(.density-spacious) .tasks-table td {
                padding: 0.15rem 0.6rem;
                font-size: 0.75rem;
                line-height: 1.2;
            }
        }

        /* ===== GOOGLE SHEETS STYLE — FLEXIBLE COLUMNS ===== */

        /* Таблиця завжди на всю ширину контейнера */
        .tasks-table {
            table-layout: auto !important;
            width: 100% !important;
            min-width: 0 !important;
        }

        /* Назва завдання — розтягується щоб заповнити вільний простір */
        .tasks-table .task-title-cell {
            max-width: none;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }
        .tasks-table .task-title-text {
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
            display: block;
            max-width: 100%;
        }

        /* Всі TD/TH не переносяться */
        .tasks-table th,
        .tasks-table td {
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        /* При звуженні < 1100px — ховаємо "Автор" */
        @media (max-width: 1100px) {
            .tasks-table .col-hide-md { display: none; }
            .tasks-table col.col-creator { display: none; }
        }

        /* При звуженні < 800px — ховаємо ще "Функція" */
        @media (max-width: 800px) {
            .tasks-table .col-hide-sm { display: none; }
            .tasks-table col.col-function { display: none; }
        }

        /* table-container на десктопі — без горизонтального скролу */
        @media (min-width: 600px) {
            #tasksTab .table-container,
            #regularTab .table-container {
                overflow-x: hidden;
            }
        }
