
:root {
    --bg: #f2f5fa;
    --card: #fff;
    --ink: #0f1b2d;
    --mute: #6b778c;
    --line: #e6ebf3;

    --cp: #2f7bf5;
    --cpS: #e4eefe;

    --dd: #e8408a;
    --ddS: #fde6f0;

    --hero1: #0a6aa8;
    --hero2: #0a2f78;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --bg: #0a1120;
        --card: #131c2e;
        --ink: #eef2f9;
        --mute: #8fa0ba;
        --line: #1f2b42;
        --cpS: #17315c;
        --ddS: #4a1730;
    }
}

:root[data-theme="dark"] {
    --bg: #0a1120;
    --card: #131c2e;
    --ink: #eef2f9;
    --mute: #8fa0ba;
    --line: #1f2b42;
    --cpS: #17315c;
    --ddS: #4a1730;
}
* {
    scrollbar-width: none; /* Firefox et versions récentes de Chrome/Safari */
  -ms-overflow-style: none;
}
*::-webkit-scrollbar {
  display: none;
}
body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
    -webkit-font-smoothing: antialiased;
    padding-bottom: calc(10px + env(safe-area-inset-bottom, 0));
}
/* ANDROID — Décalage sous la barre de statut */


.wrap {
    max-width: 720px;
    margin: 0 auto;
    padding: 0 10px;
}

.app-main {
    padding-top: 5px;
}

.app-top {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--bg);
}



/* DIFFERENCE */

.gapw {
    position: absolute;    
    width: 100%;
    left: 50%;
    transform: translateX(-50%);
    bottom: -20px;
}

.gapbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 11px 16px;
    border-radius: 16px;
    background: var(--card);
    border: 1px solid var(--line);
    box-shadow: 0 6px 18px rgba(10,30,70,.1);
    color: var(--mute);
    font-size: 14px;
}

.gapbar em {
    font-style: normal;
    font-weight: 700;
}

.gapbar em.CP {
    color: var(--cp);
}

.gapbar em.DD {
    color: var(--dd);
}

.gapbar b {
    color: var(--ink);
    font-size: 17px;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

/* ACCUEIL */

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

.home .card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 18px;
    min-width: 0;
}

.home .card h2 {
    margin: 0 0 12px;
    color: var(--mute);
    font-size: 14px;
    font-weight: 600;
}

.home .row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: 6px;
    font-size: 14px;
}

