:root {
    --pscx-purple: #523089;
    --pscx-red: #f25963;
    --pscx-green: #00a884;
    --pscx-light-blue: #3993da;
    --pscx-dark-blue: #171c73;

    --ink-strong: #20212b;
    --ink: #3c3e49;
    --ink-muted: #777985;
    --surface: #ffffff;
    --surface-soft: #f7f7f9;
    --surface-muted: #f0f0f4;
    --border: #e3e3e8;
    --shadow: 0 10px 30px rgba(29, 25, 45, 0.07);
    --sidebar-width: 250px;
    --button-font-size: 0.8rem;
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family:
        Inter,
        "Segoe UI",
        Roboto,
        Helvetica,
        Arial,
        sans-serif;
    color: var(--ink);
    background: var(--surface-soft);
}

button,
input {
    font: inherit;
}

a {
    color: inherit;
}

.auth-body {
    background:
        radial-gradient(
            circle at top right,
            rgba(82, 48, 137, 0.11),
            transparent 34%
        ),
        var(--surface-soft);
}

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

.auth-card {
    width: min(100%, 440px);
    padding: 38px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: var(--surface);
    box-shadow: var(--shadow);
}

.brand-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 74px;
    min-height: 38px;
    margin-bottom: 26px;
    padding: 7px 13px;
    border-radius: 9px;
    color: #fff;
    background: var(--pscx-purple);
    font-weight: 750;
    letter-spacing: 0.08em;
}

.auth-card h1 {
    margin: 0 0 10px;
    color: var(--ink-strong);
    font-size: 2rem;
    line-height: 1.15;
}

.auth-card p {
    line-height: 1.6;
}

.auth-card .intro {
    margin: 0 0 24px;
    color: var(--ink-muted);
}

.auth-card label {
    display: block;
    margin: 18px 0 7px;
    color: var(--ink-strong);
    font-weight: 650;
}

.auth-card input {
    width: 100%;
    min-height: 48px;
    padding: 11px 13px;
    border: 1px solid var(--border);
    border-radius: 9px;
    color: var(--ink-strong);
    background: var(--surface);
}

.auth-card input:focus,
.search-field input:focus {
    outline: 3px solid rgba(82, 48, 137, 0.13);
    border-color: var(--pscx-purple);
}

.auth-card button,
.auth-card .button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 48px;
    margin-top: 24px;
    padding: 11px 18px;
    border: 0;
    border-radius: 9px;
    color: #fff;
    background: var(--pscx-purple);
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
}

.auth-card .button-secondary {
    color: var(--pscx-dark-blue);
    background: var(--surface-muted);
}

.status-icon {
    display: grid;
    place-items: center;
    width: 54px;
    height: 54px;
    margin-bottom: 20px;
    border-radius: 50%;
    color: #fff;
    font-size: 1.7rem;
    font-weight: 700;
}

.status-success {
    background: var(--pscx-green);
}

.status-error {
    background: var(--pscx-red);
}

.status-warning {
    background: #bd7b12;
}

.application-body {
    background: #f5f5f7;
}

.application-layout {
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
}


.mobile-header,
.sidebar-backdrop {
    display: none;
}

.sidebar {
    position: sticky;
    top: 0;
    width: var(--sidebar-width);
    height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 26px 18px 20px;
    border-right: 1px solid var(--border);
    background: var(--surface);
    opacity: 1;
    transform: translateX(0);
    visibility: visible;
    transition:
        opacity 160ms ease,
        transform 220ms ease,
        visibility 220ms ease;
}

.application-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0 6px 32px;
    text-decoration: none;
}

.application-brand-mark {
    display: grid;
    place-items: center;
    width: 50px;
    height: 40px;
    border-radius: 9px;
    color: #fff;
    background: var(--pscx-purple);
    font-size: 0.83rem;
    font-weight: 800;
    letter-spacing: 0.08em;
}

.application-brand-copy {
    display: grid;
    gap: 2px;
}

.application-brand-copy strong {
    color: var(--ink-strong);
    font-size: 0.94rem;
}

.application-brand-copy small {
    color: var(--ink-muted);
    font-size: 0.75rem;
}

.primary-navigation {
    display: grid;
    gap: 6px;
}

.navigation-link {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 46px;
    padding: 10px 12px;
    border-radius: 9px;
    color: #60616b;
    font-size: 0.91rem;
    font-weight: 600;
    text-decoration: none;
    transition:
        background 150ms ease,
        color 150ms ease;
}

