* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family:
        Inter,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;
    background: #f4f6f8;
    color: #20242a;
}

.topbar {
    background: #17212b;
    color: white;
    padding: 20px 30px;
}

.brand {
    font-size: 24px;
    font-weight: 700;
}

.subtitle {
    opacity: .65;
    font-size: 13px;
    margin-top: 2px;
}

.nav {
    background: white;
    padding: 0 24px;
    display: flex;
    flex-wrap: wrap;
    gap: 3px;
    border-bottom: 1px solid #dde2e7;
}

.nav a {
    padding: 14px 12px;
    color: #39424e;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
}

.nav a:hover {
    background: #f1f3f5;
}

.container {
    max-width: 1350px;
    margin: 28px auto;
    padding: 0 20px;
}

h1 {
    margin: 0 0 22px;
    font-size: 28px;
}

h2 {
    margin-top: 0;
    font-size: 19px;
}

.grid {
    display: grid;
    grid-template-columns:
        repeat(auto-fit, minmax(260px, 1fr));
    gap: 18px;
}

.card {
    background: white;
    border-radius: 12px;
    border: 1px solid #e2e6ea;
    padding: 20px;
}

.card-big {
    grid-column: 1 / -1;
}

.stat {
    font-size: 28px;
    font-weight: 700;
    margin-top: 6px;
}

.muted {
    color: #727c87;
    font-size: 13px;
}

.success {
    color: #267447;
}

.warning {
    color: #ad6800;
}

.danger {
    color: #b42318;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

th,
td {
    padding: 10px 8px;
    border-bottom: 1px solid #edf0f2;
    text-align: left;
}

th {
    color: #64707c;
    font-size: 12px;
    text-transform: uppercase;
}

.num {
    text-align: right;
    white-space: nowrap;
}

form.inline-grid {
    display: grid;
    grid-template-columns:
        repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    align-items: end;
}

label {
    display: block;
    font-size: 12px;
    color: #67717d;
    font-weight: 600;
    margin-bottom: 5px;
}

input,
select,
textarea {
    width: 100%;
    border: 1px solid #ccd3da;
    border-radius: 8px;
    padding: 10px 11px;
    background: white;
    font-size: 14px;
}

button,
.button {
    display: inline-block;
    border: 0;
    border-radius: 8px;
    padding: 10px 15px;
    background: #17212b;
    color: white;
    text-decoration: none;
    font-weight: 600;
    cursor: pointer;
}

button:hover,
.button:hover {
    opacity: .88;
}

.badge {
    display: inline-block;
    padding: 4px 8px;
    background: #edf1f4;
    border-radius: 999px;
    font-size: 12px;
}

.amount-positive {
    color: #267447;
}

.separator {
    height: 1px;
    background: #e7eaed;
    margin: 20px 0;
}

.empty {
    color: #79838e;
    padding: 20px 0;
}

.transfer {
    padding: 11px 0;
    border-bottom: 1px solid #edf0f2;
}

.transfer strong {
    display: block;
}

footer {
    text-align: center;
    color: #98a0a8;
    font-size: 12px;
    padding: 25px;
}

@media (max-width: 700px) {
    .container {
        padding: 0 12px;
    }

    .topbar {
        padding: 18px;
    }

    th,
    td {
        padding: 8px 4px;
        font-size: 12px;
    }
}

.button.secondary {
    background: #e9edf1;
    color: #26313c;
}

textarea {
    min-height: 90px;
    resize: vertical;
}



/* ==========================================================
   C3D BUDGET V0.3
   ========================================================== */

:root {
    --bg: #f4f6f8;
    --card: #ffffff;
    --ink: #17212b;
    --muted: #6b7785;
    --line: #e2e7ec;
    --soft: #f7f9fa;
    --green: #24764a;
    --orange: #b66500;
    --red: #b42318;
}

body {
    background: var(--bg);
}

.topbar {
    position: relative;
}

.nav {
    position: sticky;
    top: 0;
    z-index: 50;
    box-shadow: 0 1px 8px rgba(0,0,0,.04);
}

.nav a {
    border-bottom: 3px solid transparent;
}

.nav a:hover {
    border-bottom-color: #17212b;
}

.page-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    margin-bottom: 22px;
}

.page-head h1 {
    margin-bottom: 4px;
}

.page-subtitle {
    color: var(--muted);
    font-size: 14px;
}

.kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(180px, 1fr));
    gap: 14px;
    margin-bottom: 18px;
}

.kpi {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 17px 18px;
}

.kpi-label {
    color: var(--muted);
    font-size: 12px;
    margin-bottom: 6px;
}

.kpi-value {
    color: var(--ink);
    font-size: 25px;
    font-weight: 750;
    line-height: 1.15;
}

.kpi-note {
    color: var(--muted);
    font-size: 11px;
    margin-top: 6px;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 16px;
}

.span-4 {
    grid-column: span 4;
}

.span-5 {
    grid-column: span 5;
}

.span-6 {
    grid-column: span 6;
}

.span-7 {
    grid-column: span 7;
}

.span-8 {
    grid-column: span 8;
}

.span-12 {
    grid-column: span 12;
}

.chart-box {
    position: relative;
    min-height: 290px;
}

.chart-box.small {
    min-height: 245px;
}

.section-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.section-title h2 {
    margin: 0;
}

.progress-row {
    margin: 14px 0;
}

.progress-head {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 6px;
    font-size: 13px;
}

.progress-track {
    height: 8px;
    background: #edf0f2;
    border-radius: 999px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: #263747;
    border-radius: inherit;
}

.person-summary {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px 15px;
    padding: 14px 0;
    border-bottom: 1px solid var(--line);
}

