th {
  font-weight: bold !important;
}

.task-manager-section {
    display: flex;
    flex-direction: column;
    gap: 0;
    border-radius: 8px;
    overflow: hidden;
    width: 100%;
}

.task-manager-header {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
}

.task-manager-title {
    font-size: 1.8rem;
    font-weight: 600;
    color: #1a1a2e;
    margin: 0;
}

.add-task-btn, .import-task-btn {
    background-color: #2563eb;
    color: #ffffff;
    border: none;
    border-radius: 8px;
    padding: 10px 20px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.ai-assist-btn {
    background: #fff;
    color: #2563eb;
    border: 2px solid transparent;
    border-radius: 10px;
    padding: 8px 18px;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    transition: opacity .2s, transform .1s, box-shadow .2s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    position: relative;
    background-clip: padding-box;
    box-shadow: 0 0 0 2px transparent;
    background-image: none;
}

.ai-assist-btn::before {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: 12px;
    background: linear-gradient(to right, #2563eb, #7c3aed);
    z-index: -1;
}

.ai-assist-btn:hover {
    box-shadow: 0 0 12px rgba(37, 99, 235, 0.3);
    color: #fff;
}

.ai-assist-btn:hover svg path {
    fill: white;
}

.view-subtasks-btn {
    background-color: #2563eb;
    color: #ffffff;
    border: none;
    border-radius: 8px;
    padding: 0px 10px;
    font-size: 0.75rem;
    font-weight: 600;
    width: 110px;
    height: 30px;
    cursor: pointer;
    margin-top: 5%;
    transition: background-color 0.2s ease;
}

.add-task-btn:hover, .import-task-btn:hover {
    background-color: #1d4ed8;
}

/* ── Row 2: Toolbar ── */
.task-manager-toolbar {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    padding: 10px 24px;
    /* Freeze the Board/List/Gantt toolbar below the sticky #topbar (56px)
       and .main-tab-nav (measured in devtools at ~53px including its
       border-bottom), same approach as .main-tab-nav itself. */
    position: sticky;
    top: 109px;
    z-index: 40;
    background: #f2f2f7;
}

.view-toggle {
    display: flex;
    flex-direction: row;
    gap: 6px;
}

.toggle-btn {
    display: flex;
    align-items: center;
    gap: 6px;

    background-color: #ffffff;
    color: #374151;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    padding: 6px 14px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.toggle-btn:hover:not(.view-active) {
    background-color: #f3f4f6;
}

/* ── Right Controls: Search + Filter ── */
.task-controls {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 10px;
}

/* ── Search Box ── */
.search-box {
    display: flex;
    align-items: center;
    gap: 8px;

    background-color: #ffffff;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    padding: 6px 14px;
}

.search-box svg {
    color: #9ca3af;
    flex-shrink: 0;
}

.search-box input {
    border: none;
    outline: none;
    font-size: 0.9rem;
    color: #374151;
    background: transparent;
    width: 180px;
}

.search-box input::placeholder {
    color: #9ca3af;
}

/* ── Filter Button ── */
.filter-btn, button.filter-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;

    -webkit-appearance: none;
    appearance: none;
    background-color: #ffffff !important;
    color: #374151 !important;
    border: 1px solid #d1d5db !important;
    border-radius: 6px;
    padding: 6px 14px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.filter-btn:hover, button.filter-btn:hover {
    background-color: #f3f4f6 !important;
}

.kanban-board {
    display: flex;
    gap: 20px;
    padding: 20px;
    overflow-x: auto;
    height: calc(100vh - 100px);
    align-items: flex-start;
}

.kanban-column {
    background: #f4f5f7;
    border-radius: 10px;
    min-width: 225px;
    max-width: 275px;
    padding: 15px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    height: fit-content;
    min-height: 500px;
    box-shadow: 0 0 0 0.2rem rgba(0,123,255,.25);
}

.kanban-column h3 {
    text-align: center;
    font-size: 16px;
    margin-bottom: 15px;
    color: #333;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.task-card {
    background: white;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 12px;
    font-size: 13px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    border-left: 4px solid #999;
    cursor: pointer;
    transition: box-shadow 0.2s ease;
}

.task-card:hover {
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.task-card.priority-1 { border-left-color: #e53935; }
.task-card.priority-2 { border-left-color: #fbc02d; }
.task-card.priority-3 { border-left-color: #43a047; }

.task-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 8px;
}

.task-title {
    font-weight: 600;
    font-size: 14px;
    color: #172b4d;
    line-height: 1.4;
    flex: 1;
    margin-right: 8px;
}

.priority-icon {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    flex-shrink: 0;
}

.priority-1 .priority-icon { background-color: #e53935; }
.priority-2 .priority-icon { background-color: #fbc02d; }
.priority-3 .priority-icon { background-color: #43a047; }

.task-meta {
    font-size: 12px;
    color: #5e6c84;
    margin-bottom: 8px;
}

.task-meta-item {
    margin-bottom: 2px;
}

.assignee {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
}

.assignee-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background-color: #0052cc;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 600;
    margin-right: 8px;
    flex-shrink: 0;
}

.assignee-name {
    font-size: 12px;
    color: #5e6c84;
}

.progress-section {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.progress-bar {
    background: #dfe1e6;
    border-radius: 3px;
    overflow: hidden;
    height: 6px;
    flex: 1;
    margin-right: 8px;
}

.progress-fill {
    height: 6px;
    background: #4caf50;
    border-radius: 3px;
}

.progress-text {
    font-size: 11px;
    color: #5e6c84;
    font-weight: 500;
}

.no-tasks {
    font-size: 12px;
    color: #8993a4;
    text-align: center;
    padding: 20px;
    font-style: italic;
}
.kanban-column.drag-over {
    outline: 3px dashed rgba(13,110,253,0.5);
    background: rgba(13,110,253,0.03);
}
/* List view styles */
.list-view { padding: 20px; }
.list-table { width: 100%; table-layout: fixed; border-collapse: collapse; }
.list-table thead th { text-align: left; padding: 10px; background: #999898; border-bottom: 1px solid #e0e6ef; font-size: 13px; overflow: hidden; }
.list-table tbody td { padding: 10px; border-bottom: 1px solid #f0f2f5; vertical-align: middle; font-size: 13px; overflow: hidden; }

/* Column widths so the table never grows wider than the project accordion (percentages always sum to <=100%) */
.list-table .col-code { width: 6%; }
.list-table .col-name { width: 8%; overflow-wrap: break-word; word-break: break-word; }
.list-table .col-desc { width: 19%; overflow-wrap: break-word; word-break: break-word; }
.list-table .col-status { width: 8%; }
.list-table .col-priority { width: 6%; }
.list-table .col-urgency { width: 0; }
.list-table .col-assignee { width: 7%; }
.list-table .col-timeline { width: 12%; }
.list-table .col-percent { width: 8%; }
.list-table .col-comments { width: 6%; }
.list-table .col-actions { width: 6%; }

.list-table .col-name,
.list-table .col-desc { white-space: normal; }

.list-table .col-percent progress { width: 60px; max-width: 100%; vertical-align: middle; }
.list-row { cursor: pointer; }
/* .list-row:hover { background: #cacacb; } */
/* More specific selectors to override the sortable striping on odd rows */
/* .list-table.sortable tbody tr:hover,
.list-table.sortable tbody tr.list-row:hover,
.list-table.sortable tbody tr:hover td {
    background-color: #cacacb !important;
    color: inherit !important;
} */
.list-table tr:nth-child(even) {
    background-color: #ffffff !important; 
}
.view-active { background-color: #0d6efd; color: white; border-color: #0d6efd; }

/* Subtask toggle styles */
.subtask-toggle {
    width: 20px;
    height: 20px;
    border: none;
    background: transparent;
    padding: 0;
    margin-right: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
}

.subtask-toggle .arrow {
    display: inline-block;
    width: 0;
    height: 0;
    border-top: 6px solid transparent;
    border-bottom: 6px solid transparent;
    border-left: 8px solid #374151; /* right-pointing arrow */
    transition: transform 0.15s ease;
}

.subtask-toggle[aria-expanded="true"] .arrow {
    transform: rotate(90deg);
}

.subtasks-container {
    margin-top: 8px;
    padding-left: 28px;
    font-size: 13px;
    color: #374151;
}

.subtask-item { display: flex; justify-content: space-between; gap: 8px; padding: 4px 0; }

/* Badges for Status and Priority */
.badge, .badge2 {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px 12px;
    border-radius: 6px;
    font-size: 0.82rem;
    font-weight: 600;
}

.badge-backlog {
    background-color: #ffe5fb;
    color: #ed0bf5;
    border: 1px solid #fc4df3;
}

.badge-on-hold {
    background-color: #fff4e5;
    color: #f59e0b;
    border: 1px solid #fcd34d;
}

.badge-in-progress {
    background-color: #eff6ff;
    color: #2563eb;
    border: 1px solid #93c5fd;
}

.badge-in-review {
    background-color: #fffeef;
    color: #d4eb25;
    border: 1px solid #f8fd93;
}

.badge-done {
    background-color: #f0fdf4;
    color: #16a34a;
    border: 1px solid #86efac;
}

.badge-high {
    background-color: #fff1f1;
    color: #ef4444;
    border: 1px solid #fca5a5;
}

.badge-medium {
    background-color: #fefce8;
    color: #ca8a04;
    border: 1px solid #fde047;
}

.badge-low {
    background-color: #f0fdf4;
    color: #16a34a;
    border: 1px solid #86efac;
}

/*Dropdown menu*/

.dropdown-wrapper,
.task-dropdown-wrapper,
.task-card-dropdown {
    position: relative;
    display: inline-block;
}

/* ── Trigger Button ── */
.action-btn,
.task-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 1px;

    background-color: #2563eb;
    color: #ffffff;
    border: none;
    border-radius: 8px;
    padding: 8px 10px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease;
    margin-top: auto;
}

.action-btn:hover,
.task-action-btn:hover {
    background-color: #1d4ed8;
}

.dropdown-menu,
.task-dropdown-menu,
.task-card-dropdown-menu {
    display: none; /* Hidden by default */
    position: absolute;
    top: calc(100% + 4px); /* Just below the button (reduced) */
    right: 0;              /* Align to right edge of button */
    z-index: 1040;

    background-color: #ffffff;
    /* remove visible border so hover backgrounds can reach the very top/bottom */
    border: 0;
    border-radius: 8px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12);

    min-width: 160px;
    overflow: hidden;
    padding: 0; /* ensure no extra internal spacing */
}

.dropdown-menu.open,
.task-dropdown-menu.open,
.task-card-dropdown-menu.open {
    display: block;
}

.dropdown-menu ul,
.task-dropdown-menu ul,
.task-card-dropdown-menu ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.dropdown-menu li,
.task-dropdown-menu li,
.task-card-dropdown-menu li {
    margin: 0;
    padding: 0;
    line-height: 1;
}

.dropdown-item {
    display: block;
    width: 100%;
    padding: 6px 12px; /* tighter vertical spacing */
    margin: 0;

    background: none;
    border: none;
    text-align: left;

    font-size: 0.9rem;
    font-weight: 400;
    color: #374151;
    cursor: pointer;

    transition: background-color 0.15s ease;
    border-radius: 0; /* let the menu's rounding handle corners */
}

/* Ensure hover/background covers rounded corners at top/bottom */
.dropdown-item:first-child,
.dropdown-item:last-child {
    /* no per-item rounding to avoid tiny gaps at edges */
    border-radius: 0;
}

.dropdown-item:hover {
    background-color: #f3f4f6;
}

/* Filter panel styles */
.filter-panel {
    position: absolute;
    top: 64px; /* below the toolbar */
    right: 24px;
    z-index: 1200;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 12px;
    box-shadow: 0 8px 24px rgba(15,23,42,0.12);
    min-width: 260px;
}
.filter-row { display:flex; flex-direction: column; gap:6px; margin-bottom:8px; }
.filter-row label { font-size: 0.8rem; color: #374151; font-weight:600; }
.filter-row select, .filter-row input { padding:6px 8px; border:1px solid #d1d5db; border-radius:6px; font-size:0.9rem; }
.filter-actions { display:flex; gap:8px; justify-content:flex-end; margin-top:6px; }

/* Ensure filter panel doesn't cover kanban scrollbar on small screens */
@media (max-width: 900px){
    .filter-panel { right: 12px; left: 12px; top: auto; bottom: 20px; }
}

.col-comments { position: relative; }

.comment-unread-counter {
	position: relative;
	top: -2px;
	right: -2px;
	background: #dc3545; /* bootstrap danger red */
	color: #ffffff;
	border-radius: 50%;
	min-width: 18px;
	height: 18px;
	padding: 0 5px;
	font-size: 0.65rem;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

/* ── Project Accordion Groups (List View) ── */
#list-projects-container {
    counter-reset: project-counter;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 16px 20px;
}

.project-group {
    counter-increment: project-counter;
    min-width: 0;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    background: #fff;
}

/* Cycling accent colors for project group headers */
.project-group:nth-child(6n+1) .project-group-header { background: #ede9fe; border-left: 4px solid #7c3aed; }
.project-group:nth-child(6n+2) .project-group-header { background: #ccfbf1; border-left: 4px solid #0d9488; }
.project-group:nth-child(6n+3) .project-group-header { background: #fef3c7; border-left: 4px solid #d97706; }
.project-group:nth-child(6n+4) .project-group-header { background: #ffe4e6; border-left: 4px solid #e11d48; }
.project-group:nth-child(6n+5) .project-group-header { background: #e0f2fe; border-left: 4px solid #0284c7; }
.project-group:nth-child(6n+6) .project-group-header { background: #dcfce7; border-left: 4px solid #16a34a; }

/* Ad-hoc group always neutral */
.project-group-adhoc .project-group-header {
    background: #f3f4f6 !important;
    border-left: 4px solid #6b7280 !important;
}

.project-group-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 18px;
    cursor: pointer;
    user-select: none;
    transition: filter 0.15s;
    border-radius: 10px 10px 0 0;
}

.project-group-header.header-collapsed {
    border-radius: 10px;
}

.project-group-header:hover { filter: brightness(0.97); }

.project-header-left {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    font-size: 0.95rem;
    color: #1a1a2e;
}

.project-counter::before {
    content: counter(project-counter);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: rgba(0,0,0,0.12);
    font-size: 0.75rem;
    font-weight: 700;
    color: inherit;
}

.project-group-adhoc .project-counter::before {
    background: rgba(107,114,128,0.2);
}

.project-chevron {
    transition: transform 0.2s ease;
    flex-shrink: 0;
}

.project-table-wrapper.collapsed .project-chevron,
.project-group-header[data-collapsed="1"] .project-chevron {
    display: none; /* handled via JS transform instead */
}

.project-name { flex: 1; }

.project-header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.project-players-badge {
    display: flex;
    align-items: flex-start;
}

.player-avatar-sm {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #0052cc;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 700;
    border: 2px solid #fff;
    margin-left: -8px;
    flex-shrink: 0;
}

.project-players-badge .player-avatar-sm:first-child { margin-left: 0; }

.project-task-count-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 26px;
    height: 26px;
    border-radius: 50%;
    background: #fff;
    border: 2px solid rgba(0,0,0,0.15);
    font-size: 0.78rem;
    font-weight: 700;
    color: #374151;
    padding: 0 4px;
}

.project-done-label {
    font-size: 0.8rem;
    color: #6b7280;
    white-space: nowrap;
}

.project-table-wrapper {
    border-radius: 0 0 10px 10px;
    overflow-x: auto;
    max-width: 100%;
}

.project-table-wrapper.collapsed {
    display: none;
}

.empty-project-row {
    text-align: center;
    color: #9ca3af;
    font-style: italic;
    padding: 16px !important;
}

/* ══════════════════════════════════════════════════════════════════════
   Gantt Chart view (My Work sub-tab)
   ══════════════════════════════════════════════════════════════════════ */

.gantt-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 4px 0 14px;
}

.gantt-nav-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 1px solid #e0e6ef;
    background: #fff;
    color: #374151;
    cursor: pointer;
    transition: filter 0.15s;
}

.gantt-nav-btn:hover { filter: brightness(0.95); }

.gantt-nav-btn svg {
    display: block;
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    stroke: #374151;
    fill: none;
    pointer-events: none;
}

.gantt-nav-label {
    min-width: 200px;
    text-align: center;
    font-weight: 600;
    font-size: 0.9rem;
    color: #1a1a2e;
}

.gantt-nav-today {
    border: 1px solid #e0e6ef;
    border-radius: 6px;
    background: #fff;
    color: #374151;
    font-size: 0.8rem;
    font-weight: 600;
    padding: 5px 12px;
    cursor: pointer;
    transition: filter 0.15s;
}

.gantt-nav-today:hover { filter: brightness(0.95); }

.gantt-scroll {
    overflow-x: auto;
    /* Needs its own vertical scroll (not the page's) for position:sticky
       headers below to have anything to stick against — a sticky element's
       reference is its nearest scrolling ancestor, and .gantt-scroll counts
       as one the moment overflow-x is non-visible, whether or not this rule
       says so. Without a capped height there'd be nothing to scroll inside
       it (auto-height always matches content height), so "sticky" would be
       a no-op. */
    overflow-y: auto;
    max-height: 65vh;
    max-width: 100%;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    background: #fff;
}

.gantt-grid {
    display: grid;
    /* Day columns have a 16px floor but stretch to fill any leftover width
       (a 31-day month rarely fills a wide screen at a fixed 16px/day) —
       they only shrink back to that floor, triggering .gantt-scroll's
       horizontal scrollbar, on screens too narrow to fit the whole month. */
    grid-template-columns: 260px repeat(var(--gantt-days), minmax(16px, 1fr));
    /* Two explicit header rows (month label, then per-day numbers) sized
       shorter than the 36px task rows below, which still come from
       grid-auto-rows since they're never given explicit row indices. */
    grid-template-rows: 28px 22px;
    grid-auto-rows: 36px;
    width: 100%;
}

/* One project's task rows, as a single toggle target for accordion
   collapse/expand. `display: contents` lets its children (label cells,
   bars) still participate directly in the outer .gantt-grid's row/column
   placement — only .collapsed removes them from layout entirely, which is
   what keeps the shared grid gap-free when a group is closed. */
.gantt-project-rows {
    display: contents;
}

.gantt-project-rows.collapsed {
    display: none;
}

.gantt-group-header.project-group-header {
    display: flex;
    align-items: center;
    gap: 6px;
    height: 36px;
    padding: 0 10px;
    position: sticky;
    left: 0;
    z-index: 1;
    background: #f3f4f6;
    border-right: 1px solid #e0e6ef;
    border-bottom: 1px solid #f1f3f5;
    box-shadow: 2px 0 4px rgba(0,0,0,0.05);
    border-radius: 0;
}

.gantt-group-name {
    font-weight: 600;
    font-size: 0.85rem;
    color: #1a1a2e;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.gantt-label-cell {
    position: sticky;
    left: 0;
    z-index: 1;
    background: #fff;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0 10px;
    border-right: 1px solid #e0e6ef;
    border-bottom: 1px solid #f1f3f5;
    box-shadow: 2px 0 4px rgba(0,0,0,0.05);
    font-size: 13px;
    cursor: pointer;
    min-width: 0;
}

.gantt-label-cell:hover { filter: brightness(0.97); }

.gantt-header-label {
    position: sticky;
    top: 0;
    z-index: 3;
    background: #d3d1d1;
    color: #1a1a2e;
    font-weight: 700;
    font-size: 12px;
    cursor: default;
}

.gantt-header-label:hover { filter: none; }

.gantt-col-name {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.gantt-col-timeline {
    flex: 0 0 78px;
    color: #6b7280;
    font-size: 0.75rem;
    white-space: nowrap;
}

.gantt-header-label .gantt-col-timeline,
.gantt-header-label .gantt-col-duration { color: inherit; }

.gantt-col-duration {
    flex: 0 0 46px;
    color: #6b7280;
    font-size: 0.75rem;
    white-space: nowrap;
}

.gantt-header-month,
.gantt-header-day {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #d3d1d1;
    color: #1a1a2e;
    border-bottom: 1px solid rgba(0,0,0,0.1);
    border-left: 1px solid rgba(0,0,0,0.1);
    font-size: 12px;
}

.gantt-header-month {
    position: sticky;
    top: 0;
    z-index: 3;
    font-weight: 700;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Per-day ruler cell, directly under the month header — sticks just below
   it (top offset matches .gantt-grid's first explicit row height) so both
   header rows stay pinned together while the body scrolls vertically. */
.gantt-header-day {
    position: sticky;
    top: 28px;
    z-index: 2;
    font-size: 10px;
    font-weight: 600;
    color: #4b5563;
}

.gantt-header-day.weekend {
    background: #c7c9cd;
}

.gantt-bar {
    align-self: center;
    height: 20px;
    margin: 0 1px;
    border-radius: 5px;
    background-color: #0d6efd;
    display: flex;
    align-items: center;
    padding: 0 6px;
    color: #fff;
    font-size: 10px;
    font-weight: 600;
    overflow: hidden;
    cursor: pointer;
    transition: filter 0.15s;
}

.gantt-bar-label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.gantt-bar:hover {
    filter: brightness(0.9);
}

/* ══════════════════════════════════════════════════════════════════════
   Overview tab + top-level tab nav (Overview / My Work / Attention / Wrap Up)
   ══════════════════════════════════════════════════════════════════════ */

.task-manager-title-group {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.task-manager-subtitle {
    margin: 0;
    font-size: 0.9rem;
    color: #6b7280;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.main-tab-nav {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    padding: 0 24px;
    border-bottom: 1px solid #e5e7eb;
    margin-bottom: 20px;
    /* Freeze the tab row below the fixed #topbar (56px tall) on scroll */
    position: sticky;
    top: 56px;
    z-index: 50;
    background: #f2f2f7;
}

.main-tab-nav-tabs {
    display: flex;
    flex-direction: row;
    gap: 24px;
}

.main-tab-nav-actions {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
}

.main-tab-btn {
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    padding: 12px 2px;
    font-size: 0.95rem;
    font-weight: 600;
    color: #6b7280;
    cursor: pointer;
    transition: color 0.15s ease, border-color 0.15s ease;
}

.main-tab-btn:hover {
    color: #1a1a2e;
}

.main-tab-btn.active {
    color: #2563eb;
    border-bottom-color: #2563eb;
}

.main-tab-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    padding: 0 5px;
    border-radius: 9px;
    background: #fff1f1;
    color: #ef4444;
    font-size: 0.72rem;
    font-weight: 700;
}

/* .main-tab-panel intentionally has no shared padding — My Work's existing
   views (toolbar, kanban board, list, projects) already manage their own
   padding and must keep their original layout width untouched. Overview/
   placeholder tabs add their own padding below. */

#overview-tab {
    padding: 0 24px 24px;
}

.main-tab-placeholder {
    padding: 60px 20px;
    text-align: center;
    color: #6b7280;
}

.main-tab-placeholder h3 {
    color: #1a1a2e;
    margin-bottom: 6px;
}

/* Generic "main content + Zeni sidebar" split, shared by any tab that
   embeds the Zeni panel (Overview, Attention, ...) */
.tab-split-layout {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    overflow-x: auto;
}

.tab-split-main {
    flex: 1;
    min-width: 480px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* ── Stat cards ── */
.stat-card-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.stat-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 16px 18px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.stat-card-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: #374151;
}

.stat-card-value {
    font-size: 2rem;
    font-weight: 700;
    color: #1a1a2e;
    line-height: 1.2;
}

.stat-card-caption {
    font-size: 0.8rem;
    color: #6b7280;
    margin-bottom: 6px;
}

.stat-card-link {
    font-size: 0.82rem;
    color: #2563eb;
    font-weight: 600;
    text-decoration: none;
    width: fit-content;
}

.stat-card-link:hover {
    text-decoration: underline;
}

/* ── Panels (Project Health / Workload / Attention) ── */
.overview-panel {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 18px 20px;
}

.overview-panel-title {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 1.05rem;
    font-weight: 700;
    color: #1a1a2e;
    margin: 0 0 14px;
}

.info-dot {
    color: #9ca3af;
    font-size: 0.85rem;
    cursor: help;
}

.overview-no-data {
    text-align: center;
    color: #9ca3af;
    font-style: italic;
    padding: 16px;
}

.overview-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.overview-panel-half {
    margin: 0;
}

/* ── Project Health table ── */
.project-health-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 14px;
}

.project-health-table th {
    text-align: left;
    font-size: 0.8rem;
    color: #6b7280;
    padding: 6px 8px;
    border-bottom: 1px solid #e5e7eb;
}

.project-health-table td {
    padding: 10px 8px;
    font-size: 0.9rem;
    border-bottom: 1px solid #f3f4f6;
    vertical-align: middle;
}

.health-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 6px;
    font-size: 0.78rem;
    font-weight: 600;
}

.health-on-track {
    background-color: #f0fdf4;
    color: #16a34a;
    border: 1px solid #86efac;
}

.health-at-risk {
    background-color: #fff4e5;
    color: #f59e0b;
    border: 1px solid #fcd34d;
}

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

.progress-bar-track {
    flex: 1;
    height: 6px;
    background: #dfe1e6;
    border-radius: 3px;
    overflow: hidden;
    min-width: 60px;
}

.progress-bar-fill {
    height: 100%;
    background: #16a34a;
    border-radius: 3px;
}

.progress-cell-value {
    font-size: 0.82rem;
    color: #6b7280;
    white-space: nowrap;
}

/* ── Workload Distribution ── */
.workload-row {
    display: grid;
    grid-template-columns: 28px 90px 1fr 40px auto;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
}

.workload-name {
    font-size: 0.88rem;
    color: #1a1a2e;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.workload-track {
    min-width: 0;
}

.workload-fill-overloaded { background: #ef4444; }
.workload-fill-high       { background: #f59e0b; }
.workload-fill-balanced   { background: #16a34a; }
.workload-fill-light      { background: #9ca3af; }

.workload-pct {
    font-size: 0.82rem;
    color: #6b7280;
    text-align: right;
}

.workload-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 3px 10px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
}

.workload-badge-overloaded { background: #fff1f1; color: #ef4444; border: 1px solid #fca5a5; }
.workload-badge-high       { background: #fff4e5; color: #f59e0b; border: 1px solid #fcd34d; }
.workload-badge-balanced   { background: #f0fdf4; color: #16a34a; border: 1px solid #86efac; }
.workload-badge-light      { background: #f3f4f6; color: #6b7280; border: 1px solid #d1d5db; }

/* ── Task Requiring Attention ── */
.attention-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #f3f4f6;
    font-size: 0.9rem;
    color: #1a1a2e;
}

.attention-row:last-child {
    border-bottom: none;
}

.attention-count {
    color: #6b7280;
    font-size: 0.85rem;
}

/* ── Zeni Assistant card ── */
.zeni-card {
    width: 360px;
    flex-shrink: 0;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 18px 20px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.zeni-body {
    display: flex;
    align-items: flex-start;
    flex-direction: column;
    gap: 20px;
}

.zeni-chat-col {
    flex: 0 0 260px;
    min-width: 0;
    border-right: 1px solid #f3f4f6;
    padding-right: 20px;
}

.zeni-info-col {
    flex: 1;
    min-width: 0;
}

.zeni-chat-wrapper {
    padding-top: 4px;
}

.zeni-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.05rem;
    font-weight: 700;
    color: #1a1a2e;
    margin: 0 0 4px;
}

.zeni-sparkle {
    background: linear-gradient(to right, #2563eb, #7c3aed);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.zeni-greeting {
    margin: 0;
    font-size: 0.92rem;
    font-weight: 600;
    color: #1a1a2e;
}

.zeni-subgreeting {
    margin: 0 0 10px;
    font-size: 0.82rem;
    color: #6b7280;
}

.zeni-section {
    padding: 14px 0;
    border-top: 1px solid #f3f4f6;
}

.zeni-section-label {
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #6b7280;
    margin-bottom: 10px;
}

.zeni-priority-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 12px;
}

.zeni-priority-num {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #2563eb;
    color: #fff;
    font-size: 0.72rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 1px;
}

.zeni-priority-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: #1a1a2e;
}

.zeni-priority-subtitle {
    font-size: 0.78rem;
    color: #6b7280;
}

.zeni-todo-btn {
    width: 100%;
    background: #fff;
    color: #2563eb;
    border: 1px solid #93c5fd;
    border-radius: 8px;
    padding: 8px 14px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.zeni-todo-btn:hover {
    background: #eff6ff;
}

.zeni-action-card {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 10px 12px;
    margin-bottom: 8px;
    cursor: pointer;
    text-align: left;
    transition: background-color 0.15s ease;
}

.zeni-action-card:hover {
    background: #f3f4f6;
}

.zeni-action-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: #1a1a2e;
}

.zeni-action-subtitle {
    font-size: 0.76rem;
    color: #6b7280;
    margin-top: 2px;
}

.zeni-action-chevron {
    color: #9ca3af;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.zeni-empty {
    padding: 14px 0;
    font-size: 0.85rem;
    color: #6b7280;
    font-style: italic;
}

.zeni-ask-row {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    margin-top: 12px;
    padding-top: 14px;
    border-top: 1px solid #f3f4f6;
}

/* task_ai_panel.html's .tai-sources-row is styled for the dark slide-in
   panel by default (border-top: #2d2d4e) — override for the light card. */
.zeni-card .tai-sources-row {
    padding: 10px 0 0;
    border-top: 1px solid #f3f4f6;
}

.zeni-ask-input {
    flex: 1;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 0.85rem;
    outline: none;
    resize: none;
    font-family: inherit;
    line-height: 1.4;
    max-height: 120px;
}

.zeni-ask-input:focus {
    border-color: #2563eb;
}

.zeni-ask-send {
    flex-shrink: 0;
    width: 34px;
    height: 34px;
    border: none;
    border-radius: 8px;
    background: #2563eb;
    color: #fff;
    font-size: 0.95rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.zeni-ask-send:hover {
    background: #1d4ed8;
}

/* Responsive: stack Zeni card below main content on narrower screens */
@media (max-width: 1100px) {
    .tab-split-layout {
        flex-direction: column;
    }
    .zeni-chat-col {
        flex: 1 1 auto;
        width: 100%;
        border-right: none;
        border-bottom: 1px solid #f3f4f6;
        padding-right: 0;
        padding-bottom: 16px;
    }
    .overview-row {
        grid-template-columns: 1fr;
    }
    .stat-card-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ══════════════════════════════════════════════════════════════════════
   Attention tab
   ══════════════════════════════════════════════════════════════════════ */

#attention-tab {
    padding: 0 24px 24px;
}

.attention-panel {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 18px 20px;
}

.attention-panel-header {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 16px;
}

.attention-panel-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: #1a1a2e;
    margin: 0 0 4px;
}

.attention-panel-subtitle {
    font-size: 0.85rem;
    color: #6b7280;
    margin: 0;
}

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

.attention-table th {
    text-align: left;
    font-size: 0.8rem;
    color: #6b7280;
    padding: 8px;
    border-bottom: 1px solid #e5e7eb;
}

.attention-table td {
    padding: 12px 8px;
    font-size: 0.9rem;
    color: #1a1a2e;
    border-bottom: 1px solid #f3f4f6;
    vertical-align: middle;
}

.attention-impact {
    color: #6b7280;
}

.severity-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: 6px;
    font-size: 0.82rem;
    font-weight: 600;
}

.severity-critical {
    background-color: #fff1f1;
    color: #ef4444;
    border: 1px solid #fca5a5;
}

.severity-high {
    background-color: #fff4e5;
    color: #f59e0b;
    border: 1px solid #fcd34d;
}

.attention-done-btn {
    background-color: #2563eb;
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 6px 16px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
}

.attention-done-btn:hover {
    background-color: #1d4ed8;
}

/* ══════════════════════════════════════════════════════════════════════
   Wrap Up tab
   ══════════════════════════════════════════════════════════════════════ */

#wrapup-tab {
    padding: 0 24px 24px;
}

.wrapup-meeting-text {
    font-size: 0.88rem;
    color: #374151;
    line-height: 1.6;
    margin: 0;
}

.wrapup-meeting-wrap {
    position: relative;
    overflow: hidden;
    max-height: 8.4em;
    transition: max-height 0.25s ease;
}

.wrapup-meeting-wrap.expanded {
    max-height: none;
}

.wrapup-meeting-wrap.truncated:not(.expanded)::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 2.2em;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0), #fff);
}

.wrapup-meeting-toggle {
    background: none;
    border: none;
    padding: 8px 0 0;
    margin: 0;
    font-size: 0.85rem;
    font-weight: 600;
    color: #4f46e5;
    cursor: pointer;
}

.wrapup-meeting-toggle:hover {
    text-decoration: underline;
}

.wrapup-daily-summary {
    margin-bottom: 10px;
}

.wrapup-summary-list {
    margin: 0;
    padding-left: 1.1em;
    font-size: 0.88rem;
    color: #374151;
    line-height: 1.6;
}

.wrapup-summary-list li {
    margin-bottom: 4px;
}

.wrapup-summary-spinner {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.88rem;
    color: #6b7280;
}

.wrapup-summary-spinner::before {
    content: "";
    width: 14px;
    height: 14px;
    border: 2px solid #d1d5db;
    border-top-color: #4f46e5;
    border-radius: 50%;
    animation: wrapupSpin 0.7s linear infinite;
}

@keyframes wrapupSpin {
    to { transform: rotate(360deg); }
}

.activity-feed-row {
    display: flex;
    gap: 14px;
    padding: 10px 0;
    border-bottom: 1px solid #f3f4f6;
    font-size: 0.88rem;
}

.activity-feed-row:last-child {
    border-bottom: none;
}

.activity-feed-time {
    flex-shrink: 0;
    width: 80px;
    color: #6b7280;
    font-weight: 600;
}

.activity-feed-text {
    color: #1a1a2e;
}

/* ========================================================================
   Weekly "To Do List" (sticky-notes) page
   ======================================================================== */
.tdl-page {
    padding: 4px 4px 40px;
}
.tdl-page-header {
    padding: 8px 4px 20px;
    border-bottom: 1px solid #e5e7eb;
    margin-bottom: 20px;
}
.tdl-page-title {
    font-size: 26px;
    font-weight: 700;
    color: #111827;
    margin: 0;
}
.tdl-page-subtitle {
    color: #6b7280;
    margin: 4px 0 0;
    font-size: 14px;
}

/* 2-column layout: main | zeni — History lives in an off-canvas drawer
   instead (.tdl-history-drawer) so it never eats into this row by default */
.todolist-layout {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    overflow-x: auto;
}

.tdl-page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

/* Small trigger button that opens the History drawer */
.tdl-history-trigger {
    flex-shrink: 0;
    font-size: 13px;
    font-weight: 600;
}
.tdl-history-trigger i {
    font-size: 13px;
    margin-right: 2px;
}

/* History drawer — slides in from the right over the page, collapsed by
   default. Bernard's complaint about the old permanent sidebar was that it
   took up space in the todolist section by default; an off-canvas panel
   can't do that since it only occupies the viewport while open. */
.tdl-history-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.35);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    z-index: 1050;
}
body.tdl-history-open .tdl-history-backdrop {
    opacity: 1;
    visibility: visible;
}
.tdl-history-drawer {
    position: fixed;
    top: 0;
    right: 0;
    height: 100vh;
    width: 320px;
    max-width: 88vw;
    background: #fff;
    border-left: 1px solid #e5e7eb;
    box-shadow: -8px 0 28px rgba(15, 23, 42, 0.16);
    padding: 16px 12px;
    overflow-y: auto;
    z-index: 1051;
    transform: translateX(100%);
    transition: transform 0.22s ease;
}
body.tdl-history-open .tdl-history-drawer {
    transform: translateX(0);
}
.tdl-history-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 6px 10px;
    border-bottom: 1px solid #eef0f3;
    margin-bottom: 8px;
}
.tdl-history-title {
    font-weight: 600;
    color: #374151;
}
/* Collapsible year > month grouping */
.tdl-history-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 6px;
    border-radius: 6px;
    cursor: pointer;
    color: #374151;
    font-weight: 600;
    list-style: none;
    user-select: none;
}
.tdl-history-toggle::-webkit-details-marker {
    display: none;
}
.tdl-history-toggle::before {
    content: "\203A";           /* chevron, rotates when open */
    display: inline-block;
    width: 10px;
    color: #9ca3af;
    transition: transform 0.15s ease;
}
details[open] > .tdl-history-toggle::before {
    transform: rotate(90deg);
}
.tdl-history-toggle:hover {
    background: #f3f4f6;
}

.tdl-history-year > .tdl-history-toggle {
    font-size: 0.95rem;
}
.tdl-history-month {
    margin-left: 10px;
}
.tdl-history-month > .tdl-history-toggle {
    font-size: 0.9rem;
    font-weight: 500;
    color: #4b5563;
}
.tdl-history-month .tdl-history-item {
    margin-left: 12px;
}

.tdl-history-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-radius: 8px;
    padding: 2px 6px 2px 4px;
    cursor: pointer;
}
.tdl-history-item:hover {
    background: #f3f4f6;
}
.tdl-history-item.active {
    background: #eaf2ff;
}
.tdl-history-item.active .tdl-history-label {
    color: #1d6ff2;
    font-weight: 600;
}
.tdl-history-link {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    padding: 8px 4px;
    color: #374151;
}
.tdl-history-link i {
    color: #9ca3af;
}
.tdl-history-del {
    color: #c0c4cc;
    font-size: 18px;
    line-height: 1;
    padding: 2px 6px;
    border-radius: 6px;
    visibility: hidden;
}
.tdl-history-item:hover .tdl-history-del {
    visibility: visible;
}
.tdl-history-del:hover {
    color: #ef4444;
    background: #fee2e2;
}
.tdl-history-empty,
.tdl-empty {
    color: #9ca3af;
    font-size: 14px;
    padding: 12px 6px;
}

/* Main dated list */
.tdl-main {
    flex: 1;
    min-width: 420px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 20px 28px 28px;
    min-height: 520px;
}
.tdl-day-group {
    margin-bottom: 18px;
}
.tdl-day-divider {
    display: flex;
    align-items: center;
    text-align: center;
    color: #9ca3af;
    font-size: 14px;
    margin: 10px 0 14px;
}
.tdl-day-divider::before,
.tdl-day-divider::after {
    content: "";
    flex: 1;
    border-top: 1px solid #e5e7eb;
}
.tdl-day-divider span {
    padding: 0 16px;
}
/* Overdue-but-incomplete day group (live view only — see is_overdue in
   _group_entries_by_day) — same layout, just flagged so it doesn't read as
   an ordinary past day the user forgot about. */
.tdl-day-group--overdue .tdl-day-divider {
    color: #b45309;
}
.tdl-day-group--overdue .tdl-day-divider::before,
.tdl-day-group--overdue .tdl-day-divider::after {
    border-top-color: #fde68a;
}

.tdl-entries {
    list-style: none;
    counter-reset: tdl;
    margin: 0;
    padding: 0;
    /* Keep a drop target even when a day has no entries yet */
    min-height: 26px;
}

/* Where the dragged item will land */
.tdl-drop-placeholder {
    border: 1px dashed #93c5fd;
    background: #eff6ff;
    border-radius: 6px;
    margin: 2px 0;
    visibility: visible !important;
}
.tdl-entry {
    counter-increment: tdl;
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 8px;
    padding: 5px 132px 5px 4px; /* room for the 4 action icons (reminder, send-team, transfer, delete) */
    border-radius: 6px;
    position: relative;
}
.tdl-entry:hover {
    background: #f9fafb;
}
.tdl-entry::before {
    content: counter(tdl) ".";
    color: #6b7280;
    min-width: 20px;
    text-align: right;
    padding-top: 1px;
}
.tdl-drag {
    cursor: grab;
    color: #d1d5db;
    font-size: 12px;
    line-height: 1.4;
    user-select: none;
    visibility: hidden;
}
.tdl-entry:hover .tdl-drag {
    visibility: visible;
}
.tdl-check {
    margin-top: 3px;
    cursor: pointer;
}
.tdl-text {
    flex: 1;
    min-width: 0;
    color: #1f2937;
    cursor: text;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}
.tdl-edit-input {
    flex: 1;
    min-width: 0;
    border: 1px solid #93c5fd;
    border-radius: 6px;
    padding: 2px 6px;
    font: inherit;
    line-height: 1.5;
    resize: none;
    overflow: hidden;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}
.tdl-done .tdl-text,
.tdl-transferred .tdl-text {
    text-decoration: line-through;
    color: #9ca3af;
}
.tdl-actions {
    display: flex;
    align-items: center;
    gap: 2px;
    visibility: hidden;
    position: absolute;
    /* Centered on the row's full height (not a fixed top offset) so the
       icons share the same center line as .tdl-text however many lines the
       entry wraps to. */
    right: 2px;
    transform: translateY(-50%);
}
.tdl-entry:hover .tdl-actions {
    visibility: visible;
}
.tdl-del,
.tdl-send-team-btn,
.tdl-reminder-btn,
.tdl-transfer-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: none;
    border: none;
    border-radius: 6px;
    color: #c0c4cc;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    padding: 0;
}
.tdl-del:hover {
    color: #ef4444;
    background: #fee2e2;
}
.tdl-send-team-btn:hover {
    color: #4338ca;
    background: #eef2ff;
}
.tdl-reminder-btn:hover {
    color: #b45309;
    background: #fffbeb;
}
.tdl-transfer-btn:hover {
    color: #0891b2;
    background: #ecfeff;
}

/* "Send to team" — recipient badge and inline picker */
.tdl-team-badge {
    align-self: center;
    font-size: 11px;
    padding: 1px 7px;
    border-radius: 10px;
    background: #eef2ff;
    color: #4338ca;
    white-space: nowrap;
}
.tdl-team-badge.tdl-team-acked {
    background: #ecfdf5;
    color: #047857;
}
.tdl-send-team-wrapper {
    position: relative;
    display: inline-flex;
}
.tdl-send-team-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    z-index: 1200;
    width: 240px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 10px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
}
.tdl-send-team-search {
    width: 100%;
    padding: 6px 10px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.85rem;
}
.tdl-send-team-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}
.tdl-send-team-chips:empty {
    display: none;
}
.tdl-send-team-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    padding: 2px 4px 2px 8px;
    border-radius: 10px;
    background: #eef2ff;
    color: #4338ca;
    white-space: nowrap;
}
.tdl-send-team-chip-remove {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 14px;
    height: 14px;
    border: none;
    border-radius: 50%;
    background: none;
    color: inherit;
    font-size: 13px;
    line-height: 1;
    cursor: pointer;
    padding: 0;
}
.tdl-send-team-chip-remove:hover {
    background: rgba(67, 56, 202, 0.15);
}
.tdl-send-team-options {
    max-height: 200px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
}
.tdl-send-team-option {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 8px;
    font: inherit;
    font-size: 0.85rem;
    color: #374151;
    cursor: pointer;
}
.tdl-send-team-option:hover {
    background: #f9fafb;
}
.tdl-send-team-empty {
    font-size: 0.82rem;
    color: #9ca3af;
    padding: 8px;
}
.tdl-send-team-confirm {
    align-self: flex-end;
    font-size: 12px;
    padding: 4px 12px;
    border: none;
    border-radius: 6px;
    background: #4338ca;
    color: #fff;
    cursor: pointer;
}
.tdl-send-team-confirm:hover {
    background: #3730a3;
}
.tdl-send-team-confirm:disabled {
    background: #d1d5db;
    color: #9ca3af;
    cursor: not-allowed;
}

/* "Set reminder" — due badge and inline datetime picker */
.tdl-reminder-badge {
    align-self: center;
    font-size: 11px;
    padding: 1px 7px;
    border-radius: 10px;
    background: #fffbeb;
    color: #b45309;
    white-space: nowrap;
}
.tdl-reminder-badge.tdl-reminder-sent {
    background: #f3f4f6;
    color: #6b7280;
}
.tdl-reminder-picker {
    flex-basis: 100%;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 0 4px 28px;
}
.tdl-reminder-input {
    font: inherit;
    padding: 2px 6px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
}
.tdl-reminder-confirm,
.tdl-reminder-clear {
    font-size: 12px;
    padding: 3px 10px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
}
.tdl-reminder-confirm {
    background: #b45309;
    color: #fff;
}
.tdl-reminder-confirm:hover {
    background: #92400e;
}
.tdl-reminder-clear {
    background: #f3f4f6;
    color: #374151;
}
.tdl-reminder-clear:hover {
    background: #e5e7eb;
}

/* "Transfer to project" — coexists with .tdl-team-badge, not a replacement */
.tdl-transfer-badge {
    align-self: center;
    font-size: 11px;
    padding: 1px 7px;
    border-radius: 10px;
    background: #ecfeff;
    color: #0e7490;
    white-space: nowrap;
}

/* Add row ("Start typing...") */
.tdl-add-row {
    padding: 6px 4px 2px 28px;
}
.tdl-add-input {
    width: 100%;
    border: none;
    outline: none;
    font: inherit;
    color: #1f2937;
    background: transparent;
    padding: 4px 0;
    line-height: 1.5;
    resize: none;
    overflow: hidden;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    display: block;
}
.tdl-add-input::placeholder {
    color: #9ca3af;
    font-style: italic;
}

/* Reuse .zeni-card width from the shared Zeni styles; keep the layout responsive */
.todolist-layout .zeni-card {
    flex-shrink: 0;
    width: 30%;
}

/* ── Panel toggles: open History drawer / minimize Zeni ── */
.tdl-icon-btn {
    background: none;
    border: none;
    color: #6b7280;
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
}
.tdl-icon-btn:hover {
    background: #f3f4f6;
    color: #1f2937;
}

/* Minimized Zeni collapses to just its title bar so the restore control stays visible */
.zeni-min-btn {
    margin-left: auto;
}
.todolist-layout .zeni-card.zeni-card-collapsed {
    width: auto;
}
.zeni-card.zeni-card-collapsed .zeni-body {
    display: none;
}

/* Stacked Zeni variant (To Do List page): AI Recommended Actions on top,
   Ask Zeni below — instead of the side-by-side columns used on the tabs. */
.zeni-card-stacked .zeni-body {
    flex-direction: column;
    gap: 14px;
}

.zeni-card-stacked .zeni-info-col,
.zeni-card-stacked .zeni-chat-col {
    flex: 0 0 auto;
    width: 100%;
}

.zeni-card-stacked .zeni-chat-col {
    border-right: none;
    padding-right: 0;
    border-top: 1px solid #f3f4f6;
    padding-top: 12px;
}

@media (max-width: 1100px) {
    .todolist-layout {
        flex-direction: column;
    }
    .tdl-main,
    .todolist-layout .zeni-card {
        width: 100%;
    }
    .tdl-main {
        min-width: 0;
    }
}

/* ── Sprint tab ──────────────────────────────────────────────────────── */

/* Card container matching .project-group's existing shadow/radius/bg
   convention (List view's project cards) — reused rather than inventing
   new card styling, per mockup 1's header sitting in its own white card. */
.sprint-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 14px 20px;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    margin-bottom: 12px;
    line-height: 1;
}

.sprint-header-left, .sprint-header-right {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 14px;
    line-height: 1;
}

.sprint-nav { display: flex; align-items: center; gap: 8px; line-height: 1; }
.sprint-nav-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 1px solid #e0e6ef;
    background: #fff;
    color: #374151;
    cursor: pointer;
    transition: filter 0.15s;
}
.sprint-nav-btn:hover:not(:disabled) { filter: brightness(0.95); }
.sprint-nav-btn:disabled { opacity: 0.35; cursor: not-allowed; }
.sprint-nav-btn svg { display: block; flex-shrink: 0; width: 16px; height: 16px; stroke: #374151; fill: none; pointer-events: none; }
.sprint-nav-label { display: inline-block; font-weight: 700; font-size: 0.95rem; line-height: 1; color: #1a1a2e; }

.sprint-date-range { display: inline-block; font-size: 0.85rem; line-height: 1; color: #6b7280; white-space: nowrap; }
.sprint-workdays-label { display: inline-flex; align-items: center; font-size: 0.8rem; line-height: 1; color: #6b7280; background: #f3f4f6; padding: 7px 10px; border-radius: 12px; white-space: nowrap; align-self: end; }

.sprint-status-pill {
    display: inline-flex;
    align-items: center;
    line-height: 1;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.78rem;
    font-weight: 700;
    align-self: end;
}
.sprint-status-pill.status-planned { background: #eff6ff; color: #2563eb; border: 1px solid #93c5fd; }
.sprint-status-pill.status-in_progress { background: #fff4e5; color: #f59e0b; border: 1px solid #fcd34d; }
.sprint-status-pill.status-complete { background: #f0fdf4; color: #16a34a; border: 1px solid #86efac; }

.sprint-days-remaining {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.82rem;
    color: #6b7280;
    white-space: nowrap;
    align-self: end;
}

/* Every control in the header row shares one explicit height, so
   align-items: center on the row aligns actual equal-height boxes instead
   of relying on differing padding/border/line-height to coincidentally
   compute to the same size — the previous approach still left them
   visibly off. box-sizing: border-box so 1px borders don't add to it. */
.sprint-header .sprint-nav-btn,
.sprint-header .sprint-picker-btn,
.sprint-header .sprint-workdays-label,
.sprint-header .sprint-project-filter-btn,
.sprint-header .sprint-status-pill,
.sprint-header .sprint-days-remaining,
.sprint-header-right .toggle-btn,
.sprint-header-right .add-task-btn {
    box-sizing: border-box;
    height: 34px;
    padding-top: 0;
    padding-bottom: 0;
}
/* .sprint-nav-btn's own rule hardcodes width:30px for its circle — keep it
   a circle at the new shared height rather than stretching into an oval. */
.sprint-header .sprint-nav-btn { width: 34px; }

/* Jump-to-sprint picker — the "Sprint N | date range ▾" boxed control from
   the mockup, distinct from the prev/next steppers beside it. */
.sprint-picker-wrapper { position: relative; }

.sprint-picker-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: #fff;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    padding: 6px 12px;
    cursor: pointer;
}
.sprint-picker-btn:hover { background: #f9fafb; }
.sprint-picker-caret { flex-shrink: 0; stroke: #6b7280; }

.sprint-picker-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    z-index: 1200;
    min-width: 240px;
    max-height: 260px;
    overflow-y: auto;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 6px;
    box-shadow: 0 8px 24px rgba(15,23,42,0.12);
}

.sprint-picker-option {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    width: 100%;
    background: none;
    border: none;
    border-radius: 6px;
    padding: 6px 10px;
    text-align: left;
    cursor: pointer;
}
.sprint-picker-option:hover { background: #f3f4f6; }
.sprint-picker-option.active { background: #eff6ff; }
.sprint-picker-option-name { font-weight: 700; font-size: 0.85rem; color: #1a1a2e; }
.sprint-picker-option-range { font-size: 0.78rem; color: #6b7280; }

.sprint-project-filter-wrapper { position: relative; }

.sprint-project-filter-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    z-index: 1200;
    width: 260px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 10px;
    box-shadow: 0 8px 24px rgba(15,23,42,0.12);
}

.project-filter-search-input {
    width: 100%;
    padding: 6px 10px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.85rem;
    margin-bottom: 8px;
}

.project-filter-options { max-height: 220px; overflow-y: auto; margin: 4px 0 8px; }

.project-filter-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 4px;
    font-size: 0.85rem;
    color: #374151;
    cursor: pointer;
}
.project-filter-option:hover { background: #f9fafb; border-radius: 6px; }
.project-filter-select-all { border-bottom: 1px solid #e5e7eb; margin-bottom: 4px; font-weight: 600; }

.project-filter-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #7c3aed;
    flex-shrink: 0;
}

.project-filter-empty { font-size: 0.82rem; color: #9ca3af; padding: 8px 4px; }

.project-filter-actions { display: flex; align-items: center; justify-content: space-between; border-top: 1px solid #e5e7eb; padding-top: 8px; }
.project-filter-clear { background: none; border: none; color: #6b7280; font-size: 0.85rem; cursor: pointer; }
.project-filter-clear:hover { text-decoration: underline; }
.project-filter-apply { background: #0d6efd; color: #fff; border: none; border-radius: 6px; padding: 6px 16px; font-size: 0.85rem; font-weight: 600; cursor: pointer; }
.project-filter-apply:hover { filter: brightness(0.95); }

.due-label { font-size: 0.72rem; font-weight: 600; margin-top: 2px; }
.due-label-overdue { color: #e11d48; }
.due-label-due-soon { color: #f59e0b; }

.sprint-date-range-row {
    display: flex;
    align-items: flex-end;
    gap: 10px;
}
.sprint-date-field { flex: 1; min-width: 0; }
.sprint-date-field-label { display: block; font-size: 0.78rem; color: #6b7280; margin-bottom: 2px; }
.sprint-date-range-sep { padding-bottom: 8px; color: #9ca3af; }

.sprint-form-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #b91c1c;
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 0.85rem;
    margin-bottom: 14px;
}

.sprint-delete-btn:hover { border-color: #e11d48; color: #e11d48; }
.sprint-delete-btn:hover svg { stroke: #e11d48; }

.select-existing-task-row { border-bottom: 1px solid #e5e7eb; padding: 10px 0; }
.select-existing-task-row:last-child { border-bottom: none; }
.select-existing-task-row-name { font-weight: 600; font-size: 0.9rem; margin-bottom: 6px; color: #374151; }
.select-existing-task-row.done { opacity: 0.6; }
.select-existing-task-row.done .select-existing-task-row-name { color: #059669; }
.select-existing-task-row-error { margin-top: 8px; margin-bottom: 0; }

.sprint-blocked-notice {
    text-align: center;
    padding: 12px 4px 20px;
}
.sprint-blocked-notice p {
    color: #374151;
    margin-bottom: 16px;
}

/* ── Entity icons ({% entity_icon %}) ─ decorative, fixed 14px box so rows
   never shift; no hover/animation (icons are never the click target). ───── */
.entity-icon { display: inline-block; width: 14px; height: 14px; flex: 0 0 14px; margin-right: 6px; vertical-align: -2px; color: #6b7280; }
.entity-icon-topic { color: #0d6efd; }
.sprint-nav-label .entity-icon, .project-name .entity-icon { vertical-align: -2px; }
@media (max-width: 576px) { .entity-icon { margin-right: 4px; } }

/* ── Topic @mention picker (add_task_modal.html) ───────────────────────── */
.topic-mention-chips { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 4px; }
.topic-mention-chip { display: inline-flex; align-items: center; gap: 2px; padding: 2px 8px; border-radius: 12px; background: #eff6ff; color: #2563eb; font-size: 0.8rem; }
.topic-mention-chip button { border: 0; background: none; color: inherit; padding: 0 2px; line-height: 1; cursor: pointer; }
.topic-mention-results { max-height: 200px; overflow-y: auto; border: 1px solid #e5e7eb; border-radius: 6px; margin-top: 4px; background: #fff; }
.topic-mention-group { padding: 4px 10px; font-size: 0.72rem; font-weight: 700; text-transform: uppercase; color: #6b7280; background: #f9fafb; }
.topic-mention-option { display: block; width: 100%; text-align: left; border: 0; background: none; padding: 6px 10px; font-size: 0.875rem; cursor: pointer; }
.topic-mention-option:hover { background: #f3f4f6; }
.topic-mention-empty { padding: 8px 10px; font-size: 0.85rem; color: #6b7280; }

/* List tab: sprint icon next to the Status pill (opens the task in the Sprint tab) */
.sprint-jump { display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; margin-left: 6px; padding: 0; border: 0; background: none; vertical-align: middle; cursor: pointer; border-radius: 4px; }
.sprint-jump .entity-icon { margin-right: 0; vertical-align: 0; }
.sprint-jump:hover .entity-icon, .sprint-jump:focus-visible .entity-icon { color: #0d6efd; }
.sprint-jump:focus-visible { outline: 2px solid #0d6efd; outline-offset: 1px; }
.sprint-jump-locked { cursor: default; opacity: .45; }
.sprint-jump-locked:hover .entity-icon { color: #6b7280; }
@keyframes sprintDeeplinkFlash { 0%, 60% { background-color: #fff3cd; } 100% { background-color: transparent; } }
.list-row.sprint-deeplink-flash > td { animation: sprintDeeplinkFlash 2.4s ease-out; }
