/* ═══════════════════════════════════════════════════════════════════
   ALIGN — Design System Principal
   Version 1.0 — Sprint 0
   Stack : CSS Vanilla (compatible hébergement mutualisé)
═══════════════════════════════════════════════════════════════════ */

/* ─── 1. TOKENS DE DESIGN ─────────────────────────────────────── */
:root {
    /* Couleur principale (surchargée par Twig depuis OngSettings) */
    --color-primary:       #2D6A4F;
    --color-primary-dark:  #1B4332;
    --color-primary-light: #D8F3DC;

    /* Couleurs neutres */
    --color-bg:         #F8FAFC;
    --color-bg-card:    #FFFFFF;
    --color-bg-sidebar: #0F172A;
    --color-surface:    #FFFFFF;
    --color-border:     #E2E8F0;
    --color-border-focus: #94A3B8;

    /* Texte */
    --color-text:        #0F172A;
    --color-text-muted:  #64748B;
    --color-text-light:  #94A3B8;
    --color-text-inv:    #FFFFFF;

    /* Couleurs sémantiques */
    --color-success:  #16A34A;
    --color-success-bg: #DCFCE7;
    --color-danger:   #DC2626;
    --color-danger-bg: #FEE2E2;
    --color-warning:  #D97706;
    --color-warning-bg: #FEF9C3;
    --color-info:     #0284C7;
    --color-info-bg:  #E0F2FE;

    /* Couleurs accent pour stat cards */
    --color-blue:   #3B82F6;
    --color-blue-bg: #DBEAFE;
    --color-green:  #22C55E;
    --color-green-bg: #DCFCE7;
    --color-amber:  #F59E0B;
    --color-amber-bg: #FEF3C7;
    --color-red:    #EF4444;
    --color-red-bg: #FEE2E2;
    --color-teal:   #14B8A6;
    --color-teal-bg: #CCFBF1;

    /* Sidebar */
    --sidebar-width:           260px;
    --sidebar-width-collapsed: 68px;
    --topbar-height:           64px;

    /* Espacement */
    --space-1:  4px;
    --space-2:  8px;
    --space-3:  12px;
    --space-4:  16px;
    --space-5:  20px;
    --space-6:  24px;
    --space-8:  32px;
    --space-10: 40px;
    --space-12: 48px;

    /* Typographie */
    --font-sans:    'Inter', system-ui, -apple-system, sans-serif;
    --font-display: 'Plus Jakarta Sans', 'Inter', sans-serif;

    --text-xs:   0.75rem;
    --text-sm:   0.875rem;
    --text-base: 1rem;
    --text-lg:   1.125rem;
    --text-xl:   1.25rem;
    --text-2xl:  1.5rem;
    --text-3xl:  1.875rem;
    --text-4xl:  2.25rem;

    --fw-normal:    400;
    --fw-medium:    500;
    --fw-semibold:  600;
    --fw-bold:      700;
    --fw-extrabold: 800;

    /* Bordures */
    --radius-sm: 6px;
    --radius:    10px;
    --radius-lg: 14px;
    --radius-xl: 20px;
    --radius-full: 9999px;

    /* Ombres */
    --shadow-sm: 0 1px 2px rgba(0,0,0,.05);
    --shadow:    0 4px 6px -1px rgba(0,0,0,.06), 0 2px 4px -1px rgba(0,0,0,.04);
    --shadow-md: 0 10px 15px -3px rgba(0,0,0,.07), 0 4px 6px -2px rgba(0,0,0,.04);
    --shadow-lg: 0 20px 25px -5px rgba(0,0,0,.08), 0 10px 10px -5px rgba(0,0,0,.03);
    --shadow-xl: 0 25px 50px -12px rgba(0,0,0,.15);

    /* Transitions */
    --transition-fast:   all 0.15s ease;
    --transition:        all 0.2s ease;
    --transition-slow:   all 0.3s ease;
}

/* ─── 2. RESET & BASE ─────────────────────────────────────────── */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-sans);
    font-size: var(--text-base);
    color: var(--color-text);
    background-color: var(--color-bg);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

img { max-width: 100%; height: auto; display: block; }
a  { color: inherit; text-decoration: none; }
button { cursor: pointer; font-family: inherit; border: none; background: none; }
input, select, textarea { font-family: inherit; }

