/* =========================================================================
    1. VARIABLES, RESETS & ARCHITECTURE GENERALE
========================================================================= */

html {
    height: -webkit-fill-available;
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background-color: #f0f2f5;
    color: #334155;
    display: grid;
    grid-template-rows: auto 1fr auto;
    min-height: 100vh;
    min-height: -webkit-fill-available;
}

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

a:focus-visible, button:focus-visible, input:focus-visible {
    outline: 3px solid #3b82f6;
    outline-offset: 2px;
}

/* =========================================================================
    2. HEADER (EN-TÊTE) & NAVIGATION DESKTOP
========================================================================= */

header {
    display: flex;
    align-items: center;
    padding: 15px 40px;
    background-color: #ffffff;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    position: sticky;
    top: 0;
    z-index: 1000;
}

header img {
    height: 50px;
    width: auto;
    margin-right: 15px;
}

header h1 {
    font-size: 24px;
    color: #1e293b;
    margin: 0;
    margin-right: auto;
}

header nav ul {
    display: flex;
    list-style-type: none;
    margin: 0;
    padding: 0;
    gap: 15px;
    margin-right: 30px;
}

header nav a {
    color: #475569;
    font-size: 16px;
    font-weight: 600;
    text-decoration: underline;
    text-decoration-thickness: 2px;
    text-underline-offset: 6px;
    padding: 10px 18px;
    border-radius: 25px;
    display: inline-block;
    transition: all 0.3s ease;
}

header nav a:hover {
    text-decoration: none;
    transform: scale(1.05);
    background-color: #e2e8f0;
    color: #0f172a;
}

header div {
    display: flex;
}

.Btn {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    width: 45px;
    height: 45px;
    border: none;
    border-radius: 40px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition-duration: .3s;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    background-color: #ef4444;
    text-decoration: none;
}

.sign {
    width: 45px; 
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition-duration: .3s;
    flex-shrink: 0;
}

.sign svg {
    width: 18px;
}

.sign svg path {
    fill: white;
}

.text {
    position: absolute;
    left: 45px;
    opacity: 0;
    color: white;
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    transition-duration: .3s;
}

.Btn:hover {
    width: 165px; 
    transition-duration: .3s;
}

.Btn:hover .text {
    opacity: 1;
    transition-duration: .3s;
}

.Btn:active {
    transform: translate(2px ,2px);
}

/* =========================================================================
    3. CONTENEURS ET PAGE DE CONNEXION (LOGIN)
========================================================================= */

.container {
    max-width: 1700px;
    margin: 40px auto;
    padding: 30px;
    background-color: #ffffff;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

.container h2 {
    color: #1e293b;
    margin-top: 0;
    margin-bottom: 25px;
    font-size: 22px;
    border-bottom: 2px solid #f1f5f9;
    padding-bottom: 10px;
}

.page-login {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    margin: 0;
    background-image: url('image/logo_chambly.png'); 
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-color: #f0f2f5;
}

.page-login form {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    width: 450px;
    box-sizing: border-box;
    padding: 40px 50px;
    border-radius: 20px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
}

.page-login label {
    margin-top: 15px;
    margin-bottom: 8px;
    font-weight: 600;
    color: #1e293b;
    font-size: 14px;
    letter-spacing: 0.5px;
}

.page-login input {
    padding: 14px 16px;
    font-size: 15px;
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    background-color: #f8fafc;
    color: #334155;
    transition: all 0.3s ease;
}

.page-login input:focus {
    outline: none;
    border-color: #3b82f6;
    background-color: #ffffff;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.15);
}

.page-login button {
    margin-top: 25px;
    padding: 15px;
    font-size: 16px;
    font-weight: 600;
    letter-spacing: 0.5px;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(37, 99, 235, 0.2);
    transition: all 0.3s ease;
}

.page-login button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(37, 99, 235, 0.35);
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
}

.page-login button:active {
    transform: translateY(0);
}

.page-login form p a {
    color: #3b82f6;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s ease;
}

.page-login form p a:hover {
    color: #1d4ed8;
    text-decoration: underline;
    text-underline-offset: 4px;
}

