/* =========================================================================
   NoteFrais - refonte mobile d'abord (Bootstrap 5 + CSS custom)
   Couleurs issues du logo ADMED : indigo = structure et actions,
   vert = accepte, magenta = refuse, le reste en gris.
   ========================================================================= */

:root {
  --nf-indigo: #575BA5;
  --nf-indigo-dark: #464a8c;
  --nf-indigo-tint: #EEEEF7;
  --nf-indigo-soft: #F7F7FC;
  --nf-green: #009640;
  --nf-green-dark: #007f36;
  --nf-green-text: #00702F;
  --nf-green-tint: #E4F4EA;
  --nf-magenta: #DB0070;
  --nf-magenta-dark: #b8005e;
  --nf-magenta-text: #B10063;
  --nf-magenta-tint: #FCE8F2;
  --nf-magenta-border: #F5C9E1;
  --nf-magenta-soft: #FEF7FA;
  --nf-sky: #86CBEB;
  --nf-ink: #14172B;
  --nf-body: #3a3f52;
  --nf-secondary: #5A6072;
  --nf-muted: #8A90A2;
  --nf-bg: #F5F6F8;
  --nf-surface: #ffffff;
  --nf-grey: #EDEFF3;
  --nf-row: #FAFAFC;
  --nf-border: rgba(23, 26, 45, .09);
  --nf-border-strong: rgba(23, 26, 45, .14);
  --nf-divider: rgba(23, 26, 45, .06);
  --nf-focus: 0 0 0 3px rgba(87, 91, 165, .14);
  --nf-sans: 'IBM Plex Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --nf-mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --nf-radius: 12px;
  --nf-radius-sm: 9px;

  /* Bootstrap */
  --bs-body-bg: var(--nf-bg);
  --bs-body-color: var(--nf-body);
  --bs-body-font-family: var(--nf-sans);
  --bs-body-font-size: .875rem;
  --bs-primary: var(--nf-indigo);
  --bs-primary-rgb: 87, 91, 165;
  --bs-link-color: var(--nf-indigo);
  --bs-link-color-rgb: 87, 91, 165;
  --bs-link-hover-color: var(--nf-indigo-dark);
  --bs-link-hover-color-rgb: 70, 74, 140;
  --bs-border-color: var(--nf-border-strong);
  --bs-border-radius: var(--nf-radius-sm);
  --bs-heading-color: var(--nf-ink);
}

html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--nf-bg);
  color: var(--nf-body);
  font-family: var(--nf-sans);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
body.nf-lock { overflow: hidden; }
a { color: var(--nf-indigo); text-decoration: none; }
a:hover { color: var(--nf-indigo-dark); }
h1, h2, h3, h4 { color: var(--nf-ink); }
p { margin: 0; }
img { max-width: 100%; }
button { font-family: inherit; }

/* ------------------------------------------------------------------ texte */
.nf-mono { font-family: var(--nf-mono); }
.nf-num { font-family: var(--nf-mono); font-weight: 500; font-size: 13.5px; }
.nf-ink { color: var(--nf-ink) !important; }
.nf-body { color: var(--nf-body) !important; }
.nf-secondary { color: var(--nf-secondary) !important; }
.nf-muted { color: var(--nf-muted) !important; }
.text-nf-indigo { color: var(--nf-indigo) !important; }
.text-nf-green { color: var(--nf-green-text) !important; }
.text-nf-magenta { color: var(--nf-magenta-text) !important; }
.nf-small { font-size: 12px; }
.nf-sub { font-size: 13px; color: var(--nf-muted); }
.nf-eyebrow {
  font-weight: 600; font-size: 11.5px; letter-spacing: .06em; text-transform: uppercase;
  color: var(--nf-muted); margin: 0;
}
.nf-section-title {
  font-weight: 600; font-size: 13px; letter-spacing: .05em; text-transform: uppercase;
  color: var(--nf-ink); margin: 0;
}
.nf-section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.nf-h1 { font-weight: 600; font-size: 22px; line-height: 1.25; letter-spacing: -.02em; color: var(--nf-ink); margin: 0; }
.nf-h2 { font-weight: 600; font-size: 15px; line-height: 1.3; color: var(--nf-ink); margin: 0; }
.nf-breadcrumb { font-size: 13px; color: var(--nf-muted); display: inline-flex; align-items: center; gap: 6px; }
.nf-breadcrumb:hover { color: var(--nf-secondary); }
.nf-amount { font-family: var(--nf-mono); font-weight: 600; letter-spacing: -.02em; color: var(--nf-ink); line-height: 1; }
.nf-amount-xl { font-size: 34px; }
.nf-amount-lg { font-size: 20px; }
.nf-amount-md { font-size: 17px; }
.nf-amount-sm { font-size: 14.5px; }
.nf-currency { font-family: var(--nf-sans); font-weight: 500; font-size: 15px; color: var(--nf-muted); letter-spacing: 0; }
.nf-hint { font-size: 12.5px; line-height: 1.5; color: var(--nf-muted); }
.nf-wrap { overflow-wrap: anywhere; }

/* ----------------------------------------------------------- mise en page */
.nf-container { max-width: 1440px; margin: 0 auto; padding: 0 16px; }
.nf-page { max-width: 1440px; margin: 0 auto; padding: 18px 16px 40px; display: flex; flex-direction: column; gap: 14px; }
.nf-page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.nf-stack { display: flex; flex-direction: column; gap: 14px; }
.nf-stack-lg { display: flex; flex-direction: column; gap: 20px; }
.nf-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.nf-two-col { display: flex; flex-direction: column; gap: 14px; }
.nf-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 14px; }
.nf-aside { display: flex; flex-direction: column; gap: 14px; }
body.nf-has-bottom-bar .nf-page { padding-bottom: 110px; }
body.nf-has-fab .nf-page { padding-bottom: 110px; }

@media (min-width: 992px) {
  .nf-container { padding: 0 16px; }
  .nf-page { padding: 22px 16px 48px; gap: 20px; }
  .nf-h1 { font-size: 28px; }
  .nf-amount-xl { font-size: 30px; }
  .nf-two-col { flex-direction: row; align-items: flex-start; gap: 20px; }
  .nf-main { gap: 16px; }
  .nf-aside { width: 320px; flex: none; gap: 16px; }
  .nf-aside-sm { width: 300px; }
  .nf-aside-lg { width: 720px; }
  body.nf-has-bottom-bar .nf-page, body.nf-has-fab .nf-page { padding-bottom: 48px; }
}

