*{
    margin:0;
    padding:0;
    box-sizing:border-box;
    font-family:"Segoe UI", sans-serif;
}

:root{
    /*
    Couleurs fonctionnelles.
    Elles ne changent pas avec le thème.
    */
    --accent:#3B82F6;
    --accent-dark:#2563EB;
    --accent-light:#60A5FA;
    --accent-soft:rgba(59,130,246,0.18);

    /*
    Thème CerebrOS par défaut.
    */
    --bg:#080A10;
    --bg-secondary:#101522;

    --sidebar:rgba(18,22,32,0.78);

    --glass:rgba(30,36,48,0.58);
    --glass-strong:rgba(38,45,60,0.72);

    --surface:rgba(255,255,255,0.045);
    --surface-hover:rgba(255,255,255,0.075);

    --border:rgba(255,255,255,0.08);
    --border-strong:rgba(255,255,255,0.14);

    --text:#FFFFFF;
    --muted:#9CA7BA;

    --input-bg:rgba(8,10,16,0.72);

    --shadow:0 20px 60px rgba(0,0,0,0.22);
}

body.personal-theme{
    --accent:#22C55E;
    --accent-dark:#16A34A;
    --accent-light:#4ADE80;
    --accent-soft:rgba(34,197,94,0.18);
}

/* =========================================================
   THÈME SOMBRE
========================================================= */

body[data-theme="dark"]{
    --bg:#090A0C;
    --bg-secondary:#111214;

    --sidebar:#111317;

    --glass:#17191E;
    --glass-strong:#1D2026;

    --surface:#202329;
    --surface-hover:#292D35;

    --border:rgba(255,255,255,0.075);
    --border-strong:rgba(255,255,255,0.13);

    --text:#F5F7FA;
    --muted:#969DA8;

    --input-bg:#101216;

    --shadow:0 18px 45px rgba(0,0,0,0.30);
}


/* =========================================================
   THÈME CLAIR
========================================================= */

body[data-theme="light"]{
    --bg:#EEF1F6;
    --bg-secondary:#E3E8F0;

    --sidebar:rgba(250,251,253,0.92);

    --glass:rgba(255,255,255,0.76);
    --glass-strong:rgba(255,255,255,0.94);

    --surface:rgba(15,23,42,0.045);
    --surface-hover:rgba(15,23,42,0.075);

    --border:rgba(15,23,42,0.16);
    --border-strong:rgba(15,23,42,0.24);

    --text:#131722;
    --muted:#697386;

    --input-bg:rgba(255,255,255,0.88);

    --shadow:0 8px 24px rgba(41,51,74,0.14);
}

body{
    min-height:100vh;

    background:
        radial-gradient(
            circle at top left,
            rgba(59,130,246,0.16),
            transparent 34%
        ),
        radial-gradient(
            circle at bottom right,
            rgba(120,80,255,0.12),
            transparent 32%
        ),
        var(--bg);

    color:var(--text);

    display:flex;
    overflow:hidden;

    transition:
        background .22s ease,
        color .22s ease;
}

body[data-theme="dark"]{
    background:var(--bg);
}

body[data-theme="light"]{
    background:
        radial-gradient(
            circle at top left,
            rgba(59,130,246,0.08),
            transparent 34%
        ),
        radial-gradient(
            circle at bottom right,
            rgba(120,80,255,0.06),
            transparent 32%
        ),
        var(--bg);
}

.sidebar{
    width:290px;
    height:100vh;
    position:relative;
    padding:26px 22px;
    background:var(--sidebar);
    border-right:1px solid var(--border);
    backdrop-filter:blur(22px);
    -webkit-backdrop-filter:blur(22px);

    display:flex;
    flex-direction:column;

    overflow-y:auto;
    scrollbar-width:none;
}

.sidebar::-webkit-scrollbar{
    display:none;
}

.brand{
    display:flex;
    align-items:center;
    gap:14px;
    margin-bottom:34px;
}

.brand-icon{
    width:42px;
    height:42px;
    border-radius:14px;
    background:linear-gradient(145deg, rgba(255,255,255,0.18), rgba(255,255,255,0.04));
    border:1px solid var(--border);
    display:flex;
    align-items:center;
    justify-content:center;
    font-weight:800;
    color:white;
}

.brand-title{
    font-size:24px;
    font-weight:800;
    letter-spacing:-0.5px;
}

.brand-subtitle{
    font-size:12px;
    color:var(--muted);
    margin-top:2px;
}

.nav-group{
    margin-bottom:26px;
}

.nav-group.bottom{
    margin-top:auto;
}

.nav-label{
    color:var(--muted);
    font-size:11px;
    text-transform:uppercase;
    letter-spacing:1px;
    margin:0 0 10px 10px;
}

.nav{
    width:100%;
    border:0;
    background:transparent;
    color:#DCE4F2;
    padding:12px 14px;
    border-radius:14px;
    margin-bottom:7px;
    cursor:pointer;
    display:flex;
    align-items:center;
    gap:12px;
    font-size:15px;
    text-align:left;
    transition:0.18s ease;
}

.nav:hover{
    background:rgba(255,255,255,0.06);
}

.nav.active{
    background:rgba(255,255,255,0.09);
    box-shadow:inset 4px 0 0 var(--accent);
}

.icon{
    width:26px;
    height:26px;
    border-radius:9px;
    display:flex;
    align-items:center;
    justify-content:center;
    color:#F4F7FB;
    background:rgba(255,255,255,0.06);
    border:1px solid rgba(255,255,255,0.06);
    font-size:15px;
}

.content{
    flex:1;
    height:100vh;
    overflow:auto;
    padding:42px 48px;
}

.page{
    display:none;
    animation:fadeIn 0.18s ease;
    width:100%;
}

.page.active{
    display:block;
}

@keyframes fadeIn{
    from{opacity:0; transform:translateY(6px);}
    to{opacity:1; transform:translateY(0);}
}

.topbar{
    display:flex;
    justify-content:space-between;
    align-items:flex-start;
    margin-bottom:26px;
}

h1{
    font-size:42px;
    letter-spacing:-1.5px;
    margin-bottom:8px;
}

h2{
    font-size:28px;
    letter-spacing:-0.8px;
}

h3{
    font-size:20px;
}

.page-subtitle,
.muted,
p{
    color:var(--muted);
}

.glass{
    background:var(--glass);
    border:1px solid var(--border);

    backdrop-filter:blur(18px);
    -webkit-backdrop-filter:blur(18px);

    box-shadow:
        var(--shadow),
        inset 0 1px 0 rgba(255,255,255,0.05);

    border-radius:24px;

    transition:
        background .22s ease,
        border-color .22s ease,
        color .22s ease;
}

.dashboard-hero{
    padding:30px;
    display:flex;
    justify-content:space-between;
    gap:30px;
    align-items:center;
    margin-bottom:26px;
}

.eyebrow{
    text-transform:uppercase;
    letter-spacing:1px;
    font-size:12px;
    color:#B8C5DA;
    margin-bottom:8px;
}

.hero-stats{
    display:flex;
    gap:14px;
}

.hero-stats div{
    width:110px;
    padding:18px;
    border-radius:18px;
    background:rgba(255,255,255,0.055);
    border:1px solid rgba(255,255,255,0.06);
    text-align:center;
}

.hero-stats strong{
    display:block;
    font-size:26px;
}

.hero-stats span{
    display:block;
    color:var(--muted);
    font-size:12px;
    margin-top:4px;
}

.dashboard-grid{
    display:grid;
    grid-template-columns:1.2fr 1fr;
    gap:22px;
}

.card-large{
    padding:24px;
    min-height:230px;
}

.card-header{
    display:flex;
    justify-content:space-between;
    align-items:center;
    margin-bottom:18px;
}

.status-pill{
    display:flex;
    align-items:center;
    gap:9px;
    padding:10px 14px;
    border-radius:999px;
    background:rgba(255,255,255,0.06);
    border:1px solid var(--border);
    color:#DCE4F2;
    font-size:14px;
}

.status-dot{
    width:8px;
    height:8px;
    border-radius:50%;
    background:#22C55E;
    box-shadow:0 0 12px rgba(34,197,94,0.8);
}

.notification-stack{
    position:relative;
    min-height:130px;
}

.notification-card{
    position:relative;
    padding:18px 42px 18px 18px;
    border-radius:18px;
    background:var(--glass-strong);
    border:1px solid var(--border);
}

.notification-card::before{
    content:"";
    position:absolute;
    inset:10px;
    transform:translate(8px,10px);
    border-radius:18px;
    background:rgba(255,255,255,0.035);
    z-index:-1;
}

.close-notification{
    position:absolute;
    top:12px;
    right:14px;
    background:none;
    border:0;
    color:#CCD5E4;
    font-size:22px;
    cursor:pointer;
}

.module-list{
    display:grid;
    gap:10px;
}

.module-list div{
    padding:14px 16px;
    border-radius:14px;
    background:rgba(255,255,255,0.045);
    border:1px solid rgba(255,255,255,0.055);
}

.primary-btn{
    background:linear-gradient(135deg, var(--accent), var(--accent-dark));
    color:white;
    border:0;
    padding:12px 18px;
    border-radius:14px;
    cursor:pointer;
    font-weight:700;
    box-shadow:0 12px 28px rgba(37,99,235,0.26);
}

.primary-btn:hover{
    transform:translateY(-1px);
}

.full{
    width:100%;
    margin-top:20px;
}

.list{
    display:grid;
    gap:16px;
}

.card,
.project-card,
.empty-module{
    background:var(--glass);
    border:1px solid var(--border);
    backdrop-filter:blur(18px);
    -webkit-backdrop-filter:blur(18px);
    border-radius:22px;
    padding:22px;
    box-shadow:0 18px 50px rgba(0,0,0,0.18);
}

.project-card h3{
    margin-bottom:8px;
}

.project-meta{
    color:var(--muted);
    margin-top:6px;
}

.modal{
    position:fixed;
    inset:0;
    background:rgba(0,0,0,0.64);
    display:flex;
    align-items:center;
    justify-content:center;
    z-index:20;
}

.hidden{
    display:none;
}

.modal-box{
    width:700px;
    max-width:90vw;

    max-height:90vh;

    display:flex;
    flex-direction:column;

    overflow:hidden;

    padding:22px;
}

.modal-header button{
    background:rgba(255,255,255,0.06);
    border:1px solid var(--border);
    color:white;
    width:36px;
    height:36px;
    border-radius:12px;
    font-size:24px;
    cursor:pointer;
}

label{
    display:block;
    color:#B7C1D4;
    margin:14px 0 7px;
    font-size:14px;
}

input{
    width:100%;
    background:var(--input-bg);
    color:var(--text);
    border:1px solid rgba(255,255,255,0.09);
    padding:13px 14px;
    border-radius:14px;
    outline:none;
}

input:focus{
    border-color:var(--accent);
    box-shadow:0 0 0 3px var(--accent-soft);
}

.clickable-project{
    cursor:pointer;
    transition:0.18s ease;
}

.clickable-project:hover{
    transform:translateY(-2px);
    border-color:rgba(59,130,246,0.35);
}

.back-btn{
    background:rgba(255,255,255,0.06);
    color:#DCE4F2;
    border:1px solid var(--border);
    padding:10px 14px;
    border-radius:12px;
    cursor:pointer;
    margin-bottom:24px;
}

.back-btn:hover{
    background:rgba(255,255,255,0.1);
}

.project-detail-grid{
    display:grid;
    grid-template-columns:1fr;
    gap:20px;
}

.project-mini-grid{
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:20px;
}

.project-info-card{
    padding:22px;
    min-height:150px;
}

.project-info-card p{
    margin-top:12px;
}

.project-info-card strong{
    display:block;
    font-size:28px;
    margin-top:8px;
}

.project-tabs{
    display:flex;
    gap:10px;
    margin-bottom:18px;
}

.project-tab{
    background:rgba(255,255,255,0.06);
    color:#DCE4F2;
    border:1px solid var(--border);
    padding:10px 16px;
    border-radius:12px;
    cursor:pointer;
    font-size:14px;
}

.project-tab.active{
    background:var(--accent-soft);
    border-color:var(--accent);
}

.documents-panel{
    padding:24px;
}

.drop-zone{
    margin-top:16px;
    padding:34px;
    border:1px dashed rgba(255,255,255,0.22);
    border-radius:20px;
    text-align:center;
    cursor:pointer;
    background:rgba(255,255,255,0.04);
    transition:0.18s ease;
}

