/* Fichier: css/style.css */

/* --- Variables & Thèmes --- */
:root {
    --primary: #4e73df;
    --primary-dark: #2e59d9;
    --secondary: #858796;
    --success: #1cc88a;
    --info: #36b9cc;
    --warning: #f6c23e;
    --danger: #e74a3b;
    --light: #f8f9fc;
    --dark: #121212; /* Mode Nuit profond */
    
    /* Mode Jour (Défaut) */
    --bg-body: #f3f4f6;
    --bg-sidebar: #ffffff;
    --text-sidebar: #5a5c69;
    --bg-card: #ffffff;
    --text-main: #333333;
    --border-color: #e3e6f0;
    --shadow: 0 0.15rem 1.75rem 0 rgba(58, 59, 69, 0.15);
    --gradient-sidebar: linear-gradient(180deg, #4e73df 10%, #224abe 100%);
    --gradient-card: linear-gradient(45deg, #4e73df, #224abe);
}

body.dark-mode {
    --bg-body: #121212;
    --bg-sidebar: #1e1e1e;
    --text-sidebar: #d1d3e2;
    --bg-card: #2c2c2c;
    --text-main: #f8f9fc;
    --border-color: #444;
    --shadow: 0 0.15rem 1.75rem 0 rgba(0, 0, 0, 0.5);
    --gradient-sidebar: linear-gradient(180deg, #1e1e1e 10%, #2d2d2d 100%);
}

/* --- Reset & Base --- */
* { box-sizing: border-box; }
body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--bg-body);
    color: var(--text-main);
    margin: 0;
    font-size: 13px;
    overflow-x: hidden;
    transition: background 0.3s ease;
}

/* --- Layout --- */
#app-container { display: flex; min-height: 100vh; }

/* --- Sidebar (Menu) --- */
#sidebar {
    width: 250px;
    background-color: var(--bg-sidebar);
    color: var(--text-sidebar);
    display: flex;
    flex-direction: column;
    box-shadow: 2px 0 15px rgba(0,0,0,0.05);
    transition: all 0.3s;
    z-index: 100;
}

.sidebar-brand {
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
    border-bottom: 1px solid var(--border-color);
    letter-spacing: 1px;
}

.user-profile {
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid var(--border-color);
    background: rgba(0,0,0,0.02);
}
.avatar-circle {
    width: 40px; height: 40px;
    background: var(--gradient-card);
    color: white;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-weight: bold;
}
.user-info { display: flex; flex-direction: column; }
.user-name { font-weight: 600; font-size: 14px; }
.user-role { font-size: 10px; opacity: 0.8; }

.nav-links { list-style: none; padding: 10px 0; margin: 0; flex-grow: 1; }
.nav-links li a {
    display: flex;
    align-items: center;
    padding: 12px 25px;
    color: var(--text-sidebar);
    text-decoration: none;
    transition: all 0.3s;
    font-weight: 500;
    border-left: 4px solid transparent;
}
.nav-links li a i { width: 25px; font-size: 16px; }

.nav-links li.active a, .nav-links li a:hover {
    color: var(--primary);
    background-color: rgba(78, 115, 223, 0.1);
    border-left-color: var(--primary);
}

.section-title {
    padding: 15px 25px 5px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    color: #b7b9cc;
}

.sidebar-footer {
    padding: 20px;
    display: flex;
    justify-content: space-around;
    border-top: 1px solid var(--border-color);
}
.btn-theme, .btn-logout {
    background: none; border: none; font-size: 18px; cursor: pointer; color: var(--text-sidebar);
    transition: transform 0.2s;
}
.btn-theme:hover, .btn-logout:hover { color: var(--primary); transform: scale(1.1); }

/* --- Content Area --- */
#content { flex-grow: 1; display: flex; flex-direction: column; height: 100vh; }

.top-header {
    background: var(--bg-card);
    padding: 15px 30px;
    box-shadow: 0 1px 5px rgba(0,0,0,0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.page-title { font-size: 1.2rem; margin: 0; color: var(--text-main); font-weight: 600; }
.date-display { font-size: 0.9rem; color: var(--secondary); font-weight: 500; }

.content-body { padding: 30px; animation: fadeIn 0.5s ease-in-out; }

/* --- Dashboard Grid & Cards --- */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 25px;
    margin-bottom: 30px;
}

.card {
    background: var(--bg-card);
    border-radius: 10px;
    padding: 20px;
    box-shadow: var(--shadow);
    transition: transform 0.3s, box-shadow 0.3s;
    border-left: 4px solid var(--primary);
    position: relative;
    overflow: hidden;
}
.card:hover { transform: translateY(-5px); box-shadow: 0 10px 20px rgba(0,0,0,0.1); }

.card-title { font-size: 11px; text-transform: uppercase; font-weight: 700; color: var(--primary); margin-bottom: 5px; }
.card-value { font-size: 24px; font-weight: 700; color: var(--text-main); }
.card-icon { position: absolute; right: 20px; top: 50%; transform: translateY(-50%); font-size: 30px; color: #dddfeb; opacity: 0.5; }

/* Variantes de cartes */
.card-success { border-left-color: var(--success); }
.card-success .card-title { color: var(--success); }
.card-warning { border-left-color: var(--warning); }
.card-warning .card-title { color: var(--warning); }
.card-danger { border-left-color: var(--danger); }
.card-danger .card-title { color: var(--danger); }

/* --- Tables Modernes --- */
table { width: 100%; border-collapse: separate; border-spacing: 0; margin-top: 10px; background: var(--bg-card); border-radius: 10px; overflow: hidden; box-shadow: var(--shadow); }
table th { background-color: var(--bg-body); color: var(--secondary); font-weight: 600; text-transform: uppercase; font-size: 11px; padding: 15px; text-align: left; border-bottom: 1px solid var(--border-color); }
table td { padding: 15px; border-bottom: 1px solid var(--border-color); color: var(--text-main); font-size: 12px; }
table tr:last-child td { border-bottom: none; }
table tr:hover { background-color: rgba(0,0,0,0.02); }

/* --- Formulaires & Boutons --- */
input, select, textarea {
    width: 100%; padding: 10px 15px; border: 1px solid var(--border-color); border-radius: 5px;
    background: var(--bg-card); color: var(--text-main); font-family: inherit; margin-bottom: 15px;
    transition: border 0.3s;
}
input:focus, select:focus { border-color: var(--primary); outline: none; box-shadow: 0 0 0 3px rgba(78, 115, 223, 0.2); }

button.btn-primary, a.btn-primary {
    background: var(--gradient-card); border: none; color: white; padding: 10px 20px;
    border-radius: 50px; font-weight: 600; cursor: pointer; text-decoration: none; display: inline-block;
    box-shadow: 0 4px 10px rgba(78, 115, 223, 0.4); transition: transform 0.2s, box-shadow 0.2s;
}
button.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 6px 15px rgba(78, 115, 223, 0.6); }

button.btn-danger {
    background: var(--danger); color: white; border: none; padding: 8px 15px; border-radius: 5px; cursor: pointer;
}

/* --- Modals animés --- */
.modal { background-color: rgba(0,0,0,0.6); backdrop-filter: blur(2px); }
.modal-content {
    background: var(--bg-card); border-radius: 15px; padding: 30px; border: none;
    box-shadow: 0 15px 50px rgba(0,0,0,0.3);
    animation: slideDown 0.3s ease-out;
}

/* Animations Keyframes */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideDown { from { transform: translateY(-50px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }