* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ========== LOADER OVERLAY ========== */
.loader-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}
/* ========== WELCOME MODAL ========== */
.welcome-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.welcome-modal-content {
    background: white;
    border-radius: 25px;
    padding: 0;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(242, 116, 5, 0.4);
    animation: slideUp 0.4s ease;
    overflow: hidden;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.welcome-header {
    background: linear-gradient(135deg, #F25C05 0%, #ff7701 100%);
    color: white;
    padding: 40px 30px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.welcome-header::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 300px;
    height: 300px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    animation: float 6s ease-in-out infinite;
}

.welcome-logo-circle {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    position: relative;
    margin: 0 auto 20px;
    animation: pulse 3s ease-in-out infinite;
}

.welcome-logo-circle::before {
    content: "";
    position: absolute;
    inset: 11px;
    border: 8px solid white;
    border-radius: 50%;
}

.welcome-logo-circle::after {
    content: "";
    position: absolute;
    width: 28px;
    height: 28px;
    background: white;
    border-radius: 50%;
    left: 50%;
    bottom: 23px;
    transform: translateX(-50%);
}

.welcome-header h2 {
    font-size: 2em;
    margin: 0 0 10px 0;
    font-weight: bold;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
    position: relative;
    z-index: 1;
}

.welcome-header p {
    font-size: 1.1em;
    margin: 0;
    opacity: 0.95;
    position: relative;
    z-index: 1;
}

.welcome-body {
    padding: 40px 30px;
}

.welcome-body > p {
    text-align: center;
    color: #666;
    margin-bottom: 25px;
    font-size: 1.05em;
}

.welcome-body .form-group {
    margin-bottom: 25px;
}

.welcome-body .form-group label {
    display: block;
    color: #F25C05;
    font-weight: bold;
    margin-bottom: 10px;
    font-size: 1.1em;
}

.welcome-body .form-group input {
    width: 100%;
    padding: 15px;
    border: 2px solid #F29F80;
    border-radius: 12px;
    font-size: 1.05em;
    transition: all 0.3s ease;
    background: white;
}

.welcome-body .form-group input:focus {
    outline: none;
    border-color: #ff7701;
    box-shadow: 0 0 0 3px rgba(242, 116, 5, 0.1);
}

.welcome-body .primary-btn {
    width: 100%;
    margin: 0;
    max-width: 100%;
}

/* Dark mode pour la modal */
body.dark-mode .welcome-modal-content {
    background: #2c2c2c;
}

body.dark-mode .welcome-body > p {
    color: #ccc;
}

body.dark-mode .welcome-body .form-group input {
    background: #3a3a3a;
    color: #e0e0e0;
    border-color: #F28D52;
}

body.dark-mode .welcome-body .form-group label {
    color: #F28D52;
}

.loader-container {
    text-align: center;
}

/* Loader inspiré de uiball.com - Ring style */
.loader {
    width: 60px;
    height: 60px;
    border: 5px solid rgba(242, 116, 5, 0.2);
    border-top-color: #ff7701;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loader-text {
    color: white;
    font-size: 1.1em;
    font-weight: bold;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

/* ========== BASE STYLES ========== */

body {
    font-family: 'Arial', sans-serif;
    background: #F2F2F2;
    color: #333;
    transition: background 0.3s ease, color 0.3s ease;
}

.dark-mode-checkbox {
    display: none;
}

.theme-toggle {
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50px;
    padding: 10px 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s ease;
    margin-left: 20px;
}

.theme-toggle:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
}

.sun-icon,
.moon-icon {
    font-size: 1.5em;
    transition: all 0.3s ease;
}

.moon-icon {
    display: none;
}

header {
    background: linear-gradient(135deg, #F25C05 0%, #ff7701 100%);
    color: white;
    padding: 40px 20px;
    box-shadow: 0 6px 30px rgba(242, 116, 5, 0.4);
    position: relative;
    overflow: hidden;
}

header::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 500px;
    height: 500px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    animation: float 6s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-20px) rotate(10deg); }
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
    z-index: 1;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 0;
}

