/* BudoKai UX 1.4.0 - L1-A : navigation isolee */

.ux-profile-menu > summary,
.ux-more > summary {
    list-style: none;
    cursor: pointer;
}

.ux-profile-menu > summary::-webkit-details-marker,
.ux-more > summary::-webkit-details-marker {
    display: none;
}

.ux-profile-menu:not([open]) .profile-dropdown {
    display: none !important;
}

.ux-profile-menu[open] .profile-dropdown {
    display: grid;
    min-width: 220px;
    max-height: min(70vh, 480px);
    overflow-y: auto;
}

.ux-profile-menu .ux-logout-form {
    margin: 0;
    padding: 0.3rem;
    border-top: 1px solid var(--border);
}

.ux-profile-menu .ux-logout-button {
    display: block;
    width: 100%;
    padding: 0.65rem 0.75rem;
    text-align: left;
    background: transparent;
    color: var(--text);
    font: inherit;
    font-weight: 700;
}

.ux-profile-menu .ux-logout-button:hover {
    background: #f0ede7;
}

.ux-profile-menu > summary:focus-visible,
.ux-more > summary:focus-visible,
.ux-nav-desktop a:focus-visible,
.ux-nav-mobile a:focus-visible,
.ux-more-panel a:focus-visible {
    outline: 3px solid #327ab0;
    outline-offset: 3px;
}

.ux-more {
    position: relative;
    min-width: 0;
}

.ux-more-symbol {
    display: inline-block;
    font-size: 1.3rem;
    line-height: 1;
    letter-spacing: 0.05em;
    font-weight: 800;
}

.ux-more-panel {
    position: absolute;
    display: grid;
    gap: 0.15rem;
    min-width: 215px;
    padding: 0.45rem;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 12px 28px rgba(0,0,0,0.18);
    z-index: 1300;
}

.ux-more:not([open]) .ux-more-panel {
    display: none;
}

.ux-more-panel a {
    display: block;
    padding: 0.7rem;
    border-radius: 9px;
    color: var(--text);
    text-decoration: none;
    font-weight: 600;
}

.ux-more-panel a:hover {
    background: #f0ede7;
}

.ux-more-desktop > summary {
    width: 52px;
    height: 52px;
    display: grid;
    place-items: center;
    border-radius: 17px;
    color: white;
}

.ux-more-desktop > summary:hover {
    background: rgba(255,255,255,0.12);
}

.ux-more-desktop .ux-more-panel {
    left: calc(100% + 0.8rem);
    bottom: 0;
}

@media (max-width: 760px) {
    .mobile-bottom-nav.ux-nav-mobile {
        grid-template-columns: repeat(5, minmax(0, 1fr));
        align-items: stretch;
        padding-bottom: max(0.4rem, env(safe-area-inset-bottom));
    }

    .ux-nav-mobile > a,
    .ux-nav-mobile > .ux-more {
        min-width: 0;
    }

    .ux-nav-mobile small {
        max-width: 100%;
        overflow-wrap: anywhere;
        text-align: center;
    }

    .ux-more-mobile > summary {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 0.1rem;
        min-height: 52px;
        padding: 0.2rem;
        color: var(--text);
    }

    .ux-more-mobile > summary small {
        font-size: 0.62rem;
        font-weight: 700;
        line-height: 1;
    }

    .ux-more-mobile .ux-more-panel {
        right: 0;
        bottom: calc(100% + 0.9rem);
        width: min(290px, calc(100vw - 2rem));
        max-height: 60vh;
        overflow-y: auto;
    }

    .ux-nav-mobile .nav-unread-badge.mobile {
        right: 0.25rem;
    }

    body {
        padding-bottom: calc(96px + env(safe-area-inset-bottom));
    }
}

@media (prefers-reduced-motion: reduce) {
    .ux-more-panel,
    .ux-profile-menu .profile-dropdown {
        transition: none;
    }
}

/* L1-A-04 : mobile administration */
@media (max-width: 760px) {
    .mobile-bottom-nav.ux-nav-mobile {
        grid-template-columns:
            repeat(4, minmax(0, 1fr))
            minmax(90px, 1.5fr);
    }

    .mobile-bottom-nav.ux-nav-mobile
    > a[aria-label="Administration"] small {
        font-size: 0.58rem;
        letter-spacing: -0.025em;
        overflow-wrap: normal;
        white-space: nowrap;
    }
}

/* L2-A-01 : accueil personnel */
.ux-dashboard-personal-header .dashboard-club-header {
    align-items: center;
}

.ux-dashboard-personal-header .dashboard-club-header h1 {
    margin-bottom: 0.35rem;
}

.ux-dashboard-next {
    border-color: var(--border);
}

.ux-dashboard-tools h2 {
    margin-bottom: 1rem;
}

