/* Concours Armée — dashboard (inspiration type Airwallex) */

:root {
    --dash-bg-page: #f7f8fa;
    --dash-bg-card: #ffffff;
    --dash-sidebar-bg: #141414;
    --dash-sidebar-text: #e8e8e8;
    --dash-sidebar-muted: #8a8a8a;
    --dash-accent: #e85d4c;
    --dash-accent-soft: #6b4c9a;
    --dash-header-border: #e8eaef;
    --dash-shadow-card: 0 1px 3px rgba(0, 0, 0, 0.06), 0 4px 12px rgba(0, 0, 0, 0.04);
    --dash-radius: 12px;
    --dash-radius-sm: 8px;
    --dash-font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --dash-page-max: 1400px;
    --dash-sidebar-width: 260px;
    /* Hauteur approximative du header sticky (padding + titre) */
    --dash-header-offset: 61px;
    /* Aligné sur .dash-main padding-top — évite le « saut » du sticky LMS */
    --dash-main-pad-top: 24px;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scrollbar-gutter: stable;
}

html,
body {
    margin: 0;
    padding: 0;
    font-family: var(--dash-font);
    background: var(--dash-bg-page);
    color: #1a1a1a;
    min-height: 100%;
}

/* ——— Header ——— */
.dash-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 24px;
    background: var(--dash-bg-card);
    border-bottom: 1px solid var(--dash-header-border);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.dash-header__brand {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.dash-header__title {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 650;
    letter-spacing: -0.02em;
}

.dash-header__tagline {
    font-size: 0.75rem;
    color: #6b7280;
}

.dash-header__actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.dash-header__email {
    font-size: 0.875rem;
    color: #4b5563;
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dash-btn {
    border: 1px solid #d1d5db;
    border-radius: var(--dash-radius-sm);
    padding: 8px 14px;
    font-size: 0.875rem;
    font-weight: 500;
    background: #fff;
    color: #374151;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}

.dash-btn:hover {
    background: #f9fafb;
    border-color: #c4c8d0;
}

.dash-btn--primary {
    background: var(--dash-accent-soft);
    border-color: var(--dash-accent-soft);
    color: #fff;
}

.dash-btn--primary:hover {
    filter: brightness(1.06);
    border-color: var(--dash-accent-soft);
}

.dash-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--dash-accent-soft), #9b7ec4);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 600;
    flex-shrink: 0;
}

/* ——— Layout ——— */
/* Pleine largeur : la sidebar reste collée au bord gauche du viewport (zoom / grands écrans).
   Le contenu est centré dans la zone principale uniquement (type Airwallex). */
.dash-layout {
    display: flex;
    align-items: flex-start;
    min-height: calc(100vh - var(--dash-header-offset));
    flex-direction: row;
    width: 100%;
    max-width: none;
    margin: 0;
}

.dash-main {
    flex: 1;
    min-width: 0;
    padding: 24px 28px 48px;
}

.dash-main > .view-panel {
    max-width: var(--dash-page-max);
    width: 100%;
    margin-left: auto;
    margin-right: auto;
}

/* ——— Left sidebar ——— */
.dash-sidebar {
    width: var(--dash-sidebar-width);
    flex-shrink: 0;
    align-self: flex-start;
    position: sticky;
    top: var(--dash-header-offset);
    /* Remplit la hauteur sous le header : plus de bande claire sous le menu */
    min-height: calc(100vh - var(--dash-header-offset));
    max-height: calc(100vh - var(--dash-header-offset));
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    z-index: 50;
    background: var(--dash-sidebar-bg);
    color: var(--dash-sidebar-text);
    padding: 20px 0 24px;
    display: flex;
    flex-direction: column;
    border-right: 1px solid #2a2a2a;
}

.dash-sidebar__label {
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--dash-sidebar-muted);
    padding: 0 20px 8px;
    margin-top: 12px;
}

.dash-sidebar__label:first-child {
    margin-top: 0;
}

.dash-nav-item {
    display: flex;
    align-items: center;
    width: 100%;
    text-align: left;
    padding: 10px 20px;
    border: none;
    background: transparent;
    color: var(--dash-sidebar-text);
    font-size: 0.9rem;
    cursor: pointer;
    gap: 10px;
    transition: background 0.12s, color 0.12s;
}

.dash-nav-item:hover {
    background: rgba(255, 255, 255, 0.06);
}

.dash-nav-item.active {
    color: var(--dash-accent);
    background: rgba(232, 93, 76, 0.08);
}

.dash-nav-item__icon {
    width: 18px;
    text-align: center;
    opacity: 0.85;
    font-size: 0.95rem;
}

.dash-nav-item__icon--svg {
    display: flex;
    align-items: center;
    justify-content: center;
}

.dash-nav-item__icon--svg svg {
    display: block;
    flex-shrink: 0;
}

.dash-nav-details {
    margin: 0;
    padding: 0;
}

.dash-nav-details > summary {
    list-style: none;
}

.dash-nav-details > summary::-webkit-details-marker {
    display: none;
}

.dash-nav-summary {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 10px 20px;
    cursor: pointer;
    color: var(--dash-sidebar-text);
    font-size: 0.9rem;
    gap: 10px;
    user-select: none;
    list-style: none;
}

.dash-nav-summary__label {
    flex: 1;
    min-width: 0;
    text-align: left;
}

.dash-nav-chevron-btn {
    margin: -4px -6px -4px auto;
    padding: 4px 8px;
    border: none;
    background: transparent;
    color: inherit;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border-radius: 4px;
}

.dash-nav-chevron-btn:hover {
    background: rgba(255, 255, 255, 0.08);
}

.dash-nav-chevron-btn:focus-visible {
    outline: 2px solid var(--dash-accent);
    outline-offset: 2px;
}

.dash-nav-summary:hover {
    background: rgba(255, 255, 255, 0.06);
}

.dash-nav-summary.active-parent {
    color: var(--dash-accent);
}

.dash-nav-chevron {
    font-size: 0.65rem;
    opacity: 0.7;
    transition: transform 0.2s;
    display: block;
}

.dash-nav-details[open] .dash-nav-chevron {
    transform: rotate(180deg);
}

.dash-nav-sub {
    padding: 4px 0 8px 0;
    display: flex;
    flex-direction: column;
}

.dash-nav-sub a {
    display: block;
    padding: 8px 20px 8px 48px;
    font-size: 0.82rem;
    color: var(--dash-sidebar-muted);
    text-decoration: none;
    transition: color 0.12s, background 0.12s;
}

.dash-nav-sub a:hover {
    color: var(--dash-sidebar-text);
    background: rgba(255, 255, 255, 0.04);
}

.dash-nav-sub a.is-disabled {
    pointer-events: none;
    opacity: 0.45;
}

.dash-nav-sub a.active {
    color: var(--dash-accent);
    font-weight: 600;
    background: rgba(232, 93, 76, 0.08);
}

.dash-sidebar__footer {
    margin-top: auto;
    padding: 20px;
    font-size: 0.7rem;
    color: var(--dash-sidebar-muted);
    border-top: 1px solid #2a2a2a;
}

.dash-sidebar-upgrade[hidden] {
    display: none !important;
}

.dash-sidebar-upgrade {
    margin: 12px 16px 0;
    padding: 14px;
    border-radius: 10px;
    border: 1px solid rgba(232, 93, 76, 0.35);
    background: rgba(232, 93, 76, 0.08);
}

.dash-sidebar-upgrade__title {
    margin: 0;
    font-size: 0.85rem;
    font-weight: 700;
    color: #fff0ef;
}

.dash-sidebar-upgrade__text {
    margin: 8px 0 0;
    font-size: 0.77rem;
    line-height: 1.45;
    color: #f4d4cf;
}

.dash-sidebar-upgrade__btn {
    width: 100%;
    margin-top: 12px;
    text-align: center;
    background: var(--dash-accent);
    border-color: var(--dash-accent);
    color: #fff;
}

.dash-sidebar-upgrade__btn:hover {
    background: #d44a3a;
    border-color: #d44a3a;
}

.dash-sidebar-upgrade__btn:focus-visible {
    outline: 2px solid rgba(232, 93, 76, 0.45);
    outline-offset: 2px;
}

/* ——— View panels ——— */
.view-panel {
    display: none;
    animation: dashFade 0.25s ease;
}

.view-panel.active {
    display: block;
}

@keyframes dashFade {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.content-card {
    background: var(--dash-bg-card);
    border-radius: var(--dash-radius);
    box-shadow: var(--dash-shadow-card);
    overflow: hidden;
    margin-bottom: 20px;
}

/* Sticky des colonnes LMS : pas d’overflow hidden sur le conteneur (sinon position:sticky ne s’applique pas). */
.content-card.lms-layout {
    overflow: visible;
}

.content-card__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    padding: 20px 24px;
    border-bottom: 1px solid #eef0f4;
}

.content-card__head h2 {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 650;
}

.content-card__body {
    padding: 24px;
}

.content-card__lead {
    margin: 0 0 20px;
    font-size: 0.9rem;
    color: #6b7280;
    max-width: 52ch;
}

#view-psychotechnique .content-card__lead {
    max-width: none;
}

#view-anglais .content-card__lead {
    max-width: none;
}

/* ——— Test cards grid ——— */
.test-card-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}

/* Psychotechnique : 2 cartes par ligne, cartes plus grandes */
.test-card-grid--psych {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
}

@media (max-width: 640px) {
    .test-card-grid--psych {
        grid-template-columns: 1fr;
    }
}

.test-card-grid--psych .test-card {
    flex: none;
    max-width: none;
    min-height: 140px;
    padding: 22px 24px;
}

#anglais-actions.test-card-grid--psych .test-card {
    grid-column: 1 / -1;
}

.test-card__main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 6px;
}

.test-card__icon {
    position: relative;
    flex-shrink: 0;
    width: 52px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--dash-accent);
    opacity: 0.92;
}

.test-card__icon svg {
    width: 100%;
    height: 100%;
    display: block;
}

.test-card__icon .ca-lock-badge--freemium svg {
    width: 11px;
    height: 11px;
}

.test-card {
    flex: 1 1 200px;
    max-width: 280px;
    min-height: 100px;
    padding: 18px 20px;
    border-radius: var(--dash-radius-sm);
    border: 1px solid #e8eaef;
    background: #fafbfc;
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 6px;
    transition: border-color 0.15s, box-shadow 0.15s, transform 0.12s;
}

/* Après .test-card : texte à gauche, icône à droite (spécificité > .test-card seul) */
.test-card.test-card--psych {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}

.test-card.test-card--psych:hover .test-card__icon {
    opacity: 1;
    color: #d44a3a;
}

.test-card:hover {
    border-color: var(--dash-accent-soft);
    box-shadow: 0 4px 14px rgba(107, 76, 154, 0.12);
    transform: translateY(-1px);
}

.test-card.is-disabled {
    pointer-events: none;
    opacity: 0.5;
    cursor: not-allowed;
}

/* Cartes cliquables (ex. hub Connaissances) : même apparence que les liens .test-card */
button.test-card {
    font: inherit;
    width: 100%;
    cursor: pointer;
    text-align: left;
    appearance: none;
    -webkit-appearance: none;
}

button.test-card::-moz-focus-inner {
    border: 0;
    padding: 0;
}

/* Hubs Connaissances & Sport : cartes type psycho sans icône — texte aligné en haut */
#connaissances-hub-grid .test-card--psych .test-card__main,
#sport-hub-grid .test-card--psych .test-card__main {
    justify-content: flex-start;
}

.test-card__title {
    font-weight: 650;
    font-size: 0.95rem;
}

.test-card__desc {
    margin: 0;
    font-size: 0.85rem;
    line-height: 1.45;
    color: #4b5563;
    flex: 1;
}

.test-card--psych .test-card__desc {
    flex: 0 1 auto;
}

.test-card__meta {
    font-size: 0.78rem;
    color: #6b7280;
    margin-top: auto;
    padding-top: 4px;
}

.test-card--psych .test-card__main .test-card__meta {
    margin-top: 6px;
}

