:root {
    --primary-color: #0f172a;       /* Bleu nuit profond institutionnel */
    --secondary-blue: #1e3a8a;      /* Bleu d'armee */
    --accent-teal: #0d9488;         /* Sceau d'etat */
    --slate-text: #334155;
    --light-bg: #f8fafc;
    --white: #ffffff;
    --danger-red: #b91c1c;
    --success-green: #15803d;
}

body {
    font-family: 'Arial', 'Helvetica', sans-serif;
    background-color: var(--light-bg);
    color: var(--slate-text);
    margin: 0; padding: 0;
    line-height: 1.5;
}

.main-header {
    background-color: var(--primary-color);
    color: var(--white);
    padding: 20px 40px;
    border-bottom: 4px solid var(--accent-teal);
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo { font-size: 1rem; margin: 0; font-weight: bold; text-transform: uppercase; letter-spacing: 0.5px; }
.logo .motto { font-size: 0.75rem; color: #a1a1aa; font-style: italic; font-weight: normal; }
.logo .ministry { font-size: 0.85rem; color: #38bdf8; font-weight: bold; display: block; margin-top: 4px; }

.app-title-central h2 { font-size: 1.1rem; color: var(--white); border-left: 3px solid var(--accent-teal); padding-left: 15px; margin: 0; }

.user-profile-widget { display: flex; align-items: center; gap: 12px; background: rgba(255,255,255,0.08); padding: 8px 15px; border-radius: 6px; }
.profile-info { display: flex; flex-direction: column; font-size: 0.8rem; }
.profile-info .user-name { color: #38bdf8; font-weight: bold; }
.logout-btn { background: var(--danger-red); color: white; border-radius: 4px; padding: 5px 10px; font-size: 0.75rem; text-decoration: none; font-weight: bold; }

.main-navigation { background-color: #1e293b; padding: 12px 40px; }
.nav-container a { color: #cbd5e1; text-decoration: none; margin-right: 25px; font-size: 0.9rem; font-weight: 500; transition: color 0.2s; }
.nav-container a:hover { color: var(--white); }
.nav-container .admin-link-highlight { color: #f59e0b; font-weight: bold; }

.main-content-wrapper { max-width: 1300px; margin: 40px auto; padding: 0 25px; box-sizing: border-box; }
.content-header-block { margin-bottom: 25px; border-bottom: 2px solid #e2e8f0; padding-bottom: 10px; }
.content-header-block h2 { margin: 0; color: var(--primary-color); font-size: 1.4rem; }

.card-wrapper { background: var(--white); border-radius: 8px; box-shadow: 0 4px 10px rgba(0,0,0,0.05); padding: 30px; margin-bottom: 30px; border-top: 4px solid var(--secondary-blue); }

.production-table { width: 100%; border-collapse: collapse; text-align: left; }
.production-table th { background-color: #f1f5f9; color: #475569; font-weight: bold; padding: 14px; border-bottom: 2px solid #cbd5e1; font-size: 0.9rem; }
.production-table td { padding: 14px; border-bottom: 1px solid #e2e8f0; font-size: 0.88rem; vertical-align: middle; }

.badge { padding: 5px 10px; border-radius: 20px; font-size: 0.72rem; font-weight: bold; text-transform: uppercase; display: inline-block; }
.badge-validé { background-color: #dcfce7; color: var(--success-green); }
.badge-en_attente { background-color: #fef3c7; color: #d97706; }
.badge-annulé { background-color: #fee2e2; color: var(--danger-red); }
.badge-a_corriger { background-color: #e0f2fe; color: #0369a1; }
.badge-evincé { background-color: #fca5a5; color: #7f1d1d; }

.login-body-layout { background: #020617; display: flex; justify-content: center; align-items: center; height: 100vh; }
.login-card-container { background: var(--white); border-radius: 12px; padding: 45px; width: 420px; box-shadow: 0 20px 25px -5px rgba(0,0,0,0.3); text-align: center; border-bottom: 5px solid var(--accent-teal); }
.coat-of-arms { font-size: 2.5rem; margin-bottom: 10px; }
.form-group-block { text-align: left; margin-bottom: 20px; }
.form-group-block label { display: block; font-weight: bold; margin-bottom: 6px; font-size: 0.85rem; color: #475569; }
.form-group-block input { width: 100%; padding: 10px 14px; border: 1px solid #cbd5e1; border-radius: 6px; box-sizing: border-box; font-size: 0.9rem; }

.btn-login-submit, .btn-primary-action { background: var(--secondary-blue); color: white; border: none; padding: 12px; border-radius: 6px; width: 100%; font-weight: bold; cursor: pointer; font-size: 0.95rem; transition: background 0.2s; }
.btn-login-submit:hover, .btn-primary-action:hover { background: var(--primary-color); }

.standard-form-layout .form-row { margin-bottom: 20px; }
.standard-form-layout label { display: block; font-weight: bold; margin-bottom: 6px; font-size: 0.9rem; }
.standard-form-layout input, .standard-form-layout textarea { width: 100%; padding: 10px; border: 1px solid #cbd5e1; border-radius: 6px; box-sizing: border-box; }
.form-row-triple { display: flex; gap: 15px; margin-bottom: 20px; }
.form-row-triple div { flex: 1; }

/* Styles additionnels modération SG */
.conflict-alert-box-critical { background: #fff5f5; border-left: 4px solid var(--danger-red); padding: 12px; border-radius: 4px; font-size: 0.82rem; }
.action-buttons-group { display: flex; gap: 8px; margin-bottom: 10px; }
.btn-approve { background: var(--success-green); color: white; text-decoration: none; padding: 6px 12px; border-radius: 4px; font-size: 0.8rem; font-weight: bold; }
.btn-reject { background: var(--danger-red); color: white; text-decoration: none; padding: 6px 12px; border-radius: 4px; font-size: 0.8rem; font-weight: bold; }
.glissement-panel { background: #f8fafc; border: 1px dashed #cbd5e1; padding: 10px; border-radius: 6px; margin-top: 10px; }
.glissement-title { font-size: 0.75rem; font-weight: bold; margin: 0 0 6px 0; color: #475569; }
.glissement-inline-form { display: flex; gap: 4px; }
.glissement-inline-form input { padding: 4px; font-size: 0.75rem; border: 1px solid #cbd5e1; border-radius: 4px; }
.btn-slide { background: #ea580c; color: white; border: none; font-size: 0.72rem; padding: 4px 8px; border-radius: 4px; cursor: pointer; font-weight: bold; }

.proposition-box { background: #f0fdf4; border: 1px solid #bbf7d0; padding: 12px; border-radius: 6px; margin-top: 5px; }
.action-btn-success { background: var(--success-green); color: white; text-decoration: none; padding: 6px 12px; border-radius: 4px; font-size: 0.8rem; font-weight: bold; display: inline-block; margin-top: 5px; }

/* Modal fullcalendar popups */
.custom-modal { position: fixed; z-index: 1000; left: 0; top: 0; width: 100%; height: 100%; background-color: rgba(0,0,0,0.5); display: flex; justify-content: center; align-items: center; }
.modal-content { background-color: white; padding: 30px; border-radius: 8px; width: 500px; box-shadow: 0 4px 20px rgba(0,0,0,0.2); position: relative; border-top: 5px solid var(--accent-teal); }
.close-modal-btn { position: absolute; top: 10px; right: 15px; font-size: 1.5rem; cursor: pointer; color: #94a3b8; }
.close-modal-btn:hover { color: black; }

.main-footer-element { background: #1e293b; color: #94a3b8; text-align: center; padding: 25px 0; font-size: 0.82rem; margin-top: 60px; border-top: 3px solid var(--accent-teal); }
.main-footer-element .sub-footer { color: #64748b; font-size: 0.75rem; margin-top: 4px; }

/* ═══════════════════════════════════════════════════════════════ */
/* SAISIE ZÉRO EFFORT : Badges de remplissage rapide             */
/* ═══════════════════════════════════════════════════════════════ */
.quick-fill-panel {
    background: linear-gradient(135deg, #f0f7ff 0%, #e8f4f8 100%);
    border: 1px solid #bfdbfe;
    border-radius: 8px;
    padding: 18px 22px;
    margin-bottom: 25px;
}
.quick-fill-section { margin-bottom: 14px; }
.quick-fill-section:last-child { margin-bottom: 0; }
.quick-fill-label {
    font-size: 0.78rem;
    font-weight: 700;
    color: #1e3a8a;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0 0 8px 0;
}
.quick-fill-badges { display: flex; flex-wrap: wrap; gap: 8px; }
.badge-btn {
    background: var(--white);
    border: 1.5px solid #93c5fd;
    color: #1e40af;
    border-radius: 20px;
    padding: 6px 14px;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
}
.badge-btn:hover {
    background: #1e3a8a;
    color: var(--white);
    border-color: #1e3a8a;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(30,58,138,0.2);
}
.badge-btn.badge-active {
    background: #1e3a8a;
    color: var(--white);
    border-color: #1e3a8a;
    box-shadow: 0 2px 6px rgba(30,58,138,0.3);
}
.badge-duree { border-color: #6ee7b7; color: #065f46; }
.badge-duree:hover, .badge-duree.badge-active {
    background: #065f46;
    border-color: #065f46;
    color: var(--white);
    box-shadow: 0 4px 8px rgba(6,95,70,0.2);
}

/* ═══════════════════════════════════════════════════════════════ */
/* ALGORITHME DE GLISSEMENT INTELLIGENT : Créneaux suggérés      */
/* ═══════════════════════════════════════════════════════════════ */
.creneaux-suggeres {
    background: #f0fdf4;
    border: 1px solid #86efac;
    border-radius: 6px;
    padding: 10px 14px;
    margin-top: 10px;
}
.creneaux-suggeres p { font-size: 0.78rem; font-weight: bold; color: #166534; margin: 0 0 6px 0; }
.creneaux-suggeres .creneau-option {
    display: inline-block;
    background: #dcfce7;
    color: #166534;
    border: 1px solid #86efac;
    border-radius: 4px;
    padding: 3px 8px;
    font-size: 0.78rem;
    font-weight: bold;
    cursor: pointer;
    margin: 2px;
    transition: background 0.15s;
}
.creneaux-suggeres .creneau-option:hover { background: #166534; color: white; }

/* ═══════════════════════════════════════════════════════════════ */
/* STYLES MODAUX GLOBAUX                                          */
/* ═══════════════════════════════════════════════════════════════ */
.modal-overlay { position: fixed; z-index: 1000; left: 0; top: 0; width: 100%; height: 100%; background-color: rgba(0,0,0,0.5); display: flex; justify-content: center; align-items: center; }
.modal-content { background-color: white; padding: 30px; border-radius: 8px; width: 90%; max-width: 500px; box-shadow: 0 4px 20px rgba(0,0,0,0.2); position: relative; border-top: 5px solid var(--accent-teal); max-height: 90vh; overflow-y: auto; }
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.modal-header h3 { margin: 0; }
.close-btn { background: none; border: none; font-size: 1.5rem; cursor: pointer; color: #94a3b8; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; }
.btn-secondary { background: #e2e8f0; color: #334155; padding: 8px 15px; border-radius: 6px; text-decoration: none; border: none; cursor: pointer; font-weight: bold; font-size: 0.85rem; }

/* ═══════════════════════════════════════════════════════════════ */
/* MENU HAMBURGER MOBILE                                          */
/* ═══════════════════════════════════════════════════════════════ */
.hamburger-btn {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
    flex-direction: column;
    gap: 5px;
}
.hamburger-btn span {
    display: block;
    width: 26px;
    height: 3px;
    background-color: var(--white);
    border-radius: 3px;
    transition: all 0.3s ease;
}

/* ═══════════════════════════════════════════════════════════════ */
/* RESPONSIVE — TABLETTE (max 1024px)                            */
/* ═══════════════════════════════════════════════════════════════ */
@media (max-width: 1024px) {
    .main-header { padding: 15px 20px; }
    .header-container { flex-wrap: wrap; gap: 10px; }
    .app-title-central h2 { font-size: 0.85rem; }
    .main-navigation { padding: 10px 20px; }
    .nav-container a { margin-right: 15px; font-size: 0.82rem; }
    .main-content-wrapper { padding: 0 15px; margin: 25px auto; }
    .form-row-triple { flex-wrap: wrap; }
    .form-row-triple div { flex: 1 1 calc(50% - 10px); min-width: 0; }
}

/* ═══════════════════════════════════════════════════════════════ */
/* RESPONSIVE — MOBILE (max 768px)                               */
/* ═══════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
    /* Header */
    .main-header { padding: 12px 15px; }
    .header-container { flex-direction: column; align-items: flex-start; gap: 8px; position: relative; }
    .app-title-central { display: none; }
    .user-profile-widget { padding: 6px 10px; font-size: 0.78rem; }
    .logo { font-size: 0.85rem; }

    /* Navigation hamburger */
    .hamburger-btn { display: flex; }
    .main-navigation { padding: 0; }
    .nav-container {
        display: none;
        flex-direction: column;
        background-color: #1e293b;
        padding: 10px 0;
    }
    .nav-container.nav-open { display: flex; }
    .nav-container a {
        margin: 0;
        padding: 12px 20px;
        border-bottom: 1px solid #334155;
        font-size: 0.9rem;
        display: block;
    }
    .nav-container a:last-child { border-bottom: none; }

    /* Content */
    .main-content-wrapper { padding: 0 10px; margin: 15px auto; }
    .card-wrapper { padding: 15px; }
    .content-header-block h2 { font-size: 1.1rem; }

    /* Tables - Card layout on mobile */
    .production-table thead { display: none; }
    .production-table, .production-table tbody, .production-table tr, .production-table td { display: block; width: 100%; }
    .production-table tr {
        margin-bottom: 15px;
        border: 1px solid #e2e8f0;
        border-radius: 8px;
        overflow: hidden;
        box-shadow: 0 2px 6px rgba(0,0,0,0.05);
    }
    .production-table td {
        padding: 10px 14px;
        border-bottom: 1px solid #f1f5f9;
        text-align: left;
        font-size: 0.85rem;
    }
    .production-table td:last-child { border-bottom: none; }
    .production-table td::before {
        content: attr(data-label);
        font-weight: bold;
        font-size: 0.72rem;
        text-transform: uppercase;
        color: #64748b;
        display: block;
        margin-bottom: 4px;
    }

    /* Formulaire */
    .form-row-triple { flex-direction: column; gap: 10px; }
    .form-row-triple div { flex: 1 1 100%; }
    .glissement-inline-form { flex-wrap: wrap; }

    /* Login */
    .login-card-container { width: 92%; padding: 25px 20px; }

    /* Modal */
    .modal-content { width: 95%; padding: 20px; }

    /* Action buttons */
    .action-buttons-group { flex-wrap: wrap; }

    /* Calendrier */
    #calendar-element-root { font-size: 0.78rem; }
    .fc-toolbar-chunk { margin-bottom: 5px; }
    .fc .fc-toolbar { flex-wrap: wrap; gap: 5px; }
}

/* ═══════════════════════════════════════════════════════════════ */
/* RESPONSIVE — PETIT MOBILE (max 480px)                         */
/* ═══════════════════════════════════════════════════════════════ */
@media (max-width: 480px) {
    .logo { font-size: 0.75rem; }
    .logo .ministry { font-size: 0.72rem; }
    .header-container { padding-right: 50px; }
    .hamburger-btn { position: absolute; top: 15px; right: 15px; }
    .user-profile-widget { width: 100%; box-sizing: border-box; }
    .card-wrapper { padding: 12px; border-radius: 6px; }
    .badge { font-size: 0.65rem; padding: 3px 7px; }
    .btn-approve, .btn-reject, .btn-slide { font-size: 0.72rem; padding: 5px 8px; }
    .main-footer-element { padding: 15px; font-size: 0.75rem; }
    .quick-fill-badges { gap: 5px; }
    .badge-btn { padding: 5px 10px; font-size: 0.78rem; }
}