.navigation-link:hover {
    color: var(--ink-strong);
    background: var(--surface-soft);
}

.navigation-link.is-active {
    color: var(--pscx-purple);
    background: rgba(82, 48, 137, 0.085);
}

.navigation-icon {
    display: grid;
    place-items: center;
    width: 20px;
    height: 20px;
    flex: 0 0 20px;
}

.navigation-icon svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.sidebar-footer {
    display: grid;
    gap: 4px;
    margin-top: auto;
    padding: 18px 10px 0;
    border-top: 1px solid var(--border);
    color: var(--ink-muted);
}

.environment-label {
    font-size: 0.76rem;
    font-weight: 700;
}

.sidebar-footer small {
    font-size: 0.72rem;
}

.application-main {
    min-width: 0;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 30;
    min-height: 92px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 20px 34px;
    border-bottom: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 6px 18px rgba(23, 28, 115, 0.055);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.topbar-leading {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 16px;
}

.desktop-menu-toggle {
    width: 42px;
    height: 42px;
    display: grid;
    place-content: center;
    flex: 0 0 42px;
    gap: 5px;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 9px;
    color: var(--ink-strong);
    background: var(--surface);
    cursor: pointer;
    transition:
        border-color 150ms ease,
        background 150ms ease,
        color 150ms ease;
}

.desktop-menu-toggle:hover {
    border-color: rgba(82, 48, 137, 0.32);
    color: var(--pscx-purple);
    background: rgba(82, 48, 137, 0.055);
}

.desktop-menu-toggle:focus-visible {
    outline: 3px solid rgba(57, 147, 218, 0.3);
    outline-offset: 2px;
}

.desktop-menu-toggle span {
    width: 19px;
    height: 2px;
    border-radius: 999px;
    background: currentColor;
    transition:
        transform 180ms ease,
        opacity 180ms ease;
}

.topbar-title {
    display: grid;
    gap: 3px;
}

.page-eyebrow,
.section-label {
    color: var(--pscx-purple);
    font-size: 0.72rem;
    font-weight: 750;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.topbar h1 {
    margin: 0;
    color: var(--ink-strong);
    font-size: 1.62rem;
    line-height: 1.2;
}

.user-summary {
    display: flex;
    align-items: center;
    gap: 11px;
}

.user-avatar {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    color: var(--pscx-purple);
    background: rgba(82, 48, 137, 0.1);
    font-size: 0.78rem;
    font-weight: 800;
}

.user-copy {
    display: grid;
    gap: 2px;
    min-width: 140px;
}

.user-copy strong {
    color: var(--ink-strong);
    font-size: 0.85rem;
}

.user-copy small {
    color: var(--ink-muted);
    font-size: 0.73rem;
}

.sign-out-button {
    min-height: 34px;
    padding: 7px 11px;
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--ink);
    background: var(--surface);
    font-size: var(--button-font-size);
    font-weight: 650;
    cursor: pointer;
}

.sign-out-button:hover {
    border-color: #cfcfd6;
    background: var(--surface-soft);
}

.application-content {
    width: calc(100% - 40px);
    max-width: none;
    min-width: 0;
    margin: 0 auto;
    padding: 28px 0;
}

.application-content > * {
    min-width: 0;
}

.dashboard-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 28px;
    padding: 32px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background:
        linear-gradient(
            110deg,
            rgba(82, 48, 137, 0.045),
            rgba(57, 147, 218, 0.025)
        ),
        var(--surface);
    box-shadow: 0 8px 24px rgba(29, 25, 45, 0.035);
}

.dashboard-hero h2,
.page-introduction h2,
.panel-heading h2 {
    margin: 6px 0 8px;
    color: var(--ink-strong);
    font-size: 1.5rem;
    line-height: 1.25;
}

.dashboard-hero p,
.page-introduction p {
    max-width: 670px;
    margin: 0;
    color: var(--ink-muted);
    line-height: 1.65;
}

.primary-action {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 10px 17px;
    border-radius: 9px;
    color: #fff;
    background: var(--pscx-purple);
    font-size: var(--button-font-size);
    font-weight: 700;
    text-decoration: none;
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin-top: 20px;
}

.summary-card {
    min-height: 150px;
    display: grid;
    align-content: space-between;
    padding: 22px;
    border: 1px solid var(--border);
    border-radius: 14px;
    color: inherit;
    background: var(--surface);
    text-decoration: none;
    transition:
        transform 150ms ease,
        box-shadow 150ms ease;
}

.summary-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.summary-card-label {
    color: var(--ink);
    font-size: 0.82rem;
    font-weight: 700;
}