.home .row b {
    font-size: 17px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.dot {
    display: inline-block;
    width: 9px;
    height: 9px;
    margin-right: 8px;
    border-radius: 50%;
}

.dot.CP {
    background: var(--cp);
}

.dot.DD {
    background: var(--dd);
}

.home .bar {
    display: flex;
    height: 8px;
    margin-top: 14px;
    overflow: hidden;
    border-radius: 99px;
    background: var(--line);
}

.home .bar i {
    display: block;
    height: 100%;
}

.home .bar .CP {
    background: var(--cp);
}

.home .bar .DD {
    background: var(--dd);
}

/* LISTE DES DEPENSES */

.home .list {
    margin-top: 12px;
    padding: 6px 6px 10px;
}

.home .day {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 14px 4px;
    color: var(--mute);
    font-size: 13px;
    font-weight: 600;
}

.home .day::after {
    content: "";
    flex: 1;
    border-top: 1px solid var(--line);
}

.home .item {
    display: flex;
    align-items: center;
    gap: 16px;
    min-height: 30px;
    padding: 10px 5px;
    border-radius: 16px;
}

.home .item:hover {
    background: var(--bg);
}

.home .av {
    flex: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
}

.home .CP .av {
    background: var(--cp);
}

.home .DD .av {
    background: var(--dd);
}

.home .txt {
    flex: 1;
    min-width: 0;
}

.home .txt b {
    display: block;
    font-size: 15px;
    font-weight: 600;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.home .txt span {
    font-size: 13px;
    color: var(--mute);
}

.home .amt {
    font-weight: 600;
    font-size: 16px;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.home .empty {
    padding: 28px 14px;
    text-align: center;
    color: var(--mute);
    font-size: 14px;
}

/* FOOTER FLOTTANT */


.footer {
    position: fixed;
    z-index: 100;
    left: 50%;
    bottom: 0;
    transform: translateX(-50%);

    width: 100%;
    max-width: 760px;
    height: calc(76px + env(safe-area-inset-bottom, 0));

    display: grid;
    grid-template-columns: 1fr 1fr 112px 1fr 1fr;
    align-items: start;

    padding: 0 8px env(safe-area-inset-bottom, 0);
    box-sizing: border-box;

    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    overflow: visible;
}

/* Parties gauche et droite de la barre */

.footer::before,
.footer::after {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    width: calc(50% - 70px);

    background: var(--card);
    border-top: 1px solid var(--line);
    border-radius: 0;
    z-index: 0;
}

.footer::before {
    left: 0;
}

.footer::after {
    right: 0;
}

/* VRAIE VAGUE CENTRALE */

.footer-wave {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);

    width: 140px;
    height: 100%;
    color: var(--card);

    pointer-events: none;
    z-index: 0;
}

/* Navigation */

.footer > a {
    position: relative;
    z-index: 1;

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

    min-width: 0;
    margin-top: 13px;
    padding: 3px 0;

    color: var(--mute);
    background: transparent;
    border-radius: 10px;
    text-decoration: none;

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

.footer > a i {
    font-size: 21px;
}

.footer > a.active:not(.menu_add) {
    color: var(--dd);
    background: transparent;
}

/* Position des 5 éléments */

.footer .menu_ {
    grid-column: 1;
}

.footer .menu_month {
    grid-column: 2;
}

.footer .menu_search {
    grid-column: 4;
}

.footer .menu_crons {
    grid-column: 5;
}

/* Bouton + dans l'encoche */

.footer .menu_add {
    grid-column: 3;
    grid-row: 1;

    position: relative;
    top: auto;
    left: auto;
    transform: none;

    justify-self: center;
    align-self: start;

    width: 56px;
    height: 56px;
    margin-top: -20px;
    padding: 0;

    border-radius: 50%;
    background: var(--cp);
    color: #fff;

    box-shadow: 0 6px 15px rgba(47,123,245,.24);
    z-index: 2;
}

.footer .menu_add i {
    font-size: 24px;
}

.footer .menu_add.active {
    outline: 4px solid var(--cpS);
}

/* GSM */

@media (max-width: 380px) {
    .footer {
        grid-template-columns: 1fr 1fr 102px 1fr 1fr;
        padding-inline: 4px;
    }

    .footer > a {
        font-size: 11px;
    }
}

/* Espace sous le contenu */




/* PETITS ECRANS */

@media (max-width: 480px) {
    .home .card {
        padding: 14px;
    }

    .home .stats .row {
        display: block;
        margin-top: 10px;
    }

    .home .stats .row b {
        display: block;
        margin-top: 3px;
        font-size: 15px;
    }

    .home .item {
        gap: 12px;
    }

    .home .amt {
        font-size: 14px;
    }
}


@media (max-width: 480px) {

    .home .stats {
        display: grid;
        grid-template-columns: minmax(65px, .8fr) minmax(0, 1.4fr) minmax(0, 1fr);
        gap: 16px 8px;
        padding: 18px 12px;
        background: var(--card);
        border: 1px solid var(--line);
        border-radius: 10px;
        align-items: center;
    }

    .home .stats > .card,
    .home .stats > .card > .row {
        display: contents;
    }

    .home .stats h2 {
        margin: 0;
        font-size: 13px;
        text-align: right;
    }

    .home .stats .row span {
        white-space: nowrap;
        font-size: 13px;
    }

    .home .stats .row b {
        display: block;
        margin: 0;
        text-align: right;
        font-size: clamp(12px, 3.5vw, 15px);
        font-weight: 600;
        white-space: nowrap;
    }

    .home .stats .dot {
        margin-right: 4px;
    }

    /* Entêtes */
    .home .stats .card:first-child h2 {
        grid-area: 1 / 2;
    }

    .home .stats .card:nth-child(2) h2 {
        grid-area: 1 / 3;
    }

    /* Colin */
    .home .stats .card:first-child .row:nth-of-type(1) span {
        grid-area: 2 / 1;
    }

    .home .stats .card:first-child .row:nth-of-type(1) b {
        grid-area: 2 / 2;
    }

    .home .stats .card:nth-child(2) .row:nth-of-type(1) b {
        grid-area: 2 / 3;
    }

    /* Delphine */
    .home .stats .card:first-child .row:nth-of-type(2) span {
        grid-area: 3 / 1;
    }

    .home .stats .card:first-child .row:nth-of-type(2) b {
        grid-area: 3 / 2;
    }

    .home .stats .card:nth-child(2) .row:nth-of-type(2) b {
        grid-area: 3 / 3;
    }

    /* Les noms sont déjà dans la première colonne */
    .home .stats .card:nth-child(2) .row span {
        display: none;
    }

    .home .item {
        gap: 12px;
    }

    .home .amt {
        font-size: 14px;
    }
}



/* Compte — Mois : feuille COMPLETE, à charger APRÈS l'ancien CSS.
   Prévue pour <main class="wrap month-page"> et month.js (version modernisée).
   N'affecte ni le header, ni le bandeau de différence, ni le footer du layout.
*/

.month-page,
.month-page * {
    box-sizing: border-box;
}

.month-page {
    width: 100%;
    max-width: 720px;
    margin: 0 auto;
    padding: 0 0 calc(40px + env(safe-area-inset-bottom));
    color: var(--ink, #0f1b2d);
    font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
}

/* Les deux vraies cartes, sans dépendre du CSS général. */
.month-page .card {
    display: block;
    min-width: 0;
    background: var(--card, #fff);
    border: 1px solid var(--line);
    border-radius: 10px;
    box-shadow: none;
}

.month-page .mhead {
    margin: 0;
    padding: 14px 16px 17px;
}

/* Année : commandes centrées */
.month-page .annee-nav,
.month-page .yr {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 14px;
    margin: 0;
}

.month-page #anneeCourante {
    display: inline-block;
    min-width: 58px;
    color: var(--ink, #0f1b2d);
    font-size: 18px;
    font-weight: 800;
    text-align: center;
    font-variant-numeric: tabular-nums;
}

.month-page .annee-nav button {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    appearance: none;
    color: var(--ink, #0f1b2d);
    background: transparent;
    font: inherit;
    font-size: 25px;
    line-height: 1;
    cursor: pointer;
}

.month-page .annee-nav button:hover {
    background: var(--bg, #f2f5fa);
}

/* Mois horizontaux avec défilement sur GSM. */
.month-page .mois-selector {
    display: block;
    width: 100%;
    margin-top: 6px;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}
.month-page .mois-selector::-webkit-scrollbar { display: none; }

.month-page #moisLigne {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2px;
    width: max-content;
    min-width: 100%;
    margin: 0;
    padding: 4px 0 8px;
}

.month-page #moisLigne button {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 7px;
    min-height: 34px;
    border: 0;
    border-radius: 999px;
    appearance: none;
    background: transparent;
    color: var(--mute, #6b778c);
    font: inherit;
    font-size: 12px;
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
    cursor: pointer;
}

.month-page #moisLigne button.actif,
.month-page #moisLigne button.on {
    background: var(--ink, #0f1b2d);
    color: var(--card, #fff);
}

/* Montants du mois */
.month-page .msum {
    display: flex;
    align-items: start;
    justify-content: space-between;
    gap: 12px;
    margin-top: 8px;
    color: var(--mute, #6b778c);
    font-size: 14px;
}
.month-page .msum > div {
    min-width: 0;
}
.month-page .msum > div:last-child { text-align: right; }
.month-page .msum b {
    margin-left: 6px;
    color: var(--ink, #0f1b2d);
    font-size: 17px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}
.month-page .dot {
    display: inline-block;
    width: 9px;
    height: 9px;
    margin-right: 7px;
    border-radius: 50%;
    vertical-align: 1px;
}
.month-page .dot.CP { background: var(--cp, #2f7bf5); }
.month-page .dot.DD { background: var(--dd, #e8408a); }

.month-page .month-bar {
    display: flex;
    width: 100%;
    height: 8px;
    margin: 14px 0 0;
    padding: 0;
    overflow: hidden;
    border-radius: 999px;
    background: var(--line, #e6ebf3);
}
.month-page .month-bar > i {
    display: block;
    flex: 0 0 auto;
    height: 100%;
    margin: 0;
    transition: width .2s ease;
}
.month-page .month-bar > .CP { background: var(--cp, #2f7bf5); }
.month-page .month-bar > .DD { background: var(--dd, #e8408a); }

/* Liste : deuxième carte, groupée par jour. */
.month-page .list {
    display: block;
    margin: 12px 0 0;
    padding: 6px 6px 10px;
}

.month-page #listeAchats {
    display: block;
    width: 100%;
    margin: 0;
    padding: 0;
    list-style: none;
}

.month-page #listeAchats > li {
    width: 100%;
    margin: 0;
    list-style: none;
}

.month-page #listeAchats > li.day {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: auto;
    padding: 16px 14px 7px;
    color: var(--mute, #6b778c);
    background: transparent;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.4;
}
.month-page #listeAchats > li.day::after {
    content: '';
    flex: 1;
    border-top: 1px solid var(--line, #e6ebf3);
}

.month-page #listeAchats > li.item {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 14px;
    min-height: 62px;
    padding: 11px 12px 11px 14px;
    border: 0;
    border-radius: 16px;
    background: transparent;
    color: var(--ink, #0f1b2d);
    cursor: pointer;
}
.month-page #listeAchats > li.item:hover,
.month-page #listeAchats > li.item:focus-within {
    background: var(--bg, #f2f5fa);
}
.month-page #listeAchats > li.item.updated {
    background: var(--cpS, #e4eefe);
}

.month-page #listeAchats > li.item .av {
    display: block;
    flex: 0 0 14px;
    width: 14px;
    height: 14px;
    min-width: 14px;
    border-radius: 50%;
    font-size: 0;
}
.month-page #listeAchats > li.item.CP .av { background: var(--cp, #2f7bf5); }
.month-page #listeAchats > li.item.DD .av { background: var(--dd, #e8408a); }

.month-page #listeAchats > li.item .txt {
    display: block;
    flex: 1 1 auto;
    min-width: 0;
    margin: 0;
    padding: 0;
    text-align: left;
}
.month-page #listeAchats > li.item .txt b {
    display: block;
    overflow: hidden;
    color: var(--ink, #0f1b2d);
    font-size: 15px;
    font-weight: 600;
    line-height: 1.4;
    white-space: nowrap;
    text-overflow: ellipsis;
}
.month-page #listeAchats > li.item .txt span {
    display: block;
    margin-top: 1px;
    color: var(--mute, #6b778c);
    font-size: 13px;
    line-height: 1.4;
}
.month-page #listeAchats > li.item .amt {
    display: block;
    flex: 0 0 auto;
    margin-left: auto;
    color: var(--ink, #0f1b2d);
    font-size: 16px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    text-align: right;
    white-space: nowrap;
}
.month-page #listeAchats > li.item button.i {
    display: inline-flex;
    flex: 0 0 28px;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 32px;
    margin: 0;
    padding: 0;
    border: 0;
    outline: 0;
    border-radius: 10px;
    appearance: none;
    background: transparent;
    color: var(--mute, #6b778c);
    box-shadow: none;
    cursor: pointer;
}
.month-page #listeAchats > li.item button.i i {
    font-size: 13px;
    line-height: 1;
}
.month-page #listeAchats > li.item button.i:hover {
    background: var(--line, #e6ebf3);
}
.month-page #listeAchats > li.item button.i:focus-visible {
    outline: 2px solid var(--cp, #2f7bf5);
}

.month-page #listeAchats > li.empty {
    padding: 28px 14px;
    color: var(--mute, #6b778c);
    text-align: center;
    font-size: 14px;
}

/* Édition dans la liste */
.month-page #listeAchats > li.edit-inline {
    display: block;
    margin: 4px 0 12px;
    width: 100%;
    padding: 14px;
    border: 1px solid var(--line, #e6ebf3);
    border-radius: 16px;
    background: var(--bg, #f2f5fa);
}
.month-page #listeAchats > li.item.active {
    background: var(--cpS);
}
.month-page .edit-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}
.month-page .edit-grid label { display: block; min-width: 0; }
.month-page .edit-grid label span {
    display: block;
    margin-bottom: 5px;
    color: var(--mute, #6b778c);
    font-size: 12px;
    font-weight: 600;
}
.month-page .edit-grid input,
.month-page .edit-grid select {
    display: block;
    width: 100%;
    min-width: 0;
    height: 40px;
    padding: 9px 10px;
    border: 1px solid var(--line, #e6ebf3);
    border-radius: 11px;
    background: var(--card, #fff);
    color: var(--ink, #0f1b2d);
    font: inherit;
    font-size: 14px;
}
.month-page .edit-grid input:focus,
.month-page .edit-grid select:focus {
    border-color: var(--cp, #2f7bf5);
    outline: 0;
}
.month-page .edit-actions {
    display: flex;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}
.month-page .edit-actions button {
    min-height: 40px;
    padding: 10px 12px;
    border: 0;
    border-radius: 11px;
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}
.month-page .btn-del { margin-right: auto; background: var(--ddS, #fde6f0); color: var(--dd, #e8408a); }
.month-page .btn-cancel { background: var(--line, #e6ebf3); color: var(--ink, #0f1b2d); }
.month-page .btn-save { background: var(--cp, #2f7bf5); color: #fff; }
.month-page .edit-actions button:disabled { opacity: .5; cursor: wait; }

@media (max-width: 520px) {
    .month-page .msum { gap: 8px; font-size: 13px; }
    .month-page .msum b { display: block; margin: 4px 0 0 16px; font-size: 15px; }
    .month-page .mhead { padding: 12px 14px 14px; }
    .month-page #listeAchats > li.item { gap: 11px; }
    .month-page #listeAchats > li.item .amt { font-size: 14px; }
}
@media (max-width: 390px) {
    .month-page .edit-grid { grid-template-columns: 1fr; }
    .month-page #listeAchats > li.item { padding-right: 7px; }
    .month-page #listeAchats > li.item .txt b { font-size: 14px; }
    .month-page #listeAchats > li.item .av { flex-basis: 10px; width: 10px; height: 10px; min-width: 10px; }
}

.month-page .mhead {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-areas:
        "year totals"
        "months months"
        "bar bar";
    align-items: center;
    gap: 8px 12px;
    padding: 12px 16px;
}

.month-page .annee-nav {
    grid-area: year;
    justify-content: flex-start;
    gap: 4px;
}

.month-page .annee-nav button {
    width: 28px;
    height: 28px;
}

.month-page .msum {
    grid-area: totals;
    justify-content: flex-end;
    align-items: center;
    gap: 16px;
    margin: 0;
    font-size: 12px;
}

.month-page .msum b {
    font-size: 15px;
    margin-left: 4px;
}

.month-page .mois-selector {
    grid-area: months;
    margin: 0;
    min-width: 0;
}

.month-page .mois-ligne {
    padding: 0;
}

.month-page .mois-ligne > * {
    padding: 6px 9px;
}

.month-page .month-bar {
    grid-area: bar;
    margin: 0;
    height: 6px;
}
/* Garder la surbrillance tant que l’édition est ouverte. */
.month-page #listeAchats > li.item.active,
.month-page #listeAchats > li.item.active:hover,
.month-page #listeAchats > li.item.active:focus-within {
    background: var(--cpS, #e4eefe);
}

/* PAGE AJOUTER */

.add-page {
    padding-bottom: calc(40px + env(safe-area-inset-bottom));
}

.add-page .add-card,
.add-page .add-recent {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 16px;
}

/* FORMULAIRE */

.add-page #formAchat {
    display: grid;
    gap: 16px;
}

.add-page .deuxCol {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 202px;
    align-items: start;
    gap: 20px;
}

.add-page .add-fields {
    display: grid;
    gap: 14px;
    min-width: 0;
}

.add-page .add-two {
    display: grid;
    grid-template-columns: 1fr 180px;
    gap: 10px;
}
.add-page .add-one DIV:last-child {
    margin-top: 10px;
}
.add-page .field {
    position: relative;
    min-width: 0;
}

.add-page .field label,
.add-page .field-label {
    display: block;
    margin-bottom: 6px;
    color: var(--mute);
    font-size: 12px;
    font-weight: 600;
}

.add-page .input {
    display: block;
    width: 100%;
    box-sizing: border-box;
    min-width: 0;
    height: 44px;
    padding: 10px 12px;

    background: var(--bg);
    color: var(--ink);
    border: 1.5px solid transparent;
    border-radius: 12px;

    font: inherit;
    font-size: 12px;
    outline: none;
    box-shadow: none;
}

.add-page .input:focus {
    border-color: var(--cp);
}

.add-page .input::placeholder {
    color: var(--mute);
    opacity: .7;
}

input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* Pour Firefox */
input[type=number] {
  -moz-appearance: textfield;
  appearance: textfield; /* Standard moderne */
}

/* MONTANT */

.add-page .amount-wrap {
    position: relative;
}

.add-page .amount-wrap input {
    height: 42px;
    padding-right: 46px;
    font-size: 20px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.add-page .amount-wrap span {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--mute);
    font-size: 19px;
    font-weight: 600;
    pointer-events: none;
}

/* PAYEUR */

.add-page .user-select {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.add-page .user {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 44px;
    padding: 10px;

    box-sizing: border-box;
    background: var(--bg);
    color: var(--ink);
    border: 1.5px solid transparent;
    border-radius: 12px;

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

.add-page .user::before {
    content: "";
    width: 10px;
    height: 10px;
    flex: none;
    border-radius: 50%;
}

.add-page .user[data-usid="2"]::before {
    background: var(--cp);
}

.add-page .user[data-usid="1"]::before {
    background: var(--dd);
}

.add-page .user[data-usid="2"].active,
.add-page .user[data-usid="2"].selected,
.add-page .user[data-usid="2"].on {
    background: var(--card);
    border-color: var(--cp);
    box-shadow: 0 0 0 3px var(--cpS);
}

.add-page .user[data-usid="1"].active,
.add-page .user[data-usid="1"].selected,
.add-page .user[data-usid="1"].on {
    background: var(--card);
    border-color: var(--dd);
    box-shadow: 0 0 0 3px var(--ddS);
}

/* CALENDRIER */

.add-page .calendar {
    height: auto;
    min-width: 0;
}

.add-page .calendar .flatpickr-calendar.inline {
    display: block;
    width: 100%;
    max-width: 100%;
    background: transparent;
    box-shadow: none;
    border: 0;
}

.add-page .calendar .flatpickr-months,
.add-page .calendar .flatpickr-weekdays {
    width: 100%;
}

.add-page .calendar .flatpickr-days,
.add-page .calendar .dayContainer {
    width: 100%;
    min-width: 0;
    max-width: none;
}

.add-page .calendar .flatpickr-day {
    flex-basis: 14.2857%;
    max-width: 14.2857%;
    border-radius: 50%;
}

.add-page .calendar .flatpickr-day.selected {
    background: var(--cp);
    border-color: var(--cp);
}

/* BOUTON VALIDER */

.add-page .button {
    display: block;
    width: 100%;
    min-height: 46px;
    padding: 12px;

    background: var(--cp);
    color: #fff;
    border: 0;
    border-radius: 12px;

    font: inherit;
    font-size: 15px;
    font-weight: 800;
    cursor: pointer;
}

.add-page .button:disabled {
    opacity: .35;
    cursor: default;
}

.add-page .errorr:empty {
    display: none;
}

.add-page .errorr {
    margin: 0;
    color: #e5484d;
    font-size: 13px;
}

/* AUTOCOMPLETION */

.add-page .suggestions {
    position: absolute;
    z-index: 30;
    top: 100%;
    left: 0;
    right: 0;
}

/* DERNIERS AJOUTS */

.add-page .add-recent {
    margin-top: 12px;
    padding: 6px;
}

.add-page .add-recent ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.add-page .add-recent ul > li {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 60px;
    padding: 10px 12px;
    border-radius: 16px;
    box-sizing: border-box;
}

.add-page .add-recent ul > li:hover {
    background: var(--bg);
}

.add-page .add-recent .date {
    flex: none;
    width: 42px;
    display: flex;
    flex-direction: column;
    align-items: center;
    color: var(--mute);
    font-size: 12px;
}

.add-page .add-recent .prenom {
    flex: none;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--cp);
}

.add-page .add-recent .prenom.delphine,
.add-page .add-recent .prenom.dd {
    background: var(--dd);
}

.add-page .add-recent .prenom span {
    display: none;
}

.add-page .add-recent .achat {
    flex: 1;
    min-width: 0;
}

.add-page .add-recent .magasin {
    font-size: 15px;
    font-weight: 600;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.add-page .add-recent .localite {
    color: var(--mute);
    font-size: 13px;
}

.add-page .add-recent .montant {
    flex: none;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
}

.add-page .add-recent .i {
    flex: none;
    padding: 6px;
    color: var(--mute);
    cursor: pointer;
}

/* MOBILE */

@media (max-width: 679px) {
    .add-page .deuxCol {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .add-page .calendar {
        max-width: 360px;
        width: 100%;
        margin-inline: auto;
    }
}

@media (max-width: 420px) {
    .add-page .add-two {
        gap: 8px;
        grid-template-columns: 1fr;
    }

    .add-page .add-recent ul > li {
        gap: 8px;
        padding: 10px 8px;
    }

    .add-page .add-recent .montant {
        font-size: 13px;
    }
}


/* ===================================
   AUTOCOMPLÉTION MAGASIN / LOCALITÉ
=================================== */

.add-page .field {
    position: relative;
    overflow: visible;
}

.add-page .field:focus-within {
    z-index: 30;
}

.add-page .suggestions {
    position: absolute;
    top: calc(100% + 5px);
    left: 0;
    right: 0;
    z-index: 50;

    max-height: 320px;
    overflow-y: auto;
    overscroll-behavior: contain;

    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 14px;
    box-shadow: 0 12px 30px rgba(10, 30, 70, .14);

    padding: 5px;
    scrollbar-width: thin;
}

.add-page .suggestions:empty {
    display: none;
}

/* UNE SUGGESTION */

.add-page .sugg {
    display: flex;
    flex-direction: column;
    gap: 3px;

    padding: 11px 13px;
    border-radius: 10px;

    cursor: pointer;
    transition: background .15s;
}

/* NOM DU MAGASIN */

.add-page .sugg .nom {
    color: var(--ink);
    font-size: 14px;
    font-weight: 600;
    line-height: 1.3;
}

/* LOCALITÉ */

.add-page .sugg .loc {
    color: var(--mute);
    font-size: 12px;
    line-height: 1.3;
}

/* SURVOL + NAVIGATION CLAVIER */

.add-page .sugg:hover,
.add-page .sugg.active {
    background: var(--cpS);
}

.add-page .sugg:hover .nom,
.add-page .sugg.active .nom {
    color: var(--cp);
}

/* TEXTE CORRESPONDANT À LA RECHERCHE */

.add-page .sugg .hl {
    color: var(--cp);
    font-style: normal;
    font-weight: 800;
    background: transparent;
}

/* BOUTON EFFACER MAGASIN */

.add-page #magasin {
    padding-right: 38px;
}

.add-page .clear-btn {
    position: absolute;
    top: 10px;
    right: 2px;

    display: grid;
    place-items: center;

    width: 26px;
    height: 26px;

    border: 0;
    border-radius: 50%;
    background-color: transparent;
    color: var(--mute);

    font-size: 11px;
    cursor: pointer;
}

.add-page .clear-btn:hover {
    color: var(--ink);
    background: var(--cpS);
}

/* ==================================
   LIGNES CLIQUABLES
================================== */

#listeAjouts ul > li:not(.edit-inline) {
    cursor: pointer;
}

#listeAjouts ul > li:not(.edit-inline):hover {
    background: var(--bg);
}

#listeAjouts ul > li:not(.edit-inline):has(+ .edit-inline) {
    background: var(--cpS);
}

/* Flèche inutile */
#listeAjouts .i {
    display: none;
}


/* ==================================
   FORMULAIRE D'ÉDITION
================================== */

#listeAjouts ul > li.edit-inline {
    display: block;
    width: calc(100% - 16px);
    min-height: 0;
    margin: 4px 8px 12px;
    padding: 14px;

    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: 16px;
    box-sizing: border-box;
}

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

#listeAjouts .edit-grid label {
    display: block;
    min-width: 0;
}

#listeAjouts .edit-grid label span {
    display: block;
    margin-bottom: 5px;
    color: var(--mute);
    font-size: 12px;
    font-weight: 600;
}

#listeAjouts .edit-grid input,
#listeAjouts .edit-grid select {
    width: 100%;
    min-width: 0;
    height: 42px;
    box-sizing: border-box;
    padding: 10px;

    background: var(--card);
    color: var(--ink);
    border: 1px solid var(--line);
    border-radius: 11px;

    font: inherit;
    font-size: 14px;
    outline: none;
}

#listeAjouts .edit-grid input:focus,
#listeAjouts .edit-grid select:focus {
    border-color: var(--cp);
}

/* BOUTONS */

#listeAjouts .edit-actions {
    display: flex;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

#listeAjouts .edit-actions button {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    width: auto;
    height: auto;
    min-height: 38px;
    padding: 10px 12px;

    border: 0;
    border-radius: 11px;

    font: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

#listeAjouts .btn-del {
    margin-right: auto;
    background: var(--ddS);
    color: var(--dd);
}

#listeAjouts .btn-cancel {
    background: var(--line);
    color: var(--ink);
}

#listeAjouts .btn-save {
    background: var(--cp);
    color: #fff;
}

@media (max-width: 420px) {
    #listeAjouts .edit-grid {
        grid-template-columns: 1fr;
    }
}

/* Supprimer */

#listeAjouts .btn-del {
    background: #fde8e8;
    color: #dc3545;
}

/* Petite animation à l'ouverture */

#listeAjouts .edit-inline.open {
    animation: editAppear .18s ease-out;
    margin-top: 10px;
}

@keyframes editAppear {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }

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


/* Dates regroupées - page Ajouter */

.add-page #listeAjouts ul > li.day {
    display: flex;
    align-items: center;
    gap: 12px;

    min-height: 0;
    margin: 0;
    padding: 14px 12px 6px;

    background: transparent;
    border-radius: 0;

    color: var(--mute);
    font-size: 13px;
    font-weight: 600;
    cursor: default;
}

#listeAjouts li.day::after {
    content: "";
    flex: 1;
    border-top: 1px solid var(--line);
}
/* Empêcher l'effet de sélection pendant le scroll tactile */
@media (hover: none) and (pointer: coarse) {

    .last li[data-id],
    #listeAchats li[data-id],
    #listeAjouts li[data-id] {
        -webkit-tap-highlight-color: transparent;
        touch-action: pan-y;
    }

    .last li[data-id]:not(.active):hover,
    .last li[data-id]:not(.active):active,
    #listeAchats li[data-id]:not(.active):hover,
    #listeAchats li[data-id]:not(.active):active,
    #listeAjouts li[data-id]:not(.active):hover,
    #listeAjouts li[data-id]:not(.active):active {
        background: transparent;
    }
}

/* Même présentation compacte sur GSM */

@media (max-width: 560px) {

    .month-page .mhead {
        grid-template-columns: auto minmax(0, 1fr);
        grid-template-areas:
            "year totals"
            "months months"
            "bar bar";
        gap: 10px 8px;
        padding: 12px 10px;
    }

    .month-page .annee-nav {
        justify-content: flex-start;
        gap: 2px;
    }

    .month-page .annee-nav b {
        font-size: 16px;
        min-width: 44px;
    }

    .month-page .annee-nav button {
        width: 24px;
        height: 28px;
    }

    .month-page .msum {
        display: flex;
        justify-content: flex-end;
        gap: 8px;
        margin: 0;
        font-size: 11px;
        white-space: nowrap;
    }

    .month-page .msum b {
        display: inline;
        margin: 0 0 0 3px;
        font-size: 12px;
    }

    .month-page .msum .dot {
        width: 7px;
        height: 7px;
        margin-right: 3px;
    }

    /* Les mois restent sur une seule ligne */
    .month-page .mois-selector {
        overflow-x: auto;
        min-width: 0;
        scrollbar-width: none;
    }

    .month-page .mois-ligne {
        width: max-content;
        min-width: 100%;
        gap: 2px;
    }

    .month-page .mois-ligne > * {
        padding: 7px 9px;
        font-size: 12px;
    }
}

/* Point coloré tout à gauche */
.add-page #listeAjouts .prenom {
    order: 0;
    flex: 0 0 12px;
}

/* Date juste après le point */
.add-page #listeAjouts .date {
    order: 1;
    flex: 0 0 38px;
}

/* Magasin puis montant */
.add-page #listeAjouts .achat {
    order: 2;
    flex: 1;
    min-width: 0;
}

.add-page #listeAjouts .montant {
    order: 3;
}


/* COMPTE — RECHERCHE : à charger APRÈS le CSS commun. */
.search-page {
    min-width: 0;
    padding-bottom: calc(40px env(safe-area-inset-bottom));
}

.search-page .search-filters,
.search-page .search-list {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 10px;
    box-sizing: border-box;    
}

.search-page .search-filters {
    padding: 16px;
}

.search-page .search-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}
@media (max-width: 420px) {
    .search-page .search-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 5px;
    }
}

