/* ==========================================================================
   Jalon — Feuille de style
   Design system repris de ITnoteAI + composants de gestion de projet
   ========================================================================== */

/* --------------------------------------------------------------------------
   Variables — thème sombre (par défaut)
   -------------------------------------------------------------------------- */
:root, [data-theme="dark"] {
    --primary-color: #2563eb;
    --primary-light: #3b82f6;
    --primary-dark:  #1d4ed8;
    --primary:       #2563eb;
    --accent-color:  #8b5cf6;
    --accent-light:  #a78bfa;

    --secondary-color: #10b981;
    --danger-color:    #ef4444;
    --warning-color:   #f59e0b;
    --orange-color:    #f97316;
    --info-color:      #06b6d4;

    --bg-dark:   #0f172a;
    --bg-medium: #1e293b;
    --bg-light:  #334155;
    --bg-card:   #1e293b;

    --text-light: #f1f5f9;
    --text:       #f1f5f9;
    --text-muted: #94a3b8;

    --border-color: rgba(148, 163, 184, 0.2);
    --shadow:       0 10px 40px rgba(0, 0, 0, 0.4);
    --shadow-light: 0 4px 20px rgba(0, 0, 0, 0.25);
    --shadow-glow:  0 0 30px rgba(37, 99, 235, 0.3);

    --radius:    16px;
    --radius-sm: 10px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);

    --gradient-primary: linear-gradient(135deg, var(--primary-color) 0%, var(--accent-color) 100%);
}

/* --------------------------------------------------------------------------
   Variables — thème clair
   -------------------------------------------------------------------------- */
[data-theme="light"] {
    --bg-dark:   #f1f5f9;
    --bg-medium: #ffffff;
    --bg-light:  #e2e8f0;
    --bg-card:   #ffffff;

    --text-light: #1e293b;
    --text:       #1e293b;
    --text-muted: #64748b;

    --border-color: rgba(15, 23, 42, 0.1);
    --shadow:       0 10px 40px rgba(0, 0, 0, 0.1);
    --shadow-light: 0 4px 20px rgba(0, 0, 0, 0.08);
    --shadow-glow:  0 0 30px rgba(37, 99, 235, 0.15);
}

/* --------------------------------------------------------------------------
   Reset & base
   -------------------------------------------------------------------------- */
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Poppins', sans-serif;
    background: linear-gradient(180deg, var(--bg-medium) 0%, var(--bg-dark) 100%);
    color: var(--text-light);
    min-height: 100vh;
    transition: background 0.4s ease, color 0.4s ease;
}

h1, h2, h3, h4 { font-family: 'Montserrat', sans-serif; font-weight: 600; }

a { color: var(--primary-light); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--accent-light); }

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

.sidebar {
    width: 280px;
    background: var(--bg-medium);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    padding: 20px;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}

.sidebar-header {
    text-align: center;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 20px;
}

.sidebar-logo {
    width: 132px; height: 132px;
    margin: 0 auto 12px;
    border-radius: 26px;
    display: flex; align-items: center; justify-content: center;
    overflow: hidden;
    box-shadow: var(--shadow-glow);
    animation: glow 3s ease-in-out infinite;
    transition: var(--transition);
}
.sidebar-logo:hover { transform: scale(1.04); }
.sidebar-logo-img { width: 100%; height: 100%; object-fit: contain; display: block; }

@keyframes glow {
    0%, 100% { box-shadow: 0 0 20px rgba(37, 99, 235, 0.4); }
    50%      { box-shadow: 0 0 40px rgba(139, 92, 246, 0.6); }
}

