/* --- Variables Globales --- */
:root {
    --primary: #10b981;
    --primary-hover: #059669;
    --bg-body: #020617;
    --bg-card: #0f172a;
    --border: rgba(255, 255, 255, 0.1);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
}

/* --- Reset & Base --- */
* { 
    box-sizing: border-box; 
    margin: 0; 
    padding: 0; 
}

body { 
    font-family: 'Inter', -apple-system, sans-serif; 
    background-color: var(--bg-body); 
    color: var(--text-main);
    display: flex;
    min-height: 100vh;
}

/* --- Sidebar (Correction Puces et Liens) --- */
.sidebar {
    width: 260px;
    height: 100vh;
    background: var(--bg-card);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: fixed;
    left: 0;
    top: 0;
    z-index: 1000;
}

.sidebar-header {
    padding: 2rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-header .logo { 
    width: 32px; 
    height: 32px; 
    object-fit: contain;
}

.sidebar-header h2 { 
    font-size: 1.1rem; 
    color: #fff; 
    font-weight: 700; 
}

/* Nettoyage des listes et liens de la navigation */
.sidebar-nav {
    flex-grow: 1;
    padding: 0 1rem;
}

.sidebar-nav ul {
    list-style: none !important;
    padding: 0;
}

.sidebar-nav li {
    margin-bottom: 4px;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 15px;
    color: var(--text-muted);
    text-decoration: none !important;
    border-radius: 8px;
    transition: all 0.2s ease;
    font-size: 0.9rem;
}

/* États survol et actif */
.sidebar-nav li.active a, 
.sidebar-nav a:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
}

.sidebar-nav li.active a {
    color: var(--primary);
    font-weight: 600;
}

.sidebar-nav a svg {
    flex-shrink: 0;
    stroke-width: 2;
}

/* --- Footer Profil --- */
.sidebar-footer {
    padding: 1.5rem;
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.user-info {
    display: flex;
    flex-direction: column;
}

.user-name {
    color: #fff;
    font-weight: 600;
    font-size: 0.85rem;
}

.user-role {
    color: var(--text-muted);
    font-size: 0.7rem;
    text-transform: uppercase;
}

.logout-btn {
    color: var(--text-muted);
    text-decoration: none;
    display: flex;
    align-items: center;
}

.logout-btn:hover {
    color: #ef4444;
}

/* --- Contenu Principal --- */
.main-content {
    margin-left: 260px; /* Important : Doit être égal à la largeur de la sidebar */
    padding: 2.5rem;
    width: calc(100% - 260px);
    min-height: 100vh;
}

header { margin-bottom: 2rem; }
header h1 { font-size: 1.8rem; font-weight: 800; }

.badge {
    display: inline-block;
    padding: 4px 12px;
    background: rgba(16, 185, 129, 0.1);
    color: var(--primary);
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
}

/* --- Tableaux des Projets --- */
.project-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    margin-top: 1rem;
}

.project-table th {
    text-align: left;
    padding: 1rem;
    background: rgba(255,255,255,0.02);
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
}

.project-table td {
    padding: 1rem;
    border-top: 1px solid var(--border);
    font-size: 0.9rem;
}

/* --- Statuts --- */
.badge-status {
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
}

.status-nouveau { background: #334155; color: #f1f5f9; }
.status-encours { background: #1e3a8a; color: #bfdbfe; }
.status-afinir { background: #7c2d12; color: #fed7aa; }
.status-termine { background: #064e3b; color: #d1fae5; }

/* --- Priorités --- */
.prio-Haute { color: #ef4444; font-weight: bold; }
.prio-Moyenne { color: #f59e0b; }
.prio-Basse { color: #94a3b8; }

/* --- Boutons & Formulaires --- */
.btn {
    padding: 10px 18px;
    border-radius: 8px;
    border: none;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); }

.input-dark {
    background: #020617;
    border: 1px solid var(--border);
    color: #fff;
    padding: 10px;
    border-radius: 8px;
    outline: none;
}
.input-dark:focus { border-color: var(--primary); }

.add-form {
    background: var(--bg-card);
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid var(--border);
    margin-bottom: 2rem;
    display: flex;
    gap: 15px;
    align-items: flex-end;
}