/* ─── 3. LAYOUT PRINCIPAL ─────────────────────────────────────── */
.align-main {
    margin-left: var(--sidebar-width);
    margin-top: var(--topbar-height);
    min-height: calc(100vh - var(--topbar-height));
    padding: var(--space-8);
    transition: margin-left var(--transition);
}

/* ─── 4. SIDEBAR ──────────────────────────────────────────────── */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--color-bg-sidebar);
    display: flex;
    flex-direction: column;
    z-index: 100;
    transition: width var(--transition);
    overflow: hidden;
}

.sidebar--collapsed {
    width: var(--sidebar-width-collapsed);
}

/* Brand / Logo */
.sidebar__brand {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-5) var(--space-4);
    border-bottom: 1px solid rgba(255,255,255,.08);
    min-height: var(--topbar-height);
}

.sidebar__logo {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    object-fit: contain;
    flex-shrink: 0;
}

.sidebar__logo-placeholder {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    background: var(--color-primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
    font-weight: var(--fw-bold);
    font-size: var(--text-lg);
    flex-shrink: 0;
}

.sidebar__ong-name {
    font-family: var(--font-display);
    font-weight: var(--fw-bold);
    font-size: var(--text-sm);
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    opacity: 1;
    transition: var(--transition);
    flex: 1;
}

.sidebar--collapsed .sidebar__ong-name { opacity: 0; width: 0; }

.sidebar__collapse-btn {
    width: 28px;
    height: 28px;
    border-radius: var(--radius-sm);
    color: rgba(255,255,255,.5);
    background: rgba(255,255,255,.06);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: var(--transition);
}

.sidebar__collapse-btn:hover { color: #fff; background: rgba(255,255,255,.12); }
.sidebar--collapsed .sidebar__collapse-btn svg { transform: rotate(180deg); }

/* Navigation */
.sidebar__nav {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: var(--space-4) var(--space-3);
    overflow-y: auto;
    overflow-x: hidden;
}

.sidebar__nav::-webkit-scrollbar { width: 4px; }
.sidebar__nav::-webkit-scrollbar-track { background: transparent; }
.sidebar__nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,.1); border-radius: 4px; }

.sidebar__link {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-2) var(--space-3);
    border-radius: var(--radius);
    color: rgba(255,255,255,.6);
    font-size: var(--text-sm);
    font-weight: var(--fw-medium);
    transition: var(--transition-fast);
    white-space: nowrap;
    position: relative;
}

.sidebar__link:hover {
    background: rgba(255,255,255,.08);
    color: #fff;
}

.sidebar__link--active {
    background: var(--color-primary);
    color: #fff;
    box-shadow: 0 4px 12px rgba(45,106,79,.4);
}

.sidebar__link--active:hover { background: var(--color-primary-dark); }

.sidebar__link--soon { opacity: .6; }
.sidebar__link--soon:hover { opacity: .85; }

.sidebar__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    flex-shrink: 0;
}

.sidebar__label {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: var(--transition);
}

.sidebar--collapsed .sidebar__label { opacity: 0; width: 0; overflow: hidden; }

.sidebar__badge {
    font-size: 10px;
    font-weight: var(--fw-semibold);
    padding: 2px 6px;
    border-radius: var(--radius-full);
    background: rgba(255,255,255,.1);
    color: rgba(255,255,255,.5);
    white-space: nowrap;
    flex-shrink: 0;
    transition: var(--transition);
}

.sidebar--collapsed .sidebar__badge { display: none; }

.sidebar__divider {
    height: 1px;
    background: rgba(255,255,255,.06);
    margin: var(--space-2) 0;
}

/* Footer sidebar */
.sidebar__footer {
    padding: var(--space-4);
    border-top: 1px solid rgba(255,255,255,.06);
}

.sidebar__version {
    font-size: var(--text-xs);
    color: rgba(255,255,255,.3);
    white-space: nowrap;
    overflow: hidden;
    transition: var(--transition);
}

.sidebar--collapsed .sidebar__version { opacity: 0; }