.sidebar-header h1 {
    font-size: 1.4rem;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.sidebar-header .app-subtitle {
    font-size: 0.7rem; color: var(--text-muted);
    text-transform: uppercase; letter-spacing: 1.5px; margin-top: 5px;
}

/* User card */
.user-card {
    padding: 15px; background: var(--bg-light);
    border-radius: var(--radius); border: 1px solid var(--border-color);
    display: flex; align-items: center; gap: 12px;
    margin-bottom: 20px; transition: var(--transition);
}
.user-card:hover { border-color: var(--primary-color); box-shadow: var(--shadow-light); }

.user-avatar {
    width: 42px; height: 42px; border-radius: 50%;
    background: var(--gradient-primary);
    display: flex; align-items: center; justify-content: center;
    font-size: 0.95rem; color: #fff; font-weight: 600; text-transform: uppercase;
    box-shadow: 0 4px 15px rgba(37, 99, 235, 0.4); flex-shrink: 0;
}

.user-details { flex: 1; min-width: 0; }
.user-name { font-weight: 600; font-size: 0.88rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role { font-size: 0.7rem; color: var(--text-muted); display: flex; align-items: center; gap: 5px; }
.user-role i { color: var(--secondary-color); font-size: 0.5rem; }

/* Theme toggle */
.theme-toggle-container {
    padding: 12px; background: var(--bg-light);
    border-radius: var(--radius-sm); border: 1px solid var(--border-color); margin-bottom: 20px;
}
.theme-toggle { display: flex; align-items: center; justify-content: space-between; cursor: pointer; }
.theme-toggle-label { display: flex; align-items: center; gap: 10px; font-size: 0.85rem; color: var(--text-muted); }
.theme-toggle-label i { font-size: 1rem; color: var(--warning-color); }
[data-theme="dark"] .theme-toggle-label i { color: var(--accent-light); }

.theme-switch {
    position: relative; width: 50px; height: 26px;
    background: var(--bg-dark); border-radius: 13px;
    transition: var(--transition); border: 2px solid var(--border-color);
}
.theme-switch::before {
    content: ''; position: absolute; top: 2px; left: 2px;
    width: 18px; height: 18px; background: var(--warning-color);
    border-radius: 50%; transition: var(--transition);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}
[data-theme="dark"] .theme-switch::before { transform: translateX(24px); background: var(--accent-light); }
.theme-switch:hover { border-color: var(--primary-color); }

/* Navigation */
.sidebar-nav { display: flex; flex-direction: column; gap: 8px; }

.nav-link {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 16px; border-radius: var(--radius-sm);
    color: var(--text-muted); transition: var(--transition);
    font-weight: 500; border: 1px solid transparent;
}
.nav-link:hover { background: var(--bg-light); color: var(--text-light); border-color: var(--border-color); }
.nav-link.active { background: var(--gradient-primary); color: #fff; box-shadow: var(--shadow-light), var(--shadow-glow); }
.nav-link i { width: 20px; text-align: center; }

.nav-badge {
    margin-left: auto; background: var(--danger-color); color: #fff;
    font-size: 0.68rem; font-weight: 700; padding: 2px 8px; border-radius: 20px; min-width: 22px; text-align: center;
}
.nav-link.active .nav-badge { background: rgba(255,255,255,0.25); }

.sidebar-section-title {
    font-size: 0.68rem; text-transform: uppercase; letter-spacing: 1.2px;
    color: var(--text-muted); margin: 22px 0 10px 6px; font-weight: 600;
}

/* Liste projets latérale */
.sidebar-projects { display: flex; flex-direction: column; gap: 4px; }
.sidebar-project {
    display: flex; align-items: center; gap: 10px;
    padding: 9px 12px; border-radius: var(--radius-sm);
    color: var(--text-muted); font-size: 0.85rem; transition: var(--transition);
}
.sidebar-project:hover { background: var(--bg-light); color: var(--text-light); }
.sidebar-project.active { background: var(--bg-light); color: var(--text-light); font-weight: 500; }
.sidebar-project .dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.sidebar-project span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.sidebar-stats {
    margin-top: auto; padding: 15px; background: var(--bg-light);
    border-radius: var(--radius-sm); border: 1px solid var(--border-color);
}
.stat-row {
    display: flex; justify-content: space-between; padding: 8px 0;
    font-size: 0.85rem; border-bottom: 1px solid var(--border-color);
}
.stat-row:last-child { border-bottom: none; }
.stat-label { color: var(--text-muted); }
.stat-value { font-weight: 600; color: var(--primary-light); }
.stat-value.danger { color: var(--danger-color); }
.stat-value.warning { color: var(--warning-color); }
.stat-value.success { color: var(--secondary-color); }

/* Lien discret vers la notice, tout en bas de la barre latérale */
.lien-guide {
    display: flex; align-items: center; justify-content: center; gap: 8px;
    margin-top: 8px; padding: 9px 12px;
    font-size: 0.78rem; color: var(--text-muted);
    border: 1px solid transparent; border-radius: var(--radius-sm);
    transition: var(--transition);
}
.lien-guide:hover, .lien-guide.actif {
    color: var(--primary-light);
    background: var(--bg-light);
    border-color: var(--border-color);
}
.lien-guide i { font-size: 0.9rem; }

/* --------------------------------------------------------------------------
   Page « L'équipe derrière Jalon »
   -------------------------------------------------------------------------- */
.apropos { max-width: 980px; margin: 0 auto; }

.apropos-hero {
    text-align: center; padding: 48px 24px 44px; margin-bottom: 34px;
    border-radius: var(--radius); position: relative; overflow: hidden;
    background:
        radial-gradient(circle at 22% 18%, rgba(37, 99, 235, .28) 0%, transparent 55%),
        radial-gradient(circle at 80% 78%, rgba(139, 92, 246, .28) 0%, transparent 55%),
        linear-gradient(160deg, #0b1220 0%, #16233b 100%);
    border: 1px solid var(--border-color);
}
/* L'illustration est le cœur de cette page : on lui donne de la place */
.apropos-cadre {
    width: 300px; max-width: 78vw; margin: 0 auto 14px;
    position: relative; animation: apparition .8s ease backwards;
}
.apropos-cadre::after {
    content: ''; position: absolute; inset: -14%;
    background: radial-gradient(circle, rgba(37, 99, 235, .35) 0%, transparent 68%);
    z-index: 0; pointer-events: none; animation: halo 5s ease-in-out infinite;
}
.apropos-logo {
    position: relative; z-index: 1;
    width: 100%; height: auto; display: block;
    filter: drop-shadow(0 18px 44px rgba(15, 23, 42, .55));
    transition: transform .5s cubic-bezier(.2, .8, .2, 1);
}
.apropos-logo:hover { transform: translateY(-6px) scale(1.02); }

@keyframes apparition { from { opacity: 0; transform: translateY(20px) scale(.94); } }
@keyframes halo { 0%, 100% { opacity: .55; } 50% { opacity: 1; } }

.apropos-legende {
    font-size: .82rem; color: var(--text-muted); font-style: italic;
    margin-bottom: 26px !important;
}
.apropos-legende i { margin-right: 6px; opacity: .7; }

.apropos-hero h1 {
    font-size: 2.7rem; letter-spacing: -1px; margin-bottom: 6px; color: #fff;
    background: linear-gradient(120deg, #ffffff 0%, #93c5fd 55%, #c4b5fd 100%);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.apropos-baseline {
    font-size: .78rem; letter-spacing: 4px; text-transform: uppercase;
    color: #93c5fd; margin-bottom: 24px;
}
.apropos-signature { font-size: .93rem; line-height: 1.7; color: #cbd5e1; }
.apropos-signature strong { color: #fff; }

.apropos-section { margin-bottom: 26px; }
.apropos-section h2, .apropos-titre-libre {
    font-size: 1.3rem; margin: 0 0 20px;
    display: flex; align-items: center; gap: 12px;
}
.apropos-section h2 i, .apropos-titre-libre i { color: var(--primary-color); }
.apropos-titre-libre { padding: 0 4px; }
.apropos-section p { line-height: 1.8; margin-bottom: 15px; font-size: .95rem; }
.apropos-section h3 { font-size: 1.02rem; margin: 26px 0 10px; color: var(--accent-light); }

.apropos-chapeau {
    font-size: 1.06rem !important; font-weight: 500; color: var(--text-light);
    border-left: 3px solid var(--primary-color); padding-left: 18px; margin-bottom: 22px !important;
}
.apropos-accent {
    font-size: 1.08rem !important; font-weight: 600; text-align: center;
    margin: 22px 0 4px !important; padding: 18px;
    background: var(--gradient-primary); -webkit-background-clip: text;
    -webkit-text-fill-color: transparent; background-clip: text;
}

/* Les trois membres */
.apropos-equipe {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 18px;
}
.apropos-membre {
    background: var(--bg-card); border: 1px solid var(--border-color);
    border-radius: var(--radius); padding: 28px 18px; text-align: center;
    transition: var(--transition); position: relative; overflow: hidden;
}
.apropos-membre::before {
    content: ''; position: absolute; inset: 0 0 auto 0; height: 3px;
    background: var(--gradient-primary); opacity: 0; transition: var(--transition);
}
.apropos-membre:hover { transform: translateY(-6px); box-shadow: var(--shadow); border-color: var(--primary-color); }
.apropos-membre:hover::before { opacity: 1; }
.apropos-avatar {
    width: 74px; height: 74px; border-radius: 50%; margin: 0 auto 15px;
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-size: 1.5rem; font-weight: 700;
    box-shadow: 0 8px 22px rgba(0, 0, 0, .3);
}
.apropos-nom { font-size: 1.03rem; font-weight: 600; margin-bottom: 5px; }
.apropos-role { font-size: .8rem; color: var(--text-muted); }

/* Ce que ça change */
.apropos-grille {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 20px;
}
.apropos-item {
    background: var(--bg-light); border-radius: var(--radius-sm);
    padding: 20px; transition: var(--transition); border: 1px solid transparent;
}
.apropos-item:hover { border-color: var(--primary-color); transform: translateY(-3px); }
.apropos-item > i {
    font-size: 1.35rem; color: var(--primary-light); margin-bottom: 12px; display: block;
}
.apropos-item h3 { font-size: .95rem; margin: 0 0 8px; color: var(--text-light); }
.apropos-item p { font-size: .87rem !important; line-height: 1.65; margin: 0 !important; color: var(--text-muted); }

/* Chiffres */
.apropos-chiffres {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 16px; margin: 24px 0 30px;
}
.apropos-chiffre {
    text-align: center; padding: 22px 12px;
    background: color-mix(in srgb, var(--c) 10%, transparent);
    border: 1px solid color-mix(in srgb, var(--c) 32%, transparent);
    border-radius: var(--radius); transition: var(--transition);
}
.apropos-chiffre:hover { transform: translateY(-4px); background: color-mix(in srgb, var(--c) 16%, transparent); }
.apropos-chiffre i { font-size: 1.15rem; color: var(--c); margin-bottom: 10px; display: block; }
.apropos-chiffre-valeur {
    font-family: 'Montserrat', sans-serif; font-size: 1.75rem; font-weight: 700;
    color: var(--c); line-height: 1;
}
.apropos-chiffre-libelle { font-size: .76rem; color: var(--text-muted); margin-top: 7px; line-height: 1.4; }

.apropos-liste { margin: 0 0 18px; padding-left: 0; list-style: none; }
.apropos-liste li {
    position: relative; padding: 0 0 16px 30px; line-height: 1.75; font-size: .93rem;
}
.apropos-liste li::before {
    content: '\f00c'; font-family: 'Font Awesome 6 Free'; font-weight: 900;
    position: absolute; left: 0; top: 2px; color: var(--secondary-color); font-size: .82rem;
}
.apropos-liste strong { color: var(--text-light); }

.apropos-note {
    background: rgba(37, 99, 235, .09); border-left: 3px solid var(--primary-color);
    padding: 14px 18px; border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    font-size: .89rem !important; margin: 4px 0 0 !important; color: var(--text-muted);
}

/* Convictions */
.apropos-conviction {
    padding: 18px 0; border-bottom: 1px solid var(--border-color);
}
.apropos-conviction:last-child { border-bottom: none; padding-bottom: 0; }
.apropos-conviction h3 { margin-top: 0; display: flex; align-items: center; gap: 10px; }
.apropos-conviction h3 i { color: var(--accent-color); font-size: .95rem; }
.apropos-conviction p { margin-bottom: 0 !important; }

/* Final */
.apropos-final {
    text-align: center; padding: 46px 30px;
    background:
        radial-gradient(circle at 50% 0%, rgba(37, 99, 235, .16) 0%, transparent 62%),
        var(--bg-card);
}
.apropos-final > i {
    font-size: 1.7rem; color: var(--primary-color); opacity: .35; margin-bottom: 18px; display: block;
}
.apropos-citation {
    font-size: 1.22rem !important; line-height: 1.8 !important; font-weight: 500;
    font-family: 'Montserrat', sans-serif; color: var(--text-light); margin-bottom: 26px !important;
}
.apropos-noms { font-size: 1rem; margin-bottom: 7px; }
.apropos-lieu { font-size: .83rem; color: var(--text-muted); }

[data-theme="light"] .apropos-hero {
    background:
        radial-gradient(circle at 22% 18%, rgba(37, 99, 235, .16) 0%, transparent 55%),
        radial-gradient(circle at 80% 78%, rgba(139, 92, 246, .16) 0%, transparent 55%),
        linear-gradient(160deg, #f8fafc 0%, #e2e8f0 100%);
}
[data-theme="light"] .apropos-hero h1 {
    background: linear-gradient(120deg, #1e293b 0%, #2563eb 55%, #7c3aed 100%);
    -webkit-background-clip: text; background-clip: text;
}
[data-theme="light"] .apropos-baseline { color: #2563eb; }
[data-theme="light"] .apropos-signature { color: #475569; }
[data-theme="light"] .apropos-signature strong { color: #0f172a; }

@media (max-width: 700px) {
    .apropos-hero { padding: 34px 18px; }
    .apropos-cadre { width: 210px; }
    .apropos-hero h1 { font-size: 2rem; }
    .apropos-citation { font-size: 1.05rem !important; }
    .apropos-chiffres { grid-template-columns: repeat(2, 1fr); }
}

@media print {
    .apropos-hero { background: none; border: none; }
    .apropos-section, .apropos-final { break-inside: avoid; }
}

/* --------------------------------------------------------------------------
   Guide d'utilisation
   -------------------------------------------------------------------------- */
.guide-layout {
    display: grid; grid-template-columns: 250px minmax(0, 1fr);
    gap: 28px; align-items: start;
}

.guide-sommaire {
    position: sticky; top: 24px;
    background: var(--bg-card); border: 1px solid var(--border-color);
    border-radius: var(--radius); padding: 18px 14px;
    display: flex; flex-direction: column; gap: 2px;
    max-height: calc(100vh - 48px); overflow-y: auto;
}
.guide-sommaire-titre {
    font-size: 0.68rem; text-transform: uppercase; letter-spacing: 1.2px;
    color: var(--text-muted); font-weight: 600; margin: 0 0 10px 8px;
}
.guide-lien {
    display: flex; align-items: center; gap: 9px;
    padding: 8px 10px; border-radius: var(--radius-sm);
    font-size: 0.82rem; color: var(--text-muted);
    border-left: 2px solid transparent; transition: var(--transition);
}
.guide-lien i { width: 16px; text-align: center; font-size: 0.8rem; opacity: .8; }
.guide-lien:hover { background: var(--bg-light); color: var(--text-light); }
.guide-lien.actif {
    color: var(--primary-light); background: var(--bg-light);
    border-left-color: var(--primary-color); font-weight: 500;
}

.guide-contenu section { scroll-margin-top: 20px; }
.guide-contenu h2 {
    font-size: 1.18rem; margin: 0 0 18px;
    padding-bottom: 12px; border-bottom: 2px solid var(--primary-color);
    display: flex; align-items: center; gap: 11px;
}
.guide-contenu h2 i { color: var(--primary-color); }
.guide-contenu h3 {
    font-size: 0.98rem; margin: 24px 0 9px; color: var(--accent-light);
}
.guide-contenu h3:first-of-type { margin-top: 0; }
.guide-contenu p { line-height: 1.75; margin-bottom: 13px; font-size: 0.93rem; }
.guide-contenu ul, .guide-contenu ol { margin: 0 0 15px 22px; line-height: 1.75; font-size: 0.93rem; }
.guide-contenu li { margin-bottom: 8px; }
.guide-contenu table {
    width: 100%; border-collapse: collapse; margin: 14px 0 18px;
    font-size: 0.88rem; display: block; overflow-x: auto;
}
.guide-contenu th, .guide-contenu td {
    border: 1px solid var(--border-color); padding: 10px 13px;
    text-align: left; vertical-align: top;
}
.guide-contenu th { background: var(--bg-light); font-weight: 600; }
.guide-contenu td:first-child { white-space: nowrap; }

.guide-note {
    background: rgba(37, 99, 235, .08);
    border-left: 3px solid var(--primary-color);
    padding: 12px 16px; border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    font-size: 0.89rem !important; margin: 14px 0 !important;
}
.guide-intro p:last-child { margin-bottom: 0; }
.guide-fin { text-align: center; }
.guide-fin p { margin: 0; }

@media (max-width: 992px) {
    .guide-layout { grid-template-columns: 1fr; }
    .guide-sommaire { position: relative; top: 0; max-height: none; }
}

@media print {
    .guide-sommaire { display: none; }
    .guide-layout { display: block; }
    .guide-contenu section { break-inside: avoid; }
}

/* --------------------------------------------------------------------------
   Contenu principal
   -------------------------------------------------------------------------- */
.main-content {
    flex: 1; padding: 30px; overflow-x: hidden;
    background:
        radial-gradient(circle at 20% 20%, rgba(37, 99, 235, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(139, 92, 246, 0.08) 0%, transparent 50%),
        linear-gradient(180deg, var(--bg-medium) 0%, var(--bg-dark) 100%);
}

.main-header {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 30px; gap: 20px; flex-wrap: wrap;
}
.main-header h2 { font-size: 1.8rem; display: flex; align-items: center; gap: 12px; }
.main-header h2 i { color: var(--primary-color); }
.main-header .subtitle { font-size: 0.85rem; color: var(--text-muted); margin-top: 4px; font-weight: 400; font-family: 'Poppins', sans-serif; }
.header-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

.back-link {
    display: inline-flex; align-items: center; gap: 8px;
    color: var(--text-muted); font-size: 0.9rem; margin-bottom: 20px; padding: 8px 0;
    transition: var(--transition);
}
.back-link:hover { color: var(--primary-light); }
.back-link i { font-size: 0.8rem; }

/* --------------------------------------------------------------------------
   KPI
   -------------------------------------------------------------------------- */
.kpi-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px; margin-bottom: 28px;
}
.kpi-card {
    background: var(--bg-card); border: 1px solid var(--border-color);
    border-radius: var(--radius); padding: 18px 20px;
    display: flex; align-items: center; gap: 15px;
    transition: var(--transition); position: relative; overflow: hidden;
}
.kpi-card::before {
    content: ''; position: absolute; top: 0; left: 0; width: 4px; height: 100%;
    background: var(--kpi-color, var(--primary-color));
}
.kpi-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-light); border-color: var(--kpi-color, var(--primary-color)); }

.kpi-icon {
    width: 46px; height: 46px; border-radius: var(--radius-sm);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.15rem; color: #fff; flex-shrink: 0;
    background: var(--kpi-color, var(--primary-color));
    box-shadow: 0 4px 14px color-mix(in srgb, var(--kpi-color, #2563eb) 40%, transparent);
}
.kpi-body { min-width: 0; }
.kpi-value { font-size: 1.6rem; font-weight: 700; font-family: 'Montserrat', sans-serif; line-height: 1.1; }
.kpi-label { font-size: 0.78rem; color: var(--text-muted); margin-top: 2px; }

/* --------------------------------------------------------------------------
   Cartes projets
   -------------------------------------------------------------------------- */
.projects-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 20px; margin-bottom: 30px;
}

.project-card {
    background: var(--bg-card); border: 1px solid var(--border-color);
    border-radius: var(--radius); transition: var(--transition);
    position: relative; overflow: hidden;
    animation: fadeInUp 0.4s ease backwards;
    display: flex; flex-direction: column;
}
.project-card::before {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 4px;
    background: var(--card-color, var(--primary-color)); opacity: 0.85; transition: var(--transition);
}
.project-card:hover { transform: translateY(-8px); box-shadow: var(--shadow), 0 0 40px rgba(37, 99, 235, 0.15); border-color: var(--card-color, var(--primary-color)); }
.project-card:hover::before { opacity: 1; height: 5px; }

@keyframes fadeInUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
.project-card:nth-child(1){animation-delay:.05s}.project-card:nth-child(2){animation-delay:.1s}
.project-card:nth-child(3){animation-delay:.15s}.project-card:nth-child(4){animation-delay:.2s}
.project-card:nth-child(5){animation-delay:.25s}.project-card:nth-child(6){animation-delay:.3s}

.project-card-header { padding: 22px 20px 12px; display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }

.project-card-icon {
    width: 50px; height: 50px; border-radius: var(--radius-sm);
    background: var(--card-color, var(--primary-color));
    display: flex; align-items: center; justify-content: center;
    font-size: 1.3rem; color: #fff; flex-shrink: 0;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.25);
}

.project-card-body { padding: 0 20px 15px; cursor: pointer; flex: 1; }
.project-card-title { font-size: 1.15rem; font-weight: 600; margin-bottom: 6px; color: var(--text-light); }
.project-card-desc {
    font-size: 0.85rem; color: var(--text-muted); line-height: 1.5; margin-bottom: 14px;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.project-card-meta { display: flex; gap: 15px; flex-wrap: wrap; font-size: 0.78rem; color: var(--text-muted); margin-bottom: 14px; }
.project-card-meta span { display: flex; align-items: center; gap: 5px; }

.project-card-footer {
    padding: 14px 20px; background: rgba(0,0,0,0.12);
    border-top: 1px solid var(--border-color);
    display: flex; justify-content: space-between; align-items: center; gap: 10px;
}

.new-project-card {
    background: transparent; border: 2px dashed var(--border-color);
    border-radius: var(--radius); padding: 40px 20px;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 15px; cursor: pointer; transition: var(--transition); min-height: 260px;
}
.new-project-card:hover { border-color: var(--primary-color); background: rgba(37, 99, 235, 0.05); }
.new-project-card i { font-size: 2.5rem; color: var(--text-muted); transition: var(--transition); }
.new-project-card:hover i { color: var(--primary-color); }
.new-project-card span { font-size: 0.95rem; color: var(--text-muted); font-weight: 500; }

/* --------------------------------------------------------------------------
   Barre de progression
   -------------------------------------------------------------------------- */
.progress { height: 8px; background: var(--bg-dark); border-radius: 20px; overflow: hidden; position: relative; }
.progress.thin { height: 5px; }
.progress.thick { height: 12px; }
.progress-bar {
    height: 100%; border-radius: 20px; transition: width 0.5s ease;
    background: var(--gradient-primary);
    background-size: 200% 100%;
}
.progress-bar.ok      { background: linear-gradient(90deg, #10b981, #34d399); }
.progress-bar.warn    { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.progress-bar.danger  { background: linear-gradient(90deg, #ef4444, #f87171); }
.progress-bar.neutral { background: linear-gradient(90deg, #64748b, #94a3b8); }

.progress-line { display: flex; align-items: center; gap: 10px; }
.progress-line .progress { flex: 1; }
.progress-value { font-size: 0.78rem; font-weight: 600; color: var(--text-muted); min-width: 38px; text-align: right; }

/* --------------------------------------------------------------------------
   Badges & pastilles d'état
   -------------------------------------------------------------------------- */
.badge {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 4px 10px; border-radius: 20px;
    font-size: 0.7rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.3px;
    white-space: nowrap;
}
.badge i { font-size: 0.65rem; }
.badge.soft { background: color-mix(in srgb, var(--b-color, #2563eb) 15%, transparent); color: var(--b-color, #2563eb); border: 1px solid color-mix(in srgb, var(--b-color, #2563eb) 35%, transparent); }
.badge.solid { background: var(--b-color, #2563eb); color: #fff; }

/* Code couleur « dans les temps / en retard » */
.etat-pill {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 5px 12px; border-radius: 20px;
    font-size: 0.72rem; font-weight: 600; white-space: nowrap;
}
.et-dans-les-temps  { background: rgba(16,185,129,.15); color:#34d399; border:1px solid rgba(16,185,129,.35); }
.et-termine         { background: rgba(16,185,129,.15); color:#34d399; border:1px solid rgba(16,185,129,.35); }
.et-termine-retard  { background: rgba(20,184,166,.15); color:#2dd4bf; border:1px solid rgba(20,184,166,.35); }
.et-derive          { background: rgba(245,158,11,.15); color:#fbbf24; border:1px solid rgba(245,158,11,.35); }
.et-imminent        { background: rgba(245,158,11,.15); color:#fbbf24; border:1px solid rgba(245,158,11,.35); }
.et-aujourdhui      { background: rgba(249,115,22,.18); color:#fb923c; border:1px solid rgba(249,115,22,.4); }
.et-retard          { background: rgba(239,68,68,.18);  color:#f87171; border:1px solid rgba(239,68,68,.4); }
.et-bloque          { background: rgba(239,68,68,.18);  color:#f87171; border:1px solid rgba(239,68,68,.4); }
.et-sans-echeance   { background: rgba(148,163,184,.15); color:var(--text-muted); border:1px solid rgba(148,163,184,.3); }

/* Bandeau latéral coloré selon l'état */
.bord-etat { border-left: 4px solid var(--etat-color, #64748b); }

/* --------------------------------------------------------------------------
   Avatars
   -------------------------------------------------------------------------- */
.avatar {
    width: 32px; height: 32px; border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    color: #fff; font-weight: 600; font-size: 0.72rem; text-transform: uppercase;
    flex-shrink: 0; border: 2px solid var(--bg-card);
}
.avatar.sm { width: 26px; height: 26px; font-size: 0.62rem; }
.avatar.lg { width: 44px; height: 44px; font-size: 0.95rem; }

.avatar-stack { display: flex; }
.avatar-stack .avatar { margin-left: -9px; }
.avatar-stack .avatar:first-child { margin-left: 0; }
.avatar-more {
    background: var(--bg-light); color: var(--text-muted);
    font-size: 0.68rem; font-weight: 600;
}

/* --------------------------------------------------------------------------
   Cartes génériques
   -------------------------------------------------------------------------- */
.card {
    background: var(--bg-card); border: 1px solid var(--border-color);
    border-radius: var(--radius); padding: 25px; margin-bottom: 25px;
    transition: var(--transition); position: relative; overflow: hidden;
}
.card::before {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
    background: var(--gradient-primary); opacity: 0; transition: var(--transition);
}
.card:hover { box-shadow: var(--shadow), 0 0 30px rgba(37, 99, 235, 0.1); border-color: rgba(37, 99, 235, 0.3); }
.card:hover::before { opacity: 1; }
.card.flat:hover { box-shadow: none; border-color: var(--border-color); }
.card.flat::before { display: none; }

.card-header {
    display: flex; justify-content: space-between; align-items: center; gap: 12px;
    margin-bottom: 20px; padding-bottom: 15px; border-bottom: 1px solid var(--border-color);
    flex-wrap: wrap;
}
.card-header h3 { font-size: 1.1rem; display: flex; align-items: center; gap: 10px; margin: 0; }
.card-header h3 i { color: var(--primary-color); }

/* --------------------------------------------------------------------------
   Boutons
   -------------------------------------------------------------------------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 12px 24px; border: none; border-radius: var(--radius-sm);
    font-family: 'Poppins', sans-serif; font-size: 0.9rem; font-weight: 500;
    cursor: pointer; transition: var(--transition);
    background: var(--gradient-primary); color: #fff;
    box-shadow: var(--shadow-light); position: relative; overflow: hidden;
    text-decoration: none;
}
.btn::before {
    content: ''; position: absolute; top: 0; left: -100%; width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent); transition: 0.5s;
}
.btn:hover::before { left: 100%; }
.btn:hover:not(:disabled) { transform: translateY(-2px); box-shadow: var(--shadow), var(--shadow-glow); color: #fff; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn.secondary { background: transparent; border: 2px solid var(--border-color); color: var(--text-light); box-shadow: none; }
.btn.secondary::before { display: none; }
.btn.secondary:hover:not(:disabled) { background: var(--bg-light); border-color: var(--primary-color); color: var(--primary-light); }

.btn.danger  { background: linear-gradient(135deg, var(--danger-color), #dc2626); }
.btn.success { background: linear-gradient(135deg, var(--secondary-color), #059669); }
.btn.warning { background: linear-gradient(135deg, var(--warning-color), #d97706); }
.btn.small   { padding: 8px 16px; font-size: 0.82rem; }
.btn.tiny    { padding: 6px 12px; font-size: 0.76rem; }
.btn.icon-only { padding: 10px; width: 40px; height: 40px; }
.btn.block   { width: 100%; }

.icon-btn {
    width: 34px; height: 34px; border: none;
    background: rgba(148,163,184,.12); color: var(--text-muted);
    border-radius: 9px; cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 0.85rem; transition: all 0.2s;
}
.icon-btn:hover { background: var(--primary-color); color: #fff; transform: scale(1.06); }
.icon-btn.danger:hover { background: var(--danger-color); }

/* --------------------------------------------------------------------------
   Formulaires
   -------------------------------------------------------------------------- */
.input, .textarea, .select {
    width: 100%; padding: 12px 16px;
    background: var(--bg-dark); border: 1px solid var(--border-color);
    border-radius: var(--radius-sm); color: var(--text-light);
    font-family: 'Poppins', sans-serif; font-size: 0.95rem; transition: var(--transition);
}
.input:focus, .textarea:focus, .select:focus {
    outline: none; border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
}
.input::placeholder, .textarea::placeholder { color: var(--text-muted); }
.textarea { resize: vertical; min-height: 110px; }

label { display: block; margin-bottom: 8px; font-weight: 500; color: var(--text-light); font-size: 0.9rem; }
label i { margin-right: 8px; color: var(--primary-color); }

.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 18px; }
.form-row { margin-bottom: 18px; }
.form-hint { font-size: 0.78rem; color: var(--text-muted); margin-top: 6px; }

input[type="range"] { width: 100%; accent-color: var(--primary-color); }
input[type="color"] { width: 100%; height: 44px; padding: 4px; background: var(--bg-dark); border: 1px solid var(--border-color); border-radius: var(--radius-sm); cursor: pointer; }
input[type="date"] { color-scheme: dark; }
[data-theme="light"] input[type="date"] { color-scheme: light; }

/* Sélecteur d'icône / couleur */
.picker-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.picker-item {
    width: 42px; height: 42px; border-radius: var(--radius-sm);
    border: 2px solid var(--border-color); background: var(--bg-dark);
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; transition: var(--transition); color: var(--text-muted);
}
.picker-item:hover { border-color: var(--primary-light); color: var(--text-light); }
.picker-item.selected { border-color: var(--primary-color); background: var(--primary-color); color: #fff; }
.picker-color { width: 34px; height: 34px; border-radius: 50%; cursor: pointer; border: 3px solid transparent; transition: var(--transition); }
.picker-color.selected { border-color: var(--text-light); transform: scale(1.12); }

/* --------------------------------------------------------------------------
   Filtres
   -------------------------------------------------------------------------- */
.filters {
    display: flex; flex-wrap: wrap; gap: 12px;
    padding: 15px 20px; background: var(--bg-light);
    border-radius: var(--radius-sm); margin-bottom: 20px; align-items: center;
}
.filter-search { flex: 1; min-width: 200px; position: relative; }
.filter-search i { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--text-muted); font-size: 0.9rem; }
.filter-search input {
    width: 100%; background: var(--bg-medium); border: 1px solid var(--border-color);
    border-radius: 25px; padding: 10px 15px 10px 40px;
    font-size: 0.9rem; font-family: inherit; color: var(--text-light); outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.filter-search input:focus { border-color: var(--primary-color); box-shadow: 0 0 0 3px rgba(37,99,235,.1); }

.filters select {
    background: var(--bg-medium); border: 1px solid var(--border-color); border-radius: 20px;
    padding: 10px 35px 10px 15px; font-size: 0.85rem; font-family: inherit;
    color: var(--text-light); cursor: pointer; outline: none; appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2394a3b8' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 12px center;
    transition: border-color 0.2s;
}
.filters select:hover { border-color: var(--primary-light); }
.filters select:focus { border-color: var(--primary-color); }

.filter-reset {
    width: 38px; height: 38px; border: 1px solid var(--border-color);
    background: var(--bg-medium); color: var(--text-muted); border-radius: 50%;
    cursor: pointer; display: flex; align-items: center; justify-content: center; transition: all 0.2s;
}
.filter-reset:hover { background: var(--danger-color); border-color: var(--danger-color); color: #fff; }

.filter-count { font-size: 0.85rem; color: var(--text-muted); padding: 8px 15px; background: var(--bg-medium); border-radius: 20px; white-space: nowrap; }
.filter-count span { font-weight: 600; color: var(--primary-color); }

/* --------------------------------------------------------------------------
   Onglets
   -------------------------------------------------------------------------- */
.tabs {
    display: flex; gap: 6px; margin-bottom: 24px;
    border-bottom: 1px solid var(--border-color); overflow-x: auto; padding-bottom: 0;
}
.tab {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 12px 18px; border: none; background: transparent;
    color: var(--text-muted); font-family: 'Poppins', sans-serif; font-size: 0.9rem; font-weight: 500;
    cursor: pointer; border-bottom: 3px solid transparent; transition: var(--transition); white-space: nowrap;
}
.tab:hover { color: var(--text-light); }
.tab.active { color: var(--primary-light); border-bottom-color: var(--primary-color); }
.tab .count {
    background: var(--bg-light); color: var(--text-muted);
    padding: 1px 8px; border-radius: 20px; font-size: 0.72rem; font-weight: 600;
}
.tab.active .count { background: var(--primary-color); color: #fff; }

.tab-panel { display: none; animation: fadeInUp 0.35s ease; }
.tab-panel.active { display: block; }

/* --------------------------------------------------------------------------
   Kanban
   -------------------------------------------------------------------------- */
.kanban {
    display: grid; grid-template-columns: repeat(5, minmax(255px, 1fr));
    gap: 16px; align-items: start; overflow-x: auto; padding-bottom: 12px;
}
.kanban-col {
    background: var(--bg-medium); border: 1px solid var(--border-color);
    border-radius: var(--radius); display: flex; flex-direction: column; min-height: 180px;
    transition: var(--transition);
}
.kanban-col.dragover { border-color: var(--primary-color); background: rgba(37,99,235,.08); box-shadow: var(--shadow-glow); }

.kanban-col-header {
    display: flex; align-items: center; gap: 9px; padding: 14px 16px;
    border-bottom: 1px solid var(--border-color); font-weight: 600; font-size: 0.88rem;
}
.kanban-col-header .dot { width: 10px; height: 10px; border-radius: 50%; }
.kanban-col-header .count {
    margin-left: auto; background: var(--bg-light); color: var(--text-muted);
    padding: 2px 9px; border-radius: 20px; font-size: 0.72rem; font-weight: 600;
}
.kanban-col-body { padding: 12px; display: flex; flex-direction: column; gap: 10px; min-height: 90px; }
.kanban-col-empty { text-align: center; color: var(--text-muted); font-size: 0.8rem; padding: 22px 10px; opacity: .7; }

.tache-card {
    background: var(--bg-card); border: 1px solid var(--border-color);
    border-left: 4px solid var(--etat-color, #64748b);
    border-radius: var(--radius-sm); padding: 13px 14px;
    cursor: grab; transition: var(--transition); position: relative;
}
.tache-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-light); border-color: var(--primary-color); border-left-color: var(--etat-color, #64748b); }
.tache-card.dragging { opacity: .45; transform: rotate(1.5deg); }

.tache-card-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; margin-bottom: 8px; }
.tache-card-titre { font-size: 0.9rem; font-weight: 500; line-height: 1.4; color: var(--text-light); flex: 1; }
.tache-card-titre a { color: inherit; }
.tache-card-titre a:hover { color: var(--primary-light); }
.tache-card-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 0.74rem; color: var(--text-muted); margin-top: 10px; }
.tache-card-meta i { margin-right: 4px; }
.tache-card-footer { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 11px; }

.prio-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex-shrink: 0; }

/* --------------------------------------------------------------------------
   Liste des tâches
   -------------------------------------------------------------------------- */
.tache-liste { display: flex; flex-direction: column; gap: 10px; }

.tache-row {
    background: var(--bg-card); border: 1px solid var(--border-color);
    border-left: 4px solid var(--etat-color, #64748b);
    border-radius: var(--radius-sm); padding: 14px 18px;
    display: grid; grid-template-columns: 26px 1fr auto; gap: 14px; align-items: center;
    transition: var(--transition); animation: fadeInUp .3s ease backwards;
}
.tache-row:hover { transform: translateX(4px); box-shadow: var(--shadow-light); border-color: var(--primary-color); border-left-color: var(--etat-color, #64748b); }
.tache-row.sous-tache { margin-left: 34px; }

/* --------------------------------------------------------------------------
   Bloc englobant : une tâche parente et toute sa descendance
   -------------------------------------------------------------------------- */
.groupe-taches {
    border: 1px solid var(--border-color);
    border-left: 4px solid var(--groupe-color, var(--accent-color));
    border-radius: var(--radius);
    background: color-mix(in srgb, var(--groupe-color, #8b5cf6) 6%, transparent);
    overflow: hidden;
    transition: var(--transition);
}
.groupe-taches:hover {
    border-color: var(--groupe-color, var(--accent-color));
    box-shadow: var(--shadow-light);
}

.groupe-entete {
    display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
    padding: 11px 18px;
    background: color-mix(in srgb, var(--groupe-color, #8b5cf6) 12%, transparent);
    border-bottom: 1px solid var(--border-color);
    font-size: 0.82rem;
}
.groupe-entete > i { color: var(--groupe-color, var(--accent-color)); }
.groupe-titre { font-weight: 600; color: var(--text-light); }
.groupe-progress { flex: 1; min-width: 140px; max-width: 260px; margin-left: auto; }

.groupe-corps { padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.groupe-corps .tache-row { background: var(--bg-card); }
.groupe-corps .tache-row:hover { transform: translateX(3px); }

/* Filet vertical reliant les sous-tâches à leur parent */
.groupe-corps .tache-row[style*="margin-left"] { position: relative; }
.groupe-corps .tache-row[style*="margin-left"]::before {
    content: ''; position: absolute; left: -18px; top: 50%;
    width: 12px; height: 1px; background: var(--border-color);
}

[data-theme="light"] .groupe-taches { background: color-mix(in srgb, var(--groupe-color, #8b5cf6) 4%, #fff); }

/* Ensemble réduit : seul l'en-tête reste visible */
.groupe-entete { cursor: pointer; user-select: none; }
.groupe-entete:focus-visible { outline: 2px solid var(--groupe-color, var(--accent-color)); outline-offset: -2px; }
.groupe-chevron { font-size: .75rem; transition: transform .2s ease; }
.groupe-taches.reduit .groupe-chevron { transform: rotate(-90deg); }
.groupe-taches.reduit .groupe-entete { border-bottom: none; }
.groupe-taches.reduit .groupe-corps { display: none; }

.ensembles-barre { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: .85rem; }
.ensembles-option { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; margin-left: auto; }

.tache-check {
    width: 22px; height: 22px; border-radius: 6px;
    border: 2px solid var(--border-color); background: transparent;
    cursor: pointer; display: flex; align-items: center; justify-content: center;
    color: transparent; font-size: 0.7rem; transition: var(--transition);
}
.tache-check:hover { border-color: var(--secondary-color); color: var(--text-muted); }
.tache-check.done { background: var(--secondary-color); border-color: var(--secondary-color); color: #fff; }

.tache-main { min-width: 0; }
.tache-titre { font-size: 0.95rem; font-weight: 500; margin-bottom: 6px; }
.tache-titre a { color: var(--text-light); }
.tache-titre a:hover { color: var(--primary-light); }
.tache-row.done .tache-titre { text-decoration: line-through; opacity: .65; }
.tache-sub { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; font-size: 0.76rem; color: var(--text-muted); }
.tache-sub i { margin-right: 4px; }
.tache-right { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; justify-content: flex-end; }
.tache-progress { width: 110px; }

/* --------------------------------------------------------------------------
   Gantt / planning
   -------------------------------------------------------------------------- */
.gantt-wrap { overflow-x: auto; border: 1px solid var(--border-color); border-radius: var(--radius); background: var(--bg-card); }
.gantt { min-width: 780px; }
.gantt-head {
    display: grid; grid-template-columns: 260px 1fr;
    border-bottom: 1px solid var(--border-color); position: sticky; top: 0; background: var(--bg-medium); z-index: 5;
}
.gantt-head-left { padding: 12px 16px; font-size: 0.8rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: .5px; }
.gantt-scale { position: relative; height: 44px; }
.gantt-scale-tick {
    position: absolute; top: 0; bottom: 0; border-left: 1px solid var(--border-color);
    font-size: 0.68rem; color: var(--text-muted); padding: 6px 0 0 6px; white-space: nowrap;
}
.gantt-row { display: grid; grid-template-columns: 260px 1fr; border-bottom: 1px solid var(--border-color); }
.gantt-row:last-child { border-bottom: none; }
.gantt-row:hover { background: rgba(148,163,184,.05); }
.gantt-label {
    padding: 11px 16px; font-size: 0.85rem; border-right: 1px solid var(--border-color);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    display: flex; align-items: center; gap: 8px;
}
.gantt-track { position: relative; height: 44px; }
.gantt-bar {
    position: absolute; top: 11px; height: 22px; border-radius: 6px;
    display: flex; align-items: center; padding: 0 8px;
    font-size: 0.7rem; color: #fff; font-weight: 500; white-space: nowrap; overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,.3); cursor: pointer; transition: var(--transition); min-width: 8px;
}
.gantt-bar:hover { transform: scaleY(1.15); box-shadow: var(--shadow-light); }
.gantt-bar-fill { position: absolute; left: 0; top: 0; bottom: 0; background: rgba(255,255,255,.28); border-radius: 6px 0 0 6px; }
.gantt-bar span { position: relative; z-index: 1; }
.gantt-today { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--danger-color); z-index: 3; opacity: .75; }

/* Corps du diagramme : sert de repère aux flèches de liaison */
.gantt-corps { position: relative; }

/* Flèches reliant une tâche à ses prérequis */
.gantt-liens {
    position: absolute; top: 0; left: 260px; right: 0;
    width: calc(100% - 260px);
    pointer-events: none; z-index: 4; overflow: visible;
}
.gantt-liens polyline { pointer-events: stroke; }

/* Barre récapitulative d'une tâche parente */
.gantt-bar.recap {
    height: 14px; top: 15px; border-radius: 3px; opacity: .9;
}
.gantt-bar.recap::before,
.gantt-bar.recap::after {
    content: ''; position: absolute; bottom: -6px;
    border-top: 7px solid var(--accent-color);
    border-left: 5px solid transparent; border-right: 5px solid transparent;
}
.gantt-bar.recap::before { left: 0; }
.gantt-bar.recap::after  { right: 0; }
.gantt-bar.recap span { font-size: .62rem; }

/* Tâche démarrant avant la fin d'un prérequis */
.gantt-bar.conflit { outline: 2px dashed var(--danger-color); outline-offset: 2px; }

.gantt-label.enfant { color: var(--text-muted); }
.tache-row.recap .tache-titre { font-weight: 600; }
.gantt-jalon {
    position: absolute; top: 12px; width: 20px; height: 20px;
    background: var(--accent-color); transform: rotate(45deg);
    border: 2px solid var(--bg-card); z-index: 2;
}

/* --------------------------------------------------------------------------
   Charge par personne
   -------------------------------------------------------------------------- */
.charge-liste { display: flex; flex-direction: column; gap: 14px; }
.charge-row {
    display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: center;
    padding: 12px 16px; background: var(--bg-light); border-radius: var(--radius-sm);
    transition: var(--transition);
}
.charge-row:hover { background: var(--bg-medium); box-shadow: var(--shadow-light); }
.charge-nom { font-size: 0.9rem; font-weight: 500; }
.charge-detail { font-size: 0.75rem; color: var(--text-muted); margin-top: 3px; }
.charge-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
    font-size: 0.7rem; font-weight: 600; padding: 3px 9px; border-radius: 20px;
    background: color-mix(in srgb, var(--c-color, #64748b) 18%, transparent);
    color: var(--c-color, #94a3b8);
    border: 1px solid color-mix(in srgb, var(--c-color, #64748b) 35%, transparent);
}

/* --------------------------------------------------------------------------
   Retours / commentaires
   -------------------------------------------------------------------------- */
.retours-liste { display: flex; flex-direction: column; gap: 14px; }
.retour {
    background: var(--bg-light); border-radius: var(--radius-sm);
    padding: 15px 17px; border-left: 3px solid var(--primary-color);
    animation: fadeInUp .3s ease backwards;
}
.retour-head { display: flex; align-items: center; gap: 11px; margin-bottom: 10px; }
.retour-auteur { font-size: 0.85rem; font-weight: 600; }
.retour-date { font-size: 0.72rem; color: var(--text-muted); }
.retour-texte { font-size: 0.9rem; line-height: 1.65; white-space: pre-wrap; word-wrap: break-word; }
.retour-badges { display: flex; gap: 8px; margin-top: 11px; flex-wrap: wrap; }
.retour .icon-btn { margin-left: auto; }

/* --------------------------------------------------------------------------
   Documents
   -------------------------------------------------------------------------- */
.doc-liste { display: flex; flex-direction: column; gap: 10px; }
.doc-item {
    display: flex; align-items: center; gap: 14px;
    padding: 13px 16px; background: var(--bg-light);
    border-radius: var(--radius-sm); border: 1px solid transparent; transition: var(--transition);
}
.doc-item:hover { border-color: var(--primary-color); transform: translateX(4px); }
.doc-icon {
    width: 42px; height: 42px; border-radius: var(--radius-sm);
    background: var(--bg-dark); display: flex; align-items: center; justify-content: center;
    font-size: 1.15rem; color: var(--primary-light); flex-shrink: 0;
}
.doc-info { flex: 1; min-width: 0; }
.doc-nom { font-size: 0.9rem; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.doc-meta { font-size: 0.74rem; color: var(--text-muted); margin-top: 3px; display: flex; gap: 12px; flex-wrap: wrap; }
.doc-actions { display: flex; gap: 6px; }

.dropzone {
    border: 2px dashed var(--border-color); border-radius: var(--radius);
    padding: 30px 20px; text-align: center; color: var(--text-muted);
    transition: var(--transition); cursor: pointer;
}
.dropzone:hover, .dropzone.dragover { border-color: var(--primary-color); background: rgba(37,99,235,.06); color: var(--text-light); }
.dropzone i { font-size: 2rem; display: block; margin-bottom: 10px; opacity: .7; }
.dropzone strong { color: var(--primary-light); }

/* Visionneuse de documents */
.modal-content.visionneuse { max-width: 1100px; width: 94%; }
.visionneuse-corps {
    padding: 0; background: var(--bg-dark);
    display: flex; align-items: center; justify-content: center;
    min-height: 320px; max-height: 78vh; overflow: auto;
}
.apercu-image { max-width: 100%; max-height: 78vh; display: block; object-fit: contain; }
.apercu-cadre { width: 100%; height: 78vh; border: none; background: #fff; }
.apercu-media { max-width: 100%; max-height: 78vh; display: block; background: #000; }
.apercu-texte {
    width: 100%; margin: 0; padding: 20px;
    font-family: Consolas, 'Courier New', monospace; font-size: 0.84rem; line-height: 1.6;
    white-space: pre-wrap; word-break: break-word; color: var(--text-light);
    max-height: 78vh; overflow: auto;
}

.upload-file-list { margin-top: 14px; display: flex; flex-direction: column; gap: 8px; }
.upload-file { flex-wrap: wrap; }
.upload-file {
    display: flex; align-items: center; gap: 10px; padding: 9px 13px;
    background: var(--bg-light); border-radius: var(--radius-sm); font-size: 0.83rem;
}
.upload-file .state { margin-left: auto; font-size: 0.76rem; color: var(--text-muted); }
.upload-file.ok    .state { color: var(--secondary-color); }
.upload-file.error .state { color: var(--danger-color); }

/* --------------------------------------------------------------------------
   Membres
   -------------------------------------------------------------------------- */
.membres-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.membre-card {
    display: flex; align-items: center; gap: 13px; padding: 15px;
    background: var(--bg-light); border: 1px solid transparent;
    border-radius: var(--radius-sm); transition: var(--transition);
}
.membre-card:hover { border-color: var(--primary-color); transform: translateY(-3px); }
.membre-info { flex: 1; min-width: 0; }
.membre-nom { font-size: 0.9rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.membre-role { font-size: 0.74rem; color: var(--text-muted); display: flex; align-items: center; gap: 5px; margin-top: 3px; }

/* --------------------------------------------------------------------------
   Journal d'activité
   -------------------------------------------------------------------------- */
.timeline { position: relative; padding-left: 30px; }
.timeline::before { content: ''; position: absolute; left: 9px; top: 6px; bottom: 6px; width: 2px; background: var(--border-color); }
.timeline-item { position: relative; padding-bottom: 20px; }
.timeline-item::before {
    content: ''; position: absolute; left: -26px; top: 5px;
    width: 12px; height: 12px; border-radius: 50%;
    background: var(--primary-color); border: 2px solid var(--bg-card);
}
.timeline-item.creation::before { background: var(--secondary-color); }
.timeline-item.suppression::before { background: var(--danger-color); }
.timeline-item.document::before { background: var(--accent-color); }
.timeline-texte { font-size: 0.87rem; line-height: 1.55; }
.timeline-date { font-size: 0.73rem; color: var(--text-muted); margin-top: 3px; }

/* --------------------------------------------------------------------------
   Compte rendu généré par l'IA
   -------------------------------------------------------------------------- */
.rapport-entete {
    display: flex; justify-content: space-between; align-items: flex-start; gap: 16px;
    flex-wrap: wrap; padding-bottom: 16px; margin-bottom: 20px;
    border-bottom: 2px solid var(--primary-color);
}

.rapport-contenu {
    line-height: 1.75; font-size: 0.94rem;
    background: var(--bg-light); border-radius: var(--radius);
    padding: 26px 30px; max-height: 70vh; overflow-y: auto;
}
.rapport-contenu h2 {
    font-size: 1.12rem; margin: 26px 0 12px;
    padding-bottom: 7px; border-bottom: 1px solid var(--border-color);
    color: var(--primary-light); display: flex; align-items: center; gap: 9px;
}
.rapport-contenu h2:first-child { margin-top: 0; }
.rapport-contenu h3 { font-size: 0.98rem; margin: 18px 0 8px; color: var(--accent-light); }
.rapport-contenu p { margin-bottom: 12px; }
.rapport-contenu ul, .rapport-contenu ol { margin: 0 0 14px 22px; }
.rapport-contenu li { margin-bottom: 6px; }
.rapport-contenu strong { color: var(--text-light); font-weight: 600; }
.rapport-contenu blockquote {
    border-left: 3px solid var(--accent-color); padding: 8px 16px;
    margin: 12px 0; background: rgba(139, 92, 246, .08); border-radius: 0 8px 8px 0;
}
.rapport-contenu table {
    width: 100%; border-collapse: collapse; margin: 14px 0; font-size: 0.88rem;
    display: block; overflow-x: auto;
}
.rapport-contenu th, .rapport-contenu td {
    border: 1px solid var(--border-color); padding: 8px 12px; text-align: left;
}
.rapport-contenu th { background: var(--bg-medium); font-weight: 600; color: var(--text-light); }
.rapport-contenu tr:nth-child(even) td { background: rgba(148, 163, 184, .05); }
.rapport-contenu code {
    background: var(--bg-dark); padding: 2px 6px; border-radius: 4px;
    font-family: Consolas, monospace; font-size: .88em;
}
.rapport-contenu hr { border: none; border-top: 1px solid var(--border-color); margin: 20px 0; }

[data-theme="light"] .rapport-contenu { background: #fff; border: 1px solid var(--border-color); }

/* --------------------------------------------------------------------------
   Modales
   -------------------------------------------------------------------------- */
.modal {
    display: none; position: fixed; inset: 0; z-index: 1000;
    align-items: center; justify-content: center;
}
.modal.active { display: flex; }
.modal-overlay { position: absolute; inset: 0; background: rgba(0,0,0,.7); backdrop-filter: blur(4px); }
.modal-content {
    position: relative; background: var(--bg-medium); border-radius: var(--radius);
    width: 92%; max-width: 560px; max-height: 90vh; overflow-y: auto;
    box-shadow: var(--shadow); animation: modalSlideIn .3s ease;
}
.modal-content.wide { max-width: 780px; }
@keyframes modalSlideIn { from { opacity: 0; transform: translateY(-20px); } to { opacity: 1; transform: translateY(0); } }

.modal-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 20px; border-bottom: 1px solid var(--border-color);
    position: sticky; top: 0; background: var(--bg-medium); z-index: 2;
}
.modal-header h3 { font-size: 1.15rem; display: flex; align-items: center; gap: 10px; margin: 0; }
.modal-header h3 i { color: var(--primary-color); }
.modal-close { background: none; border: none; color: var(--text-muted); font-size: 1.4rem; cursor: pointer; transition: var(--transition); line-height: 1; }
.modal-close:hover { color: var(--danger-color); }
.modal-body { padding: 20px; }
.modal-footer { display: flex; justify-content: flex-end; gap: 10px; padding: 20px; border-top: 1px solid var(--border-color); }

/* --------------------------------------------------------------------------
   Recherche d'utilisateurs (annuaire AD)
   -------------------------------------------------------------------------- */
.user-search-container { position: relative; flex: 1; }
.user-search-input-wrapper { position: relative; display: flex; align-items: center; }
.user-search-icon { position: absolute; left: 14px; color: var(--text-muted); font-size: 0.9rem; pointer-events: none; }
.user-search-input {
    width: 100%; padding: 12px 40px 12px 42px;
    background: var(--bg-dark); border: 2px solid var(--border-color); border-radius: var(--radius-sm);
    font-family: 'Poppins', sans-serif; font-size: 0.95rem; color: var(--text); outline: none; transition: all .2s;
}
.user-search-input:focus { border-color: var(--primary-color); box-shadow: 0 0 0 3px rgba(37,99,235,.15); }
.user-search-clear {
    position: absolute; right: 10px; background: none; border: none; color: var(--text-muted);
    cursor: pointer; padding: 5px; border-radius: 50%; transition: all .2s;
}
.user-search-clear:hover { color: var(--danger-color); }

.user-search-suggestions {
    position: absolute; top: 100%; left: 0; right: 0;
    background: var(--bg-medium); border: 2px solid var(--primary-color); border-radius: var(--radius-sm);
    max-height: 300px; overflow-y: auto; z-index: 9999; display: none;
    box-shadow: 0 8px 25px rgba(0,0,0,.5); margin-top: 6px;
}
.user-search-suggestions.active { display: block; }
.user-suggestion-item {
    display: flex; align-items: center; gap: 12px; padding: 12px 15px;
    cursor: pointer; transition: background .15s; border-bottom: 1px solid var(--border-color);
}
.user-suggestion-item:last-child { border-bottom: none; }
.user-suggestion-item:hover, .user-suggestion-item.highlighted { background: var(--bg-light); }
.user-suggestion-info { flex: 1; min-width: 0; }
.user-suggestion-name { font-weight: 500; font-size: 0.9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-suggestion-service { font-size: 0.77rem; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-search-loading, .user-search-empty { padding: 18px; text-align: center; color: var(--text-muted); font-size: 0.88rem; }

/* --------------------------------------------------------------------------
   États vides, toasts, divers
   -------------------------------------------------------------------------- */
.empty-state { text-align: center; padding: 55px 30px; color: var(--text-muted); }
.empty-state i { font-size: 2.8rem; margin-bottom: 15px; opacity: .45; display: block; }
.empty-state p { font-size: 0.93rem; }
.empty-state .btn { margin-top: 18px; }

.toast-container { position: fixed; bottom: 24px; right: 24px; z-index: 5000; display: flex; flex-direction: column; gap: 10px; }
.toast {
    display: flex; align-items: center; gap: 12px;
    background: var(--bg-medium); border: 1px solid var(--border-color);
    border-left: 4px solid var(--primary-color);
    padding: 14px 18px; border-radius: var(--radius-sm);
    box-shadow: var(--shadow); font-size: 0.88rem; min-width: 260px; max-width: 420px;
    animation: toastIn .3s ease;
}
.toast.success { border-left-color: var(--secondary-color); }
.toast.error   { border-left-color: var(--danger-color); }
.toast.warning { border-left-color: var(--warning-color); }
.toast i { font-size: 1.05rem; }
.toast.success i { color: var(--secondary-color); }
.toast.error i   { color: var(--danger-color); }
.toast.warning i { color: var(--warning-color); }
.toast.info i    { color: var(--primary-light); }
.toast.out { animation: toastOut .3s ease forwards; }
@keyframes toastIn  { from { opacity: 0; transform: translateX(40px); } to { opacity: 1; transform: translateX(0); } }
@keyframes toastOut { to { opacity: 0; transform: translateX(40px); } }

.divider { height: 1px; background: var(--border-color); margin: 22px 0; }
.muted { color: var(--text-muted); }
.text-sm { font-size: 0.83rem; }
.nowrap { white-space: nowrap; }
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.gap-8 { gap: 8px; } .gap-12 { gap: 12px; } .gap-16 { gap: 16px; }
.mt-8 { margin-top: 8px; } .mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; }
.mb-0 { margin-bottom: 0; } .mb-16 { margin-bottom: 16px; }

[data-tooltip] { position: relative; }
[data-tooltip]::after {
    content: attr(data-tooltip); position: absolute; bottom: 100%; left: 50%;
    transform: translateX(-50%); padding: 5px 10px;
    background: var(--bg-dark); color: var(--text-light);
    font-size: 0.72rem; border-radius: 5px; white-space: nowrap;
    opacity: 0; pointer-events: none; transition: var(--transition); margin-bottom: 6px; z-index: 100;
    border: 1px solid var(--border-color);
}
[data-tooltip]:hover::after { opacity: 1; }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--bg-dark); border-radius: 4px; }
::-webkit-scrollbar-thumb { background: linear-gradient(180deg, var(--primary-color) 0%, var(--accent-color) 100%); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: linear-gradient(180deg, var(--primary-light) 0%, var(--accent-light) 100%); }

/* --------------------------------------------------------------------------
   Thème clair — ajustements
   -------------------------------------------------------------------------- */
[data-theme="light"] .main-content {
    background:
        radial-gradient(circle at 20% 20%, rgba(37,99,235,.05) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(139,92,246,.05) 0%, transparent 50%),
        linear-gradient(180deg, #f8fafc 0%, #e2e8f0 100%);
}
[data-theme="light"] .card,
[data-theme="light"] .project-card,
[data-theme="light"] .kpi-card,
[data-theme="light"] .tache-card,
[data-theme="light"] .tache-row { background: var(--bg-card); box-shadow: var(--shadow-light); }
[data-theme="light"] .input, [data-theme="light"] .textarea,
[data-theme="light"] .select, [data-theme="light"] .user-search-input { background: var(--bg-light); }
[data-theme="light"] .user-card, [data-theme="light"] .theme-toggle-container,
[data-theme="light"] .filters, [data-theme="light"] .kanban-col { background: var(--bg-light); }
[data-theme="light"] .kanban-col { background: #f8fafc; }
[data-theme="light"] .project-card-footer { background: rgba(15,23,42,.03); }
[data-theme="light"] ::-webkit-scrollbar-track { background: var(--bg-light); }
[data-theme="light"] .progress { background: #cbd5e1; }
[data-theme="light"] .et-dans-les-temps, [data-theme="light"] .et-termine { color: #047857; }
[data-theme="light"] .et-derive, [data-theme="light"] .et-imminent { color: #b45309; }
[data-theme="light"] .et-aujourdhui { color: #c2410c; }
[data-theme="light"] .et-retard, [data-theme="light"] .et-bloque { color: #b91c1c; }
[data-theme="light"] .et-termine-retard { color: #0f766e; }

/* --------------------------------------------------------------------------
   Impression
   -------------------------------------------------------------------------- */
@media print {
    .sidebar, .header-actions, .filters, .tabs, .btn, .icon-btn, .toast-container { display: none !important; }
    .main-content { background: #fff !important; color: #000 !important; padding: 0; }
    .card, .tache-row { break-inside: avoid; box-shadow: none; }
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 1400px) { .kanban { grid-template-columns: repeat(5, minmax(240px, 1fr)); } }

@media (max-width: 992px) {
    .app-container { flex-direction: column; }
    .sidebar {
        width: 100%; height: auto; position: relative;
        border-right: none; border-bottom: 1px solid var(--border-color);
        flex-direction: row; flex-wrap: wrap; align-items: center; gap: 15px; overflow: visible;
    }
    .sidebar-header { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
    .sidebar-logo { width: 62px; height: 62px; border-radius: 14px; margin-bottom: 8px; }
    .sidebar-nav { flex-direction: row; flex-wrap: wrap; }
    .sidebar-section-title, .sidebar-projects, .sidebar-stats { display: none; }
    .user-card, .theme-toggle-container { margin-bottom: 0; }
    .main-content { padding: 20px; }
    .projects-grid { grid-template-columns: 1fr; }
    .kanban { grid-template-columns: repeat(5, 260px); }
}

@media (max-width: 600px) {
    .card { padding: 18px; }
    .btn { padding: 10px 18px; font-size: 0.85rem; }
    .main-header { flex-direction: column; align-items: flex-start; }
    .header-actions { width: 100%; }
    .tache-row { grid-template-columns: 26px 1fr; }
    .tache-right { grid-column: 1 / -1; justify-content: flex-start; }
    .filters { flex-direction: column; align-items: stretch; }
    .filters select, .filter-count { width: 100%; }
    .kpi-grid { grid-template-columns: repeat(2, 1fr); }
    .kpi-value { font-size: 1.3rem; }
    .toast-container { left: 16px; right: 16px; bottom: 16px; }
    .toast { min-width: 0; max-width: none; }
}

/* ==========================================================================
   Jalon en ligne — pages publiques, organisation, bandeau d'essai
   ========================================================================== */
.bandeau-essai {
    display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
    margin-bottom: 20px; padding: 12px 16px; border-radius: var(--radius-sm);
    background: color-mix(in srgb, var(--warning-color) 14%, transparent);
    border: 1px solid color-mix(in srgb, var(--warning-color) 40%, transparent);
    font-size: .88rem;
}
.bandeau-essai.fini {
    background: color-mix(in srgb, var(--danger-color) 13%, transparent);
    border-color: color-mix(in srgb, var(--danger-color) 40%, transparent);
}
.bandeau-essai a { color: var(--primary-light); }

.alerte {
    display: flex; gap: 10px; align-items: flex-start;
    padding: 12px 15px; border-radius: var(--radius-sm); margin-bottom: 18px;
    font-size: .88rem; line-height: 1.55; border: 1px solid;
}
.alerte i { margin-top: 3px; }
.alerte.ok   { background: color-mix(in srgb, var(--secondary-color) 12%, transparent); border-color: color-mix(in srgb, var(--secondary-color) 40%, transparent); }
.alerte.ko   { background: color-mix(in srgb, var(--danger-color) 12%, transparent);    border-color: color-mix(in srgb, var(--danger-color) 40%, transparent); }
.alerte.info { background: color-mix(in srgb, var(--primary-color) 12%, transparent);   border-color: color-mix(in srgb, var(--primary-color) 40%, transparent); }

/* Pages hors connexion : inscription, connexion, invitation */
.auth-page {
    min-height: 100vh; display: grid; place-items: center; padding: 32px 16px;
    background: radial-gradient(60rem 30rem at 15% -10%, rgba(37,99,235,.25), transparent 60%),
                radial-gradient(50rem 30rem at 90% 110%, rgba(139,92,246,.22), transparent 60%), var(--bg-dark);
}
.auth-box {
    width: min(100%, 460px); padding: 34px 32px; border-radius: 22px;
    background: var(--bg-card); border: 1px solid var(--border-color); box-shadow: var(--shadow);
}
.auth-box.large { width: min(100%, 620px); }
.auth-marque { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; }
.auth-marque img { width: 42px; height: 42px; }
.auth-marque b { font-family: 'Montserrat', sans-serif; font-size: 1.35rem; display: block; line-height: 1.1; }
.auth-marque small { color: var(--text-muted); font-size: .78rem; }
.auth-box h2 { font-size: 1.3rem; margin: 0 0 6px; }
.auth-box > p { color: var(--text-muted); font-size: .9rem; margin: 0 0 20px; }
.auth-box label { display: block; font-size: .82rem; font-weight: 500; margin-bottom: 6px; }
.auth-box .input { width: 100%; }
.auth-duo { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.auth-sep { display: flex; align-items: center; gap: 12px; margin: 20px 0; color: var(--text-muted); font-size: .8rem; }
.auth-sep::before, .auth-sep::after { content: ''; flex: 1; height: 1px; background: var(--border-color); }
.btn-microsoft {
    display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%;
    padding: 11px 16px; border-radius: var(--radius-sm); border: 1px solid var(--border-color);
    background: var(--bg-medium); color: var(--text-light); font-weight: 500; text-decoration: none;
}
.btn-microsoft:hover { border-color: var(--primary-light); }
.btn-microsoft svg { width: 18px; height: 18px; }
.auth-liens { margin-top: 18px; font-size: .84rem; color: var(--text-muted); text-align: center; line-height: 1.8; }
.auth-liens a { color: var(--primary-light); }
.case-cgu { display: flex !important; gap: 9px; align-items: flex-start; font-weight: 400 !important; font-size: .82rem !important; color: var(--text-muted); }
.case-cgu input { margin-top: 3px; accent-color: var(--primary-color); }
.piege { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* Page Organisation */
.tbl-jalon { width: 100%; border-collapse: collapse; font-size: .87rem; }
.tbl-jalon th {
    text-align: left; padding: 10px 12px; font-size: .72rem; letter-spacing: .06em; text-transform: uppercase;
    color: var(--text-muted); border-bottom: 1px solid var(--border-color); white-space: nowrap;
}
.tbl-jalon td { padding: 10px 12px; border-bottom: 1px solid var(--border-color); vertical-align: middle; }
.tbl-jalon tr:last-child td { border-bottom: none; }
.tbl-wrap { overflow-x: auto; }
.ligne-inactive { opacity: .5; }
.org-grille { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 22px; align-items: start; }
.etat-m365 { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--bg-dark); margin-bottom: 14px; font-size: .86rem; }
.etat-m365 .pt { width: 10px; height: 10px; border-radius: 99px; background: var(--text-muted); flex: none; }
.etat-m365.on .pt { background: var(--secondary-color); box-shadow: 0 0 0 4px color-mix(in srgb, var(--secondary-color) 25%, transparent); }
.actions-ligne { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.actions-ligne form { margin: 0; }
.inline-form { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; }
.inline-form .form-row { margin-bottom: 0; flex: 1; min-width: 180px; }

@media (max-width: 960px) { .org-grille { grid-template-columns: 1fr; } }
@media (max-width: 560px) { .auth-duo { grid-template-columns: 1fr; } .auth-box { padding: 26px 20px; } }