:root {
    --brand-primary: #044D7A;
    --brand-primary-dark: #033a5e;
    --brand-accent: #C78E30;
    --brand-accent-hover: #b07d28;
    --font-display: 'Saira Condensed', sans-serif;
    --font-body: 'Open Sans', sans-serif;
}

body {
    font-family: var(--font-body);
}

h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6,
.font-display {
    font-family: var(--font-display);
    letter-spacing: 0.02em;
}

.btn-primary {
    --bs-btn-bg: var(--brand-primary);
    --bs-btn-border-color: var(--brand-primary);
    --bs-btn-hover-bg: var(--brand-primary-dark);
    --bs-btn-hover-border-color: var(--brand-primary-dark);
    --bs-btn-active-bg: var(--brand-primary-dark);
    --bs-btn-active-border-color: var(--brand-primary-dark);
}

.btn-accent {
    --bs-btn-color: #fff;
    --bs-btn-bg: var(--brand-accent);
    --bs-btn-border-color: var(--brand-accent);
    --bs-btn-hover-bg: var(--brand-accent-hover);
    --bs-btn-hover-border-color: var(--brand-accent-hover);
    --bs-btn-active-bg: var(--brand-accent-hover);
    --bs-btn-active-border-color: var(--brand-accent-hover);
}

.text-brand-primary { color: var(--brand-primary) !important; }
.text-brand-accent { color: var(--brand-accent) !important; }
.bg-brand-primary { background-color: var(--brand-primary) !important; }
.bg-brand-accent { background-color: var(--brand-accent) !important; }

.brand-logo {
    display: block;
    height: auto;
    width: auto;
    object-fit: contain;
}

.brand-logo--navbar {
    max-height: 2.75rem;
}

.brand-logo--sidebar {
    max-height: 4.5rem;
    margin-bottom: 1rem;
}

.brand-wordmark {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
    color: inherit;
}

.brand-wordmark--navbar {
    color: #fff;
}

.brand-wordmark--sidebar,
.brand-wordmark--auth {
    color: var(--brand-primary);
}

.brand-wordmark__name {
    font-size: 1.65rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.brand-wordmark--navbar .brand-wordmark__name {
    font-size: 1.5rem;
}

.brand-wordmark__tagline {
    font-family: var(--font-body);
    font-size: 0.7rem;
    font-weight: 400;
    letter-spacing: 0.01em;
    opacity: 0.9;
    margin-top: 0.15rem;
    max-width: 14rem;
}

.brand-wordmark--navbar .brand-wordmark__tagline {
    color: rgba(255, 255, 255, 0.88);
}

.brand-wordmark--sidebar .brand-wordmark__tagline,
.brand-wordmark--auth .brand-wordmark__tagline {
    color: #64748b;
}

@media (min-width: 992px) {
    .sidebar .brand-logo-link {
        display: none;
    }
}

.app-navbar {
    background: var(--brand-primary);
    border-bottom: 3px solid var(--brand-accent);
    color: #fff;
}

.app-navbar .navbar-title {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 1.15rem;
    letter-spacing: 0.03em;
}

.app-navbar .navbar-subtitle {
    font-family: var(--font-body);
    font-size: 0.8rem;
    opacity: 0.85;
}

.app-navbar .btn-outline-light:hover {
    background: rgba(255, 255, 255, 0.12);
}

.app-navbar a:not(.btn) {
    color: rgba(255, 255, 255, 0.92);
}

.app-navbar a:not(.btn):hover {
    color: #fff;
}

.sidebar,
.app-sidebar-offcanvas.offcanvas {
    background: var(--brand-primary);
}

.sidebar a:hover,
.sidebar a.active,
.app-sidebar-offcanvas .app-sidebar-nav a:hover,
.app-sidebar-offcanvas .app-sidebar-nav a.active {
    background: rgba(199, 142, 48, 0.22);
    color: #fff;
}

.app-sidebar-nav-label {
    font-family: var(--font-body);
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: rgba(219, 228, 240, 0.55);
    padding: .9rem .75rem .25rem;
    margin-top: .15rem;
    user-select: none;
}

.app-sidebar-nav-label:first-child {
    margin-top: 0;
    padding-top: .15rem;
}

.app-sidebar-nav a.active {
    border-left: 3px solid var(--brand-accent);
    padding-left: calc(.75rem - 3px);
}

.dashboard-hero {
    background: linear-gradient(135deg, var(--brand-primary) 0%, var(--brand-primary-dark) 55%, var(--brand-accent) 100%);
}

.dashboard-section-label {
    font-family: var(--font-display);
}

.dashboard-kpi-value {
    font-family: var(--font-display);
}

/* Dashboard admin — tâches par catégorie */
.admin-todo-kpis {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr));
    gap: .65rem;
}

.admin-todo-kpi {
    display: flex;
    flex-direction: column;
    gap: .15rem;
    padding: .85rem 1rem;
    border-radius: .9rem;
    background: #fff;
    border: 1px solid rgba(15, 23, 42, .08);
    box-shadow: 0 .2rem .7rem rgba(15, 23, 42, .04);
    text-decoration: none;
    color: inherit;
    transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease;
}

