:root {
    --bg: #f4f6f8;
    --surface: #ffffff;
    --surface-soft: #f8fafc;
    --ink: #172033;
    --muted: #687386;
    --line: #dce2e9;
    --brand: #176b5b;
    --brand-dark: #105044;
    --brand-soft: #e3f2ee;
    --accent: #d9873c;
    --danger: #b42318;
    --danger-soft: #feeceb;
    --success: #16794b;
    --shadow: 0 18px 45px rgba(28, 40, 55, 0.08);
    --radius: 16px;
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    background: var(--bg);
}

body {
    min-height: 100vh;
    margin: 0;
    color: var(--ink);
    background:
        radial-gradient(circle at 8% 0%, rgba(23, 107, 91, 0.09), transparent 28rem),
        var(--bg);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.55;
}

a {
    color: var(--brand);
    text-decoration: none;
}

a:hover {
    color: var(--brand-dark);
}

h1,
h2,
h3,
p {
    margin-top: 0;
}

h1 {
    margin-bottom: 0.55rem;
    font-size: clamp(2rem, 5vw, 3.4rem);
    line-height: 1.08;
    letter-spacing: -0.045em;
}

h2 {
    margin-bottom: 1rem;
    font-size: 1.35rem;
    letter-spacing: -0.025em;
}

h3 {
    margin-bottom: 0.35rem;
}

.site-header {
    border-bottom: 1px solid rgba(6, 100, 122, 0.24);
    background: white;
    box-shadow: 0 6px 22px rgba(28, 40, 55, 0.09);
}

.institutional-masthead {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    width: min(1600px, 96vw);
    min-height: 68px;
    margin: 0 auto;
    gap: 1.5rem;
}

.usp-brand {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-self: start;
    width: 122px;
    height: 49px;
}

.usp-brand img {
    position: relative;
    z-index: 1;
    display: block;
    width: 122px;
    height: 49px;
    object-fit: contain;
    background: white;
}

.usp-wordmark {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    border: 3px solid #9a9a9a;
    border-radius: 9px;
    color: #777;
    background: white;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 1.65rem;
    font-weight: 800;
    letter-spacing: 0.08em;
}

.system-identity {
    display: flex;
    align-items: center;
    flex-direction: column;
    justify-self: center;
    color: #252b33;
    line-height: 1.12;
    text-align: center;
}

.system-identity:hover {
    color: #252b33;
}

.system-identity strong {
    font-family: Arial, Helvetica, sans-serif;
    font-size: 1.95rem;
    font-weight: 500;
    letter-spacing: -0.035em;
}

.system-identity span {
    margin-top: 0.22rem;
    color: #707984;
    font-size: 0.7rem;
    font-weight: 650;
    letter-spacing: 0.055em;
    text-transform: uppercase;
}

.user-summary {
    display: flex;
    align-items: flex-end;
    flex-direction: column;
    justify-self: end;
    color: #4e5967;
    line-height: 1.25;
    text-align: right;
}

.user-summary > span {
    font-size: 0.76rem;
}

.user-summary > a,
.user-summary > strong {
    color: #1f2937;
    font-size: 0.94rem;
    font-weight: 750;
}

.user-summary small {
    margin-top: 0.15rem;
    color: #77818d;
    font-size: 0.66rem;
}

.system-navigation {
    min-height: 50px;
    color: white;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.08), transparent 48%),
        linear-gradient(180deg, #18a2b9 0%, #07859d 100%);
    box-shadow: inset 0 1px rgba(255, 255, 255, 0.23);
    font-family: Verdana, Geneva, sans-serif;
}

.navigation-inner {
    position: relative;
    width: min(1600px, 96vw);
    margin: 0 auto;
}

.brand-mark {
    display: inline-grid;
    width: 38px;
    height: 38px;
    place-items: center;
    border-radius: 11px;
    color: white;
    background: var(--brand);
    box-shadow: 0 8px 20px rgba(23, 107, 91, 0.22);
    font-size: 0.82rem;
    font-weight: 900;
    letter-spacing: 0.03em;
}

.topbar-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 50px;
    gap: 1rem;
    font-size: 0.88rem;
}

.nav-group {
    display: flex;
    align-items: stretch;
    min-height: 50px;
}

.topbar-nav a,
.topbar-nav .link-button {
    display: inline-flex;
    align-items: center;
    min-height: 50px;
    padding: 0 1rem;
    border: 0;
    border-bottom: 3px solid transparent;
    color: rgba(255, 255, 255, 0.95);
    background: transparent;
    font: inherit;
    font-weight: 500;
    transition: background 140ms ease, border-color 140ms ease;
}

.topbar-nav a:hover,
.topbar-nav .link-button:hover,
.topbar-nav .is-active {
    color: white;
    background: rgba(0, 67, 83, 0.19);
    border-bottom-color: rgba(255, 255, 255, 0.88);
}

.topbar-nav form {
    display: flex;
    margin: 0;
}

.nav-toggle-input,
.nav-toggle-label {
    display: none;
}

.link-button {
    padding: 0;
    border: 0;
    color: var(--brand);
    background: transparent;
    cursor: pointer;
    font: inherit;
}

.page-shell {
    width: min(1600px, 96vw);
    min-height: calc(100vh - 150px);
    margin: 0 auto;
    padding: 3.5rem 0 5rem;
}

.footer {
    display: flex;
    justify-content: space-between;
    width: min(1600px, 96vw);
    margin: 0 auto;
    padding: 1.7rem 0;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: 0.85rem;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0.68rem 1.15rem;
    border: 1px solid var(--brand);
    border-radius: 10px;
    color: white;
    background: var(--brand);
    box-shadow: 0 7px 16px rgba(23, 107, 91, 0.15);
    cursor: pointer;
    font: inherit;
    font-weight: 750;
    transition: 160ms ease;
}

.button:hover {
    color: white;
    background: var(--brand-dark);
    transform: translateY(-1px);
}

.button-small {
    min-height: 36px;
    padding: 0.42rem 0.85rem;
}

.button-secondary {
    border-color: var(--line);
    color: var(--ink);
    background: white;
    box-shadow: none;
}

.button-secondary:hover {
    border-color: #c5ced8;
    color: var(--ink);
    background: var(--surface-soft);
}

.button-danger {
    border-color: var(--danger);
    background: var(--danger);
    box-shadow: 0 7px 16px rgba(180, 35, 24, 0.13);
}

.button-danger:hover {
    background: #8f1c13;
}

.button-block {
    width: 100%;
}

.eyebrow {
    margin-bottom: 0.5rem;
    color: var(--brand);
    font-size: 0.75rem;
    font-weight: 850;
    letter-spacing: 0.13em;
    text-transform: uppercase;
}

.page-heading,
.panel-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 2rem;
}

.page-heading p:not(.eyebrow) {
    max-width: 650px;
    color: var(--muted);
}

.page-heading {
    align-items: center;
    margin-bottom: 1.8rem;
}

.page-heading h1 {
    font-size: clamp(2rem, 4vw, 2.8rem);
}

.panel,
.auth-card {
    border: 1px solid rgba(220, 226, 233, 0.9);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow);
}

.panel {
    padding: clamp(1.25rem, 3vw, 2rem);
}

.panel-heading {
    align-items: center;
    margin-bottom: 1.25rem;
}

.panel-heading h2 {
    margin-bottom: 0;
}