.summary-card strong {
    color: var(--pscx-purple);
    font-size: 2rem;
    line-height: 1;
}

.summary-card small {
    color: var(--ink-muted);
    font-size: 0.76rem;
}

.summary-card.is-muted strong {
    color: #a0a1aa;
}

.content-panel {
    margin-top: 20px;
    padding: 26px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--surface);
}

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

.panel-heading {
    align-items: center;
    margin-bottom: 18px;
}

.panel-heading h2 {
    margin-bottom: 0;
    font-size: 1.18rem;
}

.text-link {
    color: var(--pscx-purple);
    font-size: var(--button-font-size);
    font-weight: 700;
    text-decoration: none;
}

.compact-client-list {
    display: grid;
}

.compact-client-row {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 13px;
    padding: 14px 0;
    border-top: 1px solid var(--border);
}

.client-monogram {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: 9px;
    color: var(--pscx-purple);
    background: rgba(82, 48, 137, 0.08);
    font-size: 0.82rem;
    font-weight: 800;
}

.compact-client-copy {
    display: grid;
    gap: 3px;
}

.compact-client-copy strong,
.client-name-cell strong {
    color: var(--ink-strong);
    font-size: 0.87rem;
}

.compact-client-copy small {
    color: var(--ink-muted);
    font-size: 0.75rem;
}

.status-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 25px;
    padding: 4px 9px;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 750;
}

.status-active {
    color: #057963;
    background: rgba(0, 168, 132, 0.1);
}

.status-prospect {
    color: #8a5b08;
    background: rgba(189, 123, 18, 0.11);
}

.page-introduction {
    margin-bottom: 20px;
}

.record-count {
    flex: 0 0 auto;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 999px;
    color: var(--ink-muted);
    background: var(--surface);
    font-size: 0.75rem;
    font-weight: 700;
}

.client-directory {
    padding: 0;
    overflow: hidden;
}

.table-toolbar {
    padding: 20px 22px;
    border-bottom: 1px solid var(--border);
}

.search-field {
    display: grid;
    gap: 7px;
    width: min(100%, 390px);
}

.search-field span {
    color: var(--ink);
    font-size: 0.76rem;
    font-weight: 700;
}

.search-field input {
    width: 100%;
    min-height: 42px;
    padding: 9px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--ink-strong);
    background: var(--surface);
}

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

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

th,
td {
    padding: 15px 22px;
    border-bottom: 1px solid var(--border);
    text-align: left;
    white-space: nowrap;
}

