﻿.apc-participation-content {
}

/* =========================
   APC MANAGER PAGE LAYOUT (GRID)
========================= */
.apc-manager-page {
    display: grid;
    grid-template-columns: 300px minmax(0, 1fr) minmax(0, 1fr);
    gap: .5rem;
    height: 100%;
}

    .apc-manager-page > .content,
    .apc-manager-page > .apc-summary-panel {
        min-width: 0;
        min-height: 0;
    }

@media (max-width: 1200px) {
    .apc-manager-page {
        grid-template-columns: 300px minmax(0, 1fr) minmax(0, 1fr);
    }
}

@media (max-width: 992px) {
    .apc-manager-page {
        grid-template-columns: 1fr;
    }
}

.apc-participation-table {
    border: 1px solid #ddd;
    border-radius: 5px;
    background: white;
}

    /* Conteneur Nom/Prénom centré */
    .apc-participation-table .apc-student-name {
        display: flex;
        align-items: center; /* centrage vertical */
        justify-content: flex-start; /* aligné à gauche */
        gap: .4rem;
        width: 100%;
        min-width: 0;
        overflow: hidden;
    }

        /* Les spans restent inline, sans flex parasite */
        .apc-participation-table .apc-student-name .last-name,
        .apc-participation-table .apc-student-name .first-name {
            display: inline;
            flex: 0 0 auto;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

.apc-participation-container {
    display: flex;
    gap: 2rem;
    padding: 1rem;
    flex-direction: row;
}

.apc-participation-student-panel {
    background-color: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 10px;
    padding: 1rem;
    flex-grow: 1;
    overflow-y: auto;
}

.apc-participation-left-column {
    max-width: 320px;
    min-width: 320px;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.apc-participation-right-column {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    height: 100%;
    overflow-y: auto;
}

.apc-manager-classroom-list-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.apc-manager-student-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 0.5rem;
}

.apc-manager-activity-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    flex: 1 1 auto;
    min-height: 0;
}


.apc-manager-label {
    font-size: 1.4rem;
    font-weight: bold;
    text-align: center;
}

.apc-manager-body {
    background-color: #f9f9f9;
    padding: 0.75rem;
    border-top: 1px solid #eee;
}

.apc-manager-edit-toggle-button {
    background-color: var(--secondary-color);
    color: white;
    border: none;
    border-radius: 6px;
    padding: 0.2rem 0.5rem;
    font-size: 0.9rem;
}

    .apc-manager-edit-toggle-button:hover {
        filter: brightness(1.2);
    }

    .apc-manager-edit-toggle-button:focus {
        background-color: rgba(var(--secondary-color-rgb), 0.8) !important;
        outline: none !important;
        box-shadow: none !important;
        border: none !important;
    }

.apc-manager-slot-form {
    background-color: #fdfdfd;
}

.apc-manager-main-container {
    display: flex;
    flex-direction: row;
    gap: 1rem;
    height: 100%;
    max-height: 100%;
    padding: 1rem;
    overflow: hidden;
    min-height: 0;
}

/* Bloc classique prend la moitié, mais grandit si possible */
.apc-manager-classic-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    background-color: #fff;
    border-radius: 8px;
    border: 1px solid #ddd;
    overflow: hidden;
    min-height: 0;
    height: 100%;
}

/* Bloc coup de pouce avec taille auto */
.apc-manager-support-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    background-color: #fff;
    border-radius: 8px;
    border: 1px solid #ddd;
    overflow: hidden;
    min-height: 0;
    height: 100%;
    align-self: stretch;
}

/* Header du bloc classique */
.apc-manager-classic-header {
    padding: 1rem;
    border-bottom: 1px solid #eee;
    background-color: var(--primary-color);
    color: white;
}

/* Contenu scrollable */
.apc-manager-classic-content,
.apc-manager-support-content {
    flex-grow: 1;
    overflow: hidden;
    min-height: 150px;
    scrollbar-gutter: stable;
}

/* =========================
   APC FORMS: accordéon (style calqué sur activités extrascolaires)
========================= */
.apc-slot-form-wrapper {
    border-top: 1px solid rgba(15, 23, 42, 0.10);
    background: #f0f4fa;
}

.apc-slot-form-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.45rem 0.6rem;
    cursor: pointer;
    user-select: none;
    color: var(--primary-color);
}

    .apc-slot-form-header:hover {
        background: rgba(var(--primary-color-rgb), 0.06);
    }

.apc-slot-form {
    border-top: 2px dashed var(--primary-color);
    padding: 0.5rem;
    overflow: hidden; /* ✅ sécurité anti dépassement */
    background: #f0f4fa;
}

/* ✅ Form interne en grid : se replie si manque de place */
.apc-slot-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.45rem;
    align-items: end;
}

