:root {
    --paper: #e6e6e6;
    --paper-2: #ffffff;
    --ink: #1f1a17;
    --muted: #6f675e;
    --line: #e0d8cc;
    --accent: #8f2d2d;
    --green: #1e6b45;
    --amber: #8a5a00;
    --shadow: 0 1px 0 rgba(31, 26, 23, 0.04);
}

body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font-family: "IBM Plex Sans", "Segoe UI", sans-serif;
    font-size: 16px;
    line-height: 1.5;
}

h1, h2, .brand, .lot-num {
    font-family: "IBM Plex Serif", Georgia, serif;
    font-weight: 500;
    letter-spacing: -0.02em;
}

h1 {
    font-size: clamp(1.8rem, 3vw, 2.4rem);
    margin: 0;
}

h2 {
    font-family: "IBM Plex Sans", "Segoe UI", sans-serif;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--muted);
    margin: 0 0 0.8rem;
}

a {
    color: inherit;
}

.skip:focus {
    position: absolute;
    z-index: 50;
}

.mast {
    position: sticky;
    top: 0;
    z-index: 20;
    background: rgba(243, 239, 230, 0.94);
    backdrop-filter: blur(10px);
    border-top: 4px solid var(--accent);
    border-bottom: 1px solid var(--line);
}

.mast-inner {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1.5rem;
    min-height: 4.2rem;
    padding-top: 0.8rem;
    padding-bottom: 0.8rem;
}

.brand {
    text-decoration: none;
    font-size: 1.45rem;
    color: var(--ink);
}

.brand span {
    display: inline-block;
    margin-left: 0.45rem;
    font-family: "IBM Plex Sans", "Segoe UI", sans-serif;
    font-size: 0.72rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--muted);
}

.mast nav {
    display: flex;
    flex-wrap: wrap;
    gap: 1.1rem;
}

.mast nav a {
    text-decoration: none;
    color: var(--muted);
    padding-bottom: 0.15rem;
}

.mast nav a.is-active {
    color: var(--ink);
    box-shadow: inset 0 -2px 0 var(--accent);
}

main {
    padding-top: 1.8rem;
    padding-bottom: 3rem;
}

.page-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.eyebrow, .crumb, .meta-page, .aide-courte, .sous {
    color: var(--muted);
}