.project-task-counts {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.table-wrap .project-task-counts {
    margin-top: 0.5rem;
}

.project-task-count {
    display: inline-flex;
    align-items: baseline;
    gap: 0.25rem;
    padding: 0.28rem 0.55rem;
    border-radius: 999px;
    color: var(--muted);
    background: #eef2f5;
    font-size: 0.75rem;
    font-weight: 700;
    white-space: nowrap;
}

.project-task-count strong {
    color: var(--ink);
    font-size: 0.9rem;
}

.project-task-count-overdue {
    color: var(--danger);
    background: var(--danger-soft);
}

.project-task-count-overdue strong {
    color: var(--danger);
}

.role-badge {
    display: inline-flex;
    align-items: center;
    width: max-content;
    padding: 0.32rem 0.65rem;
    border: 1px solid #d7dee7;
    border-radius: 999px;
    color: #4c596b;
    background: #f4f6f9;
    font-size: 0.73rem;
    font-weight: 800;
    white-space: nowrap;
}

.role-manager {
    border-color: #f2d5b8;
    color: #874b16;
    background: #fff3e8;
}

.role-admin {
    border-color: #bce0d7;
    color: var(--brand-dark);
    background: var(--brand-soft);
}

.auth-layout {
    display: grid;
    grid-template-columns: minmax(0, 440px);
    align-items: center;
    justify-content: center;
}

.auth-page-shell {
    min-height: 0;
    padding-top: 2.25rem;
    padding-bottom: 2.25rem;
}

.auth-intro h1 {
    max-width: 700px;
}

.auth-intro > p:not(.eyebrow) {
    max-width: 620px;
    color: var(--muted);
    font-size: 1.08rem;
}

.auth-highlight {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    max-width: 540px;
    margin-top: 2.5rem;
    padding: 1.15rem 1.3rem;
    border-left: 4px solid var(--accent);
    background: rgba(255, 255, 255, 0.6);
}

.auth-highlight span {
    color: var(--muted);
    font-size: 0.9rem;
}

.auth-card {
    padding: clamp(1.5rem, 4vw, 2.3rem);
}

.auth-card-heading {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.8rem;
}

.auth-card-heading h2,
.auth-card-heading p {
    margin-bottom: 0;
}

.auth-card-heading p,
.auth-footer {
    color: var(--muted);
    font-size: 0.88rem;
}

.auth-footer {
    margin: 1.2rem 0 0;
    text-align: center;
}

.auth-divider {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    margin: 1.4rem 0;
    color: var(--muted);
    cursor: pointer;
    font-size: 0.8rem;
    list-style: none;
    text-transform: uppercase;
}

.auth-divider::-webkit-details-marker {
    display: none;
}

.auth-divider::before,
.auth-divider::after {
    flex: 1;
    height: 1px;
    background: var(--line);
    content: "";
}

.auth-local-access[open] .auth-divider {
    margin-bottom: 1.2rem;
}

.feature-list {
    display: grid;
    gap: 0.8rem;
    margin: 2rem 0 0;
    padding: 0;
    list-style: none;
}

.feature-list li {
    position: relative;
    padding-left: 1.7rem;
    color: #455164;
}

.feature-list li::before {
    position: absolute;
    left: 0;
    content: "✓";
    color: var(--brand);
    font-weight: 900;
}

.narrow-page {
    width: min(680px, 100%);
    margin: 0 auto;
}

.wide-form-page {
    width: min(900px, 100%);
    margin: 0 auto;
}

.form-group {
    margin-bottom: 1.15rem;
}

.password-suggestion {
    margin-bottom: 1.25rem;
    padding: 0.9rem 1rem;
    border: 1px solid #b8d8d1;
    border-radius: 10px;
    background: var(--brand-soft);
}

.password-suggestion code {
    display: block;
    margin-top: 0.25rem;
    color: var(--brand-dark);
    font-size: 1rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    overflow-wrap: anywhere;
}

.password-suggestion-title {
    display: block;
    color: var(--ink);
    font-size: 0.84rem;
    font-weight: 750;
}

.password-suggestion-rules {
    margin-bottom: 0.9rem;
    color: var(--muted);
    font-size: 0.78rem;
}

.password-suggestion-rules ul {
    margin: 0.35rem 0 0;
    padding-left: 1.2rem;
}

.password-suggestion-row {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
}

.password-suggestion-row > div {
    min-width: 0;
}

.password-suggestion-row .button {
    flex: 0 0 auto;
}

.form-group > label,
.filters label {
    display: block;
    margin-bottom: 0.35rem;
    color: #344054;
    font-size: 0.84rem;
    font-weight: 750;
}

.form-control {
    width: 100%;
    min-height: 45px;
    padding: 0.68rem 0.82rem;
    border: 1px solid #cbd3dc;
    border-radius: 9px;
    color: var(--ink);
    background: white;
    font: inherit;
    outline: none;
    transition: border 130ms ease, box-shadow 130ms ease;
}

.form-control:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(23, 107, 91, 0.12);
}

.rich-text-editor {
    border-radius: 9px;
}

.rich-text-editor__toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    padding: 0.45rem;
    border: 1px solid #cbd3dc;
    border-bottom: 0;
    border-radius: 9px 9px 0 0;
    background: var(--surface-soft);
}

.rich-text-editor__button,
.rich-text-editor__select,
.rich-text-editor__color-control {
    min-height: 34px;
    padding: 0.35rem 0.58rem;
    border: 1px solid #cbd3dc;
    border-radius: 6px;
    color: var(--ink);
    background: white;
    font: inherit;
    font-size: 0.8rem;
    font-weight: 700;
}

.rich-text-editor__color-control {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding-block: 0.2rem;
    cursor: pointer;
}

.rich-text-editor__color-input {
    width: 28px;
    height: 24px;
    padding: 1px;
    border: 1px solid #aeb8c4;
    border-radius: 4px;
    background: white;
    cursor: pointer;
}

.rich-text-editor__button {
    cursor: pointer;
}

.rich-text-editor__button:hover,
.rich-text-editor__button.is-active,
.rich-text-editor__color-control:hover,
.rich-text-editor__color-control:focus-within {
    border-color: var(--brand);
    color: var(--brand-dark);
    background: var(--brand-soft);
}

.rich-text-editor__content.form-control {
    min-height: 190px;
    max-height: 520px;
    overflow-y: auto;
    border-radius: 0 0 9px 9px;
    line-height: 1.55;
}

.rich-text-editor:focus-within .rich-text-editor__toolbar {
    border-color: var(--brand);
}

.rich-text-editor__content:empty::before {
    color: #8993a1;
    content: attr(data-placeholder);
    pointer-events: none;
}

.rich-text-editor__content > :first-child,
.rich-text-content > :first-child {
    margin-top: 0;
}

.rich-text-editor__content > :last-child,
.rich-text-content > :last-child {
    margin-bottom: 0;
}

.rich-text-editor__content h2,
.rich-text-content h2 {
    font-size: 1.35rem;
}

.rich-text-editor__content h3,
.rich-text-content h3 {
    font-size: 1.15rem;
}

.rich-text-editor__content h4,
.rich-text-content h4 {
    font-size: 1rem;
}

.rich-text-editor__content ul,
.rich-text-editor__content ol,
.rich-text-content ul,
.rich-text-content ol {
    padding-left: 1.55rem;
}

