:root {
  --bg: #f5f7f8;
  --surface: #ffffff;
  --text: #1c2a33;
  --muted: #66757f;
  --border: #dde3e7;
  --primary: #395b90;   /* bleu Clinique Oraline */
  --primary-dark: #2b4670;
  --primary-soft: #e9eef6;
  --danger: #b42318;
  --danger-soft: #fdecea;
  --warn: #b54708;
  --warn-soft: #fef4e6;
  --ok: #067647;
  --ok-soft: #e7f6ee;
  --radius: 10px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); font-size: 16px; line-height: 1.45; }
a { color: var(--primary); }
h1 { font-size: 1.5rem; margin: 0 0 1rem; }
h2 { font-size: 1.15rem; margin: 1.75rem 0 .75rem; }
h3 { font-size: 1rem; margin: 0 0 .5rem; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }

/* ---------- header / nav */
header.top {
  background: #fff; color: var(--text); border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 1.25rem; flex-wrap: wrap;
  padding: .55rem 1rem;
}
.brand { display: flex; align-items: center; gap: .6rem; text-decoration: none; }
.brand img { display: block; height: 29px; width: auto; }
.brand-name {
  font-weight: 800; font-size: 1.2rem; color: var(--primary); letter-spacing: .01em;
  padding-left: .6rem; border-left: 2px solid var(--border);
}
.main-nav { display: flex; gap: .15rem; flex-wrap: wrap; flex: 1; }
.main-nav a {
  color: var(--text); text-decoration: none; padding: .5rem .8rem; border-radius: 8px; font-weight: 600;
  display: inline-flex; align-items: center; gap: .35rem; white-space: nowrap;
}
.main-nav a:hover { background: var(--primary-soft); color: var(--primary); }
.main-nav a.active { background: var(--primary); color: #fff; }
.who { font-size: .85rem; display: flex; gap: .9rem; align-items: center; color: var(--muted); }
.who a { color: var(--muted); }
.who a.active, .who a:hover { color: var(--primary); }
.who-name { color: var(--text); font-weight: 600; }
.sub-nav {
  background: var(--primary-soft); border-bottom: 1px solid var(--border);
  display: flex; gap: .25rem; padding: .35rem 1rem; overflow-x: auto;
}
.sub-nav a {
  color: var(--primary-dark); text-decoration: none; padding: .4rem .75rem; border-radius: 8px;
  font-size: .92rem; white-space: nowrap; display: inline-flex; align-items: center; gap: .35rem;
}
.sub-nav a:hover { background: #fff; }
.sub-nav a.active { background: #fff; font-weight: 700; box-shadow: 0 1px 2px rgba(0,0,0,.06); }
.badge {
  display: inline-block; min-width: 1.4em; padding: 0 .4em; border-radius: 999px;
  background: var(--danger); color: #fff; font-size: .72rem; font-weight: 700; text-align: center; line-height: 1.5;
}

/* ---------- home */
.home-hello { margin-bottom: 1.25rem; display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; }
.tiles { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.tile {
  display: flex; flex-direction: column; gap: .4rem; padding: 1.2rem; min-height: 9rem;
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
  color: inherit; text-decoration: none; position: relative;
}
.tile:hover { border-color: var(--primary); box-shadow: 0 2px 10px rgba(57, 91, 144, .12); }
.tile h2 { margin: 0; font-size: 1.2rem; color: var(--primary); }
.tile p { margin: 0; color: var(--muted); font-size: .92rem; }
.tile .tile-icon { width: 2.4rem; height: 2.4rem; border-radius: 10px; background: var(--primary-soft);
  color: var(--primary); display: flex; align-items: center; justify-content: center; }
.tile .tile-icon svg { width: 1.4rem; height: 1.4rem; }
.tile .soon { position: absolute; top: 1rem; right: 1rem; }
.tile.disabled h2 { color: var(--muted); }
.quick-actions { display: grid; gap: .75rem; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); margin-bottom: 1.5rem; }

main { max-width: 1100px; margin: 0 auto; padding: 1.25rem 1rem 3rem; }

/* ---------- flash */
.flash { padding: .75rem 1rem; border-radius: var(--radius); margin-bottom: 1rem; border: 1px solid; }
.flash.success { background: var(--ok-soft); border-color: #a6dcbd; color: var(--ok); }
.flash.warning { background: var(--warn-soft); border-color: #f7c98b; color: var(--warn); }
.flash.error { background: var(--danger-soft); border-color: #f3b5ae; color: var(--danger); }

/* ---------- cards / tables */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem; margin-bottom: 1rem; }
.grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; }
th, td { padding: .6rem .75rem; text-align: left; border-bottom: 1px solid var(--border); vertical-align: middle; }
th { font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); background: #fafbfc; }
tr:last-child td { border-bottom: none; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
tr.cancelled td { color: var(--muted); text-decoration: line-through; }

.pill { display: inline-block; padding: .1rem .55rem; border-radius: 999px; font-size: .8rem; font-weight: 600; white-space: nowrap; }
.pill.low { background: var(--danger-soft); color: var(--danger); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.unset { background: #eef1f3; color: var(--muted); }
.pill.brouillon { background: #eef1f3; color: var(--text); }
.pill.envoyee { background: var(--primary-soft); color: var(--primary-dark); }
.pill.recue { background: var(--ok-soft); color: var(--ok); }
.pill.annulee { background: #eef1f3; color: var(--muted); }

/* ---------- forms */
label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: .3rem; }
input[type=text], input[type=email], input[type=number], input[type=search], select, textarea {
  width: 100%; padding: .6rem .7rem; border: 1px solid var(--border); border-radius: 8px;
  font: inherit; background: #fff; color: var(--text);
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--primary); outline-offset: 0; border-color: var(--primary); }
textarea { min-height: 5rem; resize: vertical; }
.field { margin-bottom: .9rem; }
.field .hint { font-weight: 400; color: var(--muted); font-size: .8rem; }
.row { display: flex; gap: .75rem; flex-wrap: wrap; align-items: flex-end; }
.row > .field { flex: 1 1 180px; }
.checkbox { display: flex; align-items: center; gap: .5rem; font-weight: 400; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  padding: .6rem 1rem; border-radius: 8px; border: 1px solid var(--primary);
  background: var(--primary); color: #fff; font: inherit; font-weight: 600;
  cursor: pointer; text-decoration: none; white-space: nowrap;
}
.btn:hover { background: var(--primary-dark); }
.btn.secondary { background: #fff; color: var(--primary); }
.btn.secondary:hover { background: var(--primary-soft); }
.btn.danger { background: #fff; color: var(--danger); border-color: #f3b5ae; }
.btn.danger:hover { background: var(--danger-soft); }
.btn.small { padding: .3rem .6rem; font-size: .85rem; }
.btn.big { padding: .9rem 1.3rem; font-size: 1.05rem; }
.actions { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.toolbar { display: flex; gap: .75rem; flex-wrap: wrap; align-items: center; margin-bottom: 1rem; }
.toolbar input[type=search] { flex: 1 1 240px; }
.toolbar select { width: auto; }
.page-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.page-head h1 { margin: 0; }
form.inline { display: inline; }

/* ---------- sortie (assistant screen) */
.search-big { font-size: 1.1rem; padding: .85rem 1rem !important; }
.chips { display: flex; gap: .4rem; flex-wrap: wrap; margin: .75rem 0 1rem; }
.chip { border: 1px solid var(--border); background: #fff; border-radius: 999px; padding: .35rem .8rem; cursor: pointer; font: inherit; font-size: .9rem; color: var(--text); }
.chip.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.product-list { display: flex; flex-direction: column; gap: .5rem; }
.product-item {
  display: flex; justify-content: space-between; align-items: center; gap: 1rem;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: .85rem 1rem; color: inherit; text-decoration: none;
}
.product-item:hover { border-color: var(--primary); }
.product-item .pname { font-weight: 600; }
.product-item .meta { font-size: .85rem; color: var(--muted); }
.product-item .stockval { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.stepper { display: flex; align-items: center; gap: .5rem; margin-bottom: .75rem; }
.stepper button { width: 3rem; height: 3rem; border-radius: 50%; border: 1px solid var(--border); background: #fff; font-size: 1.4rem; cursor: pointer; color: var(--primary); }
.stepper input { width: 5.5rem; text-align: center; font-size: 1.4rem; font-weight: 700; padding: .5rem; }
.empty { text-align: center; color: var(--muted); padding: 2rem 1rem; }

/* ---------- email preview */
.email-preview { border: 1px dashed var(--border); border-radius: var(--radius); padding: 1rem; background: #fff; overflow-x: auto; }
.email-meta { font-size: .9rem; margin-bottom: .75rem; }
.email-meta div { margin-bottom: .2rem; }

.pagination { display: flex; gap: .5rem; justify-content: center; margin-top: 1rem; align-items: center; }

@media (max-width: 640px) {
  header.top { padding: .5rem .75rem; gap: .5rem; }
  .main-nav { order: 3; flex-basis: 100%; overflow-x: auto; flex-wrap: nowrap; }
  .who { margin-left: auto; gap: .6rem; }
  .who-name { display: none; }
  main { padding: 1rem .75rem 3rem; }
  .hide-sm { display: none; }
  th, td { padding: .5rem; }
}

/* email preview: neutralise app table styling so it looks like the real email */
.email-preview th { text-transform: none; letter-spacing: 0; font-size: inherit; }
.email-preview th, .email-preview td { border-bottom: none; }

/* quick exit (QR target) */
.quick { max-width: 520px; margin: 0 auto; }
.stepper-lg { justify-content: center; }
.stepper-lg button { width: 3.6rem; height: 3.6rem; font-size: 1.7rem; }
.stepper-lg input { width: 7rem; font-size: 1.8rem; }

/* QR labels: A4 sheet, 3 x 7 labels of 63.5 x 38.1 mm (Avery L7160) */
.labels { display: grid; grid-template-columns: repeat(auto-fill, 63.5mm); gap: 0 2.5mm; justify-content: center; }
.label {
  width: 63.5mm; height: 38.1mm; overflow: hidden; display: flex; gap: 2mm; align-items: center;
  padding: 2mm 2.5mm; background: #fff; color: #000; border: 1px dashed var(--border); break-inside: avoid;
}
.label-qr svg { width: 30mm; height: 30mm; display: block; }
.label-text { min-width: 0; display: flex; flex-direction: column; gap: .8mm; }
.label-name { font-weight: 700; font-size: 10pt; line-height: 1.15; overflow: hidden;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; }
.label-sub { overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.label-sub { font-size: 6.5pt; line-height: 1.2; color: #333; }
.label-hint { font-size: 6pt; color: #555; margin-top: .5mm; }

@media print {
  @page { size: A4; margin: 15.1mm 7.2mm; }
  body, main { background: #fff; margin: 0; padding: 0; max-width: none; }
  header.top, .no-print, .flash { display: none !important; }
  .labels { grid-template-columns: repeat(3, 63.5mm); justify-content: start; }
  .label { border: none; }
}

/* drawer page: sortie / rentrée toggle */
.segmented { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; margin-bottom: 1rem; }
.seg { margin: 0; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span {
  display: block; text-align: center; padding: .8rem; border-radius: 10px; font-size: 1.1rem; font-weight: 700;
  border: 2px solid var(--border); background: #fff; color: var(--muted); cursor: pointer;
}
.seg-out input:checked + span { border-color: var(--warn); background: var(--warn-soft); color: var(--warn); }
.seg-in input:checked + span { border-color: var(--ok); background: var(--ok-soft); color: var(--ok); }
.seg input:focus-visible + span { outline: 2px solid var(--primary); outline-offset: 2px; }
form[data-mode="rentree"] button[type=submit] { background: var(--ok); border-color: var(--ok); }

/* inventory: 3rd segment (Compter), mode switch, quick entry list */
.segmented.three { grid-template-columns: repeat(3, 1fr); }
.seg-count input:checked + span { border-color: var(--primary); background: var(--primary-soft); color: var(--primary); }
.mode-switch { display: inline-flex; gap: .25rem; padding: .25rem; margin-bottom: .75rem; border-radius: 12px;
  background: var(--primary-soft); max-width: 100%; }
.mode-switch a { padding: .45rem .9rem; border-radius: 9px; font-weight: 600; color: var(--muted); text-decoration: none; }
.mode-switch a.active { background: #fff; color: var(--primary); box-shadow: 0 1px 3px rgba(16, 24, 40, .12); }
.quick .mode-switch { display: flex; }
.quick .mode-switch a { flex: 1; text-align: center; }
.quick-reason { align-items: end; margin-bottom: 1rem; }
.quick-table td { vertical-align: middle; }
.quick-name { font-weight: 600; margin: 0; cursor: pointer; }
.quick-input { width: 5.5rem; text-align: right; font-size: 1.05rem; font-weight: 700; padding: .45rem .6rem; }
.quick-table tr.entered { background: var(--primary-soft); }
.quick-table [data-result] { font-weight: 700; min-width: 3rem; }
.quick-table [data-result].up { color: var(--ok); }
.quick-table [data-result].down { color: var(--danger); }
.quick-table [data-result].same, .quick-table [data-result].bad { color: var(--muted); }
.save-bar { position: sticky; bottom: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; margin-top: 1rem; padding: .75rem 1rem; background: #fff; border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: 0 -4px 16px rgba(16, 24, 40, .08); }
.save-bar [data-quick-count] { font-weight: 600; color: var(--muted); }
/* Face ID lock screen */
.lock-screen { max-width: 420px; margin: 3rem auto 1rem; padding: 2rem 1.5rem; text-align: center; background: #fff;
  border: 1px solid var(--border); border-radius: 18px; box-shadow: 0 10px 30px rgba(16, 24, 40, .08); }
.lock-screen .lock-icon { width: 76px; height: 76px; color: var(--primary); margin-bottom: .75rem; }
.lock-screen h1 { margin-bottom: .5rem; }
.lock-screen .btn.big { width: 100%; margin: .75rem 0 .5rem; white-space: normal; }
.lock-help { text-align: left; margin: .75rem 0; color: var(--muted); }
.lock-help summary { cursor: pointer; text-align: center; }
kbd { font: inherit; font-size: .8em; padding: .05rem .35rem; border: 1px solid var(--border); border-bottom-width: 2px; border-radius: 4px; background: #fff; }

/* in-app QR scanner */
.scanner { position: relative; aspect-ratio: 4 / 3; max-height: 38vh; width: 100%; margin: 0 auto .5rem;
  background: #0b1a1f; border-radius: var(--radius); overflow: hidden; }
.scanner video { width: 100%; height: 100%; object-fit: cover; display: block; }
.scanner-frame { position: absolute; inset: 18%; border: 3px solid rgba(255,255,255,.85); border-radius: 14px;
  box-shadow: 0 0 0 999px rgba(0,0,0,.25); display: none; }
.scanner.active .scanner-frame { display: block; }
.scanner-overlay { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: .5rem; color: #fff; text-align: center; padding: 1rem; }
.scanner-overlay[hidden] { display: none; }

.link-like { display: inline; font-weight: 400; color: var(--primary); text-decoration: underline; cursor: pointer; }

/* supplier directory */
.contacts { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); align-items: start; }
.contact { margin: 0; display: flex; flex-direction: column; gap: .35rem; }
.contact[hidden] { display: none; }
.contact-head { display: flex; justify-content: space-between; align-items: flex-start; gap: .5rem; }
.contact-head h3 { margin: 0; color: var(--primary); }
.contact-line { overflow-wrap: anywhere; }
.contact-line .muted { display: inline-block; min-width: 3.6rem; font-size: .8rem; }
.contact-notes { white-space: pre-line; color: var(--muted); border-top: 1px solid var(--border); padding-top: .4rem; }
.contacts .empty { grid-column: 1 / -1; }

/* product page: drawer QR code */
.qr-card { display: flex; flex-direction: column; align-items: center; text-align: center; }
.qr-card h3 { align-self: stretch; text-align: left; }
.qr-big svg { width: 168px; height: 168px; display: block; }
.qr-card .small { margin: .5rem 0; }

/* install on smartphone */
.install-qr { display: flex; align-items: center; gap: 1.25rem; color: inherit; text-decoration: none; }
a.install-qr:hover { border-color: var(--primary); }
.install-qr h3 { color: var(--primary); }
.install-qr p { margin: 0; }
.qr-small svg { width: 150px; height: 150px; display: block; }
.steps { margin: 0; padding-left: 1.25rem; display: flex; flex-direction: column; gap: .45rem; }
.kbd { display: inline-block; padding: 0 .35rem; border: 1px solid var(--border); border-radius: 5px; font-size: .85rem; }
/* Field work (scan, entries, delivery notes) is for smartphones and tablets
   only; computers (mouse / trackpad) get the management screens. */
@media (hover: hover) and (pointer: fine) {
  .touch-only { display: none !important; }
}
@media (hover: none), (pointer: coarse) {
  .desktop-only { display: none !important; }
}

.segno { shape-rendering: crispEdges; }

/* products: categories first */
.category-tiles { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.category-tile { min-height: 6.5rem; }
.category-tile .pill { align-self: flex-start; }
.tiles[hidden] { display: none; }
h1 .crumb { color: var(--muted); text-decoration: none; font-weight: 600; }
h1 .crumb:hover { color: var(--primary); }

/* OralineLab: impression upload and case page */
.dropzone {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .35rem;
  min-height: 8rem; padding: 1.25rem; margin-bottom: .9rem; text-align: center; font-weight: 400; cursor: pointer;
  border: 2px dashed var(--border); border-radius: var(--radius); background: #fafbfc; color: var(--muted);
}
.dropzone:hover, .dropzone.over { border-color: var(--primary); background: var(--primary-soft); color: var(--primary-dark); }
.dropzone input[type=file] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.dropzone:focus-within { outline: 2px solid var(--primary); outline-offset: 2px; }
.dropzone-text strong { color: var(--primary); }
.dropzone-files { white-space: pre-line; color: var(--text); }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: .3rem 1rem; margin: 0 0 .5rem; }
.facts dt { color: var(--muted); font-size: .85rem; }
.facts dd { margin: 0; }
.notes { white-space: pre-line; margin: .5rem 0 0; padding-top: .5rem; border-top: 1px solid var(--border); }

/* purchases: link an invoice article to a product */
.link-form { display: flex; flex-direction: column; gap: .35rem; min-width: 240px; }
.link-form input[type=text] { padding: .35rem .5rem; font-size: .9rem; }

/* home: discreet "install on smartphone" popover */
.install-pop { position: relative; }
.install-pop summary {
  list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: .35rem;
  font-size: .82rem; color: var(--muted); padding: .35rem .65rem; border: 1px solid var(--border);
  border-radius: 999px; background: var(--surface); white-space: nowrap;
}
.install-pop summary::-webkit-details-marker { display: none; }
.install-pop summary svg { width: 1rem; height: 1rem; }
.install-pop summary:hover, .install-pop[open] summary { color: var(--primary); border-color: var(--primary); }
.install-pop-card {
  position: absolute; right: 0; top: calc(100% + .5rem); z-index: 20; width: 220px; text-align: center;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 1rem;
  box-shadow: 0 8px 24px rgba(28, 42, 51, .14);
}
.install-pop-card .qr-small svg { width: 150px; height: 150px; margin: 0 auto; }
.install-pop-card p { margin: .6rem 0 .4rem; }
.home-foot { text-align: center; margin-top: 2rem; }
.home-foot a { color: var(--muted); }

/* users: module access checkboxes */
.modules-form { display: flex; flex-direction: column; gap: .15rem; min-width: 210px; }
.modules-form .checkbox { margin: 0; }
.modules-form .btn { align-self: flex-start; margin-top: .3rem; }

/* suivi financier */
.fin { --s1: #2a78d6; --s2: #eb6834; --s3: #1baf7a; --s4: #eda100; --s5: #e87ba4; --s6: #008300; --s7: #6250d6; --s8: #e34948; }
.fin-intro { margin-top: -.6rem; }
.fin h2 { margin-top: 0; }
.fin-verdict { display: flex; flex-wrap: wrap; gap: 1rem 2rem; align-items: center; justify-content: space-between; }
.fin-answer { display: flex; flex-direction: column; gap: .1rem; flex: 1 1 320px; }
.fin-answer strong { font-size: 2.1rem; line-height: 1.15; }
.fin-answer.up strong { color: var(--ok); }
.fin-answer.down strong { color: var(--danger); }
.fin-kicker { font-weight: 600; }
.fin-stats { display: flex; flex-wrap: wrap; gap: .75rem 1.5rem; margin: 0; }
.fin-stats dt { color: var(--muted); font-size: .85rem; }
.fin-stats dd { margin: 0; font-weight: 700; font-size: 1.15rem; }
.fin-months { margin-bottom: 1rem; }
.fin-all { background: none; border: 0; color: var(--primary); font: inherit; font-weight: 600; padding: .25rem 0; margin-bottom: .35rem; cursor: pointer; }
.fin-all[aria-pressed="true"] { color: var(--text); cursor: default; }
.fin-month-grid { display: grid; gap: .5rem; grid-template-columns: repeat(auto-fit, minmax(78px, 1fr)); }
.fin-month { display: flex; flex-direction: column; align-items: center; gap: .2rem; padding: .5rem .25rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); font: inherit; color: var(--text); cursor: pointer; }
.fin-month:hover { border-color: var(--primary); }
.fin-month[aria-pressed="true"] { border-color: var(--primary); box-shadow: inset 0 0 0 1px var(--primary); background: var(--primary-soft); }
.fin-month-name { font-size: .85rem; font-weight: 600; }
.fin-gauge { position: relative; display: block; width: 100%; height: 64px; }
.fin-gauge::before { content: ""; position: absolute; left: 12%; right: 12%; top: 50%; border-top: 1px solid #c3c2b7; }
.fin-bar { position: absolute; left: 50%; width: 16px; margin-left: -8px; }
.fin-month.up .fin-bar { bottom: 50%; background: var(--ok); border-radius: 4px 4px 0 0; }
.fin-month.down .fin-bar { top: 50%; background: var(--danger); border-radius: 0 0 4px 4px; }
.fin-month-value { font-size: .8rem; font-weight: 700; white-space: nowrap; }
.fin-month.up .fin-month-value { color: var(--ok); }
.fin-month.down .fin-month-value { color: var(--danger); }
.fin-spend-grid { display: grid; gap: 1rem 1.5rem; grid-template-columns: minmax(200px, 300px) 1fr; align-items: start; }
.fin-pie svg { display: block; width: 100%; max-width: 300px; margin: 0 auto; }
.fin-arc { fill: none; stroke-width: 44; cursor: pointer; }
.fin-arc:hover { stroke-width: 50; }
.fin-pie-total { text-anchor: middle; font-size: 15px; font-weight: 700; fill: var(--text); }
.fin-pie-label { text-anchor: middle; font-size: 10px; fill: var(--muted); }
.fin-row { border-top: 1px solid var(--border); }
.fin-row:first-child { border-top: 0; }
.fin-row-head { display: flex; align-items: center; gap: .5rem; width: 100%; padding: .55rem .25rem; background: none; border: 0; font: inherit; color: var(--text); text-align: left; cursor: pointer; }
.fin-row-head:hover { background: var(--primary-soft); }
.fin-dot { flex: none; width: 10px; height: 10px; border-radius: 50%; }
.fin-icon { flex: none; width: 1.4rem; text-align: center; }
.fin-name { flex: 1 1 auto; min-width: 0; font-weight: 600; }
.fin-amount { flex: none; width: 6.2rem; text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.fin-amount small { display: block; font-weight: 400; color: var(--muted); }
.fin-chevron { flex: none; color: var(--muted); font-size: 1.2rem; line-height: 1; transition: transform .15s; }
.fin-row.open .fin-chevron { transform: rotate(90deg); }
.fin-spark { flex: none; display: flex; align-items: flex-end; gap: 2px; width: 92px; height: 28px; }
.fin-spark-bar { flex: 1 1 0; border-radius: 2px 2px 0 0; }
.fin-spark-bar.dim { opacity: .28; }
.fin-detail { padding: 0 .25rem .75rem 2.4rem; }
.fin-month-chips { display: grid; gap: .3rem; grid-template-columns: repeat(auto-fit, minmax(66px, 1fr)); margin-bottom: .6rem; }
.fin-month-chips span { padding: .2rem .35rem; background: var(--bg); border-radius: 6px; font-size: .82rem; white-space: nowrap; }
.fin-month-chips span.on { background: var(--primary-soft); }
.fin-month-chips b { display: block; font-weight: 400; color: var(--muted); font-size: .75rem; }
.fin-postes { list-style: none; margin: 0; padding: 0; }
.fin-postes li { display: flex; align-items: center; gap: .5rem; padding: .25rem 0; font-size: .9rem; }
.fin-postes li > span:first-child { flex: 1 1 auto; min-width: 0; }
.fin-postes b { flex: none; width: 5.6rem; text-align: right; font-variant-numeric: tabular-nums; }
.fin-share { display: block; height: 6px; margin-top: .3rem; max-width: 260px; background: var(--bg); border-radius: 3px; overflow: hidden; }
.fin-share span { display: block; height: 100%; background: var(--primary); border-radius: 3px; }
.fin-chips { list-style: none; display: grid; gap: .5rem; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); margin: 0; padding: 0; }
.fin-chips li { display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding: .45rem .65rem; background: var(--bg); border-radius: 8px; }
.fin-chips small { display: block; color: var(--muted); }
.fin-chips b { white-space: nowrap; }
.fin-notes { margin: 0 0 1.5rem; padding-left: 1.1rem; }
.fin-tip { position: fixed; z-index: 50; padding: .25rem .5rem; background: var(--text); color: #fff; border-radius: 6px; font-size: .82rem; pointer-events: none; white-space: nowrap; }
@media (max-width: 640px) {
  .fin-spend-grid { grid-template-columns: 1fr; }
  .fin-pie svg { max-width: 240px; }
  .fin-spark { display: none; }
  .fin-postes .fin-spark { display: none; }
  .fin-detail { padding-left: .25rem; }
  .fin-answer strong { font-size: 1.8rem; }
}
