/* =========================================================
   BASE GLOBALE
   ========================================================= */
body {
    background-color: #2c3e50;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    margin: 0;
}

/* =========================================================
   CALENDRIER / INDEX
   ========================================================= */
.calendar-container {
    max-width: 1000px;
    width: 90%;
    margin: 0 auto 40px;
    padding: 20px;
    background-color: #f4f4f9;
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.mois-item {
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 5px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    padding: 20px;
    text-align: center;
    transition: transform 0.3s, background-color 0.3s;
    width: 180px;
    height: 130px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    color: #333;
    margin: 10px;
}

.mois-item:hover {
    border: 2px solid #ddd;
}

.mois-actuel {
    border: thin solid #FF5722;
}

.mois-actuel:hover {
    border: 2px solid #FF5722;
}

.mois-item .mensualite-total {
    font-size: 0.8em;
    color: #FF5722;
    margin-top: 10px;
    font-weight: bold;
}

.navigation h2 {
    color: #FF5722;
    text-align: center;
    font-size: 2.5em;
}

.navigation .btn {
    width: 180px;
    height: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px 0;
    text-decoration: none;
    color: #FF5722;
    background-color: transparent;
    border: none;
    transition: color 0.3s;
    box-sizing: border-box;
    font-size: 1.5em;
}

.navigation .btn i {
    margin: 0 10px;
}

.navigation .btn:hover {
    color: #FF5722;
}

.navigation {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
}

.calendrier {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
}

.trimestre {
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* =========================================================
   MODALE AJOUT (index / ajout)
   ========================================================= */
.modal-ajout {
    position: fixed;
    z-index: 1000;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 40%;
    max-width: 500px;
    background-color: #3A4750;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.3);
    color: #ffffff;
}

.modal-ajout-content {
    padding: 20px;
}

.modal-ajout-content h2,
.modal-header h2 {
    text-align: center;
    font-size: 24px;
    color: #2c3e50;
}

.modal-ajout-content label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    color: #2c3e50;
}

.modal-ajout-content input[type="text"],
.modal-ajout-content input[type="number"] {
    width: 100%;
    padding: 10px;
    margin-bottom: 20px;
    border-radius: 5px;
    border: 1px solid #ccc;
    background-color: #ffffff;
    color: black;
    font-size: 14px;
}

.modal-ajout-content input[type="text"]:focus,
.modal-ajout-content input[type="number"]:focus {
    border-color: black;
    outline: none;
}

.modal-ajout-content input[type="submit"] {
    display: block;
    width: 100%;
    padding: 12px 0;
    background-color: #2c3e50;
    color: #ffffff;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.modal-ajout-content input[type="submit"]:hover {
    background-color: black;
}

/* MonthPicker */
.ui-monthpicker {
    width: auto !important;
}
.ui-monthpicker td,
.ui-monthpicker th {
    width: auto;
    padding: 5px 10px;
    box-sizing: border-box;
    text-align: center;
}
.ui-monthpicker .ui-monthpicker-month {
    white-space: nowrap;
    font-size: 0.85em;
}
.ui-monthpicker table {
    width: 100%;
    table-layout: fixed;
}
#MonthPicker_date_debut {
    width: 425px;
}
.month-picker-month-table td {
    width: 100px;
}
.month-picker-month-table .ui-button {
    width: 100px;
}

/* Modale JS “utiliser la bourse” */
.ajout-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
}
.ajout-modal.show {
    display: block;
}
.ajout-modal-dialog {
    max-width: 480px;
    margin: 5% auto;
    z-index: 2001;
}
.ajout-modal-content {
    background-color: #fff;
    border-radius: 0.5rem;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    overflow: hidden;
    position: relative;
    z-index: 2002;
}
.ajout-modal-header,
.ajout-modal-body,
.ajout-modal-footer {
    padding: 1rem;
}
.ajout-modal-header {
    border-bottom: 1px solid #e9ecef;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.ajout-modal-title {
    margin: 0;
    font-size: 1.25rem;
}
.ajout-btn-close {
    background: transparent;
    border: none;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
}
.ajout-modal-body p {
    margin-bottom: 0.5rem;
}
.ajout-modal-body label {
    display: block;
    margin-top: 0.5rem;
    margin-bottom: 0.25rem;
}
.ajout-modal-body input {
    width: 100%;
    padding: 0.5rem;
    font-size: 1rem;
    box-sizing: border-box;
}
.ajout-modal-footer {
    border-top: 1px solid #e9ecef;
    text-align: right;
}
.ajout-btn {
    display: inline-block;
    padding: 0.5rem 1rem;
    font-size: 1rem;
    border-radius: 0.25rem;
    border: 1px solid transparent;
    cursor: pointer;
}
.ajout-btn-secondary {
    background-color: #6c757d;
    color: #fff;
}
.ajout-btn-primary {
    background-color: #0d6efd;
    color: #fff;
    margin-left: 0.5rem;
}

/* Input avec croix de reset */
.ajout-input-wrapper {
    position: relative;
    display: inline-block;
    width: 100%;
}
.ajout-input-wrapper input {
    width: 100%;
    padding: 0.5em 0.5em 0.5em 2em;
    box-sizing: border-box;
}
.ajout-input-clear {
    display: block;
    position: absolute;
    left: 0.5em;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    font-size: 1.2em;
    line-height: 1;
    color: #999;
    cursor: pointer;
    z-index: 1;
    pointer-events: all;
}
.ajout-input-clear:hover {
    color: #666;
}

/* =========================================================
   MODALE SYNTHÈSE
   ========================================================= */
.synthese-modal {
    display: block;
    position: fixed;
    z-index: 1000;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 95%;
    max-width: 900px;
    background-color: #fff;
    box-shadow: 0px 5px 15px rgba(0, 0, 0, 0.3);
    padding: 20px;
    border-radius: 8px;
    overflow: visible;
}

.infoSynthese {
    font-size: 0.8em;
}

.synthese-modal-dialog {
    max-width: 90vw;
    width: auto;
    min-width: 600px;
    max-height: 90vh;
    overflow: auto;
    padding: 20px;
    position: relative;
}