.person-summary:last-child {
    border-bottom: 0;
}

.person-name {
    font-weight: 700;
}

.person-rest {
    font-size: 20px;
    font-weight: 750;
}

.good {
    color: var(--green);
}

.warning-box {
    border: 1px solid #e7b65c;
    background: #fff9ed;
    border-radius: 10px;
    padding: 14px;
}

.warning-box + .warning-box {
    margin-top: 10px;
}

.ok-box {
    border: 1px solid #a9d4b9;
    background: #f1faf4;
    border-radius: 10px;
    padding: 14px;
}

.prepare-summary {
    display: grid;
    grid-template-columns: repeat(2, minmax(250px, 1fr));
    gap: 14px;
    margin-bottom: 18px;
}

.transfer-person {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 18px;
}

.transfer-person .amount {
    font-size: 28px;
    font-weight: 750;
    margin: 7px 0 3px;
}

.compact-table td,
.compact-table th {
    padding-top: 9px;
    padding-bottom: 9px;
}

.detail-button {
    padding: 7px 10px;
    border-radius: 7px;
    background: #edf1f4;
    color: #24313e;
    font-size: 12px;
}

.detail-button:hover {
    background: #dfe5ea;
    opacity: 1;
}

dialog.budget-dialog {
    width: min(900px, calc(100vw - 32px));
    max-height: 82vh;
    padding: 0;
    border: 0;
    border-radius: 14px;
    box-shadow: 0 24px 90px rgba(0,0,0,.30);
}

dialog.budget-dialog::backdrop {
    background: rgba(16,24,32,.52);
    backdrop-filter: blur(2px);
}

.dialog-head {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    align-items: center;
    padding: 18px 20px;
    border-bottom: 1px solid var(--line);
}

.dialog-head h2 {
    margin: 0;
}

.dialog-body {
    padding: 20px;
    overflow: auto;
    max-height: 65vh;
}

.dialog-close {
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: 50%;
    font-size: 19px;
}

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

.metric-mini {
    background: var(--soft);
    border-radius: 9px;
    padding: 12px;
}

.metric-mini .label {
    color: var(--muted);
    font-size: 11px;
}

.metric-mini .value {
    font-weight: 750;
    margin-top: 3px;
}

details.personal-details {
    margin-top: 16px;
    background: white;
    border: 1px solid var(--line);
    border-radius: 12px;
}

details.personal-details summary {
    cursor: pointer;
    padding: 16px 18px;
    font-weight: 700;
}

details.personal-details > div {
    padding: 0 18px 18px;
}

@media (max-width: 1000px) {
    .kpi-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .span-4,
    .span-5,
    .span-6,
    .span-7,
    .span-8 {
        grid-column: span 12;
    }
}

@media (max-width: 650px) {
    .kpi-grid,
    .prepare-summary,
    .metric-strip {
        grid-template-columns: 1fr;
    }

    .page-head {
        display: block;
    }
}

/* V0.3.1 */

.chart-box canvas {
    max-width: 100%;
}

.savings-accent {
    border-left: 4px solid #2d7a4d;
}

.expenses-accent {
    border-left: 4px solid #263747;
}



/* ==========================================================
   V0.3.2 — VIREMENTS RAPIDES
   ========================================================== */

.quick-transfer-grid {
    display: grid;
    grid-template-columns:
        repeat(2, minmax(280px, 1fr));
    gap: 16px;
}

.quick-transfer-person {
    border: 1px solid var(--line);
    border-radius: 11px;
    padding: 16px 18px;
    background: var(--soft);
}

.quick-transfer-head {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: center;
    margin-bottom: 12px;
}

.quick-transfer-name {
    font-size: 19px;
    font-weight: 750;
    margin-top: 2px;
}

.quick-transfer-total {
    font-size: 22px;
    font-weight: 750;
}

.quick-transfer-lines {
    border-top: 1px solid var(--line);
}

.quick-transfer-line {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 15px;
    padding: 10px 0;
    border-bottom: 1px solid var(--line);
}

.quick-transfer-line:last-child {
    border-bottom: 0;
}

.quick-transfer-line strong {
    white-space: nowrap;
}

@media (max-width: 750px) {

    .quick-transfer-grid {
        grid-template-columns: 1fr;
    }
}



/* ==========================================================
   C3D BUDGET V0.4 — AUTH / NAVIGATION / MOBILE
   ========================================================== */

body {
    padding-bottom: env(safe-area-inset-bottom);
}


/* ----------------------------------------------------------
   HEADER
   ---------------------------------------------------------- */

.topbar {
    padding:
        max(14px, env(safe-area-inset-top))
        24px
        14px;
}

.topbar-inner {
    max-width: 1360px;
    margin: 0 auto;

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

    gap: 20px;
}

.brand-link {
    display: flex;
    align-items: center;
    gap: 11px;

    color: white;
    text-decoration: none;
}

.brand-link:hover {
    color: white;
}

.brand-icon {
    display: block;

    width: 38px;
    height: 38px;

    object-fit: cover;

    border-radius: 9px;
}

.topbar-actions {
    display: flex;
    align-items: center;

    gap: 12px;
}

.desktop-user {
    color: rgba(255,255,255,.72);
    font-size: 13px;
}

.desktop-logout {
    margin: 0;
}

.logout-button {
    background: rgba(255,255,255,.11);

    font-size: 12px;

    padding: 8px 11px;
}


/* ----------------------------------------------------------
   NAVIGATION DESKTOP
   ---------------------------------------------------------- */

.desktop-nav {
    align-items: center;
}

.desktop-nav > a.active {
    color: #17212b;
    border-bottom-color: #17212b;
}

