/* ── Finance module ────────────────────────────────────────────────────────── */
.fin-page {
  max-width: 1100px;
}

.fin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 18px;
}

.fin-header h2 {
  margin: 0;
  font-size: 1.375rem;
  font-weight: 800;
  color: var(--text);
}

.fin-add-btn {
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--radius-md);
  padding: 10px 16px;
  font-size: 0.875rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s;
}
.fin-add-btn:hover { background: var(--primary-hover); }

.fin-month-nav {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 6px 10px;
}
.fin-month-nav__btn {
  width: 26px; height: 26px;
  border-radius: 50%;
  border: none;
  background: var(--surface-soft);
  color: var(--text);
  font-size: 1rem;
  cursor: pointer;
}
.fin-month-nav__btn:disabled { opacity: 0.35; cursor: default; }
.fin-month-nav__label { font-weight: 700; font-size: 0.875rem; color: var(--text); min-width: 110px; text-align: center; }

/* ── Stat cards ────────────────────────────────────────────────────────────── */
.fin-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 10px;
  margin-bottom: 20px;
}

.fin-stat-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 16px;
  box-shadow: 0 2px 8px rgba(15,23,42,0.04);
}
.fin-stat-card__icon { font-size: 1.375rem; margin-bottom: 8px; display: block; }
.fin-stat-card__val { font-size: 1.625rem; font-weight: 800; color: var(--text); line-height: 1; display: block; }
.fin-stat-card__label { font-size: 0.8125rem; color: var(--muted); margin-top: 4px; font-weight: 600; display: block; }
.fin-stat-card__sub { font-size: 0.75rem; color: var(--muted); margin-top: 2px; display: block; }
.fin-stat-card--expense .fin-stat-card__val { color: var(--bad); }
.fin-stat-card--income .fin-stat-card__val { color: var(--ok); }

/* ── Sections ──────────────────────────────────────────────────────────────── */
.fin-section { margin-bottom: 22px; }
.fin-section__title { font-size: 0.9375rem; font-weight: 700; color: var(--text); margin-bottom: 10px; }
.fin-section__title--sub { font-size: 0.75rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }

.fin-nobudget-list { display: flex; flex-direction: column; gap: 1px; background: var(--line); border-radius: var(--radius-md); overflow: hidden; }
.fin-nobudget-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: var(--surface);
  padding: 7px 12px;
  font-size: 0.75rem;
  color: var(--muted);
  cursor: pointer;
  transition: background 0.15s;
}
.fin-nobudget-row:hover { background: var(--surface-soft); color: var(--text); }
.fin-nobudget-row__amt { font-weight: 700; }

.fin-empty-hint {
  background: var(--primary-soft);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  font-size: 0.8125rem;
  color: var(--text);
  margin-bottom: 20px;
}

.fin-section__title-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.fin-section__title-row .fin-section__title { margin-bottom: 0; }
.fin-link-btn {
  background: none;
  border: none;
  color: var(--primary);
  font-size: 0.8125rem;
  font-weight: 700;
  cursor: pointer;
  padding: 0;
}
.fin-link-btn:hover { text-decoration: underline; }

/* ── Budgets temporaires (projets) ────────────────────────────────────────── */
.fin-project-list { display: flex; flex-direction: column; gap: 10px; }
.fin-project-row {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.fin-project-row--active { border-color: var(--primary); box-shadow: 0 2px 8px rgba(15,23,42,0.06); }
.fin-project-row--done { opacity: 0.6; }
.fin-project-row__hd { display: flex; align-items: center; gap: 12px; padding: 12px 14px; }
.fin-project-row__info { flex: 1; min-width: 0; }
.fin-project-row__name { font-size: 0.875rem; font-weight: 700; color: var(--text); }
.fin-project-row__dates { font-size: 0.75rem; color: var(--muted); margin-top: 2px; }
.fin-project-status {
  font-size: 0.6875rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
  white-space: nowrap;
}
.fin-project-status--active { background: var(--ok-bg); color: var(--ok); }
.fin-project-status--upcoming { background: var(--warn-bg); color: var(--warn); }
.fin-project-status--done { background: var(--surface-soft); color: var(--muted); }

/* ── Abonnements ───────────────────────────────────────────────────────────── */
.fin-sub-note {
  background: var(--primary-soft);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  font-size: 0.8125rem;
  color: var(--text);
}
.fin-checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
}
.fin-stopped-subs { margin-top: 14px; }
.fin-stopped-subs__title { font-size: 0.75rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 8px; }

