/* VARIABLES */
:root {
    --primary-color: #0078D4;
    --primary-dark: #005a9e;
    --bg-body: #F3F2F1;
    --bg-card: #FFFFFF;
    --bg-sidebar: #FFFFFF;
    --text-main: #201F1E;
    --text-muted: #605E5C;
    --border-color: #E1DFDD;
    --shadow-card: 0 2px 4px rgba(0,0,0,0.08);
    --shadow-hover: 0 8px 16px rgba(0,0,0,0.12);
    --console-bg: #1e1e1e;
    --sidebar-width: 280px;
}

[data-theme="dark"] {
    --primary-color: #479EF5;
    --primary-dark: #0078D4;
    --bg-body: #1B1A19;
    --bg-card: #252423;
    --bg-sidebar: #252423;
    --text-main: #FFFFFF;
    --text-muted: #A19F9D;
    --border-color: #484644;
    --shadow-card: 0 2px 4px rgba(0,0,0,0.3);
    --shadow-hover: 0 8px 16px rgba(0,0,0,0.5);
}

/* RESET */
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
    font-family: "Segoe UI", system-ui, sans-serif;
    background-color: var(--bg-body);
    color: var(--text-main);
    line-height: 1.5;
    overflow-x: hidden; /* Empêche le scroll horizontal */
    width: 100%;
}
a { text-decoration: none; color: inherit; transition: 0.2s; }
ul { list-style: none; }

/* LAYOUT */
.app-container { display: flex; min-height: 100vh; width: 100%; }

/* SIDEBAR */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    position: fixed;
    height: 100vh;
    z-index: 2000; /* Au dessus du header mobile */
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    transition: transform 0.3s ease;
}

.sidebar-header { padding: 24px; flex-shrink: 0; }
.logo-area { display: flex; align-items: center; gap: 12px; }
.initials-circle { width: 48px; height: 48px; background: var(--primary-color); color: white; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: 1.1rem; flex-shrink: 0; }
.user-name { font-weight: 600; display: block; font-size: 1rem; }
.user-role { font-size: 0.8rem; color: var(--text-muted); }

.sidebar-info-group { padding: 10px 24px; display: flex; flex-direction: column; gap: 12px; border-bottom: 1px solid var(--border-color); padding-bottom: 20px; }
.contact-mini-block { display: flex; flex-direction: column; gap: 10px; }
.contact-row { font-size: 0.85rem; color: var(--text-muted); display: flex; align-items: center; gap: 10px; word-break: break-word; }
.contact-row:hover { color: var(--primary-color); }
.quick-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.action-chip { font-size: 0.75rem; padding: 6px 10px; border: 1px solid var(--border-color); border-radius: 4px; color: var(--text-main); background: var(--bg-card); display: flex; align-items: center; gap: 6px; }
.action-chip:hover { border-color: var(--primary-color); color: var(--primary-color); background: rgba(0,120,212,0.05); }
.theme-switch-row { display: flex; justify-content: space-between; align-items: center; margin-top: 5px; }
.info-label { font-size: 0.85rem; }

.nav-links { padding: 20px 0; flex-grow: 1; }
.nav-links a { display: flex; align-items: center; padding: 12px 24px; color: var(--text-main); border-left: 4px solid transparent; font-size: 0.95rem; }
.nav-links a i { width: 24px; margin-right: 8px; color: var(--text-muted); }
.nav-links a:hover { background: rgba(0,0,0,0.04); }
.nav-links a.active { background: rgba(0,120,212,0.1); border-left-color: var(--primary-color); font-weight: 600; }
.nav-links a.active i { color: var(--primary-color); }
.sidebar-footer { padding: 20px; text-align: center; border-top: 1px solid var(--border-color); font-size: 0.75rem; color: var(--text-muted); }

/* MAIN CONTENT */
.main-content { margin-left: var(--sidebar-width); width: calc(100% - var(--sidebar-width)); padding: 0; }
.mobile-top-bar { display: none; }
.content-wrapper { padding: 40px; max-width: 1100px; margin: 0 auto; }

/* SECTIONS & CARDS */
.section { margin-bottom: 80px; scroll-margin-top: 40px; padding-top: 20px; }
.section-title { font-size: 1.5rem; margin-bottom: 30px; color: var(--text-main); display: flex; align-items: center; gap: 12px; border-bottom: 2px solid var(--border-color); padding-bottom: 10px; }
.card { background: var(--bg-card); border-radius: 4px; padding: 24px; box-shadow: var(--shadow-card); border: 1px solid transparent; transition: all 0.2s; height: 100%; display: flex; flex-direction: column; }
.card:hover { transform: translateY(-2px); box-shadow: var(--shadow-hover); border-color: var(--primary-color); }