.search-page .search-field {
    display: block;
    min-width: 0;
}

.search-page .search-field > span {
    display: block;
    margin-bottom: 5px;
    color: var(--mute);
    font-size: 12px;
    font-weight: 600;
}

.search-page .search-field input,
.search-page .search-field select {
    display: block;
    width: 100%;
    height: 42px;
    min-width: 0;
    box-sizing: border-box;
    padding: 9px 12px;
    border: 1.5px solid transparent;
    border-radius: 12px;
    outline: none;
    font: inherit;
    font-size: 15px;
    background: var(--bg);
    color: var(--ink);
    color-scheme: light dark;
}

.search-page .search-field input:focus,
.search-page .search-field select:focus {
    border-color: var(--cp);
}

.search-page .search-field input::placeholder {
    color: var(--mute);
    opacity: .8;
}

.search-page .search-summary {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin-top: 16px;
    padding-top: 13px;
    border-top: 1px solid var(--line);
}

.search-page .search-summary > div {
    min-width: 0;
}

.search-page .search-summary span {
    display: block;
    margin-bottom: 4px;
    color: var(--mute);
    font-size: 12px;
}

.search-page .search-summary strong {
    display: block;
    font-weight: 600;
    font-size: 15px;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.search-page .search-summary-cp strong { color: var(--cp); }
.search-page .search-summary-dd strong { color: var(--dd); }

.search-page .search-list {
    margin-top: 12px;
    padding: 6px 6px 10px;
    min-width: 0;
}

.search-page #results {
    margin: 0;
    padding: 0;
    list-style: none;
}