.test-card[data-slot='cubes'] {
    order: 1;
}
.test-card[data-slot='rotation'] {
    order: 2;
}
.test-card[data-slot='math'] {
    order: 3;
}
.test-card[data-slot='attention'] {
    order: 4;
}
.test-card[data-slot='french'] {
    order: 5;
}
.test-card[data-slot='codage'] {
    order: 6;
}
.test-card[data-slot='other'] {
    order: 40;
}

.psych-others-wrap {
    margin-top: 28px;
    padding-top: 24px;
    border-top: 1px solid #eef0f4;
}

.psych-others-wrap.hidden {
    display: none;
}

.psych-others-wrap h3 {
    margin: 0 0 16px;
    font-size: 0.85rem;
    font-weight: 600;
    color: #6b7280;
}

/* ——— Placeholder views ——— */
.placeholder-view {
    text-align: center;
    padding: 48px 24px;
    color: #6b7280;
    font-size: 0.95rem;
}

/* ——— Settings ——— */
.settings-card__body {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.settings-card__lead {
    margin: 0;
    color: #4b5563;
    font-size: 0.9rem;
    line-height: 1.5;
}

.settings-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.settings-form__row {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.settings-form__row label {
    font-size: 0.85rem;
    color: #374151;
    font-weight: 600;
}

.settings-form__row input[type='password'] {
    border: 1px solid #d1d5db;
    border-radius: var(--dash-radius-sm);
    padding: 10px 12px;
    font-size: 0.9rem;
    color: #111827;
    background: #fff;
}

.settings-form__row input[type='password']:focus {
    outline: 2px solid rgba(107, 76, 154, 0.2);
    border-color: var(--dash-accent-soft);
}

.settings-form__row--checkbox label {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-weight: 500;
}

.settings-form__row--checkbox input[type='checkbox'] {
    margin-top: 2px;
    accent-color: var(--dash-accent-soft);
}

.settings-form__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.settings-inline-link {
    font-size: 0.85rem;
    color: var(--dash-accent-soft);
    text-decoration: underline;
    text-underline-offset: 2px;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    font: inherit;
    text-align: left;
}

.settings-kv {
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.settings-kv__row {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 10px;
    align-items: baseline;
    font-size: 0.9rem;
}

.settings-kv__row dt {
    color: #6b7280;
}

.settings-kv__row dd {
    margin: 0;
    color: #111827;
    font-weight: 600;
}

.settings-message {
    margin: 0;
    min-height: 1.25em;
    font-size: 0.85rem;
    color: #6b7280;
}

.settings-message--ok {
    color: #166534;
}

.settings-message--err {
    color: #991b1b;
}

.settings-legal-links {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.settings-legal-links a {
    color: #374151;
    text-decoration: underline;
    text-underline-offset: 2px;
    font-size: 0.9rem;
}

.settings-separator {
    width: 100%;
    border: none;
    border-top: 1px solid #e5e7eb;
    margin: 2px 0;
}

.settings-danger-title {
    margin: 0;
    font-size: 1rem;
}

.settings-danger-lead {
    margin: 0;
    color: #6b7280;
    font-size: 0.88rem;
}

.settings-btn-danger {
    border-color: #b91c1c;
    background: #b91c1c;
    color: #fff;
}

.settings-btn-danger:hover {
    border-color: #991b1b;
    background: #991b1b;
}

.settings-card--danger .content-card__head h2 {
    color: #7f1d1d;
}

/* ——— Stats (legacy table + diagram, preserved IDs) ——— */
.stats-container {
    width: 100%;
    overflow-x: auto;
}

.points-box {
    width: 130px;
    height: 35px;
    display: flex;
    justify-content: center;
    align-items: center;
    float: right;
}

.last-score {
    width: 60px;
    height: 35px;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--color);
    border-radius: 8px;
    --color: navy;
    color: var(--color);
}

.points-box .point {
    width: 100%;
    height: 100%;
    text-align: center;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
}

.points-box .point.low {
    --color: red;
    border: 1px solid var(--color);
    border-right: none;
    color: var(--color);
    border-top-left-radius: 8px;
    border-bottom-left-radius: 8px;
}

.points-box .point.average {
    --color: #00cc00;
    background: var(--color);
    color: white;
    font-weight: bold;
    border-radius: 0;
}

.points-box .point.high {
    --color: navy;
    border: 1px solid var(--color);
    border-left: none;
    color: var(--color);
    border-top-right-radius: 8px;
    border-bottom-right-radius: 8px;
}

.stats-name-with-chevron {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-wrap: nowrap;
    font-size: 0.95rem;
    cursor: pointer;
}

.stats-row-chevron {
    display: inline-block;
    flex-shrink: 0;
    font-size: 1em;
    line-height: 1;
    color: #4b5563;
    transform: translateY(0.06em);
    transition: transform 0.2s ease, color 0.15s ease;
    cursor: pointer;
}

.data-row--stats-open .stats-row-chevron {
    transform: translateY(0.06em) rotate(180deg);
    color: #111827;
}

.stats-container td.name a {
    max-width: 200px;
    display: inline-block;
    font-size: inherit;
    color: black;
    font-weight: bold;
    text-decoration: underline;
}

.stats-container .played {
    text-align: right;
    color: gray;
}

.stats-container table .title .small {
    color: gray;
}

.stats-container table .title .main {
    font-weight: bold;
    font-size: 25px;
}

.stats-container table .title {
    display: flex;
    flex-direction: column;
    justify-content: right;
    align-items: flex-end;
}

.stats-container table {
    width: 100%;
    border-spacing: 10px;
}

.stat-details h3 {
    color: gray;
    font-size: 14px;
    font-weight: 500;
}

.stat-details {
    height: 400px;
    width: 100%;
    position: relative;
    border: 1px solid #bdbdbd;
    border-radius: 5px;
    padding: 10px;
    display: flex;
    gap: 30px;
}

.stat-row {
    display: none;
}

.stat-row.active {
    display: table-row;
}

.stat-details .list .entry .scores .score-relative {
    width: 50px;
    padding: 4px;
    color: white;
    text-align: center;
    border-radius: 5px;
}

.stat-details .list .entry .scores .score {
    color: black;
}

.stat-details .list .entry .scores {
    display: flex;
    align-items: center;
    gap: 8px;
}

.stat-details .list .entry:nth-child(2n) {
    background-color: #f8fafc;
}

.stat-details .list .entry {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    color: #717171;
    font-weight: 500;
}

.stat-details .list {
    width: 50%;
    height: 100%;
    overflow-y: scroll;
}

.stat-details .diagram .dot {
    position: absolute;
    top: calc(var(--y) * 100%);
    left: calc(var(--x) * 100%);
    transform: translate(-50%, -50%);
    width: 10px;
    height: 10px;
    border-radius: 50%;
    animation: grow 500ms forwards;
}

@keyframes grow {
    from {
        transform: translate(-100%, -50%) scale(0, 0);
    }
    to {
        transform: translate(-100%, -50%) scale(1, 1);
    }
}

.stat-details .diagram-container {
    width: 50%;
    height: 100%;
    position: relative;
    display: flex;
    flex-direction: column;
}

.stat-details .diagram {
    height: 100%;
    background: linear-gradient(to bottom, gray 1px, white 1px);
    border-bottom: 1px solid gray;
    background-size: 100% 10%;
    position: relative;
    width: calc(100% - 40px);
    margin-left: 40px;
    z-index: 99;
}

.diagram-labels {
    width: calc(100% - 40px);
    margin-left: 40px;
    position: relative;
    height: 1lh;
}

.label {
    position: absolute;
    background: gray;
}

.label-horizontal {
    height: 0;
    width: 0;
}

.label-vertical {
    height: 5px;
    width: 1px;
}

.label::after {
    content: var(--label);
    color: gray;
    position: absolute;
    top: 50%;
    font-size: 12px;
    font-weight: 700;
    display: block;
}

.label-horizontal::after {
    transform: translateY(-0.5lh);
    right: calc(100% + 6px);
}

.label-vertical::after {
    transform: translateX(50%) translateY(2px);
    right: 0;
}

/* ——— Hidden legacy ——— */
#sectionQuiz {
    display: none !important;
}

/* ——— Statistiques : aide (dialogues + pastilles récence) ——— */
#view-statistiques .stats-help-btn {
    flex-shrink: 0;
    font-size: 0.8125rem;
    padding: 6px 12px;
    max-width: min(100%, 300px);
    line-height: 1.35;
    text-align: center;
}

.stats-recency-header-cell {
    vertical-align: bottom;
    text-align: center;
    padding-bottom: 4px;
}

.stats-recency-help-icon {
    width: 1.65rem;
    height: 1.65rem;
    padding: 0;
    border: 1px solid #c4c8d0;
    border-radius: 50%;
    background: #f9fafb;
    color: #4b5563;
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.stats-recency-help-icon:hover {
    background: #fff;
    border-color: var(--dash-accent-soft);
    color: var(--dash-accent-soft);
}

.stats-recency-help-icon:focus-visible {
    outline: 2px solid var(--dash-accent-soft);
    outline-offset: 2px;
}

.stats-status-cell {
    vertical-align: middle;
    text-align: center;
}

.stats-recency-dot {
    position: relative;
    width: 2.25rem;
    height: 2.25rem;
    padding: 0;
    margin: 0 auto;
    border: none;
    border-radius: 50%;
    background: transparent;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.stats-recency-dot::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #ef4444;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.06);
}

.stats-recency-dot--green::after {
    background: #22c55e;
}

.stats-recency-dot--orange::after {
    background: #f97316;
}

.stats-recency-dot--red::after {
    background: #ef4444;
}

.stats-recency-dot:focus-visible {
    outline: 2px solid var(--dash-accent-soft);
    outline-offset: 2px;
}

.stats-help-dialog {
    max-width: min(520px, calc(100vw - 32px));
    width: 100%;
    padding: 0;
    border: 1px solid #e5e7eb;
    border-radius: var(--dash-radius);
    box-shadow: var(--dash-shadow-card), 0 24px 48px rgba(15, 23, 42, 0.12);
}

.stats-help-dialog::backdrop {
    background: rgba(15, 23, 42, 0.45);
}

.stats-help-dialog__inner {
    padding: 22px 24px;
    max-height: min(72vh, 620px);
    overflow-y: auto;
}

.stats-help-dialog__title {
    margin: 0 0 14px;
    font-size: 1.05rem;
    font-weight: 650;
    color: #111827;
}

.stats-help-dialog__inner p {
    margin: 0 0 12px;
    font-size: 0.9rem;
    line-height: 1.55;
    color: #374151;
}

.stats-help-dialog__list {
    margin: 0 0 14px;
    padding-left: 1.25rem;
    font-size: 0.9rem;
    line-height: 1.55;
    color: #374151;
}

.stats-help-dialog__list li {
    margin-bottom: 6px;
}

.stats-help-dialog__actions {
    margin: 18px 0 0;
    padding: 0;
    border: none;
    display: flex;
    justify-content: flex-end;
}

.stats-help-dialog__actions .dash-btn {
    margin: 0;
}

/* ——— Connaissances LMS ——— */
.lms-hub-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 8px;
}

.lms-hub-btn {
    flex: 1 1 200px;
    justify-content: center;
}

.lms-layout {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    min-height: min(70vh, 720px);
    padding: 0;
    overflow: visible;
}

.lms-lesson-nav {
    flex: 0 0 260px;
    max-width: 100%;
    align-self: flex-start;
    position: sticky;
    /* header + padding du .dash-main : même ligne de départ qu’au repos → pas de saut au scroll */
    top: calc(var(--dash-header-offset) + var(--dash-main-pad-top));
    min-height: calc(100vh - var(--dash-header-offset) - var(--dash-main-pad-top));
    max-height: calc(100vh - var(--dash-header-offset) - var(--dash-main-pad-top));
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    z-index: 40;
    border-right: 1px solid #eef0f4;
    background: #fafbfc;
    display: flex;
    flex-direction: column;
}

.lms-lesson-nav__head {
    padding: 16px 16px 12px;
    border-bottom: 1px solid #eef0f4;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.lms-lesson-nav__title {
    margin: 0;
    font-size: 0.85rem;
    font-weight: 700;
    color: #111827;
    line-height: 1.3;
}

.lms-back-hub {
    align-self: flex-start;
    font-size: 0.8rem;
    padding: 6px 12px;
}

.lms-page-list {
    list-style: none;
    margin: 0;
    padding: 8px 0 16px;
    overflow-y: auto;
    flex: 1;
}

.lms-page-list li {
    margin: 0;
}

.lms-page-link {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
    text-align: left;
    padding: 10px 16px;
    border: none;
    background: transparent;
    font-size: 0.85rem;
    color: #4b5563;
    cursor: pointer;
    border-left: 3px solid transparent;
    transition: background 0.12s, color 0.12s, border-color 0.12s;
}

.lms-page-link:hover {
    background: rgba(15, 23, 42, 0.04);
    color: #111827;
}

.lms-page-link--active {
    color: var(--dash-accent);
    font-weight: 600;
    background: rgba(232, 93, 76, 0.06);
    border-left-color: var(--dash-accent);
}

.lms-main {
    flex: 1;
    min-width: 0;
    padding: 20px 24px 32px;
    overflow: visible;
}

.lms-breadcrumb {
    font-size: 0.78rem;
    color: #6b7280;
    margin-bottom: 10px;
    line-height: 1.4;
}

.lms-article__title {
    margin: 0 0 10px;
    font-size: 1.45rem;
    font-weight: 700;
    color: #111827;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.lms-article__body {
    font-size: 0.95rem;
    line-height: 1.5;
    color: #374151;
}

.lms-article__body p {
    margin: 0 0 0.55em;
}

/* Paragraphes « vides » Quill (<p><br></p>) : moins d’air entre blocs */
.lms-article__body p:has(> br:only-child) {
    margin: 0.15em 0;
    min-height: 0;
    line-height: 1.2;
}

.lms-article__body .ql-align-center {
    text-align: center;
}

.lms-article__body .ql-align-right {
    text-align: right;
}

.lms-article__body .ql-align-justify {
    text-align: justify;
}

.lms-article__body h1 {
    margin: 0 0 0.45em;
    color: #111827;
    font-weight: 700;
    font-size: 1.2rem;
    line-height: 1.25;
    letter-spacing: 0.02em;
}

.lms-article__body h2,
.lms-article__body h3,
.lms-article__body h4 {
    margin: 0.75em 0 0.3em;
    color: #111827;
    font-weight: 650;
    line-height: 1.28;
}

.lms-article__body h2 {
    font-size: 1.15rem;
}

.lms-article__body h3 {
    font-size: 1.05rem;
}

.lms-article__body ul,
.lms-article__body ol {
    margin: 0 0 0.55em 1.25rem;
    padding: 0;
}

.lms-article__body li {
    margin: 0 0 0.2em;
}

.lms-article__body img {
    display: block;
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 0.45em auto;
}

/* Blocs vidéo YouTube (marqueur admin → iframe injectée au rendu) */
.lms-article__body .lms-youtube-embed {
    position: relative;
    width: 100%;
    max-width: 720px;
    margin: 0.65em auto;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    border-radius: 8px;
    background: #0f0f0f;
}

.lms-article__body .lms-youtube-embed iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.lms-article__body a {
    color: var(--dash-accent);
    text-decoration: underline;
    text-underline-offset: 2px;
}

/* Bouton téléchargement PDF (Conseils — fin de leçon) */
.lms-article__body p.lms-download-footer {
    margin-top: 1.75rem;
    padding-top: 1.25rem;
    border-top: 1px solid #e5e7eb;
    text-align: center;
}

.lms-article__body p.lms-download-footer a.dash-btn {
    display: inline-block;
    text-decoration: none;
    color: #374151;
}

.lms-article__body p.lms-download-footer a.dash-btn:hover {
    color: #374151;
}

.lms-article__body blockquote {
    margin: 0.55em 0;
    padding: 8px 14px;
    border-left: 3px solid #e5e7eb;
    background: #f9fafb;
    color: #4b5563;
}

.lms-article__body pre,
.lms-article__body code {
    font-family: ui-monospace, monospace;
    font-size: 0.88em;
}

.lms-article__body pre {
    margin: 0.55em 0;
    overflow-x: auto;
    padding: 10px 12px;
    background: #1e293b;
    color: #e2e8f0;
    border-radius: 8px;
}

.lms-empty-hint {
    margin: 0;
    color: #6b7280;
    font-size: 0.92rem;
    line-height: 1.55;
}

/* ——— Sport LMS ——— */
/* Intro sous le titre des hubs (Sport, Connaissances, …) — même mise en forme */
.dash-hub-intro {
    margin-bottom: 12px;
    font-size: 0.95rem;
    line-height: 1.55;
    color: #374151;
}

.dash-hub-intro p {
    margin: 0 0 0.55em;
}

.dash-hub-intro p:last-child {
    margin-bottom: 0;
}

.sport-program-intro-card .content-card__body {
    padding-top: 8px;
}

.sport-intro-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
}