/* Header synthèse */
.synthese-modal-header {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: 10px 40px 10px 10px;
}
.synthese-modal-header h2 {
    margin: 0;
    flex: 0 1 auto;
    max-width: 100%;
    text-align: center;
    font-size: clamp(1.1rem, 2.4vw, 1.4rem);
    padding: 0 10px;
    box-sizing: border-box;
}

/* Croix de fermeture synthèse */
.synthese-close {
    position: absolute !important;
    top: 50%;
    right: 10px;
    transform: translateY(-50%);
    background: transparent !important;
    border: none;
    padding: 2px 6px;
    font-size: 1.4rem;
    font-weight: bold;
    color: #999;
    cursor: pointer;
    z-index: 20;
}
.synthese-close:hover {
    color: #555 !important;
}

/* Total épargne */
.synthese-total {
    margin: 10px auto 20px;
    text-align: center;
    font-weight: bold;
    font-size: 0.8em;
    color: #2c3e50;
}

/* Tableau synthèse */
.synthese-table {
    width: auto;
    margin: 0 auto;
    font-size: 0.85em;
    border-collapse: collapse;
    margin-top: 20px;
}
.synthese-table th,
.synthese-table td {
    white-space: nowrap;
    border: 1px solid #ddd;
    padding: 10px 15px;
    text-align: center;
}
.synthese-table th {
    background-color: #2c3e50;
    color: white;
}
.synthese-table td {
    color: #303841;
}
.synthese-table tr {
    transition: background 0.2s;
}

/* Etats lignes */
.synthese-row-a-venir {
    background: #e9f3fa;
}
.synthese-row-en-cours {
    background: #eafae9;
}
.synthese-row-terminee {
    background: #fae9eb;
}

/* Icônes actions */
.synthese-action-icon {
    cursor: pointer;
    transition: color 0.18s;
}
.synthese-action-icon:hover {
    color: #ff8a65;
}
.synthese-action-icon.disabled {
    color: #ccc !important;
    opacity: 0.4 !important;
    cursor: not-allowed !important;
}

/* Messages synthèse */
.synthese-message-info {
    background: #e8ffd8;
    border: 1px solid #28a745;
    color: #216c3b;
    border-radius: 5px;
    margin-bottom: 1em;
    font-size: 1.08em;
    padding: .5em 1em;
}
.synthese-message p {
    margin-bottom: 10px;
    font-size: 0.75em;
    line-height: 1.4em;
    text-align: center;
}
.synthese-infoErreur {
    text-align: center;
    margin: 0 auto;
}

/* Bouton ajout depuis synthèse */
.synthese-btn-create-ajout {
    display: inline-block;
    background-color: var(--accent-color, #337ab7);
    color: white;
    padding: 10px 20px;
    margin: 30px auto 0;
    border-radius: 6px;
    text-decoration: none;
    text-align: center;
}
.synthese-btn-create-ajout:hover {
    background-color: #285e8e;
}
.synthese-table + .synthese-btn-create-ajout {
    display: block;
    text-align: center;
}
.synthese-ajout-lien {
    margin: 0 auto;
    text-align: center;
    margin-top: 2rem;
    font-size: 0.9em;
}
.synthese-ajout-lien a {
    color: #333;
    text-decoration: none;
}

/* =========================================================
   CLOSE_DEPENSE.PHP (popup autonome)
   ========================================================= */
.close-wrapper {
    max-width: 600px;
    margin: 80px auto;
    background: #fff;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    font-family: Arial, sans-serif;
}
.close-title {
    font-size: 1.5em;
    margin-bottom: 20px;
    color: #333;
}
.close-message {
    font-size: 1.1em;
    margin-bottom: 25px;
}
.close-form {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}
.close-btn {
    padding: 10px 18px;
    font-size: 1em;
    border: none;
    border-radius: 6px;
    cursor: pointer;
}
.close-btn-cancel {
    background-color: #ccc;
    color: #333;
}
.close-btn-confirm {
    background-color: #28a745;
    color: #fff;
}

.closedep-modal {
    background-color: white;
    width: 500px;
    margin: 100px auto;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.3);
    position: relative;
}
.closedep-header {
    font-size: 20px;
    margin-bottom: 10px;
}
.closedep-form {
    display: flex;
    flex-direction: column;
}
.closedep-form label {
    margin-top: 10px;
    font-weight: bold;
}
.closedep-form input[type="number"] {
    padding: 8px;
    font-size: 16px;
    margin-top: 5px;
    border-radius: 6px;
    border: 1px solid #ccc;
}
.closedep-buttons {
    margin-top: 20px;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}
.closedep-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    font-size: 14px;
}
.closedep-cancel {
    background-color: #ccc;
    color: black;
}
.closedep-submit {
    background-color: #28a745;
    color: white;
}
.closedep-error {
    color: red;
    margin-top: 10px;
}
.closedep-info {
    background: #e7fbdc;
    color: #21753a;
    padding: .6em 1em;
    margin-bottom: 1em;
    border-radius: 4px;
    border: 1px solid #8be36c;
}
.closedep-label {
    display: block;
    margin-bottom: .3em;
}

/* Overlay pour close_depense autonome */
.closedep-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}
/* bloque scroll derrière */
body.closedep-body-no-scroll {
    overflow: hidden;
}

/* =========================================================
   MODALE OPTIONS (modifier / supprimer)
   ========================================================= */
.modal-options {
    position: fixed;
    z-index: 1000;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 380px;
    background: #fff;
    box-shadow: 0 6px 32px rgba(0, 0, 0, 0.15);
    border-radius: 14px;
    padding: 0;
    animation: modal-pop .28s;
}
@keyframes modal-pop {
    from {
        transform: translate(-50%, -40%) scale(0.95);
    }
    to {
        transform: translate(-50%, -50%) scale(1);
    }
}
.modal-options-content {
    padding: 28px 24px 22px 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}
