/* ==========================================================================
   Budget Foyer — feuille de style
   Jetons repris du prototype « Budget Foyer v2 ».
   ========================================================================== */

:root {
  --bg:          #F6F4F0;
  --paper:       #FFFFFF;
  --paper-2:     #FBFAF7;
  --paper-3:     #FCFBF9;
  --sand:        #EFEBE4;

  --ink:         #14171A;
  --ink-2:       #2C3137;
  --muted:       #74787E;
  --muted-2:     #9A9EA4;
  --faint:       #C4C8CE;

  --line:        #E5E1DA;
  --line-soft:   #F4F1EB;
  --line-softer: #F0EDE7;
  --line-dash:   #CFC8BC;

  --green:       #14624A;
  --green-dk:    #0E4635;
  --green-2:     #1E7A5E;
  --mint:        #5FBF9B;
  --mint-bg:     #E8F1ED;

  --gold:        #C2A15A;
  --gold-dk:     #8A6410;
  --amber:       #B47A12;
  --amber-bg:    #FBF1DC;
  --red:         #B0472C;
  --slate:       #6B7280;

  --dark:        #14171A;
  --dark-2:      #1D2126;
  --dark-3:      #252A31;
  --dark-4:      #2A2F36;
  --dark-line:   #2B3037;
  --dark-muted:  #8A8F96;
  --dark-fg:     #F6F4F0;

  --mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --sans: 'IBM Plex Sans', system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  font-family: var(--sans);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--green); text-decoration: none; }
a:hover { color: var(--green-dk); text-decoration: underline; }
input, select, button { font-family: inherit; }
input:focus, select:focus { outline: 2px solid var(--green); outline-offset: 1px; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #DCD7CE; border-radius: 6px; }

h1, h2 { margin: 0; }

/* --------------------------------------------------------------- ossature */

.shell {
  display: grid;
  grid-template-columns: 232px 1fr;
  min-height: 100vh;
  background: var(--bg);
}

.main {
  padding: 30px 38px 72px;
  max-width: 1240px;
  min-width: 0;
}

.screen { display: flex; flex-direction: column; gap: 22px; }
.screen--tight { gap: 18px; }
.screen--loose { gap: 20px; }

/* ---------------------------------------------------------------- sidebar */

.sidebar {
  background: var(--dark);
  color: var(--dark-fg);
  padding: 22px 14px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  position: sticky;
  top: 0;
  height: 100vh;
}

.brand { display: flex; flex-direction: column; gap: 2px; padding: 0 8px; }
.brand__name { font-size: 15px; font-weight: 600; letter-spacing: -0.01em; }
.brand__sub { font-size: 12px; color: var(--dark-muted); }

.nav { display: flex; flex-direction: column; gap: 2px; }
.nav__item {
  padding: 9px 10px;
  border-radius: 7px;
  cursor: pointer;
  font-size: 13.5px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: #A8ADB4;
  border-left: 2px solid transparent;
  transition: background 140ms ease, color 140ms ease;
}
.nav__item:hover { background: #1F242A; color: #E4E6E9; }
.nav__item.is-active {
  background: var(--dark-4);
  color: #FFFFFF;
  font-weight: 600;
  border-left-color: var(--mint);
}
.nav__badge { font-family: var(--mono); font-size: 10.5px; color: #7A7F86; }

.sidebar__foot {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px;
  background: var(--dark-2);
  border-radius: 10px;
}
.sidebar__foot-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--dark-muted);
}
.sidebar__foot-value { font-family: var(--mono); font-size: 19px; font-weight: 600; color: var(--mint); }
.sidebar__foot-note { font-size: 11.5px; color: var(--dark-muted); line-height: 1.4; }

/* ----------------------------------------------------------------- entête */

.head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}
.head__titles { display: flex; flex-direction: column; gap: 6px; }
.eyebrow {
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
}
.title { font-size: 31px; font-weight: 600; letter-spacing: -0.02em; }
.lede { margin: 6px 0 0; font-size: 14px; color: var(--muted); max-width: 680px; line-height: 1.6; }
.lede strong { font-weight: 600; color: var(--ink-2); }

