:root {
    /* Enterprise Light Theme Colors (Synced with replica.css) */
    --bg-main: #f8fafc;
    --bg-sidebar: #ffffff;
    --bg-card: #ffffff;
    --bg-surface: #ffffff;
    --bg-slate: #f1f5f9;
    --bg-dark: #f1f5f9;

    --text-primary: #0f172a;
    --text-secondary: #64748b;
    --text-tertiary: #94a3b8;
    --text-muted: #94a3b8;
    
    --brand-primary: #3cb4e5;
    --brand-hover: #34a2ce;
    --brand-light: #e0f2fe;
    --accent-primary: var(--brand-primary);
    --accent-hover: var(--brand-hover);
    --accent-active: var(--brand-hover);
    --accent-primary-rgb: 60, 180, 229;
    --accent-rgb: var(--accent-primary-rgb);
    --accent: var(--accent-primary);
    
    --border-light: #e2e8f0;
    --border-hover: #cbd5e1;
    --border-accent: #94a3b8;
    
    --status-success: #10b981;
    --status-error: #ef4444;
    --status-warning: #f59e0b;
    --success: var(--status-success);
    --danger: var(--status-error);
    --warning: var(--status-warning);

    --font-sans: "HarmonyOS Sans SC", "HarmonyOS Sans", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --font-heading: var(--font-sans);
    --font-body: var(--font-sans);

    /* Spacing & Radius */
    --radius-lg: 12px;
    --radius-md: 8px;
    --radius-sm: 6px;

    --sidebar-width: 260px;
    --sidebar-width-collapsed: 68px;
    --topbar-height: 64px;
    /* Match FAST (Flask) chrome */
    --topbar-bg: #38b4e5;
    --topbar-accent: #2ca3d4;
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
}

/* ── Projects Table Layout ────────────────────────────── */

/* Page Header */
.projects-page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding: 0;
}

/* Controls */
.projects-controls {
    margin-bottom: 1rem;
    padding: 0;
}

.controls-row {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 1rem;
    padding: 0.75rem 1rem;
    background: rgba(var(--bg-surface-rgb, 248, 250, 252), 0.5);
    border: 1px solid rgba(var(--border-light-rgb, 148, 163, 184), 0.4);
    border-radius: var(--radius-sm);
}

.control-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.search-group {
    margin-left: auto; /* Push search to far right */
    flex-shrink: 0;
}

.search-input {
    width: 250px;
    padding: 0.5rem 0.75rem;
    border: 1px solid rgba(var(--border-light-rgb, 226, 232, 240), 0.8);
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    color: var(--text-primary);
    font-size: 0.85rem;
    transition: all 0.15s ease;
    height: 36px;
    box-sizing: border-box;
}

.search-input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 2px rgba(60, 180, 229, 0.1);
}

/* Custom Status Dropdown */
.custom-dropdown {
    position: relative;
    display: flex;
    align-items: center;
}

.status-input {
    width: 200px;
    padding: 0.5rem 2rem 0.5rem 0.75rem;
    border: 1px solid rgba(var(--border-light-rgb, 226, 232, 240), 0.8);
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    color: var(--text-primary);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.15s ease;
    height: 36px;
    box-sizing: border-box;
}

.status-input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 2px rgba(60, 180, 229, 0.1);
}

.dropdown-arrow {
    position: absolute;
    right: 0.75rem;
    pointer-events: none;
    color: var(--text-secondary);
    font-size: 0.7rem;
    transition: transform 0.15s ease;
}

.status-dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 0.25rem;
    width: 100%;
    min-width: 200px;
    background: var(--bg-card);
    border: 1px solid rgba(var(--border-light-rgb, 226, 232, 240), 0.8);
    border-radius: var(--radius-sm);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    display: none;
    overflow: hidden;
}

.status-option {
    padding: 0.5rem 0.75rem;
    cursor: pointer;
    transition: background-color 0.15s ease;
    color: var(--text-primary);
    font-size: 0.85rem;
}

.status-option:hover {
    background: rgba(var(--bg-surface-rgb, 248, 250, 252), 0.8);
}

.status-option.selected {
    background: var(--accent-primary);
    color: white;
}

/* Date Picker */
.date-picker-group {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.date-range-input {
    width: 200px;
    padding: 0.5rem 0.75rem;
    border: 1px solid rgba(var(--border-light-rgb, 226, 232, 240), 0.8);
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    color: var(--text-primary);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.15s ease;
    height: 36px;
    box-sizing: border-box;
}

.date-range-input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 2px rgba(60, 180, 229, 0.1);
}

.date-picker-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 0.25rem;
    width: 280px;
    max-width: 300px;
    background: var(--bg-card);
    border: 1px solid rgba(var(--border-light-rgb, 226, 232, 240), 0.8);
    border-radius: var(--radius-sm);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    display: none;
    overflow: hidden;
}

.date-picker-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem;
    border-bottom: 1px solid rgba(var(--border-light-rgb, 226, 232, 240), 0.4);
    background: rgba(var(--bg-surface-rgb, 248, 250, 252), 0.5);
}

.date-picker-nav {
    background: transparent;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    font-size: 1rem;
    transition: background-color 0.15s ease;
}

.date-picker-nav:hover {
    background: rgba(var(--bg-slate-rgb, 241, 245, 249), 0.8);
}

.date-picker-month {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
}

.date-picker-grid {
    padding: 0.5rem;
}

.date-picker-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0.25rem;
    margin-bottom: 0.5rem;
}

.date-picker-weekdays > div {
    text-align: center;
    font-size: 0.65rem;
    font-weight: 600;
    color: var(--text-secondary);
    padding: 0.25rem;
}

.date-picker-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0.25rem;
}

.date-picker-day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.15s ease;
    color: var(--text-primary);
    min-height: 28px;
}

.date-picker-day:hover:not(.empty) {
    background: rgba(var(--bg-surface-rgb, 248, 250, 252), 0.8);
}

.date-picker-day.empty {
    cursor: default;
}

.date-picker-day.today {
    font-weight: 600;
    border: 1px solid var(--accent-primary);
}

.date-picker-day.start,
.date-picker-day.end {
    background: var(--accent-primary);
    color: white;
    font-weight: 600;
}

.date-picker-day.in-range {
    background: rgba(var(--accent-primary-rgb, 60, 180, 229), 0.1);
    color: var(--text-primary);
}

.filter-select {
    padding: 0.5rem 0.75rem;
    border: 1px solid rgba(var(--border-light-rgb, 226, 232, 240), 0.8);
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    color: var(--text-primary);
    font-size: 0.85rem;
    min-width: 140px;
    transition: all 0.15s ease;
    height: 36px;
    box-sizing: border-box;
}

.filter-select:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 2px rgba(60, 180, 229, 0.1);
}

.btn-sm {
    padding: 0.5rem 0.75rem;
    font-size: 0.8rem;
    font-weight: 500;
    height: 36px;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Table Container */
.projects-table-container {
    width: 100%;
    margin: 0;
    padding: 0;
}

.projects-table {
    width: 100%;
    background: var(--bg-card);
    border: 1px solid rgba(var(--border-light-rgb, 148, 163, 184), 0.4);
    border-radius: var(--radius-sm);
    /* Remove overflow hidden to allow dropdowns to extend outside */
}

/* Table Header */
.table-header {
    display: grid;
    grid-template-columns: 1fr 120px 120px 60px;
    background: rgba(var(--bg-surface-rgb, 248, 250, 252), 0.7);
    border-bottom: 1px solid rgba(var(--border-light-rgb, 148, 163, 184), 0.4);
}

.header-cell {
    padding: 0.625rem 1rem;
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-right: 1px solid rgba(var(--border-light-rgb, 148, 163, 184), 0.3);
}

.header-cell:last-child {
    border-right: none;
}

.header-project {
    padding-left: 1.5rem;
}

.header-status {
    text-align: center;
}

.header-created {
    text-align: center;
}

.header-actions {
    text-align: center;
}

/* Table Body - No internal scrolling, page handles scrolling */

/* Table Rows */
.table-row {
    display: grid;
    grid-template-columns: 1fr 120px 120px 60px;
    border-bottom: 1px solid rgba(var(--border-light-rgb, 148, 163, 184), 0.3);
    cursor: pointer;
    transition: background-color 0.15s ease;
    /* Needed so .menu-active z-index stacks above following rows (dropdown overlaps next row). */
    position: relative;
}

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

.table-row:hover {
    background: rgba(var(--bg-surface-rgb, 248, 250, 252), 0.5);
}

.table-row.menu-active {
    z-index: 1000;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* Table Cells */
.table-cell {
    padding: 0.625rem 1rem;
    display: flex;
    align-items: center;
    min-height: 40px;
    border-right: 1px solid rgba(var(--border-light-rgb, 148, 163, 184), 0.3);
}

.table-cell:last-child {
    border-right: none;
    justify-content: center;
}

.cell-project {
    padding-left: 1.5rem;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.125rem;
}

.cell-status {
    justify-content: center;
}

.cell-created {
    justify-content: center;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.cell-actions {
    padding-right: 1rem;
}

/* Assigned tasks table — same shell as projects/teams, five columns */
.assigned-tasks-table-wrap {
    width: 100%;
}

.assigned-tasks-table-wrap.assigned-tasks-refreshing {
    opacity: 0.92;
    transition: opacity 0.15s ease;
    pointer-events: none;
}

.assigned-tasks-table .table-header,
.assigned-tasks-table .table-row {
    grid-template-columns: minmax(200px, 1.55fr) minmax(130px, 1fr) minmax(160px, 1.15fr) 118px 52px;
}

.assigned-tasks-table .table-row {
    cursor: default;
}

.assigned-tasks-table .header-cell.header-assignee,
.assigned-tasks-table .header-cell.header-team {
    text-align: left;
}

.assigned-tasks-table .table-cell.cell-assignee,
.assigned-tasks-table .table-cell.cell-team {
    justify-content: flex-start;
    min-width: 0;
}

.assigned-tasks-table .assignee-text,
.assigned-tasks-table .team-dept-text {
    font-size: 0.8rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    line-height: 1.35;
}

.assigned-tasks-table .status-badge.task-badge-todo {
    background: rgba(148, 163, 184, 0.12);
    color: var(--text-secondary);
    border: 1px solid rgba(var(--border-light-rgb, 148, 163, 184), 0.45);
}

.theme-dark .assigned-tasks-table .status-badge.task-badge-todo {
    color: #e2e8f0;
}

.assigned-tasks-table .status-badge.task-badge-in_progress {
    background: rgba(251, 191, 36, 0.18);
    color: #92400e;
    border: 1px solid rgba(234, 179, 8, 0.55);
}

.theme-dark .assigned-tasks-table .status-badge.task-badge-in_progress {
    color: #fef9c3;
    background: rgba(234, 179, 8, 0.2);
    border-color: rgba(250, 204, 21, 0.5);
}

.assigned-tasks-table .status-badge.task-badge-blocked {
    background: rgba(239, 68, 68, 0.1);
    color: #e74c3c;
    border: 1px solid rgba(239, 68, 68, 0.28);
}

.theme-dark .assigned-tasks-table .status-badge.task-badge-blocked {
    color: #fca5a5;
}

.assigned-tasks-table .status-badge.task-badge-done {
    background: rgba(39, 174, 96, 0.1);
    color: #27ae60;
    border: 1px solid rgba(39, 174, 96, 0.28);
}

.theme-dark .assigned-tasks-table .status-badge.task-badge-done {
    color: #86efac;
}

.assigned-tasks-table .status-badge.task-badge-backlog {
    background: rgba(100, 116, 139, 0.14);
    color: #475569;
    border: 1px solid rgba(100, 116, 139, 0.4);
}

.theme-dark .assigned-tasks-table .status-badge.task-badge-backlog {
    color: #cbd5e1;
    border-color: rgba(148, 163, 184, 0.45);
}

.assigned-tasks-table .status-badge.task-badge-needs_redo {
    background: rgba(249, 115, 22, 0.16);
    color: #c2410c;
    border: 1px solid rgba(249, 115, 22, 0.45);
}

.theme-dark .assigned-tasks-table .status-badge.task-badge-needs_redo {
    color: #fdba74;
}

@media (max-width: 768px) {
    .assigned-tasks-table-wrap {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .assigned-tasks-table .table-header,
    .assigned-tasks-table .table-row {
        min-width: 620px;
    }

    .assigned-tasks-table .header-cell,
    .assigned-tasks-table .table-cell {
        padding: 0.5rem 0.65rem;
    }

    .assigned-tasks-table .cell-project {
        padding-left: 0.85rem;
    }
}

/* Project Info */
.project-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    line-height: 1.3;
}

.project-description {
    font-size: 0.75rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    line-height: 1.3;
}

/* Status Badge */
.status-badge {
    display: inline-block;
    padding: 0.2rem 0.5rem;
    border-radius: 10px;
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.025em;
    white-space: nowrap;
    line-height: 1.2;
}

.status-badge.status-active {
    background: rgba(241, 196, 15, 0.1);
    color: #b8860b;
    border: 1px solid rgba(241, 196, 15, 0.2);
}

.status-badge.status-completed {
    background: rgba(39, 174, 96, 0.1);
    color: #27ae60;
    border: 1px solid rgba(39, 174, 96, 0.2);
}

.status-badge.status-dropped {
    background: rgba(231, 76, 60, 0.1);
    color: #e74c3c;
    border: 1px solid rgba(231, 76, 60, 0.2);
}

/* Actions Menu */
.actions-menu {
    position: relative;
}

.actions-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.25rem;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    transition: all 0.15s ease;
    min-width: 32px;
    min-height: 32px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    pointer-events: auto;
}

.actions-btn:hover {
    background: rgba(var(--bg-slate-rgb, 241, 245, 249), 0.8);
    color: var(--text-primary);
}

/* Actions Container */
.actions-container {
    position: relative;
    display: inline-block;
}

.actions-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--bg-card);
    border: 1px solid rgba(var(--border-light-rgb, 226, 232, 240), 0.8);
    border-radius: var(--radius-sm);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    min-width: 150px;
    z-index: 9999; /* Higher z-index to appear above all content */
    display: none;
    overflow: visible; /* Ensure dropdown is fully visible */
}

.actions-dropdown.show {
    display: block;
}

.actions-item {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: none;
    background: transparent;
    color: var(--text-primary);
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.15s ease;
    text-align: left;
    gap: 0.5rem;
}

.actions-item:hover {
    background: rgba(var(--bg-surface-rgb, 248, 250, 252), 0.7);
}

.actions-item.actions-danger {
    color: var(--status-error);
}

.actions-item.actions-danger:hover {
    background: rgba(239, 68, 68, 0.08);
}

/* Teams Section Spacing */
.teams-section-spacing {
    margin-bottom: 1rem;
}

/* Override Teams header margin */
header.flex.justify-between.items-center.mb-2xl {
    margin-bottom: 0.5rem !important;
}

/* Teams Pagination Between Sections */
.teams-pagination-between {
    display: flex;
    justify-content: flex-end;
    margin: 1rem 0;
    padding: 0;
}

/* Pagination Header */
.projects-pagination-header {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 0.5rem;
    padding: 0;
}

/* Pagination */
.pagination-container {
    margin: 0;
    padding: 0;
}

.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
}

.pagination-btn {
    padding: 0.5rem 0.75rem;
    border: 1px solid rgba(var(--border-light-rgb, 148, 163, 184), 0.6);
    background: var(--bg-card);
    color: var(--text-primary);
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: all 0.15s ease;
    min-width: 36px;
}

.pagination-btn:hover:not(.disabled) {
    background: rgba(var(--bg-surface-rgb, 248, 250, 252), 0.7);
    border-color: var(--border-hover);
}

