* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: #f5f7fa;
    color: #1a2e4a;
}

.todo-app {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    /* height set by updateStickyOffsets() — fills viewport below platform-nav + hub-nav */
}

/* Header — matches Brand Hub standard */
.hub-page-header {
    background: linear-gradient(135deg, #2F5496 0%, #1a3a6e 100%);
    padding: 20px 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.hub-page-header-left {
    flex: 1;
}

.hub-page-header-left h1 {
    font-size: 22px;
    font-weight: 700;
    color: white;
    margin-bottom: 6px;
}

.hub-page-subtitle {
    background: #2F5496;
    color: white;
    padding: 8px 14px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    display: inline-block;
    border: none;
}

.hub-page-header-right {
    display: flex;
    gap: 12px;
    align-items: center;
    justify-content: flex-end;
}

.btn {
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    border: none;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: all 0.15s;
}

.btn.btn-primary {
    background: rgba(255,255,255,0.25);
    color: #fff;
    border: 1px solid rgba(255,255,255,0.4);
}

.btn.btn-primary:hover {
    background: rgba(255,255,255,0.35);
    border-color: rgba(255,255,255,0.5);
}

.btn-ghost {
    background: rgba(255,255,255,0.15);
    color: #fff;
    border: 1px solid rgba(255,255,255,0.25);
}

.btn-ghost:hover {
    background: rgba(255,255,255,0.25);
    border-color: rgba(255,255,255,0.4);
}

#userInfo {
    font-size: 12px;
    color: rgba(255,255,255,0.8);
}

/* Hub Navigation — scoped to .todo-app to avoid bleeding into Brand Hub / other pages */
/* Hub-nav — unscoped so it works outside .todo-app (matches brands.css pill style) */
.hub-nav {
    background: #fff;
    border-bottom: 2px solid #e2e8f0;
    box-shadow: 0 1px 4px rgba(0,0,0,0.05);
    position: sticky;
    top: 44px; /* exact height of #platform-nav */
    z-index: 99;
}

.hub-nav-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 8px 20px;
    display: flex;
    align-items: center;
    overflow-x: auto;
    gap: 4px;
}

.hub-nav-tab {
    flex: 0 0 auto;
    padding: 6px 14px;
    border: none;
    background: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    color: #64748b;
    cursor: pointer;
    white-space: nowrap;
    transition: color 0.15s, background 0.15s;
    letter-spacing: 0.1px;
}

.hub-nav-tab:hover {
    color: #1a2e4a;
    background: #f0f4ff;
}

.hub-nav-tab.active {
    background: #2F5496;
    color: #fff;
    font-weight: 600;
}

/* Sub-tabs — Level 3 nav (person/member filter beneath primary hub-nav)
   Matches the brand-page tab standard: underline active, no pill background */
.todo-app .sub-tabs-bar {
    background: #fff;
    border-bottom: 1px solid #e2e8f0;
}

.todo-app .sub-tabs-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    overflow-x: auto;
}

.todo-app .sub-tabs {
    display: flex;
    gap: 0;
}

.todo-app .sub-tab {
    flex: 0 0 auto;
    padding: 10px 16px;
    border: none;
    border-bottom: 2px solid transparent;
    border-radius: 0;
    background: none;
    font-size: 13px;
    font-weight: 500;
    color: #64748b;
    cursor: pointer;
    white-space: nowrap;
    transition: color 0.15s, border-color 0.15s;
}

.todo-app .sub-tab:hover {
    color: #2F5496;
}

.todo-app .sub-tab.active {
    color: #2F5496;
    border-bottom-color: #2F5496;
    font-weight: 600;
}

/* Advanced Filters Band — full-width white background stripe */
.advanced-filters-band {
    background: white;
    border-bottom: 1px solid #e8ecf0;
    flex-shrink: 0;
}

