/* =====================================================================
   DAFManager — styles.css
   Charte WIA : brun #865830 / brun foncé #6a4526 / or #c4922a
   Typo : Josefin Sans (titres) + Nunito (texte)
   ===================================================================== */

:root {
  --brun: #865830;
  --brun-fonce: #6a4526;
  --accent: var(--brun);
  --or: #c4922a;
  --creme: #f5efe8;
  --creme-2: #efe6da;
  --surface: #ffffff;
  --ink: #2e2017;
  --muted: #8a7a68;
  --line: #e2d5c5;
  --ok: #1e6b3a;
  --danger: #b3261e;

  --r: 14px;
  --bn-h: 56px;        /* hauteur de la barre de navigation mobile */
  --shadow: 0 12px 34px rgba(106, 69, 38, .14);
  --shadow-sm: 0 4px 14px rgba(106, 69, 38, .10);
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: 'Nunito', system-ui, sans-serif;
  color: var(--ink);
  background: var(--creme);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, .brand-word, .brand-sm {
  font-family: 'Josefin Sans', 'Nunito', sans-serif;
  letter-spacing: .3px;
}

/* --- Loader --- */
.boot {
  display: flex; align-items: center; gap: 10px;
  justify-content: center; min-height: 100vh;
  color: var(--muted); font-weight: 600;
}
.boot-dot {
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--or);
  animation: pulse 1s ease-in-out infinite;
}
@keyframes pulse { 0%, 100% { opacity: .3; transform: scale(.85); } 50% { opacity: 1; transform: scale(1); } }

/* =====================================================================
   CONNEXION — deux panneaux
   ===================================================================== */
.auth {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  min-height: 100vh;
}

.auth-brand {
  position: relative;
  background:
    radial-gradient(120% 90% at 18% 10%, rgba(196, 146, 42, .22), transparent 55%),
    linear-gradient(155deg, var(--brun-fonce) 0%, var(--brun) 70%);
  color: var(--creme);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 56px;
  overflow: hidden;
}
/* Signature : ligne de trésorerie ascendante en filigrane */
.auth-brand::after {
  content: "";
  position: absolute; inset: 0;
  background-image:
    linear-gradient(to top, rgba(196,146,42,.16) 0 2px, transparent 2px);
  background-size: 100% 64px;
  -webkit-mask-image: linear-gradient(60deg, transparent 30%, #000 120%);
          mask-image: linear-gradient(60deg, transparent 30%, #000 120%);
  opacity: .5;
  pointer-events: none;
}
.brand-inner { position: relative; z-index: 1; }
.mark { margin-bottom: 22px; }
.brand-word { font-size: 38px; font-weight: 700; line-height: 1; }
.brand-word span { color: var(--or); }
.brand-tag { margin-top: 12px; font-size: 16px; color: rgba(245, 239, 232, .82); max-width: 22ch; }
.brand-foot {
  position: absolute; left: 56px; bottom: 40px;
  font-size: 12px; letter-spacing: 2px; font-weight: 700;
  color: rgba(245, 239, 232, .6);
}

.auth-form {
  display: flex; align-items: center; justify-content: center;
  background: var(--creme);
  padding: 40px 24px;
}
.form-wrap { width: 100%; max-width: 360px; }
.auth-form h1 { font-size: 28px; margin: 0 0 4px; color: var(--brun-fonce); }
.sub { margin: 0 0 24px; color: var(--muted); font-size: 14px; }

label {
  display: block; font-size: 13px; font-weight: 700;
  margin: 16px 0 6px; color: var(--ink);
}
input {
  width: 100%; padding: 12px 14px; font-size: 15px;
  font-family: inherit; color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line); border-radius: 10px;
  transition: border-color .15s, box-shadow .15s;
}
input:focus {
  outline: none;
  border-color: var(--or);
  box-shadow: 0 0 0 3px rgba(196, 146, 42, .18);
}

button[type="submit"] {
  margin-top: 26px; width: 100%; padding: 13px;
  font-family: inherit; font-size: 15px; font-weight: 800;
  color: #fff; background: var(--brun);
  border: 0; border-radius: 10px; cursor: pointer;
  transition: background .15s, transform .05s;
}
button[type="submit"]:hover { background: var(--brun-fonce); }
button[type="submit"]:active { transform: translateY(1px); }
button[type="submit"]:disabled { opacity: .65; cursor: progress; }

.alert {
  background: #fbe9e7; color: var(--danger);
  border: 1px solid #f3c9c4; border-radius: 10px;
  padding: 10px 12px; font-size: 13.5px; font-weight: 600;
  margin-bottom: 4px;
}
.auth-foot {
  margin-top: 28px; text-align: center;
  font-size: 12px; letter-spacing: 1px; color: var(--muted);
}

/* =====================================================================
   POSTE DE TRAVAIL (shell)
   ===================================================================== */
.shell { min-height: 100vh; display: flex; flex-direction: column; }

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px; height: 60px;
  background: var(--surface); border-bottom: 1px solid var(--line);
}
.brand-sm {
  font-size: 20px; font-weight: 700; color: var(--brun-fonce);
}
.brand-sm span { color: var(--or); }
.topbar-right { display: flex; align-items: center; gap: 16px; }
.user-chip { text-align: right; line-height: 1.15; }
.u-name { font-weight: 700; font-size: 14px; }
.u-role { font-size: 12px; color: var(--muted); }

.btn-ghost {
  font-family: inherit; font-size: 13px; font-weight: 700;
  color: var(--brun); background: transparent;
  border: 1px solid var(--line); border-radius: 9px;
  padding: 8px 14px; cursor: pointer;
  transition: background .15s, border-color .15s;
}
.btn-ghost:hover { background: var(--creme-2); border-color: var(--or); }

.placeholder {
  flex: 1; display: flex; align-items: center; justify-content: center;
  padding: 24px;
}
.ph-card {
  background: var(--surface); border: 1px solid var(--line);
  border-top: 4px solid var(--or);
  border-radius: var(--r); box-shadow: var(--shadow-sm);
  padding: 32px; max-width: 460px; width: 100%;
}
.ph-card h1 { font-size: 24px; margin: 0 0 8px; color: var(--brun-fonce); }
.ph-card p { color: var(--muted); font-size: 14.5px; line-height: 1.55; margin: 0 0 18px; }
.diag { list-style: none; margin: 0; padding: 0; }
.diag li {
  display: flex; justify-content: space-between; align-items: center;
  padding: 11px 0; border-top: 1px solid var(--line); font-size: 14px;
}
.diag li span { color: var(--muted); }
.diag li b { color: var(--ink); font-size: 16px; }

/* =====================================================================
   Accessibilité & responsive
   ===================================================================== */
:focus-visible { outline: 2px solid var(--or); outline-offset: 2px; }

@media (max-width: 820px) {
  .auth { grid-template-columns: 1fr; }
  .auth-brand {
    min-height: 230px; padding: 32px;
    justify-content: flex-end;
  }
  .brand-foot { left: 32px; bottom: 20px; }
  .brand-word { font-size: 32px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* =====================================================================
   DASHBOARD — Vision 360°
   ===================================================================== */
.main { flex: 1; background: var(--creme); }
.dash { max-width: 1180px; margin: 0 auto; padding: 26px 24px 60px; }

.dash-head { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 18px; }
.dash-head h1 { font-size: 24px; margin: 0; color: var(--brun-fonce); }
.dash-sub { color: var(--muted); font-size: 13px; margin-top: 4px; display: flex; align-items: center; gap: 8px; }

/* KPI */
.kpi-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 18px; }
.kpi {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r); padding: 18px 20px; box-shadow: var(--shadow-sm);
  border-left: 4px solid var(--line);
}
.kpi-label { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); }
.kpi-value { font-family: 'Josefin Sans', sans-serif; font-size: 26px; font-weight: 700; margin-top: 6px; color: var(--ink); line-height: 1.1; }
.kpi-sub { font-size: 12px; color: var(--muted); margin-top: 6px; }
.kpi.main { border-left-color: var(--or); }
.kpi.main .kpi-value { color: var(--brun-fonce); }
.kpi.neg { border-left-color: var(--danger); }
.kpi.neg .kpi-value { color: var(--danger); }
.kpi.ok { border-left-color: var(--ok); }

/* Cards */
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r); box-shadow: var(--shadow-sm);
  padding: 18px 20px; margin-bottom: 18px;
}
.card-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.card-head h2 { font-size: 15px; margin: 0; color: var(--brun-fonce); }
.card-head .hint, .hint { font-weight: 400; font-size: 12px; color: var(--muted); }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.chart-box { position: relative; height: 240px; }
.chart-empty { height: 240px; display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 13px; }