.pagination-btn.active {
    background: var(--accent-primary);
    color: white;
    border-color: var(--accent-primary);
}

.pagination-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pagination-ellipsis {
    padding: 0.5rem 0.25rem;
    color: var(--text-muted);
    font-size: 0.8rem;
}

/* Table States */
.table-loading,
.table-error,
.table-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 1rem;
    text-align: center;
}

.table-loading {
    color: var(--text-muted);
}

.table-error {
    color: var(--status-error);
}

.empty-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    opacity: 0.5;
}

.empty-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.empty-description {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* Dark Theme Overrides */
.theme-dark .controls-row {
    background: rgba(var(--bg-surface-rgb, 30, 41, 59), 0.5);
    border-color: rgba(var(--border-light-rgb, 51, 65, 85), 0.6);
}

.theme-dark .search-input,
.theme-dark .filter-select,
.theme-dark .status-input {
    background: var(--bg-card);
    border-color: rgba(var(--border-light-rgb, 51, 65, 85), 0.8);
    color: var(--text-primary);
}

.theme-dark .status-dropdown-menu {
    background: var(--bg-card);
    border-color: rgba(var(--border-light-rgb, 51, 65, 85), 0.8);
}

.theme-dark .status-option:hover {
    background: rgba(var(--bg-surface-rgb, 30, 41, 59), 0.8);
}

.theme-dark .date-range-input {
    background: var(--bg-card);
    border-color: rgba(var(--border-light-rgb, 51, 65, 85), 0.8);
    color: var(--text-primary);
}

.theme-dark .date-picker-dropdown {
    background: var(--bg-card);
    border-color: rgba(var(--border-light-rgb, 51, 65, 85), 0.8);
}

.theme-dark .date-picker-header {
    background: rgba(var(--bg-surface-rgb, 30, 41, 59), 0.5);
    border-color: rgba(var(--border-light-rgb, 51, 65, 85), 0.4);
}

.theme-dark .date-picker-nav:hover {
    background: rgba(var(--bg-surface-rgb, 30, 41, 59), 0.8);
}

.theme-dark .date-picker-day:hover:not(.empty) {
    background: rgba(var(--bg-surface-rgb, 30, 41, 59), 0.8);
}

.theme-dark .table-header {
    background: rgba(var(--bg-surface-rgb, 30, 41, 59), 0.7);
    border-color: rgba(var(--border-light-rgb, 51, 65, 85), 0.6);
}

.theme-dark .table-row:hover {
    background: rgba(var(--bg-surface-rgb, 30, 41, 59), 0.5);
}

.theme-dark .actions-dropdown {
    background: var(--bg-card);
    border-color: rgba(var(--border-light-rgb, 51, 65, 85), 0.8);
}

.theme-dark .actions-item:hover {
    background: rgba(var(--bg-surface-rgb, 30, 41, 59), 0.7);
}

.theme-dark .pagination-btn {
    background: var(--bg-card);
    border-color: rgba(var(--border-light-rgb, 51, 65, 85), 0.8);
}

.theme-dark .pagination-btn:hover:not(.disabled) {
    background: rgba(var(--bg-surface-rgb, 30, 41, 59), 0.7);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .controls-row {
        flex-wrap: wrap;
        gap: 0.75rem;
    }
    
    .search-group {
        order: 3;
        width: 100%;
        margin-left: 0;
    }
    
    .search-input {
        width: 100%;
    }
    
    .control-group:not(.search-group) {
        order: 1;
    }
    
    .date-picker-group {
        order: 2;
    }
    
    .date-picker-dropdown {
        width: 100%;
        max-width: 300px;
    }
    
    .table-header,
    .table-row {
        grid-template-columns: 1fr 80px 80px 50px;
    }
    
    .header-cell,
    .table-cell {
        padding: 0.5rem 0.75rem;
    }
    
    .cell-project {
        padding-left: 0.75rem;
    }
    
    .cell-actions {
        padding-right: 0.75rem;
    }
}

/* Teams List */
.teams-list {
    display: flex;
    flex-direction: column;
    gap: 0;
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.team-row {
    display: flex;
    align-items: center;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-light);
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    background: var(--bg-card);
}

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

.team-row:hover {
    background: var(--bg-surface);
    border-color: var(--border-hover);
}

.team-row.menu-active {
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.team-info {
    flex: 1;
    min-width: 0;
    margin-right: 1rem;
}

.team-name {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.team-description {
    font-size: 0.85rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 400px;
}

.team-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-right: 1rem;
}

.team-members-count {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.team-created {
    font-size: 0.8rem;
    color: var(--text-muted);
    white-space: nowrap;
}

.team-actions {
    position: relative;
    display: flex;
    align-items: center;
}

.team-menu-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: var(--radius-sm);
    font-size: 1.2rem;
    transition: all 0.2s;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.team-menu-btn:hover {
    background: var(--bg-slate);
    color: var(--text-primary);
}

.team-menu-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    min-width: 180px;
    z-index: 1000;
    display: none;
    overflow: hidden;
}

.team-menu-dropdown.show {
    display: block;
}

.team-menu-item {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 0.75rem 1rem;
    border: none;
    background: transparent;
    color: var(--text-primary);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
    text-align: left;
}

.team-menu-item:hover {
    background: var(--bg-surface);
}

.team-menu-item.text-danger {
    color: var(--status-error);
}

.team-menu-item.text-danger:hover {
    background: rgba(239, 68, 68, 0.1);
}

/* Toolbar Styles */
.projects-toolbar,
.teams-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 0;
    border-bottom: 1px solid var(--border-light);
    margin-bottom: 1rem;
}

.sort-controls,
.filter-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sort-select,
.filter-select {
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    color: var(--text-primary);
    font-size: 0.85rem;
    cursor: pointer;
    transition: border-color 0.2s;
}

.sort-select:hover,
.filter-select:hover {
    border-color: var(--border-hover);
}

.sort-select:focus,
.filter-select:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 2px rgba(60, 180, 229, 0.1);
}

/* Dark Theme Overrides */
.theme-dark .projects-list,
.theme-dark .teams-list {
    background: var(--bg-surface);
    border-color: var(--border-light);
}

.theme-dark .project-row,
.theme-dark .team-row {
    background: var(--bg-surface);
    border-color: var(--border-light);
}

.theme-dark .project-row:hover,
.theme-dark .team-row:hover {
    background: var(--bg-card);
}

.theme-dark .project-menu-dropdown,
.theme-dark .team-menu-dropdown {
    background: var(--bg-card);
    border-color: var(--border-light);
}

.theme-dark .project-menu-item:hover,
.theme-dark .team-menu-item:hover {
    background: var(--bg-surface);
}

.theme-dark .sort-select,
.theme-dark .filter-select {
    background: var(--bg-surface);
    border-color: var(--border-light);
    color: var(--text-primary);
}

/* ── Status Picker Dropdown ────────────────────────────── */
.status-picker-dropdown {
    position: fixed;
    z-index: 10000;
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.4);
    padding: 0.5rem;
    min-width: 170px;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    backdrop-filter: blur(10px);
    animation: slideDownFade 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slideDownFade {
    from { opacity: 0; transform: translateY(-10px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.status-picker-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    transition: all 0.2s;
}

.status-picker-item:hover {
    background: var(--bg-surface);
    padding-left: 1.1rem;
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
    box-sizing: border-box;
}

/* Task status legend: To Do = solid blue; In Progress = solid yellow */
.status-dot.status-todo { background: #38bdf8; border: 2px solid transparent; }
.status-dot.status-in_progress {
    background: #fbbf24;
    border: 2px solid rgba(202, 138, 4, 0.65);
    box-shadow: none;
}
.status-dot.status-backlog { background: #94a3b8; border: 2px solid transparent; }
.status-dot.status-blocked { background: #f87171; border: 2px solid transparent; }
.status-dot.status-needs_redo {
    background: #fb923c;
    border: 2px solid rgba(194, 65, 12, 0.55);
}

.status-dot.status-needs_redo.status-dot--redo-icon {
    width: 14px;
    height: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(251, 146, 60, 0.22);
    border: 1px solid rgba(194, 65, 12, 0.45);
    color: #c2410c;
}

.status-dot.status-needs_redo.status-dot--redo-icon svg {
    display: block;
}

html.theme-dark .status-dot.status-needs_redo.status-dot--redo-icon {
    background: rgba(251, 146, 60, 0.18);
    border-color: rgba(251, 146, 60, 0.5);
    color: #fdba74;
}

.status-dot.status-done { background: #34d399; border: 2px solid transparent; }

.status-pill, .task-status-pill {
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.2s;
    outline: none;
    user-select: none;
}

.status-pill:hover, .task-status-pill:hover {
    filter: brightness(1.2);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.status-pill:active, .task-status-pill:active {
    transform: translateY(0) scale(0.96);
}

html.theme-dark textarea::placeholder,
html.theme-dark input::placeholder {
    color: var(--text-muted);
    opacity: 1;
}

html.theme-dark {
    color-scheme: dark;
    --bg-main: #0b1220;
    --bg-sidebar: #101a2c;
    --bg-card: #111d33;
    --bg-surface: #15213a;
    --bg-slate: #101b2f;
    --bg-dark: #0d1629;

    --text-primary: #e2e8f0;
    --text-secondary: #94a3b8;
    --text-tertiary: #64748b;
    --text-muted: #94a3b8;
    --brand-primary: #38bdf8;
    --brand-hover: #0ea5e9;
    --brand-light: #082f49;
    --accent-primary: var(--brand-primary);
    --accent-hover: var(--brand-hover);
    --accent-active: var(--brand-hover);
    --accent-primary-rgb: 56, 189, 248;
    --border-light: #2a3a57;
    --border-hover: #3a4d72;
    --border-accent: #4b6188;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.35);
    --shadow-md: 0 6px 10px -2px rgb(0 0 0 / 0.45), 0 2px 4px -2px rgb(0 0 0 / 0.4);
}

/* Base Light Theme Overrides */
body.light-theme {
    background: var(--bg-main);
    color: var(--text-primary);
    font-family: var(--font-body);
}

body.sidebar-collapsed {
    --sidebar-width: var(--sidebar-width-collapsed);
}

/* Detroit Axle Card Styles */
.da-card {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-premium);
    padding: 1.5rem;
    transition: transform 0.2s, box-shadow 0.2s;
}

.da-card:hover {
    box-shadow: var(--shadow-md);
}

.da-stat-label {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.5rem;
}

.da-stat-value {
    font-size: 2.25rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.1;
}

.da-stat-footer {
    margin-top: 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
}

.multi-select-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    height: 100%;
    padding: 0 0.5rem;
    background: var(--bg-surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.8rem;
    color: var(--text-primary);
    transition: border-color 0.2s ease;
}

.multi-select-trigger:hover {
    border-color: var(--border-accent);
}

.multi-select-display {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.multi-select-dropdown svg {
    flex-shrink: 0;
    margin-left: 0.25rem;
    transition: transform 0.2s ease;
}

.multi-select-dropdown.open svg {
    transform: rotate(180deg);
}

.multi-select-options {
    position: fixed;
    z-index: 99999;
    background: var(--bg-slate);
    border: 1px solid var(--border-accent);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-premium);
    max-height: 200px;
    overflow-y: auto;
    min-width: 150px;
    padding: 0.25rem 0;
}

.multi-select-option {
    display: flex;
    align-items: center;
    padding: 0.5rem;
    cursor: pointer;
    transition: background-color 0.2s ease;
    border-bottom: 1px solid var(--border-light);
}

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

.multi-select-option:hover {
    background: var(--bg-surface);
}

.multi-select-option input[type="checkbox"] {
    margin-right: 0.5rem;
    accent-color: var(--accent-primary);
}

.multi-select-option span {
    color: var(--text-primary);
    font-size: 0.8rem;
}

.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    color: var(--text-primary);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
    transition: transform 0.2s var(--transition), background 0.2s var(--transition), border-color 0.2s var(--transition), box-shadow 0.2s var(--transition);
    cursor: pointer;
}

.btn-icon.btn-sm {
    width: 38px;
    height: 38px;
}

.btn-icon svg {
    display: block;
    width: 26px;
    height: 26px;
}

.btn-icon:hover {
    background: rgba(var(--accent-primary-rgb), 0.1);
    border-color: var(--accent-primary);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
    transform: translateY(-2px);
}

.btn-icon:focus-visible {
    outline: 2px solid var(--accent-primary);
    outline-offset: 2px;
}

/* Effective dark mode inherits from html.theme-dark variables. */
body:not(.light-theme) {
    background: var(--bg-main);
    color: var(--text-primary);
}

body .form-label { /* Applies to both themes, but light theme has specific override */
    color: var(--text-secondary);
}

body.light-theme .form-input,
body.light-theme .form-textarea {
    background-color: #ffffff; /* Use background-color to avoid resetting background-image/repeat */
}




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

body {
    font-family: var(--font-body);
    color: var(--text-primary);
    background: linear-gradient(135deg, var(--bg-gradient-start) 0%, var(--bg-gradient-end) 100%);
    background-attachment: fixed;
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
h4 {
    font-family: var(--font-heading);
    letter-spacing: -0.02em;
    font-weight: 600;
}

h1 {
    font-size: var(--font-size-xl);
}

h2 {
    font-size: var(--font-size-lg);
}

h3 {
    font-size: var(--font-size-md);
}

/* Glassmorphism Classes */
.glass {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
}

.glass-card {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: 16px;
    box-shadow: var(--shadow-premium);
    transition: all 0.3s var(--transition);
    position: relative;
    overflow: hidden;
    isolation: isolate; /* Create new stacking context */
    transform: translate3d(0, 0, 0); /* Force stable GPU layer */
    backface-visibility: hidden; /* Prevent flickering during layout shifts */
    contain: paint; /* HARD CONTAINMENT - prevents artifact leakage */
    outline: 1px solid transparent; /* Anti-aliasing stabilizer */
    background-clip: padding-box;
}

.glass-card::after {
    content: "";
    position: absolute;
    top: 0;
    left: -150%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.08),
        transparent
    );
    transition: 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
    z-index: 1;
}

.glass-card:hover::after {
    left: 150%;
}

.glass-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.4);
    border-color: var(--accent-primary);
}

/* ---- SEARCH BAR ---- */
.search-container {
    position: relative;
    flex: 1;
    max-width: 400px;
}

.search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
    display: flex;
    align-items: center;
}

.search-input {
    width: 100%;
    background: var(--bg-dark);
    border: 1px solid var(--border-light);
    border-radius: 10px;
    padding: 0.75rem 1rem 0.75rem 2.75rem;
    color: var(--text-primary);
    font-size: 0.9rem;
    font-family: inherit;
    transition: all 0.2s;
    outline: none;
}

.search-input:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(77, 166, 255, 0.1);
    background: var(--bg-surface);
}

/* Layout */
.app-layout {
    display: flex;
    height: 100vh;
    background: transparent;
}

.sidebar {
    width: var(--sidebar-width);
    background-color: var(--bg-sidebar);
    border-right: 1px solid var(--border-light);
    display: flex;
    flex-direction: column;
    height: 100vh;
    position: relative;
    z-index: 1000;
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
    box-shadow: none;
}

/* FAST: brand rail above nav links */
.tasks-sidebar-header-fast {
    height: var(--topbar-height);
    min-height: var(--topbar-height);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 0.5rem;
    background: #ffffff;
    border-bottom: 1px solid var(--border-light);
}

.tasks-sidebar-header-fast .sidebar-logo-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
}