/* ------------------------------------------------------------------ cartes */
.nf-card { background: var(--nf-surface); border: 1px solid var(--nf-border); border-radius: var(--nf-radius); }
.nf-card-body { padding: 16px; }
.nf-card-header {
  padding: 13px 16px; border-bottom: 1px solid var(--nf-border);
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
}
.nf-card-footer {
  padding: 14px 16px; background: var(--nf-row); border-top: 1px solid var(--nf-divider);
  border-radius: 0 0 var(--nf-radius) var(--nf-radius);
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
}
.nf-card-title { font-weight: 600; font-size: 14.5px; color: var(--nf-ink); }
.nf-card-clip { overflow: hidden; }
a.nf-card { color: inherit; display: block; }
a.nf-card:hover { border-color: rgba(23, 26, 45, .18); }
.nf-card.is-refused { border-color: var(--nf-magenta-border); }
.nf-total { display: flex; align-items: baseline; gap: 10px; }
.nf-total-label { font-size: 13.5px; color: var(--nf-secondary); }
@media (min-width: 992px) {
  .nf-card-body { padding: 20px 22px; }
  .nf-card-header { padding: 14px 20px; }
  .nf-card-footer { padding: 14px 20px; }
}

/* Lignes cle / valeur */
.nf-kv { display: flex; justify-content: space-between; align-items: baseline; gap: 14px; padding: 12px 15px; border-bottom: 1px solid var(--nf-divider); }
.nf-kv:last-child { border-bottom: 0; }
.nf-kv-label { font-size: 13px; color: var(--nf-muted); flex: none; }
.nf-kv-value { font-weight: 500; font-size: 13.5px; color: var(--nf-ink); text-align: right; overflow-wrap: anywhere; }
.nf-kv-value.nf-mono { font-family: var(--nf-mono); }
@media (min-width: 992px) {
  .nf-kv { display: grid; grid-template-columns: 190px 1fr; padding: 13px 22px; }
  .nf-kv-value { text-align: left; }
}
.nf-kv-lg .nf-kv-label { font-size: 13.5px; }
.nf-kv-lg .nf-kv-value { font-size: 15.5px; }

/* Mini statistiques dans un en-tete de note */
.nf-mini-stats { display: flex; gap: 18px; flex-wrap: wrap; margin-top: 14px; padding-top: 13px; border-top: 1px solid rgba(23, 26, 45, .07); }
.nf-mini-stat-label { font-size: 11.5px; color: var(--nf-muted); }
.nf-mini-stat-value { font-weight: 500; font-size: 13px; color: var(--nf-ink); margin-top: 3px; }

/* Statistiques de l'accueil */
.nf-stat { background: var(--nf-surface); border: 1px solid var(--nf-border); border-radius: var(--nf-radius); padding: 18px 20px; }
.nf-stat-label { font-size: 11.5px; letter-spacing: .05em; text-transform: uppercase; color: var(--nf-muted); }
.nf-stat-value { font-family: var(--nf-mono); font-weight: 600; font-size: 30px; letter-spacing: -.02em; color: var(--nf-ink); margin-top: 10px; line-height: 1; }
.nf-stat-sub { font-size: 13px; color: var(--nf-secondary); margin-top: 6px; }