.sport-intro-article {
    margin-bottom: 8px;
}

.sport-intro-program-progress {
    margin: 20px 0 8px;
    padding: 14px 16px;
    border-radius: var(--dash-radius-sm);
    background: #f9fafb;
    border: 1px solid #eef0f4;
}

.sport-intro-program-progress__label {
    margin: 0 0 10px;
    font-size: 0.82rem;
    font-weight: 650;
    color: #374151;
}

.sport-intro-weeks-title {
    margin: 24px 0 6px;
    font-size: 1.05rem;
    font-weight: 700;
    color: #111827;
}

.sport-intro-weeks-lead {
    margin: 0 0 14px;
    font-size: 0.9rem;
    color: #6b7280;
    line-height: 1.45;
}

.sport-intro-week-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
    gap: 12px;
}

.sport-intro-week-card {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    padding: 12px 12px 14px;
    border: 1px solid #e5e7eb;
    border-radius: var(--dash-radius-sm);
    background: #fff;
    box-shadow: var(--dash-shadow-card);
    cursor: pointer;
    text-align: left;
    font: inherit;
    color: inherit;
    transition: border-color 0.15s, box-shadow 0.15s, transform 0.12s;
}

.sport-intro-week-card:hover {
    border-color: var(--dash-accent-soft);
    box-shadow: 0 2px 8px rgba(107, 76, 154, 0.12);
}