th {
    color: var(--ink-muted);
    background: #fbfbfc;
    font-size: 0.7rem;
    font-weight: 750;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

td {
    color: var(--ink);
    font-size: 0.82rem;
}

tbody tr:last-child td {
    border-bottom: 0;
}

tbody tr:hover {
    background: #fcfcfd;
}

.client-name-cell {
    display: flex;
    align-items: center;
    gap: 11px;
}

.client-code {
    color: var(--pscx-dark-blue);
    font-size: 0.72rem;
    font-weight: 750;
    letter-spacing: 0.04em;
}

.empty-workspace {
    min-height: 420px;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 18px;
    padding: 40px;
    border: 1px dashed #d7d7dd;
    border-radius: 16px;
    color: var(--ink-muted);
    background: rgba(255, 255, 255, 0.6);
    text-align: center;
}

.empty-workspace-line {
    width: 52px;
    height: 3px;
    border-radius: 999px;
    background: rgba(82, 48, 137, 0.35);
}

.empty-workspace p {
    max-width: 420px;
    margin: 0;
    font-size: 0.88rem;
    line-height: 1.6;
}

@media (min-width: 851px) {
    .application-layout {
        grid-template-columns: minmax(0, 1fr);
    }

    .application-main {
        grid-column: 1;
        width: 100%;
    }

    .sidebar {
        position: fixed;
        inset: 0 auto 0 0;
        z-index: 60;
        opacity: 0;
        transform: translateX(-100%);
        visibility: hidden;
        pointer-events: none;
        box-shadow: 18px 0 42px rgba(23, 28, 115, 0.16);
    }

    body.sidebar-hover-open .sidebar {
        opacity: 1;
        transform: translateX(0);
        visibility: visible;
        pointer-events: auto;
    }
}

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

@media (max-width: 850px) {
    .desktop-menu-toggle {
        display: none;
    }

    .application-layout {
        display: block;
        padding-top: 68px;
    }

    .mobile-header {
        position: fixed;
        inset: 0 0 auto 0;
        z-index: 40;
        min-height: 68px;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 18px;
        padding: 12px 18px;
        border-bottom: 1px solid var(--border);
        background: rgba(255, 255, 255, 0.97);
        backdrop-filter: blur(12px);
    }

    .mobile-brand {
        display: flex;
        align-items: center;
        gap: 10px;
        color: var(--ink-strong);
        font-size: 0.88rem;
        font-weight: 750;
        text-decoration: none;
    }

    .mobile-brand .application-brand-mark {
        width: 46px;
        height: 36px;
    }

    .menu-toggle {
        width: 42px;
        height: 42px;
        display: grid;
        place-content: center;
        gap: 5px;
        padding: 0;
        border: 1px solid var(--border);
        border-radius: 9px;
        background: var(--surface);
        cursor: pointer;
    }

    .menu-toggle span {
        width: 19px;
        height: 2px;
        border-radius: 999px;
        background: var(--ink-strong);
        transition:
            transform 180ms ease,
            opacity 180ms ease;
    }

    .menu-toggle[aria-expanded="true"] span:nth-child(1) {
        transform: translateY(7px) rotate(45deg);
    }

    .menu-toggle[aria-expanded="true"] span:nth-child(2) {
        opacity: 0;
    }

    .menu-toggle[aria-expanded="true"] span:nth-child(3) {
        transform: translateY(-7px) rotate(-45deg);
    }

    .sidebar {
        position: fixed;
        inset: 0 auto 0 0;
        z-index: 60;
        width: min(86vw, 310px);
        height: 100vh;
        padding: 24px 18px 20px;
        border-right: 1px solid var(--border);
        border-bottom: 0;
        transform: translateX(-105%);
        transition: transform 200ms ease;
        box-shadow: 18px 0 50px rgba(29, 25, 45, 0.14);
    }

    body.menu-open {
        overflow: hidden;
    }

    body.menu-open .sidebar {
        transform: translateX(0);
    }

    .sidebar-backdrop {
        position: fixed;
        inset: 0;
        z-index: 50;
        display: block;
        border: 0;
        background: rgba(19, 19, 28, 0.34);
        opacity: 0;
        pointer-events: none;
        transition: opacity 180ms ease;
    }

    body.menu-open .sidebar-backdrop {
        opacity: 1;
        pointer-events: auto;
    }

    .application-brand {
        margin: 0 6px 28px;
    }

    .primary-navigation {
        display: grid;
        gap: 6px;
        overflow: visible;
        padding-bottom: 0;
    }

    .navigation-link {
        flex: none;
    }

    .sidebar-footer {
        display: grid;
    }

    .topbar {
        position: static;
        z-index: auto;
        min-height: auto;
        padding: 18px 22px;
        box-shadow: none;
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
    }

    .topbar-leading {
        width: 100%;
    }

    .topbar-title .page-eyebrow {
        display: none;
    }

    .application-content {
        width: calc(100% - 32px);
        padding: 22px 0;
    }
}

@media (max-width: 650px) {
    .topbar {
        align-items: flex-start;
        flex-direction: column;
    }

    .user-summary {
        width: 100%;
    }

    .user-summary form {
        margin-left: auto;
    }

    .user-copy {
        min-width: 0;
    }

    .dashboard-hero,
    .page-introduction {
        align-items: flex-start;
        flex-direction: column;
    }

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

    .primary-action {
        width: 100%;
    }

    .content-panel {
        padding: 20px;
    }

    .client-directory {
        padding: 0;
    }

    .auth-card {
        padding: 28px 22px;
    }
}


.client-row[hidden] {
    display: none;
}

.no-results-row td {
    padding: 0;
}

.no-results-message {
    display: grid;
    justify-items: center;
    gap: 6px;
    padding: 50px 24px;
    color: var(--ink-muted);
    text-align: center;
}

.no-results-message strong {
    color: var(--ink-strong);
    font-size: 0.92rem;
}

.no-results-message span {
    font-size: 0.78rem;
}


.client-primary-copy {
    display: grid;
    gap: 3px;
}

.client-primary-copy small {
    color: var(--ink-muted);
    font-size: 0.72rem;
}

.status-neutral {
    color: #62636d;
    background: #eeeeF2;
}

.dashboard-empty-state {
    padding: 34px 20px;
    border-top: 1px solid var(--border);
    color: var(--ink-muted);
    font-size: 0.84rem;
    text-align: center;
}


.client-monogram[style] {
    color: var(--client-colour);
    background: color-mix(
        in srgb,
        var(--client-colour) 11%,
        white
    );
}

.table-primary-value,
.table-secondary-value {
    display: block;
}

.table-primary-value {
    color: var(--ink);
}

.table-secondary-value {
    margin-top: 3px;
    color: var(--ink-muted);
    font-size: 0.71rem;
}


.clickable-row {
    cursor: pointer;
}

.clickable-row:focus {
    outline: 2px solid var(--pscx-purple);
    outline-offset: -2px;
}

.client-detail-link {
    color: inherit;
    text-decoration: none;
}

.client-detail-link:hover {
    color: var(--pscx-purple);
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 18px;
    color: var(--ink-muted);
    font-size: 0.78rem;
}

.breadcrumb a {
    color: var(--pscx-purple);
    font-weight: 700;
    text-decoration: none;
}

.client-detail-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 28px;
    padding: 26px 28px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: var(--surface);
}