.drop-zone:hover,
.drop-zone.drag-over{
    border-color:rgba(59,130,246,0.7);
    background:rgba(59,130,246,0.12);
}

.drop-zone p{
    margin-top:6px;
}

.documents-list{
    margin-top:18px;
    display:grid;
    gap:12px;
}

.document-item{
    display:flex;
    align-items:center;
    gap:12px;
    padding:14px 16px;
    border-radius:14px;
    background:rgba(255,255,255,0.055);
    border:1px solid rgba(255,255,255,0.07);
}

.document-item span{
    font-size:22px;
}

.document-item p{
    font-size:13px;
    margin-top:3px;
}

.settings-card{
    padding:28px;
}

.settings-card h2{
    margin-bottom:16px;
    margin-top:10px;
}

.shortcut-list{
    display:grid;
    gap:10px;
    margin-bottom:25px;
}

.shortcut-row{
    display:flex;
    justify-content:space-between;
    align-items:center;
    padding:12px 14px;
    border-radius:12px;
    background:rgba(255,255,255,0.04);
}

kbd{
    background:rgba(255,255,255,0.08);
    border:1px solid rgba(255,255,255,0.1);
    padding:6px 10px;
    border-radius:8px;
    color:white;
    font-size:13px;
}

.settings-card hr{
    margin:25px 0;
    border:none;
    border-top:1px solid rgba(255,255,255,0.08);
}

.settings-list{
    display:grid;
    gap:16px;
}

.settings-accordion{
    padding:0;
    overflow:hidden;
}

.settings-accordion summary{
    list-style:none;
    cursor:pointer;
    padding:20px 24px;
    font-size:18px;
    font-weight:700;
    display:flex;
    justify-content:space-between;
    align-items:center;
}

.settings-accordion summary::-webkit-details-marker{
    display:none;
}

.settings-accordion summary::after{
    content:"+";
    color:var(--muted);
    font-size:22px;
}

.settings-accordion[open] summary::after{
    content:"−";
}

.settings-accordion > *:not(summary){
    padding:0 24px 24px;
}

.system-info{
    display:grid;
    gap:8px;
}

.project-panel{
    display:none;
}

.project-panel.active{
    display:block;
}

.panel-header{
    display:flex;
    align-items:flex-start;
    justify-content:space-between;
    gap:20px;
}

.large-modal{
    width:720px;
    max-height:88vh;
    overflow:auto;
}

.secondary-btn{
    background:rgba(255,255,255,0.06);
    color:#DCE4F2;
    border:1px solid var(--border);
    padding:10px 14px;
    border-radius:12px;
    cursor:pointer;
}

.positions-header{
    display:flex;
    justify-content:space-between;
    align-items:center;
    margin:22px 0 12px;
}

.position-row{
    display:grid;
    grid-template-columns:1fr 1fr auto;
    gap:10px;
    margin-bottom:10px;
}

.remove-position{
    background:rgba(255,255,255,0.06);
    color:white;
    border:1px solid var(--border);
    border-radius:12px;
    padding:0 14px;
    cursor:pointer;
}

.order-card{
    padding:16px;
    border-radius:16px;
    background:rgba(255,255,255,0.055);
    border:1px solid rgba(255,255,255,0.07);
}

.order-card h4{
    margin-bottom:6px;
}

.order-positions{
    margin-top:10px;
    color:var(--muted);
    font-size:14px;
}

.progress-wrapper{
    margin-top:18px;
}

.progress-header{
    display:flex;
    justify-content:space-between;
    color:var(--muted);
    font-size:14px;
    margin-bottom:8px;
}

.progress-bar{
    height:10px;
    background:rgba(255,255,255,0.08);
    border-radius:999px;
    overflow:hidden;
}