/* ─── 5. TOPBAR ───────────────────────────────────────────────── */
.topbar {
    position: fixed;
    top: 0;
    left: var(--sidebar-width);
    right: 0;
    height: var(--topbar-height);
    background: var(--color-bg-card);
    border-bottom: 1px solid var(--color-border);
    display: flex;
    align-items: center;
    gap: var(--space-4);
    padding: 0 var(--space-6);
    z-index: 99;
    transition: left var(--transition);
}

.topbar__menu-btn {
    display: none;
    color: var(--color-text-muted);
    padding: var(--space-2);
    border-radius: var(--radius-sm);
}

@media (max-width: 768px) {
    .topbar { left: 0; }
    .topbar__menu-btn { display: flex; }
    .sidebar { transform: translateX(-100%); }
    .sidebar.sidebar--open { transform: translateX(0); }
    .align-main { margin-left: 0; }
}

.topbar__title {
    flex: 1;
    font-size: var(--text-sm);
    color: var(--color-text-muted);
    font-weight: var(--fw-medium);
}

.topbar__actions {
    position: relative;
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.topbar__user-btn {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-2) var(--space-3);
    border-radius: var(--radius-lg);
    transition: var(--transition-fast);
    color: var(--color-text);
}

.topbar__user-btn:hover { background: var(--color-bg); }

.topbar__avatar {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-full);
    background: var(--color-primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--text-sm);
    font-weight: var(--fw-bold);
    flex-shrink: 0;
}

.topbar__user-info {
    display: flex;
    flex-direction: column;
    text-align: left;
}

.topbar__user-name {
    font-size: var(--text-sm);
    font-weight: var(--fw-semibold);
    line-height: 1.2;
}

.topbar__user-role {
    font-size: var(--text-xs);
    color: var(--color-text-muted);
    line-height: 1.2;
}

/* Dropdown menu */
.topbar__dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 200px;
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    z-index: 200;
}

.topbar__dropdown-item {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
    font-size: var(--text-sm);
    color: var(--color-text);
    transition: var(--transition-fast);
}

.topbar__dropdown-item:hover { background: var(--color-bg); }
.topbar__dropdown-item--danger { color: var(--color-danger); }
.topbar__dropdown-item--danger:hover { background: var(--color-danger-bg); }

.topbar__dropdown-divider {
    height: 1px;
    background: var(--color-border);
    margin: 4px 0;
}

/* ─── 6. BREADCRUMB ───────────────────────────────────────────── */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    margin-bottom: var(--space-4);
    font-size: var(--text-sm);
    color: var(--color-text-muted);
}

.breadcrumb__item { display: flex; align-items: center; gap: var(--space-2); }
.breadcrumb__item--active { color: var(--color-text); font-weight: var(--fw-medium); }
.breadcrumb__separator { color: var(--color-text-light); }

/* ─── 7. PAGE HEADER ──────────────────────────────────────────── */
.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--space-4);
    margin-bottom: var(--space-8);
}

.page-title {
    font-family: var(--font-display);
    font-size: var(--text-2xl);
    font-weight: var(--fw-bold);
    color: var(--color-text);
    line-height: 1.2;
}

.page-subtitle {
    font-size: var(--text-sm);
    color: var(--color-text-muted);
    margin-top: var(--space-1);
}

/* ─── 8. DASHBOARD — STAT CARDS ───────────────────────────────── */
.dashboard-grid {
    display: flex;
    flex-direction: column;
    gap: var(--space-6);
}

.stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--space-4);
}

.stat-card {
    background: var(--color-bg-card);
    border-radius: var(--radius-lg);
    padding: var(--space-6);
    display: flex;
    align-items: center;
    gap: var(--space-4);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--color-border);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
}

.stat-card--blue::before   { background: var(--color-blue); }
.stat-card--green::before  { background: var(--color-green); }
.stat-card--amber::before  { background: var(--color-amber); }
.stat-card--red::before    { background: var(--color-red); }
.stat-card--teal::before   { background: var(--color-teal); }

.stat-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }

.stat-card__icon {
    width: 52px;
    height: 52px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
}