/* Jour sur toute la largeur, puis heures en dessous */
.apc-slot-form-field-day {
    grid-column: 1 / -1;
}

@media (max-width: 420px) {
    .apc-slot-form-grid {
        grid-template-columns: 1fr;
    }
}

.apc-slot-form-field {
    min-width: 0;
}

.apc-slot-form-label {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.2rem;
}

.apc-slot-form-control {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    height: 28px;
    font-size: 0.8rem;
    padding-top: 0.2rem;
    padding-bottom: 0.2rem;
}

/* quand fermé */
.apc-slot-form-wrapper.is-closed .apc-slot-form {
    display: none;
}

/* Scroll collé à droite : le padding est dans l'inner, pas sur la zone scroll */
.apc-manager-scroll {
    height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    min-height: 0;
    scrollbar-gutter: stable;
}

.apc-manager-scroll-inner {
    padding: 1rem;
    min-height: 0;
}

/* La liste elle-même scrolle */
.apc-manager-slot-list {
    flex-grow: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}


/*-- slot items --*/
.apc-manager-slot-box {
    background-color: white;
    border: 1px solid var(--primary-color);
    border-left: 6px solid var(--secondary-color);
    border-radius: 10px;
    margin-bottom: 1rem;
}

.apc-manager-student-participation {
    padding: 0.2rem 0.5rem;
    border-top: 1px solid rgba(var(--primary-color-rgb, 37, 99, 235), 0.15);
}

.apc-manager-student-name {
    font-weight: 700;
    font-size: 0.8rem;
    margin-bottom: 0;
}

.apc-manager-session-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    padding-bottom: 0.15rem;
}

.apc-manager-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    padding: 0.1rem 0.45rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    min-width: 48px;
    text-align: center;
    transition: all 0.2s ease;
    position: relative;
}

/* ---- État général ---- */
.apc-manager-pill-future {
    background-color: #f3f7ff;
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
}

.apc-manager-pill-future-absent {
    color: #c62828;
    border: 1px solid #ef5350;
}

.apc-manager-pill-future-teacher-absent {
    color: #6a1b9a;
    border: 1px solid #ba68c8;
}

.apc-manager-pill-present {
    background-color: #e6f4ea;
    color: #2e7d32;
    border: 1px solid #66bb6a;
}

.apc-manager-pill-absent {
    background-color: #fdecea;
    color: #c62828;
    border: 1px solid #ef5350;
}

.apc-manager-pill-teacher-absent {
    background-color: #f3e8fd;
    color: #6a1b9a;
    border: 1px solid #ba68c8;
}

.apc-manager-pill-pending {
    background-color: #f8f9fa;
    color: #6c757d;
    border: 1px dashed #adb5bd;
}

/* Icône de statut ou bouton suppression */
.apc-manager-status-icon {
    font-size: 0.82rem;
    margin-left: 0;
    line-height: 1;
}

.apc-manager-remove-assignment-button {
    background: none;
    border: none;
    color: var(--important-color);
    font-size: 1rem;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
}

    .apc-manager-remove-assignment-button:hover {
        filter: brightness(1.2);
    }

.apc-manager-slot-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    border-radius: 6px 6px 0 0;
    background: linear-gradient(90deg,
        rgba(var(--primary-color-rgb, 37, 99, 235), 0.07) 0%,
        rgba(var(--primary-color-rgb, 37, 99, 235), 0.02) 100%);
    border-bottom: 1px solid rgba(var(--primary-color-rgb, 37, 99, 235), 0.12);
}

.apc-manager-slot-day {
    font-size: 1.1rem;
    font-weight: bold;
}

.apc-manager-slot-meta {
    font-size: 0.76rem;
    color: #6b7280;
}

.apc-manager-student-block {
    background-color: #f8f9fa;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 0.75rem 1rem;
    margin-top: 1rem;
}

.apc-manager-student-header {
    font-weight: 600;
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
    color: var(--primary-color);
}