.progress-fill{
    height:100%;
    width:0%;
    background:linear-gradient(135deg, #3B82F6, #22C55E);
    border-radius:999px;
    transition:width 0.25s ease;
}

.project-stats-row{
    display:grid;
    grid-template-columns:repeat(3, 1fr);
    gap:40px;
    margin-top:20px;
    margin-bottom:25px;
}

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

.project-stat span{
    color:var(--muted);
    font-size:15px;
    margin-bottom:8px;
}

.project-stat strong{
    font-size:22px;
    font-weight:700;
}

.project-title-row{
    display:flex;
    align-items:center;
    gap:16px;
    margin-bottom:10px;
}

.edit-project-btn{
    width:48px;
    height:48px;
    border:none;
    border-radius:14px;
    background:rgba(255,255,255,0.05);
    border:1px solid rgba(255,255,255,0.08);
    color:white;
    font-size:20px;
    cursor:pointer;
    transition:all .2s ease;
}

.edit-project-btn:hover{
    background:rgba(59,130,246,.15);
    border-color:#3B82F6;
}

.modal-header{
    display:flex;
    justify-content:space-between;
    align-items:center;
    margin-bottom:20px;
}

.modal-close-btn{
    width:40px;
    height:40px;
    border:none;
    border-radius:12px;
    cursor:pointer;
    background:rgba(255,255,255,0.05);
    border:1px solid rgba(255,255,255,0.08);
    color:white;
    font-size:24px;
    transition:.2s;
}

.modal-close-btn:hover{
    background:rgba(239,68,68,.15);
    border-color:#ef4444;
}

.order-header{
    display:flex;
    justify-content:space-between;
    align-items:center;
    margin-bottom:10px;
}

.edit-order-btn{
    width:36px;
    height:36px;
    border:none;
    border-radius:10px;
    cursor:pointer;
    background:rgba(255,255,255,0.05);
    color:white;
}

.edit-order-btn:hover{
    background:rgba(59,130,246,.15);
}

.delivery-actions{
    display:flex;
    gap:10px;
    margin-top:14px;
}

.danger-btn{
    border-color:rgba(239,68,68,.45);
    color:#fca5a5;
}

.danger-btn:hover{
    background:rgba(239,68,68,.15);
}

.validated-pill{
    display:inline-flex;
    margin-top:14px;
    padding:10px 16px;
    border-radius:12px;
    background:rgba(34,197,94,.12);
    border:1px solid rgba(34,197,94,.35);
    color:#86efac;
    font-weight:600;
}

.positions-list{
    margin-bottom:12px;
    line-height:1.6;
}

.search-input{
    width:100%;
    margin-bottom:18px;
    padding:14px 16px;
    border-radius:14px;
    border:1px solid var(--border);
    background:var(--input-bg);
    color:var(--text);
    outline:none;
}

.search-input::placeholder{
    color:var(--muted);
}

.tracking-tabs{
    display:flex;
    gap:10px;
    margin-bottom:18px;
}

.tracking-tab{
    padding:12px 18px;
    border-radius:14px;
    border:1px solid var(--border);
    background:rgba(255,255,255,0.06);
    color:white;
    cursor:pointer;
    font-weight:600;
}

.tracking-tab.active{
    background:var(--accent-soft);
    border-color:var(--accent);
    color:white;
}

.tracking-content{
    animation:fadeIn .2s ease;
}

.tracking-empty{
    padding:24px;
    border-radius:16px;
    border:1px dashed var(--border);
    color:var(--muted);
    background:rgba(255,255,255,0.03);
}

.tracking-list{
    display:flex;
    flex-direction:column;
    gap:14px;
}

.tracking-card{
    padding:18px;
    border-radius:18px;
}

.tracking-card-header{
    display:flex;
    justify-content:space-between;
    align-items:center;
    gap:16px;
    margin-bottom:12px;
}

.tracking-card-header h3{
    margin:0;
}

.tracking-badge{
    padding:8px 12px;
    border-radius:999px;
    font-size:13px;
    font-weight:700;
}

.tracking-batch{
    background:rgba(234,179,8,.12);
    border:1px solid rgba(234,179,8,.35);
    color:#fde68a;
}

.tracking-card-footer{
    display:flex;
    justify-content:space-between;
    align-items:center;
    gap:16px;
    margin-top:16px;
}

.tracking-ticket{
    background:rgba(249,115,22,.12);
    border:1px solid rgba(249,115,22,.35);
    color:#fdba74;
}

.tracking-response{
    background:rgba(59,130,246,.12);
    border:1px solid rgba(59,130,246,.35);
    color:#93c5fd;
}

.tracking-confirmation{
    background:rgba(168,85,247,.12);
    border:1px solid rgba(168,85,247,.35);
    color:#d8b4fe;
}

.panel-actions{
    display:flex;
    gap:10px;
    align-items:center;
}

.tracking-menu-btn{
    width:42px;
    height:42px;
    border-radius:14px;
    border:1px solid var(--border);
    background:rgba(255,255,255,0.06);
    color:white;
    cursor:pointer;
    font-size:22px;
}

.tracking-menu{
    position:absolute;
    right:0;
    bottom:52px;
    min-width:150px;
    padding:8px;
    border-radius:14px;
    border:1px solid var(--border);
    background:#151b28;
    box-shadow:0 20px 40px rgba(0,0,0,.35);
    z-index:50;
}

.tracking-menu button{
    width:100%;
    padding:10px 14px;
    border:none;
    background:none;
    color:#ffffff;
    text-align:left;
    cursor:pointer;
    transition:.2s;
}

.tracking-menu button:hover{
    background:rgba(255,255,255,.08);
}

.tracking-menu button.danger{
    color:#ef4444;
}

.tracking-menu button.danger:hover{
    background:rgba(239,68,68,.12);
}

.panel-actions{
    position:relative;
}

.tracking-archived{
    background:rgba(148,163,184,.12);
    border:1px solid rgba(148,163,184,.35);
    color:#cbd5e1;
}

.modal label{
    display:block;
    margin-top:18px;
    margin-bottom:8px;

    font-weight:600;
}

.modal textarea{
    width:100%;
    min-height:90px;
    resize:vertical;
    background:var(--input-bg);
    border:1px solid rgba(255,255,255,.08);
    border-radius:18px;
    padding:18px 20px;
    color:var(--text);
    font-size:15px;
    font-family:inherit;
    outline:none;
    box-sizing:border-box;
}

.modal textarea::placeholder{
    color:#7f8798;
}

.modal textarea:focus{
    border-color:#5b7cff;
    box-shadow:0 0 0 3px rgba(91,124,255,.15);
}

.my-day-section{
    margin-bottom:26px;
}

.my-day-header{
    margin-bottom:14px;
}

.my-day-header h2{
    margin:0;
}

.my-day-header p{
    color:var(--muted);
    margin-top:6px;
}

.my-day-grid{
    display:grid;
    grid-template-columns:repeat(auto-fit,minmax(280px,1fr));
    gap:16px;
}

.my-day-card{
    padding:22px;
    border-radius:22px;
    cursor:pointer;
    transition:.2s;
}

.my-day-card:hover{
    transform:translateY(-2px);
}

.my-day-card h3{
    margin-top:0;
}

.my-day-card p{
    color:var(--muted);
}

.my-day-card span{
    display:block;
    margin-top:14px;
    color:#93c5fd;
    font-weight:700;
}

.my-day-card.success{
    cursor:default;
}

.urgency-yellow{
    border-color:rgba(234,179,8,.35);
}

.urgency-orange{
    border-color:rgba(249,115,22,.35);
}

.urgency-red{
    border-color:rgba(239,68,68,.45);
}

.folder-tree{
    margin-top:18px;
    display:flex;
    flex-direction:column;
    gap:8px;
}

.folder-color-dot{
    width:12px;
    height:12px;
    border-radius:999px;
    display:inline-block;
    margin-right:8px;
}

.folder-color-picker{
    display:flex;
    flex-wrap:wrap;
    gap:10px;
    margin-bottom:18px;
}

.folder-color-choice{
    width:34px;
    height:34px;
    border-radius:999px;
    border:2px solid rgba(255,255,255,.25);
    cursor:pointer;
}

.folder-color-choice.active{
    outline:3px solid rgba(96,132,255,.85);
    outline-offset:3px;
}

.folder-color-dot.empty{
    background:transparent;
    border:1px solid rgba(255,255,255,.25);
}

.folder-color-choice.no-color{
    color:#fff;
    display:flex;
    align-items:center;
    justify-content:center;
    background:rgba(255,255,255,.06) !important;
}

.folder-node{
    position:relative;
    display:flex;
    flex-direction:column;
    gap:6px;
}

.folder-row{
    position:relative;
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:12px;
    padding:10px 12px;
    border-radius:14px;
    background:rgba(255,255,255,.04);
}

.folder-node .folder-node{
    border-left:1px solid rgba(255,255,255,.12);
    padding-left:14px;
    margin-top:6px;
}

.folder-row > div:first-child{
    display:flex;
    align-items:center;
    gap:8px;
}

.folder-select-results{
    position:absolute;
    top:calc(100% + 8px);
    left:0;
    right:0;

    z-index:100;

    display:flex;
    flex-direction:column;
    gap:6px;

    border-radius:14px;
    background:rgba(31,35,44,.98);
    border:1px solid rgba(255,255,255,.08);
    box-shadow:0 24px 60px rgba(0,0,0,.45);

    max-height:260px;
    overflow-y:auto;
    overflow-x:hidden;
}

.folder-select-results::-webkit-scrollbar{
    width:8px;
}

.folder-select-results::-webkit-scrollbar-track{
    background:transparent;
}

.folder-select-results::-webkit-scrollbar-thumb{
    background:#4b5563;
    border-radius:999px;
}

.folder-select-results::-webkit-scrollbar-thumb:hover{
    background:#6b7280;
}

.folder-select-item{
    display:flex;
    align-items:center;
    gap:24px;

    width:100%;
    padding:12px 16px;

    border:none;
    border-bottom:1px solid rgba(255,255,255,.06);

    background:none;
    color:white;

    text-align:left;
    cursor:pointer;
}

.folder-select-item:last-child{
    border-bottom:none;
}

.folder-select-item:hover{
    background:rgba(255,255,255,.08);
}

.folder-result-left{
    display:flex;
    align-items:center;
    gap:10px;
    min-width:220px;
}

.folder-parent{
    color:#9ca3af;
    font-size:.9rem;
}

.folder-parent em{
    color:#b8bec9;
    font-style:italic;
}

.folder-select-empty{
    padding:12px 16px;
    color:#8b8b8b;
}

.todo-row{
    padding:0;
    cursor:pointer;
    border-radius:18px;
}

.todo-row:hover{
    border-color:rgba(59,130,246,.35);
    background:rgba(255,255,255,.04);
}

.todo-main{
    display:grid;
    grid-template-columns:48px 1.8fr 1.2fr 150px 52px;
    align-items:center;
    gap:12px;
    min-height:64px;
    padding:0 16px;
}

.todo-complete-btn{
    width:24px;
    height:24px;
    border-radius:999px;
    border:1px solid rgba(255,255,255,.28);
    background:transparent;
    color:transparent;
    cursor:pointer;
    font-weight:800;
    display:flex;
    align-items:center;
    justify-content:center;
    transition:.15s ease;
}

.todo-complete-btn:hover{
    border-color:#86efac;
    background:rgba(34,197,94,.10);
    color:#86efac;
}

.todo-title{
    font-weight:700;
    color:white;
}

.todo-folder{
    display:flex;
    align-items:center;
    gap:8px;
    color:#cbd5e1;
}

.todo-date{
    color:#9ca3af;
    text-align:right;
}

.todo-details-content{
    display:grid;
    gap:16px;
    margin-top:18px;
}

.todo-detail-block{
    padding:16px;
    border-radius:16px;
    background:rgba(255,255,255,.04);
    border:1px solid rgba(255,255,255,.06);
}

.todo-detail-label{
    color:#9ca3af;
    font-size:.9rem;
    margin-bottom:8px;
}

.todo-detail-value{
    color:white;
    font-weight:600;
}

.todo-detail-note{
    color:#d1d5db;
    line-height:1.5;
    white-space:pre-wrap;
}

.todo-details-actions{
    display:flex;
    justify-content:flex-end;
    gap:10px;
    margin-top:18px;
}

.todo-details-actions button{
    min-width:140px;
}

.delete-action-btn{
    color:#ef4444;
}

.delete-action-btn:hover{
    color:#f87171;
}

.folder-detail-display{
    display:flex;
    align-items:center;
    gap:10px;
}

.todo-date-late{
    color:#ef4444;
    font-weight:600;
}

.todo-date-today{
    color:#22c55e;
    font-weight:600;
}

.todo-date-tomorrow{
    color:#f59e0b;
    font-weight:600;
}

.todo-date-future{
    color:#d1d5db;
}

.todo-date-none{
    color:#9ca3af;
}

.folder-search-wrapper{
    position:relative;
}

.folder-select-box{
    position:relative;
}

.folder-search-wrapper input{
    padding-right:52px;
}

.folder-dropdown-btn{
    position:absolute;
    right:14px;
    top:50%;

    width:34px;
    height:34px;

    transform:translateY(-50%);

    display:flex;
    align-items:center;
    justify-content:center;

    border:none;
    background:transparent;
    cursor:pointer;
}

.folder-dropdown-btn::before{
    content:"";
    width:10px;
    height:10px;

    border-right:3px solid #e5e7eb;
    border-bottom:3px solid #e5e7eb;

    transform:rotate(45deg);
    transition:transform .2s ease;
}

.folder-dropdown-btn.open::before{
    transform:rotate(225deg);
}

.folder-dropdown-btn:hover::before{
    border-color:white;
}

.folder-dropdown-btn:hover{
    color:white;
}

/* Icône calendrier visible */
input[type="date"]::-webkit-calendar-picker-indicator{
    filter:invert(1);
    opacity:.75;
    cursor:pointer;
}

input[type="date"]::-webkit-calendar-picker-indicator:hover{
    opacity:1;
}

.sidebar-section-toggle{
    width:100%;
    margin:10px 0 8px;
    padding:10px 12px;

    border:0;
    background:transparent;
    color:#9CA7BA;

    display:flex;
    align-items:center;
    justify-content:space-between;

    cursor:pointer;
    text-transform:uppercase;
    letter-spacing:1px;
    font-size:11px;
}

.sidebar-section-toggle:hover{
    color:white;
}

.sidebar-section-arrow{
    font-size:18px;
    font-weight:700;
    line-height:1;

    transition:transform .2s ease;
}

.sidebar-section-toggle.collapsed .sidebar-section-arrow{
    transform:rotate(-90deg);
}

.sidebar-section-content{
    display:grid;
    gap:2px;
    overflow:hidden;
}

.sidebar-section-content.collapsed{
    display:none;
}

.sidebar-separator{
    height:1px;
    background:rgba(255,255,255,.08);
    margin:18px 0;
}

.sidebar-bottom{
    margin-top:auto;
}

.week-widget{
    padding:24px;
    margin-bottom:26px;
}

.week-widget-days{
    display:grid;
    grid-template-columns:repeat(7, 1fr);
    gap:12px;
}

.week-day-card{
    padding:14px;
    border-radius:16px;
    background:rgba(255,255,255,.04);
    border:1px solid rgba(255,255,255,.06);
    min-height:120px;
}

.week-day-card.today{
    border-color:rgba(59,130,246,.55);
    background:rgba(59,130,246,.10);
}

.week-day-name{
    font-weight:700;
    color:white;
    margin-bottom:4px;
}

.week-day-date{
    color:#9ca3af;
    font-size:.9rem;
    margin-bottom:12px;
}

.week-day-empty{
    color:#6b7280;
    font-size:.85rem;
}

.dashboard-widget{
    padding:24px;
    margin-bottom:26px;
    width:100%;
}

.dashboard-urgencies{
    display:grid;
    grid-template-columns:repeat(auto-fit, minmax(240px,1fr));
    gap:12px;
}

.urgency-item{
    padding:14px 16px;
    border-radius:16px;
    background:rgba(239,68,68,.08);
    border:1px solid rgba(239,68,68,.22);
}

.urgency-item-title{
    color:white;
    font-weight:700;
    margin-bottom:4px;
}

.urgency-item-meta{
    color:#fca5a5;
    font-size:.9rem;
}

.workspace-switch{
    display:flex;
    gap:8px;
    margin:18px 0 16px;
}

.workspace-btn{
    flex:1;
    border:none;
    border-radius:12px;
    padding:10px 12px;
    cursor:pointer;

    background:rgba(255,255,255,.05);
    color:#cbd5e1;

    transition:.2s;
}

.workspace-btn:hover{
    background:rgba(255,255,255,.10);
}

.workspace-btn.active{
    background:linear-gradient(135deg,var(--accent-dark),var(--accent));
    color:white;
}

.vacation-summary-grid{
    display:grid;
    grid-template-columns:repeat(auto-fit, minmax(180px, 1fr));
    gap:14px;
    margin:22px 0;
}

.vacation-summary-card{
    padding:18px;
    border-radius:18px;
    background:rgba(255,255,255,.045);
    border:1px solid rgba(255,255,255,.06);
}

.vacation-summary-card span{
    display:block;
    color:var(--muted);
    font-size:14px;
    margin-bottom:8px;
}

.vacation-summary-card strong{
    font-size:22px;
    color:white;
}

.vacation-days-list{
    display:flex;
    flex-direction:column;
    gap:18px;
    margin-top:24px;
}

.vacation-day-card{
    display:block;
    padding:16px 18px;
    border-radius:18px;
    background:rgba(255,255,255,.04);
    border:1px solid rgba(255,255,255,.06);
    cursor:pointer;
}

.vacation-positive{
    color:#4ade80;
    font-weight:800;
}

.vacation-negative{
    color:#f87171;
    font-weight:800;
}

.danger-btn{
    background:#3a1f1f;
    color:#ffb4b4;
    border:1px solid rgba(255,0,0,.25);
}

.danger-btn:hover{
    background:#4b2525;
}

.vacation-summary-card.highlight-total{
    border-color:rgba(255,255,255,.14);
}

.vacation-summary-card.highlight-reserved{
    border-color:rgba(251,191,36,.35);
    background:rgba(251,191,36,.08);
}

.vacation-summary-card.highlight-distributable{
    border-color:rgba(34,197,94,.35);
    background:rgba(34,197,94,.08);
}

.vacation-summary-card.highlight-remaining{
    border-color:rgba(59,130,246,.35);
    background:rgba(59,130,246,.08);
}

body.personal-theme .vacation-summary-card.highlight-remaining{
    border-color:rgba(34,197,94,.35);
    background:rgba(34,197,94,.08);
}

.vacation-summary-card.highlight-spent{
    border-color:rgba(248,113,113,.35);
    background:rgba(248,113,113,.08);
}

.vacation-summary-card.highlight-reserve{
    border-color:rgba(74,222,128,.35);
    background:rgba(74,222,128,.08);
}

select{
    width:100%;
    background:var(--input-bg);
    color:var(--text);
    border:1px solid rgba(255,255,255,0.09);
    padding:13px 14px;
    border-radius:14px;
    outline:none;
}

select:focus{
    border-color:var(--accent);
    box-shadow:0 0 0 3px var(--accent-soft);
}

.vacation-main-summary{
    display:grid;
    grid-template-columns:360px 1fr;
    gap:28px;
    align-items:stretch;
    margin:28px 0;
}

.vacation-ring-card{
    min-height:360px;

    display:flex;
    justify-content:center;
    align-items:center;

    padding:26px;

    border-radius:24px;
    background:rgba(255,255,255,.045);
    border:1px solid rgba(255,255,255,.07);
}

.vacation-ring{
    width:230px;
    height:230px;
}

.vacation-key-stats{
    display:grid;
    grid-template-columns:repeat(2, minmax(220px,1fr));
    gap:14px;
}

.vacation-secondary-stats{
    display:grid;
    grid-template-columns:repeat(3, minmax(180px,1fr));
    gap:14px;
    margin-bottom:24px;
}

.vacation-days-list{
    display:flex;
    flex-direction:column;
    gap:18px;
    margin-top:24px;
}

.vacation-ring-card{
    display:flex;
    justify-content:center;
    align-items:center;
    padding:22px;
    border-radius:22px;
    background:rgba(255,255,255,.045);
    border:1px solid rgba(255,255,255,.06);
}

.vacation-ring{
    width:190px;
    height:190px;
}

.vacation-ring-bg{
    fill:none;
    stroke:rgba(255,255,255,.08);
    stroke-width:14;
}

.vacation-ring-progress{
    fill:none;
    stroke:var(--accent);
    stroke-width:14;
    stroke-linecap:round;
    transform:rotate(-90deg);
    transform-origin:50% 50%;
    transition:stroke-dashoffset .35s ease;
}

.vacation-ring-text{
    fill:white;
    font-size:18px;
    font-weight:800;
    text-anchor:middle;
}

.vacation-ring-subtext{
    fill:var(--muted);
    font-size:12px;
    text-anchor:middle;
}

.vacation-ring-percent{
    fill:var(--accent-light);
    font-size:13px;
    font-weight:700;
    text-anchor:middle;
}

.vacation-expense-day-indicator{
    padding:14px 16px;
    border-radius:16px;
    background:var(--accent-soft);
    border:1px solid var(--accent);
    color:white;
    font-weight:700;
    margin-bottom:16px;
}

.vacation-day-progress{
    width:100%;
    height:6px;
    background:rgba(255,255,255,.06);
    border-radius:999px;
    overflow:hidden;
    margin-top:12px;
}

.vacation-day-progress-bar{
    height:100%;
    border-radius:999px;
    transition:.3s;
    background:linear-gradient(90deg,#22c55e,#4ade80);
}

.vacation-day-progress-bar.warning{
    background:linear-gradient(90deg,#f59e0b,#fbbf24);
}

.vacation-day-progress-bar.danger{
    background:linear-gradient(90deg,#ef4444,#f87171);
}

.vacation-day-header{
    display:flex;
    justify-content:space-between;
    align-items:flex-start;
}

.vacation-day-budget{
    margin-top:10px;
    margin-bottom:12px;
}

.vacation-day-card.today{
    border:2px solid var(--accent);
    box-shadow:0 0 18px rgba(59,130,246,.18);
}

.vacation-ring-progress.warning{
    stroke:#f59e0b;
}

.vacation-ring-progress.danger{
    stroke:#ef4444;
}

.vacation-ring-progress.warning ~ .vacation-ring-percent{
    fill:#fbbf24;
}

.vacation-ring-progress.danger ~ .vacation-ring-percent{
    fill:#f87171;
}

@media (max-width:900px){

    .vacation-main-summary{
        display:flex;
        flex-direction:column;
        gap:18px;
    }

    .vacation-key-stats{
        grid-template-columns:repeat(2,1fr);
    }

}

.panel-actions{
    flex-wrap:nowrap;
    justify-content:flex-end;
}

.panel-actions button{
    white-space:nowrap;
}

.vacation-ring{

    width:240px;
    height:240px;

}

.vacation-day-card{

    padding:16px;

}

.mobile-menu-btn,
.mobile-overlay,
.mobile-fab,
.mobile-actions-btn{
    display:none;
}

@media (max-width:900px){

    .mobile-menu-btn{
        display:flex;
        position:fixed;
        top:16px;
        left:16px;
        z-index:1001;
        width:44px;
        height:44px;
        border-radius:14px;
        align-items:center;
        justify-content:center;
        background:rgba(255,255,255,.08);
        border:1px solid rgba(255,255,255,.12);
        color:white;
        font-size:22px;
    }

    .sidebar{
        position:fixed;
        left:-290px;
        top:0;
        height:100vh;
        z-index:1000;
        transition:left .25s ease;
    }

    body.sidebar-open .sidebar{
        left:0;
    }

    .mobile-overlay{
        display:none;
        position:fixed;
        inset:0;
        background:rgba(0,0,0,.55);
        z-index:999;
    }

    body.sidebar-open .mobile-overlay{
        display:block;
    }

    .content{
        margin-left:0;
        width:100%;
        padding:80px 18px 90px;
    }

    .vacation-main-summary{
        display:flex;
        flex-direction:column;
        gap:18px;
    }

    .vacation-key-stats{
        grid-template-columns:repeat(2,1fr);
    }

    .panel-actions{
        display:none;
    }

    .mobile-actions-btn{
        display:flex;
        width:42px;
        height:42px;
        border-radius:14px;
        justify-content:center;
        align-items:center;
        background:rgba(255,255,255,.08);
        border:1px solid rgba(255,255,255,.08);
        color:white;
        font-size:26px;
        cursor:pointer;
    }

    .mobile-fab{
        font-family:Arial, sans-serif;

        display:none;

        position:fixed;
        right:18px;
        bottom:18px;

        width:64px;
        height:64px;

        border:none;
        border-radius:50%;

        align-items:center;
        justify-content:center;

        padding:0;

        background:var(--accent);
        color:white;

        font-size:42px;
        font-weight:300;
        line-height:1;

        z-index:1000;

        box-shadow:
            0 10px 35px rgba(34,197,94,.45);
    }

    body:not(.vacation-budget-open) .mobile-fab{
        display:none !important;
    }

    body.vacation-budget-open .mobile-fab{
        display:flex !important;
    }

    .vacation-ring{
        width:240px;
        height:240px;
    }

    .vacation-day-card{
        padding:16px;
    }
}

@media (max-width:900px){

    .modal-box{

        width:95vw;
        max-width:95vw;

        max-height:85vh;

        overflow-y:auto;

        padding:22px;

    }

    .modal-box input,
    .modal-box textarea,
    .modal-box select{

        min-height:48px;

        font-size:16px;

    }

    .modal-box button{

        min-height:48px;

    }

    .vacation-day-card{

        border-radius:18px;

    }

    .modal{
        align-items:flex-start;
        padding-top:32px;
        padding-bottom:32px;
        overflow-y:auto;
    }

    .modal-box{
        margin-bottom:120px;
    }

}

.login-body{
    min-height:100vh;
    display:flex;
    align-items:center;
    justify-content:center;
    padding:24px;
}

.login-card{
    width:420px;
    max-width:100%;
    padding:32px;
}

/* =========================================================
   SIDEBAR COMPACTE AU SURVOL - DESKTOP
========================================================= */

@media (min-width:901px){

    .sidebar{
        width:82px;
        padding-left:20px;
        padding-right:20px;
        flex-shrink:0;
        transition:
            width .22s ease,
            padding .22s ease;
    }

    .sidebar:hover{
        width:290px;
        padding-left:22px;
        padding-right:22px;
    }

    .sidebar .sidebar-text,
    .sidebar .nav-label,
    .sidebar .nav span:not(.icon){
        opacity:0;
        visibility:hidden;
        width:0;
        overflow:hidden;
        white-space:nowrap;
        transition:opacity .12s ease;
    }

    .sidebar:hover .sidebar-text,
    .sidebar:hover .nav-label,
    .sidebar:hover .nav span:not(.icon){
        opacity:1;
        visibility:visible;
        width:auto;
        overflow:visible;
    }

    .sidebar .brand{
        justify-content:center;
    }

    .sidebar:hover .brand{
        justify-content:flex-start;
    }

    .sidebar .nav{
        justify-content:center;
        padding-left:0;
        padding-right:0;
    }

    .sidebar:hover .nav{
        justify-content:flex-start;
        padding-left:14px;
        padding-right:14px;
    }

    .sidebar .icon{
        flex-shrink:0;
    }

    .sidebar .workspace-switch{
        flex-direction:column;
    }

    .sidebar:hover .workspace-switch{
        flex-direction:row;
    }

    .sidebar .workspace-btn{
        min-width:52px;
        padding-left:0;
        padding-right:0;
        font-size:0;
    }

    .sidebar #workspacePro::before{
        content:"💼";
        font-size:18px;
    }

    .sidebar #workspacePersonal::before{
        content:"🏠";
        font-size:18px;
    }

    .sidebar:hover .workspace-btn{
        font-size:14px;
        padding-left:12px;
        padding-right:12px;
    }

    .sidebar:hover #workspacePro::before,
    .sidebar:hover #workspacePersonal::before{
        display:none;
    }

    .sidebar::after{
    content:"BARRE LATÉRALE";

    position:absolute;
    top:50%;
    left:50%;

    transform:
        translate(-50%, -50%)
        rotate(-90deg);

    color:var(--muted);
    font-size:11px;
    font-weight:700;
    letter-spacing:3px;
    white-space:nowrap;

    opacity:.7;
    transition:opacity .15s ease;
    pointer-events:none;
    }

    .sidebar:hover::after{
        opacity:0;
    }

    .sidebar:not(:hover) .nav-group,
    .sidebar:not(:hover) .sidebar-bottom{
        opacity:0;
        visibility:hidden;
        pointer-events:none;
    }

    .sidebar:hover .nav-group,
    .sidebar:hover .sidebar-bottom{
        opacity:1;
        visibility:visible;
        pointer-events:auto;
        transition:opacity .15s ease .08s;
    }

    .sidebar .brand-icon{
        width:58px;
        height:58px;
        min-width:58px;
        min-height:58px;
        flex:0 0 58px;
    }

    .sidebar .brand-logo-image{
        width:58px;
        height:58px;
    }
}

.vacation-warning{
    color:#f59e0b;
    font-weight:800;
}

.vacation-reserve-used{
    margin-top:6px;
    color:#f59e0b;
    font-size:13px;
    font-weight:700;
}

.brand-logo-image{
    width:100%;
    height:100%;
    object-fit:cover;
    display:block;
    border-radius:inherit;
}

.brand-icon{
    overflow:hidden;
}

.personal-today-card{
    padding:28px;
    cursor:pointer;
    transition:
        transform .18s ease,
        border-color .18s ease,
        background .18s ease;
}

.personal-today-card:hover{
    transform:translateY(-2px);
    border-color:var(--accent);
    background:rgba(255,255,255,.065);
}

.personal-today-header{
    display:flex;
    align-items:flex-start;
    justify-content:space-between;
    gap:20px;
}

.personal-today-header h2{
    margin-top:4px;
}

.personal-today-arrow{
    width:44px;
    height:44px;

    display:flex;
    align-items:center;
    justify-content:center;

    border-radius:14px;
    background:var(--accent-soft);
    color:var(--accent-light);

    font-size:24px;
    font-weight:700;
}

.personal-today-stats{
    display:grid;
    grid-template-columns:repeat(2, 1fr);
    gap:14px;
    margin-top:24px;
}

.personal-today-stats div{
    padding:18px;
    border-radius:18px;
    background:rgba(255,255,255,.045);
    border:1px solid rgba(255,255,255,.06);
}

.personal-today-stats span{
    display:block;
    color:var(--muted);
    font-size:14px;
    margin-bottom:8px;
}

.personal-today-stats strong{
    font-size:22px;
}

@media (max-width:900px){

    .personal-today-stats{
        grid-template-columns:1fr;
    }

}

.personal-today-progress{
    margin-top:20px;
}

.personal-today-progress-header{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:16px;
    margin-bottom:10px;
    color:var(--muted);
    font-size:14px;
}

.personal-today-progress-header strong{
    color:white;
}

.personal-today-progress-track{
    width:100%;
    height:10px;
    overflow:hidden;
    border-radius:999px;
    background:rgba(255,255,255,.08);
}

.personal-today-progress-bar{
    height:100%;
    border-radius:999px;
    background:linear-gradient(90deg,#22c55e,#4ade80);
    transition:width .3s ease;
}

.personal-today-progress-bar.warning{
    background:linear-gradient(90deg,#f59e0b,#fbbf24);
}

.personal-today-progress-bar.danger{
    background:linear-gradient(90deg,#ef4444,#f87171);
}

.reserved-costs-scroll{
    max-height:45vh;
    overflow-y:auto;
    margin-bottom:22px;
    padding-right:6px;
}

.reserved-costs-scroll::-webkit-scrollbar{
    width:8px;
}

.reserved-costs-scroll::-webkit-scrollbar-thumb{
    background:rgba(255,255,255,.18);
    border-radius:999px;
}

.reserved-costs-scroll::-webkit-scrollbar-thumb:hover{
    background:rgba(255,255,255,.28);
}

/* =========================================================
   SUIVI COMMANDES - KANBAN
========================================================= */

.tracking-orders-toolbar{
    display:grid;
    grid-template-columns:minmax(280px, 1fr) auto;
    align-items:center;
    gap:18px;
    margin-bottom:20px;
}

.tracking-orders-toolbar .search-input{
    margin-bottom:0;
}

.tracking-orders-actions{
    display:flex;
    align-items:center;
    justify-content:flex-end;
    gap:10px;
}

.tracking-kanban{
    display:grid;
    grid-template-columns:repeat(4, minmax(240px, 1fr));
    gap:18px;
    align-items:start;
}

.tracking-kanban-column{
    min-width:0;
    padding:0;
    overflow:hidden;
    border-radius:22px;
}

.tracking-kanban-column-header{
    position:relative;
    display:flex;
    align-items:flex-start;
    justify-content:space-between;
    gap:14px;
    padding:20px 20px 18px;
    border-bottom:1px solid rgba(255,255,255,.07);
}

.tracking-kanban-column-header::before{
    content:"";
    position:absolute;
    top:0;
    left:0;
    right:0;
    height:4px;
}

.tracking-kanban-column.batch .tracking-kanban-column-header::before{
    background:#eab308;
}

.tracking-kanban-column.ticket .tracking-kanban-column-header::before{
    background:#f97316;
}

.tracking-kanban-column.response .tracking-kanban-column-header::before{
    background:#3b82f6;
}

.tracking-kanban-column.confirmation .tracking-kanban-column-header::before{
    background:#a855f7;
}

.tracking-kanban-column.archive .tracking-kanban-column-header::before{
    background:#94a3b8;
}

.tracking-kanban-column-title{
    display:flex;
    align-items:center;
    gap:10px;
    min-width:0;
}

.tracking-kanban-column-title h3{
    margin:0;
    font-size:16px;
    line-height:1.3;
}

.tracking-kanban-dot{
    width:10px;
    height:10px;
    flex:0 0 10px;
    border-radius:999px;
}

.tracking-kanban-column.batch .tracking-kanban-dot{
    background:#eab308;
    box-shadow:0 0 12px rgba(234,179,8,.6);
}

.tracking-kanban-column.ticket .tracking-kanban-dot{
    background:#f97316;
    box-shadow:0 0 12px rgba(249,115,22,.6);
}

.tracking-kanban-column.response .tracking-kanban-dot{
    background:#3b82f6;
    box-shadow:0 0 12px rgba(59,130,246,.6);
}

.tracking-kanban-column.confirmation .tracking-kanban-dot{
    background:#a855f7;
    box-shadow:0 0 12px rgba(168,85,247,.6);
}

.tracking-kanban-column.archive .tracking-kanban-dot{
    background:#94a3b8;
}

.tracking-kanban-count{
    min-width:30px;
    padding:5px 9px;
    border-radius:999px;
    background:rgba(255,255,255,.07);
    border:1px solid rgba(255,255,255,.07);
    color:#dce4f2;
    font-size:12px;
    font-weight:800;
    text-align:center;
}

.tracking-kanban-cards{
    display:flex;
    flex-direction:column;
    gap:10px;
    padding:14px;
    min-height:150px;

    /*
    Environ 5 cartes visibles.
    Au-delà, la colonne devient défilable.
    */
    max-height:430px;
    overflow-y:auto;
    overflow-x:hidden;

    scrollbar-width:thin;
    scrollbar-color:rgba(255,255,255,.18) transparent;
}

.tracking-kanban-cards::-webkit-scrollbar{
    width:7px;
}

.tracking-kanban-cards::-webkit-scrollbar-track{
    background:transparent;
}

.tracking-kanban-cards::-webkit-scrollbar-thumb{
    background:rgba(255,255,255,.16);
    border-radius:999px;
}

.tracking-kanban-cards::-webkit-scrollbar-thumb:hover{
    background:rgba(255,255,255,.26);
}

.tracking-kanban-card{
    width:100%;
    padding:15px 16px;
    border-radius:15px;
    border:1px solid rgba(255,255,255,.07);
    background:rgba(255,255,255,.045);
    color:white;
    text-align:left;
    cursor:pointer;
    transition:
        transform .16s ease,
        border-color .16s ease,
        background .16s ease;
}

.tracking-kanban-card:hover{
    transform:translateY(-2px);
    border-color:rgba(255,255,255,.18);
    background:rgba(255,255,255,.075);
}

.tracking-kanban-card-reference{
    display:block;
    margin-bottom:7px;
    color:white;
    font-size:15px;
    font-weight:800;
    line-height:1.35;
    overflow-wrap:anywhere;
}

.tracking-kanban-card-number{
    display:block;
    color:var(--muted);
    font-size:13px;
    line-height:1.35;
    overflow-wrap:anywhere;
}

.tracking-kanban-empty{
    min-height:90px;
    display:flex;
    align-items:center;
    justify-content:center;
    padding:16px;
    border:1px dashed rgba(255,255,255,.08);
    border-radius:14px;
    color:#6f7889;
    font-size:13px;
    text-align:center;
}

.tracking-kanban-archives{
    grid-template-columns:minmax(280px, 520px);
}

.tracking-details-actions{
    display:flex;
    justify-content:space-between;
    gap:12px;
    margin-top:24px;
}

.tracking-details-actions button{
    min-width:140px;
}

@media (max-width:1400px){

    .tracking-kanban{
        grid-template-columns:repeat(2, minmax(260px, 1fr));
    }

}

@media (max-width:900px){

    .tracking-orders-toolbar{
        display:flex;
        flex-direction:column;
        align-items:stretch;
    }

    .tracking-orders-actions{
        display:flex;
        width:100%;
    }

    .tracking-orders-actions button{
        flex:1;
    }

    .tracking-kanban{
        display:flex;
        overflow-x:auto;
        align-items:flex-start;
        gap:14px;
        padding-bottom:12px;
        scroll-snap-type:x mandatory;
    }

    .tracking-kanban-column{
        flex:0 0 82vw;
        scroll-snap-align:start;
    }

    .tracking-kanban-archives{
        display:grid;
    }

    .tracking-details-actions{
        flex-direction:column-reverse;
    }

    .tracking-details-actions button{
        width:100%;
    }

}

/* =========================================================
   SUIVI COMMANDES - DRAG & DROP
========================================================= */

.tracking-kanban-card{
    user-select:none;
}

.tracking-kanban-card[draggable="true"]{
    cursor:grab;
}

.tracking-kanban-card[draggable="true"]:active{
    cursor:grabbing;
}

.tracking-kanban-card.dragging{
    opacity:.42;
    transform:scale(.97);
    border-color:var(--accent);
}

.tracking-kanban-column.drag-over{
    border-color:var(--accent);
    background:rgba(59,130,246,.08);
    box-shadow:
        0 20px 60px rgba(0,0,0,.22),
        0 0 0 2px rgba(59,130,246,.20);
}

.tracking-kanban-column.drag-over .tracking-kanban-cards{
    background:rgba(59,130,246,.045);
}

.tracking-kanban-column.drag-over .tracking-kanban-empty{
    border-color:rgba(59,130,246,.45);
    color:#93c5fd;
}

/* ============================
   Barre de recherche
============================ */

.search-input-wrapper{
    position:relative;
    width:100%;
}

.search-input-wrapper .search-input{
    width:100%;
    padding-right:48px;
}

.search-clear-btn{

    position:absolute;

    top:50%;
    right:14px;

    transform:translateY(-50%);

    width:28px;
    height:28px;

    border:none;
    border-radius:50%;

    background:transparent;

    color:#9ca3af;

    font-size:20px;
    cursor:pointer;

    transition:.15s;
}

.search-clear-btn:hover{

    background:rgba(255,255,255,.08);
    color:white;

}

/* =========================================================
   COULEURS NEUTRES LIÉES AU THÈME
========================================================= */

body[data-theme="light"] h1,
body[data-theme="light"] h2,
body[data-theme="light"] h3,
body[data-theme="light"] h4,
body[data-theme="light"] strong,
body[data-theme="light"] label,
body[data-theme="light"] .todo-title,
body[data-theme="light"] .tracking-kanban-card-reference,
body[data-theme="light"] .tracking-kanban-card,
body[data-theme="light"] .tracking-tab,
body[data-theme="light"] .nav,
body[data-theme="light"] .theme-option{
    color:var(--text);
}

body[data-theme="light"] input::placeholder,
body[data-theme="light"] textarea::placeholder{
    color:#8791A2;
}

body[data-theme="light"] .sidebar{
    box-shadow:12px 0 35px rgba(41,51,74,.06);
}

body[data-theme="light"] .tracking-kanban-card{
    background:#FCFCFD;
    border-color:var(--border-strong);
    box-shadow:0 3px 10px rgba(41,51,74,.06);
}

body[data-theme="light"] .tracking-kanban-card:hover{
    background:#FFFFFF;
    border-color:rgba(15,23,42,.28);
    box-shadow:0 7px 18px rgba(41,51,74,.10);
    transform:translateY(-1px);
}

body[data-theme="light"] .tracking-kanban-column{
    background:rgba(255,255,255,.88);
    border:1px solid var(--border-strong);
    box-shadow:0 4px 14px rgba(41,51,74,.05);
}

body[data-theme="light"] .tracking-kanban-empty,
body[data-theme="light"] .tracking-empty{
    background:rgba(255,255,255,.36);
    color:var(--muted);
}

body[data-theme="light"] .secondary-btn{
    background:rgba(255,255,255,.68);
    color:var(--text);
}

body[data-theme="light"] .nav{
    color:#2E3747;
}

body[data-theme="light"] .nav:hover{
    background:rgba(15,23,42,.055);
}

body[data-theme="light"] .nav.active{
    background:rgba(15,23,42,.08);
}

body[data-theme="light"] .icon{
    color:#2E3747;
    background:rgba(15,23,42,.055);
    border-color:rgba(15,23,42,.07);
}

/* =========================================================
   SÉLECTEUR DE THÈME
========================================================= */

.theme-settings{
    display:grid;
    gap:20px;
}

.theme-settings h3{
    margin-bottom:6px;
}

.theme-options{
    display:grid;
    grid-template-columns:repeat(3, minmax(180px,1fr));
    gap:14px;
}

.theme-option{
    display:flex;
    flex-direction:column;
    align-items:flex-start;
    gap:7px;

    padding:14px;

    border-radius:18px;
    border:1px solid var(--border);

    background:var(--surface);
    color:var(--text);

    cursor:pointer;
    text-align:left;

    transition:
        transform .16s ease,
        border-color .16s ease,
        background .16s ease;
}

.theme-option:hover{
    transform:translateY(-2px);
    background:var(--surface-hover);
}

.theme-option.active{
    border-color:var(--accent);
    box-shadow:0 0 0 3px var(--accent-soft);
}

.theme-option strong{
    font-size:15px;
}

.theme-option small{
    color:var(--muted);
}

.theme-preview{
    width:100%;
    height:92px;

    display:grid;
    grid-template-columns:30% 1fr;
    grid-template-rows:repeat(2,1fr);
    gap:7px;

    padding:9px;
    margin-bottom:4px;

    border-radius:14px;
    border:1px solid rgba(255,255,255,.08);

    overflow:hidden;
}

.theme-preview span{
    display:block;
    border-radius:7px;
}

.theme-preview span:first-child{
    grid-row:1 / 3;
}

.theme-preview-cerebros{
    background:
        radial-gradient(
            circle at top left,
            rgba(59,130,246,.25),
            transparent 48%
        ),
        #080A10;
}

.theme-preview-cerebros span{
    background:rgba(255,255,255,.10);
}

.theme-preview-dark{
    background:#090A0C;
}

.theme-preview-dark span{
    background:#25282E;
}

.theme-preview-light{
    background:#E9EDF4;
    border-color:rgba(15,23,42,.10);
}

.theme-preview-light span{
    background:#FFFFFF;
    border:1px solid rgba(15,23,42,.08);
}

@media (max-width:900px){

    .theme-options{
        grid-template-columns:1fr;
    }

}

/* =========================================================
   THÈME INITIAL AVANT CHARGEMENT DU JAVASCRIPT
========================================================= */

html.theme-cerebros body{
    background:
        radial-gradient(
            circle at top left,
            rgba(59,130,246,.16),
            transparent 34%
        ),
        radial-gradient(
            circle at bottom right,
            rgba(120,80,255,.12),
            transparent 32%
        ),
        #080A10;
}

html.theme-dark body{
    background:#090A0C;
}

html.theme-light body{
    background:#EEF1F6;
}

/* =========================================================
   THÈME CLAIR — CORRECTIONS GLOBALES
========================================================= */

body[data-theme="light"]{
    color:var(--text);
}

/* Textes neutres */

body[data-theme="light"] .brand-title,
body[data-theme="light"] .week-day-name,
body[data-theme="light"] .todo-detail-value,
body[data-theme="light"] .vacation-summary-card strong,
body[data-theme="light"] .vacation-ring-text,
body[data-theme="light"] .personal-today-progress-header strong,
body[data-theme="light"] .tracking-kanban-count{
    color:var(--text);
}

/* Barre de recherche */

body[data-theme="light"] .search-input{
    background:#F6F7F9;
    color:var(--text);
    border-color:var(--border-strong);
}

body[data-theme="light"] .search-clear-btn{
    color:var(--muted);
}

body[data-theme="light"] .search-clear-btn:hover{
    color:var(--text);
    background:rgba(15,23,42,.07);
}

/* Onglets */

body[data-theme="light"] .tracking-tab,
body[data-theme="light"] .project-tab{
    background:#FFFFFF;
    color:var(--text);
    border-color:var(--border-strong);
    box-shadow:0 2px 7px rgba(41,51,74,.05);
}

body[data-theme="light"] .tracking-tab.active,
body[data-theme="light"] .project-tab.active{
    background:var(--accent-soft);
    border-color:var(--accent);
}

/* Cartes classiques */

body[data-theme="light"] .card,
body[data-theme="light"] .project-card,
body[data-theme="light"] .empty-module,
body[data-theme="light"] .order-card,
body[data-theme="light"] .document-item,
body[data-theme="light"] .module-list div,
body[data-theme="light"] .shortcut-row,
body[data-theme="light"] .todo-detail-block,
body[data-theme="light"] .folder-row,
body[data-theme="light"] .week-day-card,
body[data-theme="light"] .personal-today-stats div,
body[data-theme="light"] .vacation-summary-card,
body[data-theme="light"] .vacation-day-card,
body[data-theme="light"] .vacation-ring-card{
    background:rgba(255,255,255,.58);
    border-color:var(--border);
}

/* Kanban : couleurs d’état conservées */

body[data-theme="light"] .tracking-kanban-column-header{
    border-bottom-color:var(--border);
}

body[data-theme="light"] .tracking-kanban-count{
    background:rgba(15,23,42,.06);
    border-color:rgba(15,23,42,.08);
}

body[data-theme="light"] .tracking-kanban-card-number{
    color:var(--muted);
}

/* Modales */

body[data-theme="light"] .modal{
    background:rgba(31,41,55,.42);
}

body[data-theme="light"] .modal-box{
    color:var(--text);
}

body[data-theme="light"] .modal-header button,
body[data-theme="light"] .modal-close-btn{
    background:rgba(15,23,42,.055);
    border-color:var(--border);
    color:var(--text);
}

body[data-theme="light"] label{
    color:#4B5565;
}

body[data-theme="light"] input,
body[data-theme="light"] select,
body[data-theme="light"] .modal textarea{
    background:var(--input-bg);
    color:var(--text);
    border-color:var(--border);
}

/* Boutons neutres */

body[data-theme="light"] .secondary-btn,
body[data-theme="light"] .back-btn,
body[data-theme="light"] .edit-project-btn,
body[data-theme="light"] .edit-order-btn,
body[data-theme="light"] .tracking-menu-btn{
    background:#FFFFFF;
    color:var(--text);
    border-color:var(--border-strong);
    box-shadow:0 2px 7px rgba(41,51,74,.06);
}

/* Menu contextuel */

body[data-theme="light"] .tracking-menu{
    background:#FFFFFF;
    border-color:var(--border);
    box-shadow:0 20px 40px rgba(41,51,74,.16);
}

body[data-theme="light"] .tracking-menu button{
    color:var(--text);
}

body[data-theme="light"] .tracking-menu button:hover{
    background:rgba(15,23,42,.06);
}

/* To-do */

body[data-theme="light"] .todo-folder,
body[data-theme="light"] .todo-detail-note{
    color:#4B5565;
}

/* Calendrier */

body[data-theme="light"] input[type="date"]::-webkit-calendar-picker-indicator{
    filter:none;
}

/* Sélecteur Pro / Personal */

body[data-theme="light"] .workspace-btn:not(.active){
    background:rgba(15,23,42,.055);
    color:#4B5565;
}

/* La couleur des boutons principaux reste blanche volontairement */

body[data-theme="light"] .primary-btn,
body[data-theme="light"] .workspace-btn.active{
    color:white;
}

/* =========================================================
   ACCUEIL MOBILE CEREBROS
========================================================= */

.mobile-home{
    display:none;
}

@media (max-width:900px){

    .mobile-home{
        position:fixed;
        inset:0;
        z-index:900;

        display:block;

        background:var(--bg);
        overflow:hidden;
    }

    .mobile-home-slider{
        display:flex;

        width:200%;
        height:100%;

        transform:translateX(0);
        transition:transform .28s ease;
    }

    .mobile-home-slider.show-apps{
        transform:translateX(-50%);
    }

    .mobile-home-screen{
        width:50%;
        height:100%;

        flex:0 0 50%;

        overflow:hidden;
    }

    .mobile-dashboard-screen{
        overflow-y:auto;
    }

    .mobile-apps-screen{
        display:grid;
        grid-template-rows:auto 1fr auto;

        min-height:100%;
        background:var(--bg);
    }

    .mobile-apps-header{
        display:flex;
        align-items:center;
        gap:12px;

        padding:18px 18px 14px;

        background:var(--sidebar);
        border-bottom:1px solid var(--border);

        backdrop-filter:blur(18px);
        -webkit-backdrop-filter:blur(18px);
    }

    .mobile-apps-logo{
        width:42px;
        height:42px;

        border-radius:13px;
        object-fit:cover;
    }

    .mobile-apps-header div{
        display:flex;
        flex-direction:column;
        gap:2px;
    }

    .mobile-apps-header strong{
        color:var(--text);
        font-size:17px;
    }

    .mobile-apps-header span{
        color:var(--muted);
        font-size:12px;
    }

    .mobile-apps-grid{
        display:grid;
        grid-template-columns:repeat(3, minmax(0, 1fr));
        align-content:start;

        gap:22px 16px;

        padding:24px 18px 26px;

        overflow-y:auto;
        overflow-x:hidden;
    }

    .mobile-app-card{
        display:flex;
        flex-direction:column;
        align-items:center;
        gap:9px;

        border:none;
        background:transparent;

        color:var(--text);
        cursor:pointer;
    }

    .mobile-app-icon{
        width:64px;
        height:64px;

        display:flex;
        align-items:center;
        justify-content:center;

        border-radius:20px;

        background:var(--glass);
        border:1px solid var(--border);

        box-shadow:var(--shadow);

        font-size:26px;
    }

    .mobile-app-label{
        max-width:100%;

        color:var(--text);
        font-size:12px;
        font-weight:600;

        text-align:center;
        line-height:1.25;

        overflow:hidden;
        text-overflow:ellipsis;
        white-space:nowrap;
    }

    .mobile-apps-footer{
        padding:14px 18px 18px;

        background:var(--sidebar);
        border-top:1px solid var(--border);

        backdrop-filter:blur(18px);
        -webkit-backdrop-filter:blur(18px);
    }

    .mobile-workspace-switch{
        display:grid;
        grid-template-columns:1fr 1fr;
        gap:10px;
    }

    .mobile-workspace-btn{
        padding:12px 14px;

        border-radius:14px;
        border:1px solid var(--border);

        background:var(--surface);
        color:var(--text);

        font-weight:700;
        cursor:pointer;
    }

    .mobile-workspace-btn.active{
        background:linear-gradient(
            135deg,
            var(--accent-dark),
            var(--accent)
        );

        color:white;
        border-color:transparent;
    }

}

.mobile-module-back,
.mobile-app-edit-done{
    display:none;
}

/* =========================================================
   NAVIGATION MOBILE — DASHBOARD, APPS ET MODULES
========================================================= */

@media (max-width:900px){

    /*
    L’ancienne navigation latérale disparaît complètement.
    */

    .sidebar,
    .mobile-menu-btn,
    .mobile-overlay{
        display:none !important;
    }

    /*
    Tant que l’accueil mobile est affiché,
    le contenu classique reste derrière lui.
    */

    .content{
        width:100%;
        height:100vh;
        margin:0;
        padding:0;
        overflow:hidden;
    }

    /*
    Lorsqu’un module est ouvert,
    l’accueil Dashboard / Applications disparaît.
    */

    .mobile-home.module-open{
        display:none;
    }

    /*
    Affichage plein écran du module ouvert.
    */

    body.mobile-module-open .content{
        height:100vh;
        padding:
            calc(72px + env(safe-area-inset-top))
            16px
            calc(24px + env(safe-area-inset-bottom));

        overflow-y:auto;
        overflow-x:hidden;
    }

    body.mobile-module-open .page{
        width:100%;
        min-height:100%;
    }

    /*
    Bouton fixe permettant de revenir
    à l’écran des applications.
    */

    .mobile-module-back{
        position:fixed;
        top:calc(14px + env(safe-area-inset-top));
        left:16px;
        z-index:950;

        display:none;
        align-items:center;
        justify-content:center;
        gap:8px;

        min-width:46px;
        height:46px;
        padding:0 14px;

        border:1px solid var(--border);
        border-radius:15px;

        background:var(--glass-strong);
        color:var(--text);

        backdrop-filter:blur(18px);
        -webkit-backdrop-filter:blur(18px);

        box-shadow:var(--shadow);

        font-size:14px;
        font-weight:700;
        cursor:pointer;
    }

    body.mobile-module-open .mobile-module-back{
        display:flex;
    }

    /*
    Le haut des pages est légèrement compacté
    pour la version mobile.
    */

    body.mobile-module-open .topbar{
        margin-bottom:20px;
    }

    body.mobile-module-open h1{
        font-size:32px;
        line-height:1.1;
        letter-spacing:-1px;
    }

    body.mobile-module-open .page-subtitle{
        margin-top:6px;
        font-size:14px;
        line-height:1.4;
    }

}

/* =========================================================
   ANIMATION OUVERTURE MODULE MOBILE
========================================================= */

@media (max-width:900px){

    .content.mobile-module-enter{
        animation:mobileModuleEnter .24s ease both;
        transform-origin:center center;
    }

    @keyframes mobileModuleEnter{
        from{
            opacity:0;
            transform:scale(.94) translateY(10px);
        }

        to{
            opacity:1;
            transform:scale(1) translateY(0);
        }
    }

    .mobile-app-card{
        transition:
            transform .14s ease,
            opacity .14s ease;
    }

    .mobile-app-card:active{
        transform:scale(.92);
        opacity:.78;
    }

}

/* =========================================================
   INDICATEURS ACCUEIL MOBILE
========================================================= */

@media (max-width:900px){

    .mobile-home-indicators{
        position:fixed;
        left:50%;
        bottom:calc(92px + env(safe-area-inset-bottom));
        z-index:930;

        display:flex;
        align-items:center;
        justify-content:center;
        gap:8px;

        transform:translateX(-50%);
    }

    .mobile-home-indicator{
        width:8px;
        height:8px;
        padding:0;

        border:none;
        border-radius:999px;

        background:var(--muted);
        opacity:.35;

        cursor:pointer;

        transition:
            width .18s ease,
            opacity .18s ease,
            background .18s ease;
    }

    .mobile-home-indicator.active{
        width:22px;
        background:var(--accent);
        opacity:1;
    }

}

/* =========================================================
   RÉORGANISATION DES APPLICATIONS MOBILES
========================================================= */

@media (max-width:900px){

    .mobile-app-card{
        position:relative;
        touch-action:none;
        -webkit-touch-callout:none;
        user-select:none;
    }

    /*
    Les icônes bougent légèrement lorsqu’on entre
    dans le mode de réorganisation.
    */

    .mobile-apps-grid.editing .mobile-app-card{
        animation:mobileAppWiggle .28s ease-in-out infinite alternate;
    }

    .mobile-apps-grid.editing .mobile-app-card:nth-child(even){
        animation-delay:-.14s;
    }

    @keyframes mobileAppWiggle{
        from{
            transform:rotate(-1.2deg);
        }

        to{
            transform:rotate(1.2deg);
        }
    }

    /*
    Application actuellement déplacée.
    */

    .mobile-app-card.mobile-app-dragging{
        z-index:50;
        opacity:.92;
        animation:none !important;

        transform:scale(1.10);

        pointer-events:none;
    }

    .mobile-app-card.mobile-app-dragging .mobile-app-icon{
        border-color:var(--accent);

        box-shadow:
            0 18px 40px rgba(0,0,0,.28),
            0 0 0 4px var(--accent-soft);
    }

    /*
    Emplacement sur lequel l’application va être déposée.
    */

    .mobile-app-card.mobile-app-drop-target .mobile-app-icon{
        border-color:var(--accent);
        background:var(--accent-soft);

        transform:scale(.94);
    }

    /*
    Petit bouton permettant de quitter volontairement
    le mode édition.
    */

    .mobile-app-edit-done{
        position:fixed;
        top:calc(18px + env(safe-area-inset-top));
        right:18px;
        z-index:960;

        display:none;

        padding:9px 14px;

        border:none;
        border-radius:13px;

        background:var(--accent);
        color:white;

        font-size:13px;
        font-weight:800;

        box-shadow:0 10px 28px var(--accent-soft);
        cursor:pointer;
    }

    .mobile-home.apps-editing .mobile-app-edit-done{
        display:block;
    }

}

/* =========================================================
   HEADER ET FOOTER GLOBAUX — MOBILE
========================================================= */

@media (max-width:900px){

    .mobile-home{
        display:grid;
        grid-template-rows:auto 1fr auto;
    }

    .mobile-global-header{
        position:relative;
        z-index:940;

        display:flex;
        align-items:center;
        gap:12px;

        padding:
            calc(14px + env(safe-area-inset-top))
            18px
            14px;

        background:var(--sidebar);
        border-bottom:1px solid var(--border);

        backdrop-filter:blur(18px);
        -webkit-backdrop-filter:blur(18px);
    }

    .mobile-global-logo{
        width:42px;
        height:42px;

        flex:0 0 42px;

        border-radius:13px;
        object-fit:cover;
    }

    .mobile-global-header > div{
        display:flex;
        flex-direction:column;
        gap:2px;
    }

    .mobile-global-header strong{
        color:var(--text);
        font-size:17px;
    }

    .mobile-global-header span{
        color:var(--muted);
        font-size:12px;
    }

    .mobile-home-slider{
        min-height:0;
        height:100%;
    }

    .mobile-home-screen{
        min-height:0;
        height:100%;
    }

    .mobile-dashboard-screen,
    .mobile-apps-screen{
        overflow-y:auto;
        overflow-x:hidden;
    }

    .mobile-dashboard-screen{
        padding:18px;
    }

    .mobile-apps-screen{
        display:block;
        background:var(--bg);
    }

    .mobile-apps-grid{
        min-height:100%;
        padding:
            24px
            18px
            42px;
    }

    .mobile-global-footer{
        position:relative;
        z-index:940;

        display:grid;
        gap:10px;

        padding:
            12px
            18px
            calc(14px + env(safe-area-inset-bottom));

        background:var(--sidebar);
        border-top:1px solid var(--border);

        backdrop-filter:blur(18px);
        -webkit-backdrop-filter:blur(18px);
    }

    .mobile-footer-links{
        display:grid;
        grid-template-columns:1fr 1fr;
        gap:10px;
    }

    .mobile-footer-link{
        min-height:40px;
        padding:9px 12px;

        border:1px solid var(--border);
        border-radius:13px;

        background:var(--surface);
        color:var(--muted);

        font-size:13px;
        font-weight:700;

        cursor:pointer;
    }

    .mobile-footer-link:active{
        transform:scale(.97);
        background:var(--surface-hover);
    }

    /*
    Les indicateurs doivent rester au-dessus du footer,
    mais sans recouvrir les boutons.
    */

    .mobile-home-indicators{
        bottom:calc(
            132px + env(safe-area-inset-bottom)
        );
    }

}

@media (max-width:900px){

    body.mobile-module-open .mobile-global-header,
    body.mobile-module-open .mobile-global-footer,
    body.mobile-module-open .mobile-home-indicators{
        display:none !important;
    }

}

/* =========================================================
   DASHBOARD MOBILE DÉDIÉ
========================================================= */

@media (max-width:900px){

    .mobile-dashboard-screen{
        padding:0;
    }

    .mobile-dashboard-content{
        width:100%;
        min-width:0;
        padding:20px 18px 36px;
    }

    .mobile-dashboard-heading{
        margin-bottom:20px;
    }

    .mobile-dashboard-date{
        margin-bottom:6px;

        color:var(--accent-light);

        font-size:12px;
        font-weight:800;
        letter-spacing:.8px;
        text-transform:uppercase;
    }

    .mobile-dashboard-heading h1{
        margin:0;

        color:var(--text);
        font-size:30px;
        line-height:1.05;
        letter-spacing:-1px;
    }

    .mobile-dashboard-message{
        margin-top:8px;

        color:var(--muted);
        font-size:14px;
        line-height:1.45;
    }

    .mobile-dashboard-stats{
        display:grid;
        grid-template-columns:repeat(3, minmax(0, 1fr));
        gap:10px;

        margin-bottom:20px;
    }

    .mobile-dashboard-stat{
        min-width:0;
        padding:16px 8px;

        display:flex;
        flex-direction:column;
        align-items:center;
        gap:5px;

        border:1px solid var(--border);
        border-radius:18px;

        background:var(--glass);
        color:var(--text);

        box-shadow:var(--shadow);
        cursor:pointer;
    }

    .mobile-dashboard-stat:active{
        transform:scale(.97);
    }

    .mobile-dashboard-stat-value{
        font-size:24px;
        font-weight:800;
        line-height:1;
    }

    .mobile-dashboard-stat-label{
        max-width:100%;

        color:var(--muted);
        font-size:11px;
        font-weight:700;

        overflow:hidden;
        text-overflow:ellipsis;
        white-space:nowrap;
    }

    .mobile-dashboard-section{
        margin-top:18px;
        padding:18px;

        border:1px solid var(--border);
        border-radius:22px;

        background:var(--glass);

        box-shadow:var(--shadow);
    }

    .mobile-dashboard-section-header{
        margin-bottom:14px;
    }

    .mobile-dashboard-section-header h2{
        margin:0;

        color:var(--text);
        font-size:19px;
        letter-spacing:-.4px;
    }

    .mobile-dashboard-section-header p{
        margin-top:4px;

        color:var(--muted);
        font-size:13px;
    }

    .mobile-dashboard-list{
        display:grid;
        gap:10px;
    }

    .mobile-dashboard-empty{
        padding:16px;

        border:1px dashed var(--border);
        border-radius:16px;

        color:var(--muted);
        font-size:13px;
        text-align:center;

        background:var(--surface);
    }

    .mobile-week-list{
        display:flex;
        gap:10px;

        overflow-x:auto;
        overflow-y:hidden;

        padding-bottom:4px;

        scroll-snap-type:x mandatory;
        scrollbar-width:none;
    }

    .mobile-week-list::-webkit-scrollbar{
        display:none;
    }

    .mobile-week-day{
        flex:0 0 128px;
        min-height:112px;

        padding:14px;

        border:1px solid var(--border);
        border-radius:17px;

        background:var(--surface);

        scroll-snap-align:start;
    }

    .mobile-week-day.today{
        border-color:var(--accent);
        background:var(--accent-soft);
    }

}

@media (max-width:900px){

    .mobile-dashboard-item{
        padding:15px;

        border:1px solid var(--border);
        border-radius:16px;

        background:var(--surface);
        color:var(--text);
    }

    .mobile-dashboard-item h3{
        margin:0 0 6px;

        color:var(--text);
        font-size:15px;
    }

    .mobile-dashboard-item p{
        margin:0;

        color:var(--muted);
        font-size:13px;
        line-height:1.4;
    }

    .mobile-dashboard-item span{
        display:block;
        margin-top:10px;

        color:var(--accent-light);
        font-size:13px;
        font-weight:700;
    }

}

/* =========================================================
   CORRECTION LARGEUR ACCUEIL MOBILE
========================================================= */

@media (max-width:900px){

    .mobile-home{
        width:100vw;
        max-width:100vw;
        min-width:0;

        grid-template-columns:minmax(0, 1fr);
    }

    .mobile-global-header,
    .mobile-global-footer,
    .mobile-home-indicators{
        max-width:100vw;
        min-width:0;
    }

    .mobile-home-slider{
        width:200vw;
        min-width:0;
        max-width:none;
    }

    .mobile-home-slider.show-apps{
        transform:translateX(-100vw);
    }

    .mobile-home-screen{
        width:100vw;
        min-width:100vw;
        max-width:100vw;
        flex:0 0 100vw;
    }

    .mobile-dashboard-content,
    .mobile-apps-grid{
        width:100%;
        max-width:100%;
        min-width:0;
    }

    .mobile-dashboard-stats{
        width:100%;
        min-width:0;
    }

    .mobile-dashboard-stat{
        width:100%;
        min-width:0;
    }

    .mobile-dashboard-section{
        width:100%;
        max-width:100%;
        min-width:0;
        overflow:hidden;
    }

    .mobile-workspace-switch,
    .mobile-footer-links{
        width:100%;
        min-width:0;
    }

}

/* =========================================================
   ADMINISTRATION — INVITATIONS
========================================================= */

.admin-invitation-card{
    display:grid;
    gap:16px;

    margin-top:18px;
    padding:18px;

    border:1px solid var(--border);
    border-radius:18px;

    background:var(--surface);
}

.admin-invitation-card strong{
    color:var(--text);
}

.admin-invitation-card p{
    margin-top:5px;
}

.admin-invitation-link-row{
    display:grid;
    grid-template-columns:minmax(0, 1fr) auto;
    gap:10px;
}

.admin-invitation-link-row input{
    min-width:0;
}

@media (max-width:900px){

    .admin-invitation-link-row{
        grid-template-columns:1fr;
    }

    .admin-invitation-link-row button{
        width:100%;
    }

}

/* =========================================================
   ADMINISTRATION — UTILISATEURS
========================================================= */

#adminUsersList{
    display:grid;
    gap:12px;
    margin-top:18px;
}

.admin-user-card{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:16px;

    padding:16px 18px;

    border:1px solid var(--border);
    border-radius:18px;

    background:var(--surface);
}

.admin-user-card.pending{
    border-style:dashed;
}

.admin-user-main{
    display:flex;
    align-items:center;
    gap:14px;

    min-width:0;
}

.admin-user-avatar{
    width:42px;
    height:42px;

    display:flex;
    align-items:center;
    justify-content:center;

    flex:0 0 42px;

    border:1px solid var(--border);
    border-radius:14px;

    background:var(--glass);

    font-size:20px;
}

.admin-user-info{
    display:grid;
    gap:3px;

    min-width:0;
}

.admin-user-info strong{
    color:var(--text);
    font-size:15px;

    overflow:hidden;
    text-overflow:ellipsis;
    white-space:nowrap;
}

.admin-user-info span{
    color:var(--muted);
    font-size:13px;
}

.admin-user-info small{
    color:var(--muted);
    font-size:12px;
}

.admin-user-status{
    display:inline-flex;
    align-items:center;
    gap:7px;

    flex:0 0 auto;

    padding:7px 10px;

    border:1px solid var(--border);
    border-radius:999px;

    color:var(--muted);
    font-size:12px;
    font-weight:700;
}

.admin-user-status span{
    width:8px;
    height:8px;

    border-radius:50%;
    background:#94a3b8;
}

.admin-user-status.active span{
    background:#22c55e;
}

.admin-user-status.inactive span{
    background:#ef4444;
}

.admin-user-status.pending span{
    background:#f59e0b;
}

@media (max-width:900px){

    .admin-user-card{
        align-items:flex-start;
        flex-direction:column;
    }

    .admin-user-status{
        margin-left:56px;
    }

}

/* =========================================================
   ADMINISTRATION — INTERRUPTEURS BOOLÉENS
========================================================= */

.admin-permission-row{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:18px;

    padding:16px 18px;

    border:1px solid var(--border);
    border-radius:16px;

    background:var(--surface);
}

.admin-permission-row + .admin-permission-row{
    margin-top:10px;
}

.admin-permission-row > div{
    min-width:0;
}

.admin-permission-row strong{
    display:block;

    color:var(--text);
    font-size:14px;
}

.admin-permission-row p{
    margin-top:4px;

    font-size:12px;
    line-height:1.35;
}

.admin-toggle{
    position:relative;

    display:inline-flex;
    align-items:center;

    flex:0 0 auto;

    width:48px;
    height:28px;

    cursor:pointer;
}

.admin-toggle input{
    position:absolute;

    width:1px;
    height:1px;

    opacity:0;
    pointer-events:none;
}

.admin-toggle span{
    position:absolute;
    inset:0;

    border:1px solid var(--border);
    border-radius:999px;

    background:var(--glass);

    transition:
        background .2s ease,
        border-color .2s ease,
        opacity .2s ease;
}

.admin-toggle span::after{
    content:"";

    position:absolute;
    top:3px;
    left:3px;

    width:20px;
    height:20px;

    border-radius:50%;

    background:var(--muted);

    box-shadow:0 2px 8px rgba(0,0,0,.25);

    transition:
        transform .2s ease,
        background .2s ease;
}

.admin-toggle input:checked + span{
    border-color:var(--accent);
    background:var(--accent-soft);
}

.admin-toggle input:checked + span::after{
    transform:translateX(20px);
    background:var(--accent);
}

.admin-toggle input:focus-visible + span{
    outline:2px solid var(--accent);
    outline-offset:3px;
}

.admin-toggle input:disabled + span{
    opacity:.45;
    cursor:not-allowed;
}

.admin-toggle:has(input:disabled){
    cursor:not-allowed;
}

.admin-user-settings{
    display:grid;
    gap:18px;
}

.admin-user-settings-section{
    padding:18px;

    border:1px solid var(--border);
    border-radius:18px;

    background:var(--glass);
}

.admin-user-settings-heading{
    margin-bottom:14px;
}

.admin-user-settings-heading h3{
    margin:0;
}

.admin-permissions-list{
    display:grid;
    gap:10px;
}

@media (max-width:900px){

    .admin-permission-row{
        padding:14px;
    }

}

.admin-permission-info{
    display:flex;
    flex-direction:column;
    gap:5px;
}

.admin-permission-title{
    display:flex;
    align-items:center;
    gap:10px;
}

.admin-permission-icon{
    display:flex;
    align-items:center;
    justify-content:center;

    width:28px;
    height:28px;

    border-radius:8px;

    background:var(--glass);

    font-size:16px;
}

/* =========================================================
   ADMINISTRATION — MODALE UTILISATEUR FIXE
========================================================= */

.admin-user-modal-box{
    display:flex;
    flex-direction:column;

    width:min(920px, calc(100vw - 32px));
    max-height:calc(100vh - 32px);

    padding:0;
    overflow:hidden;
}

.admin-user-modal-box > .modal-header{
    flex:0 0 auto;

    padding:22px 22px 18px;

    border-bottom:1px solid var(--border);

    background:var(--surface);
}

.admin-user-modal-scroll{
    flex:1 1 auto;
    min-height:0;

    overflow-y:auto;
    overscroll-behavior:contain;

    padding:20px 22px;
}

.admin-user-modal-actions{
    position:relative;
    z-index:2;

    flex:0 0 auto;

    margin:0;
    padding:16px 22px;

    border-top:1px solid var(--border);

    background:var(--surface);

    box-shadow:
        0 -12px 28px rgba(0, 0, 0, .18);
}

.admin-user-modal-actions .primary-btn,
.admin-user-modal-actions .secondary-btn{
    min-width:120px;
}

@media (max-width:900px){

    .admin-user-modal-box{
        width:calc(100vw - 20px);
        max-height:calc(100vh - 20px);
    }

    .admin-user-modal-box > .modal-header{
        padding:18px 16px 14px;
    }

    .admin-user-modal-scroll{
        padding:16px;
    }

    .admin-user-modal-actions{
        display:grid;
        grid-template-columns:1fr 1fr;

        padding:14px 16px;
    }

    .admin-user-modal-actions button{
        width:100%;
        min-width:0;
    }

}

/* =========================================================
   ADMINISTRATION — GRILLE DES PERMISSIONS
========================================================= */

#adminUserModules{
    grid-template-columns:
        repeat(2, minmax(0, 1fr));
}

#adminUserWorkspaces{
    grid-template-columns:
        repeat(2, minmax(0, 1fr));
}

.admin-permission-row{
    min-width:0;
}

@media (max-width:900px){

    #adminUserModules,
    #adminUserWorkspaces{
        grid-template-columns:1fr;
    }

}

/* =========================================================
   ADMINISTRATION — IDENTITÉ UTILISATEUR
========================================================= */

.admin-user-modal-identity{
    display:flex;
    align-items:center;
    gap:14px;

    min-width:0;
}

.admin-user-modal-avatar{
    display:flex;
    align-items:center;
    justify-content:center;

    flex:0 0 46px;

    width:46px;
    height:46px;

    border:1px solid var(--border);
    border-radius:14px;

    background:var(--glass);

    font-size:22px;
}

.admin-user-modal-identity h2{
    margin:0;
}

.admin-user-modal-identity p{
    margin:3px 0 6px;
}

.admin-user-modal-role{
    display:inline-flex;
    align-items:center;

    padding:4px 8px;

    border:1px solid var(--border);
    border-radius:999px;

    color:var(--muted);
    font-size:11px;
    font-weight:700;
}

.admin-user-modal-role.admin{
    color:var(--accent);
    border-color:var(--accent);
    background:var(--accent-soft);
}

@media (max-width:900px){

    .admin-user-modal-avatar{
        flex-basis:40px;

        width:40px;
        height:40px;

        font-size:19px;
    }

}

.password-field{
    position:relative;
}

.password-field input{
    width:100%;
    padding-right:48px;
}

.password-visibility-btn{
    position:absolute;
    top:50%;
    right:10px;
    transform:translateY(-50%);

    display:flex;
    align-items:center;
    justify-content:center;

    width:34px;
    height:34px;

    border:0;
    border-radius:10px;

    background:transparent;
    color:var(--muted);

    cursor:pointer;
}

.password-visibility-btn:hover{
    background:var(--glass);
    color:var(--text);
}

/* =========================================================
   MON PROFIL
========================================================= */

.profile-layout{
    display:grid;
    gap:18px;
    max-width:980px;
}

.profile-identity-card{
    display:flex;
    align-items:center;
    gap:18px;

    padding:24px;

    border:1px solid var(--border);
    border-radius:20px;
}

.profile-avatar{
    display:flex;
    align-items:center;
    justify-content:center;

    flex:0 0 72px;

    width:72px;
    height:72px;

    border:1px solid var(--border);
    border-radius:22px;

    background:var(--glass);

    font-size:32px;
}

.profile-identity{
    min-width:0;
}

.profile-identity h2{
    margin:0;

    font-size:26px;
}

.profile-identity p{
    margin:5px 0 10px;
}

.profile-role{
    display:inline-flex;
    align-items:center;

    padding:5px 10px;

    border:1px solid var(--border);
    border-radius:999px;

    color:var(--muted);
    font-size:12px;
    font-weight:700;
}

.profile-role.admin{
    color:var(--accent);
    border-color:var(--accent);
    background:var(--accent-soft);
}

.profile-section{
    padding:22px;

    border:1px solid var(--border);
    border-radius:20px;
}

.profile-section-header{
    display:flex;
    align-items:flex-start;
    justify-content:space-between;
    gap:16px;

    margin-bottom:18px;
}