.client-detail-identity {
    display: flex;
    align-items: center;
    gap: 18px;
    min-width: 0;
}

.client-detail-monogram {
    display: grid;
    place-items: center;
    width: 62px;
    height: 62px;
    flex: 0 0 62px;
    border-radius: 14px;
    color: var(--client-colour, var(--pscx-purple));
    background: color-mix(
        in srgb,
        var(--client-colour, var(--pscx-purple)) 11%,
        white
    );
    font-size: 1.35rem;
    font-weight: 800;
}

.client-detail-hero h2 {
    margin: 5px 0 8px;
    color: var(--ink-strong);
    font-size: 1.65rem;
    line-height: 1.2;
}

.client-detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

.client-detail-meta span {
    padding: 5px 8px;
    border-radius: 6px;
    color: var(--ink-muted);
    background: var(--surface-soft);
    font-size: 0.72rem;
    font-weight: 650;
}

.client-detail-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    margin-top: 18px;
}

.detail-card {
    min-width: 0;
    padding: 24px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--surface);
}

.detail-card-heading {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.detail-card-heading h3 {
    margin: 4px 0 0;
    color: var(--ink-strong);
    font-size: 1.02rem;
}

.detail-card-icon {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    flex: 0 0 36px;
    border-radius: 9px;
    color: var(--pscx-purple);
    background: rgba(82, 48, 137, 0.08);
    font-size: 0.78rem;
    font-weight: 800;
}

.client-address {
    display: grid;
    gap: 5px;
    color: var(--ink);
    font-style: normal;
    line-height: 1.45;
}

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

.detail-list > div {
    display: grid;
    grid-template-columns: minmax(130px, 0.8fr) minmax(0, 1.2fr);
    gap: 16px;
    padding: 12px 0;
    border-top: 1px solid var(--border);
}

.detail-list > div:first-child {
    padding-top: 0;
    border-top: 0;
}

.detail-list dt {
    color: var(--ink-muted);
    font-size: 0.75rem;
    font-weight: 650;
}

.detail-list dd {
    min-width: 0;
    margin: 0;
    color: var(--ink-strong);
    font-size: 0.8rem;
    font-weight: 650;
    overflow-wrap: anywhere;
}

.detail-list dd a {
    color: var(--pscx-purple);
    text-decoration: none;
}

.colour-value {
    display: flex;
    align-items: center;
    gap: 7px;
}

.colour-swatch {
    width: 14px;
    height: 14px;
    flex: 0 0 14px;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 4px;
    background-color: #d8d8de;
}

.client-notes,
.detail-empty {
    margin: 0;
    line-height: 1.65;
}

.client-notes {
    color: var(--ink);
}

.detail-empty {
    color: var(--ink-muted);
    font-style: italic;
}

@media (max-width: 760px) {
    .client-detail-hero {
        align-items: flex-start;
        flex-direction: column;
    }

    .client-detail-grid {
        grid-template-columns: 1fr;
    }

    .detail-card-wide {
        grid-column: auto;
    }
}

@media (max-width: 520px) {
    .client-detail-identity {
        align-items: flex-start;
    }

    .client-detail-monogram {
        width: 50px;
        height: 50px;
        flex-basis: 50px;
    }

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


.client-detail-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.secondary-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 9px 15px;
    border: 1px solid var(--border);
    border-radius: 9px;
    color: var(--ink-strong);
    background: var(--surface);
    font-size: 0.82rem;
    font-weight: 700;
    text-decoration: none;
}

.secondary-action:hover {
    border-color: #cfcfd6;
    background: var(--surface-soft);
}

.success-banner,
.form-error-summary {
    margin-bottom: 18px;
    padding: 14px 16px;
    border-radius: 10px;
    font-size: 0.82rem;
    line-height: 1.5;
}

.success-banner {
    border: 1px solid rgba(0, 168, 132, 0.28);
    color: #057963;
    background: rgba(0, 168, 132, 0.08);
}

.form-error-summary {
    border: 1px solid rgba(242, 89, 99, 0.34);
    color: #8f2530;
    background: rgba(242, 89, 99, 0.08);
}

.form-error-summary strong {
    color: #761d27;
}

.form-error-summary ul {
    margin: 8px 0 0;
    padding-left: 20px;
}

.edit-page-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 18px;
}

