* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ================================================================
   VARIABLES — MODE SOMBRE (défaut)
   ================================================================ */
:root,
[data-theme="dark"] {
    --primary: #00ff88;
    --secondary: #00d4ff;
    --bg: #050810;
    --bg-card: rgba(10, 14, 39, 0.6);
    --bg-card-solid: #0a0e27;
    --text: #e0e0e0;
    --text-dim: #8892b0;
    --text-muted: #4a5568;
    --border: rgba(0, 255, 136, 0.2);
    --border-strong: rgba(0, 255, 136, 0.4);
    --grid: rgba(0, 255, 136, 0.03);
    --nav-bg: rgba(10, 14, 39, 0.95);
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    --accent-hover: rgba(0, 255, 136, 0.05);
    --check-yes: #00ff88;
    --check-no: rgba(136, 146, 176, 0.3);
    --ppe-bg: rgba(37, 99, 235, 0.2);
    --ppe-border: #2563eb;
    --tp-bg: rgba(16, 185, 129, 0.2);
    --tp-border: #10b981;
}

/* ================================================================
   VARIABLES — MODE CLAIR
   ================================================================ */
[data-theme="light"] {
    --primary: #2563eb;
    --secondary: #3b82f6;
    --bg: #f8fafc;
    --bg-card: #ffffff;
    --bg-card-solid: #ffffff;
    --text: #1e293b;
    --text-dim: #475569;
    --text-muted: #94a3b8;
    --border: rgba(37, 99, 235, 0.15);
    --border-strong: rgba(37, 99, 235, 0.4);
    --grid: rgba(37, 99, 235, 0.04);
    --nav-bg: rgba(248, 250, 252, 0.97);
    --shadow: 0 4px 20px rgba(37, 99, 235, 0.08);
    --accent-hover: rgba(37, 99, 235, 0.05);
    --check-yes: #2563eb;
    --check-no: rgba(148, 163, 184, 0.4);
    --ppe-bg: rgba(37, 99, 235, 0.08);
    --ppe-border: #2563eb;
    --tp-bg: rgba(16, 185, 129, 0.08);
    --tp-border: #059669;
}

/* ================================================================
   BASE
   ================================================================ */
body {
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    background: var(--bg);
    color: var(--text);
    overflow-x: hidden;
    transition: background 0.3s ease, color 0.3s ease;
}

.grid-background {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background-image:
        linear-gradient(var(--grid) 1px, transparent 1px),
        linear-gradient(90deg, var(--grid) 1px, transparent 1px);
    background-size: 50px 50px;
    z-index: -1;
    pointer-events: none;
}

/* ================================================================
   NAV
   ================================================================ */
nav {
    position: fixed;
    top: 0;
    width: 100%;
    padding: 20px 80px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 1000;
    background: var(--nav-bg);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    transition: background 0.3s ease, border-color 0.3s ease;
}

.logo {
    font-size: 22px;
    font-weight: bold;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    transition: color 0.3s ease;
}

.logo::before {
    content: '>';
    color: var(--secondary);
    animation: blink 1.5s infinite;
}

@keyframes blink {
    0%, 49% { opacity: 1; }
    50%, 100% { opacity: 0; }
}

.nav-links {
    display: flex;
    gap: 40px;
    list-style: none;
    counter-reset: item;
}

.nav-links a {
    color: var(--text-dim);
    text-decoration: none;
    font-size: 14px;
    transition: color 0.3s ease;
}

.nav-links a::before {
    content: '0' counter(item) '.';
    counter-increment: item;
    color: var(--primary);
    margin-right: 5px;
    font-size: 12px;
}

.nav-links a:hover {
    color: var(--primary);
}

/* Bouton thème */
.theme-toggle {
    background: rgba(255,255,255,0.06);
    border: 1px solid var(--border);
    border-radius: 50%;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 17px;
    flex-shrink: 0;
    margin-left: 20px;
    transition: background 0.3s ease, border-color 0.3s ease, transform 0.2s ease;
}

.theme-toggle:hover {
    transform: scale(1.1);
    border-color: var(--primary);
    background: var(--accent-hover);
}

/* ================================================================
   SECTION PRINCIPALE
   ================================================================ */
.e5-section {
    position: relative;
    padding: 130px 80px 100px;
    z-index: 1;
}

.e5-container {
    max-width: 1400px;
    margin: 0 auto;
}

.section-header {
    display: flex;
    align-items: center;
    margin-bottom: 60px;
    gap: 20px;
}

.section-number {
    color: var(--primary);
    font-size: 20px;
    font-weight: bold;
}

.section-title {
    color: var(--text);
    font-size: 32px;
    white-space: nowrap;
}