.page-login p[style*="color:red"] {
    background-color: #fef2f2;
    color: #ef4444 !important;
    padding: 12px;
    border-radius: 8px;
    border: 1px solid #fecaca;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 15px;
    margin-top: 0;
}

/* =========================================================================
    4. TABLEAUX ET COMPOSANTS INTERACTIFS DEKSTOP
========================================================================= */

.table-moderne {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}

.table-moderne th,
.table-moderne td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
}

.table-moderne th {
    background-color: #f8fafc;
    color: #475569;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 13px;
    letter-spacing: 0.5px;
}

.table-moderne tbody tr {
    transition: background-color 0.2s ease;
}

.table-moderne tbody tr:hover {
    background-color: #f1f5f9;
}

.texte-vide {
    text-align: center;
    color: #64748b;
    font-style: italic;
    padding: 20px;
}

.btn-modifier {
    background-color: #f59e0b;
    color: white;
    border: none;
    padding: 8px 14px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    font-size: 13px;
    transition: all 0.3s ease;
}

.btn-modifier:hover {
    background-color: #d97706;
    transform: translateY(-1px);
    box-shadow: 0 4px 6px rgba(217, 119, 6, 0.2);
}

.btn-supprimer {
    background-color: #ef4444;
    color: white;
    border: none;
    padding: 8px 14px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    font-size: 13px;
    transition: all 0.3s ease;
}

.btn-supprimer:hover {
    background-color: #c23616;
    transform: translateY(-1px);
    box-shadow: 0 4px 6px rgba(239, 68, 20, 0.2);
}

.btn-blue {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    border: none;
    padding: 8px 14px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    font-size: 13px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(59, 130, 246, 0.2);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    text-decoration: none;
}

.btn-blue:hover {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    transform: translateY(-1px);
    box-shadow: 0 6px 12px rgba(37, 99, 235, 0.35);
}

.btn-blue:active {
    transform: translateY(0);
}

.btn-pleine-largeur {
    width: 100%;
    margin-top: 25px;
}

/* =========================================================================
    5. FORMULAIRES ET ÉLÉMENTS DE DESIGN (UX/UI MODERNE)
========================================================================= */

.form-modern-card {
    background-color: #ffffff;
    padding: 30px 40px;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    border: 1px solid #e2e8f0;
    margin-bottom: 40px;
}

.form-modern-card .form-layout {
    display: flex;
    gap: 30px;
    margin-bottom: 25px;
}

.form-modern-card label {
    display: block;
    margin-bottom: 8px;
    margin-top: 15px;
    font-weight: 600;
    color: #475569;
    font-size: 14px;
}

.form-modern-card label:first-child { margin-top: 0; }

.form-modern-card input[type="text"],
.form-modern-card input[type="email"],
.form-modern-card input[type="datetime-local"],
.form-modern-card input.flatpickr-input {
    width: 100%;
    box-sizing: border-box;
    padding: 10px 12px;
    border: 1.5px solid #cbd5e1;
    border-radius: 8px;
    font-size: 14px;
    color: #334155;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.form-modern-card input[type="text"]:focus,
.form-modern-card input[type="email"]:focus,
.form-modern-card input[type="datetime-local"]:focus,
.form-modern-card input.flatpickr-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.input-quantite-modern {
    width: 85px;
    padding: 8px 12px;
    font-size: 16px;
    font-weight: 700;
    color: #0f172a;
    background-color: #f8fafc;
    border: 2px solid #cbd5e1;
    border-radius: 8px;
    text-align: center;
    transition: all 0.3s ease;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.03);
    outline: none;
    box-sizing: border-box;
}

.input-quantite-modern:focus {
    border-color: #3b82f6;
    background-color: #ffffff;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.15);
    transform: translateY(-1px);
}

.input-quantite-modern:disabled {
    background-color: #e2e8f0;
    color: #94a3b8;
    border-color: #e2e8f0;
    cursor: not-allowed;
    box-shadow: none;
}

.box-materiel {
    background-color: #f8fafc;
    border: 1px solid #e2e8f0;
    padding: 15px;
    border-radius: 8px;
}