.apc-manager-support-slot-box {
    padding: 0.75rem;
    border-radius: 8px;
    border-left: 5px solid var(--secondary-color);
    background-color: #f5faff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}


.apc-manager-status-toggle {
    border: 0;
    background: transparent;
    text-decoration: underline;
    font-size: .82rem;
    cursor: pointer;
}

    .apc-manager-status-toggle:disabled {
        opacity: .5;
        cursor: default;
        text-decoration: none;
    }

.apc-manager-status-icon-btn {
    border: 0;
    background: transparent;
    width: 20px;
    height: 20px;
    border-radius: 9999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
}

    .apc-manager-status-icon-btn:hover {
        background: rgba(0,0,0,.06);
    }

    .apc-manager-status-icon-btn:disabled {
        opacity: .5;
        cursor: default;
    }

.apc-manager-status-icon {
    font-size: 0.82rem;
    line-height: 1;
    display: inline-flex;
    align-items: center;
}

/* spinner si besoin (déjà fourni précédemment) */
.apc-spinner {
    width: 14px;
    height: 14px;
    border: 2px solid rgba(0,0,0,.15);
    border-top-color: rgba(0,0,0,.55);
    border-radius: 50%;
    animation: apc-spin .8s linear infinite;
}

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

.apc-slot-header-left {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    min-width: 0;
    flex: 1 1 0;
}

.apc-slot-header-top {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.apc-slot-header-meta {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.73rem;
    color: #6b7280;
}

.apc-slot-header-sep {
    color: #d1d5db;
}

.apc-manager-slot-session-count {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    padding: 0.05rem 0.4rem;
    border-radius: 9999px;
    font-size: 0.68rem;
    font-weight: 700;
    background: rgba(var(--primary-color-rgb, 37, 99, 235), 0.1);
    color: var(--primary-color);
    border: 1px solid rgba(var(--primary-color-rgb, 37, 99, 235), 0.2);
}

.apc-manager-slot-title {
    font-weight: 700;
    font-size: 0.88rem;
    color: var(--primary-color);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}


/* --- Summary plus large --- */
.apc-summary-container {
    display: grid;
    grid-template-columns: 0.8fr 1fr;
    gap: .5rem;
    width: 100%;
    max-width: 100%;
    max-height: none;
    overflow: hidden;
    background: linear-gradient(
        180deg,
        rgba(var(--primary-color-rgb,37,99,235), .22) 0%,
        rgba(var(--primary-color-rgb,37,99,235), .10) 45%,
        rgba(var(--primary-color-rgb,37,99,235), .00) 85%
    ), #fff;
    border: 1px solid #ddd;
    border-radius: 10px;
    padding: .75rem;
    box-shadow: 0 2px 6px rgba(0,0,0,0.05);
}

@media (max-width: 992px) {
    .apc-summary-container {
        grid-template-columns: 1fr;
    }
}

.apc-summary-panel {
    flex: 0 0 auto; /* ne se compresse pas */
    align-self: stretch;
}

/* Conteneur du résumé (on garde ta largeur "wide") */
.apc-summary--wide.apc-summary-container {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
    min-width: 0;
    overflow: hidden;
}

@media (max-width: 992px) {
    .apc-summary--wide.apc-summary-container {
        grid-template-columns: 1fr;
    }
}

.apc-summary-section {
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
    border-radius: 10px;
    border: 1px solid #e9ecef;
    background: transparent;
}

/* La section ne scrolle pas : on garde le border-radius visible.
   Le scroll est dans .apc-summary-section-content (voir plus bas). */
.apc-summary-section--days,
.apc-summary-section--students {
    overflow: hidden;
}

@media (max-width: 992px) {
    .apc-summary-section--days,
    .apc-summary-section--students {
        max-height: none;
    }
}

/* Header sticky (les 2 colonnes) */
.apc-summary-section .apc-summary-header {
    position: sticky;
    top: 0;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    min-height: 48px;
    padding: .55rem .75rem;
    margin: .5rem .5rem .35rem .5rem;
    background: var(--primary-color);
    border: 1px solid rgba(var(--primary-color-rgb,37,99,235), .22);
    border-radius: 14px;
    box-shadow: 0 8px 20px rgba(17,24,39,0.06);
    backdrop-filter: blur(8px);
}

    .apc-summary-section .apc-summary-header:after {
        content: "";
        position: absolute;
        left: .9rem;
        right: .9rem;
        bottom: -1px;
        height: 1px;
        background: linear-gradient(90deg, rgba(var(--primary-color-rgb,37,99,235), .00), rgba(var(--primary-color-rgb,37,99,235), .22), rgba(var(--primary-color-rgb,37,99,235), .00));
        pointer-events: none;
    }

.apc-summary-section .apc-summary-header-icon {
    font-size: 1.15rem;
    color: #fff;
}

.apc-summary-section .apc-summary-title {
    font-weight: 900;
    letter-spacing: .01em;
    color: #fff;
}

/* Subheaders collapsibles */
.apc-summary-subheader-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
    border: 0;
    cursor: pointer;
}

    .apc-summary-subheader-btn i {
        font-size: .95rem;
    }

/* Zone scrollable interne (et padding ici, pas sur la section) */
.apc-summary-section-content {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding: .35rem .65rem .65rem .65rem;
    overscroll-behavior: contain;
}

/* 2e colonne : le contenu est souvent une table -> éviter que ça force un scroll ailleurs */
.apc-summary-section-content--students {
    display: flex;
    flex-direction: column;
}

.apc-summary-support-table-wrapper {
    overflow: auto;
    min-height: 0;
    -webkit-overflow-scrolling: touch;
}

/* Sticky header de table dans la colonne élève (reste sous le header sticky de la section) */
.apc-support-table thead th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: #fff;
}