.months {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 4px;
}
.months__tab {
  padding: 7px 14px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  color: var(--muted);
  white-space: nowrap;
}
.months__tab:hover { background: var(--line-soft); }
.months__tab.is-active { background: var(--ink); color: #FFFFFF; font-weight: 600; }
.months__tab.is-active:hover { background: var(--ink); }
.months__tab.is-ghost { color: var(--muted-2); font-style: italic; }
.months__tab.is-ghost.is-active { color: #FFFFFF; font-style: normal; }

/* ----------------------------------------------------------------- cartes */

.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.card--flush { padding: 0; overflow: hidden; }
.card--amber { border-left: 3px solid var(--amber); }
.card--pad-sm { padding: 18px 22px; }
.card--pad-xs { padding: 16px 18px; }
.card__title { font-size: 14.5px; font-weight: 600; }
.card__row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.card__note { font-size: 11.5px; color: var(--muted); }
.card__text { margin: 0; font-size: 13px; color: var(--ink-2); line-height: 1.6; }

.dark-card {
  background: var(--dark);
  color: var(--dark-fg);
  border-radius: 14px;
  padding: 24px 26px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.stack { display: flex; flex-direction: column; gap: 12px; }

.mono { font-family: var(--mono); }
.tnum { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.right { text-align: right; }
.link {
  font-size: 12.5px;
  color: var(--green);
  font-weight: 500;
  cursor: pointer;
  align-self: flex-start;
}
.link:hover { text-decoration: underline; }
.code-inline {
  font-family: var(--mono);
  font-size: 12px;
  background: var(--sand);
  padding: 2px 5px;
  border-radius: 4px;
}

.pill {
  font-size: 10.5px;
  padding: 2px 8px;
  border-radius: 20px;
  white-space: nowrap;
}
.pill--fixe { background: var(--sand); color: #5C616A; }
.pill--var { background: #FBF5E7; color: var(--gold-dk); }
.pill--flag { background: var(--amber-bg); color: var(--gold-dk); }

/* ------------------------------------------------------------ état  vide */

.empty {
  background: var(--paper);
  border: 1px dashed var(--line-dash);
  border-radius: 14px;
  padding: 56px 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  text-align: center;
}
.empty__title { font-size: 19px; font-weight: 600; }
.empty__text { font-size: 14px; color: var(--muted); max-width: 440px; line-height: 1.55; }

.btn {
  border: none;
  background: var(--green);
  color: #FFFFFF;
  padding: 11px 20px;
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
}
.btn:hover { background: var(--green-dk); }
.btn--mt { margin-top: 8px; }

/* -------------------------------------------------------------- virements */

.fund__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.fund__name { font-size: 15px; font-weight: 600; }
.fund__share {
  font-size: 11px;
  color: var(--dark-muted);
  background: var(--dark-3);
  padding: 3px 9px;
  border-radius: 20px;
}
.fund__amount {
  font-family: var(--mono);
  font-size: 40px;
  font-weight: 600;
  letter-spacing: -0.03em;
  color: var(--mint);
}
.fund__caption { font-size: 12.5px; color: var(--dark-muted); }
.fund__lines {
  display: flex;
  flex-direction: column;
  gap: 9px;
  border-top: 1px solid var(--dark-line);
  padding-top: 16px;
}
.fund__line { display: flex; justify-content: space-between; font-size: 12.5px; }
.fund__line span:first-child { color: var(--dark-muted); }
.fund__btn {
  text-align: center;
  padding: 10px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  background: var(--mint);
  color: #0E1A15;
}
.fund__btn.is-done { background: #1B4D3E; color: var(--mint); }

.settle__row { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.settle__amount { font-family: var(--mono); font-size: 26px; font-weight: 600; }
.settle__text { font-size: 13.5px; color: var(--ink-2); line-height: 1.5; max-width: 520px; }
.settle__stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  border-top: 1px solid var(--line-softer);
  padding-top: 16px;
}
.stat { display: flex; flex-direction: column; gap: 4px; }
.stat__label { font-size: 11.5px; color: var(--muted); }
.stat__value { font-family: var(--mono); font-size: 16px; font-weight: 600; }

.joint__row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--line-soft);
  font-size: 13px;
}
.joint__total {
  display: flex;
  justify-content: space-between;
  font-size: 13.5px;
  font-weight: 600;
  padding-top: 4px;
}

/* -------------------------------------------------------------- dashboard */

.hero {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 26px 28px;
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 32px;
  align-items: center;
}
.hero__left { display: flex; flex-direction: column; gap: 14px; }
.hero__amount-row { display: flex; align-items: flex-end; gap: 14px; flex-wrap: wrap; }
.hero__amount {
  font-family: var(--mono);
  font-size: 56px;
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 0.95;
  color: var(--green);
}
.hero__delta { font-size: 13px; padding-bottom: 8px; }
.hero__goal { display: flex; flex-direction: column; gap: 7px; max-width: 430px; }
.hero__goal-legend {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--muted);
  gap: 12px;
}
.hero__right { display: flex; flex-direction: column; gap: 8px; }
.hero__spark-note { font-size: 11.5px; color: var(--muted); line-height: 1.45; }

.bar {
  height: 9px;
  background: var(--line-softer);
  border-radius: 5px;
  overflow: hidden;
}
.bar--thin { height: 6px; border-radius: 4px; }
.bar__fill { height: 100%; background: var(--green); transition: width 300ms ease; }

.kpi {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 15px 18px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}
.kpi__label {
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
}
.kpi__delta { font-size: 11.5px; }
.kpi__value { font-family: var(--mono); font-size: 21px; font-weight: 600; letter-spacing: -0.02em; }

.charts { display: grid; grid-template-columns: 1.3fr 1fr; gap: 14px; }
.legend { display: flex; gap: 14px; font-size: 11.5px; color: var(--muted); }
.legend__item { display: flex; align-items: center; gap: 5px; }
.legend__swatch { width: 9px; height: 9px; border-radius: 2px; background: #C9C2B6; display: inline-block; }
.legend__line { width: 16px; height: 2px; background: var(--green); display: inline-block; }

.combo { position: relative; height: 180px; }
.combo__bars { position: absolute; inset: 0; display: flex; align-items: flex-end; gap: 8px; }
.combo__bar { flex: 1; border-radius: 3px 3px 0 0; transition: height 300ms ease; }
.combo__svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; pointer-events: none; }
.combo__labels { display: flex; gap: 8px; }
.combo__label { flex: 1; text-align: center; font-size: 10.5px; color: var(--muted-2); }
.combo__label.is-active { color: var(--ink); font-weight: 600; }

.catbar { display: flex; flex-direction: column; gap: 4px; }
.catbar__row { display: flex; justify-content: space-between; font-size: 12.5px; gap: 10px; }
.mix { display: flex; height: 11px; border-radius: 6px; overflow: hidden; margin-top: 4px; }
.mix__fixed { background: var(--ink); }
.mix__var { background: var(--gold); }
.mix__legend { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); }

/* ----------------------------------------------------------------- budget */

.budget-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  background: var(--dark);
  color: var(--dark-fg);
  border-radius: 12px;
  padding: 16px 24px;
  flex-wrap: wrap;
}
.budget-head__stats { display: flex; gap: 34px; flex-wrap: wrap; }
.budget-head__stat { display: flex; flex-direction: column; gap: 3px; }
.budget-head__label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--dark-muted);
}
.budget-head__value { font-family: var(--mono); font-size: 18px; font-weight: 600; }
.budget-head__note { font-size: 12px; color: var(--dark-muted); max-width: 240px; line-height: 1.45; }