.edit-page-heading h2 {
    margin: 6px 0 8px;
    color: var(--ink-strong);
    font-size: 1.5rem;
}

.edit-page-heading p {
    margin: 0;
    color: var(--ink-muted);
    line-height: 1.6;
}

.client-edit-form {
    display: grid;
    gap: 18px;
}

.edit-form-card {
    padding: 24px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--surface);
}

.edit-form-heading {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 22px;
}

.edit-form-heading h3 {
    margin: 4px 0 0;
    color: var(--ink-strong);
    font-size: 1.02rem;
}

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

.form-field {
    display: grid;
    align-content: start;
    gap: 7px;
    min-width: 0;
}

.form-field-wide {
    grid-column: 1 / -1;
}

.form-field > span:first-child {
    color: var(--ink-strong);
    font-size: 0.76rem;
    font-weight: 700;
}

.form-field input,
.form-field textarea,
.form-field select {
    width: 100%;
    min-height: 43px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--ink-strong);
    background: var(--surface);
}

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

.form-field input:focus,
.form-field textarea:focus,
.form-field select:focus {
    outline: 3px solid rgba(82, 48, 137, 0.13);
    border-color: var(--pscx-purple);
}

.form-field small {
    color: var(--ink-muted);
    font-size: 0.69rem;
    line-height: 1.4;
}

.colour-input-group {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 54px;
    gap: 8px;
}

.form-colour-picker {
    width: 54px;
    min-height: 43px;
    padding: 3px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
    cursor: pointer;
}

.form-colour-picker:hover {
    border-color: var(--pscx-purple);
}

.form-colour-picker:focus {
    outline: 3px solid rgba(82, 48, 137, 0.13);
    border-color: var(--pscx-purple);
}

.form-colour-picker::-webkit-color-swatch-wrapper {
    padding: 0;
}

.form-colour-picker::-webkit-color-swatch {
    border: 0;
    border-radius: 5px;
}

.form-colour-picker::-moz-color-swatch {
    border: 0;
    border-radius: 5px;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding-bottom: 8px;
}

.form-actions .primary-action,
.form-actions .secondary-action {
    min-width: 130px;
}

.form-actions button.primary-action {
    border: 0;
    cursor: pointer;
}

@media (max-width: 760px) {
    .client-detail-actions,
    .edit-page-heading {
        width: 100%;
        align-items: stretch;
        flex-direction: column;
    }

    .client-detail-actions .secondary-action {
        width: 100%;
    }

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

    .form-field-wide {
        grid-column: auto;
    }
}

@media (max-width: 520px) {
    .form-actions {
        flex-direction: column-reverse;
    }

    .form-actions .primary-action,
    .form-actions .secondary-action {
        width: 100%;
    }
}


.projects-page-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 24px 26px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--surface);
}

.projects-page-heading h2 {
    margin: 5px 0 7px;
    color: var(--ink-strong);
    font-size: 1.45rem;
}

.projects-page-heading p {
    margin: 0;
    color: var(--ink-muted);
    font-size: 0.8rem;
}

.project-tabs {
    display: flex;
    gap: 8px;
    margin: 18px 0;
    padding: 5px;
    border: 1px solid var(--border);
    border-radius: 11px;
    background: var(--surface);
}

.project-tab {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    min-height: 43px;
    padding: 9px 16px;
    border-radius: 8px;
    color: var(--ink-muted);
    font-size: 0.8rem;
    font-weight: 700;
    text-decoration: none;
}

.project-tab strong {
    display: grid;
    place-items: center;
    min-width: 25px;
    height: 23px;
    padding: 0 7px;
    border-radius: 999px;
    color: var(--ink-strong);
    background: var(--surface-soft);
    font-size: 0.7rem;
}

.project-tab:hover {
    color: var(--ink-strong);
    background: var(--surface-soft);
}

