/* Shared, non-invasive foundations for historical and private CNBA pages. */
:root {
    --cnba-color-primary: #0077bc;
    --cnba-color-primary-dark: #00468b;
    --cnba-color-primary-deep: #003452;
    --cnba-color-primary-soft: #e5f3fb;
    --cnba-color-page: #edf5fa;
    --cnba-color-border: #b8d2e3;
    --cnba-color-text: #17324d;
    --cnba-color-success: #155724;
    --cnba-color-warning: #664d03;
    --cnba-color-danger: #b00020;
    --cnba-color-surface: #ffffff;
    --cnba-radius-sm: 4px;
    --cnba-space-1: 5px;
    --cnba-space-2: 10px;
    --cnba-space-3: 12px;
    --cnba-space-4: 16px;
    --cnba-focus-ring: 2px solid #2f7fae;
}

body.legacy-ds-app-shell {
    margin: 0;
    background: var(--cnba-color-page);
    color: var(--cnba-color-text);
    font-family: Arial, Helvetica, sans-serif;
}

.legacy-ds-app-shell .legacy-ds-responsive-page h1 {
    margin: 0 0 20px;
    color: var(--cnba-color-primary-deep);
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -.02em;
}

.legacy-ds-app-shell select,
.legacy-ds-app-shell input,
.legacy-ds-app-shell textarea {
    border: 1px solid #87abc2;
    border-radius: 6px;
    background: #fff;
    color: var(--cnba-color-text);
}

.legacy-ds-app-shell select:hover,
.legacy-ds-app-shell input:hover,
.legacy-ds-app-shell textarea:hover { border-color: var(--cnba-color-primary); }

.legacy-ds-message {
    border: 1px solid currentColor;
    border-left-width: 6px;
    border-radius: var(--cnba-radius-sm);
    margin: var(--cnba-space-4) 0;
    padding: var(--cnba-space-3) var(--cnba-space-4);
}

.legacy-ds-message--success { color: var(--cnba-color-success); }
.legacy-ds-message--warning { color: var(--cnba-color-warning); }
.legacy-ds-message--danger { color: var(--cnba-color-danger); }

.legacy-ds-private-banner {
    margin: 0;
    height: 120px;
    background: rgb(0, 70, 139) url(/assets/images/banner.jpg) left top no-repeat;
}

.legacy-ds-hidden-heading {
    color: #336699;
    text-align: center;
    display: none;
}

.legacy-ds-listing-title {
    padding-top: 10px;
    padding-left: 10px;
}

.legacy-ds-listing-logo {
    float: left;
    margin: -15px 10px 0 -5px;
}

.legacy-ds-clear-left { clear: left; }
.legacy-ds-return { float: right; padding-right: 10px; }
.legacy-ds-return a { color: orange; }

a:focus,
button:focus,
input:focus,
select:focus,
textarea:focus {
    outline: none;
}

a:focus:not(:focus-visible),
button:focus:not(:focus-visible),
input:focus:not(:focus-visible),
select:focus:not(:focus-visible),
textarea:focus:not(:focus-visible) {
    outline: none;
}

html[data-cnba-input-modality="pointer"] a:focus,
html[data-cnba-input-modality="pointer"] button:focus,
html[data-cnba-input-modality="pointer"] input:focus,
html[data-cnba-input-modality="pointer"] select:focus,
html[data-cnba-input-modality="pointer"] textarea:focus {
    outline: none;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: var(--cnba-focus-ring);
    outline-offset: 2px;
}

html[data-cnba-input-modality="keyboard"] a:focus,
html[data-cnba-input-modality="keyboard"] button:focus,
html[data-cnba-input-modality="keyboard"] input:focus,
html[data-cnba-input-modality="keyboard"] select:focus,
html[data-cnba-input-modality="keyboard"] textarea:focus {
    outline: var(--cnba-focus-ring);
    outline-offset: 2px;
}

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