.apc-summary-group {
    margin-top: .75rem;
}

.apc-summary-subheader {
    font-weight: 800;
    font-size: .9rem;
    letter-spacing: .02em;
    padding: .35rem .6rem;
    margin: .25rem 0 .35rem 0;
    color: var(--primary-color);
    background: rgba(var(--primary-color-rgb,37,99,235), .08);
    border: 1px solid rgba(var(--primary-color-rgb,37,99,235), .12);
    border-radius: 8px;
    text-align: center;
}

/* Subheaders: Passées / À venir */
.apc-summary-subheader--past {
    color: rgba(var(--secondary-color-rgb), 1);
    background: rgba(var(--secondary-color-rgb), .22);
    border-color: rgba(var(--secondary-color-rgb), .40);
    box-shadow: 0 6px 18px rgba(var(--secondary-color-rgb), .18);
}

.apc-summary-subheader--upcoming {
    color: rgba(var(--secondary-color-rgb), 1);
    background: rgba(var(--secondary-color-rgb), .16);
    border-color: rgba(var(--secondary-color-rgb), .30);
    box-shadow: 0 6px 18px rgba(var(--secondary-color-rgb), .14);
}

/* Header : tout centré H/V, multi-lignes OK */
.apc-summary-header {
    display: flex;
    align-items: center; /* centrage vertical */
    justify-content: center; /* centrage horizontal */
    text-align: center;
    min-height: 52px;
    padding: .45rem .6rem;
    background: linear-gradient(135deg, rgba(var(--primary-color-rgb,37,99,235), .08), rgba(255,255,255,0));
    border: 1px solid rgba(var(--primary-color-rgb,37,99,235), .12);
    border-radius: 12px;
    box-sizing: border-box;
}

/* Bloc (icône + titre) centré et contraint à la largeur */
.apc-summary-header-left {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    max-width: 100%;
}

/* Icône entête */
.apc-summary-header-icon {
    font-size: 1.1rem;
    color: var(--primary-color);
    flex-shrink: 0; /* l'icône ne se déforme pas */
}

/* Titre : casse les mots longs + ellipsis multi-lignes */
.apc-summary-title {
    font-weight: 700;
    color: var(--primary-color);
    line-height: 1.2;
    max-width: 100%;
    overflow: hidden;
    text-wrap: pretty; /* navigateurs récents */
    overflow-wrap: anywhere; /* casse les très longs mots */
    word-break: break-word;
    display: -webkit-box; /* ellipse multi-lignes (2) */
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

/* === Lignes : date à gauche, durée à droite, anti-overflow === */
.apc-summary-list {
    display: flex;
    flex-direction: column;
    gap: .35rem;
}

.apc-summary-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto; /* la date peut rétrécir, la durée reste à droite */
    align-items: center;
    padding: .35rem .45rem;
    border-radius: 10px;
    border: 1px solid transparent;
    transition: background .15s ease, border-color .15s ease;
}

    .apc-summary-row:hover {
        background: #fafafa;
        border-color: #eee;
    }

    .apc-summary-row.is-today {
        background: linear-gradient(0deg, rgba(var(--secondary-color-rgb,13,148,136), .06), rgba(255,255,255,0));
        border-color: rgba(var(--secondary-color-rgb,13,148,136), .20);
    }

    .apc-summary-row.is-past {
        opacity: .8;
        background: linear-gradient(0deg, rgba(0,0,0,.025), rgba(255,255,255,0));
        border-color: #eee;
    }

        .apc-summary-row.is-past .apc-summary-date,
        .apc-summary-row.is-past .apc-summary-duration {
            color: #6b7280; /* gris */
            font-weight: 600;
        }

    /* À venir : léger liseré */
    .apc-summary-row.is-upcoming {
        border-color: rgba(var(--primary-color-rgb,37,99,235), .12);
    }

    .apc-summary-row.is-today .apc-summary-date {
        font-weight: 800;
    }

.apc-summary-row-left {
    display: flex;
    align-items: center;
    gap: .5rem;
    min-width: 0; /* permet l'ellipsis de la date */
}

.apc-summary-date {
    color: #111827;
    font-weight: 600;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden; /* ellipsis si trop long */
    font-size: .9rem;
}

