/* La typographie locale est définie dans premium.css. */

:root{
    --nav:#17365D;
    --nav2:#0f2745;
    --bg:#f4f7fb;
    --card:#ffffff;
    --text:#172033;
    --muted:#667085;
    --accent:#f47b20;
    --line:#e7ebf0;
    --success:#027A48;
    --warning:#B54708;
}

*{box-sizing:border-box}

html{scroll-behavior:smooth}

body{
    font-family:Inter,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
    background:var(--bg);
    color:var(--text);
    margin:0;
    -webkit-font-smoothing:antialiased;
    text-rendering:optimizeLegibility;
}

.app-shell{display:flex;min-height:100vh}

.sidebar{
    width:260px;
    background:linear-gradient(180deg,var(--nav),var(--nav2));
    color:#fff;
    padding:20px 14px;
    position:sticky;
    top:0;
    height:100vh;
    overflow-y:auto;
}

.brand{
    display:flex;
    align-items:center;
    gap:12px;
    padding:6px 8px 24px;
}

.brand-mark,.login-logo{
    width:44px;
    height:44px;
    border-radius:13px;
    background:#fff;
    color:var(--nav);
    display:grid;
    place-items:center;
    font-weight:800;
}

.brand small{
    display:block;
    color:#c6d3e3;
    font-size:12px;
}

.sidebar nav{
    display:grid;
    gap:6px;
}

.sidebar nav a{
    color:#d9e3ef;
    text-decoration:none;
    padding:11px 13px;
    border-radius:10px;
    font-weight:600;
    transition:background-color .18s ease,color .18s ease;
}

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

.content{
    flex:1;
    min-width:0;
}

.topbar{
    min-height:70px;
    background:#fff;
    border-bottom:1px solid #e6eaf0;
    display:flex;
    align-items:center;
    padding:10px 22px;
    gap:14px;
    position:sticky;
    top:0;
    z-index:15;
}

.topbar-user span{
    display:block;
    font-size:12px;
    color:var(--muted);
}

.topbar-actions{
    display:flex;
    align-items:center;
    gap:8px;
    flex-wrap:wrap;
    justify-content:flex-end;
}

.topbar-actions form{margin:0}

.menu-btn{
    display:none;
    border:0;
    background:#eef2f7;
    border-radius:10px;
    width:42px;
    height:42px;
}

.page-title{
    display:flex;
    justify-content:space-between;
    align-items:center;
    gap:16px;
    margin-bottom:22px;
}

.page-title h1{
    font-size:28px;
    font-weight:800;
    margin:0;
    letter-spacing:-.025em;
}

.page-title p{
    margin:4px 0 0;
    color:var(--muted);
}

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

.metric,.card-pro{
    background:var(--card);
    border:1px solid var(--line);
    border-radius:16px;
    box-shadow:0 6px 22px rgba(16,24,40,.04);
}

.metric{
    padding:18px;
    min-height:116px;
}

.metric span{
    display:block;
    color:var(--muted);
    font-size:13px;
    margin-bottom:16px;
}

.metric strong{font-size:21px}

.metric.accent{
    border-color:#ffd7bd;
    background:#fff9f5;
}

.card-pro{padding:20px}

.card-pro h2{
    font-size:18px;
    font-weight:800;
}

.btn{
    border-radius:10px;
    font-weight:600;
}

.btn-primary{
    background:var(--nav);
    border-color:var(--nav);
}

.btn-primary:hover,
.btn-primary:focus{
    background:var(--nav2);
    border-color:var(--nav2);
}

.table thead th{
    font-size:12px;
    text-transform:uppercase;
    letter-spacing:.03em;
    color:#667085;
    background:#f8fafc;
}

.form-control,.form-select{
    border-radius:10px;
    min-height:44px;
}

.modal-content{
    border-radius:18px;
    border:0;
}

