/*
    Loire Games brand colours :
    - Black : #1C1C1C
    - Yellow : #FDD416
*/

:root {
    --lg-black: #1C1C1C;
    --lg-yellow: #FDD416;
    --lg-grey-50: #F7F7F7;
    --lg-grey-200: #E3E3E3;
    --lg-grey-500: #8A8A8A;
    --lg-red: #D93025;
    --lg-green: #1E8E3E;
    --lg-orange: #F9AB00;
}

* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: var(--lg-black);
    background: var(--lg-grey-50);
}

h1, h2, h3 {
    color: var(--lg-black);
    margin-top: 0;
}

/* Layout */
.lg-app {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.lg-header {
    background: var(--lg-black);
    color: var(--lg-yellow);
    padding: 16px 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.lg-header__brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Logged-in user + logout (right side of the header). */
.lg-header__user {
    display: flex;
    align-items: center;
    gap: 12px;
}

.lg-header__username {
    color: #fff;
    font-size: 13px;
    opacity: 0.85;
}

.lg-header__logout {
    background: transparent;
    color: var(--lg-yellow);
    border: 1px solid var(--lg-yellow);
    border-radius: 4px;
    padding: 6px 12px;
    font-size: 13px;
    cursor: pointer;
}

.lg-header__logout:hover {
    background: var(--lg-yellow);
    color: var(--lg-black);
}

/* Groupe de droite dans l'en-tête (hamburger + utilisateur). */
.lg-header__right {
    display: flex;
    align-items: center;
    gap: 14px;
}

/* La case qui pilote le menu mobile reste invisible (état uniquement). */
.lg-nav-toggle { display: none; }

/* Bouton hamburger — caché sur desktop, affiché sur mobile. */
.lg-burger {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 26px;
    height: 19px;
    cursor: pointer;
}

.lg-burger span {
    display: block;
    height: 3px;
    width: 100%;
    background: var(--lg-yellow);
    border-radius: 2px;
}

/* ===== Login page ===== */
.lg-login {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--lg-grey-50);
    padding: 24px;
}

.lg-login__card {
    width: 100%;
    max-width: 360px;
    background: #fff;
    border-top: 4px solid var(--lg-yellow);
    border-radius: 6px;
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.12);
    padding: 32px;
}

.lg-login__brand {
    display: flex;
    align-items: center;
    gap: 10px;
}

.lg-login__dot {
    width: 14px;
    height: 14px;
    background: var(--lg-yellow);
    border-radius: 50%;
    display: inline-block;
}

.lg-login__title {
    font-weight: 700;
    font-size: 20px;
    letter-spacing: 2px;
    color: var(--lg-black);
}

.lg-login__subtitle {
    color: var(--lg-grey-500);
    font-size: 13px;
    margin: 6px 0 20px;
}

.lg-login__form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.lg-login__label {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 13px;
    font-weight: 600;
    color: var(--lg-black);
}

.lg-login__submit {
    margin-top: 6px;
    width: 100%;
}

.lg-header__dot {
    width: 14px;
    height: 14px;
    background: var(--lg-yellow);
    border-radius: 50%;
    display: inline-block;
}

.lg-header__title {
    font-weight: 700;
    font-size: 20px;
    letter-spacing: 2px;
}

.lg-header__subtitle {
    color: #fff;
    font-size: 14px;
    opacity: 0.8;
    margin-left: 12px;
}

.lg-nav {
    background: var(--lg-black);
    border-top: 2px solid var(--lg-yellow);
    padding: 0 32px;
    display: flex;
    gap: 24px;
}

.lg-nav__link {
    color: #fff;
    text-decoration: none;
    padding: 12px 4px;
    font-size: 14px;
    border-bottom: 2px solid transparent;
}

.lg-nav__link.active {
    color: var(--lg-yellow);
    border-bottom-color: var(--lg-yellow);
}

/* ── Nav dropdown (« Gestion adhérents ») — <details>/<summary>, ouverture au clic ── */
.lg-nav__dropdown {
    position: relative;
}

/* The <summary> acts as the clickable toggle; hide the native disclosure triangle. */
.lg-nav__dropdown-toggle {
    cursor: pointer;
    user-select: none;
    list-style: none;
    display: inline-block;
}

.lg-nav__dropdown-toggle::-webkit-details-marker {
    display: none;
}

.lg-nav__dropdown-toggle::marker {
    content: "";
}