.project-tab.is-active {
    color: white;
    background: var(--pscx-purple);
}

.project-tab.is-active strong {
    color: var(--pscx-purple);
    background: white;
}

.project-list-panel {
    overflow: hidden;
}

.project-empty-state {
    display: grid;
    justify-items: center;
    gap: 6px;
    padding: 52px 24px;
    border-top: 1px solid var(--border);
    color: var(--ink-muted);
    text-align: center;
}

.project-empty-state strong {
    color: var(--ink-strong);
    font-size: 0.92rem;
}

.project-empty-state span {
    font-size: 0.78rem;
}

.project-name-cell {
    display: flex;
    align-items: flex-start;
    gap: 11px;
    min-width: 250px;
}

.project-colour {
    width: 13px;
    height: 38px;
    flex: 0 0 13px;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 4px;
    background: #d8d8de;
}

.project-primary-copy {
    display: grid;
    gap: 3px;
}

.project-primary-copy strong {
    color: var(--ink-strong);
}

.project-primary-copy small {
    color: var(--pscx-purple);
    font-size: 0.7rem;
    font-weight: 750;
}

.project-primary-copy > span {
    max-width: 420px;
    color: var(--ink-muted);
    font-size: 0.72rem;
    line-height: 1.45;
}

.project-table td {
    vertical-align: top;
}

@media (max-width: 760px) {
    .projects-page-heading {
        align-items: stretch;
        flex-direction: column;
    }

    .projects-page-heading > .secondary-action {
        width: 100%;
    }

    .project-tabs {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 520px) {
    .project-tabs {
        grid-template-columns: 1fr;
    }
}


.project-detail-link {
    color: inherit;
    text-decoration: none;
}

.project-detail-link:hover {
    color: var(--pscx-purple);
}

.project-detail-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 28px;
    padding: 26px 28px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: var(--surface);
}

.project-detail-identity {
    display: flex;
    align-items: stretch;
    gap: 18px;
    min-width: 0;
}

.project-detail-colour {
    width: 15px;
    min-height: 72px;
    flex: 0 0 15px;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 5px;
    background: #d8d8de;
}

.project-detail-hero h2 {
    margin: 5px 0 8px;
    color: var(--ink-strong);
    font-size: 1.65rem;
    line-height: 1.2;
}

.project-detail-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.project-detail-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    margin-top: 18px;
}

.project-description-card {
    grid-column: 1 / -1;
}

@media (max-width: 760px) {
    .project-detail-hero {
        align-items: flex-start;
        flex-direction: column;
    }

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

    .project-detail-actions .secondary-action {
        width: 100%;
    }

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

    .project-description-card {
        grid-column: auto;
    }
}


.project-edit-form select {
    cursor: pointer;
}

.project-edit-form input[type="datetime-local"] {
    font-variant-numeric: tabular-nums;
}


.form-field input[readonly] {
    color: var(--ink-muted);
    background: var(--surface-soft);
    cursor: not-allowed;
}


.client-tabs {
    display: flex;
    gap: 8px;
    margin: 0 0 18px;
    padding: 5px;
    border: 1px solid var(--border);
    border-radius: 11px;
    background: var(--surface);
}

.client-tab {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    min-height: 43px;
    padding: 9px 16px;
    border: 0;
    border-radius: 8px;
    color: var(--ink-muted);
    background: transparent;
    font: inherit;
    font-size: var(--button-font-size);
    font-weight: 700;
    cursor: pointer;
}

.client-tab strong {
    display: grid;
    place-items: center;
    min-width: 25px;
    height: 23px;
    padding: 0 7px;
    border-radius: 999px;
    color: var(--ink-strong);
    background: var(--surface-soft);
    font-size: 0.7rem;
}

.client-tab:hover {
    color: var(--ink-strong);
    background: var(--surface-soft);
}

.client-tab:focus-visible {
    outline: 3px solid rgba(82, 48, 137, 0.22);
    outline-offset: 2px;
}

.client-tab.is-active {
    color: white;
    background: var(--pscx-purple);
}

.client-tab.is-active strong {
    color: var(--pscx-purple);
    background: white;
}

@media (max-width: 520px) {
    .client-tabs {
        display: grid;
        grid-template-columns: 1fr;
    }
}


.page-introduction-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    flex: 0 0 auto;
}

@media (max-width: 760px) {
    .page-introduction-actions {
        width: 100%;
        align-items: stretch;
        flex-direction: column;
    }

    .page-introduction-actions .primary-action,
    .client-detail-actions .primary-action {
        width: 100%;
    }
}