.search-page #results > li.search-day {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0;
    padding: 14px 14px 5px;
    background: none;
    border: 0;
    border-radius: 0;
    color: var(--mute);
    font-size: 13px;
    font-weight: 600;
}

.search-page .search-day::after {
    content: "";
    flex: 1;
    border-top: 1px solid var(--line);
}



/* RÉSULTATS DE RECHERCHE */

.search-page #results {
    list-style: none;
    margin: 0;
    padding: 0;
}

.search-page #results > li.search-item {
    display: flex;
    align-items: center;
    gap: 14px;
    min-height: 60px;
    padding: 10px 14px;
    border-radius: 16px;
    box-sizing: border-box;
}

/* Point coloré */

.search-page .search-dot {
    flex: 0 0 12px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--cp);
}

.search-page .search-item.DD .search-dot {
    background: var(--dd);
}

/* Magasin et localité */

.search-page .search-merchant {
    flex: 1;
    min-width: 0;
}

.search-page .search-merchant b {
    display: block;
    font-size: 15px;
    font-weight: 600;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.search-page .search-merchant span {
    display: block;
    color: var(--mute);
    font-size: 13px;
}

/* Montant à droite */

.search-page .search-amount {
    margin-left: auto;
    flex: none;
    font-size: 15px;
    font-weight: 600;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

/* Mobile */

@media (max-width: 420px) {
    .search-page #results > li.search-item {
        gap: 10px;
        padding: 10px 9px;
    }

    .search-page .search-amount {
        font-size: 14px;
    }
}


/* COMPTE / CRONS — à charger après le CSS commun. */
.crons-page {
    min-width: 0;
}

.crons-page .cron-form-card,
.crons-page .cron-list-card {
    box-sizing: border-box;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 10px;
}

/* FORMULAIRE */
.crons-page .cron-form-card {
    padding: 16px;
}

.crons-page .cron-form {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: end;
    gap: 12px;
}

.crons-page .cron-field {
    display: block;
    min-width: 0;
}

.crons-page .cron-field > span:first-child,
.crons-page .cron-payer legend {
    display: block;
    margin: 0 0 6px;
    padding: 0;
    color: var(--mute);
    font-size: 12px;
    font-weight: 600;
}

.crons-page .cron-field > select,
.crons-page .cron-field input {
    display: block;
    box-sizing: border-box;
    width: 100%;
    min-width: 0;
    height: 44px;
    padding: 10px 12px;
    border: 1.5px solid transparent;
    border-radius: 12px;
    background: var(--bg);
    color: var(--ink);
    font: inherit;
    font-size: 15px;
    outline: none;
    color-scheme: light dark;
}

.crons-page .cron-field > select:focus,
.crons-page .cron-field input:focus {
    border-color: var(--cp);
}

.crons-page .cron-field input::placeholder {
    color: var(--mute);
    opacity: .8;
}

.crons-page .cron-amount-wrap {
    position: relative;
    display: block;
}

.crons-page .cron-amount-wrap input {
    padding-right: 34px;
    font-variant-numeric: tabular-nums;
}

.crons-page .cron-euro {
    position: absolute;
    top: 50%;
    right: 12px;
    transform: translateY(-50%);
    color: var(--mute);
    font-size: 16px;
    font-weight: 600;
    pointer-events: none;
}

.crons-page .cron-payer {
    min-width: 0;
    padding: 0;
    margin: 0;
    border: 0;
}

.crons-page .cron-payer-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.crons-page .cron-payer-buttons button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-sizing: border-box;
    min-width: 0;
    height: 44px;
    padding: 10px 8px;
    border: 1.5px solid transparent;
    border-radius: 12px;
    background: var(--bg);
    color: var(--ink);
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

.crons-page .cron-payer-buttons button::before {
    content: "";
    flex: 0 0 10px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--cp);
}