.modal-options-close {
    position: absolute;
    top: 13px;
    right: 16px;
    background: none;
    border: none;
    font-size: 1.5em;
    color: #8a8a8a;
    cursor: pointer;
    transition: color 0.2s;
    z-index: 1;
}
.modal-options-close:hover {
    color: #d32f2f;
}
.modal-options-content h2 {
    font-size: 1.10em;
    text-align: center;
    margin: 10px 0 24px 0;
    font-weight: 500;
}
.modal-options-nom {
    color: #388e3c;
    font-weight: 600;
    font-size: 1.05em;
}
.btn-container {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 2px;
}
.btn-form {
    display: block;
    margin: 0;
    padding: 0;
}
.btn-modifier,
.btn-supprimer {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 1em;
    padding: 10px 0 9px 0;
    margin: 0;
    border: none;
    border-radius: 7px;
    cursor: pointer;
    transition: background 0.17s, box-shadow 0.16s;
    box-shadow: 0 2px 8px rgba(75, 99, 123, 0.05);
}
.btn-modifier {
    background: #f3faf5;
    color: #298a4f;
    font-weight: 500;
}
.btn-modifier:hover {
    background: #d8f5e6;
    color: #226638;
}
.btn-supprimer {
    background: #fff6f5;
    color: #d32f2f;
    font-weight: 500;
}
.btn-supprimer:hover {
    background: #fae3e0;
    color: #9c2323;
    box-shadow: 0 2px 10px rgba(200, 60, 60, 0.07);
}

/* =========================================================
   DIVERS
   ========================================================= */
.bouton-supprimer {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    background-color: #F0604D;
}

/* Message box flottant (global) */
.message-box {
    position: absolute;
    top: 20px;
    right: 20px;
    display: none;
    background-color: #ffffff;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    padding: 20px;
    width: 300px;
    text-align: center;
    transition: opacity 0.5s ease;
}
.success {
    border-left: 6px solid #4CAF50;
}
.error {
    border-left: 6px solid #f44336;
}
.info {
    border-left: 6px solid #2196F3;
}
.message-box h2 {
    margin: 0;
}
.message-box p {
    margin: 10px 0 0;
}
.close-btn {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 20px;
    cursor: pointer;
    color: #888;
}
.close-btn:hover {
    color: #000;
}

/* Bourse en haut des pages */
.bourse {
    margin-top: 10px;
    width: 100%;
    height: 32px;
    text-align: center;
}
.lignebourse {
    height: inherit;
}
.imgbourse {
    margin-right: 10px;
}
.valeurbourse {
    font-size: .8em;
    font-weight: bold;
}
.bourse img {
    border: none;
    background-color: inherit;
}

/* =========================================================
   LOGIN / INSCRIPTION / RESET / ACTIVATION
   ========================================================= */
.login-container {
    background-color: #f4f4f9;
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    max-width: 400px;
    width: 90%;
    margin: auto;
}
.login-container h2 {
    text-align: center;
    color: #2c3e50;
    margin-bottom: 20px;
}
.login-form label {
    display: block;
    margin: 10px 0 5px;
    font-weight: bold;
    color: #2c3e50;
}
.login-form input[type="email"],
.login-form input[type="password"] {
    width: 100%;
    padding: 10px;
    margin-bottom: 15px;
    border-radius: 5px;
    border: 1px solid #ccc;
    font-size: 1em;
}
.login-form input[type="submit"] {
    background-color: #2c3e50;
    color: white;
    border: none;
    border-radius: 5px;
    padding: 12px;
    font-size: 1em;
    width: 100%;
    cursor: pointer;
}
.login-form input[type="submit"]:hover {
    background-color: #1a242f;
}
.login-forgot {
    text-align: center;
    margin-top: 10px;
}
.login-forgot a {
    color: #FF5722;
    text-decoration: none;
    font-size: 0.9em;
}
.login-forgot a:hover {
    text-decoration: underline;
}

/* Modale “mot de passe oublié” */
.login-modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.6);
}
.login-modal-content {
    background-color: #ffffff;
    margin: 10% auto;
    padding: 30px;
    border-radius: 10px;
    max-width: 400px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    position: relative;
}
.login-modal-content h2 {
    margin-top: 0;
    text-align: center;
    color: #2c3e50;
}
.login-modal-content label {
    display: block;
    margin-top: 15px;
    margin-bottom: 5px;
    font-weight: bold;
}
.login-modal-content input[type="email"] {
    width: 100%;
    padding: 10px;
    border-radius: 5px;
    border: 1px solid #ccc;
}
.login-modal-content input[type="submit"] {
    margin-top: 15px;
    background-color: #FF5722;
    color: white;
    border: none;
    border-radius: 5px;
    padding: 12px;
    font-size: 1em;
    width: 100%;
    cursor: pointer;
}
.login-modal-content input[type="submit"]:hover {
    background-color: #e64a19;
}
.login-close {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 24px;
    color: #aaa;
    cursor: pointer;
}
.login-close:hover {
    color: black;
}
#login-forgot-message {
    margin-top: 10px;
    font-size: 0.9em;
    text-align: center;
}