.nav-more {
    position: relative;
}

.nav-more-button {
    background: transparent;

    color: #39424e;

    border-radius: 0;

    padding: 14px 12px;

    font-size: 14px;
}

.nav-more-button:hover {
    background: #f1f3f5;
    opacity: 1;
}

.nav-more-menu {
    display: none;

    position: absolute;
    z-index: 150;

    top: 100%;
    right: 0;

    min-width: 170px;

    padding: 6px;

    background: white;

    border: 1px solid #dfe4e8;
    border-radius: 9px;

    box-shadow:
        0 12px 35px
        rgba(0,0,0,.12);
}

.nav-more:hover .nav-more-menu,
.nav-more:focus-within .nav-more-menu {
    display: block;
}

.nav-more-menu a {
    display: block;

    padding: 9px 10px;

    border-radius: 6px;

    text-decoration: none;

    color: #26313c;
}

.nav-more-menu a:hover {
    background: #f0f3f5;
}


/* ----------------------------------------------------------
   MASQUAGE MOBILE PAR DEFAUT
   ---------------------------------------------------------- */

.mobile-menu-button,
.mobile-bottom-nav,
.mobile-drawer-overlay {
    display: none;
}


/* ==========================================================
   LOGIN
   ========================================================== */

.login-page {
    min-height: 100vh;

    margin: 0;

    background:
        radial-gradient(
            circle at 20% 10%,
            #263b4c 0,
            #17212b 38%,
            #111920 100%
        );
}

.login-shell {
    min-height: 100vh;

    display: grid;
    place-items: center;

    padding: 24px;
}

.login-card {
    width: min(420px, 100%);

    background: white;

    border-radius: 18px;

    padding: 30px;

    box-shadow:
        0 28px 90px
        rgba(0,0,0,.28);
}

.login-brand {
    display: flex;
    align-items: center;

    gap: 14px;
}

.login-logo {
    display: block;

    width: 52px;
    height: 52px;

    object-fit: cover;

    border-radius: 12px;
}

.login-title {
    font-size: 23px;
    font-weight: 780;
}

.login-separator {
    height: 1px;

    background: #e5e9ec;

    margin: 24px 0;
}

.login-card h1 {
    margin: 0 0 20px;

    font-size: 22px;
}

.login-form {
    display: grid;

    gap: 16px;
}

.login-form input {
    width: 100%;

    padding: 12px;

    border: 1px solid #ccd3da;
    border-radius: 8px;

    font-size: 14px;
}

.login-button {
    width: 100%;

    margin-top: 4px;

    padding: 12px;
}

.login-error {
    background: #fff0ef;

    border: 1px solid #f3b1ab;

    color: #a32920;

    padding: 10px 12px;

    border-radius: 8px;

    margin-bottom: 16px;

    font-size: 13px;
}

.login-secure {
    text-align: center;

    color: #87919a;

    font-size: 11px;

    margin-top: 18px;
}


/* ==========================================================
   DRAWER MOBILE
   ========================================================== */

.mobile-drawer-overlay {
    position: fixed;

    inset: 0;

    z-index: 400;

    background: rgba(16,24,32,.54);
}

.mobile-drawer-overlay.open {
    display: block;
}

.mobile-drawer {
    margin-left: auto;

    width: min(340px, 88vw);
    height: 100%;

    background: white;

    padding:
        max(18px, env(safe-area-inset-top))
        18px
        20px;

    overflow-y: auto;

    box-shadow:
        -12px 0 40px
        rgba(0,0,0,.18);
}

.mobile-drawer-head {
    display: flex;
    justify-content: space-between;
    align-items: center;

    gap: 15px;

    margin-bottom: 22px;
}

.mobile-close {
    width: 38px;
    height: 38px;

    padding: 0;

    border-radius: 50%;

    font-size: 20px;
}

.mobile-drawer-links {
    display: grid;

    gap: 4px;
}

.mobile-drawer-links a {
    display: block;

    padding: 12px;

    border-radius: 8px;

    text-decoration: none;

    color: #26313c;

    font-weight: 600;
}

.mobile-drawer-links a:hover {
    background: #f1f4f6;
}

.mobile-logout {
    margin-top: 22px;

    padding-top: 18px;

    border-top: 1px solid #e4e8eb;
}

.mobile-logout button {
    width: 100%;
}

.drawer-open {
    overflow: hidden;
}


/* ==========================================================
   MOBILE
   ========================================================== */