.stat-card--blue .stat-card__icon   { background: var(--color-blue-bg); color: var(--color-blue); }
.stat-card--green .stat-card__icon  { background: var(--color-green-bg); color: var(--color-green); }
.stat-card--amber .stat-card__icon  { background: var(--color-amber-bg); color: var(--color-amber); }
.stat-card--red .stat-card__icon    { background: var(--color-red-bg); color: var(--color-red); }
.stat-card--teal .stat-card__icon   { background: var(--color-teal-bg); color: var(--color-teal); }

.stat-card__data {
    display: flex;
    flex-direction: column;
}

.stat-card__value {
    font-family: var(--font-display);
    font-size: var(--text-3xl);
    font-weight: var(--fw-extrabold);
    line-height: 1;
    color: var(--color-text);
}

.stat-card__label {
    font-size: var(--text-sm);
    color: var(--color-text-muted);
    margin-top: var(--space-1);
}

/* ─── 9. DASHBOARD CARD ───────────────────────────────────────── */
.dashboard-card {
    background: var(--color-bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.dashboard-card__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-5) var(--space-6);
    border-bottom: 1px solid var(--color-border);
}

.dashboard-card__title {
    font-family: var(--font-display);
    font-size: var(--text-base);
    font-weight: var(--fw-semibold);
    color: var(--color-text);
}

.dashboard-card__body {
    padding: var(--space-6);
}

/* Grille de modules */
.module-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: var(--space-3);
}

.module-card {
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: var(--space-4);
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
    transition: var(--transition-fast);
    opacity: .6;
}

.module-card--active {
    border-color: var(--color-primary-light);
    background: color-mix(in srgb, var(--color-primary) 4%, white);
    opacity: 1;
}

.module-card__icon { font-size: 1.5rem; }
.module-card__name { font-size: var(--text-sm); font-weight: var(--fw-semibold); }
.module-card__sprint { font-size: var(--text-xs); color: var(--color-text-light); }

.module-card__status {
    font-size: var(--text-xs);
    font-weight: var(--fw-semibold);
    padding: 2px 8px;
    border-radius: var(--radius-full);
    width: fit-content;
}

.module-card__status--active { background: var(--color-success-bg); color: var(--color-success); }
.module-card__status--off    { background: var(--color-border); color: var(--color-text-muted); }

/* Liste pays */
.country-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.country-item {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius);
    border: 1px solid var(--color-border);
    transition: var(--transition-fast);
}

.country-item:hover { background: var(--color-bg); }
.country-item__name { flex: 1; font-size: var(--text-sm); font-weight: var(--fw-medium); }

.country-item__status {
    font-size: var(--text-xs);
    font-weight: var(--fw-semibold);
    padding: 2px 8px;
    border-radius: var(--radius-full);
}

.country-item__status--legalise     { background: var(--color-success-bg); color: var(--color-success); }
.country-item__status--en_cours     { background: var(--color-warning-bg); color: var(--color-warning); }
.country-item__status--non_legalise { background: var(--color-border); color: var(--color-text-muted); }

/* ─── 10. EMPTY STATE ─────────────────────────────────────────── */
.empty-state {
    text-align: center;
    padding: var(--space-10) var(--space-6);
}

.empty-state__icon {
    display: block;
    font-size: 3rem;
    margin-bottom: var(--space-4);
}

.empty-state p {
    color: var(--color-text-muted);
    font-size: var(--text-sm);
    margin-bottom: var(--space-2);
}

.empty-state__hint {
    color: var(--color-text-light) !important;
    font-size: var(--text-xs) !important;
}

/* ─── 11. DASHBOARD WELCOME (Bénévoles) ───────────────────────── */
.dashboard-welcome {
    display: flex;
    justify-content: center;
    padding-top: var(--space-10);
}

.dashboard-welcome__card {
    background: var(--color-bg-card);
    border-radius: var(--radius-xl);
    border: 1px solid var(--color-border);
    padding: var(--space-12);
    text-align: center;
    box-shadow: var(--shadow-md);
    max-width: 400px;
    width: 100%;
}

