:root {
    --bg: #131314;
    --side: #1e1f20;
    --brd: #444746;
    --blue: #7cacf8;
    --blue-hover: #a1c7ff;
    --danger: #ea4335;
}

body {
    margin: 0;
    font-family: 'Roboto', sans-serif;
    background: var(--bg);
    color: white;
    overflow: hidden;
}

/* --- DASHBOARD & SIDEBAR --- */
.dashboard { display: flex; height: 100vh; }

.sidebar {
    width: 260px;
    background: var(--side);
    border-right: 1px solid var(--brd);
    padding: 20px;
    display: flex;
    flex-direction: column;
}

#weeks-list { list-style: none; padding: 0; flex-grow: 1; overflow-y: auto; }
#weeks-list li {
    padding: 10px;
    border-radius: 8px;
    cursor: pointer;
    margin-bottom: 5px;
    font-size: 0.9em;
    transition: background 0.2s;
}
#weeks-list li:hover { background: rgba(255,255,255,0.05); }
#weeks-list li.active { background: #004a77; color: #c2e7ff; }

.admin-section { border-top: 1px solid var(--brd); padding-top: 15px; }

.btn-manage-users {
    width: 100%;
    padding: 12px;
    background: #3c4043;
    border: 1px solid var(--brd);
    color: white;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    transition: background 0.2s;
}
.btn-manage-users:hover { background: #4e5256; }

/* --- CALENDAR --- */
.calendar-main { flex-grow: 1; display: flex; flex-direction: column; }
.calendar-header { padding: 15px; border-bottom: 1px solid var(--brd); display: flex; justify-content: space-between; align-items: center; }

.calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); flex-grow: 1; }
.day-cell { border-right: 1px solid var(--brd); display: flex; flex-direction: column; background: rgba(255,255,255,0.01); }

.day-cell-header {
    display: flex;
    justify-content: space-between;
    padding: 10px;
    background: rgba(0,0,0,0.2);
    border-bottom: 1px solid var(--brd);
    font-weight: bold;
    color: #9aa0a6;
    font-size: 0.8em;
}

.add-event-btn {
    background: var(--blue);
    border: none;
    width: 22px;
    height: 22px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
}

.event-list { padding: 10px; flex-grow: 1; }
.event-card {
    background: #2a2b2d;
    border-left: 4px solid var(--blue);
    padding: 8px;
    border-radius: 4px;
    margin-bottom: 8px;
    position: relative;
    cursor: grab;
}
.ev-time { color: var(--blue); font-weight: bold; font-size: 0.8em; }
.ev-title { font-size: 0.9em; margin: 2px 0; }
.ev-staff { font-size: 0.75em; color: #9aa0a6; }

/* --- MODALS (STRUCTURE) --- */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.85);
}

.modal-content {
    background: #1e1f20;
    margin: 2vh auto !important;
    padding: 25px;
    width: 95% !important;
    max-width: 500px;
    height: auto;
    max-height: 90vh;
    display: flex !important;
    flex-direction: column !important;
    border-radius: 12px;
    border: 1px solid var(--brd);
    box-sizing: border-box;
}

/* Modal Effectifs Large */
#userModal .modal-content {
    max-width: 1300px !important;
    height: 90vh !important;
}

#manage-users-list {
    flex-grow: 1;
    overflow-y: auto;
    margin: 20px 0;
    border: 1px solid var(--brd);
    background: #131314;
    padding: 15px;
    border-radius: 8px;
}

/* --- STYLE DES INPUTS & BOUTONS DANS MODAL --- */

.modal-content h3 { margin-top: 0; color: var(--blue); }

.modal-content input[type="text"] {
    width: 100%;
    padding: 12px 15px;
    background: #131314;
    border: 1px solid var(--brd);
    border-radius: 6px;
    color: white;
    font-size: 0.95em;
    margin-bottom: 10px;
    box-sizing: border-box;
    transition: border-color 0.2s;
}

.modal-content input:focus {
    outline: none;
    border-color: var(--blue);
}

/* Boutons d'action (Ajouter, Créer, Valider) */
.modal-content button:not(.btn-close-modal):not(.btn-del-mini):not(.add-event-btn) {
    padding: 12px 20px;
    background: var(--blue);
    color: #131314;
    border: none;
    border-radius: 6px;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
}

.modal-content button:not(.btn-close-modal):not(.btn-del-mini):not(.add-event-btn):hover {
    background: var(--blue-hover);
}

.modal-content button:active { transform: scale(0.98); }

/* Bouton Fermer / Annuler */
.btn-close-modal, button[onclick*="closeModal"] {
    margin-top: auto;
    padding: 12px;
    background: transparent !important;
    color: #9aa0a6 !important;
    border: 1px solid var(--brd) !important;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-close-modal:hover, button[onclick*="closeModal"]:hover {
    background: rgba(255,255,255,0.05) !important;
    color: white !important;
}

/* --- LISTE DES AGENTS (LIGNES) --- */
.user-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    padding: 12px;
    background: rgba(255,255,255,0.03);
    border-radius: 6px;
    border: 1px solid rgba(255,255,255,0.05);
}

.user-info { font-weight: bold; font-size: 1em; }

.user-controls { display: flex; gap: 15px; align-items: center; }

.user-select {
    padding: 8px;
    background: #1a1c23;
    color: white;
    border: 1px solid #666;
    border-radius: 4px;
    cursor: pointer;
}

.btn-del-mini {
    background: var(--danger);
    border: none;
    color: white;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85em;
}

.btn-del-mini:hover { background: #ff5c4d; }

/* Custom Scrollbar pour le noir */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: #3c4043; border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: #4e5256; }