.bgrid {
  display: grid;
  grid-template-columns: 1fr 120px 118px 118px 96px 26px;
  gap: 12px;
  align-items: center;
}
.colhead {
  padding: 0 22px;
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted-2);
}

.cat { background: var(--paper); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.cat__head { padding: 14px 22px; cursor: pointer; background: var(--paper); transition: background 400ms ease; }
.cat__head.is-open { background: var(--paper-2); }
.cat__head.is-flash { background: var(--mint-bg); }
.cat__name-cell { display: flex; align-items: center; gap: 11px; flex-wrap: wrap; }
.cat__chevron { font-size: 11px; color: #A0A4AA; font-family: var(--mono); }
.cat__name { font-size: 14.5px; font-weight: 600; }
.cat__charge { font-size: 11.5px; color: var(--muted); }
.cat__prevu { font-family: var(--mono); font-size: 13.5px; color: var(--muted); }
.cat__reel { font-family: var(--mono); font-size: 15px; font-weight: 600; }
.cat__ecart { font-family: var(--mono); font-size: 13px; }
.cat__body {
  border-top: 1px solid var(--sand);
  padding: 4px 22px 15px;
  display: flex;
  flex-direction: column;
}

.item { padding: 7px 0; border-bottom: 1px solid var(--line-soft); }

/* Le libellé est un champ, mais ne se signale comme tel qu'au survol :
   la colonne doit rester une liste lisible, pas un formulaire. */
.item__label {
  font-size: 13.5px;
  color: var(--ink-2);
  margin-left: 22px;
  width: calc(100% - 22px);
  padding: 4px 7px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
}
.item__label:hover { border-color: var(--line); background: var(--paper-3); }
.item__label:focus { border-color: var(--line); background: var(--paper); }

.item__del {
  background: none;
  border: none;
  padding: 0;
  font-size: 15px;
  line-height: 1;
  color: transparent;
  cursor: pointer;
  transition: color 120ms ease;
}
.item:hover .item__del { color: #B9BDC2; }
.item__del:hover, .item__del:focus { color: var(--red); }
.item__charge { font-size: 11.5px; color: var(--muted); }
.item__ecart { font-family: var(--mono); font-size: 12.5px; }
.item__add { margin-top: 11px; padding-left: 22px; }

.num-input {
  width: 100%;
  text-align: right;
  font-family: var(--mono);
  font-size: 13px;
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--paper-3);
  color: var(--ink);
  transition: background 400ms ease;
}
.num-input--prevu { border-color: var(--sand); background: var(--paper); color: var(--muted); }
.num-input.is-flash { background: var(--mint-bg); }

/* ------------------------------------------------------------ répartition */

.legend-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 18px 22px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.legend-card--pay { border-top: 3px solid var(--slate); }
.legend-card--charge { border-top: 3px solid var(--green); }
.legend-card__title { font-size: 12.5px; font-weight: 600; }
.legend-card__text { font-size: 12.5px; color: var(--muted); line-height: 1.55; }

.total-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  border-left: 3px solid var(--slate);
}
.total-card__label {
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
}
.total-card__amount { font-family: var(--mono); font-size: 21px; font-weight: 600; }
.total-card__note { font-size: 11.5px; color: var(--muted); }

.sgrid {
  display: grid;
  grid-template-columns: 1fr 150px 24px 170px 110px;
  gap: 10px;
  align-items: center;
}
.group__head {
  padding: 12px 22px;
  background: var(--paper-2);
  border-bottom: 1px solid var(--line);
}
.group__name { font-size: 13.5px; font-weight: 600; }
.group__col {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--slate);
}
.group__col--charge { color: var(--green); }
.group__total { text-align: right; font-family: var(--mono); font-size: 13.5px; font-weight: 600; }
.group__row { padding: 8px 22px; border-bottom: 1px solid var(--line-soft); }
.group__label { font-size: 13.5px; color: var(--ink-2); }
.group__arrow { text-align: center; font-size: 12px; color: var(--faint); }
.group__amount { text-align: right; font-family: var(--mono); font-size: 13px; }