@media (max-width: 780px) {

    body {
        padding-bottom:
            calc(
                68px
                + env(safe-area-inset-bottom)
            );
    }

    .topbar {
        padding-left: 14px;
        padding-right: 14px;
    }

    .brand {
        font-size: 19px;
    }

    .subtitle {
        display: none;
    }

    .brand-icon {
        width: 34px;
        height: 34px;
    }

    .desktop-nav,
    .desktop-user,
    .desktop-logout {
        display: none;
    }

    .mobile-menu-button {
        display: block;

        width: 42px;
        height: 42px;

        padding: 0;

        background: rgba(255,255,255,.12);

        font-size: 20px;
    }

    .container {
        margin-top: 18px;

        padding-left: 11px;
        padding-right: 11px;
    }

    h1,
    .page-head h1 {
        font-size: 24px;
    }

    .card {
        border-radius: 11px;

        padding: 15px;
    }

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

        gap: 9px;
    }

    .kpi {
        padding: 13px;
    }

    .kpi-value {
        font-size: 20px;
    }

    .kpi-note {
        display: none;
    }

    .dashboard-grid {
        display: block;
    }

    .dashboard-grid > .card {
        margin-bottom: 12px;
    }

    .quick-transfer-grid {
        grid-template-columns: 1fr;
    }

    table {
        display: block;

        overflow-x: auto;

        white-space: nowrap;
    }

    .mobile-bottom-nav {
        display: grid;

        grid-template-columns:
            repeat(4, 1fr);

        position: fixed;

        z-index: 300;

        bottom: 0;
        left: 0;
        right: 0;

        padding-bottom:
            env(safe-area-inset-bottom);

        background:
            rgba(255,255,255,.96);

        border-top:
            1px solid #dfe4e8;

        box-shadow:
            0 -4px 20px
            rgba(0,0,0,.08);

        backdrop-filter:
            blur(12px);
    }

    .mobile-bottom-nav a {
        min-height: 61px;

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

        gap: 3px;

        text-decoration: none;

        color: #69747e;

        font-size: 10px;
        font-weight: 650;
    }

    .mobile-bottom-nav a.active {
        color: #17212b;
    }

    .mobile-nav-icon {
        font-size: 21px;

        line-height: 1;
    }

    footer {
        display: none;
    }

    dialog.budget-dialog {
        width:
            calc(100vw - 16px);

        max-height: 90vh;
    }

    .dialog-body {
        max-height: 74vh;
    }

}


/* ==========================================================
   LOGIN MOBILE
   ========================================================== */

@media (max-width: 500px) {

    .login-shell {
        padding: 14px;
    }

    .login-card {
        padding: 24px 20px;
    }

}


/* ==========================================================
   V0.4.1 — FILTRES CHARGES
   ========================================================== */

.filters-grid {
    display: grid;

    grid-template-columns:
        repeat(4, minmax(150px, 1fr));

    gap: 12px;

    align-items: end;
}

.filter-search {
    grid-column: span 2;
}

.filter-action {
    display: flex;
    align-items: end;
}

.filter-action button {
    width: 100%;
}

.charges-filter-summary {
    display: flex;
    gap: 28px;

    margin: 0 0 14px;

    padding: 0 3px;
}

.charges-filter-summary > div {
    display: flex;
    gap: 7px;
    align-items: baseline;
}

.charges-add-details {
    margin-top: 12px;
}

.charges-add-details > summary {
    cursor: pointer;

    display: inline-block;

    padding: 9px 13px;

    border-radius: 8px;

    background: #edf1f4;

    font-weight: 700;

    color: #26313c;
}

.charges-add-details > summary:hover {
    background: #dfe5ea;
}


@media (max-width: 1050px) {

    .filters-grid {
        grid-template-columns:
            repeat(2, minmax(150px, 1fr));
    }

    .filter-search {
        grid-column: span 2;
    }

}


@media (max-width: 650px) {

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

    .filter-search {
        grid-column: span 1;
    }

    .charges-filter-summary {
        justify-content: space-between;
        gap: 10px;
    }

}


/* ==========================================================
   C3D BUDGET V0.5 — PROJETS
   ========================================================== */

.project-kpi-grid {
    display: grid;
    grid-template-columns:
        repeat(4, minmax(170px, 1fr));
    gap: 12px;
    margin-bottom: 18px;
}

.projects-dashboard {
    display: grid;
    grid-template-columns:
        repeat(2, minmax(300px, 1fr));
    gap: 14px;
}

.project-card {
    display: block;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--soft);
    text-decoration: none;
    color: var(--ink);
    transition:
        transform .15s ease,
        box-shadow .15s ease;
}

.project-card:hover {
    transform: translateY(-2px);
    box-shadow:
        0 8px 25px
        rgba(0,0,0,.07);
    opacity: 1;
}

.project-card-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 14px;
}

.project-card-name {
    font-size: 17px;
    font-weight: 750;
}

.project-budget {
    margin-top: 16px;
    font-size: 25px;
    font-weight: 780;
}

.project-card-grid {
    display: grid;
    grid-template-columns:
        repeat(2, 1fr);
    gap: 12px;
    margin-top: 16px;
}

.project-card-grid div {
    display: grid;
    gap: 3px;
}

.project-card-grid span {
    color: var(--muted);
    font-size: 11px;
}

.project-progress {
    height: 8px;
    margin-top: 14px;
    overflow: hidden;
    border-radius: 999px;
    background: #e5e9ec;
}

.project-progress-bar {
    height: 100%;
    border-radius: inherit;
    background: #263747;
}

.project-status-ok,
.project-status-danger {
    padding: 5px 8px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 750;
    white-space: nowrap;
}

.project-status-ok {
    color: #22643f;
    background: #e8f5ed;
}

.project-status-danger {
    color: #a32920;
    background: #fff0ef;
}

.project-feasibility {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    padding: 18px 20px;
    border-radius: 12px;
}

.project-feasibility-ok {
    border: 1px solid #aad8bb;
    background: #f2faf5;
}

.project-feasibility-danger {
    border: 1px solid #efaaa4;
    background: #fff3f2;
}

.project-feasibility-title {
    font-size: 18px;
    font-weight: 750;
}

.project-feasibility-value {
    display: grid;
    gap: 2px;
    text-align: right;
}

.project-feasibility-value strong {
    font-size: 23px;
}

.project-line-form {
    display: grid;
    grid-template-columns:
        repeat(4, minmax(150px, 1fr));
    gap: 12px;
    align-items: end;
}

.project-simulator {
    display: grid;
    grid-template-columns:
        minmax(220px, 1fr)
        minmax(220px, 1fr);
    gap: 20px;
    align-items: end;
}

.simulation-result {
    padding: 10px 14px;
    border-radius: 9px;
    background: var(--soft);
}