.section-line-horizontal {
    height: 1px;
    background: var(--border-strong);
    flex-grow: 1;
}

/* ================================================================
   INTRO
   ================================================================ */
.e5-intro {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-left: 4px solid var(--primary);
    border-radius: 0 10px 10px 0;
    padding: 35px 40px;
    margin-bottom: 60px;
    box-shadow: var(--shadow);
    transition: background 0.3s ease, border-color 0.3s ease;
}

.e5-intro h2 {
    color: var(--primary);
    font-size: 22px;
    margin-bottom: 20px;
}

.e5-intro p {
    color: var(--text-dim);
    font-size: 15px;
    line-height: 1.8;
    margin-bottom: 12px;
}

.highlight {
    color: var(--primary);
    font-weight: bold;
}

/* ================================================================
   STATS
   ================================================================ */
.stats-resume {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 60px;
}

.stat-resume-box {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 25px;
    text-align: center;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
}

.stat-resume-box:hover {
    border-color: var(--primary);
    transform: translateY(-4px);
    box-shadow: 0 8px 30px rgba(0,0,0,0.2);
}

.stat-icon {
    font-size: 34px;
    margin-bottom: 12px;
}

.stat-number {
    font-size: 30px;
    color: var(--primary);
    font-weight: bold;
    margin-bottom: 6px;
}

.stat-label {
    color: var(--text-dim);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* ================================================================
   COMPÉTENCES GRID
   ================================================================ */
.suivi-title {
    color: var(--text);
    font-size: 24px;
    margin-bottom: 30px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.competences-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 60px;
}

.competence-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 28px;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
}

.competence-card:hover {
    border-color: var(--primary);
    transform: translateY(-4px);
    box-shadow: 0 12px 35px rgba(0,0,0,0.2);
}

.competence-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 16px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border);
}

.competence-icon {
    font-size: 30px;
}

.competence-code {
    color: var(--primary);
    font-size: 18px;
    font-weight: bold;
}

.competence-title {
    color: var(--text);
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 10px;
    line-height: 1.4;
}

.competence-description {
    color: var(--text-dim);
    font-size: 13px;
    line-height: 1.7;
}

/* ================================================================
   TABLEAU
   ================================================================ */
.suivi-section {
    margin-bottom: 60px;
}

.table-wrapper {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 30px;
    overflow-x: auto;
    box-shadow: var(--shadow);
    transition: background 0.3s ease;
}

.competence-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.competence-table thead tr {
    background: var(--accent-hover);
}

.competence-table th {
    color: var(--primary);
    padding: 14px 10px;
    text-align: left;
    font-weight: bold;
    border-bottom: 2px solid var(--primary);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 11px;
}

.competence-table td {
    color: var(--text-dim);
    padding: 13px 10px;
    border-bottom: 1px solid var(--border);
    transition: background 0.2s ease;
}

.competence-table tbody tr:hover td {
    background: var(--accent-hover);
    color: var(--text);
}

.competence-table tbody tr:last-child td {
    border-bottom: none;
}

.project-name {
    color: var(--text);
    font-weight: 600;
    font-size: 13px;
    min-width: 200px;
}

.check-cell {
    text-align: center;
    font-size: 16px;
}

.check-yes {
    color: var(--check-yes);
    font-weight: bold;
    font-size: 16px;
}

.check-no {
    color: var(--check-no);
    font-size: 14px;
}

.total-cell {
    color: var(--primary) !important;
    font-weight: bold;
    font-size: 13px;
}

/* Section rows PPE / TP */
.section-row td {
    font-weight: bold;
    font-size: 13px;
    padding: 13px 20px;
    letter-spacing: 1px;
    border-bottom: none;
}

.ppe-row {
    background: var(--ppe-bg) !important;
    border-left: 4px solid var(--ppe-border);
}

.ppe-row td {
    color: var(--ppe-border) !important;
}

.tp-row {
    background: var(--tp-bg) !important;
    border-left: 4px solid var(--tp-border);
}

.tp-row td {
    color: var(--tp-border) !important;
}

.separator-row td {
    padding: 6px 0;
    border: none;
}

.row-icon {
    margin-right: 10px;
}

/* ================================================================
   RESPONSIVE
   ================================================================ */
@media (max-width: 768px) {
    nav {
        padding: 15px 20px;
    }
    .nav-links {
        display: none;
    }
    .e5-section {
        padding: 100px 20px 50px;
    }
    .section-title {
        font-size: 22px;
    }
    .table-wrapper {
        padding: 15px;
    }
    .competence-table {
        font-size: 11px;
    }
    .competence-table th,
    .competence-table td {
        padding: 8px 5px;
    }
    .theme-toggle {
        width: 34px;
        height: 34px;
        font-size: 15px;
    }
}