:root {
    --gs-green: #6D1B3A;
    --gs-green-dark: #4A1228;
    --gs-green-light: #F4E3E9;
    --gs-blue: #2FA8E0;
    --gs-blue-dark: #1D7FB5;
    --gs-blue-light: #E8F6FC;
    --gs-sidebar-w: 300px;
}

body {
    background: #e9eaec;
    font-family: 'Segoe UI', Arial, sans-serif;
}

.topbar {
    background: var(--gs-green);
    height: 64px;
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 1030;
}
.topbar .brand {
    background: var(--gs-green-dark);
    color: #fff;
    font-weight: 700;
    height: 64px;
    width: var(--gs-sidebar-w);
    display: flex;
    align-items: center;
    padding-left: 24px;
    letter-spacing: .5px;
}
.avatar-circle {
    display: inline-block;
    width: 36px; height: 36px;
    border-radius: 50%;
    background: #cfd3d6;
}

.app-wrapper { display: flex; padding-top: 64px; min-height: 100vh; }

.sidebar {
    width: var(--gs-sidebar-w);
    background: #fff;
    border-right: 1px solid #e2e2e2;
    display: flex;
    flex-direction: column;
    transition: margin-left .2s ease, left .2s ease, transform .25s ease;
    position: fixed;
    top: 64px;
    left: 0;
    bottom: 0;
    z-index: 1020;
    overflow-y: auto;
}
.sidebar.sidebar-collapsed { left: calc(var(--gs-sidebar-w) * -1); }

.app-wrapper:has(.sidebar.sidebar-collapsed) .content { margin-left: 0; }

