:root {
    --bg: #f5f6f8;
    --fg: #1d2330;
    --muted: #667085;
    --card: #ffffff;
    --line: #dfe3ea;
    --accent: #1f4e8c;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
    margin: 0;
    font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    background: var(--bg);
    color: var(--fg);
}

.topbar {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .75rem 1.5rem;
    background: var(--accent);
    color: #fff;
}
.topbar a { color: #fff; text-decoration: none; }
.brand { font-weight: 600; }
.crumbs { display: flex; gap: .5rem; opacity: .9; }

main { max-width: 1680px; margin: 0 auto; padding: 2rem 1.5rem; }

h1 { margin: 0 0 .5rem; font-size: 1.75rem; }
.lead { color: var(--muted); margin-top: 0; }
a { color: var(--accent); }

.cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1rem;
    margin: 1.5rem 0;
}
.cards.big { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }

.card {
    display: flex;
    flex-direction: column;
    gap: .25rem;
    padding: 1.25rem;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 10px;
    color: inherit;
    text-decoration: none;
    transition: border-color .15s, box-shadow .15s;
}
.card:hover { border-color: var(--accent); box-shadow: 0 2px 10px rgba(0, 0, 0, .07); }
.card-title { font-weight: 600; font-size: 1.1rem; color: var(--accent); }
.card-desc { color: var(--muted); font-size: .9rem; }
.cards.big .card { padding: 2rem; }
.cards.big .card-title { font-size: 1.3rem; }

/* --- Éléments communs --- */
h2 { margin: 2rem 0 .5rem; font-size: 1.2rem; }
code, pre { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .9em; }
.muted { color: var(--muted); }