.crons-page .cron-payer-buttons button[data-cron-user="1"]::before {
    background: var(--dd);
}

.crons-page .cron-payer-buttons button[data-cron-user="2"].on {
    background: var(--card);
    border-color: var(--cp);
    box-shadow: 0 0 0 3px var(--cpS);
}

.crons-page .cron-payer-buttons button[data-cron-user="1"].on {
    background: var(--card);
    border-color: var(--dd);
    box-shadow: 0 0 0 3px var(--ddS);
}

.crons-page .cron-payer-buttons button:focus-visible,
.crons-page button:focus-visible {
    outline: 2px solid var(--cp);
    outline-offset: 2px;
}

.crons-page .cron-add-button {
    grid-column: 1 / -1;
    min-height: 44px;
    padding: 11px 15px;
    border: 0;
    border-radius: 12px;
    background: var(--cp);
    color: white;
    font: inherit;
    font-size: 15px;
    font-weight: 800;
    cursor: pointer;
}

.crons-page .cron-add-button:disabled {
    opacity: .35;
    cursor: default;
}

.crons-page .cron-message {
    margin: 12px 0 0;
    padding: 10px 12px;
    border-radius: 10px;
    background: var(--cpS);
    color: var(--ink);
    font-size: 13px;
}

.crons-page .cron-message[data-error="true"] {
    background: var(--ddS);
    color: var(--dd);
}

