/* TaskMaster base styles — dark mode */
:root {
    --bg: #1a1b1e;
    --bg-elevated: #25262b;
    --bg-code: #363639;
    --text: #e4e4e7;
    --text-muted: #a1a1aa;
    --link-hover: #c4c4c8;  /* slightly darker than --text for link hover/active */
    --border: #3f3f46;
    --accent: #3b82f6;
    --accent-hover: #2563eb;
    --error: #f87171;
    --delete: #f97373;
    --success: #4ade80;
    --input-bg: #27272a;
    --project-bg: #363639;
    --feature-bg: #25262b;
}

* { box-sizing: border-box; }

/* Base typography: 16px base for mobile readability, 1.5 line-height */
html {
    font-size: 16px;
    max-width: 100%;
    overflow-x: hidden;
}
body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    margin: 0;
    padding: 1rem;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    max-width: 100%;
    overflow-x: hidden;
    line-height: 1.5;
    -webkit-text-size-adjust: 100%;
}

/* App layout: left nav + page area (protected pages) */
body.app-body {
    padding: 0;
}
.app-wrapper {
    display: flex;
    min-height: 100vh;
}
@media (min-width: 768px) {
    .app-wrapper {
        height: 100vh;
    }
}
.left-nav {
    flex: 0 0 auto;
    width: 12rem;
    background: var(--bg-elevated);
    border-right: 1px solid var(--border);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}
.left-nav-inner {
    padding: 1rem 0;
}
.left-nav-list {
    list-style: none;
    margin: 0 0 1rem;
    padding: 0;
}
.left-nav-list li {
    margin: 0;
}
.left-nav-list a {
    display: block;
    padding: 0 1.5rem;
    color: var(--text);
    text-decoration: none;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}
.left-nav-list a:hover {
    background: var(--border);
    color: var(--link-hover);
}
.left-nav-section {
    margin: 0.75rem 1rem 0.35rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.left-nav-muted {
    display: block;
    padding: 0 1.5rem;
    font-size: 0.875rem;
    color: var(--text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}
.page-area {
    flex: 1;
    min-width: 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
}
.page-area .page-actions {
    padding-left: 1rem;
    padding-right: 1rem;
}
/* .page-area .tasks-toolbar {
} */
.page-area main {
    flex: 1;
    padding: 0;
}
.tasks-main > .error,
.tasks-main > .text-muted {
    padding-left: 1rem;
    padding-right: 1rem;
}
.page-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-height: 3rem;
    padding: 0;
    border-bottom: 1px solid var(--border);
    background: var(--bg-elevated);
    flex-shrink: 0;
}
.page-header-title {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 600;
}
body.app-body .page-header {
    margin-bottom: 0;
}
.page-actions {
    margin-bottom: 1rem;
    font-size: 0.667em;  /* ~2/3 size for buttons and text in this area */
}
.page-actions .btn {
    display: inline-block;
    padding: 0.5em 1em;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 4px;
    text-decoration: none;
    font-size: 1em;
    cursor: pointer;
}
.page-actions .btn:hover {
    background: var(--accent-hover);
    color: #fff;
}
.page-actions .btn-secondary {
    background: var(--bg-elevated);
    color: var(--text);
    border: 1px solid var(--border);
}
.page-actions .btn-secondary:hover {
    background: var(--border);
    color: var(--text);
}
.page-actions .btn + .btn,
.page-actions .btn + .btn-secondary,
.page-actions .btn-secondary + .btn,
.page-actions .btn-secondary + .btn-secondary,
.page-actions .btn-secondary + .save-view-link,
.page-actions .save-view-link {
    margin-left: 0.5em;
}
.nav-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    width: 2.75rem;
    height: 2.75rem;
    padding: 0;
    margin: 0 -0.25rem 0 0;
    background: none;
    border: none;
    border-radius: 4px;
    color: var(--text);
    cursor: pointer;
}
.nav-toggle:hover {
    background: var(--border);
    color: var(--accent);
}
.nav-toggle-icon {
    width: 1.5rem;
    height: 1.5rem;
}
.left-nav-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10;
}

/* Mobile: hide left nav by default, show hamburger, overlay when open */
@media (max-width: 767px) {
    .left-nav {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        width: 12em;
        max-width: 85vw;
        z-index: 20;
        transform: translateX(-100%);
        transition: transform 0.2s ease;
    }
    .left-nav.is-open {
        transform: translateX(0);
    }
    .nav-toggle {
        display: flex;
    }
    .left-nav-overlay.is-visible {
        display: block;
    }
}

/* Desktop: left nav always visible, sticky; main content scrolls inside .page-area */
@media (min-width: 768px) {
    .left-nav {
        position: sticky;
        top: 0;
        align-self: flex-start;
        height: 100vh;
        min-height: 0; /* allow nav to scroll when content is tall */
        overflow-y: auto;
        transform: none;
    }
    .page-area {
        overflow-y: auto; /* main content scrolls here so we can reach bottom */
    }
    /* Tasks page: only .page-scroll-content scrolls; header and toolbar stay in place */
    .tasks-page .page-area {
        overflow: visible;
    }
    .tasks-page .page-scroll-content {
        flex: 1;
        min-height: 0;
        overflow-y: auto;
    }
    .page-header-title {
        margin-left: 1rem;
    }
}

/* Constrain main content width on large screens; consistent horizontal padding */
main {
    max-width: 90rem;
    margin-left: auto;
    margin-right: auto;
}
.page-area main {
    margin-left: 0;
    margin-right: 0;
    max-width: none;
    width: 100%;
}

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

a {
    color: var(--text);
    text-decoration: none;
}
a:hover,
a:active,
a:focus-visible {
    color: var(--link-hover);
    text-decoration: underline;
}
a:visited {
    color: var(--text);
}

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

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

.login-page {
    max-width: 20rem;
    margin: 2rem auto;
}
.login-page label {
    display: block;
    margin-top: 0.5rem;
    color: var(--text-muted);
}
.login-page input {
    width: 100%;
    padding: 0.5rem 0.75rem;
    margin-top: 0.25rem;
    min-height: 2.75rem;
    background: var(--input-bg);
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--text);
    font-size: 1rem;
}
.login-page input::placeholder {
    color: var(--text-muted);
}
.login-page button {
    margin-top: 1rem;
    padding: 0.75rem 1.25rem;
    min-height: 2.75rem;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
}
.login-page button:hover {
    background: var(--accent-hover);
}

/* Shared for other pages — header + nav */
header {
    border-bottom: 1px solid var(--border);
    padding-bottom: 0.5rem;
    margin-bottom: 1rem;
}
header h1 {
    margin: 0 0 0.5rem;
    font-size: clamp(1.25rem, 4vw, 1.5rem);
    font-weight: 700;
}
header p {
    margin: 0.25rem 0 0;
    font-size: 0.9rem;
}
/* Touch-friendly nav: min 44px tap targets (WCAG 2.5.5) */
header p a {
    display: inline-block;
    padding: 0.5rem 0.35rem;
    margin: 0 -0.2rem;
    min-height: 2.75rem;
    line-height: 1.75rem;
    box-sizing: border-box;
}
header p a:hover {
    text-decoration: underline;
}

/* Data table */
.data-table {
    width: 100%;
    border-collapse: collapse;
}
.data-table th,
.data-table td {
    padding: 0.5rem 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}
.data-table th {
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.875rem;
}

.projects-hierarchy-table {
    table-layout: fixed;
}
.projects-hierarchy-table .projects-col-project,
.projects-hierarchy-table .projects-col-domain,
.projects-hierarchy-table .projects-col-feature {
    width: calc((100% - 3rem) / 3);
}
.projects-hierarchy-table .projects-col-actions {
    /* width: 3rem; */
}
.projects-hierarchy-table td:last-child {
    text-align: right;
}

.tags-table {
    table-layout: fixed;
}
.tags-table th:last-child,
.tags-table td:last-child {
    /* width: 3rem; */
    text-align: right;
}

.actions-menu {
    position: relative;
    display: inline-block;
}
.actions-menu-button {
    width: 2rem;
    height: 1.5rem;
    padding: 0;
    margin: 0;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}
.actions-menu-button:hover,
.actions-menu-button:focus-visible {
    background: var(--bg-elevated);
    color: var(--accent);
    outline: none;
}
.actions-menu-button-icon {
    font-size: 1.25rem;
    line-height: 1;
    transform: translateY(-1px);
}
.actions-menu-popup {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 0.25rem;
    min-width: 9rem;
    padding: 0.25rem 0;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 6px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
    z-index: 30;
    display: none;
}
.actions-menu.is-open .actions-menu-popup {
    display: block;
}
.actions-menu-item {
    display: block;
    width: 100%;
    padding: 0.35rem 0.75rem;
    font-size: 0.85rem;
    text-align: left;
    background: none;
    border: none;
    color: var(--text);
    text-decoration: none;
    cursor: pointer;
}
.actions-menu-item:hover,
.actions-menu-item:focus-visible {
    background: var(--border);
    color: var(--link-hover);
    outline: none;
}
.actions-menu-item-delete {
    color: var(--delete); /* mid-tone red for delete */
}
.actions-menu-item-delete:hover,
.actions-menu-item-delete:focus-visible {
    background: rgba(249, 115, 115, 0.16);
    color: #fecaca;
}
.actions-menu-delete-form {
    margin: 0;
}


/* Forms (project edit, etc.) */
.form-page {
    padding: 1rem;
}

