/* ===== Layout Pages Internes Unique ===== */
.page-layout {
    display: grid;
    grid-template-columns: 280px 1fr 260px;
    gap: 0;
    max-width: 1600px;
    margin: 64px auto 0;
    min-height: calc(100vh - 64px);
}

/* ===== Sidebar Gauche Unique ===== */
.global-sidebar {
    position: sticky;
    top: 64px;
    height: calc(100vh - 64px);
    background: var(--bg-sidebar);
    border-right: 3px solid var(--primary);
    overflow-y: auto;
    padding: var(--space-xl);
}

.global-sidebar::-webkit-scrollbar {
    width: 6px;
}

.global-sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.global-sidebar::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 3px;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: var(--space-xl);
}

.nav-section-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    margin-bottom: var(--space-md);
}

.nav-link {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 15px;
    font-weight: 600;
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
}

.nav-link:hover {
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary);
    border-left-color: var(--primary);
    padding-left: calc(var(--space-md) + 4px);
}

.nav-link.active {
    background: linear-gradient(90deg, rgba(99, 102, 241, 0.15), rgba(99, 102, 241, 0.05));
    color: var(--primary);
    border-left-color: var(--primary);
    font-weight: 700;
}

.nav-link i {
    font-size: 18px;
    width: 24px;
    flex-shrink: 0;
}

/* Mobile menu button */
.mobile-menu-btn {
    display: none;
    position: fixed;
    bottom: var(--space-lg);
    right: var(--space-lg);
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: white;
    border: none;
    border-radius: 50%;
    box-shadow: var(--shadow-xl);
    cursor: pointer;
    z-index: 999;
    font-size: 24px;
    transition: transform 0.3s ease;
}

.mobile-menu-btn:hover {
    transform: scale(1.1);
}

/* ===== Contenu Principal ===== */
.content-wrapper {
    padding: var(--space-2xl);
    max-width: 900px;
    margin: 0 auto;
}

/* Breadcrumb */
.breadcrumb {
    padding: var(--space-md) 0;
    margin-bottom: var(--space-xl);
}

.breadcrumb-list {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm);
    align-items: center;
    font-size: 14px;
}

.breadcrumb-list li {
    color: var(--text-secondary);
    font-weight: 500;
}

.breadcrumb-list a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s ease;
}

.breadcrumb-list a:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

.breadcrumb-list li:not(:last-child)::after {
    content: "→";
    margin-left: var(--space-sm);
    color: var(--primary);
    font-weight: 700;
}

/* Page Header */
.page-header {
    margin-bottom: var(--space-2xl);
    padding-bottom: var(--space-lg);
    border-bottom: 3px solid var(--primary);
    position: relative;
}

.page-header::before {
    content: '';
    position: absolute;
    bottom: -3px;
    left: 0;
    width: 120px;
    height: 3px;
    background: var(--accent);
}

.page-header h1 {
    font-size: 44px;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: var(--space-md);
    color: var(--text-primary);
    letter-spacing: -0.5px;
}

.page-header .meta {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-lg);
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 500;
}

.page-header .meta span {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
}

.page-header .meta i {
    color: var(--primary);
    font-size: 16px;
}

/* ===== Sidebar Droite (TOC) ===== */
.sidebar-right {
    position: sticky;
    top: 88px;
    height: fit-content;
    padding: var(--space-xl);
    max-height: calc(100vh - 120px);
    overflow-y: auto;
    background: var(--bg-card);
    border-left: 2px solid var(--border-color);
}

.sidebar-right::-webkit-scrollbar {
    width: 4px;
}

.sidebar-right::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 2px;
}

.sidebar-right h3 {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    margin-bottom: var(--space-md);
}

.toc-list {
    list-style: none;
}

.toc-list li {
    margin: 0;
}

.toc-list a {
    display: block;
    padding: var(--space-xs) 0 var(--space-xs) var(--space-md);
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    border-left: 3px solid transparent;
    transition: all 0.2s ease;
    line-height: 1.5;
}

.toc-list a:hover {
    color: var(--primary);
    border-left-color: var(--primary-light);
    padding-left: calc(var(--space-md) + 4px);
}

.toc-list a.active {
    color: var(--primary);
    border-left-color: var(--primary);
    font-weight: 700;
}

/* ===== Stats Grid ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--space-md);
    margin: var(--space-xl) 0;
}

.stat-card {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border: none;
    border-radius: var(--radius-md);
    padding: var(--space-lg);
    text-align: center;
    color: white;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
}

.stat-number {
    font-size: 42px;
    font-weight: 700;
    color: white;
    line-height: 1;
    margin-bottom: var(--space-sm);
    position: relative;
}

.stat-label {
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: rgba(255, 255, 255, 0.9);
    position: relative;
}

/* Couleurs alternées pour stats */
.stat-card:nth-child(2) {
    background: linear-gradient(135deg, var(--secondary), #D97706);
}

.stat-card:nth-child(3) {
    background: linear-gradient(135deg, var(--success), #059669);
}

/* ===== Section Grid ===== */
.section-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--space-lg);
    margin: var(--space-xl) 0;
}

.section-card {
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: var(--space-xl);
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
    position: relative;
}

.section-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.section-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-md);
    transform: translateY(-4px);
}

.section-card:hover::before {
    transform: scaleX(1);
}

.section-card-icon {
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    margin-bottom: var(--space-md);
}

.section-card-icon i {
    font-size: 28px;
}

.section-card h3 {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: var(--space-sm);
    color: var(--text-primary);
}

.section-card p {
    font-size: 15px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin: 0;
}

/* ===== Responsive ===== */
@media (max-width: 1200px) {
    .page-layout {
        grid-template-columns: 280px 1fr;
    }
    
    .sidebar-right {
        display: none;
    }
}

@media (max-width: 768px) {
    .page-layout {
        grid-template-columns: 1fr;
    }
    
    .global-sidebar {
        position: fixed;
        left: -100%;
        top: 64px;
        width: 300px;
        z-index: 998;
        transition: left 0.3s ease;
        box-shadow: var(--shadow-xl);
    }
    
    .global-sidebar.active {
        left: 0;
    }
    
    .mobile-menu-btn {
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .content-wrapper {
        padding: var(--space-lg);
    }
    
    .page-header h1 {
        font-size: 32px;
    }
    
    .section-grid {
        grid-template-columns: 1fr;
    }
}