/* =========================================================
   ALOA-ETS CSS OPTION 1
   Executive Minimal
========================================================= */

:root {
    --white: #ffffff;
    --background: #fbfbf8;
    --surface: #ffffff;
    --surface-muted: #f3f4f1;
    --border: #dfe3dc;

    --text-main: #1f241f;
    --text-muted: #687066;

    --green: #2f6f3e;
    --green-dark: #255a32;
    --green-soft: #e8f3ea;

    --archive-blue: #1769aa;
    --archive-blue-soft: #e7f2fb;
    --archive-hover: #f0f8f3;

    --yellow: #f5c542;
    --yellow-soft: #fff7d6;
    --yellow-text: #735800;

    --shadow: 0 10px 30px rgba(31, 36, 31, 0.08);
}

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

html, button, input, select, textarea {
    font-family: Arial, Helvetica, sans-serif;
}

body {
    font-family: Arial, Helvetica, sans-serif;
    background: var(--background);
    color: var(--text-main);
    line-height: 1.6;
}

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

a:hover {
    text-decoration: underline;
}

.container {
    width: 100%;
    max-width: 1120px;
    margin: 0 auto;
    padding: 40px 24px;
}

.center-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.header {
    background: var(--white);
    border-bottom: 1px solid var(--border);
    padding: 18px 32px;
}

.header-inner {
    max-width: 1120px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    max-width: 160px;
    height: auto;
    display: block;
    margin: 0 auto 24px;
}

.header .logo {
    margin: 0;
    max-width: 135px;
}

.nav-links {
    display: flex;
    gap: 24px;
}

.nav-links a {
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 500;
}

.nav-links a:hover {
    color: var(--text-main);
}

.card {
    width: 100%;
    max-width: 460px;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 42px;
    box-shadow: var(--shadow);
}

.card h1,
.card h2 {
    text-align: center;
    font-weight: 600;
    margin-bottom: 10px;
    letter-spacing: -0.02em;
}

.card p {
    text-align: center;
    color: var(--text-muted);
    margin-bottom: 28px;
    font-size: 15px;
}

.form-group,
.card form > div {
    margin-bottom: 18px;
}

label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 6px;
}

input,
textarea,
select {
    width: 100%;
    padding: 13px 14px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--white);
    color: var(--text-main);
    font-size: 15px;
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--green);
    box-shadow: 0 0 0 4px var(--green-soft);
}

button,
.btn {
    width: 100%;
    display: inline-block;
    padding: 13px 18px;
    border: none;
    border-radius: 10px;
    background: var(--green);
    color: var(--white);
    font-size: 15px;
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    transition: 0.2s ease;
}

button:hover,
.btn:hover {
    background: var(--green-dark);
}

.helper-text {
    margin-top: 22px;
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
}

.status-complete,
.completed {
    color: var(--green);
    background: var(--green-soft);
    border: 1px solid #cce3d1;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 700;
}

.status-progress,
.in-progress {
    color: var(--yellow-text);
    background: var(--yellow-soft);
    border: 1px solid #f3df91;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 700;
}

.status-pending,
.pending {
    color: var(--text-muted);
    background: var(--surface-muted);
    border: 1px solid var(--border);
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 700;
}

.timeline-item {
    background: var(--white);
    border: 1px solid var(--border);
    border-left: 5px solid var(--border);
    border-radius: 14px;
    padding: 20px;
    margin-bottom: 16px;
}

.timeline-item.complete {
    border-left-color: var(--green);
}

.timeline-item.progress {
    border-left-color: var(--yellow);
}

@media (max-width: 600px) {
    .card {
        padding: 30px 22px;
    }

    .header-inner {
        flex-direction: column;
        gap: 12px;
    }

    .nav-links {
        flex-wrap: wrap;
        justify-content: center;
    }
}/* ========================================
   ALOA-ETS Landing Page
======================================== */

.landing-page {
    min-height: 100vh;

    background:
        linear-gradient(
            135deg,
            #ffffff 0%,
            #f9fcf9 50%,
            #fffef6 100%
        );

    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;

    padding: 40px;
}

.hero {
    text-align: center;
    margin-bottom: 60px;
}

.hero h1 {
    font-size: 58px;
    font-weight: 300;
    letter-spacing: 4px;
    color: #1f1f1f;
    margin-bottom: 12px;
}

.hero-subtitle {
    font-size: 20px;
    color: #2e7d32;
    font-weight: 600;
    margin-bottom: 20px;
}

.hero-description {
    max-width: 650px;
    color: #666666;
    font-size: 16px;
    line-height: 1.7;
}

.portal-container {
    display: flex;
    gap: 40px;
    flex-wrap: wrap;
    justify-content: center;
}

.portal-button {
    width: 340px;
    min-height: 260px;

    text-decoration: none;

    border-radius: 24px;

    padding: 40px;

    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;

    transition: all .25s ease;

    border: 2px solid transparent;
}

.portal-button:hover {
    transform: translateY(-8px);
}

.portal-icon {
    font-size: 40px;
    margin-bottom: 20px;
}

.portal-button h2 {
    margin-bottom: 15px;
    font-size: 28px;
}

.portal-button p {
    text-align: center;
    line-height: 1.6;
}

/* Staff Portal */

.staff-portal {
    background: #2e7d32;
    color: white;

    box-shadow:
        0 15px 35px rgba(46, 125, 50, 0.25);
}

.staff-portal:hover {
    background: #256628;
}

/* Client Portal */

.client-portal {
    background: #f9c846;
    color: #2b2b2b;

    box-shadow:
        0 15px 35px rgba(249, 200, 70, 0.25);
}

.client-portal:hover {
    background: #f0bc30;
}

/* Mobile */

@media (max-width: 768px) {

    .hero h1 {
        font-size: 42px;
    }

    .portal-button {
        width: 100%;
        max-width: 360px;
    }
}.client-logo {
    display: block;
    margin: 0 auto 40px auto;
    max-width: 450px;
    width: 80%;
    height: auto;
    transition: transform 0.3s ease;
}

.client-logo:hover {
    transform: scale(1.02);
}.landing-logo {
    display: block;
    margin: 0 auto 28px auto;
    max-width: 420px;
    width: 80%;
    height: auto;
}
* {
    box-sizing: border-box;
}

body.staff-body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    background: #fafafa;
    color: #111;
}

.staff-layout {
    display: flex;
    min-height: 100vh;
}

.staff-sidebar {
    width: 270px;
    background: #ffffff;
    border-right: 1px solid #e4e4e4;
    padding: 28px 20px;
    display: flex;
    flex-direction: column;
}

.staff-logo {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 45px;
    padding-bottom: 25px;
    border-bottom: 1px solid #edf0ea;
}

.staff-logo img {
    width: 240px;
    max-width: 100%;
    height: auto;
    display: block;
}


.staff-nav {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.nav-item {
    text-decoration: none;
    color: #111;
    padding: 16px 18px;
    border-radius: 10px;
    font-weight: 600;
}

.nav-item span {
    margin-right: 14px;
    color: inherit;
}

.nav-item.active,
.nav-item:hover {
    background: #f0f8e8;
    border-left: 4px solid #55b600;
}

.staff-profile {
    margin-top: auto;
    display: flex;
    gap: 14px;
    align-items: center;
    border-top: 1px solid #e5e5e5;
    padding-top: 22px;
}

.profile-circle {
    width: 54px;
    height: 54px;
    border-radius: 50%;
    background: #eef6e6;
    display: grid;
    place-items: center;
    font-weight: 800;
}

.staff-profile p,
.staff-profile small {
    margin: 4px 0;
    color: #555;
}

.staff-main {
    flex: 1;
    padding: 30px 38px;
}

.staff-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #e4e4e4;
    padding-bottom: 24px;
}

.staff-header h1 {
    margin: 0;
    font-size: 32px;
}

.staff-header p {
    margin: 8px 0 0;
    color: #666;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 18px;
}

.user-box {
    display: flex;
    flex-direction: column;
    font-size: 14px;
}

.logout-btn {
    color: #111;
    text-decoration: none;
    border: 1px solid #55b600;
    padding: 10px 16px;
    border-radius: 8px;
    cursor: pointer;
    font: inherit;
}

.logout-form {
    margin: 0;
}

.projects-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 34px 0 24px;
}

.projects-top h2 {
    font-size: 28px;
    margin: 0;
}

.projects-top p {
    color: #666;
}

.new-project-btn {
    background: transparent;
    border: 2px solid #55b600;
    padding: 16px 28px;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
}

.project-controls {
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 16px;
    margin-bottom: 28px;
}

.project-controls input,
.project-controls button {
    border: 1px solid #ddd;
    background: #fff;
    border-radius: 10px;
    padding: 16px;
    font-size: 15px;
}

.project-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
}

.project-card {
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 14px;
    padding: 24px;
    min-height: 240px;
    box-shadow: 0 8px 22px rgba(0,0,0,0.04);
    position: relative;
}

.project-icon {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-size: 28px;
    margin-bottom: 28px;
}

.project-icon.network {
    background: #edf7e5;
    color: #55b600;
}

.project-icon.decom {
    background: #f1f1f1;
    color: #333;
}

.project-card h3 {
    margin: 0 0 8px;
}

.project-card p {
    margin: 0 0 14px;
    color: #666;
}

.status {
    font-size: 14px;
}

.status.green {
    color: #4c9d00;
}

.status.dark {
    color: #333;
}

.progress {
    height: 7px;
    background: #e9e9e9;
    border-radius: 100px;
    margin-top: 22px;
    overflow: hidden;
}

.progress span {
    display: block;
    height: 100%;
    background: #55b600;
    border-radius: 100px;
}

.progress.dark-bar span {
    background: #333;
}

.project-card small {
    position: absolute;
    right: 24px;
    bottom: 20px;
    font-weight: 700;
}

@media (max-width: 1100px) {
    .project-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 750px) {
    .staff-layout {
        flex-direction: column;
    }

    .staff-sidebar {
        width: 100%;
    }

    .project-grid,
    .project-controls {
        grid-template-columns: 1fr;
    }

    .staff-header,
    .projects-top {
        flex-direction: column;
        align-items: flex-start;
        gap: 20px;
    }
}.empty-projects {
    background: #fff;
    border: 1px dashed #cfd8c8;
    border-radius: 18px;
    padding: 80px 30px;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0,0,0,.04);
}

.empty-projects h3 {
    font-size: 28px;
    margin-bottom: 10px;
}

.empty-projects p {
    color: #666;
    max-width: 550px;
    margin: 0 auto 25px;
    line-height: 1.7;
}

.empty-projects button {
    background: #fff;
    border: 2px solid #55b600;
    padding: 14px 24px;
    border-radius: 10px;
    font-weight: 700;
    cursor: pointer;
}.new-project-btn {
    display: inline-block;
    text-decoration: none;
    color: #111;
    background: #fff;
    border: 2px solid #55b600;
    padding: 16px 28px;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    width: auto;
}
/* =========================================================
   ALOA-ETS ROLE LANDING PAGES
   Uses the existing white and dark-green ALOA design
========================================================= */


/* ---------------------------------------------------------
   ALOA BRAND OVERRIDES
--------------------------------------------------------- */

.staff-logo a {
    display: block;
    width: 100%;
}

.staff-logo img {
    width: 210px;
    max-width: 100%;
    margin: 0 auto;
}

.nav-item.active,
.nav-item:hover {
    color: var(--green-dark);
    background: var(--green-soft);
    border-left: 4px solid var(--green);
    text-decoration: none;
}

.logout-btn {
    color: var(--green-dark);
    background: var(--white);
    border: 1px solid var(--green);
}

.logout-btn:hover {
    color: var(--white);
    background: var(--green-dark);
    text-decoration: none;
}


/* ---------------------------------------------------------
   SIDEBAR
--------------------------------------------------------- */

.role-sidebar-label {
    margin-bottom: 22px;
    padding: 14px 16px;

    background: var(--green-soft);
    border-left: 4px solid var(--green);
    border-radius: 8px;
}

.role-sidebar-label span,
.role-sidebar-label strong {
    display: block;
}

.role-sidebar-label span {
    margin-bottom: 3px;

    color: var(--text-muted);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.role-sidebar-label strong {
    color: var(--green-dark);
    font-size: 14px;
}

.nav-item-disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

.nav-item-disabled:hover {
    color: #111111;
    background: transparent;
    border-left-color: transparent;
}

.staff-profile-details {
    min-width: 0;
}

.staff-profile-details strong,
.staff-profile-details p,
.staff-profile-details small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.staff-profile-details strong {
    color: var(--text-main);
    font-size: 14px;
}

/* ---------------------------------------------------------
   HEADER
--------------------------------------------------------- */

.role-header-label {
    margin: 0 0 4px !important;

    color: var(--brand-primary-strong);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.user-box span {
    color: var(--text-muted);
    font-size: 12px;
}


/* ---------------------------------------------------------
   PAGE HEADING
--------------------------------------------------------- */

.role-page-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;

    margin: 34px 0 26px;
}

.role-page-heading h2 {
    margin: 7px 0 4px;

    color: var(--text-main);
    font-size: 32px;
    line-height: 1.2;
}

.role-page-heading p {
    max-width: 760px;
    margin: 0;

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

.role-eyebrow {
    display: inline-block;

    color: var(--green);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.11em;
    text-transform: uppercase;
}

.role-primary-action {
    width: auto;
    min-width: 165px;
    min-height: 48px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    padding: 0 20px;

    color: var(--white);
    background: var(--green-dark);
    border: 1px solid var(--green-dark);
    border-radius: 9px;

    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
}

.role-primary-action:hover {
    color: var(--white);
    background: var(--green);
    text-decoration: none;
}

.role-action-disabled {
    cursor: not-allowed;
    opacity: 0.55;
}


/* ---------------------------------------------------------
   METRICS
--------------------------------------------------------- */

.role-metric-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;

    margin-bottom: 22px;
}

.role-metric-card {
    min-height: 142px;
    display: flex;
    flex-direction: column;

    padding: 22px;

    background: var(--white);
    border: 1px solid var(--border);
    border-top: 4px solid var(--green);
    border-radius: 12px;
    box-shadow: var(--shadow);
}

.role-metric-label {
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 700;
}

.role-metric-card strong {
    margin: 10px 0 6px;

    color: var(--green-dark);
    font-size: 36px;
    line-height: 1;
}

.role-metric-card small {
    margin-top: auto;

    color: var(--text-muted);
    font-size: 12px;
}


/* ---------------------------------------------------------
   MAIN DASHBOARD
--------------------------------------------------------- */

.role-content-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) minmax(290px, 0.75fr);
    gap: 22px;
}

.role-workspace-card,
.role-information-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: var(--shadow);
}

.role-workspace-card {
    padding: 26px;
}

.role-section-heading h2,
.role-information-card h2 {
    margin: 7px 0 5px;
    color: var(--text-main);
    font-size: 22px;
}

.role-section-heading p,
.role-information-card p {
    color: var(--text-muted);
}


/* ---------------------------------------------------------
   ACTION CARDS
--------------------------------------------------------- */

.role-action-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;

    margin-top: 24px;
}

.role-action-card {
    min-height: 145px;
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr) 24px;
    align-items: start;
    gap: 13px;

    padding: 18px;

    color: var(--text-main);
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 11px;

    text-decoration: none;
    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease,
        transform 0.2s ease;
}

a.role-action-card:hover {
    transform: translateY(-2px);

    color: var(--text-main);
    border-color: var(--green);
    box-shadow: 0 12px 28px rgba(37, 90, 50, 0.12);

    text-decoration: none;
}

.role-action-number {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;

    color: var(--green-dark);
    background: var(--green-soft);
    border-radius: 8px;

    font-size: 11px;
    font-weight: 800;
}

.role-action-card strong {
    display: block;
    color: var(--text-main);
    font-size: 15px;
}

.role-action-card p {
    margin: 7px 0 0;

    color: var(--text-muted);
    font-size: 13px;
    line-height: 1.5;
}

.role-action-card small {
    display: inline-block;
    margin-top: 9px;

    color: var(--green);
    font-size: 11px;
    font-weight: 700;
}

.role-action-arrow {
    color: var(--green);
    font-size: 20px;
    text-align: right;
}

.role-action-card-disabled {
    cursor: not-allowed;
    opacity: 0.58;
}


/* ---------------------------------------------------------
   SIDE CARDS
--------------------------------------------------------- */

.role-side-column {
    display: grid;
    align-content: start;
    gap: 22px;
}

.role-information-card {
    padding: 23px;
}

.role-focus-list {
    display: grid;
    gap: 13px;

    margin: 18px 0 0;
    padding: 0;

    list-style: none;
}

.role-focus-list li {
    display: flex;
    align-items: flex-start;
    gap: 10px;

    color: var(--text-muted);
    font-size: 13px;
    line-height: 1.5;
}

.role-focus-list li span {
    width: 22px;
    height: 22px;
    display: grid;
    place-items: center;
    flex: 0 0 auto;

    color: var(--green-dark);
    background: var(--green-soft);
    border-radius: 6px;

    font-size: 11px;
    font-weight: 800;
}

.role-security-card {
    background:
        linear-gradient(
            145deg,
            var(--green-soft),
            var(--white)
        );
}

.role-security-status {
    display: flex;
    align-items: center;
    gap: 10px;

    margin-top: 18px;
    padding-top: 16px;

    color: var(--green-dark);
    border-top: 1px solid #cddfcf;

    font-size: 12px;
    font-weight: 700;
}

.role-security-status > span {
    width: 9px;
    height: 9px;

    background: var(--green);
    border-radius: 50%;
    box-shadow: 0 0 0 5px var(--green-soft);
}


/* ---------------------------------------------------------
   RESPONSIVE
--------------------------------------------------------- */