/* Inscription admin */
.inscription-admin-wrapper {
    max-width: 420px;
    margin: 8vh auto 0 auto;
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 3px 20px rgba(0, 0, 0, 0.10);
    padding: 2.5rem 2rem 1.7rem 2rem;
    text-align: center;
}
.inscription-admin-title {
    font-size: 1.5rem;
    margin-bottom: 2rem;
    color: #157347;
    font-weight: bold;
    letter-spacing: 0.02em;
}
.inscription-highlight-admin {
    color: #157347;
    background: #E3F7ED;
    border-radius: 0.4em;
    padding: 0.09em 0.7em;
}
.inscription-admin-form .inscription-form-group {
    margin-bottom: 1.8rem;
    text-align: left;
}
.inscription-form-label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.45em;
    color: #222;
}
.inscription-form-input {
    width: 100%;
    padding: 0.7em 1em;
    border: 1.5px solid #b7d4c4;
    border-radius: 8px;
    font-size: 1.1em;
    background: #f6faf8;
    transition: border 0.2s;
}
.inscription-form-input:focus {
    border-color: #157347;
    outline: none;
    background: #e8f8f1;
}
.inscription-admin-btn {
    width: 100%;
    background: linear-gradient(90deg, #157347 60%, #198754 100%);
    color: #fff;
    padding: 1em 2em;
    font-size: 1.07em;
    border: none;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 2px 12px rgba(21, 115, 71, 0.07);
    margin-bottom: 1.7em;
    transition: background 0.2s;
}
.inscription-admin-btn:hover {
    background: linear-gradient(90deg, #198754 60%, #157347 100%);
}
.inscription-admin-warning {
    background: #fff6e6;
    color: #b67800;
    font-size: 0.97em;
    border-left: 5px solid #ffa800;
    padding: 0.75em 1em 0.75em 1.1em;
    border-radius: 7px;
    margin: 0 auto;
    text-align: left;
    box-sizing: border-box;
}
.inscription-warning-icon {
    font-size: 1.2em;
    margin-right: 0.35em;
    vertical-align: -2px;
}

/* Activation compte */
.activation-container {
    max-width: 430px;
    margin: 8vh auto 0 auto;
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 5px 28px rgba(21, 115, 71, 0.11);
    padding: 2.7rem 2.1rem 2.3rem 2.1rem;
    text-align: center;
    font-family: 'Segoe UI', 'Roboto', Arial, sans-serif;
}
.activation-title {
    font-size: 1.42rem;
    margin-bottom: 2.2rem;
    color: #157347;
    font-weight: 700;
    letter-spacing: 0.03em;
}
.activation-alert {
    margin-bottom: 2.1rem;
    padding: 1.15em 1.2em 1.1em 1.2em;
    border-radius: 8px;
    font-size: 1.08em;
    text-align: left;
    display: flex;
    align-items: flex-start;
    gap: 0.8em;
    line-height: 1.55;
    border-left: 6px solid;
    box-shadow: 0 2px 10px rgba(21, 115, 71, 0.05);
}
.activation-success {
    background: #ecfdf3;
    color: #12723b;
    border-color: #1ec977;
}
.activation-error {
    background: #fef2f0;
    color: #b4371c;
    border-color: #e35020;
}
.activation-success-icon,
.activation-error-icon {
    font-size: 1.65em;
    margin-top: 0.03em;
}
.activation-link {
    color: #157347;
    font-weight: bold;
    text-decoration: underline;
    margin-left: 0.1em;
    font-size: 1em;
    transition: color 0.18s;
}
.activation-link:hover {
    color: #055d2b;
}
.activation-form {
    margin-top: 1.3em;
    text-align: left;
}
.activation-form-group {
    margin-bottom: 1.6em;
}
.activation-form-label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.48em;
    color: #18543a;
    letter-spacing: 0.01em;
}
.activation-form-input {
    width: 100%;
    padding: 0.72em 1em;
    border: 1.5px solid #b7d4c4;
    border-radius: 8px;
    font-size: 1.07em;
    background: #f6faf8;
    transition: border 0.2s, background 0.2s;
}
.activation-form-input:focus {
    border-color: #157347;
    outline: none;
    background: #e6faef;
}
.activation-btn {
    display: block;
    min-width: 140px;
    max-width: 320px;
    margin: 1.3em auto 0 auto;
    background: linear-gradient(90deg, #157347 60%, #198754 100%);
    color: #fff;
    padding: 0.8em 2.2em;
    font-size: 1em;
    border: none;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 2px 12px rgba(21, 115, 71, 0.09);
    transition: background 0.22s, box-shadow 0.2s;
    text-align: center;
    text-decoration: none;
}
.activation-btn:hover {
    background: linear-gradient(90deg, #198754 60%, #157347 100%);
    box-shadow: 0 4px 18px rgba(21, 115, 71, 0.11);
}
.activation-criteria {
    margin: 1em 0 1.2em 0;
    font-size: 0.98em;
    background: #f7faf8;
    padding: 0.8em 1.2em;
    border-radius: 8px;
    text-align: left;
}
.activation-criteria p {
    margin: 0.15em 0;
    padding-left: 0.8em;
    position: relative;
    transition: color 0.18s;
}
.activation-criteria .valid {
    color: #198754;
    font-weight: 600;
}
.activation-criteria .invalid {
    color: #b4371c;
}
.activation-criteria .valid::before,
.activation-criteria .invalid::before {
    position: absolute;
    left: 0;
    font-size: 1.1em;
}
.activation-criteria .valid::before {
    content: '✔';
}
.activation-criteria .invalid::before {
    content: '✘';
}

/* Reset mot de passe */
.reset-container {
    max-width: 420px;
    margin: 8vh auto 0 auto;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 5px 28px rgba(21, 115, 71, 0.10);
    padding: 2.5rem 2rem 1.7rem 2rem;
    text-align: center;
    font-family: 'Segoe UI', 'Roboto', Arial, sans-serif;
}
.reset-title {
    font-size: 1.4rem;
    margin-bottom: 2.2rem;
    color: #157347;
    font-weight: 700;
}
.reset-alert {
    margin-bottom: 1.8rem;
    padding: 1em 1.2em;
    border-radius: 7px;
    font-size: 1.08em;
    text-align: left;
    border-left: 6px solid #e35020;
    background: #fef2f0;
    color: #b4371c;
}
.reset-form {
    margin-top: 1.1em;
    text-align: left;
}
.reset-form input[type="password"] {
    width: 100%;
    padding: 0.72em 1em;
    margin-bottom: 1em;
    border: 1.5px solid #b7d4c4;
    border-radius: 8px;
    font-size: 1.07em;
    background: #f6faf8;
    transition: border 0.2s, background 0.2s;
}
.reset-form input[type="password"]:focus {
    border-color: #157347;
    outline: none;
    background: #e6faef;
}
.reset-btn {
    width: 100%;
    background: linear-gradient(90deg, #157347 60%, #198754 100%);
    color: #fff;
    padding: 1em 2em;
    font-size: 1.09em;
    border: none;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
    margin-top: 0.7em;
    box-shadow: 0 2px 12px rgba(21, 115, 71, 0.09);
    transition: background 0.22s, box-shadow 0.2s;
}
.reset-btn:hover {
    background: linear-gradient(90deg, #198754 60%, #157347 100%);
    box-shadow: 0 4px 18px rgba(21, 115, 71, 0.11);
}
.reset-criteria {
    margin: 1em 0 1.2em 0;
    font-size: 0.98em;
    background: #f7faf8;
    padding: 0.8em 1.2em;
    border-radius: 8px;
    text-align: left;
}
.reset-criteria p {
    margin: 0.15em 0;
    padding-left: 0.8em;
    position: relative;
    transition: color 0.18s;
}
.reset-criteria .valid {
    color: #198754;
    font-weight: 600;
}
.reset-criteria .invalid {
    color: #b4371c;
}
.reset-criteria .valid::before,
.reset-criteria .invalid::before {
    position: absolute;
    left: 0;
    font-size: 1.1em;
}
.reset-criteria .valid::before {
    content: '✔';
}
.reset-criteria .invalid::before {
    content: '✘';
}
.inline-reset {
    display: inline-block;
    margin-left: 6px;
}

/* =========================================================
   FLASH MESSAGES GLOBALES
   ========================================================= */
.flash-message {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 0.95rem;
    color: #fff;
    background-color: #333;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    opacity: 1;
    transition: opacity 0.5s ease;
    max-width: 90%;
    text-align: center;
}
.flash-message.success {
    background-color: #28a745;
}
.flash-message.error {
    background-color: #dc3545;
}
.flash-message.info {
    background-color: #17a2b8;
}
.flash-message.warning {
    background-color: #ffc107;
    color: #000;
}
.flash-close {
    margin-left: 12px;
    font-weight: bold;
    cursor: pointer;
}

/* =========================================================
   MENU HAMBURGER / SLIDE MENU
   ========================================================= */
.menu-hamburger {
    position: fixed;
    top: 10px;
    right: 10px;
    z-index: 1001;
}
.menu-toggle {
    position: absolute;
    top: 10px;
    right: 10px;
    background: transparent;
    border: none;
    font-size: 28px;
    color: #fff;
    cursor: pointer;
    z-index: 1001;
}
.menu-content {
    display: none;
    position: absolute;
    top: 50px;
    right: 0;
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 6px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    min-width: 200px;
    text-align: left;
}
.menu-content a {
    display: block;
    padding: 10px;
    color: #333;
    text-decoration: none;
    border-bottom: 1px solid #eee;
}
.menu-content a:last-child {
    border-bottom: none;
}
.menu-content a:hover {
    background: #f0f0f0;
}

/* Slide menu à droite */
#slideMenu {
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    right: 0;
    width: 250px;
    height: 100%;
    background: #222;
    color: #fff;
    padding-top: 60px;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    z-index: 1000;
}
#slideMenu.open {
    transform: translateX(0);
}
#slideMenu a {
    display: block;
    padding: 15px 20px;
    color: #fff;
    text-decoration: none;
}
#slideMenu a:hover {
    background: #444;
}
#slideMenu .menu-separator {
    border: 0;
    border-top: 1px solid #555;
    margin: 15px 0;
}
#slideMenu .menu-email {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    font-size: 0.85rem;
    color: #ccc;
    text-decoration: none;
    border-top: 1px solid #333;
    margin-top: auto;
}
#slideMenu .menu-email:hover {
    background: #333;
    color: #fff;
}
.menu-links {
    flex-grow: 1;
}