.rich-text-editor__content blockquote,
.rich-text-content blockquote {
    margin-left: 0;
    padding: 0.6rem 0.85rem;
    border-left: 3px solid var(--brand);
    color: var(--muted);
    background: var(--surface-soft);
}

.rich-text-editor__content pre,
.rich-text-content pre {
    overflow-x: auto;
    padding: 0.75rem;
    border-radius: 7px;
    background: #f2f4f7;
    font-size: 0.85rem;
    white-space: pre-wrap;
}

.rich-text-content {
    line-height: 1.55;
    font-weight: 400;
}

.checkbox-row {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
}

.checkbox-row label {
    font-weight: 700;
}

.form-check-input {
    width: 18px;
    height: 18px;
    margin-top: 0.18rem;
    accent-color: var(--brand);
}

.help-text {
    margin-top: 0.35rem;
    color: var(--muted);
    font-size: 0.78rem;
}

.help-text ul {
    margin: 0.45rem 0 0;
    padding-left: 1.2rem;
}

.field-error {
    margin: 0.35rem 0 0;
    color: var(--danger);
    font-size: 0.8rem;
    font-weight: 650;
}

.form-errors {
    margin-bottom: 1rem;
    padding: 0.8rem 1rem;
    border: 1px solid #f1b5b0;
    border-radius: 9px;
    color: var(--danger);
    background: var(--danger-soft);
    font-size: 0.85rem;
}

.form-errors p {
    margin: 0;
}

.form-actions,
.panel-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-top: 1.7rem;
}

.two-column {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
    gap: 1.2rem;
    align-items: start;
}

.details-list {
    margin: 0;
}

.details-list > div {
    display: grid;
    grid-template-columns: 130px 1fr;
    gap: 1rem;
    padding: 0.78rem 0;
    border-bottom: 1px solid #edf0f3;
}

.details-list dt {
    color: var(--muted);
    font-size: 0.8rem;
    font-weight: 700;
}

.details-list dd {
    margin: 0;
    overflow-wrap: anywhere;
    font-weight: 650;
}

.detail-timestamp {
    display: inline-block;
    margin-left: 0.5rem;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 500;
}

.membership-list {
    display: grid;
    gap: 0.65rem;
}

.membership-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.9rem 1rem;
    border: 1px solid var(--line);
    border-radius: 10px;
}

.membership-row small,
table small {
    display: block;
    margin-top: 0.2rem;
    color: var(--muted);
}

.is-muted {
    opacity: 0.58;
}

.empty-state {
    padding: 2.8rem 1rem;
    border: 1px dashed #cbd3dc;
    border-radius: 12px;
    color: var(--muted);
    text-align: center;
}

.empty-state h3 {
    color: var(--ink);
}

.empty-state p {
    margin-bottom: 0;
}

.empty-state.compact {
    padding: 1.4rem 1rem;
}

.filters {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) 180px auto;
    align-items: end;
    gap: 0.8rem;
    margin-bottom: 1.4rem;
}

.table-wrap {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
}

th {
    padding: 0.7rem 0.8rem;
    border-bottom: 2px solid var(--line);
    color: var(--muted);
    font-size: 0.72rem;
    letter-spacing: 0.06em;
    text-align: left;
    text-transform: uppercase;
}

td {
    padding: 0.9rem 0.8rem;
    border-bottom: 1px solid #edf0f3;
    vertical-align: middle;
}

.actions-cell {
    font-weight: 750;
    text-align: right;
}

.status-dot {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    color: var(--success);
    font-weight: 750;
}

.status-dot::before {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: currentColor;
    content: "";
}

.status-inactive {
    color: var(--muted);
}

.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-top: 1.5rem;
    color: var(--muted);
    font-size: 0.84rem;
}

.messages {
    display: grid;
    gap: 0.6rem;
    margin-bottom: 1.2rem;
}

.message {
    padding: 0.85rem 1rem;
    border: 1px solid #bce0d7;
    border-radius: 10px;
    color: var(--brand-dark);
    background: var(--brand-soft);
    font-size: 0.88rem;
    font-weight: 650;
}

.message-error {
    border-color: #f1b5b0;
    color: var(--danger);
    background: var(--danger-soft);
}

.message-warning {
    margin-bottom: 1rem;
    border-color: #f2d5b8;
    color: #874b16;
    background: #fff3e8;
}

.profile-section {
    margin-top: 1.2rem;
}

.heading-with-badge,
.heading-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.heading-with-badge h1 {
    margin-bottom: 0;
}

.team-summary {
    margin-bottom: 1.2rem;
}

.project-summary {
    margin-bottom: 1.2rem;
}

.attachment-upload-form {
    max-width: 760px;
}

.attachment-upload-form input[type="file"] {
    height: auto;
    min-height: 48px;
}

.attachment-name {
    overflow-wrap: anywhere;
}

.attachment-list td:nth-child(2) {
    min-width: 220px;
    white-space: normal;
}

.project-navigation {
    display: flex;
    width: fit-content;
    max-width: 100%;
    gap: 0.35rem;
    margin: -0.45rem 0 1.6rem;
    padding: 0.4rem;
    overflow-x: auto;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface-soft);
    box-shadow: 0 5px 14px rgba(31, 42, 55, 0.06);
}

.project-navigation a {
    display: inline-flex;
    min-height: 42px;
    align-items: center;
    flex: 0 0 auto;
    padding: 0.65rem 1.05rem;
    border: 1px solid transparent;
    border-radius: 9px;
    color: var(--ink);
    font-size: 0.88rem;
    font-weight: 750;
    transition: color 140ms ease, background 140ms ease, box-shadow 140ms ease;
}

.project-navigation a:hover {
    border-color: var(--line);
    color: var(--brand-dark);
    background: white;
}

.project-navigation .is-active {
    border-color: var(--brand);
    color: white;
    background: var(--brand);
    box-shadow: 0 5px 12px rgba(23, 107, 91, 0.2);
}

.project-navigation .is-active:hover {
    border-color: var(--brand-dark);
    color: white;
    background: var(--brand-dark);
}

.section-summary {
    margin: 0.25rem 0 0;
    color: var(--muted);
    font-size: 0.84rem;
}

.task-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 0.8rem;
}

.task-summary-card {
    display: flex;
    min-height: 105px;
    flex-direction: column;
    justify-content: space-between;
    padding: 1rem;
    border: 1px solid var(--line);
    border-top: 3px solid var(--task-status-color, var(--line));
    border-radius: 12px;
    background: var(--surface-soft);
}

.task-summary-card span {
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 700;
}

.task-summary-card strong {
    color: var(--task-status-color, var(--ink));
    font-size: 2rem;
    line-height: 1;
}

.task-summary-overdue {
    border-color: #f1b5b0;
    background: var(--danger-soft);
}

.task-summary-overdue span,
.task-summary-overdue strong {
    color: var(--danger);
}

.task-filters {
    grid-template-columns: minmax(220px, 1fr) minmax(160px, 0.6fr) minmax(180px, 0.7fr) 140px minmax(170px, 0.65fr) auto;
}

.task-status-filter-summary {
    width: 100%;
    min-height: 45px;
    justify-content: center;
    white-space: nowrap;
}

.kanban-column-settings-panel.task-status-filter-panel {
    right: auto;
    left: 0;
}

.task-status-filter .task-status-filter-options label {
    grid-template-columns: auto minmax(0, 1fr);
    margin-bottom: 0;
    color: var(--ink);
    font-weight: 400;
}