.dashboard-welcome__avatar {
    width: 80px;
    height: 80px;
    border-radius: var(--radius-full);
    background: var(--color-primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
    font-size: var(--text-2xl);
    font-weight: var(--fw-bold);
    margin: 0 auto var(--space-6);
}

.dashboard-welcome__name {
    font-family: var(--font-display);
    font-size: var(--text-xl);
    font-weight: var(--fw-bold);
    margin-bottom: var(--space-2);
}

.dashboard-welcome__country { color: var(--color-text-muted); font-size: var(--text-sm); margin-bottom: var(--space-2); }
.dashboard-welcome__role    { color: var(--color-primary); font-size: var(--text-sm); font-weight: var(--fw-semibold); }

/* ─── 12. ALERTS / FLASH MESSAGES ────────────────────────────── */
.alert {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius);
    margin-bottom: var(--space-4);
    font-size: var(--text-sm);
    border: 1px solid transparent;
    animation: slideDown .2s ease;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
}

.alert--success { background: var(--color-success-bg); color: var(--color-success); border-color: #bbf7d0; }
.alert--danger  { background: var(--color-danger-bg);  color: var(--color-danger);  border-color: #fecaca; }
.alert--warning { background: var(--color-warning-bg); color: var(--color-warning); border-color: #fde68a; }
.alert--info    { background: var(--color-info-bg);    color: var(--color-info);    border-color: #bae6fd; }

.alert__icon { font-weight: var(--fw-bold); flex-shrink: 0; }
.alert__msg  { flex: 1; }
.alert__close {
    background: none; border: none; cursor: pointer;
    opacity: .6; font-size: 1.2rem; padding: 0 4px;
    transition: var(--transition-fast);
}
.alert__close:hover { opacity: 1; }

/* ─── 12.5. SLIDE-OVER (Carte Interactive) ────────────────────── */
.slide-over {
    position: absolute;
    top: 0;
    right: 0;
    width: 320px;
    height: 100%;
    background: var(--color-bg-card);
    box-shadow: -4px 0 15px rgba(0,0,0,0.05);
    border-left: 1px solid var(--color-border);
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 10;
    display: flex;
    flex-direction: column;
}

.slide-over--open {
    transform: translateX(0);
}

.slide-over__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-5) var(--space-6);
    border-bottom: 1px solid var(--color-border);
}

.slide-over__title {
    margin: 0;
    font-size: var(--text-lg);
    font-weight: var(--fw-bold);
    color: var(--color-text);
}

.slide-over__close {
    background: none;
    border: none;
    font-size: 1.25rem;
    color: var(--color-text-light);
    cursor: pointer;
    transition: color 0.2s;
}

.slide-over__close:hover { color: var(--color-danger); }

.slide-over__content {
    padding: var(--space-6);
    flex: 1;
    overflow-y: auto;
}

.slide-over__content .info-group {
    margin-bottom: var(--space-4);
}

.slide-over__content .info-group label {
    display: block;
    font-size: var(--text-xs);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-text-light);
    margin-bottom: var(--space-1);
}

.slide-over__content .info-group p {
    margin: 0;
    font-weight: var(--fw-medium);
    color: var(--color-text);
}

/* ─── 13. FORMULAIRES ─────────────────────────────────────────── */
.form-group {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    margin-bottom: var(--space-5);
}

.form-label {
    font-size: var(--text-sm);
    font-weight: var(--fw-medium);
    color: var(--color-text);
}

.form-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.form-input-icon {
    position: absolute;
    left: 14px;
    color: var(--color-text-light);
    display: flex;
    align-items: center;
    pointer-events: none;
}

.form-input {
    width: 100%;
    height: 48px;
    padding: 0 var(--space-4) 0 44px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    font-size: var(--text-sm);
    color: var(--color-text);
    background: var(--color-bg-card);
    transition: var(--transition-fast);
    outline: none;
}

.form-input:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-primary) 15%, transparent);
}

.form-input::placeholder { color: var(--color-text-light); }

.form-input--with-action { padding-right: 48px; }

.form-input-action {
    position: absolute;
    right: 14px;
    color: var(--color-text-light);
    display: flex;
    align-items: center;
    padding: 4px;
    border-radius: var(--radius-sm);
    transition: var(--transition-fast);
}

.form-input-action:hover { color: var(--color-text); background: var(--color-bg); }

.form-check {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    cursor: pointer;
}

.form-check__input {
    width: 16px;
    height: 16px;
    border-radius: 4px;
    accent-color: var(--color-primary);
    cursor: pointer;
}