/* Tooltip logout */
.logout-tooltip {
    display: none;
    position: absolute;
    bottom: 60px;
    left: 50%;
    transform: translateX(-50%);
    background: #fefefe;
    border: 1px solid #ccc;
    color: #222;
    font-size: 0.9rem;
    padding: 10px 14px;
    border-radius: 8px;
    box-shadow: 0 0 8px rgba(0, 0, 0, 0.1);
    z-index: 1200;
    max-width: 200px;
}
.logout-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border-width: 8px;
    border-style: solid;
    border-color: #fefefe transparent transparent transparent;
}
.tooltip-content {
    animation: bounce 0.7s ease-in-out 2;
}
.logout-tooltip .close-tooltip {
    position: absolute;
    top: 4px;
    right: 6px;
    font-size: 14px;
    color: #888;
    cursor: pointer;
}
.logout-tooltip .close-tooltip:hover {
    color: #000;
}
.animate-tooltip {
    animation: bounce 0.7s ease-in-out 2;
}
@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-8px);
    }
    70% {
        transform: translateY(4px);
    }
}

/* =========================================================
   USERS.PHP
   ========================================================= */
.users-container {
    max-width: 1000px;
    margin: 60px auto;
    padding: 20px;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}
.users-container h1 {
    font-size: 2rem;
    color: #333;
    text-align: center;
    margin-bottom: 30px;
}
.users-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}
.users-table th,
.users-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}
.users-table th {
    background-color: #f4f4f4;
    color: #444;
    font-weight: bold;
}
.users-table tr:hover {
    background-color: #f9f9f9;
}
.users-table td.actions {
    text-align: right;
}

/* Bouton "Ajouter un utilisateur" */
.users-btn-add {
    display: inline-block;
    margin: 10px 0 20px;
    padding: 8px 14px;
    background-color: #007bff;
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.95rem;
}

/* Modale utilisateurs */
.users-modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.5);
}
.users-modal .modal-content {
    background-color: #fff;
    margin: 10% auto;
    padding: 30px;
    border-radius: 10px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    position: relative;
}
.users-modal .modal-title {
    font-size: 1.5rem;
    margin-bottom: 20px;
    text-align: center;
}
.users-modal .form-group {
    margin-bottom: 15px;
}
.users-modal label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}
.users-modal input,
.users-modal select {
    width: 100%;
    padding: 10px;
    border: 1px solid #bbb;
    border-radius: 5px;
    font-size: 1rem;
}
.users-modal .form-actions {
    display: flex;
    justify-content: space-between;
    margin-top: 20px;
}
.users-modal .btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
}
.users-modal .btn-valider {
    background-color: #4caf50;
    color: white;
}
.users-modal .btn-annuler {
    background-color: #f44336;
    color: white;
}
.users-modal .modal-close {
    position: absolute;
    top: 12px;
    right: 20px;
    font-size: 24px;
    color: #888;
    cursor: pointer;
}
.users-modal .modal-close:hover {
    color: #000;
}

