/* =========================================================
   MEMORIA - GESTION DU CIMETIÈRE DE SAINT VAAST EN CHAUSSÉE
   ========================================================= */

:root {
    --memoria-sidebar-width: 280px;
    --memoria-dark: #2c3e50;
    --memoria-accent: #4a7c44;
    --memoria-bg: #f4f7f6;
}

/* On cible spécifiquement la classe .memoria-layout sur le body 
   pour écraser proprement le global.css sans utiliser trop de !important 
*/
body.memoria-layout {
    margin: 0 !important;
    padding: 0 !important;
    background-color: var(--memoria-bg) !important;
    display: flex !important;
    flex-direction: row !important;
    align-items: stretch !important;
    justify-content: flex-start !important;
    height: 100vh !important;
    overflow: hidden !important;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif !important;
}

/* ==========================================
   BARRE LATÉRALE (SIDEBAR)
   ========================================== */
.memoria-sidebar {
    width: var(--memoria-sidebar-width);
    min-width: var(--memoria-sidebar-width);
    background-color: white;
    border-right: 1px solid #e0e0e0;
    display: flex;
    flex-direction: column;
    box-shadow: 2px 0 10px rgba(0,0,0,0.05);
    z-index: 100;
    height: 100vh;
}

.memoria-sidebar-header {
    padding: 30px 20px;
    text-align: center;
    border-bottom: 1px solid #f0f0f0;
}

.memoria-sidebar-header img {
    max-width: 180px;
    height: auto;
    margin-bottom: 10px;
}

.memoria-sidebar-header h1 {
    font-size: 1.2em;
    color: var(--memoria-dark);
    margin: 0;
    letter-spacing: 2px;
    text-transform: uppercase;
}

/* NAVIGATION */
.memoria-sidebar-nav {
    flex-grow: 1;
    padding: 20px 15px !important;
    display: flex;
    flex-direction: column;
    /* Annulation des styles imposés par le <nav> de global.css */
    margin: 0 !important;
    background: transparent !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    border: none !important;
    width: auto !important; 
}

.memoria-nav-item {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    text-decoration: none;
    color: #636e72;
    font-weight: 600;
    transition: all 0.3s ease;
    border-radius: 15px; /* Effet pilule */
    margin-bottom: 8px;
    width: 100%;
    box-sizing: border-box;
}

.memoria-nav-item:hover {
    background-color: #f0f4f0;
    color: var(--memoria-accent);
}

.memoria-nav-item.active {
    background-color: #e1ede0;
    color: var(--memoria-accent);
    box-shadow: 0 2px 6px rgba(74, 124, 68, 0.15); 
}

.memoria-nav-icon {
    margin-right: 15px;
    font-size: 1.2em;
}

/* PIED DE LA BARRE (Bouton retour) */
.memoria-sidebar-footer {
    padding: 20px;
    border-top: 1px solid #f0f0f0;
}

.memoria-btn-retour {
    display: block;
    text-align: center;
    padding: 10px;
    background: #eee;
    color: #666;
    text-decoration: none;
    border-radius: 10px;
    font-size: 0.9em;
    font-weight: bold;
    transition: 0.2s;
}

.memoria-btn-retour:hover {
    background: #e0e0e0;
    color: #333;
}

/* ==========================================
   CONTENU PRINCIPAL
   ========================================== */
.memoria-main-content {
    flex-grow: 1;
    overflow-y: auto;
    padding: 40px;
    box-sizing: border-box;
    height: 100vh;
    text-align: left;
}

.memoria-welcome-header h2 { margin: 0; color: var(--memoria-dark); font-size: 2em; }
.memoria-welcome-header p { color: #888; margin-top: 10px; }

/* TABLEAU DE BORD - STATISTIQUES */
.memoria-dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 25px;
    margin-top: 30px;
}

.memoria-stat-card {
    background: white;
    padding: 25px;
    border-radius: 20px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    display: flex;
    align-items: center;
    gap: 20px;
}

.memoria-stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8em;
}

.bg-blue { background: #e3f2fd; color: #2196f3; }
.bg-green { background: #e8f5e9; color: #4caf50; }
.bg-red { background: #ffebee; color: #f44336; }

.memoria-stat-info h3 { margin: 0; font-size: 0.9em; color: #888; text-transform: uppercase; }
.memoria-stat-info p { margin: 5px 0 0 0; font-size: 1.8em; font-weight: bold; color: var(--memoria-dark); }

/* BOUTONS D'ACTION RAPIDE */
.memoria-quick-actions {
    margin-top: 40px;
    background: white;
    padding: 30px;
    border-radius: 20px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

.memoria-action-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.memoria-btn-action {
    padding: 15px;
    border: 2px solid #f0f0f0;
    border-radius: 15px;
    text-align: center;
    text-decoration: none;
    color: var(--memoria-dark);
    font-weight: bold;
    transition: 0.3s;
}

.memoria-btn-action:hover {
    border-color: var(--memoria-accent);
    color: var(--memoria-accent);
    background: #f9fbf9;
}

.memoria-alert-box {
    margin-top: 40px; 
    padding: 20px; 
    background: #fff3cd; 
    border-radius: 15px; 
    color: #856404; 
    border: 1px solid #ffeeba;
}