.form-check__label { font-size: var(--text-sm); color: var(--color-text-muted); cursor: pointer; }

/* ─── 14. BOUTONS ─────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: 0 var(--space-5);
    height: 40px;
    border-radius: var(--radius);
    font-size: var(--text-sm);
    font-weight: var(--fw-semibold);
    font-family: inherit;
    cursor: pointer;
    transition: var(--transition-fast);
    border: none;
    text-decoration: none;
    white-space: nowrap;
}

.btn--primary {
    background: var(--color-primary);
    color: #fff;
    box-shadow: 0 4px 12px color-mix(in srgb, var(--color-primary) 40%, transparent);
}

.btn--primary:hover {
    background: var(--color-primary-dark);
    box-shadow: 0 6px 16px color-mix(in srgb, var(--color-primary) 50%, transparent);
    transform: translateY(-1px);
}

.btn--primary:active { transform: translateY(0); }

.btn--full { width: 100%; }

.btn--lg { height: 52px; font-size: var(--text-base); border-radius: var(--radius-lg); }

/* ─── 15. PAGE D'AUTHENTIFICATION ─────────────────────────────── */
.auth-page { min-height: 100vh; }

.auth-screen {
    display: grid;
    grid-template-columns: 1fr 1fr;
    min-height: 100vh;
}

@media (max-width: 900px) {
    .auth-screen { grid-template-columns: 1fr; }
    .auth-brand  { display: none; }
}

/* Panneau gauche — branding */
.auth-brand {
    background: var(--color-bg-sidebar);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: var(--space-10);
    position: relative;
    overflow: hidden;
}

.auth-brand__content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    gap: var(--space-6);
    text-align: center;
    z-index: 1;
}

.auth-brand__logo-placeholder {
    width: 80px;
    height: 80px;
    border-radius: var(--radius-xl);
    background: var(--color-primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
    font-size: var(--text-4xl);
    font-weight: var(--fw-extrabold);
    box-shadow: 0 20px 40px color-mix(in srgb, var(--color-primary) 40%, transparent);
}

.auth-brand__ong-name {
    font-family: var(--font-display);
    font-size: var(--text-3xl);
    font-weight: var(--fw-extrabold);
    color: #fff;
    letter-spacing: -0.5px;
}

.auth-brand__tagline {
    font-size: var(--text-base);
    color: rgba(255,255,255,.5);
}

/* Décorations géométriques */
.auth-brand__decor {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.auth-brand__decor-circle {
    position: absolute;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,.06);
}

.auth-brand__decor-circle--1 {
    width: 400px; height: 400px;
    bottom: -100px; right: -100px;
    background: radial-gradient(circle, color-mix(in srgb, var(--color-primary) 15%, transparent) 0%, transparent 70%);
}

.auth-brand__decor-circle--2 {
    width: 250px; height: 250px;
    top: -50px; left: -50px;
    border: 1px solid rgba(255,255,255,.04);
}

.auth-brand__decor-circle--3 {
    width: 150px; height: 150px;
    top: 40%; right: 10%;
    border: 1px solid rgba(255,255,255,.04);
}

.auth-brand__footer {
    font-size: var(--text-xs);
    color: rgba(255,255,255,.25);
    text-align: center;
    z-index: 1;
}

/* Panneau droit — formulaire */
.auth-form-panel {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-10);
    background: var(--color-bg);
}

.auth-form-wrap {
    width: 100%;
    max-width: 400px;
}

.auth-form__header {
    margin-bottom: var(--space-8);
}

.auth-form__title {
    font-family: var(--font-display);
    font-size: var(--text-2xl);
    font-weight: var(--fw-extrabold);
    color: var(--color-text);
    margin-bottom: var(--space-2);
}

.auth-form__subtitle {
    font-size: var(--text-sm);
    color: var(--color-text-muted);
}

.auth-form__options {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-6);
}

.auth-form__forgot {
    font-size: var(--text-sm);
    color: var(--color-primary);
    font-weight: var(--fw-medium);
    transition: var(--transition-fast);
}

.auth-form__forgot:hover { opacity: .8; }