.profile-section-header h2{
    margin:0 0 5px;

    font-size:20px;
}

.profile-section-header p{
    margin:0;
}

.profile-information-grid{
    display:grid;
    grid-template-columns:
        repeat(2, minmax(0, 1fr));

    gap:12px;

    margin-bottom:18px;
}

.profile-information-item{
    display:flex;
    flex-direction:column;
    gap:7px;

    min-width:0;
    padding:16px;

    border:1px solid var(--border);
    border-radius:15px;

    background:var(--surface);
}

.profile-information-item span{
    color:var(--muted);
    font-size:12px;
}

.profile-information-item strong{
    min-width:0;

    color:var(--text);
    font-size:14px;

    overflow-wrap:anywhere;
}

.profile-logout-btn{
    display:inline-flex;
    align-items:center;
    justify-content:center;

    width:max-content;

    text-decoration:none;
}

@media (max-width:900px){

    .profile-layout{
        max-width:none;
    }

    .profile-identity-card{
        padding:18px;
    }

    .profile-avatar{
        flex-basis:56px;

        width:56px;
        height:56px;

        border-radius:17px;
        font-size:25px;
    }

    .profile-identity h2{
        font-size:21px;
    }

    .profile-section{
        padding:18px;
    }

    .profile-information-grid{
        grid-template-columns:1fr;
    }

    .profile-section .secondary-btn,
    .profile-logout-btn{
        width:100%;
    }

}