/* Icônes d’action dans users.php */
.users-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}
.users-actions form {
    display: inline-flex;
    margin: 0;
}
.users-iconbtn {
    border: none;
    outline: none;
    background: none;
    padding: 4px;
    margin: 0;
    cursor: pointer;
    color: #374151;
    line-height: 0;
    border-radius: 6px;
}
.users-iconbtn:hover {
    transform: translateY(-1px);
}
.users-iconbtn:active {
    transform: translateY(0);
}
.users-iconbtn:focus {
    outline: none;
}
.users-iconbtn:focus-visible {
    box-shadow: 0 0 0 2px rgba(37, 99, 235, .35);
}
/* teintes par action */
.users-edit {
    color: #0ea5e9;
}
.users-reset {
    color: #2563eb;
}
.users-delete {
    color: #ef4444;
}
.users-iconbtn svg {
    width: 18px;
    height: 18px;
    display: block;
}

/* Zone de date */
.users-date {
    font-size: 0.9rem;
    color: #999;
    font-style: italic;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 6px;
}
.users-date i {
    color: #aaa;
}

/* Bouton reset inline */
.users-btn-reset {
    padding: 6px 10px;
    border-radius: 8px;
    border: 0;
    background: #0ea5e9;
    color: #fff;
    font-weight: 600;
    cursor: pointer;
}
.users-btn-reset:hover {
    filter: brightness(0.95);
}

/* Conteneur messages dans users.php */
.flash-message-container {
    min-height: 60px;
    text-align: center;
    margin-bottom: 10px;
}

/* =========================================================
   HEADER / GANTT
   ========================================================= */
.header-wrapper {
    width: 99.5%;
    padding-left: 5px;
    padding-right: 5px;
}
.header-wrapper h2 {
    color: #FF5722;
    text-align: center;
    font-size: 2.5em;
}

#gantt-container {
    box-sizing: border-box;
    border-radius: 5px;
}
.today-button {
    display: none !important;
}
#gantt-vue-btns {
    text-align: center;
    margin-bottom: 15px;
}
#gantt-vue-btns button {
    background: #f8b195;
    color: #333;
    font-weight: bold;
    font-size: 1.08em;
    border: none;
    border-radius: 8px;
    padding: 8px 28px;
    margin: 0 8px;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(248, 177, 149, 0.13);
    transition: background 0.2s, box-shadow 0.2s;
    outline: none;
}
#gantt-vue-btns button:hover,
#gantt-vue-btns button.active {
    background: #f67280;
    color: #fff;
    box-shadow: 0 4px 16px rgba(246, 114, 128, 0.16);
}
#gantt-vue-btns button:active {
    transform: translateY(1px) scale(0.98);
}
.gantt-wrapper {
    text-align: center;
}
#gantt .popup,
.gantt .popup {
    z-index: 99999 !important;
    position: fixed !important;
    left: auto !important;
    right: auto !important;
    bottom: auto !important;
}
.gantt .bar-label {
    font-weight: bold;
    font-style: italic;
}
.scroll-container {
    display: block;
    margin: 0 20px;
    overflow-x: auto;
    white-space: nowrap;
    padding: 20px 0;
    scroll-behavior: smooth;
}
#gantt {
    display: inline-block;
}
.gantt-invisible-task .bar {
    opacity: 0 !important;
    pointer-events: none !important;
}
.popup > div:first-child {
    font-weight: bold;
    font-style: italic;
    font-size: 0.7em;
    margin-bottom: 4px;
}

/* =========================================================
   BOURSE_RECAP / RECAP-CONTAINER / BACKUP
   ========================================================= */
.recap-container {
    max-width: 500px;
    margin: 2em auto;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 18px #0002;
    padding: 2em;
}
table.recap-table {
    width: 100%;
    border-collapse: collapse;
}
.recap-table th,
.recap-table td {
    padding: .7em 1em;
    border-bottom: 1px solid #e3eaf2;
    text-align: left;
}
.recap-table th {
    background: #e3f2fd;
    font-weight: 700;
}
.recap-table tr:last-child td {
    border-bottom: 0;
}
.recap-apport {
    color: #21753a;
    font-weight: bold;
}
.recap-dispo {
    color: #1576d1;
    font-weight: bold;
}
.recap-totaux {
    font-weight: bold;
    background: #eafbe6;
}

/* backup_restore.php */
.backup-container {
    max-width: 400px;
    margin: 2em auto;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 18px #0002;
    padding: 2em;
}
.backup-container h2 {
    text-align: center;
    color: #257fd5;
}
.backup-btn {
    display: inline-block;
    padding: 0.7em 1.6em;
    border-radius: 7px;
    background: #257fd5;
    color: #fff;
    border: none;
    font-size: 1.12em;
    margin: 1em 0;
    cursor: pointer;
    transition: .14s;
}
.backup-btn:hover {
    background: #145f9d;
}
.backup-form label {
    font-weight: 500;
}
.backup-form input[type="file"] {
    margin: .8em 0;
}
.backup-error {
    color: #b32d2d;
    background: #ffeaea;
    border: 1px solid #ffa4a4;
    border-radius: 5px;
    padding: .5em 1em;
    margin-bottom: 1em;
}

/* =========================================================
   MEDIA QUERIES – MOBILE / TABLET
   ========================================================= */