/* Table */
.table-wrap { overflow-x: auto; }
.bank-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.bank-table thead th {
  text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .5px;
  color: var(--muted); font-weight: 700; padding: 8px 12px; border-bottom: 1px solid var(--line);
}
.bank-table th.num, .bank-table td.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.bank-table td { padding: 12px; border-bottom: 1px solid var(--creme-2); vertical-align: middle; }
.bank-table tr:last-child td { border-bottom: 0; }
.bank-table td.neg { color: var(--danger); font-weight: 700; }
.bank-table td.pos { color: var(--ok); font-weight: 700; }
.muted-row { opacity: .55; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 8px; vertical-align: middle; }
.lib { font-weight: 600; }
.tag {
  display: inline-block; margin-left: 8px; font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .4px; padding: 2px 7px; border-radius: 20px;
  background: var(--creme-2); color: var(--brun); vertical-align: middle;
}
.tag-warn { background: #fbe9d6; color: #9a5a12; }
.tag-info { background: #e7edf6; color: #3f5e86; }
.dash-na { color: var(--muted); }

/* Gauge */
.gauge-col { min-width: 220px; }
.gauge { height: 9px; border-radius: 6px; background: var(--creme-2); overflow: hidden; }
.gauge-fill { height: 100%; border-radius: 6px; transition: width .4s ease; }
.gauge-fill.ok { background: var(--ok); }
.gauge-fill.warn { background: var(--or); }
.gauge-fill.danger { background: var(--danger); }
.gauge-legend { font-size: 11px; color: var(--muted); margin-top: 4px; font-variant-numeric: tabular-nums; }

/* Placements */
.placement-row { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; border-top: 1px solid var(--creme-2); font-size: 14px; }
.placement-row:first-of-type { border-top: 0; }

/* États */
.empty-card, .error-card { text-align: center; padding: 40px; }
.empty-card h2 { color: var(--brun-fonce); margin: 0 0 8px; }
.empty-card p { color: var(--muted); max-width: 46ch; margin: 0 auto; font-size: 14px; }
.error-card { color: var(--danger); font-weight: 600; }

@media (max-width: 900px) {
  .kpi-row { grid-template-columns: 1fr 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .kpi-row { grid-template-columns: 1fr; }
}

/* =====================================================================
   SHELL — sidebar + layout applicatif
   ===================================================================== */
.layout { display: flex; min-height: 100vh; }

.sidebar {
  width: 244px; flex-shrink: 0;
  background: var(--side-bg, linear-gradient(180deg, var(--brun-fonce) 0%, var(--brun) 100%));
  color: var(--creme);
  display: flex; flex-direction: column; padding: 18px 0;
  position: sticky; top: 0; height: 100vh; align-self: flex-start;
  transition: width .18s ease;
}
.side-brand { display: flex; align-items: center; gap: 10px; padding: 4px 20px 22px; }
.side-word { font-family: 'Josefin Sans', sans-serif; font-size: 20px; font-weight: 700; }
.side-word i { color: var(--or); font-style: normal; }

.side-nav { flex: 1; display: flex; flex-direction: column; gap: 2px; padding: 0 12px; overflow-y: auto; }
.nav-item {
  display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 11px 12px; border: 0; border-radius: 9px;
  background: transparent; color: rgba(245, 239, 232, .82);
  font-family: inherit; font-size: 14px; font-weight: 600; text-align: left;
  cursor: pointer; transition: background .15s, color .15s;
}
.nav-item:hover { background: rgba(245, 239, 232, .10); color: #fff; }
.nav-item.active { background: rgba(245, 239, 232, .14); color: #fff; box-shadow: inset 3px 0 0 var(--or); }
.nav-item svg { flex-shrink: 0; opacity: .92; }

.side-foot { padding: 16px 20px 4px; font-size: 11px; letter-spacing: 1.5px; color: rgba(245, 239, 232, .5); }

.content { flex: 1; display: flex; flex-direction: column; min-width: 0; }

/* Topbar (révisée : burger + titre + utilisateur) */
.topbar {
  display: flex; align-items: center; gap: 14px;
  padding: 0 24px; height: 60px;
  background: var(--surface); border-bottom: 1px solid var(--line);
}
.page-title {
  flex: 1; margin: 0; font-family: 'Josefin Sans', sans-serif;
  font-size: 18px; font-weight: 600; color: var(--brun-fonce);
}
.burger {
  display: none; align-items: center; justify-content: center;
  width: 38px; height: 38px; border: 1px solid var(--line);
  border-radius: 9px; background: var(--surface); color: var(--brun); cursor: pointer;
}
.scrim { display: none; }

/* Écran « à venir » */
.soon-card { text-align: center; padding: 48px 32px; }
.soon-card h2 { color: var(--brun-fonce); margin: 6px 0 8px; font-size: 22px; }
.soon-card p { color: var(--muted); max-width: 46ch; margin: 0 auto; font-size: 14px; }
.soon-badge {
  display: inline-block; font-size: 11px; font-weight: 800; letter-spacing: .6px;
  text-transform: uppercase; color: var(--brun); background: var(--creme-2);
  padding: 4px 10px; border-radius: 20px;
}

/* Responsive : sidebar repliable */
@media (max-width: 860px) {
  .sidebar {
    position: fixed; top: 0; bottom: 0; left: 0; z-index: 30;
    transform: translateX(-100%); transition: transform .2s ease;
  }
  .layout.menu-open .sidebar { transform: none; }
  .burger { display: inline-flex; }
  .layout.menu-open .scrim {
    display: block; position: fixed; inset: 0; z-index: 20;
    background: rgba(46, 32, 23, .4);
  }
}

/* =====================================================================
   BARRE DE NAVIGATION MOBILE (app-style) + relèvement du bouton d'aide
   ===================================================================== */
.bottom-nav { display: none; }

@media (max-width: 860px) {
  .bottom-nav {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 38;
    background: var(--surface); border-top: 1px solid var(--line);
    padding-bottom: env(safe-area-inset-bottom);
    box-shadow: 0 -6px 18px rgba(106, 69, 38, .08);
  }
  /* Quand le tiroir « Plus » est ouvert, on masque la barre (drawer plein). */
  .layout.menu-open .bottom-nav { display: none; }

  .bn-item {
    flex: 1 1 0; min-width: 0; height: var(--bn-h);
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
    border: 0; background: transparent; cursor: pointer;
    color: var(--muted); font-family: inherit; font-size: 11px; font-weight: 700;
    padding: 6px 2px; -webkit-tap-highlight-color: transparent;
  }
  .bn-item svg { width: 22px; height: 22px; }
  .bn-item span {
    max-width: 100%; overflow: hidden; text-overflow: ellipsis;
    white-space: nowrap; letter-spacing: .2px;
  }
  .bn-item.active { color: var(--accent); }
  .bn-item:active { background: rgba(134, 88, 48, .06); }

  /* Le contenu ne passe pas sous la barre */
  .content .main { padding-bottom: calc(var(--bn-h) + env(safe-area-inset-bottom) + 8px); }

  /* Le bouton d'aide flottant et son panneau remontent au-dessus de la barre */
  .layout .wa-root .wa-fab {
    bottom: calc(var(--bn-h) + env(safe-area-inset-bottom) + 16px);
  }
  .layout .wa-root .wa-panel {
    bottom: calc(var(--bn-h) + env(safe-area-inset-bottom) + 12px);
  }
}

@media print {
  .bottom-nav { display: none !important; }
}

/* =====================================================================
   SIDEBAR RÉTRACTABLE (desktop) — rail d'icônes
   ===================================================================== */
.side-rail-toggle {
  display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 10px 12px; margin-bottom: 4px; border: 0; border-radius: 9px;
  background: transparent; color: rgba(245, 239, 232, .7);
  font-family: inherit; font-size: 13px; font-weight: 700; text-align: left;
  cursor: pointer; transition: background .15s, color .15s;
}
.side-rail-toggle:hover { background: rgba(245, 239, 232, .10); color: #fff; }
.side-rail-toggle svg { flex-shrink: 0; transition: transform .15s; }
.layout.is-rail .side-rail-toggle svg { transform: scaleX(-1); }
@media (max-width: 860px) { .side-rail-toggle { display: none; } }

@media (min-width: 861px) {
  .layout.is-rail .sidebar { width: 64px; }
  .layout.is-rail .side-brand { justify-content: center; padding: 4px 0 18px; }
  .layout.is-rail .side-word,
  .layout.is-rail .side-tag,
  .layout.is-rail .side-logo,
  .layout.is-rail .side-user-top,
  .layout.is-rail .nav-item span,
  .layout.is-rail .nav-chap-head svg:last-child,
  .layout.is-rail .nav-children,
  .layout.is-rail .side-logout span,
  .layout.is-rail .side-rail-toggle span { display: none; }

  .layout.is-rail .side-nav { padding: 0 8px; }
  .layout.is-rail .nav-item { justify-content: center; gap: 0; padding: 11px 0; }
  .layout.is-rail .side-foot { padding: 12px 8px 4px; }
  .layout.is-rail .side-logout { justify-content: center; gap: 0; padding: 11px 0; }
  .layout.is-rail .side-rail-toggle { justify-content: center; gap: 0; padding: 11px 0; }
}

/* =====================================================================
   MODULE COMPTES — boutons, modale, formulaire
   ===================================================================== */
.btn-primary {
  font-family: inherit; font-size: 13.5px; font-weight: 800;
  color: #fff; background: var(--accent); border: 0; border-radius: 9px;
  padding: 10px 16px; cursor: pointer; transition: background .15s, transform .05s, filter .15s;
}
.btn-primary:hover { filter: brightness(.92); }
.btn-primary:active { transform: translateY(1px); }
.btn-primary:disabled { opacity: .65; cursor: progress; }

.btn-link {
  font-family: inherit; font-size: 13px; font-weight: 700;
  color: var(--brun); background: transparent; border: 0; cursor: pointer; padding: 4px 6px;
}
.btn-link:hover { color: var(--brun-fonce); text-decoration: underline; }

/* Modale */
.modal-scrim {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(46, 32, 23, .45);
  display: flex; align-items: flex-start; justify-content: center;
  padding: 40px 16px; overflow-y: auto;
}
.modal {
  background: var(--surface); border-radius: var(--r);
  box-shadow: var(--shadow); width: 100%; max-width: 560px;
  padding: 24px 26px; border-top: 4px solid var(--or);
}
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.modal-head h2 { margin: 0; font-size: 19px; color: var(--brun-fonce); }
.modal-x {
  border: 0; background: transparent; font-size: 26px; line-height: 1;
  color: var(--muted); cursor: pointer; padding: 0 4px;
}
.modal-x:hover { color: var(--ink); }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; }
.modal-foot .btn-ghost, .modal-foot .btn-primary { margin-top: 0; width: auto; }

/* Formulaire en grille */
.grid-form { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 16px; }
.grid-form label { margin-top: 14px; }

select {
  width: 100%; padding: 12px 14px; font-size: 15px; font-family: inherit; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px;
}
select:focus { outline: none; border-color: var(--or); box-shadow: 0 0 0 3px rgba(196, 146, 42, .18); }

input[type="checkbox"] { width: auto; }
input[type="color"] { width: 52px; height: 42px; padding: 3px; cursor: pointer; }

.check {
  display: flex; align-items: center; gap: 10px; margin-top: 18px;
  font-size: 14px; font-weight: 600;
}

@media (max-width: 560px) {
  .grid-form { grid-template-columns: 1fr; }
}

/* =====================================================================
   COMPTES — logos & pastilles de couleur
   ===================================================================== */
.logo-cell {
  width: 24px; height: 24px; border-radius: 6px; object-fit: contain;
  background: #fff; border: 1px solid var(--line);
  margin-right: 8px; vertical-align: middle;
}

.logo-field { display: flex; gap: 16px; align-items: center; margin-bottom: 2px; }
.logo-prev {
  width: 58px; height: 58px; border-radius: 12px; object-fit: contain;
  background: #fff; border: 1px solid var(--line); flex-shrink: 0;
}
.logo-prev.empty {
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-family: 'Josefin Sans', sans-serif; font-size: 26px; font-weight: 700;
  border: 0;
}
.logo-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.file-btn { margin: 0; width: auto; display: inline-flex; align-items: center; cursor: pointer; }
.logo-note { font-size: 12.5px; color: var(--muted); }
.logo-note.err { color: var(--danger); }
.logo-hint { width: 100%; font-size: 11.5px; color: var(--muted); }

.swatches { display: flex; flex-wrap: wrap; gap: 7px; align-items: center; padding-top: 4px; }
.swatch {
  width: 24px; height: 24px; border-radius: 50%; cursor: pointer;
  border: 2px solid #fff; box-shadow: 0 0 0 1px var(--line); padding: 0;
}
.swatch.on { box-shadow: 0 0 0 2px var(--or); }
.swatches input[type="color"] { width: 30px; height: 30px; padding: 2px; }

/* Pied de modale avec action de suppression à gauche */
.modal-foot { justify-content: space-between; align-items: center; }
.foot-right { display: flex; gap: 10px; }
.btn-danger-link {
  font-family: inherit; font-size: 13px; font-weight: 700; color: var(--danger);
  background: transparent; border: 0; cursor: pointer; padding: 6px 2px;
}
.btn-danger-link:hover { text-decoration: underline; }
.btn-danger-link:disabled { opacity: .5; cursor: default; }

/* ===== Saisie des mouvements ===== */
.mvt-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 14px 18px; }
.mvt-bar-lbl { font-weight: 700; color: var(--brun-fonce, #6a4526); margin: 0; }
.mvt-select {
  min-width: 240px; max-width: 100%; padding: 9px 12px; border: 1px solid #e3d8c9;
  border-radius: 9px; background: #fff; font-family: inherit; font-size: 14px; color: #3a2c20;
}
.mode-badge {
  font-size: 11px; font-weight: 700; padding: 4px 10px; border-radius: 999px;
  border: 1px solid transparent; white-space: nowrap;
}
.mode-badge.saisi   { background: #f1ece4; color: #6a4526; border-color: #e3d8c9; }
.mode-badge.calcule { background: #e8f3ef; color: #2e7d6b; border-color: #bfe0d6; }

.mvt-kpis .kpi-value.sm { font-size: 19px; }
.empty-mini { padding: 24px 18px; color: #8a7c6d; font-size: 14px; }
.bank-table td.center, .bank-table th.center { text-align: center; }
.bank-table td.nowrap { white-space: nowrap; }
.bank-table td.actions { white-space: nowrap; }
.tick { color: #2e7d6b; font-weight: 800; }

/* Champ de montant formaté (séparateurs de milliers) */
.amount-input { text-align: right; font-variant-numeric: tabular-nums; letter-spacing: .02em; }

/* ===== Rapprochement bancaire ===== */
.rappro-state label { display: block; font-size: 12px; font-weight: 700; color: var(--brun-fonce, #6a4526); margin-bottom: 5px; }
.rappro-inputs { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 6px 0 16px; }
.rappro-state input[type="date"], .rappro-state .rs-comment input, .rappro-inputs input {
  width: 100%; padding: 9px 12px; border: 1px solid #e3d8c9; border-radius: 9px;
  background: #fff; font-family: inherit; font-size: 14px; color: #3a2c20;
}
.ecart-badge { font-size: 12px; font-weight: 700; padding: 5px 12px; border-radius: 999px; white-space: nowrap; }
.ecart-badge.ok   { background: #e8f3ef; color: #2e7d6b; border: 1px solid #bfe0d6; }
.ecart-badge.warn { background: #fbeceb; color: #b3261e; border: 1px solid #f1c9c4; }

.rappro-calc { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.calc-col { background: #faf6f0; border: 1px solid #efe6da; border-radius: 10px; padding: 12px 14px; }
.calc-row { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; padding: 5px 0; color: #5b4a3a; }
.calc-row b { font-variant-numeric: tabular-nums; white-space: nowrap; }
.calc-row.total { border-top: 1px solid #e3d8c9; margin-top: 4px; padding-top: 8px; font-weight: 700; color: #3a2c20; }

.rappro-save { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-top: 16px; }
.rs-fields { display: flex; gap: 14px; flex-wrap: wrap; flex: 1; }
.rs-comment { flex: 1; min-width: 200px; }
.saved-note { margin-top: 10px; color: #2e7d6b; font-size: 13px; font-weight: 600; }

.rappro-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.rappro-totals { display: flex; gap: 16px; flex-wrap: wrap; padding: 2px 2px 10px;
  font-size: 13px; border-bottom: 1px solid #efe6da; margin-bottom: 2px; }
.rappro-table td.ptr { width: 34px; text-align: center; }
.rappro-table td.ptr input { cursor: pointer; }
.rappro-table tr.pointed { background: #f3f8f5; }
.rappro-table tr.pointed .lib { color: #6a7c70; }
.tag-ok { background: #e8f3ef; color: #2e7d6b; border: 1px solid #bfe0d6; }
.btn-link.sm { font-size: 14px; padding: 2px 6px; }
.span2 { grid-column: 1 / -1; }
.hist-com { color: #8a7c6d; font-size: 12px; margin-left: 8px; }

@media (max-width: 900px) { .rappro-cols { grid-template-columns: 1fr; } }
@media (max-width: 680px) { .rappro-inputs, .rappro-calc { grid-template-columns: 1fr; } }

/* ===== Gestionnaires (annuaire) ===== */
.gest-search { display: flex; gap: 10px; align-items: center; padding: 12px 16px; }
.gest-search input {
  flex: 1; padding: 9px 12px; border: 1px solid #e3d8c9; border-radius: 9px;
  background: #fff; font-family: inherit; font-size: 14px; color: #3a2c20;
}
.gest-group { padding-top: 8px; }
.gest-group-head { display: flex; align-items: center; gap: 10px; padding: 2px 2px 12px;
  border-bottom: 1px solid #efe6da; margin-bottom: 14px; }
.gest-group-head h2 { margin: 0; font-size: 16px; }
.gest-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.gest-card { border: 1px solid #efe6da; border-radius: 10px; padding: 12px 14px; background: #fffdfb; }
.gest-card-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.gest-nom { font-weight: 700; color: #3a2c20; line-height: 1.25; }
.gest-fn { font-size: 12px; color: #8a7c6d; margin-top: 2px; }
.gest-lines { margin-top: 9px; display: flex; flex-direction: column; gap: 6px; }
.gest-line { display: flex; align-items: center; gap: 7px; font-size: 13px; color: #6a4526; text-decoration: none; min-width: 0; }
.gest-line:hover { text-decoration: underline; }
.gest-line svg { flex-shrink: 0; color: #a87a4e; }
.gest-line .ell { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gest-compte { margin-top: 9px; }

/* Avatar de banque (initiale colorée) quand pas de logo de compte */
.bank-avatar {
  display: inline-flex; align-items: center; justify-content: center;
  width: 24px; height: 24px; border-radius: 6px; flex-shrink: 0;
  margin-right: 8px; color: #fff; font-weight: 800; font-size: 12px; line-height: 1;
}

/* ===== Administration (utilisateurs) ===== */
.badge-on  { background: #e8f3ef; color: #2e7d6b; border: 1px solid #bfe0d6; font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 999px; }
.badge-off { background: #f1ece4; color: #8a7c6d; border: 1px solid #e3d8c9; font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 999px; }
.ell-cell { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.muted { color: #8a7c6d; }
.check-cell { display: flex; align-items: flex-end; }
.perim-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 6px 14px; margin: 8px 0 4px; }
.perim-item { display: flex; align-items: center; gap: 8px; font-size: 13px; color: #3a2c20; cursor: pointer; }
.perim-item input { cursor: pointer; }

/* ===== Périmètre catégorisé + niveau (Aucun / Lecteur / Éditeur) ===== */
.perim-cat { border: 1px solid var(--line); border-radius: 12px; margin: 10px 0; overflow: hidden; }
.perim-cat-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 9px 12px; background: var(--creme); border-bottom: 1px solid var(--line); flex-wrap: wrap;
}
.perim-cat-title { font-weight: 700; font-size: 13.5px; color: var(--brun-fonce); }
.perim-bulk { display: flex; align-items: center; gap: 6px; }
.perim-bulk-lbl { font-size: 11.5px; color: var(--muted); }
.perim-bulk button {
  font-family: inherit; font-size: 11.5px; font-weight: 600; color: var(--brun);
  background: #fff; border: 1px solid var(--line); border-radius: 999px;
  padding: 3px 10px; cursor: pointer; transition: background .12s, color .12s, border-color .12s;
}
.perim-bulk button:hover { background: var(--brun); color: #fff; border-color: var(--brun); }
.perim-rows { display: flex; flex-direction: column; }
.perim-acc-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 8px 12px; border-bottom: 1px solid var(--creme);
}
.perim-acc-row:last-child { border-bottom: none; }
.perim-acc-name { font-size: 13px; color: var(--ink); display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.perim-acc-bank { font-size: 11px; color: var(--muted); white-space: nowrap; }

.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; background: #fff; flex-shrink: 0; }
.seg-btn {
  font-family: inherit; font-size: 12px; font-weight: 600; color: var(--muted);
  background: transparent; border: none; padding: 5px 12px; cursor: pointer;
  border-left: 1px solid var(--line); transition: background .12s, color .12s;
}
.seg-btn:first-child { border-left: none; }
.seg-btn:hover { background: var(--creme); }
.seg-btn.seg-aucun.is-active   { background: #f1ece4; color: #8a7c6d; }
.seg-btn.seg-lecteur.is-active  { background: #e9f0f7; color: #2c5d86; }
.seg-btn.seg-editeur.is-active  { background: var(--brun); color: #fff; }
.perim-summary { font-size: 12.5px; color: var(--ink); margin: 4px 0 2px; }

/* ===== Journal ===== */
.jrnl-list { display: flex; flex-direction: column; }
.jrnl-entry { display: flex; gap: 16px; padding: 14px 4px; border-bottom: 1px solid var(--creme); }
.jrnl-entry:last-child { border-bottom: none; }
.jrnl-side { flex: 0 0 168px; display: flex; flex-direction: column; gap: 5px; align-items: flex-start; }
.jrnl-date { font-weight: 700; font-size: 13px; color: var(--brun-fonce); }
.jrnl-acc { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--ink); }
.jrnl-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.jrnl-body { flex: 1 1 auto; min-width: 0; }
.jrnl-com { font-size: 13.5px; color: var(--ink); line-height: 1.5; white-space: pre-wrap; word-wrap: break-word; }
.jrnl-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 6px; font-size: 12px; }
.jrnl-actions { display: inline-flex; gap: 10px; }
.jrnl-textarea {
  width: 100%; font-family: inherit; font-size: 14px; color: var(--ink);
  border: 1px solid var(--line); border-radius: 9px; padding: 9px 11px;
  resize: vertical; box-sizing: border-box; background: #fff;
}
.jrnl-textarea:focus { outline: none; border-color: var(--brun); }
@media (max-width: 620px) {
  .jrnl-entry { flex-direction: column; gap: 6px; }
  .jrnl-side { flex-basis: auto; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 8px; }
}

/* ===== Pied de sidebar : utilisateur + déconnexion (style RHManager) ===== */
.side-foot { padding: 14px 16px 4px; border-top: 1px solid rgba(245, 239, 232, .12); }
.side-user { padding: 0 2px 2px; }
.su-name { font-size: 13px; font-weight: 700; color: #fff; line-height: 1.2; }
.su-role { font-size: 11px; color: rgba(245, 239, 232, .6); }
.side-logout {
  display: flex; align-items: center; gap: 10px; width: 100%;
  margin: 10px 0 8px; padding: 10px 12px;
  border: 1px solid rgba(245, 239, 232, .2); border-radius: 9px;
  background: transparent; color: rgba(245, 239, 232, .9);
  font-family: inherit; font-size: 14px; font-weight: 600; cursor: pointer;
  transition: background .15s, color .15s;
}
.side-logout:hover { background: rgba(245, 239, 232, .1); color: #fff; }
.side-logout svg { flex-shrink: 0; opacity: .9; }
.side-tag { font-size: 11px; letter-spacing: 1.5px; color: rgba(245, 239, 232, .4); }

/* ===== Carte « Vos accès » (formulation positive) ===== */
.access-card { padding: 28px 30px; }
.access-card h2 { color: var(--brun-fonce); margin: 0 0 10px; font-size: 20px; }
.access-card p { color: #5b4a3a; font-size: 14px; margin: 6px 0; }
.access-card p.muted { color: var(--muted); }
.access-list { margin: 12px 0 14px; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 8px; }
.access-list li {
  background: var(--creme-2); color: var(--brun-fonce); border: 1px solid var(--line);
  border-radius: 999px; padding: 6px 14px; font-size: 13px; font-weight: 600;
}

/* ===== Consignes ===== */
.head-actions { display: flex; gap: 10px; align-items: center; }
.seg.tabs { margin: 0 0 14px; }
.tab-caption { font-size: 12px; color: var(--muted); margin: -6px 0 14px; }
.tab-count { font-size: 11px; font-weight: 700; margin-left: 6px; opacity: .8; }
.arch-bar { display: flex; align-items: center; gap: 10px; margin: 0 0 12px; flex-wrap: wrap; }
.seg.sm .seg-btn { font-size: 12px; padding: 5px 12px; }
.arch-month { width: auto; font-family: inherit; font-size: 13px; padding: 5px 9px;
  border: 1px solid var(--line); border-radius: 8px; color: var(--ink); }
.modal-lg { max-width: 640px; }

.st-badge { font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 999px; white-space: nowrap; }
.st-badge.st-avoir   { background: #fbe9d6; color: #9a5a12; }
.st-badge.st-vu      { background: #e9f0f7; color: #2c5d86; }
.st-badge.st-encours { background: #f6ecd6; color: #8a6516; }
.st-badge.st-traite  { background: #e8f3ef; color: #2e7d6b; border: 1px solid #bfe0d6; }

.cons-list { display: flex; flex-direction: column; }
.cons-item { display: flex; gap: 14px; align-items: flex-start; justify-content: space-between;
  padding: 13px 4px; border-bottom: 1px solid var(--creme); }
.cons-item:last-child { border-bottom: none; }
.cons-item.is-done { opacity: .62; }
.cons-main { min-width: 0; flex: 1 1 auto; }
.cons-top { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 5px; }
.cons-acc { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--ink); }
.cons-meta { font-size: 11.5px; color: var(--muted); }
.cons-com { font-size: 13.5px; color: var(--ink); line-height: 1.5; white-space: pre-wrap; word-wrap: break-word; }
.cons-progress { display: flex; align-items: center; gap: 10px; margin-top: 7px; flex-wrap: wrap; }
.cons-bar { width: 140px; height: 7px; border-radius: 999px; background: #ece2d4; overflow: hidden; }
.cons-bar span { display: block; height: 100%; background: #2e7d6b; }
.cons-counts { font-size: 11.5px; color: var(--ink); }
.cons-ratio { font-size: 12px; font-weight: 700; color: var(--brun-fonce); white-space: nowrap; }
.cons-chips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 7px; }
.cons-actions { display: flex; flex-direction: column; gap: 6px; align-items: flex-end; flex-shrink: 0; }
.cons-actions .seg-btn { border: 1px solid var(--line); border-radius: 999px; }
.seg-btn.is-active           { background: var(--accent); color: #fff; }
.seg-btn.st-vu.is-active      { background: #2c5d86; color: #fff; }
.seg-btn.st-encours.is-active { background: #b9892b; color: #fff; }
.seg-btn.st-traite.is-active  { background: #2e7d6b; color: #fff; }

.cible-seg { margin: 4px 0 6px; }
.pick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 6px 14px;
  margin: 6px 0 4px; max-height: 220px; overflow: auto; padding: 4px; border: 1px solid var(--line); border-radius: 10px; }
.pilote-check { display: flex; align-items: center; gap: 8px; margin: 4px 0 2px; font-size: 13px; color: var(--ink); }

/* État de situation */
.report-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 4px 0 10px; }
.report-bar input { width: auto; }
.report-bar select { width: auto; font-family: inherit; font-size: 13px; padding: 5px 9px; border: 1px solid var(--line); border-radius: 8px; }
.report-bar label { font-size: 12px; color: var(--muted); }
.report-asof { font-size: 13px; color: var(--ink); margin-bottom: 10px; }
.report-cons { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin-bottom: 10px; }
.report-cons-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.report-cons-com { font-size: 13.5px; font-weight: 600; color: var(--ink); }
.report-counts { display: flex; gap: 5px; flex-wrap: wrap; }
.report-recips { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 9px; padding-top: 9px; border-top: 1px dashed var(--line); }
.report-recip { font-size: 12px; color: var(--ink); display: inline-flex; align-items: center; gap: 5px; }

/* ===== Cloche + tiroir de notifications ===== */
.notif-wrap { margin-left: auto; position: relative; }
.notif-bell { position: relative; background: transparent; border: none; color: var(--brun-fonce);
  cursor: pointer; padding: 6px; border-radius: 9px; display: inline-flex; }
.notif-bell:hover { background: var(--creme); }
.notif-badge { position: absolute; top: 0; right: 0; min-width: 17px; height: 17px; padding: 0 4px;
  background: var(--danger); color: #fff; font-size: 10.5px; font-weight: 700; line-height: 17px;
  text-align: center; border-radius: 999px; }
.notif-scrim { position: fixed; inset: 0; background: rgba(20,12,6,.18); z-index: 60; }
.notif-drawer { position: fixed; top: 0; right: 0; width: 360px; max-width: 88vw; height: 100vh;
  background: var(--surface); box-shadow: var(--shadow); z-index: 61; padding: 16px; overflow-y: auto; }
.notif-head { display: flex; align-items: center; justify-content: space-between; font-size: 15px;
  color: var(--brun-fonce); margin-bottom: 12px; }
.notif-item { border: 1px solid var(--line); border-radius: 11px; padding: 10px 12px; margin-bottom: 9px; }
.notif-item-top { display: flex; align-items: center; gap: 7px; }
.notif-com { font-size: 13px; color: var(--ink); line-height: 1.4; }
.notif-meta { font-size: 11px; color: var(--muted); margin: 3px 0 8px; }
.notif-actions { display: flex; gap: 6px; }
.notif-actions .seg-btn { border: 1px solid var(--line); border-radius: 999px; font-size: 11.5px; padding: 4px 9px; }
.prio-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--danger); flex-shrink: 0; }
.notif-foot { width: 100%; margin-top: 6px; background: var(--creme); border: none; border-radius: 9px;
  padding: 9px; font-family: inherit; font-size: 13px; font-weight: 600; color: var(--brun-fonce); cursor: pointer; }
.notif-foot:hover { background: #ece2d4; }
@media (max-width: 620px) {
  .cons-item { flex-direction: column; }
  .cons-actions { flex-direction: row; align-items: center; }
}

/* =====================================================================
   THÈME SOMBRE (dark mode)
   On redéfinit les tokens : body/cartes/modales/topbar consomment ces
   variables, donc l'ossature bascule automatiquement. On surcharge ensuite
   les quelques fonds clairs « en dur ».
   ===================================================================== */
[data-theme="dark"] {
  color-scheme: dark;
  --brun: #a4733f;
  --brun-fonce: #7d5430;
  --or: #d2a23e;
  --creme: #15171c;
  --creme-2: #1c1f26;
  --surface: #1e2128;
  --ink: #eceef2;
  --muted: #9aa3b2;
  --line: #2d323c;
  --ok: #54b481;
  --danger: #e06a62;
  --shadow: 0 12px 34px rgba(0, 0, 0, .55);
  --shadow-sm: 0 4px 14px rgba(0, 0, 0, .45);
}
[data-theme="dark"] input,
[data-theme="dark"] select,
[data-theme="dark"] textarea {
  background: var(--surface); color: var(--ink); border-color: var(--line);
}
[data-theme="dark"] .seg { background: var(--surface); }
[data-theme="dark"] .perim-bulk button { background: var(--surface); }
[data-theme="dark"] .gest-card { background: var(--surface); border-color: var(--line); }

/* =====================================================================
   PARAMÈTRES — mise en page
   ===================================================================== */
.set-wrap { display: grid; grid-template-columns: 220px 1fr; gap: 22px; align-items: start; }
.set-nav { display: flex; flex-direction: column; gap: 3px; }
.set-nav button {
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
  text-align: left; padding: 10px 13px; border: none; background: transparent;
  border-radius: 10px; font-family: inherit; font-size: 14px; color: var(--ink); cursor: pointer;
}
.set-nav button:hover:not(:disabled) { background: var(--creme-2); }
.set-nav button.is-active { background: var(--accent); color: #fff; }
.set-nav button:disabled { color: var(--muted); cursor: default; }
.set-soon {
  font-size: 9.5px; font-weight: 800; letter-spacing: .5px; text-transform: uppercase;
  color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 1px 7px;
}
.set-section {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
  padding: 22px 24px; box-shadow: var(--shadow-sm);
}
.set-section h2 { margin: 0 0 4px; font-size: 18px; }
.set-hint { color: var(--muted); font-size: 13px; margin: 0 0 18px; }
.theme-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.theme-card {
  border: 2px solid var(--line); border-radius: 12px; padding: 12px; cursor: pointer;
  background: var(--surface); text-align: left; font-family: inherit; transition: border-color .12s;
}
.theme-card:hover { border-color: var(--brun); }
.theme-card.is-active { border-color: var(--brun); box-shadow: 0 0 0 3px rgba(164, 115, 63, .18); }
.theme-prev {
  height: 56px; border-radius: 8px; margin-bottom: 10px; border: 1px solid var(--line);
  overflow: hidden; display: flex;
}
.theme-name { font-weight: 700; font-size: 14px; color: var(--ink); }
.theme-on { font-weight: 600; color: var(--brun); }
.theme-sub { font-size: 11.5px; color: var(--muted); margin-top: 1px; }
@media (max-width: 860px) {
  .set-wrap { grid-template-columns: 1fr; }
  .set-nav { flex-direction: row; flex-wrap: wrap; }
  .theme-grid { grid-template-columns: 1fr; }
}

/* =====================================================================
   SIDEBAR — logo entreprise + compte utilisateur en haut
   ===================================================================== */
.side-logo { display: flex; justify-content: center; padding: 0 18px 14px; }
.side-logo img {
  max-height: 48px; max-width: 100%; object-fit: contain;
  background: #fff; border-radius: 10px; padding: 6px 10px;
}
.side-user-top {
  margin: 0 14px 14px; padding: 9px 12px;
  background: rgba(245, 239, 232, .09); border-radius: 10px;
}

/* =====================================================================
   PARAMÈTRES — section Entreprise
   ===================================================================== */
.set-sub { font-size: 13px; font-weight: 800; letter-spacing: .3px; margin: 22px 0 10px; color: var(--brun-fonce); }
[data-theme="dark"] .set-sub { color: var(--or); }
.logo-empty { color: var(--muted); font-size: 20px; }
.set-form { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 18px; }
.set-form label { display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; font-weight: 700; color: var(--muted); }
.set-form input {
  padding: 9px 11px; border: 1px solid var(--line); border-radius: 9px;
  font-family: inherit; font-size: 14px; color: var(--ink); background: var(--surface);
}
.color-presets { display: flex; flex-wrap: wrap; gap: 8px; }
.color-chip {
  display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px 6px 6px;
  border: 2px solid var(--line); border-radius: 999px; background: var(--surface);
  font-family: inherit; font-size: 12.5px; color: var(--ink); cursor: pointer;
}
.color-chip:hover { border-color: var(--brun); }
.color-chip.is-active { border-color: var(--brun); box-shadow: 0 0 0 3px rgba(164, 115, 63, .18); }
.color-dot { width: 18px; height: 18px; border-radius: 50%; border: 1px solid rgba(0, 0, 0, .15); flex-shrink: 0; }
.color-custom { display: flex; align-items: center; gap: 10px; margin-top: 12px; font-size: 13px; }
.color-custom label { font-weight: 700; color: var(--muted); }
.color-custom input[type="color"] {
  width: 46px; height: 30px; padding: 0; border: 1px solid var(--line);
  border-radius: 8px; background: none; cursor: pointer;
}
.set-note { font-size: 12px; color: var(--muted); margin-top: 10px; }
.set-actions { display: flex; align-items: center; gap: 14px; margin-top: 22px; }
.saved-flag { color: var(--ok); font-weight: 700; font-size: 13px; }
.file-btn { cursor: pointer; }
.danger-link { color: var(--danger); margin-left: 8px; }
@media (max-width: 860px) { .set-form { grid-template-columns: 1fr; } }

/* =====================================================================
   PARAMÈTRES — palette personnelle (Apparence)
   ===================================================================== */
.pal-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 4px; }
.pal-card { border: 2px solid var(--line); border-radius: 12px; padding: 8px; cursor: pointer; background: var(--surface); font-family: inherit; text-align: left; }
.pal-card:hover { border-color: var(--accent); }
.pal-card.is-active { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(0, 0, 0, .06); }
.pal-prev { display: flex; height: 40px; border-radius: 8px; overflow: hidden; border: 1px solid var(--line); }
.pal-side { flex: 1; }
.pal-accent { width: 34%; }
.pal-name { font-size: 12.5px; font-weight: 700; margin-top: 7px; color: var(--ink); }
@media (max-width: 860px) { .pal-grid { grid-template-columns: 1fr 1fr; } }

/* Couleurs personnalisées (option « Personnalisé », Apparence — admin) */
.perso-colors { margin-top: 10px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--creme-2); }
.perso-colors .color-custom { margin-top: 6px; }

/* =====================================================================
   SIDEBAR — chapitres avec sous-navigation
   ===================================================================== */
.nav-chap { display: flex; flex-direction: column; }
.nav-chap-head { width: 100%; }
.nav-chap-head svg:last-child { margin-left: auto; opacity: .65; transition: transform .15s; }
.nav-chap-head.open svg:last-child { transform: rotate(90deg); }
.nav-children { display: flex; flex-direction: column; gap: 2px; margin: 1px 0 4px; }
.nav-child { padding-left: 38px; font-size: 13.5px; }
.nav-child svg { width: 16px; height: 16px; opacity: .75; }

/* =====================================================================
   CHAPITRE BANQUE — module Banques
   ===================================================================== */
.bank-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(244px, 1fr)); gap: 14px; }
.bank-card { display: flex; gap: 12px; align-items: center; text-align: left; padding: 14px;
  border: 1px solid var(--line); border-radius: 12px; background: var(--surface); cursor: pointer;
  font-family: inherit; box-shadow: var(--shadow-sm); }
.bank-card:hover { border-color: var(--accent); }
.bank-card-body { min-width: 0; }
.bank-card-name { font-weight: 800; font-size: 15px; color: var(--ink); }
.bank-card-sub { font-size: 12px; color: var(--muted); margin-top: 1px; }
.bank-card-meta { font-size: 11.5px; color: var(--muted); margin-top: 6px; }
.bank-logo { width: 46px; height: 46px; border-radius: 10px; flex-shrink: 0; display: flex;
  align-items: center; justify-content: center; overflow: hidden; background: #fff; }
.bank-logo img { width: 100%; height: 100%; object-fit: contain; }
.bank-logo-ini { color: #fff; font-weight: 800; font-size: 18px; font-family: 'Josefin Sans', sans-serif; }
.bank-detail-head { display: flex; align-items: center; gap: 14px; }
.back-btn { padding: 6px 10px; }
.bank-tabs { display: flex; gap: 4px; flex-wrap: wrap; margin: 4px 0 16px; border-bottom: 1px solid var(--line); }
.bank-tab { padding: 9px 14px; border: 0; background: none; font-family: inherit; font-size: 13.5px;
  font-weight: 700; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent;
  margin-bottom: -1px; display: inline-flex; align-items: center; gap: 8px; }
.bank-tab.is-active { color: var(--ink); border-bottom-color: var(--accent); }
.bank-tab.is-soon { cursor: default; opacity: .8; }
.bank-section { margin-bottom: 16px; }
.bank-section h2 { font-size: 15px; margin: 0 0 12px; display: flex; align-items: center; gap: 8px; }
.bank-count { font-size: 12px; font-weight: 700; color: var(--muted); background: var(--creme-2);
  border-radius: 999px; padding: 1px 9px; }
.bank-kv-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px 22px; }
.bank-kv { display: flex; flex-direction: column; gap: 2px; }
.bank-kv-l { font-size: 11.5px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .3px; }
.bank-kv-v { font-size: 14px; color: var(--ink); }
.bank-notes { margin-top: 14px; }
.bank-notes div { font-size: 14px; color: var(--ink); white-space: pre-wrap; margin-top: 4px; }
.bank-list { display: flex; flex-direction: column; }
.bank-row { display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 10px 2px; border-bottom: 1px solid var(--line); }
.bank-row:last-child { border-bottom: none; }
.bank-row-name { font-weight: 700; font-size: 14px; color: var(--ink); }
.bank-row-sub { font-size: 12px; color: var(--muted); }
.bank-row-contact { display: flex; flex-direction: column; align-items: flex-end; font-size: 13px; }
.bank-row-amount { font-weight: 700; font-size: 14px; color: var(--ink); white-space: nowrap; }
.bank-form { padding: 4px 2px; display: flex; flex-direction: column; gap: 14px; }
.bank-field-full { display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; font-weight: 700; color: var(--muted); }
.bank-field-full input, .bank-field-full textarea { padding: 9px 11px; border: 1px solid var(--line);
  border-radius: 9px; font-family: inherit; font-size: 14px; color: var(--ink); background: var(--surface); }

.sync-note { font-size: 13px; color: var(--ink); margin-bottom: 14px; }

/* --- Conditions & documents (B2) --- */
.bank-cond { display: flex; flex-direction: column; gap: 14px; }
.cond-block { display: flex; flex-direction: column; gap: 5px; }
.cond-label { font-size: 12.5px; font-weight: 700; color: var(--muted); }
.cond-area { padding: 10px 12px; border: 1px solid var(--line); border-radius: 9px;
  font-family: inherit; font-size: 14px; line-height: 1.5; color: var(--ink);
  background: var(--surface); resize: vertical; min-height: 72px; }
.cond-area:focus { outline: none; border-color: var(--accent); }
.cond-read { font-size: 14px; line-height: 1.55; color: var(--ink); white-space: pre-wrap;
  background: var(--creme); border: 1px solid var(--line); border-radius: 9px; padding: 10px 12px; }
.cond-empty { font-size: 13px; color: var(--muted); font-style: italic; }
.cond-actions { display: flex; align-items: center; justify-content: flex-end; gap: 12px; margin-top: 14px; }
.cond-flash { font-size: 13px; color: var(--brun); font-weight: 700; }

.doc-hint { font-size: 13px; color: var(--muted); margin: -4px 0 14px; }
.doc-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.doc-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px;
  border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.doc-ico { flex: none; width: 38px; height: 38px; border-radius: 8px; display: grid; place-items: center;
  font-size: 10px; font-weight: 800; letter-spacing: .5px; color: #fff; background: var(--brun); }
.doc-main { flex: 1; min-width: 0; }
.doc-titre { font-weight: 700; font-size: 14px; color: var(--ink); text-decoration: none; word-break: break-word; }
.doc-titre:hover { text-decoration: underline; }
.doc-meta { display: flex; flex-wrap: wrap; gap: 10px; font-size: 12px; color: var(--muted); margin-top: 3px; align-items: center; }
.doc-badge { background: var(--creme); border: 1px solid var(--line); border-radius: 999px;
  padding: 1px 9px; font-weight: 700; color: var(--brun); }
.doc-confirm { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink); white-space: nowrap; }

.doc-upload { border-top: 1px solid var(--line); padding-top: 14px; display: flex; flex-direction: column; gap: 10px; }
.doc-up-row { display: flex; gap: 10px; flex-wrap: wrap; }
.cond-sel, .cond-in { padding: 9px 11px; border: 1px solid var(--line); border-radius: 9px;
  font-family: inherit; font-size: 14px; color: var(--ink); background: var(--surface); }
.cond-sel { flex: none; min-width: 200px; }
.cond-in { flex: 1; min-width: 180px; }
.doc-file { flex: 1; min-width: 180px; display: flex; align-items: center; padding: 9px 11px;
  border: 1px dashed var(--line); border-radius: 9px; background: var(--creme);
  font-size: 13.5px; color: var(--muted); cursor: pointer; }
.doc-file input { display: none; }
.doc-file span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* --- Grilles taux & dates de valeur (B3) --- */
.grid-scroll { overflow-x: auto; margin-bottom: 10px; }
.rate-grid { width: 100%; border-collapse: collapse; font-size: 13.5px; min-width: 560px; }
.rate-grid th { text-align: left; font-size: 12px; font-weight: 700; color: var(--muted);
  padding: 0 8px 6px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.rate-grid td { padding: 4px 8px; vertical-align: middle; border-bottom: 1px solid var(--line); color: var(--ink); }
.rate-grid .w-val { width: 90px; } .rate-grid .w-uni { width: 96px; } .rate-grid .w-act { width: 34px; }
.rate-grid .ta-r { text-align: right; } .rate-grid .ta-c { text-align: center; }
.rate-grid .muted { color: var(--muted); }
.ge { width: 100%; padding: 7px 9px; border: 1px solid var(--line); border-radius: 8px;
  font-family: inherit; font-size: 13.5px; color: var(--ink); background: var(--surface); box-sizing: border-box; }
.ge:focus { outline: none; border-color: var(--accent); }
input.ge.ta-r { text-align: right; }
.row-x { width: 26px; height: 26px; border: none; border-radius: 7px; cursor: pointer;
  background: var(--creme); color: var(--muted); font-size: 17px; line-height: 1; }
.row-x:hover { background: #f3d9d2; color: #b3402a; }
.grid-empty { text-align: center; color: var(--muted); font-style: italic; padding: 12px 8px; }
.add-row { margin-top: 2px; }


/* --- Réclamations --- */
.rec-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 16px; }
.rec-kpi { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }
.rec-kpi-l { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .3px; }
.rec-kpi-v { font-family: 'Josefin Sans', sans-serif; font-size: 22px; font-weight: 700; color: var(--ink); margin-top: 6px; line-height: 1.1; }
.rec-kpi-sub { font-size: 12px; color: var(--muted); margin-top: 4px; }
.rec-kpi.rec-pos { border-left: 3px solid #2e7d52; }
.rec-kpi.rec-pos .rec-kpi-v { color: #2e7d52; }
.rec-kpi.rec-warn { border-left: 3px solid var(--or); }
@media (max-width: 880px) { .rec-cards { grid-template-columns: repeat(2, 1fr); } }

.rec-filter { margin-bottom: 14px; flex-wrap: wrap; }
.seg-n { display: inline-block; min-width: 18px; padding: 0 5px; margin-left: 4px; border-radius: 999px;
  background: rgba(0,0,0,.08); font-size: 11px; font-weight: 700; }
.seg-btn.is-active .seg-n { background: rgba(255,255,255,.3); }

.rec-table-card { padding: 6px 6px 4px; }
.rec-table { width: 100%; border-collapse: collapse; font-size: 13.5px; min-width: 720px; }
.rec-table th { text-align: left; font-size: 12px; font-weight: 700; color: var(--muted);
  padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.rec-table td { padding: 9px 10px; border-bottom: 1px solid var(--line); color: var(--ink); vertical-align: top; }
.rec-table tr:last-child td { border-bottom: none; }
.rec-table .ta-r { text-align: right; } .rec-table .ta-c { text-align: center; }
.rec-table .nowrap { white-space: nowrap; }
.rec-table .muted { color: var(--muted); }
.rec-table .pos { color: #2e7d52; font-weight: 700; }
.rec-motif { max-width: 320px; }

/* --- Recouvrement clients : tableau tenu en largeur -------------------------
   Le tableau debordait a droite sans que rien ne le retienne : une seule
   cellule un peu longue (un mode ou un motif) poussait toutes les colonnes
   suivantes hors ecran, boutons d'action compris. Largeurs fixes + repli du
   texte : le contenu descend d'une ligne au lieu de chasser vers la droite.
   Portee volontairement limitee a .rcv-table : .rec-table sert aussi aux
   reclamations, engagements et effets, qu'on ne veut pas modifier ici. */
.rcv-table { table-layout: fixed; min-width: 940px; }
.rcv-table .rcv-c-date   { width: 96px; }
.rcv-table .rcv-c-client { width: 190px; }
.rcv-table .rcv-c-mode   { width: 128px; }
.rcv-table .rcv-c-motif  { width: 220px; }
.rcv-table .rcv-c-mt     { width: 124px; }
.rcv-table .rcv-c-st     { width: 104px; }
.rcv-table .rcv-c-act    { width: 46px; }
.rcv-table td.rcv-wrap { white-space: normal; overflow-wrap: anywhere; hyphens: auto; }
.rcv-table td, .rcv-table th { overflow-wrap: anywhere; }

/* Ascenseur horizontal visible en permanence : sur les postes ou le systeme
   masque les barres, rien n'indiquait qu'il restait des colonnes a droite. */
.grid-scroll-vis { overflow-x: auto; scrollbar-width: thin; padding-bottom: 2px; }
.grid-scroll-vis::-webkit-scrollbar { height: 10px; }
.grid-scroll-vis::-webkit-scrollbar-track { background: var(--line, #e4d9c9); border-radius: 6px; }
.grid-scroll-vis::-webkit-scrollbar-thumb { background: var(--brun, #865830); border-radius: 6px; }
.rec-retour { font-size: 12px; color: var(--muted); margin-top: 3px; font-style: italic; }
.row-edit { width: 28px; height: 28px; border: 1px solid var(--line); border-radius: 7px; cursor: pointer;
  background: var(--surface); color: var(--muted); font-size: 14px; }
.row-edit:hover { border-color: var(--accent); color: var(--accent); }

.rec-badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 700; white-space: nowrap; }
.rec-badge.st-ouverte  { background: #fdeecf; color: #9a6a12; }
.rec-badge.st-en_cours { background: #dce8f7; color: #2c5f99; }
.rec-badge.st-traitee  { background: #d8efe0; color: #2e7d52; }
.rec-badge.st-rejetee  { background: #ece8e4; color: #7a6f66; }

/* --- Recouvrement (réutilise les primitives .rec-*) --- */
.rec-kpi.rec-danger { border-left: 3px solid var(--danger); }
.rec-kpi.rec-danger .rec-kpi-v { color: var(--danger); }
.rec-badge.st-attendu  { background: #fdeecf; color: #9a6a12; }
.rec-badge.st-encaisse { background: #d8efe0; color: #2e7d52; }
.rec-badge.st-annule   { background: #ece8e4; color: #7a6f66; }
.rec-badge.st-retard   { background: #f7dcd6; color: #b3402a; }
.rec-table td.rcv-late { color: var(--danger); font-weight: 700; }

/* --- Engagements (badges paiements stp- / crédits stc-) --- */
.rec-badge.stp-a_payer     { background: #fdeecf; color: #9a6a12; }
.rec-badge.stp-paye        { background: #d8efe0; color: #2e7d52; }
.rec-badge.stp-annule      { background: #ece8e4; color: #7a6f66; }
.rec-badge.stc-a_renouveler { background: #fdeecf; color: #9a6a12; }
.rec-badge.stc-renouvele    { background: #d8efe0; color: #2e7d52; }
.rec-badge.stc-clos         { background: #ece8e4; color: #7a6f66; }

/* =====================================================================
   AGENDA DES TÂCHES
   ===================================================================== */
.ag-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.ag-nav { display: flex; align-items: center; gap: 8px; }
.ag-navbtn { padding: 4px 12px; font-size: 18px; line-height: 1; }
.ag-title { margin: 0; font-family: 'Josefin Sans', sans-serif; font-size: 18px; color: var(--brun-fonce); min-width: 150px; text-align: center; text-transform: capitalize; }

.ag-kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 14px; }
.ag-kpi.is-late .kpi-value { color: var(--danger); }

.ag-cal-card { padding: 12px; }
.ag-cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.ag-cal-head { font-size: 12px; font-weight: 700; color: var(--muted); text-align: center; padding: 4px 0; }
.ag-cal-head.is-we { color: var(--brun); }
.ag-cell { min-height: 92px; border: 1px solid var(--line); border-radius: 10px; padding: 6px; background: var(--surface); display: flex; flex-direction: column; gap: 4px; overflow: hidden; }
.ag-cell.is-out { background: var(--creme-2); opacity: .55; }
.ag-cell.is-we { background: rgba(134, 88, 48, .035); }
.ag-cell.is-today { border-color: var(--or); box-shadow: inset 0 0 0 1px var(--or); }
.ag-daynum { font-size: 12px; font-weight: 700; color: var(--muted); }
.ag-cell.is-today .ag-daynum { color: var(--or); }
.ag-chips { display: flex; flex-direction: column; gap: 3px; }
.ag-chip { display: flex; align-items: center; gap: 5px; width: 100%; border: 0; background: rgba(46, 32, 23, .04); border-radius: 6px; padding: 3px 6px; cursor: pointer; text-align: left; font-family: inherit; font-size: 11.5px; color: var(--ink); }
.ag-chip:hover { background: rgba(46, 32, 23, .09); }
.ag-chip.is-done { opacity: .5; text-decoration: line-through; }
.ag-chip.is-late { background: rgba(179, 38, 30, .09); }
.ag-chip-t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ag-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--c, var(--brun)); flex-shrink: 0; }
.ag-more { border: 0; background: transparent; color: var(--brun); font-family: inherit; font-size: 11px; font-weight: 700; cursor: pointer; text-align: left; padding: 1px 6px; }

.ag-late-card { margin-top: 14px; }
.ag-list { display: flex; flex-direction: column; gap: 6px; }
.ag-row { display: flex; align-items: center; gap: 10px; width: 100%; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); padding: 9px 12px; cursor: pointer; text-align: left; font-family: inherit; }
.ag-row:hover { border-color: var(--brun); }
.ag-row-main { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.ag-row-t { font-weight: 700; font-size: 14px; color: var(--ink); }
.ag-row-sub { font-size: 12px; color: var(--muted); }
.ag-row-date { font-size: 13px; font-weight: 700; color: var(--muted); }
.ag-row-date.is-late { color: var(--danger); }

.ag-modal { max-width: 540px; }
.ag-modal-lg { max-width: 760px; }
.ag-desc { color: var(--muted); font-size: 14px; margin: 0 0 12px; line-height: 1.5; }
.ag-meta { display: flex; flex-direction: column; gap: 0; margin: 4px 0 14px; }
.ag-meta > div { display: flex; justify-content: space-between; gap: 12px; font-size: 13.5px; border-bottom: 1px solid var(--line); padding: 7px 0; }
.ag-meta span { color: var(--muted); }
.ag-meta b { color: var(--ink); text-align: right; }
.ag-shift { color: var(--brun) !important; }
.ag-confirmed { background: rgba(30, 107, 58, .09); color: var(--ok); border-radius: 9px; padding: 9px 12px; font-size: 13.5px; font-weight: 700; }
.ag-note-ro { font-style: italic; color: var(--muted); font-size: 13px; margin: 8px 0 0; }
.ag-field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 12px; font-size: 12.5px; font-weight: 700; color: var(--muted); }
.ag-field input, .ag-field select, .ag-field textarea { font-family: inherit; font-size: 14px; font-weight: 400; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 9px; padding: 9px 11px; }
.ag-field textarea { resize: vertical; }
.ag-field input[type="color"] { padding: 2px; height: 38px; width: 60px; cursor: pointer; }
.ag-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.ag-check { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; color: var(--muted); margin-bottom: 12px; align-self: end; padding-bottom: 11px; }
.ag-check input { width: 16px; height: 16px; }
.ag-wd { display: flex; gap: 6px; flex-wrap: wrap; }
.ag-wd-btn { border: 1px solid var(--line); background: var(--surface); border-radius: 8px; padding: 6px 11px; font-family: inherit; font-size: 13px; cursor: pointer; color: var(--ink); }
.ag-wd-btn.is-on { background: var(--brun); color: #fff; border-color: var(--brun); }
.ag-seg { display: inline-flex; gap: 6px; }
.ag-error { background: rgba(179, 38, 30, .08); color: var(--danger); border-radius: 9px; padding: 10px 12px; font-size: 13.5px; font-weight: 600; margin-bottom: 12px; }
.ag-error.sm { padding: 8px 10px; font-size: 12.5px; }

.ag-plan-bar { margin-bottom: 12px; }
.ag-plan-list { display: flex; flex-direction: column; gap: 8px; }
.ag-plan-row { display: flex; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; background: var(--surface); }
.ag-plan-row.is-off { opacity: .6; }
.ag-plan-main { flex: 1; min-width: 0; }
.ag-plan-t { font-weight: 700; font-size: 14px; color: var(--ink); }
.ag-plan-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.ag-plan-act { display: flex; gap: 8px; flex-wrap: wrap; }

@media (max-width: 640px) {
  .ag-grid2 { grid-template-columns: 1fr; }
  .ag-cal { gap: 3px; }
  .ag-cell { min-height: 60px; padding: 4px; }
  .ag-chip-t { display: none; }
  .ag-check { align-self: start; padding-bottom: 0; margin-top: -4px; }
}

/* =====================================================================
   DASHBOARD — cartes compactes + restitution Agenda
   ===================================================================== */
.dash-treso .kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 10px; margin-bottom: 12px; }
.dash-treso .kpi { padding: 12px 14px; }
.dash-treso .kpi-label { font-size: 11px; }
.dash-treso .kpi-value { font-size: 20px; margin-top: 3px; }
.dash-treso .kpi-sub { font-size: 11px; margin-top: 3px; }

.ag-resume { margin-bottom: 16px; }
.ag-resume-kpis { display: flex; gap: 10px; margin: 4px 0 12px; flex-wrap: wrap; }
.ag-rk { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; border: 1px solid var(--line); border-radius: 10px; padding: 8px 14px; background: var(--surface); cursor: pointer; font-family: inherit; min-width: 96px; }
.ag-rk:hover { border-color: var(--brun); }
.ag-rk b { font-family: 'Josefin Sans', sans-serif; font-size: 20px; color: var(--ink); line-height: 1; }
.ag-rk span { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .4px; font-weight: 700; }
.ag-rk.is-late b { color: var(--danger); }
.ag-resume-list { display: flex; flex-direction: column; }
.ag-resume-row { display: flex; align-items: center; gap: 12px; width: 100%; border: 0; border-top: 1px solid var(--line); background: transparent; padding: 8px 2px; cursor: pointer; font-family: inherit; text-align: left; }
.ag-resume-row:first-child { border-top: 0; }
.ag-resume-row:hover .ag-resume-t { color: var(--brun); }
.ag-resume-date { font-size: 13px; font-weight: 700; color: var(--muted); min-width: 48px; }
.ag-resume-date.is-late { color: var(--danger); }
.ag-resume-t { flex: 1; font-size: 14px; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ag-resume-tag { font-size: 10.5px; font-weight: 800; text-transform: uppercase; color: var(--danger); background: rgba(179, 38, 30, .1); padding: 2px 7px; border-radius: 20px; }
.ag-resume-empty { color: var(--muted); font-size: 13.5px; padding: 6px 2px; }

/* =====================================================================
   MOBILE — « Détail par compte » en cartes empilées (plus de troncature)
   ===================================================================== */
@media (max-width: 640px) {
  .bank-table thead { display: none; }
  .bank-table, .bank-table tbody, .bank-table tr, .bank-table td { display: block; width: 100%; }
  .bank-table tr {
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 10px 12px;
    margin-bottom: 10px;
    background: var(--surface);
  }
  .bank-table td {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 7px 0;
    border-bottom: 1px solid var(--creme-2);
    text-align: right;
  }
  .bank-table td:last-child { border-bottom: 0; }
  .bank-table td::before {
    content: attr(data-label);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .3px;
    color: var(--muted);
    text-align: left;
    flex: 0 0 auto;
  }
  .bank-table td.num { white-space: nowrap; }
  /* Cellule compte = en-tête de carte (pas de label, contenu à gauche) */
  .bank-table td.bank-acc {
    border-bottom: 1px solid var(--line);
    padding-bottom: 9px;
    margin-bottom: 3px;
    flex-wrap: wrap;
    justify-content: flex-start;
    white-space: normal;
  }
  .bank-table td.bank-acc::before { content: none; }
  .bank-table td.bank-acc .lib { font-weight: 700; font-size: 15px; }
  /* Jauge de découvert en pleine largeur sous son label */
  .bank-table td.gauge-col { flex-direction: column; align-items: stretch; text-align: left; }
  .bank-table td.gauge-col::before { margin-bottom: 5px; }
  .bank-table td.gauge-col .gauge { width: 100%; }
  .bank-table td.gauge-col .gauge-legend { text-align: left; }
}

/* =====================================================================
   PROJECTION DE TRÉSORERIE (courbe J+30 / J+90)
   ===================================================================== */
.proj { margin-bottom: 16px; }
.proj-seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.proj-seg button { border: 0; background: var(--surface); color: var(--muted); font-family: inherit; font-size: 12px; font-weight: 700; padding: 5px 12px; cursor: pointer; }
.proj-seg button + button { border-left: 1px solid var(--line); }
.proj-seg button.is-on { background: var(--brun); color: #fff; }
.proj-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 10px; }
.proj-end { display: flex; flex-direction: column; gap: 1px; }
.proj-end-lbl { font-size: 11px; text-transform: uppercase; letter-spacing: .4px; font-weight: 700; color: var(--muted); }
.proj-end-val { font-family: 'Josefin Sans', sans-serif; font-size: 24px; font-weight: 700; color: var(--ink); line-height: 1.1; }
.proj-end-val.neg { color: var(--danger); }
.proj-alert { font-size: 13px; font-weight: 700; padding: 6px 12px; border-radius: 8px; }
.proj-alert.is-neg { color: var(--danger); background: rgba(179, 38, 30, .10); }
.proj-alert.is-ok { color: #2e7d32; background: rgba(46, 125, 50, .10); }
.proj-note { margin-top: 8px; font-size: 11.5px; color: var(--muted); }

/* ============================================================
   Notifications & alertes — écran de réglages DAF
   (préfixes nset-/notif-* ; distincts du tiroir de la cloche)
   ============================================================ */
.nset-wrap{max-width:880px;margin:0 auto;padding:4px 2px 40px}
.nset-head{display:flex;align-items:flex-start;justify-content:space-between;gap:16px;margin-bottom:14px}
.notif-title{margin:0;font-size:22px;color:var(--brun,#865830)}
.notif-sub{margin:4px 0 0;font-size:13.5px;color:var(--muted,#8a7a68);max-width:620px;line-height:1.5}
.notif-save{white-space:nowrap}
.notif-err{color:var(--danger,#b3261e);font-size:14px}
.notif-flash{background:#e9f5ec;border:1px solid #bfe0c8;color:#1f6b3b;border-radius:10px;padding:10px 14px;font-size:14px;margin-bottom:14px}

.notif-master{display:flex;align-items:center;gap:14px;padding:14px 16px;border-radius:12px;border:1px solid var(--line,#e2d5c5);background:var(--surface,#fff);margin-bottom:16px}
.notif-master.is-on{border-color:var(--or,#c4922a);box-shadow:0 0 0 1px var(--or,#c4922a) inset}
.notif-master-txt{display:flex;flex-direction:column;gap:2px}
.notif-master-txt strong{font-size:15px;color:var(--ink,#2e2017)}
.notif-master-txt .muted{font-size:13px}

.notif-switch{position:relative;display:inline-block;width:46px;height:26px;flex:0 0 auto}
.notif-switch.sm{width:42px;height:24px}
.notif-switch input{opacity:0;width:0;height:0;position:absolute}
.notif-slider{position:absolute;inset:0;cursor:pointer;background:#cdbfae;border-radius:30px;transition:.2s}
.notif-slider::before{content:"";position:absolute;height:20px;width:20px;left:3px;top:3px;background:#fff;border-radius:50%;transition:.2s}
.notif-switch.sm .notif-slider::before{height:18px;width:18px}
.notif-switch input:checked + .notif-slider{background:var(--brun,#865830)}
.notif-switch input:checked + .notif-slider::before{transform:translateX(20px)}
.notif-switch.sm input:checked + .notif-slider::before{transform:translateX(18px)}

.notif-global,.notif-tester{display:flex;flex-direction:column;gap:12px;padding:14px 16px;border:1px solid var(--line,#e2d5c5);border-radius:12px;background:var(--surface,#fff);margin-bottom:14px}
.notif-tester{gap:6px}
.notif-field{display:flex;flex-direction:column;gap:5px}
.notif-field>label,.notif-tester>label{font-size:13px;font-weight:600;color:var(--ink,#2e2017)}
.nset-wrap input[type=text],.nset-wrap input[type=email],.nset-wrap input[type=number],.nset-wrap textarea,.nset-wrap select{font:inherit;padding:8px 10px;border:1px solid var(--line,#e2d5c5);border-radius:8px;background:var(--surface,#fff);color:var(--ink,#2e2017)}
.nset-wrap textarea{resize:vertical}

.notif-card{border:1px solid var(--line,#e2d5c5);border-radius:12px;background:var(--surface,#fff);margin-bottom:12px;overflow:hidden}
.notif-card.is-on{border-color:var(--or,#c4922a)}
.notif-card-head{display:flex;align-items:center;gap:12px;padding:14px 16px;background:var(--creme-2,#efe6da)}
.notif-card.is-on .notif-card-head{background:rgba(196,146,42,.12)}
.notif-card-title{display:flex;flex-direction:column;gap:2px}
.notif-card-title strong{font-size:15px;color:var(--brun,#865830)}
.notif-card-title .muted{font-size:12.5px;line-height:1.4}
.notif-card-body{padding:14px 16px;display:flex;flex-direction:column;gap:12px}
.notif-card:not(.is-on) .notif-card-body{opacity:.62}

.notif-row{display:flex;align-items:center;gap:12px;flex-wrap:wrap}
.notif-row.top{align-items:flex-start}
.notif-row-lbl{flex:0 0 140px;font-size:13px;font-weight:600;color:var(--ink,#2e2017)}
.notif-row textarea{flex:1;min-width:220px}
.notif-tz{font-size:12px}

.notif-days{display:flex;gap:6px;flex-wrap:wrap}
.notif-day{width:42px;padding:6px 0;border:1px solid var(--line,#e2d5c5);background:var(--surface,#fff);color:var(--muted,#8a7a68);border-radius:8px;cursor:pointer;font-size:12.5px;font-weight:600}
.notif-day.on{background:var(--brun,#865830);border-color:var(--brun,#865830);color:#fff}

.notif-checks{display:flex;gap:16px;flex-wrap:wrap}
.notif-checks label,.notif-inline{display:flex;align-items:center;gap:6px;font-size:13.5px;color:var(--ink,#2e2017);cursor:pointer}
.notif-num{width:80px}
.notif-num.wide{width:140px}

.notif-dests{flex:1;min-width:240px;display:flex;flex-direction:column;gap:10px}
.notif-userlist{display:grid;grid-template-columns:repeat(auto-fill,minmax(220px,1fr));gap:6px 14px}
.notif-user{display:flex;align-items:center;gap:8px;font-size:13.5px;cursor:pointer}
.notif-user small{font-size:11.5px}
.notif-addrow{display:flex;gap:8px}
.notif-addrow input{flex:1}
.notif-chips{display:flex;gap:6px;flex-wrap:wrap}
.notif-chip{display:inline-flex;align-items:center;gap:6px;background:var(--creme-2,#efe6da);border-radius:20px;padding:3px 6px 3px 12px;font-size:12.5px}
.notif-chip button{border:0;background:#cdbfae;color:#fff;border-radius:50%;width:18px;height:18px;cursor:pointer;line-height:1}
.notif-warn{color:var(--danger,#b3261e);font-size:12.5px}

.notif-card-foot{display:flex;align-items:center;gap:12px;flex-wrap:wrap;border-top:1px dashed var(--line,#e2d5c5);padding-top:12px}
.notif-test-msg{font-size:12.5px;color:var(--muted,#8a7a68)}
.notif-test-msg.ok{color:#1f6b3b}
.notif-test-msg.ko{color:var(--danger,#b3261e)}

.notif-journal{margin-top:18px}
.notif-journal h3{margin:0 0 10px;font-size:16px;color:var(--brun,#865830)}
.notif-jtable{width:100%;border-collapse:collapse;font-size:13px}
.notif-jtable th,.notif-jtable td{text-align:left;padding:7px 10px;border-bottom:1px solid var(--line,#e2d5c5);vertical-align:top}
.notif-jtable th{font-size:11.5px;text-transform:uppercase;letter-spacing:.4px;color:var(--muted,#8a7a68)}
.nset-badge{display:inline-block;padding:2px 9px;border-radius:20px;font-size:11.5px;font-weight:600;white-space:nowrap}
.nset-badge.st-envoye{background:#e9f5ec;color:#1f6b3b}
.nset-badge.st-partiel{background:#fdf2e3;color:#9a6a12}
.nset-badge.st-echec{background:#fbeae8;color:#b3261e}
.nset-badge.st-test{background:#eef0f4;color:#516079}

.notif-foot-save{margin-top:18px;display:flex;justify-content:flex-end}

@media(max-width:640px){
  .notif-row-lbl{flex:0 0 100%}
  .notif-userlist{grid-template-columns:1fr}
  .nset-head{flex-direction:column}
}

.notif-flash.err{background:#fbeae8;border-color:#f0c4bf;color:#b3261e}