.tasks-da-wordmark-full {
    font-size: 0.58rem;
    font-weight: 900;
    letter-spacing: 0.16em;
    color: #0c4a6e;
    text-transform: uppercase;
    text-align: center;
    line-height: 1.3;
    white-space: nowrap;
}

.tasks-da-wordmark-full .tasks-da-pipe {
    display: inline-block;
    margin: 0 0.4em;
    opacity: 0.45;
    font-weight: 700;
    color: #0369a1;
}

.tasks-da-wordmark-small {
    display: none;
    font-size: 0.7rem;
    font-weight: 900;
    letter-spacing: 0.12em;
    color: #0c4a6e;
}

html.theme-dark .tasks-sidebar-header-fast {
    background: linear-gradient(180deg, #060b14 0%, #0a1628 55%, #0c1a30 100%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

html.theme-dark .tasks-da-wordmark-full {
    color: #7dd3fc;
}

html.theme-dark .tasks-da-wordmark-full .tasks-da-pipe {
    color: #bae6fd;
    opacity: 0.5;
}

html.theme-dark .tasks-da-wordmark-small {
    color: #7dd3fc;
}

.sidebar.collapsed .tasks-da-wordmark-full {
    display: none;
}

.sidebar.collapsed .tasks-da-wordmark-small {
    display: block;
}

.sidebar:hover {
    width: var(--sidebar-width);
    box-shadow: none;
    border-right-color: var(--border-light);
}

.sidebar.collapsed {
    width: var(--sidebar-width-collapsed);
}

/* Sidebar Header & Toggle */
.sidebar-header {
    min-height: var(--topbar-height);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 0.75rem;
    border-bottom: 1px solid var(--border-light);
    overflow: hidden;
    position: relative;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar.collapsed .sidebar-header {
    padding: 0.75rem 0.25rem;
}

.sidebar-logo-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    width: 100%;
}

.sidebar-toggle-btn {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    color: var(--text-tertiary);
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
}

.sidebar-toggle-btn:hover {
    background-color: var(--bg-main);
    color: var(--text-primary);
}

.sidebar.collapsed .sidebar-toggle-btn {
    opacity: 1;
    pointer-events: auto;
}

.sidebar.collapsed .sidebar-toggle-btn {
    left: 50%;
    right: auto;
    transform: translate(-50%, -50%);
}

/* Sidebar Search (Replica Style) */
.sidebar-search-wrap {
    padding: 0.65rem 1rem;
    border-bottom: 1px solid var(--border-light);
    background: var(--bg-sidebar);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    max-height: 60px;
    opacity: 1;
    overflow: hidden;
    white-space: nowrap;
}

.sidebar.collapsed .sidebar-search-wrap {
    padding: 0;
    max-height: 0;
    opacity: 0;
    pointer-events: none;
    border-bottom-color: transparent;
}

.sidebar.collapsed .logo-full,
.sidebar.collapsed .sidebar-section-title,
.sidebar.collapsed .profile-info,
.sidebar.collapsed .nav-btn span,
.sidebar.collapsed .sidebar-top .menu-item span,
.sidebar.collapsed .sidebar-logo span {
    display: none !important;
    opacity: 0 !important;
}

.sidebar.collapsed .sidebar-search-wrap,
.sidebar.collapsed .search-container {
    padding: 0;
    max-height: 0;
    opacity: 0;
    pointer-events: none;
    border-bottom-color: transparent;
}

.sidebar.collapsed .logo-small {
    display: flex !important;
    opacity: 1 !important;
    transform: translateX(-50%) scale(1) !important;
    left: 50% !important;
    position: absolute !important;
}

.sidebar-search-inner {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--bg-main);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    padding: 0 0.65rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.sidebar-search-inner:focus-within {
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 3px rgba(60, 180, 229, 0.12);
}

.sidebar-search-icon {
    width: 14px;
    height: 14px;
    color: var(--text-tertiary);
    flex-shrink: 0;
}

.sidebar-search-input {
    flex: 1;
    border: none;
    background: transparent;
    padding: 0.45rem 0;
    font-size: 0.82rem;
    color: var(--text-primary);
    outline: none;
}

.logo-full, .logo-small, .menu-item span, .profile-info {
    transition: var(--transition);
}

.nav-links {
    list-style: none;
    padding: 1.5rem 1rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    overflow-y: auto;
    overflow-x: hidden;
}

.nav-btn {
    width: 100%;
    display: flex;
    align-items: center;
    padding: 0.625rem 0.75rem;
    background: transparent;
    border: none;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 0.925rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
    text-align: left;
    white-space: nowrap;
}

.nav-icon {
    width: 18px;
    height: 18px;
    margin-right: 12px;
    opacity: 0.7;
    flex-shrink: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-btn:hover {
    background-color: var(--bg-main);
    color: var(--text-primary);
}

.nav-btn.active {
    background-color: rgba(60, 180, 229, 0.05) !important; /* Subtle tint of brand color */
    color: var(--brand-primary) !important;
    border-radius: 0 8px 8px 0;
    border-left: 3px solid var(--brand-primary);
    padding-left: 9px; /* Adjust padding to account for border (12px - 3px) */
}

.nav-btn.active .nav-icon {
    opacity: 1;
    color: var(--brand-primary);
}

.sidebar.collapsed .nav-btn {
    justify-content: center;
    padding: 0.625rem 0;
}

.sidebar.collapsed .nav-icon {
    margin-right: 0;
}

.sidebar-section-title {
    margin: 1.5rem 0.75rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.sidebar-footer {
    padding: 1.25rem 1.5rem;
    border-top: 1px solid var(--border-light);
}

.sidebar.collapsed .sidebar-footer {
    padding: 1.25rem 0;
}

.system-status {
    display: flex;
    align-items: center;
    font-size: 0.825rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.sidebar.collapsed .system-status span {
    display: none;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 8px;
}

.sidebar.collapsed .status-dot {
    margin: 0 auto;
}

.status-dot.online {
    background-color: var(--status-success);
    box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.2);
}

.profile-trigger {
    margin-top: 1rem;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.sidebar.collapsed .profile-trigger {
    justify-content: center;
}

.avatar-circle {
    width: 32px;
    height: 32px;
    font-size: 0.8rem;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    flex-shrink: 0;
}

.profile-info {
    flex: 1;
    overflow: hidden;
    transition: opacity 0.2s;
}

.profile-rank {
    font-size: 0.7rem;
    color: var(--text-secondary);
}

/* Main column: FAST-style cyan topbar + scrollable page body */
.tasks-main-shell {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
    background: var(--bg-main);
}

.tasks-fast-topbar {
    flex-shrink: 0;
    height: var(--topbar-height);
    min-height: var(--topbar-height);
    font-family: var(--font-sans);
    background-color: var(--topbar-bg);
    background-image:
        radial-gradient(circle at 0 0, rgba(15, 80, 120, 0.14) 0, transparent 55%),
        repeating-linear-gradient(
            -12deg,
            transparent,
            transparent 8px,
            rgba(15, 80, 120, 0.06) 8px,
            rgba(15, 80, 120, 0.06) 9px
        );
    border-bottom: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.25rem 0 0;
    z-index: 5;
    color: #fff;
    position: relative;
    overflow: visible;
}

html.theme-dark .tasks-fast-topbar {
    /* FAST keeps the bar on brand cyan in dark mode */
    background-color: var(--topbar-bg);
    color: #fff;
}

.tasks-fast-topbar .topbar-brand {
    display: flex;
    align-items: center;
    align-self: stretch;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    position: relative;
    z-index: 6;
}

.tasks-fast-topbar .topbar-burger {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 4px;
    width: 68px;
    height: var(--topbar-height);
    padding: 0;
    flex-shrink: 0;
    background: transparent;
    border: none;
    cursor: pointer;
    z-index: 2;
    position: absolute;
    left: 0;
    top: 0;
    box-sizing: border-box;
}

.tasks-fast-topbar .topbar-burger span {
    display: block;
    width: 18px;
    height: 2px;
    background: #fff;
    border-radius: 2px;
    flex-shrink: 0;
    transition: opacity 0.2s;
}

.tasks-fast-topbar .topbar-burger:hover span {
    background: rgba(255, 255, 255, 0.75);
}

.tasks-topbar-logo-slot {
    display: flex;
    align-items: center;
    align-self: stretch;
    flex-shrink: 0;
    padding-left: 68px;
    position: relative;
    min-height: var(--topbar-height);
}

.tasks-fast-topbar .topbar-logo-main {
    height: var(--topbar-height);
    width: auto;
    max-width: min(340px, 38vw);
    object-fit: contain;
    object-position: left center;
    display: block;
    flex-shrink: 0;
}

.tasks-topbar-wordmark-fallback {
    display: none;
    align-items: center;
    height: var(--topbar-height);
    padding-right: 0.35rem;
}

.tasks-topbar-logo-slot.is-fallback .tasks-topbar-logo-img {
    display: none;
}

.tasks-topbar-logo-slot.is-fallback .tasks-topbar-wordmark-fallback {
    display: flex;
}

.tasks-topbar-fast-tag {
    display: inline-flex;
    flex-direction: row;
    align-items: center;
    background: #ffffff;
    padding: 0.28rem 0.65rem 0.28rem 0.35rem;
    clip-path: polygon(0 0, calc(100% - 11px) 0, 100% 50%, calc(100% - 11px) 100%, 0 100%);
    box-shadow: 0 2px 8px rgba(15, 80, 120, 0.2);
    border: 1px solid rgba(15, 80, 120, 0.1);
}

.tasks-topbar-fast-dax {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding-right: 0.3rem;
    margin-right: 0.35rem;
    border-right: 1px solid rgba(12, 74, 110, 0.2);
    font-weight: 800;
    font-size: 0.38rem;
    line-height: 1.05;
    letter-spacing: 0.04em;
    color: #0c4a6e;
    text-transform: uppercase;
}

.tasks-topbar-fast-text {
    font-weight: 800;
    font-size: 0.82rem;
    letter-spacing: 0.04em;
    line-height: 1;
    color: #0c4a6e;
}

.tasks-fast-topbar .topbar-view-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding-left: 1rem;
    border-left: 1px solid rgba(255, 255, 255, 0.25);
    margin: 0 0 0 0.75rem;
    line-height: 1.2;
}

.tasks-fast-topbar .topbar-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    position: relative;
    z-index: 20;
    flex-shrink: 0;
}

.tasks-fast-topbar .topbar-icon-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border: none;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    cursor: pointer;
    transition: background 0.15s ease;
}

.tasks-fast-topbar .topbar-icon-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Main-app notification bell (matches templates/index.html + static/style.css) */
.tasks-fast-topbar .tasks-main-notif-wrap {
    position: relative;
}

.tasks-fast-topbar .tasks-main-notif-btn {
    position: relative;
    box-sizing: border-box;
    width: 42px;
    height: 42px;
    min-width: 42px;
    padding: 0;
    margin: 0;
    line-height: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: #ffffff;
    border: none;
    background: transparent;
    overflow: visible;
    cursor: pointer;
}

.tasks-fast-topbar .tasks-main-notif-btn:hover,
.tasks-fast-topbar .tasks-main-notif-btn:focus-visible {
    background: rgba(255, 255, 255, 0.22);
}

.tasks-fast-topbar .tasks-main-notif-btn svg,
.tasks-fast-topbar .tasks-main-notif-btn svg path {
    display: block;
    stroke: #ffffff;
    color: #ffffff;
}

.tasks-fast-topbar .tasks-main-notif-btn .topbar-notif-bell {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    transform: translateX(-1px);
}

.tasks-fast-topbar .notif-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    border-radius: 9px;
    background: rgba(255, 255, 255, 0.96);
    color: #0c4a6e;
    font-size: 0.65rem;
    font-weight: 700;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    pointer-events: none;
    border: 2px solid rgba(255, 255, 255, 0.55);
    box-sizing: border-box;
    font-variant-numeric: tabular-nums;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.12);
}

.tasks-fast-topbar .notif-badge.hidden {
    display: none !important;
}

.tasks-fast-topbar .notif-dropdown {
    position: fixed;
    top: auto;
    right: auto;
    width: 320px;
    max-height: 420px;
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    z-index: 10050;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.tasks-fast-topbar .notif-dropdown.hidden {
    display: none !important;
}

.tasks-fast-topbar .notif-dropdown-loading {
    position: absolute;
    inset: 0;
    z-index: 30;
    display: flex;
    align-items: center;
    justify-content: center;
    background: color-mix(in srgb, var(--bg-card) 90%, transparent);
    backdrop-filter: blur(5px);
}

.tasks-fast-topbar .notif-dropdown-loading.hidden {
    display: none !important;
}

.tasks-fast-topbar .notif-dropdown-loading-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.65rem;
    padding: 1rem;
    text-align: center;
}

.tasks-fast-topbar .notif-dropdown-loading-spinner {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 3px solid var(--border-light);
    border-top-color: var(--brand-primary);
    animation: tasksNotifMarkReadSpin 0.75s linear infinite;
}

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

.tasks-fast-topbar .notif-dropdown-loading-text {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.tasks-fast-topbar .notif-dropdown-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-light);
    font-weight: 700;
    font-size: 0.875rem;
    color: var(--text-primary);
    background: var(--bg-surface);
    flex-shrink: 0;
}

.tasks-fast-topbar .notif-mark-read-btn {
    font-size: 0.72rem;
    color: var(--brand-primary);
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    font-weight: 600;
}

.tasks-fast-topbar .notif-mark-read-btn:hover {
    text-decoration: underline;
}

.tasks-fast-topbar .notif-list {
    overflow-y: auto;
    flex: 1;
}

.tasks-fast-topbar .notif-item {
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
    padding: 0.7rem 1.1rem 0.7rem 1.25rem;
    border-bottom: 1px solid var(--border-light);
    cursor: default;
    transition: background 0.15s;
}

.tasks-fast-topbar .notif-item:last-child {
    border-bottom: none;
}

.tasks-fast-topbar .notif-item:hover {
    background: var(--bg-slate);
}

.tasks-fast-topbar .notif-item.unread {
    background: rgba(56, 189, 248, 0.1);
}

@supports (background: color-mix(in srgb, white, black)) {
    .tasks-fast-topbar .notif-item.unread {
        background: color-mix(in srgb, var(--brand-primary) 14%, transparent);
    }
    .tasks-fast-topbar .notif-item.unread:hover {
        background: color-mix(in srgb, var(--brand-primary) 22%, transparent);
    }
}

.tasks-fast-topbar .notif-item.notif-item--action {
    cursor: pointer;
}

.tasks-fast-topbar .notif-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--brand-primary);
    flex-shrink: 0;
    margin-top: 5px;
}

.tasks-fast-topbar .notif-item-body {
    flex: 1;
    min-width: 0;
}

.tasks-fast-topbar .notif-item-title {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tasks-fast-topbar .notif-item-meta {
    font-size: 0.72rem;
    color: var(--text-tertiary);
    margin-top: 2px;
}

.tasks-fast-topbar .notif-empty {
    padding: 1.5rem 1rem;
    text-align: center;
    font-size: 0.82rem;
    color: var(--text-tertiary);
}

.tasks-fast-topbar .notif-section-label {
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-tertiary);
    padding: 0.5rem 1.1rem 0.35rem calc(1.25rem + 8px + 0.85rem);
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border-light);
}

@media (max-width: 720px) {
    .tasks-fast-topbar .topbar-view-title {
        display: none;
    }

    .tasks-fast-topbar .topbar-logo-main {
        max-width: 200px;
    }
}

@media (max-width: 480px) {
    .tasks-fast-topbar .topbar-logo-main {
        max-width: 150px;
    }

    .tasks-fast-topbar {
        padding-right: 0.5rem;
    }
}