/* ── Budget bars ───────────────────────────────────────────────────────────── */
.fin-budget-list { display: flex; flex-direction: column; gap: 10px; }
.fin-budget-row {
  display: grid;
  grid-template-columns: 150px 1fr 150px;
  align-items: center;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  transition: background 0.15s, border-color 0.15s;
}
.fin-budget-row--clickable { cursor: pointer; }
.fin-budget-row--clickable:hover { border-color: var(--primary); background: var(--primary-soft); }
.fin-budget-row__cat { font-size: 0.8125rem; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fin-budget-row__bar { height: 8px; border-radius: 999px; background: rgba(0,0,0,0.06); overflow: hidden; }
.fin-budget-row__bar-fill { height: 100%; border-radius: 999px; transition: width 0.3s; }
.fin-budget-row__bar-fill--ok   { background: var(--ok); }
.fin-budget-row__bar-fill--warn { background: var(--warn); }
.fin-budget-row__bar-fill--bad  { background: var(--bad); }
.fin-budget-row__amt { font-size: 0.75rem; color: var(--muted); text-align: right; white-space: nowrap; }

/* ── Recent transactions ──────────────────────────────────────────────────── */
.fin-recent-list { display: flex; flex-direction: column; gap: 2px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; }
.fin-recent-row { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-bottom: 1px solid var(--line); transition: background 0.15s; }
.fin-recent-row:last-child { border-bottom: none; }
.fin-recent-row--clickable { cursor: pointer; }
.fin-recent-row--clickable:hover { background: var(--surface-soft); }
.fin-recent-row__icon { width: 34px; height: 34px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 1rem; flex-shrink: 0; }
.fin-recent-row__info { flex: 1; min-width: 0; }
.fin-recent-row__cat { font-size: 0.8125rem; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fin-recent-row__meta { font-size: 0.75rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fin-recent-row__amt { font-size: 0.875rem; font-weight: 700; flex-shrink: 0; }
.fin-recent-row__amt--expense { color: var(--bad); }
.fin-recent-row__amt--income { color: var(--ok); }
.fin-recent-row__amt--refund { color: var(--ok); }

/* ── Filters ───────────────────────────────────────────────────────────────── */
.fin-filters { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; align-items: center; }
.fin-filter-select {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 6px 12px;
  height: 36px;
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--text);
  font-family: inherit;
  cursor: pointer;
}

.fin-chip-group { display: flex; flex-wrap: wrap; gap: 6px; }
.fin-chip {
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.fin-chip:hover { border-color: var(--primary); }
.fin-chip--active { background: var(--primary); border-color: var(--primary); color: #fff; }

.fin-custom-range { display: flex; align-items: center; gap: 8px; color: var(--muted); }

/* ── Sum bar ───────────────────────────────────────────────────────────────── */
.fin-sum-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  background: var(--surface-soft);
  border-radius: var(--radius-md);
  padding: 10px 16px;
  margin-bottom: 14px;
  font-size: 0.8125rem;
  color: var(--muted);
}
.fin-sum-bar__expense { color: var(--bad); font-weight: 700; }
.fin-sum-bar__income { color: var(--ok); font-weight: 700; }
.fin-sum-bar__refund { color: var(--ok); font-weight: 600; opacity: 0.85; }

/* ── Table ─────────────────────────────────────────────────────────────────── */
.fin-table-scroll { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); }
.fin-table { width: 100%; border-collapse: collapse; font-size: 0.8125rem; }
.fin-table thead th { text-align: left; padding: 10px 14px; font-size: 0.6875rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); border-bottom: 1px solid var(--line); white-space: nowrap; }
.fin-table tbody td { padding: 10px 14px; border-bottom: 1px solid var(--line); color: var(--text); white-space: nowrap; }
.fin-table tbody tr:last-child td { border-bottom: none; }
.fin-table__amt { font-weight: 700; }
.fin-table__amt--expense { color: var(--bad); }
.fin-table__amt--income { color: var(--ok); }
.fin-table__amt--refund { color: var(--ok); }
.fin-table__note { color: var(--muted); white-space: normal; max-width: 220px; }
.fin-refund-hint { font-size: 0.6875rem; color: var(--ok); font-weight: 600; white-space: nowrap; margin-top: 2px; }
.fin-table__actions-cell { width: 72px; }
.fin-table__actions { display: flex; gap: 4px; min-height: 28px; }

.fin-table__row--virtual td { color: var(--muted); font-style: italic; }
.fin-table__row--virtual .fin-table__amt { opacity: 0.75; }
.fin-virtual-badge {
  display: inline-block;
  font-size: 0.625rem;
  font-weight: 700;
  font-style: normal;
  background: var(--primary-soft);
  color: var(--primary);
  padding: 1px 7px;
  border-radius: 999px;
  white-space: nowrap;
}
.fin-virtual-badge--real { background: none; padding: 0; font-size: 0.75rem; }

.fin-cat-chip { display: inline-block; padding: 3px 9px; border-radius: 999px; font-size: 0.75rem; font-weight: 600; white-space: nowrap; }

.fin-icon-btn {
  width: 28px; height: 28px;
  border-radius: 50%;
  border: none;
  background: var(--surface-soft);
  cursor: pointer;
  font-size: 0.8125rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}
.fin-icon-btn:hover { background: rgba(0,0,0,0.06); }

/* ── Modals: type chips / emoji / color picker ────────────────────────────── */
.fin-field-row { display: flex; gap: 10px; }
.fin-field-row > .field { flex: 1; min-width: 0; }
.fin-type-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.fin-type-chip {
  flex: 1 1 100px;
  background: var(--surface-soft);
  border: 1.5px solid var(--line);
  border-radius: var(--radius-md);
  padding: 10px 6px;
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--muted);
  cursor: pointer;
  text-align: center;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.fin-type-chip--active { background: var(--primary); border-color: var(--primary); color: #fff; }

.fin-emoji-row { display: flex; flex-wrap: wrap; gap: 6px; }
.fin-emoji-btn {
  width: 36px; height: 36px;
  border-radius: 10px;
  border: 1.5px solid var(--line);
  background: var(--surface-soft);
  font-size: 1.1rem;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.fin-emoji-btn--active { border-color: var(--primary); background: var(--primary-soft); }
.fin-emoji-custom {
  padding: 0;
  text-align: center;
  box-sizing: border-box;
  font-family: inherit;
}
.fin-emoji-custom::placeholder { font-size: 0.95rem; opacity: 0.6; }

.fin-color-row { display: flex; flex-wrap: wrap; gap: 8px; }
.fin-color-btn {
  width: 28px; height: 28px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
}
.fin-color-btn--active { border-color: var(--text); }

/* ── Pièce jointe (transactions) ───────────────────────────────────────────── */
.fin-attachment-field {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 6px;
  border-top: 1px solid var(--line);
}
.fin-attachment-field > label {
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--text);
}
.fin-attachment-optional {
  font-weight: 500;
  color: var(--muted);
  font-size: 0.75rem;
}
.fin-attachment-preview-wrap:empty { display: none; }
.fin-attachment-preview-wrap img {
  max-width: 160px;
  max-height: 160px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  display: block;
}
.fin-attachment-file-chip {
  display: inline-block;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 8px 12px;
  font-size: 0.8125rem;
  color: var(--text);
}
.fin-attachment-link { text-decoration: none; }

/* ── Budgets page: category rows ──────────────────────────────────────────── */
.fin-budget-edit-list { display: flex; flex-direction: column; gap: 8px; }
.fin-budget-edit-row {
  display: grid;
  grid-template-columns: 160px 1fr 130px auto;
  align-items: center;
  gap: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 10px 14px;
}
.fin-budget-edit-row__cat { display: flex; align-items: center; gap: 8px; font-size: 0.8125rem; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fin-budget-edit-row__cat--clickable { cursor: pointer; }
.fin-budget-edit-row__cat--clickable:hover { color: var(--primary); text-decoration: underline; }
.fin-budget-edit-row__bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.fin-budget-edit-row__bar .fin-budget-row__bar { flex: 1; min-width: 60px; }
.fin-budget-edit-row__pct { font-size: 0.75rem; color: var(--muted); font-weight: 700; width: 36px; text-align: right; }
.fin-budget-edit-row__nobudget { font-size: 0.75rem; color: var(--muted); font-style: italic; }
.fin-budget-edit-row__actions { display: flex; gap: 4px; }
.fin-budget-override-badge {
  font-size: 0.625rem;
  font-weight: 700;
  background: var(--primary-soft);
  color: var(--primary);
  padding: 1px 7px;
  border-radius: 999px;
  white-space: nowrap;
}

.fin-cat-swatch {
  width: 26px; height: 26px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.8125rem;
  flex-shrink: 0;
}

/* ── Reports: charts ───────────────────────────────────────────────────────── */
.fin-chart-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: 0 2px 8px rgba(15,23,42,0.04);
}
.fin-chart-card .fin-section__title { margin-bottom: 14px; }

.fin-donut-wrap { display: flex; justify-content: center; margin-bottom: 16px; }

.fin-legend-list { display: flex; flex-direction: column; gap: 6px; }
.fin-legend-item { display: flex; align-items: center; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--line); font-size: 0.8125rem; }
.fin-legend-item:last-child { border-bottom: none; }
.fin-legend-item__label { flex: 1; color: var(--text); font-weight: 600; }
.fin-legend-item__val { color: var(--text); font-weight: 700; }
.fin-legend-item__pct { color: var(--muted); font-weight: 500; }

.fin-legend-row { display: flex; align-items: center; justify-content: center; gap: 4px; margin-top: 10px; font-size: 0.8125rem; color: var(--muted); }
.fin-legend-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }

/* ── Empty states ──────────────────────────────────────────────────────────── */
.fin-empty { text-align: center; padding: 40px 20px; color: var(--muted); }
.fin-empty__icon { font-size: 2.5rem; margin-bottom: 12px; display: block; }
.fin-empty__text { font-size: 1rem; font-weight: 600; color: var(--text); }

@media (max-width: 640px) {
  .fin-budget-row, .fin-budget-edit-row { grid-template-columns: 1fr; gap: 8px; }
  .fin-table thead th, .fin-table tbody td { padding: 8px 10px; }

  .fin-header { align-items: stretch; }
  .fin-header h2 { flex: 1 1 100%; }
  .fin-header .fin-month-nav { flex: 1; justify-content: center; }
  .fin-header .fin-add-btn { flex: 1; text-align: center; }

  .fin-stats-grid { grid-template-columns: repeat(2, 1fr); }
  .fin-stat-card { padding: 12px; }
  .fin-stat-card__val { font-size: 1.375rem; }

  .fin-filters { gap: 8px; }
  .fin-filter-select { flex: 1 1 auto; min-width: 0; }
  .fin-custom-range { flex-wrap: wrap; }

  .fin-sum-bar { padding: 10px 12px; gap: 10px; }

  .fin-field-row { flex-direction: column; gap: 14px; }

  .fin-project-row__hd { flex-wrap: wrap; row-gap: 8px; }
  .fin-project-row__info { flex-basis: 140px; }

  .fin-budget-edit-row__actions { justify-content: flex-end; }

  .fin-chart-card { padding: 14px; }
  .fin-legend-item__label { white-space: normal; }

  .fin-nobudget-row { font-size: 0.8125rem; }
}