.apc-summary-badge {
    margin-left: .25rem;
    background: rgba(var(--secondary-color-rgb,13,148,136), .1);
    color: var(--secondary-color, #0ea5a4);
    border: 1px solid rgba(var(--secondary-color-rgb,13,148,136), .2);
    padding: .05rem .45rem;
    border-radius: 9999px;
    font-size: .75rem;
    font-weight: 700;
}

/* Durée alignée à droite, bien lisible, largeur minimale */
.apc-summary-row-right {
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

.apc-summary-duration {
    min-width: 120px; /* évite les sauts */
    text-align: right;
    font-weight: 800;
    letter-spacing: .01em;
    color: var(--primary-color);
}

/* === Footer : total très mis en valeur, sans chip en header === */
.apc-summary-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: .6rem;
    border-top: 1px dashed #e5e7eb;
    margin-top: .25rem;
}

.apc-summary-footer-label {
    color: #6b7280;
    font-weight: 700;
    letter-spacing: .02em;
}

.apc-summary-footer-total {
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    font-weight: 900;
    font-size: 1.15rem;
    letter-spacing: .02em;
}

.apc-summary-section-separator {
    height: 1px;
    background-color: var(--primary-color);
}

/* Header du bloc élève : ligne cliquable centrée verticalement */
.apc-student-collapse-header {
    width: 100%;
    display: flex;
    align-items: center; /* ✅ centrage vertical global */
    justify-content: space-between;
    gap: .4rem;
    background: transparent;
    border: 0;
    padding: .1rem 0;
    min-height: 30px;
    cursor: pointer;
}

    .apc-student-collapse-header i {
        line-height: 1;
    }

    /* Zone libellé + compteur : centrée verticalement */
    .apc-student-collapse-header .d-flex {
        align-items: center; /* ✅ centrage vertical sur le groupe gauche */
    }

    /* Le nom ne doit pas pousser vers le bas dans le header */
    .apc-student-collapse-header .apc-manager-student-name {
        margin: 0; /* ✅ supprime le margin-bottom hérité */
        display: inline-flex;
        align-items: center; /* ✅ centrage vertical du texte lui-même */
        line-height: 1.25;
    }

/* Compteur : centré dans sa pastille */
.apc-student-collapse-count {
    display: inline-flex;
    align-items: center; /* ✅ centrage vertical du nombre */
    justify-content: center;
    min-width: 1.3rem;
    height: 1.15rem;
    padding: 0 .35rem;
    border-radius: 9999px;
    font-size: .68rem;
    font-weight: 700;
    background: rgba(var(--primary-color-rgb,37,99,235), .08);
    color: var(--primary-color);
    border: 1px solid rgba(var(--primary-color-rgb,37,99,235), .15);
}

/* Tableau "Coup de pouce" compact */
.apc-summary-support-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed; /* ✅ permet de fixer la largeur des colonnes */
    margin-top: .35rem;
}

    .apc-summary-support-table thead th {
        text-align: left;
        font-weight: 800;
        font-size: .85rem;
        color: #374151;
        padding: .35rem .5rem;
        border-bottom: 1px dashed #e5e7eb;
    }

    .apc-summary-support-table tbody td {
        padding: .35rem .5rem;
        border-bottom: 1px dashed #f1f5f9;
    }

/* Colonnes : le nom prend la largeur, les deux autres sont étroites */
.apc-support-col-name {
    width: auto;
}

.apc-support-col-count {
    text-align: center;
}

.apc-support-col-duration {
    text-align: right;
}

/* Cellules : ellipsis sur le nom, chiffres compacts */
.apc-support-cell-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 600;
    color: #111827;
}

.apc-support-cell-count {
    font-size: .78rem; /* ✅ plus petit pour laisser la place au nom */
    color: #6b7280;
    text-align: center;
}

.apc-support-cell-duration {
    text-align: right;
    font-weight: 800;
    font-variant-numeric: tabular-nums; /* alignement des chiffres */
    letter-spacing: .01em;
    color: var(--primary-color);
    font-size: 0.8rem;
}

/* Un peu de hover pour la lisibilité */
.apc-summary-support-table tbody tr:hover {
    background: #fafafa;
}

/* Conteneur vertical du formulaire */
.apc-slot-form-fields {
    display: flex;
    flex-direction: column;
    gap: .75rem;
}

/* Une case = label + input empilés */
.apc-form-field {
    display: flex;
    flex-direction: column;
    gap: .25rem;
    min-width: 0; /* évite les débordements de texte */
}

    .apc-form-field .form-label {
        margin: 0;
        font-weight: 600;
        font-size: .9rem;
        line-height: 1.2;
        white-space: normal; /* les libellés peuvent passer à la ligne */
    }

/* Ligne compacte : 3 champs côte à côte, sans largeur fixe, et wrap si manque de place */
.apc-form-inline {
    display: flex;
    flex-wrap: wrap; /* passe à la ligne si nécessaire */
    gap: .75rem 1rem;
    align-items: flex-end; /* aligne les champs par le bas */
}

    .apc-form-inline .apc-form-field {
        flex: 1 1 auto; /* chaque champ prend sa part, pas de largeur imposée */
    }