.main-content {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 2.5rem;
    margin-left: 0;
    background: transparent;
    transition: var(--transition);
    transform: translate3d(0, 0, 0) translateZ(0); 
    isolation: isolate;
    contain: layout paint;
    backface-visibility: hidden;
}

/* Project list view: let the task grid scroll horizontally inside a bounded pane */
.main-content:has(> .project-view-container) {
    display: flex;
    flex-direction: column;
    padding: 0;
    overflow: hidden;
}

.main-content > .project-view-container {
    flex: 1 1 auto;
    min-height: 0;
    height: auto;
}

/* Sidebar Header & Logos managed by sidebar.js and shared transitions */

/* Return link refined */
.return-link {
    font-weight: 500 !important;
}

.sidebar.collapsed .return-link {
    width: 48px !important;
    padding: 0 !important;
}

.auth-logo {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 2.5rem;
    text-align: center;
    letter-spacing: 0.15em;
    color: var(--text-primary);
    text-shadow: 0 0 30px var(--accent-glow);
    font-family: var(--font-heading);
}

.auth-logo.auth-logo-stack {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
    font-size: unset;
    letter-spacing: normal;
    line-height: 1.1;
}

.auth-logo.auth-logo-stack .auth-logo-main {
    font-size: 2.45rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    color: var(--text-primary);
    font-family: var(--font-heading);
}

.auth-logo.auth-logo-stack .auth-logo-sub {
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    color: var(--text-secondary);
}

.auth-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 400px;
    z-index: 1;
}

.text-gradient {
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--accent-primary) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 800;
}