.simulation-result strong {
    display: block;
    font-size: 24px;
    margin: 3px 0;
}

.project-status {
    display: inline-block;
    padding: 5px 8px;
    border-radius: 999px;
    background: #edf1f4;
    font-size: 10px;
    font-weight: 700;
}

.status-a_chiffrer {
    background: #edf1f4;
}

.status-chiffre,
.status-devis {
    background: #fff5d9;
}

.status-accepte,
.status-commande {
    background: #e5effb;
}

.status-paye {
    background: #e8f5ed;
    color: #22643f;
}

.status-annule {
    background: #f1f1f1;
    color: #858585;
}

.danger {
    color: var(--red);
}


@media (max-width: 900px) {

    .project-kpi-grid {
        grid-template-columns:
            repeat(2, 1fr);
    }

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

    .project-line-form {
        grid-template-columns:
            repeat(2, 1fr);
    }
}


@media (max-width: 600px) {

    .project-kpi-grid,
    .project-line-form,
    .project-simulator {
        grid-template-columns: 1fr;
    }

    .project-feasibility {
        display: block;
    }

    .project-feasibility-value {
        margin-top: 12px;
        text-align: left;
    }
}



/* ==========================================================
   C3D BUDGET V0.5.1 — PROJETS UX
   ========================================================== */

.project-kpi-grid {
    display: grid !important;
    grid-template-columns:
        repeat(4, minmax(0, 1fr)) !important;
    gap: 14px !important;
    margin-bottom: 18px !important;
}

.project-kpi-grid .kpi {
    min-width: 0;
}


.projects-dashboard {
    display: grid !important;
    grid-template-columns:
        repeat(2, minmax(0, 1fr)) !important;
    gap: 16px !important;
}


.project-card {
    display: block !important;

    padding: 20px !important;

    color: var(--ink) !important;
    text-decoration: none !important;

    background: #ffffff !important;

    border:
        1px solid var(--line) !important;

    border-radius: 13px !important;

    box-shadow:
        0 2px 7px
        rgba(20,30,40,.035);

    transition:
        transform .15s ease,
        box-shadow .15s ease,
        border-color .15s ease;
}


.project-card:hover {
    transform: translateY(-2px);

    border-color: #cbd3da !important;

    box-shadow:
        0 10px 30px
        rgba(20,30,40,.08);

    opacity: 1;
}


.project-card-head {
    display: flex !important;
    align-items: flex-start;
    justify-content: space-between;

    gap: 15px;
}


.project-card-name {
    font-size: 18px !important;
    font-weight: 780 !important;

    color: var(--ink);
}


.project-budget {
    margin-top: 16px !important;

    font-size: 27px !important;
    line-height: 1.05;

    font-weight: 800 !important;
}


.project-progress {
    height: 9px !important;

    margin-top: 15px !important;

    overflow: hidden;

    border-radius: 999px;

    background: #e9edf0 !important;
}


.project-progress-bar {
    height: 100% !important;

    border-radius: inherit;

    background: #263747 !important;
}


.project-card-grid {
    display: grid !important;

    grid-template-columns:
        repeat(2, minmax(0, 1fr)) !important;

    gap: 12px 18px !important;

    margin-top: 17px !important;
}


.project-card-grid > div {
    display: flex !important;
    flex-direction: column;

    gap: 3px;
}


.project-card-grid span {
    color: var(--muted);

    font-size: 11px;
}


.project-card-grid strong {
    font-size: 14px;
}


.project-status-ok,
.project-status-danger {
    display: inline-flex !important;

    align-items: center;

    padding: 5px 9px !important;

    border-radius: 999px !important;

    font-size: 10px !important;
    font-weight: 750 !important;

    white-space: nowrap;
}


.project-status-ok {
    background: #e9f6ee !important;
    color: #247247 !important;
}


.project-status-danger {
    background: #fff0ef !important;
    color: #b42318 !important;
}


/* Création d'une enveloppe */

.charges-add-details {
    margin-top: 16px;
}


.charges-add-details > summary {
    display: inline-flex !important;

    align-items: center;

    cursor: pointer;

    padding: 9px 13px !important;

    color: #26313c !important;

    background: #e9eef2 !important;

    border-radius: 8px !important;

    font-weight: 700;

    list-style: none;
}


.charges-add-details > summary::-webkit-details-marker {
    display: none;
}


.charges-add-details > summary:hover {
    background: #dde4e9 !important;
}


/* Comparatif */

.project-comparison-card {
    margin-top: 18px;
}


@media (max-width: 950px) {

    .project-kpi-grid {
        grid-template-columns:
            repeat(2, minmax(0, 1fr)) !important;
    }

    .projects-dashboard {
        grid-template-columns:
            1fr !important;
    }
}


@media (max-width: 560px) {

    .project-kpi-grid {
        grid-template-columns:
            1fr !important;
    }

    .project-card-grid {
        grid-template-columns:
            1fr 1fr !important;
    }
}



/* V0.5.2 — Projets simplifiés */

.project-kpi-grid-3 {
    grid-template-columns:
        repeat(3, minmax(0, 1fr)) !important;
}

.project-card-grid-3 {
    grid-template-columns:
        repeat(3, minmax(0, 1fr)) !important;
}


@media (max-width: 850px) {

    .project-kpi-grid-3 {
        grid-template-columns:
            1fr !important;
    }

    .project-card-grid-3 {
        grid-template-columns:
            repeat(2, minmax(0, 1fr)) !important;
    }
}



/* ==========================================================
   C3D BUDGET V0.5.3 — RESTE DISPONIBLE
   ========================================================== */

.project-kpi-grid-4 {
    grid-template-columns:
        repeat(4, minmax(0, 1fr)) !important;
}