.sport-intro-week-card:focus-visible {
    outline: 2px solid var(--dash-accent-soft);
    outline-offset: 2px;
}

.sport-intro-week-card__title {
    font-size: 0.95rem;
    font-weight: 700;
    color: #111827;
}

.sport-intro-week-card__phase {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #6b7280;
}

.sport-intro-week-card__bar {
    margin: 0;
}

.sport-intro-week-card__bar .sport-progress__label {
    min-width: 2.75rem;
}

.sport-intro-week-card__meta {
    font-size: 0.78rem;
    color: #4b5563;
}

.sport-lms-week-nav__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.sport-dash-nav-btn {
    font-size: 0.78rem;
    padding: 6px 10px;
}

.sport-lms-layout {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    min-height: min(70vh, 720px);
    padding: 0;
    overflow: visible;
}

.sport-lms-week-nav {
    flex: 0 0 200px;
    max-width: 100%;
    align-self: flex-start;
    position: sticky;
    top: calc(var(--dash-header-offset) + var(--dash-main-pad-top));
    min-height: calc(100vh - var(--dash-header-offset) - var(--dash-main-pad-top));
    max-height: calc(100vh - var(--dash-header-offset) - var(--dash-main-pad-top));
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    z-index: 40;
    border-right: 1px solid #eef0f4;
    background: #fafbfc;
    display: flex;
    flex-direction: column;
}