/* Highlight the toggle while the menu is open. */
.lg-nav__dropdown[open] > .lg-nav__dropdown-toggle {
    color: var(--lg-yellow);
}

/* The menu overlays the content (absolute), shown only when <details> is open. */
.lg-nav__dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 200px;
    background: var(--lg-black);
    border: 1px solid var(--lg-yellow);
    border-top: none;
    display: flex;
    flex-direction: column;
    z-index: 50;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35);
}

.lg-nav__dropdown-item {
    color: #fff;
    text-decoration: none;
    padding: 10px 16px;
    font-size: 14px;
    border-left: 3px solid transparent;
    white-space: nowrap;
}

.lg-nav__dropdown-item:hover {
    background: rgba(255, 255, 255, 0.08);
}

.lg-nav__dropdown-item.active {
    color: var(--lg-yellow);
    border-left-color: var(--lg-yellow);
}

.lg-main {
    flex: 1;
    padding: 32px;
    max-width: 1100px;
    width: 100%;
    margin: 0 auto;
}

.lg-footer {
    text-align: center;
    padding: 16px;
    color: var(--lg-grey-500);
    font-size: 12px;
}

/* Banner */
.lg-banner {
    background: var(--lg-black);
    color: var(--lg-yellow);
    padding: 32px;
    border-radius: 4px;
    margin-bottom: 24px;
    border-left: 6px solid var(--lg-yellow);
}

.lg-banner__title {
    margin: 0 0 8px;
    color: var(--lg-yellow);
}

.lg-banner__text {
    margin: 0;
    color: #fff;
    opacity: 0.85;
}

/* Cards */
.lg-card {
    background: #fff;
    border: 1px solid var(--lg-grey-200);
    border-radius: 4px;
    padding: 24px;
    margin-bottom: 16px;
}

.lg-muted {
    color: var(--lg-grey-500);
    font-size: 14px;
}

/* Buttons */
.lg-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.lg-btn {
    display: inline-block;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 4px;
    text-decoration: none;
    border: 2px solid transparent;
    cursor: pointer;
    transition: opacity 0.15s;
}

.lg-btn:hover {
    opacity: 0.85;
}

.lg-btn--primary {
    background: var(--lg-yellow);
    color: var(--lg-black);
    border-color: var(--lg-yellow);
}

.lg-btn--secondary {
    background: transparent;
    color: var(--lg-black);
    border-color: var(--lg-black);
}

/* Forms */
.lg-checkbox {
    margin: 12px 0;
    padding: 12px;
    background: var(--lg-grey-50);
    border-radius: 4px;
    border: 1px solid var(--lg-grey-200);
}

.lg-checkbox label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 14px;
}

.lg-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--lg-yellow);
    cursor: pointer;
}

/* Alerts */
.lg-alert {
    padding: 12px 16px;
    border-radius: 4px;
    margin: 16px 0;
    font-size: 14px;
}

.lg-alert--warning {
    background: #FFF8E1;
    border-left: 4px solid var(--lg-orange);
    color: #7A4F00;
}

.lg-alert--error {
    background: #FCE8E6;
    border-left: 4px solid var(--lg-red);
    color: #8A1F17;
}

/* Progress bar */
.lg-progress {
    background: var(--lg-grey-200);
    height: 24px;
    border-radius: 4px;
    overflow: hidden;
    margin: 16px 0 8px;
}

.lg-progress__bar {
    background: var(--lg-yellow);
    height: 100%;
    transition: width 0.3s ease;
    min-width: 2%;
}

.lg-progress__label {
    font-size: 14px;
    color: var(--lg-black);
    margin: 0 0 20px;
}

/* Log panel */
.lg-log {
    background: var(--lg-black);
    color: #E0E0E0;
    padding: 12px;
    border-radius: 4px;
    font-family: "Consolas", "Monaco", monospace;
    font-size: 12px;
    max-height: 300px;
    overflow-y: auto;
    line-height: 1.5;
}

.lg-log__line {
    white-space: pre-wrap;
    word-break: break-word;
}

/* Tables */
.lg-table {
    width: 100%;
    border-collapse: collapse;
    margin: 16px 0;
}

.lg-table th,
.lg-table td {
    padding: 8px 12px;
    text-align: left;
    border-bottom: 1px solid var(--lg-grey-200);
    font-size: 14px;
}

.lg-table th {
    color: var(--lg-grey-500);
    font-weight: 600;
    width: 40%;
}

/* Details */
.lg-details {
    margin-top: 24px;
    padding: 12px;
    background: var(--lg-grey-50);
    border-radius: 4px;
}