.project-kpi-highlight {
    background: #f3faf5;
}

.project-main-balance {
    margin-top: 17px;
}

.project-main-balance-label {
    color: var(--muted);
    font-size: 11px;
}

.project-main-balance-value {
    margin-top: 2px;
    font-size: 29px;
    line-height: 1.1;
    font-weight: 800;
}

.project-status-muted {
    display: inline-flex;
    align-items: center;

    padding: 5px 9px;

    border-radius: 999px;

    background: #edf0f2;
    color: #69747e;

    font-size: 10px;
    font-weight: 750;
}

.project-filter-tabs {
    display: flex;
    gap: 5px;
    padding: 4px;

    background: #e9edf0;
    border-radius: 9px;
}

.project-filter-tabs a {
    padding: 7px 10px;

    border-radius: 6px;

    color: #55616c;
    text-decoration: none;

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

.project-filter-tabs a:hover {
    opacity: 1;
    background: rgba(255,255,255,.6);
}

.project-filter-tabs a.active {
    background: white;
    color: #17212b;

    box-shadow:
        0 1px 4px
        rgba(0,0,0,.08);
}


@media (max-width: 900px) {

    .project-kpi-grid-4 {
        grid-template-columns:
            repeat(2, minmax(0, 1fr)) !important;
    }
}


@media (max-width: 560px) {

    .project-kpi-grid-4 {
        grid-template-columns:
            1fr !important;
    }

    .project-filter-tabs {
        margin-top: 12px;
    }
}


/* V0.5.4 */

.status-en_attente {
    background: #fff5d9;
    color: #765400;
}



/* ==========================================================
   C3D BUDGET V0.6 — ANALYSE
   ========================================================== */

.analyse-filter-card {
    margin-bottom: 16px;
}

.analyse-filters {
    display: grid;

    grid-template-columns:
        repeat(6, minmax(120px, 1fr))
        auto;

    gap: 10px;

    align-items: end;
}

.analyse-filter-action button {
    min-width: 105px;
}

.analyse-kpis {
    display: grid;

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

    gap: 12px;

    margin-bottom: 16px;
}

.analyse-grid {
    display: grid;

    grid-template-columns:
        repeat(12, 1fr);

    gap: 16px;
}

.analyse-span-6 {
    grid-column: span 6;
}

.analyse-span-12 {
    grid-column: span 12;
}

.analyse-top-line {
    display: flex;

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

    gap: 20px;

    padding: 11px 0;

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

.analyse-top-line:last-child {
    border-bottom: 0;
}

.analyse-top-line > strong {
    white-space: nowrap;
}

.analyse-real-badge {
    display: inline-block;

    margin-top: 3px;

    padding: 2px 5px;

    border-radius: 4px;

    background: #e8f5ed;

    color: #247247;

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

.analyse-reel-details > summary {
    cursor: pointer;

    font-weight: 750;

    font-size: 16px;
}

.analyse-real-help {
    margin: 9px 0 15px;
}

.analyse-real-table input {
    width: 130px;
    text-align: right;
}

.analyse-refresh-form {
    margin: 0;
}


@media (max-width: 1100px) {

    .analyse-filters {
        grid-template-columns:
            repeat(3, 1fr);
    }

    .analyse-filter-action button {
        width: 100%;
    }
}


@media (max-width: 800px) {

    .analyse-kpis {
        grid-template-columns:
            repeat(2, 1fr);
    }

    .analyse-span-6 {
        grid-column: span 12;
    }
}


@media (max-width: 600px) {

    .analyse-filters {
        grid-template-columns:
            1fr;
    }

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

    .analyse-refresh-form {
        margin-top: 12px;
    }
}



/* ==========================================================
   C3D BUDGET V0.6.1 — ARBORESCENCE ANALYSE
   ========================================================== */

.analyse-tree {
    display: grid;
    gap: 8px;
}

.analyse-tree details {
    margin: 0;
}

.analyse-tree summary {
    list-style: none;
    cursor: pointer;
}

.analyse-tree summary::-webkit-details-marker {
    display: none;
}


.analyse-tree-category {
    border:
        1px solid #dfe5e9;

    border-radius: 10px;

    overflow: hidden;

    background: #fff;
}


.analyse-tree-category > summary {
    display: flex;

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

    gap: 20px;

    padding: 13px 15px;

    background: #f7f9fa;
}


.analyse-tree-category[open]
    > summary {

    background: #f0f4f6;
}


.analyse-tree-summary-main {
    display: flex;

    align-items: center;

    gap: 8px;

    min-width: 0;
}


.analyse-tree-summary-value {
    display: flex;

    align-items: center;

    justify-content: flex-end;

    gap: 14px;

    min-width: 180px;

    white-space: nowrap;
}


.analyse-tree-chevron {
    display: inline-flex;

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

    width: 16px;
    height: 16px;

    font-size: 20px;

    line-height: 1;

    transition:
        transform .15s ease;
}


details[open]
    > summary
    .analyse-tree-chevron {

    transform:
        rotate(90deg);
}


.analyse-tree-count {
    color: var(--muted);

    font-size: 10px;
}


.analyse-tree-percent {
    color: var(--muted);

    font-size: 11px;
}


.analyse-tree-progress {
    height: 3px;

    background: #e9edf0;
}


.analyse-tree-progress-fill {
    height: 100%;

    background: #263747;
}


.analyse-tree-category-content {
    padding:
        8px 12px 12px;
}


.analyse-tree-account {
    border-bottom:
        1px solid #edf0f2;
}


.analyse-tree-account:last-child {
    border-bottom: 0;
}


.analyse-tree-account > summary {
    display: flex;

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

    gap: 18px;

    padding: 11px 8px;
}


.analyse-tree-account > summary:hover {
    background: #f8fafb;
}


.analyse-tree-account-icon {
    display: inline-flex;

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

    width: 22px;
    height: 22px;

    border-radius: 6px;

    background: #edf1f4;

    font-size: 11px;
    font-weight: 750;
}


.analyse-tree-account-content {
    margin-left: 29px;

    padding-bottom: 7px;
}


.analyse-tree-expense {
    border-top:
        1px solid #f0f2f4;
}


.analyse-tree-expense > summary {
    display: flex;

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

    gap: 16px;

    padding: 9px 7px;
}


.analyse-tree-expense > summary:hover {
    background: #fafbfc;
}


.analyse-tree-badge {
    padding: 2px 5px;

    border-radius: 4px;

    background: #edf1f4;

    color: #64717c;

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


.analyse-tree-persons {
    margin:
        0 6px 7px 26px;

    padding:
        4px 0 4px 12px;

    border-left:
        2px solid #e8ecef;
}


.analyse-tree-person {
    display: flex;

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

    gap: 20px;

    padding: 6px 8px;

    color: #56616b;

    font-size: 12px;
}


.analyse-tree-person strong {
    color: var(--ink);

    white-space: nowrap;
}


.analyse-tree-person-icon {
    margin-right: 6px;

    color: #9aa3aa;
}


.analyse-tree-actions {
    display: flex;

    gap: 6px;
}


.analyse-tree-actions .button {
    padding: 7px 9px;

    font-size: 11px;
}


.analyse-flat-view {
    margin-top: 15px;
}


.analyse-flat-view > summary {
    cursor: pointer;

    color: #596773;

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


.analyse-flat-view table {
    margin-top: 12px;
}


@media (max-width: 700px) {

    .analyse-tree-category > summary,
    .analyse-tree-account > summary,
    .analyse-tree-expense > summary {

        align-items: flex-start;
    }

    .analyse-tree-summary-value {
        min-width: auto;

        flex-direction: column;

        align-items: flex-end;

        gap: 1px;
    }

    .analyse-tree-count {
        display: none;
    }

    .analyse-tree-account-content {
        margin-left: 12px;
    }

    .analyse-tree-actions {
        display: none;
    }
}



/* ==========================================================
   C3D BUDGET V0.6.2 — EDITION DE MASSE
   ========================================================== */

.bulk-filter-grid {
    display: grid;

    grid-template-columns:
        2fr
        repeat(3, minmax(150px, 1fr))
        auto;

    gap: 10px;

    align-items: end;
}

.bulk-filter-action button {
    min-width: 100px;
}

.bulk-result-bar {
    display: flex;

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

    gap: 15px;

    margin: 15px 2px;
}

.bulk-result-actions {
    display: flex;

    gap: 6px;
}

.bulk-result-actions .button {
    padding: 7px 10px;

    font-size: 11px;
}

.bulk-actions-card {
    position: sticky;

    top: 0;

    z-index: 30;

    box-shadow:
        0 6px 20px
        rgba(20,30,40,.08);
}

.bulk-actions-grid {
    display: grid;

    grid-template-columns:
        repeat(6, minmax(120px, 1fr))
        auto;

    gap: 10px;

    align-items: end;
}

.bulk-apply button {
    min-width: 100px;
}

.bulk-table-wrap {
    overflow-x: auto;
}

.bulk-check {
    width: 36px;

    text-align: center !important;
}

.bulk-checkbox {
    width: 16px !important;
    height: 16px;

    cursor: pointer;
}

.bulk-warning {
    display: inline-block;

    padding: 3px 6px;

    border-radius: 5px;

    color: #976000;

    background: #fff4d8;

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


@media (max-width: 1100px) {

    .bulk-filter-grid {
        grid-template-columns:
            repeat(2, 1fr);
    }

    .bulk-search {
        grid-column:
            span 2;
    }

    .bulk-actions-grid {
        grid-template-columns:
            repeat(3, 1fr);
    }
}


@media (max-width: 650px) {

    .bulk-filter-grid,
    .bulk-actions-grid {
        grid-template-columns:
            1fr;
    }

    .bulk-search {
        grid-column: auto;
    }

    .bulk-result-bar {
        align-items: flex-start;

        flex-direction: column;
    }

    .bulk-actions-card {
        position: static;
    }
}



/* ==========================================================
   C3D BUDGET V0.7 — EPARGNE INTELLIGENTE
   ========================================================== */

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

.saving-capacity-card {
    padding: 15px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--soft);
}

.saving-capacity-name {
    font-weight: 750;
}

.saving-capacity-value {
    margin-top: 5px;
    font-size: 25px;
    font-weight: 800;
}

.saving-capacity-details {
    display: flex;
    gap: 16px;
    margin-top: 11px;
    font-size: 11px;
}

.saving-reserve-details {
    margin-top: 14px;
}

.saving-reserve-details > summary {
    cursor: pointer;
    font-weight: 700;
    font-size: 12px;
}

.saving-reserve-form {
    display: flex;
    align-items: end;
    gap: 12px;
    margin-top: 12px;
}

.saving-reserve-form input {
    max-width: 160px;
}

.saving-form-grid {
    display: grid;
    grid-template-columns:
        repeat(5, minmax(150px, 1fr));
    gap: 12px;
    align-items: end;
}

.saving-form-submit {
    display: flex;
    align-items: center;
    gap: 8px;
}

.saving-objectives-grid {
    display: grid;
    grid-template-columns:
        repeat(2, minmax(300px, 1fr));
    gap: 16px;
    margin-top: 18px;
}

.saving-goal-card {
    padding: 19px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: white;
}

.saving-goal-head {
    display: flex;
    justify-content: space-between;
    gap: 15px;
}

.saving-goal-title {
    font-size: 18px;
    font-weight: 800;
}

.saving-goal-meta {
    margin-top: 3px;
    color: var(--muted);
    font-size: 10px;
}

.saving-goal-percent {
    font-size: 19px;
    font-weight: 800;
}

.saving-progress {
    height: 9px;
    margin-top: 14px;
    overflow: hidden;
    border-radius: 999px;
    background: #e8ecef;
}

.saving-progress-fill {
    height: 100%;
    border-radius: inherit;
    background: #263747;
}

.saving-goal-values {
    display: grid;
    grid-template-columns:
        repeat(3, 1fr);
    gap: 10px;
    margin-top: 15px;
}

.saving-goal-values div {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.saving-goal-values span {
    color: var(--muted);
    font-size: 10px;
}

.saving-recommendation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;

    margin-top: 17px;
    padding: 13px 14px;

    border-radius: 9px;
    background: #f1f7f3;
}

.saving-recommendation-label {
    color: #5c6b61;
    font-size: 10px;
}

.saving-recommendation-value {
    margin-top: 2px;
    font-size: 24px;
    font-weight: 800;
    color: #267347;
}

.saving-recommendation-info {
    text-align: right;
    font-size: 11px;
    color: var(--muted);
}

.saving-goal-links {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;

    margin-top: 13px;

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

.saving-payment-form {
    display: flex;
    align-items: end;
    gap: 8px;
    margin-top: 15px;
}

.saving-payment-form > div {
    flex: 1;
}

.saving-goal-actions {
    display: flex;
    align-items: center;
    gap: 7px;

    margin-top: 12px;
    padding-top: 12px;

    border-top: 1px solid var(--line);
}

.saving-goal-actions form {
    margin: 0;
}

.danger-button {
    background: #fff0ef !important;
    color: #ad2c23 !important;
    border: 1px solid #efc0bc !important;
}


@media (max-width: 1050px) {

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

}


@media (max-width: 780px) {

    .saving-objectives-grid,
    .saving-capacity-grid {
        grid-template-columns: 1fr;
    }

    .saving-form-grid {
        grid-template-columns: 1fr;
    }

    .saving-reserve-form {
        display: grid;
        grid-template-columns: 1fr;
    }

    .saving-recommendation {
        align-items: flex-start;
        flex-direction: column;
    }

    .saving-recommendation-info {
        text-align: left;
    }
}



/* ==========================================================
   C3D BUDGET V0.7.1
   ========================================================== */

.saving-alert {
    margin-top: 12px;
    padding: 11px 13px;

    border-radius: 8px;

    background: #fff8e8;
    border: 1px solid #eed49c;

    font-size: 11px;
    line-height: 1.5;
}

.saving-alert-danger {
    background: #fff0ef;
    border-color: #efc0bc;
    color: #92251e;
}

.saving-skip-row {
    margin-top: 12px;
}

.saving-skip-row form {
    margin: 0;
}



/* ==========================================================
   C3D BUDGET V0.7.3 — DISPO REEL COMPTE
   ========================================================== */

.c3d-project-five-metrics {
    display: grid !important;
    grid-template-columns:
        repeat(5, minmax(0, 1fr)) !important;
    gap: 12px;
}

.c3d-project-five-metrics > * {
    min-width: 0;
}

.c3d-project-five-metrics
.c3d-project-real-account {
    background: #eef6ff !important;
    border-color: #d4e5fb !important;
}

.c3d-project-five-metrics
.c3d-project-real-account strong,
.c3d-project-five-metrics
.c3d-project-real-account .value {
    color: #1d4ed8 !important;
}

@media (max-width: 1100px) {
    .c3d-project-five-metrics {
        grid-template-columns:
            repeat(3, minmax(0, 1fr)) !important;
    }
}

@media (max-width: 650px) {
    .c3d-project-five-metrics {
        grid-template-columns:
            repeat(1, minmax(0, 1fr)) !important;
    }
}



/* ==========================================================
   C3D BUDGET V0.7.4 — ACCUEIL PROJETS
   ========================================================== */

.c3d-project-five-home {
    display: grid !important;

    grid-template-columns:
        repeat(5, minmax(0, 1fr)) !important;

    gap: 12px;
}

.c3d-project-five-home > * {
    min-width: 0;
}

.c3d-project-four-details {
    display: grid !important;

    grid-template-columns:
        repeat(4, minmax(0, 1fr)) !important;

    gap: 12px;
}

.c3d-project-four-details > * {
    min-width: 0;
}

.c3d-real-account-home {
    background: #eef6ff;
    border-color: #d4e5fb;
}

.c3d-real-account-home strong,
.c3d-real-account-home .value {
    color: #1d4ed8 !important;
}

@media (max-width: 1100px) {

    .c3d-project-five-home {
        grid-template-columns:
            repeat(3, minmax(0, 1fr)) !important;
    }

    .c3d-project-four-details {
        grid-template-columns:
            repeat(2, minmax(0, 1fr)) !important;
    }
}

@media (max-width: 650px) {

    .c3d-project-five-home {
        grid-template-columns:
            repeat(1, minmax(0, 1fr)) !important;
    }

    .c3d-project-four-details {
        grid-template-columns:
            repeat(2, minmax(0, 1fr)) !important;
    }
}


/* C3D_PROJECT_ALIGN_V0831 */

/* Aligner les formulaires projet par le haut */
.project-line-form {
    align-items: start;
}