.form-page label {
    display: block;
    margin-top: 1rem;
    padding-left: 0.2rem;
    line-height: 1.15;
    color: var(--text-muted);
    font-size: 0.9rem;
}
.form-page label:first-of-type {
    margin-top: 0;
}
form.form-page > div:not(.form-actions),
.form-page form > div:not(.form-actions) {
    display: grid;
    gap: 0.3rem;
}
form.form-page > div:not(.form-actions) + div:not(.form-actions),
.form-page form > div:not(.form-actions) + div:not(.form-actions) {
    margin-top: 1rem;
}
form.form-page > div:not(.form-actions) > label,
.form-page form > div:not(.form-actions) > label {
    margin-top: 0;
}
.form-page input {
    width: 100%;
    max-width: 20rem;
    padding: 0.35rem 0.5rem;
    margin-top: 0.25rem;
    background: var(--input-bg);
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--text);
}
.form-page input[type="date"] {
    width: auto;
}
.form-page select {
    width: 100%;
    max-width: 20rem;
    padding: 0.35rem 0.5rem;
    margin-top: 0.25rem;
    background: var(--input-bg);
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--text);
}
.form-page textarea {
    width: 100%;
    max-width: 40rem;
    min-height: 6rem;
    padding: 0.35rem 0.5rem;
    margin-top: 0.25rem;
    background: var(--input-bg);
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--text);
    font-family: inherit;
    resize: vertical;
}
form.form-page > div:not(.form-actions) > input,
form.form-page > div:not(.form-actions) > select,
form.form-page > div:not(.form-actions) > textarea,
.form-page form > div:not(.form-actions) > input,
.form-page form > div:not(.form-actions) > select,
.form-page form > div:not(.form-actions) > textarea {
    margin-top: 0;
}
.form-tags {
    margin-top: 1rem;
    border: 1px solid var(--border);
    padding: 0.75rem 1rem;
    border-radius: 4px;
}
.form-tags legend {
    padding: 0 0.25rem;
}
.form-colour-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}
.form-colour-picker {
    width: 2.5rem;
    height: 2.25rem;
    padding: 2px;
    cursor: pointer;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: var(--bg);
}
.form-colour-hex {
    width: 6rem;
    font-family: ui-monospace, monospace;
}
.form-hint {
    margin: 0.35rem 0 0;
    font-size: 0.875rem;
    color: var(--text-muted);
}
.tag-checkboxes {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
    margin-top: 0.5rem;
}
.tag-checkbox-label {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin-top: 0;
    font-weight: normal;
    cursor: pointer;
}
.tag-checkbox-label input {
    width: auto;
    max-width: none;
}

.form-actions {
    margin-top: 1.25rem;
}
.form-actions button,
.form-actions .button-link {
    margin-right: 0.75rem;
}
.form-actions button {
    padding: 0.6rem 1.25rem;
    min-height: 2.75rem;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
}
.form-actions button:hover {
    background: var(--accent-hover);
}
.form-page input[type="text"],
.form-page input[type="email"],
.form-page input[type="password"],
.form-page select,
.form-page textarea {
    min-height: 2.75rem;
    padding: 0.5rem 0.75rem;
}
.form-page textarea {
    min-height: 6rem;
}
.button-link {
    font-size: 0.9rem;
}
.link-button {
    background: none;
    border: none;
    padding: 0;
    font-size: inherit;
    font-family: inherit;
    color: var(--accent);
    cursor: pointer;
    text-decoration: none;
}
.link-button:hover {
    color: var(--accent-hover);
    text-decoration: underline;
}
.required {
    color: var(--error);
}
.account-extra-actions {
    margin-top: 1rem;
    padding: 1rem;
    border-top: 1px solid var(--border);
}
.change-password-btn,
a.change-password-btn:visited {
    color: var(--delete);
}