/* =========================================================
   MON PROFIL — FINITIONS
========================================================= */

.profile-avatar{
    background:
        linear-gradient(
            145deg,
            var(--accent-soft),
            var(--surface)
        );

    color:var(--accent);
    font-size:28px;
    font-weight:800;
}

.profile-access-description{
    margin:10px 0 0;

    color:var(--muted);
    font-size:12px;
}

.profile-information-label{
    display:flex;
    align-items:center;
    gap:8px;

    color:var(--muted);
    font-size:12px;
}

.profile-information-label > span:first-child{
    display:flex;
    align-items:center;
    justify-content:center;

    width:24px;
    height:24px;

    border:1px solid var(--border);
    border-radius:8px;

    background:var(--glass);

    color:var(--text);
    font-size:12px;
    font-weight:700;
}

.profile-section-header .secondary-btn{
    flex:0 0 auto;
}

.profile-logout-btn.danger-btn{
    border-color:rgba(248, 113, 113, .35);
    background:rgba(248, 113, 113, .08);
    color:#f87171;
}

.profile-logout-btn.danger-btn:hover{
    border-color:#f87171;
    background:rgba(248, 113, 113, .14);
}

@media (max-width:900px){

    .profile-section-header{
        flex-direction:column;
    }

    .profile-section-header .secondary-btn{
        width:100%;
    }

}