/* 📱 Mobiles (≤600px) */
@media (max-width: 600px) {
    html,
    body {
        overflow-x: hidden;
    }

    html {
        height: auto;
    }
    body {
        display: block;
        position: relative;
        height: auto;
        min-height: 100dvh;
        margin: 0;
        padding: 10px 6px;
        align-items: stretch;
        justify-content: flex-start;
    }

    /* Conteneurs principaux */
    .calendar-container,
    .login-container,
    .reset-container,
    .activation-container,
    .inscription-admin-wrapper,
    .users-container,
    .recap-container,
    .backup-container,
    .close-wrapper,
    .closedep-modal {
        width: 100%;
        max-width: 100%;
        margin: 16px auto;
        padding: 16px;
        box-sizing: border-box;
    }

    /* Header / index */
    .header-wrapper {
        width: 100%;
        padding-left: 5px;
        padding-right: 5px;
        margin-top: max(24px, env(safe-area-inset-top));
    }
    .header-wrapper h2 {
        font-size: 1.6em;
    }

    /* Navigation calendrier (titre + flèches) */
    .navigation {
        display: flex;
        flex-wrap: nowrap;
        align-items: center;
        justify-content: space-between;
        gap: 4px;
        padding: 0 4px;
    }
    .navigation h2 {
        flex: 1 1 auto;
        margin: 0;
        text-align: center;
        white-space: nowrap;
        font-size: clamp(1.1em, 4.5vw, 1.4em);
    }
    .navigation .btn {
        flex: 0 0 auto;
        min-width: 32px;
        padding: 4px 6px;
        font-size: 1.4em;
        justify-content: center;
    }

    /* Calendrier – tuiles */
    .calendar-container {
        width: 100%;
        padding: 14px;
    }
    .calendrier {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }
    .trimestre {
        width: 100%;
    }
    .mois-item {
        width: 100%;
        height: auto;
        margin: 0;
        padding: 12px;
        font-size: .95em;
    }
    .mois-item .mensualite-total {
        font-size: .78em;
    }

    /* Modales générales */
    .modal-ajout,
    .synthese-modal,
    .modal-options,
    .login-modal-content,
    .users-modal .modal-content,
    .closedep-modal {
        width: 94vw !important;
        max-width: 94vw !important;
        margin: 0 auto !important;
        left: 50% !important;
        top: 50% !important;
        transform: translate(-50%, -50%) !important;
        padding: 14px !important;
        border-radius: 10px;
    }
    .synthese-modal-dialog {
        max-width: 100% !important;
        min-width: 0 !important;
        padding: 0 !important;
    }
    .ajout-modal-dialog {
        max-width: 92vw;
        margin: 8% auto;
    }

    /* Close dépense – boutons colonne */
    .closedep-buttons {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }
    .closedep-btn {
        width: 100%;
    }

    /* Synthèse – mode cartes */
    .synthese-modal {
        padding: 12px !important;
    }
    .synthese-modal-header h2 {
        font-size: clamp(1rem, 4vw, 1.2rem);
    }
    .synthese-total {
        font-size: 0.9em;
    }
    .synthese-table {
        display: block !important;
        width: 100% !important;
        font-size: 0.8em !important;
        border-collapse: separate !important;
        border-spacing: 0 !important;
    }
    .synthese-table thead {
        display: none !important;
    }
    .synthese-table tr {
        display: block !important;
        margin-bottom: 10px;
        border: 1px solid #ddd;
        border-radius: 8px;
        overflow: hidden;
        background: #fff;
    }
    .synthese-table td {
        display: block !important;
        text-align: right;
        padding: 6px 10px 6px 50%;
        position: relative;
        white-space: normal !important;
        border: none !important;
        border-bottom: 1px solid #eee !important;
    }
    .synthese-table td:last-child {
        border-bottom: none !important;
    }
    .synthese-table td::before {
        content: attr(data-label);
        position: absolute;
        left: 10px;
        top: 50%;
        transform: translateY(-50%);
        font-weight: 600;
        color: #666;
        text-align: left;
    }
    .synthese-action-icon {
        font-size: 1.2em;
        padding: 4px;
    }

    /* Croix synthèse */
    .synthese-close {
        right: 8px;
        font-size: 1.3rem;
    }

    /* Login / Reset / Activation / Inscription */
    .login-container,
    .reset-container,
    .activation-container,
    .inscription-admin-wrapper {
        width: 92vw;
        padding: 18px;
    }
    .login-container h2,
    .reset-title,
    .activation-title,
    .inscription-admin-title {
        font-size: 1.3rem;
    }
    .login-form input[type="email"],
    .login-form input[type="password"],
    .login-form input[type="submit"],
    .reset-form input[type="password"],
    .activation-form-input,
    .inscription-form-input {
        font-size: 1rem;
    }

    /* Users – mode cartes */
    .users-container {
        width: 100% !important;
        max-width: 100% !important;
        margin: 80px auto 20px !important;
        padding: 16px !important;
        box-sizing: border-box;
    }
    .users-container h1 {
        font-size: 1.3rem;
        margin-bottom: 14px;
        text-align: center;
    }
    .users-table {
        width: 100% !important;
        display: block !important;
        border-collapse: separate !important;
        border-spacing: 0 !important;
        font-size: 0.9rem;
        overflow: visible !important;
        white-space: normal !important;
    }
    .users-table thead {
        display: none !important;
    }
    .users-table tbody {
        display: block;
        width: 100%;
    }
    .users-table tr {
        display: block;
        margin-bottom: 12px;
        border: 1px solid #ddd;
        border-radius: 8px;
        background: #fff;
        padding: 6px 8px;
    }
    .users-table td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 4px 4px;
        border: none !important;
        border-bottom: 1px solid #eee !important;
    }
    .users-table td:last-child {
        border-bottom: none !important;
    }
    .users-table td::before {
        content: attr(data-label);
        font-weight: 600;
        color: #555;
        margin-right: 6px;
        flex: 0 0 auto;
    }
    .users-table td span,
    .users-table td div,
    .users-table td {
        flex: 1 1 auto;
        text-align: right;
        word-break: break-word;
    }
    .users-table td.actions {
        justify-content: flex-end;
    }
    .users-table td.actions::before {
        content: "Actions";
    }
    .users-btn {
        padding: 6px 8px;
        font-size: 0.8rem;
        margin-left: 4px;
    }
    .users-btn-reset {
        padding: 5px 7px;
        font-size: 0.78rem;
    }
    .users-btn-add {
        width: 100%;
        text-align: center;
    }

    /* bourse_recap – sous le menu */
    .recap-container {
        width: 100% !important;
        max-width: 100% !important;
        margin: 72px auto 16px !important;
        padding: 14px 10px !important;
        box-sizing: border-box;
        border-radius: 8px;
    }
    .recap-table {
        font-size: 0.9em;
    }
    .recap-table th,
    .recap-table td {
        padding: 8px 6px;
        white-space: normal;
        word-wrap: break-word;
    }

    /* Messages / Flash */
    .message-box,
    .flash-message {
        width: 90% !important;
        max-width: 320px !important;
        right: auto !important;
        left: 50% !important;
        transform: translateX(-50%) !important;
        font-size: 0.9rem !important;
        top: 10px !important;
    }
    .flash-message-container {
        min-height: 40px;
        margin-bottom: 8px;
    }

    /* Boutons tactiles */
    button,
    .ajout-btn,
    .users-btn,
    .closedep-btn,
    .backup-btn,
    .login-form input[type="submit"],
    .reset-btn,
    .activation-btn,
    .synthese-btn-create-ajout {
        min-height: 44px;
        font-size: 1rem;
    }

    /* Gantt / diagramme – caché sur mobile */
    #gantt-container,
    .gantt-wrapper,
    #gantt {
        display: none !important;
    }
    .scroll-container {
        margin: 0 4px !important;
        padding: 10px 0 !important;
        overflow-x: auto !important;
    }

    /* MonthPicker trop large */
    #MonthPicker_date_debut {
        width: 100% !important;
    }

    /* Menu hamburger */
    .menu-hamburger {
        position: fixed;
        top: 10px;
        right: 10px;
        z-index: 2001;
    }
    .menu-toggle {
        background: rgba(0, 0, 0, 0.55) !important;
        color: #fff !important;
        border-radius: 999px !important;
        padding: 6px 10px !important;
        font-size: 24px !important;
        border: none;
        cursor: pointer;
    }
    #slideMenu {
        width: 80vw !important;
        max-width: 320px !important;
        height: 100%;
        background: #222;
        color: #fff;
        padding-top: max(60px, env(safe-area-inset-top)) !important;
        transform: translateX(100%);
        transition: transform 0.3s ease;
        box-sizing: border-box;
    }
    #slideMenu.open {
        transform: translateX(0);
    }
    #slideMenu a {
        padding: 14px 20px;
        font-size: 0.95rem;
    }
    #slideMenu .menu-email {
        font-size: 0.9rem;
        padding: 12px 20px;
        margin-top: auto;
        border-top: 1px solid #333;
    }

    /* Bourse */
    .bourse {
        height: auto;
    }
    .valeurbourse {
        font-size: .9em;
    }

    /* Cacher Diagramme & Maintenance dans le menu mobile */
    #slideMenu a[href="vue.php"],
    #slideMenu a[href="backup_restore.php"] {
        display: none !important;
    }
}