/* Dashboard: left nav + main */
.dashboard-page .dashboard-layout {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin-top: 0.5rem;
}
.dashboard-nav {
    flex: 0 0 12rem;
    min-width: 10rem;
    padding: 0.75rem;
    background: var(--bg-elevated);
    border-radius: 6px;
    border: 1px solid var(--border);
}
.dashboard-nav h2 {
    margin: 0 0 0.5rem;
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 600;
}
.dashboard-nav .project-list {
    list-style: none;
    margin: 0;
    padding: 0;
}
.dashboard-nav .project-list li {
    margin: 0.15rem 0;
}
.dashboard-nav .project-list a {
    display: block;
    padding: 0.35rem 0.5rem;
    border-radius: 4px;
    color: var(--text);
    text-decoration: none;
}
.dashboard-nav .project-list a:hover {
    background: var(--border);
    color: var(--link-hover);
}
.dashboard-nav .project-list a.active {
    background: var(--accent);
    color: #fff;
}
.dashboard-nav .project-list a.active:hover {
    background: var(--accent-hover);
    color: #fff;
}
.dashboard-nav .nav-features-link {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-left: 0.35rem;
}
.dashboard-nav .nav-features-link:hover {
    color: var(--link-hover);
}
.dashboard-main {
    flex: 1;
    min-width: 0;
    padding: 1rem !important;
}
.text-muted {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Dashboard sections (overview, favourites) — no task list */
.dashboard-section {
    margin-bottom: 1.5rem;
}
.dashboard-section:last-child {
    margin-bottom: 0;
}
.dashboard-section-title {
    margin: 0 0 0.75rem;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
    border-bottom: 1px solid var(--border);
    padding-bottom: 0.35rem;
}
.overview-project-list {
    list-style: none;
    margin: 0;
    padding: 0;
}
.overview-project-item {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.5rem 1rem;
    padding: 0.5rem 0.75rem;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 6px;
    margin-bottom: 0.5rem;
}
.overview-project-item:last-child {
    margin-bottom: 0;
}
.overview-project-link {
    display: inline-flex;
    align-items: baseline;
    gap: 0.35rem;
    text-decoration: none;
    color: var(--text);
    font-weight: 500;
}
.overview-project-link:hover {
    color: var(--link-hover);
    text-decoration: underline;
}
.overview-project-name {
    font-weight: 600;
}
.overview-project-total {
    font-variant-numeric: tabular-nums;
    color: var(--text-muted);
    font-size: 0.9rem;
}
.overview-by-status {
    font-size: 0.875rem;
    color: var(--text-muted);
}
.dashboard-section-favourites .favourites-list {
    list-style: none;
    margin: 0;
    padding: 0;
}
.dashboard-section-favourites .favourites-list li {
    margin: 0.25rem 0;
}
.dashboard-section-favourites .favourites-list li.favourites-list-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.dashboard-section-favourites .favourites-list li.favourites-list-item a {
    flex: 1;
    min-width: 0;
}
.dashboard-section-favourites .favourites-list a {
    display: inline-block;
    padding: 0.35rem 0.5rem;
    border-radius: 4px;
}
.dashboard-section-favourites .favourites-list a:hover {
    background: var(--border);
}
.dashboard-section-favourites .favourites-list-item .actions-menu {
    flex-shrink: 0;
}

/* Task groups (project → feature → status) */
/* Height vars drive both header size and sticky offsets; change in one place */
.task-groups {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    padding: 0 1rem;
    --tasks-h-l1: 2.5rem;
    --tasks-h-l2: 2rem;
    --tasks-h-l3: 1.5rem;
    --tasks-sticky-l1: calc(var(--tasks-sticky-after-toolbar) + var(--tasks-h-l1));
    --tasks-sticky-l2: calc(var(--tasks-sticky-l1) + var(--tasks-h-l2));
}
/*
 * Headers suppressed: any group-by level is filtered, so we collapse top spacing only
 * (no extra gap under toolbar). Used for 1/2/3 levels with 1+ visible headers.
 */
.task-groups.task-groups-headers-suppressed > .task-group.project-group:first-child {
    padding-top: 0;
    margin-top: 0;
}
.task-groups.task-groups-headers-suppressed .task-group.project-group:first-child > .feature-group:first-child,
.task-groups.task-groups-headers-suppressed .task-group.project-group:first-child > .task-table:first-child {
    margin-top: 0;
}
.task-groups.task-groups-headers-suppressed .task-group.project-group:first-child .feature-group:first-child .task-table {
    margin-top: 0;
}
/* 3-level: first status-group under a suppressed L2 header has no top gap */
.task-groups.task-groups-headers-suppressed .feature-group:first-child > .status-group:first-child {
    margin-top: 0;
}
.task-groups.task-groups-headers-suppressed .feature-group:first-child > .status-group:first-child .task-table {
    margin-top: 0;
}

/*
 * All headers suppressed: every group-by level is filtered (0 visible headers).
 * Use compact spacing so section/feature-group/empty-zone don’t create a big gap.
 * Used for 1 level (L1 suppressed), 2 levels (L1+L2 suppressed), 3 levels (all suppressed).
 */
.task-groups.task-groups-all-headers-suppressed > .task-group.project-group:first-child {
    padding-bottom: 0.25rem;
}
.task-groups.task-groups-all-headers-suppressed .feature-group {
    margin-bottom: 0.25rem;
}
.task-groups.task-groups-all-headers-suppressed .feature-group:first-child {
    margin-top: 0;
}
.task-groups.task-groups-all-headers-suppressed .feature-group:last-child {
    margin-bottom: 0;
}
.task-groups.task-groups-all-headers-suppressed .empty-group-drop-zone {
    min-height: 0;
    margin-top: 0;
    margin-bottom: 0;
}

/*
 * L2 suppressed only (e.g. Domain visible, Status suppressed): compact spacing under each L1 group
 * so feature-groups and empty drop zones don’t leave huge gaps.
 */
.task-groups.task-groups-l2-suppressed .feature-group {
    margin-bottom: 0.25rem;
}
.task-groups.task-groups-l2-suppressed .feature-group:last-child {
    margin-bottom: 0;
}
.task-groups.task-groups-l2-suppressed .empty-group-drop-zone {
    min-height: 0;
    margin-top: 0;
    margin-bottom: 0;
}

/*
 * L3 suppressed only: compact spacing for status-groups under each L2 group.
 */
.task-groups.task-groups-l3-suppressed .status-group {
    margin-bottom: 0.25rem;
}
.task-groups.task-groups-l3-suppressed .status-group:last-child {
    margin-bottom: 0;
}
.task-groups.task-groups-l3-suppressed .empty-group-drop-zone {
    min-height: 0;
    margin-top: 0;
    margin-bottom: 0;
}

.task-group.project-group {
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 0 0 1rem;
    /* border-bottom: 1px solid var(--border); */
}
.task-group.project-group:last-child {
    border-bottom: none;
}
/* Level 1 header: height from var; sticky below toolbar; overflow ellipsis */
.task-group .group-title {
    margin: 0 -1rem;
    padding: 0 1rem;
    height: var(--tasks-h-l1);
    box-sizing: border-box;
    display: flex;
    align-items: center;
    font-size: 1rem;
    color: var(--text);
    border-bottom: 1px solid var(--border);
    background: var(--project-bg);
    position: sticky;
    top: var(--tasks-sticky-after-toolbar);
    z-index: 3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.task-group .group-title-row {
    margin: 0 -1rem;
    padding: 0 1rem;
    height: var(--tasks-h-l1);
    box-sizing: border-box;
    font-size: 1rem;
    color: var(--text);
    border-bottom: 1px solid var(--border);
    background: var(--project-bg);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    position: sticky;
    top: var(--tasks-sticky-after-toolbar);
    z-index: 3;
}
.task-group .group-title.is-suppressed,
.task-group .group-title-row.is-suppressed {
    height: 0;
    padding-top: 0;
    padding-bottom: 0;
    border-bottom: none;
    overflow: hidden;
}
.task-group .group-title-row .group-title {
    margin: 0;
    padding: 0;
    border-bottom: none;
    background: transparent;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.task-group .group-add-task-btn {
    flex-shrink: 0;
    padding: 0.35rem;
    margin: -0.35rem 0;
    font-size: 1.35rem;
    line-height: 1;
    background: none;
    border: none;
    border-radius: 0;
    color: var(--text);
    cursor: pointer;
}
.task-group .group-add-task-btn:hover,
.task-group .group-add-task-btn:active,
.task-group .group-add-task-btn:focus-visible {
    color: var(--link-hover);
}
.task-group .group-add-task-btn:focus-visible {
    outline: none;
}
.feature-title-row .group-add-task-btn,
.status-title .group-add-task-btn {
    /* padding: 0.25rem; */
    padding-right: 0.4rem;
    margin: -0.25rem 0;
    font-size: 1.1rem;
}
/* Level 2 header: height from var; overflow ellipsis */
.feature-group {
    margin-bottom: 1rem;
}
.feature-group:last-child {
    margin-bottom: 0;
}
.feature-title-row {
    margin: 0 -1rem;
    padding: 0 1rem;
    height: var(--tasks-h-l2);
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: var(--text);
    font-weight: 600;
    background: var(--feature-bg);
    position: sticky;
    top: var(--tasks-sticky-l1);
    z-index: 2;
    overflow: hidden;
}
.feature-title-row.is-suppressed {
    height: 0;
    padding-top: 0;
    padding-bottom: 0;
    border-bottom: none;
    overflow: hidden;
}
.feature-title-row .feature-title {
    margin: 0;
    padding: 0;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.feature-title {
    margin: 0 -1rem;
    padding: 0 1rem;
    height: var(--tasks-h-l2);
    box-sizing: border-box;
    display: flex;
    align-items: center;
    font-size: 0.9rem;
    color: var(--text);
    font-weight: 600;
    background: var(--feature-bg);
    position: sticky;
    top: var(--tasks-sticky-l1);
    z-index: 2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
/* Gap between status icon and text in level 1 / level 2 headers when group-by is status */
.task-group .group-title .status-indicator,
.feature-title .status-indicator {
    margin-right: 0.35em;
    flex-shrink: 0;
}
.status-group {
    margin-left: 0;
    margin-top: 0;
    padding-bottom: 0;
}
/* Level 3 header: full-bleed bg to page width; content inset 1rem; bg matches table/page */
.status-title {
    margin: 0 -1rem;
    padding: 0 1rem;
    height: var(--tasks-h-l3);
    box-sizing: border-box;
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 700;
    display: flex;
    align-items: center;
    width: 100%;
    gap: 0;
    position: sticky;
    top: var(--tasks-sticky-l2);
    z-index: 1;
    background: var(--bg);
}
.status-title.is-suppressed {
    height: 0;
    padding-top: 0;
    padding-bottom: 0;
    border-bottom: none;
    overflow: hidden;
}
.status-title-content {
    flex-shrink: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 0.35rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.status-title-line {
    flex: 1;
    min-width: 0;
    margin-left: 0.5rem;
    border-bottom: 1px solid var(--border);
    align-self: center;
}
.status-title .status-indicator {
    flex-shrink: 0;
}
.status-title .status-title-add-btn {
    flex-shrink: 0;
    margin-left: 0.5rem;
}
.task-table {
    width: 100%;
    table-layout: fixed;
    border-collapse: collapse;
    margin-top: 0.25rem;
}
.task-table th,
.task-table td {
    padding: 0 0.5rem;
    text-align: left;
    vertical-align: middle;
}
.task-table th {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 600;
}
.task-table tbody tr {
    border: none;
    line-height: 1.0;
}
.task-table tbody tr.task-row-dragging {
    opacity: 0.85;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.25);
    transform: scale(1.01);
    transition: box-shadow 0.15s ease, transform 0.15s ease;
}

/* Drop indicator line during task drag (positioned by tasks_drag.js) */
#task-drag-drop-line {
    position: absolute;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--accent);
    pointer-events: none;
    z-index: 10;
    display: none;
}
#task-drag-drop-line.visible {
    display: block;
}

/* Empty group drop zone (when "Show empty groups" is on) – compact height, blue line still shows on drag-over */
.empty-group-drop-zone {
    min-height: 0.85rem;
    margin: 0 0.75rem;
    border-radius: 4px;
    position: relative;
    display: flex;
    align-items: center;
}
.empty-group-drop-zone .empty-group-drop-zone-line {
    display: none;
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    margin-top: -2px;
    height: 3px;
    background: var(--accent);
    border-radius: 2px;
    pointer-events: none;
}
.empty-group-drop-zone.drag-over .empty-group-drop-zone-line {
    display: block;
}

.task-table tbody td {
    border: none;
    border-top: none;
}
.task-table tbody td:first-child {
    padding-left: calc(0.5rem + 0.75rem);
}
.task-table .task-status-th {
    width: 1.25rem;
    padding-left: 0.25rem;
}
.task-table .task-status-cell {
    width: 1.5rem;
    max-width: 1.5rem;
    padding: 0.16rem 0.45rem 0.16rem 0.2rem;
    vertical-align: middle;
}
.status-indicator-btn {
    display: inline-block;
    margin: 0;
    padding: 0;
    border: none;
    background: transparent;
    cursor: pointer;
    border-radius: 50%;
    font: inherit;
    line-height: 1;
}
.status-indicator-btn:hover {
    opacity: 0.85;
}
.status-indicator-btn:focus {
    outline: 2px solid var(--focus-ring, currentColor);
    outline-offset: 2px;
}
.task-table .task-status-cell .status-indicator-btn {
    width: 0.75rem;
    height: 0.75rem;
}
.status-indicator {
    display: inline-block;
    width: 0.75rem;
    height: 0.75rem;
    border-radius: 50%;
    flex-shrink: 0;
}
.status-indicator.status-backlog { background: #374151; }
.status-indicator.status-todo { background: #6b7280; }
.status-indicator.status-in-progress { background: #eab308; }
.status-indicator.status-resolved { background: #22c55e; }
.task-table .task-title-cell {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
    width: auto;
    overflow: hidden;
}
.task-table .task-title-cell .task-title {
    flex: 1;
    min-width: 0;
}
.task-title {
    font-weight: 500;
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
    padding: 0.22rem 0;
}
.task-table .task-title-cell .task-extra-details {
    flex-shrink: 0;
    /* width: 10rem; */
    max-width: 10rem;
    font-size: 0.75rem;
    color: var(--text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@media (max-width: 767px) {
    .task-table .task-title-cell .task-extra-details {
        max-width: 5rem;
    }
}


.task-table .task-tags-cell {
    width: 5rem;
    max-width: 5rem;
    white-space: normal;
}
.task-table.no-tags-in-list .task-tags-cell {
    width: 0;
    min-width: 0;
    max-width: 0;
    padding-left: 0;
    padding-right: 0;
    overflow: hidden;
}
.task-table .task-tags-cell .tag-pill {
    margin-right: 0.25rem;
    margin-bottom: 0.12rem;
}
.task-table .task-owner {
    width: 2rem;
    max-width: 2rem;
    font-size: 0.875rem;
    color: var(--text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
/* Disable iOS link preview on long-press so task row drag works; tap still opens the task */
.task-groups tr[data-task-id] {
    -webkit-touch-callout: none;
    touch-callout: none;
}
.user-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.5rem;
    height: 1.5rem;
    min-width: 1.5rem;
    min-height: 1.5rem;
    border-radius: 50%;
    font-size: 0.75rem;
    font-weight: 600;
    color: #fff;
    text-transform: uppercase;
}
/* Tasks table: on mobile, hide Tags — show only status, title, feature (if any), assignee */
@media (max-width: 767px) {
    .task-table .task-tags-cell {
        display: none;
    }
}

/* Tasks list page — Filter / Organize popups */
.tasks-toolbar {
    /* margin-bottom: 1rem; */
    padding: 0;
}

/* Search page — search field with clear button */
.search-toolbar .search-form {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem 0.75rem;
    flex-wrap: wrap;
}
.search-toolbar .search-input-wrap {
    position: relative;
    flex: 1 1 16rem;
    min-width: 0;
}
.search-toolbar .search-input {
    width: 100%;
    padding: 0.5em 2rem 0.5em 0.75em;
    background: var(--input-bg);
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--text);
    font-size: 1rem;
}
.search-toolbar .search-input::placeholder {
    color: var(--text-muted);
}
.search-toolbar .search-input:focus {
    outline: none;
    border-color: var(--accent);
}
.search-toolbar .search-clear {
    position: absolute;
    right: 0.25rem;
    top: 50%;
    transform: translateY(-50%);
    width: 1.75rem;
    height: 1.75rem;
    padding: 0;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-size: 1.25rem;
    line-height: 1;
    cursor: pointer;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.search-toolbar .search-clear:hover {
    color: var(--text);
    background: var(--border);
}
.search-toolbar .search-clear[hidden] {
    display: none !important;
}
.search-toolbar .search-form .btn {
    display: inline-block;
    padding: 0.5em 1em;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 4px;
    text-decoration: none;
    font-size: 1em;
    cursor: pointer;
}
.search-toolbar .search-form .btn:hover {
    background: var(--accent-hover);
    color: #fff;
}

.tasks-popup-form {
    display: block;
    position: static;
}
.tasks-popup {
    z-index: 1000;
    min-width: 12rem;
    max-width: 20rem;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    padding: 0;
}
.tasks-popup[hidden] {
    display: none !important;
}
.tasks-popup-inner {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
}
.tasks-popup-inner label {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    font-size: 0.875rem;
    color: var(--text-muted);
}
.tasks-popup-inner label select {
    flex: 0 0 10rem;
    width: 10rem;
    margin-left: auto;
    padding: 0.35rem 0.5rem;
    background: var(--input-bg);
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--text);
}
.tasks-popup-inner label select:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}
.organize-manual-sort-label .organize-checkbox-label-text {
    flex: 1 1 auto;
    min-width: 0;
}
.organize-manual-sort-checkbox-wrap {
    flex: 0 0 auto;
    display: flex;
    justify-content: flex-end;
    align-items: center;
}
.tasks-popup-section-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-top: 0.25rem;
}
.tasks-popup-section-label:first-child {
    margin-top: 0;
}
.tasks-popup-divider {
    border: 0;
    border-top: 1px solid var(--border);
    margin: 0.25rem 0 0;
}

/* New task popup (over the task list). Overlay is fixed so it always covers the
   viewport; popup is in flow so it scrolls with the page and you can reach the
   Create button when the form is tall (e.g. long Quill description on mobile). */
.new-task-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 100;
    /* Let scroll/wheel pass through to .page-scroll-content so the page can scroll */
    pointer-events: none;
}
.new-task-overlay[hidden] {
    display: none !important;
}
.new-task-popup {
    position: relative;
    z-index: 101;
    width: 90%;
    max-width: 32rem;
    margin: 1rem auto;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
}
@media (min-width: 640px) {
    .new-task-popup {
        max-width: 50rem;
    }
    .new-task-popup-inner {
        max-width: 48rem;
        margin-left: auto;
        margin-right: auto;
    }
}
.new-task-popup[hidden] {
    display: none !important;
}
.new-task-popup-inner {
    padding: 1rem 1.25rem;
    position: relative;
}
.new-task-popup-close {
    position: absolute;
    top: 1rem;
    right: 1.25rem;
    width: 1.75rem;
    height: 1.75rem;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: var(--bg-elevated);
    color: var(--text);
    font-size: 1.25rem;
    line-height: 1;
    cursor: pointer;
}
.new-task-popup-close:hover {
    border-color: var(--accent);
    color: var(--accent);
}
.new-task-form label {
    display: block;
    /* margin-top: 0.75rem; */
    color: var(--text-muted);
    font-size: 0.875rem;
}
.new-task-form label:first-of-type {
    margin-top: 0;
}
/* Title input in popup: same h2-style as task edit page; padding-right for close button */
.new-task-form .task-edit-title-input {
    margin-top: 0.25rem;
    padding: 0.35rem 2.5rem 0.35rem 0;
    font-size: 1.125rem;
    font-weight: 600;
    line-height: 1.3;
    background: transparent;
    border: none;
    border-radius: 0;
    border-bottom: 1px solid transparent;
    outline: none;
}
.new-task-form .task-edit-title-input:hover {
    border-bottom-color: var(--border);
}
.new-task-form .task-edit-title-input:focus {
    border-bottom-color: var(--accent);
}
.new-task-form .task-edit-title-input::placeholder {
    color: var(--text-muted);
}
.new-task-form .task-edit-title-input {
    min-height: 0;
}
.new-task-form input[type="text"]:not(.task-edit-title-input),
.new-task-form textarea:not(.task-edit-title-input) {
    width: 100%;
    margin-top: 0.25rem;
    padding: 0.5rem 0.75rem;
    background: var(--input-bg);
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--text);
    font-family: inherit;
}
.new-task-form textarea:not(.task-edit-title-input) {
    min-height: 4rem;
    resize: vertical;
}
.new-task-form-hint {
    font-size: 0.75rem;
}
.new-task-upload-image {
    flex-wrap: nowrap;
    gap: 0.5rem;
    align-items: center;
}
.new-task-upload-image-group {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    flex-shrink: 0;
}
.new-task-upload-image-group .upload-image-label {
    flex-shrink: 0;
}
.new-task-upload-image-group input[type="file"] {
    width: auto;
    max-width: 11rem;
    min-width: 0;
}
.new-task-upload-image .button-link {
    flex-shrink: 0;
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    min-height: unset;
    line-height: 1.2;
    white-space: nowrap;
}
.new-task-upload-image .upload-status {
    flex-shrink: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}
.new-task-fields {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.75rem;
    align-items: center;
}
.new-task-fields select {
    min-width: 5rem;
    max-width: 10rem;
    padding: 0.35rem 0.5rem;
    font-size: 0.875rem;
    background: var(--input-bg);
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--text);
}
.new-task-tags {
    margin-top: 0.75rem;
    padding: 0.5rem 0 0;
    border: none;
    border-top: 1px solid var(--border);
}
.new-task-tags legend {
    font-size: 0.875rem;
    color: var(--text-muted);
    padding: 0 0.25rem 0 0;
}
.new-task-tag-checkboxes {
    /* display: grid;
    grid-template-columns: repeat(auto-fill, minmax(6rem, max-content));
    align-items: center;
    gap: 0.35rem 0.75rem; */
    margin-top: 0;
}
.new-task-tag-checkboxes .tag-checkbox-label {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    line-height: 1;
    min-height: 1.5rem;
}
.new-task-tag-checkboxes .tag-checkbox-label input {
    flex-shrink: 0;
    margin: 0;
    vertical-align: middle;
}
.new-task-tag-checkboxes .tag-pill-inline {
    line-height: 1;
    flex-shrink: 0;
}
.new-task-form-actions {
    margin-top: 1rem;
    display: flex;
    justify-content: flex-end;
    align-items: center;
}
.new-task-form-actions button[type="submit"] {
    padding: 0.5rem 1rem;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 0.9375rem;
    cursor: pointer;
}
.new-task-form-actions button[type="submit"]:hover {
    background: var(--accent-hover);
}
.new-task-form-actions button[type="submit"]:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}
.new-task-error {
    margin: 0 0 0.5rem;
}
.new-task-error[hidden] {
    display: none !important;
}

.new-task-draft-confirm {
    position: absolute;
    inset: 0;
    z-index: 12;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.45);
    border-radius: 8px;
}
.new-task-draft-confirm-panel {
    width: min(28rem, calc(100% - 2rem));
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
    padding: 1rem;
}
.new-task-draft-confirm-title {
    margin: 0 0 0.35rem;
    color: var(--text);
    font-size: 1rem;
    font-weight: 600;
}
.new-task-draft-confirm-description {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.4;
}
.new-task-draft-confirm-actions {
    margin-top: 0.85rem;
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
}
.new-task-draft-confirm-btn {
    padding: 0.45rem 0.85rem;
    border-radius: 4px;
    font-size: 0.9rem;
    cursor: pointer;
    border: 1px solid var(--border);
    background: var(--input-bg);
    color: var(--text);
}
.new-task-draft-confirm-btn:hover {
    border-color: var(--accent);
}
.new-task-draft-confirm-btn-primary {
    border-color: var(--accent);
    background: var(--accent);
    color: #fff;
}
.new-task-draft-confirm-btn-primary:hover {
    border-color: var(--accent-hover);
    background: var(--accent-hover);
}
.new-task-draft-confirm-btn-secondary {
    background: var(--bg-elevated);
    color: var(--text);
}

/* Task edit page — layout aligned with new-task popup */
.task-edit-page {
    max-width: 40rem;
    padding: 0 1rem;
}
.task-edit-heading {
    margin: 0 0 1rem;
    font-size: 1.25rem;
    font-weight: 600;
}
.task-edit-form label.task-edit-label {
    display: block;
    margin-top: 0.75rem;
    color: var(--text-muted);
    font-size: 0.875rem;
}
.task-edit-form label.task-edit-label:first-of-type {
    margin-top: 0;
}
.task-edit-title-input {
    display: block;
    width: 100%;
    margin-top: 0.25rem;
    padding: 0.35rem 0;
    font-size: 1.25rem;
    font-weight: 600;
    line-height: 1.3;
    color: var(--text);
    background: transparent;
    border: none;
    border-radius: 0;
    border-bottom: 1px solid transparent;
    outline: none;
    font-family: inherit;
    resize: vertical;
    min-height: 2.5em;
    overflow: hidden;
    overflow-wrap: break-word;
    white-space: pre-wrap;
    word-wrap: break-word;
}
.task-edit-title-input:hover {
    border-bottom-color: var(--border);
}
.task-edit-title-input:focus {
    border-bottom-color: var(--accent);
}
.task-edit-title-input::placeholder {
    color: var(--text-muted);
}
.quill-description-wrap {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    margin-top: 0.25rem;
}
.quill-description-wrap .task-edit-quill-container {
    width: 100%;
}
.quill-attach-input {
    position: absolute;
    width: 0;
    height: 0;
    opacity: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    pointer-events: none;
}
.quill-attach-btn {
    margin-top: 0.25rem;
    padding: 0.2rem;
    min-height: unset;
    background: none;
    border: none;
    border-radius: 4px;
    color: var(--text-muted);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.quill-attach-btn:hover {
    color: var(--text);
}
.quill-attach-btn .quill-attach-icon {
    display: block;
}
.task-edit-quill-container {
    min-height: 12rem;
    /* background: var(--input-bg); */
    /* border: 1px solid var(--border);
    border-radius: 4px; */
}
.task-edit-quill-container .ql-editor {
    min-height: 10rem;
    font-size: 0.9375rem;
    padding: 0;
}
/* Prevent iOS/mobile zoom on focus: inputs need font-size >= 16px */
@media (max-width: 768px) {
    .task-edit-quill-container .ql-editor {
        font-size: 16px;
    }
}
.task-edit-quill-container .ql-editor.ql-blank::before {
    color: var(--text-muted);
    left: 0;
}
/* Code blocks in Quill editor (Quill 2: .ql-code-block-container > .ql-code-block).
   Override Quill bubble theme's .ql-code-block-container background (higher specificity). */
.task-edit-quill-container.ql-container .ql-editor .ql-code-block-container,
.task-edit-quill-container .ql-editor .ql-code-block {
    background: var(--bg-code);
}
.task-edit-quill-container.ql-container .ql-editor .ql-code-block-container {
    background-color: var(--bg-code);
}
.task-edit-form-hint {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin: 0.35rem 0 0;
}
.task-edit-upload-image {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
}
.task-edit-upload-image-group {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}
.task-edit-upload-image-group input[type="file"] {
    width: auto;
    max-width: 12rem;
}
.task-edit-fields {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.75rem;
    align-items: center;
}
.task-edit-fields select {
    min-width: 5rem;
    max-width: 10rem;
    padding: 0.35rem 0.5rem;
    font-size: 0.875rem;
    background: var(--input-bg);
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--text);
}
.task-field-picker {
    display: inline-flex;
    align-items: center;
}
.task-field-pill {
    box-sizing: border-box;
    min-width: 5rem;
    max-width: 7rem;
    min-height: 1.5rem;
    padding: 0.25rem 0.5rem;
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.task-field-pill .task-field-pill-value {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.task-field-pill .task-field-pill-value:has(.status-indicator) {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}
.task-form-select-native {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
    padding: 0;
    border: 0;
}
.task-field-pill {
    cursor: pointer;
    border: 1px solid var(--border);
    font-size: 0.8125rem;
    background: var(--bg-elevated);
    border-radius: 6px;
    color: var(--text);
}
.task-field-pill:hover {
    border-color: var(--accent);
}
/* Override .tag-pill capsule when used as field picker (status, assignee, etc.) */
.task-field-picker .tag-pill,
.task-field-picker .task-field-pill {
    border-radius: 6px;
}
/* Task form tags: pills + Add Tag button + dropdown (in-line with field pickers) */
.task-form-tags-wrap {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    position: relative;
}
.task-form-tags-selected {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem;
}
.task-form-tag-pill-wrap {
    display: inline-flex;
    align-items: center;
}
.task-form-tag-pill-wrap .tag-pill {
    cursor: pointer;
    border: 1px solid var(--border);
    padding: 0.25rem 0.5rem;
    font-size: 0.8125rem;
    background: var(--bg-elevated);
    border-radius: 6px;
    user-select: none;
}
.task-form-tag-pill-wrap .tag-pill:hover {
    border-color: var(--accent);
}
.task-form-tags-wrap .task-field-picker .task-field-pill {
    user-select: none;
}
.task-form-tags-wrap .task-field-picker .task-field-pill::selection {
    background: var(--border);
    color: var(--text);
}
.tag-picker-dropdown {
    position: fixed;
    z-index: 1000;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    min-width: 10rem;
    max-height: 14rem;
    overflow-y: auto;
    color: var(--text);
}
.tag-picker-dropdown-inner {
    padding: 0.35rem 0;
}
.tag-picker-option {
    display: block;
    width: 100%;
    padding: 0.4rem 0.75rem;
    text-align: left;
    border: none;
    background: none;
    font-size: 0.875rem;
    color: inherit;
    cursor: pointer;
    font-family: inherit;
}
.tag-picker-option:hover {
    background: var(--bg);
}
.tag-picker-option.tag-picker-option-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.tag-picker-option.tag-picker-remove {
    color: var(--error, #c00);
    border-bottom: 1px solid var(--border);
    margin-bottom: 0.2rem;
}
.tag-picker-empty {
    display: block;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    color: var(--text-muted);
}
.task-edit-meta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin: 0;
    font-size: 0.7rem;
    font-weight: bold;
    color: var(--text-muted);
}
.task-edit-form-actions {
    margin-top: 1rem;
    display: flex;
    gap: 0.75rem;
    align-items: center;
}
.task-edit-form-actions-buttons {
    justify-content: space-between;
    align-items: center;
}
.task-edit-form-actions-right {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}
.task-edit-form-actions button[type="submit"] {
    padding: 0.5rem 1rem;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 0.9375rem;
    cursor: pointer;
}
.task-edit-form-actions button[type="submit"]:hover {
    background: var(--accent-hover);
}

.task-edit-delete-section {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}
.task-edit-delete-btn {
    background: none;
    border: none;
    padding: 0;
    font-size: inherit;
    font-family: inherit;
    cursor: pointer;
    color: var(--delete);
    text-decoration: none;
}
.task-edit-delete-btn:hover {
    text-decoration: underline;
}

.tasks-page .page-scroll-content {
    position: relative;
    display: flex;
    flex-direction: column;
    /* Single source of truth: header heights drive both layout and sticky offsets */
    --tasks-h-l0: 3rem;
    --tasks-toolbar-height: 3.25rem;
    --tasks-sticky-after-toolbar: calc(var(--tasks-h-l0) + var(--tasks-toolbar-height));
}
/* Page header stays fixed at top; height from var so sticky stack stays in sync */
.tasks-page .page-scroll-content > .page-header {
    position: sticky;
    top: 0;
    z-index: 4;
    flex-shrink: 0;
    height: var(--tasks-h-l0);
    box-sizing: border-box;
}
.tasks-page .tasks-toolbar {
    position: sticky;
    top: var(--tasks-h-l0);
    z-index: 4; /* above level-1/2/3 so it never gets covered */
    flex-shrink: 0;
    height: var(--tasks-toolbar-height);
    box-sizing: border-box;
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--border);
    padding-bottom: 0.25rem;
}
.tasks-page .dashboard-layout {
    display: block;
    /* No flex: 1 — let it size to content so footer sits at end of scrollable content */
}
.tasks-main {
    max-width: none;
    padding-left: 0;
    padding-right: 0;
}

/* Task detail page */
.task-detail {
    max-width: 48rem;
    padding: 1rem;
}
.task-detail-title {
    margin: 0 0 1rem;
    font-size: 1.5rem;
}
.task-detail-meta {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.25rem 1.5rem;
    margin: 0 0 1.5rem;
    font-size: 0.9375rem;
}
.task-detail-meta dt {
    color: var(--text-muted);
    font-weight: 500;
}
.task-detail-meta dd {
    margin: 0;
}
.task-detail-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}
.tag-pill {
    display: inline-block;
    padding: 0.2rem 0.5rem;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 999px;
    font-size: 0.75rem;
}
.task-tags-cell {
    white-space: normal;
}
.task-tags-cell .tag-pill {
    margin-right: 0.25rem;
    margin-bottom: 0.2rem;
}
.tag-pill-inline {
    display: inline;
    padding: 0;
    background: transparent;
    border: none;
    border-radius: 0;
}
.tag-checkboxes .tag-pill-inline {
    display: inline-block;
    padding: 0.2rem 0.5rem;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 999px;
    font-size: 0.8125rem;
}
.task-detail-description {
    margin-bottom: 1.5rem;
}
.task-detail-description h3 {
    margin: 0 0 0.5rem;
    font-size: 1rem;
    color: var(--text-muted);
}
.task-description-body {
    word-break: break-word;
}
.task-description-body code {
    background: #2d2d2d;
    color: #e8e8e8;
    padding: 0.15em 0.4em;
    border-radius: 3px;
    font-size: 0.9em;
}
.task-description-body a {
    color: var(--text);
}
.task-description-body a:hover,
.task-description-body a:active {
    color: var(--link-hover);
}
.task-description-body strong { font-weight: 600; }
.task-description-body em { font-style: italic; }
.task-description-body ul, .task-description-body ol { margin: 0.5em 0 0.5em 1.5em; }
.task-description-body li { margin: 0.25em 0; }
.task-description-body img {
    max-width: 100%;
    height: auto;
    vertical-align: middle;
}
.form-upload-image {
    margin-top: 0.5rem;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}
.form-upload-image .upload-status { font-size: 0.9em; color: var(--text-muted); }
.form-upload-image .upload-status.error { color: var(--error); }
.form-upload-image .upload-status.success { color: var(--success, green); }
.task-detail-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}
.task-delete-btn {
    color: var(--error);
}

