/*
 * SIGE — Charte visuelle Groupe Scolaire Nanan Yeboua
 * Couleurs : Vert + Orange (logo officiel)
 */

:root {
    --sige-blue:        #2E8B57;   /* vert profond — titres, boutons primaires */
    --sige-blue-light:  #3CB371;   /* vert moyen — bandes, accents */
    --sige-blue-pale:   #E8F5E9;   /* vert très clair — fonds */
    --sige-orange:      #F4A460;   /* orange — accents secondaires */
    --sige-orange-pale: #FFF3E0;   /* orange clair — fonds doux */
    --sige-cream:       #FAFFF5;   /* crème vert — page background */
    --sige-ink:         #1F2937;   /* texte principal */
    --sige-ink-soft:    #6B7280;   /* texte secondaire */

    --sige-gradient: linear-gradient(135deg, var(--sige-blue) 0%, var(--sige-blue-light) 100%);
    --sige-gradient-warm: linear-gradient(135deg, var(--sige-orange) 0%, #FFB89A 100%);
}

/* Body et tons de fond */
body.sige-app {
    background: linear-gradient(180deg, var(--sige-cream) 0%, #ffffff 200px);
    color: var(--sige-ink);
}

/* Logo officiel — Groupe Scolaire Nanan Yeboua */
.sige-logo {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: white;
    background-image: url('img/logo-gsny.png');
    background-size: 90% 90%;
    background-position: center;
    background-repeat: no-repeat;
    box-shadow: 0 4px 14px rgba(46, 139, 87, 0.25);
    border: 3px solid white;
    display: inline-block;
    vertical-align: middle;
}
.sige-logo.sm { width: 44px; height: 44px; border-width: 2px; }
.sige-logo.lg { width: 104px; height: 104px; border-width: 4px; }

/* Bandes décoratives "carnet" */
.sige-band {
    background: var(--sige-gradient);
    color: white;
}
.sige-band-orange {
    background: var(--sige-gradient-warm);
    color: white;
}

/* Boutons brandés */
.sige-btn-primary {
    background: var(--sige-blue);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    font-weight: 600;
    font-size: 0.875rem;
    transition: all 0.2s;
    box-shadow: 0 2px 6px rgba(46, 139, 87, 0.2);
}
.sige-btn-primary:hover {
    background: #256F46;
    box-shadow: 0 4px 12px rgba(46, 139, 87, 0.35);
    transform: translateY(-1px);
}

.sige-btn-orange {
    background: var(--sige-orange);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    font-weight: 600;
    font-size: 0.875rem;
}
.sige-btn-orange:hover { background: #e89272; }

/* Cards "carnet" : coin arrondi + bordure orange clair */
.sige-card {
    background: white;
    border-radius: 0.75rem;
    border: 1px solid #f1e7df;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
    overflow: hidden;
}
.sige-card-header {
    background: var(--sige-blue-pale);
    border-bottom: 1px solid #C8E6C9;
    padding: 0.875rem 1.25rem;
    font-weight: 600;
    color: var(--sige-blue);
    font-size: 0.875rem;
}

/* Étiquettes de champs façon carnet (cadre orange clair) */
.sige-field-label {
    display: inline-block;
    background: var(--sige-orange-pale);
    border-left: 3px solid var(--sige-orange);
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: #7c4326;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* Titres de section "carnet" : numéro dans cercle + libellé bleu */
.sige-section-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 1.25rem 0 0.75rem;
}
.sige-section-title .num {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--sige-blue);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.875rem;
    box-shadow: 0 2px 4px rgba(46, 139, 87, 0.3);
}
.sige-section-title .lib {
    background: var(--sige-blue-pale);
    color: var(--sige-blue);
    padding: 0.375rem 1rem;
    border-radius: 0.5rem;
    font-weight: 700;
    font-size: 0.95rem;
    flex: 1;
}

/* Tableau de notes style "carnet" */
table.sige-grid {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}
table.sige-grid th {
    background: var(--sige-blue-pale);
    color: var(--sige-blue);
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.7rem;
    letter-spacing: 0.05em;
    padding: 0.625rem 0.75rem;
    border: 1px solid #C8E6C9;
    text-align: left;
}
table.sige-grid td {
    padding: 0.5rem 0.75rem;
    border: 1px solid #e5e7eb;
}
table.sige-grid tbody tr:nth-child(odd) {
    background: #fbfcfd;
}
table.sige-grid tbody tr:hover {
    background: var(--sige-blue-pale);
}

/* Badges de mention */
.sige-mention {
    display: inline-block;
    padding: 0.125rem 0.5rem;
    border-radius: 9999px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.sige-mention.tb { background: #d1fae5; color: #065f46; }
.sige-mention.b  { background: #dbeafe; color: #1e40af; }
.sige-mention.ab { background: #fef3c7; color: #92400e; }
.sige-mention.p  { background: #fed7aa; color: #9a3412; }
.sige-mention.i  { background: #fee2e2; color: #991b1b; }

/* Animation subtile au focus pour différencier des concurrents */
input:focus, select:focus, textarea:focus {
    outline: 2px solid var(--sige-blue-light) !important;
    outline-offset: 1px !important;
}

/* En-tête sticky avec ombre douce */
.sige-topbar {
    background: white;
    border-bottom: 3px solid var(--sige-blue-light);
    box-shadow: 0 2px 8px rgba(46, 139, 87, 0.06);
}

/* ============================================================
   SYSTÈME DE FORMULAIRES PROFESSIONNELS
   ============================================================ */

/* Formulaire = conteneur global */
.sige-form {
    max-width: 1100px;
    margin: 0 auto;
}

/* Résumé d'erreurs en tête de formulaire */
.sige-form-errors {
    background: linear-gradient(135deg, #fef2f2 0%, #fff 100%);
    border: 1px solid #fecaca;
    border-left: 4px solid #dc2626;
    border-radius: 0.75rem;
    padding: 1rem 1.25rem;
    margin-bottom: 1.25rem;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}
.sige-form-errors .icon {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #dc2626;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1rem;
}
.sige-form-errors h4 {
    font-size: 0.875rem;
    font-weight: 700;
    color: #991b1b;
    margin: 0 0 0.375rem;
}
.sige-form-errors ul {
    font-size: 0.8rem;
    color: #b91c1c;
    margin: 0;
    padding-left: 1rem;
    list-style-type: disc;
}

/* Section = groupe de champs avec header numéroté */
.sige-section {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 0.875rem;
    margin-bottom: 1.25rem;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.03);
    transition: box-shadow 0.2s, border-color 0.2s;
}
.sige-section:hover {
    box-shadow: 0 4px 12px rgba(46, 139, 87, 0.08);
    border-color: #C8E6C9;
}

/* Header de section : rond numéroté + titre + sous-titre */
.sige-section-header {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    padding: 1rem 1.25rem;
    background: linear-gradient(135deg, var(--sige-blue-pale) 0%, #ffffff 100%);
    border-bottom: 1px solid #e5e7eb;
}
.sige-section-header .num {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--sige-gradient);
    color: white;
    font-weight: 800;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 3px 8px rgba(46, 139, 87, 0.3);
    border: 2px solid white;
}
.sige-section-header .titre {
    flex: 1;
    min-width: 0;
}
.sige-section-header .titre h3 {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--sige-blue);
    margin: 0;
    line-height: 1.3;
}
.sige-section-header .titre p {
    font-size: 0.75rem;
    color: var(--sige-ink-soft);
    margin: 0.125rem 0 0;
}
.sige-section-header .icon {
    font-size: 1.5rem;
    opacity: 0.4;
}
.sige-section-body {
    padding: 1.25rem;
}

/* Variante "orange" pour sections secondaires */
.sige-section.warm .sige-section-header {
    background: linear-gradient(135deg, var(--sige-orange-pale) 0%, #fffaf5 100%);
}
.sige-section.warm .sige-section-header .num {
    background: var(--sige-gradient-warm);
    box-shadow: 0 3px 8px rgba(244, 169, 138, 0.35);
}
.sige-section.warm .sige-section-header .titre h3 {
    color: #7c4326;
}

/* Grille responsive 1/2/3/4 colonnes */
.sige-form-grid {
    display: grid;
    grid-template-columns: repeat(1, minmax(0, 1fr));
    gap: 1rem;
}
@media (min-width: 640px) {
    .sige-form-grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .sige-form-grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .sige-form-grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
.sige-form-grid .col-span-2 { grid-column: span 2 / span 2; }
.sige-form-grid .col-span-full { grid-column: 1 / -1; }

/* Un groupe = label + input + help text */
.sige-field {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}
.sige-field label {
    font-size: 0.75rem;
    font-weight: 600;
    color: #374151;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}
.sige-field label .req {
    color: #dc2626;
    font-weight: 800;
}
.sige-field label .opt {
    font-size: 0.65rem;
    font-weight: 500;
    text-transform: none;
    color: #9ca3af;
    margin-left: 0.25rem;
}
.sige-field .help {
    font-size: 0.7rem;
    color: var(--sige-ink-soft);
    line-height: 1.4;
}
.sige-field.error input,
.sige-field.error select,
.sige-field.error textarea {
    border-color: #dc2626 !important;
    background: #fef2f2;
}
.sige-field.error .err {
    font-size: 0.7rem;
    color: #dc2626;
    font-weight: 600;
}

/* Inputs, selects, textareas uniformisés */
.sige-form input[type="text"],
.sige-form input[type="email"],
.sige-form input[type="password"],
.sige-form input[type="tel"],
.sige-form input[type="number"],
.sige-form input[type="date"],
.sige-form input[type="search"],
.sige-form input[type="url"],
.sige-form select,
.sige-form textarea {
    width: 100%;
    padding: 0.625rem 0.875rem;
    font-size: 0.875rem;
    font-family: inherit;
    color: var(--sige-ink);
    background: white;
    border: 1.5px solid #e5e7eb;
    border-radius: 0.5rem;
    transition: all 0.15s ease;
    box-shadow: 0 1px 2px rgba(0,0,0,0.02);
}
.sige-form input:hover:not(:disabled),
.sige-form select:hover:not(:disabled),
.sige-form textarea:hover:not(:disabled) {
    border-color: #cbd5e1;
}
.sige-form input:focus,
.sige-form select:focus,
.sige-form textarea:focus {
    border-color: var(--sige-blue) !important;
    outline: none !important;
    box-shadow: 0 0 0 3px rgba(91, 168, 214, 0.2) !important;
}
.sige-form input:disabled,
.sige-form select:disabled {
    background: #f9fafb;
    color: #9ca3af;
    cursor: not-allowed;
}
.sige-form textarea {
    resize: vertical;
    min-height: 80px;
}
.sige-form input[type="file"] {
    padding: 0.375rem;
    background: #f9fafb;
    cursor: pointer;
}
.sige-form input[type="file"]::file-selector-button {
    margin-right: 0.75rem;
    padding: 0.5rem 1rem;
    background: var(--sige-blue);
    color: white;
    border: 0;
    border-radius: 0.375rem;
    font-weight: 600;
    font-size: 0.75rem;
    cursor: pointer;
    transition: background 0.15s;
}
.sige-form input[type="file"]::file-selector-button:hover {
    background: #256F46;
}

/* Checkbox / radio stylisés */
.sige-check {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: #f9fafb;
    border: 1.5px solid #e5e7eb;
    border-radius: 0.5rem;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.15s;
}
.sige-check:hover {
    border-color: var(--sige-blue-light);
    background: var(--sige-blue-pale);
}
.sige-check input[type="checkbox"],
.sige-check input[type="radio"] {
    width: 16px;
    height: 16px;
    accent-color: var(--sige-blue);
}

/* Pavé photo / upload circulaire */
.sige-photo-upload {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    padding: 1rem;
    background: linear-gradient(135deg, var(--sige-blue-pale) 0%, #ffffff 100%);
    border: 1.5px dashed var(--sige-blue-light);
    border-radius: 0.75rem;
}
.sige-photo-upload .photo-ring {
    flex-shrink: 0;
    width: 96px;
    height: 96px;
    border-radius: 50%;
    overflow: hidden;
    border: 4px solid white;
    box-shadow: 0 0 0 3px var(--sige-blue), 0 4px 12px rgba(46, 139, 87, 0.2);
    background: #f3f4f6;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: #cbd5e1;
}
.sige-photo-upload .photo-ring img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.sige-photo-upload .upload-info {
    flex: 1;
    min-width: 0;
}

/* Barre d'actions sticky en bas du formulaire */
.sige-form-actions {
    position: sticky;
    bottom: 0;
    background: white;
    border-top: 1px solid #e5e7eb;
    padding: 1.125rem 1.25rem;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    border-radius: 0 0 0.875rem 0.875rem;
    margin-top: 1.25rem;
    box-shadow: 0 -4px 12px rgba(0,0,0,0.04);
    z-index: 10;
}
/* Helper "* champs obligatoires" : prend toute la largeur, passe au-dessus, centré */
.sige-form-actions .helper {
    flex-basis: 100%;
    text-align: center;
    font-size: 0.75rem;
    color: var(--sige-ink-soft);
    order: -1;
    margin-bottom: 0.25rem;
}
.sige-form-actions .btn-cancel,
.sige-form-actions .btn-submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.sige-form-actions .btn-cancel {
    padding: 0.5rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: #6b7280;
    background: white;
    border: 1.5px solid #e5e7eb;
    border-radius: 0.5rem;
    transition: all 0.15s;
}
.sige-form-actions .btn-cancel:hover {
    border-color: #cbd5e1;
    color: #374151;
    background: #f9fafb;
}
.sige-form-actions .btn-submit {
    padding: 0.5rem 1.5rem;
    font-size: 0.875rem;
    font-weight: 700;
    color: white;
    background: var(--sige-gradient);
    border: 0;
    border-radius: 0.5rem;
    cursor: pointer;
    box-shadow: 0 3px 10px rgba(46, 139, 87, 0.3);
    transition: all 0.15s;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}
.sige-form-actions .btn-submit:hover {
    transform: translateY(-1px);
    box-shadow: 0 5px 16px rgba(46, 139, 87, 0.4);
}
.sige-form-actions .btn-submit:active {
    transform: translateY(0);
}

/* Séparateur de section "ou" */
.sige-divider {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 1rem 0;
    color: #9ca3af;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}
.sige-divider::before, .sige-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #e5e7eb;
}

/* Badge informatif dans formulaire */
.sige-hint {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 0.625rem 0.875rem;
    background: var(--sige-blue-pale);
    border: 1px solid #C8E6C9;
    border-radius: 0.5rem;
    font-size: 0.75rem;
    color: #1e40af;
    line-height: 1.5;
}
.sige-hint .hint-icon {
    font-size: 0.9rem;
    flex-shrink: 0;
}
.sige-hint.warm {
    background: var(--sige-orange-pale);
    border-color: #fcd9c5;
    color: #7c4326;
}
.sige-hint.success {
    background: #d1fae5;
    border-color: #a7f3d0;
    color: #065f46;
}

/* ============================================================
   SELECT2 — Override pour matcher la charte SIGE
   ============================================================ */

/* Container Select2 — on ne force PAS la largeur ici (laisser le JS la setter
   inline au moment de l'init pour ne pas affecter le dropdown). */
.select2-container {
    font-family: inherit;
    box-sizing: border-box;
    max-width: 100%;
}

/* La "fausse input" qui remplace le select natif */
.select2-container--default .select2-selection--single {
    height: auto !important;
    min-height: 42px;
    padding: 0.625rem 0.875rem !important;
    font-size: 0.875rem !important;
    background: white !important;
    border: 1.5px solid #e5e7eb !important;
    border-radius: 0.5rem !important;
    transition: all 0.15s ease;
    box-shadow: 0 1px 2px rgba(0,0,0,0.02);
    display: flex;
    align-items: center;
}
.select2-container--default .select2-selection--single:hover {
    border-color: #cbd5e1 !important;
}

/* Texte affiché dans la fausse input */
.select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: 1.4 !important;
    color: var(--sige-ink) !important;
    padding: 0 !important;
    flex: 1;
}
.select2-container--default .select2-selection--single .select2-selection__placeholder {
    color: #9ca3af !important;
}

/* Flèche déroulante repositionnée */
.select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 100% !important;
    top: 0 !important;
    right: 8px !important;
    width: 24px !important;
}
.select2-container--default .select2-selection--single .select2-selection__arrow b {
    border-color: var(--sige-blue) transparent transparent transparent !important;
    border-width: 6px 5px 0 5px !important;
    margin-left: -5px !important;
    margin-top: -2px !important;
}

/* Quand le select est ouvert : flèche vers le haut + halo bleu */
.select2-container--default.select2-container--open .select2-selection--single {
    border-color: var(--sige-blue) !important;
    box-shadow: 0 0 0 3px rgba(91, 168, 214, 0.2) !important;
}
.select2-container--default.select2-container--open .select2-selection--single .select2-selection__arrow b {
    border-color: transparent transparent var(--sige-blue) transparent !important;
    border-width: 0 5px 6px 5px !important;
}

/* Quand le select est focused via clavier */
.select2-container--default.select2-container--focus .select2-selection--single,
.select2-container--default .select2-selection--single:focus {
    border-color: var(--sige-blue) !important;
    box-shadow: 0 0 0 3px rgba(91, 168, 214, 0.2) !important;
    outline: none !important;
}

/* Le menu déroulant qui s'ouvre */
.select2-container--default .select2-dropdown {
    border: 1.5px solid var(--sige-blue) !important;
    border-radius: 0.5rem !important;
    box-shadow: 0 8px 24px rgba(46, 139, 87, 0.15) !important;
    overflow: hidden;
    margin-top: 4px;
}
.select2-container--default .select2-dropdown--above {
    margin-top: -4px;
    margin-bottom: 4px;
}

/* Champ de recherche dans le dropdown */
.select2-container--default .select2-search--dropdown {
    padding: 8px;
    background: var(--sige-blue-pale);
    border-bottom: 1px solid #C8E6C9;
}
.select2-container--default .select2-search--dropdown .select2-search__field {
    padding: 0.5rem 0.75rem !important;
    font-size: 0.85rem !important;
    border: 1.5px solid #C8E6C9 !important;
    border-radius: 0.375rem !important;
    background: white;
    width: 100%;
    transition: all 0.15s;
}
.select2-container--default .select2-search--dropdown .select2-search__field:focus {
    border-color: var(--sige-blue) !important;
    outline: none !important;
    box-shadow: 0 0 0 2px rgba(91, 168, 214, 0.2) !important;
}

/* Résultats : chaque option du dropdown */
.select2-container--default .select2-results__option {
    padding: 0.625rem 0.875rem !important;
    font-size: 0.85rem !important;
    color: var(--sige-ink) !important;
    border-bottom: 1px solid #f3f4f6;
    transition: background 0.1s;
}
.select2-container--default .select2-results__option:last-child {
    border-bottom: none;
}

/* Option survolée / sélectionnée au clavier */
.select2-container--default .select2-results__option--highlighted[aria-selected],
.select2-container--default .select2-results__option--highlighted {
    background: var(--sige-blue) !important;
    color: white !important;
}

/* Option déjà choisie (affichée avec un fond doux) */
.select2-container--default .select2-results__option[aria-selected="true"] {
    background: var(--sige-blue-pale) !important;
    color: var(--sige-blue) !important;
    font-weight: 600;
}
.select2-container--default .select2-results__option[aria-selected="true"].select2-results__option--highlighted {
    background: var(--sige-blue) !important;
    color: white !important;
}

/* Message "aucun résultat" */
.select2-container--default .select2-results__option--no-results {
    color: #9ca3af !important;
    font-style: italic;
    padding: 1rem !important;
    text-align: center;
    background: #f9fafb;
}

/* Disabled */
.select2-container--default.select2-container--disabled .select2-selection--single {
    background: #f9fafb !important;
    color: #9ca3af !important;
    cursor: not-allowed;
}

/* Variante "small" pour les selectores compacts (filtre période en haut de grille notes) */
.select2-container--default.select2-sm .select2-selection--single {
    min-height: 34px;
    padding: 0.375rem 0.625rem !important;
    font-size: 0.8rem !important;
}

/* IMPORTANT — Override final pour le dropdown :
   Select2 calcule lui-même la position et la largeur du dropdown via JS.
   On contraint juste pour qu'il ne déborde JAMAIS du viewport. */
.select2-container--open .select2-dropdown {
    max-width: calc(100vw - 24px);
    /* Empêche le dropdown de partir hors-écran à droite */
}
/* Le dropdown n'est PAS affecté par les règles "trigger 100%" */
.select2-container--open {
    z-index: 9999;
}

/* ============================================================
   PAGINATION SIGE — fenêtre glissante intelligente
   ============================================================ */
.sige-pagination {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 1.25rem;
    padding: 1rem 1.25rem;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 0.75rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.03);
}

.sige-pagination-info {
    font-size: 0.75rem;
    color: var(--sige-ink-soft);
    line-height: 1.5;
}
.sige-pagination-info strong {
    color: var(--sige-blue);
    font-weight: 700;
}

.sige-pagination-list {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.25rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.sige-pagination-list li > a,
.sige-pagination-list li > span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    height: 38px;
    padding: 0 0.75rem;
    border-radius: 0.5rem;
    border: 1.5px solid #e5e7eb;
    background: white;
    color: var(--sige-ink);
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.15s ease;
    box-shadow: 0 1px 2px rgba(0,0,0,0.02);
}

.sige-pagination-list li > a:hover {
    border-color: var(--sige-blue);
    background: var(--sige-blue-pale);
    color: var(--sige-blue);
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(46, 139, 87, 0.15);
}

.sige-pagination-list li.active > span {
    background: var(--sige-gradient);
    border-color: transparent;
    color: white;
    box-shadow: 0 3px 10px rgba(46, 139, 87, 0.35);
    cursor: default;
}

.sige-pagination-list li.disabled > span {
    background: #f9fafb;
    color: #cbd5e1;
    cursor: not-allowed;
    border-color: #f3f4f6;
    box-shadow: none;
}

.sige-pagination-list li.dots > span {
    background: transparent;
    border: none;
    color: #9ca3af;
    box-shadow: none;
    min-width: 24px;
    padding: 0 0.25rem;
    font-weight: 700;
    letter-spacing: 0.1em;
}

/* Variante "simple" : juste Précédent / Suivant */
.sige-pagination-simple .sige-pagination-list {
    gap: 0.5rem;
}

/* Responsive : empile les 2 zones sur petit écran */
@media (max-width: 640px) {
    .sige-pagination {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }
    .sige-pagination-list {
        justify-content: center;
    }
    .sige-pagination-list li > a,
    .sige-pagination-list li > span {
        min-width: 34px;
        height: 34px;
        font-size: 0.8rem;
        padding: 0 0.5rem;
    }
}

/* ============================================================
 * GLOBAL FORM CONTROLS — fallback de style pour TOUS les inputs
 * ============================================================
 *
 * Tailwind CDN ne fournit pas de style par défaut pour les inputs
 * (sauf si on utilise @tailwindcss/forms). Cette règle assure que
 * TOUS les champs de formulaire de l'application aient une bordure
 * visible, un padding correct et un focus state cohérent SANS avoir
 * à modifier chaque vue individuellement.
 *
 * Les champs avec class="sige-form" gardent leur style spécifique
 * (défini plus haut dans ce fichier) qui est plus précis.
 *
 * Cible : tous les inputs dans <body class="sige-app">.
 */
.sige-app input[type="text"],
.sige-app input[type="email"],
.sige-app input[type="password"],
.sige-app input[type="tel"],
.sige-app input[type="number"],
.sige-app input[type="date"],
.sige-app input[type="time"],
.sige-app input[type="datetime-local"],
.sige-app input[type="search"],
.sige-app input[type="url"],
.sige-app input[type="month"],
.sige-app input[type="week"],
.sige-app select,
.sige-app textarea {
    width: 100%;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    font-family: inherit;
    color: var(--sige-ink, #1f2937);
    background-color: #ffffff;
    background-image: none;
    border: 1.5px solid #d1d5db;
    border-radius: 0.5rem;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
    line-height: 1.4;
    -webkit-appearance: none;
    appearance: none;
}

/* Cas spéciaux : inputs avec affichage type checkbox/radio doivent rester natifs */
.sige-app input[type="checkbox"],
.sige-app input[type="radio"] {
    width: auto;
    border: initial;
    background: initial;
    box-shadow: none;
    accent-color: var(--sige-blue);
}

/* Select natif : restaurer la flèche dropdown via background SVG */
.sige-app select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3E%3Cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3E%3C/svg%3E");
    background-position: right 0.5rem center;
    background-repeat: no-repeat;
    background-size: 1.25rem;
    padding-right: 2rem;
}

/* File input : style spécifique pour le bouton */
.sige-app input[type="file"] {
    width: 100%;
    padding: 0.375rem;
    font-size: 0.8rem;
    background-color: #f9fafb;
    border: 1.5px solid #d1d5db;
    border-radius: 0.5rem;
    cursor: pointer;
}
.sige-app input[type="file"]::file-selector-button {
    margin-right: 0.75rem;
    padding: 0.375rem 0.875rem;
    background: var(--sige-blue);
    color: white;
    border: 0;
    border-radius: 0.375rem;
    font-weight: 600;
    font-size: 0.75rem;
    cursor: pointer;
    transition: background 0.15s;
}
.sige-app input[type="file"]::file-selector-button:hover {
    background: #256F46;
}

/* Color picker : taille fixe + cursor */
.sige-app input[type="color"] {
    width: 3rem;
    height: 2.5rem;
    padding: 0.25rem;
    border: 1.5px solid #d1d5db;
    border-radius: 0.5rem;
    cursor: pointer;
    background: white;
}

/* Hover & focus uniformes pour tous les champs */
.sige-app input:hover:not(:disabled):not([type="checkbox"]):not([type="radio"]),
.sige-app select:hover:not(:disabled),
.sige-app textarea:hover:not(:disabled) {
    border-color: #94a3b8;
}
.sige-app input:focus:not([type="checkbox"]):not([type="radio"]),
.sige-app select:focus,
.sige-app textarea:focus {
    border-color: var(--sige-blue) !important;
    outline: none !important;
    box-shadow: 0 0 0 3px rgba(91, 168, 214, 0.2) !important;
    background-color: #ffffff;
}
.sige-app input:disabled,
.sige-app select:disabled,
.sige-app textarea:disabled {
    background-color: #f3f4f6;
    color: #9ca3af;
    cursor: not-allowed;
    border-color: #e5e7eb;
}
.sige-app input::placeholder,
.sige-app textarea::placeholder {
    color: #9ca3af;
    opacity: 1;
}

/* Textarea : hauteur min raisonnable */
.sige-app textarea {
    resize: vertical;
    min-height: 4.5rem;
    line-height: 1.5;
}

/* Validation HTML5 : champ invalide */
.sige-app input:invalid:not(:placeholder-shown):not(:focus),
.sige-app select:invalid:not(:focus),
.sige-app textarea:invalid:not(:placeholder-shown):not(:focus) {
    border-color: #fca5a5;
}

/* Inputs intégrés dans des tableaux (notes, présences) : variante compacte */
.sige-app table input[type="text"],
.sige-app table input[type="number"],
.sige-app table select,
.sige-app .sige-grid input[type="text"],
.sige-app .sige-grid input[type="number"],
.sige-app .sige-grid select {
    padding: 0.375rem 0.5rem;
    font-size: 0.8rem;
}