/* 💻 Tablettes (601–1024px) */
@media (min-width: 601px) and (max-width: 1024px) {
    body {
        display: block;
        height: auto;
        min-height: 100vh;
        padding: 12px 10px;
    }

    .calendar-container,
    .users-container,
    .login-container,
    .activation-container,
    .reset-container,
    .inscription-admin-wrapper {
        max-width: 95%;
        margin: 24px auto;
        padding: 18px;
        box-sizing: border-box;
    }

    .header-wrapper {
        margin-top: 14px;
    }

    .calendrier {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 12px;
    }
    .mois-item {
        width: 100%;
        height: 120px;
        margin: 0;
    }
    .navigation .btn {
        font-size: 1.25em;
        width: auto;
        padding: 8px 14px;
    }

    /* Synthèse – tableau scrollable */
    .synthese-modal {
        padding: 16px !important;
    }
    .synthese-modal-dialog {
        max-width: 95vw !important;
        min-width: 0 !important;
    }
    .synthese-table {
        display: block !important;
        width: 100% !important;
        overflow-x: auto !important;
        white-space: nowrap !important;
        font-size: 0.92em;
        border-collapse: collapse;
    }
    .synthese-table thead {
        display: table;
        width: 100%;
        table-layout: fixed;
    }
    .synthese-table tbody {
        display: table;
        width: 100%;
        table-layout: fixed;
    }
    .synthese-table th,
    .synthese-table td {
        padding: 10px 12px;
    }

    /* Croix synthèse */
    .synthese-close {
        position: absolute !important;
        top: 8px !important;
        right: 10px !important;
        background: rgba(255, 255, 255, 0.9) !important;
        border-radius: 999px !important;
        padding: 2px 8px !important;
        font-size: 1.3em !important;
        color: #999 !important;
        z-index: 20 !important;
    }
    .synthese-close:hover {
        color: #555 !important;
    }

    /* Modales un peu plus larges */
    .closedep-modal,
    .modal-ajout,
    .modal-options,
    .users-modal .modal-content {
        width: 80vw !important;
        max-width: 800px !important;
    }

    /* Users – tableau scrollable */
    .users-container {
        max-width: 95% !important;
        margin: 90px auto 24px !important;
        padding: 18px !important;
        box-sizing: border-box;
    }
    .users-table {
        display: block;
        width: 100%;
        overflow-x: auto;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
    }
    .users-table th,
    .users-table td {
        padding: 10px 12px;
    }
    .users-table td.actions {
        white-space: nowrap;
    }

    #slideMenu {
        width: 300px;
    }

    /* bourse_recap – un peu de marge haut */
    .recap-container {
        max-width: 90% !important;
        margin: 80px auto 24px !important;
        padding: 18px !important;
        box-sizing: border-box;
    }
}

/* =========================================================
   Correctifs iPhone / iOS Safari
   ========================================================= */
@supports (-webkit-touch-callout: none) {
    html,
    body {
        height: auto !important;
        min-height: 100dvh !important;
        min-height: -webkit-fill-available !important;
    }

    .header-wrapper {
        margin-top: max(12px, env(safe-area-inset-top));
    }

    input,
    select,
    textarea {
        font-size: 16px !important;
        -webkit-text-size-adjust: 100%;
    }

    .modal-ajout,
    .synthese-modal,
    .modal-options,
    .users-modal .modal-content,
    .login-modal-content,
    .closedep-modal {
        width: 92vw !important;
        max-width: 92vw !important;
        left: 50% !important;
        top: 50% !important;
        transform: translate(-50%, -50%) !important;
        border-radius: 10px;
    }

    #MonthPicker_date_debut {
        width: 100% !important;
    }
    .month-picker-month-table td,
    .month-picker-month-table .ui-button {
        width: auto !important;
    }

    .scroll-container,
    .users-table,
    .synthese-modal-dialog {
        -webkit-overflow-scrolling: touch;
    }

    .ajout-btn,
    .users-btn,
    .closedep-btn,
    .modal-options .btn-modifier,
    .modal-options .btn-supprimer {
        min-height: 44px;
    }
}