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;
}

/* SIMS+ shell toolbar alignment: one fixed height, no wrapped labels, and the
   row wraps instead of squashing buttons. Undoes pr/css's global
   `button { margin-top: 20px }` and the search box's Bootstrap mt-auto
   (margin-top: auto !important). W3 has its own rules in w3-task-manager.css. */
body:not(.w3-shell) .task-manager-toolbar { flex-wrap: wrap; gap: 10px; }
body:not(.w3-shell) .task-manager-toolbar .view-toggle { flex-wrap: wrap; }
body:not(.w3-shell) .task-manager-toolbar :is(.toggle-btn, .filter-btn, .search-box) {
    box-sizing: border-box;
    height: 36px;
    margin-top: 0 !important;
    padding-top: 0;
    padding-bottom: 0;
    white-space: nowrap;
    flex-shrink: 0;
}
body:not(.w3-shell) .task-manager-toolbar :is(.toggle-btn, .filter-btn) svg { flex-shrink: 0; }

.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; }
.filter-row-check label { display:flex; align-items:center; gap:6px; font-weight:500; cursor:pointer; }
.filter-row-check input { margin:0; }

/* Number of active task filters on the Filter button */
.filter-count {
    display:inline-flex; align-items:center; justify-content:center; min-width:18px; height:18px;
    margin-left:4px; padding:0 5px; border-radius:9px; background:#2563eb; color:#fff;
    font-size:0.7rem; font-weight:700; line-height:1;
}
.filter-count[hidden] { display:none; }
/* Quick filters above the task views (both shells; W3 restyles them as chips
   in w3-task-manager.css). */