.project-filters {
    grid-template-columns: minmax(220px, 1fr) minmax(180px, 0.7fr) 140px auto;
}

.task-list-toolbar {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.task-list-toolbar > span {
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 750;
}

.task-view-switcher {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.task-view-switcher .is-active,
.task-view-switcher .is-active:hover {
    border-color: var(--brand);
    color: white;
    background: var(--brand);
}

.kanban-stack {
    display: grid;
    gap: 1.5rem;
}

.kanban-board {
    min-width: 0;
    padding-top: 1rem;
    border-top: 1px solid var(--line);
}

.kanban-board:first-child {
    padding-top: 0;
    border-top: 0;
}

.kanban-board-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.9rem;
}

.kanban-board-heading h2,
.kanban-column-heading h3,
.kanban-board-heading p {
    margin: 0;
}

.kanban-board-heading h2 {
    font-size: 1.2rem;
}

.kanban-board-title-line {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.65rem;
}

.kanban-board-title-line .status-dot {
    font-size: 0.72rem;
    white-space: nowrap;
}

.kanban-board-heading p {
    margin-top: 0.18rem;
    color: var(--muted);
    font-size: 0.8rem;
}

.kanban-board-actions {
    display: flex;
    align-items: center;
    gap: 0.55rem;
}

.kanban-column-settings {
    position: relative;
}

.kanban-column-settings > summary {
    list-style: none;
    cursor: pointer;
}

.kanban-column-settings > summary::-webkit-details-marker {
    display: none;
}

.kanban-column-settings-panel {
    position: absolute;
    z-index: 20;
    top: calc(100% + 0.45rem);
    right: 0;
    display: grid;
    width: min(330px, 86vw);
    gap: 0.65rem;
    padding: 0.85rem;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: white;
    box-shadow: 0 14px 32px rgba(26, 46, 53, 0.18);
}

.kanban-column-settings-panel > small {
    margin-top: -0.45rem;
    color: var(--muted);
    font-size: 0.72rem;
}

.kanban-column-options {
    display: grid;
    max-height: 300px;
    overflow-y: auto;
}

.kanban-column-options label {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.55rem;
    padding: 0.55rem 0;
    border-bottom: 1px solid #edf0f3;
    cursor: pointer;
    font-size: 0.8rem;
}

.kanban-column-options label:last-child {
    border-bottom: 0;
}

.kanban-column-options label > small {
    color: var(--muted);
    font-size: 0.68rem;
    white-space: nowrap;
}

.kanban-column-option-name {
    display: flex;
    align-items: center;
    min-width: 0;
    gap: 0.45rem;
}

.kanban-column-option-name i {
    width: 8px;
    height: 8px;
    flex: 0 0 auto;
    border-radius: 50%;
    background: var(--kanban-status-color, var(--muted));
}

.kanban-hidden-summary {
    margin: -0.35rem 0 0.9rem;
    color: var(--muted);
    font-size: 0.78rem;
}

.kanban-consultation-note {
    margin-bottom: 0.9rem;
}

p.kanban-consultation-note {
    margin-top: -0.35rem;
    font-size: 0.82rem;
}

.kanban-scroll-shell {
    position: relative;
    min-width: 0;
}

.kanban-columns {
    display: grid;
    grid-auto-columns: minmax(210px, 1fr);
    grid-auto-flow: column;
    gap: 0.8rem;
    padding: 0.15rem 0 0.7rem;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    scroll-behavior: smooth;
    scrollbar-gutter: stable;
    cursor: grab;
}

.kanban-columns.is-panning {
    scroll-behavior: auto;
    cursor: grabbing;
    user-select: none;
}

.kanban-columns.is-panning * {
    cursor: grabbing !important;
    user-select: none;
}

.kanban-column {
    display: flex;
    min-height: 260px;
    flex-direction: column;
    border: 1px solid var(--line);
    border-top: 3px solid var(--kanban-status-color, var(--line));
    border-radius: 12px;
    background: #f4f7f8;
    transition: border-color 140ms ease, background 140ms ease;
}

.kanban-columns > .empty-state {
    cursor: default;
}

.kanban-column.is-inactive {
    opacity: 0.78;
}

.kanban-column.is-drag-over {
    border-color: var(--kanban-status-color, var(--brand));
    background: var(--brand-soft);
}

.kanban-column-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.7rem;
    border-bottom: 1px solid var(--line);
}

.kanban-column-heading h3 {
    color: var(--kanban-status-color, var(--ink));
    font-size: 0.9rem;
}

.kanban-column-heading small {
    color: var(--muted);
    font-size: 0.7rem;
}

.kanban-count {
    display: inline-grid;
    min-width: 25px;
    height: 25px;
    place-items: center;
    padding: 0 0.35rem;
    border-radius: 999px;
    color: var(--muted);
    background: white;
    font-size: 0.75rem;
    font-weight: 800;
}

.kanban-card-list {
    display: grid;
    align-content: start;
    flex: 1;
    gap: 0.55rem;
    padding: 0.55rem;
}

.kanban-card {
    padding: 0.68rem;
    border: 1px solid #dce3e7;
    border-radius: 9px;
    background: white;
    box-shadow: 0 2px 5px rgba(26, 46, 53, 0.05);
    cursor: ew-resize;
    transition: opacity 120ms ease, transform 120ms ease;
}

.kanban-card[draggable="true"] {
    cursor: ew-resize;
}

.kanban-card.is-dragging {
    opacity: 0.45;
    transform: rotate(1deg);
}

.kanban-card.is-saving {
    opacity: 0.62;
    pointer-events: none;
}

.kanban-card-title {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.5rem;
    font-size: 0.8rem;
    font-weight: 800;
}

.kanban-drag-handle {
    color: var(--muted);
    font-size: 1rem;
    letter-spacing: -0.2em;
    line-height: 1;
}

.kanban-card-details {
    display: grid;
    gap: 0.35rem;
    margin: 0.7rem 0;
}

.kanban-card-details > div {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr);
    gap: 0.35rem;
    font-size: 0.7rem;
}

.kanban-card-details dt {
    color: var(--muted);
    font-weight: 650;
}

.kanban-card-details abbr {
    text-decoration: none;
}

.kanban-card-details dd {
    min-width: 0;
    margin: 0;
    overflow-wrap: anywhere;
}

.kanban-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    color: var(--muted);
    font-size: 0.72rem;
}

.kanban-column-empty {
    margin: 1.5rem 0;
    color: var(--muted);
    font-size: 0.78rem;
    text-align: center;
}

.task-gantt {
    --gantt-day-width: 34px;
    --gantt-task-width: 260px;
    min-width: 0;
}

.gantt-toolbar {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.8rem;
}