/* Advanced Filters Bar — centered content inside the band */
.advanced-filters-bar {
    max-width: 1200px;
    margin: 0 auto;
    padding: 8px 40px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.advanced-filters-toggle {
    background: none;
    border: 1px solid #d0d7e0;
    border-radius: 4px;
    padding: 5px 10px;
    font-size: 12px;
    color: #555;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.advanced-filters-toggle:hover {
    border-color: #aaa;
    background: #f5f5f5;
}

.advanced-filters-toggle.open {
    border-color: #2F5496;
    color: #2F5496;
}

.quick-date-chip {
    background: none;
    border: 1px solid #d0d7e0;
    border-radius: 4px;
    padding: 5px 10px;
    font-size: 12px;
    color: #555;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    flex-shrink: 0;
}
.quick-date-chip:hover {
    border-color: #aaa;
    background: #f5f5f5;
}
.quick-date-chip.active {
    background: #2F5496;
    border-color: #2F5496;
    color: #fff;
    font-weight: 600;
}

.active-filter-count {
    background: #2F5496;
    color: white;
    border-radius: 10px;
    padding: 1px 6px;
    font-size: 11px;
    font-weight: 600;
}

/* Toolbar Row */
.todo-toolbar {
    background: white;
    border-bottom: 1px solid #e8ecf0;
    padding: 10px 40px;
}

.todo-toolbar-inner {
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
    display: flex;
    justify-content: flex-end;
}

.btn-new-todo {
    background: #2F5496;
    color: white;
    border: none;
    padding: 6px 16px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.btn-new-todo:hover {
    background: #1a3a6e;
}

/* Filters Band — full-width wrapper (toggled show/hide by JS) */
.todo-filters-band {
    background: white;
    border-bottom: 1px solid #e8ecf0;
}

/* Filters — centered content */
.todo-filters {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 40px;
}

.filter-group {
    margin-bottom: 16px;
}

.filter-group:last-child {
    margin-bottom: 0;
}

.filter-group label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #888;
    margin-bottom: 8px;
}

.filter-chips,
.date-filters {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.chip {
    padding: 6px 12px;
    border: 1px solid #ddd;
    border-radius: 20px;
    background: white;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
    color: #666;
}

.chip:hover {
    border-color: #999;
    background: #f9f9f9;
}

.chip.active {
    background: #2F5496;
    border-color: #2F5496;
    color: white;
}

.chip.urgent {
    border-color: #f44336;
    color: #f44336;
}

.chip.urgent.active {
    background: #f44336;
    color: white;
}

.chip.high {
    border-color: #ff9800;
    color: #ff9800;
}

.chip.high.active {
    background: #ff9800;
    color: white;
}

.chip.medium {
    border-color: #2F5496;
    color: #2F5496;
}

.chip.medium.active {
    background: #2F5496;
    color: white;
}

.chip.low {
    border-color: #4caf50;
    color: #4caf50;
}

.chip.low.active {
    background: #4caf50;
    color: white;
}

/* Content */
.todo-content {
    flex: 1;
    min-height: 0; /* required for flex child to shrink and overflow-y to work */
    overflow-y: auto;
    padding: 24px 40px;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
    box-sizing: border-box;
}

.todo-table-wrapper {
    background: white;
    border-radius: 10px;
    overflow: clip; /* clip preserves border-radius without creating a scroll container, so <thead> sticky works */
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    border: 1px solid #e8ecf0;
}

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

.todo-table thead {
    background: #f8f9fb;
    border-bottom: 1px solid #e8ecf0;
    position: sticky;
    top: 0;
    z-index: 10;
}

.todo-table th {
    padding: 10px 12px;
    text-align: left;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: #888;
    user-select: none;
}

.todo-table th.sortable {
    cursor: pointer;
    position: relative;
    transition: background 0.2s;
}

.todo-table th.sortable:hover {
    background: #f0f0f0;
}

.sort-indicator {
    display: inline-block;
    margin-left: 3px;
    font-size: 9px;
    color: #999;
}

.sort-indicator::before {
    content: "⇅";
}

.todo-table th.sort-active .sort-indicator::before {
    content: "↑";
}

.todo-table th.sort-active.sort-desc .sort-indicator::before {
    content: "↓";
}

.todo-table tbody tr {
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.2s;
}

.todo-table tbody tr:hover {
    background: #f8f9fb;
}

.todo-table tbody tr.is-overdue td.col-due span {
    color: #dc2626;
    font-weight: 600;
}

.todo-table tbody tr.is-overdue td.col-due span::before {
    content: '⚠ ';
    font-size: 11px;
}

/* Overdue aging — yellow tint after 1 week, red tint after 1 month */
.todo-table tbody tr.is-overdue-week {
    background: #fffbeb;
}
.todo-table tbody tr.is-overdue-week td.col-due span {
    color: #d97706;
    font-weight: 600;
}
.todo-table tbody tr.is-overdue-week td.col-due span::before {
    content: '⚠ ';
    font-size: 11px;
}
.todo-table tbody tr.is-overdue-week:hover { background: #fef3c7; }

.todo-table tbody tr.is-overdue-month {
    background: #fff1f2;
}
.todo-table tbody tr.is-overdue-month td.col-due span {
    color: #dc2626;
    font-weight: 700;
}
.todo-table tbody tr.is-overdue-month td.col-due span::before {
    content: '🔴 ';
    font-size: 11px;
}
.todo-table tbody tr.is-overdue-month:hover { background: #ffe4e6; }

.todo-table tbody tr.is-done {
    opacity: 0.55;
    color: #94a3b8;
}

.todo-table tbody tr.is-done .col-title {
    text-decoration: line-through;
    text-decoration-color: #cbd5e1;
}

.todo-table tbody tr.is-done:hover {
    opacity: 0.8;
}

.todo-table tbody tr.completed-section-header td {
    background: #f0fdf4;
    border-top: 2px solid #bbf7d0;
}

.todo-table td {
    padding: 10px 12px;
    font-size: 12px;
    color: #1a2e4a;
}

.col-check {
    width: 36px;
}

.col-check input {
    cursor: pointer;
}

.col-title {
    width: 30%;
    font-weight: 500;
    color: #1a1a1a;
}

.col-notes {
    width: 30%;
    color: #666;
    font-size: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.source-badge {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 9px;
    font-weight: 600;
    margin-left: 4px;
    color: white;
}

/* ── Recurrence selector buttons in modal ── */
.recur-btn {
    padding: 2px 10px;
    font-size: 11px;
    font-weight: 600;
    border: 1px solid #cbd5e1;
    border-radius: 999px;
    background: #fff;
    color: #475569;
    cursor: pointer;
    letter-spacing: .02em;
}
.recur-btn:hover { border-color: #1a2e4a; color: #1a2e4a; }
.recur-btn.active { background: #1a2e4a; color: #fff; border-color: #1a2e4a; }

/* ── Recurring badge on row title ── */
.recur-badge {
    display: inline-block;
    font-size: 10px;
    margin-left: 5px;
    opacity: 0.7;
    vertical-align: middle;
}

/* ── Context chip — brand + category shown below title in My Execution ── */
.todo-context-line {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-top: 3px;
    flex-wrap: wrap;
}
.todo-brand-chip {
    font-size: 10px;
    font-weight: 600;
    color: #1a2e4a;
    background: #e8eef6;
    padding: 1px 7px;
    border-radius: 10px;
    text-decoration: none;
    white-space: nowrap;
}
.todo-brand-chip:hover { background: #d0daea; }
.todo-cat-chip {
    font-size: 10px;
    color: #64748b;
    background: #f1f5f9;
    padding: 1px 7px;
    border-radius: 10px;
    white-space: nowrap;
}

.col-status {
    width: 6.67%;
}

.col-priority {
    width: 6.67%;
}

.col-due {
    width: 6.67%;
}

.col-task-execution {
    width: 6.67%;
    color: #666;
    font-size: 12px;
}

.col-task-owner {
    width: 6.67%;
    color: #666;
    font-size: 12px;
}

.col-action {
    width: 6.67%;
    text-align: center;
}

/* Group Header — Collapsible Sections */
.group-header {
    background: linear-gradient(to right, #f8f9fb, #f0f3f8);
    border-bottom: 1px solid #d8dfe8;
    border-top: 2px solid #2F5496;
    height: auto;
    cursor: pointer;
    transition: background 0.2s;
}

.group-header:hover {
    background: linear-gradient(to right, #f0f3f8, #e8ecf4);
}

.group-header td {
    padding: 14px 16px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #2F5496;
    display: flex;
    align-items: center;
    gap: 12px;
}

.group-header .collapse-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 4px;
    background: rgba(47, 84, 150, 0.1);
    color: #2F5496;
    font-weight: 700;
    font-size: 14px;
    transition: transform 0.2s, background 0.2s;
    flex-shrink: 0;
}

.group-header.collapsed .collapse-toggle {
    transform: rotate(-90deg);
}

.group-header .group-title {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 10px;
}

.group-header .group-count {
    display: inline-block;
    background: rgba(47, 84, 150, 0.15);
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    color: #2F5496;
}


.group-section.collapsed tbody tr:not(.group-header) {
    display: none;
}

/* Status Badge */
.status-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.status-backlog { background: #e8e8e8; color: #666; }
.status-working-on-it { background: #fff3e0; color: #e65100; }
.status-stuck { background: #ffebee; color: #c62828; }
.status-done { background: #e8f5e9; color: #2e7d32; }

/* Priority Badge */
.priority-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.priority-urgent { background: #ffebee; color: #c62828; }
.priority-high { background: #fff3e0; color: #e65100; }
.priority-medium { background: #e3f2fd; color: #1565c0; }
.priority-low { background: #e8f5e9; color: #2e7d32; }

/* Action Buttons */
.btn-complete {
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    border-radius: 4px;
    transition: all 0.2s;
    font-size: 18px;
}

.btn-complete:hover {
    background: #f0f0f0;
}

.btn-complete.completed {
    color: #4caf50;
}

.btn-complete:not(.completed) {
    color: #ccc;
}

.btn-delete {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 4px;
    font-size: 14px;
    color: #ccc;
    opacity: 0;
    transition: all 0.2s;
}

tr:hover .btn-delete {
    opacity: 1;
    color: #d32f2f;
}

.btn-delete:hover {
    background: #ffebee;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}

.empty-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.empty-state h3 {
    font-size: 18px;
    color: #666;
    margin-bottom: 8px;
}

.empty-state p {
    font-size: 14px;
    color: #aaa;
}

/* Loading State */
.loading-state {
    text-align: center;
    padding: 60px 20px;
}

.spinner {
    display: inline-block;
    width: 32px;
    height: 32px;
    border: 3px solid #e0e0e0;
    border-top: 3px solid #2F5496;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 16px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-state p {
    color: #666;
    font-size: 14px;
}

/* Error State */
.error-state {
    text-align: center;
    padding: 60px 20px;
    color: #d32f2f;
}

.error-state button {
    margin-top: 16px;
    padding: 10px 20px;
    background: #d32f2f;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

.error-state button:hover {
    background: #c62828;
}

/* Status Band — full-width white background stripe */
.todo-status-band {
    background: white;
    border-top: 1px solid #e8ecf0;
    border-bottom: 1px solid #e8ecf0;
    flex-shrink: 0;
}

/* Status Bar — centered content */
.todo-status-bar {
    max-width: 1200px;
    margin: 0 auto;
    padding: 10px 40px;
    font-size: 13px;
    color: #555;
    display: flex;
    align-items: center;
    gap: 24px;
    flex-wrap: wrap;
}

/* Group By toggle bar */
.group-by-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}

.group-by-label {
    font-size: 11px;
    font-weight: 600;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    white-space: nowrap;
}

.group-by-options {
    display: flex;
    gap: 2px;
}

.group-by-btn {
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 500;
    border: 1px solid #e2e8f0;
    background: white;
    color: #64748b;
    cursor: pointer;
    transition: background 0.12s, color 0.12s, border-color 0.12s;
    border-radius: 0;
    line-height: 1.4;
}

.group-by-btn:first-child { border-radius: 4px 0 0 4px; }
.group-by-btn:last-child  { border-radius: 0 4px 4px 0; }
.group-by-btn:only-child  { border-radius: 4px; }

.group-by-btn:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
    color: #334155;
}

.group-by-btn.active {
    background: #1F3864;
    border-color: #1F3864;
    color: white;
    font-weight: 600;
}

#todoStats {
    display: flex;
    gap: 24px;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

.stat-count {
    font-weight: 600;
    color: #1a1a1a;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal.show {
    display: flex;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    cursor: pointer;
}

.modal-content {
    position: relative;
    background: white;
    border-radius: 10px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    width: 90%;
    max-width: 570px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid #e8ecf0;
}

.modal-header {
    padding: 16px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.modal-header h2 {
    font-size: 20px;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #999;
    padding: 4px 8px;
    transition: color 0.2s;
}

.modal-close:hover {
    color: #333;
}

.modal-body {
    padding: 12px;
    overflow-y: auto;
    flex: 1;
}

.modal-field {
    margin-bottom: 6px;
}

/* Inline labels (for Status, Priority, Work Category, Task Execution, Task Owner, Approval Status) */
.inline-label {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #888;
    margin-right: 0;
    width: 90px;
    flex-shrink: 0;
    vertical-align: middle;
}

/* Modal title editing */
.modal-title-edit-btn {
    background: none;
    border: none;
    font-size: 14px;
    cursor: pointer;
    color: #999;
    padding: 2px 6px;
    opacity: 0;
    transition: opacity 0.2s, color 0.2s;
}

.modal-title-edit-btn:hover {
    color: #2F5496;
}

.modal-header:hover .modal-title-edit-btn {
    opacity: 1;
}

.modal-title-edit-input {
    padding: 6px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 18px;
    font-weight: 600;
    font-family: inherit;
    width: auto;
    min-width: 300px;
}

.modal-field:last-child {
    margin-bottom: 0;
}

.modal-field label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #888;
    margin-bottom: 6px;
}

/* 2-column layout for compact fields */
.modal-field.compact-pair {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 8px;
}

.modal-field.compact-pair > * {
    margin-bottom: 0;
}

.modal-input,
.modal-select,
.modal-textarea {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 13px;
    font-family: inherit;
    transition: border-color 0.2s;
}

.modal-input:focus,
.modal-select:focus,
.modal-textarea:focus {
    outline: none;
    border-color: #2F5496;
    box-shadow: 0 0 0 2px rgba(47, 84, 150, 0.1);
}

.modal-textarea {
    resize: vertical;
    min-height: 70px;
}

.modal-textarea.compact {
    min-height: 50px;
}

.modal-metadata {
    background: #f8f9fb;
    padding: 8px 12px;
    border-radius: 4px;
    margin-bottom: 8px;
    font-size: 12px;
    border: 1px solid #e8ecf0;
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.metadata-item {
    display: flex;
    gap: 6px;
    align-items: center;
}

.metadata-item:not(:last-child) {
    border-bottom: none;
}

.metadata-label {
    font-weight: 600;
    color: #666;
}

/* ============ SEGMENTED CONTROLS (Status & Priority) ============ */
.segmented-control {
    display: flex;
    gap: 4px;
    background: #f5f7fa;
    padding: 4px;
    border-radius: 6px;
    border: 1px solid #e0e0e0;
    flex: 1;
}

.seg-btn {
    flex: 1;
    padding: 4px 8px;
    border: 1px solid transparent;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    background: white;
    color: #666;
    text-align: center;
    white-space: nowrap;
}

.seg-btn:hover {
    background: #f0f3f8;
    border-color: #d0d8e8;
}

/* Status Colors (Monday.com) */
.seg-backlog.selected { background: #c4c4c4; color: white; border-color: #b0b0b0; }
.seg-working.selected { background: #ffcb00; color: #1a1a1a; border-color: #ffc000; }
.seg-done.selected { background: #00c875; color: white; border-color: #00b86d; }
.seg-stuck.selected { background: #df2f4a; color: white; border-color: #d01f3a; }

/* Priority Colors (Monday.com) */
.seg-low.selected { background: #00c875; color: white; border-color: #00b86d; }
.seg-medium.selected { background: #cab641; color: white; border-color: #b89f38; }
.seg-high.selected { background: #ffcb00; color: #1a1a1a; border-color: #ffc000; }
.seg-urgent.selected { background: #df2f4a; color: white; border-color: #d01f3a; }

/* Work Category Button Colors */
.seg-btn[data-value="Operations"].selected { background: #579bfc; color: white; border-color: #4a8ef0; }
.seg-btn[data-value="Brand"].selected { background: #784bd1; color: white; border-color: #6a3fc0; }
.seg-btn[data-value="National"].selected { background: #00c875; color: white; border-color: #00b86d; }
.seg-btn[data-value="Direct"].selected { background: #ffcb00; color: #1a1a1a; border-color: #ffc000; }
.seg-btn[data-value="HR"].selected { background: #ff5ac4; color: white; border-color: #ff4ab5; }
.seg-btn[data-value="Other"].selected { background: #9d50dd; color: white; border-color: #8d40cd; }

/* ============ PILL SELECTORS (Work Category & Source) ============ */
.pill-selector {
    position: relative;
}

.pill-display {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: white;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 13px;
    gap: 8px;
}

.pill-display:hover {
    border-color: #999;
    background: #f9f9f9;
}

.pill-display.active {
    border-color: #2F5496;
    background: #f0f3f8;
}

.category-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex: 1;
    min-width: 0;
}

.pill-chevron {
    font-size: 12px;
    color: #999;
    flex-shrink: 0;
    transition: transform 0.2s;
}

.pill-display.active .pill-chevron {
    transform: rotate(180deg);
}

.pill-picker {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #ddd;
    border-top: none;
    border-radius: 0 0 4px 4px;
    margin-top: -1px;
    z-index: 100;
    max-height: 250px;
    overflow-y: auto;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.pill-option {
    display: block;
    width: 100%;
    padding: 12px;
    border: none;
    background: none;
    text-align: left;
    cursor: pointer;
    font-size: 14px;
    color: #333;
    transition: background 0.2s;
    border-bottom: 1px solid #f0f0f0;
}

.pill-option:last-child {
    border-bottom: none;
}

.pill-option:hover {
    background: #f5f5f5;
}

.pill-option.selected {
    background: #e3f2fd;
    color: #2F5496;
    font-weight: 500;
}

/* Category Colors */
.category-operations { color: #579bfc; font-weight: 500; }
.category-brand-management { color: #784bd1; font-weight: 500; }
.category-national-sales { color: #00c875; font-weight: 500; }
.category-national-accounts { color: #ffcb00; font-weight: 500; }
.category-hr { color: #ff5ac4; font-weight: 500; }
.category-pricing { color: #9d50dd; font-weight: 500; }
.category-ai { color: #66ccff; font-weight: 500; }
.category-supplier { color: #bb3354; font-weight: 500; }

/* ============ SOURCE BADGE (Read-Only) ============ */
.source-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 12px;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    background: #f8f9fb;
    font-size: 13px;
    font-weight: 500;
    color: #666;
}

.source-email { color: #579bfc; border-color: #579bfc; background: #f0f5ff; }
.source-granola { color: #784bd1; border-color: #784bd1; background: #faf5ff; }
.source-ai { color: #66ccff; border-color: #66ccff; background: #f0f9ff; }
.source-manual { color: #999; border-color: #ddd; background: #fafafa; }

/* ============ ASSIGNEE CHIPS & SEARCH ============ */
.assignee-chips {
    position: relative;
}

.chips-row {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 6px;
    min-height: 28px;
    align-items: center;
}

.avatar-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    border-radius: 16px;
    background: #2F5496;
    color: white;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
}

.avatar-chip .remove-btn {
    margin-left: 2px;
    cursor: pointer;
    opacity: 0.8;
    transition: opacity 0.2s;
    padding: 0 2px;
}

.avatar-chip .remove-btn:hover {
    opacity: 1;
}

.avatar-chip-initial {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    font-size: 11px;
    font-weight: 600;
    margin-right: 2px;
}

.assignee-search {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 13px;
    font-family: inherit;
    transition: border-color 0.2s;
}

/* Compact chips for side-by-side layout */
.compact-chips .chips-row {
    cursor: pointer;
    padding: 6px 8px;
    border-radius: 4px;
    border: 1px solid #e0e0e0;
    background: white;
    transition: all 0.2s;
    min-height: 28px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
}

.compact-chips .chips-row:hover {
    background: #f8f9fb;
    border-color: #d0d7e0;
}

.compact-chips .chips-row:empty::after {
    content: "Click to add";
    color: #999;
    font-size: 12px;
    font-weight: 400;
}

.assignee-search:focus {
    outline: none;
    border-color: #2F5496;
    box-shadow: 0 0 0 2px rgba(47, 84, 150, 0.1);
}

.metadata-item span:last-child {
    color: #1a1a1a;
}

.assignee-dropdown {
    position: absolute;
    background: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    z-index: 1001;
    max-height: 200px;
    overflow-y: auto;
    width: 100%;
    margin-top: 4px;
}

.assignee-option {
    padding: 12px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.2s;
    font-size: 14px;
}

.assignee-option:last-child {
    border-bottom: none;
}

.assignee-option:hover {
    background: #f5f5f5;
}

.assignee-option.selected {
    background: #e3f2fd;
    color: #2F5496;
    font-weight: 500;
}

.modal-footer {
    padding: 12px 16px;
    border-top: 1px solid #e0e0e0;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    flex-shrink: 0;
}

.btn-primary,
.btn-secondary {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary {
    background: #2F5496;
    color: white;
}

.btn-primary:hover {
    background: #1a3a6e;
}

.btn-primary:active {
    background: #0f2245;
}

.btn-secondary {
    background: #f0f0f0;
    color: #333;
}

.btn-secondary:hover {
    background: #e0e0e0;
}

.btn-secondary:active {
    background: #d0d0d0;
}

.btn-delete {
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid #fca5a5;
    background: #fff5f5;
    color: #dc2626;
    margin-right: auto;
    display: inline-flex;
    align-items: center;
}

.btn-delete:hover {
    background: #fee2e2;
    border-color: #f87171;
}

/* Notes History — Collapsible Section */
.collapsible-section {
    margin-bottom: 8px;
}

.collapsible-toggle {
    background: #f8f9fb;
    border: 1px solid #e0e0e0;
    padding: 10px 12px;
    border-radius: 4px;
    width: 100%;
    text-align: left;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    color: #2F5496;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
    user-select: none;
}

.collapsible-toggle:hover {
    background: #f0f2f8;
    border-color: #d0d8e8;
}

.collapsible-chevron {
    display: inline-block;
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    transition: transform 0.2s;
    transform: rotate(0deg);
}

.collapsible-toggle.expanded .collapsible-chevron {
    transform: rotate(90deg);
}

.collapsible-content {
    display: none;
    background: #fafafa;
    border: 1px solid #e0e0e0;
    border-top: none;
    border-radius: 0 0 4px 4px;
    padding: 12px 14px;
    margin-top: -4px;
}

.collapsible-toggle.expanded + .collapsible-content {
    display: block;
}

/* Notes History */
.notes-history-toggle {
    background: #f8f9fb;
    border: 1px solid #e0e0e0;
    padding: 10px 12px;
    border-radius: 4px;
    width: 100%;
    text-align: left;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    color: #2F5496;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
    user-select: none;
}

.notes-history-toggle:hover {
    background: #f0f2f8;
    border-color: #d0d8e8;
}

.notes-chevron {
    display: inline-block;
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    transition: transform 0.2s;
    transform: rotate(0deg);
}

.notes-history-toggle.expanded .notes-chevron {
    transform: rotate(90deg);
}

.notes-history-content {
    background: #fafafa;
    border: 1px solid #e0e0e0;
    border-top: none;
    border-radius: 0 0 4px 4px;
    padding: 8px 10px;
    margin-top: -4px;
    max-height: 250px;
    overflow-y: auto;
}

.notes-history-item {
    padding: 12px;
    border-bottom: 1px solid #e0e0e0;
    font-size: 13px;
    line-height: 1.5;
}

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

.notes-history-date {
    font-weight: 600;
    color: #1a1a1a;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.notes-history-source {
    display: inline-block;
    padding: 2px 6px;
    background: #e3f2fd;
    color: #1976d2;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 500;
    margin-left: 6px;
}

.notes-history-text {
    color: #333;
    margin-top: 6px;
}

/* Notes Character Count */
#notesCharCount {
    font-weight: 600;
    color: #2F5496;
}

/* Inline Field Helper Text */
.field-helper {
    font-size: 11px;
    color: #999;
    font-style: italic;
    margin-top: 4px;
    line-height: 1.4;
}

/* Section Helper Text */
.section-helper {
    font-size: 11px;
    color: #999;
    font-style: italic;
    margin-top: 4px;
    padding: 4px 12px;
    display: block;
}

/* How It Works Link */
.how-it-works-link {
    background: none;
    border: none;
    color: #2F5496;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    padding: 6px 12px;
    transition: all 0.2s;
    text-decoration: none;
}

.how-it-works-link:hover {
    color: #1a3a6e;
    text-decoration: underline;
}

/* Inline Dropdown Popovers */
.inline-dropdown {
    position: absolute;
    background: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
    z-index: 1001;
    min-width: 180px;
    max-height: 200px;
    overflow-y: auto;
}

.inline-dropdown-item {
    padding: 10px 12px;
    cursor: pointer;
    font-size: 13px;
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.15s;
}

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

.inline-dropdown-item:hover {
    background: #f5f5f5;
}

.inline-dropdown-item.selected {
    background: #e3f2fd;
    color: #2F5496;
    font-weight: 500;
}

.badge-clickable {
    cursor: pointer !important;
    opacity: 0.9;
    transition: opacity 0.2s;
}

.badge-clickable:hover {
    opacity: 1;
}

.date-clickable,
.assignee-clickable,
.notes-clickable {
    cursor: pointer !important;
    padding: 2px 6px;
    border-radius: 3px;
    transition: background 0.2s;
}

.date-clickable:hover,
.assignee-clickable:hover,
.notes-clickable:hover {
    background: #f0f0f0;
}

.notes-editor {
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    background: white;
    border-radius: 4px;
}

/* Approval Queue Styles */
.approval-queue-row {
    background: #fafbfc;
    border-left: 4px solid #ffcb00;
}

.approval-queue-row:hover {
    background: #f0f2f5;
}

.btn-approve {
    background: #00c875;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    transition: background 0.2s;
    margin-right: 4px;
}

.btn-approve:hover {
    background: #00a862;
}

.btn-changes {
    background: #df2f4a;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    transition: background 0.2s;
}

.btn-changes:hover {
    background: #c41a35;
}

.btn-sm {
    padding: 4px 8px;
    font-size: 11px;
}

/* Responsive */
@media (max-width: 768px) {
    .todo-header {
        padding: 16px;
    }

    .todo-title-section {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .todo-header h1 {
        font-size: 24px;
    }

    .todo-filters {
        padding: 16px;
    }

    .todo-content {
        padding: 16px;
    }

    .todo-table th,
    .todo-table td {
        padding: 12px 8px;
        font-size: 12px;
    }

    .col-title { width: 45%; }
    .col-status { width: 15%; }
    .col-priority { display: none; }
    .col-due { width: 20%; }
    .col-assigned { display: none; }
    .col-action { width: 20%; }

    .todo-status-bar {
        padding: 12px 16px;
        font-size: 12px;
    }

    #todoStats {
        gap: 12px;
    }
}

/* ============ NOTES — TAGGED BLOCKS ============ */
.notes-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.notes-edit-raw-btn {
    background: none;
    border: none;
    font-size: 11px;
    color: #aaa;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 3px;
    transition: color 0.2s, background 0.2s;
}
.notes-edit-raw-btn:hover { color: #2F5496; background: #f0f4ff; }
.notes-edit-raw-btn.active { color: #2F5496; background: #e8eeff; }

.notes-rendered {
    border: 1px solid #e8ecf0;
    border-radius: 6px;
    padding: 8px;
    background: #fafbfc;
    min-height: 60px;
    margin-bottom: 8px;
    font-size: 13px;
    line-height: 1.5;
}

.note-block {
    padding: 8px 10px;
    margin-bottom: 6px;
    border-radius: 4px;
    background: #fff;
    border: 1px solid #eef0f3;
}
.note-block:last-child { margin-bottom: 0; }

.note-block-header {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 4px;
}

.note-badge {
    display: inline-block;
    font-size: 10px;
    font-weight: 700;
    padding: 1px 5px;
    border-radius: 3px;
    letter-spacing: 0.3px;
    text-transform: uppercase;
}
.badge-email    { background: #e8f0fe; color: #1a56db; }
.badge-granola  { background: #f3e8ff; color: #6d28d9; }
.badge-monday   { background: #fff3e0; color: #b45309; }
.badge-ai       { background: #e0f7fa; color: #0277bd; }
.badge-human    { background: #f0fdf4; color: #15803d; }

.note-date {
    font-size: 11px;
    color: #999;
}

.note-text {
    font-size: 13px;
    color: #333;
    white-space: pre-wrap;
    word-break: break-word;
}

.note-block-empty {
    color: #bbb;
    font-style: italic;
    font-size: 13px;
    padding: 8px 4px;
}

/* ============ ADD NOTE SECTION ============ */
.add-note-section {
    display: flex;
    gap: 8px;
    align-items: flex-start;
    margin-top: 8px;
    margin-bottom: 4px;
}

.add-note-section textarea {
    flex: 1;
    min-height: 56px;
    resize: vertical;
}

.btn-add-note {
    padding: 8px 14px;
    background: #2F5496;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    align-self: flex-start;
    margin-top: 0;
    transition: background 0.2s;
}
.btn-add-note:hover { background: #1e3a6e; }

/* ============ DOC LINK PILLS ============ */
.doc-links-rendered {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 6px 0 4px;
    min-height: 28px;
}

.doc-link-pill {
    display: inline-block;
    padding: 4px 10px;
    background: #f0f4ff;
    color: #2F5496;
    border: 1px solid #c5d3f0;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    text-decoration: none;
    transition: background 0.15s, border-color 0.15s;
    white-space: nowrap;
}
.doc-link-pill:hover {
    background: #dce6ff;
    border-color: #2F5496;
}

/* ============ SEARCH BAR ============ */
.todo-search-wrap {
    flex: 0 1 360px;   /* was flex:1 — cap at 360px so the toolbar has room for action buttons */
    position: relative;
    display: flex;
    align-items: center;
}

.todo-search-icon {
    position: absolute;
    left: 10px;
    font-size: 16px;
    color: #aaa;
    pointer-events: none;
    line-height: 1;
}

.todo-search-input {
    width: 100%;
    padding: 6px 32px 6px 32px;
    border: 1px solid #d0d7e0;
    border-radius: 6px;
    font-size: 13px;
    font-family: inherit;
    color: #333;
    background: #fafbfc;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}
.todo-search-input:focus {
    border-color: #2F5496;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(47, 84, 150, 0.1);
}
.todo-search-input::placeholder { color: #bbb; }

/* Hide the browser's native clear button — we have our own */
.todo-search-input::-webkit-search-cancel-button { display: none; }

.todo-search-clear {
    position: absolute;
    right: 8px;
    background: none;
    border: none;
    font-size: 13px;
    color: #aaa;
    cursor: pointer;
    padding: 2px 4px;
    line-height: 1;
    transition: color 0.15s;
}
.todo-search-clear:hover { color: #555; }

/* Search result highlight */
mark.search-hl {
    background: #fff3b0;
    color: inherit;
    border-radius: 2px;
    padding: 0 1px;
}

/* ─────────────────────────────────────────────────────────────
   Duplicates sub-tab
   ───────────────────────────────────────────────────────────── */

.dup-count-badge {
    display: inline-block;
    margin-left: 6px;
    background: #fef3c7;
    color: #92400e;
    font-size: 11px;
    font-weight: 700;
    padding: 1px 7px;
    border-radius: 999px;
    letter-spacing: 0.3px;
    vertical-align: middle;
}
.hub-nav-tab.active .dup-count-badge {
    background: rgba(255,255,255,0.25);
    color: #fff;
}

.dup-refresh-btn {
    background: #2F5496;
    color: #fff;
    border: none;
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}
.dup-refresh-btn:hover { background: #1a3a6e; }

.dup-group {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    margin-bottom: 14px;
    overflow: hidden;
}
.dup-group-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: #fef9c3;
    border-bottom: 1px solid #fde68a;
    gap: 14px;
}
.dup-group-count {
    display: inline-block;
    background: #92400e;
    color: #fff;
    font-weight: 700;
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 999px;
    margin-right: 10px;
    letter-spacing: 0.3px;
}
.dup-group-title {
    color: #1a2e4a;
    font-weight: 600;
    font-size: 13.5px;
}
.dup-merge-btn {
    background: #2F5496;
    color: #fff;
    border: none;
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
}
.dup-merge-btn:hover { background: #1a3a6e; }

/* Layer 3 fuzzy-confidence badge */
.dup-conf-badge {
    display: inline-block;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.4px;
    padding: 2px 7px;
    border-radius: 4px;
    margin-right: 8px;
    vertical-align: middle;
}
.dup-conf-exact { background: #1f3864; color: #fff; }
.dup-conf-fuzzy { background: #b45309; color: #fff; }
.dup-group-fuzzy .dup-group-header {
    background: #fff7ed;
    border-bottom-color: #fed7aa;
}
.dup-group-fuzzy .dup-group-count {
    background: #b45309;
}

.dup-group-body { overflow-x: auto; }
.dup-group-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12.5px;
}
.dup-group-table thead { background: #f8fafc; }
.dup-group-table th {
    text-align: left;
    padding: 8px 10px;
    font-size: 10px;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    font-weight: 600;
    border-bottom: 1px solid #e2e8f0;
    white-space: nowrap;
}
.dup-group-table td {
    padding: 8px 10px;
    border-bottom: 1px solid #f1f5f9;
    color: #1a2e4a;
}
.dup-group-table tr:hover td { background: #f8fafc; }
.dup-group-table input[type="radio"],
.dup-group-table input[type="checkbox"] { cursor: pointer; }
.dup-group-table a {
    color: #2F5496;
    text-decoration: none;
    border-bottom: 1px dotted #cbd5e1;
}
.dup-group-table a:hover {
    color: #1a3a6e;
    border-bottom-color: #2F5496;
}

/* ── How-to-use help popover ─────────────────────────────────────────── */
.todo-help-wrap {
    position: relative;
    display: flex;
    align-items: center;
}
.todo-help-btn {
    background: none;
    border: none;
    font-size: 16px;
    color: #94a3b8;
    cursor: pointer;
    padding: 2px 4px;
    line-height: 1;
    transition: color 0.15s;
}
.todo-help-btn:hover { color: #2F5496; }
/* (old .todo-help-popover replaced by #helpModal) */

/* ── Manager Overview Card ─────────────────────────────── */
.manager-summary-band {
    background: white;
    border-bottom: 1px solid #e2e8f0;
    flex-shrink: 0;
}
.manager-summary-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 10px 40px;
    display: flex;
    align-items: center;
    gap: 0;
}
.mgr-kpi {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 0 20px 0 0;
    margin-right: 20px;
    border-right: 1px solid #e2e8f0;
    cursor: pointer;
    background: none;
    border-top: none;
    border-bottom: none;
    border-left: none;
    font-family: inherit;
    transition: opacity 0.12s;
}
.mgr-kpi:last-child { border-right: none; padding-right: 0; margin-right: 0; }
.mgr-kpi:hover { opacity: 0.75; }
.mgr-num {
    font-size: 22px;
    font-weight: 700;
    color: #1a2e4a;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}
.mgr-kpi-danger .mgr-num { color: #dc2626; }
.mgr-sublabel {
    font-size: 11px;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    margin-top: 2px;
    white-space: nowrap;
}

/* ── Manager workload row ───────────────────────────────── */
.mgr-workload-row {
    display: flex;
    gap: 8px;
    padding: 8px 24px 10px;
    border-top: 1px solid #f1f5f9;
    flex-wrap: wrap;
    max-width: 1200px;
    margin: 0 auto;
}
.mgr-person-chip {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    background: #f8fafc;
    cursor: pointer;
    font-size: 12px;
    color: #374151;
    transition: background 0.1s;
}
.mgr-person-chip:hover { background: #e0e7ff; border-color: #a5b4fc; }
.mgr-person-chip.mgr-person-overdue { border-color: #fca5a5; background: #fff5f5; }
.mgr-person-chip.mgr-person-overdue:hover { background: #fee2e2; }
.mgr-person-name { font-weight: 600; }
.mgr-person-active { color: #6366f1; font-weight: 700; }
.mgr-person-od-badge {
    background: #fee2e2;
    color: #dc2626;
    font-size: 10px;
    font-weight: 700;
    padding: 1px 5px;
    border-radius: 8px;
}

/* ── Snooze ─────────────────────────────────────────────── */
.snooze-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 12px;
    opacity: 0.35;
    padding: 1px 3px;
    border-radius: 3px;
    transition: opacity 0.15s;
    vertical-align: middle;
    margin-left: 3px;
    line-height: 1;
}
tr:hover .snooze-btn { opacity: 0.7; }
.snooze-btn:hover { opacity: 1 !important; background: #f1f5f9; }
.snooze-popover {
    position: fixed;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0,0,0,.12);
    padding: 6px;
    z-index: 3000;
    min-width: 130px;
}
.snooze-title {
    font-size: 10.5px;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    padding: 2px 6px 5px;
    border-bottom: 1px solid #f1f5f9;
    margin-bottom: 3px;
}
.snooze-option {
    display: block;
    width: 100%;
    text-align: left;
    background: none;
    border: none;
    padding: 5px 8px;
    font-size: 12.5px;
    color: #1a2e4a;
    cursor: pointer;
    border-radius: 4px;
    transition: background 0.1s;
    font-family: inherit;
}
.snooze-option:hover { background: #f1f5f9; }
.snooze-clear { color: #94a3b8; }
.snooze-badge {
    display: inline-block;
    font-size: 10px;
    background: #f1f5f9;
    color: #64748b;
    border-radius: 3px;
    padding: 1px 4px;
    margin-left: 5px;
    vertical-align: middle;
}
.is-snoozed td { opacity: 0.6; }
.snoozed-count-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    padding: 2px 7px;
    font-size: 11.5px;
    color: #475569;
    cursor: pointer;
    transition: background 0.12s;
    margin-left: 6px;
}
.snoozed-count-chip:hover { background: #e2e8f0; }
.snoozed-count-chip.active { background: #dbeafe; border-color: #93c5fd; color: #1d4ed8; font-weight: 600; }

/* @mention autocomplete dropdown */
.mention-item {
    padding: 6px 10px;
    font-size: 13px;
    color: #1a2e4a;
    cursor: pointer;
    border-radius: 4px;
    white-space: nowrap;
}
.mention-item:hover, .mention-selected {
    background: #eff6ff;
    color: #2F5496;
    font-weight: 500;
}

/* ── Help / User Guide Modal ─────────────────────────────── */
.help-modal-content {
    max-width: 820px;
    width: 92%;
    max-height: 88vh;
}
.help-modal-header {
    background: linear-gradient(135deg, #2F5496 0%, #1a3a6e 100%);
    border-bottom: none;
    padding: 20px 24px;
}
.help-modal-header h2 {
    color: #fff;
    font-size: 18px;
    font-weight: 700;
}
.help-modal-header .modal-close {
    color: rgba(255,255,255,0.7);
    font-size: 28px;
    line-height: 1;
}
.help-modal-header .modal-close:hover { color: #fff; }
.help-subtitle {
    color: rgba(255,255,255,0.72);
    font-size: 12.5px;
    margin-top: 3px;
}
.help-modal-body {
    padding: 20px 24px 28px;
    background: #f8fafc;
}

/* Table of contents — sticky so nav stays visible while scrolling */
.help-toc {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 16px;
    padding: 12px 14px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    position: sticky;
    top: 0;
    z-index: 10;
    border-top: none;
    border-left: none;
    border-right: none;
    border-radius: 0;
    margin-left: -24px;
    margin-right: -24px;
    padding-left: 24px;
    padding-right: 24px;
    border-bottom: 1px solid #e2e8f0;
    margin-bottom: 20px;
}
.help-toc a {
    font-size: 12px;
    color: #2F5496;
    text-decoration: none;
    padding: 3px 8px;
    border-radius: 4px;
    border: 1px solid #bfdbfe;
    background: #eff6ff;
    white-space: nowrap;
    transition: background 0.12s;
}
.help-toc a:hover { background: #dbeafe; }

/* Sections */
.help-section {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 18px 20px;
    margin-bottom: 14px;
    scroll-margin-top: 12px;
}
.help-section-title {
    font-size: 14px;
    font-weight: 700;
    color: #1a2e4a;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 2px solid #2F5496;
    display: inline-block;
}
.help-section p {
    font-size: 13.5px;
    color: #374151;
    line-height: 1.6;
    margin-bottom: 8px;
}
.help-section p:last-child { margin-bottom: 0; }

/* Tables */
.help-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    margin: 8px 0;
}
.help-table th {
    background: #f1f5f9;
    color: #475569;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.5px;
    padding: 7px 10px;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
}
.help-table td {
    padding: 8px 10px;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: top;
    color: #374151;
    line-height: 1.5;
}
.help-table tr:last-child td { border-bottom: none; }
.help-table td:first-child { width: 170px; white-space: nowrap; }
.help-table code {
    font-family: "SFMono-Regular", Consolas, monospace;
    font-size: 12px;
    background: #f1f5f9;
    padding: 1px 5px;
    border-radius: 3px;
    color: #1a2e4a;
}

/* Lists */
.help-ul, .help-ol {
    font-size: 13.5px;
    color: #374151;
    line-height: 1.6;
    padding-left: 20px;
    margin: 6px 0 8px;
}
.help-ul li, .help-ol li { margin-bottom: 4px; }

/* Callout box */
.help-callout {
    background: #eff6ff;
    border-left: 3px solid #2F5496;
    border-radius: 0 6px 6px 0;
    padding: 10px 14px;
    font-size: 13px;
    color: #1e3a5f;
    line-height: 1.6;
    margin: 8px 0;
}
.help-callout code {
    font-family: "SFMono-Regular", Consolas, monospace;
    font-size: 12px;
    background: #dbeafe;
    padding: 1px 5px;
    border-radius: 3px;
}

/* Role pills */
.help-callout-row { display: flex; align-items: flex-start; gap: 10px; font-size: 13px; }
.help-pill {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 9px;
    border-radius: 20px;
    white-space: nowrap;
    flex-shrink: 0;
    margin-top: 1px;
}
.help-pill-blue  { background: #dbeafe; color: #1d4ed8; }
.help-pill-navy  { background: #1a2e4a; color: #fff; }

/* Status/priority chips */
.help-chip {
    display: inline-block;
    font-size: 11.5px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 4px;
    white-space: nowrap;
}

/* Manager KPI demo */
.help-kpi-demo {
    font-size: 22px;
    font-weight: 700;
    color: #1a2e4a;
    font-variant-numeric: tabular-nums;
}
.help-kpi-red { color: #dc2626; }
.help-kpi-label {
    font-size: 11px;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    margin-left: 3px;
}

/* ── Bulk selection (item 1) ─────────────────────────────────────────────── */
.col-select {
    display: none !important;
}
.todo-select-check {
    width: 15px;
    height: 15px;
    cursor: pointer;
    accent-color: #2F5496;
}
tr.is-selected td { background: #eff6ff !important; }
tr.is-selected:hover td { background: #dbeafe !important; }
#selectAllCheck {
    width: 15px;
    height: 15px;
    cursor: pointer;
    accent-color: #2F5496;
}

/* Floating bulk action bar */
#bulkActionBar {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    background: #1a2e4a;
    color: #fff;
    border-radius: 10px;
    padding: 10px 18px;
    display: none;
    align-items: center;
    gap: 10px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.28);
    z-index: 2000;
    white-space: nowrap;
    font-size: 13px;
}
#bulkActionBar.visible { display: flex; }
.bulk-count-badge {
    background: #2F5496;
    color: #fff;
    border-radius: 20px;
    padding: 2px 10px;
    font-size: 12px;
    font-weight: 700;
    margin-right: 4px;
}
.bulk-divider { width: 1px; height: 22px; background: rgba(255,255,255,0.2); margin: 0 2px; }
.bulk-btn {
    background: rgba(255,255,255,0.12);
    border: 1px solid rgba(255,255,255,0.18);
    color: #fff;
    border-radius: 6px;
    padding: 5px 12px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s;
}
.bulk-btn:hover { background: rgba(255,255,255,0.22); }
.bulk-btn.bulk-btn-danger { background: rgba(220,38,38,0.5); border-color: rgba(220,38,38,0.6); }
.bulk-btn.bulk-btn-danger:hover { background: rgba(220,38,38,0.7); }
.bulk-cancel-btn {
    background: none;
    border: none;
    color: rgba(255,255,255,0.6);
    cursor: pointer;
    font-size: 16px;
    padding: 0 4px;
    line-height: 1;
}
.bulk-cancel-btn:hover { color: #fff; }

/* Bulk sub-menus (assign / status dropdowns) */
.bulk-dropdown-wrapper { position: relative; display: inline-block; }
.bulk-dropdown {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 0;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 7px;
    box-shadow: 0 8px 24px rgba(0,0,0,.12);
    min-width: 160px;
    padding: 4px;
    z-index: 2001;
    display: none;
}
.bulk-dropdown.open { display: block; }
.bulk-dropdown-item {
    padding: 7px 12px;
    font-size: 12px;
    color: #1a2e4a;
    border-radius: 4px;
    cursor: pointer;
    white-space: nowrap;
}
.bulk-dropdown-item:hover { background: #f0f4ff; }

/* ── New TO DO button ────────────────────────────────────────────────────── */
.btn-new-todo {
    background: #2F5496;
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 7px 14px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: background 0.15s;
}
.btn-new-todo:hover { background: #1a3a78; }

/* ── Original Email section ──────────────────────────────────────────────── */
.original-email-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    flex-wrap: wrap;
}
.original-email-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}
.original-email-content {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 12px 14px;
    margin-top: 8px;
    font-size: 12px;
    line-height: 1.6;
    color: #374151;
    white-space: pre-wrap;
    word-break: break-word;
    max-height: 280px;
    overflow-y: auto;
}
.outlook-link-btn {
    font-size: 12px;
    color: #2F5496;
    text-decoration: underline;
    white-space: nowrap;
    cursor: pointer;
}
.extract-leads-btn {
    font-size: 12px;
    font-weight: 600;
    color: #fff;
    background: #059669;
    border: none;
    border-radius: 5px;
    padding: 4px 10px;
    cursor: pointer;
    transition: background 0.15s, opacity 0.15s;
    white-space: nowrap;
}
.extract-leads-btn:hover { background: #047857; }
.extract-leads-btn:disabled { opacity: 0.6; cursor: default; }