.login-body{
    min-height:100vh;
    display:grid;
    place-items:center;
    background:linear-gradient(135deg,#eaf0f7,#f9fbfd);
    padding:20px;
}

.login-card{
    width:min(460px,100%);
    background:#fff;
    border-radius:22px;
    padding:32px;
    box-shadow:0 20px 60px rgba(23,54,93,.15);
}

.login-card h1{
    font-size:24px;
    margin:18px 0 4px;
}

.login-logo{
    background:var(--nav);
    color:#fff;
    width:54px;
    height:54px;
}

/* ==========================================================
   STATUTS
   ========================================================== */

.status-pill{
    display:inline-flex;
    align-items:center;
    gap:8px;
    padding:9px 14px;
    margin-top:5px;
    border-radius:999px;
    border:1px solid transparent;
    font-weight:800;
    font-size:13px;
    line-height:1.25;
    white-space:nowrap;
}

.status-pill::before{
    content:'';
    display:block;
    width:9px;
    height:9px;
    flex:0 0 9px;
    border-radius:50%;
    background:currentColor;
}

.status-warning{
    background:#FFF7E6;
    color:#B54708;
    border-color:#FEC84B;
}

.status-success{
    background:#ECFDF3;
    color:#027A48;
    border-color:#ABEFC6;
}

/* ==========================================================
   MISE À JOUR CSS EN DIRECT
   ========================================================== */

.live-style-notice{
    position:fixed;
    right:18px;
    bottom:18px;
    z-index:1100;
    background:#17365D;
    color:#fff;
    padding:10px 14px;
    border-radius:11px;
    font-size:13px;
    font-weight:700;
    box-shadow:0 12px 35px rgba(23,54,93,.25);
    opacity:0;
    transform:translateY(12px);
    pointer-events:none;
    transition:opacity .2s ease,transform .2s ease;
}

.live-style-notice.show{
    opacity:1;
    transform:translateY(0);
}

/* ==========================================================
   EXPORTS ULTRA PRO
   ========================================================== */

.export-document{
    --export-blue:#17365D;
    --export-blue-dark:#0f2745;
    --export-orange:#F47B20;
    --export-ink:#172033;
    --export-muted:#6B7280;
    --export-line:#DCE3EB;
    --export-soft:#F5F8FC;

    background:#fff;
    color:var(--export-ink);
    border:1px solid #e3e8ef;
    border-radius:18px;
    padding:34px;
    max-width:1180px;
    margin:0 auto;
    box-shadow:0 12px 35px rgba(16,24,40,.06);
}

.export-shipment{
    max-width:1500px;
}

.export-brand-header{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:24px;
    border-bottom:2px solid var(--export-blue);
    padding-bottom:18px;
}

.export-brand-left{
    display:flex;
    align-items:center;
    gap:14px;
    min-width:0;
}

.export-logo{
    width:54px;
    height:54px;
    display:grid;
    place-items:center;
    flex:0 0 54px;
    border-radius:15px;
    background:linear-gradient(145deg,var(--export-blue),var(--export-blue-dark));
    color:#fff;
    font-size:19px;
    font-weight:800;
    letter-spacing:.03em;
}

.export-organization{
    font-size:18px;
    font-weight:800;
    letter-spacing:.02em;
}

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

.export-reference{
    text-align:right;
    border-left:1px solid var(--export-line);
    padding-left:24px;
}

.export-reference span{
    display:block;
    color:var(--export-muted);
    font-size:10px;
    font-weight:800;
    letter-spacing:.12em;
}

.export-reference strong{
    display:block;
    margin-top:4px;
    font-size:14px;
    color:var(--export-blue);
}

.export-title-block{
    padding:28px 0 20px;
}

.export-title-block.shipment-title{
    padding-bottom:16px;
}

.export-kicker{
    display:block;
    color:var(--export-orange);
    font-size:10px;
    font-weight:800;
    letter-spacing:.14em;
    margin-bottom:7px;
}

.export-title-block h2{
    margin:0;
    font-size:30px;
    font-weight:800;
    letter-spacing:-.035em;
    color:var(--export-blue-dark);
}

.export-title-block p{
    margin:7px 0 0;
    color:var(--export-muted);
    font-size:13px;
}

.export-info-grid{
    display:grid;
    grid-template-columns:repeat(4,minmax(0,1fr));
    gap:12px;
    margin-bottom:24px;
}

.export-info-item,
.export-stats > div{
    border:1px solid var(--export-line);
    background:var(--export-soft);
    border-radius:12px;
    padding:14px;
    min-width:0;
}

.export-info-item > span:first-child,
.export-stats span{
    display:block;
    color:var(--export-muted);
    font-size:10px;
    font-weight:700;
    text-transform:uppercase;
    letter-spacing:.06em;
    margin-bottom:6px;
}

.export-info-item > strong,
.export-stats strong{
    display:block;
    font-size:14px;
    font-weight:800;
    overflow-wrap:anywhere;
}

.export-stats{
    display:grid;
    grid-template-columns:1.5fr repeat(3,1fr);
    gap:10px;
    margin-bottom:18px;
}

.export-stats > div:first-child{
    background:linear-gradient(135deg,#17365D,#214c7b);
    border-color:#17365D;
    color:#fff;
}

.export-stats > div:first-child span{
    color:#dbe8f6;
}

.export-stats > div:first-child strong{
    font-size:20px;
}

.export-table-wrap{
    width:100%;
    overflow-x:auto;
    border:1px solid var(--export-line);
    border-radius:13px;
}

.export-table{
    width:100%;
    border-collapse:collapse;
    margin:0;
    font-size:13px;
}

.export-table th,
.export-table td{
    border-bottom:1px solid var(--export-line);
    border-right:1px solid var(--export-line);
    padding:11px 12px;
    vertical-align:middle;
}

.export-table th:last-child,
.export-table td:last-child{
    border-right:0;
}

.export-table tbody tr:last-child th,
.export-table tbody tr:last-child td{
    border-bottom:0;
}

.export-table thead th{
    background:#EEF3F8;
    color:#415166;
    font-size:10px;
    font-weight:800;
    text-transform:uppercase;
    letter-spacing:.05em;
}

.export-table tbody th{
    background:#FBFCFE;
    font-weight:800;
}

.export-table tfoot th{
    background:#17365D;
    color:#fff;
    border-color:#17365D;
    font-weight:800;
}

.export-table .total-column{
    background:#F5F8FC;
    font-weight:800;
}

.export-table tfoot .total-column{
    background:#0f2745;
}

.export-summary-band{
    margin-top:18px;
    padding:16px 18px;
    border-radius:13px;
    background:linear-gradient(135deg,#17365D,#214c7b);
    color:#fff;
    display:flex;
    justify-content:space-between;
    align-items:center;
    gap:18px;
}

.export-summary-band span{
    color:#dbe8f6;
    font-size:12px;
    font-weight:600;
}

.export-summary-band strong{
    font-size:23px;
    font-weight:800;
}

.export-validation-grid{
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:14px;
    margin-top:22px;
}

.export-validation-card{
    border:1px solid var(--export-line);
    border-radius:13px;
    padding:15px;
    background:#fff;
}

.export-validation-card > span{
    display:block;
    color:var(--export-muted);
    font-size:10px;
    text-transform:uppercase;
    letter-spacing:.06em;
    font-weight:800;
}

.export-validation-card strong{
    display:block;
    margin-top:7px;
    font-size:14px;
}

.export-validation-card small{
    display:block;
    margin-top:5px;
    color:var(--export-muted);
    line-height:1.5;
}

.export-section{
    margin-top:28px;
}

.export-section-heading{
    display:flex;
    justify-content:space-between;
    align-items:flex-end;
    gap:20px;
    margin-bottom:14px;
}

.export-section-heading h3{
    margin:0;
    font-size:20px;
    font-weight:800;
    color:var(--export-blue-dark);
}

.export-section-heading > strong{
    color:var(--export-muted);
    font-size:12px;
}

.envelope-grid{
    display:grid;
    grid-template-columns:repeat(4,minmax(0,1fr));
    gap:10px;
}

.envelope-card{
    border:1.5px dashed #9AA9BA;
    border-radius:12px;
    padding:13px;
    background:#FBFCFE;
    break-inside:avoid;
}

.envelope-card span{
    display:block;
    color:#7B8794;
    font-size:9px;
    font-weight:800;
    letter-spacing:.09em;
}

.envelope-card strong{
    display:block;
    margin-top:6px;
    color:var(--export-blue-dark);
    font-size:16px;
    font-weight:800;
}

.envelope-card b{
    display:block;
    margin-top:5px;
    color:var(--export-blue);
    font-size:17px;
    font-weight:800;
}

.envelope-card small{
    display:block;
    margin-top:6px;
    color:#8792A2;
    font-size:9px;
}

.grand-envelope{
    margin-top:18px;
    border:2px solid var(--export-blue);
    border-radius:15px;
    background:linear-gradient(135deg,#F6F9FC,#EEF4FA);
    padding:20px;
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:24px;
    break-inside:avoid;
}

.grand-envelope span{
    display:block;
    color:#667085;
    font-size:10px;
    font-weight:800;
    letter-spacing:.07em;
}

.grand-envelope strong{
    display:block;
    margin-top:5px;
    color:var(--export-blue-dark);
    font-size:18px;
}

.grand-envelope small{
    display:block;
    margin-top:5px;
    color:#667085;
    font-size:11px;
}

.grand-envelope b{
    flex:0 0 auto;
    color:var(--export-blue);
    font-size:28px;
    font-weight:800;
    white-space:nowrap;
}

.export-footer{
    border-top:1px solid var(--export-line);
    margin-top:24px;
    padding-top:12px;
    display:flex;
    justify-content:space-between;
    gap:20px;
    color:#8A94A3;
    font-size:9px;
}

.pdf-export-mode{
    border-radius:0 !important;
    box-shadow:none !important;
    border:0 !important;
}

/* ==========================================================
   RESPONSIVE
   ========================================================== */

@media(max-width:1100px){
    .export-info-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
    .export-stats{grid-template-columns:repeat(2,minmax(0,1fr))}
    .envelope-grid{grid-template-columns:repeat(3,minmax(0,1fr))}
}

@media(max-width:900px){
    .sidebar{
        position:fixed;
        left:-280px;
        z-index:30;
        transition:left .2s ease;
    }

    .sidebar.open{left:0}

    .menu-btn{
        display:inline-grid;
        place-items:center;
        flex:0 0 42px;
    }

    .topbar{padding:10px 14px}

    .topbar-actions{
        margin-left:auto;
    }

    .page-title{
        align-items:flex-start;
        flex-direction:column;
    }

    .export-actions{
        width:100%;
    }

    .export-actions .btn{
        flex:1 1 160px;
    }

    .container-fluid{
        padding-left:14px!important;
        padding-right:14px!important;
    }

    .metric strong{font-size:18px}

    .export-document{
        padding:22px;
        border-radius:14px;
    }
}

@media(max-width:650px){
    .topbar-user{
        min-width:0;
        flex:1;
    }

    .topbar-user strong,
    .topbar-user span{
        overflow:hidden;
        text-overflow:ellipsis;
        white-space:nowrap;
    }

    .topbar-actions form{
        display:none;
    }

    .export-brand-header{
        align-items:flex-start;
    }

    .export-reference{
        padding-left:14px;
    }

    .export-organization{
        font-size:15px;
    }

    .export-title-block h2{
        font-size:24px;
    }

    .export-info-grid,
    .export-stats,
    .export-validation-grid{
        grid-template-columns:1fr;
    }

    .envelope-grid{
        grid-template-columns:repeat(2,minmax(0,1fr));
    }

    .grand-envelope{
        align-items:flex-start;
        flex-direction:column;
    }

    .grand-envelope b{
        font-size:24px;
    }

    .status-pill{
        white-space:normal;
    }
}

@media(max-width:420px){
    .export-document{padding:16px}
    .export-logo{width:46px;height:46px;flex-basis:46px}
    .export-subtitle{display:none}
    .envelope-grid{grid-template-columns:1fr}
}

/* ==========================================================
   IMPRESSION
   ========================================================== */

@page{
    size:A4;
    margin:8mm;
}

@media print{
    html,body{
        background:#fff!important;
        print-color-adjust:exact;
        -webkit-print-color-adjust:exact;
    }

    .sidebar,
    .topbar,
    .no-print,
    .live-style-notice{
        display:none!important;
    }

    .content,
    .container-fluid{
        width:100%!important;
        max-width:none!important;
        padding:0!important;
        margin:0!important;
    }

    .export-document{
        border:0!important;
        box-shadow:none!important;
        border-radius:0!important;
        padding:0!important;
        max-width:none!important;
        width:100%!important;
    }

    .export-shipment{
        font-size:10px;
    }

    .export-table{
        font-size:10px;
    }

    .export-table th,
    .export-table td{
        padding:6px 7px;
    }

    .envelope-grid{
        grid-template-columns:repeat(4,minmax(0,1fr));
    }

    .envelope-card,
    .grand-envelope,
    .export-validation-card,
    .export-summary-band{
        break-inside:avoid;
        page-break-inside:avoid;
    }

    .export-footer{
        margin-top:14px;
    }

    a[href]::after{
        content:""!important;
    }
}


/* ==========================================================
   PATCH V1.3 — BORDEREAU A4 PAYSAGE COMPACT
   ========================================================== */

/*
 * Le clone utilisé pour l'export PDF reçoit une largeur fixe
 * correspondant à une page A4 paysage exploitable.
 * Cela empêche le découpage/cadrage horizontal constaté.
 */
.pdf-landscape-capture{
    width:1080px !important;
    max-width:1080px !important;
    min-width:1080px !important;
    margin:0 !important;
    padding:22px !important;
    border:0 !important;
    border-radius:0 !important;
    box-shadow:none !important;
    overflow:visible !important;
    background:#fff !important;
}

/* Typographie légèrement réduite pour gagner de la place sans perdre la lisibilité */
.pdf-landscape-capture .export-brand-header{
    padding-bottom:11px;
}

.pdf-landscape-capture .export-logo{
    width:46px;
    height:46px;
    flex-basis:46px;
    border-radius:12px;
    font-size:16px;
}

.pdf-landscape-capture .export-organization{
    font-size:15px;
}

.pdf-landscape-capture .export-subtitle{
    font-size:9px;
}

.pdf-landscape-capture .export-reference{
    padding-left:18px;
}

.pdf-landscape-capture .export-reference span{
    font-size:8px;
}

.pdf-landscape-capture .export-reference strong{
    font-size:11px;
}

.pdf-landscape-capture .export-title-block{
    padding:16px 0 11px;
}

.pdf-landscape-capture .export-kicker{
    font-size:8px;
    margin-bottom:4px;
}

.pdf-landscape-capture .export-title-block h2{
    font-size:23px;
}

.pdf-landscape-capture .export-title-block p{
    margin-top:4px;
    font-size:9px;
}

.pdf-landscape-capture .export-stats{
    gap:7px;
    margin-bottom:11px;
}

.pdf-landscape-capture .export-stats > div{
    padding:9px 10px;
    border-radius:9px;
}

.pdf-landscape-capture .export-stats span{
    font-size:8px;
    margin-bottom:3px;
}

.pdf-landscape-capture .export-stats strong{
    font-size:11px;
}

.pdf-landscape-capture .export-stats > div:first-child strong{
    font-size:16px;
}

/* Le tableau du bordereau est volontairement plus dense */
.pdf-landscape-capture .matrix-wrap{
    overflow:visible !important;
    border-radius:8px;
}

.pdf-landscape-capture .matrix-table{
    table-layout:fixed;
    width:100% !important;
    font-size:9px !important;
}

.pdf-landscape-capture .matrix-table th,
.pdf-landscape-capture .matrix-table td{
    padding:5px 6px !important;
    font-size:9px !important;
    line-height:1.15;
    white-space:nowrap;
}

.pdf-landscape-capture .matrix-table thead th{
    font-size:7.5px !important;
}

.pdf-landscape-capture .matrix-table th:first-child{
    width:115px;
    white-space:normal;
}

.pdf-landscape-capture .matrix-table .total-column{
    width:105px;
}

/* Enveloppes compactées : 6 par ligne sur le PDF paysage */
.pdf-landscape-capture .export-section{
    margin-top:14px;
}

.pdf-landscape-capture .export-section-heading{
    margin-bottom:8px;
}

.pdf-landscape-capture .export-section-heading h3{
    font-size:15px;
}

.pdf-landscape-capture .export-section-heading > strong{
    font-size:9px;
}

.pdf-landscape-capture .envelope-grid{
    grid-template-columns:repeat(6,minmax(0,1fr));
    gap:6px;
}

.pdf-landscape-capture .envelope-card{
    padding:8px;
    border-radius:8px;
}

.pdf-landscape-capture .envelope-card span{
    font-size:7px;
}

.pdf-landscape-capture .envelope-card strong{
    margin-top:3px;
    font-size:11px;
}

.pdf-landscape-capture .envelope-card b{
    margin-top:3px;
    font-size:11px;
}

.pdf-landscape-capture .envelope-card small{
    margin-top:3px;
    font-size:7px;
}

.pdf-landscape-capture .grand-envelope{
    margin-top:10px;
    padding:11px 13px;
    border-radius:10px;
}

.pdf-landscape-capture .grand-envelope span{
    font-size:8px;
}

.pdf-landscape-capture .grand-envelope strong{
    margin-top:3px;
    font-size:13px;
}

.pdf-landscape-capture .grand-envelope small{
    margin-top:3px;
    font-size:8px;
}

.pdf-landscape-capture .grand-envelope b{
    font-size:20px;
}

.pdf-landscape-capture .export-validation-grid{
    gap:8px;
    margin-top:11px;
}

.pdf-landscape-capture .export-validation-card{
    padding:9px 11px;
    border-radius:9px;
}

.pdf-landscape-capture .export-validation-card > span{
    font-size:7px;
}

.pdf-landscape-capture .export-validation-card strong{
    margin-top:3px;
    font-size:10px;
}

.pdf-landscape-capture .export-validation-card small{
    margin-top:3px;
    font-size:8px;
}

.pdf-landscape-capture .export-footer{
    margin-top:10px;
    padding-top:7px;
    font-size:7px;
}

/* Impression navigateur : chaque type de document conserve son orientation */
.export-shipment{
    page:shipmentLandscape;
}

.export-receipt{
    page:receiptPortrait;
}

@page shipmentLandscape{
    size:A4 landscape;
    margin:7mm;
}

@page receiptPortrait{
    size:A4 portrait;
    margin:8mm;
}

@media print{
    .export-shipment{
        font-size:9px !important;
    }

    .export-shipment .export-title-block h2{
        font-size:22px !important;
    }

    .export-shipment .matrix-table{
        font-size:8.5px !important;
        table-layout:fixed;
    }

    .export-shipment .matrix-table th,
    .export-shipment .matrix-table td{
        padding:4px 5px !important;
        font-size:8.5px !important;
    }

    .export-shipment .envelope-grid{
        grid-template-columns:repeat(6,minmax(0,1fr)) !important;
        gap:5px !important;
    }

    .export-shipment .envelope-card{
        padding:7px !important;
    }
}

/* ==========================================================
   PATCH V1.6 — TABLEAU DE BORD
   ========================================================== */

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

.dashboard-quick-actions{
    display:flex;
    align-items:center;
    gap:9px;
    flex-wrap:wrap;
}

.dashboard-section{
    margin-bottom:4px;
}

.dashboard-section-title,
.panel-heading{
    display:flex;
    align-items:flex-end;
    justify-content:space-between;
    gap:16px;
    margin-bottom:13px;
}

.dashboard-section-title > div > span,
.panel-heading > div > span{
    display:block;
    color:#F47B20;
    font-size:9px;
    line-height:1;
    font-weight:800;
    letter-spacing:.12em;
    margin-bottom:5px;
}

.dashboard-section-title h2,
.panel-heading h2{
    margin:0;
    color:#172033;
    font-size:18px;
    font-weight:800;
    letter-spacing:-.02em;
}

.dashboard-section-title > small{
    color:#7B8794;
    font-weight:700;
}

.panel-heading > a{
    color:#17365D;
    font-size:12px;
    font-weight:700;
    text-decoration:none;
}

.dashboard-metric{
    position:relative;
    overflow:hidden;
    min-height:130px;
}

.dashboard-metric::after{
    content:'';
    position:absolute;
    width:72px;
    height:72px;
    border-radius:50%;
    right:-24px;
    top:-25px;
    background:#EEF3F8;
}

.dashboard-metric > span,
.dashboard-metric > strong,
.dashboard-metric > small{
    position:relative;
    z-index:1;
}

.dashboard-metric > span{
    margin-bottom:12px;
    font-size:12px;
    font-weight:700;
}

.dashboard-metric > strong{
    display:block;
    font-size:21px;
    letter-spacing:-.035em;
    overflow-wrap:anywhere;
}

.dashboard-metric > small{
    display:block;
    margin-top:8px;
    color:#8590A0;
    font-size:10px;
    line-height:1.35;
}

.dashboard-metric.metric-income::after{background:#EAF9F0}
.dashboard-metric.metric-expense::after{background:#FFF0EE}
.dashboard-metric.metric-balance::after{background:#EEF4FA}
.dashboard-metric.metric-cash::after{background:#FFF7EB}

.dashboard-metric.district-primary{
    color:#fff;
    border-color:#17365D;
    background:linear-gradient(135deg,#17365D,#285986);
}

.dashboard-metric.district-primary::after{
    width:100px;
    height:100px;
    right:-30px;
    top:-40px;
    background:rgba(255,255,255,.08);
}

.dashboard-metric.district-primary > span,
.dashboard-metric.district-primary > small{
    color:#DDE9F5;
}

.dashboard-panel{
    min-height:100%;
}

.trend-list{
    display:grid;
    gap:13px;
}

.trend-row{
    display:grid;
    grid-template-columns:58px minmax(0,1fr);
    align-items:center;
    gap:12px;
}

.trend-label{
    color:#6D7887;
    font-size:10px;
    font-weight:700;
}

.trend-bars{
    display:grid;
    gap:5px;
}

.trend-bar-line{
    position:relative;
    height:8px;
    border-radius:999px;
    background:#EEF2F6;
    overflow:visible;
    margin-right:88px;
}

.trend-bar{
    display:block;
    min-width:2px;
    height:100%;
    border-radius:999px;
}

.trend-bar.income{background:#27AE60}
.trend-bar.expense{background:#E66A5C}

.trend-bar-line small{
    position:absolute;
    left:calc(100% + 8px);
    top:-4px;
    width:80px;
    color:#687386;
    font-size:8.5px;
    text-align:right;
    white-space:nowrap;
}

.trend-legend{
    display:flex;
    gap:16px;
    margin-top:16px;
    color:#7B8794;
    font-size:10px;
}

.trend-legend span{
    display:inline-flex;
    align-items:center;
    gap:6px;
}

.trend-legend i{
    width:8px;
    height:8px;
    border-radius:50%;
}

.trend-legend i.income{background:#27AE60}
.trend-legend i.expense{background:#E66A5C}

.category-bars{
    display:grid;
    gap:13px;
}

.category-bar-item > div:first-child{
    display:flex;
    justify-content:space-between;
    gap:12px;
    margin-bottom:6px;
    font-size:10px;
}

.category-bar-item strong{
    color:#344054;
    font-size:10px;
}

.category-bar-item span{
    color:#667085;
    white-space:nowrap;
}

.category-track{
    height:7px;
    border-radius:999px;
    background:#EEF2F6;
    overflow:hidden;
}

.category-track span{
    display:block;
    height:100%;
    min-width:2px;
    border-radius:999px;
    background:linear-gradient(90deg,#17365D,#3976A8);
}

.dashboard-table{
    margin-bottom:0;
}

.dashboard-table td{
    font-size:11px;
}

.remittance-list{
    display:grid;
    gap:8px;
}

.remittance-item{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:12px;
    padding:11px 12px;
    border:1px solid #E7EBF0;
    border-radius:11px;
    color:#172033;
    text-decoration:none;
    transition:border-color .15s ease,background-color .15s ease;
}

.remittance-item:hover{
    border-color:#BDD0E1;
    background:#F8FAFC;
}

.remittance-item strong{
    display:block;
    font-size:11px;
}

.remittance-item span{
    display:block;
    margin-top:3px;
    color:#7B8794;
    font-size:9px;
}

.dashboard-status{
    display:inline-block!important;
    margin-top:4px!important;
    padding:3px 7px;
    border-radius:999px;
    font-size:8px!important;
    font-weight:800;
}

.dashboard-status.received{
    color:#027A48!important;
    background:#ECFDF3;
}

.dashboard-status.pending{
    color:#B54708!important;
    background:#FFF7E6;
}

.latest-shipment{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:12px;
    margin-top:14px;
    padding:13px;
    border-radius:12px;
    background:#F2F6FA;
    border:1px solid #DCE5ED;
}

.latest-shipment span{
    display:block;
    color:#7B8794;
    font-size:8px;
    font-weight:700;
    text-transform:uppercase;
    letter-spacing:.05em;
}

.latest-shipment strong{
    display:block;
    margin-top:3px;
    font-size:11px;
    color:#17365D;
}

.latest-shipment a{
    display:block;
    margin-top:4px;
    color:#17365D;
    font-size:9px;
    font-weight:700;
    text-decoration:none;
}

.dashboard-action-list{
    display:grid;
    gap:9px;
}

.dashboard-action-list a{
    display:block;
    padding:13px;
    border:1px solid #E4E9EF;
    border-radius:11px;
    color:#172033;
    text-decoration:none;
}

.dashboard-action-list a:hover{background:#F8FAFC}
.dashboard-action-list strong{display:block;font-size:11px}
.dashboard-action-list span{display:block;margin-top:3px;color:#7B8794;font-size:9px}

.empty-dashboard-state{
    padding:30px 12px;
    text-align:center;
    color:#8590A0;
    font-size:11px;
}

@media(max-width:900px){
    .dashboard-quick-actions{
        width:100%;
    }

    .dashboard-quick-actions .btn{
        flex:1 1 170px;
    }

    .dashboard-metric{
        min-height:120px;
    }
}

@media(max-width:520px){
    .dashboard-metric > strong{
        font-size:17px;
    }

    .trend-row{
        grid-template-columns:46px minmax(0,1fr);
        gap:8px;
    }

    .trend-bar-line{
        margin-right:62px;
    }

    .trend-bar-line small{
        width:58px;
        font-size:7px;
    }

    .dashboard-section-title,
    .panel-heading{
        align-items:flex-start;
    }
}


/* ==========================================================
   V1.7 — SAISIE GROUPÉE DES RECETTES
   ========================================================== */

.operation-switch{
    display:inline-flex;
    padding:4px;
    gap:4px;
    border:1px solid #DDE4EC;
    background:#F5F7FA;
    border-radius:12px;
}

.operation-switch-btn{
    min-width:130px;
    border:0 !important;
    color:#526071;
    background:transparent;
}

.btn-check:checked + .operation-switch-btn.income{
    background:#EAF9F0;
    color:#027A48;
    box-shadow:0 2px 8px rgba(2,122,72,.08);
}

.btn-check:checked + .operation-switch-btn.expense{
    background:#FFF0EE;
    color:#B42318;
    box-shadow:0 2px 8px rgba(180,35,24,.08);
}

.operation-section{
    border-top:1px solid #E8ECF1;
    padding-top:20px;
}

.operation-section-heading{
    display:flex;
    align-items:flex-start;
    justify-content:space-between;
    gap:20px;
    margin-bottom:16px;
}

.operation-section-heading > div:first-child > span{
    display:block;
    color:#F47B20;
    font-size:10px;
    font-weight:800;
    letter-spacing:.12em;
}

.operation-section-heading h6{
    margin:3px 0 4px;
    font-size:18px;
    font-weight:800;
    color:#172033;
}

.operation-section-heading p{
    margin:0;
    max-width:620px;
    color:#667085;
    font-size:13px;
    line-height:1.5;
}

.income-batch-total{
    min-width:190px;
    padding:12px 15px;
    border-radius:12px;
    background:linear-gradient(135deg,#17365D,#214C7B);
    color:#fff;
    text-align:right;
}

.income-batch-total span{
    display:block;
    color:#D9E7F5;
    font-size:10px;
    font-weight:700;
    text-transform:uppercase;
    letter-spacing:.06em;
}

.income-batch-total strong{
    display:block;
    margin-top:4px;
    font-size:20px;
    font-weight:800;
}

.income-grid{
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:10px;
}

.income-category-card{
    display:block;
    min-width:0;
    padding:12px;
    border:1px solid #DDE4EC;
    border-radius:12px;
    background:#FAFBFC;
    cursor:text;
    transition:border-color .15s ease,background-color .15s ease;
}

.income-category-card:focus-within{
    border-color:#8FB2D8;
    background:#fff;
}

.income-category-card > span{
    display:block;
    margin-bottom:7px;
    font-size:12px;
    font-weight:700;
    color:#344054;
}

.income-category-card .form-control{
    font-weight:700;
    text-align:right;
}

.income-category-card .input-group-text{
    font-size:11px;
    font-weight:700;
    color:#667085;
}

.dashboard-warning{
    font-size:13px;
}

@media(max-width:767px){
    .operation-switch{
        width:100%;
    }

    .operation-switch-btn{
        flex:1;
        min-width:0;
    }

    .operation-section-heading{
        flex-direction:column;
    }

    .income-batch-total{
        width:100%;
        text-align:left;
    }

    .income-grid{
        grid-template-columns:1fr;
    }
}


/* ==========================================================
   V1.8 — SYNCHRONISATION DES RUBRIQUES
   ========================================================== */

.category-sync-panel{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:24px;
    padding:18px 20px;
    border:1px solid #D9E4EF;
    border-radius:15px;
    background:linear-gradient(135deg,#F7FAFD,#EEF4FA);
}

.category-sync-panel > div:first-child{
    min-width:0;
}

.category-sync-panel > div:first-child > span{
    display:block;
    color:#F47B20;
    font-size:9px;
    font-weight:800;
    letter-spacing:.12em;
}

.category-sync-panel h2{
    margin:4px 0 4px;
    color:#17365D;
    font-size:17px;
    font-weight:800;
}

.category-sync-panel p{
    margin:0;
    max-width:780px;
    color:#667085;
    font-size:12px;
    line-height:1.55;
}

.category-sync-actions{
    flex:0 0 auto;
    display:flex;
    align-items:center;
    gap:8px;
    flex-wrap:wrap;
    justify-content:flex-end;
}

.category-sync-actions form{
    margin:0;
}

@media(max-width:900px){
    .category-sync-panel{
        align-items:flex-start;
        flex-direction:column;
    }

    .category-sync-actions{
        width:100%;
        justify-content:flex-start;
    }

    .category-sync-actions form,
    .category-sync-actions .btn{
        width:100%;
    }
}


/* ==========================================================
   V1.9 — MODALE OPÉRATION : ACTIONS TOUJOURS VISIBLES
   ========================================================== */

#txModal .modal-dialog{
    height:calc(100dvh - 16px);
    max-height:calc(100dvh - 16px);
    margin:8px auto;
}

#txModal .modal-content{
    height:100%;
    max-height:100%;
    overflow:hidden;
}

#txModal #transactionForm{
    display:flex;
    flex-direction:column;
    min-height:0;
    height:100%;
}

#txModal .modal-header{
    flex:0 0 auto;
    background:#fff;
    z-index:4;
}

#txModal .modal-body{
    flex:1 1 auto;
    min-height:0;
    overflow-y:auto;
    overscroll-behavior:contain;
    padding-bottom:24px;
}

#txModal .modal-footer{
    position:sticky;
    bottom:0;
    z-index:8;
    flex:0 0 auto;
    background:#fff;
    border-top:1px solid #E3E8EF;
    box-shadow:0 -10px 24px rgba(16,24,40,.08);
    padding:12px 18px;
}

#txModal .modal-footer .btn{
    min-width:130px;
}

@media(max-width:767px){
    #txModal .modal-dialog{
        width:calc(100% - 8px);
        height:calc(100dvh - 8px);
        max-height:calc(100dvh - 8px);
        margin:4px auto;
    }

    #txModal .modal-footer{
        display:grid;
        grid-template-columns:1fr 1fr;
        gap:8px;
    }

    #txModal .modal-footer .btn{
        width:100%;
        min-width:0;
        margin:0;
    }
}

/* ==========================================================
   V1.9 — BORDEREAU OFFICIEL INVERSÉ
   Localités verticales / rubriques horizontales
   ========================================================== */

.matrix-table-inverted{
    table-layout:fixed;
    width:100%;
}

.matrix-table-inverted th:first-child{
    width:150px;
    text-align:left;
    white-space:normal;
}

.matrix-table-inverted th,
.matrix-table-inverted td{
    font-size:10px;
}

.matrix-table-inverted thead th:not(:first-child),
.matrix-table-inverted td{
    white-space:nowrap;
}

.matrix-table-inverted .total-column{
    width:115px;
}

@media print{
    .matrix-table-inverted th,
    .matrix-table-inverted td{
        font-size:7.6px !important;
        padding:4px 4px !important;
    }

    .matrix-table-inverted th:first-child{
        width:78px !important;
    }

    .matrix-table-inverted .total-column{
        width:70px !important;
    }
}


/* ==========================================================
   V1.10 — ASSEMBLÉES / COMPTE DEV / MOT DE PASSE
   ========================================================== */

.assembly-hierarchy-info{
    display:flex;
    align-items:center;
    gap:10px;
    flex-wrap:wrap;
    padding:14px 17px;
    border:1px solid #D9E4EF;
    border-radius:13px;
    background:linear-gradient(135deg,#F7FAFD,#EEF4FA);
    color:#5C6979;
    font-size:13px;
}

.assembly-hierarchy-info strong{
    color:#17365D;
}

.assembly-hierarchy-info span::before{
    color:#F47B20;
}

.assembly-filter{
    width:min(260px,100%);
}

.developer-mini-badge{
    display:inline-flex;
    margin-left:6px;
    padding:3px 6px;
    border-radius:6px;
    background:#17365D;
    color:#fff;
    font-size:9px;
    font-weight:800;
    vertical-align:middle;
    letter-spacing:.05em;
}

.password-page-grid{
    display:grid;
    grid-template-columns:minmax(0,620px) minmax(280px,420px);
    gap:24px;
    align-items:start;
}

.password-card{
    padding:24px;
}

.password-field{
    position:relative;
}

.password-field .form-control{
    padding-right:88px;
}

.password-toggle{
    position:absolute;
    top:50%;
    right:7px;
    transform:translateY(-50%);
    border:0;
    border-radius:8px;
    padding:6px 9px;
    background:#EEF3F8;
    color:#17365D;
    font-size:11px;
    font-weight:700;
}

.password-requirements{
    margin-top:7px;
    color:#7A8594;
    font-size:11px;
    line-height:1.45;
}

.password-security-note{
    padding:24px;
    border-radius:17px;
    background:linear-gradient(150deg,#17365D,#0F2745);
    color:#fff;
    box-shadow:0 14px 35px rgba(23,54,93,.16);
}

.password-security-note > span{
    display:block;
    color:#F6A36A;
    font-size:9px;
    font-weight:800;
    letter-spacing:.12em;
}

.password-security-note h2{
    margin:6px 0 8px;
    font-size:20px;
    font-weight:800;
}

.password-security-note p{
    color:#D8E3F0;
    font-size:13px;
    line-height:1.6;
}

.developer-account-badge{
    margin-top:18px;
    padding:11px 13px;
    border:1px solid rgba(255,255,255,.18);
    border-radius:10px;
    background:rgba(255,255,255,.08);
    color:#fff;
    font-size:11px;
    font-weight:700;
}

@media(max-width:900px){
    .password-page-grid{
        grid-template-columns:1fr;
    }

    .password-top-btn{
        display:none;
    }
}


/* ==========================================================
   V1.11 — GESTION DES RUBRIQUES
   ========================================================== */

.category-list-heading{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:18px;
    margin-bottom:16px;
}

.category-list-heading p{
    margin:0;
    color:#667085;
    font-size:12px;
}

.category-archive-toggle{
    display:inline-flex;
    align-items:center;
    gap:7px;
    color:#526071;
    font-size:12px;
    font-weight:600;
    cursor:pointer;
    white-space:nowrap;
}

.category-archive-toggle input{
    width:16px;
    height:16px;
}

.category-management-table td{
    vertical-align:middle;
}

.category-actions{
    display:flex;
    justify-content:flex-end;
    align-items:center;
    gap:6px;
    flex-wrap:wrap;
}

.category-actions form{
    margin:0;
}

.category-system-badge{
    display:inline-flex;
    margin-left:7px;
    padding:3px 6px;
    border-radius:6px;
    background:#EEF3F8;
    color:#17365D;
    font-size:8px;
    font-weight:800;
    letter-spacing:.05em;
    vertical-align:middle;
}

.category-usage-count{
    display:inline-grid;
    min-width:29px;
    height:29px;
    place-items:center;
    padding:0 7px;
    border-radius:999px;
    background:#F2F4F7;
    color:#475467;
    font-size:11px;
    font-weight:700;
}

.category-status{
    display:inline-flex;
    align-items:center;
    gap:6px;
    font-size:11px;
    font-weight:700;
}

.category-status::before{
    content:'';
    width:7px;
    height:7px;
    border-radius:50%;
}

.category-status.active{
    color:#027A48;
}

.category-status.active::before{
    background:#12B76A;
}

.category-status.archived{
    color:#667085;
}

.category-status.archived::before{
    background:#98A2B3;
}

.category-archived-row{
    opacity:.68;
    background:#FAFAFA;
}

.category-create-card{
    position:sticky;
    top:94px;
}

@media(max-width:900px){
    .category-list-heading{
        align-items:flex-start;
        flex-direction:column;
    }

    .category-actions{
        justify-content:flex-start;
    }

    .category-create-card{
        position:static;
    }
}


/* V1.12 — saisie unique et validation TAss */
.assembly-accounting-rule{
    display:flex;justify-content:space-between;align-items:center;gap:20px;
    padding:16px 18px;border:1px solid #D9E4EF;border-radius:15px;
    background:linear-gradient(135deg,#F7FAFD,#EDF4FA)
}
.assembly-accounting-rule span,.pending-validation-heading span{
    display:block;color:#F47B20;font-size:9px;font-weight:800;letter-spacing:.11em
}
.assembly-accounting-rule strong{
    display:block;margin:3px 0;color:#17365D;font-size:15px
}
.assembly-accounting-rule p{
    margin:0;color:#667085;font-size:12px
}
.assembly-pending-counter{
    flex:0 0 auto;display:grid;place-items:center;min-width:74px;min-height:67px;
    border-radius:12px;background:#17365D;color:#fff;font-size:23px;font-weight:800
}
.assembly-pending-counter small{font-size:9px;color:#D8E3F0}
.pending-validation-section{
    overflow:hidden;border:1px solid #F4D6B8;border-radius:16px;background:#fff;
    box-shadow:0 8px 25px rgba(16,24,40,.05)
}
.pending-validation-heading{
    display:flex;justify-content:space-between;align-items:center;gap:18px;
    padding:16px 18px;background:#FFF8F1;border-bottom:1px solid #F8E3CF
}
.pending-validation-heading h2{
    margin:2px 0;color:#17365D;font-size:17px;font-weight:800
}
.pending-validation-heading p{margin:0;color:#7A6251;font-size:11px}
.pending-validation-heading>strong{
    display:grid;place-items:center;min-width:42px;height:42px;border-radius:50%;
    background:#F47B20;color:#fff;font-size:15px
}
.validation-actions{display:flex;justify-content:flex-end;gap:6px}
.validation-actions form{margin:0}
.transaction-status{display:inline-flex;align-items:center;gap:6px;font-size:11px;font-weight:700}
.transaction-status:before{content:'';width:7px;height:7px;border-radius:50%}
.transaction-status.approved{color:#027A48}.transaction-status.approved:before{background:#12B76A}
.transaction-status.pending{color:#B54708}.transaction-status.pending:before{background:#F79009}
.transaction-status.rejected{color:#B42318}.transaction-status.rejected:before{background:#F04438}
.transaction-rejected{opacity:.66}
.duplicate-override-box{
    padding:12px 14px;border:1px dashed #D0D5DD;border-radius:11px;background:#FAFAFA
}
.duplicate-override-box label{
    display:flex;align-items:flex-start;gap:8px;margin:0;color:#344054;font-size:12px;
    font-weight:700;cursor:pointer
}
.duplicate-override-box input{margin-top:2px}
.duplicate-override-box small{
    display:block;margin:5px 0 0 24px;color:#667085;font-size:10px;line-height:1.4
}
.assembly-role-callout{
    padding:10px 12px;border-radius:9px;background:#EEF4FA;color:#17365D;
    font-size:12px;font-weight:800
}
@media(max-width:767px){
    .assembly-accounting-rule,.pending-validation-heading{align-items:flex-start}
    .assembly-accounting-rule{flex-direction:column}
    .assembly-pending-counter{width:100%;min-height:54px}
    .validation-actions{flex-direction:column;align-items:stretch}
    .validation-actions .btn{width:100%}
}


/* ==========================================================
   V1.12.1 — FINANCES : ÉCRAN DE SECOURS / MIGRATION
   ========================================================== */

.finance-schema-warning{
    display:flex;
    align-items:flex-start;
    gap:18px;
    max-width:920px;
    padding:24px;
    border:1px solid #F3D5B7;
    border-radius:18px;
    background:linear-gradient(135deg,#FFFDFB,#FFF7EF);
    box-shadow:0 12px 35px rgba(16,24,40,.06);
}

.finance-schema-warning-icon{
    flex:0 0 auto;
    display:grid;
    place-items:center;
    width:48px;
    height:48px;
    border-radius:14px;
    background:#F47B20;
    color:#fff;
    font-size:24px;
    font-weight:900;
}

.finance-schema-warning-content{
    min-width:0;
}

.finance-schema-warning-content > span{
    display:block;
    color:#F47B20;
    font-size:9px;
    font-weight:800;
    letter-spacing:.12em;
}

.finance-schema-warning-content h2{
    margin:4px 0 8px;
    color:#17365D;
    font-size:20px;
    font-weight:800;
}

.finance-schema-warning-content p{
    max-width:720px;
    color:#667085;
    line-height:1.6;
}

.finance-schema-details summary{
    cursor:pointer;
    color:#17365D;
    font-size:12px;
    font-weight:700;
}

.finance-schema-details ul{
    margin:9px 0 0;
    padding-left:20px;
    color:#667085;
    font-size:11px;
}

.finance-dev-error{
    margin-top:14px;
    padding:12px 14px;
    border-radius:10px;
    background:#172033;
    color:#F7FAFC;
    font-family:ui-monospace,SFMono-Regular,Menlo,monospace;
    font-size:11px;
    line-height:1.55;
    overflow-wrap:anywhere;
}

@media(max-width:700px){
    .finance-schema-warning{
        flex-direction:column;
        padding:18px;
    }
}


/* ==========================================================
   V1.12.3 — IMEG AUTOMATIQUE + OUTILS DEV
   ========================================================== */

.imeg-auto-info{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:20px;
    padding:14px 17px;
    border:1px solid #D7E5F2;
    border-radius:14px;
    background:linear-gradient(135deg,#F5F9FD,#EDF4FA);
}

.imeg-auto-info span{
    display:block;
    color:#F47B20;
    font-size:9px;
    font-weight:800;
    letter-spacing:.1em;
}

.imeg-auto-info strong{
    display:block;
    margin-top:3px;
    color:#17365D;
    font-size:15px;
}

.imeg-auto-info p{
    max-width:700px;
    margin:0;
    color:#667085;
    font-size:11px;
    line-height:1.5;
}

.developer-tools-grid{
    display:grid;
    grid-template-columns:minmax(0,1fr) minmax(360px,.8fr);
    gap:24px;
    align-items:start;
}

.developer-tools-kicker,
.developer-danger-zone > span{
    display:block;
    color:#F47B20;
    font-size:9px;
    font-weight:800;
    letter-spacing:.12em;
}

.developer-count-grid{
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:12px;
    margin-top:18px;
}

.developer-count-grid > div{
    padding:14px;
    border:1px solid #E2E8F0;
    border-radius:12px;
    background:#F8FAFC;
}

.developer-count-grid span{
    display:block;
    color:#667085;
    font-size:10px;
}

.developer-count-grid strong{
    display:block;
    margin-top:4px;
    color:#17365D;
    font-size:23px;
}

.developer-danger-zone{
    padding:24px;
    border:1px solid #FDA29B;
    border-radius:17px;
    background:#FFF7F6;
}

.developer-danger-zone h2{
    margin:5px 0 8px;
    color:#912018;
    font-size:20px;
    font-weight:800;
}

.developer-danger-zone p{
    color:#7A271A;
    font-size:12px;
    line-height:1.6;
}

.developer-preserved-list{
    padding:12px 14px;
    border-radius:10px;
    background:#FFF;
    border:1px solid #FECACA;
    color:#5F1D16;
    font-size:11px;
    line-height:1.5;
}

@media(max-width:900px){
    .developer-tools-grid{
        grid-template-columns:1fr;
    }

    .imeg-auto-info{
        align-items:flex-start;
        flex-direction:column;
    }
}


/* ==========================================================
   V1.12.4 — DÎMES → IMEG 10 % → ENVELOPPE
   ========================================================== */

.metric-imeg{
    border-color:#F3D5B7 !important;
    background:linear-gradient(135deg,#FFFDFB,#FFF7EF) !important;
}

.metric-imeg strong{
    color:#B54708 !important;
}

.imeg-wallet-hero{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:22px;
    padding:20px 22px;
    border:1px solid #D7E5F2;
    border-radius:17px;
    background:linear-gradient(135deg,#F4F8FC,#EAF2F9);
}

.imeg-wallet-hero > div:first-child > span,
.dashboard-imeg-strip span{
    display:block;
    color:#F47B20;
    font-size:9px;
    font-weight:800;
    letter-spacing:.11em;
}

.imeg-wallet-hero h2{
    margin:4px 0 4px;
    color:#17365D;
    font-size:22px;
    font-weight:800;
}

.imeg-wallet-hero p{
    margin:0;
    color:#667085;
    font-size:12px;
}

.imeg-wallet-mini-stats{
    display:grid;
    grid-template-columns:repeat(2,minmax(120px,1fr));
    gap:10px;
}

.imeg-wallet-mini-stats > div{
    min-width:140px;
    padding:12px 14px;
    border:1px solid rgba(23,54,93,.10);
    border-radius:11px;
    background:rgba(255,255,255,.72);
}

.imeg-wallet-mini-stats span{
    display:block;
    color:#667085;
    font-size:9px;
}

.imeg-wallet-mini-stats strong{
    display:block;
    margin-top:3px;
    color:#17365D;
    font-size:15px;
}

.imeg-contribution-row{
    background:#FFF9F3;
}

.imeg-auto-badge{
    display:inline-flex;
    margin-left:7px;
    padding:3px 7px;
    border-radius:999px;
    background:#FFF0E1;
    color:#B54708;
    font-size:8px;
    font-weight:800;
    letter-spacing:.04em;
    vertical-align:middle;
}

.imeg-max-hint{
    display:block;
    margin-top:5px;
    color:#B54708;
    font-size:9px;
    font-weight:700;
}

.imeg-wallet-table td,
.imeg-wallet-table th{
    white-space:nowrap;
}

.dashboard-imeg-strip{
    display:grid;
    grid-template-columns:auto auto 1fr;
    align-items:center;
    gap:24px;
    padding:14px 17px;
    border:1px solid #F3D5B7;
    border-radius:14px;
    background:#FFF9F3;
}

.dashboard-imeg-strip strong{
    display:block;
    margin-top:2px;
    color:#17365D;
    font-size:16px;
}

.dashboard-imeg-strip p{
    margin:0;
    color:#7A6251;
    font-size:11px;
    line-height:1.5;
}

@media(max-width:800px){
    .imeg-wallet-hero{
        align-items:flex-start;
        flex-direction:column;
    }

    .imeg-wallet-mini-stats{
        width:100%;
    }

    .imeg-wallet-mini-stats > div{
        min-width:0;
    }

    .dashboard-imeg-strip{
        grid-template-columns:1fr 1fr;
    }

    .dashboard-imeg-strip p{
        grid-column:1 / -1;
    }
}

@media(max-width:520px){
    .imeg-wallet-mini-stats,
    .dashboard-imeg-strip{
        grid-template-columns:1fr;
    }

    .dashboard-imeg-strip p{
        grid-column:auto;
    }
}


/* ==========================================================
   V1.12.5 — ACTIONS COMPTE DANS LA SIDEBAR MOBILE
   ========================================================== */

.sidebar-mobile-actions{
    display:none;
}

@media(max-width:900px){
    /*
     * La sidebar mobile devient une colonne fixe sur toute la hauteur
     * de l'écran. Le menu central scrolle, mais les actions compte
     * restent accessibles en bas.
     */
    .sidebar{
        display:flex;
        flex-direction:column;
        width:min(86vw,300px);
        height:100vh;
        height:100dvh;
        max-height:100dvh;
        overflow:hidden;
        padding:
            max(16px,env(safe-area-inset-top))
            14px
            max(12px,env(safe-area-inset-bottom));
    }

    .sidebar .brand{
        flex:0 0 auto;
        padding-bottom:14px;
    }

    .sidebar nav{
        flex:1 1 auto;
        min-height:0;
        overflow-y:auto;
        overscroll-behavior:contain;
        -webkit-overflow-scrolling:touch;
        padding-right:3px;
        padding-bottom:12px;
        scrollbar-width:thin;
    }

    .sidebar-mobile-actions{
        display:block;
        flex:0 0 auto;
        padding-top:12px;
        border-top:1px solid rgba(255,255,255,.14);
        background:
            linear-gradient(
                180deg,
                rgba(15,39,69,0),
                rgba(15,39,69,.20) 18%,
                rgba(15,39,69,.38)
            );
    }

    .sidebar-mobile-user{
        padding:0 10px 10px;
        min-width:0;
    }

    .sidebar-mobile-user strong{
        display:block;
        color:#fff;
        font-size:12px;
        font-weight:700;
        white-space:nowrap;
        overflow:hidden;
        text-overflow:ellipsis;
    }

    .sidebar-mobile-user span{
        display:block;
        margin-top:2px;
        color:#bfcde0;
        font-size:9px;
        line-height:1.35;
        white-space:nowrap;
        overflow:hidden;
        text-overflow:ellipsis;
    }

    .sidebar-account-action{
        width:100%;
        min-height:43px;
        display:flex;
        align-items:center;
        gap:10px;
        padding:10px 12px;
        border:0;
        border-radius:10px;
        background:transparent;
        color:#e8eff7;
        text-decoration:none;
        font-family:inherit;
        font-size:11px;
        font-weight:700;
        text-align:left;
        cursor:pointer;
    }

    .sidebar-account-action:hover,
    .sidebar-account-action:focus{
        background:rgba(255,255,255,.10);
        color:#fff;
    }

    .sidebar-account-icon{
        width:24px;
        height:24px;
        display:grid;
        place-items:center;
        flex:0 0 24px;
        border-radius:7px;
        background:rgba(255,255,255,.10);
        font-size:12px;
    }

    .sidebar-logout-form{
        margin:2px 0 0;
    }

    .sidebar-logout-btn{
        appearance:none;
        -webkit-appearance:none;
        color:#ffd8d4;
    }

    .sidebar-logout-btn:hover,
    .sidebar-logout-btn:focus{
        background:rgba(240,68,56,.16);
        color:#fff;
    }

    /*
     * Sur mobile, les deux actions ne sont plus nécessaires dans
     * le topbar : elles sont volontairement déplacées dans la sidebar.
     * Le bouton d'installation PWA peut rester géré séparément.
     */
    .topbar .password-top-btn,
    .topbar-actions form{
        display:none;
    }
}

@media(min-width:901px){
    .sidebar-mobile-actions{
        display:none !important;
    }
}


/* ==========================================================
   V1.12.6 — SIDEBAR MOBILE TOTALEMENT HORS ÉCRAN
   ========================================================== */

@media(max-width:900px){
    /*
     * Ne plus utiliser un décalage fixe (-280px) :
     * la sidebar peut mesurer jusqu'à 300px.
     * translateX(-100%) garantit qu'aucune bande ne reste visible.
     */
    .sidebar{
        left:0 !important;
        transform:translateX(-100%);
        transition:transform .22s ease !important;
        will-change:transform;
    }

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


/* ==========================================================
   V1.12.7 — FILTRES TG / STATS TAss / REÇU ASSEMBLÉE
   ========================================================== */

.stats-filter-card{
    padding:16px 18px;
    border:1px solid #D9E4EF;
    border-radius:15px;
    background:#fff;
    box-shadow:0 8px 24px rgba(16,24,40,.04);
}

.stats-filter-form{
    display:grid;
    grid-template-columns:minmax(190px,1fr) minmax(220px,1fr) auto auto;
    gap:12px;
    align-items:end;
}

.stats-filter-card > small{
    display:block;
    margin-top:10px;
    color:#667085;
    font-size:10px;
    line-height:1.5;
}

.metric-pending{
    border-color:#F4D6B8 !important;
    background:linear-gradient(135deg,#FFFDFB,#FFF7EF) !important;
}

.metric-pending strong{
    color:#B54708 !important;
}

.tass-privacy-card{
    padding:17px;
    border:1px solid #D7E5F2;
    border-radius:13px;
    background:#F5F9FD;
}

.tass-privacy-card strong{
    display:block;
    color:#17365D;
    font-size:14px;
}

.tass-privacy-card p{
    margin:6px 0 14px;
    color:#667085;
    font-size:11px;
    line-height:1.55;
}

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

.tass-summary-list > div{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:18px;
    padding:12px 14px;
    border:1px solid #E2E8F0;
    border-radius:11px;
    background:#F8FAFC;
}

.tass-summary-list span{
    color:#667085;
    font-size:10px;
}

.tass-summary-list strong{
    color:#17365D;
    font-size:13px;
    white-space:nowrap;
}

.transaction-receipt-link{
    display:inline-flex;
    margin-left:7px;
    padding:2px 7px;
    border-radius:999px;
    background:#EEF4FA;
    color:#17365D;
    font-size:8px;
    font-weight:800;
    text-decoration:none;
    vertical-align:middle;
}

.transaction-receipt-link:hover{
    background:#DCE8F4;
    color:#0F2948;
}

.receipt-imeg-note{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:18px;
    margin:14px 0;
    padding:13px 15px;
    border:1px solid #F3D5B7;
    border-radius:11px;
    background:#FFF8EF;
}

.receipt-imeg-note span{
    display:block;
    color:#B54708;
    font-size:8px;
    font-weight:800;
    letter-spacing:.08em;
}

.receipt-imeg-note strong{
    display:block;
    margin-top:3px;
    color:#B54708;
    font-size:16px;
}

.receipt-imeg-note p{
    max-width:470px;
    margin:0;
    color:#7A6251;
    font-size:10px;
    line-height:1.5;
}

.status-danger{
    background:#FFF1F0 !important;
    color:#B42318 !important;
}

.local-revenue-receipt{
    max-width:860px;
}

@media(max-width:980px){
    .stats-filter-form{
        grid-template-columns:1fr 1fr;
    }

    .stats-filter-form .btn{
        width:100%;
    }
}

@media(max-width:620px){
    .stats-filter-form{
        grid-template-columns:1fr;
    }

    .receipt-imeg-note{
        align-items:flex-start;
        flex-direction:column;
    }
}

@media print{
    .stats-filter-card{
        display:none !important;
    }
}


/* ==========================================================
   V1.12.8 — ARCHIVES PERMANENTES DES REÇUS TAss
   ========================================================== */

.assembly-export-intro{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:20px;
    padding:18px 20px;
    border:1px solid #D7E5F2;
    border-radius:16px;
    background:linear-gradient(135deg,#F5F9FD,#EDF4FA);
}

.assembly-export-intro span{
    display:block;
    color:#F47B20;
    font-size:9px;
    font-weight:800;
    letter-spacing:.12em;
}

.assembly-export-intro strong{
    display:block;
    margin-top:4px;
    color:#17365D;
    font-size:16px;
}

.assembly-export-intro p{
    margin:5px 0 0;
    max-width:680px;
    color:#667085;
    font-size:11px;
    line-height:1.55;
}

.assembly-export-icon{
    flex:0 0 auto;
    display:grid;
    place-items:center;
    width:54px;
    height:54px;
    border-radius:14px;
    background:#17365D;
    color:#fff;
    font-size:12px;
    font-weight:900;
    letter-spacing:.06em;
}

.assembly-export-filter{
    display:grid;
    grid-template-columns:minmax(180px,1fr) minmax(180px,1fr) auto auto;
    gap:12px;
    align-items:end;
}

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

.assembly-receipt-card{
    display:grid;
    grid-template-columns:minmax(0,1fr) auto;
    gap:18px;
    align-items:center;
    padding:14px 15px;
    border:1px solid #E2E8F0;
    border-radius:13px;
    background:#fff;
    transition:
        border-color .16s ease,
        box-shadow .16s ease,
        transform .16s ease;
}

.assembly-receipt-card:hover{
    border-color:#C7D7E8;
    box-shadow:0 8px 24px rgba(16,24,40,.06);
    transform:translateY(-1px);
}

.assembly-receipt-main{
    display:flex;
    align-items:center;
    gap:15px;
    min-width:0;
}

.assembly-receipt-ref{
    flex:0 0 auto;
    min-width:118px;
    padding:9px 11px;
    border-radius:10px;
    background:#F4F7FB;
}

.assembly-receipt-ref span{
    display:block;
    color:#667085;
    font-size:8px;
    font-weight:800;
    letter-spacing:.04em;
}

.assembly-receipt-ref strong{
    display:block;
    margin-top:3px;
    color:#17365D;
    font-size:11px;
}

.assembly-receipt-content{
    min-width:0;
}

.assembly-receipt-topline{
    display:flex;
    align-items:center;
    gap:9px;
    flex-wrap:wrap;
}

.assembly-receipt-created{
    color:#98A2B3;
    font-size:9px;
}

.assembly-receipt-content p{
    margin:6px 0 0;
    color:#475467;
    font-size:10px;
    line-height:1.5;
    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
}

.assembly-receipt-side{
    display:flex;
    align-items:center;
    gap:14px;
}

.assembly-receipt-side > strong{
    color:#17365D;
    font-size:13px;
    white-space:nowrap;
}

@media(max-width:760px){
    .assembly-export-filter{
        grid-template-columns:1fr 1fr;
    }

    .assembly-export-filter .btn{
        width:100%;
    }

    .assembly-receipt-card{
        grid-template-columns:1fr;
        gap:12px;
    }

    .assembly-receipt-side{
        justify-content:space-between;
    }
}

@media(max-width:520px){
    .assembly-export-intro{
        align-items:flex-start;
    }

    .assembly-export-icon{
        display:none;
    }

    .assembly-export-filter{
        grid-template-columns:1fr;
    }

    .assembly-receipt-main{
        align-items:flex-start;
        flex-direction:column;
        gap:10px;
    }

    .assembly-receipt-ref{
        width:100%;
    }

    .assembly-receipt-content{
        width:100%;
    }

    .assembly-receipt-content p{
        white-space:normal;
    }

    .assembly-receipt-side{
        align-items:stretch;
        flex-direction:column;
    }

    .assembly-receipt-side .btn{
        width:100%;
    }
}


/* V1.12.9 — Dépenses ponctuelles / libres */
#incidentalExpenseHelp{
    display:block;
    margin-top:5px;
    color:#B54708;
    font-size:9px;
    font-weight:700;
    line-height:1.45;
}
#incidentalExpenseHelp.d-none{
    display:none !important;
}
.category-system-badge + .category-system-badge{
    margin-left:4px;
}


/* ==========================================================
   V1.12.10 — ACTIONS DU COMPTE PERMANENTES DANS LA SIDEBAR
   ========================================================== */

/*
 * Desktop and mobile:
 * - brand fixed at top;
 * - main navigation scrolls independently;
 * - account actions remain pinned at bottom.
 */
.sidebar{
    display:flex;
    flex-direction:column;
    overflow:hidden;
}

.sidebar .brand{
    flex:0 0 auto;
}

.sidebar nav{
    flex:1 1 auto;
    min-height:0;
    overflow-y:auto;
    overscroll-behavior:contain;
    -webkit-overflow-scrolling:touch;
    padding-right:3px;
    padding-bottom:12px;
    scrollbar-width:thin;
}

.sidebar-account-actions{
    display:block;
    flex:0 0 auto;
    padding-top:12px;
    border-top:1px solid rgba(255,255,255,.14);
}

.sidebar-account-user{
    padding:0 10px 10px;
    min-width:0;
}

.sidebar-account-kicker{
    display:block;
    margin-bottom:4px;
    color:#9FB2C9;
    font-size:8px;
    font-weight:800;
    letter-spacing:.11em;
}

.sidebar-account-user strong{
    display:block;
    color:#FFFFFF;
    font-size:11px;
    font-weight:700;
    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
}

.sidebar-account-user small{
    display:block;
    margin-top:2px;
    color:#BFCDE0;
    font-size:8px;
    line-height:1.35;
    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
}

.sidebar-account-action{
    width:100%;
    min-height:41px;
    display:flex;
    align-items:center;
    gap:9px;
    padding:9px 10px;
    border:0;
    border-radius:9px;
    background:transparent;
    color:#E4ECF5;
    text-decoration:none;
    font-family:inherit;
    font-size:10px;
    font-weight:700;
    text-align:left;
    cursor:pointer;
    transition:
        background-color .16s ease,
        color .16s ease;
}

.sidebar-account-action:hover,
.sidebar-account-action:focus,
.sidebar-account-action.active{
    background:rgba(255,255,255,.10);
    color:#FFFFFF;
}

.sidebar-account-icon{
    width:23px;
    height:23px;
    display:grid;
    place-items:center;
    flex:0 0 23px;
    border-radius:7px;
    background:rgba(255,255,255,.10);
    color:#FFFFFF;
    font-size:11px;
    font-weight:800;
}

.sidebar-install-action{
    color:#DCEEFF;
}

.sidebar-install-action .sidebar-account-icon{
    background:rgba(77,158,255,.18);
}

.sidebar-logout-form{
    margin:2px 0 0;
}

.sidebar-logout-btn{
    appearance:none;
    -webkit-appearance:none;
    color:#FFD7D3;
}

.sidebar-logout-btn:hover,
.sidebar-logout-btn:focus{
    background:rgba(240,68,56,.16);
    color:#FFFFFF;
}

/*
 * The old V1.12.5 class remains unused in the new layout.
 * Force it out of the flow if a stale cached fragment is ever mixed in.
 */
.sidebar-mobile-actions{
    display:none !important;
}

/*
 * The topbar is now intentionally limited to:
 * hamburger (mobile) + current user identity.
 */
.topbar-actions{
    display:none !important;
}

@media(min-width:901px){
    .sidebar{
        height:100vh;
        height:100dvh;
    }

    /*
     * Keep the account block visually compact on desktop.
     */
    .sidebar-account-actions{
        margin-top:8px;
    }
}

@media(max-width:900px){
    .sidebar{
        height:100vh;
        height:100dvh;
        max-height:100dvh;
    }

    .sidebar-account-actions{
        padding-bottom:max(
            2px,
            env(safe-area-inset-bottom)
        );
    }

    /*
     * Keep V1.12.6 behavior:
     * the closed sidebar must be fully outside the viewport.
     */
    .sidebar{
        left:0 !important;
        transform:translateX(-100%);
        transition:transform .22s ease !important;
        will-change:transform;
    }

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


/* ==========================================================
   V1.12.11 — FILTRES AUTOMATIQUES
   ========================================================== */

.auto-filter-form{
    position:relative;
}

.auto-filter-state{
    min-height:40px;
    display:flex;
    align-items:center;
    justify-content:center;
    gap:7px;
    padding:8px 12px;
    border:1px solid #DCE5EF;
    border-radius:10px;
    background:#F8FAFC;
    color:#667085;
    font-size:9px;
    font-weight:700;
    white-space:nowrap;
}

.auto-filter-dot{
    width:7px;
    height:7px;
    flex:0 0 7px;
    border-radius:50%;
    background:#12B76A;
    box-shadow:0 0 0 3px rgba(18,183,106,.10);
}

.auto-filter-state.is-loading .auto-filter-dot{
    background:#F79009;
    box-shadow:0 0 0 3px rgba(247,144,9,.12);
    animation:autoFilterPulse .75s ease-in-out infinite alternate;
}

.auto-filter-form.is-filtering{
    pointer-events:none;
    opacity:.82;
}

@keyframes autoFilterPulse{
    from{
        transform:scale(.85);
        opacity:.65;
    }
    to{
        transform:scale(1.15);
        opacity:1;
    }
}

/*
 * Dashboard: 2 filters + automatic-state + reset.
 */
.stats-filter-form{
    grid-template-columns:
        minmax(190px,1fr)
        minmax(220px,1fr)
        auto
        auto;
}

/*
 * Receipts: month + status + automatic-state + reset.
 */
.assembly-export-filter{
    grid-template-columns:
        minmax(180px,1fr)
        minmax(180px,1fr)
        auto
        auto;
}

@media(max-width:980px){
    .stats-filter-form,
    .assembly-export-filter{
        grid-template-columns:1fr 1fr;
    }
}

@media(max-width:620px){
    .stats-filter-form,
    .assembly-export-filter{
        grid-template-columns:1fr;
    }

    .auto-filter-state{
        width:100%;
    }
}

/* V1.14 — common entry view for local receipts and remittances. */
.unified-entry-form { padding: 0; overflow: visible; }
.entry-form-body { padding: clamp(16px, 3vw, 28px); }
.unified-entry-form .operation-section-heading h2 { font-size: 1.1rem; margin: 4px 0; }
.entry-contributions { padding-top: 24px; border-top: 1px solid #e4e9f0; }
.unified-entry-form .income-category-card { min-width: 0; }
.unified-entry-form .income-category-card > label { font-weight: 650; margin-bottom: 10px; }
.entry-imeg-card { background: #f4f8ff; border-color: #b8cceb; }
.entry-imeg-card small { display: block; line-height: 1.5; margin-top: 10px; }
.entry-form-footer { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 18px 28px; border-top: 1px solid #e4e9f0; background: #fff; border-radius: 0 0 18px 18px; }
.entry-success { border-left: 4px solid #13804f; }
@media (max-width: 575px) {
    .unified-entry-form .operation-section-heading { align-items: stretch; flex-direction: column; gap: 12px; }
    .unified-entry-form .income-grid { grid-template-columns: 1fr; }
    .entry-form-footer { padding: 16px; }
    .entry-form-footer > * { width: 100%; }
    .unified-entry-form .transaction-type-switch { display: flex; flex-wrap: wrap; }
}
