/* Espace Client Qualia — scoped styles */

/* Disable intrusive full-screen blue loader inside client portal */
.client-portal .q-page-loader,
.client-portal .q-page-transition,
.q-page-loader,
.q-page-transition {
    display: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
}

/* Top progress bar */
.client-page-progress {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    height: 2px;
    background: transparent;
    pointer-events: none;
    opacity: 0;
    transition: opacity .15s ease;
}

.client-page-progress.is-active {
    opacity: 1;
}

.client-page-progress__bar {
    height: 100%;
    width: 100%;
    background: linear-gradient(90deg, #d4a373, #c9a962);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform .25s ease-out;
}

.client-portal * {
    box-sizing: border-box;
}

.client-portal {
    --cp-primary: #0a1628;
    --cp-accent: #d4a373;
    --cp-surface: #f7f7f7;
    --cp-text: #1a1a1a;
    --cp-muted: #6b7280;
    --cp-border: #e5e7eb;
    --cp-success: #10b981;
    --cp-error: #ef4444;
    --cp-radius: 8px;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: var(--cp-text);
    line-height: 1.5;
}

.client-portal--auth {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: linear-gradient(135deg, #0a1628 0%, #1c2b45 100%);
}

.client-portal__card {
    width: 100%;
    max-width: 480px;
    background: #fff;
    padding: 2.5rem;
    border-radius: var(--cp-radius);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}

.client-portal__card h1 {
    font-size: 1.5rem;
    margin: 0 0 0.25rem;
    color: var(--cp-primary);
}

.client-portal__card h2 {
    font-size: 1.125rem;
    margin: 0 0 1.5rem;
    font-weight: 500;
    color: var(--cp-muted);
}

.client-form__group {
    margin-bottom: 1.25rem;
}

.client-form__row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.client-form label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
}

.client-form input,
.client-form textarea,
.client-form select {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--cp-border);
    border-radius: var(--cp-radius);
    font: inherit;
    background: #fff;
}

.client-form input:focus,
.client-form textarea:focus,
.client-form select:focus {
    outline: 2px solid var(--cp-accent);
    border-color: var(--cp-accent);
}

.client-form input:disabled {
    background: var(--cp-surface);
    color: var(--cp-muted);
}

.client-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.875rem 1.5rem;
    border: none;
    border-radius: var(--cp-radius);
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    background: var(--cp-accent);
    color: #fff;
    transition: opacity 0.2s;
}

.client-btn:hover {
    opacity: 0.92;
}

.client-btn--secondary {
    background: var(--cp-primary);
}

.client-btn--small {
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
}

.client-error {
    color: var(--cp-error);
    font-size: 0.875rem;
    margin: 0.25rem 0 0;
}

.client-flash {
    padding: 0.875rem 1rem;
    border-radius: var(--cp-radius);
    margin: 0 0 1rem;
}

.client-flash--success {
    background: #d1fae5;
    color: #065f46;
}

.client-flash--error {
    background: #fee2e2;
    color: #991b1b;
}

.client-portal__links {
    text-align: center;
    margin: 1.5rem 0 0;
    font-size: 0.875rem;
}

.client-portal__links a {
    color: var(--cp-primary);
    text-decoration: underline;
}

.client-portal--app {
    display: flex;
    min-height: 100vh;
    background: var(--cp-surface);
}

.client-portal__sidebar {
    width: 260px;
    background: #fff;
    border-right: 1px solid var(--cp-border);
    padding: 2rem 0;
    position: fixed;
    left: 0;
    z-index: 50;
    transition: width .25s ease, top .25s ease, height .25s ease;
}

.client-portal__nav {
    display: flex;
    flex-direction: column;
}

.client-portal__nav-link {
    padding: 0.875rem 1.5rem;
    color: var(--cp-text);
    text-decoration: none;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: none;
    border: none;
    width: 100%;
    text-align: left;
    font: inherit;
    cursor: pointer;
}

.client-portal__nav-link:hover,
.client-portal__nav-link--active {
    background: var(--cp-surface);
    color: var(--cp-primary);
    border-left: 3px solid var(--cp-accent);
}

.client-portal__nav-link--logout {
    color: var(--cp-error);
}

.client-portal__main {
    flex: 1;
    margin-left: 260px;
    padding: 2rem;
    max-width: calc(100% - 260px);
    transition: margin-left .25s ease, max-width .25s ease;
}

.client-page__title {
    font-size: 1.75rem;
    margin: 0 0 1.5rem;
}

.client-dashboard.client-dashboard--premium {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 2rem;
    max-width: 1280px;
}

.client-dashboard__body {
    min-width: 0;
}

.client-dashboard__aside {
    min-width: 0;
}

.client-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.client-stat {
    background: #fff;
    padding: 1.5rem;
    border-radius: var(--cp-radius);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.client-stat__value {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    color: var(--cp-primary);
}

.client-stat__label {
    font-size: 0.875rem;
    color: var(--cp-muted);
}

.client-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

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

.client-card {
    background: #fff;
    padding: 1.5rem;
    border-radius: var(--cp-radius);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    margin-bottom: 1.5rem;
}

.client-card__title {
    font-size: 1.125rem;
    margin: 0 0 1rem;
    font-weight: 600;
}

.client-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.client-list__item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.875rem 0;
    border-bottom: 1px solid var(--cp-border);
}

.client-list__item:last-child {
    border-bottom: none;
}

.client-list__item a {
    color: var(--cp-primary);
    text-decoration: none;
    font-weight: 500;
}

.client-list__item--unread a {
    font-weight: 700;
}

.client-list--notifications .client-list__item {
    align-items: flex-start;
}

.client-list__link {
    font-weight: 600;
}

.client-empty {
    color: var(--cp-muted);
    font-style: italic;
}

.client-link {
    display: inline-block;
    margin-top: 1rem;
    color: var(--cp-primary);
    font-weight: 500;
}

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

.client-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9375rem;
}

.client-table th,
.client-table td {
    text-align: left;
    padding: 0.875rem;
    border-bottom: 1px solid var(--cp-border);
}