.sidebar .nav-link {
    color: var(--gs-green);
    font-weight: 500;
    padding: .85rem 1.5rem;
    display: flex;
    align-items: center;
    gap: .6rem;
    border-radius: 0;
}
.sidebar .nav-link i { font-size: 1.1rem; }
.sidebar .nav-link.active,
.sidebar .nav-link:hover {
    background: var(--gs-green);
    color: #fff;
}
.sidebar .sous-menu .nav-link {
    padding-left: 2.7rem;
    font-weight: 400;
    font-size: .95rem;
}
.btn-deconnexion {
    background: #e2e2e2;
    color: var(--gs-green);
    font-weight: 700;
    border: none;
    padding: .6rem;
}
.btn-deconnexion:hover { background: #d3d3d3; color: var(--gs-green-dark); }

.content { flex: 1; display: flex; flex-direction: column; min-width: 0; margin-left: var(--gs-sidebar-w); transition: margin-left .2s ease; padding-bottom: 48px; }

footer.text-muted {
    position: fixed;
    bottom: 0;
    left: var(--gs-sidebar-w);
    right: 0;
    background: #fff;
    border-top: 1px solid #e2e2e2;
    z-index: 1010;
    transition: left .2s ease;
}
.app-wrapper:has(.sidebar.sidebar-collapsed) footer.text-muted { left: 0; }

/* ===================================================================
   RESPONSIVE : tablette et mobile (< 992px)
   Le menu passe en "hors-champ" (masque par defaut, glisse par-dessus
   le contenu au lieu de le pousser), avec un voile de fond cliquable
   pour le refermer. Le meme bouton/la meme classe JS existants
   (#toggleSidebar / .sidebar-collapsed) pilotent ce comportement :
   sur mobile, .sidebar-collapsed signifie desormais "ouvert".
   =================================================================== */
@media (max-width: 991.98px) {
    :root { --gs-sidebar-w: 280px; }

    .topbar .brand { width: auto; padding-left: 14px; padding-right: 14px; font-size: 1rem; }

    .sidebar {
        left: 0;
        transform: translateX(-100%);
        box-shadow: 4px 0 24px rgba(0,0,0,.18);
    }
    .sidebar.sidebar-collapsed { left: 0; transform: translateX(0); }

    .content { margin-left: 0 !important; }
    footer.text-muted { left: 0 !important; }

    .sidebar-backdrop {
        display: none;
        position: fixed;
        inset: 64px 0 0 0;
        background: rgba(0,0,0,.4);
        z-index: 1015;
    }
    .sidebar-backdrop.show { display: block; }

    .page-card { padding: 16px; }
}

@media (max-width: 575.98px) {
    :root { --gs-sidebar-w: 86vw; }

    .topbar .brand { display: none; }
    .page-card { padding: 12px; }
    .selecteur-langue-label { display: none; }
}

/* ===================================================================
   RESPONSIVE : grands ecrans / televiseurs (>= 1600px)
   Un peu plus d'air et de lisibilite sans casser la mise en page.
   =================================================================== */
@media (min-width: 1600px) {
    :root { --gs-sidebar-w: 320px; }
    body { font-size: 1.05rem; }
    .page-card { padding: 32px 40px; }
}
@media (min-width: 2200px) {
    body { font-size: 1.15rem; }
    .page-card { padding: 40px 64px; }
}

/* ===================================================================
   RESPONSIVE : barre d'outils DataTables (recherche / longueur / pagination)
   Empile proprement au lieu de deborder sur petit ecran.
   =================================================================== */
@media (max-width: 767.98px) {
    .dataTables_wrapper .row:first-child,
    .dataTables_wrapper .row:last-child {
        flex-direction: column;
        gap: 10px;
        text-align: center !important;
    }
    .dataTables_wrapper .dataTables_filter,
    .dataTables_wrapper .dataTables_length {
        text-align: center !important;
    }
    .dataTables_wrapper .dataTables_filter input {
        width: 100%;
        margin-left: 0 !important;
        margin-top: 6px;
    }
    .dataTables_wrapper .dataTables_paginate {
        display: flex;
        justify-content: center;
        flex-wrap: wrap;
    }
}

/* Cibles tactiles plus confortables sur mobile/tablette (doigt vs curseur) */
@media (hover: none) and (pointer: coarse) {
    .btn-sm { min-height: 34px; padding-top: .35rem; padding-bottom: .35rem; }
    .table td .btn, .table td .btn-sm { margin: 2px; }
    .form-select, .form-control { min-height: 42px; }
}

/* ===================================================================
   Prechargeur (avant affichage de l'application)
   =================================================================== */
.gs-preloader {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(150deg, var(--gs-green-dark), var(--gs-green) 65%, var(--gs-blue-dark, #1D7FB5));
    transition: opacity .5s ease, visibility .5s ease;
}
.gs-preloader.gs-preloader-hide { opacity: 0; visibility: hidden; pointer-events: none; }
.gs-preloader-ring {
    position: relative;
    width: 92px;
    height: 92px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}
.gs-preloader-ring::before,
.gs-preloader-ring::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 4px solid transparent;
}
.gs-preloader-ring::before {
    border-top-color: #fff;
    border-right-color: #fff;
    animation: gsPreloaderSpin 1.1s cubic-bezier(.5,0,.5,1) infinite;
}
.gs-preloader-ring::after {
    inset: 11px;
    border-bottom-color: var(--gs-blue, #3FA9DC);
    border-left-color: var(--gs-blue, #3FA9DC);
    animation: gsPreloaderSpin 1.6s cubic-bezier(.5,0,.5,1) infinite reverse;
}
.gs-preloader-icon { position: relative; z-index: 2; color: #fff; font-size: 1.5rem; animation: gsPreloaderPulse 1.6s ease-in-out infinite; }
@keyframes gsPreloaderSpin { to { transform: rotate(360deg); } }
@keyframes gsPreloaderPulse { 0%,100% { transform: scale(1); opacity: 1; } 50% { transform: scale(.88); opacity: .75; } }

.page-card {
    background: #e9eaec;
    padding: 24px;
    flex: 1;
}

.card, .form-card, .table-card {
    background: #fff;
    border-radius: 6px;
    border: 1px solid #e2e2e2;
    padding: 20px;
}

.kpi-card {
    background: #fff;
    border-radius: 8px;
    border: 1px solid #e2e2e2;
    padding: 18px 20px;
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
    transition: transform .2s ease, box-shadow .2s ease;
    cursor: pointer;
}
.kpi-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 10px 22px rgba(0,0,0,.12);
}
.kpi-icon {
    width: 52px; height: 52px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.3rem;
    flex-shrink: 0;
}
.kpi-text {
    min-width: 0;
    flex: 1 1 auto;
}
.kpi-label {
    color: #6c757d;
    font-size: .88rem;
    line-height: 1.25;
    /* Jamais de troncature : un libelle un peu long passe a la ligne plutot
       que d'etre coupe (important pour les fondateurs qui doivent tout lire). */
    white-space: normal;
    overflow-wrap: break-word;
}
.kpi-value {
    font-size: 1.6rem;
    font-weight: 700;
    color: #212529;
    line-height: 1.25;
    overflow-wrap: break-word;
    /* Jamais de troncature : le nombre entier doit toujours etre visible. */
    white-space: normal;
}
.kpi-value-montant {
    /* Le montant (Caisse) est la donnee la plus critique de la page : il ne doit
       JAMAIS etre coupe, quelle que soit sa longueur ou la largeur de l'ecran.
       On reduit la police proportionnellement a la largeur disponible, et si
       malgre tout la place manque, le montant passe a la ligne (jamais coupe). */
    font-size: clamp(.92rem, 1.6vw + .55rem, 1.5rem);
    white-space: normal;
    overflow-wrap: break-word;
    word-break: break-word;
    line-height: 1.25;
}

/* ===== Barre d'onglets (Gestion des eleves, Paiements, Personnel...) =====
   Onglets compacts pour tenir sur UNE seule ligne (pas de retour a la ligne).
   Pas d'overflow-x/y ici (ca coupait le menu deroulant "Plus", qui doit
   flotter par-dessus le reste de la page). */
.nav-tabs-gs {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 6px;
    margin: 0 0 4px;
    list-style: none;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    padding-bottom: 6px;
}
.nav-tabs-gs::-webkit-scrollbar { height: 5px; }
.nav-tabs-gs::-webkit-scrollbar-thumb { background: #d8c6cc; border-radius: 3px; }

.nav-tabs-gs .nav-item { flex-shrink: 0; }

.nav-tabs-gs .nav-link {
    display: flex;
    align-items: center;
    gap: 7px;
    white-space: nowrap;
    background: #f6eef1;
    border: 1px solid #e8d8de;
    border-radius: 9px;
    padding: 9px 15px;
    color: #55535a;
    font-weight: 500;
    font-size: .86rem;
    line-height: 1.2;
    transition: background .15s ease, border-color .15s ease, color .15s ease;
}
.nav-tabs-gs .nav-link i {
    color: var(--gs-blue);
    font-size: 1rem;
    flex-shrink: 0;
}
.nav-tabs-gs .nav-link:hover {
    background: #efe1e6;
    color: var(--gs-green-dark);
    text-decoration: none;
}
.nav-tabs-gs .nav-link.active {
    background: var(--gs-green-light);
    color: var(--gs-green-dark);
    font-weight: 700;
    border-color: var(--gs-green);
}
.nav-tabs-gs .nav-link.active i {
    color: var(--gs-green);
}

/* "Plus" (menu deroulant) : style distinct, sans pastille, separe par un trait */
.nav-tabs-gs .nav-item.dropdown .nav-link {
    background: transparent;
    border: none;
    border-left: 1px solid #e2e2e2;
    border-radius: 0;
    color: var(--gs-green-dark);
    font-weight: 700;
    padding-left: 20px;
}
.nav-tabs-gs .nav-item.dropdown .nav-link:hover { background: transparent; color: var(--gs-green); }
.nav-tabs-gs .nav-item.dropdown .nav-link i:first-child { color: var(--gs-green-dark); }

table.dataTable thead th,
.table thead th,
table.table-bordered thead th,
.table-card table thead th,
.table-responsive table thead th {
    background: var(--gs-green) !important;
    color: #fff !important;
    border-color: var(--gs-green-dark) !important;
}

.btn-gs { background: var(--gs-green); color: #fff; border: none; }
.btn-gs:hover { background: var(--gs-green-dark); color: #fff; }
.btn-gs-outline { background: #fff; color: var(--gs-green); border: 1px solid var(--gs-green); }

.badge-inscrit { background: var(--gs-green); }

/* ===== Tableau de bord : bandeau institutionnel ===== */
.flag-strip {
    height: 6px;
    background: linear-gradient(to right, #CE1126 0 33.33%, #FCD116 33.33% 66.66%, #009460 66.66% 100%);
    border-radius: 6px 6px 0 0;
}
.dashboard-banner {
    background: linear-gradient(135deg, var(--gs-green-dark) 0%, var(--gs-green) 55%, #2A0A17 100%);
    border-radius: 0 0 10px 10px;
    color: #fff;
    padding: 22px 28px 20px;
    box-shadow: 0 8px 24px rgba(74, 18, 40, .25);
    position: relative;
    overflow: hidden;
}
.dashboard-banner .republique {
    font-weight: 800;
    letter-spacing: 1.5px;
    font-size: 1.55rem;
    text-align: center;
    text-transform: uppercase;
}
.dashboard-banner .devise {
    text-align: center;
    font-size: .85rem;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-top: 3px;
}
.dashboard-banner .devise .tiret {
    color: rgba(255,255,255,.55);
    font-weight: 400;
    letter-spacing: normal;
}
.dashboard-banner .devise .mot-rouge { color: #FF5C6C; }
.dashboard-banner .devise .mot-jaune { color: #FCD116; }
.dashboard-banner .devise .mot-vert  { color: #4CD787; }
.dashboard-banner .separateur {
    width: 70px;
    height: 3px;
    background: var(--gs-blue);
    margin: 12px auto 14px;
    border-radius: 3px;
}
.ecole-marquee-wrap {
    display: flex;
    align-items: center;
    gap: 16px;
    background: rgba(255,255,255,.10);
    border: 1px solid rgba(255,255,255,.18);
    border-radius: 10px;
    padding: 10px 18px;
    overflow: hidden;
}
.ecole-logo {
    width: 52px; height: 52px;
    border-radius: 50%;
    background: #fff;
    object-fit: contain;
    padding: 4px;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(0,0,0,.15);
}
.ecole-logo-placeholder {
    width: 52px; height: 52px;
    border-radius: 50%;
    background: rgba(255,255,255,.15);
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    font-weight: 800;
    font-size: 1.1rem;
}
.ecole-marquee {
    overflow: hidden;
    white-space: nowrap;
    flex: 1;
    mask-image: linear-gradient(to right, transparent 0, #000 24px, #000 calc(100% - 24px), transparent 100%);
}
.ecole-marquee-track {
    display: inline-block;
    white-space: nowrap;
    animation: marquee-scroll 18s linear infinite;
    font-size: 1.35rem;
    font-weight: 800;
}
.ecole-marquee-track span.sep {
    margin: 0 18px;
    color: var(--gs-blue);
}
.ecole-marquee:hover .ecole-marquee-track { animation-play-state: paused; }
@keyframes marquee-scroll {
    0%   { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}
.annee-badge {
    background: var(--gs-blue);
    color: #fff;
    font-weight: 800;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: .9rem;
    white-space: nowrap;
    flex-shrink: 0;
}
.chart-card {
    background: #fff;
    border-radius: 8px;
    border: 1px solid #e2e2e2;
    padding: 20px;
}

/* ===== Tableau de bord : en-tete de bandeau (horloge a gauche, titre centre) ===== */
.banner-header-grid {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 16px;
}
.banner-title-center {
    text-align: center;
}
.republique-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
}
.republique-text {
    text-align: center;
}
.armoiries-icon {
    height: 58px;
    width: auto;
    flex-shrink: 0;
    filter: drop-shadow(0 3px 6px rgba(0,0,0,.35));
}
.banner-left-group {
    display: flex;
    align-items: center;
    gap: 14px;
    justify-self: start;
    flex-wrap: wrap;
}
.banner-clock-box {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: rgba(255,255,255,.10);
    border: 1px solid rgba(255,255,255,.20);
    border-radius: 10px;
    padding: 7px 16px;
}
.banner-clock-box .clock-icon {
    font-size: 1.35rem;
    color: var(--gs-blue);
    opacity: .95;
}
.banner-clock-box .date-col {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}
.banner-clock-box .heure {
    font-size: 1.4rem;
    font-weight: 800;
    letter-spacing: .5px;
    font-variant-numeric: tabular-nums;
    font-family: 'Consolas', 'Courier New', monospace;
}
.banner-clock-box .jour {
    font-size: .68rem;
    font-weight: 600;
    letter-spacing: .5px;
    text-transform: uppercase;
    color: rgba(255,255,255,.75);
}
@media (max-width: 767px) {
    .banner-header-grid {
        grid-template-columns: 1fr;
        justify-items: center;
        text-align: center;
    }
    .banner-left-group { justify-self: center; justify-content: center; }
}
@media (max-width: 420px) {
    .dashboard-banner .republique { font-size: 1.15rem; }
    .dashboard-banner .devise { font-size: .78rem; }
    .armoiries-icon { height: 44px; }
    .banner-clock-box .heure { font-size: 1.15rem; }
}

/* ===== Tableau de bord : selecteur d'annee scolaire ===== */
.annee-selector-bar {
    background: #fff;
    border: 1px solid #e2e2e2;
    border-radius: 10px;
    padding: 12px 18px;
    display: flex;
    align-items: center;
}
.annee-selector-label {
    font-weight: 700;
    color: var(--gs-green);
    margin: 0;
    font-size: .92rem;
    display: flex;
    align-items: center;
    gap: 6px;
}
.annee-selector-select {
    border: 1px solid var(--gs-green);
    color: var(--gs-green-dark);
    font-weight: 700;
    border-radius: 20px;
    padding: 6px 16px;
    background: var(--gs-green-light);
    cursor: pointer;
}
.annee-selector-select:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(109, 27, 58, .15);
}

/* ===== Tableau de bord : bandeaux contextuels (annee passee / a venir) ===== */
.alert-annee {
    display: flex;
    align-items: center;
    gap: 14px;
    border-radius: 10px;
    padding: 14px 18px;
    margin-bottom: 20px;
}
.alert-annee-future {
    background: #FFF7E0;
    border: 1px solid #F3D98B;
    color: #8A6D1D;
}
.alert-annee-past {
    background: #EAF3FB;
    border: 1px solid #B9D8F0;
    color: #2C5C82;
}

/* ===== Tableau de bord : etat vide (annee a venir) ===== */
.empty-state-card {
    background: #fff;
    border: 1px dashed #cfcfcf;
    border-radius: 10px;
    padding: 56px 24px;
    color: #8a8a8a;
}
.empty-state-card i { color: #c9c9c9; }

/* ===== Mode sombre ===== */
[data-theme="dark"] {
    --dm-bg: #14161a;
    --dm-surface: #1e2126;
    --dm-surface-alt: #262a31;
    --dm-border: #33383f;
    --dm-text: #e7e9ec;
    --dm-text-muted: #9aa0a8;
}
[data-theme="dark"] body { background: var(--dm-bg); color: var(--dm-text); }
[data-theme="dark"] .page-card { background: var(--dm-bg); }
[data-theme="dark"] .sidebar {
    background: var(--dm-surface);
    border-right-color: var(--dm-border);
}
[data-theme="dark"] .sidebar .nav-link { color: #d7c6cc; }
[data-theme="dark"] .sidebar .nav-link.active,
[data-theme="dark"] .sidebar .nav-link:hover {
    background: var(--gs-green);
    color: #fff;
}
[data-theme="dark"] .btn-deconnexion { background: var(--dm-surface-alt); color: #d7c6cc; }
[data-theme="dark"] .card,
[data-theme="dark"] .form-card,
[data-theme="dark"] .table-card,
[data-theme="dark"] .kpi-card,
[data-theme="dark"] .chart-card,
[data-theme="dark"] .annee-selector-bar {
    background: var(--dm-surface);
    border-color: var(--dm-border);
    color: var(--dm-text);
}
[data-theme="dark"] .kpi-label { color: var(--dm-text-muted); }
[data-theme="dark"] .kpi-value { color: var(--dm-text); }
[data-theme="dark"] .table { color: var(--dm-text); }
[data-theme="dark"] .table > :not(caption) > * > * {
    background: var(--dm-surface);
    color: var(--dm-text);
    border-color: var(--dm-border);
}
[data-theme="dark"] .table-hover > tbody > tr:hover > * {
    background: var(--dm-surface-alt);
}
[data-theme="dark"] .form-control,
[data-theme="dark"] .form-select {
    background: var(--dm-surface-alt);
    border-color: var(--dm-border);
    color: var(--dm-text);
}
[data-theme="dark"] .form-control:focus,
[data-theme="dark"] .form-select:focus {
    background: var(--dm-surface-alt);
    color: var(--dm-text);
}
[data-theme="dark"] .form-label { color: var(--dm-text-muted); }
[data-theme="dark"] .modal-content {
    background: var(--dm-surface);
    color: var(--dm-text);
}
[data-theme="dark"] .nav-tabs-gs .nav-link { background: var(--dm-surface-alt); color: var(--dm-text-muted); border-color: var(--dm-border); }
[data-theme="dark"] .nav-tabs-gs .nav-link.active {
    background: rgba(109,27,58,.35);
    color: #fff;
    border-color: var(--gs-green);
}
[data-theme="dark"] .nav-tabs-gs .nav-item.dropdown .nav-link { background: transparent; border-left-color: var(--dm-border); }
[data-theme="dark"] .empty-state-card { background: var(--dm-surface); border-color: var(--dm-border); color: var(--dm-text-muted); }
[data-theme="dark"] footer.text-muted { color: var(--dm-text-muted) !important; }
[data-theme="dark"] .alert-annee-past { background: #16273a; border-color: #2b4a6b; color: #bcdcff; }
[data-theme="dark"] .alert-annee-future { background: #3a301a; border-color: #6b5a2b; color: #ffe9b0; }

/* ===== Gestion du personnel : classes compactes + colonnes montant ===== */
.classes-badge {
    font-size: .78rem;
    font-weight: 600;
    padding: 4px 9px;
    cursor: help;
    white-space: nowrap;
}
.montant-col {
    white-space: nowrap;
    font-weight: 700;
    font-size: 1.02rem;
    min-width: 130px;
    color: #2c2c2c;
}
.montant-col.text-total {
    color: var(--gs-green-dark);
    font-size: 1.08rem;
}
.alerte-solde {
    font-size: .82rem;
    border-radius: 6px;
    padding: 6px 10px;
    margin-top: 6px;
    display: none;
}
.alerte-solde.show-warning {
    display: block;
    background: #FFF3CD;
    color: #856404;
    border: 1px solid #FFE69C;
}

/* ===== Gestion des eleves : couleur du nom selon le genre ===== */
.genre-fille {
    color: #C0392B;
    font-weight: 600;
}
.genre-garcon {
    color: #000;
    font-weight: 600;
}

/* ===== Impression depuis l'application (Rapports, Fiches de rappel...) =====
   L'entete avec logo est cachee a l'ecran, et n'apparait qu'a l'impression,
   qui masque aussi le menu/barre laterale/boutons pour un rendu document propre. */
.print-entete-app { display: none; }

@media print {
    .topbar, .sidebar, footer, .btn, .nav-tabs-gs, .no-print,
    .d-flex.justify-content-end, .annee-selector-bar, .alert { display: none !important; }
    .content { margin: 0 !important; }
    .page-card { padding: 0 !important; background: #fff !important; }
    .print-entete-app { display: block !important; margin-bottom: 20px; }
    .print-entete-app .entete-impression {
        display: flex; align-items: center; gap: 18px;
        background: #6D1B3A !important; color: #fff !important;
        padding: 16px 24px; border-radius: 8px;
        -webkit-print-color-adjust: exact; print-color-adjust: exact;
    }
    .print-entete-app .entete-logo {
        width: 60px; height: 60px; border-radius: 50%;
        background: #fff; object-fit: contain; padding: 4px; flex-shrink: 0;
    }
    .print-entete-app .entete-texte h4 { margin: 0; font-weight: 800; color: #fff !important; }
    .print-entete-app .entete-coordonnees,
    .print-entete-app .entete-titre-document { color: #fff !important; opacity: .9; margin: 2px 0 0; font-size: .8rem; }
    table.dataTable thead th { background: #6D1B3A !important; color: #fff !important; }
}

/* ===== Bouton "Modification remise" (Gestion des eleves) ===== */
.btn-remise {
    background: var(--gs-blue);
    color: #fff;
    border: none;
}
.btn-remise:hover {
    background: var(--gs-blue-dark);
    color: #fff;
}

/* =====================================================================
   Tableaux avec defilement horizontal propre (barre juste sous le tableau,
   texte des en-tetes/cellules jamais coupe sur 2 lignes).
   ===================================================================== */
.table-responsive {
    overflow-x: auto;
    overflow-y: hidden;
    border-radius: 6px;
}
.table-responsive table {
    margin-bottom: 0;
    font-size: .84rem;
    border-collapse: collapse;
}
.table-responsive table th,
.table-responsive table td {
    white-space: nowrap;
    border: 1px solid #dcdfe3 !important;
}
.table-responsive table thead th {
    border-color: var(--gs-green-dark) !important;
}

/* Barre de defilement personnalisee (Chrome / Edge / Safari) */
.table-responsive::-webkit-scrollbar {
    height: 10px;
}
.table-responsive::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}
.table-responsive::-webkit-scrollbar-thumb {
    background: var(--gs-green);
    border-radius: 10px;
}
.table-responsive::-webkit-scrollbar-thumb:hover {
    background: var(--gs-green-dark);
}

/* Firefox */
.table-responsive {
    scrollbar-width: thin;
    scrollbar-color: var(--gs-green) #f1f1f1;
}

/* ===== Fiche eleve (page detail) ===== */
.fiche-champ {
    background: #f8f9fa;
    border-radius: 6px;
    padding: 10px 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: .92rem;
}
.fiche-champ i {
    color: var(--gs-green);
    font-size: 1.1rem;
    flex-shrink: 0;
}
.fiche-champ strong {
    color: #555;
    font-weight: 700;
    min-width: 170px;
}
.fiche-champ span {
    margin-left: auto;
    text-align: right;
    color: #222;
}
.avatar-initiales {
    width: 110px;
    height: 110px;
    border-radius: 12px;
    background: #f1f1f1;
    border: 1px solid #e2e2e2;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--gs-green-dark);
}
.visuel-check {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 1rem;
}
.visuel-check.visuel-ok {
    background: var(--gs-green);
    color: #fff;
}
.visuel-check.visuel-attente {
    background: #f1f1f1;
    color: #999;
    border: 1px solid #ddd;
}

/* ===== Formulaire de transfert d'eleve ===== */
.transfert-info-box {
    background: var(--gs-green-light);
    border: 1px solid var(--gs-green);
    border-radius: 8px;
    padding: 16px 20px;
}
.transfert-info-box strong { color: var(--gs-green-dark); }
.transfert-alerte-box {
    background: #FFF3CD;
    border: 1px solid #FFE69C;
    color: #856404;
    border-radius: 8px;
    padding: 14px 20px;
}
.transfert-mois-box {
    background: var(--gs-green-light);
    border: 1px solid var(--gs-green);
    border-radius: 8px;
    padding: 12px 16px;
    color: #333;
}

/* ===== Paiements groupes : mini-cartes eleves dans la colonne "Eleves" ===== */
.table-responsive table td.cell-wrap {
    white-space: normal !important;
}
.eleve-groupe-ligne {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 0;
    white-space: normal;
}
.eleve-groupe-ligne + .eleve-groupe-ligne {
    border-top: 1px solid #eee;
}
.eleve-groupe-photo {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}
.eleve-groupe-photo-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f1f1f1;
    color: #aaa;
    font-size: 1.1rem;
}

/* ===== Miniature photo eleve dans les tableaux ===== */
.photo-miniature {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
}
.photo-miniature-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f1f1f1;
    color: #aaa;
    font-size: 1rem;
}

/* ===== Liste des eleves avec photos : grille de cartes ===== */
.grille-eleves-photos {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 18px;
}
.carte-eleve-photo {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 1px 8px rgba(0,0,0,.06);
    padding: 18px;
    text-align: center;
    position: relative;
    transition: transform .2s ease, box-shadow .2s ease;
    cursor: pointer;
}
.carte-eleve-photo:hover {
    transform: translateY(-6px);
    box-shadow: 0 10px 22px rgba(0,0,0,.12);
}
.badge-matricule {
    position: absolute;
    top: 12px;
    right: 12px;
    background: #f4f6f9;
    border: 1px solid #e6e9ee;
    border-radius: 20px;
    padding: 3px 10px;
    font-size: .68rem;
    font-weight: 700;
    color: #555;
}
.avatar-eleve-photo {
    width: 84px;
    height: 84px;
    border-radius: 50%;
    object-fit: cover;
    margin: 18px auto 12px;
    display: block;
}
.avatar-eleve-placeholder {
    background: #E3EDFA;
    color: #1D5DA6;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.2rem;
}
.nom-eleve-photo {
    font-weight: 800;
    font-size: .92rem;
    color: #1a2340;
    margin-bottom: 4px;
}
.classe-eleve-photo {
    color: #E8871E;
    font-size: .78rem;
    font-weight: 600;
    margin-bottom: 12px;
}
.badge-statut-actif {
    display: inline-block;
    background: #E6F6EC;
    color: #1A8A4A;
    font-size: .72rem;
    font-weight: 700;
    padding: 4px 14px;
    border-radius: 20px;
}
.separateur-carte {
    border-top: 1px solid #eee;
    margin: 16px 0 14px;
}
.ligne-telephone {
    display: flex;
    align-items: center;
    gap: 10px;
    text-align: left;
}
.icone-telephone {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #1A8A4A;
    color: #fff;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .85rem;
}
.libelle-telephone {
    font-size: .62rem;
    color: #999;
    letter-spacing: .5px;
    font-weight: 700;
}
.valeur-telephone {
    font-size: .85rem;
    font-weight: 800;
    color: #222;
}

/* ===== Colonne "Net a payer" plus large pour ne jamais couper un montant ===== */
.col-net-a-payer {
    min-width: 130px;
}