.logo-section {
    display: flex;
    align-items: center;
    gap: 20px;
}

.logo-circle {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    position: relative;
    animation: pulse 3s ease-in-out infinite;
}

.logo-circle::before {
    content: "";
    position: absolute;
    inset: 11px;
    border: 8px solid white;
    border-radius: 50%;
}

.logo-circle::after {
    content: "";
    position: absolute;
    width: 28px;
    height: 28px;
    background: white;
    border-radius: 50%;
    left: 50%;
    bottom: 23px;
    transform: translateX(-50%);
}

@keyframes pulse {
    0%, 100% { transform: scale(1.40); }
    50% { transform: scale(1.15); }
}

.logo-text h1 {
    font-size: 2.8em;
    font-weight: 900;
    text-shadow: 3px 3px 6px rgba(0,0,0,0.3);
    letter-spacing: 2px;
    margin: 0;
}

.logo-text p {
    font-size: 1em;
    margin-top: 5px;
    opacity: 0.95;
    font-weight: 300;
    letter-spacing: 1px;
}

.user-info {
    text-align: right;
    background: rgba(255, 255, 255, 0.15);
    padding: 15px 25px;
    border-radius: 15px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.user-info p {
    font-size: 0.95em;
    margin: 5px 0;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
}

.section {
    background: white;
    border-radius: 20px;
    padding: 35px;
    margin-bottom: 35px;
    box-shadow: 0 8px 30px rgba(242, 116, 5, 0.15);
    transition: all 0.4s ease;
    border: 1px solid rgba(242, 116, 5, 0.1);
}

.section:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 40px rgba(242, 116, 5, 0.25);
}

.section-title {
    color: #ff7701;
    font-size: 2em;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 4px solid #ff7701;
    display: flex;
    align-items: center;
    font-weight: 800;
}