.gantt-mode-selector {
    display: flex;
    align-items: end;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.gantt-mode-selector label {
    width: 100%;
    color: var(--muted);
    font-size: 0.76rem;
    font-weight: 750;
}

.gantt-mode-selector .form-control {
    width: min(280px, 70vw);
}

.gantt-navigation {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.gantt-navigation h2 {
    min-width: 190px;
    margin: 0 0.3rem;
    font-size: 1.15rem;
    text-align: center;
}

.gantt-navigation > .button:not(.gantt-today-link) {
    width: 36px;
    padding-right: 0;
    padding-left: 0;
    font-size: 1.25rem;
}

.gantt-summary {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.8rem;
}

.gantt-summary p,
.gantt-help {
    margin: 0;
    font-size: 0.78rem;
}

.gantt-help {
    margin-bottom: 0.8rem;
}

.gantt-legend {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 700;
}

.gantt-legend span {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.gantt-legend i {
    width: 18px;
    height: 7px;
    border-radius: 999px;
}

.gantt-legend .is-planned,
.gantt-bar.is-planned {
    background: var(--brand);
}

.gantt-legend .is-actual,
.gantt-bar.is-actual {
    background: #3568a6;
}

.gantt-legend .is-overdue {
    background: #b9685a;
}

.gantt-bar.is-overdue {
    background: #b9685a;
    box-shadow: 0 2px 5px rgba(26, 46, 53, 0.16);
}

.gantt-scroll {
    min-width: 0;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    scrollbar-gutter: stable;
    cursor: grab;
}

.gantt-scroll.is-panning {
    cursor: grabbing;
    user-select: none;
}

.gantt-scroll.is-panning * {
    cursor: grabbing !important;
    user-select: none;
}

.gantt-chart {
    width: 100%;
    min-width: calc(var(--gantt-task-width) + var(--gantt-timeline-width));
    border-top: 1px solid var(--line);
    border-left: 1px solid var(--line);
}

.gantt-axis-row,
.gantt-task-row {
    display: grid;
    grid-template-columns: var(--gantt-task-width) minmax(var(--gantt-timeline-width), 1fr);
}

.gantt-task-heading,
.gantt-task-info {
    position: sticky;
    z-index: 8;
    left: 0;
    border-right: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    background: white;
}

.gantt-task-heading {
    display: flex;
    align-items: center;
    padding: 0.55rem 0.7rem;
    color: var(--muted);
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.gantt-days,
.gantt-day-grid {
    display: grid;
    grid-template-columns: repeat(
        var(--gantt-day-count),
        minmax(var(--gantt-day-width), 1fr)
    );
}

.gantt-days {
    border-bottom: 1px solid var(--line);
}

.gantt-day-heading {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    flex-direction: column;
    padding: 0.3rem 0;
    border-right: 1px solid var(--line);
    color: var(--muted);
    background: #eef2f5;
    line-height: 1.1;
}

.gantt-day-heading small {
    font-size: 0.56rem;
    font-weight: 700;
    text-transform: uppercase;
}

.gantt-day-heading strong {
    margin-top: 0.18rem;
    font-size: 0.72rem;
}

.gantt-day-heading.is-weekend,
.gantt-day-grid .is-weekend {
    background: #f5f7f9;
}

.gantt-day-heading.is-today {
    color: var(--brand-dark);
    background: var(--brand-soft);
}

.gantt-task-info {
    display: grid;
    align-content: center;
    min-height: 48px;
    gap: 0.12rem;
    padding: 0.48rem 0.7rem;
    cursor: default;
}

.gantt-task-info a {
    overflow: hidden;
    font-size: 0.75rem;
    font-weight: 800;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.gantt-task-info small,
.gantt-task-info span {
    overflow: hidden;
    color: var(--muted);
    font-size: 0.62rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.gantt-task-info span {
    font-style: italic;
}

.gantt-task-info .gantt-task-overdue {
    color: #8f443a;
    font-size: 0.62rem;
}

.gantt-timeline {
    position: relative;
    display: grid;
    min-height: 48px;
    grid-template-columns: repeat(
        var(--gantt-day-count),
        minmax(var(--gantt-day-width), 1fr)
    );
    grid-template-rows: repeat(var(--gantt-bar-count), 24px);
    align-content: center;
    padding: 4px 0;
    border-bottom: 1px solid var(--line);
    background: white;
}

.gantt-day-grid {
    position: absolute;
    z-index: 0;
    inset: 0;
    pointer-events: none;
}

.gantt-day-grid i {
    border-right: 1px solid #edf0f3;
}

.gantt-day-grid i.is-today {
    box-shadow: inset 1px 0 0 var(--brand), inset -1px 0 0 var(--brand);
}

.gantt-timeline.is-drag-over::after {
    position: absolute;
    z-index: 5;
    top: 0;
    bottom: 0;
    left: var(--gantt-drop-left);
    width: var(--gantt-day-width);
    border: 2px solid var(--brand);
    background: rgba(23, 107, 91, 0.1);
    pointer-events: none;
    content: "";
}

.gantt-bar {
    position: relative;
    z-index: 3;
    display: flex;
    align-items: center;
    min-width: 0;
    grid-column: var(--gantt-start) / span var(--gantt-span);
    grid-row: var(--gantt-grid-row);
    margin: 0 2px;
    border-radius: 6px;
    color: white;
    box-shadow: 0 2px 5px rgba(26, 46, 53, 0.16);
    cursor: default;
}

.gantt-bar.continues-before {
    border-radius: 0 6px 6px 0;
}

.gantt-bar.continues-after {
    border-radius: 6px 0 0 6px;
}

.gantt-bar.continues-before.continues-after {
    border-radius: 0;
}

.gantt-bar > span {
    min-width: 0;
    flex: 1;
    padding: 0 0.38rem;
    overflow: hidden;
    font-size: 0.62rem;
    font-weight: 800;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.gantt-date-handle {
    width: 10px;
    height: 100%;
    flex: 0 0 auto;
    padding: 0;
    border: 0;
    background: rgba(255, 255, 255, 0.48);
    cursor: ew-resize;
}

.gantt-date-handle.is-start {
    border-radius: 6px 0 0 6px;
}

.gantt-date-handle.is-end {
    border-radius: 0 6px 6px 0;
}

.gantt-date-handle:hover,
.gantt-date-handle:focus-visible {
    background: white;
    outline: 2px solid var(--ink);
    outline-offset: -2px;
}

.gantt-bar.is-dragging {
    opacity: 0.5;
}

.gantt-bar.is-saving {
    opacity: 0.62;
    pointer-events: none;
}

.task-main-row td {
    background: var(--surface-soft);
}

.task-project-tree-row td {
    background: #eaf4f1;
}

.task-project-tree-row td:first-child {
    box-shadow: inset 3px 0 0 var(--brand-dark);
}

.task-group-tree-row td:first-child {
    box-shadow: inset 3px 0 0 var(--brand);
}

.task-subtask-row td {
    background: #fcfdfd;
}

.task-subtask-row td:first-child {
    box-shadow: inset 3px 0 0 #c9ddd8;
}

.task-tree-title {
    display: flex;
    align-items: flex-start;
    min-width: 270px;
    gap: 0.55rem;
}

.task-tree-title > div {
    min-width: 0;
}

.task-tree-toggle,
.task-tree-spacer,
.task-tree-connector {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 28px;
    width: 28px;
    height: 28px;
}

.task-tree-toggle {
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 7px;
    color: var(--brand);
    background: white;
    cursor: pointer;
    font: inherit;
    font-size: 1rem;
}

.task-tree-toggle:hover {
    border-color: var(--brand);
    background: #eff8f5;
}

.task-tree-child {
    padding-left: 0.6rem;
}

.task-tree-level-1 {
    padding-left: 0.75rem;
}

.task-tree-level-2 {
    padding-left: 2.1rem;
}

.task-tree-connector {
    color: var(--brand);
    font-size: 1.05rem;
    font-weight: 800;
}

table small.task-subtask-summary {
    color: var(--brand-dark);
    font-weight: 750;
}

.task-group-state {
    display: inline-flex;
    padding: 0.28rem 0.62rem;
    border: 1px solid #a9cfc5;
    border-radius: 999px;
    color: var(--brand-dark);
    background: #eff8f5;
    font-size: 0.74rem;
    font-weight: 800;
    white-space: nowrap;
}

.task-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 1.2rem;
}

.task-form-grid .form-group-title,
.task-form-grid .form-group-description,
.task-form-grid .form-group-progress,
.task-form-grid .form-group-solution {
    grid-column: 1 / -1;
}

.task-form-grid .form-group-progress {
    width: max-content;
}

.task-form-grid .form-group-progress .form-control {
    width: 15ch;
    min-width: 78px;
}

.task-group-summary-grid .task-summary-card {
    min-height: 95px;
}

.task-summary-card .task-summary-date {
    font-size: 1.35rem;
}

.task-status {
    display: inline-flex;
    align-items: center;
    width: max-content;
    padding: 0.28rem 0.62rem;
    border: 1px solid var(--task-status-color, #687386);
    border-radius: 999px;
    color: var(--task-status-color, #687386);
    background: white;
    font-size: 0.74rem;
    font-weight: 800;
    white-space: nowrap;
}

.task-priority {
    display: inline-flex;
    align-items: center;
    width: max-content;
    padding: 0.28rem 0.62rem;
    border: 1px solid var(--task-priority-color, #687386);
    border-radius: 999px;
    color: var(--task-priority-color, #687386);
    background: white;
    font-size: 0.74rem;
    font-weight: 800;
    white-space: nowrap;
}

.progress-value {
    width: 92px;
    height: 7px;
    overflow: hidden;
    border-radius: 999px;
    background: #e4e9ee;
}

.progress-value span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--brand), #29a18a);
}

.progress-large {
    display: inline-block;
    width: min(190px, 75%);
    height: 9px;
    margin-right: 0.55rem;
}

.task-progress-quick-edit {
    width: max-content;
    max-width: 100%;
}

.task-progress-display {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    gap: 0.45rem;
}

.task-progress-display-value {
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 750;
    white-space: nowrap;
}

.task-progress-edit-button {
    min-height: auto;
    padding: 0.2rem 0;
    color: var(--brand);
    font-size: 0.72rem;
    font-weight: 750;
}

.task-progress-control {
    display: grid;
    width: min(285px, 100%);
    grid-template-columns: minmax(90px, 1fr) auto;
    align-items: center;
    gap: 0.45rem;
}

.task-progress-display[hidden],
.task-progress-control[hidden] {
    display: none;
}

.task-progress-slider-label {
    display: flex;
    align-items: center;
    min-height: 18px;
}

.task-progress-slider {
    width: 100%;
    height: 6px;
    margin: 0;
    border-radius: 999px;
    appearance: none;
    background: linear-gradient(
        to right,
        var(--brand) 0 var(--task-progress),
        #dfe5ea var(--task-progress) 100%
    );
    cursor: pointer;
}

.task-progress-slider::-webkit-slider-thumb {
    width: 15px;
    height: 15px;
    border: 2px solid white;
    border-radius: 50%;
    appearance: none;
    background: var(--brand);
    box-shadow: 0 0 0 1px #0b7768, 0 2px 5px rgba(31, 42, 55, 0.18);
}

.task-progress-slider::-moz-range-thumb {
    width: 12px;
    height: 12px;
    border: 2px solid white;
    border-radius: 50%;
    background: var(--brand);
    box-shadow: 0 0 0 1px #0b7768, 0 2px 5px rgba(31, 42, 55, 0.18);
}

.task-progress-slider:focus-visible {
    outline: 2px solid rgba(12, 137, 120, 0.35);
    outline-offset: 4px;
}

.task-progress-entry {
    display: flex;
    min-height: 30px;
    align-items: center;
    flex-wrap: nowrap;
    gap: 0.25rem;
    color: var(--muted);
    font-size: 0.75rem;
    font-weight: 750;
    white-space: nowrap;
}

.task-progress-number {
    width: 4.6em;
    min-height: 28px;
    padding: 0.2rem 0.3rem;
    border: 1px solid var(--line);
    border-radius: 6px;
    color: var(--ink);
    background: white;
    font: inherit;
    text-align: right;
}

.task-progress-number:focus {
    border-color: var(--brand);
    outline: 2px solid rgba(12, 137, 120, 0.16);
}

.task-progress-submit {
    min-height: 28px;
    padding: 0.25rem 0.5rem;
    font-size: 0.7rem;
}

.task-progress-cancel {
    display: inline-grid;
    width: 28px;
    min-width: 28px;
    height: 28px;
    padding: 0;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 7px;
    color: var(--muted);
    background: white;
    cursor: pointer;
    font-size: 1rem;
}

.task-progress-cancel:hover {
    border-color: #c5ced8;
    color: var(--ink);
    background: var(--surface-soft);
}

.task-progress-cancel:disabled,
.task-status-cancel:disabled {
    cursor: wait;
    opacity: 0.6;
}

.task-progress-control.is-saving .task-progress-slider,
.task-progress-control.is-saving .task-progress-number {
    opacity: 0.68;
}

.task-progress-control.is-large {
    width: min(285px, 100%);
    margin-top: 0.15rem;
}

.task-progress-control.is-large .task-progress-slider-label {
    min-height: 22px;
}

.task-progress-summary.is-editing .task-progress-quick-edit {
    width: 100%;
}

.task-progress-readonly {
    white-space: nowrap;
}

.task-status-quick-edit {
    width: max-content;
    max-width: 100%;
}

.task-status-display {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    gap: 0.45rem;
}

.task-status-display[hidden],
.task-status-control[hidden] {
    display: none;
}

.task-status-edit-button {
    min-height: auto;
    padding: 0.2rem 0;
    color: var(--brand);
    font-size: 0.72rem;
    font-weight: 750;
}

.task-status-control {
    display: flex;
    width: 100%;
    align-items: center;
    flex-wrap: nowrap;
    gap: 0.4rem;
}

.task-status-select {
    min-width: 0;
    min-height: 36px;
    flex: 1 1 auto;
    padding: 0.35rem 0.45rem;
    border: 1px solid var(--task-status-color, var(--line));
    border-radius: 7px;
    color: var(--task-status-color, var(--ink));
    background: white;
    font: inherit;
    font-weight: 750;
}

.task-status-select:focus {
    border-color: var(--brand);
    outline: 2px solid rgba(12, 137, 120, 0.16);
}

.task-status-submit {
    flex: 0 0 auto;
}

.task-status-cancel {
    display: inline-grid;
    width: 28px;
    min-width: 28px;
    height: 32px;
    padding: 0;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 7px;
    color: var(--muted);
    background: white;
    cursor: pointer;
    font-size: 1rem;
}

.task-status-cancel:hover {
    border-color: #c5ced8;
    color: var(--ink);
    background: var(--surface-soft);
}

.task-status-control.is-saving .task-status-select {
    opacity: 0.68;
}

.task-status-summary.is-editing .task-status-quick-edit {
    width: 100%;
}

.task-period-display {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    gap: 0.45rem;
}

.task-period-display[hidden],
.task-period-control[hidden] {
    display: none;
}

.task-period-edit-button {
    min-height: auto;
    padding: 0.2rem 0;
    color: var(--brand);
    font-size: 0.72rem;
    font-weight: 750;
}

.task-period-control {
    display: flex;
    align-items: end;
    flex-wrap: nowrap;
    gap: 0.4rem;
}

.task-period-control label {
    display: grid;
    gap: 0.15rem;
    color: var(--muted);
    font-size: 0.68rem;
    font-weight: 700;
}

.task-period-date {
    min-height: 36px;
    padding: 0.3rem 0.4rem;
    border: 1px solid var(--line);
    border-radius: 7px;
    color: var(--ink);
    background: white;
    font: inherit;
}

.task-period-date:focus {
    border-color: var(--brand);
    outline: 2px solid rgba(12, 137, 120, 0.16);
}

.task-period-submit {
    flex: 0 0 auto;
}

.task-period-cancel {
    display: inline-grid;
    width: 28px;
    min-width: 28px;
    height: 36px;
    padding: 0;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 7px;
    color: var(--muted);
    background: white;
    cursor: pointer;
    font-size: 1rem;
}

.task-period-cancel:hover {
    border-color: #c5ced8;
    color: var(--ink);
    background: var(--surface-soft);
}

.task-period-cancel:disabled {
    cursor: wait;
    opacity: 0.6;
}

.task-responsible-display {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.task-responsible-display[hidden],
.task-responsible-control[hidden] {
    display: none;
}

.task-responsible-edit-button {
    min-height: auto;
    padding: 0.2rem 0;
    color: var(--brand);
    font-size: 0.72rem;
    font-weight: 750;
}

.task-responsible-control {
    display: grid;
    width: min(330px, 86vw);
    gap: 0.65rem;
}

.task-responsible-options label {
    grid-template-columns: auto minmax(0, 1fr);
    margin: 0;
}

.task-responsible-options label > span {
    min-width: 0;
    overflow-wrap: anywhere;
}

.task-responsible-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.45rem;
    white-space: nowrap;
}

.task-responsible-submit {
    flex: 0 0 auto;
}

.task-responsible-cancel {
    flex: 0 0 auto;
}

.task-responsible-cancel:hover {
    border-color: #c5ced8;
    color: var(--ink);
    background: var(--surface-soft);
}

.task-responsible-cancel:disabled {
    cursor: wait;
    opacity: 0.6;
}

.deadline-overdue {
    color: var(--danger);
    font-weight: 800;
}

.task-detail-tabs__list {
    display: flex;
    width: fit-content;
    max-width: 100%;
    gap: 0.35rem;
    margin: -0.45rem 0 1.2rem;
    padding: 0.4rem;
    overflow-x: auto;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface-soft);
    box-shadow: 0 5px 14px rgba(31, 42, 55, 0.06);
}

.task-detail-tabs__tab {
    display: inline-flex;
    min-height: 42px;
    align-items: center;
    flex: 0 0 auto;
    padding: 0.65rem 1.05rem;
    border: 1px solid transparent;
    border-radius: 9px;
    color: var(--ink);
    background: transparent;
    cursor: pointer;
    font: inherit;
    font-size: 0.88rem;
    font-weight: 750;
    transition: color 140ms ease, background 140ms ease, box-shadow 140ms ease;
}

.task-detail-tabs__tab:hover {
    border-color: var(--line);
    color: var(--brand-dark);
    background: white;
}

.task-detail-tabs__tab.is-active,
.task-detail-tabs__tab[aria-selected="true"] {
    border-color: var(--brand);
    color: white;
    background: var(--brand);
    box-shadow: 0 5px 12px rgba(23, 107, 91, 0.2);
}

.task-detail-tabs__tab.is-active:hover,
.task-detail-tabs__tab[aria-selected="true"]:hover {
    border-color: var(--brand-dark);
    color: white;
    background: var(--brand-dark);
}

.task-details {
    display: flex;
    align-items: flex-start;
    flex-wrap: wrap;
    column-gap: 1.25rem;
}

.task-details > div {
    flex: 0 0 100%;
    grid-template-columns: 190px 1fr;
}

.task-details > .task-summary-field {
    min-height: 78px;
    flex: 0 0 auto;
    grid-template-columns: 1fr;
    align-content: start;
    gap: 0.2rem;
    margin-bottom: 0.8rem;
    padding: 0.7rem 0.85rem;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--surface-soft);
}

.task-details > .task-progress-summary {
    flex-basis: auto;
}

.task-details > .task-progress-summary.is-editing {
    flex-basis: 320px;
}

.task-details > .task-status-summary {
    flex-basis: auto;
}

.task-details > .task-status-summary.is-editing {
    flex-basis: 250px;
}

.task-progress-summary .progress-large {
    width: min(145px, 65%);
}

.task-history-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
    gap: 1.2rem;
}

.history-list {
    display: grid;
    gap: 0;
    margin: 0;
    padding: 0;
    list-style: none;
}

.history-list li {
    position: relative;
    padding: 0 0 1.1rem 1.25rem;
    border-left: 2px solid #dce6e9;
}

.history-list li:last-child {
    padding-bottom: 0;
    border-left-color: transparent;
}

.history-list li::before {
    position: absolute;
    top: 0.35rem;
    left: -5px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--brand);
    content: "";
}

.history-list small {
    display: block;
    margin-top: 0.18rem;
    color: var(--muted);
}

.task-note {
    margin-top: 1.2rem;
    padding: 1rem;
    border-left: 4px solid var(--brand);
    border-radius: 0 9px 9px 0;
    background: var(--brand-soft);
}

.task-note p {
    margin: 0.35rem 0 0;
}

.task-checklist {
    margin-top: 1.2rem;
    padding: 1rem 1.1rem;
    scroll-margin-top: 1rem;
}

.task-checklist .panel-heading {
    margin-bottom: 0.7rem;
}

.checklist-count {
    flex: 0 0 auto;
    padding: 0.3rem 0.6rem;
    border-radius: 999px;
    color: var(--brand-dark);
    background: var(--brand-soft);
    font-size: 0.75rem;
    font-weight: 800;
    white-space: nowrap;
}

.checklist-items {
    display: grid;
    gap: 0.3rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.checklist-items > li:not(.empty-state) {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.65rem;
    min-height: 2.25rem;
    padding: 0.35rem 0.55rem;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: var(--surface-soft);
}

.checklist-items form:first-child,
.checklist-items label {
    display: flex;
    min-width: 0;
    flex: 1;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
}

.checklist-items input[type="checkbox"] {
    width: 1rem;
    height: 1rem;
    flex: 0 0 auto;
    accent-color: var(--brand);
}

.checklist-items span {
    overflow-wrap: anywhere;
    font-size: 0.86rem;
    line-height: 1.25;
}

.checklist-items .is-completed span {
    color: var(--muted);
    text-decoration: line-through;
}

.checklist-delete {
    font-size: 0.75rem;
}

.task-checklist .empty-state.compact {
    padding: 0.65rem;
    font-size: 0.84rem;
}

.task-events {
    margin-top: 1.2rem;
}

.task-events .panel-heading p {
    margin: 0.35rem 0 0;
    color: var(--muted);
    font-size: 0.88rem;
}

.event-count {
    flex: 0 0 auto;
    padding: 0.35rem 0.65rem;
    border-radius: 999px;
    color: var(--brand-dark);
    background: var(--brand-soft);
    font-size: 0.78rem;
    font-weight: 800;
}

.event-list {
    display: grid;
    gap: 0.85rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.event-card {
    padding: 1rem;
    border: 1px solid var(--line);
    border-radius: 12px;
    scroll-margin-top: 1rem;
}

.event-meta {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.65rem;
}

.event-meta time {
    margin-left: 0.25rem;
    color: var(--muted);
    font-size: 0.75rem;
}

.event-edited {
    margin-left: 0.4rem;
    color: var(--muted);
    font-size: 0.75rem;
    font-style: italic;
}

.event-edited time {
    margin-left: 0;
}

.event-edit-link {
    font-size: 0.82rem;
    font-weight: 750;
}

.event-content {
    overflow-wrap: anywhere;
    white-space: normal;
}

.event-attachments {
    margin-top: 0.85rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--line);
}

.event-attachments > strong {
    display: block;
    margin-bottom: 0.45rem;
    font-size: 0.82rem;
}

.event-attachment-list {
    display: grid;
    gap: 0.45rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.event-attachment-list li {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.55rem 0.65rem;
    border-radius: 8px;
    background: var(--surface-soft);
}

.event-attachment-list a {
    overflow-wrap: anywhere;
    font-weight: 750;
}

.event-attachment-list span,
.event-attachment-list small {
    display: block;
    margin-top: 0.15rem;
    color: var(--muted);
    font-size: 0.75rem;
}

.event-attachment-list small {
    flex: 0 0 auto;
    text-align: right;
}

.event-attachment-actions {
    display: flex;
    flex: 0 0 auto;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.3rem;
}

.event-form-page {
    width: min(1100px, 100%);
    margin: 0 auto;
}

.inline-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.7rem;
    white-space: nowrap;
}

.details-list-wide {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 2rem;
}

.informational-note {
    margin: 1.2rem 0 0;
    padding: 0.85rem 1rem;
    border-left: 3px solid var(--brand);
    color: var(--muted);
    background: var(--surface-soft);
    font-size: 0.86rem;
}

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

.link-danger:hover {
    color: #8f1c13;
}

.result-card {
    width: min(540px, 100%);
    margin: 5rem auto;
    padding: 3rem;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: white;
    box-shadow: var(--shadow);
    text-align: center;
}

.result-card h1 {
    font-size: 2.2rem;
}

.result-card p {
    margin-bottom: 1.7rem;
    color: var(--muted);
}

.result-icon {
    display: grid;
    width: 52px;
    height: 52px;
    margin: 0 auto 1.2rem;
    place-items: center;
    border-radius: 50%;
    color: var(--brand);
    background: var(--brand-soft);
    font-size: 1.4rem;
    font-weight: 900;
}

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

@media (max-width: 900px) {
    .institutional-masthead {
        grid-template-columns: auto 1fr auto;
        width: 94vw;
        gap: 1rem;
    }

    .system-identity strong {
        font-size: 1.65rem;
    }

    .system-identity span,
    .user-summary small {
        display: none;
    }

    .navigation-inner {
        width: 94vw;
    }

    .nav-toggle-input {
        position: absolute;
        display: block;
        width: 1px;
        height: 1px;
        opacity: 0;
        pointer-events: none;
    }

    .nav-toggle-label {
        display: inline-flex;
        align-items: center;
        min-height: 50px;
        gap: 0.65rem;
        color: white;
        cursor: pointer;
        font-size: 0.85rem;
        font-weight: 650;
    }

    .hamburger-icon {
        display: grid;
        width: 22px;
        gap: 4px;
    }

    .hamburger-icon i {
        display: block;
        width: 100%;
        height: 2px;
        border-radius: 2px;
        background: white;
        transition: transform 150ms ease;
    }

    .topbar-nav {
        position: absolute;
        z-index: 40;
        top: 100%;
        right: 0;
        left: 0;
        display: none;
        align-items: stretch;
        flex-direction: column;
        gap: 0;
        padding: 0.45rem;
        border: 1px solid rgba(255, 255, 255, 0.18);
        border-top: 0;
        border-radius: 0 0 10px 10px;
        background: #087f96;
        box-shadow: 0 16px 30px rgba(8, 52, 64, 0.24);
    }

    .nav-toggle-input:checked ~ .topbar-nav {
        display: flex;
    }

    .nav-group {
        align-items: stretch;
        flex-direction: column;
        min-height: 0;
    }

    .nav-secondary {
        margin-top: 0.35rem;
        padding-top: 0.35rem;
        border-top: 1px solid rgba(255, 255, 255, 0.18);
    }

    .topbar-nav a,
    .topbar-nav .link-button {
        width: 100%;
        min-height: 43px;
        justify-content: flex-start;
        padding: 0 0.85rem;
        border-bottom: 0;
        border-left: 3px solid transparent;
        border-radius: 6px;
    }

    .topbar-nav a:hover,
    .topbar-nav .link-button:hover,
    .topbar-nav .is-active {
        border-bottom-color: transparent;
        border-left-color: white;
    }

    .page-shell {
        width: 94vw;
        padding-top: 2rem;
    }

    .auth-layout,
    .two-column,
    .details-list-wide,
    .task-history-grid {
        grid-template-columns: 1fr;
    }

    .auth-layout {
        padding: 0;
    }

    .auth-page-shell {
        padding-top: 1.5rem;
        padding-bottom: 1.5rem;
    }

    .filters {
        grid-template-columns: 1fr;
    }

    .task-list-toolbar {
        align-items: flex-start;
        flex-direction: column;
    }

    .kanban-board-heading {
        flex-wrap: wrap;
    }

    .gantt-toolbar,
    .gantt-summary {
        align-items: flex-start;
        flex-direction: column;
    }

    .gantt-navigation {
        flex-wrap: wrap;
    }

    .gantt-navigation h2 {
        min-width: 165px;
    }

    .task-form-grid {
        grid-template-columns: 1fr;
    }

    .task-form-grid .form-group {
        grid-column: 1;
    }

    .page-heading,
    .panel-heading {
        align-items: flex-start;
        flex-direction: column;
        gap: 1rem;
    }

    .heading-actions {
        width: 100%;
        flex-wrap: wrap;
    }

    .footer {
        width: 94vw;
        flex-direction: column;
        gap: 0.3rem;
    }
}

@media (max-width: 480px) {
    h1 {
        font-size: 2.1rem;
    }

    .institutional-masthead {
        grid-template-columns: auto 1fr;
        min-height: 62px;
        gap: 0.75rem;
    }

    .usp-brand,
    .usp-brand img {
        width: 100px;
        height: 40px;
    }

    .usp-wordmark {
        font-size: 1.3rem;
    }

    .system-identity {
        justify-self: end;
    }

    .system-identity strong {
        font-size: 1.45rem;
    }

    .user-summary {
        display: none;
    }

    .panel,
    .auth-card {
        padding: 1.1rem;
        border-radius: 12px;
    }

    .details-list > div {
        grid-template-columns: 1fr;
        gap: 0.2rem;
    }

    .task-details > .task-summary-field {
        flex-basis: 100%;
    }

    .membership-row {
        align-items: flex-start;
        flex-direction: column;
    }

    .form-actions {
        flex-direction: column-reverse;
    }

    .form-actions .button {
        width: 100%;
    }

    .password-suggestion-row {
        align-items: stretch;
        flex-direction: column;
    }

    .password-suggestion-row .button {
        width: 100%;
    }
}