.crons-page .cron-message[hidden] {
    display: none;
}

/* LISTE ET TOTAUX */
.crons-page .cron-list-card {
    margin-top: 12px;
    padding: 6px 6px 10px;
}

.crons-page .cron-list-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 14px 12px;
    border-bottom: 1px solid var(--line);
}

.crons-page #cronCount,
.crons-page .cron-total-label > span {
    font-size: 13px;
    font-weight: 600;
    color: var(--mute);
}

.crons-page .cron-total-label {
    display: flex;
    align-items: baseline;
    gap: 7px;
}

.crons-page #cronTotal {
    color: var(--ink);
    font-size: 18px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.crons-page .cron-item {
    display: grid;
    grid-template-columns: 12px minmax(0, 1fr) auto auto 44px;
    align-items: center;
    gap: 12px;
    min-height: 64px;
    box-sizing: border-box;
    padding: 10px 12px;
    border-radius: 14px;
}

.crons-page .cron-item + .cron-item {
    border-top: 1px solid var(--line);
    border-top-left-radius: 0;
    border-top-right-radius: 0;
}

.crons-page .cron-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--cp);
}

.crons-page .cron-item.DD .cron-dot {
    background: var(--dd);
}

.crons-page .cron-name {
    min-width: 0;
}

.crons-page .cron-name strong {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--ink);
    font-size: 15px;
    font-weight: 600;
}