.pick {
  font-size: 12.5px;
  padding: 5px 7px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--paper-3);
  color: var(--ink);
  width: 100%;
}
.pick--pay { border-left: 2px solid var(--slate); }
.pick--charge { border-left: 2px solid var(--green); }

/* ------------------------------------------------------------- historique */

.hgrid { display: grid; grid-template-columns: 1.2fr repeat(5, 1fr) 84px; gap: 10px; }
.table__head {
  padding: 12px 22px;
  background: var(--paper-2);
  border-bottom: 1px solid var(--line);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
}
.hrow {
  padding: 9px 22px;
  border-bottom: 1px solid var(--line-soft);
  font-family: var(--mono);
  font-size: 13px;
  background: var(--paper);
}
.hrow.is-current { background: var(--paper-2); }
.hrow__month {
  font-family: var(--sans);
  display: flex;
  align-items: center;
  gap: 8px;
}
.hrow.is-current .hrow__month { font-weight: 600; }
.tag-live {
  font-size: 9.5px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--gold-dk);
  background: var(--amber-bg);
  padding: 2px 6px;
  border-radius: 20px;
  white-space: nowrap;
}

/* ------------------------------------------------------------- projections */

.proj__controls { display: flex; gap: 28px; align-items: flex-end; flex-wrap: wrap; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field__label {
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
}
.field__input {
  width: 140px;
  font-family: var(--mono);
  font-size: 15px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--paper-3);
  color: var(--ink);
}
.proj__end { margin-left: auto; text-align: right; }
.proj__end-value { font-family: var(--mono); font-size: 26px; font-weight: 600; color: var(--green); }
.proj__chart {
  height: 230px;
  border-top: 1px solid var(--line-softer);
  border-bottom: 1px solid var(--line-softer);
  padding: 8px 0;
}
.proj__ticks { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--muted); }