.sport-lms-week-nav__head {
    padding: 16px 14px 12px;
    border-bottom: 1px solid #eef0f4;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.sport-lms-week-nav__title {
    margin: 0;
    font-size: 0.85rem;
    font-weight: 700;
    color: #111827;
    line-height: 1.3;
}

.sport-lms-week-list {
    list-style: none;
    margin: 0;
    padding: 8px 10px 16px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.sport-lms-week-link {
    display: block;
    width: 100%;
    text-align: center;
    padding: 8px 6px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #fff;
    font-size: 0.8rem;
    font-weight: 600;
    color: #4b5563;
    cursor: pointer;
    transition: background 0.12s, border-color 0.12s, color 0.12s;
}

.sport-lms-week-link:hover {
    background: rgba(107, 76, 154, 0.08);
    border-color: var(--dash-accent-soft);
    color: #111827;
}

.sport-lms-main {
    flex: 1;
    min-width: 0;
    padding: 20px 24px 32px;
}

.sport-lms-status {
    min-height: 1.25em;
    margin: 0 0 10px;
    font-size: 0.85rem;
    color: #b45309;
}

.sport-lms-program-head {
    margin-bottom: 20px;
}

.sport-lms-program-title {
    margin: 0 0 12px;
    font-size: 1.45rem;
    font-weight: 700;
    color: #111827;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.sport-lms-mount {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.sport-lms-error {
    margin: 0;
    padding: 14px 16px;
    border-radius: var(--dash-radius-sm);
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
    font-size: 0.92rem;
    line-height: 1.5;
}

.sport-lms-error p {
    margin: 0 0 0.5em;
}

.sport-lms-error p:last-child {
    margin-bottom: 0;
}

.sport-week {
    border: 1px solid #e5e7eb;
    border-radius: var(--dash-radius);
    background: var(--dash-bg-card);
    box-shadow: var(--dash-shadow-card);
    overflow: hidden;
}

.sport-week > summary {
    list-style: none;
    cursor: pointer;
    padding: 14px 16px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px 16px;
    background: #f9fafb;
    border-bottom: 1px solid #eef0f4;
}

.sport-week > summary::-webkit-details-marker {
    display: none;
}

.sport-week__title {
    font-size: 1rem;
    font-weight: 700;
    color: #111827;
    flex: 0 0 auto;
}

.sport-week[open] > summary {
    border-bottom-color: #e5e7eb;
}

.sport-session {
    padding: 16px 18px 18px;
    border-top: 1px solid #f3f4f6;
}

.sport-session:first-of-type {
    border-top: none;
}

.sport-session__head {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 10px;
}

.sport-session__head input[type='checkbox'] {
    width: 1.15rem;
    height: 1.15rem;
    margin-top: 3px;
    flex-shrink: 0;
    cursor: pointer;
    accent-color: var(--dash-accent-soft);
}

.sport-session__label {
    font-size: 1rem;
    font-weight: 650;
    color: #111827;
    line-height: 1.35;
    cursor: pointer;
    user-select: none;
}

.sport-session__body {
    padding-left: calc(1.15rem + 12px);
}

.sport-progress {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1 1 160px;
    min-width: 120px;
}

.sport-progress--program {
    max-width: 420px;
}

.sport-progress__track {
    flex: 1;
    height: 8px;
    border-radius: 999px;
    background: #e5e7eb;
    overflow: hidden;
}

.sport-progress__fill {
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--dash-accent-soft), var(--dash-accent));
    transition: width 0.2s ease;
}

.sport-progress__label {
    font-size: 0.78rem;
    font-weight: 600;
    color: #6b7280;
    flex: 0 0 auto;
    min-width: 2.5rem;
    text-align: right;
}

.sport-progress--week .sport-progress__track {
    height: 6px;
}

.sport-progress--week .sport-progress__label {
    font-size: 0.72rem;
}