.client-table th {
    font-weight: 600;
    color: var(--cp-muted);
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.client-badge {
    display: inline-block;
    padding: 0.25rem 0.625rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    background: var(--cp-surface);
    color: var(--cp-text);
}

.client-doc-type {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: var(--cp-radius);
    font-size: 0.75rem;
    font-weight: 600;
    background: var(--cp-primary);
    color: #fff;
    text-transform: uppercase;
}

.client-filters {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.client-filter {
    padding: 0.5rem 1rem;
    border: 1px solid var(--cp-border);
    border-radius: var(--cp-radius);
    color: var(--cp-text);
    text-decoration: none;
    font-size: 0.875rem;
    background: #fff;
}

.client-filter--active,
.client-filter:hover {
    background: var(--cp-primary);
    color: #fff;
    border-color: var(--cp-primary);
}

.client-tabs {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--cp-border);
}

.client-tab {
    padding: 0.75rem 0;
    color: var(--cp-muted);
    text-decoration: none;
    font-weight: 500;
}

.client-tab--active,
.client-tab:hover {
    color: var(--cp-primary);
    border-bottom: 2px solid var(--cp-accent);
}

.client-detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.client-meta {
    list-style: none;
    padding: 0;
    margin: 0 0 1.5rem;
}

.client-meta li {
    display: flex;
    justify-content: space-between;
    padding: 0.625rem 0;
    border-bottom: 1px solid var(--cp-border);
}

.client-meta span {
    color: var(--cp-muted);
}

.client-paragraph {
    margin: 0 0 1rem;
}

.client-paragraph--muted {
    color: var(--cp-muted);
}

.client-paragraph--small {
    font-size: 0.875rem;
    margin: 0.25rem 0 0;
}

.client-meta__time {
    font-size: 0.75rem;
    color: var(--cp-muted);
}

.client-back {
    display: inline-block;
    margin-bottom: 1rem;
    color: var(--cp-muted);
    text-decoration: none;
}

.client-form--narrow {
    max-width: 520px;
}

.client-inline-form {
    margin: 0;
    flex-shrink: 0;
}

.client-subtitle {
    font-size: 1rem;
    margin: 1.5rem 0 0.75rem;
    font-weight: 600;
}

@media (max-width: 900px) {
    .client-portal__sidebar {
        width: 100%;
        position: relative;
        top: 0;
        height: auto;
        left: auto;
        border-right: none;
        border-bottom: 1px solid var(--cp-border);
    }

    .client-portal__nav {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .client-portal__main {
        margin-left: 0;
        max-width: 100%;
    }

    .client-portal--app {
        flex-direction: column;
    }

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

@media (max-width: 640px) {
    .client-portal__card {
        padding: 1.5rem;
    }

    .client-portal__main {
        padding: 1rem;
    }

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

    .client-table th,
    .client-table td {
        padding: 0.625rem;
    }
}

/* ── Client authentication shell (login / register / forgot / reset) ── */

.client-auth-shell {
    display: flex;
    width: 100%;
    min-height: calc(100vh - 80px);
    background: #fff;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: #0a1628;
}

.client-auth-shell__form {
    width: 33.333%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem 4rem;
    overflow-y: auto;
    position: relative;
    z-index: 1;
}

.client-auth-shell__form-inner {
    width: 100%;
    max-width: 420px;
}

.client-auth-shell__back {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    color: #6b7280;
    text-decoration: none;
    font-size: .875rem;
    margin-bottom: 2.5rem;
    transition: color .2s;
}

.client-auth-shell__back:hover,
.client-auth-shell__back:focus {
    color: #0a1628;
}

.client-auth-shell__brand-mark {
    display: flex;
    align-items: baseline;
    gap: .35rem;
    margin-bottom: 2.5rem;
    font-family: var(--font-serif, Georgia, serif);
}

.client-auth-shell__logo {
    font-size: 1.5rem;
    font-weight: 400;
    letter-spacing: -0.02em;
    color: #0a1628;
}

.client-auth-shell__logo b {
    font-weight: 700;
}

.client-auth-shell__descriptor {
    font-size: .75rem;
    text-transform: uppercase;
    letter-spacing: .15em;
    color: #6b7280;
}

.client-auth__title {
    font-size: 2rem;
    font-weight: 600;
    margin: 0 0 .5rem;
    line-height: 1.15;
    letter-spacing: -0.02em;
}

.client-auth__lede {
    color: #6b7280;
    margin: 0 0 2rem;
    font-size: 1rem;
    line-height: 1.5;
}

.client-auth__social {
    display: flex;
    flex-direction: column;
    gap: .75rem;
    margin-bottom: 1.5rem;
}

.client-auth__social-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .75rem;
    width: 100%;
    padding: .85rem 1.25rem;
    border: 1px solid #e5e7eb;
    border-radius: var(--cp-radius, 8px);
    background: #fff;
    color: #0a1628;
    font: inherit;
    font-weight: 500;
    font-size: .9375rem;
    cursor: pointer;
    transition: background .2s, border-color .2s, box-shadow .2s;
}

.client-auth__social-btn:hover:not(:disabled),
.client-auth__social-btn:focus:not(:disabled) {
    background: #f9fafb;
    border-color: #d1d5db;
    box-shadow: 0 2px 8px rgba(0,0,0,.04);
}

.client-auth__social-btn:disabled {
    opacity: .7;
    cursor: not-allowed;
}

.client-auth__icon {
    width: 1.25rem;
    height: 1.25rem;
    flex-shrink: 0;
}

.client-auth__divider {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 1.5rem 0;
    color: #9ca3af;
    font-size: .875rem;
}

.client-auth__divider::before,
.client-auth__divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #e5e7eb;
}

.client-auth__form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.client-form__group {
    display: flex;
    flex-direction: column;
    gap: .5rem;
    margin: 0;
}

.client-form__group--half {
    flex: 1;
}

.client-form__row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.client-form__row--between {
    display: flex;
    align-items: center;
    justify-content: space-between;
    grid-template-columns: auto auto;
    gap: 0;
}

.client-form__label {
    font-size: .875rem;
    font-weight: 500;
    color: #374151;
}

.client-form__input {
    width: 100%;
    padding: .85rem 1rem;
    border: 1px solid #e5e7eb;
    border-radius: var(--cp-radius, 8px);
    font: inherit;
    font-size: .9375rem;
    color: #0a1628;
    background: #fff;
    transition: border-color .2s, box-shadow .2s;
}

.client-form__input:hover {
    border-color: #d1d5db;
}

.client-form__input:focus {
    outline: none;
    border-color: #d4a373;
    box-shadow: 0 0 0 3px rgba(212, 163, 115, .15);
}

.client-form__error {
    color: #ef4444;
    font-size: .8125rem;
    margin: 0;
}

.client-auth__forgot-link {
    font-size: .8125rem;
    color: #6b7280;
    text-decoration: none;
}

.client-auth__forgot-link:hover,
.client-auth__forgot-link:focus {
    color: #0a1628;
    text-decoration: underline;
}

.client-auth__submit {
    width: 100%;
    padding: .95rem 1.25rem;
    margin-top: .5rem;
    border: none;
    border-radius: var(--cp-radius, 8px);
    background: #0a1628;
    color: #fff;
    font: inherit;
    font-weight: 600;
    font-size: .9375rem;
    cursor: pointer;
    transition: background .2s, transform .15s;
}

.client-auth__submit:hover,
.client-auth__submit:focus {
    background: #1c2b45;
}

.client-auth__submit:active {
    transform: translateY(1px);
}

.client-auth__footer {
    margin: 1.75rem 0 0;
    text-align: center;
    color: #6b7280;
    font-size: .9375rem;
}

.client-auth__link {
    color: #0a1628;
    font-weight: 600;
    text-decoration: none;
}

.client-auth__link:hover,
.client-auth__link:focus {
    text-decoration: underline;
}

/* ── Visual panel ── */

.client-auth-shell__visual {
    width: 66.666%;
    position: relative;
    background-color: #0a1628;
    background-image: url('/assets/images/client-hero-default.webp');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    display: flex;
    align-items: flex-end;
    padding: 3rem;
}

.client-auth-shell__visual[data-client-hero="default"] {
    background-image: url('/assets/images/client-hero-default.webp');
}

.client-auth-shell__overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(10, 22, 40, 0) 0%, rgba(10, 22, 40, .75) 100%);
    pointer-events: none;
}