/* ------------------------------------------------------------------ pilules */
.nf-pill {
  display: inline-block; font-weight: 600; font-size: 11.5px; line-height: 1.2; border-radius: 20px; padding: 4px 10px;
  white-space: nowrap; vertical-align: middle;
}
.nf-pill-provisoire { color: var(--nf-secondary); background: var(--nf-grey); }
.nf-pill-envoyee { color: var(--nf-indigo); background: var(--nf-indigo-tint); }
.nf-pill-acceptee { color: var(--nf-green-text); background: var(--nf-green-tint); }
.nf-pill-payee { color: #fff; background: var(--nf-green-text); }
.nf-pill-refusee { color: var(--nf-magenta-text); background: var(--nf-magenta-tint); }
.nf-pill-fixed { width: 78px; text-align: center; }
.nf-badge {
  display: inline-block; font-family: var(--nf-mono); font-weight: 600; font-size: 11px; line-height: 1.2;
  background: var(--nf-magenta); color: #fff; border-radius: 20px; padding: 2px 6px; margin-left: 4px; vertical-align: middle;
}

/* ------------------------------------------------------------------ alertes */
.nf-alert {
  background: var(--nf-surface); border: 1px solid var(--nf-border); border-left: 3px solid var(--nf-indigo);
  border-radius: var(--nf-radius); padding: 14px 16px; display: flex; gap: 12px; align-items: flex-start;
}
.nf-alert > .bi { font-size: 15px; line-height: 1.4; flex: none; }
.nf-alert-body { flex: 1; min-width: 0; font-size: 13.5px; line-height: 1.5; color: var(--nf-body); }
.nf-alert-title { font-weight: 600; font-size: 13.5px; margin: 0; }
.nf-alert-refus { border-color: var(--nf-magenta-border); border-left-color: var(--nf-magenta); }
.nf-alert-refus > .bi, .nf-alert-refus .nf-alert-title { color: var(--nf-magenta-text); }
.nf-alert-refus > .bi { color: var(--nf-magenta); }
.nf-alert-succes { border-left-color: var(--nf-green); }
.nf-alert-succes > .bi { color: var(--nf-green); }
.nf-alert-erreur { border-color: var(--nf-magenta-border); border-left-color: var(--nf-magenta); }
.nf-alert-erreur > .bi { color: var(--nf-magenta); }
.nf-alert-info { border-left-color: var(--nf-indigo); }
.nf-alert-info > .bi { color: var(--nf-indigo); }
.nf-alert-quote { color: var(--nf-body); }
.nf-alert .btn-close { flex: none; font-size: 11px; margin-top: 2px; }
.nf-flash {
  position: fixed; top: calc(52px + 12px); right: 16px; z-index: 1080;
  width: calc(100% - 32px); max-width: 380px;
  display: flex; flex-direction: column; gap: 10px;
  pointer-events: none;
}
.nf-flash:empty { display: none; }
.nf-flash .nf-alert {
  pointer-events: auto; box-shadow: 0 8px 24px rgba(0,0,0,.14);
  animation: nf-toast-in .25s ease-out;
}
.nf-flash .nf-alert.nf-alert-closing { animation: nf-toast-out .2s ease-in forwards; }
@keyframes nf-toast-in {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes nf-toast-out {
  from { opacity: 1; transform: translateY(0); }
  to { opacity: 0; transform: translateY(-8px); }
}
@media (min-width: 992px) {
  .nf-flash { top: calc(58px + 16px); right: 28px; }
  .nf-alert { padding: 16px 20px; align-items: center; gap: 16px; }
  .nf-alert > .bi { font-size: 18px; }
}

/* ------------------------------------------------------------------ boutons */
.btn {
  --bs-btn-font-family: var(--nf-sans);
  --bs-btn-font-weight: 500;
  --bs-btn-font-size: 14px;
  --bs-btn-padding-y: 11px;
  --bs-btn-padding-x: 16px;
  --bs-btn-border-radius: var(--nf-radius-sm);
  --bs-btn-line-height: 1.3;
  --bs-btn-focus-box-shadow: var(--nf-focus);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; white-space: nowrap;
}
.btn .bi { font-size: 13px; line-height: 1; }
.btn-primary {
  --bs-btn-bg: var(--nf-indigo); --bs-btn-border-color: var(--nf-indigo);
  --bs-btn-hover-bg: var(--nf-indigo-dark); --bs-btn-hover-border-color: var(--nf-indigo-dark);
  --bs-btn-active-bg: var(--nf-indigo-dark); --bs-btn-active-border-color: var(--nf-indigo-dark);
  --bs-btn-disabled-bg: var(--nf-indigo); --bs-btn-disabled-border-color: var(--nf-indigo);
  --bs-btn-font-weight: 600;
}
.btn-dark {
  --bs-btn-bg: var(--nf-ink); --bs-btn-border-color: var(--nf-ink);
  --bs-btn-hover-bg: #23273f; --bs-btn-hover-border-color: #23273f;
  --bs-btn-active-bg: #23273f; --bs-btn-active-border-color: #23273f;
  --bs-btn-font-weight: 600;
}
.btn-success {
  --bs-btn-bg: var(--nf-green); --bs-btn-border-color: var(--nf-green);
  --bs-btn-hover-bg: var(--nf-green-dark); --bs-btn-hover-border-color: var(--nf-green-dark);
  --bs-btn-active-bg: var(--nf-green-dark); --bs-btn-active-border-color: var(--nf-green-dark);
  --bs-btn-font-weight: 600;
}
.btn-danger {
  --bs-btn-bg: var(--nf-magenta); --bs-btn-border-color: var(--nf-magenta);
  --bs-btn-hover-bg: var(--nf-magenta-dark); --bs-btn-hover-border-color: var(--nf-magenta-dark);
  --bs-btn-active-bg: var(--nf-magenta-dark); --bs-btn-active-border-color: var(--nf-magenta-dark);
  --bs-btn-font-weight: 600;
}
.btn-outline-secondary {
  --bs-btn-color: var(--nf-secondary); --bs-btn-border-color: var(--nf-border-strong); --bs-btn-bg: var(--nf-surface);
  --bs-btn-hover-color: var(--nf-ink); --bs-btn-hover-bg: var(--nf-row); --bs-btn-hover-border-color: rgba(23, 26, 45, .22);
  --bs-btn-active-color: var(--nf-ink); --bs-btn-active-bg: var(--nf-grey); --bs-btn-active-border-color: rgba(23, 26, 45, .22);
}
.btn-outline-danger {
  --bs-btn-color: var(--nf-magenta-text); --bs-btn-border-color: rgba(219, 0, 112, .35); --bs-btn-bg: var(--nf-surface);
  --bs-btn-hover-color: var(--nf-magenta-text); --bs-btn-hover-bg: var(--nf-magenta-soft); --bs-btn-hover-border-color: rgba(219, 0, 112, .5);
  --bs-btn-active-color: var(--nf-magenta-text); --bs-btn-active-bg: var(--nf-magenta-tint); --bs-btn-active-border-color: rgba(219, 0, 112, .5);
  --bs-btn-font-weight: 600;
}
.btn-sm { --bs-btn-padding-y: 9px; --bs-btn-padding-x: 14px; --bs-btn-font-size: 13px; min-height: 38px; }
.btn-lg { --bs-btn-padding-y: 13px; --bs-btn-padding-x: 20px; --bs-btn-font-size: 15.5px; min-height: 50px; --bs-btn-border-radius: 10px; }
.btn-lg .bi { font-size: 15px; }
.btn-icon { padding: 0; width: 52px; min-height: 50px; --bs-btn-border-radius: 10px; }
.btn-icon .bi { font-size: 16px; }
.btn-text { --bs-btn-padding-y: 0; --bs-btn-padding-x: 0; --bs-btn-color: var(--nf-indigo); --bs-btn-hover-color: var(--nf-indigo-dark); --bs-btn-font-weight: 500; --bs-btn-font-size: 13.5px; min-height: 0; border: 0; background: none; }
.btn-text-muted { --bs-btn-color: var(--nf-muted); --bs-btn-hover-color: var(--nf-secondary); }
.nf-icon-btn {
  width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center;
  border: 0; background: transparent; color: var(--nf-ink); border-radius: 10px; padding: 0; flex: none;
}
.nf-icon-btn .bi { font-size: 18px; }
.nf-icon-btn:hover { background: var(--nf-row); }
.nf-icon-btn--muted { color: var(--nf-secondary); }
.nf-icon-btn--light { color: #fff; }
.nf-icon-btn--light:hover { background: rgba(255, 255, 255, .08); }
.nf-link-add { font-weight: 500; font-size: 13.5px; color: var(--nf-indigo); background: none; border: 0; padding: 0; }
.nf-link-add:hover { color: var(--nf-indigo-dark); }

/* ------------------------------------------------------------- formulaires */
.form-label { font-weight: 500; font-size: 12.5px; color: var(--nf-secondary); margin-bottom: 5px; }
.form-control, .form-select {
  font-family: var(--nf-sans); font-size: 14px; color: var(--nf-ink);
  min-height: 46px; padding: 10px 13px; border: 1px solid var(--nf-border-strong); border-radius: 10px;
  background-color: var(--nf-surface); box-shadow: none;
}
.form-control:focus, .form-select:focus { border-color: var(--nf-indigo); box-shadow: var(--nf-focus); color: var(--nf-ink); }
.form-control::placeholder { color: var(--nf-muted); }
.form-control[readonly] { background-color: var(--nf-bg); border-color: rgba(23, 26, 45, .1); color: var(--nf-secondary); }
.form-control.nf-mono, .form-control.nf-computed { font-family: var(--nf-mono); }
.form-control.nf-computed[readonly] { background: var(--nf-indigo-tint); border-color: rgba(87, 91, 165, .28); color: var(--nf-indigo); font-weight: 600; font-size: 15px; }
.form-control-lg { min-height: 50px; font-size: 15px; padding: 12px 14px; }
textarea.form-control { min-height: 96px; line-height: 1.5; }
.form-text { font-size: 12px; color: var(--nf-muted); }
.nf-form { display: flex; flex-direction: column; gap: 14px; }
.nf-form-row { display: flex; gap: 10px; }
.nf-form-row > * { flex: 1; min-width: 0; }
.nf-form-row > .nf-grow { flex: 1.4; }
.nf-input-group { position: relative; }
.nf-input-group .form-control { padding-right: 48px; }
.nf-eye {
  position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
  width: 40px; height: 40px; border: 0; background: transparent; color: var(--nf-muted);
  display: inline-flex; align-items: center; justify-content: center; border-radius: 8px;
}
.nf-eye:hover { color: var(--nf-secondary); background: var(--nf-row); }
.nf-eye .bi { font-size: 15px; }
.nf-visually-hidden { position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
@media (min-width: 992px) {
  .form-control, .form-select { min-height: 44px; padding: 9px 13px; border-radius: var(--nf-radius-sm); }
  .form-control-lg { min-height: 48px; border-radius: 10px; }
  .nf-form-row { gap: 12px; }
}

/* Bascule Deplacement / Autre frais */
.nf-segmented { display: flex; gap: 8px; padding: 4px; background: var(--nf-grey); border-radius: 10px; }
.nf-segmented label {
  flex: 1; text-align: center; font-weight: 500; font-size: 13.5px; color: var(--nf-secondary);
  padding: 9px 0; border-radius: 7px; cursor: pointer; margin: 0; user-select: none;
}
.nf-segmented input:checked + label { background: var(--nf-surface); color: var(--nf-ink); font-weight: 600; box-shadow: 0 1px 2px rgba(16, 24, 40, .08); }
.nf-segmented input:focus-visible + label { box-shadow: var(--nf-focus); }

/* Section repliee dans un formulaire */
.nf-collapse-toggle {
  display: flex; align-items: center; justify-content: space-between; width: 100%; min-height: 48px;
  border: 0; border-top: 1px solid rgba(23, 26, 45, .08); background: none; padding: 0;
  font-weight: 500; font-size: 14px; color: var(--nf-secondary); text-align: left;
}
.nf-collapse-toggle .bi { font-size: 13px; color: var(--nf-muted); transition: transform .15s; }
.nf-collapse-toggle[aria-expanded="true"] .bi { transform: rotate(180deg); }

/* Justificatifs dans le formulaire */
.nf-files { display: flex; flex-direction: column; gap: 10px; }
.nf-files-actions { display: flex; gap: 10px; }
.nf-files-actions .btn { flex: 1; }
.nf-files-actions .btn-icon { flex: none; width: 46px; min-height: 46px; }
.nf-dropzone {
  border: 1px dashed rgba(87, 91, 165, .4); background: #FAFAFD; border-radius: 11px; padding: 16px;
  display: flex; gap: 14px; align-items: center; flex-wrap: wrap;
}
.nf-dropzone.is-over { border-color: var(--nf-indigo); background: var(--nf-indigo-tint); }
.nf-dropzone-text { font-size: 13.5px; color: var(--nf-ink); font-weight: 500; }
.nf-dropzone-sub { font-size: 12px; color: var(--nf-muted); margin-top: 3px; }
.nf-dropzone-sub label { color: var(--nf-indigo); font-weight: 500; cursor: pointer; }
.nf-thumbs { display: flex; gap: 10px; flex-wrap: wrap; }
.nf-thumbs:empty { display: none; }
.nf-thumb {
  width: 82px; height: 104px; border-radius: 9px; background: var(--nf-grey); border: 1px solid rgba(23, 26, 45, .1);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; overflow: hidden;
  position: relative; color: var(--nf-muted); text-decoration: none; flex: none;
}
.nf-thumb img { width: 100%; height: 100%; object-fit: cover; }
.nf-thumb .bi { font-size: 20px; }
.nf-thumb-name { font-size: 10.5px; color: var(--nf-muted); max-width: 72px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 0 4px; }
.nf-thumb-remove {
  position: absolute; top: 4px; right: 4px; width: 24px; height: 24px; border-radius: 50%; border: 0;
  background: rgba(20, 23, 43, .75); color: #fff; display: inline-flex; align-items: center; justify-content: center; padding: 0;
}
.nf-thumb-remove .bi { font-size: 11px; }
.nf-thumb-lg { width: 96px; height: 120px; }
.nf-thumb-sm { width: 52px; height: 64px; border-radius: 6px; }
.nf-thumb-sm .bi { font-size: 15px; }
.nf-thumb-xs { width: 40px; height: 40px; border-radius: 8px; }
.nf-thumb-xs .bi { font-size: 16px; }
.nf-thumb-add { border-style: dashed; border-color: rgba(23, 26, 45, .18); cursor: pointer; }
.nf-thumb-add .bi { font-size: 18px; }

/* --------------------------------------------------------- barre du haut */
.nf-topbar { background: var(--nf-surface); border-bottom: 1px solid var(--nf-border); position: sticky; top: 0; z-index: 1020; }
.nf-topbar-inner { height: 58px; display: flex; align-items: center; gap: 24px; padding: 0 16px; }
.nf-brand { display: inline-flex; align-items: center; gap: 10px; color: var(--nf-ink); font-weight: 600; font-size: 15px; letter-spacing: -.01em; }
.nf-brand img { height: 26px; width: auto; }
.nf-brand:hover { color: var(--nf-ink); }
.nf-brand--light { color: #fff; }
.nf-brand--light:hover { color: #fff; }
.nf-nav { display: flex; gap: 4px; margin-left: 14px; }
.nf-nav-link { font-weight: 500; font-size: 14px; color: var(--nf-secondary); padding: 8px 12px; border-radius: 8px; display: inline-flex; align-items: center; }
.nf-nav-link:hover { color: var(--nf-ink); background: var(--nf-row); }
.nf-nav-link.active { color: var(--nf-ink); background: var(--nf-indigo-tint); }
.nf-avatar {
  width: 30px; height: 30px; border-radius: 50%; background: var(--nf-indigo); color: #fff;
  font-weight: 600; font-size: 12px; display: inline-flex; align-items: center; justify-content: center; flex: none; letter-spacing: 0;
}
.nf-avatar-34 { width: 34px; height: 34px; }
.nf-avatar-38 { width: 38px; height: 38px; font-size: 13px; }
.nf-avatar-44 { width: 44px; height: 44px; font-size: 15px; }
.nf-avatar--tint { background: var(--nf-indigo-tint); color: var(--nf-indigo); }
.nf-avatar--ink { background: var(--nf-ink); }
.nf-avatar-btn { border: 0; padding: 0; margin-right: 0; cursor: pointer; background: var(--nf-indigo); }
.nf-avatar-btn:hover { background: var(--nf-indigo-dark); }
.nf-avatar-pill {
  margin-left: auto; display: inline-flex; align-items: center; gap: 8px; padding: 5px 10px 5px 6px;
  border: 1px solid rgba(23, 26, 45, .12); border-radius: 22px; background: var(--nf-surface); color: var(--nf-ink);
  font-weight: 500; font-size: 13px; cursor: pointer;
}
.nf-avatar-pill:hover, .nf-avatar-pill[aria-expanded="true"] { border-color: rgba(87, 91, 165, .3); background: var(--nf-indigo-soft); }
.nf-avatar-pill .bi { font-size: 11px; color: var(--nf-muted); }
.nf-dropdown {
  --bs-dropdown-min-width: 232px; --bs-dropdown-border-radius: 12px; --bs-dropdown-border-color: rgba(23, 26, 45, .1);
  --bs-dropdown-padding-y: 6px; --bs-dropdown-padding-x: 6px; --bs-dropdown-box-shadow: 0 12px 32px rgba(16, 24, 40, .14);
  box-shadow: 0 12px 32px rgba(16, 24, 40, .14); margin-top: 8px !important;
}
.nf-dropdown-header { padding: 10px 12px; border-bottom: 1px solid rgba(23, 26, 45, .08); margin-bottom: 4px; }
.nf-dropdown-header .name { font-weight: 600; font-size: 13px; color: var(--nf-ink); }
.nf-dropdown-header .sub { font-family: var(--nf-mono); font-size: 12px; color: var(--nf-muted); margin-top: 2px; }
.nf-dropdown-item {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px; border-radius: 8px;
  font-weight: 500; font-size: 13px; color: var(--nf-ink); background: none; border: 0; text-align: left;
}
.nf-dropdown-item .bi { font-size: 14px; color: var(--nf-muted); }
.nf-dropdown-item:hover { background: var(--nf-bg); color: var(--nf-ink); }
.nf-dropdown-item.is-accent .bi { color: var(--nf-indigo); }
.nf-dropdown-item.is-muted { color: var(--nf-secondary); }
.nf-dropdown-item.is-danger { color: var(--nf-magenta-text); }
.nf-dropdown-item.is-danger .bi { color: var(--nf-magenta); }
.nf-dropdown-item:disabled { opacity: .5; }
.nf-dropdown-divider { height: 1px; background: rgba(23, 26, 45, .08); margin: 4px 12px; }

/* Cloche de notifications */
.nf-notif-btn { position: relative; }
.nf-notif-badge {
  position: absolute; top: 4px; right: 4px; min-width: 16px; height: 16px; padding: 0 4px;
  font-size: 10px; line-height: 16px; text-align: center; border-radius: 999px; margin-left: 0;
}
.nf-notif-panel { width: 340px; max-width: calc(100vw - 32px); padding: 0; }
.nf-notif-list { max-height: 360px; overflow-y: auto; padding: 4px; }
.nf-notif-item { display: flex; align-items: flex-start; gap: 8px; width: 100%; padding: 10px 8px; border-radius: 8px; cursor: pointer; background: none; border: 0; text-align: left; }
.nf-notif-item:hover { background: var(--nf-bg); }
.nf-notif-item-body { flex: 1; min-width: 0; }
.nf-notif-item-msg { font-size: 13px; color: var(--nf-ink); line-height: 1.4; margin: 0; }
.nf-notif-item-date { font-size: 11.5px; color: var(--nf-muted); margin: 3px 0 0; font-family: var(--nf-mono); }
.nf-notif-item-close {
  flex: none; width: 26px; height: 26px; display: inline-flex; align-items: center; justify-content: center;
  border: 0; background: none; color: var(--nf-muted); border-radius: 6px;
}
.nf-notif-item-close:hover { background: var(--nf-row); color: var(--nf-ink); }
.nf-notif-empty { padding: 24px 12px; text-align: center; font-size: 13px; color: var(--nf-muted); margin: 0; }

/* Barre mobile (52 px) */
.nf-mobile-bar {
  height: 52px; background: var(--nf-surface); border-bottom: 1px solid var(--nf-border);
  display: flex; align-items: center; justify-content: space-between; padding: 0 16px;
  position: sticky; top: 0; z-index: 1020;
}
.nf-mobile-bar--sub { padding: 0 6px 0 4px; }
.nf-mobile-bar .nf-brand img { height: 22px; }
.nf-mobile-bar-left { display: flex; align-items: center; gap: 2px; min-width: 0; }
.nf-mobile-title { font-weight: 600; font-size: 15px; color: var(--nf-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nf-mobile-title-month { font-weight: 400; color: var(--nf-muted); }
.nf-mobile-bar-right { display: flex; align-items: center; gap: 2px; flex: none; }
.nf-mobile-counter { font-weight: 500; font-size: 12.5px; color: var(--nf-muted); padding-right: 12px; }
.nf-mobile-bar .nf-avatar-btn { margin-right: 0; }

/* Menu plein ecran mobile */
.nf-menu { position: fixed; inset: 0; z-index: 1050; background: var(--nf-ink); display: flex; flex-direction: column; overflow-y: auto; }
.nf-menu[hidden] { display: none; }
.nf-menu-bar { height: 52px; flex: none; display: flex; align-items: center; justify-content: space-between; padding: 0 8px 0 16px; }
.nf-menu-bar .nf-brand img { height: 22px; }
.nf-menu-body { flex: 1; padding: 26px 20px; display: flex; flex-direction: column; gap: 4px; }
.nf-menu-user { display: flex; align-items: center; gap: 12px; padding: 12px 4px 20px; }
.nf-menu-user-name { font-weight: 600; font-size: 15px; color: #fff; }
.nf-menu-user-sub { font-family: var(--nf-mono); font-size: 12px; color: rgba(255, 255, 255, .5); margin-top: 3px; }
.nf-menu-link {
  display: flex; align-items: center; gap: 14px; height: 56px; padding: 0 4px; border-top: 1px solid rgba(255, 255, 255, .1);
  font-weight: 500; font-size: 20px; color: rgba(255, 255, 255, .8);
}
.nf-menu-link .bi { font-size: 18px; color: rgba(255, 255, 255, .55); }
.nf-menu-link:hover { color: #fff; }
.nf-menu-link.active { font-weight: 600; color: #fff; }
.nf-menu-link.active .bi { color: var(--nf-sky); }
.nf-menu-link .nf-badge { font-size: 12px; padding: 2px 8px; }
.nf-menu-logout { margin-top: auto; padding: 20px 0; }
.nf-menu-logout button {
  width: 100%; height: 48px; display: flex; align-items: center; justify-content: center; gap: 9px;
  border: 1px solid rgba(255, 255, 255, .22); border-radius: 10px; background: none;
  font-weight: 500; font-size: 15px; color: rgba(255, 255, 255, .7);
}
.nf-menu-logout button .bi { font-size: 15px; }
.nf-menu-logout button:hover { color: #fff; border-color: rgba(255, 255, 255, .4); }

/* Bouton flottant et barre d'action fixe (mobile) */
.nf-fab {
  position: fixed; right: 18px; bottom: 26px; z-index: 1010; width: 60px; height: 60px; border-radius: 50%;
  background: var(--nf-indigo); color: #fff; box-shadow: 0 8px 22px rgba(87, 91, 165, .42);
  display: flex; align-items: center; justify-content: center; border: 0;
}
.nf-fab .bi { font-size: 24px; }
.nf-fab:hover { background: var(--nf-indigo-dark); color: #fff; }
.nf-bottom-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 1010; background: var(--nf-surface); border-top: 1px solid var(--nf-border);
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 10px)); display: flex; gap: 10px; align-items: center;
}
.nf-bottom-bar .btn { min-height: 50px; --bs-btn-border-radius: 10px; --bs-btn-font-size: 15px; --bs-btn-font-weight: 600; }
.nf-bottom-bar .btn-grow { flex: 1; }
.nf-bottom-bar form { display: contents; }
.nf-bottom-bar form.btn-grow { display: flex; flex: 1; }
.nf-bottom-bar form.btn-grow .btn { flex: 1; }
.nf-bottom-bar .nf-bottom-note { flex: 1; font-size: 13px; color: var(--nf-secondary); }

/* ------------------------------------------------------------ feuilles */
.nf-sheet { position: fixed; inset: 0; z-index: 1060; }
.nf-sheet[hidden] { display: none; }
.nf-sheet-backdrop { position: absolute; inset: 0; background: rgba(20, 23, 43, .45); }
.nf-sheet-panel {
  position: absolute; left: 0; right: 0; bottom: 0; max-height: 92dvh; background: var(--nf-surface);
  border-radius: 20px 20px 0 0; display: flex; flex-direction: column; margin: 0;
  padding-bottom: env(safe-area-inset-bottom, 0);
}
.nf-sheet-grip { width: 38px; height: 4px; border-radius: 4px; background: rgba(23, 26, 45, .18); margin: 12px auto 10px; flex: none; }
.nf-sheet-header { flex: none; padding: 0 16px 12px; display: flex; align-items: center; justify-content: space-between; gap: 10px; border-bottom: 1px solid rgba(23, 26, 45, .08); }
.nf-sheet-title { font-weight: 600; font-size: 15px; color: var(--nf-ink); text-align: center; flex: 1; }
.nf-sheet-header .btn-text { min-width: 56px; }
.nf-sheet-body { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 16px; }
.nf-sheet-footer { flex: none; padding: 16px 22px; border-top: 1px solid rgba(23, 26, 45, .08); display: flex; gap: 10px; justify-content: flex-end; }
@media (min-width: 992px) {
  .nf-sheet-backdrop { background: rgba(20, 23, 43, .28); }
  .nf-sheet-panel {
    left: auto; top: 0; right: 0; bottom: 0; width: 440px; max-height: none; border-radius: 0;
    border-left: 1px solid rgba(23, 26, 45, .1); box-shadow: -14px 0 40px rgba(16, 24, 40, .14);
  }
  .nf-sheet-grip { display: none; }
  .nf-sheet-header { padding: 18px 22px; }
  .nf-sheet-title { text-align: left; font-size: 16px; }
  .nf-sheet-body { padding: 20px 22px; }
  .nf-sheet--dialog .nf-sheet-panel {
    top: 50%; left: 50%; right: auto; bottom: auto; transform: translate(-50%, -50%);
    width: 480px; max-height: 90vh; border-radius: 14px; border: 1px solid rgba(23, 26, 45, .1);
    box-shadow: 0 24px 64px rgba(16, 24, 40, .22);
  }
}

/* --------------------------------------------------------------- listes */
.nf-item { display: flex; align-items: center; gap: 12px; padding: 13px 15px; border-bottom: 1px solid var(--nf-divider); color: inherit; }
.nf-item:last-child { border-bottom: 0; }
a.nf-item:hover { background: var(--nf-row); color: inherit; }
.nf-item.is-flagged { background: var(--nf-magenta-soft); }
.nf-item-icon { width: 36px; height: 36px; border-radius: 9px; background: var(--nf-indigo-tint); display: inline-flex; align-items: center; justify-content: center; flex: none; }
.nf-item-icon .bi { font-size: 15px; color: var(--nf-indigo); }
.nf-item-icon-lg { width: 38px; height: 38px; }
.nf-item-icon-lg .bi { font-size: 16px; }
.nf-item-icon-xl { width: 44px; height: 44px; border-radius: 10px; }
.nf-item-icon-xl .bi { font-size: 18px; }
.is-flagged .nf-item-icon { background: var(--nf-magenta-tint); }
.is-flagged .nf-item-icon .bi { color: var(--nf-magenta); }
.nf-item-link { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; color: inherit; }
.nf-item-link:hover { color: inherit; }
.nf-item-body { flex: 1; min-width: 0; }
.nf-td-link { color: var(--nf-ink); }
.nf-td-link:hover { color: var(--nf-indigo); }
.nf-item-title { font-weight: 500; font-size: 14px; color: var(--nf-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nf-item-sub { font-size: 12px; color: var(--nf-muted); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.is-flagged .nf-item-sub { color: var(--nf-magenta-text); }
.nf-item-amount { font-family: var(--nf-mono); font-weight: 500; font-size: 14px; color: var(--nf-ink); flex: none; }

/* Carte d'une note (liste mobile) */
.nf-note-card { padding: 14px 15px; display: flex; flex-direction: column; gap: 9px; }
.nf-note-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.nf-note-num { font-family: var(--nf-mono); font-weight: 500; font-size: 12.5px; color: var(--nf-muted); }
.nf-note-title { font-weight: 600; font-size: 15px; color: var(--nf-ink); margin-top: 4px; }
.nf-note-foot { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding-top: 9px; border-top: 1px solid rgba(23, 26, 45, .07); font-size: 12.5px; color: var(--nf-muted); }

/* Filtres */
.nf-chips { display: flex; gap: 7px; flex-wrap: wrap; }
.nf-chip {
  font-weight: 500; font-size: 13px; color: var(--nf-secondary); background: var(--nf-surface);
  border: 1px solid rgba(23, 26, 45, .12); border-radius: 20px; padding: 7px 14px; cursor: pointer; min-height: 34px;
}
.nf-chip:hover { border-color: rgba(23, 26, 45, .25); color: var(--nf-ink); }
.nf-chip.active { background: var(--nf-ink); border-color: var(--nf-ink); color: #fff; }

/* Tableaux (PC) */
.nf-table { width: 100%; border-collapse: collapse; margin: 0; }
.nf-table th {
  padding: 12px 20px; background: var(--nf-row); border-bottom: 1px solid rgba(23, 26, 45, .08);
  font-weight: 600; font-size: 11.5px; letter-spacing: .05em; text-transform: uppercase; color: var(--nf-muted); text-align: left; white-space: nowrap;
}
.nf-table td { padding: 15px 20px; border-bottom: 1px solid var(--nf-divider); vertical-align: middle; font-size: 13.5px; color: var(--nf-secondary); }
.nf-table tbody tr:last-child td { border-bottom: 0; }
.nf-table tbody tr.is-link { cursor: pointer; }
.nf-table tbody tr.is-link:hover td { background: #FBFBFD; }
.nf-table tbody tr.is-flagged td { background: var(--nf-magenta-soft); }
.nf-table .nf-td-ink { font-weight: 500; font-size: 14px; color: var(--nf-ink); }
.nf-table .nf-td-num { font-family: var(--nf-mono); font-weight: 500; }
.nf-table .nf-td-amount { font-family: var(--nf-mono); font-weight: 600; font-size: 14.5px; color: var(--nf-ink); text-align: right; white-space: nowrap; }
.nf-table .text-end { text-align: right; }
.nf-table .nf-td-tight { padding-top: 12px; padding-bottom: 12px; }
.nf-td-title { display: flex; align-items: center; gap: 10px; }
.nf-td-title .bi { font-size: 14px; color: var(--nf-indigo); flex: none; }
.is-flagged .nf-td-title .bi { color: var(--nf-magenta); }
.nf-td-sub { font-size: 12px; color: var(--nf-muted); margin-top: 3px; }
.nf-ok { color: var(--nf-green-text); display: inline-flex; align-items: center; gap: 6px; font-size: 13px; white-space: nowrap; }
.nf-ok .bi { font-size: 12px; }
.nf-warn { color: var(--nf-magenta-text); display: inline-flex; align-items: center; gap: 6px; font-size: 13px; white-space: nowrap; }
.nf-warn .bi { font-size: 12px; }
.nf-empty { padding: 28px 16px; text-align: center; color: var(--nf-muted); font-size: 13.5px; }

/* Recherche et pagination des tableaux */
.nf-list-toolbar { margin-bottom: 14px; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.nf-list-toolbar .nf-search { flex: 1 1 220px; }
.nf-list-toolbar .form-select { min-width: 200px; padding-right: 2.5rem; }
.nf-search { position: relative; max-width: 320px; }
.nf-search .bi-search { position: absolute; top: 50%; left: 13px; transform: translateY(-50%); color: var(--nf-muted); font-size: 14px; pointer-events: none; }
.nf-search input.form-control { padding-left: 36px; }
.nf-search .nf-search-clear {
  position: absolute; top: 50%; right: 6px; transform: translateY(-50%); border: 0; background: none;
  color: var(--nf-muted); width: 26px; height: 26px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
}
.nf-search .nf-search-clear:hover { color: var(--nf-ink); background: var(--nf-row); }
.nf-pagination { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 20px; border-top: 1px solid var(--nf-divider); font-size: 13px; color: var(--nf-muted); flex-wrap: wrap; }
.nf-list-mobile .nf-search { max-width: none; flex: 1 1 100%; }
.nf-list-mobile .nf-list-toolbar .form-select { width: 100% !important; min-width: 0; }
.nf-list-mobile .nf-stack { margin-bottom: 14px; }
.nf-list-mobile .nf-pagination { border-top: 0; padding: 4px 0 0; justify-content: center; }
/* Tableau empile en cartes sur mobile (cellules avec data-label) */
@media (max-width: 991.98px) {
  .nf-table-stack thead { display: none; }
  .nf-table-stack, .nf-table-stack tbody, .nf-table-stack tr, .nf-table-stack td { display: block; }
  .nf-table-stack tbody tr { padding: 14px 16px; border-bottom: 1px solid var(--nf-divider); }
  .nf-table-stack tbody tr:last-child { border-bottom: 0; }
  .nf-table-stack td { padding: 4px 0; border: 0; display: flex; align-items: center; justify-content: space-between; gap: 12px; text-align: right; word-break: break-word; }
  .nf-table-stack td::before { content: attr(data-label); flex: none; color: var(--nf-muted); font-size: 12.5px; text-align: left; }
  .nf-table-stack td:not([data-label]) { justify-content: flex-start; text-align: left; font-weight: 600; font-size: 15px; padding-bottom: 6px; }
  .nf-table-stack td:not([data-label])::before { content: none; }
  .nf-table-stack td[data-label="Groupes / rôles"] { flex-wrap: wrap; }
  .nf-table-stack td.nf-cell-actions { justify-content: flex-end; padding-top: 10px; }
  .nf-table-stack td.nf-cell-actions::before { content: none; }
  .nf-table-stack .btn-group { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
  .nf-table-stack .btn-group > .btn, .nf-table-stack .btn-group > form > .btn { border-radius: var(--bs-border-radius-sm) !important; margin-left: 0; }
}
.nf-pagination-info { white-space: nowrap; }
.nf-pagination-nav { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.nf-pagination-btn {
  font-weight: 500; font-size: 13px; color: var(--nf-secondary); background: var(--nf-surface);
  border: 1px solid rgba(23, 26, 45, .12); border-radius: 8px; padding: 5px 11px; cursor: pointer; min-height: 30px; min-width: 30px;
}
.nf-pagination-btn:hover:not(:disabled) { border-color: rgba(23, 26, 45, .25); color: var(--nf-ink); }
.nf-pagination-btn:disabled { opacity: .4; cursor: default; }
.nf-pagination-btn.active { background: var(--nf-ink); border-color: var(--nf-ink); color: #fff; }
.nf-pagination-ellipsis { padding: 0 4px; color: var(--nf-muted); }

/* Chronologie */
.nf-timeline { display: flex; flex-direction: column; gap: 12px; max-height: 320px; overflow-y: auto; padding-right: 4px; }
.nf-timeline-item { display: flex; gap: 11px; }
.nf-dot { width: 8px; height: 8px; border-radius: 50%; margin-top: 5px; flex: none; background: #C6CAD6; }
.nf-dot-refused { background: var(--nf-magenta); }
.nf-dot-sent { background: var(--nf-indigo); }
.nf-dot-accepted { background: var(--nf-green); }
.nf-timeline-label { font-weight: 500; font-size: 13px; color: var(--nf-ink); }
.nf-timeline-sub { font-size: 12px; color: var(--nf-muted); margin-top: 2px; }

/* Sous-navigation des reglages (PC) */
.nf-subnav { display: flex; flex-direction: column; gap: 2px; width: 210px; flex: none; position: sticky; top: 84px; }
.nf-subnav a { font-weight: 500; font-size: 14px; color: var(--nf-secondary); padding: 10px 12px; border-radius: 8px; }
.nf-subnav a:hover, .nf-subnav a.active { color: var(--nf-ink); background: var(--nf-indigo-tint); }
.nf-settings { display: flex; flex-direction: column; gap: 20px; }
.nf-settings-section { scroll-margin-top: 80px; display: flex; flex-direction: column; gap: 8px; }
.nf-settings-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 15px; color: var(--nf-ink); }
.nf-settings-row .bi-chevron-right { font-size: 12px; color: var(--nf-muted); }
.nf-settings-row-label { display: flex; align-items: center; gap: 11px; font-weight: 500; font-size: 14px; }
.nf-settings-row-label .bi { font-size: 15px; color: var(--nf-indigo); }
.nf-type { display: flex; gap: 12px; align-items: flex-start; }
.nf-type .nf-item-icon { width: 34px; height: 34px; }
.nf-type-title { font-weight: 600; font-size: 14px; color: var(--nf-ink); }
.nf-type-sub { font-size: 12.5px; line-height: 1.5; color: var(--nf-muted); margin-top: 3px; }
.nf-steps { margin: 0; padding-left: 18px; font-size: 13.5px; line-height: 1.6; color: var(--nf-body); display: flex; flex-direction: column; gap: 6px; }
@media (min-width: 992px) {
  .nf-settings-layout { display: flex; gap: 34px; align-items: flex-start; }
  .nf-settings { width: 560px; max-width: 100%; }
}

/* Validation responsable */
.nf-validation { display: flex; align-items: stretch; min-height: calc(100vh - 58px); }
.nf-side-list { width: 290px; flex: none; background: var(--nf-surface); border-right: 1px solid var(--nf-border); padding: 18px 0; }
.nf-side-list .nf-eyebrow { padding: 0 20px; margin-bottom: 12px; }
.nf-side-item { display: block; padding: 13px 20px; border-left: 3px solid transparent; color: inherit; }
.nf-side-item:hover { background: var(--nf-row); color: inherit; }
.nf-side-item.active { border-left-color: var(--nf-indigo); background: var(--nf-indigo-soft); }
.nf-side-item-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.nf-side-item-name { font-weight: 500; font-size: 14px; color: var(--nf-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nf-side-item.active .nf-side-item-name { font-weight: 600; }
.nf-side-item-amount { font-family: var(--nf-mono); font-weight: 500; font-size: 14px; color: var(--nf-ink); flex: none; }
.nf-side-item.active .nf-side-item-amount { font-weight: 600; }
.nf-side-item-sub { font-family: var(--nf-mono); font-size: 12px; color: var(--nf-muted); margin-top: 4px; }
.nf-validation-wrap { display: block; }
.nf-validation-main { min-width: 0; padding: 18px 16px 40px; display: flex; flex-direction: column; gap: 14px; }
body.nf-has-bottom-bar .nf-validation-main { padding-bottom: 110px; }
@media (min-width: 992px) {
  .nf-validation-wrap { display: flex; align-items: stretch; min-height: calc(100vh - 58px); }
  .nf-validation-main { flex: 1; padding: 26px 28px 48px; gap: 20px; }
  body.nf-has-bottom-bar .nf-validation-main { padding-bottom: 48px; }
}
.nf-validation-placeholder { flex: 1; display: flex; align-items: center; justify-content: center; color: var(--nf-muted); font-size: 14px; text-align: center; padding: 40px; }

/* Justificatifs (detail d'un poste) */
.nf-preview { height: 240px; background: var(--nf-grey); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 9px; color: var(--nf-muted); }
.nf-preview img { width: 100%; height: 100%; object-fit: contain; }
.nf-preview iframe { width: 100%; height: 100%; border: 0; }
.nf-preview .bi { font-size: 30px; }
.nf-preview-caption { font-size: 12.5px; color: var(--nf-muted); }
.nf-receipts-grid { display: flex; gap: 10px; flex-wrap: wrap; }
@media (min-width: 992px) { .nf-preview { height: 460px; } }

.nf-doc-list { flex-direction: column; max-height: 260px; }
.nf-doc-rows { display: flex; flex-direction: column; flex: 1; min-height: 0; overflow-y: auto; }
.nf-doc-row {
  display: flex; align-items: center; gap: 9px; width: 100%; border: 0; border-top: 1px solid var(--nf-divider);
  background: none; text-align: left; padding: 11px 18px; font-size: 13px; color: var(--nf-body); cursor: pointer;
}
.nf-doc-row:first-child { border-top: 0; }
.nf-doc-row:hover { background: var(--nf-grey); }
.nf-doc-row.is-active { background: var(--nf-indigo-tint); color: var(--nf-indigo-dark); font-weight: 600; }
.nf-doc-row .bi { font-size: 15px; color: var(--nf-muted); flex: none; }
.nf-doc-row.is-active .bi { color: var(--nf-indigo); }
.nf-doc-row span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Accueil (mobile et PC) */
.nf-home-mobile { min-height: calc(100vh - 52px); display: flex; flex-direction: column; justify-content: center; gap: 22px; padding: 24px 22px 48px; }
.nf-home-greeting { text-align: center; font-weight: 600; font-size: 26px; line-height: 1.25; letter-spacing: -.02em; color: var(--nf-ink); }
.nf-home-mobile .btn-lg { min-height: 56px; --bs-btn-font-size: 16px; }
@media (min-width: 992px) {
  .nf-home-mobile { min-height: calc(100vh - 58px); max-width: 420px; margin: 0 auto; padding: 24px 16px 48px; }
  .nf-home-greeting { font-size: 30px; }
}

/* Connexion */
.nf-login { min-height: 100vh; min-height: 100dvh; display: flex; background: var(--nf-surface); }
.nf-login-form { flex: 1; display: flex; flex-direction: column; justify-content: center; padding: 24px; }
.nf-login-inner { max-width: 360px; width: 100%; display: flex; flex-direction: column; gap: 28px; margin: 0 auto; }
.nf-login-head { display: flex; flex-direction: column; gap: 12px; }
.nf-login-head img { width: 56px; height: auto; }
.nf-login-head h1 { font-weight: 600; font-size: 27px; line-height: 1.2; letter-spacing: -.02em; margin: 0; }
.nf-login-head p { font-size: 15px; color: var(--nf-secondary); margin-top: 6px; }
.nf-login-fields { display: flex; flex-direction: column; gap: 14px; }
.nf-login-fields .btn { margin-top: 6px; min-height: 52px; }
.nf-login-note { font-size: 12.5px; line-height: 1.5; color: var(--nf-muted); }
.nf-login-brand { width: 480px; flex: none; background: var(--nf-ink); flex-direction: column; justify-content: flex-end; padding: 48px; gap: 26px; }
.nf-swatches { display: flex; gap: 10px; }
.nf-swatches span { width: 44px; height: 44px; border-radius: 8px; display: block; }
.nf-login-brand-title { font-weight: 600; font-size: 22px; line-height: 1.35; color: #fff; text-wrap: pretty; }
.nf-login-brand-text { font-size: 15px; line-height: 1.6; color: rgba(255, 255, 255, .6); margin-top: 10px; text-wrap: pretty; }
@media (min-width: 992px) {
  .nf-login { background: var(--nf-bg); }
  .nf-login-form { padding: 0 96px; }
  .nf-login-inner {
    max-width: 480px;
    background: var(--nf-surface); border: 1px solid var(--nf-border); border-radius: var(--nf-radius);
    box-shadow: 0 20px 45px rgba(23, 26, 45, .07); padding: 40px 44px;
  }
  .nf-login-head img { width: 48px; }
  .nf-login-head h1 { font-size: 28px; }
  .nf-login-fields .btn { min-height: 50px; }
}

/* Divers */
.nf-ghost { opacity: .55; pointer-events: none; }
.nf-inline-form { display: inline; }
.nf-divider { height: 1px; background: var(--nf-divider); }
.nf-sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