/* =========================================================
   MON PROFIL — AVATAR FINAL
========================================================= */

.profile-avatar{
    display:flex;
    align-items:center;
    justify-content:center;

    flex:0 0 64px;
    width:64px;
    height:64px;

    border:1px solid var(--border);
    border-radius:18px;

    background:var(--glass);
    color:var(--text);

    box-shadow:
        inset 0 1px 0 rgba(255,255,255,.04);

    font-size:26px;
    font-weight:800;
    line-height:1;
    text-transform:uppercase;
}

.profile-role.admin{
    color:var(--accent);
    border-color:rgba(59,130,246,.45);
    background:rgba(59,130,246,.10);
}

@media (max-width:900px){

    .profile-avatar{
        flex-basis:54px;
        width:54px;
        height:54px;

        border-radius:15px;
        font-size:22px;
    }

}

/* =========================================================
   BUDGET VACANCES — SÉJOUR TERMINÉ
========================================================= */

.vacation-finished-hero{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:28px;

    width:100%;
    padding:30px;
    margin-bottom:22px;

    border:1px solid var(--border);
    border-radius:22px;
}

.vacation-finished-content{
    display:flex;
    align-items:center;
    gap:20px;

    min-width:0;
}

.vacation-finished-content h2{
    margin:5px 0 8px;
}

.vacation-finished-content p{
    max-width:680px;
    margin:0;
}

.vacation-finished-icon{
    display:flex;
    align-items:center;
    justify-content:center;

    flex:0 0 64px;
    width:64px;
    height:64px;

    border:1px solid var(--border);
    border-radius:18px;

    background:var(--glass);
    font-size:28px;
}

.vacation-history-section{
    margin-top:18px;
}

.vacation-history-heading{
    display:flex;
    align-items:center;
    justify-content:space-between;

    margin-bottom:10px;
}

.vacation-history-heading h3{
    margin:0 0 4px;
}

.vacation-history-heading p{
    margin:0;
}

.vacation-history-list{
    display:grid;
    gap:8px;
}

.vacation-history-row{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:20px;

    min-height:54px;
    padding:12px 16px;

    border:1px solid var(--border);
    border-radius:14px;
}

.vacation-history-row strong{
    overflow:hidden;
    text-overflow:ellipsis;
    white-space:nowrap;
}

.vacation-history-row span{
    flex:0 0 auto;

    color:var(--muted);
    font-size:13px;
}

.vacation-history-empty{
    padding:16px;

    border:1px dashed var(--border);
    border-radius:14px;

    color:var(--muted);
    text-align:center;
}

.vacation-history-under-form{
    margin-top:22px;
}

@media (max-width:900px){

    .vacation-finished-hero{
        flex-direction:column;
        align-items:stretch;

        padding:20px;
    }

    .vacation-finished-content{
        align-items:flex-start;
    }

    .vacation-finished-icon{
        flex-basis:50px;
        width:50px;
        height:50px;

        border-radius:15px;
        font-size:22px;
    }

    .vacation-finished-hero .primary-btn{
        width:100%;
    }

    .vacation-history-row{
        align-items:flex-start;
        flex-direction:column;
        gap:4px;

        min-height:0;
    }

    .vacation-history-row span{
        font-size:12px;
    }

}

/* =========================================================
   BUDGET VACANCES — ARCHIVES
========================================================= */

.vacation-history-button{
    width:100%;

    border:1px solid var(--border);

    color:var(--text);
    font:inherit;
    text-align:left;

    cursor:pointer;

    transition:
        border-color .18s ease,
        background .18s ease,
        transform .18s ease;
}

.vacation-history-button:hover{
    border-color:var(--accent);
    background:var(--glass-hover);
    transform:translateY(-1px);
}

.vacation-archive-toolbar{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:12px;

    margin-bottom:18px;
}

@media (max-width:900px){

    .vacation-archive-toolbar{
        align-items:stretch;
        flex-direction:column;
    }

    .vacation-archive-toolbar button{
        width:100%;
    }

}

/* Évite le flash du Dashboard pendant la restauration */
html.page-restoring .sidebar,
html.page-restoring .content,
html.page-restoring .mobile-home{
    visibility:hidden;
}