.billing-form-card {
    display: grid;
    gap: 22px;
}

.billing-change-warning {
    margin: 0;
    padding: 12px 14px;
    border: 1px solid #e0b35b;
    border-radius: 9px;
    background: #fff9e9;
    color: #6f5215;
    font-size: 0.76rem;
    line-height: 1.5;
}

.billing-type-panel {
    padding: 19px;
    border: 1px solid var(--border);
    border-radius: 11px;
    background: var(--surface-soft);
}

.billing-panel-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 18px;
}

.billing-panel-heading h4,
.milestone-editor-heading h4 {
    margin: 4px 0 0;
    color: var(--ink-strong);
    font-size: 0.96rem;
}

.billing-panel-heading p {
    max-width: 440px;
    margin: 0;
    color: var(--ink-muted);
    font-size: 0.74rem;
    line-height: 1.5;
}

.billing-footer-fields {
    padding-top: 2px;
}

.milestone-editor {
    display: grid;
    gap: 12px;
    margin-top: 20px;
}

.milestone-editor-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.compact-action {
    min-height: 35px;
    padding: 7px 12px;
    font-size: 0.72rem;
}

.milestone-row {
    display: grid;
    grid-template-columns: 28px minmax(130px, 0.7fr)
        minmax(140px, 0.8fr) minmax(220px, 1.8fr) 36px;
    align-items: end;
    gap: 10px;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 9px;
    background: var(--surface);
}

.milestone-number {
    display: grid;
    place-items: center;
    width: 25px;
    height: 25px;
    align-self: center;
    border-radius: 999px;
    background: rgba(82, 48, 137, 0.1);
    color: var(--pscx-purple);
    font-size: 0.7rem;
    font-weight: 800;
}

.milestone-remove {
    display: grid;
    place-items: center;
    width: 34px;
    height: 38px;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
    color: var(--pscx-red);
    cursor: pointer;
    font-size: 1.25rem;
    line-height: 1;
}

.milestone-remove:hover {
    border-color: var(--pscx-red);
    background: rgba(242, 89, 99, 0.08);
}

.project-milestones-card {
    grid-column: 1 / -1;
}

.milestone-table th,
.milestone-table td {
    padding: 13px 15px;
}

.milestone-table tfoot th,
.milestone-table tfoot td {
    border-top: 2px solid var(--border);
    color: var(--ink-strong);
    font-weight: 800;
}

.numeric-cell {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

@media (max-width: 900px) {
    .milestone-row {
        grid-template-columns: 28px 1fr 1fr 36px;
    }

    .milestone-description {
        grid-column: 2 / 4;
    }
}

@media (max-width: 620px) {
    .billing-panel-heading,
    .milestone-editor-heading {
        align-items: stretch;
        flex-direction: column;
    }

    .milestone-row {
        grid-template-columns: 28px 1fr 36px;
    }

    .milestone-row .form-field,
    .milestone-description {
        grid-column: 2 / 3;
    }

    .milestone-number {
        grid-column: 1;
        grid-row: 1;
    }

    .milestone-remove {
        grid-column: 3;
        grid-row: 1;
    }
}


/*
 * Button typography standard
 *
 * Active Clients is the reference size. Apply the same 0.8rem label size to
 * native buttons and links styled as application actions.
 */
button,
.primary-action,
.secondary-action,
.auth-card .button,
.client-tab,
.sign-out-button {
    font-size: var(--button-font-size);
}


/* PSCXUP v4.1.0.8 responsive-width authenticated workspace */
.application-content .page-introduction,
.application-content .content-panel,
.application-content .client-directory {
    width: 100%;
}

@media (min-width: 1100px) {
    .application-content {
        width: 90%;
    }
}

@media (min-width: 1600px) {
    .application-content {
        width: 80%;
    }

    .page-introduction p,
    .dashboard-hero p {
        max-width: 820px;
    }
}

.retainer-line-editor .inline-actions{display:flex;gap:8px;flex-wrap:wrap}.retainer-line-editor .field-note{margin:0 0 14px;color:var(--ink-muted);font-size:.75rem}

/*
 * Desktop navigation hover bridge.
 * Keeps the pointer path between the menu control and the overlay sidebar
 * inside the active navigation area.
 */
@media (min-width: 851px) {
    body.sidebar-hover-open .sidebar::after {
        content: "";
        position: absolute;
        top: 0;
        right: -18px;
        width: 18px;
        height: 100%;
    }
}
