:root {
  --bg: #f4f1ec;
  --surface: #ffffff;
  --surface2: #faf8f5;
  --border: #e0dbd3;
  --text: #1c1917;
  --muted: #78716c;
  --vallon: #b91c3c;
  --teal: #0d9488;
  --teal-dark: #0f766e;
  --lime: #15803d;
  --orange: #c2410c;
  --success: #16a34a;
  --danger: #dc2626;
  --warning: #ca8a04;
  --shadow: 0 1px 3px rgba(28,25,23,0.07), 0 4px 14px rgba(28,25,23,0.05);
  --shadow-lg: 0 12px 32px rgba(28,25,23,0.1);
  --radius: 14px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Plus Jakarta Sans', system-ui, sans-serif; background: var(--bg); color: var(--text); min-height: 100vh; }
.bg-mesh { position: fixed; inset: 0; pointer-events: none; background: radial-gradient(ellipse 70% 50% at 80% 10%, rgba(13,148,136,0.06), transparent 55%); }
.shell-header { display: flex; align-items: center; justify-content: space-between; padding: 0.65rem 1.5rem; border-bottom: 1px solid var(--border); background: #fff; box-shadow: 0 1px 0 rgba(28,25,23,0.04); position: sticky; top: 0; z-index: 20; }
.ecosystem-dots { display: flex; align-items: center; gap: 6px; padding: 0 0.35rem; }
.eco-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; border: 1px solid rgba(255,255,255,0.15); cursor: help; }
.eco-dot--online { background: #22c55e; box-shadow: 0 0 6px rgba(34,197,94,0.55); }
.eco-dot--degraded { background: #f59e0b; box-shadow: 0 0 6px rgba(245,158,11,0.5); }
.eco-dot--offline { background: #ef4444; box-shadow: 0 0 6px rgba(239,68,68,0.45); }
.brand { display: flex; align-items: center; gap: 0.75rem; }
.brand-logo { width: 40px; height: 40px; border-radius: 10px; background: var(--teal); display: flex; align-items: center; justify-content: center; font-family: Fraunces, Georgia, serif; font-weight: 800; font-size: 0.75rem; color: #fff; }
.brand-name { font-family: Fraunces, Georgia, serif; font-weight: 700; display: block; }
.brand-ver { font-size: 0.65rem; color: var(--teal); }
.shell-actions { display: flex; align-items: center; gap: 0.65rem; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--lime); animation: pulse 2s infinite; }
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:0.4} }
.icon-btn { background: var(--surface); border: 1px solid var(--border); color: var(--text); border-radius: 8px; padding: 0.4rem 0.6rem; cursor: pointer; }
.notif-btn { position: relative; }
.notif-badge { position: absolute; top: -4px; right: -4px; background: var(--orange); color: #fff; font-size: 0.65rem; padding: 1px 5px; border-radius: 999px; }
.notif-badge.hidden { display: none; }
.notif-panel { position: fixed; top: 56px; right: 16px; width: min(360px, 92vw); max-height: 400px; overflow-y: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); z-index: 30; padding: 0.75rem; }
.notif-panel.hidden { display: none; }
.notif-item { padding: 0.6rem 0; border-bottom: 1px solid var(--border); font-size: 0.85rem; cursor: pointer; }
.notif-item.unread { border-left: 3px solid var(--teal); padding-left: 0.5rem; }
.nav-toggle { display: none; }
.nav-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,0.45); z-index: 8; }
.nav-backdrop.hidden { display: none; }
.side-nav { position: fixed; left: 0; top: 56px; bottom: 0; width: 220px; background: #fff; border-right: 1px solid var(--border); padding: 1rem 0.5rem; z-index: 15; overflow-y: auto; box-shadow: var(--shadow); }
.side-nav button, .side-nav a { display: flex; align-items: center; justify-content: space-between; gap: 0.4rem; padding: 0.55rem 0.85rem; color: var(--muted); text-decoration: none; border-radius: 8px; font-size: 0.88rem; margin-bottom: 0.2rem; cursor: pointer; border: none; background: none; width: 100%; text-align: left; font-family: inherit; }
.side-nav button .nav-label { flex: 1; min-width: 0; }
.side-nav button.active, .side-nav button:hover, .side-nav a.active, .side-nav a:hover { background: rgba(13,148,136,0.1); color: var(--teal); }
.nav-count-badge {
  flex-shrink: 0;
  min-width: 1.35rem;
  height: 1.35rem;
  padding: 0 0.4rem;
  border-radius: 999px;
  background: var(--orange);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
/* Urgence : danger rouge · warning orange · info bleu */
.nav-count-badge--danger { background: #dc2626; }
.nav-count-badge--warning { background: var(--orange); }
.nav-count-badge--info { background: #2563eb; }
.side-nav button.active .nav-count-badge { opacity: 0.95; }

/* Alertes par urgence (réutilise le design existant) */
.compta-alert--danger { border-left: 3px solid #dc2626; background: rgba(220, 38, 38, 0.06); }
.compta-alert--warning { border-left: 3px solid var(--orange); background: rgba(194, 65, 12, 0.06); }
.compta-alert--info { border-left: 3px solid #2563eb; background: rgba(37, 99, 235, 0.06); }
.compta-alert-level { display: block; font-size: 0.65rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 0.15rem; }
.compta-alert-level--danger { color: #dc2626; }
.compta-alert-level--warning { color: var(--orange); }
.compta-alert-level--info { color: #2563eb; }
.compta-alert-level--success { color: var(--lime); }

/* Dashboard : alertes à droite */
.dashboard-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 320px);
  gap: 1.25rem;
  align-items: start;
}
.dashboard-alerts-rail {
  position: sticky;
  top: 72px;
}
.dashboard-alerts-rail .compta-alerts {
  max-height: calc(100vh - 100px);
  overflow-y: auto;
}
@media (max-width: 1000px) {
  .dashboard-layout { grid-template-columns: 1fr; }
  .dashboard-alerts-rail { position: static; }
}

/* Factures client — cartes + actions */
.factures-site-list { display: flex; flex-direction: column; gap: 0.85rem; }
.facture-site-card { padding: 1rem 1.1rem; }
.facture-site-card--emise { border-left: 3px solid var(--orange); }
.facture-site-card__head { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 0.75rem; }
.facture-site-card__tools { display: flex; flex-wrap: wrap; gap: 0.65rem; align-items: flex-end; justify-content: space-between; }
.facture-site-actions { display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; }
.facture-site-status { display: flex; flex-direction: column; gap: 0.2rem; }
.facture-status-select {
  padding: 0.35rem 0.55rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--text);
  font-family: inherit;
  font-size: 0.85rem;
}
.facture-lines-editor.hidden { display: none; }
.facture-lines-editor input {
  padding: 0.35rem 0.45rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
}
.hero-sub { margin-top: 0.35rem; font-size: 0.72rem; }
.shell-main { margin-left: 220px; padding: 1.5rem; max-width: 1280px; }
.shell-main.compta-wide { max-width: 1400px; }
@media (max-width: 900px) {
  .nav-toggle { display: inline-flex; }
  .side-nav { transform: translateX(-100%); transition: transform 0.2s ease; }
  .side-nav.open { transform: translateX(0); }
  .shell-main { margin-left: 0; }
}

.scan-zone { margin-bottom: 1rem; }
.scan-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0.5rem 0 0.75rem; }
.scan-btn { flex: 1 1 140px; min-height: 44px; }
.scan-input-hidden { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; overflow: hidden; }
.scan-preview-box { margin-top: 0.5rem; padding: 0.75rem; border: 1px dashed var(--border); border-radius: 10px; background: var(--surface2); }
.scan-hint { color: var(--muted); font-size: 0.88rem; margin: 0; }
.scan-filename { font-size: 0.82rem; color: var(--teal); margin: 0 0 0.5rem; }
.scan-preview-img { display: block; max-width: 100%; max-height: 280px; border-radius: 8px; object-fit: contain; }
.scan-preview-pdf { display: block; width: 100%; height: min(360px, 55vh); border: none; border-radius: 8px; background: #fff; }
.scan-change-btn { margin-top: 0.5rem; }
.scan-thumb-wrap { flex: 0 0 auto; }
.scan-thumb-img { display: block; max-width: 140px; max-height: 180px; border-radius: 6px; object-fit: cover; }
.scan-thumb-pdf { display: block; width: 140px; height: 180px; border: 1px solid var(--border); border-radius: 6px; background: #fff; }
.glass { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.page-title { font-family: Fraunces, Georgia, serif; font-size: 1.6rem; margin-bottom: 0.3rem; }
.page-sub { color: var(--muted); margin-bottom: 1.2rem; line-height: 1.5; font-size: 0.9rem; }
.badge { display: inline-block; padding: 0.2rem 0.55rem; border-radius: 999px; font-size: 0.72rem; font-weight: 600; }
.badge-teal { background: rgba(20,184,166,0.18); color: var(--teal); }
.badge-lime { background: rgba(21,128,61,0.15); color: var(--lime); }
.badge-orange { background: rgba(255,107,53,0.15); color: var(--orange); }
.badge-muted { background: rgba(122,139,168,0.15); color: var(--muted); }
.btn { border: none; border-radius: 999px; padding: 0.55rem 1.1rem; font-family: inherit; font-weight: 600; cursor: pointer; }
.btn-teal { background: var(--teal); color: #fff; }
.btn-ghost { background: transparent; border: 1px solid var(--border); color: var(--text); }
.btn-sm { padding: 0.35rem 0.75rem; font-size: 0.8rem; }
.btn-block { width: 100%; }
.form-group { margin-bottom: 0.75rem; }
.form-group label { display: block; font-size: 0.78rem; color: var(--muted); margin-bottom: 0.25rem; }
.form-group input, .form-group select, .form-group textarea {
  width: 100%; padding: 0.6rem 0.75rem; border-radius: 8px;
  border: 1px solid var(--border); background: #d8e2ef; color: #0b1220;
  -webkit-text-fill-color: #0b1220; caret-color: #0b1220; font-family: inherit;
}
.form-group input::placeholder, .form-group textarea::placeholder {
  color: #475569; -webkit-text-fill-color: #475569; opacity: 1;
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }
@media (max-width: 600px) { .form-row { grid-template-columns: 1fr; } }
.auth-wrap { min-height: 80vh; display: flex; align-items: center; justify-content: center; }
.auth-panel { padding: 2rem; width: 100%; max-width: 420px; }
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 0.65rem; margin-bottom: 1.25rem; }
.kpi-card { padding: 1rem; text-align: center; }
.kpi-card .val { font-family: Fraunces, Georgia, serif; font-size: 1.5rem; color: var(--teal); }
.kpi-card .lbl { font-size: 0.75rem; color: var(--muted); margin-top: 0.2rem; }
.data-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.data-table th, .data-table td { padding: 0.6rem 0.75rem; border-bottom: 1px solid var(--border); text-align: left; }
.data-table th { color: var(--muted); font-size: 0.75rem; font-weight: 500; }
.virements-table td { vertical-align: top; }
.virements-table .btn { margin: 0.15rem 0.15rem 0.15rem 0; }
.kpi-card .val { font-family: Fraunces, Georgia, serif; font-size: 1.35rem; font-weight: 700; }
.kpi-card .lbl { font-size: 0.75rem; color: var(--muted); margin-top: 0.2rem; }
.kpi-card { padding: 0.85rem 1.1rem; min-width: 120px; }
.panel { padding: 1.25rem; margin-bottom: 1rem; }
.panel h3 { font-family: Fraunces, Georgia, serif; font-size: 1rem; margin-bottom: 0.85rem; }
.toast { position: fixed; bottom: 1.5rem; right: 1.5rem; padding: 0.85rem 1.25rem; border-radius: 8px; background: #fff; border: 1px solid var(--border); border-left: 4px solid var(--teal); z-index: 200; box-shadow: var(--shadow-lg); }
.toast.hidden { display: none; }
.statut-envoye { color: var(--orange); }
.statut-ok { color: var(--lime); }
.statut-ko { color: #dc2626; }

/* ——— Compta pro dashboard ——— */
.compta-page-head { display: flex; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; gap: 1rem; margin-bottom: 0.65rem; }
.compta-kpi-label { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin: 0 0 0.5rem; font-weight: 600; }
.compta-page-head .meta-live { font-size: 0.78rem; color: var(--muted); }
.compta-hero { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.75rem; margin-bottom: 1.25rem; }
@media (max-width: 1000px) { .compta-hero { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .compta-hero { grid-template-columns: 1fr; } }
.compta-hero-card { padding: 1.1rem 1.15rem; position: relative; overflow: hidden; }
.compta-hero-card::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px; background: var(--accent, var(--teal)); opacity: 0.85; }
.compta-hero-card .hero-icon { font-size: 1.1rem; opacity: 0.7; margin-bottom: 0.35rem; }
.compta-hero-card .hero-val { font-family: Fraunces, Georgia, serif; font-size: 1.65rem; font-weight: 700; line-height: 1.1; }
.compta-hero-card .hero-lbl { font-size: 0.72rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; margin-top: 0.35rem; }
.compta-hero-card .hero-sub { font-size: 0.78rem; color: var(--muted); margin-top: 0.2rem; }
.compta-hero-card.positive .hero-val { color: var(--lime); }
.compta-hero-card.negative .hero-val { color: #dc2626; }
.compta-hero-card.neutral .hero-val { color: var(--teal); }

.compta-alerts { margin-bottom: 1.25rem; }
.compta-alerts-head { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.65rem; }
.compta-alerts-head h2 { font-family: Fraunces, Georgia, serif; font-size: 0.95rem; font-weight: 700; }
.compta-alert-list { display: flex; flex-direction: column; gap: 0.45rem; }
.compta-alert { display: flex; align-items: flex-start; gap: 0.75rem; padding: 0.75rem 1rem; border-radius: 10px; border: 1px solid var(--border); background: var(--surface2); cursor: pointer; transition: border-color 0.15s; }
.compta-alert:hover { border-color: rgba(20,184,166,0.45); }
.compta-alert.danger { border-left: 4px solid #dc2626; }
.compta-alert.warning { border-left: 4px solid var(--orange); }
.compta-alert.info { border-left: 4px solid #7c8aff; }
.compta-alert-icon { font-size: 1.1rem; flex-shrink: 0; margin-top: 0.1rem; }
.compta-alert-body strong { display: block; font-size: 0.88rem; margin-bottom: 0.15rem; }
.compta-alert-body small { color: var(--muted); font-size: 0.8rem; line-height: 1.4; }
.compta-alert-amount { margin-left: auto; font-family: Fraunces, Georgia, serif; font-weight: 700; font-size: 0.9rem; white-space: nowrap; }

.compta-mailboxes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.65rem; margin-bottom: 1.25rem; }
@media (max-width: 900px) { .compta-mailboxes { grid-template-columns: 1fr; } }
.compta-mailbox { padding: 1rem; border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface2); }
.compta-mailbox-head { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.5rem; }
.compta-mailbox-head strong { font-size: 0.88rem; }
.compta-mailbox-email { font-family: ui-monospace, monospace; font-size: 0.75rem; color: var(--teal); word-break: break-all; margin-bottom: 0.45rem; }
.compta-mailbox-desc { font-size: 0.75rem; color: var(--muted); line-height: 1.45; margin-bottom: 0.6rem; }
.compta-mailbox .btn-copy { font-size: 0.72rem; padding: 0.3rem 0.65rem; }
.compta-mailbox.unset { opacity: 0.92; border-style: dashed; }
.compta-mailbox-email.unset { color: var(--orange); font-style: italic; font-family: inherit; }
.compta-mailbox-head .routing-badge { margin-left: auto; font-size: 0.62rem; }
.compta-mailbox-future { font-size: 0.68rem; color: var(--muted); margin-bottom: 0.5rem; }
.compta-mailbox-future code { font-size: 0.65rem; color: #9aa8ff; }
.compta-mail-foot { font-size: 0.75rem; color: var(--muted); margin-top: 0.65rem; }
.compta-mail-foot.muted { font-style: italic; }

.compta-section { margin-bottom: 1.35rem; }
.compta-section-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 0.75rem; margin-bottom: 0.75rem; flex-wrap: wrap; }
.compta-section-title { font-family: Fraunces, Georgia, serif; font-size: 1rem; font-weight: 700; margin: 0; }
.compta-section-sub { font-size: 0.78rem; color: var(--muted); margin: 0.2rem 0 0; }
.compta-alerts-section .compta-alerts { margin-bottom: 0; }

.compta-mail-config { margin-bottom: 0.75rem; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.compta-mail-config-toggle { width: 100%; display: flex; justify-content: space-between; align-items: center; padding: 0.75rem 1rem; background: var(--surface2); border: none; color: inherit; font-family: inherit; font-size: 0.85rem; cursor: pointer; text-align: left; }
.compta-mail-config-toggle:hover { background: rgba(20,184,166,0.08); }
.compta-mail-config-body { padding: 1rem; border-top: 1px solid var(--border); }
.compta-mail-config-body.hidden { display: none; }
.cfg-hint { font-size: 0.78rem; color: var(--muted); margin: 0 0 0.85rem; line-height: 1.45; }
.cfg-split { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.65rem; }
@media (max-width: 800px) { .cfg-split { grid-template-columns: 1fr; } }
.field-hint { display: block; font-size: 0.72rem; color: var(--muted); margin-top: 0.25rem; }
.cfg-neo-details { margin: 0.75rem 0; font-size: 0.82rem; color: var(--muted); }
.cfg-neo-details summary { cursor: pointer; color: var(--teal); }
.cfg-actions { display: flex; align-items: center; gap: 0.75rem; margin-top: 0.85rem; }
.cfg-status { font-size: 0.78rem; color: var(--lime); }

.compta-transmit-panel { padding: 1rem; margin-bottom: 0.75rem; border: 1px solid var(--border); border-radius: var(--radius); }
.transmit-title { font-family: Fraunces, Georgia, serif; font-size: 0.92rem; margin: 0 0 0.5rem; }
.transmit-toggles { display: flex; flex-wrap: wrap; gap: 1rem; margin: 0.75rem 0; }
.toggle-switch { display: flex; align-items: center; gap: 0.55rem; cursor: pointer; font-size: 0.82rem; }
.toggle-switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.toggle-track { width: 42px; height: 24px; border-radius: 999px; background: rgba(255,255,255,0.12); position: relative; transition: background 0.2s; flex-shrink: 0; }
.toggle-track::after { content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform 0.2s; }
.toggle-switch input:checked + .toggle-track { background: rgba(20,184,166,0.55); }
.toggle-switch input:checked + .toggle-track::after { transform: translateX(18px); }
.fe-obligations { margin: 0.65rem 0; font-size: 0.8rem; color: var(--muted); }
.fe-obligations summary { cursor: pointer; color: var(--teal); font-weight: 600; }
.fe-list { margin: 0.5rem 0 0.5rem 1.1rem; line-height: 1.5; }
.transmit-recent { margin-top: 0.85rem; padding-top: 0.65rem; border-top: 1px solid var(--border); }
.transmit-recent h4 { font-size: 0.78rem; color: var(--muted); margin: 0 0 0.45rem; text-transform: uppercase; letter-spacing: 0.04em; }
.transmit-row { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; font-size: 0.78rem; padding: 0.35rem 0; border-bottom: 1px solid var(--border); }
.transmit-row small { color: var(--muted); margin-left: auto; }

.compta-tabs { display: flex; gap: 0.35rem; flex-wrap: wrap; margin-bottom: 1rem; }
.compta-tab { padding: 0.4rem 0.85rem; border-radius: 999px; border: 1px solid var(--border); background: transparent; color: var(--muted); font-size: 0.8rem; font-family: inherit; cursor: pointer; }
.compta-tab.active { background: rgba(13,148,136,0.1); color: var(--teal); border-color: rgba(13,148,136,0.3); }
.compta-tab .tab-count { opacity: 0.7; margin-left: 0.2rem; }

.chantier-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 0.85rem; }
.chantier-card { padding: 1.1rem; cursor: pointer; transition: transform 0.12s, border-color 0.12s; }
.chantier-card:hover { border-color: rgba(20,184,166,0.4); transform: translateY(-1px); }
.chantier-card.selected { border-color: var(--teal); box-shadow: 0 0 0 1px rgba(20,184,166,0.25); }
.chantier-card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 0.5rem; margin-bottom: 0.75rem; }
.chantier-card-title { font-family: Fraunces, Georgia, serif; font-weight: 700; font-size: 0.95rem; line-height: 1.25; }
.chantier-card-ref { font-size: 0.72rem; color: var(--muted); font-family: ui-monospace, monospace; margin-top: 0.15rem; }
.chantier-card-client { font-size: 0.78rem; color: var(--muted); margin-top: 0.25rem; }
.chantier-metrics { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0.5rem; margin-bottom: 0.85rem; }
.chantier-metric { text-align: center; padding: 0.5rem 0.35rem; background: var(--surface2); border-radius: 8px; }
.chantier-metric .m-val { font-family: Fraunces, Georgia, serif; font-weight: 700; font-size: 0.95rem; }
.chantier-metric .m-lbl { font-size: 0.65rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.03em; margin-top: 0.15rem; }
.chantier-metric.marge-pos .m-val { color: var(--lime); }
.chantier-metric.marge-neg .m-val { color: #dc2626; }

.flow-bar-wrap { margin-bottom: 0.45rem; }
.flow-bar-label { display: flex; justify-content: space-between; font-size: 0.72rem; color: var(--muted); margin-bottom: 0.2rem; }
.flow-bar-track { height: 6px; background: var(--surface2); border-radius: 999px; overflow: hidden; }
.flow-bar-fill { height: 100%; border-radius: 999px; transition: width 0.4s ease; }
.flow-bar-fill.in { background: linear-gradient(90deg, var(--teal), #0d9488); }
.flow-bar-fill.out { background: linear-gradient(90deg, var(--orange), #e85d04); }
.flow-bar-fill.pending { background: linear-gradient(90deg, #7c8aff, #5b6ee8); }

.compta-detail { padding: 1.25rem; margin-top: 1rem; }
.compta-detail h3 { font-family: Fraunces, Georgia, serif; margin-bottom: 1rem; }
.compta-split { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-bottom: 1rem; }
@media (max-width: 700px) { .compta-split { grid-template-columns: 1fr; } }
.compta-waterfall { display: flex; flex-direction: column; gap: 0.5rem; }
.waterfall-row { display: flex; align-items: center; gap: 0.75rem; }
.waterfall-row .wf-label { flex: 0 0 140px; font-size: 0.82rem; color: var(--muted); }
.waterfall-row .wf-bar-wrap { flex: 1; height: 22px; background: var(--surface2); border-radius: 6px; overflow: hidden; }
.waterfall-row .wf-bar { height: 100%; border-radius: 6px; min-width: 2px; }
.waterfall-row .wf-val { flex: 0 0 90px; text-align: right; font-family: Fraunces, Georgia, serif; font-weight: 600; font-size: 0.85rem; }
.wf-in { background: linear-gradient(90deg, rgba(20,184,166,0.7), rgba(20,184,166,0.35)); }
.wf-out { background: linear-gradient(90deg, rgba(255,107,53,0.7), rgba(255,107,53,0.35)); }
.wf-result { background: linear-gradient(90deg, rgba(21,128,61,0.5), rgba(21,128,61,0.2)); }
.wf-result.neg { background: linear-gradient(90deg, rgba(248,113,113,0.6), rgba(248,113,113,0.25)); }

.badge-red { background: rgba(248,113,113,0.18); color: #dc2626; }
.badge-purple { background: rgba(124,138,255,0.18); color: #9aa8ff; }

.montant-ht-ttc-hint { font-size: 0.75rem; color: var(--muted); margin: -0.25rem 0 0.75rem; line-height: 1.4; }
.montant-ht-ttc-row .montant-ht-input,
.montant-ht-ttc-row .montant-ttc-input { font-variant-numeric: tabular-nums; }