/* ── Période partagée, recherche, montants, règles (02/11/2026) ── */
.fin-period { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.fin-period__label { font-weight: 600; font-size: 14px; }
.fin-search { min-width: 220px; flex: 1 1 220px; }
.fin-amount-range { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.fin-amount-range .field__input { width: 80px; }
.fin-amount-hint { font-size: 12px; font-weight: 600; color: var(--primary); min-height: 0; margin-top: 4px; }
.fin-amount-hint:empty { display: none; }
.fin-amount-hint--bad { color: var(--danger, #dc2626); }
.fin-budget-edit-row__ro { font-size: 13px; color: var(--muted); }
.fin-rule-row { display: flex; align-items: center; gap: 8px; padding: 6px 0; font-size: 14px; border-bottom: 1px solid var(--line, #e5e7eb); }
.fin-rule-row .fin-icon-btn { margin-left: auto; }
.fin-rule-row__tag { font-size: 11px; color: var(--muted); }
.fin-rule-add { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.fin-rule-add .field__input { flex: 1 1 160px; }

/* ── Ticket divisé, bilan du mois ── */
.fin-split-row { display: grid; grid-template-columns: 1fr 100px 32px; gap: 8px; align-items: center; }
.fin-split-rest { font-size: 12.5px; font-weight: 700; color: var(--danger, #dc2626); }
.fin-split-rest--ok { color: var(--ok, #16a34a); }
.fin-mr { display: grid; gap: 12px; }
.fin-mr-tip { display: flex; gap: 8px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; background: color-mix(in srgb, var(--primary) 10%, transparent); font-weight: 600; font-size: 14px; }
.fin-mr-delta { font-size: 11.5px; font-weight: 700; }
.fin-mr-delta.ok, .fin-mr .ok { color: var(--ok, #16a34a); }
.fin-mr-delta.bad, .fin-mr .bad { color: var(--danger, #dc2626); }
.fin-mr-row { display: flex; align-items: center; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--line, #e5e7eb); font-size: 14px; }
.fin-mr-row__main { flex: 1; display: grid; }
.fin-mr-row__main small { color: var(--muted); font-size: 12px; }
.fin-upcoming-btn { display: inline-flex; align-items: center; gap: 6px; margin: 4px 0 8px; }
.fin-table__row--upcoming { opacity: .45; }

/* ── Dépenses partagées ── */
.fin-se { display: grid; gap: 10px; }
.fin-se-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line, #e5e7eb); font-size: 14px; width: 100%; }
.fin-se-row--btn { background: none; border-left: 0; border-right: 0; border-top: 0; cursor: pointer; color: inherit; font: inherit; text-align: left; }
.fin-se-row__main { flex: 1; display: grid; min-width: 0; }
.fin-se-row__main small { color: var(--muted); font-size: 12px; }
.fin-se-ok { color: var(--ok, #16a34a); }
.fin-se-bad { color: var(--danger, #dc2626); }
.fin-se-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.fin-se-pay { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.fin-se-pay .field__input:nth-child(2) { grid-column: span 1; }

/* ── À venir · Épargne · Abonnements ── */
.fin-up-line { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: 13px; color: var(--muted); padding: 3px 0; }
.fin-up-line b { color: var(--text); }
.fin-up-line--head { font-size: 14px; color: var(--text); margin-bottom: 4px; }
.fin-up-ltl__top { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 8px; }
.fin-up-ltl__big { font-size: 1.9rem; font-weight: 800; color: var(--text); }
.fin-up-ltl__day { display: grid; text-align: right; }
.fin-up-ltl__day small { color: var(--muted); font-size: 12px; }
.fin-up-dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.fin-sv-bar { height: 8px; border-radius: 99px; background: var(--line, #e5e7eb); overflow: hidden; }
.fin-sv-bar span { display: block; height: 100%; background: var(--primary, #4f46e5); border-radius: 99px; }
.fin-sv-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.fin-sub-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 12px; color: var(--muted); margin-top: 6px; }
.fin-warn { color: var(--warn, #d97706); }
.fin-danger-btn { color: var(--danger, #dc2626); border-color: currentColor; }
#panel-finance-upcoming .fin-section, #panel-finance-savings .fin-section, #panel-finance-subscriptions .fin-section {
  background: var(--surface, #fff); border: 1px solid var(--line, #e5e7eb); border-radius: 16px; padding: 14px 16px; margin-bottom: 12px; }
#panel-finance-upcoming .fin-se-row:last-child { border-bottom: 0; }
#panel-finance-savings details.fin-section summary { cursor: pointer; font-weight: 700; font-size: 14px; }
#panel-finance-savings .fin-header h2 svg { width: 18px; height: 18px; vertical-align: -2px; }

/* ── Ajout rapide · Reste à vivre · Taux d'épargne · Restes ── */
.fin-quick { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line, #e5e7eb); background: var(--surface, #fff); border-radius: 12px; padding: 6px 6px 6px 12px; margin-bottom: 4px; }
.fin-quick__icon svg { width: 16px; height: 16px; color: var(--primary); display: block; }
.fin-quick__input { flex: 1; min-width: 0; border: 0; background: none; font: inherit; font-size: 15px; color: var(--text); outline: none; padding: 6px 0; }
.fin-quick__go { border: 0; background: var(--primary, #1f3a5a); color: #fff; border-radius: 9px; padding: 7px 12px; font-weight: 700; cursor: pointer; }
.fin-quick__msg { font-size: 13px; min-height: 0; margin: 2px 0 10px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.fin-quick__msg:empty { margin: 0 0 8px; }
.fin-quick__msg svg { width: 14px; height: 14px; vertical-align: -2px; }
.fin-ltl { display: flex; align-items: center; gap: 16px; background: var(--surface, #fff); border: 1px solid var(--line, #e5e7eb); border-radius: 16px; padding: 14px 16px; margin-bottom: 12px; }
.fin-ltl__ring { width: 92px; height: 92px; flex: none; }
.fin-ltl__per { font-size: 17px; font-weight: 800; fill: var(--text); }
.fin-ltl__unit { font-size: 10px; font-weight: 600; fill: var(--muted); }
.fin-ltl__big { font-size: 1.6rem; font-weight: 800; color: var(--text); }
.fin-sr { display: flex; gap: 4px; align-items: stretch; height: 170px; }
.fin-sr__col { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; font-size: 10px; }
.fin-sr__top, .fin-sr__bot { flex: 1; width: 100%; display: flex; justify-content: center; }
.fin-sr__top { align-items: flex-end; border-bottom: 1px solid var(--line, #e5e7eb); }
.fin-sr__bot { align-items: flex-start; }
.fin-sr__top span, .fin-sr__bot span { width: 70%; max-width: 26px; border-radius: 4px; background: var(--primary, #1f3a5a); display: block; }
.fin-sr__bot span { background: var(--danger, #dc2626); }
.fin-sr__col small { color: var(--muted); margin-top: 2px; }
.fin-sr__col b { font-size: 10px; white-space: nowrap; }
.fin-lo { background: var(--surface, #fff); border: 1px solid var(--line, #e5e7eb); border-radius: 16px; padding: 14px 16px; margin-bottom: 12px; }
.fin-lo-form { display: grid; gap: 10px; }
.fin-lo-opt { display: flex; gap: 10px; align-items: flex-start; border: 1px solid var(--line, #e5e7eb); border-radius: 12px; padding: 10px 12px; cursor: pointer; }
.fin-lo-opt > span { display: grid; gap: 6px; flex: 1; min-width: 0; }
.fin-lo-opt small { color: var(--muted); font-size: 12px; }
.fin-lo-opt input[type=radio] { margin-top: 3px; }
.fin-lo-opt:has(input:checked) { border-color: var(--primary, #1f3a5a); }
@media (max-width: 560px) {
  .fin-sr__col b { display: none; }
  .fin-ltl { gap: 12px; padding: 12px; }
  .fin-ltl__ring { width: 76px; height: 76px; }
  .fin-ltl__big { font-size: 1.3rem; }
}

/* ── Calendrier des abonnements ── */
.fin-subbadge { display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; color: #fff; font-weight: 800; flex: none; border: 1px solid var(--surface, #fff); line-height: 1; }
.fin-scal__nav { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.fin-scal__nav div { display: grid; text-align: center; }
.fin-scal__nav small { color: var(--muted); font-size: 12px; }
.fin-scal__grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.fin-scal__h { text-align: center; font-size: 11px; font-weight: 700; color: var(--muted); padding-bottom: 2px; }
.fin-scal__d { min-height: 50px; border: 1px solid transparent; border-radius: 10px; background: none; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 5px 0; font: inherit; font-size: 13px; color: var(--text); cursor: pointer; }
.fin-scal__d:disabled { cursor: default; }
.fin-scal__d.is-today { border-color: var(--primary, #1f3a5a); font-weight: 800; color: var(--primary); }
.fin-scal__d.is-sel { background: color-mix(in srgb, var(--primary, #1f3a5a) 12%, transparent); }
.fin-scal__b { display: flex; align-items: center; min-height: 16px; }
.fin-scal__b .fin-subbadge + .fin-subbadge { margin-left: -4px; }
.fin-scal__b small { font-size: 9px; font-weight: 700; color: var(--muted); margin-left: 2px; }
.fin-scal__sel { border-top: 1px solid var(--line, #e5e7eb); margin-top: 8px; padding-top: 8px; display: grid; gap: 4px; }
.fin-scal__sel .fin-up-line { gap: 8px; justify-content: flex-start; }

/* ══ Style des pages Nutrition (cartes .pl2-card, en-têtes .pl2-eyebrow) ══ */
.fin-page { max-width: 1440px; margin: 0 auto; width: 100%; }
.fin-header { margin-bottom: 14px; }
.fin-header h2 { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.fin-eyebrow, .fin-section__title, .fin-section__title--sub {
  font-size: 11px; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted);
  display: flex; align-items: center; gap: 7px;
}
.fin-section__title svg { width: 14px; height: 14px; }
.fin-section, .fin-chart-card, .fin-hero, .fin-ltl, .fin-lo, .fin-quick, .fin-stat-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg, 18px);
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.04);
}
.fin-section, .fin-chart-card, .fin-hero { padding: 18px; margin-bottom: 14px; }
.fin-section .fin-section__title, .fin-chart-card .fin-section__title { margin-bottom: 10px; }
#panel-finance-upcoming .fin-section, #panel-finance-savings .fin-section, #panel-finance-subscriptions .fin-section { border-radius: var(--radius-lg, 18px); padding: 18px; }

/* Grande carte de synthèse */
.fin-hero { display: grid; gap: 14px; }
.fin-hero__top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.fin-hero__main { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.fin-hero__val { font-size: 44px; font-weight: 800; line-height: 1; color: var(--text); font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.fin-hero__unit { font-size: 15px; font-weight: 600; color: var(--muted); }
.fin-hero__side { margin-left: auto; display: grid; text-align: right; color: var(--muted); }
.fin-hero__side b { font-size: 17px; font-variant-numeric: tabular-nums; }
.fin-hero__side small { font-size: 12px; }
.fin-hero__bar { height: 8px; border-radius: 99px; background: var(--line); overflow: hidden; }
.fin-hero__bar span { display: block; height: 100%; border-radius: 99px; }
.fin-hero__stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; }
.fin-hero__stats small { display: block; font-size: 12px; color: var(--muted); margin-bottom: 3px; }
.fin-hero__stats b { font-size: 19px; font-weight: 800; font-variant-numeric: tabular-nums; color: var(--text); }
.fin-hero__stats b.fin-se-ok { color: var(--ok); } .fin-hero__stats b.fin-se-bad { color: var(--bad, #dc2626); }
.fin-hero__note { font-size: 12.5px; color: var(--muted); }

/* Liens « + Nouveau » et boutons */
.fin-link { display: inline-flex; align-items: center; gap: 5px; background: none; border: 0; padding: 0; color: var(--primary); font: inherit; font-size: 13px; font-weight: 800; cursor: pointer; }
.fin-link svg { width: 14px; height: 14px; }
.fin-link:hover { text-decoration: underline; }
.fin-add-btn { border-radius: 999px; padding: 8px 16px; font-size: 13px; }
.fin-link-btn { color: var(--primary); font-weight: 700; }
.fin-month-nav { border-radius: 999px; padding: 4px 6px; }
.fin-month-nav__btn { width: 30px; height: 30px; border: 1px solid var(--line); }

/* Lignes à l'intérieur des cartes : plus de cadre propre, un filet entre elles */
.fin-section .fin-budget-row, .fin-section .fin-nobudget-row, .fin-section .fin-budget-edit-row, .fin-section .fin-project-row {
  background: none; border: 0; border-radius: 0; box-shadow: none; padding: 10px 0; border-bottom: 1px solid var(--line);
}
.fin-section .fin-budget-row:last-child, .fin-section .fin-nobudget-row:last-child, .fin-section .fin-budget-edit-row:last-child, .fin-section .fin-project-row:last-child { border-bottom: 0; }
.fin-section .fin-project-row__hd { padding: 0 0 8px; }
.fin-budget-list, .fin-nobudget-list, .fin-project-list, .fin-budget-edit-list { gap: 0 !important; }
.fin-budget-row__bar, .fin-sv-bar { height: 6px; }
.fin-recent-row { padding: 10px 0; }
.fin-empty-hint { border-radius: 12px; }
.fin-stats-grid { gap: 12px; }
.fin-stat-card { padding: 16px; }
.fin-stat-card__val { font-size: 1.5rem; }
.fin-sum-bar { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 10px 14px; }
.fin-sum-bar svg { width: 13px; height: 13px; vertical-align: -2px; }
@media (max-width: 560px) {
  .fin-hero__val { font-size: 34px; }
  .fin-hero__stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .fin-hero__stats b { font-size: 16px; }
}
.fin-section .fin-empty-hint, .fin-chart-card .fin-empty-hint, .fin-hero .fin-empty-hint, .fin-lo .fin-empty-hint { background: none; padding: 0; color: var(--muted); font-size: 13px; }

/* ── Boutons comme la page Cuisine ── */
.fin-tools { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.fin-header .fin-tools .icon-button { flex: none; }
.fin-rbtn { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; padding: 0; border-radius: 50%;
  border: 1px solid var(--line); background: var(--surface-soft); color: var(--muted); cursor: pointer;
  transition: color .15s ease, border-color .15s ease, background .15s ease; }
.fin-rbtn svg { width: 15px; height: 15px; }
.fin-rbtn:hover { color: var(--primary); border-color: color-mix(in srgb, var(--primary) 40%, var(--line)); }
.fin-rbtn--primary { background: color-mix(in srgb, var(--primary) 12%, var(--surface)); color: var(--primary); border-color: color-mix(in srgb, var(--primary) 30%, var(--line)); }
.fin-rbtn--ok:hover { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 40%, var(--line)); }
.fin-rbtn--bad:hover { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 40%, var(--line)); }
.fin-rbtn-lbl { font-size: 12.5px; font-weight: 600; color: var(--muted); margin: 0 10px 0 -2px; }
.fin-sv-actions { align-items: center; gap: 8px; }
.fin-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.fin-chipbtn { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: var(--surface-soft); color: var(--text);
  border-radius: 999px; padding: 6px 12px; font: inherit; font-size: 12.5px; font-weight: 700; cursor: pointer; }
.fin-chipbtn svg { width: 13px; height: 13px; }
.fin-chipbtn:hover { border-color: color-mix(in srgb, var(--primary) 40%, var(--line)); color: var(--primary); }
.fin-chipbtn--primary { background: color-mix(in srgb, var(--primary) 12%, var(--surface)); color: var(--primary); border-color: color-mix(in srgb, var(--primary) 30%, var(--line)); }
.fin-quick { padding: 5px 5px 5px 14px; }
.fin-se-row .fin-rbtn + .fin-rbtn { margin-left: 2px; }

/* ── Dépenses regroupées par jour ── */
.fin-day { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg, 18px); box-shadow: 0 6px 18px rgba(15,23,42,.04); padding: 6px 18px; margin-bottom: 12px; }
.fin-day__head { display: flex; justify-content: space-between; align-items: center; padding: 10px 0 6px; font-size: 13px; border-bottom: 1px solid var(--line); }
.fin-day__head b { font-weight: 800; color: var(--text); }
.fin-day__head span { font-weight: 800; color: var(--muted); font-variant-numeric: tabular-nums; }
.fin-tx { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.fin-tx:last-child { border-bottom: 0; }
.fin-tx--virtual { opacity: .7; } .fin-tx--upcoming { opacity: .45; }
.fin-tx__icon { width: 34px; height: 34px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex: none; }
.fin-tx__icon svg { width: 16px; height: 16px; }
.fin-tx__main { flex: 1; min-width: 0; display: grid; }
.fin-tx__main b { font-size: 14px; font-weight: 700; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fin-tx__main small { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fin-tx__main small svg { width: 11px; height: 11px; vertical-align: -1px; }
.fin-tx__amt { font-weight: 800; font-size: 14px; text-align: right; font-variant-numeric: tabular-nums; display: grid; }
.fin-tx__amt small { font-size: 11px; font-weight: 600; color: var(--ok); }
.fin-tx__amt--income, .fin-tx__amt--refund { color: var(--ok); }
.fin-tx__actions { display: flex; gap: 6px; }
@media (max-width: 560px) { .fin-tx__actions .fin-rbtn--bad { display: none; } .fin-day { padding: 4px 14px; } }

/* ── Nouveau mois ── */
.fin-ms { display: grid; gap: 4px; }
.fin-ms__step { display: flex; align-items: flex-start; gap: 10px; padding: 8px 0; }
.fin-ms__step[data-ms] { cursor: pointer; }
.fin-ms__n { width: 26px; height: 26px; border-radius: 50%; flex: none; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 800;
  background: color-mix(in srgb, var(--primary) 12%, var(--surface)); color: var(--primary); }
.fin-ms__n.is-done { background: color-mix(in srgb, var(--ok) 14%, var(--surface)); color: var(--ok); }
.fin-ms__n svg { width: 13px; height: 13px; }
.fin-ms__txt { flex: 1; display: grid; gap: 2px; }
.fin-ms__txt b { font-size: 14px; color: var(--text); }
.fin-ms__txt small { font-size: 12.5px; color: var(--muted); }
.fin-ms__go { color: var(--muted); font-size: 18px; line-height: 26px; }

/* ── Étiquettes ── */
.fin-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 3px; }
.fin-tag { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 700; color: var(--primary);
  background: color-mix(in srgb, var(--primary) 10%, var(--surface)); border-radius: 999px; padding: 2px 8px; border: 0; font-family: inherit; }
.fin-tag svg { width: 10px; height: 10px; }
.fin-tag--on { cursor: pointer; font-size: 12.5px; padding: 5px 10px; }
.fin-tag--big { font-size: 13px; padding: 5px 11px; }
.fin-tagbox { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; border: 1px solid var(--line); border-radius: 12px; padding: 8px; background: var(--surface); }
.fin-tagbox__in { flex: 1; min-width: 140px; border: 0; outline: none; font: inherit; font-size: 14px; background: none; color: var(--text); padding: 4px; }
.fin-tagbox__sugg { width: 100%; display: flex; flex-wrap: wrap; gap: 6px; }
.fin-tagsum { border-bottom: 1px solid var(--line); padding: 8px 0; }
.fin-tagsum:last-child { border-bottom: 0; }
.fin-tagsum summary { display: flex; align-items: center; justify-content: space-between; gap: 10px; cursor: pointer; list-style: none; }
.fin-tagsum summary::-webkit-details-marker { display: none; }
.fin-tagsum__amt { display: grid; text-align: right; }
.fin-tagsum__amt small { font-size: 11px; color: var(--muted); }
.fin-tagsum .fin-up-line { padding-left: 6px; }

/* ── Dépenses favorites (sous l'ajout rapide) ── */
.fin-qfav { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin: 6px 0 2px; }
.fin-qfav:empty { display: none; }
.fin-qfav .fin-chipbtn svg { width: 11px; height: 11px; }
.fin-qfm { display: grid; gap: 4px; }

/* ── Nouveau formulaire de transaction ── */
.fin-type-chips { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.fin-type-chips .fin-type-chip { padding: 8px 6px; font-size: 13px; }
.fin-amt-big { display: flex; align-items: baseline; justify-content: center; gap: 6px; padding: 6px 0 0; }
.fin-amt-big__in { width: 100%; max-width: 260px; text-align: center; border: 0; outline: none; background: none; font: inherit; font-size: 46px; font-weight: 800; color: var(--text); font-variant-numeric: tabular-nums; padding: 0; }
.fin-amt-big__in::placeholder { color: var(--line); }
.fin-amt-big__eur { font-size: 26px; font-weight: 800; color: var(--muted); }
.fin-date-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; justify-content: center; }
.fin-date-row .field__input { width: auto; flex: 0 1 160px; padding: 6px 10px; min-height: 0; font-size: 13px; }
.fin-cat-select { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.fin-cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; }
.fin-cat-tile { display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 9px 4px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface-soft); cursor: pointer; font: inherit; font-size: 11.5px; font-weight: 700; color: var(--text); text-align: center; min-width: 0; }
.fin-cat-tile > span:last-child { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fin-cat-tile__ic { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; }
.fin-cat-tile__ic svg { width: 17px; height: 17px; }
.fin-cat-tile.is-on { border: 1.5px solid var(--primary); background: color-mix(in srgb, var(--primary) 10%, var(--surface)); }
.fin-more { border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px; }
.fin-more summary { cursor: pointer; display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 14px; list-style: none; }
.fin-more summary::-webkit-details-marker { display: none; }
.fin-more summary svg { width: 15px; height: 15px; color: var(--muted); }
.fin-more summary small { font-weight: 500; color: var(--muted); font-size: 12px; margin-left: auto; text-align: right; }
.fin-more__body { display: flex; flex-direction: column; gap: 14px; margin-top: 12px; }

/* ── Sous-onglets (Vue d'ensemble / À venir, Catégories / Abonnements) ── */
.fin-subtabs { display: flex; gap: 2px; padding: 4px; border-radius: 999px; background: var(--surface-soft); border: 1px solid var(--line); width: fit-content; max-width: 100%; margin: 0 0 14px; }
.fin-subtabs__b { border: 0; background: none; border-radius: 999px; padding: 7px 16px; font: inherit; font-size: 13px; font-weight: 700; color: var(--muted); cursor: pointer; }
.fin-subtabs__b.is-on { background: var(--surface); color: var(--text); box-shadow: 0 1px 4px rgba(15,23,42,.12); }
@media (max-width: 560px) { .fin-subtabs { width: 100%; } .fin-subtabs__b { flex: 1; } }
.fin-amt-big__in { width: auto; field-sizing: content; min-width: 2.5ch; max-width: 80%; }
.fin-type-chips .fin-type-chip { display: inline-flex; align-items: center; justify-content: center; gap: 5px; white-space: nowrap; font-size: 12.5px; }
.fin-type-chips .fin-type-chip svg { flex: none; }
@media (max-width: 420px) { .fin-type-chips .fin-type-chip svg { display: none; } }
.fin-date-row { flex-wrap: nowrap; overflow-x: auto; justify-content: flex-start; scrollbar-width: none; }
.fin-date-row .fin-chipbtn { flex: none; }
.fin-date-row .field__input { flex: 0 0 140px; }
.fin-more summary small { max-width: 60%; }

/* ── Filtres compacts (Dépenses) ── */
.fin-filterbar { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.fin-filterbar .fin-search { flex: 1; min-width: 0; margin: 0; }
.fin-filterbar .fin-chipbtn { flex: none; padding: 9px 14px; }
.fin-filterbar .fin-chipbtn svg { width: 14px; height: 14px; }
.fin-activefilters { margin-bottom: 10px; }
.fin-activefilters svg { width: 11px; height: 11px; }
#finFiltersPanel { display: none; }
#finFiltersPanel.is-open { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); margin-bottom: 12px; }
#finFiltersPanel .fin-search--legacy { display: none; }
@media (max-width: 560px) { #finFiltersPanel.is-open .fin-filter-select { flex: 1 1 45%; } #finFiltersPanel .fin-amount-range { flex: 1 1 100%; } }

/* ── Lignes de budget compactes ── */
.fin-brow { display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 4px 10px; padding: 10px 0; border-bottom: 1px solid var(--line); position: relative; }
.fin-brow:last-child { border-bottom: 0; }
.fin-brow__main { display: flex; align-items: center; gap: 10px; min-width: 0; background: none; border: 0; padding: 0; text-align: left; font: inherit; cursor: pointer; color: inherit; }
.fin-brow__ic { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; flex: none; }
.fin-brow__ic svg { width: 16px; height: 16px; }
.fin-brow__txt { display: grid; min-width: 0; }
.fin-brow__txt b { font-size: 14px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fin-brow__txt small { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fin-brow__txt small.fin-se-bad { color: var(--bad, #dc2626); font-weight: 700; }
.fin-brow__amt { font-size: 13px; font-weight: 700; color: var(--muted); white-space: nowrap; }
.fin-brow__amt .field__input { width: 78px; text-align: right; padding: 6px 8px; min-height: 0; font-size: 14px; font-weight: 700; display: inline-block; }
.fin-brow__bar { grid-column: 1 / -1; height: 5px; border-radius: 99px; background: var(--line); overflow: hidden; margin-left: 44px; }
.fin-brow__fill { display: block; height: 100%; border-radius: 99px; background: var(--ok); }
.fin-brow__fill--warn { background: var(--warn, #d97706); } .fin-brow__fill--bad { background: var(--bad, #dc2626); }
.fin-brow__menu { position: relative; }
.fin-brow__menu summary { list-style: none; }
.fin-brow__menu summary::-webkit-details-marker { display: none; }
.fin-brow__pop { position: absolute; right: 0; top: 38px; z-index: 20; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 28px rgba(15,23,42,.14); padding: 6px; display: grid; min-width: 210px; }
.fin-brow__pop button { display: flex; align-items: center; gap: 8px; background: none; border: 0; padding: 9px 10px; border-radius: 8px; font: inherit; font-size: 13.5px; font-weight: 600; color: var(--text); cursor: pointer; text-align: left; }
.fin-brow__pop button:hover { background: var(--surface-soft); }
.fin-brow__pop button svg { width: 14px; height: 14px; }
.fin-brow__pop button.fin-se-bad { color: var(--bad, #dc2626); }
/* Grande carte : tient sur un téléphone (chiffre adapté, « / budget » sous le chiffre) */
.fin-hero__val { font-size: clamp(30px, 9vw, 44px); }
.fin-hero__side b { white-space: nowrap; }
.fin-hero__stats b { white-space: nowrap; font-size: clamp(15px, 4.4vw, 19px); }
@media (max-width: 560px) {
  .fin-hero__main { display: grid; grid-template-columns: auto 1fr; align-items: baseline; }
  .fin-hero__side { grid-column: 1 / -1; margin: 0; text-align: left; display: flex; gap: 6px; align-items: baseline; }
  .fin-hero__side b { font-size: 15px; }
  .fin-hero__stats { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .fin-hero__stats > div:nth-child(n+4) { grid-column: span 3; }
}

/* ── Tableau de bord : anneau dans la grande carte, Nouveau mois replié ── */
.fin-hero__ring { display: flex; align-items: center; gap: 14px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.fin-hero__ring .fin-ltl__ring { width: 84px; height: 84px; flex: none; }
.fin-hero__ring > span { display: grid; gap: 2px; }
.fin-hero__ring small { font-size: 12px; color: var(--muted); }
.fin-hero__ring b { font-size: 24px; font-weight: 800; color: var(--text); font-variant-numeric: tabular-nums; }
.fin-hero__ringhint { display: flex; gap: 8px; align-items: center; font-size: 12.5px; color: var(--muted); padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.fin-hero__ringhint svg { width: 15px; height: 15px; flex: none; }
.fin-ms > summary { cursor: pointer; list-style: none; }
.fin-ms > summary::-webkit-details-marker { display: none; }
.fin-ms__open { font-size: 13px; font-weight: 800; color: var(--primary); }
.fin-ms[open] .fin-ms__open { display: none; }
.fin-ms__body { display: grid; gap: 4px; margin-top: 6px; }
/* Sélecteur de période identique partout, en pilule */
.fin-period { display: inline-flex; align-items: center; gap: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 4px 6px; max-width: 100%; }
.fin-period .fin-filter-select { border: 0; background: var(--surface-soft); border-radius: 999px; padding: 6px 28px 6px 12px; min-height: 0; font-weight: 700; }
.fin-period .fin-month-nav__label { min-width: 0; padding: 0 4px; white-space: nowrap; }
.fin-header { align-items: center; }
.fin-header .fin-tools { margin-left: auto; }
@media (max-width: 560px) { .fin-header { flex-wrap: nowrap; } .fin-period { flex: 1; justify-content: space-between; } .fin-period .fin-filter-select { max-width: 110px; } }
@media (max-width: 560px) {
  .fin-header { flex-wrap: wrap; gap: 8px; }
  .fin-header .fin-period { flex: 1 1 100%; order: 2; }
  .fin-header .fin-tools { order: 1; margin-left: auto; }
  .fin-period { display: flex; flex-wrap: nowrap; }
  .fin-period .fin-month-nav__label { flex: 1; text-align: center; font-size: 14px; }
  .fin-period .fin-filter-select { max-width: 104px; font-size: 13px; padding: 6px 24px 6px 10px; }
  .fin-hero__stats small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
}
.fin-iconfix { display: flex; align-items: center; gap: 8px; width: 100%; border: 1px solid var(--line); background: var(--surface-soft); border-radius: 12px; padding: 10px 12px; margin-bottom: 8px; font: inherit; font-size: 12.5px; color: var(--text); cursor: pointer; text-align: left; }
.fin-iconfix svg { width: 15px; height: 15px; color: var(--primary); flex: none; }
.fin-iconfix span { flex: 1; }
.fin-iconfix b { color: var(--primary); }

/* ── Pages vides ── */
.fin-emptystate { display: grid; justify-items: center; text-align: center; gap: 8px; padding: 26px 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg, 18px); margin-bottom: 14px; }
.fin-emptystate__ic { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; color: var(--primary); background: color-mix(in srgb, var(--primary) 12%, var(--surface)); }
.fin-emptystate__ic svg { width: 24px; height: 24px; }
.fin-emptystate b { font-size: 16px; color: var(--text); }
.fin-emptystate p { margin: 0; font-size: 13px; color: var(--muted); max-width: 380px; }
.fin-emptystate .button { border-radius: 999px; margin-top: 4px; display: inline-flex; gap: 6px; align-items: center; }
.fin-emptystate .button svg { width: 14px; height: 14px; }
.fin-sr--pos { height: 130px; }
.fin-sr--pos .fin-sr__bot { flex: 0 0 0; }

/* Accueil : reste à vivre sans anneau, tuiles et liens Budgets / Dépenses */
.fin-hero__ring--flat { align-items: flex-start; }
.fin-hero__ring--flat > span:first-child { flex: 1; min-width: 0; }
.fin-ltl__bar { display: block; height: 4px; border-radius: 99px; background: var(--line); overflow: hidden; margin-top: 6px; }
.fin-ltl__bar > span { display: block; height: 100%; border-radius: inherit; }
.fin-ltl__day { display: grid; justify-items: end; gap: 0; flex: none; }
.fin-ltl__day b { font-size: 22px; }
.fin-tiles { margin: 2px 0; }
.fin-links { display: flex; flex-direction: column; padding: 0; overflow: hidden; }
.fin-link-row { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border: 0; background: none; font: inherit; color: var(--text); text-align: left; cursor: pointer; }
.fin-link-row + .fin-link-row { border-top: 1px solid var(--line); }
.fin-link-row:hover { background: var(--surface-soft); }
.fin-link-row .nt-dot { width: 36px; height: 36px; }
.fin-link-row .nt-dot svg { width: 16px; height: 16px; }
.fin-link-row__txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.fin-link-row__txt b { font-size: 15px; }
.fin-link-row__txt small { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fin-link-row__chev { color: var(--muted); font-size: 18px; }
@media (max-width: 560px) { .nt-tiles { gap: 10px; } .nt-tile { min-height: 100px; } }
@media (min-width: 1100px) { .fin-tiles { grid-template-columns: repeat(6, minmax(0, 1fr)); } }

/* Nouveau mois : carte d'action (Répartir / Bilan / ✕) */
.fin-ms2 { display: flex; align-items: flex-start; gap: 12px; padding: 16px; margin-bottom: 14px; }
.fin-ms2 .nt-dot { width: 40px; height: 40px; }
.fin-ms2 .nt-dot svg { width: 18px; height: 18px; }
.fin-ms2__txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.fin-ms2__txt b { font-size: 15px; }
.fin-ms2__txt small { font-size: 12.5px; color: var(--muted); }
.fin-ms2__btns { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.fin-ms2__x { width: 30px; height: 30px; flex: none; border: 0; border-radius: 50%; background: var(--surface-soft); color: var(--muted); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.fin-ms2__x svg { width: 13px; height: 13px; }
.fin-pill { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: var(--surface-soft); color: var(--text); border-radius: 999px; padding: 8px 14px; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.fin-pill svg { width: 14px; height: 14px; }
.fin-pill--primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.fin-split { display: flex; flex-direction: column; gap: 12px; }
.fin-split__row { display: flex; flex-direction: column; gap: 8px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.fin-split__hd { display: flex; align-items: center; gap: 8px; }
.fin-split__hd b:nth-of-type(1) { flex: 1; }
.fin-split__chips { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.fin-split__chip { border: 0; border-radius: 999px; padding: 7px 0; font: inherit; font-size: 12.5px; font-weight: 700; background: var(--surface-soft); color: var(--text); cursor: pointer; }
.fin-split__chip.is-on { background: var(--primary); color: #fff; }
.fin-tiles { margin-bottom: 14px; }

/* Finances › Accueil sur écran large (12/11) : la page + « Dernières opérations / Budgets à surveiller ». */
.fin-dash-wrap { display: grid; gap: 16px; align-items: start; }
.fin-dash-wrap > .fin-page { max-width: none; margin: 0; width: auto; min-width: 0; }
.fin-dash-side { display: grid; gap: 14px; align-content: start; }
.fin-side-row { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 0; border: 0; border-top: 1px solid var(--line); background: none; font: inherit; color: inherit; text-align: left; cursor: pointer; }
.fin-side-row:first-of-type { border-top: 0; }
.fin-side-dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.fin-side-txt { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.fin-side-txt b { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fin-side-txt small { color: var(--muted); font-size: 12px; }
.fin-side-row em { font-style: normal; font-weight: 700; white-space: nowrap; }
.fin-side-budget { display: grid; gap: 6px; width: 100%; padding: 10px 0; border: 0; border-top: 1px solid var(--line); background: none; font: inherit; color: inherit; text-align: left; cursor: pointer; }
.fin-side-budget:first-of-type { border-top: 0; }
.fin-side-budget__top { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; }
.fin-side-budget__top span { color: var(--muted); white-space: nowrap; }
@media (min-width: 1100px) { .fin-dash-wrap { grid-template-columns: minmax(0, 1.55fr) minmax(300px, 1fr); } }
/* ══ Refonte 2026-11 (comme l'app) : Budgets lecture / Modifier / Gérer, À venir en une carte, ⋯ ══ */
.fin-dots { display: inline-block; }
.fin-brow__left { display: grid; justify-items: end; font-weight: 800; font-size: 14px; font-variant-numeric: tabular-nums; }
.fin-brow__left small { font-size: 11px; font-weight: 600; color: var(--muted); }
.fin-manage { border-top: 1px solid var(--line); }
.fin-manage:first-of-type { border-top: 0; }
.fin-manage__head { width: 100%; display: flex; align-items: center; gap: 10px; min-height: 46px; border: 0; background: none; font: inherit; color: var(--text); cursor: pointer; text-align: left; padding: 0; }
.fin-manage__head svg { width: 15px; height: 15px; color: var(--muted); }
.fin-manage__head b { flex: 1; font-size: 14px; }
.fin-manage__head span { font-size: 13px; color: var(--muted); font-weight: 600; }
.fin-manage__head i { font-style: normal; color: var(--muted); font-size: 12px; }
.fin-manage__body { display: grid; gap: 8px; padding: 0 0 14px; }
.fin-up-day { padding: 0 2px; }
.fin-up-line--day { margin-top: 10px; font-size: 12.5px; color: var(--muted); }
.fin-up-line--day b { color: var(--muted); }
.fin-sv-new .fin-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.fin-rec-subs > .fin-page { padding: 0; margin-top: 18px; max-width: none; }

/* ── Accueil, refonte du 2/12 (comme l'app) ─────────────────────────────── */
.fin-sum { display: grid; gap: 10px; width: 100%; text-align: left; padding: 16px; border-radius: 22px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; font-family: inherit; color: var(--text); margin-bottom: 12px; }
.fin-sum__eb { display: flex; justify-content: space-between; font-size: 11px; font-weight: 700; letter-spacing: .1em; color: var(--muted); }
.fin-sum__eb i { font-style: normal; font-weight: 800; }
.fin-sum__row { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.fin-sum__row b { font-size: 34px; font-weight: 800; line-height: 1.05; }
.fin-sum__row small, .fin-sum__line { font-size: 13px; color: var(--muted); }
.fin-sum__line { font-size: 12px; }
.fin-addbtn { width: 100%; min-height: 54px; border: 0; border-radius: 16px; background: var(--primary); color: #fff; font-family: inherit; font-size: 17px; font-weight: 800; cursor: pointer; margin-bottom: 10px; }
.fin-addbtn:hover { filter: brightness(1.08); }
.fin-next { display: flex; align-items: center; gap: 6px; width: 100%; min-height: 44px; padding: 0 14px; margin-top: 10px; border-radius: 14px; cursor: pointer; font-family: inherit; font-size: 13px; text-align: left;
  color: #a35a00; background: color-mix(in srgb, #f5a623 14%, transparent); border: 1px solid color-mix(in srgb, #f5a623 35%, transparent); }
.fin-next span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fin-next i { font-style: normal; font-weight: 800; }
.fin-addm { display: grid; gap: 12px; }
.fin-addm .fin-quick { margin: 0; }
.fin-addm__or { font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.fin-addm .fin-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
