﻿:root {
    --primary: #1b8f7a;
    --primary-dk: #0f6e5c;
    --primary-lt: #e1f5ee;
    --navy: #0f2044;
    --navy-mid: #1a3a6e;
    --white: #fff;
    --off: #f4f6fb;
    --g100: #eef0f6;
    --g300: #c4c9d9;
    --g500: #7a839e;
    --g700: #3d4460;
    --text: #0d1b3e;
    --red: #dc2626;
    --red-lt: #fee2e2;
    --sidebar-w: 258px;
    --topbar-h: 56px;
    --r: 12px;
    --sh: 0 2px 14px rgba(15,32,68,.08);
    --sh-lg: 0 8px 30px rgba(15,32,68,.14);
    --tr: all .22s cubic-bezier(.4,0,.2,1);
}

/* ═══════════════════════════════════════════
   RESET
═══════════════════════════════════════════ */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    height: 100%;
}

body {
    font-family: 'DM Sans', sans-serif;
    background: var(--off);
    color: var(--text);
    display: flex;
    overflow: hidden;
}

/* ═══════════════════════════════════════════
   OVERLAY MOBILE
═══════════════════════════════════════════ */
.sb-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 32, 68, .45);
    z-index: 199;
    backdrop-filter: blur(2px);
}

    .sb-overlay.on {
        display: block;
    }

/* ═══════════════════════════════════════════
   SIDEBAR
═══════════════════════════════════════════ */
.sidebar {
    width: var(--sidebar-w);
    height: 100vh;
    background: var(--white);
    border-right: 1px solid var(--g100);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    overflow: hidden;
    transition: transform .28s cubic-bezier(.4,0,.2,1);
    z-index: 200;
    position: relative;
}

/* ── En-tête ── */
.sb-header {
    padding: 20px 18px 16px;
    border-bottom: 1px solid var(--g100);
    flex-shrink: 0;
}

.sb-brand {
    display: flex;
    align-items: center;
    gap: 11px;
    margin-bottom: 16px;
}

.sb-logo {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

    .sb-logo svg {
        width: 20px;
        height: 20px;
        fill: white;
    }

.sb-brand-txt strong {
    font-family: 'Playfair Display', serif;
    font-size: 14px;
    font-weight: 700;
    color: var(--navy);
    display: block;
}

.sb-brand-txt span {
    font-size: 11px;
    color: var(--g500);
}

/* Profil */
.sb-profile {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--primary-lt);
    border-radius: var(--r);
    padding: 10px 12px;
}

.avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 12px;
    color: white;
    flex-shrink: 0;
}

.prof-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    line-height: 1.3;
}

.prof-meta {
    font-size: 11px;
    color: var(--primary);
    font-weight: 500;
}

/* ── Nav ── */
.sb-nav {
    flex: 1;
    padding: 12px 10px;
    overflow-y: auto;
}

    .sb-nav::-webkit-scrollbar {
        width: 3px;
    }

    .sb-nav::-webkit-scrollbar-thumb {
        background: var(--g300);
        border-radius: 50px;
    }

.nav-section {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--g300);
    padding: 10px 10px 4px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: var(--r);
    cursor: pointer;
    font-size: 13px;
    font-weight: 400;
    color: var(--g700);
    transition: var(--tr);
    margin-bottom: 1px;
    text-decoration: none;
}

    .nav-item svg {
        width: 16px;
        height: 16px;
        flex-shrink: 0;
        opacity: .65;
        transition: opacity .2s;
    }

    .nav-item:hover {
        background: var(--g100);
        color: var(--text);
    }

        .nav-item:hover svg {
            opacity: 1;
        }

    .nav-item.active {
        background: var(--primary);
        color: white;
        font-weight: 600;
    }

        .nav-item.active svg {
            opacity: 1;
        }

.badge-count {
    margin-left: auto;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 50px;
}

.nav-item.active .badge-count {
    background: rgba(255,255,255,.25);
    color: white;
}

.nav-item:not(.active) .badge-count {
    background: var(--red-lt);
    color: var(--red);
}

/* ── Pied ── */
.sb-footer {
    padding: 12px 10px;
    border-top: 1px solid var(--g100);
    flex-shrink: 0;
}

.logout {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: var(--r);
    cursor: pointer;
    font-size: 13px;
    color: var(--g500);
    border: none;
    background: transparent;
    font-family: 'DM Sans', sans-serif;
    width: 100%;
    transition: var(--tr);
}

    .logout:hover {
        color: var(--red);
        background: var(--red-lt);
    }

    .logout svg {
        width: 15px;
        height: 15px;
    }