.client-auth-shell__visual-content {
    position: relative;
    z-index: 1;
    max-width: 540px;
    color: #fff;
}

.client-auth-shell__tagline {
    text-transform: uppercase;
    letter-spacing: .15em;
    font-size: .75rem;
    color: #d4a373;
    margin: 0 0 1rem;
}

.client-auth-shell__headline {
    font-size: 2.25rem;
    font-weight: 700;
    line-height: 1.2;
    margin: 0;
    letter-spacing: -0.02em;
    color: #fff;
    text-shadow: 0 2px 10px rgba(0, 0, 0, .35);
}

/* ── Tablet ── */
@media (max-width: 1024px) {
    .client-auth-shell__form,
    .client-auth-shell__visual {
        width: 50%;
    }

    .client-auth-shell__form {
        padding: 2.5rem;
    }

    .client-auth-shell__headline {
        font-size: 1.75rem;
    }
}

/* ── Mobile ── */
@media (max-width: 767px) {
    .client-auth-shell {
        flex-direction: column;
        min-height: auto;
    }

    .client-auth-shell__visual {
        width: 100%;
        min-height: 240px;
        order: 1;
        padding: 2rem 1.5rem;
        align-items: flex-end;
        justify-content: flex-start;
    }

    .client-auth-shell__visual-content {
        max-width: 100%;
    }

    .client-auth-shell__headline {
        font-size: 1.35rem;
        color: #fff;
    }

    .client-auth-shell__form {
        width: 100%;
        order: 2;
        padding: 2rem 1.5rem;
        align-items: flex-start;
        min-height: auto;
    }

    .client-auth-shell__form-inner {
        max-width: 100%;
    }

    .client-auth__title {
        font-size: 1.75rem;
    }

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

    .client-form__row--between {
        display: flex;
        justify-content: space-between;
    }
}

/* ── Client dossier & documents ── */

.client-page__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
}

.client-mono {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    letter-spacing: -0.03em;
}

.client-number {
    text-align: right;
    white-space: nowrap;
}