/* ——— Responsive ——— */
@media (max-width: 900px) {
    :root {
        --dash-main-pad-top: 16px;
    }

    .lms-layout {
        flex-direction: column;
        min-height: 0;
    }

    .lms-lesson-nav {
        flex: none;
        width: 100%;
        border-right: none;
        border-bottom: 1px solid #eef0f4;
        min-height: 0;
        max-height: min(45vh, calc(100vh - var(--dash-header-offset) - var(--dash-main-pad-top)));
    }

    .lms-page-list {
        display: flex;
        flex-direction: row;
        flex-wrap: wrap;
        gap: 4px;
        padding: 8px 12px 12px;
    }

    .lms-page-list li {
        flex: 1 1 auto;
    }

    .lms-page-link {
        border-left: none;
        border-bottom: 2px solid transparent;
        padding: 8px 12px;
        border-radius: 6px;
    }

    .lms-page-link--active {
        border-left: none;
        border-bottom-color: var(--dash-accent);
    }

    .dash-layout {
        flex-direction: column;
    }

    .dash-sidebar {
        width: 100%;
        flex-direction: row;
        flex-wrap: wrap;
        padding: 12px;
        border-right: none;
        border-bottom: 1px solid #2a2a2a;
        min-height: 0;
        max-height: min(52vh, calc(100vh - var(--dash-header-offset)));
    }

    .dash-sidebar__label {
        width: 100%;
        padding: 8px 12px 4px;
    }

    .dash-nav-item,
    .dash-nav-summary {
        padding: 8px 12px;
        width: auto;
        flex: 1 1 auto;
    }

    .dash-nav-details {
        width: 100%;
    }

    .dash-nav-sub {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .dash-nav-sub a {
        padding: 6px 12px 6px 24px;
    }

    .dash-sidebar__footer {
        width: 100%;
        text-align: center;
    }

    .dash-sidebar-upgrade {
        width: 100%;
        margin: 8px 0 0;
    }

    .dash-main {
        padding: 16px;
    }

    .dash-header__email {
        display: none;
    }

    .sport-lms-layout {
        flex-direction: column;
        min-height: 0;
    }

    .sport-lms-week-nav {
        flex: none;
        width: 100%;
        border-right: none;
        border-bottom: 1px solid #eef0f4;
        min-height: 0;
        max-height: min(40vh, calc(100vh - var(--dash-header-offset) - var(--dash-main-pad-top)));
        position: relative;
        top: auto;
    }

    .sport-lms-week-list {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .sport-lms-week-link {
        flex: 1 1 calc(25% - 4px);
    }

    .sport-session__body {
        padding-left: 0;
    }
}

/* Urgence — au-dessus des autres bandeaux, rouge, tous profils */
.ca-emergency-banner[hidden] {
    display: none !important;
}

.ca-emergency-banner {
    display: block;
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 10px 20px;
    box-sizing: border-box;
    text-align: center;
    font-size: 15px;
    line-height: 1.45;
    font-weight: 600;
    background: #fef2f2;
    color: #991b1b;
    border-bottom: 1px solid #fecaca;
}

/* Freemium — bandeau pleine largeur viewport (sous le header) */
/* L’attribut hidden doit primer sur display:block (sinon barre vide pour les comptes payants). */
.ca-freemium-banner[hidden] {
    display: none !important;
}

.ca-freemium-banner {
    display: block;
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 10px 20px;
    box-sizing: border-box;
    text-align: center;
    font-size: 15px;
    background: #e8f4ff;
    color: #0b3d6d;
    border-bottom: 1px solid #cfe2ff;
}

.ca-freemium-banner.ca-freemium-banner--cta {
    background: #fff3cd;
    color: #664d03;
    border-bottom-color: #ffecb5;
}

.ca-freemium-banner__link {
    appearance: none;
    border: none;
    background: transparent;
    color: inherit;
    font: inherit;
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 2px;
    cursor: pointer;
    padding: 0;
}

.ca-freemium-banner__link:hover {
    opacity: 0.85;
}

.ca-freemium-banner__link:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 2px;
    border-radius: 3px;
}

/* Bandeau invité — même palette que freemium « tests restants », CTA renforcé */
.ca-guest-signup-banner[hidden] {
    display: none !important;
}

.ca-checkout-banner[hidden] {
    display: none !important;
}

.ca-checkout-banner {
    display: block;
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 10px 20px;
    box-sizing: border-box;
    text-align: center;
    font-size: 14px;
    background: #ecfdf5;
    color: #065f46;
    border-bottom: 1px solid #a7f3d0;
}

.ca-checkout-banner.ca-checkout-banner--warn {
    background: #fef3c7;
    color: #92400e;
    border-bottom-color: #fde68a;
}

.lms-page-link__label {
    flex: 1;
    min-width: 0;
    text-align: left;
}

/* Clic → modale / vente : curseur invitant, pas « interdit » */
.lms-page-link.lms-page-link--locked {
    cursor: pointer;
}

.lms-page-link.lms-page-link--locked .lms-page-link__label {
    opacity: 0.55;
}

/* Badge cadenas freemium (cercle sombre + picto blanc) */
.ca-lock-badge.ca-lock-badge--freemium {
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #111827;
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.ca-lock-badge.ca-lock-badge--freemium svg {
    display: block;
}

.test-card--ca-locked .test-card__icon > svg:first-of-type {
    opacity: 0.42;
}

.test-card--ca-locked .test-card__icon .ca-lock-badge--freemium {
    position: absolute;
    top: -5px;
    right: -5px;
    z-index: 1;
}

.test-card--ca-locked:not(.test-card--psych) {
    position: relative;
}

.test-card--ca-locked:not(.test-card--psych) .ca-lock-badge--freemium {
    position: absolute;
    top: 10px;
    right: 10px;
}

#nav-psych-sub.dash-nav-sub a.dash-nav-sub-link--ca-locked {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding-right: 14px;
}

.sport-intro-week-card__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.sport-week__title-wrap {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    flex: 0 1 auto;
    min-width: 0;
}

.sport-lms-week-link__row {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.sport-week.sport-week--locked {
    opacity: 0.45;
}

.sport-week.sport-week--locked .sport-week__summary {
    cursor: not-allowed;
}

/* ——— Invité : masquer Statistiques / Paramètres (renfort CSS + JS) ——— */
body.ca-dashboard--guest .dash-nav-item[data-view='statistiques'],
body.ca-dashboard--guest .dash-nav-item[data-view='parametres'] {
    display: none !important;
}

.dash-nav-item--contact {
    position: relative;
}

.dash-nav-unread-badge {
    margin-left: auto;
    min-width: 18px;
    height: 18px;
    padding: 0 6px;
    border-radius: 999px;
    background: #ef4444;
    color: #fff;
    font-size: 11px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

.dash-nav-unread-badge[hidden] {
    display: none !important;
}

.contact-card__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.contact-card__body {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 16px;
}

.contact-list {
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 10px;
    background: #fff;
    min-height: 520px;
}

.contact-list__head h3 {
    margin: 4px 0 10px;
    font-size: 14px;
}

.contact-list__items {
    display: grid;
    gap: 8px;
}

.contact-conv-item {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 10px;
    text-align: left;
    background: #fff;
    cursor: pointer;
    display: grid;
    gap: 3px;
}

.contact-conv-item.active {
    border-color: #6b4c9a;
    background: #f3edff;
}

.contact-conv-item__title {
    font-weight: 600;
    font-size: 13px;
}

.contact-conv-item__preview {
    color: #4b5563;
    font-size: 12px;
}

.contact-conv-item__badge {
    justify-self: end;
    background: #ef4444;
    color: #fff;
    border-radius: 999px;
    font-size: 11px;
    min-width: 18px;
    padding: 2px 6px;
}

.contact-thread {
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 10px;
    min-height: 520px;
    display: grid;
    grid-template-rows: auto 1fr auto;
    gap: 12px;
}

.contact-thread__header {
    font-weight: 600;
}

.contact-thread__messages {
    border: 1px solid #eceff4;
    border-radius: 8px;
    padding: 10px;
    overflow: auto;
    max-height: 360px;
    display: grid;
    gap: 10px;
}

.contact-msg {
    border-radius: 10px;
    padding: 8px 10px;
    max-width: 82%;
}

.contact-msg--mine {
    justify-self: end;
    background: #f3edff;
}

.contact-msg--theirs {
    justify-self: start;
    background: #f4f6f8;
}

.contact-msg__meta {
    color: #6b7280;
    font-size: 11px;
    margin-bottom: 6px;
}

.contact-msg img {
    max-width: 240px;
    border-radius: 6px;
    border: 1px solid #ddd;
}

.contact-thread__composer textarea {
    width: 100%;
    resize: vertical;
}

.contact-thread__composer input[type='text'] {
    width: 100%;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    padding: 9px 10px;
    margin-bottom: 8px;
    font-size: 14px;
}

.contact-thread__actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 8px;
}

.contact-empty {
    color: #6b7280;
    font-size: 13px;
    margin: 0;
}

@media (max-width: 1000px) {
    .contact-card__body {
        grid-template-columns: 1fr;
    }
    .contact-list,
    .contact-thread {
        min-height: 0;
    }
}

/* ——— Header invité / connecté (mutuellement exclusifs) ——— */
/* Ne pas utiliser display:contents sur le wrapper user : avec [hidden], les
   enfants peuvent rester visibles comme flex items du header (bug navigateur). */
#dashHeaderGuestActions[hidden],
#dashHeaderUserActions[hidden] {
    display: none !important;
}

.dash-header__guest:not([hidden]) {
    display: flex;
    align-items: center;
    gap: 10px;
}

.dash-header__user:not([hidden]) {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    gap: 16px;
}

/* ——— Modal auth dashboard ——— */
.ca-dash-auth-dialog {
    max-width: calc(100vw - 32px);
    width: 420px;
    padding: 0;
    border: none;
    border-radius: var(--dash-radius);
    box-shadow: var(--dash-shadow-card), 0 12px 40px rgba(0, 0, 0, 0.12);
}

.ca-dash-auth-dialog::backdrop {
    background: rgba(15, 15, 20, 0.45);
}

.ca-dash-auth-dialog__inner {
    position: relative;
    padding: 24px 24px 22px;
}

.ca-dash-auth-dialog__close {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 8px;
    background: transparent;
    font-size: 1.35rem;
    line-height: 1;
    color: #6b7280;
    cursor: pointer;
}

.ca-dash-auth-dialog__close:hover {
    background: #f3f4f6;
    color: #111;
}

.ca-dash-auth-dialog__title {
    margin: 0 32px 8px 0;
    font-size: 1.2rem;
    font-weight: 650;
}

.ca-dash-auth-dialog__hint {
    margin: 0 0 16px;
    font-size: 0.875rem;
    color: #6b7280;
    line-height: 1.45;
}

.ca-dash-auth-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 18px;
    border-bottom: 1px solid #e8eaef;
}