/* Confort d’input (sans définir de couleurs de fond) */
.apc-slot-form .form-control {
    min-height: 2.25rem;
    padding: .375rem .5rem;
}

input[type="time"] {
    font-variant-numeric: tabular-nums;
    letter-spacing: .02em;
}
/* --- Summary : détails Session vs Coup de pouce sous la ligne --- */
.apc-summary-row-details {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(72px, max-content);
    justify-content: end;
    align-items: center;
    gap: .5rem;
    font-size: .74rem;
    font-weight: 800;
    opacity: .9;
}

/* Total + pills dans la liste élève : 2 pills puis total, avec largeurs stables */
.apc-student-balance-top {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    align-items: center;
    gap: .75rem;
}

    .apc-student-balance-top .apc-summary-row-details {
        grid-auto-columns: minmax(56px, max-content);
        gap: .45rem;
        justify-content: end;
    }

/* Le total élève garde un alignement propre et réserve une petite largeur */
.apc-student-balance-total {
    width: 56px;
    text-align: right;
}

.apc-summary-split {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    padding: .08rem .4rem;
    border-radius: 9999px;
    border: 1px solid transparent;
}

.apc-summary-split--session {
    color: var(--primary-color);
    background: rgba(var(--primary-color-rgb,37,99,235), .06);
    border-color: rgba(var(--primary-color-rgb,37,99,235), .16);
}

.apc-summary-split--support {
    color: var(--secondary-color);
    background: rgba(var(--secondary-color-rgb,13,148,136), .08);
    border-color: rgba(var(--secondary-color-rgb,13,148,136), .18);
}

/* --- Summary : uniformiser les pills "Sessions" / "Coup de pouce" dans la colonne élève --- */
.apc-student-split {
    justify-content: center;
    min-width: 52px;
    font-variant-numeric: tabular-nums;
}

.apc-student-balance-top .apc-summary-row-details {
    align-items: center;
}

/* --- Table : mini badges de compte --- */
.apc-summary-mini {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 .45rem;
    border-radius: 9999px;
    font-size: .6rem;
    font-weight: 900;
    border: 1px solid transparent;
}

.apc-summary-mini--session {
    color: var(--primary-color);
    background: rgba(var(--primary-color-rgb,37,99,235), .08);
    border-color: rgba(var(--primary-color-rgb,37,99,235), .16);
}

.apc-summary-mini--support {
    color: var(--secondary-color);
    background: rgba(var(--secondary-color-rgb,13,148,136), .10);
    border-color: rgba(var(--secondary-color-rgb,13,148,136), .18);
}

.apc-summary-mini-time {
    display: block;
    font-size: .6rem;
    font-weight: 700;
    color: #6b7280;
    margin-top: .15rem;
}

/* Réutilisation du pattern last-name/first-name dans la summary aussi */
.apc-support-table .apc-student-name {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .4rem;
    width: 100%;
    min-width: 0;
    overflow: hidden;
}

    .apc-support-table .apc-student-name .last-name,
    .apc-support-table .apc-student-name .first-name {
        display: inline;
        flex: 0 0 auto;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

/* =========================
   SUMMARY: triggers
========================= */
.apc-summary-cell-trigger {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: .2rem;
    width: 100%;
    cursor: pointer;
    user-select: none;
    border-radius: 10px;
    padding: .35rem .25rem;
    transition: background .12s ease, transform .12s ease;
}

    .apc-summary-cell-trigger:hover {
        background: rgba(0,0,0,.03);
    }

    .apc-summary-cell-trigger:active {
        transform: translateY(1px);
    }

/* mini badges déjà existants, on garde */

/* =========================
   TOOLTIP: version "warm"
========================= */
.apc-summary-tooltip.tooltip-container {
    /* positionné en fixed par JS */
    display: none;
    width: 220px;
    max-width: min(260px, 80vw);
    background: rgba(255, 255, 255, 0.98);
    border: 1px solid rgba(var(--primary-color-rgb,37,99,235), .18);
    border-radius: 14px;
    box-shadow: 0 14px 40px rgba(17,24,39,0.14);
    backdrop-filter: blur(8px);
    padding: .55rem;
}

/* Header tooltip */
.apc-summary-tooltip-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: .6rem;
    padding: .35rem .4rem .45rem .4rem;
    border-bottom: 1px dashed rgba(0,0,0,.12);
    margin-bottom: .35rem;
}

.apc-summary-tooltip-title {
    font-weight: 900;
    color: var(--primary-color);
    letter-spacing: .01em;
}

.apc-summary-tooltip-subtitle {
    font-weight: 800;
    font-size: .78rem;
    color: #6b7280;
}