/* ─── 16. UTILITAIRES ─────────────────────────────────────────── */
.sr-only {
    position: absolute; width: 1px; height: 1px;
    padding: 0; margin: -1px; overflow: hidden;
    clip: rect(0,0,0,0); border: 0;
}

/* Scrollbar globale */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--color-border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--color-border-focus); }

/* Sélection */
::selection { background: color-mix(in srgb, var(--color-primary) 20%, transparent); }

/* ==========================================================================
   CSS Organigramme (.tree) — Arborescence Corporate
   ========================================================================== */
.tree {
    display: flex;
    justify-content: center;
    padding: 3rem 0;
    width: 100%;
}

.tree ul {
    padding-top: 20px;
    position: relative;
    transition: all 0.5s;
    display: flex;
    padding-left: 0;
    margin: 0;
    justify-content: center;
}

.tree li {
    float: left;
    text-align: center;
    list-style-type: none;
    position: relative;
    padding: 20px 5px 0 5px;
    transition: all 0.5s;
}

/* Lignes de connexion (Before/After) */
.tree li::before, .tree li::after {
    content: '';
    position: absolute;
    top: 0;
    right: 50%;
    border-top: 2px solid var(--color-border);
    width: 50%;
    height: 20px;
}

.tree li::after {
    right: auto;
    left: 50%;
    border-left: 2px solid var(--color-border);
}

.tree li:only-child::after, 
.tree li:only-child::before {
    display: none;
}

.tree li:only-child {
    padding-top: 0;
}

.tree li:first-child::before, 
.tree li:last-child::after {
    border: 0 none;
}

.tree li:last-child::before {
    border-right: 2px solid var(--color-border);
    border-radius: 0 5px 0 0;
}

.tree li:first-child::after {
    border-radius: 5px 0 0 0;
}

.tree ul ul::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    border-left: 2px solid var(--color-border);
    width: 0;
    height: 12px;
}

/* Cartes (Nœuds) de l'organigramme */
.org-node-container {
    position: relative;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
}

.org-node {
    border: 1px solid var(--color-border);
    padding: 0.5rem 0.75rem;
    display: inline-block;
    border-radius: 14px;
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 4px 12px rgba(0,0,0,0.03), 0 1px 2px rgba(0,0,0,0.02);
    min-width: 135px;
    position: relative;
    z-index: 10;
    text-decoration: none !important;
    color: inherit !important;
    display: block;
    text-align: center;
    overflow: hidden;
}

.org-node::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: var(--color-primary);
    opacity: 0.6;
}

.org-node:hover {
    box-shadow: 0 12px 28px -8px rgba(0,0,0,0.12);
    transform: translateY(-4px) scale(1.02);
    border-color: var(--color-primary);
}