/* API Documentation page — padding and code styling to match Quill editor code blocks */
/* Override .page-area main { padding: 0 } so api-docs has breathing room */
.page-area main.api-docs,
.api-docs {
    max-width: 50rem;
    margin: 0 auto;
    padding: 0 2rem 2rem;
}
/* Quick navigation at top of API docs */
.api-docs-nav {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.5rem 1rem;
    margin-bottom: 2rem;
    padding: 1rem;
    background: var(--bg-subtle, rgba(0,0,0,0.06));
    border-radius: 8px;
    font-size: 0.9rem;
}
.api-docs-nav strong {
    margin-right: 0.25rem;
}
.api-docs-nav a {
    color: var(--link-color, #2563eb);
    text-decoration: none;
}
.api-docs-nav a:hover {
    text-decoration: underline;
}

.api-docs h2 {
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
    font-size: 1.125rem;
}
.api-docs h3 {
    margin-top: 1rem;
    margin-bottom: 0.35rem;
    font-size: 1rem;
}
.api-docs p,
.api-docs ul {
    margin-bottom: 0.75rem;
}
/* Match .task-description-body code and Quill code blocks: dark background, light text, good contrast */
.api-docs code {
    background: var(--bg-code);
    color: #e8e8e8;
    padding: 0.2em 0.5em;
    border-radius: 3px;
    font-size: 0.9em;
    font-family: ui-monospace, 'Cascadia Code', 'Source Code Pro', Menlo, Consolas, monospace;
}
.api-docs pre {
    background: var(--bg-code);
    color: #e8e8e8;
    padding: 0.75rem 1rem;
    border-radius: 6px;
    overflow-x: auto;
    font-size: 0.875rem;
    margin: 0.5rem 0 1rem;
    font-family: ui-monospace, 'Cascadia Code', 'Source Code Pro', Menlo, Consolas, monospace;
}
.api-docs pre code {
    background: none;
    padding: 0;
    font-size: inherit;
}
.api-docs .base-url {
    font-weight: 600;
}
.api-docs .endpoint-section {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}
/* Resource section title (Projects, Domains, Features, Tags) — largest */
.api-docs .endpoint-section h3 {
    margin-top: 0;
    margin-bottom: 0.5rem;
    font-size: 1.75rem;
    font-weight: 700;
}
/* API endpoint title (GET /api/v1/...) — slightly smaller */
.api-docs .endpoint-section h4 {
    margin-top: 1rem;
    margin-bottom: 0.25rem;
    font-size: 1.15rem;
    font-weight: 600;
}
/* Sub-headers (Query parameters, Response, Request body, etc.) — smaller again */
.api-docs .api-doc-subhead {
    margin-top: 0.75rem;
    margin-bottom: 0.25rem;
    font-size: 0.9rem;
    font-weight: 600;
}
/* Indent all content under each endpoint (GET/POST/...) for easier scanning */
.api-docs .endpoint-details {
    margin-left: 2rem;
    padding-left: 0;
}
.api-docs table.api-params {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
    margin: 0.5rem 0 1rem;
}
.api-docs table.api-params th,
.api-docs table.api-params td {
    padding: 0.35rem 0.5rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}
.api-docs table.api-params th {
    font-weight: 600;
    background: var(--bg-subtle, rgba(0,0,0,0.05));
}
.api-docs table.api-params code {
    padding: 0.1em 0.35em;
}
.api-docs pre.api-example,
.api-docs pre.api-curl {
    margin: 0.5rem 0 1rem;
}
@media (max-width: 600px) {
    .page-area main.api-docs,
    .api-docs {
        padding: 1rem 1rem 1.5rem;
    }
}

/* App footer — use on authenticated pages for consistent layout */
.app-footer {
    margin-top: 2.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
    font-size: 0.875rem;
    color: var(--text-muted);
    text-align: center;
}

/* ---- Responsive breakpoints (mobile-first where applicable) ---- */
/* Narrow: single column, stacked nav, touch-friendly spacing */
@media (max-width: 600px) {
    body {
        padding: 0.75rem;
    }
    .dashboard-layout {
        flex-direction: column;
    }
    .dashboard-nav {
        flex: 1 1 100%;
        min-width: 0;
    }
    .dashboard-nav .project-list a,
    .dashboard-nav .nav-features-link {
        min-height: 2.75rem;
        padding: 0.5rem 0.5rem;
        display: inline-flex;
        align-items: center;
    }
    /* Tables: keep within viewport on small screens */
    .data-table-wrapper {
        overflow-x: visible;
        margin: 0;
    }
    .data-table-wrapper .data-table {
        min-width: 0;
    }
    .data-table th,
    .data-table td {
        padding: 0.5rem 0.5rem;
        font-size: 0.85rem;
    }
}
/* Very small viewports: ensure readable text and tap targets */
@media (max-width: 480px) {
    html {
        font-size: 15px;
    }
    header p a {
        min-height: 2.75rem;
        padding: 0.5rem 0.25rem;
    }
}
/* Wide: more breathing room */
@media (min-width: 768px) {
    body {
        padding: 1.25rem;
    }
    main {
        padding-left: 0.25rem;
        padding-right: 0.25rem;
    }
}
@media (min-width: 1024px) {
    body {
        padding: 1.5rem;
    }
}

/* 2026 aesthetic refresh */
:root {
    --font-body: 'Manrope', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-ui: 'Space Grotesk', 'Segoe UI', sans-serif;
    --bg: #0b1122;
    --bg-deep: #060a14;
    --bg-elevated: rgba(13, 19, 35, 0.9);
    --bg-code: rgba(9, 14, 27, 0.92);
    --bg-subtle: rgba(13, 19, 35, 0.66);
    --text: #eef2ff;
    --text-muted: #96a0c2;
    --link-hover: #ffffff;
    --border: rgba(122, 137, 184, 0.18);
    --border-strong: rgba(149, 166, 220, 0.3);
    --accent: #c88368;
    --accent-hover: #df9979;
    --input-bg: rgba(7, 11, 22, 0.9);
    --project-bg: rgba(18, 26, 48, 0.94);
    --feature-bg: rgba(12, 18, 35, 0.9);
    --panel-shadow: 0 18px 40px rgba(2, 6, 18, 0.35);
    --focus-ring: rgba(223, 153, 121, 0.45);
}

html {
    background: var(--bg-deep);
}

body {
    font-family: var(--font-body);
    color: var(--text);
    background-color: var(--bg-deep);
    background-image:
        radial-gradient(circle at top left, rgba(74, 67, 151, 0.24) 0%, rgba(74, 67, 151, 0) 34%),
        radial-gradient(circle at top right, rgba(58, 106, 196, 0.14) 0%, rgba(58, 106, 196, 0) 28%),
        linear-gradient(180deg, #151834 0%, #0c1224 48%, #060a14 100%);
    background-attachment: fixed;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

::selection {
    background: rgba(200, 131, 104, 0.32);
    color: #fff;
}

a {
    color: var(--text);
}

a:hover {
    color: var(--link-hover);
}

.app-wrapper {
    position: relative;
}

.left-nav {
    width: 15.75rem;
    background:
        linear-gradient(180deg, rgba(17, 24, 44, 0.96) 0%, rgba(8, 12, 23, 0.97) 100%);
    border-right: 1px solid var(--border-strong);
    box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.02);
}

.left-nav-inner {
    padding: 1.5rem 0 2.25rem;
}

.left-nav-inner > .left-nav-section:first-of-type {
    margin: 0 1.5rem 1.35rem;
    color: #ee9a7c;
    font-family: var(--font-ui);
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: none;
}

.left-nav-section {
    margin: 1.05rem 1.5rem 0.42rem;
    color: #808cb3;
    font-family: var(--font-ui);
    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    -webkit-user-select: none;
    user-select: none;
    cursor: default;
}

.left-nav-list {
    margin: 0;
    padding: 0 0 0.92rem;
    border-bottom: 1px solid var(--border);
}

.left-nav-inner > .left-nav-list:last-of-type {
    padding-bottom: 0;
    border-bottom: none;
}

.left-nav-list li + li {
    margin-top: 0.04rem;
}

.left-nav-list a,
.left-nav-muted {
    position: relative;
    display: block;
    min-height: 2.1rem;
    padding: 0.42rem 1.55rem 0.42rem 2rem;
    font-family: var(--font-ui);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: #d7deff;
    text-decoration: none;
}

.left-nav-list a::before,
.left-nav-muted::before {
    content: '';
    position: absolute;
    left: 1.25rem;
    top: 50%;
    width: 0.22rem;
    height: 0.95rem;
    transform: translateY(-50%);
    background: linear-gradient(180deg, rgba(143, 158, 255, 0.85) 0%, rgba(97, 110, 191, 0.35) 100%);
    opacity: 0.7;
}

.left-nav-muted {
    color: var(--text-muted);
    -webkit-user-select: none;
    user-select: none;
    cursor: default;
}

.left-nav-muted::before {
    opacity: 0.25;
}

.left-nav-project-list .left-nav-project-link::before {
    left: 1.18rem;
    width: 0.22rem;
    height: 0.98rem;
    border-radius: 0;
    background: var(--project-chip-colour, #ff5e7a);
    opacity: 1;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.14), 0 0 12px rgba(255, 255, 255, 0.05);
}

.left-nav-project-list .left-nav-project-link-all::before {
    background: linear-gradient(180deg, #ff2d55 0%, #ff6a00 18%, #ffd60a 34%, #32d74b 50%, #64d2ff 66%, #0a84ff 82%, #bf5af2 100%);
}

.left-nav-list a:hover {
    background: rgba(255, 255, 255, 0.035);
    color: #ffffff;
    text-decoration: none;
    box-shadow: inset 2px 0 0 rgba(200, 131, 104, 0.65);
}

.left-nav-overlay {
    background: rgba(4, 8, 17, 0.72);
    backdrop-filter: blur(2px);
}

.page-area {
    background: linear-gradient(180deg, rgba(12, 17, 32, 0.36) 0%, rgba(6, 10, 20, 0.16) 100%);
}

.page-header {
    min-height: 4rem;
    padding: 0 1.2rem;
    border-bottom: 1px solid var(--border-strong);
    background: linear-gradient(180deg, rgba(18, 25, 46, 0.92) 0%, rgba(10, 14, 27, 0.94) 100%);
    backdrop-filter: blur(14px);
}

.page-header-title {
    font-family: var(--font-ui);
    font-size: 0.88rem;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: #dde5ff;
}

.nav-toggle,
.actions-menu-button,
.new-task-popup-close,
.search-toolbar .search-clear {
    border-radius: 0;
}

.nav-toggle {
    width: 3rem;
    height: 3rem;
    border: 1px solid transparent;
}

.nav-toggle:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: var(--border);
    color: var(--accent);
}

.page-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.65rem;
    margin: 0;
    padding: 0.95rem 1rem 1rem;
    font-size: 1rem;
}

.page-copy {
    padding-left: 1rem;
    padding-right: 1rem;
}

.page-actions .btn + .btn,
.page-actions .btn + .btn-secondary,
.page-actions .btn-secondary + .btn,
.page-actions .btn-secondary + .btn-secondary,
.page-actions .btn-secondary + .save-view-link,
.page-actions .save-view-link {
    margin-left: 0;
}

.page-actions .btn,
.page-actions .btn-secondary,
.page-actions .save-view-link,
.search-toolbar .search-form .btn,
.form-actions button,
.form-actions .button-link,
.login-page button,
.new-task-form-actions button[type="submit"],
.task-edit-form-actions button[type="submit"],
.new-task-draft-confirm-btn,
.button-link,
.link-button,
.change-password-btn,
a.change-password-btn:visited {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    padding: 0.78rem 1.05rem;
    border: 1px solid var(--border);
    border-radius: 0;
    background: linear-gradient(180deg, rgba(17, 24, 44, 0.92) 0%, rgba(10, 14, 26, 0.96) 100%);
    color: var(--text);
    font-family: var(--font-ui);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    text-decoration: none;
    box-shadow: none;
}

.page-actions .btn,
.search-toolbar .search-form .btn,
.form-actions button,
.login-page button,
.new-task-form-actions button[type="submit"],
.task-edit-form-actions button[type="submit"],
.new-task-draft-confirm-btn-primary {
    border-color: rgba(226, 171, 148, 0.22);
    background: linear-gradient(180deg, #bb7d63 0%, #8f604f 100%);
    color: #fff8f4;
}

.page-actions .btn:hover,
.search-toolbar .search-form .btn:hover,
.form-actions button:hover,
.login-page button:hover,
.new-task-form-actions button[type="submit"]:hover,
.task-edit-form-actions button[type="submit"]:hover,
.new-task-draft-confirm-btn-primary:hover {
    background: linear-gradient(180deg, #cc8c71 0%, #9f6a57 100%);
    color: #fff;
}

.page-actions .btn-secondary,
.page-actions .save-view-link,
.form-actions .button-link,
.button-link,
.link-button,
.change-password-btn,
a.change-password-btn:visited,
.new-task-draft-confirm-btn {
    border-color: var(--border);
    background: linear-gradient(180deg, rgba(18, 24, 44, 0.94) 0%, rgba(10, 14, 27, 0.98) 100%);
    color: #d5ddff;
}

.page-actions .btn-secondary:hover,
.page-actions .save-view-link:hover,
.form-actions .button-link:hover,
.button-link:hover,
.link-button:hover,
.change-password-btn:hover,
.new-task-draft-confirm-btn:hover {
    background: rgba(255, 255, 255, 0.045);
    border-color: var(--border-strong);
    color: #ffffff;
    text-decoration: none;
    outline: none;
}

.link-button,
.task-edit-delete-btn {
    padding-left: 0.9rem;
    padding-right: 0.9rem;
}

.link-button:hover,
.task-edit-delete-btn:hover {
    text-decoration: none;
}

.task-edit-delete-btn,
.actions-menu-item-delete,
.task-delete-btn,
.change-password-btn,
a.change-password-btn:visited {
    color: #f4a68b;
}

.task-edit-delete-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.78rem 1.05rem;
    border: 1px solid rgba(244, 166, 139, 0.26);
    border-radius: 0;
    background: linear-gradient(180deg, rgba(43, 21, 22, 0.78) 0%, rgba(24, 11, 12, 0.92) 100%);
    font-family: var(--font-ui);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.task-edit-delete-btn:hover,
.actions-menu-item-delete:hover,
.actions-menu-item-delete:focus-visible {
    background: rgba(244, 166, 139, 0.12);
    border-color: rgba(244, 166, 139, 0.34);
    color: #ffd7c7;
}

.tasks-page .page-scroll-content {
    --tasks-h-l0: 4rem;
    --tasks-toolbar-height: 4.45rem;
}

.tasks-page .tasks-toolbar {
    background: linear-gradient(180deg, rgba(15, 22, 40, 0.94) 0%, rgba(10, 14, 28, 0.98) 100%);
    border-bottom: 1px solid var(--border-strong);
    padding-bottom: 0.4rem;
}

.dashboard-nav,
.overview-project-item,
.tasks-popup,
.new-task-popup,
.new-task-draft-confirm-panel,
.tag-picker-dropdown,
.actions-menu-popup,
.api-docs-nav,
.form-tags {
    border: 1px solid var(--border);
    border-radius: 0;
    background: linear-gradient(180deg, rgba(19, 26, 48, 0.94) 0%, rgba(10, 14, 27, 0.98) 100%);
    box-shadow: var(--panel-shadow);
}

.dashboard-nav {
    padding: 1rem;
}

.dashboard-nav h2,
.dashboard-section-title,
.data-table th,
.tasks-popup-section-label,
.form-page label,
.login-page label,
.new-task-form label,
.task-edit-form label.task-edit-label,
.task-edit-meta-row,
.task-detail-description h3,
.task-detail-meta dt,
.api-docs h2,
.api-docs h3,
.api-docs .api-doc-subhead {
    font-family: var(--font-ui);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.dashboard-nav .project-list a,
.dashboard-section-favourites .favourites-list a,
.overview-project-link,
.overview-project-name,
.overview-by-status {
    font-family: var(--font-ui);
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.dashboard-nav .project-list a,
.dashboard-section-favourites .favourites-list a {
    padding: 0.7rem 0.85rem;
    border-radius: 0;
}

.dashboard-nav .project-list a:hover,
.dashboard-section-favourites .favourites-list a:hover,
.overview-project-link:hover {
    background: rgba(255, 255, 255, 0.04);
    text-decoration: none;
}

.dashboard-nav .project-list a.active {
    background: linear-gradient(180deg, rgba(195, 131, 104, 0.94) 0%, rgba(143, 96, 79, 0.98) 100%);
    color: #fff;
}

.overview-project-item {
    padding: 0.8rem 1rem;
}

.overview-project-link {
    gap: 0.5rem;
}

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

.data-table th,
.task-table th,
.api-docs table.api-params th {
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.02);
}

.data-table td,
.data-table th,
.api-docs table.api-params th,
.api-docs table.api-params td {
    border-bottom-color: var(--border);
}

.data-table tbody tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

.search-toolbar .search-form {
    padding: 0.85rem 1rem 1rem;
}

.search-toolbar .search-input,
.login-page input,
.form-page input,
.form-page select,
.form-page textarea,
.new-task-form input[type="text"]:not(.task-edit-title-input),
.new-task-form textarea:not(.task-edit-title-input),
.new-task-fields select,
.task-edit-fields select,
.tasks-popup-inner label select {
    border-radius: 0;
    border-color: var(--border);
    background-color: rgba(7, 10, 20, 0.98);
    background: linear-gradient(180deg, rgba(10, 14, 27, 0.95) 0%, rgba(7, 10, 20, 0.98) 100%);
    color: var(--text);
    color-scheme: dark;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.02);
}

.form-page select,
.new-task-fields select,
.task-edit-fields select,
.tasks-popup-inner label select {
    appearance: auto;
}

.form-page select option,
.form-page select optgroup,
.new-task-fields select option,
.new-task-fields select optgroup,
.task-edit-fields select option,
.task-edit-fields select optgroup,
.tasks-popup-inner label select option,
.tasks-popup-inner label select optgroup {
    background: #0a0f1d;
    background-color: #0a0f1d;
    color: #eef2ff;
}

.search-toolbar .search-input:focus,
.login-page input:focus,
.form-page input:focus,
.form-page select:focus,
.form-page textarea:focus,
.new-task-form input[type="text"]:not(.task-edit-title-input):focus,
.new-task-form textarea:not(.task-edit-title-input):focus,
.new-task-fields select:focus,
.task-edit-fields select:focus,
.tasks-popup-inner label select:focus {
    outline: none;
    border-color: rgba(223, 153, 121, 0.48);
    box-shadow: 0 0 0 1px rgba(223, 153, 121, 0.2);
}

.search-toolbar .search-input::placeholder,
.login-page input::placeholder,
.form-page input::placeholder,
.form-page textarea::placeholder,
.new-task-form input[type="text"]:not(.task-edit-title-input)::placeholder,
.new-task-form textarea:not(.task-edit-title-input)::placeholder,
.task-edit-title-input::placeholder,
.new-task-form .task-edit-title-input::placeholder {
    color: #7f89aa;
}

.tasks-popup-inner {
    gap: 0.9rem;
    padding: 1rem 1.1rem;
}

.tasks-popup-inner label {
    font-family: var(--font-ui);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.tasks-popup-inner label select,
.task-field-pill,
.tag-picker-option {
    font-family: var(--font-ui);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.new-task-popup,
.new-task-draft-confirm-panel {
    border-radius: 0;
}

.new-task-popup-inner {
    padding: 1.15rem 1.35rem 1.25rem;
}

.new-task-popup-close {
    top: 1.1rem;
    right: 1.35rem;
    border-color: var(--border);
    background: rgba(255, 255, 255, 0.02);
}

.new-task-popup-close:hover {
    border-color: rgba(223, 153, 121, 0.4);
    background: rgba(223, 153, 121, 0.1);
    color: #fff;
}

.actions-menu-button {
    width: 2.15rem;
    height: 1.9rem;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.03);
    color: #d5ddff;
}

.actions-menu-button:hover,
.actions-menu-button:focus-visible {
    border-color: var(--border-strong);
    background: rgba(255, 255, 255, 0.05);
    color: #ffffff;
}

.actions-menu-popup {
    border-radius: 0;
    overflow: hidden;
}

.actions-menu-item {
    display: block;
    width: 100%;
    padding: 0.65rem 0.85rem;
    border: none;
    background: none;
    color: #d5ddff;
    font-family: var(--font-ui);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-align: left;
    text-transform: uppercase;
    text-decoration: none;
    box-shadow: none;
}

.actions-menu-item:hover,
.actions-menu-item:focus-visible {
    background: rgba(255, 255, 255, 0.04);
    color: #ffffff;
    outline: none;
}

.task-edit-page {
    max-width: 44rem;
}

.task-edit-heading {
    font-family: var(--font-ui);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.task-edit-title-input,
.new-task-form .task-edit-title-input,
.task-title,
.task-detail-title,
.task-description-body,
.task-table .task-title-cell .task-extra-details,
.task-detail-meta dd {
    font-family: var(--font-body);
    text-transform: none;
    letter-spacing: normal;
}

.task-edit-title-input,
.new-task-form .task-edit-title-input {
    font-size: 1.35rem;
    font-weight: 700;
}

.task-edit-fields,
.new-task-fields,
.task-form-tags-wrap {
    gap: 0.65rem;
    margin-top: 1rem;
}

.task-field-pill {
    min-width: 6.1rem;
    max-width: 10rem;
    min-height: 2rem;
    padding: 0.52rem 0.78rem;
    border: 1px solid var(--border);
    border-radius: 0;
    background: linear-gradient(180deg, rgba(19, 26, 48, 0.94) 0%, rgba(10, 14, 27, 0.98) 100%);
    color: var(--text);
}

.task-field-pill:hover {
    border-color: var(--border-strong);
    background: rgba(255, 255, 255, 0.045);
}

.task-form-tag-pill-wrap .tag-pill,
.tag-pill,
.tag-checkboxes .tag-pill-inline {
    border-radius: 2px;
    background: linear-gradient(180deg, rgba(18, 24, 44, 0.9) 0%, rgba(10, 14, 27, 0.98) 100%);
    border-color: var(--border);
}

.tag-picker-dropdown {
    min-width: 11rem;
    border-radius: 0;
}

.tag-picker-option {
    padding: 0.55rem 0.8rem;
}

.tag-picker-option:hover {
    background: rgba(255, 255, 255, 0.04);
}

.task-groups {
    gap: 1.5rem;
    --tasks-h-l1: 3rem;
    --tasks-h-l2: 2.35rem;
    --tasks-h-l3: 1.8rem;
}

.task-group.project-group {
    padding-bottom: 1.25rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.task-group .group-title,
.task-group .group-title-row {
    height: var(--tasks-h-l1);
    padding: 0 1.25rem;
    border-top: 1px solid rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid var(--border-strong);
    background: linear-gradient(180deg, rgba(22, 31, 56, 0.98) 0%, rgba(13, 19, 36, 0.98) 100%);
    font-family: var(--font-ui);
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.feature-title,
.feature-title-row {
    height: var(--tasks-h-l2);
    padding: 0 1.25rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.035);
    background: linear-gradient(180deg, rgba(14, 20, 39, 0.95) 0%, rgba(10, 14, 28, 0.98) 100%);
    font-family: var(--font-ui);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.status-title {
    --status-header-accent: 143 154 191;
    height: var(--tasks-h-l3);
    padding: 0 1.25rem;
    position: relative;
    overflow: hidden;
    background: rgba(8, 12, 23, 0.96);
    box-shadow: inset 0 -1px 0 rgba(255, 255, 255, 0.08);
    font-family: var(--font-ui);
    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: #8f9abf;
}

.status-title::before {
    content: '';
    position: absolute;
    inset: 0 auto 0 0;
    width: 8.5rem;
    background: linear-gradient(90deg, rgb(var(--status-header-accent) / 0.72) 0%, rgb(var(--status-header-accent) / 0.28) 48%, rgb(var(--status-header-accent) / 0) 100%);
    pointer-events: none;
}

.status-title > * {
    position: relative;
    z-index: 1;
}

.status-title-content {
    gap: 1.15rem;
}

.status-title-line {
    margin-left: 0.65rem;
    border-bottom: none;
}

.status-title.status-title-backlog {
    --status-header-accent: 79 95 140;
}

.status-title.status-title-todo {
    --status-header-accent: 125 134 255;
}

.status-title.status-title-in-progress {
    --status-header-accent: 242 179 107;
}

.status-title.status-title-resolved {
    --status-header-accent: 79 209 160;
}

.task-group .group-title .status-indicator,
.feature-title .status-indicator,
.status-title .status-indicator {
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.02);
}

.status-title .status-indicator {
    width: 0.38rem;
    height: 0.38rem;
}

.task-group .group-add-task-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.85rem;
    height: 1.85rem;
    padding: 0;
    margin: 0;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.03);
    color: #c8d0ef;
}

.feature-title-row .group-add-task-btn,
.status-title .group-add-task-btn {
    width: 1.65rem;
    height: 1.65rem;
    padding-right: 0;
}

.task-group .group-add-task-btn:hover,
.task-group .group-add-task-btn:active,
.task-group .group-add-task-btn:focus-visible {
    border-color: rgba(223, 153, 121, 0.42);
    background: rgba(223, 153, 121, 0.1);
    color: #ffffff;
    outline: none;
}

.task-table {
    margin-top: 0;
}

.task-table tbody tr {
    border-bottom: none;
    line-height: 1;
}

.task-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

.task-table tbody td {
    padding-top: 0.04rem;
    padding-bottom: 0.04rem;
}

.task-table .task-title-cell {
    padding-left: 0.8rem;
}

.task-title {
    padding: 0.24rem 0;
    font-size: 0.86rem;
    font-weight: 600;
    color: var(--text);
}

.task-table .task-title-cell .task-extra-details {
    font-size: 0.72rem;
}

.task-table .task-tags-cell .tag-pill {
    padding: 0.12rem 0.4rem;
    font-size: 0.7rem;
}

.task-title:hover,
.task-title:focus-visible,
.task-table .task-title-cell a:hover,
.task-table .task-title-cell a:focus-visible {
    color: #ffffff;
    text-decoration: none;
}

.task-table .task-owner {
    font-family: var(--font-ui);
    font-size: 0.68rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #b1bbde;
}

.task-table .task-owner .user-avatar {
    width: 1.28rem;
    height: 1.28rem;
    min-width: 1.28rem;
    min-height: 1.28rem;
    font-size: 0.66rem;
}

.status-indicator.status-backlog { background: #4f5f8c; }
.status-indicator.status-todo { background: #7d86ff; }
.status-indicator.status-in-progress { background: #f2b36b; }
.status-indicator.status-resolved { background: #4fd1a0; }

.task-detail,
.page-area main.api-docs,
.api-docs {
    padding-top: 1.25rem;
}

.api-docs h2,
.api-docs h3,
.task-detail-description h3 {
    margin-bottom: 0.65rem;
}

.api-docs-nav a {
    text-decoration: none;
}

.api-docs-nav a:hover {
    text-decoration: none;
    color: #fff;
}

.app-footer {
    color: #808cb3;
}

* {
    scrollbar-width: thin;
    scrollbar-color: rgba(124, 139, 197, 0.62) rgba(6, 10, 20, 0.92);
}

*::-webkit-scrollbar {
    width: 0.8rem;
    height: 0.8rem;
}

*::-webkit-scrollbar-track {
    background: rgba(6, 10, 20, 0.92);
}

*::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, rgba(112, 127, 181, 0.88) 0%, rgba(79, 92, 146, 0.92) 100%);
    border: 3px solid rgba(6, 10, 20, 0.92);
    border-radius: 999px;
}

*::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, rgba(142, 156, 214, 0.92) 0%, rgba(95, 109, 169, 0.96) 100%);
}

*::-webkit-scrollbar-corner {
    background: rgba(6, 10, 20, 0.92);
}

@media (max-width: 767px) {
    .left-nav {
        width: min(18rem, 86vw);
    }

    .page-header {
        padding-left: 0.85rem;
        padding-right: 0.85rem;
    }

    .page-actions,
    .search-toolbar .search-form {
        padding-left: 0.85rem;
        padding-right: 0.85rem;
    }

    .page-copy {
        padding-left: 0.85rem;
        padding-right: 0.85rem;
    }

    .task-group .group-title,
    .task-group .group-title-row,
    .feature-title,
    .feature-title-row,
    .status-title {
        padding-left: 0.85rem;
        padding-right: 0.85rem;
    }
}