body.light-theme .text-gradient {
    background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-active) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.stat-icon-mini {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-icon-mini.bg-blue { background: rgba(59, 130, 246, 0.15); color: #3b82f6; }
.stat-icon-mini.bg-orange { background: rgba(249, 115, 22, 0.15); color: #f97316; }
.stat-icon-mini.bg-green { background: rgba(16, 185, 129, 0.15); color: #10b981; }
.stat-icon-mini.bg-purple { background: rgba(168, 85, 247, 0.15); color: #a855f7; }

.p-md { padding: 1.25rem; }

/* Auth Pages Styling */
.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    position: relative;
    overflow: hidden;
}

.auth-card {
    width: 100%;
    padding: 2.5rem;
    width: 100%;
}

/* Forms */
.form-group {
    margin-bottom: 1.25rem;
}

.form-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.form-input,
.form-textarea {
    width: 100%;
    background: var(--bg-dark);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 0.75rem 1rem;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.9375rem;
    transition: all 0.2s var(--transition);
}

.form-input:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--accent-primary);
    background-color: var(--bg-surface); /* Use background-color to avoid resetting background-image/repeat */
    box-shadow: 0 0 0 3px rgba(77, 166, 255, 0.1);
}

.input-wrapper {
    position: relative;
    width: 100%;
}

/* Custom Select Styling */
select.form-input {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23a1a1aa' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 2.5rem;
}

body.light-theme select.form-input {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23334155' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
}

/* Custom Date Styling */
input[type="date"] {
    color-scheme: dark;
}

input[type="date"]::-webkit-calendar-picker-indicator {
    filter: invert(0.6) sepia(1) saturate(0) hue-rotate(0deg);
    cursor: pointer;
    opacity: 0.6;
    transition: opacity 0.2s;
}

input[type="date"]::-webkit-calendar-picker-indicator:hover {
    opacity: 1;
}

/* Flatpickr Custom Theme Overrides */
.flatpickr-calendar {
    background: #121212 !important; /* Force solid background for readability */
    border: 1px solid var(--border-light) !important;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5) !important;
    border-radius: var(--radius-lg) !important;
    font-family: inherit !important;
    z-index: 10060 !important; /* Above .side-panel (9999) and .modal-overlay (2000) */
}

.flatpickr-day.selected,
.flatpickr-day.startRange,
.flatpickr-day.endRange,
.flatpickr-day.selected.inRange,
.flatpickr-day.startRange.inRange,
.flatpickr-day.endRange.inRange,
.flatpickr-day.selected:focus,
.flatpickr-day.startRange:focus,
.flatpickr-day.endRange:focus,
.flatpickr-day.selected:hover,
.flatpickr-day.startRange:hover,
.flatpickr-day.endRange:hover,
.flatpickr-day.selected.prevMonthDay,
.flatpickr-day.startRange.prevMonthDay,
.flatpickr-day.endRange.prevMonthDay,
.flatpickr-day.selected.nextMonthDay,
.flatpickr-day.startRange.nextMonthDay,
.flatpickr-day.endRange.nextMonthDay {
    background: var(--text-primary) !important;
    border-color: var(--text-primary) !important;
    color: var(--bg-obsidian) !important;
}

.flatpickr-day.today {
    border-color: var(--border-accent) !important;
}

.flatpickr-day.today:hover {
    background: var(--accent-primary) !important;
    color: var(--text-primary) !important;
}

.flatpickr-months .flatpickr-month {
    background: transparent !important;
    color: var(--text-primary) !important;
}

.flatpickr-current-month .flatpickr-monthDropdown-months {
    background: var(--bg-slate) !important;
    color: var(--text-primary) !important;
}

.flatpickr-weekday {
    color: var(--text-muted) !important;
}

.flatpickr-day {
    color: var(--text-secondary) !important;
}

.flatpickr-day:hover {
    background: var(--accent-primary) !important;
    border-color: transparent !important;
}

.flatpickr-day.flatpickr-disabled,
.flatpickr-day.flatpickr-disabled:hover {
    color: var(--text-muted) !important;
    opacity: 0.3;
}

span.flatpickr-weekday {
    font-weight: 600 !important;
}

.flatpickr-months .flatpickr-prev-month,
.flatpickr-months .flatpickr-next-month {
    fill: var(--text-secondary) !important;
}

.flatpickr-months .flatpickr-prev-month:hover,
.flatpickr-months .flatpickr-next-month:hover {
    fill: var(--text-primary) !important;
}

/* Task Sections */
.task-group-section {
    background: var(--bg-surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.3s ease;
}

.task-group-header {
    background: var(--bg-card);
    padding: 0.875rem 1.5rem;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    gap: 1rem;
}

.section-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.section-title-text {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.task-group-count {
    background: var(--bg-main);
    color: var(--text-secondary);
    font-size: 0.75rem;
    padding: 2px 10px;
    border-radius: 100px;
    font-weight: 600;
    border: 1px solid var(--border-light);
}

.task-row {
    padding: 0.75rem 1.5rem;
    border-bottom: 1px solid var(--border-light);
    display: grid;
    grid-template-columns: 100px 1fr 120px 150px 180px;
    align-items: center;
    gap: 1rem;
    cursor: pointer;
}

/* Project View Redesign */
.project-view-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: var(--bg-main);
    color: var(--text-primary);
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
}

.project-header {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-light);
}

.project-header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.project-title-section {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.project-logo-box {
    width: 32px;
    height: 32px;
    background: var(--brand-primary);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.project-title-section h1 {
    font-size: 1.5rem;
    font-weight: 800;
    margin: 0;
    color: var(--text-primary);
}

.project-header-actions {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.icon-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 4px;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.icon-btn:hover {
    background: var(--bg-slate);
    color: var(--text-primary);
}

.status-btn {
    background: var(--bg-main);
    border: 1px solid var(--border-light);
    color: var(--text-secondary);
    padding: 4px 12px;
    border-radius: 100px;
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
}

.status-btn:hover {
    background: rgba(255, 255, 255, 0.05);
}

.project-header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.avatar-group {
    display: flex;
    align-items: center;
}

.avatar-circle.sm {
    width: 24px;
    height: 24px;
    font-size: 0.7rem;
    border: 2px solid var(--bg-card);
    margin-left: -6px;
}

.avatar-circle.sm:first-child {
    margin-left: 0;
}

.share-btn {
    background: var(--brand-primary);
    color: white;
    font-weight: 600;
}

.share-btn:hover {
    background: var(--brand-hover);
}

.customize-btn {
    color: var(--text-secondary);
    border: 1px solid var(--border-light);
}

.project-nav {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.nav-tab {
    padding: 0.75rem 0;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
}

.nav-tab:hover {
    color: var(--text-primary);
}

.nav-tab.active {
    color: var(--accent-primary);
    border-bottom-color: var(--accent-primary);
    font-weight: 600;
}

.add-tab-btn {
    font-size: 1.25rem;
    color: #a2a0a2;
}

.project-toolbar {
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-light);
}

.toolbar-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.btn-group {
    display: flex;
    align-items: center;
}

.add-task-btn {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
    padding: 6px 12px;
    font-weight: 600;
}

.dropdown-arrow {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
    padding: 6px 4px;
    border-left: 1px solid rgba(255, 255, 255, 0.2);
}

.toolbar-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.toolbar-btn {
    background: var(--bg-main);
    border: 1px solid var(--border-light);
    color: var(--text-secondary);
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.toolbar-btn:hover {
    background: var(--bg-slate);
    color: var(--text-primary);
}

.toolbar-btn.icon-only {
    padding: 8px;
}

/* Asana List View */
.asana-list-view {
    flex: 1 1 auto;
    min-height: 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--bg-surface);
}

.asana-list-layout {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    min-width: 0;
    height: 100%;
}

.asana-table-scroll {
    flex: 1 1 auto;
    min-height: 0;
    min-width: 0;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}

.asana-table-inner {
    width: 100%;
    min-width: max(100%, var(--asana-table-min, 48rem));
    box-sizing: border-box;
}

/* Unified add actions (task, section, group) */
.asana-add-action {
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    gap: 0.45rem;
    width: 100%;
    box-sizing: border-box;
    margin: 0;
    padding: 0.6rem 1rem;
    border: 1px dashed color-mix(in srgb, var(--border-light) 90%, var(--accent-primary));
    border-radius: 8px;
    background: color-mix(in srgb, var(--bg-surface) 40%, transparent);
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 0.8125rem;
    font-weight: 600;
    line-height: 1.3;
    cursor: pointer;
    transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
    text-align: left;
}

.asana-add-action:hover {
    color: var(--accent-primary);
    border-color: color-mix(in srgb, var(--accent-primary) 50%, var(--border-light));
    background: color-mix(in srgb, var(--brand-primary) 10%, transparent);
}

.asana-add-action:focus-visible {
    outline: 2px solid var(--accent-primary);
    outline-offset: 2px;
}

.asana-add-action__icon,
.asana-add-action__label {
    pointer-events: none;
}

.asana-add-action__icon {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.15rem;
    font-size: 1rem;
    font-weight: 700;
    line-height: 1;
    color: var(--accent-primary);
}

.asana-add-action__label {
    min-width: 0;
}

.asana-add-action--task {
    border: none;
    border-radius: 0;
    border-top: 1px dashed color-mix(in srgb, var(--border-light) 90%, var(--accent-primary));
    padding: 0.75rem 3rem;
    background: transparent;
}

.asana-add-action--task:hover {
    background: color-mix(in srgb, var(--brand-primary) 10%, transparent);
    border-top-color: color-mix(in srgb, var(--accent-primary) 40%, var(--border-light));
}

.asana-add-action--in-group {
    margin: 0.5rem 1rem 0.85rem;
    width: calc(100% - 2rem);
}

.asana-add-actions-panel {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin: 1rem 1.5rem 1.25rem;
    padding: 0;
}

.asana-add-action--panel {
    width: 100%;
}

.asana-add-actions-panel .asana-add-actions-footer {
    margin: 0;
}

.asana-add-actions-footer {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    margin: 0;
    padding: 0;
}

.asana-add-actions-footer .asana-add-action--footer {
    flex: 1 1 10rem;
    min-width: min(100%, 10rem);
}

.asana-empty-board {
    width: min(44rem, calc(100% - 3rem));
    margin: 3.5rem auto 0;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.asana-empty-board__title {
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 600;
    text-align: center;
}

.asana-empty-board .asana-add-actions-panel {
    margin: 0;
}

.asana-header-row {
    display: grid;
    align-items: center;
    padding: 0.85rem 1.75rem;
    border-bottom: 1px solid var(--border-light);
    background: var(--bg-main);
    position: sticky;
    top: 0;
    z-index: 10;
    width: 100%;
    box-sizing: border-box;
}

.asana-section-columns-header {
    width: 100%;
    box-sizing: border-box;
}

.asana-header-row--section {
    position: static;
    top: auto;
    z-index: 1;
    padding: 0.5rem 1.75rem;
    background: color-mix(in srgb, var(--bg-surface) 85%, var(--bg-main));
    border-bottom: 1px solid var(--border-light);
}

.asana-header-cell--select {
    min-width: 2.5rem;
}

.asana-section-content .asana-task-row:first-of-type {
    border-top: none;
}

.asana-header-cell {
    color: var(--text-secondary);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05rem;
    display: flex;
    align-items: center;
    padding: 0 1.15rem;
    border-right: 1px solid var(--border-light);
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.asana-header-cell:last-child {
    border-right: none;
}

.asana-section {
    margin-bottom: 12px;
    position: relative;
}

.asana-section-header {
    padding: 12px 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    background: var(--bg-main);
    border-bottom: 1px solid var(--border-light);
    font-weight: 800;
    color: var(--text-primary);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.1rem;
    position: relative;
    z-index: 20;
}

.asana-section-header:hover {
    background: var(--bg-slate);
}

.asana-section-select-wrap {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    margin-right: 0.15rem;
    cursor: default;
}

.asana-section-select-cb {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: var(--accent-primary, #3b82f6);
}

.asana-section-select-cb:disabled {
    cursor: not-allowed;
    opacity: 0.45;
}

.asana-section-icon {
    transition: transform 0.2s;
    display: flex;
}

.asana-section.collapsed .asana-section-icon {
    transform: rotate(-90deg);
}

.asana-section--done .asana-section-header {
    opacity: 0.92;
}

.asana-section-done-pill {
    display: inline-flex;
    align-items: center;
    margin-left: 0.5rem;
    padding: 2px 8px;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--success, #22c55e);
    background: rgba(34, 197, 94, 0.12);
    border: 1px solid rgba(34, 197, 94, 0.35);
    border-radius: 999px;
    vertical-align: middle;
}

.asana-section-in-progress-pill {
    display: inline-flex;
    align-items: center;
    margin-left: 0.5rem;
    padding: 2px 8px;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--brand-primary, #38bdf8);
    background: rgba(56, 189, 248, 0.12);
    border: 1px solid rgba(56, 189, 248, 0.35);
    border-radius: 999px;
    vertical-align: middle;
}

.asana-section--in-progress .asana-section-header {
    border-left: 3px solid var(--brand-primary, #38bdf8);
}

.asana-section-group {
    margin-bottom: 1.25rem;
    border: 1px solid var(--border-light);
    border-radius: 10px;
    background: color-mix(in srgb, var(--bg-surface) 60%, transparent);
    overflow: visible;
}

.asana-section--menu-open {
    z-index: 100;
}

.asana-section--menu-open .asana-section-header {
    z-index: 101;
}

.asana-section-group-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.65rem 0.85rem;
    cursor: pointer;
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border-light);
    user-select: none;
    position: relative;
    z-index: 20;
}

.asana-section-group-title {
    flex: 1;
    font-weight: 800;
    font-size: 0.9rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.asana-section-group-body {
    padding: 0.35rem 0.5rem 0.75rem;
}

.asana-section-group--done .asana-section-group-header {
    opacity: 0.92;
}

.asana-section-group--menu-open {
    z-index: 100;
    position: relative;
}

.asana-section-group--menu-open .asana-section-group-header {
    z-index: 101;
}

.asana-section-group-body .asana-section {
    margin-bottom: 0.35rem;
}

.asana-section-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
}

.asana-section-bolt {
    color: var(--accent-primary);
}

.asana-section-content {
    position: relative;
    z-index: 1;
    overflow: visible;
    padding-top: 4px;
}

.asana-section-menu {
    margin-left: auto;
    padding: 4px;
    cursor: pointer;
    border-radius: 4px;
    opacity: 1;
    transition: background 0.2s;
    position: relative;
    color: var(--text-secondary);
}

.asana-section-menu:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.section-menu-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
    z-index: 5000;
    min-width: 180px;
    margin-top: 4px;
    overflow: visible;
}

.section-menu-item {
    padding: 8px 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    font-weight: 400;
    text-transform: none;
    letter-spacing: normal;
    color: var(--text-primary);
    cursor: pointer;
    transition: background 0.15s;
}

.section-menu-item:hover {
    background: var(--bg-slate);
}

.section-menu-item:first-child {
    border-radius: 6px 6px 0 0;
}

.section-menu-item:last-child {
    border-radius: 0 0 6px 6px;
}

.section-menu-item-danger {
    color: #e74c3c;
}

.section-menu-item-danger:hover {
    background: rgba(231, 76, 60, 0.1);
}

.section-menu-divider {
    height: 1px;
    background: var(--border-light);
    margin: 4px 0;
}

.section-inspect-modal-overlay {
    padding: 0.75rem;
    box-sizing: border-box;
}

.modal.section-inspect-modal {
    max-width: min(1520px, calc(100vw - 1.5rem));
    width: 100%;
    max-height: min(86vh, 860px);
    display: flex;
    flex-direction: column;
}

.section-inspect-header h2 {
    margin: 0.15rem 0 0;
    font-size: 1.15rem;
    letter-spacing: -0.02em;
}

.section-inspect-eyebrow {
    color: var(--text-secondary);
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.section-inspect-summary {
    margin-top: 0.3rem;
    color: var(--text-secondary);
    font-size: 0.82rem;
    font-weight: 600;
}

.section-inspect-body {
    padding: 0;
    overflow: hidden;
    min-height: 0;
    flex: 1;
}

.section-inspect-table {
    /* One single grid container so the header AND every row share the same
       column tracks. Previously each row was its own `display: grid` with
       `minmax(...)` columns, which made column widths re-compute per row
       based on that row's content — so the visible cells drifted out of
       alignment whenever rows had different text lengths. With subgrid,
       column widths are resolved once here and inherited by all rows.

       overflow: auto on the grid itself gives a horizontal scrollbar when
       the column tracks add up to more than the modal can show. We don't
       set min-width: max-content here because that would push the overflow
       out to a parent that has overflow: hidden and clip the right side
       (the symptom: columns end abruptly with no scrollbar). */
    display: grid;
    grid-template-columns: var(--section-inspect-grid-template, 24px minmax(150px, 1.2fr) minmax(80px, 0.7fr));
    align-content: start;
    min-height: 260px;
    max-height: 100%;
    overflow: auto;
    /* Always leave room for the horizontal scrollbar; "stable both-edges"
       avoids the layout reflowing once the scrollbar appears. */
    scrollbar-gutter: stable;
}

.section-inspect-task-head,
.section-inspect-task-row,
.section-inspect-task-list {
    display: grid;
    grid-column: 1 / -1;
    grid-template-columns: subgrid;
    align-items: stretch;
    box-sizing: border-box;
}

.section-inspect-task-list {
    /* The list is only a logical wrapper so the empty-state can span all
       columns; otherwise its child rows participate directly in the outer
       grid via subgrid. */
    grid-auto-rows: auto;
    overflow: visible;
}

.section-inspect-task-head {
    position: sticky;
    top: 0;
    z-index: 1;
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border-light);
    color: var(--text-secondary);
    font-size: 0.62rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.035em;
}

.section-inspect-head-cell {
    display: flex;
    align-items: center;
    box-sizing: border-box;
    min-width: 0;
    padding: 0.4rem 0.45rem;
    border-right: 1px solid var(--border-light);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.section-inspect-head-cell--status {
    padding: 0;
    border-right: 0;
}

.section-inspect-task-row {
    border: 0;
    border-bottom: 1px solid var(--border-light);
    background: var(--bg-card);
    color: var(--text-primary);
    text-align: left;
    cursor: pointer;
    padding: 0;
}

.section-inspect-task-row:hover {
    background: var(--bg-main);
}

.section-inspect-task-status {
    width: 9px;
    height: 9px;
    border-radius: 999px;
    background: var(--text-secondary);
    justify-self: center;
    align-self: center;
}

.section-inspect-task-main,
.section-inspect-task-assignee,
.section-inspect-task-custom {
    min-width: 0;
    padding: 0.4rem 0.45rem;
    border-right: 1px solid var(--border-light);
    font-size: 0.7rem;
    box-sizing: border-box;
    align-self: stretch;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.section-inspect-task-main {
    align-items: flex-start;
    gap: 0.1rem;
}

.section-inspect-task-assignee,
.section-inspect-task-custom {
    flex-direction: row;
    align-items: center;
}

.section-inspect-task-title,
.section-inspect-task-meta,
.section-inspect-task-assignee,
.section-inspect-task-custom {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.section-inspect-task-title {
    display: block;
    font-weight: 700;
    font-size: 0.74rem;
}

.section-inspect-task-meta {
    display: block;
    margin-top: 0.1rem;
    color: var(--text-secondary);
    font-size: 0.63rem;
    font-weight: 600;
}

.section-inspect-task-custom.is-empty {
    opacity: 0.62;
}

.section-inspect-task-custom--year-ranges {
    flex-wrap: wrap;
    align-content: center;
    gap: 0.2rem;
    overflow: visible;
    text-overflow: clip;
    white-space: normal;
}

.section-inspect-year-range-chip {
    display: inline-flex;
    align-items: center;
    max-width: 100%;
    padding: 0.08rem 0.28rem;
    border: 1px solid var(--border-light);
    border-radius: 999px;
    background: rgba(59, 130, 246, 0.12);
    color: var(--text-primary);
    line-height: 1.25;
    white-space: nowrap;
}

.section-inspect-task-head span.is-empty-column,
.section-inspect-task-custom.is-empty-column {
    padding-left: 0.25rem;
    padding-right: 0.25rem;
    text-align: center;
    color: var(--text-muted);
}

.section-inspect-task-status.status-done { background: var(--success, #22c55e); }
.section-inspect-task-status.status-in_progress { background: #fbbf24; }
.section-inspect-task-status.status-blocked { background: #ef4444; }
.section-inspect-task-status.status-needs_redo { background: #a855f7; }

.section-inspect-empty {
    grid-column: 1 / -1;
    padding: 1.5rem;
    color: var(--text-secondary);
    text-align: center;
}

.section-inspect-footer {
    flex-shrink: 0;
}

.asana-task-row {
    display: grid;
    padding: 0.5rem 1.75rem;
    border-bottom: 1px solid var(--border-light);
    background: var(--bg-card);
    align-items: stretch;
    cursor: pointer;
    transition: all 0.2s;
    min-height: 56px;
    box-sizing: border-box;
    width: 100%;
}

.asana-task-row:hover {
    background: var(--bg-main);
}

.asana-task-row--selected {
    background: rgba(59, 130, 246, 0.12);
    box-shadow: inset 3px 0 0 0 var(--accent-primary);
}

.asana-task-row--selected:hover {
    background: rgba(59, 130, 246, 0.16);
}

.asana-task-select-header {
    justify-content: center;
    padding-left: 0.5rem;
    padding-right: 0.5rem;
}

.asana-task-select-cell {
    justify-content: center;
    align-items: center;
    align-self: stretch;
    padding-left: 0.5rem;
    padding-right: 0.5rem;
    cursor: default;
}

.asana-task-select-cell .asana-task-select-cb,
.asana-task-select-all-cb {
    width: 16px;
    height: 16px;
    accent-color: var(--accent-primary);
    cursor: pointer;
    flex-shrink: 0;
}

.asana-task-bulk-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    /* Match .asana-header-row / .asana-task-row horizontal inset */
    padding: 0.5rem 1.75rem 0.65rem;
    margin: 0 0 0.35rem;
    box-sizing: border-box;
    background: transparent;
    border: none;
    border-radius: 0;
    border-bottom: 1px solid var(--border-light);
    flex-wrap: nowrap;
    min-width: 0;
}

.asana-task-bulk-count {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    flex-shrink: 0;
}

.asana-task-bulk-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: nowrap;
    flex: 1;
    min-width: 0;
    justify-content: flex-end;
}

.asana-task-bulk-assign-wrap {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.45rem;
    flex-wrap: nowrap;
    flex-shrink: 0;
}

.asana-task-bulk-assign-label {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    white-space: nowrap;
}

.asana-bulk-assign-picker {
    position: relative;
    flex-shrink: 1;
    min-width: 8.5rem;
    max-width: min(16rem, 36vw);
}

.asana-bulk-assign-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    width: 100%;
    min-height: 36px;
    padding: 0.35rem 0.65rem;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-primary);
    background: var(--bg-surface);
    border: 1px solid var(--border-light);
    border-radius: 8px;
    cursor: pointer;
    text-align: left;
    transition: border-color 0.15s ease, background 0.15s ease;
}

.asana-bulk-assign-trigger:hover {
    border-color: var(--border-accent);
    background: var(--bg-card);
}

.asana-bulk-assign-trigger-text {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--text-secondary);
}

.asana-bulk-assign-trigger-text.has-value {
    color: var(--text-primary);
}

.asana-bulk-assign-chevron {
    flex-shrink: 0;
    opacity: 0.65;
    color: var(--text-secondary);
    transition: transform 0.2s ease;
}

.asana-bulk-assign-trigger[aria-expanded='true'] .asana-bulk-assign-chevron {
    transform: rotate(180deg);
}

.asana-bulk-assign-menu {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    z-index: 80;
    max-height: min(280px, 42vh);
    overflow-y: auto;
    padding: 0.35rem 0;
    margin: 0;
    list-style: none;
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: 10px;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.35);
}

.asana-bulk-assign-item {
    display: block;
    width: 100%;
    padding: 0.55rem 0.85rem;
    border: none;
    background: transparent;
    color: var(--text-primary);
    font-size: 0.82rem;
    font-weight: 500;
    text-align: left;
    cursor: pointer;
    transition: background 0.12s ease;
}

.asana-bulk-assign-item:hover,
.asana-bulk-assign-item:focus-visible {
    background: var(--bg-slate);
    outline: none;
}

.asana-bulk-assign-item--unassigned {
    color: var(--text-secondary);
    font-weight: 600;
    border-bottom: 1px solid var(--border-light);
    margin-bottom: 0.2rem;
    padding-bottom: 0.65rem;
}

#asana-task-bulk-assign-apply {
    flex-shrink: 0;
    white-space: nowrap;
}

@media (max-width: 720px) {
    .asana-task-bulk-bar {
        flex-wrap: wrap;
        row-gap: 0.5rem;
    }

    .asana-task-bulk-actions {
        flex-wrap: wrap;
        justify-content: flex-start;
        width: 100%;
    }
}

.asana-task-bulk-delete-btn {
    background: color-mix(in srgb, var(--danger) 18%, transparent);
    color: var(--danger);
    border: 1px solid color-mix(in srgb, var(--danger) 55%, transparent);
    font-weight: 600;
}

.asana-task-bulk-delete-btn:hover {
    background: color-mix(in srgb, var(--danger) 32%, transparent);
    color: var(--text-primary);
}

.task-drop-target-active {
    outline: 2px dashed var(--accent-primary);
    outline-offset: -2px;
}

.asana-task-cell {
    display: flex;
    align-items: center;
    align-self: stretch;
    padding: 0 1.15rem;
    border-right: 1px solid var(--border-light);
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-primary);
    min-height: 44px;
    min-width: 0;
    gap: 1rem;
    box-sizing: border-box;
    overflow: hidden;
}

.asana-task-cell .task-custom-input,
.asana-task-cell .asana-task-cell-value,
.asana-task-cell select.task-custom-input {
    max-width: 100%;
    min-width: 0;
}

.asana-task-cell .asana-task-name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.asana-task-cell:last-child {
    border-right: none;
}

.asana-task-cell.task-actions-cell {
    justify-content: center;
    padding: 0 1.1rem 0 1.35rem;
    gap: 1rem;
}

.task-edit-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    margin-inline-end: 0.5rem;
    border: 1px solid transparent;
    border-radius: 6px;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.task-edit-btn:hover:not(:disabled) {
    color: var(--accent, #3b82f6);
    background: rgba(59, 130, 246, 0.12);
    border-color: rgba(59, 130, 246, 0.35);
}

.task-delete-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border: 1px solid transparent;
    border-radius: 6px;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.task-delete-btn:hover:not(:disabled) {
    color: var(--danger);
    background: rgba(239, 68, 68, 0.12);
    border-color: rgba(239, 68, 68, 0.35);
}

.task-delete-btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.asana-checkbox {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid var(--border-accent);
    margin: 0 0.35rem 0 0;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    box-sizing: border-box;
}

/* List row markers: To Do = blue; In Progress = yellow */
.asana-checkbox.status-todo {
    border-color: #38bdf8;
    background: #38bdf8;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.15);
}

.asana-checkbox.status-in_progress,
.asana-checkbox.status-in-progress,
.asana-checkbox.status-inprogress {
    border-color: #ca8a04;
    background: #fbbf24;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.22);
}

.asana-checkbox.status-backlog,
.asana-checkbox.status-back-log {
    border-color: #94a3b8;
    background: #94a3b8;
    box-shadow: none;
}

.asana-checkbox.status-blocked {
    border-color: #ef4444;
    background: #ef4444;
    color: #ffffff;
}

.asana-checkbox.status-needs_redo,
.asana-checkbox.status-needs-redo {
    border-color: rgba(194, 65, 12, 0.85);
    background: #fb923c;
    color: #fff7ed;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.2);
}

.asana-checkbox.status-needs_redo svg,
.asana-checkbox.status-needs-redo svg {
    display: block;
}

html.theme-dark .asana-checkbox.status-needs_redo,
html.theme-dark .asana-checkbox.status-needs-redo {
    border-color: rgba(251, 146, 60, 0.9);
    background: rgba(234, 88, 12, 0.95);
    color: #ffedd5;
}

.asana-checkbox.status-done {
    border-color: #10b981;
    background: #10b981;
    color: white;
}

.asana-checkbox.status-done svg {
    color: white;
}

html.theme-dark .asana-checkbox.status-in_progress,
html.theme-dark .asana-checkbox.status-in-progress,
html.theme-dark .asana-checkbox.status-inprogress {
    border-color: #eab308;
    background: #facc15;
}

.asana-checkbox-x {
    color: #ffffff;
    font-size: 0.72rem;
    font-weight: 800;
    line-height: 1;
}

.asana-task-name {
    flex-shrink: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
    margin-right: 0.35rem;
}

.assignee-pill {
    font-size: 0.6rem;
    font-weight: 800;
    padding: 1px 5px;
    background: rgba(var(--accent-rgb), 0.08);
    color: var(--brand-primary);
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    border: 1px solid rgba(var(--accent-rgb), 0.12);
    white-space: nowrap;
    opacity: 0.8;
    flex-shrink: 0;
}

.asana-status-pill {
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.725rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.asana-status-pill.pending { background: rgba(245, 158, 11, 0.14); color: #d97706; border: 1px solid rgba(245, 158, 11, 0.35); }
.asana-status-pill.critical { background: rgba(239, 68, 68, 0.14); color: #dc2626; border: 1px solid rgba(239, 68, 68, 0.35); }
.asana-status-pill.today { background: rgba(56, 189, 248, 0.14); color: #0369a1; border: 1px solid rgba(56, 189, 248, 0.35); }
html.theme-dark .asana-status-pill.today { color: #bae6fd; }
.asana-status-pill.needs-t { background: rgba(168, 85, 247, 0.14); color: #7c3aed; border: 1px solid rgba(168, 85, 247, 0.35); }
html.theme-dark .asana-status-pill.needs-t { color: #e9d5ff; }
.asana-status-pill.fitme { background: rgba(16, 185, 129, 0.14); color: #047857; border: 1px solid rgba(16, 185, 129, 0.35); }
html.theme-dark .asana-status-pill.fitme { color: #a7f3d0; }

.asana-add-task-row.asana-add-action--task[data-editing="1"] {
    border-top-style: solid;
    cursor: default;
}

.asana-add-task-inline-input {
    width: 100%;
    border: 1px solid var(--border-light);
    border-radius: 6px;
    padding: 8px 10px;
    font-size: 0.9rem;
    color: var(--text-primary);
    background: var(--bg-surface);
}

.search-highlight {
    background: #f1c40f;
    color: #1e1f21;
    padding: 0 2px;
    border-radius: 2px;
}

.status-dropdown {
    position: absolute;
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: 12px;
    padding: 8px;
    display: none;
    flex-direction: column;
    z-index: 1000;
    box-shadow: var(--shadow-md);
    min-width: 180px;
}

.status-dropdown.open {
    display: flex;
}

.status-option {
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8125rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

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

.status-option .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.status-option.completed .dot { background: #27ae60; }
.status-option.dropped .dot { background: #e74c3c; }
.status-option.in-progress .dot { background: #fbbf24; }

.toolbar-search-input {
    background: var(--bg-surface);
    border: 1px solid var(--border-light);
    color: var(--text-primary);
    border-radius: 8px;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    width: 240px;
    outline: none;
    transition: all 0.2s;
}

.toolbar-search-input:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px var(--brand-light);
}

.btn-outline-dashed {
    background: transparent;
    border: 1px dashed var(--border-light);
    color: var(--text-secondary);
    padding: 0.5rem;
    border-radius: var(--radius-md);
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes scaleUp {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(10px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.animate-fade-in {
    animation: fadeIn 0.3s ease-out forwards;
}

.animate-scale-up {
    animation: scaleUp 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Premium Modal Enhancements */
.modal-close-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: var(--bg-slate);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.modal-close-btn:hover {
    background: var(--bg-surface);
    color: var(--text-primary);
    transform: rotate(90deg);
}

/* Global task side panel: edit uses same dark frame as close (no grey .btn-ghost); no rotate on hover. */
#edit-global-task-panel.modal-close-btn:hover {
    transform: none;
    border-color: var(--border-hover);
}

.password-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s var(--transition);
    border-radius: 6px;
}

.password-toggle:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

/* Fix for dark background dropdown menus */
select.form-input option {
    background-color: var(--bg-slate);
    color: var(--text-primary);
    padding: 10px;
}

.form-textarea {
    min-height: 100px;
    resize: vertical;
}

/* Buttons - Redesigned */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 36px;
    padding: 0 1rem;
    border-radius: 8px;
    font-weight: 500;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid transparent;
    gap: 0.5rem;
    white-space: nowrap;
}


.btn-block {
    width: 100%;
}

.btn-primary {
    background: var(--accent-primary);
    color: #ffffff;
    border: 1px solid var(--accent-primary);
}

.btn-primary:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
}

.btn-outline-red {
    background: transparent;
    border: 1px solid rgba(255, 77, 77, 0.4);
    color: var(--danger);
}

.btn-outline-red:hover {
    background: rgba(255, 77, 77, 0.1);
    border-color: rgba(255, 77, 77, 0.6);
}

.btn-success {
    background: #00c864;
    color: #ffffff;
}

.btn-success:hover {
    background: #059669;
}

/* Loading States */
.spinner {
    width: 16px;
    height: 16px;
    border-top-color: var(--text-primary);
    animation: spin 0.8s linear infinite;
    display: inline-block;
}

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

.btn-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    pointer-events: none;
    opacity: 0.8;
}

.btn-secondary {
    background: var(--bg-slate);
    border-color: var(--border-light);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background: var(--bg-surface);
    border-color: var(--border-accent);
}


.btn-danger {
    background: rgba(255, 77, 77, 0.1);
    color: var(--danger);
    border-color: rgba(255, 77, 77, 0.2);
}

.btn-danger:hover {
    background: var(--danger);
    color: white;
}

/* Profile Menu - Bottom Left */
.profile-section {
    position: relative;
    padding: 1.5rem 0.75rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.4s var(--transition);
}

.sidebar.collapsed .profile-section {
    padding: 1.5rem 0.5rem;
}

.sidebar.collapsed .profile-trigger {
    padding: 0.75rem 0;
    justify-content: center;
    background: transparent;
}

.sidebar.collapsed .profile-info {
    display: none;
}

.profile-trigger {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.3s var(--transition);
}

.profile-trigger:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.avatar-circle {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--avatar-gradient);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.875rem;
    border: 2px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 0 15px rgba(77, 166, 255, 0.4);
    flex-shrink: 0;
    transition: all 0.3s var(--transition);
}

.profile-trigger:hover .avatar-circle {
    box-shadow: 0 0 25px rgba(77, 166, 255, 0.6);
    transform: scale(1.05);
}

.profile-info {
    flex: 1;
    overflow: hidden;
    text-align: left;
}

.profile-name {
    font-weight: 600;
    font-size: 0.875rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.profile-menu {
    position: absolute;
    bottom: calc(100% + 12px);
    left: 8px;
    width: 200px;
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    padding: 8px;
    display: none;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.2s ease, opacity 0.2s ease, transform 0.2s ease;
    z-index: 2000;
}

.profile-menu.active {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

.profile-menu .menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    margin: 2px 0;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    border-radius: 8px;
    transition: all 0.2s ease;
}

.profile-menu .menu-item:hover {
    background: var(--bg-slate);
    color: var(--text-primary);
}

.profile-menu .menu-item i {
    font-size: 1.1rem;
    width: 20px;
    text-align: center;
}

/* --- Added Sidebar Styles --- */
.sidebar-top {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
}

.sidebar-top nav {
    list-style: none;
    padding: 1.5rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    flex: 1;
}

.sidebar-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    height: var(--topbar-height);
    padding: 0;
    margin-bottom: 0;
    border-bottom: 1px solid var(--border-light);
    width: 100%;
    position: relative;
}

.sidebar-fast-logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 0.25rem;
}

.sidebar-fast-logo-tag {
    display: inline-flex;
    flex-direction: row;
    align-items: center;
    background: #ffffff;
    padding: 0.3rem 0.75rem 0.3rem 0.4rem;
    clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 50%, calc(100% - 12px) 100%, 0 100%);
    box-shadow: 0 3px 10px rgba(15, 80, 120, 0.18);
    border: 1px solid rgba(15, 80, 120, 0.08);
}

.sidebar-fast-logo-dax {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding-right: 0.35rem;
    margin-right: 0.4rem;
    border-right: 1px solid rgba(12, 74, 110, 0.18);
    font-weight: 800;
    font-size: 0.42rem;
    line-height: 1.05;
    letter-spacing: 0.04em;
    color: #0c4a6e;
    text-transform: uppercase;
}

.sidebar-fast-logo-fast {
    font-weight: 800;
    font-size: 0.92rem;
    letter-spacing: 0.04em;
    line-height: 1;
    color: #0c4a6e;
}

.profile-section {
    padding: 16px;
    border-top: 1px solid var(--border-light);
    margin-top: auto;
}

.sidebar.collapsed .profile-section {
    padding: 16px 8px;
}

.sidebar.collapsed .profile-menu {
    position: fixed;
    left: 90px;
    bottom: 20px;
    width: 180px;
}

/* --- Unified Sidebar Suite --- */

.sidebar-top .menu-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 0.75rem;
    margin: 0;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.925rem;
    font-weight: 500;
    transition: all 0.15s ease;
    border-radius: var(--radius-sm);
    white-space: nowrap;
    cursor: pointer;
}

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

.sidebar-top .menu-item.active {
    background-color: var(--brand-light) !important;
    color: var(--brand-primary) !important;
    box-shadow: inset 0 0 0 1px rgba(60, 180, 229, 0.1), 0 0 15px rgba(60, 180, 229, 0.08);
}

.sidebar.collapsed .menu-item.active {
    justify-content: center;
}

.sidebar-top .menu-item svg {
    width: 18px;
    height: 18px;
    stroke-width: 2;
    flex-shrink: 0;
    opacity: 0.7;
}

.sidebar.collapsed .menu-item {
    justify-content: center;
    padding: 0.625rem 9px !important;
}

.sidebar.collapsed .menu-item svg {
    margin: 0 !important;
}

.sidebar-footer {
    border-top: 1px solid var(--border-light);
    padding: 1.25rem;
    transition: padding 0.2s;
}

.profile-trigger {
    background: var(--bg-slate);
    border: 1px solid var(--border-light);
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.profile-trigger:hover {
    border-color: var(--accent-primary);
    background: var(--bg-card);
}

/* Sidebar Sections Title */
.sidebar nav div[style*="text-transform: uppercase"] {
    margin: 1.5rem 1rem 0.5rem;
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 0.05em;
    transition: opacity 0.2s;
}

.sidebar.collapsed nav div[style*="text-transform: uppercase"] {
    opacity: 0;
}


/* Consolidated with sidebar styles above */

/* Project Row Styles */
.project-row {
    display: grid;
    grid-template-columns: 2fr 3fr 1fr 1fr;
    align-items: center;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-light);
    transition: background 0.2s;
    text-decoration: none;
    color: inherit;
}

.project-row:hover {
    background: rgba(255, 255, 255, 0.02);
}

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

.project-name {
    font-weight: 600;
    color: var(--text-primary);
}

.project-desc {
    color: var(--text-muted);
    font-size: 0.875rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding-right: 1.5rem;
}

.status-pill {
    display: inline-flex;
    padding: 0.125rem 0.625rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    background: var(--bg-surface);
    color: var(--text-primary);
    border: 1px solid var(--border-light);
}

.project-meta {
    color: var(--text-muted);
    font-size: 0.8125rem;
}

/* Utilities */
.flex {
    display: flex;
}

.flex-col {
    flex-direction: column;
}

.items-center {
    align-items: center;
}

.justify-between {
    justify-content: space-between;
}

.gap-sm {
    gap: 0.5rem;
}

.gap-md {
    gap: 1rem;
}

.gap-lg {
    gap: 1.5rem;
}

.mb-sm {
    margin-bottom: 0.5rem;
}

.mb-md {
    margin-bottom: 1rem;
}

.mb-lg {
    margin-bottom: 1.5rem;
}

.mb-xl {
    margin-bottom: 2rem;
}

.mb-2xl {
    margin-bottom: 2.5rem;
}

.text-center {
    text-align: center;
}

.text-secondary {
    color: var(--text-secondary);
}

.text-muted {
    color: var(--text-muted);
}

.text-xs {
    font-size: 0.75rem;
}

.text-danger {
    color: var(--danger);
}

.text-success {
    color: var(--success);
}

.font-bold {
    font-weight: 700;
}

.uppercase {
    text-transform: uppercase;
}

.grid {
    display: grid;
}

.grid-cols-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.mt-xl {
    margin-top: 2rem;
}

.p-md {
    padding: 1rem;
}

.mb-xs {
    margin-bottom: 0.25rem;
}

.text-danger {
    color: var(--danger);
}

/* Modals */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-glass);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.modal {
    background: var(--bg-card);
    width: 100%;
    max-width: 480px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-premium);
    overflow: hidden;
}

.modal-task {
    background: var(--bg-surface);
    border-color: rgba(255, 255, 255, 0.08);
}

.modal-task .modal-header {
    background: var(--bg-card);
}

.modal-task .modal-body {
    background: var(--bg-surface);
}

.modal-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-surface);
    color: var(--text-primary);
}

.modal-header h2,
.modal-header h3,
.modal-header h4 {
    color: var(--text-primary);
}

.modal-body {
    padding: 1.5rem;
    background: var(--bg-card);
    color: var(--text-primary);
}

.modal-footer {
    padding: 1rem 1.5rem;
    background: var(--bg-slate);
    border-top: 1px solid var(--border-light);
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
}

/* Confirmation dialog (window.showConfirmModal) — avoids unstylable native confirm() */
.confirm-modal-overlay.modal-overlay {
    padding: 1rem;
    box-sizing: border-box;
}

.modal.confirm-modal {
    max-width: 420px;
    width: 100%;
    margin: 0;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow:
        0 24px 48px rgba(0, 0, 0, 0.45),
        0 0 0 1px rgba(255, 255, 255, 0.04);
}

.confirm-modal .modal-header {
    padding: 1.125rem 1.35rem;
    border-bottom: 1px solid var(--border-light);
}

.confirm-modal-title {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text-primary);
    line-height: 1.35;
}

.confirm-modal .modal-body {
    padding: 1rem 1.35rem 1.35rem;
}

.confirm-modal-message {
    margin: 0;
    font-size: 0.9375rem;
    line-height: 1.55;
    color: var(--text-secondary);
}

.confirm-modal-footer.modal-footer {
    padding: 1rem 1.35rem;
    gap: 0.625rem;
    align-items: center;
    flex-wrap: wrap;
}

.confirm-modal-btn-cancel {
    min-height: 40px;
    padding: 0.5rem 1.15rem;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-primary);
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    transition:
        background 0.15s ease,
        border-color 0.15s ease,
        color 0.15s ease;
}

.confirm-modal-btn-cancel:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.22);
}

.confirm-modal-btn-ok {
    min-height: 40px;
    padding: 0.5rem 1.35rem;
    border-radius: 8px;
    border: none;
    background: var(--accent-primary, #3b82f6);
    color: #fff;
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    transition:
        filter 0.15s ease,
        transform 0.1s ease,
        box-shadow 0.15s ease;
}

.confirm-modal-btn-ok:hover {
    filter: brightness(1.08);
}

.confirm-modal-btn-ok:active {
    transform: scale(0.98);
}

.confirm-modal--danger .confirm-modal-btn-ok {
    background: var(--danger, #dc2626);
}

.confirm-modal--danger .confirm-modal-btn-ok:hover {
    filter: brightness(1.12);
}

/* More Utilities */
.flex-1 {
    flex: 1;
}

.flex-2 {
    flex: 2;
}

.relative {
    position: relative;
}

.p-sm {
    padding: 0.5rem;
}

.p-md {
    padding: 1rem;
}

.p-lg {
    padding: 1.5rem;
}

.font-medium {
    font-weight: 500;
}

.font-semibold {
    font-weight: 600;
}

.font-bold {
    font-weight: 700;
}

.text-xs {
    font-size: 0.75rem;
}

.text-sm {
    font-size: 0.875rem;
}

.text-xl {
    font-size: 1.5rem;
}

.text-2xl {
    font-size: 2rem;
}

.text-3xl {
    font-size: 3rem;
    line-height: 1;
}

.text-gradient {
    background: linear-gradient(to right, var(--text-primary), var(--text-secondary));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.overflow-hidden {
    overflow: hidden;
}

.text-right {
    text-align: right;
}

.btn-sm {
    height: 30px;
    padding: 0 0.75rem;
    font-size: 0.8125rem;
}

/* Navigation Controls - Centralized */
.nav-arrows {
    display: flex;
    align-items: center;
    gap: 2px;
    background: rgba(255, 255, 255, 0.05);
    padding: 2px;
    border-radius: 10px;
    border: 1px solid var(--border-light);
}

.nav-arrow-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s;
}

.nav-arrow-btn:hover {
    background: var(--accent-active);
    color: var(--text-primary);
}

.nav-arrow-btn svg {
    width: 20px;
    height: 20px;
}

.segmented-control {
    display: flex;
    background: rgba(255, 255, 255, 0.05);
    padding: 2px;
    border-radius: 10px;
    border: 1px solid var(--border-light);
}

.segmented-control .btn {
    border: none;
    border-radius: 7px;
    height: 30px;
    background: transparent;
    color: var(--text-secondary);
}

.segmented-control .btn.active {
    background: var(--text-primary);
    color: var(--bg-obsidian);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}


/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--border-light);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--border-accent);
}

/* Task Sections Implementation styles */
.task-group-section {
    background: var(--bg-surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.3s ease;
}

.task-group-section:hover {
    box-shadow: var(--shadow-md);
}

.task-group-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    background: rgba(var(--bg-slate-rgb), 0.3);
    border-radius: var(--radius-sm);
    margin-bottom: 0.5rem;
    border-left: 4px solid transparent;
}

.task-group-header.urgent { border-left-color: #ef4444; color: #ef4444; background: rgba(239, 68, 68, 0.05); }
.task-group-header.high { border-left-color: #f59e0b; color: #f59e0b; background: rgba(245, 158, 11, 0.05); }
.task-group-header.medium { border-left-color: var(--accent-primary); color: var(--accent-primary); }
.task-group-header.low { border-left-color: #10b981; color: #10b981; }

.task-group-count {
    font-size: 0.7rem;
    background: var(--bg-dark);
    padding: 2px 8px;
    border-radius: 10px;
    opacity: 0.7;
}

/* Task Row Layout - Grid */
.task-row {
    display: grid;
    grid-template-columns: 80px 1fr 120px 150px 120px;
    align-items: center;
    padding: 0.75rem 1rem;
    gap: 1rem;
    cursor: pointer;
    transition: background 0.2s;
    border-bottom: 1px solid var(--border-light);
    font-size: 0.875rem;
}

.task-row:hover {
    background: var(--border-light);
}

.task-cell {
    display: flex;
    align-items: center;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.task-priority-cell {
    justify-content: center;
}

.task-title-cell {
    font-weight: 500;
    color: var(--text-primary);
    font-size: 0.95rem;
}


.task-assignee-cell {
    color: var(--text-secondary);
    gap: 0.5rem;
}

.task-date-cell {
    color: var(--text-muted);
    font-size: 0.8125rem;
    justify-content: flex-end;
}

.task-actions-cell {
    justify-content: center;
}

/* Status Pills - Redefined */
.status-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    white-space: nowrap;
}

/* Priority Colors */
.priority-low {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.priority-medium {
    background: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.priority-high {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.priority-urgent {
    background: #ef4444;
    color: #ffffff;
    box-shadow: 0 2px 4px rgba(239, 68, 68, 0.3);
}

/* Status Colors */
.status-todo {
    background: var(--border-light);
    color: var(--text-secondary);
    border: 1px solid var(--border-accent);
}

.status-in_progress {
    background: rgba(251, 191, 36, 0.2);
    color: #854d0e;
    border: 1px solid rgba(234, 179, 8, 0.45);
}

html.theme-dark .status-in_progress {
    color: #fef3c7;
    background: rgba(234, 179, 8, 0.22);
    border-color: rgba(250, 204, 21, 0.45);
}

.status-blocked {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.status-done {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.status-backlog {
    background: rgba(148, 163, 184, 0.12);
    color: var(--text-secondary);
    border: 1px solid var(--border-light);
}

.status-paused {
    background: rgba(245, 158, 11, 0.12);
    color: #b45309;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

html.theme-dark .status-paused {
    color: #fde68a;
}

.status-needs_redo {
    background: rgba(249, 115, 22, 0.14);
    color: #c2410c;
    border: 1px solid rgba(249, 115, 22, 0.4);
}

html.theme-dark .status-needs_redo {
    color: #fdba74;
    background: rgba(249, 115, 22, 0.2);
    border-color: rgba(251, 146, 60, 0.5);
}

.status-active {
    background: rgba(241, 196, 15, 0.16);
    color: #854d0e;
    border: 1px solid rgba(241, 196, 15, 0.35);
}

html.theme-dark .status-active {
    color: #fef3c7;
    background: rgba(241, 196, 15, 0.2);
    border-color: rgba(241, 196, 15, 0.4);
}

.status-completed {
    background: rgba(34, 197, 94, 0.15);
    color: #166534;
    border: 1px solid rgba(34, 197, 94, 0.35);
}

html.theme-dark .status-completed {
    color: #dcfce7;
    background: rgba(21, 128, 61, 0.8);
    border-color: rgba(74, 222, 128, 0.9);
}

.status-dropped {
    background: rgba(239, 68, 68, 0.14);
    color: #991b1b;
    border: 1px solid rgba(239, 68, 68, 0.35);
}

html.theme-dark .status-dropped {
    color: #fee2e2;
    background: rgba(153, 27, 27, 0.75);
    border-color: rgba(248, 113, 113, 0.85);
}

/* Task Context Menu */
.task-menu-container {
    position: relative;
    opacity: 0;
    transition: opacity 0.2s;
}

.task-row:hover .task-menu-container,
.task-menu-container.active {
    opacity: 1;
}

.task-menu-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    width: 28px;
    height: 28px;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    line-height: 1;
    transition: all 0.2s;
}

.task-menu-btn:hover,
.task-menu-container.active .task-menu-btn {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.task-menu-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    width: 140px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 0.25rem;
    z-index: 100;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    display: none;
}

.task-menu-dropdown.active {
    display: block;
}

.task-menu-item {
    display: block;
    width: 100%;
    padding: 0.5rem 0.75rem;
    text-align: left;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 0.8125rem;
    cursor: pointer;
    border-radius: var(--radius-sm);
}

.task-menu-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.task-menu-item.text-danger {
    color: var(--danger);
}

.task-menu-item.text-danger:hover {
    background: rgba(239, 68, 68, 0.1);
}

/* Filter Toolbar Wrapper (Layout Only) */
.filter-toolbar {
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 0;
    background: transparent;
    border: none;
}

.filter-group-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
}

.filter-label {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.filter-divider {
    width: 1px;
    height: 24px;
    background: var(--border-light);
    opacity: 0.5;
}

/* Segmented Pill Track */
.filter-group {
    display: flex;
    background: var(--bg-dark);
    border: 1px solid var(--border-light);
    border-radius: 20px;
    padding: 3px;
    gap: 0;
}

/* Segment Button */
.filter-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 4px 14px;
    font-size: 0.8125rem;
    font-weight: 500;
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
}

.filter-btn:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

/* Active Segment (The "Pill") */
.filter-btn.active {
    background: var(--bg-surface);
    color: var(--text-primary);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2), 0 1px 0 rgba(255, 255, 255, 0.05) inset;
    font-weight: 600;
    border: none;
}

/* Print Styles for Reports */
@media print {
    body {
        background: white !important;
        color: black !important;
    }

    .sidebar,
    .print-hide,
    .page-header,
    .navbar {
        display: none !important;
    }

    .main-content {
        padding: 0 !important;
        margin: 0 !important;
        background: none !important;
        overflow: visible !important;
    }

    .card {
        background: transparent !important;
        border: none !important;
        box-shadow: none !important;
        padding: 0 !important;
    }

    .data-table {
        width: 100% !important;
        border-collapse: collapse !important;
    }

    .data-table th,
    .data-table td {
        border-bottom: 1px solid #e4e4e7 !important;
        color: #18181b !important;
        padding: 12px !important;
    }

    .report-table {
        width: 100% !important;
        border-collapse: collapse !important;
        page-break-inside: auto !important;
    }

    .report-table tr {
        page-break-inside: avoid !important;
        page-break-after: auto !important;
    }

    .report-table th,
    .report-table td {
        border-bottom: 1px solid #e4e4e7 !important;
        color: #18181b !important;
        padding: 10px 8px !important;
    }

    .report-table th {
        background-color: #f4f4f5 !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    .status-pill {
        border: 1px solid #d4d4d8 !important;
        background: transparent !important;
        color: #18181b !important;
        padding: 2px 6px !important;
    }

    .report-header h2 svg,
    .report-table td svg {
        display: none !important;
        /* Hide decorative icons in print */
    }

    .status-pill {
        border: 1px solid #000 !important;
        background: transparent !important;
        color: black !important;
        padding: 2px 6px !important;
    }

    @page {
        margin: 1cm;
        size: auto;
    }
}

/* Page Loader Transition */
.page-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-card);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.5s var(--transition);
}

.page-loader.active {
    opacity: 1;
    visibility: visible;
}

.page-loader .loader-content {
    text-align: center;
    animation: cloak-reveal 0.8s cubic-bezier(0.2, 0, 0, 1) forwards;
}

.page-loader .loader-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 0 auto 1.1rem auto;
    --rotor-size: 200px;
    --hub-size: 90px;
    --caliper-color: #3cb4e5;
    --metal-light: #ffffff;
    --metal-mid: #3cb4e5;
    --metal-dark: #1a6d8f;
    --hub-bg: #2b2d31;
    --hole-color: #111;
}

.page-loader .disc-loader {
    position: relative;
    width: var(--rotor-size);
    height: var(--rotor-size);
    border-radius: 50%;
    filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.28));
}

.page-loader .rotor-base {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background-color: var(--metal-light);
    border: 2px solid var(--metal-mid);
}

.page-loader .rotor-lines {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: repeating-radial-gradient(circle, transparent, transparent 3px, rgba(60, 180, 229, 0.15) 4px, rgba(60, 180, 229, 0.15) 6px);
    z-index: 1;
}

.page-loader .rotor-spinner {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    animation: spin-rotor 1.2s linear infinite;
    z-index: 2;
}

.page-loader .hole-group {
    position: absolute;
    width: 100%;
    height: 100%;
    transform: rotate(var(--r));
}

.page-loader .hole {
    position: absolute;
    width: 8px;
    height: 8px;
    background-color: var(--hole-color);
    border-radius: 50%;
    box-shadow: inset 2px 2px 4px rgba(0, 0, 0, 0.6);
}

.page-loader .hole.h1 { top: 8%; left: 45%; }
.page-loader .hole.h2 { top: 15%; left: 52%; }
.page-loader .hole.h3 { top: 22%; left: 59%; }

.page-loader .hub {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: var(--hub-size);
    height: var(--hub-size);
    border-radius: 50%;
    background-color: var(--hub-bg);
    border: 2px solid #111;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.4);
    z-index: 3;
}

.page-loader .hub-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background-color: #111;
    border: 2px solid #333;
}

.page-loader .lug-group {
    position: absolute;
    width: 100%;
    height: 100%;
    transform: rotate(var(--r));
}

.page-loader .lug {
    position: absolute;
    top: 12%;
    left: 50%;
    transform: translateX(-50%);
    width: 14px;
    height: 14px;
    background-color: #555;
    border-radius: 50%;
    border: 1px solid #111;
    box-shadow: 1px 1px 3px rgba(0, 0, 0, 0.4);
}

.page-loader .caliper {
    position: absolute;
    top: 50%;
    right: -7.5%;
    transform: translateY(-50%);
    width: 27.5%;
    height: 55%;
    background-color: var(--caliper-color);
    border-radius: 20px 10px 10px 20px;
    z-index: 10;
    box-shadow: -4px 0 10px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 15% 0;
    box-sizing: border-box;
    border-left: 2px solid var(--metal-dark);
}

.page-loader .caliper::before,
.page-loader .caliper::after {
    content: '';
    width: 12px;
    height: 12px;
    background-color: #222;
    border-radius: 50%;
    margin: 0 auto;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.7);
    border: 1px solid #000;
}

.page-loader h2 {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: 0;
    margin-bottom: 8px;
    color: var(--text-primary);
    text-transform: none;
}

.page-loader p {
    margin-top: 0;
    color: var(--text-secondary);
    font-size: 0.95rem;
}

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

@keyframes cloak-shimmer { to { background-position: -200% 0; } }
@keyframes cloak-reveal {
    from { opacity: 0; transform: translateY(20px) scale(0.95); }
}

/* Flatpickr Theme Overrides */
.flatpickr-calendar {
    background: var(--bg-slate) !important;
    border: 1px solid var(--border-light) !important;
    box-shadow: var(--shadow-premium) !important;
    color: var(--text-primary) !important;
    border-radius: var(--radius-md) !important;
    font-family: var(--font-body) !important;
    z-index: 10060 !important;
}

.flatpickr-calendar.arrowTop:before, 
.flatpickr-calendar.arrowTop:after {
    border-bottom-color: var(--bg-slate) !important;
}

.flatpickr-calendar.arrowBottom:before, 
.flatpickr-calendar.arrowBottom:after {
    border-top-color: var(--bg-slate) !important;
}

.flatpickr-month {
    color: var(--text-primary) !important;
    fill: var(--text-primary) !important;
}

.flatpickr-current-month {
    font-weight: 600 !important;
}

.flatpickr-current-month .flatpickr-monthDropdown-months {
    background: var(--bg-slate) !important;
}

.flatpickr-weekday {
    color: var(--text-secondary) !important;
    font-weight: 600 !important;
    font-size: 0.75rem !important;
}

.flatpickr-day {
    color: var(--text-primary) !important;
    border-radius: var(--radius-sm) !important;
    transition: all 0.2s ease !important;
}

.flatpickr-day:hover {
    background: var(--bg-surface) !important;
}

.flatpickr-day.today {
    border-color: var(--accent-primary) !important;
    color: var(--accent-primary) !important;
}

.flatpickr-day.selected, 
.flatpickr-day.startRange, 
.flatpickr-day.endRange {
    background: var(--accent-primary) !important;
    border-color: var(--accent-primary) !important;
    color: #ffffff !important;
    font-weight: 700 !important;
}

.flatpickr-day.flatpickr-disabled, 
.flatpickr-day.flatpickr-disabled:hover {
    color: var(--text-muted) !important;
    opacity: 0.3 !important;
}

.flatpickr-months .flatpickr-prev-month, 
.flatpickr-months .flatpickr-next-month {
    color: var(--text-primary) !important;
    fill: var(--text-primary) !important;
}

.flatpickr-months .flatpickr-prev-month:hover, 
.flatpickr-months .flatpickr-next-month:hover {
    color: var(--accent-primary) !important;
    fill: var(--accent-primary) !important;
}

/* Premium Modal Enhancements */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.modal {
    background: var(--bg-slate);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-premium);
    width: 100%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
    margin: 20px;
}

.modal form {
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
}

.modal-header {
    padding: 1.25rem 2rem;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
    background: var(--bg-surface);
    color: var(--text-primary);
}

.modal-header h2,
.modal-header h3,
.modal-header h4 {
    color: var(--text-primary);
}

.modal-body {
    padding: 1.5rem 2rem;
    overflow-y: auto;
    flex: 1;
    background: var(--bg-card);
    color: var(--text-primary);
}

.modal-footer {
    padding: 1.25rem 2rem;
    border-top: 1px solid var(--border-light);
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    flex-shrink: 0;
}

/* --- Visual Flow Builder Styles --- */
.workflow-flex-layout {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    height: 100%;
}

.flow-builder-section {
    padding: 2rem;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    min-height: 240px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow-x: auto;
}

.flow-container {
    display: flex;
    align-items: center;
    gap: 0;
}

.flow-node {
    width: 220px;
    background: var(--bg-surface);
    border: 1px solid var(--border-light);
    border-radius: 12px;
    padding: 1.25rem;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.flow-node:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(0,0,0,0.3);
}

.flow-node.active {
    border-color: var(--accent);
    background: rgba(69, 115, 210, 0.05);
}

.flow-node-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 700;
}

.node-when .flow-node-header { color: #4573d2; }
.node-check .flow-node-header { color: #f59e0b; }
.node-do .flow-node-header { color: #10b981; }

.flow-node-content {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-primary);
    min-height: 24px;
}

.flow-node-content .placeholder {
    opacity: 0.4;
    font-weight: 400;
    font-style: italic;
}

.flow-connector {
    width: 50px;
    height: 2px;
    background: var(--border-light);
    position: relative;
    opacity: 0.6;
}

.flow-connector::after {
    content: '';
    position: absolute;
    right: -2px;
    top: -3px;
    width: 0;
    height: 0;
    border-top: 4px solid transparent;
    border-bottom: 4px solid transparent;
    border-left: 6px solid var(--border-light);
}

.flow-action-stack {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.flow-action-tag {
    font-size: 0.72rem;
    padding: 3px 8px;
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
    border-radius: 4px;
    display: flex;
    align-items: center;
    gap: 5px;
}

/* Saved Rules Section */
.saved-rules-section {
    border-top: 1px solid var(--border-light);
    padding-top: 1.5rem;
}

.saved-rules-title {
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    margin-bottom: 1rem;
    opacity: 0.6;
}

.rule-summary-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 1rem 1.5rem;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.2s;
}

.rule-summary-card:hover {
    border-color: var(--accent);
    background: rgba(255,255,255,0.02);
}

.rule-path {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 0.875rem;
    color: var(--text-primary);
}

.rule-step {
    display: flex;
    align-items: center;
    gap: 8px;
}

.rule-arrow {
    opacity: 0.3;
}

.rule-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Full-Page Workflow Builder & Side Panel */
.workflow-tab-content {
    display: none;
    height: calc(100vh - 120px);
    position: relative;
    overflow: hidden;
    min-width: 0;
    max-width: 100%;
}

.workflow-tab-content.active {
    display: flex;
}

.workflow-builder-view {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 2rem;
    background: var(--bg-surface);
    min-width: 0;
    max-width: 100%;
}

#workflow-builder-view {
    min-width: 0;
    max-width: 100%;
}

.workflow-management-view {
    max-width: 100%;
    overflow-x: clip;
}

/* Side panel styles: single source — see “Global Side Panel” later (avoids transform/right conflicts). */

/* ---- WORKFLOW BUILDER V2 ---- */
.workflow-flex-layout {
    display: flex;
    gap: 2rem;
    height: 100%;
}

.builder-area {
    flex: 1;
    min-width: 0;
}

.saved-rules-section {
    width: 380px;
    background: var(--bg-card);
    border-left: 1px solid var(--border-light);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.flow-container {
    padding: 6rem 2rem;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 0;
}

.flow-node {
    width: 280px;
    background: var(--bg-surface);
    border: 1.5px solid var(--border-light);
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s var(--transition);
    flex-shrink: 0;
}

.flow-node:hover {
    transform: translateY(-5px);
    border-color: var(--accent-primary);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.flow-node-header {
    background: rgba(255, 255, 255, 0.03);
    padding: 0.6rem 1rem;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    gap: 8px;
}

.flow-node-content {
    padding: 1.25rem 1rem;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    text-align: center;
    min-height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.node-when { border-top: 4px solid #fbcb09; border-left: 1.5px solid var(--border-light); }
.node-do   { border-top: 4px solid #4573d2; border-left: 1.5px solid var(--border-light); }
.node-check { border-top: 4px solid #a2a0a2; border-left: 1.5px solid var(--border-light); }

.flow-connector {
    width: 60px;
    height: 2px;
    background: var(--border-light);
    position: relative;
    flex-shrink: 0;
}

.flow-connector::after {
    content: "";
    position: absolute;
    right: -5px;
    top: 50%;
    transform: translateY(-50%);
    border-top: 6px solid transparent;
    border-bottom: 6px solid transparent;
    border-left: 8px solid var(--border-light);
}

.trigger-option-item:hover {
    background: rgba(69, 115, 210, 0.08) !important;
    border-color: var(--accent-primary) !important;
    transform: translateX(4px);
}

.rules-list-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 1.5rem;
}

.rule-summary-card {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: 16px;
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s var(--transition);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.rule-summary-card:hover {
    border-color: var(--accent-primary);
    transform: translateY(-3px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15);
}

.rule-trigger-label {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.rule-path {
    display: flex;
    align-items: center;
    gap: 8px;
}

.rule-step {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.03);
    padding: 4px 10px;
    border-radius: 8px;
}

/* ─── Global Side Panel ─────────────────────────────────────── */
.side-panel-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    z-index: 9998;
    backdrop-filter: blur(2px);
}
.side-panel-overlay.active { display: block; }

.side-panel {
    position: fixed;
    top: 0;
    right: 0;
    width: 440px;
    max-width: 100vw;
    height: 100%;
    background: var(--bg-card);
    border-left: 1px solid var(--border-light);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    box-shadow: -8px 0 32px rgba(0, 0, 0, 0.3);
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}
.side-panel.active { transform: translateX(0); }

/* Task detail / edit — wider than workflow defaults */
.side-panel.side-panel--task-wide {
    width: min(720px, 100vw);
}
.side-panel.side-panel--task-edit {
    width: min(520px, 100vw);
}
.side-panel-body.side-panel-body--task {
    padding: 0;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}

.side-panel .side-panel-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.02);
    flex-shrink: 0;
}
.side-panel .side-panel-body {
    flex: 1;
    overflow-y: auto;
    padding: 2rem;
    color: var(--text-primary);
}
.side-panel .side-panel-footer {
    padding: 1.25rem 1.5rem;
    border-top: 1px solid var(--border-light);
    display: flex;
    gap: 1rem;
    background: rgba(255, 255, 255, 0.02);
    flex-shrink: 0;
}
.side-panel .side-panel-footer .btn { flex: 1; }

/* Workflow CHECK IF / DO THIS row controls — keep above scroll/stacking quirks */
.check-if-remove,
.do-action-remove {
    position: relative;
    z-index: 2;
    cursor: pointer;
    flex-shrink: 0;
    touch-action: manipulation;
}

/* ─── Tasks UI: dark-mode contrast (forms + slide-over + modals) ─────────── */
.task-desc-empty {
    color: var(--text-secondary);
    font-style: italic;
}

/* Task description: Excel-paste HTML tables */
.task-description-html,
.task-description-snippet--table {
    overflow-x: auto;
    max-width: 100%;
}

.task-description-snippet--table {
    max-height: 7.5rem;
    overflow-y: auto;
}

table.task-desc-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
    line-height: 1.35;
    color: var(--text-primary);
    background: var(--bg-main);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm, 6px);
}

table.task-desc-table th,
table.task-desc-table td {
    border: 1px solid var(--border-light);
    padding: 0.35rem 0.5rem;
    text-align: left;
    vertical-align: top;
}

table.task-desc-table th {
    font-weight: 700;
    background: var(--bg-slate, var(--bg-surface));
    color: var(--text-primary);
}

html.theme-dark table.task-desc-table {
    background: rgba(255, 255, 255, 0.03);
}

html.theme-dark table.task-desc-table th {
    background: rgba(255, 255, 255, 0.06);
}

/* Import grid modal (Excel → sections + tasks) */
.import-grid-textarea {
    min-height: 168px;
    width: 100%;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.82rem;
    line-height: 1.4;
}

.import-grid-modal .import-grid-help strong {
    color: var(--text-primary);
    font-weight: 700;
}

/* Import modal — layout + column mapping (native selects tuned for dark / light) */
.import-grid-modal {
    color-scheme: dark;
}

body.light-theme .import-grid-modal {
    color-scheme: light;
}

.import-grid-modal-body {
    padding-top: 0.15rem;
}

.import-layout-fieldset {
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md, 10px);
    padding: 0.75rem 1rem 0.85rem;
    margin: 0 0 1rem 0;
    background: var(--bg-surface, rgba(255, 255, 255, 0.02));
}

.import-layout-legend {
    font-size: 0.7rem;
    font-weight: 800;
    color: var(--text-secondary);
    padding: 0 0.4rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.import-layout-option {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    margin-bottom: 0.5rem;
    font-size: 0.86rem;
    line-height: 1.45;
    color: var(--text-secondary);
    cursor: pointer;
}

.import-layout-option:last-of-type {
    margin-bottom: 0;
}

.import-layout-radio {
    margin-top: 0.22rem;
    width: 1rem;
    height: 1rem;
    flex-shrink: 0;
    accent-color: var(--accent-primary, #3b82f6);
    cursor: pointer;
}

.import-layout-option strong {
    color: var(--text-primary);
    font-weight: 650;
}

.import-board-help,
.import-table-hint {
    font-size: 0.86rem;
    color: var(--text-secondary);
    line-height: 1.52;
    margin: 0 0 1rem 0;
}

.import-board-help strong,
.import-table-hint strong {
    color: var(--text-primary);
}

.import-table-options {
    margin-bottom: 1rem;
}

.import-header-row-label {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    flex-wrap: wrap;
    margin-bottom: 0.55rem !important;
}

.import-header-row-input {
    width: 4.75rem !important;
    min-width: 4.75rem;
    padding: 0.5rem 0.65rem !important;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    text-align: center;
}

.import-column-map-scroll {
    max-height: 260px;
    overflow-y: auto;
    overflow-x: hidden;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md, 10px);
    padding: 0.4rem 0.25rem 0.5rem 0.5rem;
    background: var(--bg-main, #0f1219);
    scrollbar-color: rgba(148, 163, 184, 0.35) transparent;
    scrollbar-width: thin;
}

.import-column-map-scroll::-webkit-scrollbar {
    width: 8px;
}

.import-column-map-scroll::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.28);
    border-radius: 99px;
}

.import-column-map-scroll::-webkit-scrollbar-thumb:hover {
    background: rgba(148, 163, 184, 0.45);
}

.import-column-map-msg {
    margin: 0.35rem 0.25rem;
    font-size: 0.85rem;
    line-height: 1.4;
}

.import-column-map-msg--muted {
    color: var(--text-muted);
}

.import-column-map-msg--warn {
    color: var(--danger, #f87171);
}

.import-map-row {
    display: grid;
    grid-template-columns: 2.1rem minmax(0, 1fr) minmax(11rem, 1.42fr);
    gap: 0.6rem 0.75rem;
    align-items: stretch;
    padding: 0.45rem 0.35rem 0.45rem 0.25rem;
    margin-bottom: 0.2rem;
    border-radius: 8px;
    border: 1px solid transparent;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.import-map-row:hover {
    background: rgba(255, 255, 255, 0.03);
    border-color: var(--border-light);
}

body.light-theme .import-map-row:hover {
    background: rgba(0, 0, 0, 0.03);
}

.import-map-row__idx {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 0.15rem;
    font-size: 0.72rem;
    font-weight: 800;
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.02em;
}

.import-map-row__name {
    display: flex;
    align-items: center;
    min-width: 0;
    padding: 0.15rem 0;
    font-size: 0.84rem;
    font-weight: 600;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.import-map-row__select-wrap {
    min-width: 0;
    display: flex;
    align-items: center;
}

.import-grid-modal select.import-col-map-select {
    width: 100%;
    min-height: 2.5rem;
    padding: 0.5rem 2.75rem 0.5rem 0.75rem !important;
    font-size: 0.8125rem !important;
    font-weight: 550;
    line-height: 1.35;
    border-radius: 10px !important;
    background-color: var(--bg-dark, #141824);
    border-color: rgba(148, 163, 184, 0.22);
    cursor: pointer;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.65rem center;
}

body.light-theme .import-grid-modal select.import-col-map-select {
    background-color: var(--bg-surface, #fff);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%23475569' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    border-color: rgba(15, 23, 42, 0.12);
}

.import-grid-modal select.import-col-map-select:hover {
    border-color: rgba(148, 163, 184, 0.45);
    background-color: var(--bg-surface, #1a1f2e);
}

body.light-theme .import-grid-modal select.import-col-map-select:hover {
    border-color: rgba(15, 23, 42, 0.22);
    background-color: #f8fafc;
}

.import-grid-modal select.import-col-map-select:focus {
    border-color: var(--accent-primary, #4da6ff);
    box-shadow: 0 0 0 3px rgba(77, 166, 255, 0.2);
    outline: none;
}

.import-grid-modal select.import-col-map-select optgroup {
    font-weight: 750;
    font-size: 0.72rem;
    color: var(--text-muted);
    font-style: normal;
}

.import-grid-modal select.import-col-map-select option {
    font-weight: 500;
    font-size: 0.875rem;
    padding: 0.45rem 0.5rem;
    background-color: var(--bg-slate, #1e2433);
    color: var(--text-primary);
}

body.light-theme .import-grid-modal select.import-col-map-select option {
    background-color: #fff;
    color: #1e293b;
}

.import-grid-summary {
    line-height: 1.45;
}

#global-task-panel {
    background: var(--bg-card) !important;
    color: var(--text-primary);
}

#global-task-panel .modal-header h2,
#task-detail-modal .modal-header h2 {
    color: var(--text-primary) !important;
}

/* New / rename section modal (form#section-form) */
.modal-overlay:has(form#section-form) .modal {
    background: var(--bg-card) !important;
    color: var(--text-primary);
}

.modal-overlay:has(form#section-form) .modal-header h2 {
    color: var(--text-primary) !important;
}

.modal-overlay:has(form#section-form) .modal-body {
    background: var(--bg-card) !important;
    color: var(--text-primary);
}

/* Global notifications (replaces native alert popups) */
.app-toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 12000;
    display: flex;
    flex-direction: column-reverse;
    gap: 10px;
    pointer-events: none;
}

.app-toast {
    min-width: 260px;
    max-width: 420px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border-radius: 10px;
    border: 1px solid var(--border-light);
    background: var(--bg-card);
    color: var(--text-primary);
    box-shadow: var(--shadow-md);
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1.4;
    transform: translateY(8px);
    opacity: 0;
    transition: opacity 0.18s ease, transform 0.18s ease;
}

.app-toast.show {
    opacity: 1;
    transform: translateY(0);
}

.app-toast-icon {
    width: 20px;
    height: 20px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 0.75rem;
    font-weight: 700;
}

.app-toast-success .app-toast-icon {
    background: color-mix(in srgb, var(--success) 22%, transparent);
    color: var(--success);
}

.app-toast-error .app-toast-icon {
    background: color-mix(in srgb, var(--danger) 22%, transparent);
    color: var(--danger);
}

.app-toast-info .app-toast-icon {
    background: color-mix(in srgb, var(--accent-primary) 22%, transparent);
    color: var(--accent-primary);
}

.app-toast-message {
    word-break: break-word;
}

.assignee-search-wrap {
    position: relative;
}

.assignee-search-results {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    z-index: 1400;
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: 10px;
    box-shadow: var(--shadow-md);
    max-height: 260px;
    overflow-y: auto;
    padding: 6px;
}

.assignee-search-item {
    width: 100%;
    border: 0;
    background: transparent;
    color: var(--text-primary);
    border-radius: 8px;
    padding: 8px 10px;
    text-align: left;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.assignee-search-item:hover {
    background: var(--bg-surface);
}

.assignee-main {
    font-size: 0.86rem;
    font-weight: 600;
    line-height: 1.3;
}

.assignee-secondary {
    font-size: 0.75rem;
    color: var(--text-secondary);
    line-height: 1.2;
}

.assignee-search-empty {
    padding: 10px;
    color: var(--text-secondary);
    font-size: 0.8rem;
}