.liste-materiel {
    max-height: 65vh;
    overflow-y: auto;
    padding-right: 10px;
}

.item-materiel {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
    padding-bottom: 10px;
    border-bottom: 1px dashed #cbd5e1;
}

.item-materiel:last-child { border-bottom: none; }
.item-materiel label { margin: 0; font-weight: 500; color: #334155; }

.item-materiel-card {
    background-color: #f8fafc;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
    transition: border-color 0.2s ease;
}

.item-materiel-card:hover { border-color: #94a3b8; }

.materiel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.stock-badge {
    font-size: 12px;
    color: #64748b;
    background: #e2e8f0;
    padding: 2px 8px;
    border-radius: 12px;
    margin-left: 8px;
}

.badge-statut {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    display: inline-block;
    text-transform: uppercase;
}
.badge-en-cours { background-color: #dcfce7; color: #166534; }
.badge-a-venir { background-color: #e0f2fe; color: #0369a1; }
.badge-termine { background-color: #f1f5f9; color: #475569; }

.day-pill {
    font-size: 11px;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 12px;
    border: 1px solid transparent;
}
.pill-success { background: #dcfce7; color: #166534; border-color: #bbf7d0; }
.pill-warning { background: #fef9c3; color: #854d0e; border-color: #fef08a; }
.pill-danger  { background: #fee2e2; color: #991b1b; border-color: #fecaca; }

.form-modern-card .options-event {
    margin-top: 20px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 5px 20px;
}

/* =========================================================================
    6. CHECKBOX HIGH-TECH (CYBER CHECKBOX ANIMATIONS)
========================================================================= */

.cyber-checkbox {
    --checkbox-size: 20px;
    --checkbox-color: #3b82f6;
    --checkbox-check-color: #ffffff;
    --checkbox-hover-color: #2563eb;
    --checkbox-spark-offset: -20px;
    position: relative;
    display: flex !important;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    user-select: none;
    margin: 0 !important;
}

.cyber-checkbox input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.cyber-checkbox__mark {
    position: relative;
    display: inline-block;
    width: var(--checkbox-size);
    height: var(--checkbox-size);
    flex-shrink: 0;
}

.cyber-checkbox__box {
    position: absolute;
    inset: 0;
    border: 2px solid #cbd5e1;
    border-radius: 6px;
    background: #ffffff;
    transition: all 0.2s ease;
}

.cyber-checkbox__check {
    position: absolute;
    inset: 0;
    padding: 3px;
    stroke: var(--checkbox-check-color);
    stroke-width: 2.5px;
    stroke-linecap: round;
    stroke-linejoin: round;
    fill: none;
    transform: scale(0);
    transition: transform 0.2s cubic-bezier(0.12, 0.4, 0.29, 1.46);
}

.cyber-checkbox:hover .cyber-checkbox__box {
    border-color: var(--checkbox-hover-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.cyber-checkbox input:checked + .cyber-checkbox__mark .cyber-checkbox__box {
    background: var(--checkbox-color);
    border-color: var(--checkbox-color);
}

.cyber-checkbox input:checked + .cyber-checkbox__mark .cyber-checkbox__check {
    transform: scale(1);
}

.cyber-checkbox input:checked + .cyber-checkbox__mark .cyber-checkbox__spark {
    animation: spark 0.4s ease-out;
}

.cyber-checkbox__spark {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 4px;
    height: 4px;
    background: #00f2fe;
    border-radius: 50%;
    opacity: 0;
    transform-origin: center center;
    box-shadow: 0 0 8px #00f2fe;
}

.cyber-checkbox__spark:nth-child(1) { transform: rotate(0deg) translateX(var(--checkbox-spark-offset)); }
.cyber-checkbox__spark:nth-child(2) { transform: rotate(90deg) translateX(var(--checkbox-spark-offset)); }
.cyber-checkbox__spark:nth-child(3) { transform: rotate(180deg) translateX(var(--checkbox-spark-offset)); }
.cyber-checkbox__spark:nth-child(4) { transform: rotate(270deg) translateX(var(--checkbox-spark-offset)); }

@keyframes spark {
    0% { opacity: 0; transform: scale(0) rotate(0deg) translateX(var(--checkbox-spark-offset)); }
    50% { opacity: 1; }
    100% { opacity: 0; transform: scale(1) rotate(0deg) translateX(calc(var(--checkbox-spark-offset) * 1.5)); }
}

.cyber-checkbox__particles { position: absolute; inset: -50%; pointer-events: none; }
.cyber-checkbox__particles div {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--checkbox-color);
    opacity: 0;
    box-shadow: 0 0 10px var(--checkbox-color);
}

.cyber-checkbox input:checked + .cyber-checkbox__mark .particle-1 { animation: particle-1 0.4s ease-out forwards; }
.cyber-checkbox input:checked + .cyber-checkbox__mark .particle-2 { animation: particle-2 0.4s ease-out forwards 0.1s; }
.cyber-checkbox input:checked + .cyber-checkbox__mark .particle-3 { animation: particle-3 0.4s ease-out forwards 0.15s; }
.cyber-checkbox input:checked + .cyber-checkbox__mark .particle-4 { animation: particle-4 0.4s ease-out forwards 0.05s; }
.cyber-checkbox input:checked + .cyber-checkbox__mark .particle-5 { animation: particle-5 0.4s ease-out forwards 0.12s; }
.cyber-checkbox input:checked + .cyber-checkbox__mark .particle-6 { animation: particle-6 0.4s ease-out forwards 0.08s; }
.cyber-checkbox input:checked + .cyber-checkbox__mark .particle-7 { animation: particle-7 0.4s ease-out forwards 0.18s; }
.cyber-checkbox input:checked + .cyber-checkbox__mark .particle-8 { animation: particle-8 0.4s ease-out forwards 0.15s; }

@keyframes particle-1 { 0% { transform: translate(0, 0) scale(0); opacity: 0; background: #00f2fe; } 20% { opacity: 1; } 100% { transform: translate(-55px, -30px) scale(1.6); opacity: 0; background: #9d4edd; } }
@keyframes particle-2 { 0% { transform: translate(0, 0) scale(0); opacity: 0; background: #00f2fe; } 20% { opacity: 1; } 100% { transform: translate(35px, -55px) scale(1.4); opacity: 0; background: #9d4edd; } }
@keyframes particle-3 { 0% { transform: translate(0, 0) scale(0); opacity: 0; background: #00f2fe; } 20% { opacity: 1; } 100% { transform: translate(60px, 25px) scale(1.7); opacity: 0; background: #9d4edd; } }
@keyframes particle-4 { 0% { transform: translate(0, 0) scale(0); opacity: 0; background: #00f2fe; } 20% { opacity: 1; } 100% { transform: translate(-25px, 50px) scale(1.3); opacity: 0; background: #9d4edd; } }
@keyframes particle-5 { 0% { transform: translate(0, 0) scale(0); opacity: 0; background: #00f2fe; } 20% { opacity: 1; } 100% { transform: translate(-50px, 40px) scale(1.5); opacity: 0; background: #9d4edd; } }
@keyframes particle-6 { 0% { transform: translate(0, 0) scale(0); opacity: 0; background: #00f2fe; } 20% { opacity: 1; } 100% { transform: translate(50px, -20px) scale(1.6); opacity: 0; background: #9d4edd; } }
@keyframes particle-7 { 0% { transform: translate(0, 0) scale(0); opacity: 0; background: #00f2fe; } 20% { opacity: 1; } 100% { transform: translate(-15px, -60px) scale(1.4); opacity: 0; background: #9d4edd; } }
@keyframes particle-8 { 0% { transform: translate(0, 0) scale(0); opacity: 0; background: #00f2fe; } 20% { opacity: 1; } 100% { transform: translate(20px, 65px) scale(1.8); opacity: 0; background: #9d4edd; } }

/* =========================================================================
    7. POPUPS (MODALES DESKTOP)
========================================================================= */

body.modal-open { overflow: hidden; }

.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: #ffffff;
    padding: 30px 40px;
    border-radius: 16px;
    width: 100%;
    max-width: 900px;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    position: relative;
    animation: apparitionModale 0.3s ease-out;
}

@keyframes apparitionModale {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

.modal-content h3 {
    margin-top: 0;
    color: #1e293b;
    font-size: 20px;
    border-bottom: 2px solid #f1f5f9;
    padding-bottom: 10px;
    margin-bottom: 20px;
}

.btn-close, .close {
    position: absolute;
    top: 15px;
    right: 20px;
    background: transparent;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}
.btn-close svg { width: 24px; height: 24px; }
.btn-close:hover, .close:hover {
    color: #ef4444;
    background-color: #fee2e2;
    transform: rotate(90deg);
}

.form-layout { display: flex; gap: 30px; }
.form-left, .form-right { flex: 1; }
.form-left label:first-child { margin-top: 0; }

.modal-content label {
    display: block;
    margin-bottom: 8px;
    margin-top: 15px;
    font-weight: 600;
    color: #475569;
    font-size: 14px;
}

.modal-content input[type="text"],
.modal-content input[type="email"],
.modal-content input[type="datetime-local"] {
    width: 100%;
    box-sizing: border-box;
    padding: 10px 12px;
    border: 1.5px solid #cbd5e1;
    border-radius: 8px;
    font-size: 14px;
    color: #334155;
    transition: border-color 0.3s ease;
}

.modal-content input[type="text"]:focus,
.modal-content input[type="email"]:focus,
.modal-content input[type="datetime-local"]:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* =========================================================================
    8. PAGES SPÉCIFIQUES (ADMIN, VALORISATION, CALENDRIER)
========================================================================= */

/* Administration */
.page-admin .alert-error { background-color: #fef2f2; color: #ef4444; padding: 12px; border-radius: 8px; border: 1px solid #fecaca; margin-bottom: 20px; }
.page-admin .alert-success { background-color: #f0fdf4; color: #16a34a; padding: 12px; border-radius: 8px; border: 1px solid #bbf7d0; margin-bottom: 20px; }
.page-admin .admin-form-card { background-color: #f8fafc; border: 1px solid #e2e8f0; padding: 25px; border-radius: 12px; margin-bottom: 35px; }
.page-admin .admin-form-row { display: flex; gap: 20px; margin-bottom: 20px; }
.page-admin .admin-form-group { flex: 1; }
.page-admin .admin-form-group label { display: block; margin-bottom: 8px; font-weight: 600; color: #475569; font-size: 14px; }
.page-admin .admin-form-group input[type="text"], .page-admin .admin-form-group input[type="password"] { width: 100%; padding: 10px 12px; border: 1.5px solid #cbd5e1; border-radius: 8px; box-sizing: border-box; }
.page-admin .admin-form-actions { display: flex; justify-content: space-between; align-items: center; }

.badge-admin { background-color: #fee2e2; color: #991b1b; padding: 4px 10px; border-radius: 12px; font-size: 12px; font-weight: bold; }
.badge-user { background-color: #e0f2fe; color: #075985; padding: 4px 10px; border-radius: 12px; font-size: 12px; font-weight: bold; }

/* Calendrier & FullCalendar UI Hooks */
/* Calendrier & FullCalendar UI Hooks */
.calendar-container {
    margin-top: 20px;
    background: #faf7f7;
    padding: 20px;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.fc-event, .fc-event .fc-event-main, .fc-event .fc-event-title, .fc-event .fc-event-time, .event-cliquable {
    cursor: pointer !important;
}

.fc-event:hover {
    filter: brightness(0.9);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15) !important;
    transition: all 0.2s ease;
}

/* --- NOUVEAU DESIGN DES BOUTONS DU CALENDRIER --- */

/* Espace sous la barre d'outils */
.fc-header-toolbar {
    margin-bottom: 25px !important;
}

/* Titre du mois */
.fc-toolbar-title {
    font-size: 20px !important;
    color: #1e293b !important;
    font-weight: 700 !important;
    text-transform: capitalize;
}

/* Séparer les boutons collés entre eux */
.fc .fc-button-group {
    display: flex;
    gap: 8px; /* L'espace magique entre les boutons */
}

/* Design de base des boutons (Inactifs) */
.fc .fc-button-primary {
    background-color: #ffffff !important;
    color: #475569 !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 8px !important; /* Bords bien arrondis partout */
    font-weight: 600 !important;
    font-size: 13px !important;
    padding: 8px 14px !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02) !important;
    text-transform: capitalize !important;
    transition: all 0.2s ease !important;
}

/* Survol des boutons inactifs */
.fc .fc-button-primary:hover {
    background-color: #f8fafc !important;
    color: #0f172a !important;
    border-color: #94a3b8 !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05) !important;
}

/* Design du bouton Actif (ex: vue Mois en cours) */
.fc .fc-button-primary:not(:disabled).fc-button-active,
.fc .fc-button-primary:not(:disabled):active {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%) !important;
    color: #ffffff !important;
    border-color: transparent !important;
    box-shadow: 0 4px 10px rgba(37, 99, 235, 0.2) !important;
    transform: translateY(0) !important;
}

/* Ajustement des flèches précédent/suivant */
.fc .fc-icon {
    font-size: 1.2em !important;
    vertical-align: middle;
}

/* Valorisation */
.page-valorisation .valorisation-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 30px; border-bottom: 2px solid #e2e8f0; padding-bottom: 15px; }
.page-valorisation .valorisation-card { background-color: #ffffff; border: 1px solid #e2e8f0; border-radius: 12px; padding: 25px; margin-bottom: 30px; }
.page-valorisation .table-valorisation { width: 100%; border-collapse: collapse; }
.page-valorisation .table-valorisation th, .page-valorisation .table-valorisation td { padding: 14px 16px; border-bottom: 1px solid #e2e8f0; }
.page-valorisation .table-valorisation th { background-color: #f8fafc; color: #475569; font-size: 13px; font-weight: 600; text-transform: uppercase; }
.page-valorisation .table-valorisation td.col-montant { text-align: right; font-weight: 500; }
.page-valorisation .table-valorisation td.col-sous-total { text-align: right; font-weight: 700; }

.page-valorisation .total-general-box {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    color: white;
    padding: 25px;
    border-radius: 12px;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 20px;
}
.page-valorisation .total-general-box h3 { margin: 0; font-size: 32px; color: #ffffff; }

/* Footer Internes */
.footer-interne { background-color: #ffffff; border-top: 1px solid #e2e8f0; padding: 20px 40px; color: #64748b; font-size: 13px; }
.footer-content { display: flex; justify-content: space-between; align-items: center; }
.footer-links a { color: #3b82f6; text-decoration: none; font-weight: 500; }
.footer-links a:hover { color: #1d4ed8; text-decoration: underline; }


/* =========================================================================
    9. GRANDE SECTION RESPONSIVE UNIQUE (ÉCRANS < 768px)
========================================================================= */

@media (max-width: 768px) {
    
    header {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        justify-content: space-between;
        padding: 12px 15px;
        gap: 15px;
    }

    header img { height: 35px; margin-right: 10px; }
    header h1 { font-size: 18px; flex: 1; }
    .Btn { width: 40px !important; height: 40px !important; transition: none; }
    .Btn .text { display: none !important; }
    .sign { width: 40px; height: 40px; }
    header nav { width: 100%; order: 3; }

    header nav ul {
        display: flex;
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        gap: 10px;
        padding-bottom: 8px;
    }

    header nav ul::-webkit-scrollbar { display: none; }

    header nav a {
        white-space: nowrap;
        font-size: 14px;
        padding: 8px 14px;
        background-color: #f8fafc;
        border: 1px solid #e2e8f0;
    }

    .page-login { align-items: flex-start; background-image: none; background-color: #ffffff; }
    .page-login form { width: 100%; min-height: 100vh; padding: 40px 25px; border: none; border-radius: 0; box-shadow: none; background: #ffffff; }

    .container, .form-modern-card, .page-admin .admin-form-card {
        padding: 15px !important;
        margin: 10px !important;
        width: auto !important;
        box-shadow: 0 2px 10px rgba(0,0,0,0.02) !important;
    }
    .container h2 { font-size: 18px; }

    .form-layout, 
    .page-admin .admin-form-row,
    .form-modern-card .options-event,
    .form-modern-card div[style*="grid"],
    #zone_salle div[style*="grid"],
    #zone_salle_demande div[style*="grid"],
    div[style*="grid-template-columns"] {
        display: flex !important;
        flex-direction: column !important;
        gap: 15px !important;
        width: 100% !important;
    }

    .form-modern-card input[type="text"],
    .form-modern-card input[type="email"],
    .form-modern-card input[type="datetime-local"],
    .form-modern-card input.flatpickr-input,
    .modal-content input {
        font-size: 16px !important;
        width: 100% !important;
    }

    .modal { align-items: flex-end; }
    .modal-content {
        max-height: 85vh;
        border-radius: 20px 20px 0 0;
        padding: 25px 20px 20px 20px;
        margin: 0;
        width: 100%;
        animation: slideUpMobile 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    }

    @keyframes slideUpMobile {
        from { transform: translateY(100%); }
        to { transform: translateY(0); }
    }

    .close, .btn-close { top: 15px; right: 15px; }

    .table-moderne, .table-moderne tbody, .table-moderne tr, .table-moderne td,
    .page-valorisation .table-valorisation, .page-valorisation .table-valorisation tbody, .page-valorisation .table-valorisation tr, .page-valorisation .table-valorisation td {
        display: block;
        width: 100%;
        box-sizing: border-box;
    }
    .table-moderne thead, .page-valorisation .table-valorisation thead { display: none; }
    
    .table-moderne tr, .page-valorisation .table-valorisation tr {
        margin-bottom: 15px;
        border: 1px solid #e2e8f0;
        border-radius: 10px;
        box-shadow: 0 2px 6px rgba(0,0,0,0.03);
        background-color: #ffffff;
    }
    
    .table-moderne td, .page-valorisation .table-valorisation td {
        text-align: right !important;
        padding: 12px 15px 12px 45%;
        border-bottom: 1px solid #f1f5f9;
        position: relative;
        display: flex;
        justify-content: flex-end;
        align-items: center;
        min-height: 35px;
    }
    .table-moderne td:last-child, .page-valorisation .table-valorisation td:last-child {
        border-bottom: none;
        background-color: #f8fafc;
    }
    .table-moderne td::before, .page-valorisation .table-valorisation td::before {
        content: attr(data-label);
        position: absolute;
        left: 15px;
        width: 40%;
        text-align: left;
        font-weight: 600;
        color: #64748b;
        font-size: 11px;
        text-transform: uppercase;
    }

    .page-valorisation .valorisation-header { flex-direction: column; align-items: stretch; gap: 15px; }
    .page-valorisation .total-general-box { flex-direction: column; text-align: center; padding: 20px 15px; } 
    .fc-header-toolbar { flex-direction: column; gap: 12px; }
    .fc-toolbar-chunk { display: flex; flex-wrap: wrap; justify-content: center; gap: 5px; }
    .footer-content { flex-direction: column; gap: 12px; text-align: center; }
    
    .cache-mobile {
        display: none !important;
    }
}

/* =========================================================================
    10. ZONE DE CAPTURE PHOTO (MOBILE & TERRAIN)
========================================================================= */

input[type="file"],
.input-file-cache {
    display: none !important;
}

.zone-capture-terrain {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    width: 100%;
}

.apercu-photo {
    max-width: 80px;
    max-height: 80px;
    border-radius: 6px;
    object-fit: cover;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

.btn-photo-mobile {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
    padding: 10px 16px;
    border-radius: 8px;
    user-select: none;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    box-shadow: 0 4px 6px rgba(59, 130, 246, 0.2);
    transition: all 0.3s ease;
}

.btn-photo-mobile:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 12px rgba(37, 99, 235, 0.35);
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
}

@media (max-width: 768px) {
    .zone-capture-terrain {
        align-items: flex-end;
    }
    .header--hidden {
        transform: translateY(-100%);
    }
    .header--hidden {
        transform: translateY(-100%);
    }
}