@media (max-width: 1150px) {
    .role-metric-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .role-content-grid {
        grid-template-columns: 1fr;
    }

    .role-side-column {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

[data-theme="dark"] { color-scheme: dark; --surface: #15201a; --surface-muted: #1d2b23; --text-main: #f2f7f3; --text-muted: #b7c8bc; --border: #385044; --white: #17221c; }
[data-high-contrast="true"] { --text-main: #000; --text-muted: #252525; --border: #111; }
[data-theme="dark"][data-high-contrast="true"] { --text-main: #fff; --text-muted: #fff; --border: #fff; }
[data-reduce-motion="true"] *, [data-reduce-motion="true"] *::before, [data-reduce-motion="true"] *::after { scroll-behavior: auto !important; animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
@media (prefers-color-scheme: dark) { [data-theme="system"] { color-scheme: dark; --surface: #15201a; --surface-muted: #1d2b23; --text-main: #f2f7f3; --text-muted: #b7c8bc; --border: #385044; --white: #17221c; } }
[data-content-width="standard"] .staff-main { max-width: 1440px; }
[data-content-width="wide"] .staff-main { max-width: none; }

.settings-page { max-width: 1100px; margin: 30px auto 0; padding: 0; border: 0; background: transparent; box-shadow: none; }
.settings-intro { display: flex; justify-content: space-between; align-items: end; margin-bottom: 24px; }
.settings-kicker, .settings-panel-header > span { color: var(--green); font-size: 12px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.settings-intro h2 { margin: 6px 0 5px; font-size: clamp(25px, 3vw, 34px); letter-spacing: -.025em; }
.settings-intro p { margin: 0; color: var(--text-muted); }
.settings-scroll { display: grid; gap: 24px; max-width: 820px; margin: 0 auto; }
.settings-menu { position: sticky; top: 18px; display: grid; gap: 7px; padding: 8px; border: 1px solid var(--border); border-radius: 16px; background: var(--surface); box-shadow: 0 12px 35px rgba(19, 55, 31, .07); }
.settings-menu a { display: grid; gap: 2px; padding: 13px 15px; border-radius: 11px; color: var(--text-main); text-decoration: none; transition: background-color .16s ease, color .16s ease, transform .16s ease; }
.settings-menu a span { font-weight: 750; }
.settings-menu a small { color: var(--text-muted); font-size: 12px; font-weight: 500; }
.settings-menu a:hover, .settings-menu a:focus-visible { background: var(--surface-muted); color: var(--green); }
.settings-menu a.active { background: #e8f3ea; color: var(--green); box-shadow: inset 4px 0 0 var(--green); }
.settings-menu a.active small { color: #46664e; }
.settings-panel { scroll-margin-top: 20px; margin: 0; padding: clamp(24px, 4vw, 38px); border: 1px solid var(--border); border-radius: 18px; background: var(--surface); box-shadow: 0 16px 45px rgba(19, 55, 31, .08); }
.settings-panel-header { margin: 0 0 30px; padding: 0 0 22px; border-bottom: 1px solid var(--border); }
.settings-panel-header h2 { margin: 6px 0 7px; font-size: 26px; letter-spacing: -.02em; }
.settings-panel-header p { max-width: 620px; margin: 0; color: var(--text-muted); line-height: 1.55; }
.settings-form { display: grid; gap: 30px; }
.settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; }
.settings-grid-single { grid-template-columns: minmax(0, 1fr); max-width: 520px; }
.settings-grid label > span { display: block; margin-bottom: 9px; font-size: 14px; font-weight: 750; }
.settings-grid select, .settings-grid input:not([type="checkbox"]) { width: 100%; min-height: 48px; padding: 10px 13px; border: 1px solid var(--border); border-radius: 10px; background: var(--white); color: var(--text-main); font: inherit; }
.settings-grid select:hover { border-color: #85a98e; }
.settings-grid small, .settings-help { display: block; margin-top: 8px; color: var(--text-muted); line-height: 1.45; }
.settings-actions { display: flex; justify-content: flex-end; padding-top: 22px; border-top: 1px solid var(--border); }
.settings-actions button { min-width: 150px; min-height: 46px; }
.settings-account-list { display: grid; gap: 0; margin: 0 0 24px; }
.settings-account-list div { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 22px; padding: 16px 0; border-bottom: 1px solid var(--border); }
.settings-account-list dt { color: var(--text-muted); font-size: 13px; font-weight: 750; text-transform: uppercase; letter-spacing: .06em; }
.settings-account-list dd { margin: 0; font-weight: 700; overflow-wrap: anywhere; }
.settings-reset { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 20px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-muted); }
.settings-reset label { display: flex; align-items: center; min-height: 44px; gap: 10px; line-height: 1.45; cursor: pointer; }
.settings-notice { display: grid; gap: 3px; margin: 0 0 20px; padding: 13px 16px; border: 1px solid #c9d8cc; border-radius: 12px; background: #f5f8f5; color: var(--text-main); }
.settings-notice span { color: var(--text-muted); }
.settings-notice-error { border-color: #e0cfad; background: #fffbf1; color: #5f4818; }
@media (max-width: 720px) { .settings-page { margin-top: 20px; } .settings-grid { grid-template-columns: 1fr; } .settings-panel { padding: 22px; } .settings-account-list div { grid-template-columns: 1fr; gap: 5px; } .settings-reset { align-items: stretch; flex-direction: column; } }

/* =========================================================
   RESPONSIVE APPLICATION SHELL + SHARED AUTH PAGES
========================================================= */

html,
body {
    max-width: 100%;
    overflow-x: clip;
}

:where(a, button, input, select, textarea):focus-visible {
    outline: 3px solid rgba(47, 111, 62, 0.28);
    outline-offset: 3px;
}

.staff-main,
.staff-header-copy,
.header-actions,
.role-workspace-card,
.role-information-card,
.admin-section {
    min-width: 0;
}

.staff-main {
    width: 100%;
    padding: clamp(22px, 3vw, 38px);
}

.staff-header {
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 18px 28px;
}

.staff-header-copy {
    flex: 1 1 420px;
}

.header-actions {
    flex: 0 1 auto;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.user-box {
    min-width: 0;
    max-width: min(360px, 100%);
}

.user-box span,
.staff-profile-details p,
.archive-breadcrumbs,
.archive-detail-list dd,
.admin-table td,
.role-section-heading p {
    overflow-wrap: anywhere;
}

.nav-item {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    white-space: nowrap;
}

.nav-item > span:last-child {
    margin-right: 0;
    white-space: nowrap;
}

.archive-project-nav a,
.admin-section-actions a,
.admin-section-actions button,
.archive-back-actions a {
    white-space: nowrap;
}

.admin-table-wrap {
    scrollbar-gutter: stable;
    overscroll-behavior-inline: contain;
    -webkit-overflow-scrolling: touch;
}

.role-workspace-card,
.role-information-card {
    padding: clamp(20px, 2.4vw, 28px);
}

.admin-form-actions,
.admin-settings-footer,
.archive-back-actions {
    flex-wrap: wrap;
}

@media (max-width: 1150px) {
    .staff-layout {
        display: block;
    }

    .staff-sidebar,
    .admin-dashboard .staff-sidebar {
        position: static;
        width: 100%;
        height: auto;
        min-height: 0;
        display: grid;
        grid-template-columns: minmax(150px, 190px) minmax(180px, 1fr) auto;
        grid-template-areas:
            "logo role profile"
            "nav nav nav";
        align-items: center;
        gap: 14px 20px;
        padding: 18px clamp(20px, 3vw, 38px);
        border-right: 0;
        border-bottom: 1px solid var(--border);
        overflow: visible;
    }

    .staff-logo {
        grid-area: logo;
        justify-content: flex-start;
        margin: 0;
        padding: 0;
        border: 0;
    }

    .staff-logo img {
        width: 165px;
        margin: 0;
    }

    .role-sidebar-label {
        grid-area: role;
        width: fit-content;
        max-width: 100%;
        margin: 0;
    }

    .staff-nav {
        grid-area: nav;
        min-width: 0;
        flex-direction: row;
        flex-wrap: wrap;
        gap: 8px;
        padding-top: 14px;
        border-top: 1px solid var(--border);
    }

    .nav-item {
        flex: 0 0 auto;
        padding: 10px 13px;
        border: 1px solid transparent;
        border-radius: 8px;
    }

    .nav-item.active,
    .nav-item:hover {
        border: 1px solid #cce3d1;
        border-left-width: 1px;
    }

    .staff-profile {
        grid-area: profile;
        min-width: 0;
        margin: 0;
        padding: 0;
        border: 0;
    }

    .profile-circle {
        flex: 0 0 auto;
    }
}

/* Keep navigation in a stable sidebar on laptop-sized screens. */
@media (min-width: 901px) and (max-width: 1150px) {
    .staff-layout {
        display: flex;
    }

    .staff-sidebar,
    .admin-dashboard .staff-sidebar {
        position: sticky;
        top: 0;
        width: 248px;
        height: 100vh;
        min-height: 100vh;
        display: flex;
        flex: 0 0 248px;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        padding: 24px 18px;
        border-right: 1px solid var(--border);
        border-bottom: 0;
        overflow-y: auto;
    }

    .staff-logo {
        display: flex;
        justify-content: center;
        margin: 0 0 24px;
        padding: 0 0 22px;
        border-bottom: 1px solid var(--border);
    }

    .staff-logo img {
        width: 190px;
        margin: 0 auto;
    }

    .role-sidebar-label {
        width: auto;
        margin: 0 0 18px;
    }

    .staff-nav {
        min-width: 0;
        flex-direction: column;
        flex-wrap: nowrap;
        gap: 7px;
        padding: 0;
        border: 0;
    }

    .nav-item {
        width: 100%;
        min-height: 46px;
        flex: 0 0 auto;
        box-sizing: border-box;
        padding: 11px 14px;
        border: 1px solid transparent;
        border-radius: 9px;
    }

    .nav-item.active,
    .nav-item:hover {
        border-color: #cce3d1;
        border-left: 4px solid var(--green);
    }

    .staff-profile {
        min-width: 0;
        margin: auto 0 0;
        padding: 20px 0 0;
        border-top: 1px solid var(--border);
    }
}

/* Compact top navigation for tablets and phones. */
@media (max-width: 900px) {
    .staff-sidebar,
    .admin-dashboard .staff-sidebar {
        grid-template-columns: minmax(150px, 1fr) auto;
        grid-template-areas:
            "logo profile"
            "nav nav";
        gap: 14px 20px;
        padding: 14px clamp(16px, 4vw, 28px);
        background: var(--surface);
    }

    .staff-logo img { width: 150px; }
    .role-sidebar-label { display: none; }
    .staff-nav { padding-top: 12px; gap: 6px; }
    .nav-item { justify-content: center; min-height: 42px; padding: 8px 12px; }
    .staff-profile { justify-content: flex-end; }
    .profile-circle { width: 42px; height: 42px; }
    .staff-profile-details small { display: none; }
}

@media (max-width: 780px) {
    .staff-sidebar,
    .admin-dashboard .staff-sidebar {
        grid-template-columns: minmax(140px, 1fr) auto;
        grid-template-areas:
            "logo role"
            "nav nav"
            "profile profile";
    }

    .staff-profile {
        padding-top: 12px;
        border-top: 1px solid var(--border);
    }

    .staff-header h1,
    .role-page-heading h2 {
        font-size: clamp(25px, 7vw, 32px);
    }

    .archive-project-nav {
        gap: 6px;
    }

    .archive-project-nav a {
        flex: 1 0 auto;
        text-align: center;
    }
}

@media (max-width: 520px) {
    .staff-sidebar,
    .admin-dashboard .staff-sidebar {
        grid-template-columns: 1fr;
        grid-template-areas:
            "logo"
            "role"
            "nav"
            "profile";
    }

    .role-sidebar-label {
        width: 100%;
    }

    .staff-nav {
        align-items: stretch;
    }

    .nav-item {
        flex: 1 1 auto;
        justify-content: center;
    }

    .header-actions,
    .logout-form,
    .logout-btn {
        width: 100%;
    }

    .user-box {
        width: 100%;
        max-width: none;
    }

    .archive-detail-list div {
        grid-template-columns: 1fr;
        gap: 4px;
    }

    .archive-explorer-list {
        padding-inline: 6px;
    }

    .archive-explorer-row > span:nth-child(3),
    .archive-explorer-row > span:nth-child(4) {
        padding-left: 0;
    }

    .admin-toast {
        right: 14px;
        bottom: 14px;
        left: 14px;
        max-width: none;
    }
}

@media (max-width: 520px) {
    .staff-sidebar,
    .admin-dashboard .staff-sidebar {
        grid-template-columns: 1fr auto;
        grid-template-areas:
            "logo profile"
            "nav nav";
    }

    .staff-profile {
        width: auto;
        padding: 0;
        border: 0;
    }

    .staff-profile-details { display: none; }
    .staff-nav { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .nav-item { width: 100%; white-space: normal; text-align: center; }
}

.auth-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    margin: 0;
    padding: 24px;
    color: var(--text-main);
    background: var(--background);
}

.auth-card {
    width: min(100%, 440px);
    padding: clamp(28px, 6vw, 42px);
    background: var(--white);
    border: 1px solid var(--border);
    border-top: 4px solid var(--green);
    border-radius: 16px;
    box-shadow: var(--shadow);
    text-align: center;
}

.auth-card-wide {
    width: min(100%, 640px);
}

.auth-logo {
    display: block;
    width: min(165px, 55vw);
    height: auto;
    margin: 0 auto 26px;
}

.auth-card h1 {
    margin: 0;
    font-size: clamp(28px, 7vw, 36px);
    line-height: 1.15;
}

.auth-card > p {
    margin: 12px auto 0;
    color: var(--text-muted);
    line-height: 1.65;
}

.auth-actions {
    display: grid;
    gap: 12px;
    margin-top: 28px;
}

.auth-button {
    min-height: 50px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 11px 18px;
    color: var(--white);
    background: var(--green-dark);
    border: 1px solid var(--green-dark);
    border-radius: 9px;
    font-weight: 700;
    text-decoration: none;
}

.auth-button:hover {
    color: var(--white);
    background: var(--green);
    text-decoration: none;
}

.auth-button-secondary {
    color: var(--green-dark);
    background: var(--white);
}

.auth-button-secondary:hover {
    color: var(--white);
    background: var(--green-dark);
}

.auth-symbol {
    width: 58px;
    height: 58px;
    display: grid;
    place-items: center;
    margin: 0 auto 22px;
    color: var(--white);
    background: var(--green);
    border-radius: 50%;
    font-size: 28px;
    font-weight: 800;
}

.auth-symbol-denied {
    color: #8b1f1f;
    background: #fff0f0;
    border: 1px solid #efc6c6;
}

.auth-note {
    margin-top: 22px !important;
    font-size: 13px;
}

.auth-card-denied {
    border-top-color: #9b2f2f;
}

.auth-actions-inline {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.auth-help {
    font-size: 0.8rem;
}

.auth-symbol-success {
    color: var(--white);
    background: var(--green);
}

.microsoft-icon {
    display: grid;
    grid-template-columns: repeat(2, 7px);
    flex: 0 0 auto;
    gap: 2px;
}

.microsoft-icon span {
    width: 7px;
    height: 7px;
    background: currentColor;
}

@media (max-width: 750px) {
    .staff-main {
        padding: 26px 20px;
    }

    .role-page-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .role-primary-action {
        width: 100%;
    }

    .role-metric-grid,
    .role-action-grid,
    .role-side-column {
        grid-template-columns: 1fr;
    }

    .header-actions {
        width: 100%;
        justify-content: space-between;
    }

    .user-box {
        min-width: 0;
    }
}/* =========================================================
   ADMIN SINGLE-PAGE FRONT END
========================================================= */

html {
    scroll-behavior: smooth;
}

@media (max-width: 520px) {
    .auth-actions-inline {
        grid-template-columns: 1fr;
    }
}

.admin-dashboard .staff-sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}

.admin-dashboard .staff-main {
    min-width: 0;
}

.admin-skip-link {
    position: fixed;
    top: 12px;
    left: 12px;
    z-index: 9999;
    padding: 10px 14px;
    color: var(--white);
    background: var(--green-dark);
    border-radius: 8px;
    transform: translateY(-160%);
}

.admin-skip-link:focus {
    transform: translateY(0);
}

.admin-nav-icon {
    width: 20px;
    height: 20px;
    display: inline-grid;
    place-items: center;
    margin-right: 14px;
    color: var(--green);
    vertical-align: middle;
}

.admin-nav-icon svg {
    width: 17px;
    height: 17px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.admin-section {
    padding: 8px 0 48px;
    scroll-margin-top: 22px;
}

.admin-section + .admin-section {
    border-top: 1px solid var(--border);
    padding-top: 42px;
}

.error-page {
    min-height: 100vh;
    padding: 32px;
    display: grid;
    place-items: center;
}

.error-card {
    width: min(620px, 100%);
    text-align: center;
}

.error-card h1 {
    margin: 12px 0;
}

.error-card .role-primary-action {
    margin-top: 20px;
}

.archive-folder-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 16px;
}

.archive-table-link {
    color: var(--green);
    font-weight: 700;
    text-decoration: none;
}

.archive-table-link:hover {
    text-decoration: underline;
}

.archive-layout-notice,
.archive-document-section {
    margin-top: 24px;
}

.archive-page {
    display: grid;
    gap: 22px;
    transition: opacity 140ms ease, transform 140ms ease;
}

.archive-page-loading {
    pointer-events: none;
    opacity: 0.55;
    transform: translateY(3px);
}

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

.archive-breadcrumbs {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    color: var(--text-muted);
    font-size: 13px;
    padding: 12px 16px;
    background: linear-gradient(90deg, #eef8f1 0%, #eef5fb 100%);
    border-left: 4px solid var(--green);
    border-radius: 8px;
}

.archive-breadcrumbs a,
.archive-back-actions a {
    color: var(--green);
    font-weight: 700;
    text-decoration: none;
}

.archive-breadcrumbs a:hover,
.archive-back-actions a:hover {
    text-decoration: underline;
}

.archive-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
}

.archive-summary-grid .role-workspace-card {
    display: grid;
    gap: 7px;
}

.archive-summary-grid span,
.archive-detail-list dt {
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.archive-summary-grid strong {
    color: var(--text-main);
    font-size: 25px;
}

.archive-search input {
    width: 100%;
    padding: 14px 16px;
    color: var(--text-main);
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 10px;
    font: inherit;
}

.archive-search {
    position: relative;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 10px;
}

.archive-search input {
    padding-left: 0;
    border: 0;
    outline: 0;
}

.archive-search-icon { padding-left: 12px; color: var(--archive-blue); font-size: 20px; font-weight: 800; }
.archive-search-clear { width: 30px; height: 30px; margin-right: 5px; color: var(--text-muted); background: transparent; border: 0; border-radius: 50%; cursor: pointer; font-size: 21px; }
.archive-search-clear:hover { color: var(--white); background: var(--green); }
.archive-search:focus-within { border-color: var(--green); box-shadow: 0 0 0 3px rgba(37, 90, 50, 0.12); }

.archive-live-search { position: relative; z-index: 20; }
.archive-live-search > label { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 9px; padding: 7px 8px 7px 14px; background: linear-gradient(100deg, #173f2b, #176b72 60%, #1769aa); border-radius: 12px; box-shadow: 0 10px 24px rgba(23, 76, 55, 0.2); }
.archive-live-search input { width: 100%; padding: 9px 0; color: var(--white); background: transparent; border: 0; outline: 0; font: inherit; }
.archive-live-search input::placeholder { color: rgba(255, 255, 255, 0.78); }
.archive-live-search .archive-search-icon { padding: 0; color: #d9ffe2; }
.archive-live-search button { width: 32px; height: 32px; color: var(--white); background: rgba(255, 255, 255, 0.14); border: 0; border-radius: 50%; cursor: pointer; font-size: 21px; }
.archive-live-search button:hover { background: rgba(255, 255, 255, 0.28); }
.archive-live-panel { position: absolute; top: calc(100% + 7px); right: 0; left: 0; max-height: min(540px, 65vh); overflow-y: auto; padding: 10px; background: var(--white); border: 1px solid #bfd1c3; border-radius: 12px; box-shadow: 0 20px 48px rgba(23, 52, 35, 0.22); }
.archive-live-panel h3 { margin: 8px 9px 4px; color: var(--text-muted); font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; }
.archive-live-result { display: grid; grid-template-columns: 74px minmax(0, 1fr); align-items: center; gap: 11px; padding: 10px; color: var(--text-main); border-radius: 8px; text-decoration: none; }
.archive-live-result:hover { color: var(--text-main); background: var(--archive-hover); text-decoration: none; }
.archive-live-result strong, .archive-live-result small { display: block; }
.archive-live-result small { margin-top: 2px; color: var(--text-muted); font-size: 11px; }
.archive-live-result-type { padding: 4px 6px; color: var(--white); background: var(--archive-blue); border-radius: 999px; text-align: center; font-size: 9px; font-weight: 900; letter-spacing: 0.05em; text-transform: uppercase; }
.archive-live-result-project .archive-live-result-type { background: #07816c; }
.archive-live-result-client .archive-live-result-type { background: #a62aa6; }
.archive-live-result-region .archive-live-result-type { background: #1769aa; }
.archive-live-result-folder .archive-live-result-type { color: #674b00; background: #f7c948; }
.archive-live-result-file .archive-live-result-type { background: #d64545; }
.archive-live-status { padding: 24px 14px; color: var(--text-muted); text-align: center; }
.archive-live-status.is-loading { color: var(--archive-blue); }
.archive-live-status.is-error { color: #a52f2f; }

.archive-search input:focus {
    outline: 0;
}


.archive-entity-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 14px;
    margin-top: 20px;
}

.archive-entity-card,
.archive-project-row {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr) auto;
    align-items: center;
    gap: 14px;
    padding: 17px;
    color: var(--text-main);
    background: var(--surface-muted);
    border: 1px solid var(--border);
    border-radius: 11px;
    text-decoration: none;
    transition: 160ms ease;
}

.archive-entity-card:hover,
.archive-project-row:hover {
    border-color: var(--green);
    box-shadow: 0 8px 20px rgba(37, 90, 50, 0.1);
    transform: translateY(-1px);
}

.archive-entity-card small,
.archive-project-row small,
.archive-recent-list small {
    display: block;
    margin-top: 5px;
    color: var(--text-muted);
}

.archive-entity-icon {
    display: grid;
    width: 38px;
    height: 38px;
    place-items: center;
    color: var(--green);
    background: var(--green-soft);
    border-radius: 9px;
    font-size: 13px;
    font-weight: 800;
}

.archive-project-list {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
    margin-top: 20px;
}

.archive-project-list > .archive-project-row {
    width: 100%;
    box-sizing: border-box;
}

.archive-project-heading,
.archive-back-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}

.archive-project-heading h2 {
    margin: 7px 0 0;
    max-width: 780px;
    font-size: clamp(24px, 3vw, 34px);
    line-height: 1.15;
    overflow-wrap: anywhere;
}

.archive-back-actions {
    flex-wrap: wrap;
    justify-content: flex-end;
    font-size: 13px;
}

.archive-project-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    padding: 5px;
    background: var(--surface-muted);
    border: 1px solid var(--border);
    border-radius: 10px;
}

.archive-project-nav a {
    padding: 10px 14px;
    color: var(--text-muted);
    border-radius: 7px;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
}

.archive-project-nav a:hover,
.archive-project-nav a.is-active {
    color: var(--green);
    background: var(--white);
}

.archive-workspace-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 18px;
}

.archive-workspace-grid > * {
    min-width: 0;
}

.archive-detail-list {
    display: grid;
    gap: 0;
    margin: 20px 0 0;
}

.archive-detail-list div {
    display: grid;
    grid-template-columns: minmax(130px, 0.4fr) 1fr;
    gap: 16px;
    padding: 13px 0;
    border-bottom: 1px solid var(--border);
}

.archive-detail-list dd {
    margin: 0;
    overflow-wrap: anywhere;
}

.archive-recent-list {
    display: grid;
    gap: 12px;
    margin: 20px 0 0;
    padding: 0;
    list-style: none;
}

.archive-recent-list li,
.archive-name-cell {
    display: flex;
    align-items: center;
    gap: 11px;
}

.archive-recent-list li > span:last-child,
.archive-name-cell strong {
    min-width: 0;
    overflow-wrap: anywhere;
}

.archive-recent-list strong {
    display: block;
    line-height: 1.4;
}

.archive-file-icon,
.archive-folder-icon {
    display: inline-grid;
    min-width: 38px;
    height: 30px;
    padding: 0 6px;
    place-items: center;
    color: var(--green);
    background: var(--green-soft);
    border-radius: 6px;
    font-size: 9px;
    font-weight: 800;
}

.archive-folder-icon {
    font-size: 16px;
}

.archive-explorer {
    overflow: hidden;
    background: var(--white);
    border: 1px solid #cfded2;
    border-radius: 14px;
    box-shadow: 0 12px 32px rgba(27, 89, 49, 0.1);
}

.archive-explorer-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 18px 20px;
    background: linear-gradient(135deg, #f1faf4 0%, #edf6fb 100%);
    border-bottom: 1px solid #cfddd3;
}

.archive-explorer-toolbar > div { display: grid; gap: 2px; }
.archive-explorer-toolbar strong { color: var(--green-dark); font-size: 18px; }
.archive-explorer-toolbar span { color: var(--text-muted); font-size: 12px; }
.archive-explorer-toolbar .archive-search { width: min(360px, 48%); }
.archive-explorer-toolbar .archive-search input { padding: 10px 13px; border-color: #bfd3c5; }
.archive-explorer-list { padding: 0 10px 10px; }

.archive-explorer-columns,
.archive-explorer-row {
    display: grid;
    grid-template-columns: minmax(260px, 1.8fr) minmax(100px, 0.55fr) minmax(120px, 0.7fr) minmax(90px, 0.45fr);
    align-items: center;
    gap: 16px;
}

.archive-explorer-columns {
    padding: 12px 14px 9px;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.archive-explorer-row {
    min-height: 62px;
    padding: 10px 14px;
    color: var(--text-main);
    border-bottom: 1px solid #e7ebe6;
    border-radius: 7px;
    font-size: 13px;
    text-decoration: none;
    transition: background 130ms ease, box-shadow 130ms ease;
}

.archive-explorer-row:hover {
    color: var(--text-main);
    background: var(--archive-hover);
    box-shadow: inset 3px 0 var(--green);
    text-decoration: none;
}

.archive-explorer-folder:hover { background: var(--archive-blue-soft); box-shadow: inset 3px 0 var(--archive-blue); }
.archive-explorer-name { display: flex; min-width: 0; align-items: center; gap: 13px; }
.archive-explorer-name strong { min-width: 0; overflow-wrap: anywhere; }

.archive-folder-glyph {
    position: relative;
    width: 38px;
    height: 27px;
    flex: 0 0 38px;
    background: #f7c948;
    border-radius: 3px 4px 4px 4px;
    box-shadow: inset 0 -3px rgba(150, 102, 0, 0.12);
}

.archive-folder-glyph::before {
    content: "";
    position: absolute;
    top: -5px;
    left: 2px;
    width: 17px;
    height: 7px;
    background: #e9b72d;
    border-radius: 3px 3px 0 0;
}

.archive-file-glyph {
    display: inline-grid;
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    place-items: center;
    color: var(--white);
    background: var(--archive-blue);
    border-radius: 5px;
    box-shadow: 0 4px 10px rgba(23, 105, 170, 0.18);
    font-size: 8px;
    font-weight: 900;
}

.archive-file-xls, .archive-file-xlsx { background: #168357; }
.archive-file-pdf { background: #d64545; }
.archive-file-doc, .archive-file-docx { background: #2467bd; }
.archive-file-ppt, .archive-file-pptx { background: #d65b32; }
.archive-file-jpg, .archive-file-jpeg, .archive-file-png { background: #7a4fb3; }

.archive-kind-pill {
    display: inline-flex;
    padding: 4px 8px;
    color: var(--archive-blue);
    background: var(--archive-blue-soft);
    border-radius: 999px;
    font-size: 11px;
    font-weight: 800;
}

.archive-kind-folder { color: #725400; background: #fff2bf; }

.archive-level-heading {
    padding: 18px 20px;
    border-left: 6px solid var(--green);
    background: linear-gradient(100deg, #f0faf3 0%, var(--white) 70%);
    border-radius: 0 12px 12px 0;
}

.archive-level-client { border-left-color: #b52ab5; background: linear-gradient(100deg, #fff0ff 0%, var(--white) 70%); }
.archive-level-region { border-left-color: var(--archive-blue); background: linear-gradient(100deg, #edf6ff 0%, var(--white) 70%); }
.archive-level-project { border-left-color: #07816c; background: linear-gradient(100deg, #eafaf6 0%, var(--white) 70%); }

.archive-level-client .archive-explorer-toolbar { border-top: 4px solid #b52ab5; }
.archive-level-region .archive-explorer-toolbar { border-top: 4px solid var(--archive-blue); }
.archive-level-project .archive-explorer-toolbar { border-top: 4px solid #07816c; }

.archive-level-client .archive-kind-folder { color: #8d168d; background: #fbe6fb; }
.archive-level-region .archive-kind-folder { color: #125f98; background: #e3f1fc; }
.archive-level-project .archive-kind-folder { color: #066957; background: #ddf6ef; }

.archive-explorer-name small {
    display: block;
    margin-top: 3px;
    color: var(--text-muted);
    font-size: 11px;
}


[data-archive-search-value][hidden],
.archive-filter-empty[hidden] {
    display: none;
}

@media (max-width: 780px) {
    .archive-project-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .archive-back-actions {
        justify-content: flex-start;
    }

    .archive-explorer-toolbar { align-items: stretch; flex-direction: column; }
    .archive-explorer-toolbar .archive-search { width: 100%; }
    .archive-explorer-columns { display: none; }
    .archive-explorer-row { grid-template-columns: minmax(0, 1fr) auto; gap: 7px 12px; padding: 13px 8px; }
    .archive-explorer-row > span:nth-child(3),
    .archive-explorer-row > span:nth-child(4) { grid-column: 1; padding-left: 51px; color: var(--text-muted); font-size: 11px; }
}

@media (min-width: 1280px) {
    .archive-workspace-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.admin-preview-badge,
.admin-source-badge {
    display: inline-flex;
    align-items: center;
    max-width: 320px;
    padding: 8px 12px;
    color: var(--green-dark);
    background: var(--green-soft);
    border: 1px solid #cddfcf;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    text-align: center;
}

.admin-spaced-card {
    margin-top: 22px;
}

.admin-toolbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(180px, 240px);
    gap: 16px;
    margin-bottom: 22px;
}

.admin-search,
.admin-filter {
    margin: 0;
}

.admin-search span,
.admin-filter span {
    display: block;
    margin-bottom: 7px;
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 700;
}

.admin-table-wrap {
    width: 100%;
    overflow-x: auto;
}

.admin-table {
    width: 100%;
    min-width: 720px;
    border-collapse: collapse;
}

.admin-table th,
.admin-table td {
    padding: 14px 15px;
    border-bottom: 1px solid var(--border);
    text-align: left;
    vertical-align: top;
}

.admin-table th {
    color: var(--text-muted);
    background: var(--surface-muted);
    font-size: 12px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.admin-table td {
    color: var(--text-main);
    font-size: 13px;
}

.admin-table td strong,
.admin-table td small {
    display: block;
}

.admin-table td small {
    margin-top: 4px;
    color: var(--text-muted);
    line-height: 1.45;
}

.admin-table select {
    min-width: 135px;
    padding: 9px 10px;
}

.admin-empty-state {
    padding: 54px 24px;
    text-align: center;
    background: var(--surface-muted);
    border: 1px dashed #cfd8c8;
    border-radius: 12px;
}

.admin-empty-state strong {
    display: block;
    margin-bottom: 7px;
    color: var(--text-main);
    font-size: 17px;
}

.admin-empty-state p {
    max-width: 560px;
    margin: 0 auto;
    color: var(--text-muted);
}

.admin-form-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(160px, 220px);
    gap: 16px;
}

.admin-form-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.admin-form-actions span {
    color: var(--text-muted);
    font-size: 12px;
}

.admin-primary-button,
.admin-secondary-button,
.admin-text-button {
    width: auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.admin-primary-button {
    min-height: 44px;
    padding: 0 18px;
    color: var(--white);
    background: var(--green-dark);
    border: 1px solid var(--green-dark);
    border-radius: 9px;
}

.admin-primary-button:hover {
    background: var(--green);
}

.admin-secondary-button {
    min-height: 44px;
    padding: 0 18px;
    color: var(--green-dark);
    background: var(--white);
    border: 1px solid var(--green);
    border-radius: 9px;
}

.admin-secondary-button:hover {
    color: var(--white);
    background: var(--green-dark);
}

.admin-text-button {
    padding: 0;
    color: var(--green-dark);
    background: transparent;
    border: 0;
    font-size: 12px;
    font-weight: 700;
}

.admin-text-button:hover {
    color: var(--green);
    background: transparent;
    text-decoration: underline;
}

.admin-health-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.admin-health-card {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 14px;
    padding: 20px;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: var(--shadow);
}

.admin-health-dot {
    width: 11px;
    height: 11px;
    background: var(--yellow);
    border-radius: 50%;
    box-shadow: 0 0 0 5px var(--yellow-soft);
}

.admin-health-card.healthy .admin-health-dot {
    background: var(--green);
    box-shadow: 0 0 0 5px var(--green-soft);
}

.admin-health-card.warning .admin-health-dot {
    background: #bb3f3f;
    box-shadow: 0 0 0 5px #fff0f0;
}

.admin-health-card strong,
.admin-health-card p {
    display: block;
}

.admin-health-card p {
    margin: 3px 0 0;
    color: var(--text-muted);
    font-size: 12px;
}

.admin-health-status {
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 800;
}

.admin-health-card.healthy .admin-health-status {
    color: var(--green-dark);
}

.admin-health-card.warning .admin-health-status {
    color: #8b1f1f;
}

.admin-check-time {
    margin: 16px 0 0;
    color: var(--text-muted);
    font-size: 12px;
}

.admin-role-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.admin-role-card {
    position: relative;
    min-height: 190px;
    padding: 22px;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: var(--shadow);
}

.admin-role-card h3 {
    margin: 14px 0 7px;
    font-size: 18px;
}

.admin-role-card p {
    margin: 0 0 18px;
    color: var(--text-muted);
    font-size: 13px;
    line-height: 1.55;
}

.admin-role-index {
    color: var(--green-dark);
    font-size: 11px;
    font-weight: 800;
}

.admin-chip {
    display: inline-flex;
    padding: 6px 9px;
    color: var(--green-dark);
    background: var(--green-soft);
    border-radius: 999px;
    font-size: 11px;
    font-weight: 800;
}

.admin-settings-list {
    display: grid;
}

.admin-setting-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 20px 0;
    border-bottom: 1px solid var(--border);
}

.admin-setting-row:first-child {
    padding-top: 0;
}

.admin-setting-row:last-child {
    border-bottom: 0;
}

.admin-setting-row strong {
    display: block;
    color: var(--text-main);
}

.admin-setting-row p {
    margin: 5px 0 0;
    color: var(--text-muted);
    font-size: 13px;
}

.admin-switch {
    position: relative;
    width: 52px;
    height: 29px;
    flex: 0 0 auto;
    margin: 0;
}

.admin-switch input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.admin-switch span {
    position: absolute;
    inset: 0;
    cursor: pointer;
    background: #cfd4cc;
    border-radius: 999px;
    transition: background 0.2s ease;
}

.admin-switch span::after {
    content: "";
    position: absolute;
    top: 4px;
    left: 4px;
    width: 21px;
    height: 21px;
    background: var(--white);
    border-radius: 50%;
    box-shadow: 0 2px 7px rgba(0, 0, 0, 0.18);
    transition: transform 0.2s ease;
}

.admin-switch input:checked + span {
    background: var(--green);
}

.admin-switch input:checked + span::after {
    transform: translateX(23px);
}

.admin-switch input:focus-visible + span {
    outline: 3px solid var(--green-soft);
    outline-offset: 3px;
}

.admin-settings-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

.admin-settings-footer > span {
    color: var(--text-muted);
    font-size: 12px;
}

.admin-backend-section {
    padding-bottom: 80px;
}

.admin-backend-map {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.admin-backend-map article {
    display: grid;
    gap: 5px;
    padding: 17px 18px;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 10px;
}

.admin-backend-map strong {
    color: var(--text-main);
}

.admin-backend-map span {
    color: var(--text-muted);
    font-size: 12px;
}

.admin-toast {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 2000;
    max-width: 360px;
    padding: 13px 16px;
    color: var(--white);
    background: var(--green-dark);
    border-radius: 10px;
    box-shadow: 0 12px 30px rgba(31, 36, 31, 0.2);
    opacity: 0;
    pointer-events: none;
    transform: translateY(12px);
    transition:
        opacity 0.2s ease,
        transform 0.2s ease;
}

.admin-toast.visible {
    opacity: 1;
    transform: translateY(0);
}

@media (max-width: 1150px) {
    .admin-role-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 750px) {
    .admin-dashboard .staff-sidebar {
        position: static;
        height: auto;
    }

    .admin-toolbar,
    .admin-form-grid,
    .admin-health-grid,
    .admin-role-grid,
    .admin-backend-map {
        grid-template-columns: 1fr;
    }

    .admin-form-actions,
    .admin-settings-footer {
        align-items: flex-start;
        flex-direction: column;
    }

    .admin-setting-row {
        align-items: flex-start;
    }

    .admin-preview-badge,
    .admin-source-badge {
        max-width: 100%;
    }
}/* =========================================================
   ADMIN PROJECTS + CALENDAR SECTIONS
========================================================= */

.admin-section-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 10px;
}

.admin-project-toolbar {
    grid-template-columns:
        minmax(260px, 1fr)
        minmax(150px, 210px)
        minmax(150px, 210px);
}

.admin-inline-metrics {
    margin-top: 20px;
}

.admin-calendar-layout {
    display: grid;
    grid-template-columns:
        minmax(0, 1fr)
        minmax(260px, 330px);
    gap: 22px;
    align-items: start;
}

.admin-calendar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 20px;
}

.admin-calendar-header h2 {
    margin: 4px 0 0;
}

.admin-calendar-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.admin-calendar-button {
    width: auto;
    min-width: 42px;
    min-height: 38px;
    padding: 0 12px;
    color: var(--green-dark);
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 8px;
}

.admin-calendar-button:disabled {
    color: var(--text-muted);
    background: var(--surface-muted);
    cursor: not-allowed;
    opacity: 0.75;
}

.admin-calendar-weekdays,
.admin-calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
}

.admin-calendar-weekdays {
    border: 1px solid var(--border);
    border-bottom: 0;
    border-radius: 10px 10px 0 0;
    overflow: hidden;
}

.admin-calendar-weekdays span {
    padding: 10px 6px;
    color: var(--text-muted);
    background: var(--surface-muted);
    border-right: 1px solid var(--border);
    font-size: 11px;
    font-weight: 800;
    text-align: center;
    text-transform: uppercase;
}

.admin-calendar-weekdays span:last-child {
    border-right: 0;
}

.admin-calendar-grid {
    border-top: 1px solid var(--border);
    border-left: 1px solid var(--border);
}

.admin-calendar-day {
    position: relative;
    min-height: 92px;
    padding: 9px;
    background: var(--white);
    border-right: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.admin-calendar-day span {
    display: inline-grid;
    width: 25px;
    height: 25px;
    place-items: center;
    color: var(--text-main);
    border-radius: 50%;
    font-size: 12px;
    font-weight: 700;
}

.admin-calendar-empty {
    margin-top: 18px;
    padding: 30px 20px;
}

.admin-empty-list {
    padding: 22px 0 4px;
    text-align: center;
}

.admin-empty-list strong {
    display: block;
    margin-bottom: 7px;
    color: var(--text-main);
}

.admin-empty-list p {
    margin: 0;
    color: var(--text-muted);
    font-size: 13px;
    line-height: 1.55;
}

@media (max-width: 1100px) {
    .admin-project-toolbar,
    .admin-calendar-layout {
        grid-template-columns: 1fr;
    }

    .admin-section-actions {
        justify-content: flex-start;
    }
}

@media (max-width: 750px) {
    .admin-calendar-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .admin-calendar-grid,
    .admin-calendar-weekdays {
        min-width: 680px;
    }

    .admin-calendar-layout .role-workspace-card {
        overflow-x: auto;
    }

    .admin-section-actions {
        width: 100%;
        align-items: stretch;
        flex-direction: column;
    }

    .admin-section-actions .admin-primary-button,
    .admin-section-actions .admin-secondary-button {
        width: 100%;
    }
}

/* Project Archive: unified live workspace */
.archive-page {
    width: 100%;
    max-width: 1180px;
    margin: 28px auto 0;
    padding: 0;
    gap: 18px;
    border: 0;
    background: transparent;
    box-shadow: none;
}

.archive-breadcrumbs {
    min-height: 42px;
    padding: 9px 13px;
    gap: 7px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-left: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: 0 5px 18px rgba(19, 55, 31, .045);
}

.archive-breadcrumbs strong {
    color: var(--text-main);
    font-weight: 700;
}

.archive-live-search > label {
    min-height: 50px;
    padding: 5px 8px 5px 15px;
    color: var(--text-main);
    background: var(--surface);
    border: 1px solid #a9c5b0;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(19, 55, 31, .07);
}

.archive-live-search:focus-within > label {
    border-color: var(--green);
    box-shadow: 0 0 0 3px rgba(37, 90, 50, .12), 0 8px 24px rgba(19, 55, 31, .07);
}

.archive-live-search input {
    padding: 10px 0;
    color: var(--text-main);
}

.archive-live-search input::placeholder { color: var(--text-muted); }
.archive-live-search .archive-search-icon { color: var(--green); }
.archive-live-search button { color: var(--text-muted); background: var(--surface-muted); }
.archive-live-search button:hover { color: var(--white); background: var(--green); }
.archive-search-icon { display: inline-grid; width: 20px; height: 20px; padding: 0; place-items: center; }
.archive-search-icon svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-width: 2; }

.archive-live-panel {
    top: calc(100% + 8px);
    padding: 8px;
    border-color: var(--border);
    border-radius: 12px;
    background: var(--surface);
    box-shadow: 0 22px 55px rgba(18, 42, 27, .18);
}

.archive-project-heading,
.archive-level-heading {
    min-height: 104px;
    padding: 23px 26px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-left: 4px solid var(--green);
    border-radius: 14px;
    box-shadow: 0 8px 28px rgba(19, 55, 31, .055);
}

.archive-level-client,
.archive-level-region,
.archive-level-project {
    border-left-color: var(--green);
    background: var(--surface);
}

.archive-project-heading h2 { margin-top: 5px; font-size: clamp(24px, 2.5vw, 32px); }
.archive-project-heading p { max-width: 680px; margin: 8px 0 0; color: var(--text-muted); line-height: 1.5; }

.archive-explorer {
    border-color: var(--border);
    border-radius: 14px;
    background: var(--surface);
    box-shadow: 0 14px 38px rgba(19, 55, 31, .07);
}

.archive-level-client .archive-explorer-toolbar,
.archive-level-region .archive-explorer-toolbar,
.archive-level-project .archive-explorer-toolbar {
    border-top: 0;
}

.archive-explorer-toolbar {
    min-height: 78px;
    padding: 17px 20px;
    background: var(--surface-muted);
    border-bottom-color: var(--border);
}

.archive-explorer-toolbar strong { color: var(--text-main); font-size: 17px; }
.archive-explorer-toolbar .archive-search { width: min(390px, 48%); background: var(--surface); border-radius: 9px; }
.archive-explorer-list { padding: 0; }

.archive-explorer-columns {
    padding: 12px 20px;
    background: var(--surface);
}

.archive-explorer-row {
    min-height: 68px;
    padding: 12px 20px;
    border-bottom: 1px solid var(--border);
    border-radius: 0;
    transition: background-color 140ms ease, box-shadow 140ms ease;
}

.archive-explorer-row:last-child { border-bottom: 0; }
.archive-explorer-row:hover,
.archive-explorer-folder:hover {
    background: var(--surface-muted);
    box-shadow: inset 3px 0 var(--green);
}

.archive-folder-glyph {
    width: 34px;
    height: 24px;
    flex-basis: 34px;
    background: #d8a928;
    box-shadow: none;
}

.archive-folder-glyph::before { width: 15px; height: 6px; background: #c4951c; }
.archive-file-glyph { width: 34px; height: 38px; flex-basis: 34px; box-shadow: none; }
.archive-kind-pill { padding: 5px 9px; font-size: 10px; }
.archive-kind-folder,
.archive-level-client .archive-kind-folder,
.archive-level-region .archive-kind-folder,
.archive-level-project .archive-kind-folder { color: #65501a; background: #f7edce; }

.archive-project-nav {
    width: fit-content;
    max-width: 100%;
    padding: 4px;
    gap: 2px;
    background: var(--surface);
    border-radius: 10px;
}

.archive-project-nav a { padding: 9px 14px; }
.archive-project-nav a:hover,
.archive-project-nav a.is-active { background: var(--surface-muted); }

.archive-workspace-grid .role-workspace-card,
.archive-document-section {
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--surface);
    box-shadow: 0 10px 30px rgba(19, 55, 31, .055);
}

@media (max-width: 780px) {
    .archive-page { margin-top: 20px; gap: 14px; }
    .archive-project-heading, .archive-level-heading { min-height: 0; padding: 19px; }
    .archive-explorer-toolbar { padding: 15px; }
    .archive-explorer-toolbar .archive-search { width: 100%; }
    .archive-explorer-list { padding: 0; }
    .archive-explorer-row { padding: 14px 13px; }
    .archive-explorer-row > span:nth-child(3),
    .archive-explorer-row > span:nth-child(4) { padding-left: 47px; }
}

.admin-table code {
    color: var(--text-muted);
    font-size: 12px;
    overflow-wrap: anywhere;
}

.admin-directory-note {
    margin: 14px 0 0;
    color: var(--text-muted);
    font-size: 12px;
}

/* Keep the shared navigation in the responsive top layout after admin overrides. */
@media (max-width: 700px) {
    .admin-dashboard .staff-sidebar {
        position: static;
        width: 100%;
        height: auto;
        overflow: visible;
    }
}

/* Final application shell: persistent professional sidebar above phone size. */
@media (min-width: 701px) and (max-width: 1150px) {
    .staff-layout { display: flex; }

    .staff-sidebar,
    .admin-dashboard .staff-sidebar {
        position: sticky;
        top: 0;
        width: 250px;
        height: 100vh;
        min-height: 100vh;
        display: flex;
        flex: 0 0 250px;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        padding: 24px 17px 20px;
        background: var(--surface);
        border-right: 1px solid var(--border);
        border-bottom: 0;
        overflow-x: hidden;
        overflow-y: auto;
        box-shadow: 8px 0 28px rgba(19, 55, 31, .035);
    }

    .staff-logo {
        display: flex;
        justify-content: center;
        margin: 0 0 22px;
        padding: 0 4px 21px;
        border: 0;
        border-bottom: 1px solid var(--border);
    }

    .staff-logo img { width: 188px; margin: 0 auto; }

    .role-sidebar-label {
        display: block;
        width: auto;
        margin: 0 3px 20px;
        padding: 11px 13px;
        background: var(--surface-muted);
        border: 1px solid var(--border);
        border-left: 3px solid var(--green);
        border-radius: 9px;
    }

    .staff-nav {
        display: flex;
        min-width: 0;
        flex-direction: column;
        flex-wrap: nowrap;
        gap: 6px;
        padding: 0;
        border: 0;
    }

    .nav-item {
        width: 100%;
        min-height: 46px;
        flex: 0 0 auto;
        justify-content: flex-start;
        box-sizing: border-box;
        padding: 11px 13px;
        border: 1px solid transparent;
        border-radius: 9px;
        text-align: left;
    }

    .nav-item.active,
    .nav-item:hover {
        color: var(--green-dark);
        background: var(--green-soft);
        border-color: #cce3d1;
        border-left: 3px solid var(--green);
    }

    .staff-profile {
        width: auto;
        min-width: 0;
        justify-content: flex-start;
        margin: auto 3px 0;
        padding: 18px 0 0;
        border: 0;
        border-top: 1px solid var(--border);
    }

    .profile-circle { width: 44px; height: 44px; flex: 0 0 44px; }
    .staff-profile-details { display: block; }
    .staff-profile-details small { display: block; }
}

/* Role landing pages use a compact card pattern distinct from archive actions. */
.role-section-heading:has(> .role-section-heading-copy) {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
}

.role-section-heading-copy {
    min-width: 0;
}

.role-section-heading-copy h2 {
    margin: 7px 0 6px;
}

.role-section-heading-copy p {
    max-width: 760px;
    margin: 0;
    line-height: 1.55;
}

.role-status-badge {
    display: inline-flex;
    min-height: 44px;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    padding: 7px 13px;
    color: var(--green-dark);
    background: var(--green-soft);
    border: 1px solid #cce3d1;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
    white-space: nowrap;
}

.admin-section > .role-action-grid {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 16px;
    margin-top: 24px;
}

.role-action-card.role-dashboard-card {
    position: relative;
    min-height: 118px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 8px;
    padding: 22px 58px 22px 22px;
    overflow: hidden;
    background: var(--surface);
    box-shadow: 0 8px 24px rgba(19, 55, 31, 0.055);
}

.role-action-card.role-dashboard-card::after {
    content: "\2192";
    position: absolute;
    top: 50%;
    right: 22px;
    color: var(--green);
    font-size: 22px;
    line-height: 1;
    transform: translateY(-50%);
    transition: transform 0.2s ease;
}

.role-action-card.role-dashboard-card:hover::after {
    transform: translate(3px, -50%);
}

.role-action-card.role-dashboard-card strong {
    font-size: 17px;
    line-height: 1.25;
}

.role-action-card.role-dashboard-card > span {
    display: block;
    color: var(--text-muted);
    font-size: 13px;
    line-height: 1.5;
}

@media (max-width: 620px) {
    .role-section-heading:has(> .role-section-heading-copy) {
        flex-direction: column;
        gap: 13px;
    }

    .role-status-badge {
        align-self: flex-start;
    }

    .admin-section > .role-action-grid {
        grid-template-columns: 1fr;
    }
}

/* Admin Client Project assignment workspace. */
.client-assignment-page { width: min(1020px, 100%); display: grid; gap: 18px; margin: 24px auto 0; }
.assignment-client-card,
.assignment-section { padding: clamp(20px, 3vw, 28px); background: var(--surface); border: 1px solid var(--border); border-radius: 14px; }
.assignment-client-card { display: grid; gap: 16px; border-left: 4px solid var(--green); }
.assignment-back-link { justify-self: start; }
.assignment-client-identity { min-width: 0; display: flex; align-items: center; gap: 14px; }
.assignment-client-avatar { width: 48px; height: 48px; display: grid; flex: 0 0 48px; place-items: center; color: var(--green-dark); background: var(--green-soft); border-radius: 12px; font-size: 18px; font-weight: 850; }
.assignment-client-identity h2 { margin: 0 0 3px; font-size: 23px; }
.assignment-client-identity p { margin: 0; color: var(--text-muted); }
.assignment-section-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.assignment-section-heading h2 { margin: 0; font-size: 21px; }
.assignment-section-heading > span,
.assignment-results-count { color: var(--text-muted); font-size: 12px; font-weight: 750; }
.assignment-project-list { border-top: 1px solid var(--border); }
.assignment-project-row { min-width: 0; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 15px 2px; border-bottom: 1px solid var(--border); }
.assignment-project-row > div { min-width: 0; display: grid; gap: 4px; }
.assignment-project-row strong { color: var(--text-main); font-size: 15px; }
.assignment-project-row span { color: var(--text-muted); font-size: 13px; line-height: 1.4; }
.assignment-project-row b { color: var(--green); font-weight: 800; }
.assignment-project-row form { flex: 0 0 auto; }
.assignment-live-search label { min-height: 58px; display: grid; grid-template-columns: 24px minmax(0, 1fr) 34px; align-items: center; gap: 10px; padding: 0 12px 0 16px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 8px 24px rgba(19, 55, 31, 0.055); }
.assignment-live-search label:focus-within { border-color: var(--green); box-shadow: 0 0 0 3px rgba(37, 90, 50, 0.12); }
.assignment-live-search input { width: 100%; min-width: 0; height: 56px; padding: 0; color: var(--text-main); background: transparent; border: 0; outline: 0; font: inherit; font-size: 16px; }
.assignment-live-search button { width: 32px; height: 32px; padding: 0; color: var(--text-muted); background: transparent; border: 0; border-radius: 50%; font-size: 22px; cursor: pointer; }
.assignment-live-search button:hover { color: var(--green-dark); background: var(--surface-muted); }
.assignment-live-status { min-height: 18px; margin-top: 8px; color: var(--text-muted); font-size: 12px; }
.assignment-results { margin-top: 10px; transition: opacity 140ms ease; }
.assignment-results.is-loading { opacity: 0.45; }
.assignment-results-count { margin-bottom: 8px; }
.assignment-search-prompt,
.assignment-empty-state { padding: 24px 18px; color: var(--text-muted); background: var(--surface-muted); border: 1px dashed var(--border); border-radius: 10px; text-align: center; }
.assignment-search-prompt strong,
.assignment-empty-state strong { display: block; color: var(--text-main); }
.assignment-search-prompt p,
.assignment-empty-state p { margin: 6px 0 0; font-size: 13px; }

@media (max-width: 620px) {
    .assignment-project-row { align-items: flex-start; flex-direction: column; gap: 12px; }
    .assignment-project-row form,
    .assignment-project-row button { width: 100%; }
}
/* Project Manager and Client shared UI stabilization. */
body:is(.project-manager-dashboard, .client-dashboard) {
    --role-accent-solid: #255a32;
    --role-accent-hover: #2f6f3e;
    --role-on-accent: #ffffff;
    --role-status-bg: #e7f3e9;
    --role-status-text: #185d2c;
    --role-hold-bg: #fff3d4;
    --role-hold-text: #765800;
    --role-complete-bg: #e5f1ff;
    --role-complete-text: #174f82;
    --role-archived-bg: #ecefed;
    --role-archived-text: #4d5650;
    background: var(--background);
    color: var(--text-main);
}

body:is(.project-manager-dashboard, .client-dashboard) .staff-sidebar {
    color: var(--text-main);
    background: var(--surface);
    border-color: var(--border);
}

body:is(.project-manager-dashboard, .client-dashboard) .staff-header,
body:is(.project-manager-dashboard, .client-dashboard) .staff-logo,
body:is(.project-manager-dashboard, .client-dashboard) .staff-profile {
    border-color: var(--border);
}

body:is(.project-manager-dashboard, .client-dashboard) .staff-header p,
body:is(.project-manager-dashboard, .client-dashboard) .staff-profile p,
body:is(.project-manager-dashboard, .client-dashboard) .staff-profile small {
    color: var(--text-muted);
}

body:is(.project-manager-dashboard, .client-dashboard) .profile-circle {
    color: var(--green-dark);
    background: var(--green-soft);
}

body:is(.project-manager-dashboard, .client-dashboard) .nav-item {
    color: var(--text-main);
}

body:is(.project-manager-dashboard, .client-dashboard) .dashboard-nav-dot {
    width: 7px;
    height: 7px;
    display: inline-block;
    flex: 0 0 7px;
    margin-right: 12px;
    background: var(--border);
    border-radius: 50%;
}

body:is(.project-manager-dashboard, .client-dashboard) .nav-item:is(.active, :hover) .dashboard-nav-dot {
    background: var(--green);
}

body:is(.project-manager-dashboard, .client-dashboard) :is(
    .admin-primary-button,
    .role-primary-action,
    .logout-btn:hover,
    .archive-search-clear:hover,
    .archive-live-search button:hover,
    .archive-live-result-type
) {
    color: var(--role-on-accent);
}

body:is(.project-manager-dashboard, .client-dashboard) :is(
    .admin-primary-button,
    .role-primary-action,
    .logout-btn:hover
) {
    background: var(--role-accent-solid);
    border-color: var(--role-accent-solid);
}

body:is(.project-manager-dashboard, .client-dashboard) :is(
    .admin-primary-button,
    .role-primary-action,
    .logout-btn:hover
):hover {
    background: var(--role-accent-hover);
    border-color: var(--role-accent-hover);
}

body:is(.project-manager-dashboard, .client-dashboard) .admin-secondary-button,
body:is(.project-manager-dashboard, .client-dashboard) .logout-btn {
    color: var(--green-dark);
    background: var(--surface);
}

body:is(.project-manager-dashboard, .client-dashboard) .staff-main > :is(
    .staff-header,
    .admin-section,
    .settings-notice
) {
    width: min(100%, 1380px);
    margin-inline: auto;
}

.project-manager-dashboard #dashboard {
    width: min(100%, 1380px);
}

body:is(.project-manager-dashboard, .client-dashboard) .admin-table-wrap {
    max-width: 100%;
    overflow-x: auto;
}

.project-manager-dashboard .admin-table { min-width: 880px; }
.client-dashboard .admin-table { min-width: 680px; }

html[data-theme="dark"] body:is(.project-manager-dashboard, .client-dashboard) {
    --background: #0f1712;
    --surface: #15201a;
    --surface-muted: #1d2b23;
    --text-main: #f2f7f3;
    --text-muted: #b7c8bc;
    --border: #385044;
    --white: #17221c;
    --green: #79ca8e;
    --green-dark: #9bd8a9;
    --green-soft: #233a2a;
    --archive-blue: #79b6e5;
    --archive-blue-soft: #1d3445;
    --archive-hover: #24352a;
    --yellow-soft: #3c341b;
    --yellow-text: #f4dc83;
    --role-accent-solid: #2d6e40;
    --role-accent-hover: #37864e;
    --role-status-bg: #203c29;
    --role-status-text: #a9e7b7;
    --role-hold-bg: #40371d;
    --role-hold-text: #f5dc82;
    --role-complete-bg: #1c3448;
    --role-complete-text: #acd4f4;
    --role-archived-bg: #29322c;
    --role-archived-text: #cad3cc;
}

@media (prefers-color-scheme: dark) {
    html[data-theme="system"] body:is(.project-manager-dashboard, .client-dashboard) {
        --background: #0f1712;
        --surface: #15201a;
        --surface-muted: #1d2b23;
        --text-main: #f2f7f3;
        --text-muted: #b7c8bc;
        --border: #385044;
        --white: #17221c;
        --green: #79ca8e;
        --green-dark: #9bd8a9;
        --green-soft: #233a2a;
        --archive-blue: #79b6e5;
        --archive-blue-soft: #1d3445;
        --archive-hover: #24352a;
        --yellow-soft: #3c341b;
        --yellow-text: #f4dc83;
        --role-accent-solid: #2d6e40;
        --role-accent-hover: #37864e;
        --role-status-bg: #203c29;
        --role-status-text: #a9e7b7;
        --role-hold-bg: #40371d;
        --role-hold-text: #f5dc82;
        --role-complete-bg: #1c3448;
        --role-complete-text: #acd4f4;
        --role-archived-bg: #29322c;
        --role-archived-text: #cad3cc;
    }
}

/* Shared staff/client Project workspace. */
.project-page-actions,
.project-links__heading,
.project-form-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
}

.project-workspace {
    width: min(100%, 1180px);
    min-width: 0;
    margin: 1.25rem auto 0;
    padding: clamp(1.25rem, 3vw, 2.25rem);
    color: var(--text-main);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 1.25rem;
    box-shadow: 0 16px 40px rgba(20, 45, 29, 0.07);
}

.project-workspace__hero {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1.5rem;
}

.project-workspace__hero > div { min-width: 0; }
.project-workspace__hero h2 {
    margin: 0.35rem 0 0.25rem;
    overflow-wrap: anywhere;
    font-size: clamp(1.7rem, 4vw, 2.6rem);
    line-height: 1.15;
}
.project-workspace__hero p { margin: 0; color: var(--text-muted); }

.project-status {
    flex: 0 0 auto;
    padding: 0.55rem 0.85rem;
    color: var(--role-status-text);
    background: var(--role-status-bg);
    border-radius: 999px;
    font-weight: 700;
    white-space: nowrap;
}
.project-status--on-hold { color: var(--role-hold-text); background: var(--role-hold-bg); }
.project-status--complete { color: var(--role-complete-text); background: var(--role-complete-bg); }
.project-status--archived { color: var(--role-archived-text); background: var(--role-archived-bg); }

.project-objective {
    margin: 2rem 0 1.5rem;
    padding: 1.15rem 1.25rem;
    background: var(--surface-muted);
    border-left: 4px solid var(--green);
    border-radius: 0 0.75rem 0.75rem 0;
}
.project-objective span,
.project-facts dt { color: var(--text-muted); }
.project-objective span {
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}
.project-objective p { margin: 0.4rem 0 0; overflow-wrap: anywhere; font-size: 1.08rem; }
.project-progress > div:first-child { display: flex; justify-content: space-between; margin-bottom: 0.5rem; }
.project-progress__track { height: 0.7rem; overflow: hidden; background: var(--surface-muted); border-radius: 999px; }
.project-progress__track span { display: block; height: 100%; background: var(--green); border-radius: inherit; }

.project-facts {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
    margin: 1.75rem 0;
}
.project-facts div { min-width: 0; padding: 1rem; background: var(--surface-muted); border-radius: 0.8rem; }
.project-facts dt { font-size: 0.8rem; font-weight: 700; }
.project-facts dd { margin: 0.35rem 0 0; overflow-wrap: anywhere; font-weight: 700; }

.project-links { padding-top: 1.5rem; border-top: 1px solid var(--border); }
.project-links h3 { margin: 0.25rem 0 0; }
.project-links details { min-width: 0; }
.project-links summary { cursor: pointer; }
.project-links__heading > details[open] { flex: 1 0 100%; }
.project-link-list { display: grid; gap: 0.65rem; margin: 1rem 0 0; padding: 0; list-style: none; }
.project-link-list > li {
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.9rem 1rem;
    border: 1px solid var(--border);
    border-radius: 0.75rem;
}
.project-link-list > li:has(details[open]) { align-items: stretch; flex-direction: column; }
.project-link-list > li > details[open] { width: 100%; }
.project-link-list a { color: var(--green-dark); overflow-wrap: anywhere; font-weight: 700; }
.project-link-form { width: 100%; min-width: 0; display: grid; gap: 0.85rem; padding: 1rem 0; }
.project-link-form > *,
.project-link-form label { margin: 0; }
.project-link-form label { display: grid; gap: 0.35rem; font-weight: 700; }
.project-empty-note { color: var(--text-muted); }

.project-edit-form {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.15rem 1.25rem;
    margin-top: 1.5rem;
}
.project-edit-form > * { min-width: 0; margin: 0; }
.project-edit-form > label { display: grid; align-content: start; gap: 0.4rem; }
.project-edit-form textarea { min-height: 130px; resize: vertical; }
.project-edit-form__wide,
.project-edit-form .project-form-actions { grid-column: 1 / -1; }
.project-edit-form .project-form-actions {
    margin: 0;
    padding-top: 1.25rem;
    border-top: 1px solid var(--border);
}

.client-dashboard .archive-recent-list li { min-width: 0; gap: 1rem; }
.client-dashboard .archive-recent-list li > span { min-width: 0; overflow-wrap: anywhere; }
.client-dashboard .archive-recent-list li > a { flex: 0 0 auto; }

.settings-reset input[type="checkbox"] {
    width: 18px;
    height: 18px;
    min-width: 18px;
    min-height: 18px;
    flex: 0 0 18px;
    margin: 0;
    padding: 0;
    accent-color: var(--green);
}

body:is(.project-manager-dashboard, .client-dashboard) .settings-notice {
    color: var(--text-main);
    background: var(--surface-muted);
    border-color: var(--border);
}

body:is(.project-manager-dashboard, .client-dashboard) .settings-notice span {
    color: var(--text-muted);
}

html[data-theme="dark"] body:is(.project-manager-dashboard, .client-dashboard) .settings-notice-error {
    color: #f2d99c;
    background: #382f1c;
    border-color: #6b592f;
}

@media (prefers-color-scheme: dark) {
    html[data-theme="system"] body:is(.project-manager-dashboard, .client-dashboard) .settings-notice-error {
        color: #f2d99c;
        background: #382f1c;
        border-color: #6b592f;
    }
}

@media (min-width: 701px) {
    body:is(.project-manager-dashboard, .client-dashboard) .staff-sidebar {
        position: sticky;
        top: 0;
        height: 100vh;
        min-height: 100vh;
        align-self: flex-start;
        overflow-x: hidden;
        overflow-y: auto;
    }
}

/* One unambiguous top-navigation layout for both roles on small screens. */
@media (max-width: 700px) {
    body:is(.project-manager-dashboard, .client-dashboard) .staff-layout {
        display: block;
    }

    body:is(.project-manager-dashboard, .client-dashboard) .staff-sidebar {
        position: static;
        width: 100%;
        height: auto;
        min-height: 0;
        display: grid;
        grid-template-columns: minmax(140px, 1fr) auto;
        grid-template-areas:
            "logo profile"
            "nav nav";
        align-items: center;
        gap: 14px 18px;
        padding: 14px clamp(16px, 4vw, 24px);
        overflow: visible;
        border-right: 0;
        border-bottom: 1px solid var(--border);
    }

    body:is(.project-manager-dashboard, .client-dashboard) .staff-logo {
        grid-area: logo;
        justify-content: flex-start;
        margin: 0;
        padding: 0;
        border: 0;
    }

    body:is(.project-manager-dashboard, .client-dashboard) .staff-logo img {
        width: 145px;
        margin: 0;
    }

    body:is(.project-manager-dashboard, .client-dashboard) .role-sidebar-label {
        display: none;
    }

    body:is(.project-manager-dashboard, .client-dashboard) .staff-nav {
        grid-area: nav;
        min-width: 0;
        display: flex;
        flex-flow: row wrap;
        gap: 6px;
        padding-top: 12px;
        border-top: 1px solid var(--border);
    }

    body:is(.project-manager-dashboard, .client-dashboard) .nav-item {
        width: auto;
        min-height: 42px;
        flex: 1 1 140px;
        justify-content: center;
        padding: 8px 12px;
        white-space: normal;
        text-align: center;
    }

    body:is(.project-manager-dashboard, .client-dashboard) .staff-profile {
        grid-area: profile;
        width: auto;
        justify-content: flex-end;
        margin: 0;
        padding: 0;
        border: 0;
    }

    body:is(.project-manager-dashboard, .client-dashboard) .staff-profile-details {
        display: none;
    }
}

@media (max-width: 800px) {
    .project-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .project-workspace__hero { flex-direction: column; }
    .project-edit-form { grid-template-columns: 1fr; }
    .project-edit-form__wide,
    .project-edit-form .project-form-actions { grid-column: auto; }
}

@media (max-width: 620px) {
    .project-page-actions,
    .project-form-actions { align-items: stretch; flex-direction: column; }
    .project-page-actions :is(.admin-primary-button, .admin-secondary-button),
    .project-form-actions :is(.admin-primary-button, .admin-secondary-button) { width: 100%; }
    .client-dashboard .archive-recent-list li { align-items: stretch; flex-direction: column; }
    .client-dashboard .archive-recent-list li > a { width: 100%; }
}

@media (max-width: 480px) {
    .project-facts { grid-template-columns: 1fr; }
    .project-link-list > li { align-items: stretch; flex-direction: column; }
    .project-links__heading { align-items: stretch; flex-direction: column; }
    .project-links__heading .admin-secondary-button { width: 100%; }
    body:is(.project-manager-dashboard, .client-dashboard) .staff-nav {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    body:is(.project-manager-dashboard, .client-dashboard) .nav-item {
        width: 100%;
    }
}

/* =========================================================
   SHARED FEEDBACK + PROJECT COMMUNICATION WORKSPACE
========================================================= */

[hidden] { display: none !important; }

.staff-body {
    color: var(--text-main);
    background: var(--background);
}

.staff-body .staff-sidebar {
    color: var(--text-main);
    background: var(--surface);
    border-color: var(--border);
}

.staff-body :is(.staff-header, .staff-logo, .staff-profile) { border-color: var(--border); }
.staff-body :is(.staff-header p, .staff-profile p, .staff-profile small) { color: var(--text-muted); }
.staff-body .nav-item { color: var(--text-main); }
.staff-body .profile-circle { color: var(--green-dark); background: var(--green-soft); }

.app-feedback-stack {
    width: min(100%, 1380px);
    display: grid;
    gap: 10px;
    margin: 0 auto 22px;
}

.app-feedback {
    min-width: 0;
    display: flex;
    align-items: flex-start;
    gap: 11px;
    padding: 13px 15px;
    color: var(--text-main);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 11px;
    box-shadow: 0 7px 20px rgba(19, 55, 31, 0.05);
}

.app-feedback__marker {
    width: 9px;
    height: 9px;
    flex: 0 0 9px;
    margin-top: 0.48rem;
    background: var(--green);
    border-radius: 50%;
}

.app-feedback--success { border-color: #b9d8c0; background: #f2faf4; }
.app-feedback--error { border-color: #e8bbbb; background: #fff5f5; color: #7a2020; }
.app-feedback--error .app-feedback__marker { background: #a63030; }
.app-feedback--warning { border-color: #e4cf94; background: #fffaf0; color: #674f13; }
.app-feedback--warning .app-feedback__marker { background: #a87905; }

.admin-primary-button,
.admin-secondary-button,
.admin-danger-button,
.logout-btn {
    min-height: 44px;
    border-radius: 9px;
    font-weight: 700;
}

.admin-danger-button {
    width: auto;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 10px;
    color: #8b2525;
    background: transparent;
    border: 1px solid transparent;
    cursor: pointer;
}

.admin-danger-button:hover,
.admin-danger-button:focus-visible {
    color: #761d1d;
    background: #fff0f0;
    border-color: #e7bcbc;
}

.header-actions > :not(.logout-form) { flex: 0 0 auto; }

.project-workspace {
    display: grid;
    gap: 0;
}

.project-record {
    width: min(100%, 1120px);
    margin-inline: auto;
    padding: clamp(1.25rem, 3vw, 2.25rem);
}

.project-record--folder { min-height: 0; }

.project-structured-editor {
    margin-bottom: 0.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
    scroll-margin-top: 18px;
}

.project-workspace__summary {
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px 20px;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid var(--border);
}

.project-summary-status {
    min-width: 0;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.project-summary-status > strong { font-size: 0.95rem; }
.project-summary-location { color: var(--text-muted); overflow-wrap: anywhere; }
.project-summary-location b { color: var(--green); }

.project-delivery-summary {
    display: grid;
    grid-template-columns: auto minmax(220px, 1fr);
    align-items: center;
    gap: 1rem;
}

.project-delivery-summary .project-progress { min-width: 0; }

.project-section {
    min-width: 0;
    padding: 1.55rem 0;
    scroll-margin-top: 18px;
}

.project-section + .project-section { border-top: 1px solid var(--border); }

.project-section__heading {
    min-width: 0;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.project-section__heading h2 {
    margin: 0;
    font-size: clamp(1.05rem, 2vw, 1.25rem);
    line-height: 1.25;
}

.project-section-action {
    min-height: 0;
    padding: 0.25rem 0;
    color: var(--green-dark);
    background: transparent;
    border: 0;
    font: inherit;
    font-size: 0.82rem;
    font-weight: 750;
    cursor: pointer;
}

.project-section-action:hover,
.project-section-action:focus-visible { color: var(--green); text-decoration: underline; }

.project-section__count {
    flex: 0 0 auto;
    padding: 0.3rem 0.6rem;
    color: var(--text-muted);
    background: var(--surface-muted);
    border: 1px solid var(--border);
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 750;
}

.project-section__actions {
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 0.65rem;
}

.project-objective {
    margin: 0;
    padding: 0;
    background: transparent;
    border: 0;
    border-radius: 0;
    border-top: 0;
}

.project-detail-label,
.project-metadata-list dt {
    color: var(--text-muted);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.055em;
    text-transform: uppercase;
}

.project-objective p {
    max-width: 780px;
    margin: 0.4rem 0 0;
    overflow-wrap: anywhere;
    white-space: pre-wrap;
    line-height: 1.65;
}

.project-metadata-list {
    display: flex;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 0.85rem clamp(1.35rem, 4vw, 3.25rem);
    margin: 1.2rem 0 0;
}

.project-metadata-list div { min-width: 110px; }
.project-metadata-list dd { margin: 0.28rem 0 0; font-weight: 700; }

.project-progress-section { padding-bottom: 1.4rem; }

.project-editor-panel {
    margin: 0 0 1rem;
    padding: 1rem;
    background: var(--surface-muted);
    border: 1px solid var(--border);
    border-left: 3px solid var(--green);
    border-radius: 7px;
}

.project-editor-panel--nested {
    flex: 1 0 100%;
    width: 100%;
    margin: 0.85rem 0 0;
}

.project-inline-form {
    min-width: 0;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.project-inline-form > * { min-width: 0; margin: 0; }

.project-field {
    min-width: 0;
    display: grid;
    align-content: start;
    gap: 0.4rem;
}

.project-field--wide,
.project-visibility-control,
.project-inline-form .project-form-actions { grid-column: 1 / -1; }

.project-field label { font-weight: 750; }

.project-field :is(input, textarea),
.project-edit-form :is(input, select, textarea) {
    width: 100%;
    min-width: 0;
    padding: 0.75rem 0.85rem;
    color: var(--text-main);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 9px;
    font: inherit;
}

.project-field input { min-height: 46px; }
.project-field textarea { min-height: 96px; resize: vertical; line-height: 1.5; }
.project-field small { color: var(--text-muted); }

.project-field :is(input, textarea):focus,
.project-edit-form :is(input, select, textarea):focus {
    border-color: var(--green);
    outline: 3px solid rgba(47, 111, 62, 0.14);
    outline-offset: 1px;
}

.project-visibility-control {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 0.75rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 9px;
    cursor: pointer;
}

.project-visibility-control input {
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
    margin-top: 2px;
    accent-color: var(--green);
}

.project-visibility-control span { display: grid; gap: 2px; }
.project-visibility-control small { color: var(--text-muted); font-weight: 400; }

.project-inline-form .project-form-actions {
    margin: 0;
    padding-top: 0.9rem;
    border-top: 1px solid var(--border);
}

.project-update-list,
.project-link-list,
.project-info-list {
    display: grid;
    gap: 0;
    margin: 0;
    padding: 0;
}

.project-update-card,
.project-link-list > li,
.project-info-item {
    min-width: 0;
    padding: 0.9rem 0;
    background: transparent;
    border: 0;
    border-bottom: 1px solid var(--border);
    border-radius: 0;
}

.project-update-card:last-child,
.project-link-list > li:last-child,
.project-info-item:last-child { border-bottom: 0; }

.project-info-item {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.85rem 1.25rem;
}

.project-info-copy {
    min-width: 0;
    flex: 1 1 360px;
}

.project-info-copy h3 {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.project-info-copy p {
    margin: 0.35rem 0 0.25rem;
    overflow-wrap: anywhere;
    white-space: pre-wrap;
    line-height: 1.55;
}

.project-update-body {
    margin: 0;
    overflow-wrap: anywhere;
    white-space: pre-wrap;
    line-height: 1.6;
}

.project-update-meta {
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem 1rem;
    margin: 0 0 0.45rem;
    padding: 0;
    color: var(--text-muted);
    border: 0;
    font-size: 0.8rem;
}

.project-update-meta > div {
    min-width: 0;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.55rem;
}

.project-visibility-badge {
    padding: 0;
    color: var(--text-muted);
    background: transparent;
    border-radius: 0;
    font-size: 0.72rem;
    font-weight: 650;
}

.project-visibility-badge.is-internal { color: var(--text-muted); background: transparent; }

.project-item-actions {
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 0.55rem;
}

.project-item-actions form { margin: 0; }

.project-item-actions :is(.admin-text-button, .admin-danger-button) {
    width: auto;
    min-height: 0;
    padding: 0.2rem 0.3rem;
    font-size: 0.77rem;
}

.project-link-list { list-style: none; }
.project-link-list > li { flex-wrap: wrap; }

.project-resource-copy {
    min-width: 0;
    display: grid;
    flex: 1 1 260px;
    gap: 2px;
}

.project-resource-copy strong { overflow-wrap: anywhere; }
.project-resource-copy span { color: var(--text-muted); font-size: 0.8rem; }
.project-link-list .project-item-actions { flex: 0 0 auto; }

.project-empty-note {
    margin: 0;
    padding: 0.35rem 0;
    color: var(--text-muted);
    font-size: 0.88rem;
}

.project-empty-state {
    padding: 1.15rem;
    color: var(--text-muted);
    background: var(--surface-muted);
    border: 1px dashed var(--border);
    border-radius: 10px;
}

.project-empty-state strong { color: var(--text-main); }
.project-empty-state p { margin: 0.25rem 0 0; }

.project-document-access {
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem 1.5rem;
    padding: 1rem 1.1rem;
    background: var(--surface-muted);
    border: 1px solid var(--border);
    border-radius: 11px;
}

.project-document-access > div { min-width: 0; }
.project-document-access p { margin: 0.25rem 0 0; color: var(--text-muted); }
.project-document-access .admin-primary-button { flex: 0 0 auto; }

.project-document-breadcrumbs {
    margin: -0.25rem 0 0.9rem;
    padding: 0;
    background: transparent;
    border: 0;
}

.project-document-explorer {
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: none;
}

.project-document-explorer .archive-explorer-list { padding: 0; }

.project-document-row {
    grid-template-columns: minmax(0, 1fr) minmax(70px, auto) auto;
    min-height: 60px;
    padding: 0.7rem 0.9rem;
}

.project-document-row > :nth-child(3) { padding-left: 0; }
.project-document-kind { color: var(--text-muted); font-size: 0.78rem; }
.project-document-download { min-height: 0; padding: 0.35rem 0.55rem; font-size: 0.8rem; }
.project-document-row--file:hover { box-shadow: none; }

html[data-theme="dark"] :is(.app-feedback--success, .app-feedback--error, .app-feedback--warning),
html[data-theme="dark"] .project-visibility-badge,
html[data-theme="dark"] .project-visibility-badge.is-internal {
    color: var(--text-main);
    background: transparent;
}

@media (prefers-color-scheme: dark) {
    html[data-theme="system"] :is(.app-feedback--success, .app-feedback--error, .app-feedback--warning),
    html[data-theme="system"] .project-visibility-badge,
    html[data-theme="system"] .project-visibility-badge.is-internal {
        color: var(--text-main);
        background: transparent;
    }
}

@media (max-width: 800px) {
    .project-inline-form { grid-template-columns: 1fr; }
    .project-delivery-summary { grid-template-columns: 1fr; }
    .project-field--wide,
    .project-visibility-control,
    .project-inline-form .project-form-actions { grid-column: auto; }
}

@media (max-width: 620px) {
    .header-actions > :not(.logout-form),
    .header-actions > :not(.logout-form) :is(button, a) { width: 100%; }
    .project-workspace__summary,
    .project-section__heading,
    .project-update-meta,
    .project-link-list > li,
    .project-info-item,
    .project-document-access { align-items: stretch; flex-direction: column; }
    .project-info-copy,
    .project-resource-copy { flex-basis: auto; min-height: 0; min-width: 0; }
    .project-section__actions { justify-content: flex-start; }
    .project-section__actions .admin-secondary-button { width: 100%; }
    .project-item-actions { justify-content: flex-start; }
    .project-link-list .project-item-actions { width: 100%; }
    .project-link-list .project-item-actions .admin-secondary-button { flex: 1 1 auto; }
    .project-document-access .admin-primary-button { width: 100%; }
    .project-document-row { grid-template-columns: minmax(0, 1fr) auto; }
    .project-document-row .project-document-kind { display: none; }
    .project-document-row > :nth-child(3) { grid-column: 2; grid-row: 1; }
}

/* Shared responsive Project list and local live filter. */
.project-list-actions {
    display: flex;
    justify-content: flex-end;
    margin: -0.25rem 0 1rem;
}

.project-list-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px 18px;
    margin-bottom: 0.75rem;
}

.project-list-search {
    width: min(100%, 560px);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.project-list-search label {
    min-height: 50px;
    display: grid;
    grid-template-columns: 22px minmax(0, 1fr) 32px;
    align-items: center;
    gap: 10px;
    padding: 0 10px 0 14px;
    background: var(--surface-card);
    border: 1px solid var(--border-strong);
    border-radius: 11px;
    box-shadow: 0 7px 20px rgba(19, 55, 31, 0.05);
}

.project-list-search label:focus-within {
    border-color: var(--focus-ring);
    box-shadow: 0 0 0 3px var(--focus-ring);
}

.project-list-search input {
    width: 100%;
    min-width: 0;
    height: 48px;
    padding: 0;
    color: var(--text-main);
    background: transparent;
    border: 0;
    outline: 0;
    font: inherit;
}

/* The composite wrapper owns the Project search boundary and focus ring. */
.project-list-search .search-control input:is(:focus, :focus-visible) {
    border: 0;
    outline: 0;
    box-shadow: none;
}
.project-list-search .archive-search-icon { color: var(--text-secondary); }
.project-list-search input::placeholder { color: var(--text-muted-accessible); opacity: 1; }
[data-high-contrast="true"] .project-list-search .search-control { border-width: 2px; }

@media (forced-colors: active) {
    .project-list-search .search-control:focus-within {
        outline: 3px solid Highlight;
        outline-offset: 3px;
        box-shadow: none;
    }
    body.staff-body .project-list-search .search-control input:focus-visible {
        outline: 0;
        box-shadow: none;
    }
}

.project-list-search-clear {
    width: 30px;
    height: 30px;
    display: grid;
    place-items: center;
    padding: 0;
    color: var(--text-muted);
    background: transparent;
    border: 0;
    border-radius: 50%;
    font-size: 1.25rem;
    line-height: 1;
    text-decoration: none;
    cursor: pointer;
}

.project-list-search-clear:hover { color: var(--green-dark); background: var(--surface-muted); text-decoration: none; }
.project-list-search > .admin-primary-button { flex: 0 0 auto; min-height: 50px; }
.project-list-count { flex: 0 0 auto; color: var(--text-muted); font-size: 0.8rem; font-weight: 750; }

.project-list {
    display: grid;
    gap: 0.7rem;
}

.project-list-row {
    min-width: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-items: center;
    gap: 16px 24px;
    padding: 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 11px;
    transition: border-color 150ms ease, box-shadow 150ms ease, transform 150ms ease;
}

.project-list-row:hover,
.project-list-row:focus-within {
    border-color: #a9c5b0;
    box-shadow: 0 8px 24px rgba(19, 55, 31, 0.07);
}

.project-list-main {
    min-width: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.1rem;
    color: var(--text-main);
    text-decoration: none;
}

.project-list-main:hover { color: var(--green-dark); text-decoration: none; }
.project-list-copy { min-width: 0; display: grid; gap: 3px; }
.project-list-title { overflow-wrap: anywhere; font-weight: 800; }
.project-list-context { color: var(--text-muted); overflow-wrap: anywhere; font-size: 0.82rem; }
.project-list-context b { color: var(--green); }
.project-list-open { margin-top: 0.35rem; color: var(--green-dark); font-size: 0.78rem; font-weight: 750; }

.project-list-row--client {
    display: block;
    border-radius: 9px;
}

.project-list-main--client {
    min-height: 68px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 1rem;
    padding: 0.8rem 1rem;
}

.project-list-main--client > span:first-child {
    min-width: 0;
    display: grid;
    gap: 0.2rem;
}

.project-list-main--client .project-list-context {
    display: block;
}

.project-list-chevron {
    color: var(--green-dark);
    font-size: 1.65rem;
    font-weight: 500;
    line-height: 1;
}

.project-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    margin-top: 1rem;
}

.project-pagination .project-pagination__button {
    width: auto;
    min-width: 124px;
    flex: 0 0 auto;
    padding-inline: 16px;
}
.project-pagination__status { color: var(--text-muted); font-size: 0.82rem; font-weight: 750; text-align: center; white-space: nowrap; }
.project-pagination .project-pagination__button.is-disabled,
.project-pagination .project-pagination__button.is-disabled:hover {
    color: var(--text-muted);
    background: var(--surface-muted);
    border-color: var(--border);
    opacity: 0.65;
    cursor: not-allowed;
}
.archive-page > .archive-explorer + .archive-explorer { margin-top: 1rem; }

.project-list-meta {
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 0.7rem;
    padding: 0.9rem 1.1rem 0.9rem 0;
}

.project-list-meta form { margin: 0; }
.project-list-progress { color: var(--text-muted); font-size: 0.8rem; white-space: nowrap; }
.project-list-progress strong { color: var(--text-main); }

.project-availability-badge {
    padding: 0.38rem 0.62rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 750;
    white-space: nowrap;
}

.project-availability-badge.is-unavailable { color: #7a4f16; background: #fff3d4; }

html[data-theme="dark"] .project-availability-badge.is-unavailable { color: var(--text-main); background: var(--surface-muted); }

@media (prefers-color-scheme: dark) {
    html[data-theme="system"] .project-availability-badge.is-unavailable { color: var(--text-main); background: var(--surface-muted); }
}

@media (max-width: 760px) {
    .project-list-toolbar { align-items: stretch; flex-direction: column; }
    .project-list-search { width: 100%; }
    .project-list-row { grid-template-columns: 1fr; gap: 0; }
    .project-list-meta { justify-content: flex-start; padding: 0 1.1rem 1rem; }
}

@media (max-width: 480px) {
    .project-list-search { align-items: stretch; flex-direction: column; }
    .project-list-search > .admin-primary-button { width: 100%; }
    .project-pagination { gap: 8px; }
    .project-pagination .project-pagination__button { min-width: 108px; padding-inline: 8px; font-size: 0.75rem; }
    .project-list-actions,
    .project-list-actions .admin-secondary-button { width: 100%; }
    .project-list-meta { align-items: flex-start; flex-direction: column; }
}

/* Visual Client Project catalog and application-owned cover images. */
.client-projects-page {
    width: min(100%, 1100px);
    margin-inline: auto;
}

.client-project-list-page .staff-main { padding: 22px clamp(24px, 3vw, 42px) 34px; }
.client-project-list-page .staff-header {
    width: min(100%, 1100px);
    align-items: flex-end;
    margin-inline: auto;
    padding-bottom: 14px;
}
.client-project-list-page .staff-header h1 { font-size: clamp(1.75rem, 3vw, 2.15rem); }
.client-project-list-page .staff-header p { margin-top: 4px; }
.client-project-list-page .role-header-label { font-size: 0.7rem; letter-spacing: 0.11em; }

.client-project-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.8rem 1.5rem;
    margin: 16px 0;
    padding: 10px 12px;
    background: var(--surface);
    border: 1px solid #c5d2c8;
    border-radius: 10px;
    box-shadow: 0 4px 14px rgba(19, 55, 31, 0.06);
}

.client-project-search { width: min(100%, 420px); }

.client-project-sort {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 0.65rem;
    color: var(--text-muted);
    font-size: 0.88rem;
    font-weight: 700;
}

.client-project-sort select {
    min-height: 40px;
    padding: 0 2.2rem 0 0.8rem;
    color: var(--text-main);
    background: var(--surface);
    border: 1px solid #bdcec1;
    border-radius: 10px;
    font: inherit;
    cursor: pointer;
}

.client-project-sort select:focus-visible {
    border-color: var(--green);
    outline: 3px solid rgba(37, 90, 50, 0.12);
}

.client-project-grid {
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
    align-items: stretch;
    gap: 1rem;
}

.client-project-card {
    position: relative;
    min-width: 0;
    width: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--surface);
    border: 1px solid #bdcec1;
    border-radius: 11px;
    box-shadow: 0 5px 16px rgba(19, 55, 31, 0.08);
    transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.client-project-card:hover,
.client-project-card:focus-within {
    border-color: #568b64;
    box-shadow: 0 11px 26px rgba(19, 55, 31, 0.14);
    transform: translateY(-2px);
}

.client-project-cover {
    position: relative;
    display: block;
    aspect-ratio: 12 / 5;
    overflow: hidden;
    color: inherit;
    background: #e8eee8;
}

.client-project-cover img,
.project-detail-cover img,
.project-cover-preview img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

.client-project-cover-fallback {
    width: 100%;
    height: 100%;
    display: grid;
    place-content: center;
    gap: 0.2rem;
    color: #44604b;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.82), rgba(222, 234, 225, 0.9)),
        repeating-linear-gradient(45deg, transparent 0 18px, rgba(39, 98, 54, 0.06) 18px 19px);
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-size: 0.68rem;
    font-weight: 800;
}

.client-project-cover-mark {
    color: var(--green-dark);
    font-size: clamp(1.35rem, 4vw, 2.1rem);
    letter-spacing: 0.06em;
}

.client-project-card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.52rem;
    padding: 0.8rem 0.9rem 0.9rem;
}

.client-project-card-heading {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
    gap: 0.75rem;
}

.client-project-card-heading a {
    color: #174728;
    font-size: 1.05rem;
    font-weight: 850;
    line-height: 1.25;
    overflow: hidden;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    text-decoration: none;
}

.client-project-card-heading a:hover,
.client-project-card-heading a:focus-visible { text-decoration: underline; }

.client-project-card-link::after {
    position: absolute;
    inset: 0;
    content: "";
}

.client-project-card-link:focus-visible {
    outline: 3px solid color-mix(in srgb, var(--green) 32%, transparent);
    outline-offset: 3px;
}

.client-project-card-meta {
    display: grid;
    grid-template-columns: 1rem minmax(0, 1fr);
    align-items: start;
    gap: 0.5rem;
    margin: 0;
    color: var(--text-muted);
    font-size: 0.78rem;
    line-height: 1.4;
}

.client-project-card-meta > span:first-child {
    color: #356344;
    font-size: 0.7rem;
    line-height: 1.6;
}

.client-project-card-meta.is-unspecified {
    color: color-mix(in srgb, var(--text-muted) 78%, transparent);
    font-style: italic;
}

.client-project-status {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin: 0;
    font-size: 0.82rem;
}

.client-project-status-pill {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 0.25rem 0.65rem;
    color: #245d31;
    background: #e6f3e8;
    border-radius: 999px;
    font-weight: 750;
}

.client-project-status-pill.status-on-hold { color: #775217; background: #fbefd4; }
.client-project-status-pill.status-complete,
.client-project-status-pill.status-archived { color: #505b53; background: #e9ecea; }

.client-project-view {
    position: relative;
    z-index: 2;
    min-height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-top: auto;
    padding: 0.45rem 0.7rem;
    color: #ffffff;
    background: #1d6335;
    border: 1px solid #1d6335;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 800;
    text-decoration: none;
}

.client-project-view:hover,
.client-project-view:focus-visible {
    color: #ffffff;
    background: #124a27;
    border-color: #124a27;
    text-decoration: none;
}

.client-project-search-empty,
.client-project-empty {
    padding: 2rem 0;
    color: var(--text-muted);
    text-align: center;
}

.client-project-empty p { margin: 0; }

.project-record--continuous {
    background: transparent;
    border: 0;
    box-shadow: none;
}

.project-detail-cover {
    width: 100%;
    max-height: 280px;
    aspect-ratio: 16 / 5;
    margin: 0 0 1.35rem;
    overflow: hidden;
    background: var(--surface-muted);
    border: 1px solid var(--border);
    border-radius: 11px;
}

.project-cover-editor { scroll-margin-top: 18px; }
.project-cover-editor .project-section__heading p { margin: 0.35rem 0 0; color: var(--text-muted); }

.project-cover-editor-layout {
    display: grid;
    grid-template-columns: minmax(220px, 0.8fr) minmax(280px, 1.2fr);
    align-items: start;
    gap: 1rem;
}

.project-cover-preview {
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: #e8eee8;
    border: 1px solid var(--border);
    border-radius: 9px;
}

.project-cover-upload-form { display: grid; gap: 0.65rem; }
.project-cover-upload-form > label { font-weight: 750; }
.project-cover-upload-form > input[type="file"] {
    width: 100%;
    padding: 0.65rem;
    color: var(--text-main);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
}
.project-cover-upload-form > small { color: var(--text-muted); line-height: 1.45; }
.project-cover-upload-form .project-form-actions { margin: 0.35rem 0 0; }

.project-cover-remove-form {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 1rem;
    padding-top: 1rem;
    color: var(--text-muted);
    border-top: 1px solid var(--border);
    font-size: 0.82rem;
}

@media (max-width: 760px) {
    .client-project-toolbar { align-items: stretch; flex-direction: column; }
    .client-project-search { width: 100%; }
    .client-project-sort { justify-content: space-between; }
    .client-project-sort select { flex: 1; }
    .project-cover-editor-layout { grid-template-columns: 1fr; }
    .project-detail-cover { aspect-ratio: 16 / 7; }
}

@media (max-width: 480px) {
    .client-project-sort { align-items: stretch; flex-direction: column; }
    .project-cover-remove-form { align-items: stretch; flex-direction: column; }
}

html[data-theme="dark"] .client-project-cover-fallback,
html[data-theme="dark"] .project-cover-preview { background: var(--surface-muted); }


@media (prefers-color-scheme: dark) {
    html[data-theme="system"] .client-project-cover-fallback,
    html[data-theme="system"] .project-cover-preview { background: var(--surface-muted); }
}

/* Compact, read-only Client Portal with permanent desktop navigation. */
.client-dashboard {
    --client-sidebar-width: 248px;
    --client-sidebar-bg: var(--surface-sidebar);
    --client-sidebar-panel: var(--sidebar-hover);
    --client-sidebar-text: var(--sidebar-text);
    --client-sidebar-muted: var(--sidebar-muted);
}
body.client-dashboard #client-sidebar {
    flex: 0 0 var(--client-sidebar-width);
    width: var(--client-sidebar-width);
    overflow: hidden;
    color: var(--client-sidebar-text);
    background: var(--client-sidebar-bg);
    border-right-color: var(--sidebar-border);
}
.client-dashboard .client-sidebar-content { width: 100%; min-height: 0; display: flex; flex: 1; flex-direction: column; }
.client-dashboard .staff-main { min-width: 0; }
#client-sidebar .staff-logo {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 0 12px;
    padding: 8px 0 2px;
    border: 0;
}
#client-sidebar .staff-logo a {
    width: auto;
    height: auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-inline: auto;
    padding: 0;
    overflow: visible;
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
}
#client-sidebar .staff-logo a:focus-visible { outline: 3px solid var(--sidebar-focus); outline-offset: 3px; }
#client-sidebar .client-logo-full {
    width: min(188px, 82%);
    height: auto;
    display: block;
    object-fit: contain;
    filter: var(--sidebar-logo-filter);
    opacity: 0.96;
}
#client-sidebar .role-sidebar-label { margin: 0 0 6px; padding: 0 8px; background: transparent; border: 0; border-radius: 0; }
#client-sidebar .role-sidebar-label > span { display: none; }
#client-sidebar .role-sidebar-label > strong { color: var(--sidebar-muted); font-size: 0.68rem; font-weight: 850; letter-spacing: 0.13em; text-transform: uppercase; }
#client-sidebar .nav-item { min-height: 44px; gap: 0.6rem; padding: 7px 8px; overflow: hidden; color: var(--client-sidebar-text); background: transparent; border: 0; border-left: 3px solid transparent; border-radius: 7px; white-space: nowrap; }
#client-sidebar .nav-item:hover { color: var(--sidebar-text); background: var(--sidebar-hover); border-left-color: var(--brand-accent); }
#client-sidebar .nav-item:focus-visible { outline: 3px solid var(--sidebar-focus); outline-offset: 1px; }
#client-sidebar .nav-item.active { color: var(--sidebar-selected-text); background: var(--sidebar-selected-surface); border-left-color: var(--brand-accent); box-shadow: 0 3px 10px rgba(0, 0, 0, 0.14); }
#client-sidebar .dashboard-nav-dot { width: 18px; height: 18px; flex: 0 0 18px; display: grid; place-items: center; background: transparent; border-radius: 0; }
#client-sidebar .dashboard-nav-dot svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
#client-sidebar .nav-item-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
#client-sidebar .nav-item-label small { color: inherit; font: inherit; font-weight: 750; opacity: 0.78; }
.client-project-nav { min-width: 0; }
.client-project-nav__header { min-width: 0; display: flex; align-items: center; gap: 2px; }
#client-sidebar .client-project-nav__link { min-width: 0; flex: 1; }
.client-project-nav__toggle { width: 44px; height: 44px; flex: 0 0 44px; display: grid; place-items: center; padding: 0; color: var(--client-sidebar-muted); background: transparent; border: 0; border-radius: 5px; box-shadow: none; }
.client-project-nav__toggle:hover, .client-project-nav__toggle:focus-visible { color: var(--sidebar-text); background: var(--sidebar-hover); }
.client-project-nav__toggle:focus-visible { outline: 3px solid color-mix(in srgb, var(--green) 28%, transparent); outline-offset: 1px; }
.client-project-nav__toggle svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: transform 150ms ease; }
[data-project-nav="collapsed"] .client-project-nav__toggle svg { transform: rotate(-90deg); }
[data-project-nav="collapsed"] .client-project-nav__panel { display: none; }
.client-project-nav__panel { min-width: 0; padding: 2px 2px 5px 10px; }
.client-project-nav__search { position: relative; display: block; margin: 0 0 5px; }
.client-project-nav__search-icon { position: absolute; top: 50%; left: 8px; width: 15px; height: 15px; display: grid; place-items: center; color: var(--client-sidebar-muted); transform: translateY(-50%); pointer-events: none; }
.client-project-nav__search-icon svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.client-project-nav__search input { height: 44px; min-height: 44px; padding: 4px 8px 4px 29px; color: var(--sidebar-text); background: var(--sidebar-hover); border: 1px solid var(--sidebar-border); border-radius: 6px; font-size: 0.75rem; }
.client-project-nav__search input::placeholder { color: var(--client-sidebar-muted); }
.client-project-nav__search input:focus { border-color: var(--sidebar-focus); box-shadow: 0 0 0 3px color-mix(in srgb, var(--sidebar-focus) 32%, transparent); }
.client-project-nav__list { max-height: min(38vh, 320px); display: flex; flex-direction: column; gap: 4px; overflow-x: hidden; overflow-y: auto; scrollbar-width: thin; scrollbar-color: color-mix(in srgb, var(--text-muted) 42%, transparent) transparent; }
.client-project-nav__item { min-width: 0; min-height: 44px; display: flex; flex-direction: column; justify-content: center; gap: 4px; padding: 9px 10px; color: var(--client-sidebar-text); border-left: 2px solid transparent; border-radius: 4px; text-decoration: none; }
.client-project-nav__item:hover { color: var(--sidebar-text); background: var(--sidebar-hover); text-decoration: none; }
.client-project-nav__item:focus-visible { outline: 3px solid color-mix(in srgb, var(--green) 28%, transparent); outline-offset: -2px; }
.client-project-nav__item.is-active { color: var(--sidebar-selected-text); background: var(--sidebar-selected-surface); border-left-color: var(--brand-accent); }
.client-project-nav__item strong, .client-project-nav__item span { display: block; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.client-project-nav__item strong { font-size: 0.77rem; font-weight: 600; line-height: 1.4; white-space: normal; overflow: visible; overflow-wrap: anywhere; text-overflow: clip; }
.client-project-nav__item span { color: var(--client-sidebar-muted); font-size: 0.68rem; line-height: 1.3; white-space: normal; overflow: visible; overflow-wrap: anywhere; text-overflow: clip; }
.client-project-nav__state { margin: 0; padding: 8px; color: var(--client-sidebar-muted); font-size: 0.72rem; line-height: 1.4; }
.client-project-nav__state[hidden], .client-project-nav__item[hidden] { display: none; }
.client-dashboard .client-project-toolbar { align-items: center; gap: 0.75rem 1.25rem; }
.client-dashboard .client-project-search label { min-height: 40px; }
.client-dashboard .client-project-search .archive-search-icon { color: var(--text-secondary); }
.client-dashboard .client-project-search input { border: 0; }
.client-dashboard .client-project-sort { min-width: max-content; white-space: nowrap; }
.client-dashboard .client-project-sort select { min-height: 40px; }
.client-dashboard .client-project-grid { gap: 1rem; }
.client-dashboard .client-project-card-body { gap: 0.52rem; padding: 0.8rem 0.9rem 0.9rem; }
.client-project-list-page .client-project-card-heading { min-height: 2.94rem; align-items: start; }
.client-project-list-page .client-project-card-heading a { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; line-height: 1.4; }
.client-dashboard .client-project-view { min-height: 44px; padding-block: 0.45rem; }
#client-sidebar .sidebar-footer { border-top-color: var(--sidebar-border); }
#client-sidebar .sidebar-avatar { color: var(--sidebar-avatar-text); background: var(--sidebar-avatar-surface); }
#client-sidebar .sidebar-account-name { color: var(--sidebar-text); }
#client-sidebar .sidebar-account-login { color: var(--client-sidebar-muted); }
#client-sidebar .sidebar-signout button { color: var(--client-sidebar-text); }
#client-sidebar .sidebar-signout button:hover,
#client-sidebar .sidebar-signout button:focus-visible { color: var(--sidebar-text); background: var(--sidebar-hover); }
#client-sidebar .sidebar-signout button:focus-visible { outline: 3px solid var(--sidebar-focus); outline-offset: 2px; }
.client-project-workspace-page .staff-header { display: none; }
.client-project-workspace-page .staff-main { padding: clamp(16px, 2vw, 26px); }
.client-project-workspace { width: min(100%, 1120px); display: grid; gap: 12px; margin: 0 auto; }
.client-page-back { margin: 0; }
.client-page-back a { display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.25rem 0; color: var(--green-dark); font-size: 0.8rem; font-weight: 800; text-decoration: none; }
.client-page-back a:hover { text-decoration: underline; }
.client-page-back a:focus-visible { outline: 3px solid color-mix(in srgb, var(--green) 28%, transparent); outline-offset: 3px; border-radius: 3px; }
.client-project-breadcrumb { min-width: 0; display: flex; align-items: center; gap: 0.45rem; color: var(--text-muted); font-size: 0.76rem; line-height: 1.35; }
.client-project-breadcrumb a { color: var(--green-dark); font-weight: 750; text-decoration: none; }
.client-project-breadcrumb strong { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.client-project-hero { min-width: 0; display: grid; grid-template-columns: minmax(230px, 36%) minmax(0, 1fr); align-items: stretch; gap: clamp(16px, 2.5vw, 28px); padding: 14px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 6px 20px rgba(19, 55, 31, 0.05); }
.client-project-hero__cover { min-height: 132px; aspect-ratio: 12 / 5; margin: 0; overflow: hidden; background: var(--surface-muted); border-radius: 8px; }
.client-project-hero__cover img { width: 100%; height: 100%; display: block; object-fit: cover; }
.client-project-hero__copy { min-width: 0; align-self: center; }
.client-project-eyebrow { margin: 0 0 0.35rem; color: var(--text-muted); font-size: 0.68rem; font-weight: 850; letter-spacing: 0.1em; text-transform: uppercase; }
.client-project-hero__copy h2 { margin: 0.3rem 0 0.35rem; font-size: clamp(1.5rem, 3vw, 2.2rem); line-height: 1.12; overflow-wrap: anywhere; }
.client-project-hero__context { display: flex; flex-wrap: wrap; gap: 0.35rem 0.55rem; margin: 0; color: var(--text-muted); font-size: 0.94rem; }
.client-project-hero__status { display: inline-flex; padding: 0.28rem 0.62rem; color: #245d31; background: #e6f3e8; border-radius: 999px; font-size: 0.72rem; font-weight: 800; }
.client-project-hero__status.status-on-hold { color: #775217; background: #fbefd4; }
.client-project-hero__status:is(.status-complete, .status-archived) { color: #505b53; background: #e9ecea; }
.client-project-hero__updated { display: flex; align-items: center; gap: 0.4rem; margin: 0.7rem 0 0; color: var(--text-muted); font-size: 0.75rem; }
.client-project-hero__updated > span:first-child { width: 24px; height: 24px; display: grid; place-items: center; color: var(--green-dark); background: var(--green-soft); border-radius: 50%; font-weight: 900; }
.client-project-details { display: grid; gap: 0; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; }
.client-project-panel { min-width: 0; margin: 0; padding: 13px 15px; background: transparent; border-bottom: 1px solid var(--border); }
.client-project-panel:last-child { border-bottom: 0; }
.client-project-documents { min-width: 0; margin: 0; padding: 13px 15px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; }
.client-project-panel > header { display: flex; align-items: center; gap: 0.65rem; margin-bottom: 0.7rem; }
.client-project-panel h2, .client-project-documents .project-section__heading h2 { margin: 0; font-size: 0.96rem; }
.client-project-panel__icon { width: 23px; height: 23px; display: grid; place-items: center; color: var(--green-dark); background: var(--green-soft); border-radius: 6px; font-size: 0.7rem; font-weight: 900; }
.client-project-info-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0; margin: 0; }
.client-project-info-list > div { min-width: 0; padding: 0.55rem 0.55rem 0.55rem 0; border-top: 1px solid var(--border); }
.client-project-info-list dt { color: var(--text-muted); font-size: 0.68rem; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase; }
.client-project-info-list dd { margin: 0.18rem 0 0; overflow-wrap: anywhere; white-space: pre-wrap; font-size: 0.82rem; line-height: 1.35; }
.client-project-update-list article { position: relative; padding: 0.6rem 0; border-top: 1px solid var(--border); }
.client-project-update-list time { float: right; margin-left: 0.6rem; color: var(--text-muted); font-size: 0.66rem; white-space: nowrap; }
.client-project-update-list p { margin: 0; overflow-wrap: anywhere; white-space: pre-wrap; font-size: 0.8rem; line-height: 1.42; }
.client-project-resource-list { margin: 0; padding: 0; list-style: none; }
.client-project-resource-list li { border-top: 1px solid var(--border); }
.client-project-resource-list a { min-height: 42px; display: grid; grid-template-columns: 25px minmax(0, 1fr) auto; align-items: center; gap: 0.55rem; color: var(--text-main); font-size: 0.8rem; text-decoration: none; }
.client-project-resource-list a:hover strong { color: var(--green-dark); text-decoration: underline; }
.client-project-link-glyph { width: 24px; height: 24px; display: grid; place-items: center; color: var(--green-dark); background: var(--green-soft); border-radius: 6px; }
.client-project-link-open { color: var(--text-muted); }
.client-project-empty { margin: 0; padding-top: 0.45rem; color: var(--text-muted); font-size: 0.8rem; line-height: 1.45; }
.client-project-documents { scroll-margin-top: 14px; }
.project-documents > .project-section__heading { justify-content: flex-start; align-items: center; }
.project-documents > .project-section__heading .project-overview-more { margin-left: auto; }
.client-project-documents .project-section__heading { padding: 0 0 0.75rem; border: 0; }
.client-project-documents .project-section__heading p { margin: 0.2rem 0 0; color: var(--text-muted); font-size: 0.76rem; }
.client-project-documents .project-document-breadcrumbs { margin: 0 0 0.65rem; font-size: 0.75rem; }
.client-document-table { overflow: hidden; border: 1px solid var(--border); border-radius: 8px; }
.client-document-table__head, .client-document-table .project-document-row { min-width: 720px; display: grid; grid-template-columns: minmax(260px, 2.2fr) minmax(85px, .65fr) minmax(95px, .75fr) minmax(125px, .9fr) 72px; align-items: center; column-gap: 12px; }
.client-document-table__head { min-height: 32px; padding: 0 0.75rem; color: var(--text-muted); background: var(--surface-muted); border-bottom: 1px solid var(--border); font-size: 0.64rem; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase; }
.client-document-table .project-document-row { min-height: 44px; padding: 0.35rem 0.75rem; color: var(--text-main); border: 0; border-bottom: 1px solid var(--border); text-decoration: none; }
.client-document-table .project-document-row:last-child { border-bottom: 0; }
.client-document-table a.project-document-row:hover { background: var(--surface-muted); text-decoration: none; }
.client-document-table .archive-explorer-name { min-width: 0; display: flex; align-items: center; gap: 0.65rem; }
.client-document-table .archive-explorer-name > :first-child { flex-shrink: 0; }
.client-document-table .archive-explorer-name strong { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.8rem; }
.client-document-table :is(.project-document-kind, .project-document-detail, .project-document-modified) { color: var(--text-muted); font-size: 0.74rem; }
.client-document-table .project-list-chevron { justify-self: end; color: var(--green-dark); }
.client-document-table .project-document-download { justify-self: end; padding: 0.3rem; color: var(--green-dark); font-size: 0.72rem; }
.client-project-workspace--folder .client-project-documents { margin-top: 2px; }

.project-document-state {
    width: min(100%, 620px);
    min-width: 0;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    color: var(--text-secondary);
    background: var(--surface-elevated);
    border: 1px solid var(--border-strong);
    border-radius: 10px;
}
.project-document-state__icon {
    width: 1.5rem;
    height: 1.5rem;
    flex: 0 0 1.5rem;
    display: grid;
    place-items: center;
    color: var(--text-primary);
    border: 1px solid currentColor;
    border-radius: 50%;
    font-weight: 900;
    line-height: 1;
}
.project-document-state strong { display: block; color: var(--text-primary); }
.project-document-state p { margin: 0.15rem 0 0; color: inherit; }
.project-document-state--error {
    color: var(--status-warning-text);
    background: var(--status-warning-surface);
    border-color: var(--status-warning-border);
}
.project-document-state--empty { border-style: dashed; }

.project-member-list, .project-member-search-results, .project-team-summary { display: grid; gap: 0.65rem; }
.project-member-row, .project-member-result { min-width: 0; display: flex; align-items: center; gap: 0.8rem; padding: 0.8rem; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; }
.project-member-row .profile-circle { width: 38px; height: 38px; flex: 0 0 38px; }
.project-member-copy, .project-member-result > span { min-width: 0; flex: 1; display: grid; gap: 0.15rem; }
.project-member-copy span, .project-member-result small, .project-team-summary small { color: var(--text-muted); font-size: 0.78rem; }
.project-member-add { display: grid; gap: 0.8rem; margin-top: 1.35rem; padding-top: 1.2rem; border-top: 1px solid var(--border); }
.project-member-add .project-list-search { max-width: 620px; }
.project-access-page { display: grid; gap: 1.5rem; }
.project-access-intro { max-width: 760px; }
.project-access-intro h2 { margin: 0.2rem 0 0.35rem; }
.project-access-intro p:last-child { margin: 0; color: var(--text-muted); }
.project-access-groups { display: grid; gap: 1.25rem; align-items: start; }
.project-access-group { min-width: 0; padding: 1.25rem; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; }
.project-access-group__header { display: flex; justify-content: space-between; gap: 1rem; align-items: flex-start; padding-bottom: 1rem; border-bottom: 1px solid var(--border); }
.project-access-group__header h2 { margin: 0.15rem 0 0.25rem; }
.project-access-group__header p:last-child { margin: 0; color: var(--text-muted); }
.project-access-count { display: grid; place-items: center; min-width: 2rem; height: 2rem; padding: 0 0.55rem; border-radius: 999px; background: var(--surface-muted); color: var(--text-main); font-weight: 700; }
.project-access-group > .project-member-list,
.project-access-group > .project-empty-note { margin-top: 1rem; }
.project-access-add { display: grid; gap: 0.55rem; margin-top: 1.35rem; padding-top: 1.2rem; border-top: 1px solid var(--border); }
.project-access-add h3, .project-access-add p { margin: 0; }
.project-access-add > p { color: var(--text-muted); font-size: 0.9rem; }
.project-access-search { display: grid; gap: 0.4rem; width: 100%; margin: 0; }
.project-access-search > label { margin: 0; }
.project-access-search-row { display: flex; gap: 0.6rem; align-items: stretch; }
.project-access-search-row input { min-width: 0; flex: 1; }
.project-team-directory > div:first-child { display: grid; gap: 0.35rem; }
.project-team-directory .project-team-directory-meta { color: var(--text-muted); font-size: 0.78rem; }
.project-team-role-groups { display: grid; gap: 1.15rem; }
.project-team-role-group { min-width: 0; }
.project-team-role-group h4 { margin: 0 0 0.55rem; color: var(--text-main); font-size: 0.78rem; letter-spacing: 0.07em; text-transform: uppercase; }
.project-team-role-group h4 span { color: var(--text-muted); font-weight: 600; letter-spacing: 0; }
.project-team-directory-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr)); gap: 0.65rem; }
.project-team-directory-card { min-width: 0; display: grid; grid-template-columns: 38px minmax(0, 1fr); gap: 0.65rem 0.75rem; align-items: center; padding: 0.75rem; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; }
.project-team-directory-card .profile-circle { width: 38px; height: 38px; flex-basis: 38px; }
.project-team-directory-card__copy { min-width: 0; display: grid; gap: 0.08rem; }
.project-team-directory-card__copy strong,
.project-team-directory-card__copy span,
.project-team-directory-card__copy small { overflow-wrap: anywhere; }
.project-team-directory-card__copy span { color: var(--aloa-green-dark); font-size: 0.82rem; font-weight: 700; }
.project-team-directory-card__copy small { color: var(--text-muted); font-size: 0.75rem; }
.project-team-directory-card form { grid-column: 2; }
.project-team-directory-card button { width: 100%; }
.project-directory-notice { margin: 0; padding: 0.8rem; color: var(--text-main); background: var(--surface-muted); border: 1px solid var(--border); border-radius: 8px; }

@media (min-width: 1180px) {
    .project-access-groups { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
    .project-access-search-row { align-items: stretch; flex-direction: column; }
    .project-member-row, .project-member-result { align-items: flex-start; flex-wrap: wrap; }
    .project-member-row form, .project-member-result button { margin-left: 46px; }
    .project-team-directory-card { grid-template-columns: 38px minmax(0, 1fr); }
}
.project-team-section { margin-bottom: 1rem; }
.project-team-summary { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.project-team-summary > span { min-width: 0; display: grid; gap: 0.2rem; padding: 0.75rem; background: var(--surface-muted); border-radius: 7px; }

@media (min-width: 701px) {
    .client-dashboard .staff-sidebar { width: var(--client-sidebar-width); padding: 12px; }
    .client-dashboard .staff-nav { gap: 3px; padding-top: 2px; }
    .client-dashboard .sidebar-footer { padding-top: 0.65rem; }
    .client-dashboard .sidebar-identity { grid-template-columns: 36px minmax(0, 1fr); gap: 0.55rem; padding-inline: 0.35rem; }
    .client-dashboard .sidebar-avatar { width: 36px; height: 36px; }
    .client-dashboard .sidebar-signout button { min-height: 44px; }
}
@media (max-width: 1100px) {
    .client-document-table__head, .client-document-table .project-document-row { min-width: 0; grid-template-columns: minmax(220px, 1fr) minmax(85px, .45fr) minmax(125px, .65fr) 70px; }
    .client-document-table__head > :nth-child(3), .client-document-table .project-document-detail { display: none; }
}
@media (max-width: 820px) { .client-project-hero { grid-template-columns: minmax(190px, 38%) minmax(0, 1fr); } }
@media (max-width: 780px) {
    .client-document-table__head, .client-document-table .project-document-row { grid-template-columns: minmax(190px, 1fr) minmax(125px, .6fr) 70px; }
    .client-document-table__head > :nth-child(2), .client-document-table .project-document-kind { display: none; }
}
@media (max-width: 700px) {
    .client-project-workspace-page .staff-header { display: flex; padding-bottom: 14px; }
    .client-project-workspace-page .staff-header-copy { display: none; }
    .client-project-workspace-page .header-actions { width: 100%; justify-content: flex-end; }
    body.client-dashboard #client-sidebar { width: 100%; flex-basis: auto; display: flex; gap: 0; }
    .client-dashboard .client-sidebar-content { width: 100%; min-height: 0; display: grid; grid-template-columns: minmax(140px, 1fr) auto; grid-template-areas: "logo profile" "nav nav"; align-items: center; gap: 14px 18px; }
    .client-project-hero { grid-template-columns: 1fr; }
    .client-project-hero__cover { min-height: 0; aspect-ratio: 16 / 6; }
}
@media (max-width: 560px) {
    .client-document-table__head, .client-document-table .project-document-row { grid-template-columns: minmax(180px, 1fr) 70px; }
    .client-document-table__head > :nth-child(4), .client-document-table .project-document-modified { display: none; }
}
@media (max-width: 480px) { .client-project-info-list { grid-template-columns: 1fr; } .client-project-hero { padding: 12px; } .client-project-panel, .client-project-documents { padding: 13px; } }

/* Shared authenticated sidebar identity and sign-out footer. */
.sidebar-footer {
    min-width: 0;
    flex: 0 0 auto;
    margin-top: auto;
    padding-top: 0.85rem;
    border-top: 1px solid var(--border);
}

.sidebar-identity {
    min-width: 0;
    display: grid;
    grid-template-columns: 40px minmax(0, 1fr);
    align-items: center;
    gap: 0.65rem;
    padding: 0 0.45rem;
}

.sidebar-avatar {
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    color: var(--green-dark);
    background: var(--green-soft);
    border-radius: 50%;
    font-size: 0.82rem;
    font-weight: 800;
}

.sidebar-account { min-width: 0; }
.sidebar-account-name,
.sidebar-account-login {
    display: block;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.sidebar-account-name { color: var(--text-main); font-size: 0.82rem; }
.sidebar-account-login { margin-top: 0.15rem; color: var(--text-muted); font-size: 0.7rem; }

.sidebar-signout { margin: 0.35rem 0 0; }
.sidebar-signout button {
    width: 100%;
    min-height: 36px;
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.4rem 0.65rem;
    color: #4d5d52;
    background: transparent;
    border: 0;
    border-radius: 6px;
    font: inherit;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
}
.sidebar-signout button:hover,
.sidebar-signout button:focus-visible { color: var(--green-dark); background: var(--green-soft); }
.sidebar-signout button:focus-visible { outline: 3px solid color-mix(in srgb, var(--green) 28%, transparent); outline-offset: 1px; }
.sidebar-signout-icon {
    width: 20px;
    height: 20px;
    flex: 0 0 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

@media (min-width: 701px) {
    .staff-sidebar,
    .admin-dashboard .staff-sidebar {
        overflow: hidden;
    }
    .staff-nav {
        min-height: 0;
        flex: 1 1 auto;
        overflow-x: hidden;
        overflow-y: auto;
        overscroll-behavior: contain;
        scrollbar-width: thin;
    }
    .client-dashboard .staff-nav { overflow: hidden; }
}

@media (max-width: 700px) {
    .staff-sidebar,
    .admin-dashboard .staff-sidebar,
    .client-dashboard .client-sidebar-content {
        grid-template-areas:
            "logo footer"
            "nav nav";
    }
    .sidebar-footer {
        grid-area: footer;
        width: min(100%, 340px);
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: center;
        gap: 0.4rem;
        justify-self: end;
        margin: 0;
        padding: 0;
        border: 0;
    }
    .sidebar-identity { grid-template-columns: 36px minmax(0, 1fr); padding: 0; }
    .sidebar-avatar { width: 36px; height: 36px; }
    .sidebar-signout { margin: 0; }
    .sidebar-signout button { width: auto; padding-inline: 0.55rem; }
}

@media (max-width: 520px) {
    .staff-sidebar,
    .admin-dashboard .staff-sidebar,
    .client-dashboard .client-sidebar-content {
        grid-template-columns: 1fr;
        grid-template-areas:
            "logo"
            "nav"
            "footer";
        column-gap: 0;
    }
    body.client-dashboard .staff-logo { justify-content: center; }
    body.client-dashboard .staff-logo img { margin-inline: auto; }
    .sidebar-footer {
        width: 100%;
        justify-self: stretch;
        padding-top: 0.75rem;
        border-top: 1px solid var(--border);
    }
}
/* Project Tasks */
.task-page,
.task-detail,
.project-tasks {
  background: var(--surface, #fff);
  border: 1px solid var(--border-color, #d9e0e7);
  border-radius: 14px;
  padding: 1.25rem;
  margin-bottom: 1rem;
}

.task-list { display: grid; gap: .75rem; }
.task-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: .9rem 1rem;
  border: 1px solid var(--border-color, #d9e0e7);
  border-radius: 10px;
}
.task-card--overdue { border-inline-start: 4px solid #b42318; }
.task-card h3, .task-card h4 { margin: .3rem 0; font-size: 1rem; }
.task-card p { margin: 0; color: var(--text-secondary); }
.task-card__meta { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
.task-card__actions { display: flex; gap: .6rem; align-items: center; }
.task-card__links { display: flex; flex-wrap: wrap; gap: .65rem; margin-top: .55rem; }
.task-group-heading { margin: 1rem 0 .55rem; font-size: .82rem; letter-spacing: .06em; text-transform: uppercase; }
.task-status, .task-priority, .task-warning {
  border-radius: 999px;
  font-size: .75rem;
  font-weight: 700;
  padding: .2rem .55rem;
}
.task-status { background: #e8eef5; color: #25364a; }
.task-status--in_progress { background: #dbeafe; color: #174ea6; }
.task-status--blocked, .task-warning { background: #fee4e2; color: #912018; }
.task-status--done { background: #dcfae6; color: #05603a; }
.task-priority { border: 1px solid var(--border-color, #d9e0e7); }
.task-access-warning { color: #912018 !important; font-weight: 650; }
.task-editor { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .8rem; margin-top: 1rem; }
.task-editor h3, .task-editor__wide { grid-column: 1 / -1; }
.task-editor label, .task-status-form label { display: grid; gap: .35rem; font-weight: 650; }
.task-editor input, .task-editor textarea, .task-editor select, .task-card select, .task-status-form select { width: 100%; }
.task-detail dl { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.task-detail dl div { display: grid; gap: .25rem; }
.task-detail dt { color: var(--text-secondary); font-size: .8rem; font-weight: 700; text-transform: uppercase; }
.task-detail dd { margin: 0; }
.task-detail dd small { display: block; }
.task-description { white-space: pre-wrap; }
.task-status-form { display: flex; gap: .75rem; align-items: end; margin-top: 1rem; }
.task-project-picker { display: grid; gap: .4rem; margin-top: 1rem; }
.task-project-picker > label { font-weight: 650; }
.task-project-picker__controls { display: flex; gap: .65rem; align-items: center; }
.task-project-picker__controls input { flex: 1; min-width: 0; }
.task-project-results { display: grid; gap: .55rem; margin-top: .75rem; }
.task-project-result { display: flex; justify-content: space-between; gap: .75rem; align-items: center; padding: .75rem .85rem; border: 1px solid var(--border-color, #d9e0e7); border-radius: 10px; }
.task-project-result div, .task-create-context div { display: grid; gap: .15rem; }
.task-project-result span, .task-create-context span { color: var(--text-secondary); font-size: .84rem; }
.task-create-context { display: flex; justify-content: space-between; gap: .65rem; align-items: center; margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--border-color, #d9e0e7); }
.task-empty-team { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; margin-top: 1rem; }
.task-empty-team .project-empty-note { margin: 0; }

@media (max-width: 700px) {
  .task-card { align-items: stretch; flex-direction: column; }
  .task-card__actions { justify-content: space-between; }
  .task-editor, .task-detail dl { grid-template-columns: 1fr; }
  .task-editor h3, .task-editor__wide { grid-column: auto; }
  .task-project-picker__controls { align-items: stretch; flex-direction: column; }
  .task-project-result, .task-create-context { align-items: stretch; flex-direction: column; }
}

/* =========================================================
   ACCESSIBLE VISUAL DESIGN SYSTEM V1
   Semantic tokens and shared WCAG 2.2 AA interaction states.
========================================================= */

:root {
    --brand-primary: #1f6a38;
    --brand-primary-strong: #174f2b;
    --brand-accent: #75b968;

    --surface-page: #f7f8f5;
    --surface-card: #ffffff;
    --surface-elevated: #eef2ed;
    --surface-sidebar: #123d25;
    --sidebar-text: #f5faf6;
    --sidebar-muted: #c7d9cc;
    --sidebar-border: #0b2d1a;
    --sidebar-hover: #1b5032;
    --sidebar-selected-surface: #f5faf6;
    --sidebar-selected-text: #123d25;
    --sidebar-focus: #9bd08c;
    --sidebar-avatar-surface: #dcefdc;
    --sidebar-avatar-text: #123d25;
    --sidebar-logo-filter: grayscale(1) brightness(0) invert(1);

    --text-primary: #1b241e;
    --text-secondary: #45564b;
    --text-muted-accessible: #59685e;
    --text-on-brand: #ffffff;

    --border-subtle: #b7c1ba;
    --border-strong: #738177;

    --action-primary: #1f6a38;
    --action-primary-hover: #174f2b;
    --action-secondary-hover: #e2eee5;

    --status-success-text: #075e36;
    --status-success-surface: #dff5e7;
    --status-success-border: #77a98a;
    --status-warning-text: #694800;
    --status-warning-surface: #fff1c7;
    --status-warning-border: #b58b26;
    --status-danger-text: #84221c;
    --status-danger-surface: #fde7e5;
    --status-danger-border: #bd746f;
    --status-info-text: #124f83;
    --status-info-surface: #e3f0fb;
    --status-info-border: #759abb;

    --focus-ring: #075ea8;
    --focus-ring-offset: #ffffff;
    --disabled-background: #e4e8e3;
    --disabled-text: #58645b;
    --disabled-border: #98a49b;

    /* Compatibility aliases keep established components on one palette. */
    --background: var(--surface-page);
    --surface: var(--surface-card);
    --surface-muted: var(--surface-elevated);
    --text-main: var(--text-primary);
    --text-muted: var(--text-muted-accessible);
    --border: var(--border-subtle);
    --green: var(--action-primary);
    --green-dark: var(--brand-primary-strong);
    --green-soft: var(--action-secondary-hover);
}

html[data-theme="dark"] {
    color-scheme: dark;
    --surface-page: #0d1711;
    --surface-card: #15201a;
    --surface-elevated: #213028;
    --surface-sidebar: #101813;
    --sidebar-text: #f4f8f5;
    --sidebar-muted: #b4c3b8;
    --sidebar-border: #52685b;
    --sidebar-hover: #213028;
    --sidebar-selected-surface: #2a4032;
    --sidebar-selected-text: #f4f8f5;
    --sidebar-focus: #8ecbff;
    --sidebar-avatar-surface: #2a4032;
    --sidebar-avatar-text: #f4f8f5;
    --sidebar-logo-filter: grayscale(1) brightness(0) invert(1);
    --text-primary: #f4f8f5;
    --text-secondary: #cad6cd;
    --text-muted-accessible: #b4c3b8;
    --border-subtle: #52685b;
    --border-strong: #647c6e;
    --action-primary: #377d4a;
    --action-primary-hover: #2f6f3e;
    --action-secondary-hover: #253a2c;
    --focus-ring: #8ecbff;
    --focus-ring-offset: #0d1711;
    --disabled-background: #28332c;
    --disabled-text: #aebbb2;
    --disabled-border: #647069;
    --status-success-text: #b9f6cf;
    --status-success-surface: #123523;
    --status-success-border: #4c9368;
    --status-warning-text: #ffe19a;
    --status-warning-surface: #3a2e12;
    --status-warning-border: #a47c28;
    --status-danger-text: #ffc9c5;
    --status-danger-surface: #461b18;
    --status-danger-border: #a45e59;
    --status-info-text: #c2e1ff;
    --status-info-surface: #17324a;
    --status-info-border: #5e8eb5;
}

@media (prefers-color-scheme: dark) {
    html[data-theme="system"] {
        color-scheme: dark;
        --surface-page: #0d1711;
        --surface-card: #15201a;
        --surface-elevated: #213028;
        --surface-sidebar: #101813;
        --sidebar-text: #f4f8f5;
        --sidebar-muted: #b4c3b8;
        --sidebar-border: #52685b;
        --sidebar-hover: #213028;
        --sidebar-selected-surface: #2a4032;
        --sidebar-selected-text: #f4f8f5;
        --sidebar-focus: #8ecbff;
        --sidebar-avatar-surface: #2a4032;
        --sidebar-avatar-text: #f4f8f5;
        --sidebar-logo-filter: grayscale(1) brightness(0) invert(1);
        --text-primary: #f4f8f5;
        --text-secondary: #cad6cd;
        --text-muted-accessible: #b4c3b8;
        --border-subtle: #52685b;
        --border-strong: #647c6e;
        --action-primary: #377d4a;
        --action-primary-hover: #2f6f3e;
        --action-secondary-hover: #253a2c;
        --focus-ring: #8ecbff;
        --focus-ring-offset: #0d1711;
        --disabled-background: #28332c;
        --disabled-text: #aebbb2;
        --disabled-border: #647069;
        --status-success-text: #b9f6cf;
        --status-success-surface: #123523;
        --status-success-border: #4c9368;
        --status-warning-text: #ffe19a;
        --status-warning-surface: #3a2e12;
        --status-warning-border: #a47c28;
        --status-danger-text: #ffc9c5;
        --status-danger-surface: #461b18;
        --status-danger-border: #a45e59;
        --status-info-text: #c2e1ff;
        --status-info-surface: #17324a;
        --status-info-border: #5e8eb5;
    }
}

/* Locally-scoped legacy role variables follow the semantic theme. */
html[data-theme="dark"] body.staff-body,
html[data-theme="system"] body.staff-body {
    --background: var(--surface-page);
    --surface: var(--surface-card);
    --surface-muted: var(--surface-elevated);
    --white: var(--surface-card);
    --text-main: var(--text-primary);
    --text-muted: var(--text-muted-accessible);
    --border: var(--border-subtle);
    --green: var(--action-primary);
    --green-dark: var(--text-secondary);
    --green-soft: var(--action-secondary-hover);
}

body.staff-body {
    color: var(--text-primary);
    background: var(--surface-page);
    line-height: 1.55;
}

.staff-main :where(p, dd) a:not(.admin-primary-button, .admin-secondary-button, .admin-text-button, .client-project-view) {
    font-weight: 650;
    text-decoration: underline;
    text-decoration-thickness: 0.09em;
    text-underline-offset: 0.18em;
}

body.staff-body :where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
    outline: 3px solid var(--focus-ring);
    outline-offset: 3px;
    box-shadow: 0 0 0 2px var(--focus-ring-offset);
}

:where(input, textarea, select) {
    min-height: 44px;
    color: var(--text-primary);
    background: var(--surface-card);
    border-color: var(--border-strong);
}

:where(input, textarea, select):hover { border-color: var(--brand-primary); }
:where(input, textarea, select):focus { border-color: var(--focus-ring); }

body.staff-body :where(button, .btn, .admin-primary-button, .admin-secondary-button, .admin-text-button, .nav-item) {
    min-height: 44px;
    transition-property: color, background-color, border-color, box-shadow, transform;
}

:where(button, input, textarea, select):disabled,
:where(.role-action-disabled, .nav-item-disabled, .project-pagination__button.is-disabled) {
    color: var(--disabled-text);
    background: var(--disabled-background);
    border-color: var(--disabled-border);
    cursor: not-allowed;
    opacity: 1;
}

.admin-primary-button,
.role-primary-action,
button.btn,
.btn-primary {
    color: var(--text-on-brand);
    background: var(--action-primary);
    border-color: var(--action-primary);
}

.admin-primary-button:hover,
.role-primary-action:hover,
button.btn:hover,
.btn-primary:hover {
    color: var(--text-on-brand);
    background: var(--action-primary-hover);
    border-color: var(--action-primary-hover);
}

.admin-secondary-button,
.admin-text-button {
    color: var(--brand-primary-strong);
    border-color: var(--border-strong);
}

html[data-theme="dark"] :is(.admin-secondary-button, .admin-text-button),
html[data-theme="system"] :is(.admin-secondary-button, .admin-text-button) {
    color: var(--text-primary);
}

.admin-secondary-button:hover,
.admin-text-button:hover { background: var(--action-secondary-hover); }

/* One semantic secondary action treatment across all role palettes. */
body.staff-body .admin-secondary-button {
    color: var(--text-primary);
    background: var(--surface-card);
    border-color: var(--border-strong);
}
body.staff-body .admin-secondary-button:is(:hover, :focus-visible, :active) {
    color: var(--text-primary);
    background: var(--action-secondary-hover);
    border-color: var(--brand-primary);
}
body.staff-body .admin-secondary-button:is(:disabled, [aria-disabled="true"]) {
    color: var(--text-secondary);
    background: var(--surface-muted);
    border-color: var(--border-subtle);
    cursor: not-allowed;
    opacity: 1;
}

.staff-sidebar:not(#client-sidebar) {
    color: var(--sidebar-text);
    background: var(--surface-sidebar);
    border-color: var(--sidebar-border);
}

.staff-sidebar:not(#client-sidebar) .nav-item { color: var(--sidebar-text); }
.staff-sidebar:not(#client-sidebar) .nav-item:hover { color: var(--sidebar-text); background: var(--sidebar-hover); }
.staff-sidebar:not(#client-sidebar) .nav-item.active {
    color: var(--sidebar-selected-text);
    background: var(--sidebar-selected-surface);
    border-color: var(--brand-accent);
}

#client-sidebar .nav-item { color: var(--sidebar-text); opacity: 1; }
#client-sidebar .client-project-nav__item { color: var(--sidebar-text); }
#client-sidebar .client-project-nav__item span,
#client-sidebar .client-project-nav__state,
#client-sidebar .sidebar-account-login { color: var(--sidebar-muted); }
body.client-dashboard #client-sidebar .sidebar-signout button:focus-visible {
    outline-width: 3px;
    outline-style: solid;
    outline-color: var(--sidebar-focus);
    outline-offset: 2px;
}

.role-header-label,
.settings-kicker,
.settings-panel-header > span,
.client-project-eyebrow {
    color: var(--brand-primary-strong);
    font-size: max(0.75rem, 12px);
    letter-spacing: 0.08em;
}

html[data-theme="dark"] :is(.role-header-label, .settings-kicker, .settings-panel-header > span, .client-project-eyebrow),
html[data-theme="system"] :is(.role-header-label, .settings-kicker, .settings-panel-header > span, .client-project-eyebrow) {
    color: var(--text-secondary);
}

.staff-header h1,
.role-page-heading h2 { color: var(--text-primary); line-height: 1.15; }
.staff-header p,
.project-section__heading p,
.client-project-card-meta,
.project-list-context { color: var(--text-secondary); }

:is(.role-workspace-card, .role-information-card, .settings-panel, .project-workspace,
    .project-list-row, .client-project-card, .client-project-toolbar, .client-project-hero,
    .client-project-details, .client-project-documents, .task-page, .task-detail, .project-tasks) {
    color: var(--text-primary);
    background: var(--surface-card);
    border-color: var(--border-subtle);
}

.client-project-card:hover,
.client-project-card:focus-within,
.project-list-row:hover,
.project-list-row:focus-within {
    border-color: var(--brand-primary);
    box-shadow: 0 8px 24px rgba(18, 61, 37, 0.10);
}

.client-project-card:focus-within,
.project-list-row:focus-within {
    outline: 3px solid var(--focus-ring);
    outline-offset: 3px;
}

.client-project-card-heading a,
.client-page-back a,
.client-project-breadcrumb a,
.project-link-list a { color: var(--brand-primary-strong); }

html[data-theme="dark"] :is(.client-project-card-heading a, .client-page-back a, .client-project-breadcrumb a, .project-link-list a),
html[data-theme="system"] :is(.client-project-card-heading a, .client-page-back a, .client-project-breadcrumb a, .project-link-list a) {
    color: var(--text-primary);
}

.client-document-table,
.project-document-explorer { border-color: var(--border-strong); }
.client-document-table__head { color: var(--text-secondary); background: var(--surface-elevated); }
.project-document-row:focus-within { outline: 3px solid var(--focus-ring); outline-offset: -3px; }
.project-document-download { min-width: 44px; min-height: 44px; display: inline-grid; place-items: center; }

.project-pagination .project-pagination__button { min-height: 44px; border-color: var(--border-strong); }
.project-pagination__status { color: var(--text-secondary); }

.app-feedback { border-width: 2px; box-shadow: none; }
.app-feedback__marker {
    width: 1.25rem;
    height: 1.25rem;
    display: grid;
    place-items: center;
    margin-top: 0.08rem;
    color: currentColor;
    background: transparent;
    font-weight: 900;
}
.app-feedback__marker::before { content: "i"; }
.app-feedback--success { color: var(--status-success-text); background: var(--status-success-surface); border-color: var(--status-success-border); }
.app-feedback--success .app-feedback__marker::before { content: "\2713"; }
.app-feedback--warning { color: var(--status-warning-text); background: var(--status-warning-surface); border-color: var(--status-warning-border); }
.app-feedback--warning .app-feedback__marker::before,
.app-feedback--error .app-feedback__marker::before { content: "!"; }
.app-feedback--error { color: var(--status-danger-text); background: var(--status-danger-surface); border-color: var(--status-danger-border); }

.task-status,
.task-priority,
.task-warning,
.project-status,
.client-project-status-pill,
.client-project-hero__status,
.project-availability-badge {
    border: 1px solid currentColor;
}

.task-status { color: var(--text-secondary); background: var(--surface-elevated); }
.task-status::before { content: "\2022\00a0"; }
.task-status--in_progress { color: var(--status-info-text); background: var(--status-info-surface); }
.task-status--in_progress::before { content: "\2192\00a0"; }
.task-status--blocked,
.task-warning { color: var(--status-danger-text); background: var(--status-danger-surface); }
.task-status--blocked::before,
.task-warning::before { content: "!\00a0"; }
.task-status--done { color: var(--status-success-text); background: var(--status-success-surface); }
.task-status--done::before { content: "\2713\00a0"; }
.task-priority { color: var(--text-secondary); background: var(--surface-card); border-color: var(--border-strong); }
.task-priority::before { content: "Priority: "; }
.task-access-warning { color: var(--status-danger-text) !important; }

.project-status--on-hold,
.client-project-status-pill.status-on-hold,
.client-project-hero__status.status-on-hold,
.project-availability-badge.is-unavailable {
    color: var(--status-warning-text);
    background: var(--status-warning-surface);
}

.project-status--complete,
.client-project-status-pill.status-complete,
.client-project-hero__status.status-complete {
    color: var(--status-success-text);
    background: var(--status-success-surface);
}

[data-high-contrast="true"] {
    --surface-page: #ffffff;
    --surface-card: #ffffff;
    --surface-elevated: #f2f2f2;
    --text-primary: #000000;
    --text-secondary: #111111;
    --text-muted-accessible: #202020;
    --border-subtle: #202020;
    --border-strong: #000000;
    --action-primary: #004d27;
    --action-primary-hover: #00391d;
    --focus-ring: #005fcc;
    --focus-ring-offset: #ffffff;
}

[data-theme="dark"][data-high-contrast="true"] {
    --surface-page: #000000;
    --surface-card: #080808;
    --surface-elevated: #171717;
    --text-primary: #ffffff;
    --text-secondary: #ffffff;
    --text-muted-accessible: #f2f2f2;
    --border-subtle: #ffffff;
    --border-strong: #ffffff;
    --action-primary: #2b7440;
    --action-primary-hover: #286d3b;
    --focus-ring: #ffde59;
    --focus-ring-offset: #000000;
}

@media (prefers-color-scheme: dark) {
    html[data-theme="system"][data-high-contrast="true"] {
        --surface-page: #000000;
        --surface-card: #080808;
        --surface-elevated: #171717;
        --text-primary: #ffffff;
        --text-secondary: #ffffff;
        --text-muted-accessible: #f2f2f2;
        --border-subtle: #ffffff;
        --border-strong: #ffffff;
        --action-primary: #2b7440;
        --action-primary-hover: #286d3b;
        --focus-ring: #ffde59;
        --focus-ring-offset: #000000;
    }
}

[data-high-contrast="true"] :is(.admin-section, .role-workspace-card, .role-information-card,
    .settings-panel, .project-workspace, .project-list-row, .client-project-card, .client-project-toolbar,
    .client-project-hero, .client-project-details, .client-project-documents, .task-page, .task-detail,
    .project-tasks, input, textarea, select, button) { border-width: 2px; }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

@media (forced-colors: active) {
    body.staff-body :where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
        outline: 3px solid Highlight;
        outline-offset: 3px;
        forced-color-adjust: auto;
    }
    .task-status, .task-priority, .task-warning, .project-status,
    .client-project-status-pill, .client-project-hero__status, .app-feedback {
        border: 2px solid CanvasText;
        forced-color-adjust: auto;
    }
    #client-sidebar { border-right: 2px solid CanvasText; }
}

/* =========================================================
   RESPONSIVE APPLICATION SYSTEM
   One deliberate spacing and reflow model from desktop through phone.
========================================================= */

html[data-theme="light"],
html[data-theme="system"] {
    color-scheme: light;
    --surface-page: #fafafa;
    --surface-card: #ffffff;
    --surface-elevated: #f1f3f1;
    --surface-sidebar: #f1f3f1;
    --sidebar-text: #1b241e;
    --sidebar-muted: #4d5d52;
    --sidebar-border: #b7c1ba;
    --sidebar-hover: #e5eae6;
    --sidebar-selected-surface: #dcebe0;
    --sidebar-selected-text: #174f2b;
    --sidebar-focus: #075ea8;
    --sidebar-avatar-surface: #dcebe0;
    --sidebar-avatar-text: #174f2b;
    --sidebar-logo-filter: none;
}

.settings-page {
    width: min(100%, 960px);
    max-width: none;
    display: grid;
    gap: 1.5rem;
    margin: 1.75rem auto 0;
    padding: 0;
}

.settings-intro,
.settings-scroll {
    width: 100%;
    max-width: none;
    margin: 0;
}

.settings-intro h2 {
    max-width: 18ch;
    margin-top: 0.4rem;
    font-size: clamp(1.75rem, 4vw, 2.4rem);
    line-height: 1.12;
}

.settings-scroll { gap: 1.25rem; }
.settings-panel { min-width: 0; padding: clamp(1.35rem, 4vw, 2.25rem); }
.settings-panel-header { margin-bottom: 1.5rem; padding-bottom: 1.25rem; }
.settings-panel-header h2 { font-size: clamp(1.45rem, 3vw, 1.8rem); }
.settings-theme-fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
.settings-theme-fieldset legend { margin-bottom: 0.75rem; font-weight: 800; }
.settings-theme-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.75rem; }
.settings-theme-option {
    min-width: 0;
    min-height: 88px;
    display: grid;
    grid-template-columns: auto auto minmax(0, 1fr);
    align-items: center;
    gap: 0.7rem;
    padding: 0.8rem;
    color: var(--text-primary);
    background: var(--surface-card);
    border: 1px solid var(--border-strong);
    border-radius: 12px;
    cursor: pointer;
}
.settings-theme-option:has(input:checked) { border: 2px solid var(--brand-primary); background: var(--action-secondary-hover); }
.settings-theme-option input { width: 20px; height: 20px; min-height: 20px; margin: 0; accent-color: var(--brand-primary); }
.settings-theme-option__preview {
    width: 42px;
    height: 32px;
    display: block;
    overflow: hidden;
    background: linear-gradient(90deg, #123d25 0 32%, #f7f8f5 32% 100%);
    border: 1px solid var(--border-strong);
    border-radius: 6px;
    box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.35);
}
.settings-theme-option__preview--light { background: linear-gradient(90deg, #f1f3f1 0 32%, #ffffff 32% 100%); }
.settings-theme-option__preview--dark { background: linear-gradient(90deg, #101813 0 32%, #15201a 32% 100%); }
.settings-theme-option__preview--system {
    background: linear-gradient(135deg, #f1f3f1 0 25%, #ffffff 25% 50%, #101813 50% 66%, #15201a 66% 100%);
}
.settings-theme-option__copy { min-width: 0; display: grid; gap: 0.15rem; }
.settings-theme-option__copy strong,
.settings-theme-option__copy small { overflow-wrap: anywhere; }
.settings-theme-option__copy small { color: var(--text-secondary); font-size: 0.78rem; line-height: 1.3; }

.security-table-wrap,
.admin-table-wrap,
.archive-table-wrap { max-width: 100%; overflow-x: auto; overscroll-behavior-inline: contain; }
.security-table { min-width: 680px; }

@media (max-width: 700px) {
    body.staff-body { min-width: 0; }
    .staff-layout { width: 100%; display: block; }
    .staff-sidebar,
    .admin-dashboard .staff-sidebar,
    body:is(.project-manager-dashboard, .client-dashboard) .staff-sidebar,
    #client-sidebar {
        position: static;
        width: 100%;
        height: auto;
        min-height: 0;
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 0.85rem;
        padding: 1rem;
        overflow: visible;
        border-right: 0;
        border-bottom: 1px solid var(--border-subtle);
    }
    #client-sidebar .client-sidebar-content { width: 100%; display: flex; flex-direction: column; gap: 0.85rem; }
    .staff-logo,
    body:is(.project-manager-dashboard, .client-dashboard) .staff-logo {
        width: 100%;
        display: flex;
        justify-content: center;
        margin: 0;
        padding: 0 0 0.75rem;
        border-bottom: 1px solid currentColor;
    }
    .staff-logo img,
    body:is(.project-manager-dashboard, .client-dashboard) .staff-logo img {
        width: min(164px, 52vw);
        max-height: 84px;
        object-fit: contain;
        margin: 0 auto;
    }
    .role-sidebar-label { display: none; }
    .staff-nav,
    body:is(.project-manager-dashboard, .client-dashboard) .staff-nav {
        width: 100%;
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.5rem;
        padding: 0;
        border: 0;
    }
    .nav-item,
    body:is(.project-manager-dashboard, .client-dashboard) .nav-item {
        width: 100%;
        min-width: 0;
        min-height: 48px;
        justify-content: center;
        padding: 0.7rem;
        white-space: normal;
        text-align: center;
    }
    .sidebar-footer,
    .staff-profile {
        width: 100%;
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: center;
        gap: 0.75rem;
        margin: 0;
        padding: 0.85rem 0 0;
        border-top: 1px solid currentColor;
    }
    .sidebar-identity { min-width: 0; }
    .sidebar-account,
    .staff-profile-details { min-width: 0; display: grid; }
    .sidebar-account-name,
    .sidebar-account-login { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .sidebar-signout button { min-width: 104px; min-height: 48px; padding-inline: 0.75rem; }
    .staff-main { width: 100%; min-width: 0; padding: 1.25rem 1rem 2rem; }
    .staff-header { gap: 0.75rem; padding-bottom: 1rem; }
    .staff-header-copy { flex-basis: 100%; }
    .staff-header h1 { font-size: clamp(1.75rem, 9vw, 2.25rem); overflow-wrap: anywhere; }
    .header-actions { width: 100%; align-items: stretch; }
    .header-actions > *,
    .header-actions :is(a, button) { max-width: 100%; }
    .admin-section,
    .project-record,
    .task-page,
    .task-detail,
    .project-tasks { min-width: 0; padding-inline: 0; }
    .client-project-grid { grid-template-columns: minmax(0, 1fr); }
    .client-project-card { width: 100%; min-width: 0; }
    .client-project-card-cover { min-width: 0; }
    .project-workspace__hero,
    .client-project-hero { grid-template-columns: 1fr; flex-direction: column; }
    .project-section__heading,
    .project-section__actions,
    .project-page-actions { align-items: stretch; flex-direction: column; }
    .project-section__actions :is(a, button),
    .project-page-actions :is(a, button) { width: 100%; justify-content: center; }
    .project-document-breadcrumbs,
    .client-project-breadcrumb { overflow-wrap: anywhere; }
    .project-document-row { min-width: 0; }
    .task-card__actions,
    .task-status-form,
    .task-empty-team { align-items: stretch; flex-direction: column; }
    .task-card__actions :is(a, button, select),
    .task-status-form :is(button, select) { width: 100%; }
    .project-access-groups,
    .project-member-list,
    .security-summary-grid { grid-template-columns: minmax(0, 1fr); }
    .project-access-group,
    .project-member-card { min-width: 0; }
    .settings-page { width: 100%; gap: 1rem; margin-top: 1rem; }
    .settings-intro { padding-inline: 0; }
    .settings-intro h2 { max-width: none; font-size: clamp(1.7rem, 9vw, 2.15rem); }
    .settings-theme-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .settings-actions { align-items: stretch; }
    .settings-actions button { width: 100%; }
}

@media (max-width: 390px) {
    .staff-main { padding-inline: 0.875rem; }
    .staff-sidebar,
    .admin-dashboard .staff-sidebar,
    body:is(.project-manager-dashboard, .client-dashboard) .staff-sidebar,
    #client-sidebar { padding-inline: 0.875rem; }
    .staff-nav,
    body:is(.project-manager-dashboard, .client-dashboard) .staff-nav { grid-template-columns: 1fr; }
    .sidebar-footer,
    .staff-profile { grid-template-columns: 1fr; }
    .sidebar-signout,
    .sidebar-signout button { width: 100%; }
    .settings-panel { padding: 1rem; border-radius: 14px; }
    .settings-theme-grid { grid-template-columns: 1fr; }
    .settings-theme-option { min-height: 64px; }
    .settings-account-list div { grid-template-columns: 1fr; }
    .project-pagination { width: 100%; gap: 0.45rem; }
    .project-pagination .project-pagination__button { min-width: 0; flex: 1 1 0; padding-inline: 0.55rem; }
    .project-pagination__status { flex: 0 0 auto; }
}

/* =========================================================
   MULTI-THEME DESIGN SYSTEM V1
   Theme changes palette only. Every authenticated role shares this skin;
   role selectors continue to own navigation content and page structure.
========================================================= */

html[data-theme="aloa"] { color-scheme: light; }

body.staff-body {
    --background: var(--surface-page);
    --surface: var(--surface-card);
    --surface-muted: var(--surface-elevated);
    --white: var(--surface-card);
    --text-main: var(--text-primary);
    --text-muted: var(--text-muted-accessible);
    --border: var(--border-subtle);
    --green: var(--action-primary);
    --green-dark: var(--brand-primary-strong);
    --green-soft: var(--action-secondary-hover);
}

body.staff-body .staff-sidebar,
body.client-dashboard #client-sidebar {
    color: var(--sidebar-text);
    background: var(--surface-sidebar);
    border-color: var(--sidebar-border);
}

body.staff-body .staff-sidebar :is(.staff-logo, .sidebar-footer),
body.client-dashboard #client-sidebar :is(.staff-logo, .sidebar-footer) {
    border-color: var(--sidebar-border);
}

body.staff-body .staff-sidebar .client-logo-full,
body.staff-body #client-sidebar .client-logo-full {
    filter: var(--sidebar-logo-filter);
    opacity: 0.96;
}

body.staff-body .staff-sidebar .role-sidebar-label {
    color: var(--sidebar-muted);
    background: transparent;
    border-color: var(--sidebar-border);
}

body.staff-body .staff-sidebar .role-sidebar-label :is(span, strong),
body.staff-body #client-sidebar .role-sidebar-label > strong {
    color: var(--sidebar-muted);
}

body.staff-body .staff-sidebar .nav-item,
body.staff-body #client-sidebar .nav-item,
body.staff-body #client-sidebar .client-project-nav__item {
    color: var(--sidebar-text);
    opacity: 1;
}

body.staff-body .staff-sidebar .nav-item:hover,
body.staff-body #client-sidebar .nav-item:hover,
body.staff-body #client-sidebar .client-project-nav__item:hover {
    color: var(--sidebar-text);
    background: var(--sidebar-hover);
}

body.staff-body .staff-sidebar .nav-item.active,
body.staff-body #client-sidebar .nav-item.active,
body.staff-body #client-sidebar .client-project-nav__item.is-active {
    color: var(--sidebar-selected-text);
    background: var(--sidebar-selected-surface);
    border-color: var(--brand-accent);
}
body.staff-body #client-sidebar .client-project-nav__item.is-active span { color: inherit; }

body.staff-body .staff-sidebar :is(.nav-item, .staff-logo a, .sidebar-signout button):focus-visible,
body.staff-body #client-sidebar :is(.nav-item, .client-project-nav__item, .client-project-nav__toggle, .staff-logo a, .sidebar-signout button):focus-visible {
    outline-color: var(--sidebar-focus);
}

body.staff-body .staff-sidebar .sidebar-avatar,
body.staff-body #client-sidebar .sidebar-avatar {
    color: var(--sidebar-avatar-text);
    background: var(--sidebar-avatar-surface);
}

body.staff-body .staff-sidebar :is(.sidebar-account-name, .sidebar-signout button),
body.staff-body #client-sidebar :is(.sidebar-account-name, .sidebar-signout button) {
    color: var(--sidebar-text);
}

body.staff-body .staff-sidebar .sidebar-account-login,
body.staff-body #client-sidebar :is(.sidebar-account-login, .client-project-nav__item span, .client-project-nav__state, .client-project-nav__toggle, .client-project-nav__search-icon) {
    color: var(--sidebar-muted);
}

body.staff-body .staff-sidebar .sidebar-signout button:hover,
body.staff-body #client-sidebar .sidebar-signout button:hover {
    color: var(--sidebar-text);
    background: var(--sidebar-hover);
}

body.staff-body #client-sidebar .client-project-nav__search input {
    color: var(--sidebar-text);
    background: var(--sidebar-hover);
    border-color: var(--sidebar-border);
}

body.staff-body #client-sidebar .client-project-nav__search input::placeholder {
    color: var(--sidebar-muted);
    opacity: 1;
}

/* High Contrast strengthens the selected base theme; it is not a fifth theme. */
html[data-theme="aloa"][data-high-contrast="true"] {
    --surface-sidebar: #06351d;
    --sidebar-text: #ffffff;
    --sidebar-muted: #ffffff;
    --sidebar-border: #ffffff;
    --sidebar-hover: #145a31;
    --sidebar-selected-surface: #ffffff;
    --sidebar-selected-text: #000000;
    --sidebar-focus: #ffde59;
    --sidebar-avatar-surface: #ffffff;
    --sidebar-avatar-text: #000000;
}

html:is([data-theme="light"], [data-theme="system"])[data-high-contrast="true"] {
    --surface-page: #ffffff;
    --surface-card: #ffffff;
    --surface-elevated: #f2f2f2;
    --surface-sidebar: #ffffff;
    --text-primary: #000000;
    --text-secondary: #111111;
    --text-muted-accessible: #202020;
    --border-subtle: #202020;
    --border-strong: #000000;
    --sidebar-text: #000000;
    --sidebar-muted: #202020;
    --sidebar-border: #000000;
    --sidebar-hover: #e6e6e6;
    --sidebar-selected-surface: #dcebe0;
    --sidebar-selected-text: #000000;
    --sidebar-focus: #005fcc;
    --sidebar-avatar-surface: #dcebe0;
    --sidebar-avatar-text: #000000;
    --sidebar-logo-filter: none;
}

html[data-theme="system"] :is(.admin-secondary-button, .admin-text-button) {
    color: var(--brand-primary-strong);
}

html[data-theme="system"] :is(.role-header-label, .settings-kicker, .settings-panel-header > span, .client-project-eyebrow) {
    color: var(--brand-primary-strong);
}

html[data-theme="system"] :is(.client-project-card-heading a, .client-page-back a, .client-project-breadcrumb a, .project-link-list a) {
    color: var(--brand-primary-strong);
}

html[data-theme="dark"][data-high-contrast="true"] {
    --surface-sidebar: #000000;
    --sidebar-text: #ffffff;
    --sidebar-muted: #ffffff;
    --sidebar-border: #ffffff;
    --sidebar-hover: #202020;
    --sidebar-selected-surface: #173e24;
    --sidebar-selected-text: #ffffff;
    --sidebar-focus: #ffde59;
    --sidebar-avatar-surface: #ffffff;
    --sidebar-avatar-text: #000000;
}

@media (prefers-color-scheme: dark) {
    html[data-theme="system"] {
        color-scheme: dark;
        --surface-page: #0d1711;
        --surface-card: #15201a;
        --surface-elevated: #213028;
        --surface-sidebar: #101813;
        --text-primary: #f4f8f5;
        --text-secondary: #cad6cd;
        --text-muted-accessible: #b4c3b8;
        --border-subtle: #52685b;
        --border-strong: #647c6e;
        --action-primary: #377d4a;
        --action-primary-hover: #2f6f3e;
        --action-secondary-hover: #253a2c;
        --focus-ring: #8ecbff;
        --focus-ring-offset: #0d1711;
        --disabled-background: #28332c;
        --disabled-text: #aebbb2;
        --disabled-border: #647069;
        --sidebar-text: #f4f8f5;
        --sidebar-muted: #b4c3b8;
        --sidebar-border: #52685b;
        --sidebar-hover: #213028;
        --sidebar-selected-surface: #2a4032;
        --sidebar-selected-text: #f4f8f5;
        --sidebar-focus: #8ecbff;
        --sidebar-avatar-surface: #2a4032;
        --sidebar-avatar-text: #f4f8f5;
        --sidebar-logo-filter: grayscale(1) brightness(0) invert(1);
        --status-success-text: #b9f6cf;
        --status-success-surface: #123523;
        --status-success-border: #4c9368;
        --status-warning-text: #ffe19a;
        --status-warning-surface: #3a2e12;
        --status-warning-border: #a47c28;
        --status-danger-text: #ffc9c5;
        --status-danger-surface: #461b18;
        --status-danger-border: #a45e59;
        --status-info-text: #c2e1ff;
        --status-info-surface: #17324a;
        --status-info-border: #5e8eb5;
    }

    html[data-theme="system"] :is(.admin-secondary-button, .admin-text-button,
        .role-header-label, .settings-kicker, .settings-panel-header > span, .client-project-eyebrow,
        .client-project-card-heading a, .client-page-back a, .client-project-breadcrumb a, .project-link-list a) {
        color: var(--text-primary);
    }

    html[data-theme="system"][data-high-contrast="true"] {
        --surface-page: #000000;
        --surface-card: #080808;
        --surface-elevated: #171717;
        --surface-sidebar: #000000;
        --text-primary: #ffffff;
        --text-secondary: #ffffff;
        --text-muted-accessible: #f2f2f2;
        --border-subtle: #ffffff;
        --border-strong: #ffffff;
        --sidebar-text: #ffffff;
        --sidebar-muted: #ffffff;
        --sidebar-border: #ffffff;
        --sidebar-hover: #202020;
        --sidebar-selected-surface: #173e24;
        --sidebar-selected-text: #ffffff;
        --sidebar-focus: #ffde59;
        --sidebar-avatar-surface: #ffffff;
        --sidebar-avatar-text: #000000;
        --sidebar-logo-filter: grayscale(1) brightness(0) invert(1);
    }
}

/* =========================================================
   RESPONSIVE UI RELIABILITY V1
   The approved UI is unchanged. This final layer owns shell geometry and
   continuous reflow; legacy breakpoint rules above remain compatibility-only.
========================================================= */

:root {
    --sidebar-width: clamp(248px, 18vw, 276px);
    --content-max-width: 1600px;
    --page-gutter: clamp(1rem, 2.4vw, 2.5rem);
    --section-gap: clamp(1rem, 2vw, 1.5rem);
    --card-gap: clamp(0.8rem, 1.5vw, 1.25rem);
    --control-height: 44px;
    --mobile-bar-height: 64px;
}

html { min-width: 0; }
body.staff-body { min-width: 0; overflow-x: clip; }
.mobile-app-bar,
.mobile-nav-backdrop,
.mobile-nav-close { display: none; }

.staff-layout {
    width: 100%;
    min-width: 0;
    min-height: 100vh;
    min-height: 100dvh;
    display: grid;
    grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
    align-items: start;
}

.staff-sidebar,
.admin-dashboard .staff-sidebar,
body:is(.project-manager-dashboard, .client-dashboard) .staff-sidebar,
body.client-dashboard #client-sidebar {
    position: sticky;
    inset-block-start: 0;
    width: 100%;
    height: 100vh;
    height: 100dvh;
    min-height: 0;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    padding: clamp(0.8rem, 1.4vw, 1.35rem);
    overflow: hidden;
    border-right: 1px solid var(--sidebar-border);
    border-bottom: 0;
}

.client-dashboard .client-sidebar-content {
    width: 100%;
    min-height: 0;
    display: flex;
    flex: 1;
    flex-direction: column;
}

.staff-sidebar .staff-logo {
    flex: 0 0 auto;
    margin: 0 0 1rem;
    padding: 0 0 1rem;
}

.staff-sidebar .staff-logo img {
    width: min(188px, 82%);
    max-height: 96px;
    height: auto;
    object-fit: contain;
}

body.client-dashboard #client-sidebar .staff-logo a {
    width: min(180px, 92%);
    max-width: 100%;
}

body.client-dashboard #client-sidebar .staff-logo img {
    width: 100%;
    max-width: 100%;
    max-height: 120px;
    height: auto;
    margin-inline: auto;
    object-fit: contain;
}

.staff-sidebar .role-sidebar-label { flex: 0 0 auto; }
.sidebar-project-search {
    position: relative;
    flex: 0 0 auto;
    width: 100%;
    min-width: 0;
    margin: 0 0 0.5rem;
}
.sidebar-project-search__icon {
    position: absolute;
    inset-block-start: 50%;
    inset-inline-start: 0.65rem;
    width: 1rem;
    height: 1rem;
    display: grid;
    place-items: center;
    color: var(--sidebar-muted);
    transform: translateY(-50%);
    pointer-events: none;
}
.sidebar-project-search__icon svg {
    width: 100%;
    height: 100%;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
}
.sidebar-project-search input {
    width: 100%;
    min-width: 0;
    min-height: var(--control-height);
    padding: 0.5rem 0.65rem 0.5rem 2rem;
    color: var(--sidebar-text);
    background: var(--sidebar-hover);
    border: 1px solid var(--sidebar-border);
    border-radius: 0.5rem;
}
.sidebar-project-search input::placeholder { color: var(--sidebar-muted); opacity: 1; }
.sidebar-project-search input:focus-visible {
    border-color: var(--sidebar-focus);
    outline: 3px solid var(--sidebar-focus);
    outline-offset: 2px;
    box-shadow: none;
}
.client-project-nav > .client-project-nav__search { margin: 0 2px 0.5rem; }
.client-project-nav__search input:disabled { cursor: not-allowed; }

/* Compact Project + Settings Experience V1 */
.staff-project-workspace-page .staff-header { display: none; }
.staff-project-workspace-page .staff-main { padding: clamp(16px, 2vw, 26px); }
.project-detail-workspace {
    width: min(100%, 1180px);
    min-width: 0;
    display: grid;
    gap: 12px;
    margin-inline: auto;
}
.project-detail-workspace .project-record {
    width: 100%;
    display: grid;
    gap: 12px;
    padding: 0;
}
.project-summary-card {
    min-width: 0;
    min-height: 176px;
    display: grid;
    grid-template-columns: minmax(250px, 36%) minmax(0, 1fr);
    align-items: stretch;
    gap: clamp(16px, 2.4vw, 28px);
    padding: 12px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 6px 20px rgba(19, 55, 31, 0.05);
}
.project-summary-card__cover {
    min-height: 152px;
    aspect-ratio: auto;
}
.project-summary-card__copy {
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 8px;
    padding-block: 4px;
}
.project-summary-card__title-row,
.project-summary-card__footer {
    min-width: 0;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px 16px;
}
.project-summary-card__title-row > div { min-width: 0; flex: 1 1 320px; }
.project-summary-card__copy h1 {
    margin: 0;
    overflow-wrap: anywhere;
    color: var(--text-main);
    font-size: clamp(1.55rem, 3vw, 2.25rem);
    line-height: 1.08;
}
.project-summary-card__footer { align-items: center; margin-top: auto; }
.project-summary-card .client-project-hero__updated { margin: 0; }
.project-summary-actions {
    min-width: 0;
    display: flex;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 7px;
}
.project-summary-actions :is(a, button) { min-height: 44px; padding: 8px 11px; }
.project-summary-grid {
    min-width: 0;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    align-items: start;
    background: transparent;
    border: 0;
}
.project-summary-panel,
.client-project-details > .client-project-panel {
    min-width: 0;
    height: auto;
    padding: 13px 14px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
}
.project-summary-grid .project-section + .project-section,
.client-project-details > .client-project-panel + .client-project-panel { border-top: 1px solid var(--border); }
.project-summary-panel .project-section__heading { margin-bottom: 0.65rem; }
.project-summary-panel .project-section__heading h2,
.client-project-panel h2 { font-size: 0.96rem; }
.project-summary-panel :is(.project-update-card, .project-link-list > li, .project-info-item) { padding: 0.65rem 0; }
.project-summary-panel .project-empty-note { padding: 0.2rem 0; font-size: 0.8rem; line-height: 1.45; }
.project-workspace { gap: 12px; }
.project-workspace > .project-overview {
    padding: 13px 14px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
}
.project-workspace > .project-overview .project-metadata-list { margin-top: 0.75rem; }
.project-detail-workspace > .project-record > .project-section,
.project-detail-workspace > .project-record > .project-tasks {
    margin: 0;
    padding: 14px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
}
.project-detail-workspace .project-section__heading { margin-bottom: 0.7rem; }
.project-detail-workspace .project-section__heading p { margin-top: 0.2rem; }
.project-detail-workspace .project-team-section { order: 10; }
.project-documents .project-document-row { min-height: 44px; }
.project-document-breadcrumbs { padding-block: 0.2rem; }

.settings-page {
    width: min(100%, 1180px);
    gap: 12px;
    margin: 0 auto;
}
.settings-scroll {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(300px, 0.85fr);
    grid-auto-flow: column;
    grid-template-rows: repeat(3, auto);
    gap: 12px;
    align-items: start;
}
.settings-panel {
    min-width: 0;
    padding: 16px;
    border-radius: 12px;
    box-shadow: 0 6px 20px rgba(19, 55, 31, 0.05);
}
.settings-panel#appearance { grid-row: 1 / span 3; }
.settings-panel-header { margin-bottom: 12px; padding-bottom: 10px; }
.settings-panel-header h2 { margin: 3px 0; font-size: 1.2rem; }
.settings-panel-header p { font-size: 0.82rem; line-height: 1.4; }
.settings-form { gap: 14px; }
.settings-theme-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.settings-theme-option { min-height: 68px; gap: 8px; padding: 9px; border-radius: 9px; }
.settings-theme-option__preview { width: 34px; height: 26px; }
.settings-theme-option__copy small { font-size: 0.7rem; }
.settings-theme-fieldset legend { margin-bottom: 7px; font-size: 0.82rem; }
.settings-actions { padding-top: 10px; }
.settings-actions button { min-width: 0; min-height: 44px; }
.settings-grid select { min-height: 44px; }
.settings-grid small,
.settings-help { margin-top: 5px; font-size: 0.76rem; line-height: 1.35; }
.settings-account-list { margin-bottom: 8px; }
.settings-account-list div { grid-template-columns: 110px minmax(0, 1fr); gap: 10px; padding: 8px 0; }
.settings-account-list dt { font-size: 0.68rem; }
.settings-account-list dd { font-size: 0.8rem; }
.settings-reset { align-items: flex-start; flex-direction: column; gap: 10px; padding: 10px; }
.settings-reset label { font-size: 0.8rem; }
.settings-notice { margin-bottom: 0; }

@media (max-width: 1024px) {
    .project-summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .project-summary-grid > :last-child:nth-child(odd) { grid-column: 1 / -1; }
    .settings-scroll { grid-template-columns: 1fr; grid-auto-flow: row; grid-template-rows: none; }
    .settings-panel#appearance { grid-row: auto; }
}

@media (max-width: 767px) {
    .project-summary-card { min-height: 0; grid-template-columns: 1fr; gap: 12px; }
    .project-summary-card__cover { min-height: 0; aspect-ratio: 16 / 6; }
    .project-summary-actions { width: 100%; justify-content: flex-start; }
    .project-summary-grid { grid-template-columns: 1fr; }
    .project-summary-grid > :last-child:nth-child(odd) { grid-column: auto; }
    .project-summary-panel,
    .client-project-details > .client-project-panel { padding: 13px; }
}

@media (max-width: 480px) {
    .project-summary-card__title-row { display: grid; }
    .project-summary-actions :is(a, button) { flex: 1 1 130px; }
    .settings-theme-grid { grid-template-columns: 1fr; }
    .settings-panel { padding: 14px; }
    .settings-account-list div { grid-template-columns: 1fr; gap: 3px; }
}
.staff-sidebar .staff-nav {
    min-width: 0;
    min-height: 0;
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    flex-wrap: nowrap;
    gap: 0.35rem;
    padding: 0;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
}
.staff-sidebar .nav-item { width: 100%; min-width: 0; flex: 0 0 auto; }
.staff-sidebar .nav-item-label,
.staff-sidebar .nav-item > span:last-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.staff-sidebar .sidebar-footer { flex: 0 0 auto; }

.staff-main {
    width: min(100%, var(--content-max-width));
    min-width: 0;
    margin-inline: auto;
    padding: var(--page-gutter);
}

.staff-header,
.header-actions,
.staff-main > *,
.admin-section,
.project-record,
.project-workspace,
.project-section,
.task-page,
.task-detail,
.project-tasks,
.settings-page { min-width: 0; }

.client-projects-page,
.client-project-list-page .staff-header { width: min(100%, 1440px); }
.client-project-list-page .staff-main,
.client-project-workspace-page .staff-main { padding: var(--page-gutter); }
.client-project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(0, min(100%, 350px)));
    align-items: stretch;
    justify-content: start;
}
body.staff-body .client-project-grid { gap: var(--card-gap); }
.client-project-card { width: 100%; max-width: 480px; }
.client-project-card:only-child { width: min(100%, 480px); }

:where(input, select, textarea, button) { max-width: 100%; }
:where(.project-inline-form, .task-editor, .settings-grid, .settings-theme-grid,
    .project-team-directory-grid, .security-summary-grid) > * { min-width: 0; }
.task-project-results,
.project-member-search-results { max-width: 100%; }
.task-project-result > div,
.task-create-context > div { min-width: 0; overflow-wrap: anywhere; }

.security-table-wrap,
.admin-table-wrap,
.archive-table-wrap,
.client-document-table {
    max-width: 100%;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    scrollbar-gutter: stable;
    -webkit-overflow-scrolling: touch;
}
.project-document-row :is(strong, span),
.archive-explorer-name { min-width: 0; overflow-wrap: anywhere; }

@media (max-width: 960px) {
    .settings-theme-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .project-cover-editor-layout,
    .project-inline-form,
    .task-editor { grid-template-columns: minmax(0, 1fr); }
    .project-field--wide,
    .project-visibility-control,
    .project-inline-form .project-form-actions,
    .task-editor h3,
    .task-editor__wide { grid-column: auto; }
    .task-detail dl { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 767px), (max-height: 500px) and (max-width: 900px) {
    body.staff-body { padding-top: var(--mobile-bar-height); }
    body.staff-body.mobile-nav-open { overflow: hidden; }

    .mobile-app-bar {
        position: fixed;
        inset: 0 0 auto;
        z-index: 110;
        min-height: var(--mobile-bar-height);
        display: grid;
        grid-template-columns: 48px minmax(0, 1fr) 40px;
        align-items: center;
        gap: 0.75rem;
        padding: max(0.5rem, env(safe-area-inset-top)) max(0.75rem, env(safe-area-inset-right)) 0.5rem max(0.75rem, env(safe-area-inset-left));
        color: var(--sidebar-text);
        background: var(--surface-sidebar);
        border-bottom: 1px solid var(--sidebar-border);
    }
    .mobile-nav-toggle,
    .mobile-nav-close {
        width: 48px;
        height: 48px;
        min-height: 48px;
        place-items: center;
        padding: 0;
        color: var(--sidebar-text);
        background: transparent;
        border: 1px solid var(--sidebar-border);
        border-radius: 9px;
        cursor: pointer;
    }
    .mobile-nav-toggle { display: grid; }
    .mobile-nav-toggle > span,
    .mobile-nav-toggle > span::before,
    .mobile-nav-toggle > span::after {
        width: 22px;
        height: 2px;
        display: block;
        content: "";
        background: currentColor;
        border-radius: 2px;
    }
    .mobile-nav-toggle > span { position: relative; }
    .mobile-nav-toggle > span::before { position: absolute; inset: -7px 0 auto; }
    .mobile-nav-toggle > span::after { position: absolute; inset: 7px 0 auto; }
    .mobile-app-brand {
        min-width: 0;
        color: var(--sidebar-text);
        font-size: 1rem;
        font-weight: 850;
        letter-spacing: 0.08em;
        text-align: center;
        text-decoration: none;
    }
    .mobile-app-avatar {
        width: 40px;
        height: 40px;
        display: grid;
        place-items: center;
        color: var(--sidebar-avatar-text);
        background: var(--sidebar-avatar-surface);
        border-radius: 50%;
        font-size: 0.72rem;
        font-weight: 800;
    }
    .mobile-nav-backdrop {
        position: fixed;
        inset: var(--mobile-bar-height) 0 0;
        z-index: 120;
        width: 100%;
        display: block;
        padding: 0;
        background: rgba(0, 0, 0, 0.5);
        border: 0;
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transition: opacity 160ms ease, visibility 0s;
    }
    .staff-layout { width: 100%; min-height: calc(100dvh - var(--mobile-bar-height)); display: block; }
    .staff-sidebar,
    .admin-dashboard .staff-sidebar,
    body:is(.project-manager-dashboard, .client-dashboard) .staff-sidebar,
    body.client-dashboard #client-sidebar {
        position: fixed;
        inset: var(--mobile-bar-height) auto 0 0;
        z-index: 130;
        width: min(88vw, 350px);
        height: calc(100vh - var(--mobile-bar-height));
        height: calc(100dvh - var(--mobile-bar-height));
        min-height: 0;
        display: flex;
        flex-direction: column;
        gap: 0;
        padding: 1rem max(1rem, env(safe-area-inset-right)) max(1rem, env(safe-area-inset-bottom)) max(1rem, env(safe-area-inset-left));
        overflow: hidden;
        border-right: 1px solid var(--sidebar-border);
        border-bottom: 0;
        transform: translateX(-105%);
        visibility: hidden;
        transition: transform 180ms ease, visibility 0s;
    }
    .mobile-nav-close {
        position: absolute;
        top: 0.75rem;
        right: 0.75rem;
        z-index: 1;
        display: grid;
        font-size: 1.75rem;
        line-height: 1;
    }
    .staff-sidebar .staff-logo {
        width: 100%;
        justify-content: flex-start;
        margin: 0 0 0.75rem;
        padding: 0 3.5rem 0.75rem 0;
        border-bottom: 1px solid var(--sidebar-border);
    }
    .staff-sidebar .staff-logo img { width: clamp(132px, 44vw, 170px); max-height: 76px; margin: 0; }
    body.client-dashboard #client-sidebar .staff-logo {
        justify-content: center;
        padding: 0 3.5rem 0.75rem;
    }
    body.client-dashboard #client-sidebar .staff-logo a { width: min(170px, 100%); }
    body.client-dashboard #client-sidebar .staff-logo img {
        width: 100%;
        max-height: none;
        height: auto;
        margin-inline: auto;
    }
    body.staff-body .staff-sidebar .role-sidebar-label { display: block; margin-bottom: 0.75rem; }
    .staff-sidebar .staff-nav,
    body:is(.project-manager-dashboard, .client-dashboard) .staff-nav {
        width: 100%;
        min-height: 0;
        display: flex;
        flex: 1 1 auto;
        flex-direction: column;
        flex-wrap: nowrap;
        align-items: stretch;
        gap: 0.35rem;
        padding: 0;
        overflow-x: hidden;
        overflow-y: auto;
        border: 0;
    }
    .staff-sidebar .nav-item,
    body:is(.project-manager-dashboard, .client-dashboard) .nav-item {
        width: 100%;
        min-width: 0;
        min-height: 48px;
        flex: 0 0 auto;
        justify-content: flex-start;
        padding: 0.7rem 0.8rem;
        white-space: normal;
        text-align: left;
    }
    .staff-sidebar .sidebar-footer,
    .staff-sidebar .staff-profile {
        width: 100%;
        min-width: 0;
        display: block;
        flex: 0 0 auto;
        margin: 0.75rem 0 0;
        padding: 0.75rem 0 0;
        border-top: 1px solid var(--sidebar-border);
    }
    .sidebar-identity { grid-template-columns: 40px minmax(0, 1fr); padding-inline: 0.25rem; }
    .sidebar-account { display: grid; }
    .sidebar-signout { width: 100%; margin-top: 0.5rem; }
    .sidebar-signout button { width: 100%; min-height: 48px; }
    body.staff-body.mobile-nav-open .staff-sidebar,
    body.staff-body.client-dashboard.mobile-nav-open #client-sidebar { transform: translateX(0); visibility: visible; transition-delay: 0s; }
    body.staff-body.mobile-nav-open .mobile-nav-backdrop { opacity: 1; visibility: visible; pointer-events: auto; transition-delay: 0s; }

    .staff-main { width: 100%; max-width: none; margin: 0; padding: var(--page-gutter); }
    .staff-header { align-items: stretch; gap: 0.85rem; padding-bottom: 1rem; }
    .staff-header-copy { flex-basis: 100%; }
    .staff-header h1 { font-size: clamp(1.75rem, 8vw, 2.25rem); overflow-wrap: anywhere; }
    .header-actions { width: 100%; justify-content: flex-start; }
    .header-actions > * { max-width: 100%; }

    .client-project-workspace-page .staff-header { display: none; }
    .client-project-toolbar,
    .project-list-toolbar { align-items: stretch; flex-direction: column; }
    .client-project-search,
    .project-list-search { width: 100%; }
    .client-project-sort { min-width: 0; justify-content: space-between; white-space: normal; }
    .client-project-sort select { min-width: 0; flex: 1; }
    .client-project-grid { grid-template-columns: minmax(0, 1fr); }
    .client-project-card { width: 100%; max-width: none; flex-basis: 100%; }
    .project-workspace__hero,
    .client-project-hero { grid-template-columns: minmax(0, 1fr); }
    .project-detail-cover,
    .client-project-hero__cover { height: auto; min-height: 0; aspect-ratio: 16 / 7; }
    .project-record { padding: clamp(0.9rem, 4vw, 1.25rem); }
    .project-section__heading,
    .project-page-actions { align-items: stretch; flex-direction: column; }
    .project-section__actions { justify-content: flex-start; }
    .project-section__actions :is(a, button),
    .project-page-actions :is(a, button) { max-width: 100%; }

    .task-page,
    .task-detail,
    .project-tasks { padding: clamp(0.9rem, 4vw, 1.25rem); }
    .task-card,
    .task-card__actions,
    .task-status-form,
    .task-project-picker__controls,
    .task-project-result,
    .task-create-context,
    .task-empty-team { align-items: stretch; flex-direction: column; }
    .task-card__actions :is(a, button, select),
    .task-status-form :is(button, select) { width: 100%; }
    .task-detail dl { grid-template-columns: minmax(0, 1fr); }

    .project-access-groups,
    .security-summary-grid { grid-template-columns: minmax(0, 1fr); }
    .project-access-group { padding: clamp(0.9rem, 4vw, 1.25rem); }
    .project-access-search-row { align-items: stretch; flex-direction: column; }
    .project-member-row,
    .project-member-result { align-items: flex-start; flex-wrap: wrap; }

    .settings-page { width: 100%; gap: 1rem; margin-top: 1rem; }
    .settings-panel { padding: clamp(1rem, 4vw, 1.35rem); }
    .settings-actions { align-items: stretch; }
    .settings-actions button { width: 100%; }
}

@media (max-width: 480px) {
    :root { --page-gutter: clamp(0.875rem, 4vw, 1rem); }
    .mobile-app-bar { grid-template-columns: 48px minmax(0, 1fr) 36px; }
    .mobile-app-avatar { width: 36px; height: 36px; }
    .settings-theme-grid { grid-template-columns: minmax(0, 1fr); }
    .client-project-sort { flex-direction: column; }
    .project-access-group__header,
    .project-cover-remove-form { align-items: stretch; flex-direction: column; }
    .project-pagination {
        width: 100%;
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.5rem;
    }
    .project-pagination__status { grid-column: 1 / -1; grid-row: 2; }
    .project-pagination .project-pagination__button { width: 100%; min-width: 0; }
}

@media (prefers-reduced-motion: reduce) {
    .staff-sidebar,
    .mobile-nav-backdrop { transition: none; }
}

@media (forced-colors: active) and (max-width: 767px),
    (forced-colors: active) and (max-height: 500px) and (max-width: 900px) {
    .mobile-app-bar,
    .staff-sidebar { border-color: CanvasText; }
    .mobile-nav-backdrop { background: Canvas; opacity: 0.7; }
}

/* Client Settings: four balanced cards with compact, accessible theme choices. */
.client-settings-page .staff-main { padding-block: 20px; }
.client-settings-page .staff-header { padding-bottom: 14px; }
.client-settings-page .role-header-label { display: none; }
.client-settings-page .staff-header h1 { font-size: 1.8rem; }
.client-settings-page .staff-header-copy > p:last-child { margin-top: 6px; font-size: 0.875rem; line-height: 1.4; }
.client-settings-page .app-feedback-stack { margin-bottom: 12px; }
.client-settings-page .app-feedback { padding-block: 9px; font-size: 0.875rem; }
.client-settings-page .settings-page { width: min(100%, 1180px); margin: 0 auto; }
.client-settings-page .settings-scroll {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: auto auto;
    grid-auto-flow: row;
    gap: 14px;
    align-items: stretch;
}
.client-settings-page .settings-panel {
    display: flex;
    flex-direction: column;
    padding: 16px 18px;
    border-radius: 14px;
}
.client-settings-page .settings-panel#appearance { grid-row: auto; }
.client-settings-page .settings-panel-header { margin-bottom: 12px; padding-bottom: 10px; }
.client-settings-page .settings-panel-header > span { display: none; }
.client-settings-page .settings-panel-header h2 { margin: 0 0 4px; font-size: 1.15rem; line-height: 1.25; }
.client-settings-page .settings-panel-header p { font-size: 0.8rem; }
.client-settings-page .settings-form { display: flex; flex: 1; flex-direction: column; gap: 12px; }
.client-settings-page .settings-theme-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.client-settings-page .settings-theme-option {
    grid-template-columns: auto minmax(0, 1fr) auto;
    min-height: 64px;
    gap: 8px;
    margin: 0;
    padding: 9px;
    border: 1px solid var(--border-strong);
    border-radius: 10px;
    font-family: inherit;
    background: var(--surface-card);
    transition: border-color 120ms ease, background-color 120ms ease;
}
.client-settings-page .settings-theme-option:hover { background: var(--surface-elevated); }
.client-settings-page .settings-theme-option:has(input:checked) {
    border-color: var(--brand-primary);
    box-shadow: inset 0 0 0 1px var(--brand-primary);
    background: var(--action-secondary-hover);
}
.client-settings-page .settings-theme-option:has(input:focus-visible) {
    outline: 2px solid var(--focus-ring);
    outline-offset: 3px;
}
.client-settings-page .settings-theme-option input {
    grid-column: 3;
    grid-row: 1;
    width: 16px;
    height: 16px;
    min-width: 16px;
    min-height: 16px;
    margin: 0;
    padding: 0;
    box-shadow: none;
}
.client-settings-page .settings-theme-option input:focus-visible { outline: none; }
.client-settings-page .settings-theme-option__preview {
    grid-column: 1;
    grid-row: 1;
    position: relative;
    width: 44px;
    height: 38px;
    border-radius: 6px;
    box-shadow: none;
}
.client-settings-page .settings-theme-option__preview::before,
.client-settings-page .settings-theme-option__preview::after {
    content: "";
    position: absolute;
    left: 43%;
    right: 10%;
    border-radius: 2px;
    background: #9bada2;
}
.client-settings-page .settings-theme-option__preview::before { top: 20%; height: 10%; }
.client-settings-page .settings-theme-option__preview::after { top: 43%; height: 37%; opacity: 0.5; }
.client-settings-page .settings-theme-option__copy { grid-column: 2; grid-row: 1; gap: 3px; }
.client-settings-page .settings-theme-option__copy strong { font-size: 0.86rem; font-weight: 700; }
.client-settings-page .settings-theme-option__copy small { font-size: 0.7rem; font-weight: 400; line-height: 1.35; }
.client-settings-page .settings-actions { margin-top: auto; padding-top: 10px; }
.client-settings-page .settings-actions button { padding-inline: 16px; font-size: 0.82rem; }
.client-settings-page .settings-grid-single { max-width: none; }
.client-settings-page .settings-grid label > span { margin-bottom: 7px; }
.client-settings-page .settings-grid small { font-weight: 400; }
.client-settings-page .settings-account-list { margin: 0; }
.client-settings-page .settings-account-list div { padding: 6px 0; }
.client-settings-page .settings-account-list div:last-child { border-bottom: 0; }
.client-settings-page .settings-account-list dt { text-transform: none; letter-spacing: 0; font-size: 0.76rem; }
.client-settings-page .settings-account-list dd { font-weight: 600; }
.client-settings-page .settings-reset-hint { margin: 0 0 14px; color: var(--text-secondary); font-size: 0.82rem; line-height: 1.5; }
.client-settings-page .settings-reset {
    align-items: flex-end;
    margin-top: auto;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
}
.client-settings-page .settings-reset button { min-height: 44px; padding-inline: 16px; font-size: 0.82rem; }
@media (max-width: 1100px) and (min-width: 1000px) {
    .client-settings-page .settings-panel { padding-inline: 14px; }
    .client-settings-page .settings-theme-option { gap: 6px; padding: 8px; }
    .client-settings-page .settings-theme-option__preview { width: 32px; height: 34px; }
}
@media (max-width: 999px) {
    .client-settings-page .settings-scroll { grid-template-columns: minmax(0, 1fr); grid-template-rows: none; }
}
@media (max-width: 480px) {
    .client-settings-page .settings-panel { padding: 14px; }
    .client-settings-page .settings-theme-option { grid-template-columns: minmax(0, 1fr) auto; gap: 6px; }
    .client-settings-page .settings-theme-option__preview { width: 100%; height: 46px; grid-column: 1 / -1; }
    .client-settings-page .settings-theme-option__copy { grid-column: 1; grid-row: 2; }
    .client-settings-page .settings-theme-option input { grid-column: 2; grid-row: 2; }
    .client-settings-page .settings-reset button { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
    .client-settings-page .settings-theme-option { transition: none; }
}
@media (forced-colors: active) {
    .client-settings-page .settings-theme-option:has(input:checked) { border: 2px solid Highlight; }
}

/* Shared, read-only schedule view. All date geometry is generated from saved dates. */
.timeline-section { background:var(--surface-card); color:var(--text-primary); border:1px solid var(--border-subtle); border-radius:8px; padding:16px; min-width:0; margin-block:12px; }
.timeline-section-heading, .schedule-toolbar { display:flex; align-items:center; justify-content:flex-start; gap:10px; flex-wrap:wrap; }
.timeline-section-heading h2, .schedule-toolbar h3 { margin:0; font-size:1.05rem; }
.timeline-section-heading > a { margin-left:auto; }
.timeline-section-heading p { color:var(--text-secondary); margin:6px 0; }
.timeline-muted { color:var(--text-secondary); font-size:.85rem; line-height:1.5; }
.schedule-summary { display:grid; grid-template-columns:minmax(0,1.5fr) minmax(0,1fr) minmax(0,.7fr); gap:12px; padding:8px 0; }
.schedule-summary > div { min-width:0; }
.schedule-summary > div { flex:1 1 180px; }
.schedule-summary strong { display:block; font-size:.9rem; margin-top:3px; line-height:1.5; overflow-wrap:anywhere; }
.schedule-summary p { margin:6px 0 0; font-size:.82rem; }
.schedule-eyebrow { display:block; color:var(--text-secondary); font-size:.75rem; font-weight:500; }
.schedule-summary .schedule-percentage { font-size:1.4rem; font-weight:700; margin-top:3px; }
.schedule-percentage span { font-size:1rem; }
.project-timeline progress { display:block; width:100%; max-width:230px; height:7px; border:0; border-radius:8px; background:var(--border-subtle); color:var(--schedule-green); accent-color:var(--schedule-green); overflow:hidden; }
.project-timeline progress::-webkit-progress-bar { background:var(--border-subtle); }
.project-timeline progress::-webkit-progress-value { background:var(--schedule-green); border-radius:8px; }
.project-timeline progress::-moz-progress-bar { background:var(--schedule-green); }
/* One shared phase journey; source schedules are never displayed as a grid. */
.project-timeline { min-width:0; position:relative; --schedule-green:var(--status-success-text); }
.phase-state--green { --phase-color:var(--status-success-text); --phase-surface:var(--status-success-surface); }
.phase-state--yellow { --phase-color:var(--status-warning-text); --phase-surface:var(--status-warning-surface); }
.phase-state--red { --phase-color:var(--status-danger-text); --phase-surface:var(--status-danger-surface); }
.phase-journey-scroll { overflow-x:auto; padding:8px 4px 12px; }
.phase-journey { display:flex; list-style:none; margin:0; padding:8px 0 0; min-width:100%; }
.phase-stop { flex:1 0 120px; min-width:0; position:relative; text-align:center; }
.phase-stop:after { content:""; position:absolute; top:20px; left:50%; width:100%; height:2px; background:var(--border-strong); }
.phase-stop:last-child:after { display:none; }
.phase-stop.is-connected:after { background:var(--status-success-text); }
.phase-trigger { position:relative; z-index:1; width:100%; display:flex; flex-direction:column; align-items:center; gap:10px; padding:0 8px 8px; min-height:44px; border:0; background:transparent; color:var(--text-primary); font:inherit; cursor:pointer; text-align:center; list-style:none; }
.phase-trigger::-webkit-details-marker { display:none; }
.project-timeline .phase-trigger:is(:hover,:focus-visible,:active) { background:transparent; color:var(--text-primary); transform:none; }
.project-timeline .phase-close:is(:hover,:focus-visible,:active) { background:var(--surface-muted); color:var(--text-primary); }
.phase-orb { display:grid; place-items:center; box-sizing:border-box; width:40px; height:40px; flex-shrink:0; border:2px solid var(--phase-color); border-radius:50%; background:var(--phase-surface); color:var(--phase-color); font-size:22px; font-weight:750; box-shadow:0 0 0 4px var(--surface-card); }
.phase-state--green .phase-orb { background:var(--phase-color); color:var(--phase-surface); }
.phase-trigger:hover .phase-orb, .is-selected .phase-orb { outline:2px solid var(--phase-color); outline-offset:5px; }
.phase-label { display:flex; flex-direction:column; align-items:center; gap:5px; min-width:0; width:100%; }
.phase-label strong { font-size:.84rem; line-height:1.4; min-height:2.8em; overflow-wrap:anywhere; display:-webkit-box; -webkit-line-clamp:3; -webkit-box-orient:vertical; overflow:hidden; }
.phase-label > span, .phase-label small { color:var(--text-secondary); font-size:.78rem; line-height:1.5; }
.phase-label small { font-weight:600; padding:3px 9px; border-radius:5px; color:var(--phase-color); background:var(--phase-surface); }
.phase-detail { position:relative; z-index:5; text-align:left; padding:18px; border:1px solid var(--border-strong); border-top:3px solid var(--phase-color); border-radius:12px; background:var(--surface-card); color:var(--text-primary); font-size:.86rem; line-height:1.5; overflow-wrap:anywhere; }
[data-enhanced] .phase-detail { position:fixed; z-index:100; width:360px; max-width:calc(100vw - 24px); max-height:min(540px,65vh); overflow:auto; box-shadow:0 12px 36px #0003; }
.phase-detail header { display:flex; gap:12px; align-items:flex-start; justify-content:space-between; }
.phase-detail h3 { font-size:1rem; margin:0; line-height:1.5; }
.phase-detail p { margin:8px 0; }
.phase-close { display:grid; place-items:center; flex-shrink:0; width:44px; height:44px; border:1px solid var(--border-subtle); border-radius:8px; background:var(--surface-card); color:var(--text-primary); font:inherit; font-size:1.5rem; cursor:pointer; }
.phase-state-label { color:var(--phase-color); font-weight:700; }
.phase-steps { list-style:none; padding:0; margin:16px 0 0; }
.phase-step { display:flex; gap:10px; border-top:1px solid var(--border-subtle); padding:12px 0; }
.phase-step > div { min-width:0; flex:1; }
.phase-step-symbol { font-size:1.15rem; font-weight:700; color:var(--phase-color); }
.phase-step p { font-size:.8rem; }
.phase-step-count { font-weight:600; }
.phase-legend { display:flex; flex-wrap:wrap; gap:8px 24px; border-top:1px solid var(--border-subtle); padding-top:10px; font-size:.8rem; }
.phase-legend > span { display:flex; gap:8px; align-items:center; }
.phase-legend b { display:grid; place-items:center; flex:0 0 24px; box-sizing:border-box; line-height:1; width:24px; height:24px; border:2px solid var(--phase-color); border-radius:50%; color:var(--phase-color); background:var(--phase-surface); font-size:1rem; }
.schedule-footnote { margin-bottom:0; font-size:.75rem; }
.project-timeline :is(button,summary,a,[tabindex]):focus-visible, .timeline-import :is(input,select,button,a):focus-visible, .client-project-tabs a:focus-visible { outline:3px solid var(--focus-ring); outline-offset:3px; }
@media (max-width:1100px) {
 .phase-trigger, .phase-close { scroll-margin-block-start:calc(var(--mobile-bar-height,64px) + 12px); }
 .phase-journey { flex-direction:column; padding:8px 0; }
 .phase-stop { flex:none; width:100%; padding-bottom:12px; }
 .phase-stop:after { top:20px; left:19px; width:3px; height:100%; }
 .phase-trigger { flex-direction:row; text-align:left; padding-inline:0; }
 .phase-label { align-items:flex-start; }
 .phase-detail, [data-enhanced] .phase-detail { position:relative; top:auto !important; left:auto !important; width:auto; max-width:100%; max-height:60vh; overflow:auto; margin:4px 0 12px; box-shadow:none; }
 .phase-journey-scroll { overflow:visible; }
}

.phase-state--gray, .phase-stop.is-pending { --phase-color:var(--text-secondary); --phase-surface:var(--surface-muted); }
.phase-stop.is-selected .phase-trigger { background:var(--surface-muted); border-radius:8px; }
.phase-instruction { margin:3px 0 0; font-size:.78rem; }

/* Project detail: shared Client/staff workspace, using the existing theme tokens. */
[data-project-workspace] { width:min(100%,1360px); min-width:0; margin-inline:auto; display:grid; gap:12px; }
[data-project-workspace] [hidden], .project-timeline [hidden], .timeline-import [hidden] { display:none !important; }
[data-project-workspace] .client-page-back a { min-height:44px; padding:0; color:var(--text-primary); }
[data-project-workspace] .project-summary-card { min-height:0; grid-template-columns:minmax(0,1fr) 220px; align-items:start; gap:16px; padding:12px 16px; border-radius:8px; background:var(--surface-card); box-shadow:none; }
[data-project-workspace] .project-summary-card__cover { grid-column:2; grid-row:1; width:220px; height:112px; min-height:0; aspect-ratio:auto; align-self:start; border-radius:5px; }
[data-project-workspace] .project-summary-card__copy { grid-column:1; grid-row:1; align-self:start; padding:4px 0; gap:10px; }
[data-project-workspace] .project-summary-card__title-row > div { flex:1 1 0; }
[data-project-workspace] .project-summary-card__copy h1 { font-size:clamp(1.2rem,1.65vw,1.65rem); line-height:1.25; }
[data-project-workspace] .client-project-eyebrow { margin-bottom:4px; font-size:.7rem; color:var(--text-secondary); }
[data-project-workspace] .project-summary-meta { align-items:center; gap:8px 0; color:var(--text-secondary); font-size:.8rem; line-height:1.5; }
[data-project-workspace] .project-summary-meta > span { padding-right:12px; margin-right:12px; }
[data-project-workspace] .project-summary-meta > span + span { border-left:1px solid var(--border-subtle); padding-left:12px; }
[data-project-workspace] .project-summary-meta .client-project-hero__updated { display:block; margin-block:0; font-size:inherit; }
[data-project-workspace] .project-summary-card__footer { margin:0; }
[data-project-workspace] .project-summary-card__footer:empty { display:none; }
[data-project-workspace] .project-summary-actions { justify-content:flex-start; gap:6px; }
[data-project-workspace] .project-summary-actions :is(a,button) { font-size:.8rem; }
.client-project-tabs { display:flex; align-items:stretch; gap:24px; min-width:0; overflow-x:auto; overflow-y:hidden; border-bottom:1px solid var(--border-subtle); padding:0 2px; margin:0; }
.client-project-tabs a { display:inline-flex; align-items:center; min-height:44px; white-space:nowrap; border-bottom:3px solid transparent; color:var(--text-secondary); font-size:.85rem; text-decoration:none; }
.client-project-tabs a[aria-selected=true], .client-project-tabs a[aria-current=page] { color:var(--text-primary); font-weight:700; border-bottom-color:var(--status-success-text); }
.client-project-tabpanel { display:grid; gap:12px; min-width:0; }
[data-project-workspace] .project-workspace { display:grid; gap:0; margin:0; padding:0; border:0; box-shadow:none; background:transparent; }
[data-project-workspace] .project-summary-grid { grid-template-columns:repeat(3,minmax(0,1fr)); gap:12px; align-items:stretch; margin:0; padding:0; background:transparent; border:0; }
[data-project-workspace] :is(.client-project-panel,.project-summary-panel,.project-documents,.timeline-section) { margin:0; padding:16px; border:1px solid var(--border-subtle); border-radius:8px; background:var(--surface-card); min-width:0; box-shadow:none; }
[data-project-workspace] .project-summary-panel { align-self:stretch; }
[data-project-workspace] :is(.client-project-panel > header,.project-section__heading,.timeline-section-heading) { display:flex; flex-direction:row; align-items:center; justify-content:flex-start; gap:10px; flex-wrap:wrap; margin:0 0 10px; padding:0; border:0; }
[data-project-workspace] :is(.client-project-panel,.project-summary-panel) h2 { flex:1; min-width:100px; font-size:.95rem; line-height:1.4; margin:0; }
.project-section-icon { display:inline-flex; align-items:center; justify-content:center; width:28px; height:28px; flex:0 0 28px; border-radius:6px; color:var(--status-success-text); background:var(--status-success-surface); }
.project-section-icon svg { display:block; width:20px; height:20px; }
[data-project-workspace] .project-section-action { font-size:.78rem; padding:6px; min-height:44px; }
.project-overview-more { display:inline-flex; align-items:center; min-height:44px; font-size:.78rem; color:var(--text-primary); text-underline-offset:3px; margin-left:auto; }
[data-project-view]:not([data-project-view=overview]) .project-overview-more { display:none; }
[data-project-workspace][data-project-view]:not([data-project-view=overview]) .project-summary-grid { grid-template-columns:minmax(0,1fr); }
[data-project-view=overview] :is(.client-project-update-list,.project-update-list) > article:not(:first-child) { display:none; }
[data-project-view=overview] :is(.client-project-update-list p,.project-update-body) { display:-webkit-box; -webkit-line-clamp:4; -webkit-box-orient:vertical; overflow:hidden; }
[data-project-workspace] .client-project-info-list { display:block; margin:0; }
[data-project-workspace] .client-project-info-list > div { display:grid; grid-template-columns:minmax(75px,.8fr) minmax(0,1.3fr); gap:10px; padding:10px 0; border-top:1px solid var(--border-subtle); }
[data-project-workspace] .client-project-info-list dt { text-transform:none; letter-spacing:normal; font-size:.78rem; font-weight:600; color:var(--text-secondary); }
[data-project-workspace] .client-project-info-list dd { font-size:.82rem; line-height:1.5; margin:0; }
[data-project-workspace] .project-overview { padding:0 0 10px; margin:0; border:0; background:transparent; }
[data-project-workspace] .project-metadata-list { margin:0; gap:10px 16px; grid-template-columns:repeat(2,minmax(0,1fr)); }
[data-project-workspace] .project-metadata-list dt { font-size:.75rem; letter-spacing:0; text-transform:none; overflow-wrap:anywhere; }
[data-project-workspace] .project-metadata-list dd { font-size:.82rem; }
[data-project-workspace] .project-metadata-list > div { min-width:0; }
[data-project-workspace] .project-info-copy { flex:1 1 140px; min-width:0; }
[data-project-workspace] .project-info-copy :is(h3,p) { font-size:.82rem; line-height:1.5; }
[data-project-workspace] .project-info-item { gap:8px; padding:10px 0; }
[data-project-workspace] .project-update-card { padding:10px 0; }
[data-project-workspace] .client-project-update-list article { position:relative; padding:8px 0 8px 16px; border-top:0; border-left:1px solid var(--border-subtle); }
[data-project-workspace] .client-project-update-list article:before { content:""; position:absolute; left:-4px; top:15px; width:7px; height:7px; border-radius:50%; background:var(--status-success-text); }
[data-project-workspace] .client-project-update-list time { display:block; float:none; margin:0 0 6px; white-space:normal; color:var(--text-secondary); font-size:.75rem; }
[data-project-workspace] :is(.client-project-update-list p,.project-update-body) { font-size:.85rem; line-height:1.55; margin:0; }
[data-project-workspace] :is(.client-project-resource-list,.project-link-list) { display:grid; gap:6px; margin:0; }
[data-project-workspace] .client-project-resource-list li { border:0; }
[data-project-workspace] :is(.client-project-resource-list a,.project-resource-link) { display:grid; grid-template-columns:20px minmax(0,1fr) auto; align-items:center; gap:8px; padding:8px 10px; min-height:44px; border:1px solid var(--border-subtle); border-radius:6px; font-size:.82rem; color:var(--text-primary); text-decoration:none; }
[data-project-workspace] :is(.client-project-resource-list a,.project-resource-link):hover { background:var(--surface-muted); }
[data-project-workspace] .client-project-resource-list a:hover strong { color:var(--text-primary); }
[data-project-workspace] :is(.client-project-resource-list strong,.project-resource-link strong) { overflow-wrap:anywhere; }
[data-project-workspace] .project-link-list > li { display:flex; flex-direction:row; flex-wrap:wrap; padding:0; gap:4px; border:0; }
[data-project-workspace] .project-resource-link { flex:1 1 100%; }
[data-project-workspace] .project-link-list .project-item-actions { margin-left:auto; }
[data-project-workspace] .project-item-actions:empty { display:none; }
[data-project-workspace] .project-item-actions :is(a,button) { min-height:44px; min-width:44px; }
[data-project-workspace] .admin-danger-button { color:var(--status-danger-text); }
[data-project-workspace] .admin-danger-button:is(:hover,:focus-visible,:active) { color:var(--status-danger-text); background:var(--status-danger-surface); border-color:var(--status-danger-text); }
[data-project-workspace] .client-project-empty { padding:8px 0; font-size:.82rem; line-height:1.5; }
[data-project-workspace] .project-documents { width:100%; }
[data-project-workspace] .project-documents .project-section__heading p { color:var(--text-secondary); font-size:.78rem; margin:3px 0 0; }
[data-project-workspace] .project-document-breadcrumbs { display:flex; flex-wrap:wrap; align-items:center; gap:8px; font-size:.78rem; overflow-wrap:anywhere; }
[data-project-workspace] .project-document-breadcrumbs a { display:inline-flex; align-items:center; min-height:44px; color:var(--text-primary); text-decoration:underline; text-underline-offset:3px; }
[data-project-workspace] .client-document-table__head,
[data-project-workspace] .client-document-table .project-document-row { min-width:0; grid-template-columns:minmax(0,2.4fr) minmax(60px,.6fr) minmax(75px,.7fr) minmax(115px,1fr) 80px; gap:12px; }
[data-project-workspace] .client-document-table__head { min-height:32px; font-size:.75rem; letter-spacing:0; text-transform:none; }
[data-project-workspace] .client-document-table__head > * { display:block; }
[data-project-workspace] .client-document-table .project-document-row { min-height:44px; padding-block:4px; }
[data-project-workspace] .client-document-table :is(.project-document-kind,.project-document-detail,.project-document-modified) { display:block; font-size:.78rem; }
[data-project-workspace] .client-document-table .archive-explorer-name strong { white-space:normal; overflow-wrap:anywhere; font-size:.82rem; }
[data-project-workspace] .project-document-download { min-height:44px; display:flex; align-items:center; font-size:.78rem; color:var(--text-primary); }
[data-project-workspace] .project-document-state { font-size:.85rem; }
[data-project-workspace] :is(a,button,summary):focus-visible { outline:3px solid var(--focus-ring); outline-offset:3px; }
.client-timeline-summary__values { display:flex; flex-wrap:wrap; gap:12px 24px; margin:12px 0 0; }
.client-timeline-summary__values dt { color:var(--text-secondary); font-size:.8rem; }
.client-timeline-summary__values dd { margin:4px 0 0; font-size:.9rem; overflow-wrap:anywhere; }
.client-timeline-summary__values small { display:block; color:var(--text-secondary); }
.schedule-ended { margin:8px 0; font-size:.82rem; color:var(--text-secondary); line-height:1.5; }
@media (max-width:1100px) {
 [data-project-workspace] .project-summary-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
 [data-project-workspace] .project-summary-grid > :last-child:nth-child(odd) { grid-column:1 / -1; }
}
@media (max-width:767px) {
 [data-project-workspace] { gap:10px; }
 [data-project-workspace] .project-summary-card { grid-template-columns:minmax(0,1fr); gap:12px; padding:14px; }
 [data-project-workspace] .project-summary-card__copy { grid-column:1; grid-row:1; }
 [data-project-workspace] .project-summary-card__cover { grid-column:1; grid-row:2; width:100%; height:128px; }
 [data-project-workspace] .project-summary-card__title-row { display:flex; }
 [data-project-workspace] .project-summary-card__title-row > div { flex:1 1 0; }
 [data-project-workspace] .project-summary-meta { gap:6px; }
 [data-project-workspace] .project-summary-meta > span, [data-project-workspace] .project-summary-meta > span + span { padding:0; margin:0; border:0; flex-basis:100%; }
 [data-project-workspace] .project-info-copy { flex-basis:auto; }
 [data-project-workspace] .project-summary-grid { grid-template-columns:minmax(0,1fr); gap:10px; }
 [data-project-workspace] .project-summary-grid > :last-child:nth-child(odd) { grid-column:auto; }
 [data-project-workspace] :is(.client-project-panel,.project-summary-panel,.project-documents,.timeline-section) { padding:14px; }
 .client-project-tabs { gap:20px; }
 [data-project-workspace] .client-document-table__head,
 [data-project-workspace] .client-document-table .project-document-row { grid-template-columns:minmax(0,1fr) 80px; gap:8px; }
 [data-project-workspace] .client-document-table__head > :nth-child(n+2):nth-child(-n+4),
 [data-project-workspace] .client-document-table :is(.project-document-kind,.project-document-detail,.project-document-modified) { display:none; }
 .schedule-summary { grid-template-columns:minmax(0,1fr); gap:8px; }
 .schedule-summary strong { font-size:.85rem; }
}
@media (forced-colors:active) {
 .phase-orb, .phase-detail, .phase-legend b { border-color:CanvasText; }
 .phase-stop:after, .phase-stop.is-connected:after { background:CanvasText; }
 .phase-trigger:focus-visible { outline-color:Highlight; }
}
@media (prefers-reduced-motion:reduce) { .project-timeline * { scroll-behavior:auto; transition:none; animation:none; } }

/* Client Overview contains only the timeline; other sections have their own tabs. */
@media (min-width:1101px) and (min-height:700px) {
 .client-project-workspace-page .staff-main:has(.client-project-workspace[data-project-view=overview]) { padding:12px 20px; }
 .client-project-workspace[data-project-view=overview] .client-page-back a { min-height:28px; }
 .client-project-workspace[data-project-view=overview] .project-summary-card { grid-template-columns:minmax(0,1fr) 156px; padding:8px 12px; gap:12px; }
 .client-project-workspace[data-project-view=overview] .project-summary-card__cover { width:156px; height:68px; }
 .client-project-workspace[data-project-view=overview] .project-summary-card__copy { padding:0; gap:5px; }
 .client-project-workspace[data-project-view=overview] .project-summary-card__copy h1 { font-size:1.2rem; }
 .client-project-workspace[data-project-view=overview] .project-summary-card__footer { display:none; }
 .client-project-workspace[data-project-view=overview] .project-summary-meta { font-size:.75rem; gap:3px 0; }
 .client-project-workspace[data-project-view=overview] { min-height:calc(100dvh - 24px); grid-template-rows:28px auto 44px auto; align-content:start; gap:6px; }
 .client-project-workspace[data-project-view=overview] .client-project-tabpanel { display:block; }
}

/* Client details use the native modal top layer; staff retains anchored phase panels. */
.client-phase-open { overflow:hidden; }
.client-phase-dialog { position:fixed; inset:0; margin:auto; padding:0; width:min(960px,calc(100vw - 32px)); height:min(780px,calc(100dvh - 48px)); max-width:none; max-height:none; border:0; border-radius:12px; background:var(--surface-card); color:var(--text-primary); box-shadow:0 20px 70px #0005; overflow:hidden; }
.client-phase-dialog::backdrop { background:rgb(0 0 0 / 40%); }
.client-phase-dialog.is-pending { --phase-color:var(--text-secondary); --phase-surface:var(--surface-muted); }
.project-timeline[data-enhanced] .client-phase-dialog .phase-detail { position:relative; inset:auto; margin:0; width:100%; height:100%; max-width:none; max-height:none; padding:24px; border-radius:12px; box-shadow:none; overflow:auto; box-sizing:border-box; }
.client-phase-dialog .phase-detail > header { position:sticky; top:-24px; z-index:1; margin:-24px -24px 16px; padding:16px 24px; background:var(--surface-card); border-bottom:1px solid var(--border-subtle); align-items:center; }
.client-phase-dialog .phase-detail h3 { font-size:1.2rem; }
.client-phase-dialog .phase-detail { font-size:.95rem; }
.client-phase-dialog .phase-step p { font-size:.9rem; }

/* Larger split photo header for Client, PM and Admin Projects. */
[data-project-workspace] .project-summary-card.project-summary-card--photo {
 position:relative; isolation:isolate; overflow:hidden; display:flex; align-items:center; padding:24px;
 min-height:clamp(190px,25vh,280px); background:var(--surface-card); border-color:var(--border-subtle);
}
[data-project-workspace] .project-summary-card.project-summary-card--photo .project-summary-card__cover {
 position:absolute; inset:0 0 0 auto; z-index:-1; width:48%; height:100%; margin:0; border-radius:0; grid-area:auto;
 clip-path:polygon(12% 0,100% 0,100% 100%,0 100%);
}
[data-project-workspace] .project-summary-card.project-summary-card--photo .project-summary-card__cover img { width:100%; height:100%; object-fit:cover; object-position:center; }
[data-project-workspace] .project-summary-card.project-summary-card--photo::after {
 content:""; position:absolute; inset:0 0 0 auto; width:calc(48% + 14px); z-index:-2; pointer-events:none;
 clip-path:polygon(12% 0,100% 0,100% 100%,0 100%); background:var(--status-success-border);
}
[data-project-workspace] .project-summary-card.project-summary-card--photo .project-summary-card__copy { width:50%; padding:0; gap:16px; }
[data-project-workspace] .project-summary-card.project-summary-card--photo h1 { font-size:clamp(1.2rem,1.7vw,1.8rem); line-height:1.25; }
[data-project-workspace] .project-summary-card.project-summary-card--photo .project-summary-meta { font-size:.8rem; line-height:1.6; gap:6px 0; }
[data-project-workspace] .project-summary-card.project-summary-card--photo .project-summary-actions :is(a,button) { background:var(--surface-card); color:var(--text-primary); border-color:var(--border-strong); }
[data-project-workspace] .project-summary-card.project-summary-card--photo .project-summary-actions :is(a,button):hover { background:var(--surface-muted); }
@media (max-width:767px) {
 [data-project-workspace] .project-summary-card.project-summary-card--photo { flex-direction:column; padding:0; gap:0; }
 [data-project-workspace] .project-summary-card.project-summary-card--photo .project-summary-card__copy { width:100%; padding:18px; box-sizing:border-box; }
 [data-project-workspace] .project-summary-card.project-summary-card--photo .project-summary-card__cover { order:2; position:relative; inset:auto; z-index:auto; width:100%; height:190px; clip-path:none; }
 [data-project-workspace] .project-summary-card.project-summary-card--photo::after { display:none; }
}
@media (forced-colors:active) {
 [data-project-workspace] .project-summary-card.project-summary-card--photo { background:Canvas; border-color:CanvasText; }
 [data-project-workspace] .project-summary-card.project-summary-card--photo::after,
 [data-project-workspace] .project-summary-card.project-summary-card--photo .project-summary-card__cover { display:none; }
 [data-project-workspace] .project-summary-card.project-summary-card--photo .project-summary-card__copy { width:100%; }
}

/* Client timeline: grouped source summary, numbered phases and explicit detail affordances. */
.timeline-section--client .timeline-intro { margin:3px 0 0; color:var(--text-secondary); font-size:.82rem; line-height:1.4; }
.timeline-section--client .timeline-phase-count { margin-left:auto; padding:8px 12px; border:1px solid var(--border-subtle); border-radius:8px; font-size:.78rem; white-space:nowrap; color:var(--text-secondary); }
.timeline-section--client .timeline-section-heading > .project-section-icon { width:40px; height:40px; flex-basis:40px; }
.timeline-section--client .timeline-section-heading h2 { font-size:1.15rem; }
.timeline-section--client .timeline-section-heading > div { flex:1; min-width:0; }
.timeline-section--client .schedule-summary { display:grid; grid-template-columns:1.2fr 1.2fr 1fr; padding:14px 12px; gap:0; background:var(--surface-muted); border-radius:9px; margin:12px 0; }
.timeline-section--client .schedule-summary--progress { grid-template-columns:1.2fr 1.2fr 1fr .9fr; }
.timeline-section--client .schedule-summary > div { padding:0 12px; min-width:0; }
.timeline-section--client .schedule-summary > div + div { border-left:1px solid var(--border-subtle); }
.timeline-section--client .schedule-summary-item { display:flex; align-items:flex-start; gap:10px; }
.timeline-section--client .schedule-summary-item > div { min-width:0; }
.timeline-section--client .schedule-summary-item > .project-section-icon { background:transparent; flex-shrink:0; }
.timeline-section--client .schedule-summary strong { display:block; font-size:.8rem; line-height:1.4; overflow-wrap:anywhere; }
.timeline-section--client .schedule-eyebrow { font-size:.75rem; margin-bottom:3px; }
.timeline-section--client .schedule-current-status { display:inline-block; margin-top:5px; padding:2px 8px; border-radius:5px; color:var(--phase-color); background:var(--phase-surface); font-size:.75rem; font-weight:650; }
.timeline-section--client .schedule-overall > div { display:flex; align-items:center; flex-wrap:wrap; gap:6px; }
.timeline-section--client .schedule-overall strong { font-size:1.4rem; color:var(--status-success-text); }
.timeline-section--client .schedule-overall small { display:block; font-size:.65rem; line-height:1.4; margin-top:5px; color:var(--text-secondary); }
.timeline-section--client .schedule-overall progress { height:9px; margin-top:4px; }
.timeline-section--client .phase-journey-scroll { padding:8px 2px 12px; }
.timeline-section--client .phase-stop { flex-basis:145px; }
.timeline-section--client .phase-stop:after { top:25px; }
.timeline-section--client .phase-orb { width:50px; height:50px; font-size:27px; }
.timeline-section--client .is-current .phase-orb { outline:2px solid var(--phase-color); outline-offset:4px; box-shadow:0 0 0 11px var(--phase-surface); }
.timeline-section--client .phase-trigger { gap:8px; padding-inline:6px; }
.timeline-section--client .phase-number { font-weight:700; color:var(--text-primary); }
.timeline-section--client .phase-label { gap:4px; }
.timeline-section--client .phase-label strong { font-size:.8rem; min-height:2.8em; }
.timeline-section--client .phase-label small { min-width:94px; padding:4px 9px; }
.timeline-section--client .phase-label .phase-details-label { display:flex; align-items:center; justify-content:center; gap:14px; min-height:36px; padding:4px 12px; margin-top:5px; border:1px solid var(--border-strong); border-radius:8px; color:var(--text-primary); background:var(--surface-card); font-size:.75rem; }
.timeline-section--client .phase-trigger:hover .phase-details-label { background:var(--surface-muted); }
.timeline-section--client .timeline-footer { display:flex; gap:12px; align-items:center; justify-content:space-between; flex-wrap:wrap; padding-top:10px; border-top:1px solid var(--border-subtle); }
.timeline-section--client .phase-legend { border:0; padding:0; gap:8px 18px; font-size:.72rem; }
.timeline-full-link { display:inline-flex; align-items:center; justify-content:center; gap:16px; min-height:36px; padding:5px 12px; border:1px solid var(--border-subtle); border-radius:8px; font-size:.75rem; color:var(--text-primary); text-decoration:none; }
.timeline-full-link:hover { background:var(--surface-muted); }
.timeline-section--client .schedule-footnote { font-size:.68rem; margin:8px 0 0; }
 .client-project-workspace[data-project-view=overview] .timeline-section--client .schedule-footnote { display:none; }
@media (min-width:1101px) and (max-height:800px) {
 .client-project-workspace[data-project-view=overview] .timeline-section--client { padding:12px; }
 .timeline-section--client .timeline-section-heading h2 { font-size:1rem; }
 .timeline-section--client .timeline-section-heading > .project-section-icon { width:32px; height:32px; flex-basis:32px; }

 [data-project-workspace] .project-summary-card.project-summary-card--photo { min-height:180px; padding-block:16px; }
 .timeline-section--client .timeline-intro { font-size:.75rem; }
 .timeline-section--client .schedule-summary { padding:8px 6px; margin:6px 0; }
 .timeline-section--client .schedule-summary-item { gap:6px; }
 .timeline-section--client .schedule-summary > div { padding-inline:8px; }
 .timeline-section--client .phase-orb { width:42px; height:42px; font-size:24px; }
 .timeline-section--client .phase-stop:after { top:21px; }
 .timeline-section--client .phase-journey-scroll { padding-block:4px; }
 .timeline-section--client .phase-trigger { gap:5px; padding-bottom:4px; }
 .timeline-section--client .phase-label { gap:2px; }
 .timeline-section--client .phase-label .phase-details-label { min-height:30px; margin-top:2px; }
 .timeline-section--client .schedule-footnote { margin-top:5px; }
}
@media (max-width:1100px) {
 .timeline-section--client .schedule-summary { grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px 0; }
 .timeline-section--client .schedule-summary > div:nth-child(odd) { border-left:0; }
 .timeline-section--client .phase-stop { flex-basis:auto; }
 .timeline-section--client .phase-trigger { align-items:flex-start; }
 .timeline-section--client .phase-stop:after { left:24px; top:25px; }
 .timeline-section--client .phase-label .phase-details-label { align-self:flex-start; min-height:44px; }
 .timeline-section--client .phase-label strong { min-height:0; }
 .timeline-section--client .timeline-phase-count { margin-left:50px; }
 .timeline-section--client .timeline-section-heading > div { flex:1 1 calc(100% - 50px); }
}
@media (max-width:480px) {
 .timeline-section--client .schedule-summary { grid-template-columns:minmax(0,1fr); gap:12px; }
 .timeline-section--client .schedule-summary > div + div { border-left:0; border-top:1px solid var(--border-subtle); padding-top:10px; }
 .timeline-section--client .timeline-footer { align-items:flex-start; }
 .timeline-section--client .timeline-full-link { min-height:44px; }
}

/* Project Overview cards: shared headers, bodies and read-only preview rows. */
.client-project-workspace .project-overview-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:16px; align-items:stretch; }
.client-project-workspace .project-overview-grid > .project-overview-card { min-width:0; height:auto; min-height:0; padding:20px; margin:0; border:1px solid var(--border-subtle); border-radius:8px; background:var(--surface-card); box-shadow:none; overflow:visible; align-self:stretch; grid-column:auto; }
.client-project-workspace .project-overview-card .project-card-header { display:flex; flex-wrap:nowrap; align-items:center; justify-content:space-between; gap:12px; min-height:44px; padding:0; margin:0 0 14px; border:0; }
.client-project-workspace .project-card-title { display:flex; align-items:center; gap:10px; min-width:0; }
.client-project-workspace .project-card-title .project-section-icon { width:30px; height:30px; flex:0 0 30px; border-radius:6px; background:var(--status-success-surface); color:var(--status-success-text); }
.client-project-workspace .project-card-title h2 { min-width:0; margin:0; font-size:.875rem; line-height:1.35; font-weight:650; }
.client-project-workspace .project-card-action { display:inline-flex; flex-shrink:0; align-items:center; justify-content:center; gap:5px; min-width:44px; min-height:44px; margin:0; padding:0; font-size:.75rem; line-height:1.4; color:var(--status-success-text); text-decoration:none; white-space:nowrap; }
.client-project-workspace .project-card-action:hover { text-decoration:underline; text-underline-offset:3px; }
.client-project-workspace .project-card-body { min-width:0; font-size:.875rem; color:var(--text-primary); line-height:1.5; overflow-wrap:anywhere; }
.client-project-workspace .project-card-body :is(dl,ul,p) { margin-block:0; }
.client-project-workspace .project-card-body :is(.client-project-info-list,.client-project-update-list,.client-project-resource-list,.project-document-preview) { display:grid; gap:10px; padding:0; margin:0; list-style:none; }
.client-project-workspace .project-card-body .client-project-info-list > div { display:grid; grid-template-columns:minmax(0,1fr); gap:4px; padding:0; border:0; }
.client-project-workspace .project-card-body .client-project-info-list > div + div { border-top:1px solid var(--border-subtle); padding-top:10px; }
.client-project-workspace .project-card-body .client-project-info-list dt { min-width:0; font-size:.75rem; font-weight:550; line-height:1.4; color:var(--text-secondary); overflow-wrap:anywhere; }
.client-project-workspace .project-card-body .client-project-info-list dd { display:block; margin:0; font-size:.875rem; font-weight:400; line-height:1.5; white-space:pre-line; overflow:visible; -webkit-line-clamp:unset; }
.client-project-workspace .project-card-body .client-project-update-list article { display:block; position:relative; padding:0 0 0 16px; margin:0; min-height:44px; border:0; }
.client-project-workspace .project-card-body .client-project-update-list article + article { border-top:1px solid var(--border-subtle); padding-top:10px; }
.client-project-workspace .project-card-body .client-project-update-list article:before { left:0; top:6px; width:6px; height:6px; }
.client-project-workspace .project-card-body .client-project-update-list article + article:before { top:16px; }
.client-project-workspace .project-card-body .client-project-update-list time { display:block; font-size:.75rem; line-height:1.4; margin:0 0 5px; color:var(--text-secondary); }
.client-project-workspace .project-card-body .client-project-update-list p { display:block; font-size:.875rem; line-height:1.5; white-space:pre-line; margin:0; overflow:visible; -webkit-line-clamp:unset; }
.client-project-workspace .project-card-body :is(.client-project-resource-list a,.project-card-row) { display:grid; grid-template-columns:minmax(0,1fr) auto; align-items:center; min-height:44px; gap:10px; padding:9px 10px; border:1px solid var(--border-subtle); border-radius:6px; background:var(--surface-card); color:var(--text-primary); text-decoration:none; font-size:.875rem; line-height:1.4; box-sizing:border-box; }
.client-project-workspace .project-card-body :is(.client-project-resource-list a,.project-card-row):hover { background:var(--surface-muted); border-color:var(--border-strong); }
.client-project-workspace .project-card-body .client-project-resource-list strong { font-weight:500; min-width:0; overflow-wrap:anywhere; }
.client-project-workspace .project-card-body .client-project-link-glyph { display:none; }
.client-project-workspace .project-card-body .client-project-link-open { color:var(--text-secondary); }
.client-project-workspace .project-card-body a.project-card-row { grid-template-columns:20px minmax(0,1fr) auto; }
.client-project-workspace .project-card-row-label { min-width:0; overflow-wrap:anywhere; font-weight:500; }
.client-project-workspace .project-card-row small { color:var(--text-secondary); font-size:.75rem; white-space:nowrap; }
.client-project-workspace .project-card-row :is(.archive-folder-glyph,.archive-file-icon) { width:20px; min-width:0; height:18px; padding:0; box-sizing:border-box; flex:0 0 20px; font-size:.5rem; }
.client-project-workspace .project-card-row .archive-folder-glyph::before { width:10px; height:4px; }
.client-project-workspace .project-document-preview, .project-card-excerpt { display:none; }
.client-project-workspace[data-project-view=overview] .project-card-excerpt { display:inline; }
.client-project-workspace[data-project-view=overview] .project-card-full { display:none; }
.client-project-workspace[data-project-view=overview] .project-card-body .project-document-preview { display:grid; }
.client-project-workspace[data-project-view=overview] .project-card-body :is(.client-document-table,.project-document-breadcrumbs) { display:none; }
.client-project-workspace[data-project-view=overview] .project-card-body :is(.client-project-info-list > div,.client-project-update-list > article,.client-project-resource-list > li):nth-child(n+4) { display:none; }
.client-project-workspace[data-project-view]:not([data-project-view=overview]) .project-card-action { display:none; }
.client-project-workspace[data-project-view]:not([data-project-view=overview]) .project-card-header { margin-bottom:14px; }
.client-project-workspace[data-project-view]:not([data-project-view=overview]) .project-card-body .client-project-info-list > div { grid-template-columns:minmax(130px,25%) minmax(0,1fr); gap:16px; }
.client-project-workspace .project-card-body .client-project-empty { padding:0; margin:0; font-size:.875rem; color:var(--text-secondary); line-height:1.5; }
@media (min-width:1650px) { .client-project-workspace .project-overview-grid { grid-template-columns:repeat(4,minmax(0,1fr)); } }
@media (max-width:899px) {
 .client-project-workspace .project-overview-grid { grid-template-columns:minmax(0,1fr); }
 .client-project-workspace .project-overview-grid > .project-overview-card { padding:18px; }
 .client-project-workspace[data-project-view]:not([data-project-view=overview]) .project-card-body .client-project-info-list > div { grid-template-columns:minmax(0,1fr); gap:4px; }
}

.client-project-workspace .project-card-body .project-document-preview { display:none; }
.client-project-workspace[data-project-view=overview] .project-card-body .project-document-preview { display:grid; }

/* Reference spacing for the Client Overview; complete tabs retain their roomier layout. */
@media (min-width:1280px) {
 .client-project-workspace[data-project-view=overview] .project-overview-grid { grid-template-columns:repeat(4,minmax(0,1fr)); gap:12px; }
 .client-project-workspace[data-project-view=overview] .project-overview-grid > .project-overview-card { padding:10px 12px 12px; }
 .client-project-workspace[data-project-view=overview] .project-card-header { gap:6px; margin-bottom:4px; }
 .client-project-workspace[data-project-view=overview] .project-card-title { gap:8px; }
 .client-project-workspace[data-project-view=overview] .project-card-title .project-section-icon { width:24px; height:24px; flex-basis:24px; background:transparent; }
 .client-project-workspace[data-project-view=overview] .project-card-title h2 { font-size:.78rem; }
 .client-project-workspace[data-project-view=overview] .project-card-action { font-size:.68rem; }
 .client-project-workspace[data-project-view=overview] .project-card-body :is(.client-project-info-list,.client-project-update-list,.client-project-resource-list,.project-document-preview) { gap:4px; }
 .client-project-workspace[data-project-view=overview] .project-card-body .client-project-info-list > div { grid-template-columns:minmax(72px,.7fr) minmax(0,1.3fr); gap:10px; }
 .client-project-workspace[data-project-view=overview] .project-card-body :is(.client-project-info-list dd,.client-project-update-list p,.client-project-resource-list a,.project-card-row) { font-size:.78rem; line-height:1.45; }
 .client-project-workspace[data-project-view=overview] .project-card-body :is(.client-project-info-list dt,.client-project-update-list time,.project-card-row small) { font-size:.7rem; }
 .client-project-workspace[data-project-view=overview] .project-card-body :is(.client-project-resource-list a,.project-card-row) { padding:5px 2px; border-color:transparent; background:transparent; }
 .client-project-workspace[data-project-view=overview] .project-card-body :is(.client-project-resource-list a,.project-card-row):hover { background:var(--surface-muted); border-color:var(--border-subtle); }
 .client-project-workspace[data-project-view=overview] .project-card-body .client-project-update-list article:not(:first-child) { display:none; }
 .client-project-workspace[data-project-view=overview] .project-card-body .client-project-update-list article { border-left:1px solid var(--border-subtle); padding-left:14px; }
 .client-project-workspace[data-project-view=overview] .project-card-body .client-project-update-list article:before { left:-3px; }
}

.client-project-workspace .project-card-body .client-project-info-list { grid-template-columns:minmax(0,1fr); }

.phase-legend b > svg { display:block; width:14px; height:14px; }


/* Client card signal: standard red / amber / green order, one lamp illuminated. */
:root {
    --timeline-critical: #df2837;
    --timeline-alert: #e2a400;
    --timeline-calm: #39845f;
}
.client-project-card { position:relative; }
.project-traffic-light {
 position:absolute; top:8px; right:8px; z-index:2; display:flex; flex-direction:column;
 gap:2px; padding:4px; width:20px; box-sizing:border-box; border:1px solid #65706c;
 border-radius:7px; background:#18211e; box-shadow:0 2px 4px #0005;
}
.project-traffic-lamp {
 display:block; width:10px; height:10px; border-radius:50%; background:#35423c;
 border:1px solid #68736d; box-sizing:border-box; box-shadow:inset 0 2px 3px #0006;
}
.project-traffic-lamp--red.is-lit { background:var(--timeline-critical); }
.project-traffic-lamp--yellow.is-lit { background:var(--timeline-alert); }
.project-traffic-lamp--green.is-lit { background:var(--timeline-calm); }
.project-traffic-lamp.is-lit { border-color:#fff; box-shadow:none; }
@media (forced-colors:active) {
 .project-traffic-light { background:Canvas; border-color:CanvasText; }
 .project-traffic-lamp { background:Canvas; border-color:GrayText; }
 .project-traffic-lamp.is-lit { background:Highlight; border:3px solid CanvasText; box-shadow:none; }
}


/* Client phase details are a compact vertical timeline inside a centered dialog. */
.client-phase-dialog .phase-detail > .phase-steps { margin-top:24px; }
.client-phase-dialog .phase-step { position:relative; display:grid; grid-template-columns:32px minmax(0,1fr); gap:14px; border:0; padding:0 0 20px; }
.client-phase-dialog .phase-step:not(:last-child)::before { content:""; position:absolute; left:15px; top:30px; bottom:-16px; width:2px; background:var(--border-strong); }
.client-phase-dialog .phase-step-symbol { position:relative; z-index:1; display:grid; place-items:center; width:32px; height:32px; margin-top:12px; border:2px solid var(--phase-color); border-radius:50%; box-sizing:border-box; background:var(--phase-surface); color:var(--phase-color); }
.client-phase-dialog .phase-step-symbol svg { display:block; width:18px; height:18px; }
.client-phase-dialog .phase-step.is-pending { --phase-color:var(--text-secondary); --phase-surface:var(--surface-muted); }
.client-phase-dialog .phase-step > div { padding:12px 16px; border:1px solid var(--border-subtle); border-radius:10px; background:var(--surface-card); }
.client-phase-dialog .phase-step > div > strong { display:block; font-size:.95rem; line-height:1.4; text-wrap:pretty; }
.client-phase-dialog .phase-step p { margin:6px 0; font-size:.84rem; line-height:1.5; }
.client-phase-dialog .phase-steps .phase-steps { margin-top:16px; }
.client-phase-dialog .phase-step:last-child { padding-bottom:0; }
.client-phase-dialog .phase-close,
.phase-preview [data-preview-close] { display:grid; place-items:center; padding:0; line-height:1; box-sizing:border-box; }
.client-phase-dialog .phase-close { width:44px; height:44px; min-width:44px; min-height:44px; }
.client-phase-dialog .phase-close > svg,
.phase-preview [data-preview-close] > svg { display:block; width:20px; height:20px; }
@media (max-width:600px) {
 .project-timeline[data-enhanced] .client-phase-dialog .phase-detail { padding:16px; }
 .client-phase-dialog .phase-detail > header { top:-16px; margin:-16px -16px 16px; padding:12px 16px; }
 .client-phase-dialog .phase-detail h3 { font-size:1rem; }
 .client-phase-dialog .phase-step { grid-template-columns:26px minmax(0,1fr); gap:10px; }
 .client-phase-dialog .phase-step-symbol { width:26px; height:26px; }
 .client-phase-dialog .phase-step:not(:last-child)::before { left:12px; top:28px; bottom:-13px; }
 .client-phase-dialog .phase-step > div { padding:10px; }
}
@media (forced-colors:active) {
 .client-phase-dialog .phase-step-symbol { border-color:CanvasText; }
 .client-phase-dialog .phase-step:not(:last-child)::before { background:CanvasText; }
}

@media (min-width:601px) {
 .client-phase-dialog .phase-step > div { display:grid; grid-template-columns:minmax(0,1fr) auto; column-gap:20px; row-gap:6px; }
 .client-phase-dialog .phase-step > div > strong,
 .client-phase-dialog .phase-step-status { grid-column:1; }
 .client-phase-dialog .phase-step > div > p { margin:0; }
 .client-phase-dialog .phase-step > div > .timeline-muted { grid-column:2; grid-row:1 / 3; text-align:right; align-self:center; }
 .client-phase-dialog .phase-step-description,
 .client-phase-dialog .phase-step > div > .phase-steps { grid-column:1 / -1; }
}

/* Compact project task panel; editor and completed history open on demand. */
.project-tasks .project-section__heading { margin-bottom: .5rem; }
.project-tasks .project-section__heading p { margin: .2rem 0 0; font-size: .8rem; }
.project-tasks .project-empty-note { margin: .5rem 0; }
.project-tasks .task-list { gap: .35rem; }
.project-tasks .task-card { padding: .5rem .7rem; gap: .6rem; border-radius: 6px; }
.project-tasks .task-card__main { min-width: 0; }
.project-tasks .task-card h4 { margin: .2rem 0; font-size: .9rem; overflow-wrap: anywhere; }
.project-tasks .task-card p { font-size: .8rem; }
.project-task-editor, .project-task-completed { margin-top: .5rem; }
.project-task-editor > summary, .project-task-completed > summary { cursor: pointer; min-height: 44px; align-content: center; font-weight: 650; font-size: .85rem; color: var(--text-primary); }
.project-task-editor > summary:focus-visible, .project-task-completed > summary:focus-visible { outline: 3px solid var(--focus-ring); outline-offset: 2px; }
.project-task-editor .task-editor { margin-top: .5rem; padding-top: .5rem; border-top: 1px solid var(--border); }

/* Reset legacy archive mobile placement inside the aligned document table. */
.client-document-table .project-document-row > span:nth-child(3),
.client-document-table .project-document-row > span:nth-child(4) { grid-column: auto; padding-left: 0; }

/* Security reports share readable spacing and contain wide evidence tables. */
.security-console-nav { display:flex; flex-wrap:wrap; gap:8px; margin:0 0 20px; }
.security-console-nav a { display:inline-flex; align-items:center; min-height:44px; padding:10px 14px; border:1px solid var(--border-subtle); border-radius:8px; background:var(--surface-card); color:var(--text-primary); text-decoration:none; }
.security-console-nav a[aria-current="page"] { background:var(--surface-muted); border-color:var(--border-strong); font-weight:700; }
.security-console-nav a:hover { text-decoration:underline; }
.security-console { padding:20px; border:1px solid var(--border-subtle); border-radius:12px; background:var(--surface-card); }
.security-console > h2, .security-console > h3 { margin:0 0 16px; }
.security-summary-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(100%,180px),1fr)); gap:16px; margin:0 0 24px; }
.security-summary-grid > article { display:flex; flex-direction:column; gap:6px; padding:16px; border:1px solid var(--border-subtle); border-radius:8px; background:var(--surface-muted); }
.security-summary-grid strong { font-size:1.5rem; }
.security-summary-grid span, .security-table small { color:var(--text-secondary); }
.security-table { width:100%; border-collapse:collapse; }
.security-table th, .security-table td { padding:12px 14px; border-bottom:1px solid var(--border-subtle); text-align:left; vertical-align:top; overflow-wrap:anywhere; }
.security-table th { background:var(--surface-muted); font-weight:600; }
.security-table a { color:var(--text-primary); text-decoration:underline; text-underline-offset:2px; }
.security-table small { display:block; margin-top:4px; line-height:1.5; }
.security-console .project-list-search { display:grid; gap:8px; margin-bottom:16px; }
.security-console .project-list-search label { display:block; min-height:0; padding:0; border:0; border-radius:0; box-shadow:none; background:transparent; }
.security-console .project-list-search > div { display:flex; flex-wrap:wrap; gap:8px; }
.security-console .project-list-search input { flex:1 1 200px; min-width:0; padding:10px 12px; border:1px solid var(--border-strong); border-radius:8px; background:var(--surface-card); }
.security-console .project-list-search input:focus-visible { outline:2px solid var(--focus-ring); outline-offset:2px; }
.security-detail { display:grid; grid-template-columns:minmax(100px,1fr) minmax(0,3fr); gap:12px 20px; }
.security-detail dt { font-weight:600; }
.security-detail dd { margin:0; overflow-wrap:anywhere; }
@media (max-width:767px) {
    .security-console { padding:14px; }
    .security-summary-grid { grid-template-columns:minmax(0,1fr); }
    .security-detail { grid-template-columns:minmax(0,1fr); gap:8px; }
    .security-detail dd { margin-bottom:12px; }
}

/* Compact client navigation: one selected project, with a quiet section heading. */
body.client-dashboard #client-sidebar .staff-logo {
    min-height: 64px; margin: 0 0 18px; padding: 4px 10px;
    justify-content: flex-start;
}
body.client-dashboard #client-sidebar .staff-logo a { width: 128px; margin: 0; }
body.client-dashboard #client-sidebar .staff-logo img { max-height: 60px; }
body.client-dashboard #client-sidebar .client-sidebar-content { gap: 0; }
body.client-dashboard #client-sidebar .role-sidebar-label { display: none; }
body.client-dashboard #client-sidebar .client-project-nav__search { margin-bottom: 14px; }
body.client-dashboard #client-sidebar .client-project-nav__search input {
    background: var(--surface-sidebar); border-radius: 8px; font-size: .75rem;
}
body.client-dashboard #client-sidebar .client-project-nav__header { margin-bottom: 4px; }
body.client-dashboard #client-sidebar .nav-item.client-project-nav__link {
    min-height: 44px; padding: 6px 10px; gap: 8px; border: 0;
    background: transparent; color: var(--sidebar-text); box-shadow: none;
    font-size: .78rem; font-weight: 600;
}
body.client-dashboard #client-sidebar .nav-item.client-project-nav__link:hover { background: var(--sidebar-hover); }
body.client-dashboard #client-sidebar .nav-item.client-project-nav__link.active {
    color: var(--sidebar-selected-text); background: var(--sidebar-selected-surface);
    border-left: 4px solid var(--brand-accent);
}
body.client-dashboard #client-sidebar .client-project-nav__link small { font-size: .7rem; font-weight: 500; }
body.client-dashboard #client-sidebar .client-project-nav__panel { padding: 0 0 8px; }
body.client-dashboard #client-sidebar .client-project-nav__list { gap: 3px; }
body.client-dashboard #client-sidebar .client-project-nav__item {
    gap: 3px; padding: 9px 12px; border-left-width: 2px; border-radius: 7px;
}
body.client-dashboard #client-sidebar .client-project-nav__item strong { font-size: .76rem; font-weight: 600; }
body.client-dashboard #client-sidebar .client-project-nav__item span { font-size: .66rem; line-height: 1.4; }
body.client-dashboard #client-sidebar .staff-nav > .nav-item {
    min-height: 44px; padding: 8px 12px; gap: 8px; font-size: .76rem; font-weight: 500;
}
body.client-dashboard #client-sidebar .sidebar-footer { padding-top: 12px; }
body.client-dashboard #client-sidebar .sidebar-identity { grid-template-columns: 32px minmax(0,1fr); gap: 8px; padding-inline: 6px; }
body.client-dashboard #client-sidebar .sidebar-avatar { width: 32px; height: 32px; font-size: .7rem; }
body.client-dashboard #client-sidebar .sidebar-account-name { font-size: .73rem; font-weight: 600; }
body.client-dashboard #client-sidebar .sidebar-account-login { font-size: .64rem; }
body.client-dashboard #client-sidebar .sidebar-signout { margin-top: 8px; }
body.client-dashboard #client-sidebar .sidebar-signout button { min-height: 44px; font-size: .73rem; font-weight: 500; }

/* Client sidebar controls and project title hierarchy. */
body.client-dashboard #client-sidebar .staff-logo { min-height: 110px; padding: 16px 0 4px; justify-content: center; }
body.client-dashboard #client-sidebar .staff-logo a { width: 208px; max-width: 100%; }
body.client-dashboard #client-sidebar .staff-logo img { max-height: 110px; }
.client-sidebar-toggle { position: absolute; right: 8px; top: 8px; z-index: 3; display: grid; place-items: center; width: 32px; height: 32px; min-height: 32px; padding: 6px; border: 1px solid var(--sidebar-border); border-radius: 7px; background: var(--surface-sidebar); color: var(--sidebar-text); box-shadow: none; cursor: pointer; }
.client-sidebar-toggle svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.client-sidebar-toggle:hover { background: var(--sidebar-hover); }
.client-sidebar-toggle:focus-visible { outline: 3px solid var(--sidebar-focus); outline-offset: 2px; }
body.client-dashboard #client-sidebar .client-project-code { display: block; font: inherit; font-weight: 700; }
body.client-dashboard #client-sidebar .client-project-description { display: block; margin-top: 1px; font: inherit; font-size: .7rem; font-weight: 500; line-height: 1.4; }
body.client-dashboard #client-sidebar .client-project-nav__item { gap: 5px; }
body.client-dashboard.client-sidebar-collapsed .staff-layout,
body.staff-body.client-dashboard.client-sidebar-collapsed .staff-layout:has([data-project-workspace]) { grid-template-columns: 52px minmax(0,1fr); }

body.client-dashboard.client-sidebar-collapsed #client-sidebar .client-sidebar-content { opacity: 0; transform: translateX(-32px); visibility: hidden; pointer-events: none; }
body.client-dashboard.client-sidebar-collapsed .client-sidebar-toggle svg { transform: rotate(180deg); }
@media (max-width: 767px), (max-height: 500px) and (max-width: 900px) {
    .client-sidebar-toggle { display: none; }
    body.client-dashboard #client-sidebar .staff-logo { min-height: 100px; }
}

body.client-dashboard #client-sidebar .client-project-nav__header { background: transparent; }

body.client-dashboard #client-sidebar,
body.client-dashboard #client-sidebar :is(.staff-nav,.client-project-nav__list) { touch-action: pan-y pinch-zoom; }
.client-sidebar-swipe-edge { display: none; }
@media (max-width: 767px), (max-height: 500px) and (max-width: 900px) {
    .client-sidebar-swipe-edge { display: block; position: fixed; left: 0; top: var(--mobile-bar-height,64px); bottom: 0; width: 20px; z-index: 90; touch-action: pan-y pinch-zoom; }
    .mobile-nav-open .client-sidebar-swipe-edge { display: none; }
}

@media (min-width: 768px) {
    body.client-dashboard.sidebar-motion-ready .staff-layout { transition: grid-template-columns 300ms cubic-bezier(.22,.68,.25,1); }
    body.client-dashboard #client-sidebar .client-sidebar-content { width: var(--client-sidebar-content-width,100%); flex-shrink: 0; }
    body.client-dashboard.sidebar-motion-ready #client-sidebar .client-sidebar-content { transition: opacity 180ms ease, transform 300ms cubic-bezier(.22,.68,.25,1), visibility 0s; }
    body.client-dashboard.sidebar-motion-ready.client-sidebar-collapsed #client-sidebar .client-sidebar-content { transition: opacity 150ms ease, transform 300ms cubic-bezier(.22,.68,.25,1), visibility 0s 300ms; }
    body.client-dashboard.sidebar-motion-ready .client-sidebar-toggle svg { transition: transform 250ms ease; }
}
@media (prefers-reduced-motion: reduce) {
    body.client-dashboard.sidebar-motion-ready .staff-layout,
    body.client-dashboard.sidebar-motion-ready #client-sidebar .client-sidebar-content,
    body.client-dashboard.sidebar-motion-ready .client-sidebar-toggle svg { transition: none; }
}
html[data-reduce-motion=true] body.client-dashboard.sidebar-motion-ready :is(.staff-layout,#client-sidebar .client-sidebar-content,.client-sidebar-toggle svg) { transition: none; }

.project-document-approval { display:block; white-space:normal; overflow-wrap:anywhere; }

/* Explicit PM catalog scope; personal ownership never limits default visibility. */
.pm-project-scope{display:flex;flex-wrap:wrap;gap:10px;margin-bottom:20px;}
.pm-project-scope a{min-height:44px;max-width:100%;text-align:center;}

.project-build-options{display:inline-flex;flex-wrap:wrap;gap:8px;max-width:100%;}