.tree__toggle {
    width: 32px;
    height: 32px;
    background: var(--color-surface);
    border: 3px solid var(--color-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 18px;
    font-weight: 800;
    color: var(--color-primary);
    position: absolute;
    bottom: -16px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 20;
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    padding: 0;
}

.tree__toggle:hover {
    transform: translateX(-50%) scale(1.15);
    background: var(--color-primary);
    color: white;
}

.tree__toggle--expanded {
    background: var(--color-primary);
    color: white;
}

/* Pulsation sur les boutons fermés pour attirer l'attention */
.tree__toggle:not(.tree__toggle--expanded) {
    animation: tree-pulse 2s infinite;
}

@keyframes tree-pulse {
    0% { box-shadow: 0 0 0 0 rgba(26, 58, 107, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(26, 58, 107, 0); }
    100% { box-shadow: 0 0 0 0 rgba(26, 58, 107, 0); }
}

/* ==========================================================================
   Mode "Assistant" (Balanced Vertical Stack)
   ========================================================================== */
.tree ul.tree__list--vertical {
    flex-direction: column;
    align-items: center; /* Centré par rapport au tronc */
    padding-top: 0;
    margin-top: 20px;
    position: relative;
    padding-left: 0;
}

/* Le tronc central */
.tree__list--vertical::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    border-left: 2px solid var(--color-border);
    height: calc(100% - 30px); /* S'arrête avant la fin du dernier noeud */
    width: 0;
}

.tree__list--vertical li {
    padding: 15px 0;
    width: 100%;
    display: flex;
    justify-content: center;
    position: relative;
    min-height: 100px;
}

.tree__list--vertical li::before,
.tree__list--vertical li::after {
    display: none !important; /* On annule les lignes standards */
}

/* On décale alternativement à gauche et à droite */
.tree__list--vertical li:nth-child(odd) {
    justify-content: flex-end;
    padding-right: calc(50% + 20px);
}

.tree__list--vertical li:nth-child(even) {
    justify-content: flex-start;
    padding-left: calc(50% + 20px);
}

/* Connecteurs horizontaux vers le tronc */
.tree__list--vertical li::after {
    content: '';
    display: block !important;
    position: absolute;
    top: 50%;
    width: 20px;
    height: 0;
    border-top: 2px solid var(--color-border);
}

.tree__list--vertical li:nth-child(odd)::after {
    right: 50%;
}

.tree__list--vertical li:nth-child(even)::after {
    left: 50%;
}

.tree__list--vertical .org-node {
    min-width: 200px;
}

.tree__list--vertical [x-collapse] {
     width: 100%;
}

.org-node__title {
    margin: 0 0 4px 0;
    font-size: 0.78rem;
    font-weight: 800;
    color: var(--color-primary-dark);
    line-height: 1.2;
    letter-spacing: -0.01em;
}

.org-node__type {
    display: inline-block;
    font-size: 0.52rem;
    text-transform: uppercase;
    font-weight: 800;
    color: var(--color-primary);
    background: rgba(var(--color-primary-rgb), 0.08);
    padding: 2px 8px;
    border-radius: 20px;
    margin-bottom: 4px;
    letter-spacing: 0.05em;
    border: 1px solid rgba(var(--color-primary-rgb), 0.1);
}

.org-node__manager, 
.org-node__country {
    margin: 0;
    font-size: 0.65rem;
    color: var(--color-text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.2rem;
    margin-top: 0.1rem;
}

.org-node__manager svg, 
.org-node__country svg {
    display: none;
}

/* ==========================================================================
   Design Symétrique (Paired Table Layout) - Stable
   ========================================================================== */
.tree__paired-table {
    position: relative;
    border-collapse: separate;
    border-spacing: 0 8px;
    margin: 20px auto 0 auto;
    z-index: 5;
}

.tree__paired-table::before {
    content: '';
    position: absolute;
    top: -30px;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    border-left: 2px solid var(--color-border);
    width: 0;
    z-index: 1;
}

.tree__paired-tr {
    vertical-align: middle;
}

.tree__paired-td {
    padding: 8px 0;
    vertical-align: middle;
    position: relative;
    white-space: nowrap;
}

.tree__paired-td--spacer {
    width: 30px;
    background: transparent;
}

.tree__paired-td--left {
    text-align: right;
    padding-right: 15px;
}

.tree__paired-td--right {
    text-align: left;
    padding-left: 15px;
}

/* Connecteurs horizontaux */
.tree__paired-td--left::after {
    content: '';
    position: absolute;
    right: 0;
    top: 50%;
    width: 15px;
    height: 0;
    border-top: 2px solid var(--color-border);
    z-index: 1;
}

.tree__paired-td--right::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    width: 15px;
    height: 0;
    border-top: 2px solid var(--color-border);
    z-index: 1;
}

/* Noeud Staff plus compact */
.org-node--staff {
    min-width: 120px !important;
    padding: 0.4rem 0.8rem !important;
    background-color: var(--color-surface) !important;
    border: 1px dashed var(--color-primary) !important;
    transform: none !important;
    box-shadow: var(--shadow-sm) !important;
    z-index: 20;
    transition: all 0.2s ease;
}

.org-node--staff:hover {
    border-style: solid !important;
    box-shadow: var(--shadow-md) !important;
    background-color: var(--color-bg) !important;
}

.org-node--staff .org-node__title {
    font-size: 0.85rem;
    margin: 0;
    color: var(--color-primary);
}

.org-node--staff .org-node__type {
    display: block;
    font-size: 0.65rem;
    opacity: 0.7;
    margin-top: 2px;
}

/* Animations de transition pour l'arbre */
[x-cloak] { display: none !important; }
.tree ul {
    transition: all 0.3s ease-in-out;
}