.egrid { display: grid; grid-template-columns: 1fr 1.4fr 1fr 130px 40px; gap: 12px; align-items: center; }
.erow { padding: 10px 22px; border-bottom: 1px solid var(--line-soft); }
.erow__date { font-size: 13px; font-family: var(--mono); }
.erow__name { font-size: 13.5px; }
.erow__type { font-size: 11px; padding: 3px 9px; border-radius: 20px; justify-self: start; }
.erow__impact { text-align: right; font-family: var(--mono); font-size: 13.5px; }
.erow__remove {
  text-align: right;
  font-size: 15px;
  color: #B9BDC2;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  justify-self: end;
}
.erow__remove:hover { color: var(--red); }
.erow__add { padding: 13px 22px; display: flex; gap: 10px; align-items: center; }

/* ----------------------------------------------------------------- projets */

.pgrid {
  display: grid;
  grid-template-columns: 1.5fr 96px 96px 96px 1.1fr 108px 110px;
  gap: 10px;
  align-items: center;
}
.prow { padding: 11px 22px; border-bottom: 1px solid var(--line-soft); }
.prow__name-cell { display: flex; align-items: center; gap: 9px; }
.prow__dot { width: 7px; height: 7px; border-radius: 2px; flex: none; }
.prow__name { font-size: 13.5px; }
.prow__charge { font-size: 10.5px; color: var(--muted-2); }
.prow__num { text-align: right; font-family: var(--mono); font-size: 13px; }
.prow__progress { display: flex; align-items: center; gap: 8px; }
.prow__pct { font-size: 11px; color: var(--muted); font-family: var(--mono); }
.prow__when { text-align: right; font-size: 12px; color: var(--muted); }
.ptotal { padding: 13px 22px; background: var(--paper-2); font-size: 13px; font-weight: 600; }

/* -------------------------------------------------------------- simulation */

.sim-layout { display: grid; grid-template-columns: 1fr 296px; gap: 14px; align-items: start; }
.simgrid { display: grid; grid-template-columns: 1.2fr 90px 1fr 106px 96px; gap: 12px; align-items: center; }
.simrow { padding: 10px 22px; border-bottom: 1px solid var(--line-soft); }
.simrow__name { font-size: 13.5px; }
.simrow__kind { font-size: 10.5px; color: var(--muted-2); }
.simrow__kind--var { color: var(--gold-dk); }
.simrow__num { text-align: right; font-family: var(--mono); font-size: 13px; }
.slider { width: 100%; accent-color: var(--green); }
.slider:disabled { opacity: 0.35; }

.sim-panel {
  background: var(--dark);
  color: var(--dark-fg);
  border-radius: 12px;
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  position: sticky;
  top: 30px;
}
.sim-panel__label {
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--dark-muted);
}
.sim-panel__gain { font-family: var(--mono); font-size: 30px; font-weight: 600; color: var(--mint); }
.sim-panel__block {
  display: flex;
  flex-direction: column;
  gap: 10px;
  border-top: 1px solid var(--dark-line);
  padding-top: 16px;
}
.sim-panel__row { display: flex; justify-content: space-between; font-size: 12.5px; }
.sim-panel__row span:first-child { color: var(--dark-muted); }
.sim-panel__note {
  font-size: 12px;
  color: var(--dark-muted);
  line-height: 1.55;
  border-top: 1px solid var(--dark-line);
  padding-top: 16px;
}
.sim-panel__reset {
  font-size: 12.5px;
  color: var(--mint);
  cursor: pointer;
  font-weight: 500;
  background: none;
  border: none;
  padding: 0;
  text-align: left;
}

/* -------------------------------------------------------------- paramètres */