.btn {
    display: inline-block;
    padding: .55rem 1.1rem;
    background: var(--accent);
    color: #fff;
    border: 0;
    border-radius: 8px;
    font: inherit;
    text-decoration: none;
    cursor: pointer;
}
.btn:hover { filter: brightness(1.1); }
.btn.secondary { background: #fff; color: var(--accent); border: 1px solid var(--accent); }
.btn.danger { background: #b3261e; }
.btn.secondary, .btn.danger { padding: .35rem .9rem; font-size: .9rem; }
.head-actions { display: flex; gap: .5rem; margin-top: .75rem !important; }
.actions-row { display: flex; align-items: center; gap: 1.25rem; margin-top: 1.25rem; }
.actions-row .btn.danger { padding: .55rem 1.1rem; font-size: 1rem; }

.alert { padding: .75rem 1rem; border-radius: 8px; margin: 1rem 0; }
.alert.error { background: #fdecea; border: 1px solid #f3b8b2; color: #7a1d14; }

.alert.ok { background: #e9f6ec; border: 1px solid #b4dcbc; color: #1d5a2b; }
.tag { display: inline-block; margin-left: .4rem; padding: 0 .45rem; font-size: .75rem; color: var(--accent); border: 1px solid var(--accent); border-radius: 999px; }

/* --- Formulaires --- */
.form { max-width: 560px; margin-top: 1.5rem; }
.form label { display: block; margin: 1rem 0 .3rem; font-weight: 600; }
.form label.radio { font-weight: 400; margin: .35rem 0; }
.form input[type=text], .form textarea {
    width: 100%;
    padding: .55rem .7rem;
    font: inherit;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
}
.form input[type=date] { width: 100%; padding: .5rem .7rem; font: inherit; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.form .small { font-size: .85rem; margin: .75rem 0 0; }
.form fieldset[hidden] { display: none; }
.form select { width: 100%; padding: .55rem .7rem; font: inherit; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.form select:disabled { background: #eef1f3; color: var(--muted); }
.form fieldset { border: 1px solid var(--line); border-radius: 8px; margin: 1.25rem 0 0; padding: .5rem 1rem 1rem; background: #fff; }
.form legend { font-weight: 600; padding: 0 .4rem; }
.form .actions { display: flex; align-items: center; gap: 1.25rem; margin-top: 1.5rem; }

/* --- Tableaux --- */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; background: #fff; }
.table.narrow { max-width: 560px; }
.table th, .table td { padding: .5rem .75rem; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
.table thead th { background: #7d8f9c; color: #fff; text-transform: uppercase; font-size: .85rem; letter-spacing: .02em; }
.table tbody tr:nth-child(even) { background: #eef1f3; }
.table .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.table .center { text-align: center; }
.table .note { color: var(--muted); }
.table .empty { text-align: center; color: var(--muted); padding: 1.5rem; }
.table .signs td { border: 0; padding-bottom: 0; font-weight: 600; background: transparent; }

/* --- Vue d'un compte --- */
.compte-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; flex-wrap: wrap; }
.compte-head h1 { text-transform: uppercase; }
.compte-head p { margin: .2rem 0; }
.compte-solde { text-align: right; font-size: 1.1rem; }
.compte-solde span { margin-right: .75rem; font-weight: 700; }
.compte-solde strong { font-weight: 400; font-variant-numeric: tabular-nums; }

/* --- Saisie d'écriture : mise en page et aperçu en T --- */
.ecriture-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 2rem; align-items: start; }
.ecriture-layout .form { max-width: none; }
.grid2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0 1.5rem; }
@media (max-width: 1000px) { .ecriture-layout { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 640px) { .grid2 { grid-template-columns: minmax(0, 1fr); } }
.aside-title { margin-top: 1.25rem; font-size: 1rem; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); }
.aside-title:first-child { margin-top: 1.5rem; }

.t-account { background: #fff; border: 1px solid var(--line); border-radius: 8px; margin-bottom: 1rem; overflow: hidden; }
.t-caption { padding: .3rem .75rem; font-size: .75rem; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); background: #f0f2f5; }
.t-title { padding: .5rem .75rem; text-align: center; font-weight: 600; border-bottom: 2px solid var(--fg); }
.t-body { display: grid; grid-template-columns: 1fr 1fr; }
.t-col { padding: .5rem .75rem; min-height: 3.4rem; }
.t-col + .t-col { border-left: 2px solid var(--fg); }
.t-col.active { background: #e8f0fb; }
.t-head { font-size: .75rem; text-transform: uppercase; color: var(--muted); }
.t-amount { font-weight: 600; font-variant-numeric: tabular-nums; text-align: right; }
.t-col:first-child .t-amount { text-align: left; }
.t-solde { padding: .4rem .75rem; font-size: .85rem; color: var(--muted); border-top: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.t-account.empty .t-title { border-bottom: 0; font-weight: 400; }

/* --- En-tête de page avec action à droite --- */
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; flex-wrap: wrap; }
.page-head p { margin: .2rem 0; }

/* --- Grand livre --- */
.filter-bar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin: 1rem 0; }
.filter-bar form { display: flex; align-items: center; gap: .5rem; }
.filter-bar select { padding: .4rem .6rem; font: inherit; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.table tr.deleted td { color: var(--muted); background: #f7efef; }
.table tr.deleted .txt { text-decoration: line-through; }
.tag-red { color: #b3261e; border-color: #b3261e; }
.table.resume th { width: 10rem; background: #7d8f9c; }

/* --- Recherche du grand livre --- */
.search-form { flex: 1 1 520px; flex-wrap: wrap; }
.search-form input[type=search] { flex: 1 1 280px; min-width: 0; padding: .5rem .7rem; font: inherit; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.search-form input[name=n] { flex: 0 0 9rem; width: 9rem; min-width: 0; padding: .5rem .7rem; font: inherit; border: 1px solid var(--line); border-radius: 8px; background: #fff; }

#resultats.loading { opacity: .55; transition: opacity .15s; }

/* --- Période d'affichage --- */
.periode-box { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 1rem 1.25rem; margin: 1rem 0; }
.periode-box h2 { margin: 0 0 .25rem; }
.periode-form { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; margin-top: .5rem; }
.periode-form label { display: flex; align-items: center; gap: .4rem; }
.periode-form input[type=date] { padding: .45rem .6rem; font: inherit; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.periode-form .btn.secondary { padding: .5rem .9rem; font-size: 1rem; }
.periode-ligne { margin: .2rem 0 1rem; color: var(--muted); }
.periode-ligne strong { color: var(--fg); }

/* --- Bilan et pertes et profits : comptes en T --- */
.bp-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2.5rem; margin-top: 1rem; }
.bp-t h2 { margin: 0 0 .6rem; font-size: 1.1rem; }
.bp-corps { display: grid; grid-template-columns: 1fr 1fr; background: #fff; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.bp-col { display: flex; flex-direction: column; min-width: 0; }
.bp-col + .bp-col { border-left: 2px solid var(--fg); }
.bp-titre { padding: .5rem .75rem; text-align: center; font-weight: 600; text-transform: uppercase; letter-spacing: .03em; border-bottom: 2px solid var(--fg); }
.bp-lignes { list-style: none; margin: 0; padding: .4rem 0; flex: 1; min-height: 4rem; }
.bp-lignes li { display: flex; justify-content: space-between; gap: .75rem; padding: .25rem .75rem; }
.bp-lignes li > :first-child { min-width: 0; overflow-wrap: anywhere; }
.bp-montant { white-space: nowrap; font-variant-numeric: tabular-nums; }
.bp-equilibre { font-style: italic; border-top: 1px dashed var(--line); margin-top: .35rem; padding-top: .45rem !important; }
.bp-total { display: flex; justify-content: space-between; gap: .75rem; padding: .5rem .75rem; font-weight: 600; border-top: 2px solid var(--fg); background: #f0f2f5; }
.bp-fortune { margin-top: 1rem; }

/* --- Copropriétaires --- */
.copro-box { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 1.5rem; margin: 1rem 0 1.5rem; }
@media (max-width: 900px) { .copro-box { grid-template-columns: minmax(0, 1fr); } }
.copro-col { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 1rem 1.25rem; }
.copro-col h2 { margin: 0 0 .6rem; font-size: 1.05rem; }
.inline-form { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; margin: .5rem 0 0; }
.inline-form input[type=text], .inline-form input[type=date] { padding: .4rem .6rem; font: inherit; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.inline-form .btn.secondary { padding: .4rem .9rem; }
.table.periodes { margin-bottom: .5rem; }
.table.periodes tr.selected td { background: #e8f0fb; }
.table.periodes .inline-form { margin: 0; justify-content: flex-end; }
.lien-danger { background: none; border: 0; padding: 0; font: inherit; font-size: .85rem; color: #b3261e; cursor: pointer; text-decoration: underline; }
.table.parts tfoot td { font-weight: 600; background: #f0f2f5; border-top: 1px solid var(--line); }
.table.parts tfoot tr:first-child td { border-top: 2px solid var(--fg); }
.table.parts td.ok { color: #1d5a2b; }
.table.parts td.ecart { color: #b3261e; }
.form-part { max-width: 860px; }
.form-part .ligne { display: grid; gap: .5rem; margin-bottom: .5rem; align-items: center; }
.form-part .ligne-personne { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.7fr) minmax(0, 1fr) minmax(0, 1.1fr) auto 2rem; }
.form-part .p-envoi { display: inline-flex; align-items: center; gap: .3rem; white-space: nowrap; font-size: .9rem; }
.form-part .ligne-objet { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) 2rem; }
.form-part .ligne input { width: 100%; min-width: 0; padding: .5rem .6rem; font: inherit; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.form-part .retirer { width: 2rem; height: 2.4rem; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: #b3261e; font-size: 1.2rem; line-height: 1; cursor: pointer; padding: 0; }
.form-part fieldset .btn.secondary { margin-top: .25rem; }
.form-part .total-part { margin: .75rem 0 0; }
@media (max-width: 700px) {
    .form-part .ligne-personne { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
    .form-part .ligne-personne .p-role { grid-column: 1 / -1; }
    .form-part .ligne-personne input:nth-child(3) { grid-column: 1 / -1; }
    .form-part .ligne-personne .retirer { justify-self: end; }
}

/* --- Locataires --- */
.form input[type=email] { width: 100%; padding: .55rem .7rem; font: inherit; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.form-loc .ligne-1 { grid-template-columns: minmax(0, 1fr); }
.form-loc .ligne-2, .form-loc .ligne-montants { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.form-loc .ligne-contact { grid-template-columns: minmax(0, 1fr) minmax(0, 1.7fr); }
.form-loc .ligne-montants { align-items: end; }
.form-loc .ligne-montants label { margin: 0 0 .25rem; font-size: .9rem; }
.form-loc .ligne > div { min-width: 0; }
.form-loc label.radio { display: block; margin: .5rem 0; }
.form-loc fieldset label:not(.radio) { margin-top: .75rem; }
.form-loc .ligne-montants label { margin-top: 0; }
@media (max-width: 700px) { .form-loc .ligne-2, .form-loc .ligne-contact, .form-loc .ligne-montants { grid-template-columns: minmax(0, 1fr); } }
.loc-head { margin-top: 1.5rem; align-items: flex-end; }
.loc-head h2 { margin: 0; }
.loc-head p { margin: .1rem 0; }
.table.locataires tfoot td { font-weight: 600; background: #f0f2f5; border-top: 2px solid var(--fg); }
.form-loc .champ-court { max-width: 12rem; }
.form input[type=date] { max-width: 100%; }

/* --- Décompte de charges --- */
.select-loc { margin: .5rem 0 1rem; }
.select-loc select { padding: .45rem .6rem; font: inherit; border: 1px solid var(--line); border-radius: 8px; background: #fff; min-width: 18rem; }
.table.decompte { max-width: 860px; }
.table.decompte tr.sous-total td { font-weight: 600; background: #f0f2f5; }
.table.decompte tfoot td { border-top: 1px solid var(--line); }
.table.decompte tfoot tr.total td { font-weight: 700; background: #e8f0fb; border-top: 2px solid var(--fg); }
.form-loc .ligne-aff { grid-template-columns: minmax(0, 2.2fr) minmax(0, 1fr) minmax(0, 1.6fr) 2rem; }
.form-loc .ligne-aff select { width: 100%; min-width: 0; padding: .5rem .6rem; font: inherit; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
@media (max-width: 700px) { .form-loc .ligne-aff { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } .form-loc .ligne-aff select:first-child { grid-column: 1 / -1; } }

/* Décompte détaillé (mois par mois) */
.table.decompte.detail { max-width: none; }
.table.decompte.detail thead th { text-transform: none; vertical-align: bottom; }
.table.decompte.detail tr.inoccupe td { color: var(--muted, #8a949d); background: #f7f8fa; }
.table.decompte.detail tfoot td { border-top: 2px solid var(--fg); }
.poids-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: .5rem .75rem; max-width: 760px; margin: .5rem 0; }
.poids-grid label { display: flex; flex-direction: column; font-size: .85rem; gap: .15rem; }
.poids-grid input, .form-chaleur input[name=eau] { padding: .35rem .5rem; font: inherit; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
dialog.modal { border: 1px solid var(--line); border-radius: 12px; padding: 1.25rem 1.5rem; max-width: 640px; width: calc(100% - 2rem); box-shadow: 0 10px 40px rgba(0,0,0,.25); }
dialog.modal::backdrop { background: rgba(30,40,50,.45); }
dialog.modal h3 { margin-top: 0; }
.modal-actions { display: flex; gap: .6rem; margin-bottom: 0; }
.btn.small-btn { padding: .2rem .7rem; font-size: .85rem; margin-left: .4rem; }
.bp-bascule { background: none; border: 0; padding: 0; font: inherit; color: var(--link, #1d4f91); cursor: pointer; text-align: left; }
.bp-bascule::before { content: '▸ '; }
.bp-bascule[aria-expanded=true]::before { content: '▾ '; }
.bp-lignes li.bp-sous { padding-left: 1.75rem; font-size: .9rem; color: var(--muted, #6b7785); }

/* Presets d'écritures */
.form-preset { max-width: 640px; }
.var-chips { display: flex; flex-wrap: wrap; gap: .4rem; margin: .5rem 0; }
.chip { font: inherit; font-size: .85rem; padding: .2rem .6rem; border: 1px solid var(--line); border-radius: 999px; background: #f0f2f5; cursor: pointer; }
.chip:hover { background: #e3e8ee; }
.table.presets td.note { color: var(--muted, #6b7785); }

/* Menu Comptabilité en zones */
.menu-zone { margin-top: 2rem; }
.menu-zone h2 { margin: 0 0 .75rem; font-size: 1.15rem; padding-bottom: .35rem; border-bottom: 2px solid var(--line); }
.menu-zone .card-title .tag { margin-left: .4rem; font-weight: 400; vertical-align: middle; }

/* Documents joints */
.documents { margin-top: 2rem; max-width: 900px; }
.documents h2 { font-size: 1.15rem; margin: 0 0 .5rem; }
.documents-liste td { vertical-align: middle; }
.doc-renommer { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem; }
.doc-renommer input[type=text] { flex: 1 1 14rem; min-width: 8rem; padding: .4rem .6rem; font: inherit; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.doc-prefixe { font-weight: 700; padding: .4rem .5rem; background: #eef1f3; border: 1px solid var(--line); border-radius: 8px; color: var(--muted, #6b7785); cursor: not-allowed; }
.doc-ext { color: var(--muted, #6b7785); }
.doc-renommer .btn.secondary { padding: .35rem .8rem; }
.doc-actions { white-space: nowrap; }
.doc-actions a, .doc-actions .inline-form { display: inline-block; margin-right: .75rem; }
.doc-actions .inline-form { margin: 0; }
.lien-danger { background: none; border: 0; padding: 0; font: inherit; color: #b3261e; cursor: pointer; text-decoration: underline; }
.doc-envoi { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; margin-top: 1rem; }
.clip { text-decoration: none; margin-left: .35rem; white-space: nowrap; }
.form input[type=file] { width: 100%; padding: .4rem 0; font: inherit; }

.doc-noms { margin: .4rem 0 .2rem; }
.doc-nom-ligne { display: flex; align-items: center; gap: .15rem; margin: .25rem 0; }
.doc-nom-ligne input[type=text] { flex: 1; max-width: 22rem; }

/* ---- Formulaire d'écriture : cartes et couleurs ---- */
.form-ecriture .ec-carte { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: .9rem 1.25rem 1.2rem; margin-bottom: 1.1rem; box-shadow: 0 1px 3px rgba(16,24,40,.05); }
.form-ecriture .ec-carte h2 { display: flex; align-items: center; gap: .6rem; margin: 0 0 .3rem; font-size: 1.05rem; color: var(--accent); }
.form-ecriture .ec-num { display: inline-flex; align-items: center; justify-content: center; width: 1.6rem; height: 1.6rem; border-radius: 50%; background: var(--accent); color: #fff; font-size: .85rem; font-weight: 700; }
.form-ecriture .ec-preset { background: #fff8e6; border-color: #f0dba0; }
.form-ecriture .ec-preset h2 { color: #8a5a00; }
.form-ecriture .ec-preset .ec-num { background: #e8a317; }
.form-ecriture .ec-ligne-preset { display: flex; align-items: center; gap: 1rem; margin-top: .5rem; }
.form-ecriture .ec-ligne-preset select { flex: 1; }
.form-ecriture .ec-montant { font-size: 1.25rem; font-weight: 600; text-align: right; }
.form-ecriture .ec-comptes { gap: 1rem 1.25rem; margin-top: .5rem; }
.form-ecriture .ec-cote { border-radius: 10px; padding: .8rem .9rem 1rem; border: 1px solid; }
.form-ecriture .ec-debit, .form-ecriture .ec-credit { background: #f7f8fa; border-color: var(--line); }
.form-ecriture .ec-etiquette { font-weight: 700; text-transform: uppercase; letter-spacing: .04em; font-size: .85rem; margin-bottom: .45rem; }
.form-ecriture .ec-etiquette span { font-weight: 400; text-transform: none; letter-spacing: 0; opacity: .75; }
.form-ecriture .ec-etiquette { color: var(--fg); }
.form-ecriture .ec-cote #apercu-debit, .form-ecriture .ec-cote #apercu-credit { margin-top: .8rem; }
.form-ecriture .ec-cote .t-account { margin-bottom: 0; background: #fff; }
.form-ecriture .ec-carte input:focus, .form-ecriture .ec-carte select:focus, .form-ecriture .ec-carte textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.form-ecriture-actions .actions { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: .9rem 1.25rem; }
.form-ecriture-actions .actions .btn { padding: .65rem 1.6rem; font-size: 1.05rem; }
.ecriture-layout aside { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 0 1.1rem 1rem; }
.ecriture-layout aside { min-width: 0; overflow-x: auto; }
.ecriture-layout aside .table { width: 100%; font-size: .88rem; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
/* Section documents de la page de modification : même cartes que le formulaire */
.documents.ec-carte { max-width: none; margin: 1.1rem 0; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: .9rem 1.25rem 1.2rem; box-shadow: 0 1px 3px rgba(16,24,40,.05); }
.documents.ec-carte h2 { display: flex; align-items: center; gap: .6rem; margin: 0 0 .3rem; font-size: 1.05rem; color: var(--accent); }
.documents.ec-carte .ec-num { display: inline-flex; align-items: center; justify-content: center; width: 1.6rem; height: 1.6rem; border-radius: 50%; background: var(--accent); color: #fff; font-size: .85rem; font-weight: 700; }
.doc-envoi { display: block; }
.doc-envoi .small { margin: .5rem 0 .8rem; }
.doc-noms { margin: .4rem 0 .2rem; }
.form.doc-envoi { max-width: none; margin-top: .5rem; }
.form.doc-envoi .small { margin: .75rem 0 .8rem; font-size: .85rem; }
.ec-colonne { min-width: 0; }

/* ---- Grand livre : tableau compact, montant toujours visible ---- */
.table.ledger { font-size: .92rem; table-layout: auto; }
.table.ledger th, .table.ledger td { padding: .4rem .55rem; }
.table.ledger td:nth-child(1) { width: 3.2rem; }
.table.ledger td:nth-child(2) { white-space: nowrap; }
.table.ledger td:nth-child(3) { min-width: 10rem; }
.table.ledger td.note { max-width: 12rem; font-size: .85rem; }
.table.ledger td:nth-child(5), .table.ledger td:nth-child(6) { font-size: .85rem; white-space: nowrap; }
.table.ledger td.num { font-weight: 600; }
.table.ledger a { text-decoration-thickness: 1px; text-underline-offset: 2px; }

/* ---- Liste des comptes ---- */
:root { --c-bleu: #1f4e8c; --c-orange: #b45f06; --c-rouge: #b3261e; --c-vert: #1d7a3a; }
.c-bleu { --cc: var(--c-bleu); --cf: #eef4fc; }
.c-orange { --cc: var(--c-orange); --cf: #fdf3e6; }
.c-rouge { --cc: var(--c-rouge); --cf: #fdeeec; }
.c-vert { --cc: var(--c-vert); --cf: #eaf6ee; }
.cpt-barre { display: flex; flex-wrap: wrap; gap: .8rem 1.2rem; align-items: center; margin: 1rem 0 1.2rem; }
.cpt-barre input[type=search] { flex: 1 1 18rem; max-width: 26rem; padding: .6rem .9rem; font: inherit; border: 1px solid var(--line); border-radius: 999px; background: #fff; }
.cpt-filtres { display: flex; flex-wrap: wrap; gap: .4rem; }
.cpt-chip { font: inherit; font-size: .88rem; padding: .3rem .8rem; border-radius: 999px; border: 1px solid var(--cc, var(--line)); background: #fff; color: var(--cc, var(--fg)); cursor: pointer; }
.cpt-chip span { opacity: .7; margin-left: .2rem; }
.cpt-chip.actif { background: var(--cc, var(--fg)); color: #fff; border-color: var(--cc, var(--fg)); }
.cpt-grille { display: grid; grid-template-columns: repeat(auto-fit, minmax(440px, 1fr)); gap: 1.2rem; align-items: start; }
.cpt-carte { background: var(--card); border: 1px solid var(--line); border-top: 4px solid var(--cc); border-radius: 12px; box-shadow: 0 1px 3px rgba(16,24,40,.05); overflow: hidden; }
.cpt-carte header { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; padding: .8rem 1.1rem; background: var(--cf); }
.cpt-carte h2 { margin: 0; font-size: 1.05rem; color: var(--cc); }
.cpt-total { font-size: .85rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.cpt-carte ul { list-style: none; margin: 0; padding: 0; }
.cpt-carte li { display: flex; align-items: center; gap: .5rem; padding: .5rem 1.1rem; border-top: 1px solid var(--line); }
.cpt-carte li:hover { background: var(--cf); }
.cpt-carte li a { text-decoration: none; font-weight: 500; overflow-wrap: anywhere; }
.cpt-carte li a:hover { text-decoration: underline; }
.cpt-solde { margin-left: auto; white-space: nowrap; font-variant-numeric: tabular-nums; font-weight: 600; }
.cpt-solde.neg { color: var(--c-rouge); }

/* ---- Bilan et pertes et profits ---- */
.bp-kpi { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1rem; margin: 1.2rem 0 .5rem; }
.bp-tuile { background: var(--cf); border: 1px solid var(--line); border-left: 5px solid var(--cc); border-radius: 12px; padding: .8rem 1.1rem; display: flex; flex-direction: column; gap: .1rem; }
.bp-tuile span { color: var(--muted); font-size: .88rem; }
.bp-tuile strong { font-size: 1.5rem; color: var(--cc); font-variant-numeric: tabular-nums; }
.bp-grid { gap: 2rem; }
.bp-t { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 1rem 1.2rem 1.2rem; box-shadow: 0 1px 3px rgba(16,24,40,.05); }
.bp-t h2 { display: flex; align-items: center; gap: .6rem; font-size: 1.15rem; }
.bp-pastille { width: .9rem; height: .9rem; border-radius: 50%; background: var(--cc); display: inline-block; }
.bp-corps { border: 0; border-radius: 10px; gap: 1rem; background: transparent; overflow: visible; }
.bp-col, .bp-col + .bp-col { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #fff; }
.bp-titre { background: var(--cc); color: #fff; border-bottom: 0; text-align: left; padding: .6rem .9rem; }
.bp-lignes li { padding: .35rem .9rem; border-bottom: 1px solid #f0f2f5; }
.bp-lignes li:nth-child(even) { background: #fafbfc; }
.bp-lignes li a { text-decoration: none; }
.bp-lignes li a:hover { text-decoration: underline; }
.bp-montant { font-weight: 500; }
.bp-equilibre { background: var(--cf) !important; border-top: 1px solid var(--cc); font-weight: 600; }
.bp-total { background: var(--cf); color: var(--cc); border-top: 2px solid var(--cc); padding: .65rem .9rem; font-size: 1.05rem; }
.bp-fortune { margin-top: 1.2rem; max-width: 560px; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.bp-fortune td { background: #fff; }
.bp-fortune tr:last-child td { background: #fdf3e6; border-bottom: 0; font-size: 1.02rem; }
@media (max-width: 900px) { .bp-corps { grid-template-columns: minmax(0, 1fr); } }

/* ---- Formulaire de compte ---- */
.form-compte { max-width: 760px; }
.form-compte .ec-carte, .form-ecriture .ec-carte { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: .9rem 1.25rem 1.2rem; margin-bottom: 1.1rem; box-shadow: 0 1px 3px rgba(16,24,40,.05); }
.form-compte .ec-carte h2 { display: flex; align-items: center; gap: .6rem; margin: 0 0 .5rem; font-size: 1.05rem; color: var(--accent); }
.form-compte .ec-num { display: inline-flex; align-items: center; justify-content: center; width: 1.6rem; height: 1.6rem; border-radius: 50%; background: var(--accent); color: #fff; font-size: .85rem; font-weight: 700; }
.form-compte #nom { font-size: 1.15rem; font-weight: 600; }
.cf-types { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .8rem; }
.form-compte .champ-court { max-width: 12rem; }
@media (max-width: 600px) { .cf-types { grid-template-columns: minmax(0, 1fr); } }
.form .cf-type { display: flex; align-items: flex-start; gap: .7rem; margin: 0; padding: .8rem .9rem; border: 2px solid var(--line); border-left: 6px solid var(--cc); border-radius: 10px; background: #fff; cursor: pointer; font-weight: 400; }
.cf-type input { margin-top: .3rem; accent-color: var(--cc); }
.cf-type-corps { display: flex; flex-direction: column; }
.cf-type-corps strong { color: var(--cc); }
.cf-type-corps small { color: var(--muted); }
.cf-type:hover { background: var(--cf); }
.cf-type:has(input:checked) { background: var(--cf); border-color: var(--cc); box-shadow: 0 0 0 1px var(--cc); }
.form-compte .actions { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: .9rem 1.25rem; display: flex; align-items: center; gap: 1.25rem; }
.form-compte .actions .btn { padding: .65rem 1.6rem; font-size: 1.05rem; }

/* ---- Nom de la PPE modifiable ---- */
.brand-edit { background: transparent; border: 0; color: #fff; opacity: .55; cursor: pointer; font-size: .95rem; padding: .1rem .3rem; border-radius: 6px; }
.brand-edit:hover { opacity: 1; background: rgba(255,255,255,.15); }
#dlg-nom form input[type=text] { width: 100%; padding: .55rem .7rem; font: inherit; border: 1px solid var(--line); border-radius: 8px; }
#dlg-nom h2 { margin: 0 0 .3rem; font-size: 1.15rem; }

/* ---- Acomptes reçus (locataire hors PPE), saisie dans le tableau mensuel ---- */
.table.decompte.detail input.ac-mois { width: 6.5rem; padding: .3rem .5rem; font: inherit; border: 1px solid var(--line); border-radius: 8px; text-align: right; background: #fff; }

/* ---- Aperçu des comptes : couleur du type de compte (bleu actif, orange passif, rouge charge, vert produit) ---- */
.t-account[class*="c-"] { border-color: var(--cc); border-top-width: 3px; }
.t-account[class*="c-"] .t-caption { background: var(--cf); color: var(--cc); font-weight: 600; }
.t-account[class*="c-"] .t-title { color: var(--cc); border-bottom-color: var(--cc); }
.t-account[class*="c-"] .t-col + .t-col { border-left-color: var(--cc); }
.t-account[class*="c-"] .t-col.active { background: var(--cf); }
.t-account[class*="c-"] .t-col.active .t-amount { color: var(--cc); }
.form-ecriture select.c-bleu, .form-ecriture select.c-orange, .form-ecriture select.c-rouge, .form-ecriture select.c-vert { border-left: 6px solid var(--cc); }

/* ---- Budget ---- */
.bud-barre { display: flex; flex-wrap: wrap; align-items: center; gap: .8rem 1.6rem; margin: .8rem 0 1rem; }
.bud-annees { display: flex; align-items: center; gap: .6rem; font-size: 1.3rem; }
.bud-annees a { text-decoration: none; padding: 0 .55rem; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.bud-options { display: flex; gap: 1rem; margin: 0; }
.bud-options label { font-size: .9rem; color: var(--muted); display: flex; align-items: center; gap: .4rem; }
.bud-options select { padding: .3rem .5rem; font: inherit; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.bud-valider { margin: 0 0 0 auto; display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.tag-ok { background: #e9f6ec; color: #1d5a2b; border-color: #b4dcbc; }
.bud-wrap { background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 1px 3px rgba(16,24,40,.05); }
table.bud { border-collapse: separate; border-spacing: 0; width: 100%; font-variant-numeric: tabular-nums; }
table.bud th, table.bud td { padding: .38rem .75rem; white-space: nowrap; }
table.bud .num { text-align: right; }
table.bud thead th { position: sticky; top: 0; background: #7d8f9c; color: #fff; font-size: .85rem; text-transform: none; vertical-align: bottom; z-index: 2; }
table.bud thead th small { display: block; font-weight: 400; opacity: .85; font-size: .72rem; }
table.bud thead th.h-budget { background: #5f6f7b; }
table.bud thead th.h-reel   { background: var(--accent); }
table.bud thead th.h-diff   { background: #1b3a66; }
table.bud .bud-nom { position: sticky; left: 0; background: #fff; text-align: left; z-index: 1; min-width: 15rem; }
table.bud thead th.bud-nom { background: #7d8f9c; z-index: 3; }
table.bud tr.bud-ligne td { border-bottom: 1px solid #eef1f3; }
table.bud tr.bud-ligne:hover td { background: #f6f8fb; }
table.bud tr.bud-ligne:hover td.bud-nom { background: #f6f8fb; }
table.bud tr.bud-ligne a { text-decoration: none; }
table.bud td.hist { color: var(--muted); }
table.bud td.col-budget { background: #f3f5f7; }
table.bud td.col-reel   { background: #eef4fc; }
table.bud td.col-diff   { background: #e3ebf6; font-weight: 600; }
table.bud tr.bud-rub td { font-weight: 700; text-transform: uppercase; letter-spacing: .04em; font-size: .8rem; padding-top: .9rem; background: var(--cf); color: var(--cc); border-top: 3px solid var(--cc); }
table.bud tr.bud-total td { font-weight: 700; border-top: 2px solid var(--cc); background: var(--cf); }
table.bud tr.bud-total td.bud-nom { background: var(--cf); }
table.bud tfoot td { font-weight: 700; font-size: 1.05rem; border-top: 3px solid var(--fg); padding-top: .7rem; padding-bottom: .7rem; background: #fff; }
table.bud tfoot td.bud-nom { background: #fff; }
.bud-in { width: 8.5rem; padding: .25rem .5rem; font: inherit; text-align: right; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.bud-actions { margin: 1rem 0; display: flex; gap: 1.2rem; align-items: center; }
.form-rub { max-width: 860px; }
.form-rub .ec-carte { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: .9rem 1.25rem 1.2rem; margin-bottom: 1.1rem; box-shadow: 0 1px 3px rgba(16,24,40,.05); }
.form-rub .ec-carte h2 { display: flex; align-items: center; gap: .6rem; margin: 0 0 .5rem; font-size: 1.05rem; color: var(--accent); }
.form-rub .ec-num { display: inline-flex; align-items: center; justify-content: center; width: 1.6rem; height: 1.6rem; border-radius: 50%; background: var(--accent); color: #fff; font-size: .85rem; font-weight: 700; }
.form-rub input[type=text], .form-rub select { padding: .4rem .6rem; font: inherit; border: 1px solid var(--line); border-radius: 8px; background: #fff; width: 100%; }

/* ---- Organiser les rubriques : deux zones, barre d'enregistrement toujours visible ---- */
.rub-zones { display: grid; grid-template-columns: repeat(auto-fit, minmax(420px, 1fr)); gap: 1.4rem; align-items: start; }
.rub-zone { background: var(--card); border: 1px solid var(--line); border-top: 5px solid var(--cc); border-radius: 12px; padding: 0 1.2rem 1.2rem; box-shadow: 0 1px 3px rgba(16,24,40,.05); }
.rub-zone header { display: flex; align-items: baseline; gap: .8rem; margin: 0 -1.2rem; padding: .8rem 1.2rem; background: var(--cf); border-radius: 8px 8px 0 0; }
.rub-zone header h2 { margin: 0; font-size: 1.15rem; color: var(--cc); }
.rub-zone h3 { margin: 1.1rem 0 .5rem; font-size: .85rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.rub-ligne { display: flex; align-items: center; gap: .5rem; margin-bottom: .4rem; padding: .35rem .5rem; background: #fafbfc; border: 1px solid var(--line); border-left: 4px solid var(--cc); border-radius: 8px; }
.rub-ligne input[type=text] { flex: 1; min-width: 0; padding: .35rem .6rem; font: inherit; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.rub-suppr { border: 0; background: transparent; color: var(--c-rouge); font: inherit; font-size: .85rem; cursor: pointer; }
.rub-ligne.supprimee { opacity: .5; }
.rub-ligne.supprimee input[type=text] { text-decoration: line-through; }
.lien-bouton { border: 0; background: none; padding: 0; font: inherit; color: var(--accent); text-decoration: underline; cursor: pointer; }
.rub-barre { position: sticky; bottom: 0; z-index: 20; display: flex; align-items: center; gap: 1.2rem; margin-top: 1.4rem; padding: .8rem 1.2rem; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 -4px 16px rgba(16,24,40,.10); }
.rub-barre .btn { padding: .6rem 1.8rem; }
.rub-etat { margin-right: auto; }
.rub-etat.rub-modif { color: #b45f06; font-weight: 600; }

.rub-grip { cursor: grab; touch-action: none; user-select: none; padding: .2rem .3rem; color: var(--muted); font-size: 1.1rem; letter-spacing: -.15em; }
.rub-grip:hover { color: var(--cc); }
.rub-ligne.glisse { box-shadow: 0 4px 14px rgba(16,24,40,.2); background: #fff; position: relative; z-index: 5; }
.rub-ligne.glisse .rub-grip { cursor: grabbing; }

/* ---- Rubriques : blocs contenant leurs comptes, glisser-déposer ---- */
.rub-bloc { margin-bottom: .9rem; }
.rub-bloc > .rub-ligne { margin-bottom: 0; border-radius: 8px 8px 0 0; background: var(--cf); }
.rub-cpts { min-height: 2.2rem; border: 1px solid var(--line); border-top: 0; border-radius: 0 0 8px 8px; padding: .25rem; background: #fff; }
.rub-cpts:not(:has(.rub-cpt))::before { content: "Glisse des comptes ici"; display: block; padding: .45rem .6rem; color: var(--muted); font-size: .85rem; font-style: italic; }
.rub-cpt { display: flex; align-items: center; gap: .5rem; padding: .25rem .4rem; border-radius: 6px; background: #fff; border-bottom: 1px solid #eef1f3; }
.rub-cpt:hover { background: #f6f8fa; }
.rub-cpt.glisse { box-shadow: 0 4px 14px rgba(16,24,40,.2); border-bottom-color: transparent; position: relative; z-index: 5; }
.rub-bloc.glisse { box-shadow: 0 6px 18px rgba(16,24,40,.22); position: relative; z-index: 5; }
.rub-bloc.supprimee { opacity: .55; }
.rub-bloc.supprimee input[type=text] { text-decoration: line-through; }
.rub-libres > .rub-ligne { background: #fffaf0; border-left-color: #e8c27a; }
.rub-libres .rub-cpts { background: #fffdf7; }
.rub-ajout { display: flex; align-items: center; gap: 1rem; margin: .2rem 0 1.2rem; }
.rub-cpt .rub-nomcompte { flex: 1; }

/* ---- Accès : connexion, utilisateurs, lecture seule ---- */
.topbar-zone { margin-left: auto; border: 1px solid rgba(255,255,255,.55); border-radius: 999px; padding: .15rem .85rem; font-size: .88rem; font-weight: 600; white-space: nowrap; }
.topbar-zone:hover { background: rgba(255,255,255,.18); }
.topbar-zone + .topbar-user { margin-left: 1rem; }
.topbar-user { margin-left: auto; display: flex; align-items: center; gap: .8rem; font-size: .9rem; }
.user-role { background: rgba(255,255,255,.2); border-radius: 999px; padding: .05rem .55rem; font-size: .75rem; margin-left: .3rem; }
.user-quit { background: transparent; color: #fff; border: 1px solid rgba(255,255,255,.6); border-radius: 8px; padding: .2rem .7rem; font: inherit; font-size: .85rem; cursor: pointer; }
.user-quit:hover { background: rgba(255,255,255,.15); }
.bandeau-lecture { background: #fff8e6; border-bottom: 1px solid #f0dba0; color: #7a5200; text-align: center; padding: .4rem 1rem; font-size: .9rem; }
.login-carte { max-width: 26rem; margin: 3rem auto; background: var(--card); border: 1px solid var(--line); border-top: 5px solid var(--accent); border-radius: 12px; padding: 1.5rem 1.8rem 1.8rem; box-shadow: 0 2px 8px rgba(16,24,40,.08); }
.login-form { display: flex; flex-direction: column; gap: 1rem; }
.login-form label, .acc-form label { display: flex; flex-direction: column; gap: .3rem; font-weight: 600; font-size: .9rem; }
.login-form input, .acc-form input, .acc-form select { padding: .5rem .7rem; font: inherit; font-weight: 400; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.acc-carte { background: var(--card); border: 1px solid var(--line); border-top: 5px solid var(--cc, var(--accent)); border-radius: 12px; padding: 0 1.2rem 1.1rem; box-shadow: 0 1px 3px rgba(16,24,40,.05); }
.acc-carte header { display: flex; align-items: center; justify-content: space-between; margin: 0 -1.2rem .6rem; padding: .7rem 1.2rem; background: var(--cf, #eef3fa); border-radius: 8px 8px 0 0; }
.acc-carte h2 { margin: 0; font-size: 1.1rem; color: var(--cc, var(--accent)); }
.acc-badge { background: var(--cc, var(--accent)); color: #fff; border-radius: 999px; padding: .1rem .7rem; font-size: .8rem; }
.acc-nouveau { margin-bottom: 1.4rem; padding-top: .9rem; border-top-color: var(--accent); }
.acc-nouveau h2 { margin-bottom: .6rem; color: var(--accent); }
.acc-nouveau .acc-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 1rem; }
.acc-liste { display: grid; grid-template-columns: repeat(auto-fill, minmax(21rem, 1fr)); gap: 1.2rem; align-items: start; }
.acc-ligne { display: flex; align-items: flex-end; gap: .6rem; margin-top: .7rem; }
.acc-ligne label { flex: 1; }
.acc-suppr { margin-top: .9rem; }

/* ---- Fiscalement déductible / document Déduction charges PPE ---- */
.ec-deductible { display: flex; align-items: center; gap: .6rem; margin-top: .9rem; padding: .6rem .8rem; background: #fff8e6; border: 1px solid #f0dba0; border-radius: 8px; cursor: pointer; }
.ec-deductible[hidden] { display: none; }
.ec-deductible input { width: 1.15rem; height: 1.15rem; margin: 0; }
.ded-scroll { overflow-x: auto; margin-top: 1rem; }
table.ded { width: 100%; }
table.ded tr.ded-compte td { background: #eef3f6; font-weight: 600; }
table.ded tr.ded-sous td { background: #f8f9fb; font-weight: 600; border-bottom: 2px solid var(--line); }
table.ded tfoot tr.ded-total td { background: #e8f0fb; font-weight: 700; border-top: 2px solid var(--accent); }
table.ded thead th .muted { color: rgba(255,255,255,.8); }
table.ded .ded-colpart { border-left: 2px solid var(--line); }
table.ded tbody td.ded-colpart { background: #f4f8fd; }

/* ---- Barre d'enregistrement flottante : le bouton reste visible en bas de l'écran tant que le formulaire est affiché ---- */
.barre-enreg, .form .actions, .form-ecriture-actions, .form-compte .actions {
    position: sticky; bottom: 0; z-index: 20;
    background: #fff; border: 1px solid var(--line); border-radius: 12px;
    padding: .8rem 1.2rem; box-shadow: 0 -4px 16px rgba(16,24,40,.10);
}
.barre-enreg { display: flex; align-items: center; gap: 1.2rem; flex-wrap: wrap; margin-top: 1.2rem; }
.form-ecriture-actions { padding: 0; border: 0; background: transparent; box-shadow: none; position: sticky; bottom: 0; z-index: 20; }
.form-ecriture-actions .actions { box-shadow: 0 -4px 16px rgba(16,24,40,.10); }

/* ---- Preset : formulaire en cartes ---- */
.form-preset { max-width: 900px; }
.form-preset .pr-nom { font-size: 1.15rem; font-weight: 600; }
.form-preset .champ-court { max-width: 26rem; }
.form-preset .ec-preset .var-chips { margin: .6rem 0; }
.form-preset .ec-preset .chip { background: #fff; border-color: #f0dba0; }
.form-preset .ec-preset .chip:hover { background: #ffefc2; }

/* ---- Formulaires en cartes numérotées (parts, locataires) ---- */
.form-cartes { max-width: 980px; }
.form-cartes .ec-carte { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: .9rem 1.25rem 1.2rem; margin: 0 0 1.1rem; box-shadow: 0 1px 3px rgba(16,24,40,.05); }
.form-cartes .ec-carte h2 { display: flex; align-items: center; gap: .6rem; margin: 0 0 .5rem; font-size: 1.05rem; color: var(--accent); }
.form-cartes .ec-num { display: inline-flex; align-items: center; justify-content: center; width: 1.6rem; height: 1.6rem; border-radius: 50%; background: var(--accent); color: #fff; font-size: .85rem; font-weight: 700; flex: none; }
.form-cartes .gros-champ { font-size: 1.15rem; font-weight: 600; }
.form-cartes .sous-titre { margin: 1.3rem 0 .2rem; padding-top: .9rem; border-top: 1px dashed var(--line); font-size: .95rem; color: var(--accent); }
.form-cartes .total-part { padding: .5rem .8rem; background: #f2f6fc; border-radius: 8px; display: inline-block; }
.form-cartes .ec-carte input:focus, .form-cartes .ec-carte select:focus, .form-cartes .ec-carte textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.form-cartes .cf-types { margin-top: .4rem; }
.form-cartes .cf-type small { line-height: 1.35; }

/* ---- Décompte de charges : zones en cartes colorées ---- */
.dc-toolbar { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: .8rem 1.2rem; box-shadow: 0 1px 3px rgba(16,24,40,.05); flex-wrap: wrap; }
.dc-carte { background: var(--card); border: 1px solid var(--line); border-top: 5px solid var(--cc); border-radius: 12px; padding: 0 1.25rem 1.1rem; margin: 1.2rem 0; box-shadow: 0 1px 3px rgba(16,24,40,.05); }
.dc-carte > header { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin: 0 -1.25rem .8rem; padding: .7rem 1.25rem; background: var(--cf); border-radius: 8px 8px 0 0; }
.dc-carte > header h2 { margin: 0; font-size: 1.1rem; color: var(--cc); }
.dc-carte .acc-badge { background: var(--cc); color: #fff; border-radius: 999px; padding: .1rem .8rem; font-size: .8rem; white-space: nowrap; }
.dc-faits { list-style: none; display: flex; flex-wrap: wrap; gap: .7rem 1rem; padding: 0; margin: 0 0 .5rem; }
.dc-faits li { display: flex; flex-direction: column; gap: .1rem; padding: .5rem .85rem; background: var(--cf); border-radius: 8px; min-width: 9rem; }
.dc-faits li span { font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.dc-lien { margin: .4rem 0 0; font-size: .9rem; }
.dc-carte .table-wrap { margin-top: 0; }
.dc-carte .table.decompte { max-width: none; }
.dc-synthese .table.decompte { max-width: 860px; }
.dc-detail > p.muted { margin-top: 0; }

/* ---- Menu Documents : exporter documents comptables ---- */
button.card-bouton { font: inherit; text-align: left; cursor: pointer; border-top: 4px solid var(--cc); }
.dlg-export { max-width: 680px; max-height: 90vh; overflow: auto; }
.exp-bloc { border: 1px solid var(--line); border-radius: 10px; padding: .6rem .9rem; margin: .6rem 0; }
.exp-titre { font-weight: 600; display: flex; align-items: center; gap: .5rem; cursor: pointer; }
.exp-detail { display: flex; flex-wrap: wrap; gap: .5rem 1.2rem; margin-top: .6rem; padding-left: 1.6rem; align-items: center; }
.exp-detail[hidden], .exp-liste[hidden] { display: none; }
.exp-liste { flex-basis: 100%; max-height: 260px; overflow: auto; border: 1px solid var(--line); border-radius: 8px; padding: .4rem .8rem; }
.exp-liste fieldset { border: 0; border-left: 4px solid var(--cc); background: var(--cf); border-radius: 6px; margin: .6rem 0; padding: .2rem .8rem .7rem; min-width: 0; }
.exp-liste legend { font-weight: 600; color: var(--cc); padding: 0 .4rem; }
.exp-grille { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: .3rem 1rem; }
.exp-grille label { display: flex; align-items: flex-start; gap: .5rem; min-width: 0; line-height: 1.3; cursor: pointer; }
.exp-grille input { flex: none; margin-top: .2rem; }
.exp-grille span { min-width: 0; overflow-wrap: anywhere; }
.exp-actions { display: flex; justify-content: flex-end; gap: .6rem; margin-top: 1rem; }

/* ---- Menu Comptabilité : une couleur par zone (Opérations = bleu, Configuration = orange, Documents = vert) ---- */
.menu-zone h2 { display: flex; align-items: center; gap: .6rem; color: var(--cc); border-bottom: 3px solid var(--cc); }
.menu-zone h2::before { content: ""; width: .9rem; height: .9rem; border-radius: 4px; background: var(--cc); }
.menu-zone .card { background: var(--cf); border: 1px solid transparent; border-top: 5px solid var(--cc); border-radius: 12px; box-shadow: 0 1px 3px rgba(16,24,40,.06); transition: transform .12s, box-shadow .12s; }
.menu-zone .card:hover { border-color: var(--cc); border-top-color: var(--cc); transform: translateY(-2px); box-shadow: 0 6px 16px rgba(16,24,40,.12); }
.menu-zone .card-title { color: var(--cc); }
.menu-zone .card-title .tag { color: var(--cc); border-color: var(--cc); background: #fff; }
.menu-zone .card-desc { color: #4a5563; }
.menu-zone button.card-export { background: var(--cc); border-color: var(--cc); }
.menu-zone button.card-export .card-title, .menu-zone button.card-export .card-desc { color: #fff; }

/* ---- Documents à viser ---- */
.dv-carte > header { gap: .6rem; }
.dv-carte > header h2 { display: flex; align-items: center; gap: .6rem; margin-right: auto; }
.dv-depot { display: grid; gap: .8rem; max-width: 720px; }
.dv-depot label { display: grid; gap: .25rem; font-weight: 600; }
.dv-depot label .muted { font-weight: 400; }
.dv-nom-ligne { display: flex; align-items: center; gap: .2rem; }
.dv-nom-ligne input { flex: 1; max-width: 26rem; }
.dv-liste { list-style: none; margin: 0; padding: 0; display: grid; gap: .6rem; }
.dv-doc { display: flex; justify-content: space-between; gap: 1rem; align-items: flex-start; flex-wrap: wrap; padding: .7rem .9rem; border: 1px solid var(--line); border-left: 5px solid var(--cc); border-radius: 10px; background: #fff; }
.dv-doc.dv-refuse { border-left-color: var(--c-rouge); background: #fdf6f5; }
.dv-corps { flex: 1 1 22rem; min-width: 0; }
.dv-nom { font-weight: 600; overflow-wrap: anywhere; }
.dv-desc { margin-top: .3rem; }
.dv-motif { margin-top: .4rem; padding: .35rem .6rem; border-radius: 8px; background: #fdeeec; color: #7a1a14; font-size: .9rem; }
.dv-badge { display: inline-block; margin-left: .4rem; padding: 0 .55rem; border-radius: 999px; font-size: .75rem; font-weight: 600; }
.dv-badge-refuse { background: var(--c-rouge); color: #fff; }
.dv-actions { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.dv-actions form { margin: 0; }
.dv-btn-viser { background: var(--c-vert); border-color: var(--c-vert); }
.dv-btn-suppr { color: var(--c-rouge); border-color: var(--c-rouge); }
#dv-dlg-refus textarea { width: 100%; }

/* Ajouter une écriture : document visé à joindre */
.vs-bloc { margin-top: .9rem; padding: .7rem .9rem; border-radius: 10px; background: #eaf6ee; border-left: 5px solid var(--c-vert); }
.vs-bloc h3 { margin: 0 0 .4rem; font-size: 1rem; color: var(--c-vert); }
.vs-bloc label { display: flex; align-items: flex-start; gap: .5rem; margin: .25rem 0; overflow-wrap: anywhere; }
.vs-bloc input { margin-top: .25rem; flex: none; }
.vs-bloc .doc-prefixe { padding: 0 .2rem; border: 0; background: none; cursor: auto; }

.doc-retire { border: 0; background: transparent; color: var(--c-rouge); font-size: 1rem; cursor: pointer; padding: .2rem .5rem; }
.vs-bloc summary { cursor: pointer; font-weight: 600; color: var(--c-vert); list-style-position: inside; }
.vs-bloc summary .muted { font-weight: 400; }
.vs-bloc[open] summary { margin-bottom: .5rem; }
.vs-bloc > label { max-height: none; }
.vs-apercu { border: 0; background: none; padding: 0; font: inherit; color: var(--accent); text-align: left; cursor: pointer; text-decoration: underline; overflow-wrap: anywhere; }
.vs-apercu:hover { color: var(--c-vert); }
dialog.vs-dlg { width: min(960px, 94vw); max-width: none; height: 88vh; max-height: 88vh; padding: 0; overflow: hidden; border: 0; border-radius: 12px; }
dialog.vs-dlg[open] { display: flex; flex-direction: column; }
.vs-dlg-tete { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .6rem 1rem; background: #eaf6ee; border-bottom: 1px solid var(--line); }
.vs-dlg-tete span { display: flex; align-items: center; gap: .8rem; }
.vs-dlg-tete strong { overflow-wrap: anywhere; }
#apercu-corps { flex: 1; min-height: 0; padding: 0; display: flex; }
#apercu-corps iframe { flex: 1; border: 0; width: 100%; height: 100%; }
#apercu-corps p { padding: 1rem; }

/* Demande de visa par e-mail */
.dv-contacts { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: .7rem; margin: .5rem 0 1rem; }
.dv-contacts fieldset { border: 1px solid var(--line); border-left: 5px solid var(--cc); border-radius: 8px; background: var(--cf); margin: 0; padding: .3rem .8rem .6rem; min-width: 0; }
.dv-contacts legend { font-weight: 600; color: var(--cc); padding: 0 .3rem; }
.dv-contacts label { display: flex; align-items: flex-start; gap: .5rem; margin: .25rem 0; overflow-wrap: anywhere; }
.dv-contacts input { margin-top: .25rem; flex: none; }
.dv-message { display: grid; gap: .25rem; font-weight: 600; max-width: 720px; }
.dv-message textarea { width: 100%; }
.dv-demande-actions { display: flex; gap: .6rem; margin-top: .8rem; flex-wrap: wrap; }

/* Accès : réglages d'envoi des e-mails */
.smtp-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: .8rem 1.2rem; max-width: 900px; }
.smtp-form label .muted { font-weight: 400; }
.smtp-form .smtp-effacer { flex-direction: row; align-items: center; font-weight: 400; }
.smtp-form .smtp-actions { grid-column: 1 / -1; display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; }
.smtp-test { display: flex; gap: .6rem; align-items: flex-end; flex-wrap: wrap; margin-top: 1rem; padding-top: .8rem; border-top: 1px dashed var(--line); }
.smtp-test label { min-width: 260px; }

/* Accès : zone SMTP repliable */
details.acc-smtp > summary { display: flex; align-items: center; justify-content: space-between; margin: 0 -1.2rem; padding: .7rem 1.2rem; background: var(--cf); border-radius: 8px 8px 0 0; cursor: pointer; list-style: none; }
details.acc-smtp > summary::-webkit-details-marker { display: none; }
details.acc-smtp > summary h2 { margin: 0; font-size: 1.1rem; color: var(--cc); display: flex; align-items: center; gap: .5rem; }
details.acc-smtp > summary h2::before { content: "▸"; display: inline-block; transition: transform .15s; }
details.acc-smtp[open] > summary h2::before { transform: rotate(90deg); }
details.acc-smtp:not([open]) { padding-bottom: 0; }
details.acc-smtp:not([open]) > summary { border-radius: 8px; }
details.acc-smtp[open] > summary { margin-bottom: .6rem; }
details.acc-smtp { margin-top: 1.2rem; }

/* Mot de passe oublié / mon mot de passe */
.login-oubli { margin: .9rem 0 0; font-size: .9rem; text-align: center; }
.user-mdp { color: inherit; text-decoration: underline dotted; }
.bandeau-mdp { background: #fff4e0; color: #7a4b00; border-bottom: 1px solid #f0d49a; padding: .45rem 1.2rem; font-size: .9rem; text-align: center; }
.bandeau-mdp a { color: inherit; font-weight: 600; }
.mdp-carte { max-width: 520px; }
.mdp-form { display: grid; gap: .8rem; padding-top: .3rem; }
.acc-ligne { flex-wrap: wrap; }
.acc-ligne label { min-width: 0; flex: 1 1 11rem; }
.acc-ligne input, .acc-ligne select { min-width: 0; width: 100%; box-sizing: border-box; }

/* Accueil : une couleur par carte */
.cards.big .card[class*="c-"] { background: var(--cf); border-top: 5px solid var(--cc); border-radius: 12px; }
.cards.big .card[class*="c-"] .card-title { color: var(--cc); }
.cards.big .card[class*="c-"]:hover { border-color: var(--cc); }
.mdp-carte { margin-bottom: 1.2rem; } .mdp-carte > p { margin: 0 0 .6rem; }

/* ---------------------------------------------------------------
   Administration : annuaire, grenier, devis, procès-verbaux
   --------------------------------------------------------------- */
.adm-doc[hidden], .adm-contact[hidden], .adm-vide[hidden], .adm-vide-ecr[hidden] { display: none !important; }
.adm-nb { display: inline-block; margin-left: .4rem; padding: 0 .6rem; border-radius: 999px; background: var(--cc); color: #fff; font-size: .8rem; font-weight: 600; vertical-align: middle; }
.adm-recherche { display: flex; gap: .6rem; flex-wrap: wrap; margin: 1rem 0 1.4rem; }
.adm-recherche input[type=search] { flex: 1 1 300px; min-width: 0; padding: .6rem .85rem; font: inherit; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.adm-resultats { margin-top: 0; }
.adm-res-titre { margin: 1rem 0 .4rem; font-size: 1rem; }
.adm-res { list-style: none; margin: 0 0 .5rem; padding: 0; display: grid; gap: .45rem; }
.adm-res > li { padding: .5rem .8rem; border: 1px solid var(--line); border-left: 5px solid var(--cc, var(--accent)); border-radius: 8px; background: #fff; overflow-wrap: anywhere; }

.adm-badge { display: inline-block; margin-left: .35rem; padding: 0 .6rem; border-radius: 999px; font-size: .75rem; font-weight: 600; background: var(--cc, var(--accent)); color: #fff; white-space: nowrap; vertical-align: middle; }

/* Dépôt (zone repliable) */
details.adm-depot > summary { display: flex; align-items: center; margin: 0 -1.25rem; padding: .7rem 1.25rem; background: var(--cf); border-radius: 8px 8px 0 0; cursor: pointer; list-style: none; }
details.adm-depot > summary::-webkit-details-marker { display: none; }
details.adm-depot > summary h2 { margin: 0; font-size: 1.1rem; color: var(--cc); display: flex; align-items: center; gap: .5rem; }
details.adm-depot > summary h2::before { content: "▸"; display: inline-block; transition: transform .15s; }
details.adm-depot[open] > summary h2::before { transform: rotate(90deg); }
details.adm-depot:not([open]) { padding-bottom: 0; }
details.adm-depot:not([open]) > summary { border-radius: 8px; }
details.adm-depot[open] > summary { margin-bottom: .8rem; }

.adm-form { display: grid; gap: .8rem; max-width: 720px; }
.adm-form label { display: grid; gap: .25rem; font-weight: 600; font-size: .9rem; min-width: 0; }
.adm-form label .muted { font-weight: 400; }
.adm-form input[type=text], .adm-form input[type=email], .adm-form input[type=date], .adm-form input[type=file], .adm-form select, .adm-form textarea {
    width: 100%; box-sizing: border-box; padding: .5rem .7rem; font: inherit; font-weight: 400; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.adm-ligne { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: .8rem; }
dialog.modal .adm-form { max-width: none; }
.adm-sugg { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem; margin-top: -.4rem; }
.adm-mot-sugg { padding: .05rem .6rem; border: 1px solid var(--line); border-radius: 999px; background: #f4f6f9; font: inherit; font-size: .8rem; cursor: pointer; }
.adm-mot-sugg:hover { border-color: var(--accent); }

/* Filtres */
.adm-filtres { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; margin-bottom: .6rem; }
.adm-filtres input[type=search] { flex: 1 1 300px; min-width: 0; padding: .55rem .8rem; font: inherit; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.adm-filtres select { padding: .5rem .7rem; font: inherit; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.adm-chips { display: flex; flex-wrap: wrap; gap: .35rem; margin-bottom: .6rem; }
.adm-chip { padding: .1rem .7rem; border: 1px solid var(--cc, var(--line)); border-radius: 999px; background: #fff; color: var(--cc, var(--fg)); font: inherit; font-size: .82rem; cursor: pointer; }
.adm-chip small { opacity: .7; }
.adm-chip.actif { background: var(--cc, var(--accent)); color: #fff; }
.adm-chip.adm-mot { --cc: #5b6b82; }
.adm-mots { display: flex; flex-wrap: wrap; gap: .3rem; margin-top: .4rem; }
.adm-mots .adm-chip { font-size: .75rem; padding: 0 .55rem; }
.adm-aucun { margin: .6rem 0; }

/* Contacts */
.adm-contacts { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: .9rem; }
.adm-contact { display: flex; flex-direction: column; gap: .25rem; padding: .8rem 1rem; border: 1px solid var(--line); border-top: 5px solid var(--cc); border-radius: 12px; background: #fff; min-width: 0; overflow-wrap: anywhere; }
.adm-contact > header { display: flex; justify-content: space-between; align-items: flex-start; gap: .5rem; }
.adm-contact h3 { margin: 0; font-size: 1.05rem; color: var(--cc); }
.adm-contact > header .adm-badge { margin-left: 0; flex: none; }
.adm-infos { display: grid; grid-template-columns: auto 1fr; gap: .1rem .7rem; margin: .4rem 0 0; font-size: .92rem; }
.adm-infos dt { color: var(--muted); }
.adm-infos dd { margin: 0; }
.adm-note { margin-top: .4rem; padding: .35rem .6rem; border-radius: 8px; background: var(--cf); font-size: .9rem; }
.adm-contact footer { display: flex; gap: .5rem; margin-top: auto; padding-top: .6rem; }
.adm-contact footer form { margin: 0; }
.adm-copro { background: #fcfcfd; }

/* Listes de documents : le filet de gauche prend la couleur de l'état ou du type */
.adm-doc { border-left-color: var(--cc); }
.adm-doc .dv-nom .adm-badge { margin-left: .5rem; }

/* Dépôts de plusieurs fichiers */
.adm-fichiers { display: grid; gap: .3rem; }
.adm-lib { font-weight: 600; font-size: .9rem; }
.adm-lib .muted { font-weight: 400; }
.adm-choisis { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .35rem; }
.adm-choisis li { display: inline-flex; align-items: center; gap: .3rem; padding: .1rem .3rem .1rem .7rem; border: 1px solid var(--line); border-radius: 999px; background: #f4f6f9; font-size: .85rem; overflow-wrap: anywhere; }
.adm-x { border: 0; background: transparent; color: var(--c-rouge); font-size: 1.1rem; line-height: 1; cursor: pointer; padding: 0 .3rem; }
.adm-titre-depot { font-size: 1.05rem; }
.adm-pieces { list-style: none; margin: .35rem 0 0; padding: 0; display: grid; gap: .15rem; }
.adm-pieces li { overflow-wrap: anywhere; }
.adm-pieces-edit { list-style: none; margin: 0; padding: 0; display: grid; gap: .4rem; }
.adm-piece-edit { display: flex; align-items: center; gap: .3rem; flex-wrap: wrap; }
.adm-piece-edit input[type=text] { flex: 1 1 14rem; max-width: 26rem; }
.adm-retirer { display: inline-flex !important; align-items: center; gap: .3rem !important; margin-left: .6rem; font-weight: 400 !important; color: var(--c-rouge); }
.adm-retirer input { width: auto !important; }

/* Zone repliable des pièces jointes aux écritures : dix documents visibles, le reste défile */
details.adm-pliable > summary { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin: 0 -1.25rem; padding: .7rem 1.25rem; background: var(--cf); border-radius: 8px 8px 0 0; cursor: pointer; list-style: none; }
details.adm-pliable > summary::-webkit-details-marker { display: none; }
details.adm-pliable > summary h2 { margin: 0; font-size: 1.1rem; color: var(--cc); display: flex; align-items: center; gap: .5rem; }
details.adm-pliable > summary h2::before { content: "▸"; display: inline-block; transition: transform .15s; }
details.adm-pliable[open] > summary h2::before { transform: rotate(90deg); }
details.adm-pliable > summary .acc-badge { background: var(--cc); color: #fff; border-radius: 999px; padding: .1rem .8rem; font-size: .8rem; white-space: nowrap; }
details.adm-pliable:not([open]) { padding-bottom: 0; }
details.adm-pliable:not([open]) > summary { border-radius: 8px; }
details.adm-pliable[open] > summary { margin-bottom: .8rem; }
.adm-defile { max-height: 69rem; overflow-y: auto; padding: .1rem .4rem .1rem 0; scrollbar-gutter: stable; }

/* ---------------------------------------------------------------
   Services (buanderie…) : relevés, tableau croisé, décomptes
   --------------------------------------------------------------- */
.srv-resume { display: flex; flex-wrap: wrap; gap: .8rem; margin: .4rem 0 1rem; align-items: stretch; }
.srv-resume > div { display: flex; flex-direction: column; gap: .15rem; padding: .6rem 1.1rem; min-width: 11rem; background: #fff; border: 1px solid var(--line); border-top: 4px solid var(--c-orange); border-radius: 10px; }
.srv-resume strong { font-size: 1.25rem; }
.srv-resume .srv-resume-actions { justify-content: center; background: transparent; border: 0; padding: 0; }
.srv-defile { overflow-x: auto; }
.srv-table { min-width: 100%; }
.srv-table thead th { white-space: nowrap; }
.srv-table thead th small { display: block; font-weight: 400; opacity: .85; }
.srv-table tbody th.srv-nom { font-weight: 600; text-align: left; white-space: nowrap; }
.srv-table tbody td, .srv-table tbody th { vertical-align: middle; }
.srv-table input[type=number] { width: 4.8rem; padding: .35rem .5rem; font: inherit; text-align: right; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.srv-table input[type=number]:focus { outline: 2px solid var(--c-orange); border-color: var(--c-orange); }
.srv-table input[readonly] { background: #f4f6f9; }
.srv-table .srv-total { font-weight: 700; font-variant-numeric: tabular-nums; }
.srv-table tfoot th, .srv-table tfoot td { font-weight: 700; background: #fdf3e6; border-top: 2px solid var(--c-orange); }
.srv-paye { background: #eaf6ee; }
.srv-actions { display: flex; align-items: center; gap: .45rem; flex-wrap: wrap; }
.srv-table td.srv-actions { display: table-cell; white-space: nowrap; }
.srv-table td.srv-actions > * { margin-right: .4rem; }
.srv-btn-paye { background: var(--c-vert); border-color: var(--c-vert); font-weight: 700; letter-spacing: .03em; }
.srv-lien { border: 0; background: transparent; color: var(--accent); text-decoration: underline; font: inherit; font-size: .85rem; cursor: pointer; padding: 0; }
.srv-boutons { display: flex; flex-wrap: wrap; align-items: center; gap: .7rem; margin-top: 1rem; }
.srv-btn-publier { background: var(--c-vert); border-color: var(--c-vert); }
.srv-gestion { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; margin: 1rem 0; }
.srv-gestion form { margin: 0; }
.srv-nouveau, .srv-ajout { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; margin: .2rem 0 1rem; }
.srv-nouveau input[type=text] { flex: 1 1 18rem; max-width: 28rem; }
.srv-ajout input[type=text] { flex: 1 1 14rem; max-width: 22rem; }
.srv-ajout input.srv-prix { flex: 0 0 8rem; }
.srv-nouveau input, .srv-ajout input { padding: .5rem .7rem; font: inherit; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.srv-services { max-width: 760px; margin-bottom: 1rem; }
.srv-services td.srv-actions { display: table-cell; text-align: right; white-space: nowrap; }
.srv-services td.srv-actions form { display: inline-block; margin: 0 .2rem 0 0; }
.srv-inactif td { color: var(--muted); }
label.srv-case { display: flex !important; align-items: center; gap: .5rem; font-weight: 400 !important; }
label.srv-case input { width: auto !important; }

.srv-groupe { border: 0; margin: 0 0 1.2rem; padding: 0; min-width: 0; }
.srv-groupe legend { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; width: 100%; padding: 0 0 .5rem; margin-bottom: .6rem; border-bottom: 2px solid var(--cc, var(--line)); }
.srv-groupe-titre { font-weight: 700; color: var(--cc, inherit); }
.srv-groupe-outils { margin-left: auto; font-size: .85rem; color: var(--muted); }
.srv-tuiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: .5rem; }
.srv-tuile { position: relative; display: flex; align-items: center; gap: .6rem; padding: .55rem .8rem; background: #fff; border: 1px solid var(--line); border-left: 4px solid var(--cc, var(--line)); border-radius: 10px; cursor: pointer; transition: background .15s, box-shadow .15s, opacity .15s; overflow-wrap: anywhere; }
.srv-tuile:hover { box-shadow: 0 2px 8px rgba(0,0,0,.08); }
.srv-tuile input { flex: none; width: 1.1rem; height: 1.1rem; margin: 0; accent-color: var(--cc, var(--accent)); }
.srv-tuile:has(input:checked) { background: var(--cf, #f4f6f9); }
.srv-tuile:has(input:not(:checked)) { opacity: .55; }
.srv-tuile:has(input:not(:checked)) .srv-tuile-nom { text-decoration: line-through; }
.srv-tuile:has(input:disabled) { cursor: default; }
.srv-hab-actions { margin-top: .4rem; }

/* Coordonnées bancaires */
.cb-item .dv-corps { min-width: 0; }
.cb-iban { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 1.05rem; letter-spacing: .03em; margin: .15rem 0; }
.cb-apercu { margin-top: .5rem; }
.cb-apercu summary { cursor: pointer; color: var(--accent); font-size: .9rem; }
.cb-apercu iframe { display: block; width: 100%; max-width: 780px; aspect-ratio: 210 / 111; border: 1px solid var(--line); border-radius: 8px; background: #fff; margin-top: .5rem; }
.cb-ligne { display: flex; gap: .7rem; flex-wrap: wrap; }
.cb-ligne label { display: flex; flex-direction: column; gap: .2rem; }
.cb-ligne .cb-large { flex: 1 1 12rem; }
.cb-ligne .cb-petit { flex: 0 0 6rem; }

.srv-bulletin-choix { margin: .2rem 0 1rem; }
.srv-bulletin-choix form { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; }
.srv-bulletin-choix label { font-weight: 600; font-size: .9rem; }
.srv-bulletin-choix select { padding: .45rem .7rem; font: inherit; border: 1px solid var(--line); border-radius: 8px; background: #fff; max-width: 100%; }

/* Fiche part : compte bancaire */
.part-compte { margin-top: 1.4rem; padding-top: .4rem; border-top: 1px dashed var(--line); }
.part-compte .sous-titre { margin: .6rem 0 .2rem; }
.pc-ligne { display: flex; flex-wrap: wrap; gap: .7rem; margin: .6rem 0; }
.pc-ligne label { display: flex; flex-direction: column; gap: .2rem; margin: 0; }
.pc-ligne label span { font-size: .8rem; font-weight: 600; color: var(--muted); }
.pc-ligne .pc-large { flex: 1 1 12rem; }
.pc-ligne .pc-petit { flex: 0 0 6rem; }
.pc-ligne input { width: 100%; box-sizing: border-box; }
#reprendre-adresse { margin-top: .2rem; }
.pc-ligne input { font-weight: 400; }

/* ---- PPE / Copropriété : carte d'identité ---- */
a.brand-edit { text-decoration: none; display: inline-block; }
.ppe-hero { display: grid; grid-template-columns: minmax(260px, 5fr) 6fr; gap: 0; margin: 1.2rem 0; background: var(--card); border: 1px solid var(--line); border-top: 5px solid var(--cc); border-radius: 12px; overflow: hidden; box-shadow: 0 1px 3px rgba(16,24,40,.06); }
.ppe-hero-photo { background: var(--cf); min-height: 240px; display: flex; }
.ppe-hero-photo a { display: block; width: 100%; }
.ppe-hero-photo img { width: 100%; height: 100%; min-height: 240px; max-height: 380px; object-fit: cover; display: block; }
.ppe-hero-vide { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .3rem; font-size: 4rem; color: var(--cc); }
.ppe-hero-vide span { font-size: .9rem; color: var(--muted); }
.ppe-hero-texte { padding: 1.4rem 1.6rem; display: flex; flex-direction: column; gap: .5rem; justify-content: center; }
.ppe-hero-texte h2 { margin: 0; font-size: 1.7rem; color: var(--cc); line-height: 1.2; }
.ppe-adresse { margin: 0; font-size: 1.05rem; }
.ppe-fiche { display: flex; flex-wrap: wrap; gap: .6rem 1.8rem; margin: .4rem 0; }
.ppe-fiche > div { display: flex; flex-direction: column; }
.ppe-fiche dt { font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.ppe-fiche dd { margin: 0; font-weight: 600; font-size: 1.05rem; }
.ppe-remarque { margin: 0; color: var(--muted); white-space: pre-line; }
.ppe-cat > .muted.small { margin: 0 0 .8rem; }
.ppe-galerie { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 1rem; margin-bottom: 1rem; }
.ppe-photo { margin: 0; background: #fff; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; position: relative; display: flex; flex-direction: column; }
.ppe-photo.est-principale { border-color: var(--cc); box-shadow: 0 0 0 2px var(--cc); }
.ppe-photo a { display: block; position: relative; }
.ppe-photo img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; transition: transform .15s; }
.ppe-photo a:hover img { transform: scale(1.03); }
.ppe-photo a { overflow: hidden; }
.ppe-photo figcaption { padding: .45rem .7rem; font-size: .88rem; overflow-wrap: anywhere; }
.ppe-etoile { position: absolute; top: .4rem; left: .4rem; background: var(--cc); color: #fff; border-radius: 999px; padding: 0 .5rem; font-size: .95rem; box-shadow: 0 1px 4px rgba(0,0,0,.3); }
.ppe-actions { display: flex; gap: .3rem; padding: 0 .5rem .5rem; margin-top: auto; }
.ppe-actions form { margin: 0; }
.ppe-mini { font: inherit; cursor: pointer; border: 1px solid var(--line); background: #fff; border-radius: 8px; padding: .15rem .55rem; }
.ppe-mini:hover { border-color: var(--cc); background: var(--cf); }
.ppe-docs { list-style: none; margin: 0 0 1rem; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: .8rem; }
.ppe-doc { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: .8rem; display: flex; flex-direction: column; gap: .6rem; }
.ppe-doc:hover { border-color: var(--cc); }
.ppe-doc-lien { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: .8rem; align-items: center; text-decoration: none; color: inherit; }
.ppe-ext, .ppe-doc-mini { grid-row: 1 / span 2; width: 3.4rem; height: 3.4rem; border-radius: 10px; }
.ppe-ext { display: flex; align-items: center; justify-content: center; background: var(--cf); color: var(--cc); font-weight: 700; font-size: .8rem; letter-spacing: .03em; border: 1px solid var(--cc); }
.ppe-doc-mini { object-fit: cover; border: 1px solid var(--line); }
.ppe-doc-titre { font-weight: 600; overflow-wrap: anywhere; align-self: end; }
.ppe-doc-lien .muted { align-self: start; }
.ppe-doc-actions { display: flex; gap: .4rem; flex-wrap: wrap; }
.ppe-doc-actions form { margin: 0; }
.ppe-doc-actions .btn { padding: .25rem .7rem; font-size: .88rem; }
.ppe-envoi { display: flex; flex-wrap: wrap; gap: .6rem .8rem; align-items: center; border-top: 1px dashed var(--line); padding-top: .9rem; }
@media (max-width: 720px) { .ppe-hero { grid-template-columns: 1fr; } .ppe-hero-photo img { max-height: 260px; } }

/* ---- PPE : dossiers ---- */
.ppe-barre { margin: 0 0 .8rem; }
.ppe-dossier { border: 1px solid var(--line); border-left: 4px solid var(--cc); border-radius: 10px; background: #fff; margin: .6rem 0; }
.ppe-dossier > summary { cursor: pointer; padding: .6rem .9rem; font-weight: 600; list-style: none; display: flex; align-items: center; gap: .6rem; }
.ppe-dossier > summary::-webkit-details-marker { display: none; }
.ppe-dossier > summary::after { content: '▸'; margin-left: auto; color: var(--muted); transition: transform .15s; }
.ppe-dossier[open] > summary::after { transform: rotate(90deg); }
.ppe-dossier[open] > summary { border-bottom: 1px solid var(--line); background: var(--cf); border-radius: 8px 8px 0 0; }
.ppe-dossier-corps { padding: .9rem; }
.ppe-dossier-outils { display: flex; gap: .5rem; flex-wrap: wrap; margin: 0 0 .8rem; }
.ppe-dossier-outils form { margin: 0; }
.ppe-dossier-outils .btn { padding: .25rem .7rem; font-size: .88rem; }

/* ---- PPE : glisser-déposer ---- */
.ppe-doc[draggable=true], .ppe-photo[draggable=true] { cursor: grab; }
.ppe-glisse { opacity: .45; }
.ppe-cible { outline: 3px dashed var(--cc); outline-offset: -3px; background: var(--cf); }
details.ppe-dossier.ppe-cible > summary { background: var(--cf); }
body.ppe-envoi-en-cours::after { content: 'Envoi en cours…'; position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(255,255,255,.75); font-size: 1.4rem; font-weight: 600; color: var(--accent); z-index: 50; }

/* Aperçu des images : ajustées à la fenêtre (clic : taille réelle) */
#apercu-corps { background: #f0f2f5; }
#apercu-corps .apercu-img { margin: auto; max-width: 100%; max-height: 100%; object-fit: contain; cursor: zoom-in; display: block; }
#apercu-corps.apercu-reel { overflow: auto; }
#apercu-corps.apercu-reel .apercu-img { max-width: none; max-height: none; cursor: zoom-out; }

/* Archives comptables : dossiers à l'intérieur d'un dépôt */
.adm-choisir-dossier { justify-self: start; padding: .25rem .7rem; font-size: .88rem; }
.adm-barre { display: flex; flex-wrap: wrap; gap: .5rem; margin: .5rem 0 .2rem; }
.adm-barre .btn { padding: .25rem .7rem; font-size: .88rem; }
.adm-doc .ppe-dossier { margin: .6rem 0 .2rem; }
.adm-doc .ppe-dossier .adm-pieces { margin-top: 0; }
.adm-pieces li[draggable=true] { cursor: grab; }
.adm-piece-dossier { max-width: 14rem; }

/* Dépôts repliables */
details.adm-dep > summary { cursor: pointer; list-style: none; display: block; padding-right: 1.4rem; position: relative; }
details.adm-dep > summary::-webkit-details-marker { display: none; }
details.adm-dep > summary::after { content: '▸'; position: absolute; right: 0; top: .1rem; color: var(--muted); transition: transform .15s; }
details.adm-dep[open] > summary::after { transform: rotate(90deg); }
details.adm-dep[open] > summary { margin-bottom: .4rem; }
.adm-tout { margin: .2rem 0 .6rem; }
.adm-lien { background: none; border: 0; padding: 0; color: var(--accent); cursor: pointer; text-decoration: underline; font: inherit; }

/* Procès-verbaux : liste des PV en cours et éditeur de texte */
.pv-redige > header { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.pv-redige > header form { margin: 0; }
.pv-encours { list-style: none; margin: .6rem 0 0; padding: 0; display: grid; gap: .5rem; }
.pv-encours li { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .6rem; padding: .6rem .8rem; border: 1px solid var(--line); border-left: 5px solid var(--cc); border-radius: 8px; background: #fff; }
.pv-encours .dv-actions { display: flex; gap: .4rem; align-items: center; }
.pv-encours .dv-actions form { margin: 0; }

.pv-outils { position: sticky; top: 0; z-index: 20; display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .9rem; padding: .5rem .7rem; margin: 0 0 .9rem; background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 2px 8px rgba(20,40,70,.08); }
.pv-groupe { display: flex; align-items: center; gap: .3rem; }
.pv-groupe + .pv-groupe:not(.pv-droite) { padding-left: .9rem; border-left: 1px solid var(--line); }
.pv-droite { margin-left: auto; gap: .6rem; }
.pv-outils button { font: inherit; min-width: 2.2rem; padding: .3rem .6rem; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--ink, #1f2a37); cursor: pointer; }
.pv-outils button:hover { background: var(--cf); border-color: var(--cc); }
.pv-outils .pv-btn { font-weight: 600; }
.pv-outils .pv-principal { background: var(--accent); color: #fff; border-color: var(--accent); }
.pv-outils .pv-principal:hover { filter: brightness(1.1); background: var(--accent); }
.pv-ok { color: #1c7a3b; }
.pv-erreur { color: #b3261e; font-weight: 600; }

.pv-entete > summary h2 { margin: 0; }
.pv-entete > summary { display: flex; flex-wrap: wrap; align-items: baseline; gap: .3rem 1rem; }
.pv-resume { color: var(--muted); font-size: .9rem; }
.pv-presences { margin-top: .4rem; }
.pv-pastilles { display: grid; gap: .5rem; margin: .4rem 0; }
.pv-part { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem; }
.pv-part-nom { min-width: 6rem; }
.pv-pastille { font: inherit; padding: .25rem .75rem; border: 1px solid var(--line); border-radius: 999px; background: #fff; cursor: pointer; }
.pv-pastille:hover { border-color: var(--cc); }
.pv-pastille.on-p { background: #e6f4ea; border-color: #2e8b4f; color: #1c6b3a; font-weight: 600; }
.pv-pastille.on-e { background: #fff3e0; border-color: #d98a1f; color: #9a5b00; font-weight: 600; }
.pv-pastille.on-a { background: #fde8e6; border-color: #c4443a; color: #9c2b22; font-weight: 600; }
.pv-legende .pv-pastille { cursor: default; font-size: .85rem; padding: .1rem .6rem; }
.pv-autre { display: flex; gap: .5rem; flex-wrap: wrap; }
.pv-autre input { flex: 1 1 16rem; max-width: 24rem; }

.pv-feuille { background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 2px 10px rgba(20,40,70,.06); padding: 1.3rem 1.5rem 1.3rem 3rem; margin-bottom: 1rem; }
.pv-editeur { min-height: 55vh; outline: none; font-family: Georgia, 'Times New Roman', serif; font-size: 1.05rem; line-height: 1.55; }
.pv-editeur h2 font[size], .pv-editeur h2 .tp, .pv-editeur h2 .tn, .pv-editeur h2 .tg, .pv-editeur h2 .tt { font-size: inherit; }
.pv-editeur h2 { font-family: inherit; font-size: 1.2rem; margin: 1.3rem 0 .4rem; color: #1b2f4f; }
.pv-editeur p { margin: 0 0 .55rem; }
.pv-editeur ul, .pv-editeur ol { margin: 0 0 .55rem; padding-left: 1.6rem; }
.pv-editeur li { margin: .1rem 0; }
.pv-editeur .d1 { margin-left: 2rem; } .pv-editeur .d2 { margin-left: 4rem; } .pv-editeur .d3 { margin-left: 6rem; }
.pv-editeur .tp, .pv-editeur font[size="1"], .pv-editeur font[size="2"] { font-size: 14.4px; } .pv-editeur font[size="3"] { font-size: 16.8px; } .pv-editeur font[size="4"] { font-size: 21.6px; } .pv-editeur font[size="5"], .pv-editeur font[size="6"], .pv-editeur font[size="7"] { font-size: 27px; }
.pv-editeur .tn { font-size: 16.8px; } .pv-editeur .tg { font-size: 21.6px; } .pv-editeur .tt { font-size: 27px; }
.pv-editeur .kr, .pv-editeur font[color="#c0392b"] { color: #c0392b; } .pv-editeur .ko, .pv-editeur font[color="#d35400"] { color: #d35400; } .pv-editeur .kv, .pv-editeur font[color="#1e8449"] { color: #1e8449; }
.pv-editeur .kb, .pv-editeur font[color="#1f4e8c"] { color: #1f4e8c; } .pv-editeur .kg, .pv-editeur font[color="#6b7785"] { color: #6b7785; } .pv-editeur font[color="#1e2328"] { color: inherit; }
.pv-outils button.actif { background: #1f4e8c; border-color: #1f4e8c; color: #fff; }
.pv-couleurs { gap: .3rem; }
.pv-outils .pv-couleurs button { min-width: 0; width: 1.6rem; height: 1.6rem; padding: 0; border-radius: 50%; background: var(--k); border: 2px solid #fff; box-shadow: 0 0 0 1px var(--line); }
.pv-outils select { font: inherit; padding: .3rem .5rem; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.pv-envoi { display: flex; align-items: center; gap: .5rem; font-weight: 600; }
.pv-dest ul { margin: .3rem 0 .3rem 1rem; padding: 0; max-height: 11rem; overflow: auto; }
@media (max-width: 640px) { .pv-feuille { padding: 1rem 1rem 1rem 1.6rem; } .pv-droite { margin-left: 0; } }

/* Dossiers à créer dans le formulaire de dépôt */
.adm-groupes { display: grid; gap: .5rem; margin-top: .4rem; }
.adm-groupe { border: 1px solid var(--bord, #d8dde6); border-radius: 10px; padding: .5rem .7rem; background: rgba(0,0,0,.02); }
.adm-groupe.ppe-cible, [data-zone].ppe-cible { outline: 2px dashed currentColor; outline-offset: 2px; }
.adm-groupe-tete { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.adm-groupe-tete .btn { padding: .2rem .6rem; font-size: .85rem; }
.adm-nom-dossier { display: inline-flex; gap: .4rem; align-items: center; flex-wrap: wrap; }
.adm-nom-dossier input { min-width: 14rem; }

/* Zone de dépôt : trois boutons identiques, puis une zone qui se remplit */
.adm-boutons { display: flex; flex-wrap: wrap; gap: .5rem; margin: .2rem 0 .5rem; }
.adm-bouton { display: inline-flex; align-items: center; gap: .4rem; border: 1px solid #3b82f6; background: #eef4ff; color: #1d4ed8; border-radius: 10px; padding: .45rem .9rem; font: inherit; font-weight: 600; font-size: .92rem; cursor: pointer; }
.adm-bouton:hover { background: #dbe8ff; }
.adm-zone-depot { border: 2px dashed #9db4e0; border-radius: 12px; background: #f8faff; padding: .7rem; min-height: 5.5rem; margin-top: .5rem; }
.adm-zone-depot.ppe-cible { background: #eaf1ff; border-color: #3b82f6; outline: 0; }
.adm-invite { text-align: center; color: #6b7a99; padding: 1rem 0; }
.adm-invite b { display: block; font-size: 1.6rem; }
.adm-invite-bas { padding: .4rem 0; font-size: .85rem; }
.adm-zone-depot .adm-groupe { background: #fff; }
.adm-groupe.ppe-cible { background: #eaf1ff; outline: 2px solid #3b82f6; }
.adm-mini { border: 1px solid #c5d0ea; background: #fff; border-radius: 8px; padding: .1rem .6rem; font: inherit; font-size: .8rem; color: #1d4ed8; cursor: pointer; margin-left: auto; }
.adm-nom-dossier { margin-bottom: .3rem; }

.ppe-depot { margin: 0 0 1rem; }
.ppe-depot .adm-zone-depot { min-height: 4rem; margin-top: .2rem; }
.ppe-cat.ppe-cible .adm-zone-depot { background: #eaf1ff; border-color: #3b82f6; }
.ppe-cat.ppe-cible { outline: 0; background: inherit; }
.adm-invite small { display: block; margin-top: .2rem; font-size: .78rem; }
.adm-bouton-calme { background: #fff; border-color: #c5d0ea; color: #4a5a7a; text-decoration: none; }
.ppe-depot-dos { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; border-top: 1px dashed var(--line); padding-top: .8rem; margin-top: .6rem; }
a.adm-bouton { text-decoration: none; }

a.adm-lien-dossier { color: inherit; text-decoration: none; border-bottom: 1px dotted currentColor; }
a.adm-lien-dossier:hover { color: var(--accent, #1d4ed8); border-bottom-style: solid; }

.adm-extrait { margin: .3rem 0 0; padding: .35rem .6rem; border-left: 3px solid #3b82f6; background: #f1f6ff; border-radius: 0 8px 8px 0; font-size: .85rem; color: #46557a; }
@media (max-width: 600px) { .topbar { flex-wrap: wrap; row-gap: .4rem; } .topbar-zone, .topbar-zone + .topbar-user { margin-left: auto; } }

.adm-progres { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(255,255,255,.8); font-size: 1.3rem; font-weight: 600; color: var(--accent); z-index: 60; }

.pastille-visa { display: inline-block; margin-left: .5rem; padding: .05rem .65rem; border-radius: 999px; background: #d97706; color: #fff; font-size: .78rem; font-weight: 600; vertical-align: middle; white-space: nowrap; }
.form-part .ligne input.p-envoi-case { width: 1.15rem; height: 1.15rem; min-width: 1.15rem; padding: 0; margin: 0; flex: none; accent-color: var(--accent); }
.form-part .ligne input[type=hidden] { display: none; }
.form-part .ligne .p-role { width: 100%; min-width: 0; padding: .5rem .4rem; font: inherit; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.form-part.form-cartes:not(.form-loc) { max-width: 1240px; }