.admin-todo-kpi:hover {
    transform: translateY(-1px);
    border-color: rgba(4, 77, 122, .28);
    color: inherit;
}

.admin-todo-kpi.is-active {
    border-color: rgba(4, 77, 122, .45);
    box-shadow: 0 0 0 .18rem rgba(4, 77, 122, .12);
}

.admin-todo-kpi__label {
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: #64748b;
}

.admin-todo-kpi__value {
    font-family: var(--font-display);
    font-size: 1.55rem;
    font-weight: 700;
    line-height: 1.1;
    color: var(--brand-primary);
}

.admin-todo-kpi__hint {
    font-size: .75rem;
    color: #64748b;
    line-height: 1.25;
}

.admin-todo-kpi--warning .admin-todo-kpi__value { color: #a87520; }
.admin-todo-kpi--danger .admin-todo-kpi__value { color: #b42318; }
.admin-todo-kpi--info .admin-todo-kpi__value { color: #0369a1; }
.admin-todo-kpi--primary .admin-todo-kpi__value { color: var(--brand-primary); }

.admin-todo-group__card {
    overflow: hidden;
    border-left: .35rem solid #cbd5e1 !important;
}

.admin-todo-group__card--warning { border-left-color: var(--brand-accent) !important; }
.admin-todo-group__card--danger { border-left-color: #dc3545 !important; }
.admin-todo-group__card--info { border-left-color: #0dcaf0 !important; }
.admin-todo-group__card--primary { border-left-color: var(--brand-primary) !important; }
.admin-todo-group__card--secondary { border-left-color: #94a3b8 !important; }

@media (max-width: 767.98px) {
    .content-card .card-body,
    .content-card .card-header {
        padding-left: 0.85rem;
        padding-right: 0.85rem;
    }
    .app-main-content dl.row dt {
        margin-top: 0.5rem;
    }
}

/* Onglet Contrat & convention (fiche apprenant) */
.contract-hero {
    border-radius: 0.85rem;
    overflow: hidden;
    background:
        linear-gradient(120deg, rgba(4, 77, 122, 0.96) 0%, rgba(3, 58, 94, 0.92) 58%, rgba(199, 142, 48, 0.88) 100%),
        radial-gradient(circle at 12% 20%, rgba(255, 255, 255, 0.12), transparent 42%);
    color: #fff;
    box-shadow: 0 10px 28px rgba(4, 77, 122, 0.18);
}

.contract-hero__inner {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 1.25rem;
    padding: 1.25rem 1.4rem;
}

.contract-hero__eyebrow {
    font-family: var(--font-display);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.72rem;
    opacity: 0.8;
}

.contract-hero__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1.25rem 1.75rem;
    align-items: flex-start;
}

.contract-hero__label {
    display: block;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    opacity: 0.75;
    margin-bottom: 0.15rem;
}

.contract-hero__meta strong {
    font-size: 0.92rem;
    font-weight: 600;
}

.contract-panel {
    background: #fff;
    border: 1px solid rgba(4, 77, 122, 0.12);
    border-radius: 0.85rem;
    padding: 1.15rem 1.2rem;
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.04);
    border-top: 3px solid var(--brand-primary);
}

.contract-panel--signed {
    border-top-color: #198754;
}

.contract-panel--pending {
    border-top-color: var(--brand-accent);
}

.contract-panel--missing {
    border-top-color: #94a3b8;
    background: linear-gradient(180deg, #f8fafc 0%, #fff 55%);
}

.contract-panel__head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.contract-panel__title {
    font-family: var(--font-display);
    font-size: 1.2rem;
    margin: 0;
    color: var(--brand-primary);
}

.contract-panel__sub {
    font-size: 0.82rem;
    color: #64748b;
}

.contract-status {
    display: inline-flex;
    align-items: center;
    padding: 0.28rem 0.65rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 600;
    white-space: nowrap;
}

.contract-status--signed {
    background: rgba(25, 135, 84, 0.12);
    color: #146c43;
}

.contract-status--pending {
    background: rgba(199, 142, 48, 0.16);
    color: #8a5f14;
}

.contract-status--ready,
.contract-status--missing {
    background: rgba(100, 116, 139, 0.12);
    color: #475569;
}

.contract-panel__doc {
    margin-bottom: 0.9rem;
    padding: 0.7rem 0.8rem;
    border-radius: 0.55rem;
    background: rgba(4, 77, 122, 0.04);
}

.contract-panel__empty {
    padding: 0.85rem 0.9rem;
    border-radius: 0.55rem;
    background: rgba(148, 163, 184, 0.12);
    color: #475569;
    font-size: 0.88rem;
}

.contract-parties {
    display: grid;
    gap: 0.45rem;
}

.contract-party {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    padding: 0.45rem 0.55rem;
    border-radius: 0.5rem;
    background: #f8fafc;
}

.contract-party__dot {
    width: 0.65rem;
    height: 0.65rem;
    border-radius: 50%;
    margin-top: 0.35rem;
    flex-shrink: 0;
    background: #cbd5e1;
}

.contract-party.is-done .contract-party__dot {
    background: #198754;
}

.contract-party.is-waiting .contract-party__dot {
    background: var(--brand-accent);
}

.contract-party__name {
    font-size: 0.86rem;
    font-weight: 600;
    color: #0f172a;
}

.contract-party__state {
    font-size: 0.78rem;
    text-decoration: none;
}

.contract-consent {
    height: 100%;
    padding: 0.85rem;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 0.65rem;
    background: #fcfdff;
}

@media (max-width: 767.98px) {
    .contract-hero__inner {
        padding: 1rem;
    }

    .contract-panel {
        padding: 1rem;
    }
}

/* Dashboard apprenant — cours en cours + identité / parcours */
.student-hero-live {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .75rem 1rem;
    padding: .85rem 1rem;
    border-radius: .85rem;
    background: rgba(255, 255, 255, .14);
    border: 1px solid rgba(255, 255, 255, .22);
    backdrop-filter: blur(4px);
}

.student-hero-live__badge {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    padding: .3rem .55rem;
    border-radius: .45rem;
    background: var(--brand-accent);
    color: #fff;
    flex-shrink: 0;
}

.student-hero-live__badge::before {
    content: '';
    width: .45rem;
    height: .45rem;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 0 0 .2rem rgba(255, 255, 255, .35);
    animation: student-live-pulse 1.6s ease-in-out infinite;
}

@keyframes student-live-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: .45; }
}

.student-hero-live__body {
    flex: 1 1 12rem;
}

.student-path-card {
    border-radius: 1rem;
    box-shadow: 0 .35rem 1.2rem rgba(15, 23, 42, .06);
    overflow: hidden;
    border-top: 3px solid var(--brand-primary);
    background:
        linear-gradient(180deg, rgba(4, 77, 122, .04) 0%, transparent 42%),
        #fff;
}

.student-path-kicker {
    font-family: var(--font-display);
    font-size: .68rem;
    font-weight: 600;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--brand-accent);
    margin-bottom: .2rem;
}

.student-path-avatar {
    width: 3rem;
    height: 3rem;
    border-radius: .85rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1rem;
    letter-spacing: .02em;
    color: #fff;
    background: linear-gradient(145deg, var(--brand-primary) 0%, var(--brand-primary-dark, #033a5e) 100%);
    box-shadow: 0 .35rem .9rem rgba(4, 77, 122, .25);
    flex-shrink: 0;
}

.student-path-meta {
    display: grid;
    gap: .65rem;
}

.student-path-meta > div {
    display: grid;
    gap: .1rem;
    padding-bottom: .55rem;
    border-bottom: 1px solid rgba(15, 23, 42, .06);
}

.student-path-meta > div:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.student-path-meta dt {
    font-size: .68rem;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: #64748b;
    margin: 0;
}

.student-path-meta dd {
    margin: 0;
    font-size: .92rem;
    font-weight: 550;
    color: #172033;
}

.student-path-stat {
    background: #f8fafc;
    border: 1px solid rgba(15, 23, 42, .06);
    border-radius: .75rem;
    padding: .7rem .8rem;
    display: flex;
    flex-direction: column;
    gap: .15rem;
    min-height: 100%;
}

.student-path-stat__label {
    font-size: .68rem;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: #64748b;
}

.student-path-stat__value {
    font-family: var(--font-display);
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--brand-primary);
    line-height: 1.15;
}

.student-path-progress {
    height: .4rem;
    background: #e8eef5;
    border-radius: 999px;
    overflow: hidden;
}

.student-path-progress .progress-bar {
    background: linear-gradient(90deg, var(--brand-primary), var(--brand-accent));
}

/* Liste présences formateur */
.attendance-day__title {
    font-family: var(--font-display);
    font-size: .78rem;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: #64748b;
    margin: 0 0 .75rem;
}

.attendance-day__list {
    display: grid;
    gap: .65rem;
}

.attendance-card {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .85rem 1rem;
    padding: .95rem 1.1rem;
    border-radius: 1rem;
    background: #fff;
    box-shadow: 0 .35rem 1.2rem rgba(15, 23, 42, .06);
    border: 1px solid rgba(15, 23, 42, .05);
}

.attendance-card__avatar {
    width: 2.6rem;
    height: 2.6rem;
    border-radius: .75rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: .85rem;
    color: #fff;
    background: linear-gradient(145deg, var(--brand-primary) 0%, #033a5e 100%);
    flex-shrink: 0;
}

.attendance-card__body {
    flex: 1 1 14rem;
}

.attendance-card__name {
    font-size: 1rem;
    font-weight: 650;
    color: #172033;
}

.attendance-card__meta {
    font-size: .875rem;
    color: #475569;
}

.attendance-card__actions {
    display: flex;
    flex-wrap: wrap;
    gap: .4rem;
    margin-left: auto;
}

@media (max-width: 575.98px) {
    .attendance-card__actions {
        width: 100%;
        margin-left: 0;
    }
}

/* Déclarations de présence — portail apprenant (ton plus jeune) */
.presence-hero {
    position: relative;
    overflow: hidden;
    border-radius: 1.15rem;
    padding: 1.05rem 1.15rem 1.15rem;
    background:
        radial-gradient(120% 140% at 100% 0%, rgba(199, 142, 48, .22) 0%, transparent 55%),
        linear-gradient(135deg, #055a8c 0%, #044d7a 48%, #0a3d63 100%);
    color: #fff;
    box-shadow: 0 .45rem 1.4rem rgba(4, 77, 122, .22);
}

.presence-hero::after {
    content: '';
    position: absolute;
    right: -1.5rem;
    bottom: -2rem;
    width: 8rem;
    height: 8rem;
    border-radius: 40% 60% 55% 45%;
    background: rgba(255, 255, 255, .08);
    transform: rotate(18deg);
    pointer-events: none;
}

.presence-hero__kicker {
    font-family: var(--font-display);
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
    opacity: .85;
    margin-bottom: .25rem;
}

.presence-hero__title {
    font-family: var(--font-display);
    font-size: 1.45rem;
    font-weight: 700;
    letter-spacing: .01em;
    margin: 0 0 .35rem;
    line-height: 1.15;
}

.presence-hero__text {
    font-size: .92rem;
    opacity: .92;
    max-width: 36rem;
}

.presence-filters {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
}

.presence-filter {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    padding: .48rem .85rem;
    border-radius: 999px;
    border: 1px solid transparent;
    background: #fff;
    color: #334155;
    text-decoration: none;
    font-size: .875rem;
    font-weight: 650;
    box-shadow: 0 .2rem .6rem rgba(15, 23, 42, .05);
    transition: transform .18s ease, box-shadow .18s ease, background .18s ease, color .18s ease;
}

.presence-filter:hover {
    transform: translateY(-1px);
    color: var(--brand-primary);
    box-shadow: 0 .35rem .9rem rgba(4, 77, 122, .12);
}

.presence-filter.is-active {
    background: var(--brand-primary);
    color: #fff;
    box-shadow: 0 .35rem 1rem rgba(4, 77, 122, .28);
}

.presence-filter--todo.is-active {
    background: linear-gradient(135deg, var(--brand-accent) 0%, #a87520 100%);
    box-shadow: 0 .35rem 1rem rgba(199, 142, 48, .35);
}

.presence-filter__count {
    display: inline-flex;
    min-width: 1.4rem;
    justify-content: center;
    padding: .08rem .4rem;
    border-radius: 999px;
    background: #f1f5f9;
    font-size: .74rem;
    font-weight: 700;
    color: #475569;
}

.presence-filter.is-active .presence-filter__count {
    background: rgba(255, 255, 255, .22);
    color: #fff;
}

.presence-search {
    border-radius: 1rem;
    overflow: hidden;
}

.presence-empty {
    display: flex;
    align-items: flex-start;
    gap: .85rem;
    padding: 1.1rem 1.2rem;
    border-radius: 1rem;
    background:
        linear-gradient(180deg, rgba(4, 77, 122, .05) 0%, transparent 70%),
        #fff;
    border: 1px dashed rgba(4, 77, 122, .22);
}

.presence-empty__mark {
    width: 2.4rem;
    height: 2.4rem;
    border-radius: .85rem;
    flex-shrink: 0;
    background:
        radial-gradient(circle at 30% 30%, rgba(255, 255, 255, .55), transparent 50%),
        linear-gradient(145deg, var(--brand-accent), #a87520);
    box-shadow: 0 .3rem .8rem rgba(199, 142, 48, .3);
}

.presence-empty__text {
    font-size: .95rem;
    color: #334155;
    padding-top: .35rem;
}

.presence-list {
    display: grid;
    gap: 1.35rem;
}

.presence-day__title {
    display: flex;
    align-items: center;
    gap: .45rem;
    font-family: var(--font-display);
    font-size: .95rem;
    font-weight: 700;
    letter-spacing: .02em;
    text-transform: none;
    color: #0f172a;
    margin: 0 0 .65rem;
    position: sticky;
    top: 0;
    z-index: 1;
    background: linear-gradient(180deg, #f6f8fb 72%, transparent);
    padding: .4rem 0;
}

.presence-day__dot {
    width: .55rem;
    height: .55rem;
    border-radius: 50%;
    background: var(--brand-accent);
    box-shadow: 0 0 0 .2rem rgba(199, 142, 48, .2);
}

.presence-day__rows {
    display: grid;
    gap: .65rem;
}

.presence-row {
    border-radius: 1.05rem;
    background: #fff;
    border: 1px solid rgba(15, 23, 42, .05);
    box-shadow: 0 .25rem .9rem rgba(15, 23, 42, .05);
    overflow: hidden;
    border-left: .35rem solid #cbd5e1;
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.presence-row--todo {
    border-left-color: var(--brand-accent);
}

.presence-row--present {
    border-left-color: #2f9e6b;
}

.presence-row--absent {
    border-left-color: #94a3b8;
}

.presence-row:hover {
    transform: translateY(-1px);
    box-shadow: 0 .45rem 1.15rem rgba(15, 23, 42, .08);
}

.presence-row.is-highlighted {
    border-color: rgba(4, 77, 122, .35);
    box-shadow: 0 0 0 .22rem rgba(4, 77, 122, .14);
}

.presence-row__main {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .55rem .85rem;
    padding: .85rem 1rem;
}

.presence-row__when {
    flex: 0 0 auto;
    display: grid;
    gap: .1rem;
    min-width: 3.4rem;
    text-align: center;
    padding: .35rem .4rem;
    border-radius: .75rem;
    background: linear-gradient(180deg, rgba(4, 77, 122, .08), rgba(4, 77, 122, .03));
}

.presence-row__time {
    display: block;
    font-family: var(--font-display);
    font-size: .95rem;
    font-weight: 700;
    color: var(--brand-primary);
    line-height: 1.1;
}

.presence-row__time-end {
    display: block;
    font-size: .68rem;
    font-weight: 600;
    color: #64748b;
}

.presence-row__body {
    flex: 1 1 12rem;
}

.presence-row__title {
    font-family: var(--font-display);
    font-size: 1.05rem;
    font-weight: 700;
    color: #172033;
    line-height: 1.2;
}

.presence-row__meta {
    font-size: .8rem;
    color: #64748b;
    margin-top: .2rem;
}

.presence-row__status {
    display: flex;
    flex-wrap: wrap;
    gap: .35rem;
}

.presence-chip {
    display: inline-flex;
    align-items: center;
    padding: .28rem .6rem;
    border-radius: 999px;
    font-size: .74rem;
    font-weight: 700;
    letter-spacing: .01em;
}

.presence-chip--todo {
    background: rgba(199, 142, 48, .16);
    color: #8a5f12;
}

.presence-chip--ok {
    background: rgba(47, 158, 107, .14);
    color: #1f7a52;
}

.presence-chip--no {
    background: rgba(100, 116, 139, .16);
    color: #475569;
}

.presence-chip--soft {
    background: #f1f5f9;
    color: #475569;
}

.presence-row__actions {
    display: flex;
    gap: .35rem;
    margin-left: auto;
}

.presence-row__details {
    border-top: 1px solid rgba(15, 23, 42, .06);
    background:
        linear-gradient(180deg, rgba(4, 77, 122, .03), transparent 40%),
        #f8fafc;
}

.presence-row__summary {
    cursor: pointer;
    list-style: none;
    padding: .65rem 1rem;
    font-family: var(--font-display);
    font-size: .95rem;
    font-weight: 700;
    letter-spacing: .02em;
    color: var(--brand-primary);
    user-select: none;
}

.presence-row__summary::-webkit-details-marker {
    display: none;
}

.presence-row__summary::before {
    content: '+';
    display: inline-grid;
    place-items: center;
    width: 1.25rem;
    height: 1.25rem;
    margin-right: .45rem;
    border-radius: .4rem;
    background: rgba(4, 77, 122, .1);
    font-size: .9rem;
    line-height: 1;
    transition: transform .18s ease, background .18s ease;
}

.presence-row__details[open] .presence-row__summary::before {
    content: '–';
    background: rgba(199, 142, 48, .18);
    color: #8a5f12;
}

.presence-row__form {
    padding: 0 1rem .95rem;
}

.presence-choice {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .55rem;
    margin-bottom: .35rem;
}

.presence-choice__option {
    margin: 0;
    cursor: pointer;
}

.presence-choice__option input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.presence-choice__card {
    display: grid;
    gap: .1rem;
    padding: .7rem .8rem;
    border-radius: .85rem;
    border: 1.5px solid rgba(15, 23, 42, .08);
    background: #fff;
    transition: border-color .15s ease, transform .15s ease, box-shadow .15s ease, background .15s ease;
}

.presence-choice__title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: .95rem;
    color: #172033;
}

.presence-choice__hint {
    font-size: .75rem;
    color: #64748b;
}

.presence-choice__option input:checked + .presence-choice__card--yes {
    border-color: rgba(47, 158, 107, .55);
    background: rgba(47, 158, 107, .08);
    box-shadow: 0 .25rem .7rem rgba(47, 158, 107, .12);
}

.presence-choice__option input:checked + .presence-choice__card--no {
    border-color: rgba(100, 116, 139, .55);
    background: rgba(100, 116, 139, .1);
    box-shadow: 0 .25rem .7rem rgba(100, 116, 139, .12);
}

.presence-choice__option:hover .presence-choice__card {
    transform: translateY(-1px);
}

.presence-choice--compact {
    margin-bottom: 0;
}

.presence-panel {
    margin-top: .75rem;
    padding: .85rem .9rem;
    border-radius: .9rem;
    background: rgba(4, 77, 122, .04);
    border: 1px dashed rgba(4, 77, 122, .18);
}

.presence-panel--absent {
    background: rgba(199, 142, 48, .08);
    border-color: rgba(199, 142, 48, .28);
}

.presence-panel__title {
    font-family: var(--font-display);
    font-size: .95rem;
    font-weight: 700;
    margin: 0 0 .55rem;
    color: #172033;
}

.presence-row__extra {
    padding: 0 1rem .85rem;
    font-size: .82rem;
}

@media (max-width: 575.98px) {
    .presence-row__actions {
        width: 100%;
        margin-left: 0;
    }

    .presence-choice {
        grid-template-columns: 1fr;
    }
}

/* Présences — modules cours */
.attendance-course-item {
    border-radius: 1rem !important;
    overflow: hidden;
    box-shadow: 0 .35rem 1.2rem rgba(15, 23, 42, .06);
    background: #fff;
}

.attendance-course-trigger {
    gap: 1rem;
    padding: 1rem 1.15rem;
    background: #fff !important;
    box-shadow: none !important;
    color: #172033;
}

.attendance-course-trigger:not(.collapsed) {
    background: linear-gradient(180deg, rgba(4, 77, 122, .05) 0%, #fff 100%) !important;
    border-bottom: 1px solid rgba(15, 23, 42, .06);
}

.attendance-course-trigger:focus {
    box-shadow: none !important;
}

.attendance-course-trigger::after {
    margin-left: .5rem;
    flex-shrink: 0;
}

.attendance-course-trigger__main {
    flex: 1 1 auto;
    text-align: left;
}

.attendance-course-trigger__date {
    font-size: .78rem;
    font-weight: 650;
    color: var(--brand-primary);
    margin-bottom: .15rem;
}

.attendance-course-trigger__title {
    font-size: 1.02rem;
    font-weight: 700;
    line-height: 1.25;
}

.attendance-course-trigger__meta {
    font-size: .82rem;
    color: #64748b;
    margin-top: .15rem;
}

.attendance-course-trigger__stats {
    display: flex;
    gap: .35rem;
    align-items: center;
}

.attendance-pill {
    min-width: 1.75rem;
    height: 1.75rem;
    padding: 0 .4rem;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: .75rem;
    font-weight: 700;
}

.attendance-pill--ok { background: #dcfce7; color: #166534; }
.attendance-pill--warn { background: #fef3c7; color: #92400e; }
.attendance-pill--ko { background: #fee2e2; color: #991b1b; }

.attendance-course-body {
    padding: 1rem 1.15rem 1.2rem;
    background: #fcfdff;
}

.attendance-people {
    display: grid;
    gap: .5rem;
}

.attendance-person {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .65rem .85rem;
    padding: .7rem .85rem;
    border-radius: .85rem;
    background: #fff;
    border: 1px solid rgba(15, 23, 42, .06);
}

.attendance-person__avatar {
    width: 2.15rem;
    height: 2.15rem;
    border-radius: .65rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
    font-size: .75rem;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(145deg, var(--brand-primary), #033a5e);
    flex-shrink: 0;
}

.attendance-person__name {
    flex: 1 1 8rem;
    font-size: .92rem;
}

/* -------------------------------------------------------------------------- */
/* Aide contextuelle (HelpTooltip)                                            */
/* -------------------------------------------------------------------------- */

.help-tooltip {
    position: relative;
    display: inline-flex;
    align-items: center;
    vertical-align: middle;
    margin-left: .28rem;
}

.help-tooltip__trigger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.15rem;
    height: 1.15rem;
    padding: 0;
    border: 1px solid rgba(4, 77, 122, .35);
    border-radius: 50%;
    background: #fff;
    color: var(--brand-primary);
    font-family: var(--font-body);
    font-size: .7rem;
    font-weight: 700;
    line-height: 1;
    cursor: help;
    flex-shrink: 0;
    transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}

.help-tooltip__trigger:hover,
.help-tooltip__trigger:focus-visible,
.help-tooltip.is-open .help-tooltip__trigger {
    background: var(--brand-primary);
    border-color: var(--brand-primary);
    color: #fff;
    outline: none;
}

.help-tooltip__trigger:focus-visible {
    box-shadow: 0 0 0 .2rem rgba(4, 77, 122, .25);
}

.help-tooltip__mark {
    display: block;
    transform: translateY(.5px);
}

.help-tooltip__panel {
    position: fixed;
    z-index: 1080;
    max-width: min(17.5rem, calc(100vw - 1.5rem));
    padding: .55rem .7rem;
    border-radius: .45rem;
    border: 1px solid rgba(15, 23, 42, .1);
    background: #fff;
    color: #334155;
    font-family: var(--font-body);
    font-size: .8125rem;
    font-weight: 400;
    line-height: 1.4;
    text-align: left;
    box-shadow: 0 .35rem 1rem rgba(15, 23, 42, .12);
    white-space: normal;
}

.help-tooltip__panel--detail {
    max-width: min(22rem, calc(100vw - 1.5rem));
    padding: .75rem .85rem;
}

.help-tooltip__panel[hidden] {
    display: none !important;
}

.help-tooltip__title {
    display: block;
    margin-bottom: .35rem;
    color: var(--brand-primary);
    font-family: var(--font-display);
    font-size: .95rem;
    font-weight: 700;
    letter-spacing: .02em;
    line-height: 1.25;
}

.help-tooltip__text {
    display: block;
}

.help-tooltip__hint {
    display: block;
    margin-top: .4rem;
    color: #64748b;
    font-size: .72rem;
    font-style: italic;
}

.help-tooltip__find {
    display: block;
    margin-top: .55rem;
    padding-top: .5rem;
    border-top: 1px solid rgba(15, 23, 42, .08);
    color: #475569;
    font-size: .78rem;
}

.help-tooltip__link {
    display: inline-block;
    margin-top: .55rem;
    color: var(--brand-primary);
    font-size: .78rem;
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.help-tooltip__link:hover {
    color: var(--brand-primary-dark);
}

.form-label .help-tooltip,
.form-check-label .help-tooltip,
.h1 .help-tooltip,
.h2 .help-tooltip,
.h3 .help-tooltip,
.h4 .help-tooltip,
.h5 .help-tooltip,
.h6 .help-tooltip,
.card-title .help-tooltip,
.nav-link .help-tooltip {
    margin-top: -.1rem;
}

@media (max-width: 575.98px) {
    .help-tooltip__panel,
    .help-tooltip__panel--detail {
        max-width: min(18rem, calc(100vw - 1.25rem));
        font-size: .8rem;
    }
}

.help-tooltip__feedback {
    display: block;
    margin-top: .65rem;
    padding-top: .55rem;
    border-top: 1px solid rgba(15, 23, 42, .08);
}

.help-tooltip__feedback-label {
    display: block;
    margin-bottom: .35rem;
    color: #64748b;
    font-size: .72rem;
}

.help-tooltip__feedback-actions {
    display: flex;
    flex-wrap: wrap;
    gap: .35rem;
}

.help-tooltip__feedback-btn {
    border: 1px solid rgba(4, 77, 122, .28);
    border-radius: .35rem;
    background: #fff;
    color: var(--brand-primary);
    font-size: .72rem;
    font-weight: 600;
    padding: .15rem .55rem;
    cursor: pointer;
}

.help-tooltip__feedback-btn:hover {
    background: rgba(4, 77, 122, .08);
}

.help-tooltip__feedback-thanks {
    color: #64748b;
    font-size: .72rem;
    font-style: italic;
}

.help-tooltip__center-link {
    display: inline-block;
    margin-top: .45rem;
    color: #64748b;
    font-size: .7rem;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.help-tooltip__center-link:hover {
    color: var(--brand-primary);
}

/* Intro première visite */
.help-intro {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 1rem;
    align-items: flex-start;
    padding: 1.1rem 1.25rem;
    border-radius: .65rem;
    border: 1px solid rgba(4, 77, 122, .18);
    background:
        linear-gradient(135deg, rgba(4, 77, 122, .08), rgba(4, 77, 122, .02)),
        #fff;
    transition: opacity .18s ease, transform .18s ease;
}

.help-intro.is-leaving {
    opacity: 0;
    transform: translateY(-.25rem);
}

.help-intro__eyebrow {
    color: var(--brand-primary);
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    margin-bottom: .25rem;
}

.help-intro__title {
    font-family: var(--font-display);
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--brand-primary);
    margin: 0 0 .35rem;
}

.help-intro__body {
    margin: 0;
    color: #475569;
    font-size: .9rem;
    max-width: 42rem;
}

.help-intro__actions {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    margin-top: .85rem;
}

.help-intro__dismiss {
    border: 0;
    background: transparent;
    color: #64748b;
    font-size: .8rem;
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 2px;
    cursor: pointer;
    padding: 0;
}

.help-intro__dismiss:hover {
    color: var(--brand-primary);
}

/* Checklist */
.help-checklist {
    padding: 1.1rem 1.25rem;
    border-radius: .65rem;
    border: 1px solid rgba(15, 23, 42, .08);
    background: #fff;
    box-shadow: 0 .2rem .75rem rgba(15, 23, 42, .04);
}

.help-checklist__head {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: .75rem;
    align-items: flex-start;
    margin-bottom: .85rem;
}

.help-checklist__title {
    font-family: var(--font-display);
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--brand-primary);
    margin: 0;
}

.help-checklist__subtitle {
    margin: .25rem 0 0;
    color: #64748b;
    font-size: .82rem;
}

.help-checklist__meta {
    display: flex;
    align-items: center;
    gap: .5rem;
}

.help-checklist__progress {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.5rem;
    padding: .15rem .45rem;
    border-radius: .4rem;
    background: rgba(4, 77, 122, .1);
    color: var(--brand-primary);
    font-size: .75rem;
    font-weight: 700;
}

.help-checklist__hide {
    color: #64748b !important;
    text-decoration: none !important;
    padding: 0 !important;
}

.help-checklist__list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: .55rem;
}

.help-checklist__item {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: .5rem .75rem;
    padding: .65rem .75rem;
    border-radius: .5rem;
    background: #f8fafc;
    border: 1px solid transparent;
}

.help-checklist__item.is-done {
    background: rgba(22, 163, 74, .06);
    border-color: rgba(22, 163, 74, .15);
}

.help-checklist__item.is-done .help-checklist__item-title {
    text-decoration: line-through;
    color: #64748b;
}

.help-checklist__label {
    display: flex;
    gap: .65rem;
    align-items: flex-start;
    margin: 0;
    cursor: pointer;
    flex: 1 1 14rem;
}

.help-checklist__check {
    margin-top: .2rem;
}

.help-checklist__text {
    display: flex;
    flex-direction: column;
    gap: .15rem;
}

.help-checklist__item-title {
    font-size: .9rem;
    font-weight: 600;
    color: #0f172a;
}

.help-checklist__hint {
    font-size: .78rem;
    color: #64748b;
}

.help-checklist__go {
    font-size: .78rem;
    font-weight: 600;
    color: var(--brand-primary);
    text-decoration: none;
    white-space: nowrap;
}

.help-checklist__go:hover {
    text-decoration: underline;
}

.help-checklist__done-msg {
    margin-top: .75rem;
    color: #15803d;
    font-size: .82rem;
    font-weight: 600;
}

/* Empty enrichi */
.help-empty {
    padding: 1.35rem 1.25rem;
    text-align: center;
    border-radius: .55rem;
    background: #f8fafc;
}

.help-empty__title {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .25rem;
    flex-wrap: wrap;
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 700;
    color: var(--brand-primary);
    margin-bottom: .4rem;
}

.help-empty__body {
    max-width: 34rem;
    margin: 0 auto;
    color: #64748b;
    font-size: .88rem;
    line-height: 1.45;
}

.help-empty__actions {
    margin-top: .9rem;
}

.help-status {
    display: inline-flex;
    align-items: center;
    gap: .2rem;
    vertical-align: middle;
}

.help-callout {
    padding: .85rem 1rem;
    border-radius: .5rem;
    border-left: 3px solid var(--brand-primary);
    background: rgba(4, 77, 122, .06);
    color: #334155;
    font-size: .88rem;
}

.help-callout strong {
    color: var(--brand-primary);
}

/* Centre d’aide */
.help-center-search {
    min-width: min(18rem, 100%);
}

.help-center-section__title {
    font-family: var(--font-display);
    font-weight: 700;
    color: var(--brand-primary);
    margin-bottom: .85rem;
    padding-bottom: .35rem;
    border-bottom: 1px solid rgba(15, 23, 42, .08);
}

.help-center-card {
    padding: 1rem 1.05rem;
    border-radius: .55rem;
    border: 1px solid rgba(15, 23, 42, .08);
    background: #fff;
}

.help-center-card__title {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: .15rem;
    font-size: .95rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 .35rem;
}

.help-center-card__summary {
    margin: 0 0 .55rem;
    color: #64748b;
    font-size: .82rem;
}

.help-center-card__details summary {
    cursor: pointer;
    color: var(--brand-primary);
    font-size: .8rem;
    font-weight: 600;
}

.help-center-card__details[open] summary {
    margin-bottom: .45rem;
}

.help-center-card__details p {
    font-size: .82rem;
    color: #475569;
}

/* Overlay de progression (imports / restaurations) */
.busy-progress {
    position: fixed;
    inset: 0;
    z-index: 1090;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1.25rem;
    background: rgba(15, 23, 42, .55);
    backdrop-filter: blur(2px);
}

.busy-progress.is-open {
    display: flex;
}

.busy-progress__dialog {
    width: min(28rem, 100%);
    background: #fff;
    border-radius: .85rem;
    box-shadow: 0 1.25rem 3rem rgba(15, 23, 42, .28);
    padding: 1.5rem 1.4rem 1.25rem;
    text-align: center;
}

.busy-progress__spinner {
    width: 2.35rem;
    height: 2.35rem;
    margin: 0 auto .9rem;
    border-radius: 50%;
    border: 3px solid rgba(4, 77, 122, .18);
    border-top-color: var(--brand-primary);
    animation: busy-progress-spin .8s linear infinite;
}

.busy-progress.is-error .busy-progress__spinner {
    display: none;
}

@keyframes busy-progress-spin {
    to { transform: rotate(360deg); }
}

.busy-progress__title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--brand-primary);
    margin: 0 0 .35rem;
}

.busy-progress__status {
    margin: 0 0 .9rem;
    color: #334155;
    font-size: .92rem;
}

.busy-progress__bar {
    height: .65rem;
    margin-bottom: .45rem;
}

.busy-progress__percent {
    margin: 0 0 .35rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: var(--brand-primary);
    font-size: .9rem;
}

.busy-progress__hint {
    margin: .65rem 0 0;
    color: #64748b;
    font-size: .78rem;
}

body.busy-progress-lock {
    overflow: hidden;
}
