:root { --vert: #1f6f5c; --fond: #f5f7f6; --texte: #1b2420; --gris: #6b7773; --rouge: #c0392b; }
* { box-sizing: border-box; }
body { margin: 0; font-family: system-ui, sans-serif; background: var(--fond); color: var(--texte); }
main { max-width: 420px; margin: 0 auto; padding: 24px 16px calc(24px + env(safe-area-inset-bottom)); min-height: 100vh; }
h1 { font-size: 1.4rem; margin: 0 0 4px; }
p.aide { color: var(--gris); margin: 0 0 20px; }
.erreur { color: var(--rouge); min-height: 1.4em; margin: 8px 0; text-align: center; }
input[type=text] { width: 100%; font-size: 1.1rem; padding: 12px; border: 1px solid #c9d3cf; border-radius: 10px; margin-bottom: 12px; }
button { font: inherit; }
button.lien { background: none; border: 0; color: var(--vert); padding: 12px; width: 100%; }
.liste-users button { display: block; width: 100%; padding: 16px; margin-bottom: 10px; font-size: 1.1rem; border: 1px solid #c9d3cf; border-radius: 10px; background: #fff; }
.points { display: flex; justify-content: center; gap: 14px; margin: 24px 0 8px; height: 18px; }
.points span { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--vert); }
.points span.plein { background: var(--vert); }
.clavier { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.clavier button { padding: 18px 0; font-size: 1.5rem; border: 0; border-radius: 12px; background: #fff; box-shadow: 0 1px 2px #0002; }
.clavier button:active { background: #dfe9e5; }
h2 { font-size: 1.1rem; margin: 24px 0 8px; }
input[type=password] { width: 100%; font-size: 1.1rem; padding: 12px; border: 1px solid #c9d3cf; border-radius: 10px; margin-bottom: 12px; }
button.principal { width: 100%; padding: 14px; font-size: 1.1rem; border: 0; border-radius: 10px; background: var(--vert); color: #fff; }
button.gauche { text-align: left; width: auto; padding-left: 0; }
button.danger { color: var(--rouge); }
.carte { background: #fff; border-radius: 10px; padding: 12px 14px; margin-bottom: 10px; box-shadow: 0 1px 2px #0002; }
.carte.inactif { opacity: .6; }
.carte .actions { display: flex; gap: 8px; }
.carte .actions button { width: auto; padding: 8px 0; margin-right: 12px; }
.saisie { display: flex; flex-direction: column; gap: 10px; }
.saisie input, .saisie select { width: 100%; font-size: 1.1rem; padding: 12px; border: 1px solid #c9d3cf; border-radius: 10px; background: #fff; margin: 0; }
.saisie #montant { font-size: 2rem; text-align: center; padding: 16px; font-weight: 600; }
.depenses { list-style: none; margin: 0; padding: 0; }
.depense { display: flex; justify-content: space-between; align-items: center; gap: 10px; background: #fff; border-radius: 10px; padding: 10px 14px; margin-bottom: 8px; box-shadow: 0 1px 2px #0002; cursor: pointer; touch-action: pan-y; }
.depense .aide { margin: 2px 0 0; font-size: .85rem; }
.montant { font-weight: 600; white-space: nowrap; }
.vide { box-shadow: none; background: none; }
.stat { margin-bottom: 10px; }
.stat-ligne { display: flex; justify-content: space-between; font-size: .95rem; }
.barre { height: 6px; background: #dfe9e5; border-radius: 3px; margin-top: 4px; }
.barre span { display: block; height: 100%; background: var(--vert); border-radius: 3px; }
.pied { margin-top: 28px; border-top: 1px solid #dfe9e5; padding-top: 8px; }
dialog { border: 0; border-radius: 14px; padding: 16px; width: min(92vw, 400px); }
dialog::backdrop { background: #0006; }
.filtres { display: flex; gap: 8px; margin-bottom: 10px; }
.filtres select { flex: 1; font-size: 1rem; padding: 10px; border: 1px solid #c9d3cf; border-radius: 10px; background: #fff; }
.navperiode { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; text-transform: capitalize; }
.navperiode button { width: auto; font-size: 1.6rem; padding: 4px 16px; }
.navperiode button:disabled { opacity: .3; }
.total { font-size: 2rem; font-weight: 600; text-align: center; margin: 4px 0 8px; }
.info { color: var(--vert); text-align: center; min-height: 0; margin: 0; }
.info:empty { display: none; }
.plus summary { color: var(--vert); cursor: pointer; padding: 6px 2px; }
.plus > input, .plus > select { margin-top: 8px; }
.bulles { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.bulle { border: 0; border-radius: 18px; padding: 8px 14px; text-align: left; color: #fff; font-size: .95rem; }
.bulle.retard { background: #c0392b; }
.bulle.encours { background: #e67e22; }
.bulle.solde { background: #2e8b57; }
.pret { border-left: 6px solid #e67e22; }
.pret.retard { border-left-color: #c0392b; }
.pret.solde { border-left-color: #2e8b57; }
.pret .etat { font-size: .85rem; color: var(--gris); }
.sans-clic { cursor: default; }
button.petit { width: auto; padding: 2px 8px; display: inline; }
label.aide { display: block; }
label.aide input { margin-top: 4px; }
.stat.proche .barre span { background: #e67e22; }
.stat.depasse .barre span { background: #c0392b; }
.stat.depasse .stat-ligne span:last-child { color: #c0392b; font-weight: 600; }
.stat.proche .stat-ligne span:last-child { color: #d35400; font-weight: 600; }
.point { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: #c0392b; vertical-align: middle; margin-left: 4px; }
.alerte { border-left: 6px solid #c0392b; }
.ligne-plafond { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 8px; }
.ligne-plafond input { width: 130px; font-size: 1rem; padding: 10px; border: 1px solid #c9d3cf; border-radius: 10px; text-align: right; }
.actions-regle { display: flex; align-items: center; gap: 8px; white-space: nowrap; font-size: .9rem; }
h3 { font-size: 1rem; margin: 20px 0 8px; }
details > summary { cursor: pointer; font-weight: 600; padding: 12px 4px; border-bottom: 1px solid #dfe9e5; }
details[data-s] > .contenu { padding: 10px 0 14px; }
.ajout { display: flex; gap: 8px; margin-top: 10px; }
.ajout input { flex: 1; margin: 0; }
.ajout button.principal { width: auto; padding: 0 16px; }
.case { display: block; padding: 6px 0; }
.carte input.mp-nom { width: 100%; font-size: 1rem; padding: 10px; border: 1px solid #c9d3cf; border-radius: 10px; margin-bottom: 6px; }
.carte details > summary { font-weight: 400; border: 0; padding: 6px 0; }
.ligne-plafond select { font-size: 1rem; padding: 8px; border: 1px solid #c9d3cf; border-radius: 10px; background: #fff; max-width: 55%; }
.hors { background: #fdf0d5; color: #7a4b00; border-radius: 10px; padding: 10px 14px; margin-bottom: 14px; font-size: .95rem; }
.depense.attente { border: 1px dashed #e67e22; background: #fffaf2; }
.depense.attente.refusee { border-color: #c0392b; background: #fdf1f0; }
.depense.attente.refusee .aide { color: #c0392b; }
.rang { display: flex; gap: 8px; align-items: stretch; }
.rang > input, .rang > select { flex: 1 1 0; width: auto; min-width: 0; }
.rang > input[type=date] { flex: 0 0 auto; width: 9.2em; font-size: .95rem; padding: 8px; text-align: center; }
.rang > select { font-size: 1rem; padding: 12px 8px; text-overflow: ellipsis; }
.saisie #montant { padding: 12px 8px; }
.pour-zone { position: relative; flex: 0 0 auto; display: flex; }
.pour { width: 46px; border: 1px solid #c9d3cf; border-radius: 10px; background: #fff; color: var(--vert); font-weight: 700; font-size: 1rem; padding: 0; }
.pour.autre { background: #e67e22; border-color: #e67e22; color: #fff; }
.menu-pour { position: absolute; right: 0; bottom: calc(100% + 6px); z-index: 5; background: #fff; border-radius: 10px; box-shadow: 0 4px 16px #0003; padding: 4px; min-width: 150px; }
.menu-pour button { display: block; width: 100%; text-align: left; border: 0; background: none; padding: 10px 12px; border-radius: 8px; font-size: 1rem; }
.menu-pour button:active { background: #dfe9e5; }
.menu-pour b { display: inline-block; min-width: 1.6em; color: var(--vert); }
.depense.par-autre { border-left: 5px solid #7b5ea7; background: #f7f4fb; }
.saisie-par { color: #7b5ea7; font-weight: 600; }
.saisie input:disabled, .saisie select:disabled { background: #eef2f0; color: var(--gris); }
.depenses.lecture-seule .depense { cursor: default; }
.filtres { flex-wrap: wrap; }
.filtres select#categorie { flex: 1 1 100%; }
.stat.cliquable { cursor: pointer; padding: 4px 0; }
.stat.cliquable:active { background: #e8efec; }
.centre { text-align: center; margin-bottom: 8px; }
.pastille { border: 0; border-radius: 16px; background: var(--vert); color: #fff; padding: 6px 14px; font-size: .95rem; }
.rang > input.l-mont { flex: 0 0 6.5em; text-align: right; }
.pret .aide .nb-lignes { color: var(--gris); }