.ca-dash-auth-tab {
    flex: 1;
    padding: 10px 12px;
    border: none;
    background: transparent;
    font-size: 0.9rem;
    font-weight: 600;
    color: #6b7280;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
}

.ca-dash-auth-tab--active {
    color: var(--dash-accent);
    border-bottom-color: var(--dash-accent);
}

.ca-dash-auth-panel {
    display: none;
}

.ca-dash-auth-panel.ca-dash-auth-panel--active {
    display: block;
}

.ca-dash-auth-reset[hidden] {
    display: none !important;
}

.ca-dash-auth-reset:not([hidden]) {
    display: block;
}

.ca-dash-auth-field {
    margin-bottom: 14px;
}

.ca-dash-auth-field label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 6px;
}

.ca-dash-auth-field input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #e5e7eb;
    border-radius: var(--dash-radius-sm);
    font-size: 0.95rem;
}

.ca-dash-auth-forgot {
    margin: 0 0 14px;
}

.ca-dash-auth-linkbtn {
    border: none;
    background: none;
    padding: 0;
    font-size: 0.85rem;
    color: var(--dash-accent-soft);
    text-decoration: underline;
    cursor: pointer;
}

.ca-dash-auth-submit {
    width: 100%;
    margin-top: 4px;
}

.ca-dash-auth-err {
    margin-top: 12px;
    padding: 10px 12px;
    border-radius: var(--dash-radius-sm);
    background: #fef2f2;
    color: #991b1b;
    font-size: 0.875rem;
}

.ca-dash-auth-success {
    margin-top: 12px;
    padding: 10px 12px;
    border-radius: var(--dash-radius-sm);
    background: #ecfdf5;
    color: #065f46;
    font-size: 0.875rem;
}

.ca-dash-auth-recaptcha {
    margin: 12px 0;
}

.ca-dash-auth-recaptcha-msg {
    margin: 0 0 10px;
    font-size: 0.8rem;
    color: #92400e;
}