.lg-details summary {
    cursor: pointer;
    font-weight: 600;
    padding: 4px 0;
}

.lg-details[open] summary {
    margin-bottom: 12px;
}

/* ===== Review page ===== */

.lg-review-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--lg-yellow);
}

.lg-review-header__counter {
    font-size: 14px;
    font-weight: 600;
    color: var(--lg-grey-500);
}

.lg-review-header__nav {
    display: flex;
    gap: 8px;
}

.lg-card--danger {
    border-left: 6px solid var(--lg-red);
    background: #FFF5F5;
}

.lg-dryrun-toggle {
    margin-top: 16px;
    padding: 10px;
    background: var(--lg-grey-50);
    border-radius: 4px;
    font-size: 14px;
}

.lg-dryrun-toggle label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.lg-dryrun-toggle input[type="checkbox"] {
    accent-color: var(--lg-yellow);
    cursor: pointer;
}

/* Candidates list */
.lg-candidates {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.lg-candidate {
    display: grid;
    grid-template-columns: 130px 1fr auto;
    gap: 16px;
    align-items: center;
    padding: 12px;
    background: var(--lg-grey-50);
    border: 1px solid var(--lg-grey-200);
    border-radius: 4px;
}

.lg-candidate__info strong {
    font-size: 15px;
}

.lg-candidate__evidence {
    font-size: 12px;
    color: var(--lg-grey-500);
    margin-top: 4px;
    font-style: italic;
}

/* Badges */
.lg-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #fff;
    background: var(--lg-grey-500);
    text-align: center;
}

.lg-badge--strong {
    background: var(--lg-green);
}

.lg-badge--medium {
    background: var(--lg-orange);
    color: var(--lg-black);
}

.lg-badge--weak {
    background: #EA580C;
}

/* Manual search */
.lg-manual-search {
    display: grid;
    grid-template-columns: 1fr 2fr auto;
    gap: 12px;
    align-items: center;
    margin-top: 8px;
}

.lg-input {
    padding: 10px 12px;
    border: 1px solid var(--lg-grey-200);
    border-radius: 4px;
    font-size: 14px;
    background: #fff;
    color: var(--lg-black);
    font-family: inherit;
}

.lg-input:focus {
    outline: 2px solid var(--lg-yellow);
    outline-offset: -2px;
    border-color: var(--lg-yellow);
}

/* Disabled buttons */
.lg-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Toast */
.lg-toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    padding: 14px 24px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    max-width: 80%;
    text-align: center;
    animation: lg-toast-in 0.2s ease-out;
}

.lg-toast--success {
    background: var(--lg-green);
    color: #fff;
}

.lg-toast--error {
    background: var(--lg-red);
    color: #fff;
}

@keyframes lg-toast-in {
    from { opacity: 0; transform: translate(-50%, 10px); }
    to { opacity: 1; transform: translate(-50%, 0); }
}

/* ===== Candidate current-role badges ===== */

.lg-candidate__role {
    margin-top: 6px;
}

.lg-badge--role-same {
    background: #E6F4EA;
    color: var(--lg-green);
    border: 1px solid var(--lg-green);
    font-weight: 600;
}

.lg-badge--role-opposite {
    background: #FCE8E6;
    color: var(--lg-red);
    border: 1px solid var(--lg-red);
    font-weight: 600;
}

/* ===== Actions row split (left group + right group) ===== */

.lg-actions-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    width: 100%;
}

.lg-actions-row__left,
.lg-actions-row__right {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.lg-actions-row__right {
    margin-left: auto;
}

/* ===== Danger button + actions row split ===== */

.lg-btn.lg-btn--danger {
    background: #D93025;
    color: #ffffff;
    border-color: #D93025;
}

.lg-btn.lg-btn--danger:hover {
    background: #B5251A;
    border-color: #B5251A;
}

.lg-btn.lg-btn--danger:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Actions row: left group + right group on the same line */
.lg-actions-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    width: 100%;
}

.lg-actions-row__left,
.lg-actions-row__right {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.lg-actions-row__right {
    margin-left: auto;
}

/* ===== Modal dialog ===== */

.lg-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 900;
}

.lg-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 540px;
    background: #fff;
    border-radius: 6px;
    border-top: 6px solid #D93025;
    padding: 28px;
    z-index: 901;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.3);
}

.lg-modal h2 {
    margin-top: 0;
    color: #D93025;
}