/* Body tooltip (scroll si long : géré aussi par JS) */
.apc-summary-tooltip-body {
    display: flex;
    flex-direction: column;
    gap: .2rem;
    padding: .15rem .2rem .2rem .2rem;
}

/* Lignes */
.apc-summary-tooltip-line {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: .25rem .35rem;
    border-radius: 10px;
    background: rgba(var(--primary-color-rgb,37,99,235), .05);
    border: 1px solid rgba(var(--primary-color-rgb,37,99,235), .10);
    font-weight: 800;
    color: #111827;
}

    .apc-summary-tooltip-line:nth-child(even) {
        background: rgba(var(--secondary-color-rgb,13,148,136), .06);
        border-color: rgba(var(--secondary-color-rgb,13,148,136), .14);
    }

/* Réutilisation du pattern last-name/first-name dans la summary aussi */
.apc-support-table .apc-student-name {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .4rem;
    width: 100%;
    min-width: 0;
    overflow: hidden;
}

    .apc-support-table .apc-student-name .last-name,
    .apc-support-table .apc-student-name .first-name {
        display: inline;
        flex: 0 0 auto;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

.apc-summary-legend {
    display: flex;
    justify-content: center;
    gap: .5rem;
    margin: .35rem 0 .25rem 0;
    font-size: 10px;
}

/* Legend pills (réutilisable) */
.apc-summary-legend--compact {
    justify-content: flex-start;
    margin: 0 0 .5rem 0;
    font-size: .78rem;
}

.apc-summary-legend-pill {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    padding: .18rem .5rem;
    border-radius: 9999px;
    border: 1px solid rgba(0,0,0,.10);
    background: #fff;
    font-weight: 800;
    color: #374151;
}

    .apc-summary-legend-pill .dot {
        width: 10px;
        height: 10px;
        border-radius: 9999px;
        display: inline-block;
    }

.apc-summary-legend-pill--session {
    border-color: rgba(var(--primary-color-rgb,37,99,235), .22);
    background: rgba(var(--primary-color-rgb,37,99,235), .06);
}

    .apc-summary-legend-pill--session .dot {
        background: var(--primary-color);
    }

.apc-summary-legend-pill--support {
    border-color: rgba(var(--secondary-color-rgb,13,148,136), .24);
    background: rgba(var(--secondary-color-rgb,13,148,136), .08);
}

    .apc-summary-legend-pill--support .dot {
        background: var(--secondary-color);
    }

.apc-summary-section-sep {
    height: 10px;
    margin: 1rem 0 1.1rem 0;
    border-radius: 9999px;
    background: linear-gradient( 90deg, rgba(var(--primary-color-rgb,37,99,235), .18), rgba(var(--secondary-color-rgb,13,148,136), .14), rgba(var(--primary-color-rgb,37,99,235), .06) );
    box-shadow: 0 6px 18px rgba(17,24,39,0.06);
}

/* Students: cards plus compactes */
.apc-student-balance-item {
    padding: .4rem .55rem;
    border-radius: 10px;
}

.apc-student-balance-name {
    font-size: .88rem;
}

.apc-student-balance-total {
    font-size: .92rem;
}

.apc-student-balance-meta {
    font-size: .72rem;
    gap: .3rem;
    margin-top: .25rem;
}

.apc-summary-card {
    margin-top: .6rem;
    padding: .6rem .6rem .4rem .6rem;
    border-radius: 14px;
    border: 1px solid rgba(0,0,0,.08);
    background: linear-gradient(180deg, #ffffff 0%, #fbfbff 100%);
    box-shadow: 0 10px 26px rgba(17,24,39,0.06);
}

/* =========================
   STUDENTS BALANCE LIST
========================= */
.apc-student-balance {
    position: relative;
}

.apc-student-balance-list {
    display: flex;
    flex-direction: column;
    gap: .5rem;
}

.apc-student-balance-item {
    border: 1px solid rgba(0,0,0,.08);
    background: #fff;
    border-radius: 12px;
    padding: .5rem .6rem;
}

.apc-student-balance-top {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: .75rem;
}

.apc-student-balance-name {
    display: flex;
    align-items: center;
    gap: .35rem;
    min-width: 0;
    font-weight: 800;
    color: #111827;
}

    .apc-student-balance-name .first-name,
    .apc-student-balance-name .last-name {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

.apc-student-balance-total {
    flex: 0 0 auto;
    font-weight: 950;
    letter-spacing: .01em;
    font-variant-numeric: tabular-nums;
    color: var(--primary-color);
}

.apc-student-balance-meta {
    display: flex;
    flex-wrap: wrap;
    gap: .35rem;
    margin-top: .35rem;
    font-size: .78rem;
    font-weight: 800;
    color: #6b7280;
}

/* Réutilise le même style que "Temps passé" pour les compteurs élèves */
.apc-student-split {
    cursor: pointer;
    user-select: none;
}

.apc-student-balance-chip {
    display: inline-flex;
    align-items: center;
    padding: .12rem .45rem;
    border-radius: 9999px;
    border: 1px solid rgba(0,0,0,.10);
    background: rgba(255,255,255,.8);
    cursor: pointer;
    user-select: none;
}

    .apc-student-balance-chip:hover {
        filter: brightness(0.98);
    }

    .apc-student-balance-chip:active {
        transform: translateY(1px);
    }

/* Couleur de la barre selon la catégorie (basée sur la moyenne) */
.apc-student-balance-item.is-low .apc-student-balance-bar-fill {
    background: linear-gradient(90deg, rgba(var(--secondary-color-rgb,13,148,136), .95), rgba(var(--secondary-color-rgb,13,148,136), .55));
}

.apc-student-balance-item.is-mid .apc-student-balance-bar-fill {
    background: linear-gradient(90deg, rgba(156,163,175, .85), rgba(156,163,175, .55));
}

.apc-student-balance-item.is-high .apc-student-balance-bar-fill {
    background: linear-gradient(90deg, rgba(var(--primary-color-rgb,37,99,235), .95), rgba(var(--primary-color-rgb,37,99,235), .55));
}

.apc-student-balance-chip--session {
    border-color: rgba(var(--primary-color-rgb,37,99,235), .18);
    background: rgba(var(--primary-color-rgb,37,99,235), .06);
    color: var(--primary-color);
}

.apc-student-balance-chip--support {
    border-color: rgba(var(--secondary-color-rgb,13,148,136), .20);
    background: rgba(var(--secondary-color-rgb,13,148,136), .08);
    color: var(--secondary-color);
}

/* Code visuel simple */
/* Repère moyenne (optionnel) */
.apc-student-balance-avg {
    display: none;
}

/* Couleurs de barre supprimées volontairement (barres retirées) */

/* =========================
   APC SLOT: collapse button
========================= */
.apc-manager-slot-collapse-btn {
    border: 0;
    background: rgba(255,255,255,.12);
    color: #fff;
    width: 24px;
    height: 24px;
    border-radius: 9999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
}

    .apc-manager-slot-collapse-btn:hover {
        background: rgba(255,255,255,.20);
    }

.apc-support-cell-student {
    font-size: 0.7rem;
}

/* =========================
   APC SLOT: sessions bar
========================= */
.apc-slot-sessions-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.2rem;
    padding: 0.25rem 0.6rem;
    border-top: 1px solid rgba(0, 0, 0, 0.07);
    background: rgba(var(--primary-color-rgb, 37, 99, 235), 0.03);
}

.apc-slot-sessions-label {
    font-size: 0.67rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--primary-color);
    margin-right: 0.2rem;
    white-space: nowrap;
}

.apc-slot-session-chip {
    display: inline-flex;
    align-items: center;
    padding: 0.08rem 0.38rem;
    border-radius: 9999px;
    font-size: 0.68rem;
    font-weight: 600;
    background: rgba(var(--primary-color-rgb, 37, 99, 235), 0.08);
    color: var(--primary-color);
    border: 1px solid rgba(var(--primary-color-rgb, 37, 99, 235), 0.18);
    white-space: nowrap;
}

.apc-slot-session-chip.is-past {
    background: rgba(0, 0, 0, 0.04);
    color: #6b7280;
    border-color: #e5e7eb;
}

.apc-slot-session-chip.is-today {
    background: rgba(var(--secondary-color-rgb, 13, 148, 136), 0.12);
    color: var(--secondary-color);
    border-color: rgba(var(--secondary-color-rgb, 13, 148, 136), 0.30);
    font-weight: 800;
}

/* =========================
   APC SLOT: no students
========================= */
.apc-slot-no-students {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.6rem;
    border-top: 1px solid rgba(0, 0, 0, 0.07);
    color: #9ca3af;
    font-size: 0.78rem;
}

/* =========================
   APC SLOT: drop zone
========================= */
.apc-slot-drop-zone {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.28rem 0.6rem;
    border-top: 1px dashed rgba(var(--primary-color-rgb, 37, 99, 235), 0.22);
    background: rgba(var(--primary-color-rgb, 37, 99, 235), 0.02);
    color: rgba(var(--primary-color-rgb, 37, 99, 235), 0.50);
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 0 0 10px 10px;
    cursor: copy;
    transition: background 0.15s, color 0.15s;
}

.apc-slot-drop-zone:hover {
    background: rgba(var(--primary-color-rgb, 37, 99, 235), 0.06);
    color: var(--primary-color);
}
