:root{--ink:#172b3b;--muted:#64758a;--nav:#17354c;--accent:#146b80;--line:#dce4ec;--bs-primary:#146b80;--bs-body-color:var(--ink)}body{background:#f2f5f8;font-family:system-ui,-apple-system,'Segoe UI',sans-serif;color:var(--ink);font-size:14px}.shell{max-width:1450px;padding-left:28px;padding-right:28px}.topbar{background:var(--nav);color:white;padding:16px 0}.brand{display:flex;align-items:center;gap:12px;color:white;text-decoration:none;font-size:22px;font-weight:700;line-height:1.15}.brand:hover{color:white}.brand small{display:block;color:#b9d1de;font-size:11px;font-weight:500;letter-spacing:.04em;margin-top:3px}.brand-mark{background:#2c8495;border-radius:11px;padding:10px;font-size:18px}.local-label{color:#c6d9e4;font-size:11px;letter-spacing:.1em}.navstrip{display:flex;gap:6px;flex-wrap:wrap;border-bottom:1px solid var(--line);padding-bottom:10px}.navstrip a{text-decoration:none;padding:10px 15px;border-radius:7px;color:var(--muted);font-weight:600}.navstrip a.active{background:#dcecef;color:#14596c}.navstrip a:hover{background:#e8eff4}.pagehead{display:flex;justify-content:space-between;align-items:center;gap:14px;flex-wrap:wrap;margin-bottom:20px}.pagehead h1{font-size:30px;font-weight:700;letter-spacing:-.03em;margin:4px 0}.pagehead p{margin:0}.eyebrow{font-size:11px;letter-spacing:.13em;color:var(--accent);font-weight:700}.muted{color:var(--muted)}.panel{background:white;border:1px solid var(--line);border-radius:12px;padding:20px;box-shadow:0 3px 14px #17354c06}.panel h2{font-size:18px;font-weight:700;margin:0 0 6px}.panel-head{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:12px;margin-bottom:18px}.filterbar{display:flex;flex-wrap:wrap;align-items:end;gap:12px}.filterbar>div{flex:1;min-width:170px}.filterbar label,label{font-size:12px;font-weight:650;margin-bottom:6px;color:#42596b;display:block}.form-control,.form-select{border-color:#ccd8e2;font-size:14px;min-height:39px}.btn{font-size:13px;font-weight:600}.btn-primary{--bs-btn-bg:#146b80;--bs-btn-border-color:#146b80;--bs-btn-hover-bg:#10576b;--bs-btn-hover-border-color:#10576b;--bs-btn-active-bg:#10576b;--bs-btn-active-border-color:#10576b}.btn-outline-primary{--bs-btn-color:#146b80;--bs-btn-border-color:#94bdc8;--bs-btn-hover-bg:#146b80;--bs-btn-hover-border-color:#146b80}a{color:#146b80}.kpis{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px}.kpi{border-top:3px solid #337c9a;display:flex;flex-direction:column;gap:8px}.kpi.income{border-top-color:#20946c}.kpi.expense{border-top-color:#b96250}.kpi span{font-size:11px;font-weight:700;letter-spacing:.08em;color:var(--muted)}.kpi strong{font-size:clamp(20px,3vw,32px);font-variant-numeric:tabular-nums;letter-spacing:-.035em;overflow-wrap:anywhere}.kpi small{color:var(--muted);font-size:11px}.table{font-size:13px;--bs-table-color:var(--ink);--bs-table-border-color:#e5ebf0;margin-bottom:14px}.table thead th{background:#edf3f7;color:#52687a;font-size:11px;text-transform:uppercase;white-space:nowrap;letter-spacing:.04em;padding:12px}.table td,.table th{padding:10px 12px}.money,.balance td,.balance th{font-variant-numeric:tabular-nums}.money{font-weight:700}.tag{display:inline-block;padding:3px 7px;border-radius:5px;font-weight:650;font-size:10px;background:#edf2f7;color:#536879}.tag-income{background:#e2f4ea;color:#17754d}.tag-expense{background:#f9eae5;color:#984f3f}.section-row>*{background:#28485c!important;color:white!important}.section-income>*{background:#227b60!important}.section-expense>*{background:#9e5849!important}.category-row>*{background:#eef3f6!important;font-weight:650}.balance td:not(:first-child),.balance th:not(:first-child){white-space:nowrap}.empty{text-align:center;color:var(--muted);padding:30px 12px;margin:0}.settings-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:18px}.reference-list{list-style:none;padding:0;margin:0;max-height:230px;overflow:auto}.reference-list li{border-top:1px solid #e6edf2;padding:8px 0}.entry-form{max-width:950px}.info-note{background:#edf5f8;padding:12px 15px;border-radius:7px;color:#415c70}.back-link{text-decoration:none;font-weight:600}.validation-summary-valid{display:none}.field-validation-valid{display:none}.input-validation-error{border-color:#b43e3e!important}@media(max-width:700px){.shell{padding-left:14px;padding-right:14px}.kpis,.settings-grid{grid-template-columns:1fr}.panel{padding:15px}.local-label{display:none}.navstrip a{padding:8px 10px}.pagehead h1{font-size:25px}}
/* Facture retrouvée depuis le lien de confirmation. */
.invoice-row:target > td { background-color: #e2f4ea; --bs-table-bg: #e2f4ea; }
.invoice-row { scroll-margin-top: 20px; }

/* Rubriques et actions : compatible avec style-src 'self'. */
.category-reference-list { padding-inline-end: 12px; overflow-x: hidden; scrollbar-gutter: stable; }
.category-edit-summary { cursor: pointer; list-style: none; min-width: 0; }
.category-edit-summary::-webkit-details-marker { display: none; }
.category-edit-summary::marker { content: ""; }
.category-edit-name { min-width: 0; overflow-wrap: anywhere; }
.invoice-icon-action { width: 22px; height: 22px; flex: 0 0 22px; }
.category-edit-summary:hover .invoice-icon-action, .category-edit-summary:focus-visible .invoice-icon-action { color: var(--accent) !important; }

/* V16 - flèches natives, indépendantes des SVG data: de Bootstrap. */
select:not([multiple]):not([size]), select:not([multiple])[size="1"] {
  -webkit-appearance: menulist;
  appearance: auto;
  background-image: none;
  padding-inline-end: 0.75rem;
}
.invoice-type-reference-list > [hidden] { display: none !important; }
.invoice-type-reference-list { padding-inline-end: 12px; overflow-x: hidden; scrollbar-gutter: stable; }

/* V18 : retour sur la facture enregistrée, sans script ni style intégré. */
.invoice-card { scroll-margin-block: 24px; }
.invoice-card:target {
  outline: 2px solid #20946c;
  outline-offset: -2px;
  background-color: #f0faf4;
}

/* V22 - raccourcis des modèles, toujours visibles dans la liste. */
.schedule-shortcuts {
  position: sticky;
  top: 8px;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 3px 12px #17354c14;
}
.schedule-shortcut-label { margin: 0; white-space: nowrap; }
.schedule-shortcut-select { flex: 1 1 0; min-width: 0; max-width: 540px; }
.schedule-model-card, .schedule-model-card .invoice-card { scroll-margin-block-start: 88px; }
.schedule-model-card:focus { outline: 2px solid var(--accent); outline-offset: -2px; }
@media (max-width: 520px) {
  .schedule-shortcuts { gap: 6px; padding: 6px; }
  .schedule-shortcut-label { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
}

/* V23 - modèle nouvellement créé, repéré par son ancre. */
.schedule-model-card:target {
  outline: 2px solid #20946c;
  outline-offset: -2px;
  background-color: #f0faf4;
}

/* V24 - retour fixe vers le formulaire de creation, sans style inline. */
#create-schedule { scroll-margin-block-start: 20px; }
.create-schedule-shortcut {
 position: fixed; inset-inline-start: 12px; bottom: 24px; z-index: 30;
 display: inline-flex; align-items: center; justify-content: center;
 width: 48px; height: 48px; border-radius: 50%;
 background: #146b80; color: #fff; text-decoration: none;
 border: 1px solid #10576b; box-shadow: 0 4px 14px #17354c35;
}
.create-schedule-shortcut:hover, .create-schedule-shortcut:focus-visible { background: #10576b; color: #fff; }
.create-schedule-shortcut:focus-visible { outline: 3px solid #90cbd8; outline-offset: 3px; }
@media (max-width: 700px) { .create-schedule-shortcut { inset-inline-start: 10px; bottom: 12px; width: 44px; height: 44px; } body:has(.create-schedule-shortcut) { padding-bottom: 60px; } }

/* V25 - actions des referentiels, sans style integre ni bouton dans summary. */
.reference-list .reference-edit-row { display:flex; align-items:flex-start; gap:8px; }
.reference-edit-details { flex:1 1 auto; min-width:0; }
.reference-delete-form { flex:0 0 22px; }