.client-grid--2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.client-table tfoot td {
    border-top: 2px solid var(--cp-border, #e5e7eb);
}

.client-total td {
    font-size: 1.1rem;
    border-top: 2px solid var(--cp-text, #0a1628);
}

.client-document {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1.25rem;
    border: 1px solid var(--cp-border, #e5e7eb);
    border-radius: var(--cp-radius, 8px);
    background: var(--cp-bg, #fff);
    margin-bottom: 1rem;
}

.client-document__icon {
    width: 2.5rem;
    height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    background: var(--cp-bg-secondary, #f9fafb);
    border-radius: .5rem;
    flex-shrink: 0;
}

.client-document__body {
    flex: 1;
    min-width: 0;
}

.client-document__title {
    margin: 0 0 .35rem;
    font-size: 1.05rem;
    font-weight: 600;
}

.client-document__meta {
    display: flex;
    align-items: center;
    gap: .75rem;
    flex-wrap: wrap;
    margin: 0 0 .5rem;
    font-size: .85rem;
    color: var(--cp-muted, #6b7280);
}

.client-document__desc {
    color: var(--cp-muted, #6b7280);
    font-size: .9rem;
    margin: 0 0 .75rem;
}

.client-document__actions {
    display: flex;
    flex-direction: column;
    gap: .5rem;
    align-items: flex-end;
}

.client-bat-form {
    display: flex;
    flex-direction: column;
    gap: .5rem;
    margin-top: .75rem;
    max-width: 480px;
}

.client-bat__label {
    font-size: .85rem;
    font-weight: 500;
    color: var(--cp-text, #0a1628);
}

.client-bat__buttons {
    display: flex;
    gap: .5rem;
}

.client-btn--small {
    padding: .5rem .75rem;
    font-size: .85rem;
}

.client-btn--success {
    background: #10b981;
    color: #fff;
}

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

/* ── Right sidebar on client dashboard ── */

.client-aside {
    position: sticky;
    top: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.client-aside__section {
    background: #fff;
    border-radius: var(--cp-radius, 8px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    padding: 1.25rem;
}

.client-aside__title {
    font-size: 1rem;
    font-weight: 600;
    margin: 0 0 1rem;
    color: var(--cp-primary);
    display: flex;
    align-items: center;
    gap: .5rem;
}

.client-aside__title i {
    color: var(--cp-accent);
    font-size: .875rem;
}

.client-aside__list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: .75rem;
}

.client-aside__item {
    border-bottom: 1px solid var(--cp-border);
    padding-bottom: .75rem;
}

.client-aside__item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.client-aside__link {
    display: flex;
    flex-direction: column;
    gap: .15rem;
    color: var(--cp-primary);
    text-decoration: none;
    font-weight: 500;
    transition: color .2s;
}

.client-aside__link:hover {
    color: var(--cp-accent);
}

.client-aside__link--article {
    flex-direction: row;
    align-items: flex-start;
    gap: .75rem;
}

.client-aside__item-title {
    font-size: .95rem;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.client-aside__item-meta {
    font-size: .8rem;
    color: var(--cp-muted);
    font-weight: 400;
}

.client-aside__thumb {
    width: 56px;
    height: 56px;
    border-radius: var(--cp-radius, 8px);
    background-size: cover;
    background-position: center;
    background-color: var(--cp-surface);
    flex-shrink: 0;
}

.client-aside__article-body {
    display: flex;
    flex-direction: column;
    gap: .15rem;
    min-width: 0;
}

.client-aside__more {
    display: inline-flex;
    margin-top: .75rem;
    font-size: .85rem;
    font-weight: 500;
    color: var(--cp-accent);
    text-decoration: none;
}

.client-aside__more:hover {
    text-decoration: underline;
}

.client-aside__empty {
    font-size: .875rem;
    color: var(--cp-muted);
    font-style: italic;
    margin: 0;
}

/* Mini carousel */
.client-aside__carousel {
    width: 100%;
    overflow: hidden;
    border-radius: var(--cp-radius, 8px);
}

.client-aside__track {
    display: flex;
    gap: .75rem;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    padding-bottom: .5rem;
    -webkit-overflow-scrolling: touch;
}

.client-aside__slide {
    scroll-snap-align: start;
    flex: 0 0 75%;
    min-width: 180px;
    text-decoration: none;
    color: #fff;
    border-radius: var(--cp-radius, 8px);
    overflow: hidden;
}

.client-aside__slide-media {
    display: flex;
    align-items: flex-end;
    min-height: 140px;
    padding: 1rem;
    background-size: cover;
    background-position: center;
    background-color: var(--cp-primary);
    position: relative;
}

.client-aside__slide-media::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(10, 22, 40, .85), transparent 60%);
    pointer-events: none;
}

.client-aside__slide-title {
    position: relative;
    z-index: 1;
    font-size: .9rem;
    font-weight: 600;
    line-height: 1.25;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

@media (max-width: 1024px) {
    .client-dashboard.client-dashboard--premium {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .client-aside {
        position: static;
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 1rem;
    }

    .client-aside__section {
        padding: 1rem;
    }

    .client-aside__slide {
        flex: 0 0 60%;
    }
}

@media (max-width: 767px) {
    .client-aside {
        grid-template-columns: 1fr;
    }

    .client-aside__slide {
        flex: 0 0 80%;
    }
}

.client-form__message {
    margin-top: 1rem;
    padding: .85rem 1rem;
    border-radius: .5rem;
    font-size: .95rem;
    display: none;
}

.client-form__message:empty { display: none; }

.client-form__message--info {
    display: block;
    background: #e0f2fe;
    color: #075985;
}

.client-form__message--success {
    display: block;
    background: #d1fae5;
    color: #065f46;
}

.client-form__message--error {
    display: block;
    background: #fee2e2;
    color: #991b1b;
}

/* ── Proforma preview / table responsive ── */
.client-card .client-table {
    width: 100%;
    table-layout: auto;
}

.client-card .client-table th,
.client-card .client-table td {
    word-break: break-word;
    hyphens: auto;
}

.client-card .client-table td.client-number {
    white-space: nowrap;
}

.client-table tfoot .client-total td {
    border-top: 2px solid var(--cp-text, #0a1628);
}

.client-proforma-preview {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    padding: 1rem 0;
}

.client-proforma-preview .client-table {
    min-width: 520px;
}

/* ── Document viewer responsive ── */
.client-document-viewer {
    background: #f5f5f5;
    border-radius: var(--cp-radius, 8px);
    padding: 1rem;
    text-align: center;
    margin: 1.5rem 0;
}

.client-document-viewer iframe,
.client-document-viewer object,
.client-document-viewer embed {
    width: 100%;
    max-width: 100%;
    height: 70vh;
    border: none;
    border-radius: var(--cp-radius, 8px);
}

/* ── Premium client dashboard ── */
.client-hero {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 2rem;
    background: linear-gradient(135deg, #0a1628 0%, #1c2b45 100%);
    border-radius: var(--cp-radius, 8px);
    color: #fff;
    margin-bottom: 2rem;
    overflow: hidden;
}

.client-hero__brand {
    flex-shrink: 0;
    max-width: 120px;
}

.client-hero__logo {
    display: block;
    max-width: 100%;
    height: auto;
    filter: brightness(0) invert(1);
}

.client-hero__body {
    flex: 1;
    min-width: 0;
}

.client-hero__tagline {
    margin: 0 0 .5rem;
    font-size: .85rem;
    text-transform: uppercase;
    letter-spacing: .12em;
    color: #d4a373;
}

.client-hero__title {
    margin: 0 0 .5rem;
    font-size: 1.75rem;
    font-weight: 600;
    line-height: 1.2;
    color : #ffffe3;
}

.client-hero__lead {
    margin: 0;
    font-size: 1rem;
    color: rgba(255, 255, 255, .8);
    max-width: 520px;
}

.client-quicklinks {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.client-quicklink {
    display: flex;
    flex-direction: column;
    gap: .25rem;
    padding: 1rem 1.25rem;
    background: #fff;
    border-radius: var(--cp-radius, 8px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, .04);
    color: var(--cp-text);
    text-decoration: none;
    border: 1px solid var(--cp-border);
    transition: border-color .2s, box-shadow .2s, transform .2s;
}

.client-quicklink:hover {
    border-color: #d4a373;
    box-shadow: 0 6px 16px rgba(0, 0, 0, .06);
    transform: translateY(-2px);
}

.client-quicklink__label {
    font-weight: 600;
    font-size: .95rem;
}

.client-quicklink__hint {
    font-size: .8rem;
    color: var(--cp-muted);
}

.client-list__item--with-meta {
    align-items: center;
    gap: 1rem;
}

.client-list__main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: .15rem;
    text-decoration: none;
    color: inherit;
}

.client-list__title {
    font-weight: 600;
    color: var(--cp-text);
    text-decoration: none;
}

.client-list__subtitle {
    font-size: .85rem;
    color: var(--cp-muted);
}

.client-list__subtitle--cap {
    text-transform: capitalize;
}

.client-list__time {
    font-size: .75rem;
    color: var(--cp-muted);
    white-space: nowrap;
}

.client-univers {
    margin-top: 2rem;
    padding: 2rem;
    background: #fff;
    border-radius: var(--cp-radius, 8px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, .04);
    text-align: center;
    border-top: 3px solid #d4a373;
}

.client-univers__title {
    margin: 0 0 .5rem;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--cp-primary);
}

.client-univers__lead {
    margin: 0 0 1rem;
    color: var(--cp-muted);
}

.client-univers__links {
    display: flex;
    flex-wrap: wrap;
    gap: .75rem;
    justify-content: center;
    margin-bottom: 1rem;
}

.client-univers__link {
    padding: .55rem 1.1rem;
    background: var(--cp-surface);
    color: var(--cp-text);
    border-radius: var(--cp-radius, 8px);
    text-decoration: none;
    font-size: .9rem;
    font-weight: 500;
    transition: background .2s;
}

.client-univers__link:hover {
    background: #0a1628;
    color: #fff;
}

.client-univers__origin {
    margin: 0;
    font-size: .8rem;
    color: var(--cp-muted);
}

.client-link--primary {
    color: #d4a373;
    font-weight: 600;
}

@media (max-width: 767px) {
    .client-grid--2 {
        grid-template-columns: 1fr;
    }

    .client-document {
        flex-direction: column;
    }

    .client-document__actions {
        flex-direction: row;
        width: 100%;
        justify-content: flex-start;
    }

    .client-hero {
        flex-direction: column;
        align-items: flex-start;
        padding: 1.5rem;
    }

    .client-hero__brand {
        max-width: 90px;
    }

    .client-hero__title {
        font-size: 1.4rem;
    }

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

    .client-list__item--with-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: .5rem;
    }

    .client-univers__links {
        flex-direction: column;
        align-items: center;
    }

    .client-document-viewer iframe,
    .client-document-viewer object,
    .client-document-viewer embed {
        height: 55vh;
    }

    .client-proforma-preview .client-table {
        min-width: 0;
    }

    .client-table--compact th,
    .client-table--compact td {
        padding: .6rem .4rem;
        font-size: .85rem;
    }
}

@media (max-width: 480px) {
    .client-quicklinks {
        grid-template-columns: 1fr;
    }

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

/* ── Premium dashboard additions (Phase 1) ── */
.client-hero {
    position: relative;
    display: flex;
    align-items: flex-end;
    min-height: 280px;
    padding: 2.5rem;
    margin-bottom: 2.5rem;
    border-radius: 1rem;
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    color: #fff;
    overflow: hidden;
}

.client-hero__overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(10, 22, 40, .88) 0%, rgba(10, 22, 40, .45) 60%, rgba(10, 22, 40, .2) 100%);
    border-radius: 1rem;
    z-index: 0;
}

.client-hero__content {
    position: relative;
    z-index: 1;
    max-width: 640px;
}

.client-hero__tagline {
    margin: 0 0 .75rem;
    font-size: .78rem;
    text-transform: uppercase;
    letter-spacing: .14em;
    color: #d4a373;
    font-weight: 500;
}

.client-hero__title {
    margin: 0 0 .75rem;
    font-size: 2rem;
    font-weight: 600;
    line-height: 1.15;
}

.client-hero__lead {
    margin: 0 0 1.25rem;
    font-size: 1.05rem;
    color: rgba(255, 255, 255, .85);
    line-height: 1.5;
    max-width: 520px;
}

.client-hero__cta {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    padding: .85rem 1.6rem;
    background: #d4a373;
    color: #0a1628;
    border-radius: .5rem;
    text-decoration: none;
    font-weight: 600;
    font-size: .95rem;
    transition: background .2s, transform .2s;
}

.client-hero__cta:hover {
    background: #e6b78a;
    transform: translateY(-2px);
}

.client-stats--premium {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.25rem;
    margin-bottom: 2.5rem;
}

.client-stat--primary { border-left: 4px solid #d4a373; }
.client-stat--secondary { border-left: 4px solid #3b82f6; }
.client-stat--tertiary { border-left: 4px solid #f59e0b; }
.client-stat--quaternary { border-left: 4px solid #10b981; }

.client-quicklink__icon {
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: .5rem;
    background: #f0f2f5;
    color: #0a1628;
    font-size: 1.1rem;
    margin-bottom: .75rem;
    transition: background .2s, color .2s;
}

.client-quicklink:hover .client-quicklink__icon {
    background: #0a1628;
    color: #d4a373;
}

.client-editorial {
    margin-top: 2.5rem;
    padding: 2rem;
    border-radius: 1rem;
    background: linear-gradient(135deg, #f7f5f0 0%, #fff 100%);
    border: 1px solid rgba(212, 163, 115, .25);
    text-align: center;
}

.client-editorial__title {
    margin: 0 0 .5rem;
    font-size: 1.4rem;
    color: #0a1628;
    font-weight: 600;
}

.client-editorial__lead {
    margin: 0 0 1.25rem;
    color: #6b7280;
    font-style: italic;
}

.client-editorial__links {
    display: flex;
    flex-wrap: wrap;
    gap: .75rem;
    justify-content: center;
}

.client-editorial__link {
    padding: .55rem 1.1rem;
    background: #0a1628;
    color: #fff;
    border-radius: .5rem;
    text-decoration: none;
    font-size: .9rem;
    font-weight: 500;
    transition: background .2s;
}

.client-editorial__link:hover {
    background: #d4a373;
    color: #0a1628;
}

.client-portal__nav-icon {
    width: 22px;
    text-align: center;
    margin-right: .85rem;
    font-size: 1rem;
    opacity: .8;
    transition: opacity .2s;
}

.client-portal__nav-link:hover .client-portal__nav-icon,
.client-portal__nav-link--active .client-portal__nav-icon {
    opacity: 1;
}

@media (max-width: 900px) {
    .client-stats--premium {
        grid-template-columns: 1fr 1fr;
    }

    .client-hero {
        min-height: 220px;
        padding: 1.5rem;
    }

    .client-hero__title {
        font-size: 1.6rem;
    }
}

/* ── Dossier pipeline ── */
.client-pipeline {
    margin: 0 0 2.5rem;
    padding: 1.5rem;
    background: #fff;
    border-radius: 1rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .04);
}

.client-pipeline__track {
    display: flex;
    justify-content: space-between;
    gap: .5rem;
}

.client-pipeline__step {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .5rem;
    text-align: center;
    position: relative;
}

.client-pipeline__step:not(:last-child)::after {
    content: '';
    position: absolute;
    top: 16px;
    left: calc(50% + 16px);
    right: calc(-50% + 16px);
    height: 2px;
    background: #e5e7eb;
    z-index: 0;
}

.client-pipeline__dot {
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #f3f4f6;
    color: #9ca3af;
    font-size: .8rem;
    font-weight: 600;
    border: 2px solid #e5e7eb;
    position: relative;
    z-index: 1;
    transition: all .2s;
}

.client-pipeline__step--active .client-pipeline__dot {
    background: #0a1628;
    color: #fff;
    border-color: #0a1628;
}

.client-pipeline__step--active:not(:last-child)::after {
    background: #0a1628;
}

.client-pipeline__step--current .client-pipeline__dot {
    background: #d4a373;
    color: #0a1628;
    border-color: #d4a373;
    box-shadow: 0 0 0 4px rgba(212, 163, 115, .2);
}

.client-pipeline__step--rejected .client-pipeline__dot {
    background: #ef4444;
    color: #fff;
    border-color: #ef4444;
}

.client-pipeline__label {
    font-size: .78rem;
    color: #6b7280;
    font-weight: 500;
    white-space: nowrap;
}

.client-pipeline__step--current .client-pipeline__label,
.client-pipeline__step--active .client-pipeline__label {
    color: #0a1628;
}

@media (max-width: 767px) {
    .client-pipeline__track {
        flex-wrap: wrap;
    }

    .client-pipeline__step {
        flex: 1 1 30%;
    }

    .client-pipeline__step::after {
        display: none;
    }
}

/* ── Client BAT viewer ── */
.client-bat__content {
    font-size: 1rem;
    line-height: 1.7;
    color: #1f2937;
}

.client-bat__content h2,
.client-bat__content h3,
.client-bat__content p {
    margin-top: 0;
}

.client-bat__visual {
    margin-bottom: 1.5rem;
}

.client-bat__image {
    max-width: 100%;
    border-radius: .75rem;
    box-shadow: 0 4px 16px rgba(0, 0, 0, .08);
}

.client-bat__pdf,
.client-bat__video-link {
    display: inline-flex;
    align-items: center;
    gap: .6rem;
    padding: 1rem 1.4rem;
    background: #0a1628;
    color: #fff;
    border-radius: .5rem;
    text-decoration: none;
    font-weight: 500;
}

.client-bat__comment {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e5e7eb;
}

.client-bat__comment h3 {
    margin: 0 0 .5rem;
    font-size: .9rem;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: #6b7280;
    font-weight: 600;
}

.client-bat__actions {
    display: flex;
    flex-wrap: wrap;
    gap: .75rem;
    margin-top: 1rem;
}

.client-bat__actions .client-btn {
    flex: 1 1 auto;
}

.client-form__group--error .client-form__input {
    border-color: #ef4444;
}

@media (max-width: 480px) {
    .client-stats--premium {
        grid-template-columns: 1fr;
    }
}

/* ── Messages conversation ── */
.client-messages {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 1.5rem;
    min-height: 420px;
    background: #fff;
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .04);
}

.client-messages__threads {
    background: #f8f7f4;
    border-right: 1px solid #e5e7eb;
    padding: 1rem;
    overflow-y: auto;
}

.client-messages__list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: .5rem;
}

.client-messages__thread {
    border-radius: .6rem;
    transition: background .2s;
}

.client-messages__thread--unread .client-messages__from::after {
    content: '';
    display: inline-block;
    width: 8px;
    height: 8px;
    background: #d4a373;
    border-radius: 50%;
    margin-left: .5rem;
}

.client-messages__thread--active {
    background: #fff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, .05);
}

.client-messages__link {
    display: flex;
    flex-direction: column;
    gap: .15rem;
    padding: .75rem;
    color: #0a1628;
    text-decoration: none;
    border-radius: .6rem;
}

.client-messages__link:hover {
    background: #eceae5;
}

.client-messages__from {
    font-weight: 600;
    font-size: .92rem;
}

.client-messages__subject,
.client-messages__subject-title {
    font-size: .85rem;
    color: #6b7280;
}

.client-messages__time {
    font-size: .75rem;
    color: #9ca3af;
    margin-top: .25rem;
}

.client-messages__conversation {
    display: flex;
    flex-direction: column;
    padding: 1.25rem;
}

.client-messages__thread-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding-bottom: .75rem;
    border-bottom: 1px solid #e5e7eb;
    margin-bottom: 1rem;
}

.client-messages__history {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: .9rem;
    overflow-y: auto;
    padding-bottom: 1rem;
}

.client-message {
    display: flex;
}

.client-message--inbound {
    justify-content: flex-start;
}

.client-message--outbound {
    justify-content: flex-end;
}

.client-message__bubble {
    max-width: 80%;
    padding: .85rem 1.1rem;
    border-radius: .85rem;
    background: #f3f4f6;
    color: #1f2937;
    font-size: .95rem;
    line-height: 1.5;
}

.client-message--outbound .client-message__bubble {
    background: #0a1628;
    color: #fff;
}

.client-message__meta {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    font-size: .75rem;
    margin-bottom: .4rem;
    opacity: .8;
}

.client-message__pre {
    white-space: pre-wrap;
    font-family: inherit;
    margin: 0;
}

.client-messages__reply {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #e5e7eb;
}

.client-messages__empty-state {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
}

@media (max-width: 767px) {
    .client-messages {
        grid-template-columns: 1fr;
    }

    .client-messages__threads {
        border-right: none;
        border-bottom: 1px solid #e5e7eb;
        max-height: 200px;
    }
}

/* ── Profile premium ── */
.client-profile__identity {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    margin-bottom: 1.5rem;
}

.client-avatar {
    width: 88px;
    height: 88px;
    border-radius: 50%;
    background: linear-gradient(135deg, #0a1628, #d4a373);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    font-weight: 500;
    overflow: hidden;
    flex-shrink: 0;
    border: 3px solid #fff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, .1);
}

.client-avatar__image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.client-avatar__initials {
    letter-spacing: .05em;
}

.client-profile__name {
    flex: 1;
}

.client-profile__fullname {
    margin: 0 0 .25rem;
    font-size: 1.5rem;
    font-weight: 600;
    color: #0a1628;
}

.client-profile__email,
.client-profile__company {
    margin: 0;
    color: #6b7280;
    font-size: .95rem;
}

.client-card--profile {
    padding: 1.5rem;
}

.client-card--profile .client-card__title {
    margin-top: 0;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: #6b7280;
    margin-bottom: 1.25rem;
}

/* ── References upload & quote show ── */
.client-form__hint {
    font-size: .85rem;
    color: #6b7280;
    margin-top: .35rem;
}

.client-reference-preview {
    display: flex;
    flex-wrap: wrap;
    gap: .6rem;
    margin-top: .75rem;
}

.client-reference-preview__item {
    position: relative;
    width: 80px;
    height: 80px;
    border-radius: .4rem;
    overflow: hidden;
    border: 1px solid #e5e7eb;
}

.client-reference-preview__item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.client-reference-preview__remove {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 20px;
    height: 20px;
    background: rgba(0, 0, 0, .5);
    color: #fff;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: .75rem;
    line-height: 1;
}

.client-references__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: .75rem;
}

.client-references__item {
    aspect-ratio: 1;
    border-radius: .5rem;
    overflow: hidden;
    border: 1px solid #e5e7eb;
    display: block;
}

.client-references__item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .2s;
}

.client-references__item:hover img {
    transform: scale(1.05);
}

.client-bat__video-embed {
    position: relative;
    padding-top: 56.25%;
    background: #0a1628;
    border-radius: .75rem;
    overflow: hidden;
}

.client-bat__video-embed iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

/* ── Collapsible sidebar ── */
.client-portal__sidebar-head {
    display: flex;
    align-items: center;
    padding: 0 1rem 1rem;
}

.client-portal__sidebar-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    border: none;
    border-radius: .5rem;
    background: var(--cp-surface);
    color: var(--cp-primary);
    cursor: pointer;
    font-size: 1rem;
    transition: background .2s, color .2s;
}

.client-portal__sidebar-toggle:hover {
    background: var(--cp-primary);
    color: #fff;
}

.client-portal__nav-text {
    transition: opacity .2s ease, width .2s ease;
}

.client-portal__nav-link {
    display: flex;
    align-items: center;
    gap: .5rem;
    justify-content: flex-start;
    position: relative;
    overflow: hidden;
}

.client-portal__nav-icon {
    flex-shrink: 0;
    margin: 0;
    text-align: center;
    width: 22px;
}

.client-portal__badge {
    margin-left: auto;
    flex-shrink: 0;
}

.client-portal--sidebar-collapsed .client-portal__sidebar {
    width: 72px;
    padding: 1.5rem 0;
    overflow: visible;
}

.client-portal--sidebar-collapsed .client-portal__sidebar-head {
    justify-content: center;
    padding: 0 0 1rem;
}

.client-portal--sidebar-collapsed .client-portal__nav-text {
    position: absolute;
    left: 100%;
    opacity: 0;
    width: 0;
    pointer-events: none;
}

.client-portal--sidebar-collapsed .client-portal__nav-link {
    justify-content: center;
    padding: 0.875rem;
}

.client-portal--sidebar-collapsed .client-portal__badge {
    position: absolute;
    top: .35rem;
    right: .35rem;
    margin: 0;
    padding: .1rem .35rem;
    font-size: .65rem;
}

.client-portal--sidebar-collapsed .client-portal__nav-link:hover,
.client-portal--sidebar-collapsed .client-portal__nav-link--active {
    border-left: none;
    border-bottom: 3px solid var(--cp-accent);
}

.client-portal--sidebar-collapsed .client-portal__main {
    margin-left: 72px;
    max-width: calc(100% - 72px);
}

.client-portal--sidebar-collapsed .client-portal__sidebar-toggle i::before {
    content: '\f054';
}

@media (max-width: 1024px) {
    .client-portal__sidebar-head {
        display: none;
    }

    .client-portal--sidebar-collapsed .client-portal__sidebar {
        width: 100%;
    }

    .client-portal--sidebar-collapsed .client-portal__nav-text {
        position: static;
        opacity: 1;
        width: auto;
        pointer-events: auto;
    }

    .client-portal--sidebar-collapsed .client-portal__nav-link {
        padding: 0.875rem 1.5rem;
        justify-content: flex-start;
    }
}

/* ── Load more ── */
.client-load-more {
    margin-top: 1rem;
    text-align: center;
}

.client-load-more__btn {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    padding: .55rem 1.1rem;
    border: 1px solid var(--cp-border);
    border-radius: var(--cp-radius);
    background: #fff;
    color: var(--cp-primary);
    font: inherit;
    font-size: .9rem;
    font-weight: 500;
    cursor: pointer;
    transition: background .2s, border-color .2s;
}

.client-load-more__btn:hover {
    background: var(--cp-surface);
    border-color: var(--cp-primary);
}

.client-load-more__btn.is-hidden {
    display: none;
}

.client-list__item.is-hidden {
    display: none;
}

/* ── Dashboard charts ── */
.client-charts {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.client-chart {
    background: #fff;
    border-radius: var(--cp-radius);
    box-shadow: 0 2px 8px rgba(0, 0, 0, .04);
    padding: 1.25rem;
    position: relative;
    min-height: 260px;
}

.client-chart__title {
    font-size: 1rem;
    margin: 0 0 1rem;
    font-weight: 600;
}

.client-chart canvas {
    max-height: 220px;
}

@media (max-width: 1024px) {
    .client-charts {
        grid-template-columns: 1fr;
    }
}

/* ── Sidebar offset under fixed site header ── */
.client-portal--app {
    padding-top: var(--client-top-offset, 0);
}

.client-portal__sidebar {
    top: var(--client-top-offset, 0);
    height: calc(100vh - var(--client-top-offset, 0));
}

/* ── Dossier BAT grouping ── */
.client-bats {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.client-bat-group {
    border: 1px solid var(--cp-border);
    border-radius: 0.5rem;
    overflow: hidden;
    background: var(--cp-surface);
}

.client-bat-group__toggle {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    background: transparent;
    border: none;
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.client-bat-group__icon {
    font-size: 1.25rem;
}

.client-bat-group__title {
    font-weight: 600;
    flex: 1;
}

.client-bat-group__count {
    font-size: 0.75rem;
    color: var(--cp-text-muted);
}

.client-bat-group__arrow {
    transition: transform 0.2s ease;
    color: var(--cp-text-muted);
}

.client-bat-group.is-open .client-bat-group__arrow {
    transform: rotate(180deg);
}

.client-bat-group__body {
    display: none;
    padding: 0 1rem 1rem;
}

.client-bat-group.is-open .client-bat-group__body {
    display: block;
}

.client-document--proforma {
    border: 1px solid var(--cp-border);
    border-radius: 0.5rem;
    padding: 1rem;
    margin-bottom: 1rem;
    background: var(--cp-surface);
}

.client-document--proforma .client-document__icon {
    font-size: 1.5rem;
}

/* ── Client topbar & notifications dropdown ── */
.client-topbar {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 1rem;
    padding: 0 0 1rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--cp-border);
}

.client-notifications {
    position: relative;
}

.client-notifications__toggle {
    position: relative;
    width: 2.5rem;
    height: 2.5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: var(--cp-text);
    font-size: 1.125rem;
    cursor: pointer;
    border-radius: 0.375rem;
    transition: background 0.2s ease;
}

.client-notifications__toggle:hover {
    background: var(--cp-border);
}

.client-notifications__badge {
    position: absolute;
    top: 0.2rem;
    right: 0.2rem;
    min-width: 1.1rem;
    height: 1.1rem;
    padding: 0 0.25rem;
    background: var(--cp-accent, #d4a373);
    color: #fff;
    font-size: 0.65rem;
    font-weight: 600;
    border-radius: 9999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.client-notifications__dropdown {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    width: 20rem;
    max-width: calc(100vw - 2rem);
    background: #fff;
    border: 1px solid var(--cp-border);
    border-radius: 0.5rem;
    box-shadow: 0 10px 25px rgba(10, 22, 40, 0.12);
    z-index: 100;
    overflow: hidden;
}

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

.client-notifications__list {
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: 18rem;
    overflow-y: auto;
}

.client-notifications__item {
    border-bottom: 1px solid var(--cp-border);
}

.client-notifications__item--unread {
    background: rgba(212, 163, 115, 0.08);
}

.client-notifications__link {
    display: block;
    padding: 0.75rem 1rem;
    color: var(--cp-text);
    text-decoration: none;
}

.client-notifications__link:hover {
    background: var(--cp-surface);
}

.client-notifications__title {
    display: block;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.client-notifications__message {
    display: block;
    font-size: 0.85rem;
    color: var(--cp-text-muted);
    margin-bottom: 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.client-notifications__time {
    display: block;
    font-size: 0.75rem;
    color: var(--cp-text-muted);
}

.client-notifications__footer {
    display: block;
    padding: 0.75rem 1rem;
    text-align: center;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--cp-text);
    border-top: 1px solid var(--cp-border);
    background: var(--cp-surface);
}

.client-notifications__empty {
    padding: 1rem;
    text-align: center;
    color: var(--cp-text-muted);
    font-size: 0.9rem;
}

/* ── Project files ── */
.client-project-files {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.client-project-card {
    border: 1px solid var(--cp-border);
    border-radius: 0.75rem;
    background: var(--cp-surface);
    overflow: hidden;
}

.client-project-card__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem;
    cursor: pointer;
    transition: background 0.2s ease;
}

.client-project-card__header:hover {
    background: var(--cp-surface-2, #f8fafc);
}

.client-project-card__title {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0 0 0.35rem;
}

.client-project-card__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.85rem;
    color: var(--cp-text-muted);
}

.client-project-card__arrow {
    transition: transform 0.2s ease;
    color: var(--cp-text-muted);
}

.client-project-card.is-open .client-project-card__arrow {
    transform: rotate(180deg);
}

.client-project-card__body {
    display: none;
    padding: 0 1rem 1rem;
}

.client-project-card.is-open .client-project-card__body {
    display: block;
}

.client-project-card__brief {
    margin: 0 0 1rem;
    font-size: 0.9rem;
    color: var(--cp-text-muted);
    line-height: 1.5;
}

.client-project-files__version {
    display: inline-block;
    margin-left: 0.5rem;
    padding: 0.1rem 0.4rem;
    font-size: 0.7rem;
    font-weight: 600;
    background: var(--cp-border);
    border-radius: 0.25rem;
    color: var(--cp-text-muted);
}