.tm-filter-strip { display:flex; align-items:center; gap:10px; flex-wrap:wrap; padding:0 24px 12px; }
.tm-filter-strip button { margin-top:0; }            /* pr/css gives every button margin-top: 20px */
.tm-select-chip { margin:0; }
.tm-select-chip select {
    padding:6px 28px 6px 12px; border:1px solid #d1d5db; border-radius:999px; background-color:#fff;
    color:#374151; font-size:0.85rem; cursor:pointer; max-width:230px;
}
.tm-select-chip select:focus { outline:2px solid #2563eb; outline-offset:1px; }
.tm-text-btn { border:0; background:none; color:#2563eb; font-size:0.85rem; padding:4px 6px; cursor:pointer; }
.tm-text-btn:hover { text-decoration:underline; }
a.task-export-btn { text-decoration:none; color:inherit; margin-top:20px; } /* lines up with SIMS+ buttons (pr/css gives buttons margin-top: 20px) */

/* Task flags after a task's name: your pin, archived */
.task-pin-marker { display:inline-flex; vertical-align:-1px; margin-left:6px; color:#1170b4; }
.task-pin-marker svg { display:inline-block; }
.task-archived-badge {
    display:inline-block; margin-left:6px; padding:1px 6px; border-radius:4px;
    background:#eef0f3; color:#4b5563; font-size:0.7rem; font-weight:600; vertical-align:1px;
}

/* 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; }

/* A project's stored colour (TaskProject.colour, set inline as --project-accent)
   replaces the rotating pastels above: same weight, declared later. */
.project-group[style*="--project-accent"] .project-group-header,
.gantt-group-header[style*="--project-accent"] {
    background: color-mix(in srgb, var(--project-accent) 14%, #fff);
    border-left: 4px solid var(--project-accent);
}
.project-colour-dot {
    display: inline-block; width: 9px; height: 9px; margin-right: 7px; border-radius: 50%;
    vertical-align: 1px; box-shadow: 0 0 0 1px rgba(0,0,0,0.08);
}
.project-edit-fields { display: inline-flex; align-items: center; gap: 6px; }
.project-edit-fields .form-control-color { width: 42px; padding: 3px; flex-shrink: 0; }
.project-edit-fields input[name="meeting_url"] { min-width: 220px; }

/* Teams / Meet buttons: a project's (beside its name) and the board's standup */
.project-meeting-link {
    display: inline-block; margin-left: 8px; padding: 1px 8px; border-radius: 10px;
    font-size: 11px; font-weight: 600; line-height: 18px; vertical-align: 1px;
    color: #fff; background: #5b5fc7; text-decoration: none;
}
.project-meeting-link:hover, .project-meeting-link:focus-visible { color: #fff; background: #4f52b2; }
.project-meeting-link--meet { background: #188038; }
.project-meeting-link--meet:hover, .project-meeting-link--meet:focus-visible { background: #137333; }
.project-meeting-link--zoom { background: #0e71eb; }
.project-meeting-link--zoom:hover, .project-meeting-link--zoom:focus-visible { background: #0b5ed7; }
.standup-meeting { display: inline-flex; align-items: stretch; gap: 12px; }
/* A link styled as a button: as an inline <a>, its padding wouldn't size it like the <button>s beside it */
a.standup-join-btn { display: inline-flex; align-items: center; margin: 0; text-decoration: none; }
/* No vertical padding of its own: it stretches to Join standup's height, whatever that is.
   margin-top: pr/css gives every button margin-top: 20px, which would push it down beside the <a>. */
.standup-edit-btn--icon { display: inline-flex; align-items: center; justify-content: center; align-self: stretch; margin-top: 0; padding: 0 14px; }
.standup-edit-btn--icon svg { width: 1.2em; height: 1.2em; }

/* 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;
    /* Above the month (3) and day (2) header cells: the grid auto-scrolls
       horizontally to the first bar, so month cells slide under this
       corner cell and would otherwise paint over Timeline/Duration. */
    z-index: 4;
    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;
    /* clip, not hidden: hidden would make this cell the scroll container
       for the sticky label below, so it would never stick. */
    overflow: clip;
    white-space: nowrap;
}

/* Month name sticks just right of the 260px label column, so a month
   partly scrolled under it still shows its name (bounded by its own cell). */
.gantt-header-month-label {
    position: sticky;
    left: 268px;
    right: 8px;
    padding: 0 8px;
}

/* 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;
    /* On narrow screens, wrap whole buttons onto a second row rather than squeezing their labels onto several lines */
    flex-wrap: wrap;
    justify-content: flex-end;
}

.main-tab-nav-actions .add-task-btn,
.main-tab-nav-actions .import-task-btn,
.main-tab-nav-actions .ai-assist-btn,
.main-tab-btn {
    white-space: nowrap;
}

.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 162px 5px 4px; /* room for the 5 action icons (notes & links, 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 1 10rem; /* below ~8rem the badges wrap to their own line instead of squeezing the text */
    min-width: 8rem;
    color: #1f2937;
    cursor: text;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}
.tdl-text a {
    color: #2563eb;
    text-decoration: underline;
    word-break: break-all;
}
.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-details-btn,
.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;
}
.tdl-details-btn { font-size: 16px; }
.tdl-details-btn:hover {
    color: #2563eb;
    background: #eff6ff;
}

/* ── To Do List: search/filters, capture box, notes & links, Trash (TD-2..5) ── */
.tdl-toolbar { display:flex; align-items:center; gap:8px; flex-wrap:wrap; margin:0 0 12px; }
.tdl-search { flex:1 1 220px; margin:0; }
.tdl-search input, .tdl-toolbar select {
    width:100%; padding:6px 10px; border:1px solid #d1d5db; border-radius:8px; background:#fff;
    font-size:0.85rem; color:#374151;
}
.tdl-toolbar select { width:auto; cursor:pointer; }
.tdl-filter-clear, .tdl-toolbar button { margin-top:0; }
.tdl-filter-clear { border:0; background:none; color:#2563eb; font-size:0.85rem; padding:4px 6px; cursor:pointer; }
.tdl-filter-clear:hover { text-decoration:underline; }
.tdl-filtered .tdl-drag { visibility:hidden !important; }     /* no reordering while filtered */

.tdl-capture {
    display:flex; align-items:center; gap:8px; flex-wrap:wrap; margin:0 0 14px; padding:8px 12px;
    background:#fff; border:1px solid #e5e7eb; border-radius:12px;
}
.tdl-capture button { margin-top:0; }
.tdl-capture-plus {
    display:inline-flex; align-items:center; justify-content:center; width:24px; height:24px; flex-shrink:0;
    border-radius:50%; background:#2563eb; color:#fff; font-size:18px; line-height:1;
}
.tdl-capture-input { flex:1 1 200px; min-width:0; border:0; outline:none; padding:6px 2px; font-size:0.9rem; background:transparent; }
.tdl-capture select, .tdl-capture input[type=date] {
    padding:6px 8px; border:1px solid #d1d5db; border-radius:8px; background:#fff; font-size:0.85rem;
}
.tdl-capture-add { padding:6px 16px; border:0; border-radius:8px; background:#2563eb; color:#fff; font-weight:600; cursor:pointer; }
.tdl-capture-add:hover { background:#1d4ed8; }

.tdl-notes {
    flex-basis:100%; order:5; margin:0 0 2px 48px; color:#6b7280; font-size:12px; line-height:1.5;
    overflow:hidden; text-overflow:ellipsis; white-space:nowrap;
}
.tdl-link-chip {
    display:inline-flex; align-items:center; max-width:220px; padding:1px 8px; border:1px solid #bfdbfe;
    border-radius:10px; background:#eff6ff; color:#1d4ed8; font-size:11px; text-decoration:none;
    overflow:hidden; text-overflow:ellipsis; white-space:nowrap; align-self:center;
}
.tdl-link-chip:hover { background:#dbeafe; }

.tdl-details-item { font-weight:600; color:#111827; margin:0 0 12px; overflow-wrap:anywhere; }
.tdl-details-error { color:#b91c1c; background:#fef2f2; border:1px solid #fecaca; border-radius:8px; padding:8px 10px; font-size:13px; }
.tdl-details-links-head { display:flex; align-items:baseline; justify-content:space-between; margin:14px 0 6px; }
.tdl-details-hint { color:#6b7280; font-size:12px; }
.tdl-link-row { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1.6fr) auto; gap:8px; margin-bottom:8px; align-items:center; }
.tdl-link-remove { margin-top:0; border:0; background:none; color:#9ca3af; font-size:20px; line-height:1; cursor:pointer; padding:4px 6px; }
.tdl-link-remove:hover { color:#b91c1c; }
.tdl-link-add { margin-top:0; border:0; background:none; color:#2563eb; font-size:13px; padding:4px 0; cursor:pointer; }
.tdl-details-actions { display:flex; justify-content:flex-end; gap:8px; margin-top:16px; }
.tdl-details-actions .btn { margin-top:0; }

.tdl-history-controls { display:flex; align-items:center; gap:8px; flex-wrap:wrap; padding:0 6px 10px; border-bottom:1px solid #eef0f3; margin-bottom:8px; }
.tdl-history-field { margin:0; color:#6b7280; font-weight:600; font-size:13px; }
#tdl-history-mode { flex:1; min-width:0; padding:5px 8px; border:1px solid #d1d5db; border-radius:6px; background:#fff; font-size:13px; }
#tdl-history-q { flex-basis:100%; padding:5px 10px; border:1px solid #d1d5db; border-radius:6px; font-size:13px; }
.tdl-history-records .tdl-trash-item .tdl-trash-restore + .tdl-trash-restore { margin-left:-2px; }

.tdl-linked-name { font-weight:600; margin:0 0 10px; overflow-wrap:anywhere; }
.tdl-linked-flag { font-size:11px; font-weight:600; padding:1px 6px; border-radius:6px; background:#f1f5f9; color:#475569; }
.tdl-linked-meta { display:grid; grid-template-columns:max-content 1fr; gap:4px 14px; margin:0 0 10px; font-size:13px; }
.tdl-linked-meta dt { color:#6b7280; font-weight:500; }
.tdl-linked-meta dd { margin:0; color:#111827; }
.tdl-linked-desc { color:#4b5563; font-size:13px; white-space:pre-line; margin:0; }
.tdl-trash-note { color:#6b7280; font-size:12px; margin:0 6px 10px; }
.tdl-trash-item { display:flex; align-items:center; gap:8px; padding:8px 6px; border-bottom:1px solid #f1f3f5; }
.tdl-trash-main { flex:1; min-width:0; display:flex; flex-direction:column; }
.tdl-trash-title { color:#374151; font-size:13px; overflow-wrap:anywhere; }
.tdl-trash-meta { color:#9ca3af; font-size:11px; }
.tdl-trash-restore { margin-top:0; border:1px solid #bfdbfe; background:#eff6ff; color:#1d4ed8; border-radius:6px; padding:3px 10px; font-size:12px; cursor:pointer; }
.tdl-trash-restore:hover { background:#dbeafe; }

/* "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;
}
/* "Send to teammates" popover — one shared, viewport-anchored panel (todo_send_popover.js) */
.tdl-send-pop {
    position: fixed;
    z-index: 1045; /* above row actions / sticky headers, below Bootstrap modals (1055) */
    width: 320px;
    max-width: calc(100vw - 16px);
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid var(--border, #e2e6ea);
    border-radius: 10px;
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.2);
    overflow: hidden;
}
.tdl-send-pop[hidden] { display: none; }
.tdl-send-pop__head {
    padding: 10px 12px 8px;
    border-bottom: 1px solid var(--border, #e2e6ea);
    background: #fff;
}
.tdl-send-pop__bar { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.tdl-send-pop__title { flex: 1; margin: 0; font-size: 0.95rem; font-weight: 600; color: #1f2937; }
.tdl-send-pop__send {
    font-size: 0.85rem;
    font-weight: 600;
    padding: 5px 14px;
    border: none;
    border-radius: 6px;
    background: var(--primary, #137CD9);
    color: #fff;
    cursor: pointer;
}
.tdl-send-pop__send:hover:not(:disabled) { background: var(--primary-hover, #0f6bbf); }
.tdl-send-pop__send:disabled { background: #e5e7eb; color: #6b7280; cursor: not-allowed; }
.tdl-send-pop__close {
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 6px;
    background: none;
    color: #6b7280;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
}
.tdl-send-pop__close:hover { background: #f3f4f6; color: #1f2937; }
.tdl-send-pop__search {
    width: 100%;
    padding: 6px 10px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.85rem;
}
.tdl-send-pop__search:focus,
.tdl-send-pop button:focus-visible,
.tdl-send-pop__option:focus-visible {
    outline: 2px solid var(--primary-light, #e8f3fc);
    outline-offset: 0;
    border-color: var(--primary, #137CD9);
    box-shadow: 0 0 0 1px var(--primary, #137CD9);
}
.tdl-send-pop__meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 20px;
    margin-top: 6px;
    font-size: 0.78rem;
    color: var(--text-secondary, #575d67);
}
.tdl-send-pop__clear { border: none; background: none; color: var(--primary, #137CD9); font-size: 0.78rem; cursor: pointer; padding: 0; }
.tdl-send-pop__list {
    list-style: none;
    margin: 0;
    padding: 4px 0;
    max-height: 280px;
    overflow-y: auto;
    flex: 1 1 auto;
    min-height: 0;
    scrollbar-width: auto;
}
.tdl-send-pop__option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    cursor: pointer;
    font-size: 0.88rem;
    color: #1f2937;
}
.tdl-send-pop__option[hidden] { display: none; }
.tdl-send-pop__option:hover { background: #f9fafb; }
.tdl-send-pop__option[aria-selected="true"] { background: var(--primary-light, #e8f3fc); }
.tdl-send-pop__box {
    flex: none;
    width: 16px;
    height: 16px;
    border: 1.5px solid #9ca3af;
    border-radius: 4px;
    background: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    line-height: 1;
    color: #fff;
}
.tdl-send-pop__option[aria-selected="true"] .tdl-send-pop__box {
    background: var(--primary, #137CD9);
    border-color: var(--primary, #137CD9);
}
.tdl-send-pop__option[aria-selected="true"] .tdl-send-pop__box::before { content: "\2713"; }
.tdl-send-pop__name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tdl-send-pop__user { flex: none; font-size: 0.75rem; color: var(--muted, #6c757d); }
.tdl-send-pop__empty { padding: 12px; font-size: 0.85rem; color: var(--muted, #6c757d); }
@media (max-width: 480px) {
    .tdl-send-pop {
        left: 0 !important;
        right: 0;
        top: auto !important;
        bottom: 0;
        width: 100%;
        max-width: none;
        max-height: 80vh !important;
        border-radius: 14px 14px 0 0;
    }
    .tdl-send-pop__list { max-height: none; }
}

/* "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;
    border: 0;
    margin-top: 0;
    background: #ecfeff;
    color: #0e7490;
    white-space: nowrap;
    cursor: pointer;
}
.tdl-transfer-badge:hover { background: #cffafe; }

/* 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;
}

/* To Do List page: the Ask Zeni chat fills the card, and the card the viewport
   height beside the (taller, scrolling) list. */
.todolist-layout .zeni-card-todo {
    position: sticky;
    top: 12px;
    height: calc(100vh - 24px);
}
.todolist-layout .zeni-card-todo.zeni-card-collapsed {
    height: auto;
}
.zeni-card-todo .zeni-body,
.zeni-card-todo .zeni-chat-col,
.zeni-card-todo .zeni-chat-wrapper {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    width: 100%;
}
.zeni-card-todo .zeni-chat-messages {
    flex: 1 1 auto;
    max-height: none;
    min-height: 0;
    overflow-y: auto;
    white-space: pre-wrap;
}

@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-member-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-bottom: 8px; font-size: 0.85rem; }
.sprint-member-label { font-weight: 600; color: var(--text-secondary, #575d67); margin: 0; }
.sprint-member-select { padding: 4px 8px; border: 1px solid var(--border, #e2e6ea); border-radius: 6px; background: #fff; min-width: 160px; }
.sprint-member-banner { padding: 3px 10px; border-radius: 12px; background: var(--primary-light, #e8f3fc); color: var(--primary-hover, #0f6bbf); font-weight: 500; }
.sprint-member-back { border: none; background: none; padding: 0; color: var(--primary, #137CD9); text-decoration: underline; cursor: pointer; }
.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; }

/* ── To-Do page tabs + "Assigned" tab ───────────────────────────────────── */
.tdl-tabs { display: flex; gap: 4px; margin: -8px 0 16px; border-bottom: 1px solid #e5e7eb; }
.tdl-tab {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 8px 14px; margin-bottom: -1px;
    border: 0; border-bottom: 2px solid transparent; background: none;
    color: #6b7280; font-size: 14px; font-weight: 600; cursor: pointer;
}
.tdl-tab:hover { color: #111827; }
.tdl-tab.active { color: #111827; border-bottom-color: #2563eb; }
.tdl-tab-badge {
    min-width: 18px; padding: 1px 6px; border-radius: 999px;
    background: #dc2626; color: #fff; font-size: 11px; font-weight: 700; text-align: center;
}
.tdl-tab-badge[hidden] { display: none; }

/* My To-Do left column: the "Assigned to me" card above the dated list */
.tdl-col { flex: 1; min-width: 420px; display: flex; flex-direction: column; gap: 16px; }
.tdl-col > .tdl-main { flex: none; min-width: 0; }
.tdl-assigned-card {
    padding: 16px 20px; background: #fff; border: 1px solid #e5e7eb;
    border-left: 4px solid #2563eb; border-radius: 12px;
}
.tdl-assigned-card[hidden] { display: none; }
.tdl-assigned-card .tdl-assigned-list { margin-top: 4px; }

.tdl-assigned { display: flex; flex-direction: column; gap: 24px; max-width: 900px; }
.tdl-assigned-heading { margin: 0; font-size: 16px; font-weight: 700; color: #111827; }
.tdl-assigned-count { margin-left: 6px; color: #6b7280; font-size: 12px; font-weight: 600; }
.tdl-assigned-note, .tdl-assigned-empty { margin: 2px 0 10px; color: #6b7280; font-size: 13px; }
.tdl-assigned-list { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 8px; }
.tdl-assigned-row {
    display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px;
    padding: 10px 12px; border: 1px solid #e5e7eb; border-radius: 10px; background: #fff;
}
.tdl-assigned-row--acked { background: #f9fafb; }
.tdl-assigned-main { display: flex; flex-direction: column; gap: 2px; flex: 1 1 260px; min-width: 0; }
.tdl-assigned-title { color: #111827; font-weight: 600; overflow-wrap: anywhere; white-space: pre-line; }
.tdl-assigned-meta { color: #6b7280; font-size: 12px; }
.tdl-assigned-status { font-size: 12px; font-weight: 700; color: #b45309; }
.tdl-assigned-status--acked { color: #15803d; }
.tdl-assigned-ack {
    padding: 5px 12px; border: 0; border-radius: 8px;
    background: #2563eb; color: #fff; font-size: 13px; font-weight: 600; cursor: pointer;
}
.tdl-assigned-ack:hover { background: #1d4ed8; }
@media (max-width: 600px) { .tdl-assigned-row { flex-direction: column; align-items: flex-start; } }

/* Calendar tab (FullCalendar v6) — SIMS+ shell theme. The W3 shell also loads
   this file; its .w3-shell rules in w3-task-manager.css outrank these, so only
   set properties that file sets too, or they leak into W3. */
#calendar-view .fc {
    --fc-border-color: #e0e6ef;
    --fc-page-bg-color: #fff;
    --fc-neutral-bg-color: #f9fafb;
    --fc-today-bg-color: #eff6ff;
    --fc-list-event-hover-bg-color: #f3f4f6;
    --fc-small-font-size: 11px;
    color: #1a1a2e;
    padding: 16px 18px; border-radius: 10px;
    background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

/* Toolbar: title + buttons styled like .toggle-btn / .gantt-nav-today */
#calendar-view .fc .fc-toolbar-title { font-size: 1.1rem; font-weight: 600; }
#calendar-view .fc .fc-button-primary {
    padding: 5px 12px;
    border: 1px solid #d1d5db; border-radius: 6px;
    background: #fff; color: #374151;
    font-size: 0.8rem; font-weight: 600; text-transform: none; box-shadow: none;
}
#calendar-view .fc .fc-button-primary:hover:not(:disabled):not(.fc-button-active) {
    background: #f3f4f6; box-shadow: none;
}
#calendar-view .fc .fc-button-primary.fc-button-active,
#calendar-view .fc .fc-button-primary:not(:disabled):active {
    color: #fff; background: #0d6efd; border-color: #0d6efd; box-shadow: none;
}
#calendar-view .fc .fc-button-primary:focus { box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.25); }
#calendar-view .fc .fc-button-group { gap: 6px; }
#calendar-view .fc .fc-button-group > .fc-button { border-radius: 6px; }

/* Grid */
#calendar-view .fc .fc-scrollgrid { border-radius: 8px; overflow: hidden; }
#calendar-view .fc .fc-col-header-cell { background: #f9fafb; }
#calendar-view .fc .fc-col-header-cell-cushion {
    padding: 8px 0; color: #6b7280; font-size: 12px; font-weight: 600; text-decoration: none;
}
#calendar-view .fc .fc-day-sat, #calendar-view .fc .fc-day-sun { background: #fcfcfd; }
#calendar-view .fc .fc-daygrid-day-number {
    padding: 6px 8px; color: #374151; font-size: 12px; font-weight: 500; text-decoration: none;
}
#calendar-view .fc .fc-day-other .fc-daygrid-day-number { opacity: .4; }
#calendar-view .fc .fc-day-today .fc-daygrid-day-number {
    margin: 4px; padding: 0; width: 24px; height: 24px; border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    background: #2563eb; color: #fff;
}

/* Events */
#calendar-view .fc .fc-daygrid-event {
    margin: 1px 4px 2px; padding: 2px 6px; border-radius: 4px; border: 0;
    font-size: 11px; font-weight: 600; cursor: pointer;
    box-shadow: none; transition: box-shadow .15s;
}
#calendar-view .fc .fc-daygrid-event:hover { box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15); }
#calendar-view .fc .tm-cal-done { opacity: .5; }
#calendar-view .fc .tm-cal-done .fc-event-title { text-decoration: line-through; }
#calendar-view .fc .tm-cal-overdue { box-shadow: inset 3px 0 0 #e53935; }
#calendar-view .fc .tm-cal-overdue:hover { box-shadow: inset 3px 0 0 #e53935, 0 2px 6px rgba(0, 0, 0, 0.15); }
/* Sprint bolt on a task: the List tab's .sprint-jump, in the bar's own text colour */
/* margin: pr/css gives every button margin-top: 20px; this is a span but shares the class */
#calendar-view .fc .sprint-jump { width: 14px; height: 14px; margin: 0 4px 0 0; flex: none; color: inherit; cursor: pointer; }
#calendar-view .fc .sprint-jump:hover .entity-icon { color: inherit; }
#calendar-view .fc .sprint-jump-locked { cursor: default; }
#calendar-view .fc .fc-list-event-title .sprint-jump { display: inline-flex; vertical-align: middle; }
/* Due day = a task's last day: flag + heavier edge on the bar's final segment */
#calendar-view .fc .tm-cal-task.fc-event-end { padding-right: 20px; border-right: 4px solid rgba(0, 0, 0, 0.35); }
#calendar-view .fc .tm-cal-task.fc-event-end::after { content: "\2691"; position: absolute; right: 5px; top: 50%; transform: translateY(-50%); font-size: 11px; }
#calendar-view .fc .tm-cal-task.tm-cal-overdue.fc-event-end { border-right-color: #e53935; }
/* align-self: the day-top row is a flex container whose date number is taller than the chip */
#calendar-view .fc .tm-cal-due-badge { margin-right: auto; align-self: center; padding: 0 6px; border-radius: 8px; background: #eef2f7; color: #374151; font-size: 10px; font-weight: 700; line-height: 16px; cursor: default; }
#calendar-view .fc .tm-cal-due-badge.is-overdue { background: #e53935; color: #fff; }
/* To Do List entries: dot items (display: list-item), so no bar shadow/stripe */
#calendar-view .fc .fc-daygrid-dot-event { color: #374151; font-weight: 500; box-shadow: none; }
#calendar-view .fc .fc-daygrid-dot-event:hover { background: #f3f4f6; box-shadow: none; }
#calendar-view .fc .tm-cal-todo.tm-cal-overdue,
#calendar-view .fc .tm-cal-todo.tm-cal-overdue:hover { box-shadow: none; color: #e53935; }
/* Teams / Meet meetings: timed, so FullCalendar shows the start time first */
#calendar-view .fc .tm-cal-meeting .fc-event-time { font-weight: 700; margin-right: 4px; }

/* New meeting form */
/* Calendar "Add to <day>" chooser: Meeting / Task side by side, then the to-do box */
.tm-cal-add-choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; }
.tm-cal-add-choices .btn { padding: 12px 16px; font-weight: 600; }
/* Set while the chooser hands over to the Meeting / Task modal: the new backdrop starts at full dim
   instead of fading in, so the shade never drops out between the two (calendar_add.js). */
body.tm-modal-handoff .modal-backdrop { transition: none !important; }
.tm-meeting-when { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 10px; margin-top: 12px; }
.tm-meeting-provider { margin-top: 14px; }
.tm-meeting-provider legend { font-size: 1rem; float: none; }
.tm-meeting-teams-link { margin-top: 10px; }
.tm-meeting-invitees legend { font-size: 1rem; float: none; }
.tm-meeting-invitee-list { max-height: 168px; overflow-y: auto; margin-top: 6px; padding: 6px 10px; border: 1px solid #dee2e6; border-radius: 6px; }
.tm-meeting-invitee-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.tm-meeting-invitee-chip { display: inline-flex; align-items: center; gap: 2px; padding: 2px 4px 2px 10px; border-radius: 14px; background: #e8f0fe; color: #1d4ed8; font-size: 0.85rem; font-weight: 500; }
/* margin-top: pr/css gives every button margin-top: 20px */
.tm-meeting-invitee-chip-remove { margin-top: 0; padding: 0 6px; border: 0; border-radius: 50%; background: none; color: inherit; font-size: 1rem; line-height: 1.2; cursor: pointer; }
.tm-meeting-invitee-chip-remove:hover, .tm-meeting-invitee-chip-remove:focus-visible { background: #c7d7fb; }
.tm-meeting-invitee { display: flex; align-items: baseline; gap: 6px; margin: 0; padding: 3px 0 3px 1.5em; cursor: pointer; }
@media (max-width: 480px) { .tm-meeting-when { grid-template-columns: 1fr 1fr; } .tm-meeting-when > :first-child { grid-column: 1 / -1; } }
#calendar-view .fc .fc-daygrid-more-link { color: #2563eb; font-size: 11px; font-weight: 600; }
#calendar-view .fc .fc-popover { border-radius: 8px; border-color: #e0e6ef; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12); }
/* Project legend above the calendar */
.tm-cal-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0 0 10px; }
.tm-cal-legend[hidden] { display: none; }
/* margin-top: pr/css gives every button margin-top: 20px */
.tm-cal-legend-chip, .tm-cal-legend-more { display: inline-flex; align-items: center; gap: 6px; margin-top: 0; padding: 3px 10px; border: 1px solid #e0e6ef; border-radius: 14px; background: #fff; color: #374151; font-size: 12px; font-weight: 600; line-height: 1.4; cursor: pointer; }
.tm-cal-legend-chip:hover, .tm-cal-legend-more:hover { background: #f3f4f6; }
.tm-cal-legend-chip:focus-visible, .tm-cal-legend-more:focus-visible { outline: 2px solid #2563eb; outline-offset: 1px; }
.tm-cal-legend-chip.is-active { border-color: #2563eb; background: #e8f0fe; color: #1d4ed8; }
.tm-cal-legend-swatch { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.tm-cal-legend-count { min-width: 18px; padding: 0 5px; border-radius: 8px; background: #eef2f7; color: #6b7280; font-size: 11px; text-align: center; }
.tm-cal-legend-clear { font-size: 14px; line-height: 1; }
.tm-cal-legend-label { color: #6b7280; font-size: 12px; font-weight: 600; }
.tm-cal-legend-more { border-style: dashed; color: #2563eb; }

/* A "+N more" list can run to dozens: scroll inside the popover instead of off-screen */
#calendar-view .fc .fc-popover-body { max-height: min(50vh, 320px); overflow-y: auto; overscroll-behavior: contain; }

@media (prefers-reduced-motion: reduce) {
    #calendar-view .fc .fc-daygrid-event { transition: none; }
}