.crons-page .cron-name small {
    display: block;
    margin-top: 2px;
    color: var(--mute);
    font-size: 12px;
}

.crons-page .cron-amount {
    min-width: 77px;
    color: var(--ink);
    font-size: 15px;
    font-weight: 600;
    text-align: right;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.crons-page .cron-item.is-off .cron-dot,
.crons-page .cron-item.is-off .cron-name,
.crons-page .cron-item.is-off .cron-amount {
    opacity: .42;
}

.crons-page .cron-edit-amount {
    width: 102px;
    min-width: 0;
    height: 38px;
    box-sizing: border-box;
    padding: 7px 9px;
    border: 1.5px solid var(--cp);
    border-radius: 10px;
    outline: none;
    background: var(--card);
    color: var(--ink);
    font: inherit;
    font-size: 14px;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.crons-page .cron-edit-button {
    min-height: 34px;
    padding: 7px 11px;
    border: 0;
    border-radius: 999px;
    background: var(--cpS);
    color: var(--cp);
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

.crons-page .cron-edit-button:disabled {
    opacity: .5;
    cursor: default;
}

/* INTERUPTEUR */
.crons-page .cron-switch {
    position: relative;
    width: 44px;
    height: 26px;
    box-sizing: border-box;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: var(--line);
    cursor: pointer;
    transition: background .15s ease;
}

.crons-page .cron-switch::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: white;
    box-shadow: 0 1px 3px rgba(0,0,0,.25);
    transition: transform .15s ease;
}

.crons-page .cron-switch.on {
    background: #2fa84f;
}

.crons-page .cron-switch.on::after {
    transform: translateX(18px);
}

.crons-page .cron-switch:disabled {
    opacity: .5;
    cursor: default;
}

.crons-page .cron-empty {
    margin: 0;
    padding: 28px 12px;
    text-align: center;
    color: var(--mute);
    font-size: 14px;
}

@media (max-width: 640px) {
    .crons-page .cron-form {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .crons-page .cron-payer {
        grid-column: 1 / -1;
    }
}

@media (max-width: 420px) {
    .crons-page .cron-form-card {
        padding: 12px;
    }
    .crons-page .cron-form {
        gap: 10px;
    }
    .crons-page .cron-field > select,
    .crons-page .cron-field input {
        padding: 9px;
        font-size: 14px;
    }
    .crons-page .cron-list-head {
        padding: 10px 9px;
    }
    .crons-page .cron-item {
        grid-template-columns: 10px minmax(0, 1fr) 82px 44px;
        grid-template-areas:
            "dot name amount switch"
            "dot name edit switch";
        gap: 3px 8px;
        padding: 9px;
    }
    .crons-page .cron-dot { grid-area: dot; width: 10px; height: 10px; }
    .crons-page .cron-name { grid-area: name; }
    .crons-page .cron-amount,
    .crons-page .cron-edit-amount { grid-area: amount; }
    .crons-page .cron-amount { min-width: 0; font-size: 14px; }
    .crons-page .cron-edit-amount { width: 82px; height: 32px; }
    .crons-page .cron-edit-button {
        grid-area: edit;
        justify-self: end;
        padding: 4px 10px;
        min-height: 26px;
        font-size: 12px;
    }
    .crons-page .cron-switch { grid-area: switch; }
}


/* TABLETTE ET PC : calendrier inline */
.add-page .calendar {
    display: block;
}

.add-page .add-date-mobile {
    display: none;
}

/* GSM : champ date avec calendrier popup */
@media (max-width: 679px) {

    .add-page .calendar {
        display: none;
    }

    .add-page .add-date-mobile {
        display: block;
    }

    .add-page .add-date-mobile input {
        width: 100%;
        height: 44px;
        background: var(--bg);
        border: 1.5px solid transparent;
        border-radius: 12px;
        padding: 10px 12px;
        color: var(--ink);
        font: inherit;
        font-size: 15px;
        cursor: pointer;
    }

    .add-page .add-date-mobile input:focus {
        border-color: var(--cp);
    }
}


/* BOTTOM SHEET CALENDRIER GSM */

.date-sheet {
    display: none;
}

@media (max-width: 679px) {

    .date-sheet {
        position: fixed;
        inset: 0;
        z-index: 1000;
        display: none;
    }

    .date-sheet.open {
        display: block;
    }

    .date-sheet-backdrop {
        position: absolute;
        inset: 0;
        background: rgba(5, 15, 35, .55);
    }

    .date-sheet-panel {
        position: absolute;
        left: 0;
        right: 0;
        bottom: 0;

        box-sizing: border-box;
        width: 100%;
        height: auto;
        max-height: calc(100dvh - 20px);

        padding: 10px 18px
            calc(58px + env(safe-area-inset-bottom, 0px));

        overflow-y: auto;
        overscroll-behavior: contain;

        background: var(--card);
        color: var(--ink);
        border-radius: 24px 24px 0 0;
        box-shadow: 0 -10px 35px rgba(0,0,0,.18);

        animation: dateSheetUp .22s ease-out;
    }

    .date-sheet-handle {
        width: 42px;
        height: 5px;
        margin: 0 auto 14px;
        border-radius: 99px;
        background: var(--line);
    }

    .date-sheet-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 16px;
    }

    .date-sheet-header h2 {
        margin: 0;
        font-size: 18px;
        font-weight: 800;
    }

    #dateSheetClose {
        display: grid;
        place-items: center;
        width: 34px;
        height: 34px;
        border: 0;
        border-radius: 50%;
        background: var(--bg);
        color: var(--ink);
        font-size: 17px;
        cursor: pointer;
    }

    /* Flatpickr dans le sheet */

    .date-sheet-calendar {
        width: 100%;
        max-width: 380px;
        margin: 0 auto;
    }

    .date-sheet .flatpickr-calendar.inline {
        position: relative;
        display: block;
        width: 100% !important;
        max-width: none;
        margin: 0;
        background: transparent;
        border: 0;
        box-shadow: none;
    }

    .date-sheet .flatpickr-innerContainer,
    .date-sheet .flatpickr-rContainer,
    .date-sheet .flatpickr-days,
    .date-sheet .dayContainer,
    .date-sheet .flatpickr-weekdays {
        width: 100% !important;
        min-width: 0 !important;
        max-width: none !important;
        box-sizing: border-box;
    }

    .date-sheet .flatpickr-day {
        flex: 0 0 14.2857%;
        width: 14.2857%;
        max-width: none;
        height: 40px;
        line-height: 40px;
        color: var(--ink);
        font-size: 14px;
    }

    .date-sheet .flatpickr-day.prevMonthDay,
    .date-sheet .flatpickr-day.nextMonthDay {
        color: var(--mute);
        opacity: .45;
    }

    .date-sheet .flatpickr-months .flatpickr-month {
        color: var(--ink);
        fill: var(--ink);
    }

    .date-sheet .flatpickr-weekday {
        color: var(--mute);
    }

    .date-sheet .flatpickr-day.selected,
    .date-sheet .flatpickr-day.selected:hover {
        background: var(--cp);
        border-color: var(--cp);
        color: #fff;
    }

    .date-sheet-today {
        display: block;
        width: 100%;
        max-width: 380px;
        margin: 16px auto 0;
        padding: 13px;

        border: 0;
        border-radius: 12px;

        background: var(--cpS);
        color: var(--cp);

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

    body.date-sheet-open {
        overflow: hidden;
    }
}

@keyframes dateSheetUp {
    from {
        transform: translateY(100%);
    }
    to {
        transform: translateY(0);
    }
}


@media (max-width: 679px) {

    .add-page #dateMobile {
        display: block;
        width: 100%;
        text-align: left;
        cursor: pointer;
        appearance: none;
    }

    .date-sheet,
    .date-sheet * {
        -webkit-user-select: none;
        user-select: none;
        -webkit-touch-callout: none;
    }

}


/* ========================================
   HEADER APPLICATION
======================================== */

.app-top {
    background: var(--bg);
    z-index: 100;
}

.app-header {
    background: var(--card);
    border-bottom: 1px solid var(--line);
}

.app-header::before {
    content: "";
    background: #fff;
    height: env(safe-area-inset-top);
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
}

.app-header-inner {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 68px;
}

.app-header-logo {
    display: grid;
    place-items: center;
    flex: 0 0 42px;
    height: 42px;

    background: #edf4ff;
    color: var(--cp);

    border-radius: 14px;
    font-size: 25px;
    font-weight: 800;
}

.app-header-titles {
    min-width: 0;
}

.app-header-titles h1 {
    margin: 0;
    color: var(--ink);
    font-size: 20px;
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: -.5px;
}

.app-header-titles span {
    display: block;
    margin-top: 3px;
    color: var(--mute);
    font-size: 12px;
    font-weight: 500;
}

/* ========================================
   SOLDE
======================================== */

.app-balance-wrap {
    padding-top: 10px;
    padding-bottom: 8px;
}

.app-top .app-balance {
    display: flex;
    align-items: center;
    gap: 10px;

    padding: 13px 15px;
    margin: 0;

    border-radius: 16px;
    background: #f5f7fb;
    color: var(--ink);
    box-shadow: none;
}

.app-balance-icon {
    display: grid;
    place-items: center;
    flex: 0 0 34px;
    height: 34px;

    background: #fff;
    border-radius: 50%;

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

.app-top .app-balance span {
    flex: 1;
    min-width: 0;
    font-size: 13px;
    line-height: 1.35;
}

.app-top .app-balance em {
    font-style: normal;
    font-weight: 750;
}

.app-top .app-balance b {
    flex-shrink: 0;
    font-size: 19px;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

/* Couleur selon la personne en retard */

.app-balance:has(em.DD) {
    background: #fcebf2;
}

.app-balance:has(em.DD) .app-balance-icon,
.app-balance:has(em.DD) b {
    color: #c32d70;
}

.app-balance:has(em.CP) {
    background: #eaf2ff;
}

.app-balance:has(em.CP) .app-balance-icon,
.app-balance:has(em.CP) b {
    color: #2567d5;
}

/* GSM */

@media (max-width: 679px) {

    .app-header-inner {
        min-height: 60px;
        gap: 10px;
    }

    .app-header-logo {
        flex-basis: 38px;
        height: 38px;
        border-radius: 12px;
        font-size: 22px;
    }

    .app-header-titles h1 {
        font-size: 18px;
    }

    .app-balance-wrap {
        padding-top: 8px;
        padding-bottom: 6px;
    }

    .app-top .app-balance {
        gap: 8px;
        padding: 11px 12px;
        border-radius: 14px;
    }

    .app-balance-icon {
        flex-basis: 30px;
        height: 30px;
        font-size: 17px;
    }

    .app-top .app-balance span {
        font-size: 12px;
    }

    .app-top .app-balance b {
        font-size: 17px;
    }
}

@media (max-width: 360px) {
    .app-top .app-balance b {
        font-size: 15px;
    }
}
@media (max-width: 1100px) {

    .app-top .app-balance-wrap {
        width: 100%;
        max-width: none;
        margin: 0;
        padding-left: 0;
        padding-right: 0;
        box-sizing: border-box;
        margin-top: -12px;
    }

    .app-top .app-balance {
        width: 100%;
        box-sizing: border-box;
        border-radius: 0;
    }

}

.search-empty {
    padding: 10px;
}

/* Android : respecter la barre de statut */
body.is-native-app {
    padding-top: env(safe-area-inset-top);
    box-sizing: border-box;
}

/* Header sticky */
.is-native-app .app-top {
    top: env(safe-area-inset-top);
}

@media (max-width: 679px) {

    .app-main[data-page="index"] {
        padding-bottom: calc(40px + env(safe-area-inset-bottom));
    }

}
a,
button {
    -webkit-tap-highlight-color: transparent;
}
.footer a {
    -webkit-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
}