/* HERO */
.hero-card { background: var(--bg-card); border-radius: 4px; box-shadow: var(--shadow-card); display: flex; gap: 40px; padding: 40px; align-items: center; flex-wrap: wrap; }
.hero-content { flex: 1; min-width: 300px; }
.status-badge { display: inline-flex; align-items: center; gap: 6px; background: #e6f2fb; color: #0078d4; padding: 4px 12px; border-radius: 100px; font-size: 0.8rem; font-weight: 600; margin-bottom: 16px; }
[data-theme="dark"] .status-badge { background: rgba(0,120,212,0.2); color: #479EF5; }
.hero-content h1 { font-size: 2.2rem; margin-bottom: 12px; line-height: 1.2; }
.subtitle { color: var(--text-muted); margin-bottom: 24px; font-size: 1.1rem; }
.btn { padding: 8px 20px; border-radius: 2px; font-weight: 600; display: inline-block; cursor: pointer; border: 1px solid transparent; transition: 0.2s; }
.btn-primary { background: var(--primary-color); color: white; }
.btn-secondary { background: white; border-color: var(--border-color); color: var(--text-main); }
[data-theme="dark"] .btn-secondary { background: transparent; }

/* CONSOLE */
.console-window { flex: 1; min-width: 320px; background: var(--console-bg); border-radius: 6px; overflow: hidden; font-family: 'Consolas', monospace; color: #d4d4d4; box-shadow: 0 10px 30px rgba(0,0,0,0.25); }
.console-header { background: #252526; padding: 8px 15px; font-size: 0.75rem; color: #ccc; }
.console-body { padding: 20px; font-size: 0.85rem; line-height: 1.6; }
.ps-prompt { color: #569cd6; } .text-highlight { color: #ce9178; }
.cursor { animation: blink 1s infinite; border-left: 2px solid #ccc; margin-left: 2px; }
@keyframes blink { 50% { opacity: 0; } }

/* GRIDS */
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(350px, 1fr)); gap: 24px; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 24px; }
.tags-container { display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; padding-top: 15px; }
.tag { font-size: 0.8rem; padding: 4px 10px; border-radius: 4px; background: #f3f2f1; color: var(--text-main); }
.tag.high-priority { background: rgba(0,120,212,0.1); color: var(--primary-color); font-weight: 500; }
[data-theme="dark"] .tag { background: #333; }

/* CERTIF */
.cert-header { display: flex; justify-content: space-between; margin-bottom: 10px; }
.ms-logo { font-size: 24px; color: var(--text-muted); }
.cert-status { font-size: 0.7rem; font-weight: 700; text-transform: uppercase; color: #107C10; }
[data-theme="dark"] .cert-status { color: #6CC45E; }
.link-arrow { font-size: 0.85rem; color: var(--primary-color); margin-top: auto; font-weight: 500; display: inline-flex; align-items: center; gap: 5px; }

/* TIMELINE */
.timeline { border-left: 2px solid var(--border-color); margin-left: 12px; padding-left: 24px; }
.timeline-item { position: relative; margin-bottom: 32px; }
.timeline-marker { position: absolute; left: -31px; top: 24px; width: 12px; height: 12px; background: var(--bg-body); border: 3px solid var(--primary-color); border-radius: 50%; z-index: 2; }
.company { font-weight: 600; color: var(--primary-color); }
.date-badge { font-size: 0.8rem; color: var(--text-muted); float: right; }
.location { font-size: 0.85rem; color: var(--text-muted); font-style: italic; margin-bottom: 12px; }

/* THEME SWITCH */
.theme-switch { position: relative; display: inline-block; width: 40px; height: 20px; }
.theme-switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: #ccc; transition: .4s; border-radius: 20px; }
.slider:before { position: absolute; content: ""; height: 16px; width: 16px; left: 2px; bottom: 2px; background-color: white; transition: .4s; border-radius: 50%; }
input:checked + .slider { background-color: var(--primary-color); }
input:checked + .slider:before { transform: translateX(20px); }

/* ANIMATIONS */
.animate-up { animation: slideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards; opacity: 0; }
.delay-1 { animation-delay: 0.1s; } .delay-2 { animation-delay: 0.15s; } .delay-3 { animation-delay: 0.2s; }
@keyframes slideUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }

/* --- MOBILE RESPONSIVE (LA CLÉ POUR TOI) --- */
@media (max-width: 900px) {
    .sidebar { transform: translateX(-100%); width: 280px; box-shadow: 2px 0 10px rgba(0,0,0,0.5); }
    .sidebar.active { transform: translateX(0); }
    
    /* HEADER FIXE EN HAUT */
    .mobile-top-bar { 
        display: flex; align-items: center; 
        padding: 15px 20px; background: var(--bg-card); border-bottom: 1px solid var(--border-color); 
        position: sticky; top: 0; z-index: 1500; 
        width: 100%; 
    }
    .header-left { display: flex; align-items: center; gap: 15px; }
    #menu-toggle { background: none; border: none; font-size: 1.2rem; color: var(--text-main); cursor: pointer; }
    .page-title { font-weight: 600; font-size: 1rem; }

    /* CONTENT */
    .main-content { margin-left: 0; width: 100%; }
    .content-wrapper { padding: 20px 15px; /* Moins de padding sur mobile */ }
    
    /* HERO STACK */
    .hero-card { flex-direction: column; align-items: stretch; padding: 25px; gap: 30px; }
    .hero-content, .console-window { min-width: 100%; width: 100%; }
    
    /* GRID STACK */
    .grid-2, .grid-3 { grid-template-columns: 1fr; }
    
    /* TIMELINE */
    .date-badge { float: none; display: block; margin-top: 5px; }
    
    /* TYPO */
    .hero-content h1 { font-size: 1.8rem; }
}