.member {
  display: grid;
  grid-template-columns: 1fr 90px 96px;
  gap: 12px;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--line-soft);
}
.member__name { font-size: 13.5px; font-weight: 500; }
.member__role { font-size: 11px; color: var(--muted); }
.member__income { text-align: right; font-family: var(--mono); font-size: 13.5px; }
.member__share { text-align: right; font-size: 11.5px; color: var(--muted); }
.hint { font-size: 12px; color: var(--muted); line-height: 1.5; }

.account {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--line-soft);
}
.account__name { font-size: 13.5px; }
.account__right { display: flex; align-items: center; gap: 10px; }
.account__flow { font-family: var(--mono); font-size: 12.5px; color: var(--muted); }

.remap { display: grid; grid-template-columns: 1fr 1fr; gap: 0 26px; }
.remap__row {
  display: grid;
  grid-template-columns: 1fr 18px 1fr;
  gap: 10px;
  align-items: center;
  padding: 9px 0;
  border-bottom: 1px solid var(--line-soft);
}
.remap__from { font-size: 12.5px; color: var(--muted-2); text-decoration: line-through; }
.remap__arrow { font-size: 12px; color: var(--faint); }
.remap__to { font-size: 12.5px; color: var(--ink); }

.import-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.import-stat {
  background: var(--paper-2);
  border: 1px solid var(--sand);
  border-radius: 9px;
  padding: 12px 14px;
  display: flex;
  align-items: baseline;
  gap: 9px;
}
.import-stat__value { font-family: var(--mono); font-size: 19px; font-weight: 600; }
.import-stat__label { font-size: 11.5px; color: var(--muted); line-height: 1.35; }
.check {
  background: var(--mint-bg);
  border-radius: 9px;
  padding: 12px 14px;
  font-size: 12.5px;
  color: var(--green);
  line-height: 1.55;
}

.rule {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 14px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line-soft);
  align-items: center;
}
.rule__formula { font-family: var(--mono); font-size: 11.5px; color: var(--red); }
.rule__meaning { font-size: 12.5px; color: var(--ink-2); line-height: 1.5; }

/* ------------------------------------------- bandeau d'échec d'écriture */

.alert {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  justify-content: space-between;
  background: #FDF3F0;
  border: 1px solid #E8C4B8;
  border-left: 3px solid var(--red);
  border-radius: 12px;
  padding: 16px 20px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}
.alert__body { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.alert__title { font-size: 13.5px; font-weight: 600; color: #7E2F19; }
.alert__text { font-size: 12.5px; color: var(--ink-2); line-height: 1.5; max-width: 620px; }
.alert__detail {
  font-family: var(--mono);
  font-size: 11px;
  color: #97614F;
  margin-top: 2px;
}
.alert__actions { display: flex; align-items: center; gap: 14px; flex: none; }
.btn--sm { padding: 7px 14px; font-size: 12.5px; }

/* ------------------------------------------------- connexion & chargement */

.gate {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  padding: 24px;
}
.gate__card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 34px 36px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 340px;
  max-width: 100%;
}
.gate__brand { font-size: 19px; font-weight: 600; letter-spacing: -0.01em; }
.gate__sub { font-size: 12.5px; color: var(--muted); }
.gate__input { width: 100%; }
.gate__error { font-size: 12.5px; color: var(--red); }
.gate .btn { margin-top: 6px; }

/* -------------------------------------------------- pastille de synchro */

.sync {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 0 8px;
  font-size: 11px;
  color: var(--dark-muted);
}
.sync__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--mint);
  flex: none;
}
.sync--saving .sync__dot { background: var(--gold); animation: sync-pulse 1s ease infinite; }
.sync--error .sync__dot { background: var(--red); animation: sync-pulse 1s ease infinite; }
.sync--error { color: #D8A79A; }

@keyframes sync-pulse {
  50% { opacity: 0.35; }
}

/* ------------------------------------------------------------- responsive */

@media (max-width: 1180px) {
  .charts, .sim-layout, .hero { grid-template-columns: 1fr; }
  .hero { gap: 22px; }
  .sim-panel { position: static; }
}

@media (max-width: 980px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; }
  .nav { display: grid; grid-template-columns: repeat(3, 1fr); }
  .main { padding: 22px 18px 56px; }
  .grid-2, .grid-3, .grid-4, .remap, .import-stats { grid-template-columns: 1fr; }
  .scroll-x { overflow-x: auto; }
  .scroll-x > * { min-width: 780px; }
}