.legacy-ds-table-wrap {
    overflow-x: auto;
    margin-top: var(--cnba-space-4);
    border: 1px solid var(--cnba-color-border);
    border-radius: 8px;
    background: var(--cnba-color-surface);
    box-shadow: 0 4px 14px rgba(0, 70, 139, 0.1);
}

.legacy-ds-table {
    width: 100%;
    min-width: 1050px;
    border-collapse: collapse;
    color: #17324d;
}

.legacy-ds-table th,
.legacy-ds-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #dce5ed;
    text-align: left;
    vertical-align: top;
}

.legacy-ds-table th {
    background: var(--cnba-color-primary-dark);
    color: #fff;
    font-size: 0.9rem;
    white-space: nowrap;
}

.legacy-ds-table tbody tr:nth-child(even) { background: #f4f9fc; }
.legacy-ds-table tbody tr:hover { background: var(--cnba-color-primary-soft); }
.legacy-ds-table tbody tr:last-child td { border-bottom: 0; }
.legacy-ds-table tbody tr.legacy-ds-row-closed,
.legacy-ds-table tbody tr.legacy-ds-row-closed:hover { background: #e7ebee; color: #61707c; }
.legacy-ds-row-closed select,
.legacy-ds-row-closed input,
.legacy-ds-row-closed textarea,
.legacy-ds-row-closed button { opacity: 0.6; cursor: not-allowed; }
.legacy-ds-row-closed .legacy-ds-reopen,
.legacy-ds-row-closed .legacy-ds-delete-button { opacity: 1; cursor: pointer; }
.legacy-ds-decision-button {
    min-height: 44px;
    padding: 10px 16px;
    border: 1px solid var(--cnba-color-primary-dark);
    border-radius: 7px;
    background: linear-gradient(180deg, var(--cnba-color-primary), var(--cnba-color-primary-dark));
    color: #fff;
    font-weight: 700;
    letter-spacing: .01em;
    box-shadow: 0 3px 8px rgba(0, 70, 139, .22);
    cursor: pointer;
    transition: background-color .15s ease, box-shadow .15s ease, transform .15s ease;
}
.legacy-ds-decision-button:hover {
    background: var(--cnba-color-primary-deep);
    box-shadow: 0 4px 12px rgba(0, 70, 139, .28);
}
.legacy-ds-decision-button:active {
    box-shadow: 0 1px 4px rgba(0, 70, 139, .22);
    transform: translateY(1px);
}
.legacy-ds-delete-form { margin-top: 16px; }
.legacy-ds-delete-button {
    min-height: 44px;
    padding: 9px 14px;
    border: 1px solid var(--cnba-color-danger);
    border-radius: 7px;
    background: #fff;
    color: var(--cnba-color-danger);
    font-weight: 700;
    cursor: pointer;
}
.legacy-ds-delete-button:hover { background: #fff0f2; }
.legacy-ds-proposal {
    margin-bottom: 12px;
    padding: 10px;
    border: 1px solid #9bbbd0;
    border-radius: 8px;
    background: #eef7fc;
}
.legacy-ds-proposal summary { color: #005f96; font-weight: 700; cursor: pointer; }
.legacy-ds-proposal p { margin: 10px 0; }
.legacy-ds-proposal pre {
    max-height: 220px;
    margin: 10px 0;
    padding: 10px;
    overflow: auto;
    border: 1px solid #c8dbe7;
    border-radius: 6px;
    background: #fff;
    color: #233746;
    font: inherit;
    white-space: pre-wrap;
}
.legacy-ds-row-closed .legacy-ds-test-toggle { opacity: 1; cursor: pointer; }
.legacy-ds-test-summary td { padding: 0; }
.legacy-ds-test-toggle {
    display: grid;
    grid-template-columns: minmax(180px, 2fr) repeat(3, minmax(110px, 1fr)) auto;
    gap: 12px;
    align-items: center;
    width: 100%;
    min-height: 52px;
    padding: 10px 12px;
    border: 0;
    background: transparent;
    color: inherit;
    text-align: left;
    cursor: pointer;
}
.legacy-ds-test-toggle:hover { background: var(--cnba-color-primary-soft); }
.legacy-ds-test-toggle-state { justify-self: end; color: #005f96; font-weight: 700; }
.legacy-ds-test-meta { margin-top: 12px; padding-top: 8px; border-top: 1px solid #c8d4df; color: #52697c; font-size: .875rem; }
.legacy-ds-test-details[hidden] { display: none; }

.legacy-ds-sort-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 28px;
    color: #fff;
    text-decoration: none;
}
.legacy-ds-sort-link:hover { color: #fff; text-decoration: underline; }
.legacy-ds-sort-link:focus-visible { border-radius: 4px; outline: var(--cnba-focus-ring); outline-offset: 2px; }
.legacy-ds-sort-icon {
    position: relative;
    display: inline-block;
    width: 14px;
    height: 18px;
    flex: 0 0 14px;
}
.legacy-ds-sort-icon::before,
.legacy-ds-sort-icon::after {
    position: absolute;
    left: 3px;
    width: 0;
    height: 0;
    border-right: 4px solid transparent;
    border-left: 4px solid transparent;
    content: "";
}
.legacy-ds-sort-icon::before { top: 2px; border-bottom: 5px solid currentColor; }
.legacy-ds-sort-icon::after { bottom: 2px; border-top: 5px solid currentColor; }
.legacy-ds-sort-icon--asc::after,
.legacy-ds-sort-icon--desc::before { display: none; }
.legacy-ds-sort-icon--toggle::before,
.legacy-ds-sort-icon--toggle::after { display: block; opacity: .35; }
.legacy-ds-sort-icon--asc-active::before,
.legacy-ds-sort-icon--desc-active::after { opacity: 1; }
.legacy-ds-mobile-sort button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #8baec5;
    border-radius: 6px;
    background: #fff;
    color: #004a78;
}
.legacy-ds-mobile-sort button:hover,
.legacy-ds-mobile-sort button:focus-visible {
    border-color: var(--cnba-color-primary);
    background: #eaf4fb;
}

.legacy-ds-filter-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: end;
    gap: var(--cnba-space-2);
    padding: var(--cnba-space-3);
    border: 1px solid var(--cnba-color-border);
    border-top: 4px solid var(--cnba-color-primary);
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 3px 12px rgba(0, 70, 139, .08);
}

.legacy-ds-filter-bar label { font-weight: 600; }
.legacy-ds-filter-bar select,
.legacy-ds-filter-bar button { min-height: 40px; }
.legacy-ds-filter-bar button {
    padding: 8px 18px;
    border: 1px solid var(--cnba-color-primary-dark);
    border-radius: 6px;
    background: var(--cnba-color-primary-dark);
    color: #fff;
    font-weight: 700;
    cursor: pointer;
}
.legacy-ds-filter-bar button:hover { background: var(--cnba-color-primary-deep); }

.legacy-ds-row-form {
    display: grid;
    gap: 6px;
    min-width: 220px;
}

.legacy-ds-row-form label { font-weight: 600; }
.legacy-ds-row-form textarea { min-height: 64px; resize: vertical; }
.legacy-ds-autosave-field { min-width: 180px; }
.legacy-ds-autosave-field select,
.legacy-ds-autosave-field textarea { width: 100%; box-sizing: border-box; }
.legacy-ds-autosave-status { display: block; min-height: 1.4em; margin-top: 4px; }
.legacy-ds-autosave-status[data-state="saving"],
.legacy-ds-autosave-status[data-state="pending"] { color: #52697c; }
.legacy-ds-autosave-status[data-state="saved"] { color: #176b3a; }
.legacy-ds-autosave-status[data-state="error"] { color: #b00020; font-weight: 600; }
.legacy-ds-table .legacy-ds-autosave-status { display: none; }
.legacy-ds-autosave-summary {
    min-height: 1.5em;
    margin: 12px 0 0;
    padding: 8px 12px;
}
.legacy-ds-table textarea[name="planning_comment"],
.legacy-ds-table--coach td:nth-child(5) .legacy-ds-muted { display: none; }
.legacy-ds-muted { color: #52697c; font-size: 0.875rem; }
.legacy-ds-empty { padding: 24px !important; text-align: center !important; }

.legacy-ds-mobile-sort { display: none; }

@media (max-width: 1500px) {
    .legacy-ds-responsive-page { padding: 12px !important; }
    .legacy-ds-responsive-page h1 { font-size: 1.5rem; line-height: 1.25; }
    .legacy-ds-filter-bar > * { width: 100%; box-sizing: border-box; }
    .legacy-ds-filter-bar select,
    .legacy-ds-filter-bar button,
    .legacy-ds-mobile-sort select,
    .legacy-ds-mobile-sort button,
    .legacy-ds-table--responsive input,
    .legacy-ds-table--responsive select,
    .legacy-ds-table--responsive textarea,
    .legacy-ds-table--responsive button { min-height: 44px; font-size: 16px; box-sizing: border-box; }
    .legacy-ds-mobile-sort {
        display: grid;
        grid-template-columns: minmax(0, 1fr) 48px;
        gap: 8px;
        margin-top: 12px;
        padding: 12px;
        border-radius: 8px;
        border: 1px solid var(--cnba-color-border);
        background: #fff;
        box-shadow: 0 3px 12px rgba(0, 70, 139, .08);
    }
    .legacy-ds-mobile-sort label { grid-column: 1 / -1; font-weight: 600; }
    .legacy-ds-mobile-sort select { width: 100%; }
    .legacy-ds-table-wrap { overflow: visible; border: 0; background: transparent; box-shadow: none; }
    .legacy-ds-table--responsive { min-width: 0; border-collapse: separate; border-spacing: 0 12px; }
    .legacy-ds-table--responsive thead {
        position: absolute;
        width: 1px;
        height: 1px;
        padding: 0;
        margin: -1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
        white-space: nowrap;
        border: 0;
    }
    .legacy-ds-table--responsive tbody,
    .legacy-ds-table--responsive tr,
    .legacy-ds-table--responsive td { display: block; width: 100%; box-sizing: border-box; }
    .legacy-ds-table--responsive tr {
        overflow: hidden;
        border: 1px solid var(--cnba-color-border);
        border-left: 5px solid var(--cnba-color-primary);
        border-radius: 10px;
        background: var(--cnba-color-surface);
        box-shadow: 0 4px 14px rgba(0, 70, 139, 0.1);
    }
    .legacy-ds-table--responsive .legacy-ds-test-summary { margin-bottom: 0; }
    .legacy-ds-table--responsive .legacy-ds-test-summary td { padding: 0; }
    .legacy-ds-table--responsive .legacy-ds-test-summary td::before { display: none; }
    .legacy-ds-test-toggle { grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; }
    .legacy-ds-test-toggle > span { grid-column: 1; }
    .legacy-ds-test-toggle-state { grid-column: 2; grid-row: 1 / span 4; align-self: center; }
    .legacy-ds-table--responsive td { padding: 10px 12px; overflow-wrap: anywhere; }
    .legacy-ds-table--responsive td::before {
        display: block;
        margin-bottom: 4px;
        color: #004a78;
        font-size: 0.8rem;
        font-weight: 700;
        text-transform: uppercase;
    }
    .legacy-ds-table--responsive td:last-child { border-bottom: 0; }
    .legacy-ds-table--responsive form,
    .legacy-ds-table--responsive input,
    .legacy-ds-table--responsive select,
    .legacy-ds-table--responsive textarea,
    .legacy-ds-table--responsive button { width: 100%; max-width: 100%; }
    .legacy-ds-row-form { min-width: 0; }
    .legacy-ds-autosave-field { min-width: 0; }
    .legacy-ds-table--admin td:nth-child(1)::before,
    .legacy-ds-table--coach td:nth-child(1)::before { content: "Nom"; }
    .legacy-ds-table--admin td:nth-child(2)::before,
    .legacy-ds-table--coach td:nth-child(2)::before { content: "Prénom"; }
    .legacy-ds-table--admin td:nth-child(3)::before,
    .legacy-ds-table--coach td:nth-child(3)::before { content: "Naissance"; }
    .legacy-ds-table--admin td:nth-child(4)::before,
    .legacy-ds-table--coach td:nth-child(4)::before { content: "Groupe"; }
    .legacy-ds-table--admin td:nth-child(5)::before { content: "Arrivée"; }
    .legacy-ds-table--coach td:nth-child(5)::before,
    .legacy-ds-table--admin td:nth-child(6)::before { content: "Date du test"; }
    .legacy-ds-table--coach td:nth-child(6)::before,
    .legacy-ds-table--admin td:nth-child(7)::before { content: "Statut"; }
    .legacy-ds-table--coach td:nth-child(7)::before,
    .legacy-ds-table--admin td:nth-child(8)::before { content: "Présence"; }
    .legacy-ds-table--coach td:nth-child(8)::before,
    .legacy-ds-table--admin td:nth-child(9)::before { content: "Avis"; }
    .legacy-ds-table--coach td:nth-child(9)::before,
    .legacy-ds-table--admin td:nth-child(10)::before { content: "Commentaire"; }
    .legacy-ds-table--admin td:nth-child(11)::before { content: "Planification"; }
    .legacy-ds-table--admin td:nth-child(12)::before { content: "Décision"; }
    .legacy-ds-table--responsive .legacy-ds-empty::before { content: none; }
}

@media (min-width: 701px) and (max-width: 1500px) {
    .legacy-ds-responsive-page h1 { font-size: 1.75rem; }
    .legacy-ds-filter-bar > * { width: auto; }
    .legacy-ds-filter-bar select { min-width: 220px; }
    .legacy-ds-table--responsive tr.legacy-ds-test-details {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .legacy-ds-table--responsive tr.legacy-ds-test-details > td { width: auto; }
}

@media (min-width: 1101px) and (max-width: 1500px) {
    .legacy-ds-table--responsive tr.legacy-ds-test-details {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

/* La liste reste condensée; le détail est présenté dans la couche modale. */
.legacy-ds-mobile-sort {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 48px;
    gap: 8px;
    margin-top: 12px;
    padding: 12px;
    border-radius: 8px;
    border: 1px solid var(--cnba-color-border);
    background: #fff;
    box-shadow: 0 3px 12px rgba(0, 70, 139, .08);
}

.legacy-ds-dashboard-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}
.legacy-ds-app-shell .legacy-ds-responsive-page .legacy-ds-dashboard-header h1 { margin: 8px 0 0; }
.legacy-ds-private-back {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 40px;
    padding: 6px 10px;
    border: 1px solid #8baec5;
    border-radius: 7px;
    background: #fff;
    color: #004a78;
    font-weight: 700;
    text-decoration: none;
}
.legacy-ds-private-back:hover { border-color: var(--cnba-color-primary); background: #eaf4fb; }
.legacy-ds-view-switch { display: inline-flex; flex: 0 0 auto; gap: 6px; }
.legacy-ds-view-switch a {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border: 1px solid #8baec5;
    border-radius: 7px;
    background: #fff;
    color: #004a78;
}
.legacy-ds-view-switch a:hover { background: #eaf4fb; }
.legacy-ds-view-switch a.is-active { border-color: var(--cnba-color-primary-dark); background: var(--cnba-color-primary-dark); color: #fff; }
.legacy-ds-list-icon,
.legacy-ds-list-icon::before,
.legacy-ds-list-icon::after { width: 20px; height: 2px; background: currentColor; content: ""; }
.legacy-ds-list-icon { position: relative; display: block; }
.legacy-ds-list-icon::before { position: absolute; top: -6px; left: 0; }
.legacy-ds-list-icon::after { position: absolute; top: 6px; left: 0; }
.legacy-ds-clock-icon { position: relative; width: 20px; height: 20px; border: 2px solid currentColor; border-radius: 50%; }
.legacy-ds-clock-icon::before { position: absolute; top: 3px; left: 8px; width: 2px; height: 7px; background: currentColor; content: ""; }
.legacy-ds-clock-icon::after { position: absolute; top: 9px; left: 8px; width: 6px; height: 2px; background: currentColor; content: ""; transform: rotate(25deg); transform-origin: left center; }
.legacy-ds-week-view { margin-top: 16px; }
.legacy-ds-week-nav { display: flex; align-items: center; justify-content: center; gap: 16px; margin-bottom: 12px; }
.legacy-ds-week-nav h2 { margin: 0; color: #17324d; font-size: 1.2rem; }
.legacy-ds-week-nav a { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border: 1px solid #8baec5; border-radius: 7px; background: #fff; color: #004a78; font-size: 1.8rem; text-decoration: none; }
.legacy-ds-week-grid { display: grid; grid-template-columns: repeat(6, minmax(150px, 1fr)); gap: 8px; overflow-x: auto; padding-bottom: 8px; }
.legacy-ds-week-day { min-height: 260px; padding: 10px; border: 1px solid var(--cnba-color-border); border-radius: 9px; background: #fff; }
.legacy-ds-week-day h3 { display: flex; justify-content: space-between; gap: 6px; margin: 0 -10px 10px; padding: 0 10px 9px; border-bottom: 2px solid var(--cnba-color-primary); color: #004a78; font-size: .95rem; }
.legacy-ds-week-day h3 small { color: #52697c; font-weight: 600; }
.legacy-ds-week-test { display: grid; width: 100%; gap: 4px; margin-bottom: 8px; padding: 9px; border: 0; border-left: 4px solid var(--cnba-color-primary); border-radius: 6px; background: var(--cnba-color-primary-soft); color: #17324d; font: inherit; text-align: left; cursor: pointer; }
.legacy-ds-week-test:hover { background: #d7edf9; }
.legacy-ds-week-test span,
.legacy-ds-week-test small { overflow-wrap: anywhere; }
.legacy-ds-week-test small { color: #52697c; }
.legacy-ds-week-test.is-closed { border-left-color: #8795a1; background: #eef1f3; opacity: .8; }
.legacy-ds-week-empty { color: #718392; font-size: .875rem; text-align: center; }

@media (max-width: 700px), (orientation: portrait) and (min-width: 701px) and (max-width: 1024px) {
    .legacy-ds-dashboard-header { align-items: flex-start; }
    .legacy-ds-app-shell .legacy-ds-responsive-page .legacy-ds-dashboard-header h1 { font-size: 1.45rem; }
    .legacy-ds-private-back { min-height: 36px; }
    .legacy-ds-week-grid { grid-template-columns: repeat(6, minmax(180px, 78vw)); scroll-snap-type: x proximity; }
    .legacy-ds-week-day { scroll-snap-align: start; }
}
.legacy-ds-mobile-sort label { grid-column: 1 / -1; font-weight: 600; }
.legacy-ds-mobile-sort select { width: 100%; }
.legacy-ds-table-wrap { overflow: visible; }
.legacy-ds-table--responsive { min-width: 0; border-collapse: separate; }
.legacy-ds-table--responsive thead {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
.legacy-ds-table--admin .legacy-ds-test-toggle {
    grid-template-columns: minmax(170px, 1.5fr) repeat(5, minmax(105px, 1fr)) auto;
}
.legacy-ds-table--coach .legacy-ds-test-toggle {
    grid-template-columns: minmax(170px, 1.5fr) repeat(4, minmax(105px, 1fr)) auto;
}
@media (min-width: 901px) {
    .legacy-ds-test-toggle > span { grid-column: auto; }
    .legacy-ds-test-toggle-state { grid-column: auto; grid-row: auto; align-self: center; }
}
.legacy-ds-test-toggle > span[data-label]::before {
    display: block;
    margin-bottom: 2px;
    color: #48687e;
    content: attr(data-label);
    font-size: .75rem;
    font-weight: 600;
    text-transform: uppercase;
}
.legacy-ds-dialog-open { overflow: hidden; }
.legacy-ds-test-dialog {
    width: min(1100px, calc(100% - 48px));
    max-width: 1100px;
    max-height: calc(100vh - 48px);
    padding: 0;
    overflow: hidden;
    border: 0;
    border-radius: 12px;
    background: #fff;
    color: #17324d;
    box-shadow: 0 22px 64px rgba(0, 36, 68, .34);
}
.legacy-ds-test-dialog::backdrop { background: rgba(10, 31, 48, .58); }
.legacy-ds-test-dialog > header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    border-bottom: 0;
    background: linear-gradient(135deg, var(--cnba-color-primary-dark), var(--cnba-color-primary));
}
.legacy-ds-test-dialog h2 { margin: 0; color: #fff; font-size: 1.35rem; }
.legacy-ds-dialog-back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    padding: 8px 12px;
    border: 1px solid rgba(255, 255, 255, .75);
    border-radius: 6px;
    background: #fff;
    color: #004a78;
    cursor: pointer;
}
.legacy-ds-back-icon { position: relative; width: 16px; height: 12px; }
.legacy-ds-back-icon::before { position: absolute; top: 5px; left: 1px; width: 14px; height: 2px; background: currentColor; content: ""; }
.legacy-ds-back-icon::after { position: absolute; top: 2px; left: 1px; width: 7px; height: 7px; border-bottom: 2px solid currentColor; border-left: 2px solid currentColor; content: ""; transform: rotate(45deg); }
.legacy-ds-test-dialog-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    max-height: calc(100vh - 190px);
    padding: 20px;
    overflow-y: auto;
}
.legacy-ds-test-dialog-field {
    min-width: 0;
    padding: 12px;
    border: 1px solid var(--cnba-color-border);
    border-radius: 8px;
    background: #f4f9fc;
}
.legacy-ds-test-dialog-field h3 { margin: 0 0 8px; color: #004a78; font-size: .8rem; text-transform: uppercase; }
.legacy-ds-test-dialog-field form,
.legacy-ds-test-dialog-field input,
.legacy-ds-test-dialog-field select,
.legacy-ds-test-dialog-field textarea,
.legacy-ds-test-dialog-field button { width: 100%; max-width: 100%; box-sizing: border-box; }
.legacy-ds-test-dialog-field input,
.legacy-ds-test-dialog-field select,
.legacy-ds-test-dialog-field button { min-height: 44px; }
.legacy-ds-test-dialog-footer {
    min-height: 44px;
    padding: 10px 20px;
    border-top: 1px solid var(--cnba-color-border);
    background: var(--cnba-color-primary-soft);
}
.legacy-ds-test-dialog-footer .legacy-ds-test-meta { margin-top: 6px; }
.legacy-ds-test-dialog-grid .legacy-ds-autosave-status,
.legacy-ds-test-dialog textarea[name="planning_comment"],
.legacy-ds-test-dialog--coach .legacy-ds-test-dialog-field:nth-child(5) .legacy-ds-muted { display: none; }
.legacy-ds-row-closed .legacy-ds-dialog-back { opacity: 1; cursor: pointer; }

@media (max-width: 900px) {
    .legacy-ds-table--admin .legacy-ds-test-toggle,
    .legacy-ds-table--coach .legacy-ds-test-toggle { grid-template-columns: minmax(0, 1fr) auto; }
    .legacy-ds-test-toggle > span { grid-column: 1; }
    .legacy-ds-test-toggle-state { grid-column: 2; grid-row: 1 / span 6; align-self: center; }
    .legacy-ds-test-dialog-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 700px), (orientation: portrait) and (min-width: 701px) and (max-width: 1024px) {
    .legacy-ds-table--admin .legacy-ds-test-toggle,
    .legacy-ds-table--coach .legacy-ds-test-toggle {
        grid-template-columns: repeat(3, minmax(0, 1fr)) 44px;
        grid-template-rows: auto auto;
        gap: 6px 8px;
        min-height: 92px;
        align-items: start;
    }
    .legacy-ds-test-toggle > strong {
        display: block;
        grid-column: 1 / 4;
        grid-row: 1;
        min-width: 0;
        justify-self: end;
        overflow-wrap: anywhere;
        text-align: right;
    }
    .legacy-ds-test-toggle > span[data-label="Arrivée"],
    .legacy-ds-test-toggle > span[data-label="Présence"] { display: none; }
    .legacy-ds-test-toggle > span[data-label] {
        min-width: 0;
        overflow-wrap: anywhere;
        white-space: normal;
    }
    .legacy-ds-test-toggle > span[data-label="Groupe"] { grid-column: 1; grid-row: 2; }
    .legacy-ds-test-toggle > span[data-label="Date du test"] { grid-column: 2; grid-row: 2; }
    .legacy-ds-test-toggle > span[data-label="Statut"] { grid-column: 3; grid-row: 2; }
    .legacy-ds-test-toggle-state {
        position: relative;
        grid-column: 4;
        grid-row: 1 / span 2;
        align-self: center;
        width: 44px;
        height: 44px;
        overflow: hidden;
        color: transparent;
    }
    .legacy-ds-test-toggle-state::after {
        position: absolute;
        top: 15px;
        right: 14px;
        width: 10px;
        height: 10px;
        border-top: 2px solid var(--cnba-color-primary-dark);
        border-right: 2px solid var(--cnba-color-primary-dark);
        content: "";
        transform: rotate(45deg);
    }
    .legacy-ds-test-dialog {
        width: 100%;
        max-width: none;
        height: 100%;
        height: 100dvh;
        max-height: 100%;
        max-height: 100dvh;
        margin: 0;
        border-radius: 0;
        overflow-y: auto;
        overscroll-behavior: contain;
    }
    .legacy-ds-test-dialog > header {
        position: sticky;
        top: 0;
        z-index: 1;
        padding: max(10px, env(safe-area-inset-top)) 12px 10px;
    }
    .legacy-ds-test-dialog h2 { font-size: 1.1rem; }
    .legacy-ds-test-dialog-grid { grid-template-columns: 1fr; max-height: none; padding: 12px; overflow: visible; }
    .legacy-ds-test-dialog-footer { position: static; padding: 8px 12px max(8px, env(safe-area-inset-bottom)); }
}

/* Reminder preview follows the private theme, including dialogs moved outside the content shell. */
.legacy-ds-reminder { background:var(--cnba-surface,#eef7fc); color:var(--cnba-ink,#17324d); overflow-wrap:anywhere; }
.legacy-ds-reminder summary { color:var(--cnba-blue-dark,#005f96); }
.legacy-ds-reminder pre { background:var(--cnba-surface,#fff); color:var(--cnba-ink,#233746); }
.legacy-ds-reminder .legacy-ds-decision-button { background:var(--cnba-action-background,#00468b); color:var(--cnba-ink,#fff); }