.ux-dashboard-shortcuts {
    display: flex;
    flex-wrap: wrap;
    gap: 0.7rem;
}

.ux-dashboard-shortcuts > a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 0.6rem 0.95rem;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #f8f6f2;
    color: var(--text);
    text-decoration: none;
    font-size: 0.94rem;
    font-weight: 700;
}

.ux-dashboard-shortcuts > a:hover {
    background: #eee9e1;
}

.ux-dashboard-shortcuts > a:focus-visible {
    outline: 3px solid #327ab0;
    outline-offset: 3px;
}

@media (max-width: 620px) {
    .ux-dashboard-shortcuts {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .ux-dashboard-shortcuts > a {
        text-align: center;
        overflow-wrap: anywhere;
    }
}

/* L2-B-01 : dashboard administration */

.ux-admin-home {
    max-width: 1180px;
    margin-inline: auto;
}

.ux-admin-heading {
    align-items: center;
}

.ux-admin-kpis {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.85rem;
    margin: 1.4rem 0;
}

.ux-admin-kpi {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    padding: 1.05rem;
    border: 1px solid var(--border, #d9dfe2);
    border-radius: 14px;
    background: #f8f7f4;
    color: var(--text, #26323a);
    text-decoration: none;
}

.ux-admin-kpi span {
    font-size: 0.84rem;
    font-weight: 600;
}

.ux-admin-kpi strong {
    font-size: 1.85rem;
    line-height: 1.1;
}

.ux-admin-attention {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.2rem;
    margin-bottom: 1.4rem;
    border: 1px solid #d5aa65;
    border-left: 4px solid #b87b2d;
    border-radius: 12px;
    background: #fff9ed;
}

.ux-admin-attention h2 {
    margin: 0 0 0.3rem;
}

.ux-admin-attention p {
    margin: 0;
}

.ux-admin-section-title {
    margin: 1.5rem 0 0.3rem;
}

.ux-admin-hint {
    margin-bottom: 1rem;
}

.ux-admin-hubs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
    align-items: start;
}

.ux-admin-hub {
    min-width: 0;
    border: 1px solid var(--border, #d9dfe2);
    border-radius: 14px;
    background: #fff;
    overflow: hidden;
}

.ux-admin-hub > summary {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    padding: 1.2rem;
    cursor: pointer;
    list-style: none;
}

.ux-admin-hub > summary::-webkit-details-marker {
    display: none;
}

.ux-admin-hub > summary::after {
    content: "+";
    margin-left: auto;
    font-size: 1.5rem;
    font-weight: 400;
}

.ux-admin-hub[open] > summary::after {
    content: "\2212";
}

.ux-admin-hub > summary img {
    flex: 0 0 44px;
    width: 44px;
    height: 44px;
    object-fit: contain;
}

.ux-admin-hub-heading {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    min-width: 0;
}

.ux-admin-hub-heading strong {
    font-size: 1.04rem;
}

.ux-admin-hub-heading small {
    color: #617078;
    font-size: 0.83rem;
}

.ux-admin-hub[open] > summary {
    border-bottom: 1px solid var(--border, #d9dfe2);
    background: #f8f7f4;
}

.ux-admin-hub-content {
    padding: 1rem;
}

.ux-admin-links {
    display: grid;
    gap: 0.55rem;
}

.ux-admin-links > a {
    display: block;
    padding: 0.7rem 0.85rem;
    border-radius: 9px;
    background: #f6f7f7;
    color: var(--text, #26323a);
    text-decoration: none;
    font-size: 0.92rem;
    font-weight: 600;
}

.ux-admin-links > a:hover,
.ux-admin-kpi:hover {
    background: #ebeef0;
}

.ux-admin-links > a:focus-visible,
.ux-admin-kpi:focus-visible,
.ux-admin-hub > summary:focus-visible {
    outline: 3px solid #327ab0;
    outline-offset: 2px;
}

.ux-admin-links > .ux-admin-technical-link {
    color: #954829;
}

.ux-admin-secondary {
    margin-top: 1rem;
    padding: 0.7rem;
    border: 1px solid var(--border, #d9dfe2);
    border-radius: 9px;
}

.ux-admin-secondary > summary {
    cursor: pointer;
    font-weight: 600;
}

.ux-admin-mini-list {
    display: grid;
    gap: 0.6rem;
    margin-top: 0.8rem;
}

.ux-admin-mini-list article {
    display: flex;
    gap: 1rem;
    justify-content: space-between;
    padding: 0.7rem;
    border-bottom: 1px solid #e3e5e7;
}

.ux-admin-mini-list p {
    margin: 0.3rem 0 0;
}

.ux-admin-last-request {
    margin-top: 1rem;
}

@media (max-width: 850px) {
    .ux-admin-kpis {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .ux-admin-hubs {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .ux-admin-kpi {
        padding: 0.8rem;
    }

    .ux-admin-kpi strong {
        font-size: 1.55rem;
    }

    .ux-admin-attention,
    .ux-admin-mini-list article {
        flex-direction: column;
        align-items: stretch;
    }

    .ux-admin-hub > summary {
        padding: 0.95rem;
        gap: 0.6rem;
    }

    .ux-admin-hub > summary img {
        width: 36px;
        height: 36px;
        flex-basis: 36px;
    }
}

/* L2-B-03 : retour accueil */

.ux-admin-heading {
    display: flex;
    flex-wrap: wrap;
    gap: 0.85rem;
}

.ux-admin-heading > div {
    flex: 1 1 220px;
    min-width: 0;
}

.ux-admin-back {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    margin-left: auto;
    text-decoration: none;
}

.ux-admin-back:focus-visible {
    outline: 3px solid #327ab0;
    outline-offset: 3px;
}

@media (max-width: 620px) {
    .ux-admin-back {
        box-sizing: border-box;
        width: 100%;
        margin-left: 0;
    }
}

/* L2-N-02 : retour contextuel */

.ux-context-back-wrap {
    display: flex;
    align-items: center;
    margin: 0 0 0.85rem;
}

.ux-context-back {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    min-height: 40px;
    text-decoration: none;
}

.ux-context-back:focus-visible {
    outline: 3px solid #327ab0;
    outline-offset: 3px;
}

@media (max-width: 480px) {
    .ux-context-back {
        min-width: 112px;
    }
}

/* Tablette : entetes de gestion des cours et recurrences.
   Les actions longues passent sous le titre sans forcer la largeur du viewport.
   Limite aux deux pages auditees : aucun changement du reste de BudoKai. */
@media (min-width: 761px) and (max-width: 900px) {
    .course-responsive-admin-page > .page-header {
        display: grid !important;
        grid-template-columns: 72px minmax(0, 1fr) !important;
        align-items: center !important;
        gap: 0.85rem 1rem !important;
        min-width: 0;
    }

    .course-responsive-admin-page > .page-header > :nth-child(2) {
        min-width: 0 !important;
        grid-column: 2 !important;
    }

    .course-responsive-admin-page > .page-header > .management-actions {
        grid-column: 1 / -1 !important;
        justify-self: stretch !important;
        align-self: stretch !important;
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: wrap !important;
        align-items: stretch !important;
        justify-content: flex-start !important;
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        box-sizing: border-box;
    }

    .course-responsive-admin-page > .page-header > .management-actions > .action-button {
        flex: 1 1 220px !important;
        width: auto !important;
        min-width: 0 !important;
        max-width: 100% !important;
        box-sizing: border-box;
        white-space: normal;
        overflow-wrap: anywhere;
    }

    .course-responsive-admin-page > .page-header > .management-actions > .action-button > span {
        min-width: 0;
        overflow-wrap: anywhere;
    }
}
/* L2-Suivi : historiques sans menu Paramètres.
   La consultation occupe la largeur utile, sans changer les paramètres du dojo. */
.ux-monitoring-layout {
    grid-template-columns: minmax(0, 1fr);
    width: 100%;
    max-width: 1080px;
    margin-inline: auto;
}

.ux-monitoring-layout > .settings-main {
    min-width: 0;
    width: 100%;
    box-sizing: border-box;
}

.ux-monitoring-layout .ux-context-back-wrap {
    justify-content: flex-end;
}

.ux-monitoring-layout .technical-link,
.ux-monitoring-layout .activity-log-metadata {
    min-width: 0;
    overflow-wrap: anywhere;
}

@media (max-width: 620px) {
    .ux-monitoring-layout .ux-context-back-wrap {
        justify-content: flex-start;
    }

    .ux-monitoring-layout .ux-context-back {
        max-width: 100%;
        white-space: normal;
        text-align: center;
        overflow-wrap: anywhere;
    }
}

/* L3-A : fiche membre 1.5.0 — cinq rubriques natives accessibles. */
.ux-member-page {
    max-width: 1080px;
    margin-inline: auto;
    min-width: 0;
}
.ux-member-page-heading {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
}
.ux-member-page-heading > div:first-child {
    flex: 1 1 260px;
    min-width: 0;
}
.ux-member-identity {
    display: flex;
    align-items: center;
    gap: 1.2rem;
    margin-bottom: 1rem;
    min-width: 0;
}
.ux-member-identity-main {
    flex: 1 1 auto;
    min-width: 0;
}
.ux-member-identity-main h2 {
    overflow-wrap: anywhere;
}
.ux-member-section-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.7rem 1rem;
    flex-wrap: wrap;
    margin: 1rem 0;
}
.ux-member-section-toolbar > p {
    flex: 1 1 240px;
    margin: 0;
}
.ux-member-section-toolbar .action-button,
.ux-member-section-actions .action-button {
    min-height: 42px;
}
.ux-member-sections {
    display: grid;
    gap: 0.75rem;
    min-width: 0;
}
.ux-member-section {
    min-width: 0;
    border: 1px solid var(--border, #d9dfe2);
    border-radius: 14px;
    background: var(--card-bg, #fff);
    overflow: hidden;
}
.ux-member-section > summary {
    display: flex;
    gap: 0.7rem;
    align-items: center;
    padding: 1rem 1.15rem;
    cursor: pointer;
    font-size: 1.08rem;
    font-weight: 700;
    list-style: none;
}
.ux-member-section > summary::-webkit-details-marker {
    display: none;
}
.ux-member-section > summary::after {
    content: "+";
    font-size: 1.5rem;
    font-weight: 400;
    margin-left: auto;
}
.ux-member-section[open] > summary {
    border-bottom: 1px solid var(--border, #d9dfe2);
}
.ux-member-section[open] > summary::after {
    content: "\2212";
}
.ux-member-section > summary:focus-visible,
.ux-member-section-toolbar button:focus-visible {
    outline: 3px solid #327ab0;
    outline-offset: -3px;
}
.ux-member-section-content {
    padding: 1rem 1.2rem 1.3rem;
    min-width: 0;
    overflow-wrap: anywhere;
}
.ux-member-section-content h3 {
    margin: 1.1rem 0 0.6rem;
}
.ux-member-section-content h3:first-child {
    margin-top: 0;
}
.ux-member-section-content .member-detail-list {
    min-width: 0;
}
.ux-member-section-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.7rem;
    margin: 0.8rem 0;
}
.ux-member-section-actions .password-reset-admin-form {
    margin: 0;
}
.ux-member-relation {
    margin-bottom: 0.7rem;
    min-width: 0;
}
.ux-member-relation .member-detail-badges {
    margin: 0.6rem 0;
}
@media (max-width: 620px) {
    .ux-member-identity {
        flex-direction: column;
        align-items: flex-start;
    }
    .ux-member-section > summary {
        padding: 0.85rem 0.9rem;
        font-size: 1rem;
    }
    .ux-member-section-content {
        padding: 0.85rem 0.9rem 1rem;
    }
    .ux-member-section-toolbar .action-buttons {
        display: flex;
        flex-wrap: wrap;
        width: 100%;
    }
    .ux-member-section-toolbar button {
        flex: 1 1 125px;
    }
}

/* L3-B : creation et modification des membres, responsive et sans JS obligatoire. */
.ux-member-form-page {
    box-sizing: border-box;
    width: 100%;
}
.ux-member-form-page .ux-member-form-help {
    margin: 1rem 0 1.25rem;
    padding: 0;
    overflow: hidden;
    border: 1px solid var(--border, #d9dfe2);
    border-radius: 13px;
}
.ux-member-form-help > summary {
    cursor: pointer;
    list-style: none;
    font-weight: 700;
    padding: 0.95rem 1.1rem;
}
.ux-member-form-help > summary::-webkit-details-marker {
    display: none;
}
.ux-member-form-help > summary::after {
    content: "+";
    float: right;
    font-weight: 500;
}
.ux-member-form-help[open] > summary::after {
    content: "\2212";
}
.ux-member-help-content {
    border-top: 1px solid var(--border, #d9dfe2);
    padding: 0.9rem 1.1rem 1.15rem;
}
.ux-member-help-content h2 {
    margin-top: 0;
}
.ux-member-form-help > summary:focus-visible {
    outline: 3px solid #327ab0;
    outline-offset: -3px;
}
.ux-member-form-grid {
    width: 100%;
    min-width: 0;
    margin: 0;
}
.ux-member-form-grid > .form-group {
    min-width: 0;
    max-width: 100%;
}
.ux-member-form-grid input,
.ux-member-form-grid select,
.ux-member-form-grid textarea {
    max-width: 100%;
    box-sizing: border-box;
}
.ux-member-form-section .ux-member-section-content > .action-button {
    display: inline-flex;
    min-height: 42px;
    margin-top: 0.45rem;
    white-space: normal;
}
.ux-member-form-section .ux-member-section-content .ux-member-section-tip {
    margin-top: 0.8rem;
}
.ux-member-section-error {
    display: inline-flex;
    font-size: 0.83rem;
    font-weight: 700;
    color: #a02d29;
    margin-left: 0.5rem;
}
.ux-member-form-page .form-actions {
    position: relative;
    margin-top: 1.25rem;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.65rem;
}
@media (max-width: 620px) {
    .ux-member-form-page {
        padding-inline: min(3vw, 0.75rem);
    }
    .ux-member-form-page .ux-member-form-grid {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
    }
    .ux-member-form-page .form-actions > .action-button {
        flex: 1 1 130px;
        text-align: center;
        justify-content: center;
    }
}