.section-title::before {
    content: '';
    width: 10px;
    height: 35px;
    background: linear-gradient(180deg, #ff7701 0%, #F25C05 100%);
    margin-right: 15px;
    border-radius: 5px;
    box-shadow: 0 3px 10px rgba(242, 116, 5, 0.3);
}

.news-list {
    margin: 20px 0;
}

.news-item {
    background: linear-gradient(135deg, #ffffff 0%, #F2F2F2 100%);
    border-left: 5px solid #ff7701;
    padding: 25px;
    margin-bottom: 20px;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: stretch;
    transition: all 0.3s ease;
    box-shadow: 0 3px 15px rgba(242, 116, 5, 0.1);
    min-height: 120px;
}

.news-item:hover {
    box-shadow: 0 8px 25px rgba(242, 116, 5, 0.25);
    transform: translateX(8px);
    border-left-width: 8px;
}

.news-item .news-actions,
.news-item > div[style*="display:flex"] {
    display: flex !important;
    gap: 12px;
    justify-content: center;
    align-items: center;
    margin-top: 18px;
}

.news-content h3 {
    color: #F25C05;
    margin-bottom: 10px;
    font-size: 1.3em;
}

.news-content p {
    margin-bottom: 8px;
}

.news-date {
    color: #F28D52;
    font-size: 0.9em;
    font-weight: 600;
}

/* Boutons carrés harmonisés pour les actions du calendrier (réservations) */
.calendar-btn, .add-btn, .delete-btn {
    width: 64px;
    height: 64px;
    min-width: 64px;
    min-height: 64px;
    max-width: 64px;
    max-height: 64px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1em;
    border-radius: 16px;
    box-shadow: 0 4px 15px rgba(242, 116, 5, 0.18);
    margin: 0;
    border: none;
    font-weight: bold;
    transition: background 0.3s, box-shadow 0.3s, color 0.3s;
    color: white;
    background: linear-gradient(135deg, #ff7701 0%, #F25C05 100%);
    cursor: pointer;
    text-align: center;
    overflow: hidden;
    white-space: nowrap;
}
.calendar-btn span, .calendar-btn-text, .add-btn span, .add-btn-text {
    display: block;
    width: 100%;
    text-align: center;
    font-size: 0.95em;
    line-height: 1.1;
    word-break: break-word;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.calendar-btn {
    font-size: 1em;
    letter-spacing: 0.5px;
}
@media (max-width: 600px) {
    .calendar-btn, .add-btn, .delete-btn {
        min-width: 38px;
        min-height: 38px;
        max-width: 38px;
        max-height: 38px;
        font-size: 0.85em;
    }
}

/* Bouton secondaire pour 'Afficher tout'/'Réduire' dans les actualités */
.secondary-btn {
    width: auto;
    min-width: 160px;
    max-width: 320px;
    padding: 12px 28px;
    border-radius: 16px;
    background: #fff;
    color: #F25C05;
    border: 2px solid #F25C05;
    font-size: 1.08em;
    font-weight: bold;
    box-shadow: 0 2px 8px rgba(242, 116, 5, 0.08);
    cursor: pointer;
    display: block;
    margin: 0 auto;
    transition: background 0.2s, color 0.2s, border 0.2s;
}
.secondary-btn:hover {
    background: #FFF3E6;
    color: #ff7701;
    border-color: #ff7701;
}
.secondary-btn:active {
    background: #FFE0C2;
    color: #F25C05;
}

/* Bouton principal pour 'Publier l'actualité' */
.primary-btn {
    width: auto;
    min-width: 160px;
    max-width: 320px;
    padding: 14px 32px;
    border-radius: 16px;
    background: linear-gradient(135deg, #ff7701 0%, #F25C05 100%);
    color: #fff;
    border: 2px solid #F25C05;
    font-size: 1.12em;
    font-weight: bold;
    box-shadow: 0 2px 12px rgba(242, 116, 5, 0.13);
    cursor: pointer;
    display: block;
    margin: 0 auto;
    transition: background 0.2s, color 0.2s, border 0.2s;
}
.primary-btn:hover {
    background: linear-gradient(135deg, #F25C05 0%, #ff7701 100%);
    color: #fff;
    border-color: #ff7701;
}
.primary-btn:active {
    background: #F25C05;
    color: #fff;
}

/* Formulaire d'édition d'actualité (inline) */
/* Mode clair */
/* FIX #1: Actualités en mode clair */
body:not(.dark-mode) .news-item.editing {
    background: linear-gradient(135deg, #ffffff 0%, #F2F2F2 100%) !important;
}

/* Mode sombre */
body.dark-mode .news-item.editing {
    background: #222 !important;
    border-left: 5px solid #F28D52;
}


.news-item.editing .news-content {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.news-item.editing .form-group {
    margin-bottom: 0;
}

body:not(.dark-mode) .news-item.editing input,
body:not(.dark-mode) .news-item.editing textarea {
    background: #ffffff;
    color: #222;
    border: 2px solid #F28D52;
    font-size: 1.1em;
    padding: 12px;
}
body.dark-mode .news-item.editing input,
body.dark-mode .news-item.editing textarea {
    background: #333;
    color: #fff;
    border: 2px solid #F28D52;
    font-size: 1.1em;
    padding: 12px;
}

.news-item.editing label {
    color: #F28D52;
    font-weight: bold;
    margin-bottom: 6px;
    font-size: 1.08em;
}

.news-item.editing .news-date {
    color: #F28D52;
    font-size: 1em;
    margin-top: 8px;
}

.news-form {
    background: linear-gradient(135deg, #F2F2F2 0%, #ffffff 100%);
    padding: 25px;
    border-radius: 15px;
    margin-top: 25px;
    border: 3px solid #F28D52;
    box-shadow: 0 5px 20px rgba(242, 141, 82, 0.2);
}
/* =========================
   CHAMPS EN MODE CLAIR
========================= */

body:not(.dark-mode) input,
body:not(.dark-mode) textarea {
    background-color: #ffffff;
    color: #222;
    border: 1px solid #F28D52;
}

/* Placeholder */
body:not(.dark-mode) input::placeholder,
body:not(.dark-mode) textarea::placeholder {
    color: #777;
}


.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    color: #F25C05;
    font-weight: bold;
    margin-bottom: 8px;
    font-size: 1.05em;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 14px;
    border: 2px solid #F29F80;
    border-radius: 8px;
    font-size: 1em;
    transition: all 0.3s ease;
    background: white;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #ff7701;
    box-shadow: 0 0 0 3px rgba(242, 116, 5, 0.1);
}

.add-btn {
    background: linear-gradient(135deg, #ff7701 0%, #F25C05 100%);
    color: white;
    border: none;
    padding: 14px 35px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 1.05em;
    font-weight: bold;
    transition: background 0.3s, box-shadow 0.3s, color 0.3s;
    box-shadow: 0 5px 20px rgba(242, 116, 5, 0.4);
    transform: none !important;
}

.add-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(242, 116, 5, 0.5);
}

.add-btn:active {
    transform: none !important;
}

.hr-documents {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.document-card {
    background: linear-gradient(135deg, #ffffff 0%, #F2F2F2 100%);
    padding: 30px;
    border-radius: 15px;
    border: 3px solid #F28D52;
    transition: all 0.4s ease;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.document-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 5px;
    background: linear-gradient(90deg, #ff7701, #F25C05, #F28D52, #F29F80);
    transform: scaleX(0);
    transition: transform 0.4s ease;
}

.document-card:hover::before {
    transform: scaleX(1);
}

.document-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 35px rgba(242, 116, 5, 0.3);
    border-color: #ff7701;
}

.document-icon {
    font-size: 3.5em;
    margin-bottom: 15px;
    filter: drop-shadow(0 5px 10px rgba(242, 116, 5, 0.3));
}

.document-card h3 {
    color: #F25C05;
    margin-bottom: 12px;
    font-size: 1.3em;
}

.document-card p {
    color: #666;
    font-size: 0.95em;
    margin-bottom: 20px;
}

.download-btn {
    background: linear-gradient(135deg, #ff7701 0%, #F25C05 100%);
    color: white;
    text-decoration: none;
    padding: 12px 25px;
    border-radius: 10px;
    display: inline-block;
    transition: all 0.3s ease;
    font-weight: bold;
    box-shadow: 0 4px 15px rgba(242, 116, 5, 0.3);
}

.download-btn:hover {
    background: linear-gradient(135deg, #F25C05 0%, #ff7701 100%);
    transform: scale(1.08);
    box-shadow: 0 6px 20px rgba(242, 116, 5, 0.4);
}

.calendar-container {
    background: linear-gradient(135deg, #F2F2F2 0%, #ffffff 100%);
    padding: 25px;
    border-radius: 25px;
    border: 3px solid #F28D52;
    margin-bottom: 30px;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 10px;
}

.calendar-header {
    background: linear-gradient(135deg, #ff7701 0%, #F25C05 100%);
    color: white;
    padding: 12px;
    text-align: center;
    font-weight: bold;
    border-radius: 8px;
    font-size: 0.9em;
}

.calendar-day {
    background: white;
    padding: 15px;
    text-align: center;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid #F29F80;
    min-height: 70px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    font-weight: bold;
}

.calendar-day:hover:not(.empty) {
    background: #F29F80;
    color: white;
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(242, 116, 5, 0.3);
}

.calendar-day.empty {
    background: #f5f5f5;
    border: 2px solid #e0e0e0;
    cursor: default;
    pointer-events: none;
}

.calendar-day.today {
    background: linear-gradient(135deg, #ff7701 0%, #F25C05 100%);
    color: white;
    border-color: #F25C05;
}

.calendar-day.has-visit {
    background: linear-gradient(135deg, #F28D52 0%, #F29F80 100%);
    color: white;
}

.day-number {
    font-size: 1.2em;
    margin-bottom: 5px;
}

.today-badge,
.visit-badge {
    font-size: 0.65em;
    padding: 2px 6px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.3);
    margin-top: 3px;
}

.visit-form {
    display: none;
    background: white !important;
    padding: 0 !important;
    border-radius: 18px !important;
    border: 3px solid #ff7701 !important;
    box-shadow: 0 10px 30px rgba(242, 116, 5, 0.15) !important;
    margin-top: 20px !important;
    overflow: hidden !important;
    flex-direction: column !important;
}

.visit-form.active {
    display: flex !important;
    flex-direction: column !important;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.visit-form h4 {
    background: linear-gradient(135deg, #ff7701 0%, #F25C05 100%) !important;
    color: white !important;
    margin: 0 !important;
    padding: 16px 24px !important;
    border-radius: 0 !important;
    font-size: 1.1em !important;
    font-weight: bold !important;
    text-align: left !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

.visit-form > .form-group {
    padding: 0 28px !important;
    box-sizing: border-box !important;
    margin-bottom: 18px !important;
}

.visit-form > .form-group:first-of-type {
    padding-top: 28px !important;
}

.visit-form > .form-group label {
    display: block !important;
    color: #ff7701 !important;
    font-weight: bold !important;
    margin-bottom: 8px !important;
    font-size: 1.05em !important;
}

.visit-form > .form-group input,
.visit-form > .form-group textarea {
    width: 100% !important;
    padding: 14px 16px !important;
    border-radius: 10px !important;
    font-size: 1.05em !important;
    border-top: 2px solid #F29F80 !important;
    outline: none !important;
    transition: all 0.3s ease !important;
    box-sizing: border-box !important;
    background: #ffffff !important;
    color: #222 !important;
}

.visit-form > .form-group input:focus,
.visit-form > .form-group textarea:focus {
    outline: none !important;
    border-color: #ff7701 !important;
    box-shadow: 0 0 0 3px rgba(242, 116, 5, 0.1) !important;
}

.visit-form > .form-group textarea {
    resize: vertical !important;
    min-height: 90px !important;
    font-family: Arial, sans-serif !important;
}

.visit-form > .add-btn {
    align-self: center !important;
    margin: 28px auto 28px auto !important;
    padding: 14px 32px !important;
    width: auto !important;
    min-width: 160px !important;
    max-width: 320px !important;
    height: auto !important;
    min-height: auto !important;
    max-height: none !important;
    border-radius: 16px !important;
    font-size: 1.12em !important;
    display: block !important;
    text-align: center !important;
}

.visit-form > .form-group:last-of-type {
    padding-bottom: 0 !important;
    margin-bottom: 28px !important;
    border-bottom: 2px solid #F29F80 !important;
    padding-bottom: 28px !important;
}

body.dark-mode .visit-form {
    background: #2b2b2b !important;
}

body.dark-mode .visit-form > .form-group input,
body.dark-mode .visit-form > .form-group textarea {
    background: #3a3a3a !important;
    color: #e0e0e0 !important;
    border-color: #F28D52 !important;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.visit-form h4 {
    color: #ff7701;
    margin-bottom: 15px;
    font-size: 1.2em;
}

.visits-list-section {
    background: linear-gradient(135deg, #F2F2F2 0%, #ffffff 100%);
    padding: 25px;
    border-radius: 15px;
    border: 2px solid #F29F80;
    margin-top: 30px;
}

.visit-item {
    background: white;
    padding: 20px;
    margin-bottom: 15px;
    border-radius: 12px;
    border-left: 5px solid #ff7701;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 3px 15px rgba(242, 116, 5, 0.1);
    transition: all 0.3s ease;
}

.visit-item:hover:not(.editing) {
    box-shadow: 0 6px 20px rgba(242, 116, 5, 0.2);
    transform: translateX(5px);
}

.visit-details h4 {
    color: #F25C05;
    margin-bottom: 8px;
    font-size: 1.2em;
}

.visit-details p {
    color: #666;
    font-size: 0.95em;
    margin: 3px 0;
}

footer {
    background: linear-gradient(135deg, #2c2c2c 0%, #1a1a1a 100%);
    color: white;
    padding: 50px 20px 20px 20px;
    margin-top: 50px;
    position: relative;
}

footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 5px;
    background: linear-gradient(90deg, #ff7701, #F25C05, #F28D52, #F29F80);
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
}

.footer-section h3 {
    color: #ff7701;
    margin-bottom: 15px;
    font-size: 1.2em;
    font-weight: bold;
}

.footer-section p,
.footer-section a {
    color: #ccc;
    text-decoration: none;
    line-height: 1.8;
    display: block;
    transition: all 0.3s ease;
}

.footer-section a:hover {
    color: #ff7701;
    transform: translateX(5px);
}

.footer-bottom {
    text-align: center;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #444;
    color: #888;
}

body.dark-mode {
    background: #1a1a1a;
    color: #e0e0e0;
}

body.dark-mode .section {
    background: #2c2c2c;
}

body.dark-mode .calendar-container,
body.dark-mode .visits-list-section,
body.dark-mode .news-form {
    background: #2c2c2c;
}

body.dark-mode .calendar-day {
    background: #3a3a3a;
    color: #e0e0e0;
    border-color: #F29F80;
}

body.dark-mode .calendar-day.today {
    background: linear-gradient(135deg, #ff7701 0%, #F25C05 100%);
    color: white;
}

body.dark-mode .calendar-day.has-visit {
    background: linear-gradient(135deg, #ff7701 0%, #F28D52 100%);
    color: white;
}

body.dark-mode .visit-badge {
    background: rgba(0, 0, 0, 0.4);
    color: white;
}

body.dark-mode .news-item {
    background: #333;
}

body.dark-mode .visit-item {
    background: #333;
}

body.dark-mode input,
body.dark-mode textarea {
    background: #3a3a3a;
    color: #e0e0e0;
}

body.dark-mode .document-card {
    background: linear-gradient(135deg, #2f2f2f 0%, #262626 100%);
    border-color: #ff7701;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
}

body.dark-mode .document-card h3 {
    color: #F28D52;
}

body.dark-mode .document-card p {
    color: #cfcfcf;
}

body.dark-mode .visit-form {
    background: #333;
}

body.dark-mode .primary-btn {
    background: linear-gradient(135deg, #F25C05 0%, #ff7701 100%);
    color: #fff;
    border-color: #ff7701;
}
body.dark-mode .primary-btn:hover {
    background: #ff7701;
    color: #fff;
}
body.dark-mode .secondary-btn {
    background: #222;
    color: #ff7701 !important;
    border-color: #ff7701;
}
body.dark-mode .secondary-btn:hover {
    background: #333;
    color: #fff;
    border-color: #ff7701;
}
body.dark-mode .secondary-btn:active {
    background: #111;
    color: #ff7701;
}

#darkModeToggle:checked + header .sun-icon {
    display: none;
}

#darkModeToggle:checked + header .moon-icon {
    display: inline;
}

@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        text-align: center;
    }

    .header-right {
        flex-direction: column;
        margin-top: 15px;
    }

    .theme-toggle {
        margin-left: 0;
        margin-top: 15px;
    }

    .logo-section {
        flex-direction: column;
    }

    .logo-text h1 {
        font-size: 1.8em;
    }

    .user-info {
        margin-top: 20px;
    }

    .calendar-grid {
        gap: 5px;
    }

    .calendar-day {
        padding: 10px;
        min-height: 60px;
        font-size: 0.85em;
    }

    .day-number {
        font-size: 1em;
    }

    .today-badge,
    .visit-badge {
        font-size: 0.55em;
    }
}

@media (max-width: 600px) {
    .add-btn, .delete-btn {
        min-width: 38px;
        min-height: 38px;
        max-width: 38px;
        max-height: 38px;
        font-size: 0.85em;
    }
}

.custom-loader-svg {
    --uib-size: 80px;
    --uib-color: #ff7701;
    --uib-speed: 1.4s;
    --uib-bg-opacity: .1;
    height: var(--uib-size);
    width: var(--uib-size);
    transform-origin: center;
    overflow: visible;
    margin-bottom: 10px;
}

.car {
    fill: none;
    stroke: var(--uib-color);
    stroke-dasharray: 15, 85;
    stroke-dashoffset: 0;
    stroke-linecap: round;
    animation: travel var(--uib-speed) linear infinite;
    will-change: stroke-dasharray, stroke-dashoffset;
    transition: stroke 0.5s ease;
}

.track {
    stroke: var(--uib-color);
    opacity: var(--uib-bg-opacity);
    transition: stroke 0.5s ease;
}

@keyframes travel {
    0% { stroke-dashoffset: 0; }
    100% { stroke-dashoffset: -100; }
}
/* =====================================================
   ÉDITION DES VISITES – NOUVEAU STYLE (FIX COMPLET)
===================================================== */

.visit-item.editing {
    background: white !important;
    border-radius: 18px !important;
    padding: 0 !important;
    box-shadow: 0 10px 30px rgba(242, 116, 5, 0.15) !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 0 !important;
    border: 3px solid #ff7701 !important;
    position: relative !important;
    align-items: stretch !important;
    justify-content: flex-start !important;
    transform: none !important;
    margin-bottom: 15px !important;
}

body.dark-mode .visit-item.editing {
    background: #2b2b2b !important;
    border: 3px solid #ff7701 !important;
}

/* En-tête avec la date */
.visit-edit-header {
    background: linear-gradient(135deg, #ff7701 0%, #F25C05 100%) !important;
    color: white !important;
    padding: 16px 24px !important;
    border-radius: 15px 15px 0 0 !important;
    font-weight: bold !important;
    font-size: 1.1em !important;
    text-align: left !important;
}

/* Conteneur du formulaire */
.visit-edit-form {
    padding: 28px 32px !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 18px !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
}

/* Groupes de formulaire */
.visit-edit-form .form-group {
    margin-bottom: 0 !important;
    display: flex !important;
    flex-direction: column !important;
}

.visit-edit-form .form-group label {
    display: block !important;
    color: #ff7701 !important;
    font-weight: bold !important;
    margin-bottom: 8px !important;
    font-size: 1.05em !important;
}

/* Inputs et textarea */
.visit-edit-form input,
.visit-edit-form textarea {
    width: 100% !important;
    padding: 14px 16px !important;
    border-radius: 10px !important;
    font-size: 1.05em !important;
    border: 2px solid #F28D52 !important;
    outline: none !important;
    transition: all 0.3s ease !important;
    box-sizing: border-box !important;
}

body:not(.dark-mode) .visit-edit-form input,
body:not(.dark-mode) .visit-edit-form textarea {
    background: #ffffff !important;
    color: #222 !important;
}

body.dark-mode .visit-edit-form input,
body.dark-mode .visit-edit-form textarea {
    background: #3a3a3a !important;
    color: #e0e0e0 !important;
    border-color: #F28D52 !important;
}

.visit-edit-form input:focus,
.visit-edit-form textarea:focus {
    outline: none !important;
    border-color: #ff7701 !important;
    box-shadow: 0 0 0 3px rgba(242, 116, 5, 0.1) !important;
}

.visit-edit-form textarea {
    resize: vertical !important;
    min-height: 90px !important;
    font-family: Arial, sans-serif !important;
}

/* Actions (boutons en bas) */
.visit-edit-actions {
    display: flex !important;
    justify-content: center !important;
    gap: 18px !important;
    margin-top: 20px !important;
    padding-top: 20px !important;
    border-top: 2px solid #F29F80 !important;
    flex-direction: row !important;
    align-items: center !important;
}

.visit-edit-actions button {
    width: 64px !important;
    height: 64px !important;
    min-width: 64px !important;
    min-height: 64px !important;
    max-width: 64px !important;
    max-height: 64px !important;
    border-radius: 16px !important;
    background: linear-gradient(135deg, #ff7701 0%, #F25C05 100%) !important;
    border: none !important;
    color: white !important;
    font-size: 24px !important;
    cursor: pointer !important;
    box-shadow: 0 4px 15px rgba(242, 116, 5, 0.18) !important;
    transition: transform 0.2s ease, box-shadow 0.2s ease !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 !important;
}

.visit-edit-actions button:hover {
    transform: translateY(-3px) !important;
    box-shadow: 0 8px 25px rgba(242, 116, 5, 0.5) !important;
}

.visit-edit-actions button:active {
    transform: none !important;
}

/* Responsive */
@media (max-width: 768px) {
    .visit-edit-form {
        padding: 20px 24px !important;
    }

    .visit-edit-actions {
        gap: 12px !important;
    }

    .visit-edit-actions button {
        width: 56px !important;
        height: 56px !important;
        min-width: 56px !important;
        min-height: 56px !important;
        max-width: 56px !important;
        max-height: 56px !important;
        font-size: 20px !important;
    }
}
/* ========== NAVIGATION MOIS/ANNÉE ========== */
.month-navigation {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 70px;
    padding: 30px 40px;
    margin-bottom: 20px;
    background: white;
    border-radius: 20px;
    box-shadow: 0 8px 30px rgba(242, 116, 5, 0.15);
    transition: all 0.3s ease;
}

body.dark-mode .month-navigation {
    background: #2c2c2c;
    box-shadow: 0 8px 30px rgba(242, 116, 5, 0.25);
}

/* Boutons flèche */
.nav-btn {
    width: 60px;
    height: 60px;
    border: none;
    border-radius: 14px;
    background: linear-gradient(135deg, #ff7701 0%, #F25C05 100%);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(242, 116, 5, 0.25);
    font-size: 24px;
    position: relative;
    overflow: hidden;
}

.nav-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(242, 116, 5, 0.4);
}

.nav-btn:active {
    transform: translateY(-1px);
}

/* Flèche créée avec CSS */
.nav-btn::before {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    border-right: 3px solid white;
    border-bottom: 3px solid white;
}

/* Flèche gauche */
.nav-btn.prev::before {
    transform: rotate(225deg);
    left: 20px;
}

/* Flèche droite */
.nav-btn.next::before {
    transform: rotate(45deg);
    right: 20px;
}

/* Mois et année */
.month-year-display {
    text-align: center;
    min-width: 300px;
}

.month-year-display h2 {
    font-size: 2.2em;
    font-weight: 800;
    color: #ff7701;
    margin: 0;
    letter-spacing: 0.5px;
}

body.dark-mode .month-year-display h2 {
    color: #F28D52;
}

@media (max-width: 768px) {
    .month-navigation {
        gap: 20px;
        padding: 20px 30px;
    }

    .month-year-display h2 {
        font-size: 1.8em;
    }

    .month-year-display {
        min-width: 200px;
    }

    .nav-btn {
        width: 50px;
        height: 50px;
        font-size: 20px;
    }

    .nav-btn.prev::before {
        left: 16px;
    }

    .nav-btn.next::before {
        right: 16px;
    }
}