.eyebrow {
    margin: 0 0 0.2rem;
    font-size: 0.72rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.crumb {
    margin: 0 0 0.35rem;
    font-size: 0.92rem;
}

.meta-page {
    margin: 0.4rem 0 0;
}

.lede {
    max-width: 42rem;
    font-size: 1.05rem;
}

.chiffres {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
    margin: 0 0 1rem;
}

.chiffres article, .panel, .lot, .vide {
    background: var(--paper-2);
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
}

.chiffres article {
    padding: 0.85rem 1rem 1rem;
}

.chiffres p, .soldes span {
    margin: 0;
    color: var(--muted);
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.chiffres strong {
    display: block;
    margin-top: 0.25rem;
    font-size: 1.25rem;
    font-weight: 500;
}

.chiffres .reste strong, .soldes li:last-child strong {
    color: var(--accent);
}

.num {
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    text-align: right;
}

.montant-neg {
    color: var(--accent);
}

.ref {
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.02em;
}

.barre {
    display: flex;
    height: 8px;
    background: #efe8dc;
    border-radius: 99px;
    overflow: hidden;
}

.barre-fact { background: var(--ink); height: 100%; }
.barre-ext { background: var(--accent); height: 100%; }

.legende-barre {
    display: flex;
    flex-wrap: wrap;
    gap: 0.85rem;
    align-items: center;
    margin: 0.45rem 0 0.2rem;
    color: var(--muted);
    font-size: 0.82rem;
}

.carre {
    display: inline-block;
    width: 0.7rem;
    height: 0.7rem;
    margin-right: 0.28rem;
    vertical-align: -1px;
}

.carre.fact { background: var(--ink); }
.carre.ext { background: var(--accent); }
.carre.reste { background: #efe8dc; border: 1px solid var(--line); }

.bloc { margin-top: 1.8rem; }

.table {
    --bs-table-bg: transparent;
    --bs-table-color: var(--ink);
    --bs-table-border-color: var(--line);
    margin-bottom: 0;
}

.table thead th {
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
    font-weight: 500;
    border-bottom-color: var(--ink);
}

.table td, .table th { vertical-align: middle; }
.sous { display: block; font-size: 0.85rem; }

.etat {
    display: inline-block;
    padding: 0.12rem 0.42rem;
    border: 1px solid var(--line);
    font-size: 0.68rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    vertical-align: 2px;
}

.etat-ouvert { color: var(--accent); border-color: #e7c7be; background: #fdf7f5; }
.etat-partiel { color: var(--amber); border-color: #ead7a8; background: #fdf9f0; }
.etat-solde, .etat-clos { color: var(--green); border-color: #b7d4c4; background: #f4faf6; }
.etat-extourne, .etat-vide { color: var(--muted); background: #f7f4ee; }

.panel, .lot, .vide {
    padding: 1rem 1.1rem 1.1rem;
}

.lot { margin-bottom: 0.9rem; }
.lot-head, .lots-head, .page-actions, .filtre {
    display: flex;
    justify-content: space-between;
    gap: 0.8rem;
    align-items: end;
}

.lot-head { align-items: baseline; }
.lot-num { margin: 0; color: var(--accent); }
.lot-montant { margin: 0; font-size: 1.05rem; }
.lot-desc {
    white-space: pre-wrap;
    margin: 0.55rem 0 0.8rem;
}

.soldes {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
    list-style: none;
    padding: 0;
    margin: 0.8rem 0;
}

.soldes li {
    background: var(--paper);
    padding: 0.45rem 0.65rem;
}

.soldes strong { font-weight: 500; }

.doc-form, .ligne-edit, .form-grid, .filtre {
    display: grid;
    gap: 0.75rem;
}

.doc-form {
    grid-template-columns: 1.1fr 1fr 0.8fr 0.8fr 1.2fr auto;
    align-items: end;
    margin-top: 0.8rem;
}

.ligne-edit {
    grid-template-columns: 1fr 11rem auto;
    align-items: end;
    margin-top: 0.75rem;
}

.form-grid { grid-template-columns: repeat(3, 1fr); margin-top: 0.8rem; }
.span-2 { grid-column: span 2; }
.span-3 { grid-column: span 3; }

.filtre {
    grid-template-columns: 1.3fr 1fr 0.8fr auto;
    margin-bottom: 1rem;
}

.ligne-editor {
    display: grid;
    grid-template-columns: 1fr 11rem auto;
    gap: 0.75rem;
    align-items: end;
    padding: 0.8rem 0;
    border-top: 1px solid var(--line);
}

.field {
    display: flex;
    flex-direction: column;
    gap: 0.28rem;
    margin-bottom: 0.75rem;
    font-size: 0.72rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--muted);
}

.form-grid .field, .doc-form .field, .ligne-edit .field, .filtre .field, .ligne-editor .field {
    margin-bottom: 0;
}

.field .form-control, .field .form-select, .field textarea {
    text-transform: none;
    letter-spacing: 0;
    color: var(--ink);
    font-size: 1rem;
}

.champ-date {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    position: relative;
    text-transform: none;
    letter-spacing: 0;
}

.champ-date .form-control {
    flex: 1;
}

.btn-calendrier {
    position: relative;
    z-index: 2;
    white-space: nowrap;
}

.calendrier-natif {
    position: absolute;
    top: 0;
    right: 0;
    z-index: 1;
    width: 6.8rem;
    height: 100%;
    margin: 0;
    padding: 0;
    border: 0;
    opacity: 0.02;
    cursor: pointer;
}

.form-control, .form-select {
    border-color: var(--line);
    border-radius: 2px;
    background: white;
}

.form-control:focus, .form-select:focus {
    border-color: var(--ink);
    box-shadow: 0 0 0 3px rgba(31, 26, 23, 0.08);
}

.btn {
    border-radius: 4px;
    font-weight: 600;
}

.btn-action, .btn-sauver {
    display: inline-block;
    border-radius: 4px;
    border: 1px solid transparent;
    font-weight: 600;
    padding: 0.38rem 0.9rem;
    line-height: 1.2;
    text-decoration: none;
}
.btn-sauver { background: #2f6fdb; border-color: #2f6fdb; color: #fff; }
.btn-sauver:hover, .btn-sauver:focus { background: #245bb8; color: #fff; }
.btn-outil {
    background: #f7f7f7;
    border: 1px solid #d5d5d5;
    color: #333;
    border-radius: 2px;
    font-weight: 500;
    font-size: 0.86rem;
    padding: 0.28rem 0.55rem;
}
.btn-outil:hover, .btn-outil:focus { background: #fff; color: #111; border-color: #bbb; }
.btn-outil:disabled { opacity: 0.45; }

.btn-ink {
    background: #1c1c1c;
    border: 1px solid #1c1c1c;
    color: #fff;
}

.btn-ink:hover, .btn-ink:focus {
    background: #3a312b;
    border-color: #3a312b;
    color: white;
}

.btn-quiet {
    background: #fff;
    border: 1px solid #cfcfcf;
    color: #222;
}

.btn-quiet:hover, .btn-quiet:focus {
    border-color: var(--ink);
    color: var(--ink);
    background: white;
}

.btn-danger-quiet {
    background: #d9534f;
    border: 1px solid #d9534f;
    color: #fff;
}

.btn-danger-quiet:hover, .btn-danger-quiet:focus {
    background: #c9302c;
    color: #fff;
    border-color: #c9302c;
}

.page-actions { margin-top: 1rem; align-items: center; }
.total-live { margin: 0; color: var(--muted); }
.total-live strong { color: var(--ink); font-weight: 500; }

.panneau {
    margin-top: 1rem;
    padding-top: 0.7rem;
    border-top: 1px solid var(--line);
}

.panneau summary, .aide summary {
    cursor: pointer;
    color: var(--muted);
}

.aide {
    margin: 0.4rem 0 1.2rem;
}

.aide p, .vide ol { margin: 0.6rem 0 0; }

.panel-etroit { max-width: 36rem; }

.export-blocs {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
    gap: 1rem 1.5rem;
}

.export-blocs fieldset {
    border: 1px solid var(--line, #e4dfd4);
    border-radius: 0.4rem;
    padding: 0.8rem 1rem 0.2rem;
}

.export-blocs legend {
    font-size: 0.85rem;
    padding: 0 0.3rem;
}

#lot-table .form-control,
#lot-table .form-select {
    min-width: 6.5rem;
}

.check {
    display: flex;
    gap: 0.55rem;
    align-items: flex-start;
    margin: 0.9rem 0;
    text-transform: none;
    letter-spacing: 0;
    color: var(--ink);
    font-size: 1rem;
}

.connexion {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
    margin: 0 0 1rem;
}

.connexion div {
    padding-bottom: 0.4rem;
    border-bottom: 1px solid var(--line);
}

.connexion dt {
    color: var(--muted);
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.connexion dd {
    margin: 0.15rem 0 0;
    font-variant-numeric: tabular-nums;
}

.install-panel { max-width: 46rem; }
.zone-danger { margin-top: 1.6rem; }
.inline-danger { margin-top: 0.8rem; }
.vide-inline { color: var(--muted); margin: 0.4rem 0 0.8rem; }

.alert {
    border-radius: 2px;
    border: 1px solid var(--line);
    background: white;
    color: var(--ink);
}

.alert-danger { border-color: #e4b4b4; background: #fdf6f6; }
.alert-success { border-color: #b7d4c4; background: #f4faf6; }
.alert-warning { border-color: #ead7a8; background: #fdf9f0; }

tr[data-href] { cursor: pointer; }
tr[data-href]:hover { background: rgba(31, 26, 23, 0.03); }

.table td.lot-desc { text-align: left; white-space: pre-wrap; }

.tags, .tags-bon { display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; }
.tags { list-style: none; padding: 0; margin: 0; }
.tags-bon { margin: 0 0 1rem; }
.tag {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    border: 1px solid var(--line);
    background: white;
    padding: 0.08rem 0.45rem;
    font-size: 0.82rem;
    text-transform: none;
    letter-spacing: 0;
    color: var(--ink);
}
.tag form { margin: 0; }
.tag button {
    border: 0;
    background: transparent;
    color: var(--muted);
    padding: 0 0.1rem;
    line-height: 1;
    cursor: pointer;
}
.tag-ajout { display: flex; gap: 0.45rem; align-items: center; }
.tag-ajout .form-control { width: 14rem; }

.piece {
    display: inline-block;
    margin: 0.12rem 0.28rem 0.12rem 0;
    padding: 0.12rem 0.45rem;
    border: 1px solid var(--line);
    background: white;
    color: var(--ink);
    font-size: 0.82rem;
    cursor: pointer;
}
.piece:hover, .piece:focus { border-color: var(--ink); }

.combo { position: relative; }
.field .combo, .field .combo button { text-transform: none; letter-spacing: 0; color: var(--ink); font-size: 1rem; }
.combo-liste {
    position: absolute;
    z-index: 30;
    left: 0;
    right: 0;
    top: calc(100% + 2px);
    margin: 0;
    padding: 0;
    list-style: none;
    background: white;
    border: 1px solid var(--line);
    max-height: 14rem;
    overflow: auto;
}
.combo-liste button {
    display: block;
    width: 100%;
    text-align: left;
    background: white;
    border: 0;
    padding: 0.45rem 0.65rem;
}
.combo-liste button:hover, .combo-liste button:focus { background: var(--paper); }

dialog.dialog-large { width: min(54rem, calc(100vw - 2rem)); }

.couple, .form-grid .couple {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.8rem;
}

.form-grid .couple { grid-column: span 2; }

.login-panel { max-width: 46rem; }
.login-form { display: grid; gap: 0.85rem; max-width: 22rem; }

.liste-services {
    list-style: none;
    margin: 0;
    padding: 0;
}

.liste-services li {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    align-items: center;
    padding: 0.45rem 0;
    border-bottom: 1px solid var(--line);
}

.liste-services form { margin: 0; }

dialog {
    width: min(38rem, calc(100vw - 2rem));
    border: 1px solid var(--line);
    border-radius: 2px;
    padding: 1.15rem 1.2rem 1.25rem;
    background: var(--paper-2);
    color: var(--ink);
}
dialog::backdrop { background: rgba(31, 26, 23, 0.45); }
.dialog-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: 0.8rem; }
.dialog-head h2 {
    margin: 0;
    font-family: "IBM Plex Serif", Georgia, serif;
    font-size: 1.35rem;
    letter-spacing: -0.02em;
    text-transform: none;
    color: var(--ink);
}
dialog .form-grid { margin-top: 0; }

.etat-cloture { color: #f6f3ec; background: var(--ink); border-color: var(--ink); }

.actions-bon {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.5rem;
    align-items: center;
}

.actions-bon form { margin: 0; }

.actions-ligne {
    white-space: nowrap;
}

.menu-ligne {
    position: relative;
    display: inline-block;
    text-align: left;
}

.menu-ligne > summary {
    list-style: none;
    cursor: pointer;
}

.menu-ligne > summary::-webkit-details-marker { display: none; }

.menu-ligne-liste {
    position: fixed;
    z-index: 80;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    min-width: 9.5rem;
    padding: 0.35rem;
    background: #fff;
    border: 1px solid #d8d8d8;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.14);
    overflow: visible;
}
.menu-ligne-liste[hidden] { display: none; }

.menu-ligne-liste .btn { text-align: left; }

.filtres-sauves {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    align-items: center;
    margin: 0.75rem 0 1rem;
}

.casquette {
    display: flex;
    gap: 0.5rem;
    align-items: end;
}

.services-direction { margin: 0.35rem 0 0.6rem; }
.services-direction strong {
    display: block;
    margin-bottom: 0.2rem;
    text-transform: none;
    letter-spacing: 0;
    font-size: 0.95rem;
    color: var(--ink);
}

.solde-calcule {
    background: #e4dfd4;
    color: #5e584f;
    cursor: default;
}

.resume-ligne { cursor: pointer; }
.resume-ligne:hover, .resume-ligne:focus { background: #f3efe6; }

.colophon {
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: 0.85rem;
    padding: 1rem 0 1.4rem;
}

.table-pieces { font-size: 0.92rem; }
.table-pieces td:last-child, .table td:last-child form { margin: 0; }

@media (max-width: 1100px) {
    .doc-form { grid-template-columns: 1fr 1fr 1fr; }
}

@media (max-width: 800px) {
    .chiffres, .soldes, .connexion, .form-grid, .filtre, .ligne-editor, .ligne-edit, .doc-form {
        grid-template-columns: 1fr;
    }
    .span-2, .span-3 { grid-column: auto; }
    .page-head, .lot-head, .lots-head, .mast-inner { flex-direction: column; align-items: flex-start; }
    .num { text-align: left; }
}

@media print {
    .mast, .coque, .no-print, .colophon, .panneau, .doc-form { display: none !important; }
    body { background: white; }
    .lot, .chiffres article { break-inside: avoid; box-shadow: none; }
}

.coque {
    position: sticky;
    top: 0;
    z-index: 30;
    color: #fff;
}

.coque-haute {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: center;
    gap: 1rem;
    min-height: 4.4rem;
    padding: 0.55rem 1.2rem;
    background: #1c1c1c;
}

.marque {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: #fff;
    text-decoration: none;
    min-width: 0;
}

.logo-marque {
    display: grid;
    place-items: center;
    width: 2.6rem;
    height: 2.6rem;
    background: #fff;
    color: #c4122f;
    font-weight: 600;
    font-size: 1.15rem;
    flex: none;
}

.marque-textes {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
    min-width: 0;
}

.marque-textes strong {
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.marque-textes small {
    color: #f0d6d6;
    font-size: 0.78rem;
}

.coque-outils {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    grid-column: 2;
}

.menu-haut { position: relative; }
.menu-haut > summary {
    list-style: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    height: 2.35rem;
    padding: 0.35rem 0.85rem;
    color: #fff;
    user-select: none;
    white-space: nowrap;
}
.menu-haut > summary::-webkit-details-marker { display: none; }
.menu-haut > summary::after {
    content: "";
    border: 4px solid transparent;
    border-top-color: currentColor;
    margin-top: 0.3rem;
}

.bouton-utilisateur {
    background: #111;
}
.bouton-utilisateur::after { border-top-color: #fff; }
.bouton-rouge { background: #c4122f; }
.icone-user {
    width: 1.15rem;
    height: 1.15rem;
    border-radius: 50%;
    background: #d9d9d9;
    box-shadow: inset 0 -0.35rem 0 #bfbfbf;
    flex: none;
}

.panneau-haut {
    position: absolute;
    right: 0;
    top: calc(100% + 0.35rem);
    z-index: 40;
    min-width: 16rem;
    background: #fff;
    color: #222;
    border: 1px solid #e3e3e3;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.16);
    padding: 0.85rem 0.9rem 0.7rem;
}
.panneau-user { min-width: 15rem; }
.user-nom { margin: 0; font-weight: 600; }
.user-id { margin: 0.15rem 0 0.8rem; color: #666; font-size: 0.9rem; }
.lien-sortir { color: #1a5fbf; text-decoration: none; }
.panneau-titre {
    margin: 0 0 0.35rem;
    color: #777;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}
.choix-menu {
    display: block;
    width: 100%;
    text-align: left;
    background: transparent;
    border: 0;
    color: #333;
    padding: 0.4rem 0.15rem;
    text-decoration: none;
    cursor: pointer;
}
.choix-menu:hover, .choix-menu.is-actif { color: #c4122f; }
.panneau-haut form { margin: 0; }

.ajout-favori > summary {
    list-style: none;
    cursor: pointer;
    color: #1a5fbf;
    text-align: right;
    margin-bottom: 0.45rem;
}
.ajout-favori > summary::-webkit-details-marker { display: none; }
.form-favori { margin: 0.4rem 0 0.6rem; text-align: left; }
.liste-favoris {
    list-style: none;
    margin: 0.3rem 0;
    padding: 0.4rem 0;
    border-top: 1px solid #ececec;
}
.liste-favoris a { color: #244e78; text-decoration: none; }
.liste-favoris a:hover { text-decoration: underline; }
.liste-retrait li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    padding: 0.2rem 0;
}
.liste-retrait form { margin: 0; }
.liste-retrait button {
    border: 0;
    background: transparent;
    color: #888;
    font-size: 1.1rem;
    line-height: 1;
    cursor: pointer;
}
.favoris-vide { margin: 0.4rem 0; color: #777; font-size: 0.9rem; }

.coque-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    min-height: 2.7rem;
    padding: 0 1.2rem;
    background: #c4122f;
}
.coque-liens { display: flex; align-items: center; gap: 0.2rem; }
.coque-nav > .coque-liens > a, .menu-nav > summary {
    color: #fff;
    text-decoration: none;
    padding: 0.45rem 0.8rem;
}
.coque-nav .panneau-haut a,
.coque-nav .panneau-haut .choix-menu {
    color: #244e78;
    background: transparent;
    padding: 0.45rem 0.55rem;
}
.coque-nav .panneau-haut a:hover,
.coque-nav .panneau-haut .choix-menu:hover,
.choix-menu:hover {
    background: #1a6fb5;
    color: #fff;
}
.coque-nav a.is-active, .menu-nav > summary.is-active {
    background: rgba(0, 0, 0, 0.18);
}
.menu-nav > summary { background: transparent; }
.menu-nav .panneau-haut { left: 0; right: auto; }
.recherche-rapide {
    display: flex;
    align-items: center;
    gap: 0.45rem;
}
.bascule-recherche {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}
.barre-recherche { display: none; margin: 0; padding: 0.45rem 0.8rem 0.6rem; background: #fff; }
.bascule-recherche:checked + .barre-recherche { display: block; }
.barre-recherche input { width: 100%; height: 2.4rem; color: #222; }
.ico-recherche {
    display: grid;
    place-items: center;
    flex: none;
    position: relative;
    z-index: 3;
    color: #fff;
    background: transparent;
    border: 0;
    min-width: 2.75rem;
    min-height: 2.75rem;
    margin: 0;
    padding: 0.35rem;
    cursor: pointer;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}
.ico-recherche svg { pointer-events: none; }
.lien-sortir { display: block; margin-top: 0.35rem; }
.lien-fournisseur { color: #1a5fbf; font-weight: 700; text-decoration: none; }
.articles-apercu {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin: 0.15rem 0 0;
    color: #444;
    font-size: 0.9rem;
}
.faite-par { margin: 0.2rem 0 0; color: #444; }
.tri-reduit { margin: 0; }
.tri-reduit > summary { color: #333; }
.fiche-commande,
.fiche-page {
    background: #fff;
    border: 1px solid #e4e4e4;
    margin-top: 1rem;
}
.fiche-page { padding: 1rem 1.15rem 1.4rem; }
.reglages {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
    gap: 1.2rem;
    align-items: start;
}
.reglages-nav {
    display: flex;
    flex-direction: column;
    background: #f7f7f7;
    border: 1px solid #e4e4e4;
}
.reglages-nav a {
    padding: 0.6rem 0.85rem;
    color: #244e78;
    text-decoration: none;
    border-bottom: 1px solid #e6e6e6;
}
.reglages-nav a.is-active,
.reglages-nav a:hover { background: #1a6fb5; color: #fff; }
.rubrique { margin-top: 0.45rem; }
.fiche-commande .chiffres {
    gap: 0.35rem;
    margin: 0.45rem 1rem 0.25rem;
}
.fiche-commande .chiffres article {
    padding: 0.28rem 0.5rem 0.35rem;
    box-shadow: none;
}
.fiche-commande .chiffres strong { font-size: 1rem; margin-top: 0; }
.fiche-commande .barre { height: 6px; margin: 0 1rem; }
.fiche-commande .legende-barre { margin: 0.2rem 1rem 0.35rem; gap: 0.55rem; }
.fiche-haut, .fiche-actions, .onglets-commande, .tags-bon, .bandeau-commande {
    padding-left: 1rem;
    padding-right: 1rem;
}
.fiche-haut {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding-top: 0.9rem;
}
.fiche-titre { display: flex; align-items: center; gap: 0.6rem; }
.fiche-titre h1 { font-size: 1.45rem; margin: 0; }
.lien-retour { color: #1a5fbf; text-decoration: none; }
.onglets-commande {
    display: flex;
    gap: 0.2rem;
    border-bottom: 1px solid #e6e6e6;
    margin-top: 0.6rem;
    overflow-x: auto;
}
.onglets-commande a,
.onglets-commande button {
    flex: none;
    color: #333;
    text-decoration: none;
    background: transparent;
    border: 0;
    font: inherit;
    cursor: pointer;
    white-space: nowrap;
    padding: 0.45rem 0.8rem;
}
.onglets-commande a.is-active,
.onglets-commande button.is-active { color: #1a5fbf; box-shadow: inset 0 -2px 0 #1a5fbf; }
.releve { margin: 0.8rem 1rem 1.2rem; }
.releve h2 { font-size: 1.05rem; margin: 0 0 0.6rem; }
.ligne-releve { cursor: pointer; }
.ligne-releve:hover { background: #f3f7fb; }
.compte-edition { max-width: 42rem; margin-bottom: 1.2rem; }
.fiche-actions { display: flex; justify-content: flex-end; gap: 0.4rem; padding-top: 0.7rem; flex-wrap: wrap; }
.bandeau-commande {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: center;
    gap: 0.8rem;
    margin: 0.7rem 1rem 0.4rem;
    padding: 0.85rem 1rem;
    background: #1a6fb5;
    color: #fff;
}
.bandeau-commande a { color: #fff; font-weight: 700; }
.bandeau-commande p { margin: 0.15rem 0 0; }
.bandeau-montants { text-align: right; }
.bloc-lignes { margin: 0.6rem 1rem 1rem; }
.bloc-lignes > summary {
    cursor: pointer;
    background: #f7f7f7;
    border: 1px solid #e6e6e6;
    padding: 0.55rem 0.8rem;
    color: #1a5fbf;
}
.visibilite-tag { border: 0; padding: 0; margin: 0 0 0.8rem; display: flex; gap: 0.8rem; align-items: center; }
.visibilite-tag legend { float: left; margin-right: 0.6rem; font-size: 0.95rem; }
.puce-public, .puce-prive { display: inline-block; padding: 0.05rem 0.45rem; color: #fff; font-size: 0.82rem; }
.puce-public { background: #6c757d; }
.puce-prive { background: #1c1c1c; }
.dialog-actions { display: flex; align-items: center; gap: 0.55rem; }
.btn-link { background: none; border: 0; color: #1a5fbf; cursor: pointer; padding: 0; }
.lien-fournisseur:hover { text-decoration: underline; }
.solde-ligne { color: #1a1a1a; font-weight: 700; }
.widgets-index { margin-top: 1.2rem; }
.titre-etats { margin-top: 1.6rem; }

.carte-taches, .carte-budgets {
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    margin-top: 1.2rem;
}
.carte-taches { padding: 1.1rem 1.25rem 0.6rem; }
.carte-budgets { padding: 1rem 1.25rem 1.2rem; }
.taches-entete {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}
.titre-taches {
    font-family: "IBM Plex Sans", "Segoe UI", sans-serif;
    font-size: 1.35rem;
    font-weight: 600;
    letter-spacing: 0;
    margin: 0;
}
.onglet-commandes {
    margin: 0.85rem 0 0.4rem;
    color: #1a5fbf;
    font-weight: 600;
}
.onglet-commandes span {
    display: inline-grid;
    place-items: center;
    min-width: 1.3rem;
    height: 1.3rem;
    margin-left: 0.25rem;
    padding: 0 0.35rem;
    border-radius: 999px;
    background: #1a5fbf;
    color: #fff;
    font-size: 0.75rem;
}
.recherche-avancee { margin: 0.3rem 0 0.8rem; }
.recherche-avancee > summary {
    cursor: pointer;
    color: #1a5fbf;
    width: fit-content;
}
.filtre-taches {
    grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
    align-items: end;
    margin-top: 0.8rem;
}
.barre-resultats {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 0.55rem 0;
    border-top: 1px solid #eee;
    border-bottom: 1px solid #eee;
    color: #555;
}
.barre-resultats p { margin: 0; }
.tri-form label {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    margin: 0;
    font-size: 0.92rem;
}
.tri-form select {
    border: 1px solid #ccc;
    background: #fff;
    padding: 0.25rem 0.4rem;
}
.totaux-ligne {
    margin: 0.55rem 0 0.2rem;
    color: #777;
    font-size: 0.85rem;
}
.taches-vides { color: #666; padding: 1rem 0 1.2rem; }
.liste-taches { margin-top: 0.2rem; }
.tache {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 0.9rem 0.15rem;
    border-bottom: 1px solid #ececec;
}
.tache-titre {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem;
}
.tache-titre > a {
    color: #1a5fbf;
    font-weight: 600;
    text-decoration: none;
    font-size: 1.02rem;
}
.tache-titre > a:hover { text-decoration: underline; }
.tache-corps p { margin: 0.15rem 0 0; color: #666; font-size: 0.9rem; }
.tache-corps strong { color: #333; font-weight: 600; }
.pastille {
    display: inline-block;
    padding: 0.08rem 0.45rem;
    border-radius: 2px;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.4;
    letter-spacing: 0;
    text-transform: none;
}
.btn-ouvrir {
    flex: none;
    display: inline-block;
    background: #3c9a4a;
    color: #fff;
    text-decoration: none;
    border-radius: 3px;
    padding: 0.4rem 0.9rem;
    font-size: 0.92rem;
}
.btn-ouvrir:hover { background: #348643; color: #fff; }
.cloture-annee { margin-top: 1rem; }
.tag button { color: inherit; }
.filtre-tag {
    grid-template-columns: 1fr 8rem auto;
    align-items: end;
    max-width: 40rem;
}
.liste-tags { display: flex; flex-direction: column; gap: 0.6rem; margin-top: 0.5rem; }
.ligne-tag {
    display: flex;
    flex-wrap: wrap;
    align-items: end;
    gap: 0.6rem;
    padding: 0.7rem 0;
    border-top: 1px solid #e6e6e6;
}
.ligne-tag .field { margin: 0; min-width: 10rem; }
.form-control-color { width: 4.2rem; padding: 0.2rem; height: 2.4rem; }

.pastille-tag { display: inline-flex; align-items: center; gap: 0.25rem; }
.pastille-tag form { margin: 0; display: inline; }
.pastille-tag button {
    border: 0;
    background: transparent;
    color: inherit;
    padding: 0 0.1rem;
    cursor: pointer;
    line-height: 1;
}
.barre-outils-lignes {
    display: flex;
    flex-wrap: wrap;
    gap: 0;
    margin: 0.35rem 0 0.4rem;
    background: #f3f3f3;
    border: 1px solid #e1e1e1;
}
.barre-outils-lignes .btn-outil { border-radius: 0; border-color: transparent; background: transparent; }
.barre-outils-lignes .btn-outil + .btn-outil { border-left: 1px solid #e1e1e1; }
.tri-visible { display: flex; align-items: center; gap: 0.45rem; margin: 0; white-space: nowrap; }
.tri-visible .form-select { width: auto; min-width: 12rem; }
.bandeau-icones { display: flex; justify-content: center; align-items: center; gap: 0.85rem; }
.picto-rond {
    position: relative;
    display: grid;
    place-items: center;
    width: 2rem;
    height: 2rem;
    padding: 0;
    color: #fff;
    background: transparent;
    border: 0;
    cursor: pointer;
}
.picto-rond.is-plein { color: #f5c518; }
.compteur {
    position: absolute;
    top: -0.2rem;
    right: -0.45rem;
    min-width: 1.05rem;
    height: 1.05rem;
    padding: 0 0.2rem;
    border-radius: 99px;
    background: #fff;
    color: #1a6fb5;
    font-size: 0.68rem;
    font-weight: 700;
    line-height: 1.05rem;
    text-align: center;
}
.liste-documents, .liste-communications { list-style: none; margin: 0.6rem 0 0; padding: 0; }
.liste-documents li, .liste-communications li {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr) auto;
    gap: 0.6rem;
    align-items: center;
    padding: 0.45rem 0.2rem;
    border-bottom: 1px solid #eee;
}
.liste-communications li { grid-template-columns: 1fr; }
.liste-communications strong { display: block; }
.liste-communications span { color: #1a6fb5; font-size: 0.92rem; }
.liste-documents a { color: #1a6fb5; overflow-wrap: anywhere; }
.btn-poubelle { border: 0; background: transparent; color: #666; cursor: pointer; padding: 0.2rem; }
.alert-fermable { display: flex; justify-content: space-between; align-items: flex-start; gap: 0.8rem; }
.fermer-message { border: 0; background: transparent; color: inherit; font-size: 1.3rem; line-height: 1; cursor: pointer; padding: 0 0.15rem; }
.logo-image { width: 2.4rem; height: 2.4rem; object-fit: contain; background: #fff; border-radius: 4px; }
.logo-reglage { display: block; height: 3rem; margin-bottom: 0.4rem; }
.actions-compte { display: flex; justify-content: flex-end; gap: 0.35rem; }
.actions-compte form { margin: 0; }
.bloc-fournisseur { margin: 0.6rem 1rem 1rem; }
.onglets-doc { display: flex; background: #9d1c2c; }
.onglets-doc button {
    background: transparent;
    border: 0;
    color: #fff;
    padding: 0.55rem 0.9rem;
    cursor: pointer;
}
.onglets-doc button.is-active { background: #fff; color: #222; }
.corps-doc { border: 1px solid #e4e4e4; border-top: 0; padding: 1rem 0.8rem 0.4rem; margin-bottom: 0.8rem; }
.ligne-doc { display: grid; grid-template-columns: 8rem 1fr; align-items: center; gap: 0.6rem; }
.dialog-pied {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    margin: 0.8rem -1.1rem -1rem;
    padding: 0.75rem 1rem;
    background: #f3f3f3;
    border-top: 1px solid #e6e6e6;
}
.liste-notes { list-style: none; margin: 0 0 0.7rem; padding: 0; }
.liste-notes li { display: flex; flex-wrap: wrap; gap: 0.4rem 0.8rem; align-items: baseline; padding: 0.35rem 0; border-bottom: 1px solid #eee; }
.liste-notes p { margin: 0; flex: 1 1 12rem; }
.message-outil { margin: 0.25rem 0 0; color: #a33; }
.fiche-titre { flex-wrap: wrap; }
.col-coche { width: 2rem; }
.voile-chargement[open] {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    max-width: none;
    max-height: none;
    margin: 0;
    border: 0;
    border-radius: 0;
    padding: 0;
    background: rgba(80, 80, 80, 0.55);
    box-shadow: none;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.voile-chargement::backdrop {
    background: rgba(80, 80, 80, 0.55);
}
.roue-chargement {
    position: relative;
    width: 58px;
    height: 58px;
}
.roue-chargement span {
    position: absolute;
    left: 50%;
    top: 3px;
    width: 7px;
    height: 16px;
    margin-left: -3.5px;
    border-radius: 7px;
    background: #e6e6e6;
    transform-origin: 50% 26px;
    animation: roue-chargement 0.9s linear infinite;
}
.roue-chargement span:nth-child(1) { transform: rotate(0deg); animation-delay: -0.825s; }
.roue-chargement span:nth-child(2) { transform: rotate(30deg); animation-delay: -0.75s; }
.roue-chargement span:nth-child(3) { transform: rotate(60deg); animation-delay: -0.675s; }
.roue-chargement span:nth-child(4) { transform: rotate(90deg); animation-delay: -0.6s; }
.roue-chargement span:nth-child(5) { transform: rotate(120deg); animation-delay: -0.525s; }
.roue-chargement span:nth-child(6) { transform: rotate(150deg); animation-delay: -0.45s; }
.roue-chargement span:nth-child(7) { transform: rotate(180deg); animation-delay: -0.375s; }
.roue-chargement span:nth-child(8) { transform: rotate(210deg); animation-delay: -0.3s; }
.roue-chargement span:nth-child(9) { transform: rotate(240deg); animation-delay: -0.225s; }
.roue-chargement span:nth-child(10) { transform: rotate(270deg); animation-delay: -0.15s; }
.roue-chargement span:nth-child(11) { transform: rotate(300deg); animation-delay: -0.075s; }
.roue-chargement span:nth-child(12) { transform: rotate(330deg); animation-delay: 0s; }
@keyframes roue-chargement {
    0% { opacity: 1; }
    100% { opacity: 0.18; }
}
.releve-budgets, .pot-commun { margin-top: 1.4rem; }
.releve-budgets > h2, .pot-commun > h2 { margin-top: 0; }

@media (max-width: 800px) {
    .coque-haute { grid-template-columns: 1fr; }
    .coque-outils { grid-column: 1; justify-content: flex-start; }
    .tache, .taches-entete, .barre-resultats { flex-direction: column; align-items: flex-start; }
    .coque-outils { flex-wrap: wrap; }
    .panneau-haut { right: auto; left: 0; }
    .coque-nav { flex-wrap: nowrap; }
    .coque-liens { min-width: 0; overflow-x: auto; }
    .bandeau-commande { grid-template-columns: 1fr; }
    .bandeau-montants { text-align: left; }
    .chiffres { grid-template-columns: 1fr 1fr; }
    .reglages { grid-template-columns: 1fr; }
    .reglages-nav { flex-direction: row; overflow-x: auto; }
    .reglages-nav a { white-space: nowrap; }
}