/* ═══════════════════════════════════════════
   MAIN
═══════════════════════════════════════════ */
.main {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-width: 0;
}

/* ── Top bar ── */
.topbar {
    height: var(--topbar-h);
    background: var(--white);
    border-bottom: 1px solid var(--g100);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    flex-shrink: 0;
}

.topbar-l {
    display: flex;
    align-items: center;
    gap: 10px;
}

.topbar-r {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Bouton hamburger — visible seulement sur mobile */
.ham {
    display: none;
    background: none;
    border: none;
    padding: 7px;
    border-radius: 9px;
    cursor: pointer;
    color: var(--g700);
    transition: var(--tr);
}

    .ham:hover {
        background: var(--g100);
    }

    .ham svg {
        width: 20px;
        height: 20px;
        display: block;
        stroke: currentColor;
        fill: none;
        stroke-width: 2;
        stroke-linecap: round;
    }

.page-title {
    font-family: 'Playfair Display', serif;
    font-size: 17px;
    font-weight: 700;
    color: var(--navy);
}

.chip {
    font-size: 12px;
    font-weight: 500;
    color: var(--g500);
    background: var(--g100);
    padding: 5px 12px;
    border-radius: 50px;
}

.icon-btn {
    width: 34px;
    height: 34px;
    border-radius: 9px;
    background: var(--g100);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: var(--tr);
}

    .icon-btn:hover {
        background: var(--g300);
    }

    .icon-btn svg {
        width: 15px;
        height: 15px;
        color: var(--g700);
    }

.notif-dot {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--red);
    border: 2px solid white;
}

/* Switcher FR / EN */
.lang-sw {
    display: flex;
    background: var(--g100);
    border-radius: 50px;
    padding: 3px;
}

    .lang-sw button {
        padding: 4px 12px;
        border: none;
        border-radius: 50px;
        font-family: 'DM Sans', sans-serif;
        font-size: .68rem;
        font-weight: 700;
        cursor: pointer;
        background: transparent;
        color: var(--g500);
        transition: var(--tr);
    }

        .lang-sw button.on {
            background: var(--primary);
            color: white;
            box-shadow: 0 2px 8px rgba(27,143,122,.28);
        }

/* ── Zone de contenu ── */
.content {
    flex: 1;
    overflow-y: auto;
    padding: 28px 28px;
    scroll-behavior: smooth;
}

    .content::-webkit-scrollbar {
        width: 4px;
    }

    .content::-webkit-scrollbar-thumb {
        background: var(--g300);
        border-radius: 50px;
    }

/* Placeholder de contenu */
.content-placeholder {
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    color: var(--g300);
    text-align: center;
    user-select: none;
}

    .content-placeholder svg {
        width: 52px;
        height: 52px;
        stroke: var(--g300);
        fill: none;
        stroke-width: 1.2;
        stroke-linecap: round;
        stroke-linejoin: round;
    }

    .content-placeholder p {
        font-size: 13px;
        color: var(--g500);
        max-width: 280px;
        line-height: 1.6;
    }

    .content-placeholder code {
        font-size: 11px;
        background: var(--g100);
        padding: 3px 8px;
        border-radius: 6px;
        color: var(--primary-dk);
    }

/* ═══════════════════════════════════════════
   RESPONSIVE
═══════════════════════════════════════════ */
@media (max-width: 820px) {
    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        transform: translateX(-100%);
        box-shadow: var(--sh-lg);
    }

        .sidebar.open {
            transform: translateX(0);
        }

    .ham {
        display: flex;
    }

    .chip {
        display: none;
    }

    .main {
        width: 100%;
    }

    .topbar {
        padding: 0 16px;
    }

    .content {
        padding: 18px 16px;
    }
}

@media (max-width: 480px) {
    .topbar-r .icon-btn {
        display: none;
    }

    .page-title {
        font-size: 15px;
    }
}


/* ═══════════════════════════════════════════════
   SPINNER OVERLAY
═══════════════════════════════════════════════ */
#spinOverlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(13,31,6,.72);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 18px;
}

    #spinOverlay.on {
        display: flex
    }

.spin-ring {
    width: 58px;
    height: 58px;
    border-radius: 50%;
    border: 4px solid rgba(255,255,255,.15);
    border-top-color: var(--gilt);
    animation: rotate .75s linear infinite;
}

@keyframes rotate {
    to {
        transform: rotate(360deg)
    }
}

.spin-label {
    font-size: .95rem;
    font-weight: 600;
    color: #fff;
    letter-spacing: .4px
}

.spin-hint {
    font-size: .75rem;
    color: rgba(255,255,255,.45);
    margin-top: -10px
}