.lg-modal__list {
    margin: 8px 0 16px;
    padding-left: 24px;
}

.lg-modal__list li {
    margin: 4px 0;
}

.lg-input--full {
    width: 100%;
    margin: 8px 0 16px;
    font-family: "Consolas", "Monaco", monospace;
    font-weight: 600;
    letter-spacing: 1px;
}

.lg-code {
    background: var(--lg-grey-200);
    padding: 2px 8px;
    border-radius: 3px;
    font-family: "Consolas", "Monaco", monospace;
    font-weight: 700;
    color: var(--lg-black);
}

/* ===== Sortable table headers ===== */

.lg-th--sortable {
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
}

.lg-th--sortable:hover {
    color: var(--lg-black);
    background: var(--lg-grey-50);
}

/* ===== Stats page ===== */

/* Toolbar: period buttons on the left, export button on the right */
.lg-stats-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.lg-period-selector {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* ===== Links page ===== */

.lg-search-bar {
    margin: 12px 0 16px;
}

.lg-search-bar .lg-input {
    width: 100%;
    max-width: 480px;
}

/* Full-width table variant */
.lg-table--full th,
.lg-table--full td {
    width: auto;
}

.lg-table__actions {
    width: 220px;
    text-align: right;
    white-space: nowrap;
}

.lg-table__actions .lg-btn {
    margin-left: 6px;
}

/* Small button variant */
.lg-btn--small {
    padding: 6px 12px;
    font-size: 12px;
}

/* Success line for "no orphans / no expired" empty states. */
.lg-success-text {
    color: var(--lg-green);
    font-weight: 600;
    margin: 8px 0;
}

/* ===== "No Discord expected" inline form on the Review page ===== */

.lg-no-discord-form {
    margin-top: 16px;
    padding: 16px;
    background: var(--lg-grey-50);
    border: 1px dashed var(--lg-grey-200);
    border-radius: 4px;
}

.lg-no-discord-form .lg-input {
    margin: 8px 0 12px;
}

/* ===== Clickable scan counters and inline drill-down panels ===== */

.lg-link-counter {
    color: var(--lg-black);
    text-decoration: underline;
    text-decoration-color: var(--lg-yellow);
    text-decoration-thickness: 2px;
    text-underline-offset: 3px;
    cursor: pointer;
    font-weight: 600;
}

.lg-link-counter:hover {
    text-decoration-color: var(--lg-black);
}

.lg-details-panel {
    margin-top: 12px;
    padding: 12px;
    background: var(--lg-grey-50);
    border: 1px solid var(--lg-grey-200);
    border-radius: 4px;
}

.lg-table--compact th,
.lg-table--compact td {
    padding: 4px 8px;
    font-size: 13px;
}

/* ===== Boutique page ===== */

/* Larger, easier-to-tap checkbox for day-of-event use. */
.lg-boutique-check {
    width: 22px;
    height: 22px;
    cursor: pointer;
    accent-color: var(--lg-green);
}

/* Received rows get a subtle green tint so it's easy to see progress at a glance. */
.lg-boutique-row--received td {
    background: #F0FDF4;
    color: #6B7280;
    text-decoration: line-through;
    text-decoration-color: #9CA3AF;
}

/* Inline "add a manual delivery" form (name + first name + actions). */
.lg-manual-add {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
    margin: 8px 0;
    padding: 10px;
    background: #fff;
    border: 1px dashed var(--lg-grey-200);
    border-radius: 4px;
}

.lg-manual-add .lg-input {
    width: 180px;
}

/* Inline max-stock number input in the products table. */
.lg-stock-input {
    width: 64px;
    text-align: center;
    padding: 4px 6px;
}

.lg-stock-left {
    color: var(--lg-green);
    font-weight: 600;
    font-size: .85rem;
}

/* Out of stock (remaining <= 0) shown in red. */
.lg-stock-out {
    color: var(--lg-red);
    font-weight: 700;
    font-size: .85rem;
}

/* ===== Événements page — duplicate row highlight ===== */

/* Amber background on registrant rows that appear in multiple pass-type groups. */
.lg-table__row--warning td {
    background: #FFFBEB;
}

/* ===== Adhesions page ===== */

/* Toolbar: state-filter buttons on the left, search input on the right. */
.lg-adhesions-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

/* Search input, fixed width that shrinks on narrow screens. */
.lg-adhesions-search {
    width: 280px;
    min-width: 160px;
    flex-shrink: 1;
}

/* Small count badge inside state-filter buttons (e.g. "Actives 12"). */
.lg-btn__count {
    display: inline-block;
    margin-left: 6px;
    padding: 1px 6px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 700;
    background: rgba(255, 255, 255, 0.25);
    vertical-align: middle;
    line-height: 1.4;
}

/* Stock boutique : version texte du max (mobile) cachée par défaut (desktop = champ éditable). */
.lg-stock-max-text { display: none; }
.lg-stock-sep { color: var(--lg-grey-500); margin: 0 2px; }

/* Quantité « non payé » dans la colonne Commandes : en rouge, avec tooltip au survol/touch. */
.lg-unpaid {
    color: var(--lg-red);
    font-weight: 700;
    cursor: help;
}

/* Cartes pliables (Adhésions) : la ligne de résumé n'existe que sur mobile. */
.lg-card-summary { display: none; }
.lg-card-summary__sub {
    margin-left: auto;
    color: var(--lg-grey-500);
    font-size: 13px;
    white-space: nowrap;
}
.lg-card-summary__chevron {
    color: var(--lg-grey-500);
    flex-shrink: 0;
    transition: transform 0.25s ease;
}
tr.is-expanded .lg-card-summary__chevron { transform: rotate(180deg); }

/* La marge haut/bas du tableau est portée par le conteneur. */
.lg-table-scroll > .lg-table {
    margin: 16px 0;
}

/* ════════════════════════════════════════════════════════════════════════
   RESPONSIVE — écrans tablette & mobile
   ════════════════════════════════════════════════════════════════════════ */

/* ── Tablette & téléphone (≤ 768px) ── */
@media (max-width: 768px) {

    /* Espacements resserrés. */
    .lg-main   { padding: 16px 12px; }
    .lg-banner { padding: 20px 16px; margin-bottom: 16px; }
    .lg-card   { padding: 16px 12px; }
    .lg-banner__title { font-size: 1.4rem; }

    /* En-tête : marque + utilisateur passent à la ligne. */
    .lg-header {
        flex-wrap: wrap;
        gap: 8px;
        padding: 12px 16px;
    }
    .lg-header__subtitle { display: none; }   /* gagner de la place */

    /* ── Menu hamburger : nav repliable verticale ── */
    .lg-burger { display: flex; }
    .lg-header__username { display: none; }   /* place pour le hamburger */

    .lg-nav {
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        padding: 0;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease;
    }
    /* Ouvert quand la case (pilotée par le hamburger) est cochée. */
    .lg-nav-toggle:checked ~ .lg-nav {
        max-height: 80vh;
        overflow-y: auto;
    }

    .lg-nav__link,
    .lg-nav__dropdown-toggle {
        padding: 14px 16px;
        font-size: 15px;
        border-bottom: 1px solid rgba(255, 255, 255, 0.08);
        border-left: 3px solid transparent;
    }
    .lg-nav__link.active {
        border-bottom-color: rgba(255, 255, 255, 0.08);
        border-left-color: var(--lg-yellow);
    }

    /* Sous-menu « Gestion adhérents » en mode inline (pas en absolu). */
    .lg-nav__dropdown { display: block; }
    .lg-nav__dropdown-menu {
        position: static;
        min-width: 0;
        border: none;
        box-shadow: none;
        background: rgba(255, 255, 255, 0.04);
    }
    .lg-nav__dropdown-item { padding: 12px 16px 12px 28px; }

    /* Pas de débordement horizontal de la page. */
    .lg-app { overflow-x: hidden; }

    /* Tableaux de données → CARTES EMPILÉES (une carte par ligne, format « Libellé : valeur »).
       Pas de défilement horizontal : chaque cellule passe sur sa propre ligne. */
    .lg-table--responsive thead { display: none; }
    .lg-table--responsive tbody,
    .lg-table--responsive tr,
    .lg-table--responsive td { display: block; width: 100%; box-sizing: border-box; }

    .lg-table--responsive tr {
        border: 1px solid var(--lg-grey-200);
        border-radius: 6px;
        padding: 4px 12px;
        margin-bottom: 10px;
        background: #fff;
    }

    .lg-table--responsive td {
        display: block;
        position: relative;
        text-align: right;
        white-space: normal;
        border-bottom: 1px solid var(--lg-grey-50);
        padding: 9px 0 9px 42%;
        min-height: 1.1em;
    }
    .lg-table--responsive tr td:last-child { border-bottom: none; }

    /* Le libellé de colonne, positionné en absolu à gauche (la valeur reste groupée à droite). */
    .lg-table--responsive td::before {
        content: attr(data-label);
        position: absolute;
        left: 0;
        top: 9px;
        width: 38%;
        font-weight: 600;
        color: var(--lg-grey-500);
        text-align: left;
        white-space: nowrap;
    }
    /* Cellules sans libellé (actions, boutons) : pleine largeur. */
    .lg-table--responsive td:not([data-label]) { padding-left: 0; text-align: left; }
    /* Cellules sans libellé (actions, contenu pleine largeur) : pas de préfixe. */
    .lg-table--responsive td:not([data-label])::before,
    .lg-table--responsive td[data-label=""]::before { content: none; }
    .lg-table--responsive td[data-label=""] { justify-content: flex-end; }

    /* Cellule fusionnée (ligne dépliée boutique) : bloc pleine largeur, pas de flex. */
    .lg-table--responsive td[colspan] {
        display: block;
        text-align: left;
        background: var(--lg-grey-50);
    }
    .lg-table--responsive td[colspan]::before { content: none; }

    /* Boutique : sur mobile, stock en lecture seule (champ caché, valeur en texte). */
    .lg-stock-input { display: none; }
    .lg-stock-max-text { display: inline; }

    /* ── Cartes Adhésions pliables (uniquement .lg-table--collapsible) ── */
    /* Ligne de résumé cliquable (Nom Prénom — Adhésion + chevron). */
    .lg-table--collapsible td.lg-card-summary {
        display: flex;
        align-items: center;
        gap: 8px;
        justify-content: flex-start;
        cursor: pointer;
        font-size: 15px;
    }
    /* Cellules portées par le résumé : masquées (évite la redite). */
    .lg-table--collapsible td.lg-hide-mobile { display: none; }

    /* Cellules de détail : repliables avec animation. */
    .lg-table--collapsible td[data-label]:not(.lg-hide-mobile) {
        transition: max-height 0.3s ease, opacity 0.25s ease, padding 0.3s ease;
        max-height: 90px;
        opacity: 1;
        overflow: hidden;
    }
    .lg-table--collapsible tr:not(.is-expanded) td[data-label]:not(.lg-hide-mobile) {
        max-height: 0;
        min-height: 0;
        opacity: 0;
        padding-top: 0;
        padding-bottom: 0;
        border-bottom: none;
    }

    /* Graphique (Chart.js) : ne déborde pas. */
    .lg-card canvas { max-width: 100%; }

    /* Barres d'outils (filtres + recherche) : empilées, pleine largeur. */
    .lg-adhesions-toolbar,
    .lg-stats-toolbar {
        flex-direction: column;
        align-items: stretch;
    }
    .lg-adhesions-search { width: 100%; }

    /* Filtres Adhésions : grille 2×2, boutons de même taille. */
    .lg-adhesions-toolbar .lg-period-selector {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }
    .lg-adhesions-toolbar .lg-period-selector .lg-btn {
        width: 100%;
        text-align: center;
    }

    /* Boutons d'actions de l'accueil : empilés et alignés (plus de décalage à droite). */
    .lg-actions-row,
    .lg-actions-row__left,
    .lg-actions-row__right {
        flex-direction: column;
        align-items: stretch;
    }
    .lg-actions-row__right { margin-left: 0; }
    .lg-actions-row .lg-btn { width: 100%; }

    /* Grilles → une seule colonne. */
    .lg-manual-search,
    .lg-candidate { grid-template-columns: 1fr; }
    .lg-manual-add { flex-direction: column; align-items: stretch; }
    .lg-manual-add .lg-input { width: 100%; }

    /* En-tête de revue : compteur + navigation empilés. */
    .lg-review-header { flex-direction: column; align-items: flex-start; gap: 8px; }

    /* Modale : quasi pleine largeur. */
    .lg-modal { width: 94%; }

    /* Page de connexion. */
    .lg-login { padding: 16px; }
    .lg-login__card { padding: 24px 20px; }
}

/* ── Petits téléphones (≤ 480px) ── */
@media (max-width: 480px) {
    .lg-header__title  { font-size: 17px; letter-spacing: 1px; }
    .lg-nav__link,
    .lg-nav__dropdown-toggle { font-size: 12px; }
    .lg-banner__title  { font-size: 1.25rem; }

    /* Cibles tactiles un peu plus grandes. */
    .lg-btn        { padding: 10px 14px; }
    .lg-btn--small { padding: 6px 10px; }
}