/* ─── AAE Extranet — Styles personnalisés ─────────────────────────────────── */

:root {
    --aae-primary:    #003366;
    --aae-secondary:  #c8a94a;
    --aae-light-bg:   #f4f6f9;
    --aae-sidebar-w:  300px;
    --userbar-h:      41px;
}

/* ── Layout ─────────────────────────────────────────────────────────────── */
body {
    background-color: var(--aae-light-bg);
    font-family: 'Segoe UI', system-ui, sans-serif;
}

/* ── Sidebar ─────────────────────────────────────────────────────────────── */
.sidebar {
    width: var(--aae-sidebar-w);
    min-height: 100vh;
    background: var(--aae-primary);
    color: #fff;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 200;
    padding-top: 0;
    transition: transform 0.25s ease;
}

.sidebar .brand {
    background: rgba(0,0,0,.2);
    padding: 1rem 1.5rem;
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: .5px;
    border-bottom: 1px solid rgba(255,255,255,.1);
    text-align: center;
}

.sidebar .brand span.gold {
    color: var(--aae-secondary);
}

.sidebar .nav-link {
    color: rgba(255,255,255,.75);
    padding: .55rem 1.25rem;
    border-radius: 6px;
    margin: 2px 8px;
    font-size: .9rem;
    transition: background .15s, color .15s;
}

.sidebar .nav-link:hover,
.sidebar .nav-link.active {
    background: rgba(255,255,255,.12);
    color: #fff;
}

.sidebar .nav-link i {
    width: 1.4rem;
    text-align: center;
    margin-right: .5rem;
}

.sidebar .nav-section {
    font-size: .7rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: rgba(255,255,255,.4);
    padding: 1.25rem 1.25rem .3rem;
}

/* ── Contenu principal ──────────────────────────────────────────────────── */
.main-content {
    margin-left: var(--aae-sidebar-w);
    min-height: 100vh;
}

.userbar {
    background: #f8f9fb;
    border-bottom: 1px solid #e0e4ea;
    padding: .35rem 1.5rem;
    position: sticky;
    top: 0;
    z-index: 100;
}

.topbar {
    background: #fff;
    border-bottom: 1px solid #e0e4ea;
    padding: .65rem 1.5rem;
    position: sticky;
    top: var(--userbar-h);
    z-index: 99;
}

.page-content {
    padding: 1.75rem 2rem;
}

/* ── Cartes ─────────────────────────────────────────────────────────────── */
.card {
    border: none;
    border-radius: 10px;
    box-shadow: 0 1px 4px rgba(0,0,0,.08);
}

.card-header {
    background: #fff;
    border-bottom: 1px solid #edf0f4;
    font-weight: 600;
    border-radius: 10px 10px 0 0 !important;
}

/* ── Badges de statut ───────────────────────────────────────────────────── */
.badge-active      { background-color: #198754; color: #fff; }
.badge-deceased    { background-color: #6c757d; color: #fff; }
.badge-resigned    { background-color: #fd7e14; color: #fff; }
.badge-non-renewed { background-color: #dc3545; color: #fff; }
.badge-archived    { background-color: #343a40; color: #fff; }

/* ── Timeline membre ────────────────────────────────────────────────────── */
.timeline { position: relative; padding-left: 2rem; }
.timeline::before {
    content: '';
    position: absolute;
    left: .7rem;
    top: 0; bottom: 0;
    width: 2px;
    background: #dee2e6;
}

.timeline-item { position: relative; margin-bottom: 1.25rem; }
.timeline-item::before {
    content: '';
    position: absolute;
    left: -1.65rem;
    top: .35rem;
    width: 10px; height: 10px;
    border-radius: 50%;
    background: var(--aae-primary);
    border: 2px solid #fff;
    box-shadow: 0 0 0 2px var(--aae-primary);
}

.timeline-item.edited::before { background: var(--aae-secondary); box-shadow: 0 0 0 2px var(--aae-secondary); }

/* ── Page de login ──────────────────────────────────────────────────────── */
.login-wrapper {
    min-height: 100vh;
    background: linear-gradient(135deg, var(--aae-primary) 0%, #005599 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-card {
    width: 100%;
    max-width: 420px;
    border-radius: 14px;
    box-shadow: 0 20px 60px rgba(0,0,0,.3);
}

.login-card .card-header {
    background: var(--aae-primary);
    color: #fff;
    text-align: center;
    padding: 2rem;
    border-radius: 14px 14px 0 0 !important;
}

.login-card .logo-text {
    font-size: 1.6rem;
    font-weight: 700;
    letter-spacing: 2px;
}

.login-card .logo-subtitle {
    font-size: .8rem;
    opacity: .8;
    letter-spacing: 1px;
    text-transform: uppercase;
}

/* ── Boutons d'archivage ────────────────────────────────────────────────── */
.btn-archive { font-size: .82rem; }

/* ── Overlay mobile ─────────────────────────────────────────────────────── */
#sidebarOverlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.45);
    z-index: 150;
    opacity: 0;
    transition: opacity 0.25s ease;
}
body.sidebar-open #sidebarOverlay {
    display: block;
    opacity: 1;
}

/* ── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 991.98px) {
    .sidebar {
        width: 100%;
        height: 100vh;
        overflow-y: auto;
        transform: translateX(-100%);
    }
    .sidebar.sidebar-open {
        transform: translateX(0);
    }
    .main-content { margin-left: 0; }
    .page-content { padding: 1rem; }
    .topbar { flex-wrap: wrap; gap: .5rem; }
    .user-name { max-width: 110px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
}

/* ── Boutons d'action dans les cards dashboard (wrap sous lg) ──────────── */
@media (max-width: 991.98px) {
    .dash-item-actions {
        flex: 0 0 100%;
        display: flex;
        justify-content: flex-end;
        gap: .25rem;
        margin-top: .25rem;
    }
}

/* ── Titres Jodit (éditeur + affichage) ─────────────────────────────────── */
.jodit-wysiwyg h1, .jodit-content h1 { font-size: 1.5rem;  margin-bottom: .4rem;  padding-top: 15px; padding-bottom: 15px; color: #003366; text-align: center; }
.jodit-wysiwyg h2, .jodit-content h2 { font-size: 1.3rem;  margin-bottom: .35rem; padding-top: 10px; padding-bottom: 6px; padding-left: 10px; padding-right: 10px; background-color: #004489; color: #fff; }
.jodit-wysiwyg h3, .jodit-content h3 { font-size: 1.15rem; margin-bottom: .3rem;  padding-top: 10px; padding-bottom: 6px; color: #004489; background-color: transparent; text-decoration: underline; }
.jodit-wysiwyg h4, .jodit-content h4 { font-size: 1.05rem; margin-bottom: .25rem; padding-top: 10px; padding-bottom: 6px; color: #004489; background-color: transparent; }
