/* OSAT — feuille de style unique, sans dependance */
:root {
  --navy: #0b1b33; --navy-2: #13284a; --ink: #0f172a; --muted: #64748b; --line: #e5e9f0;
  --bg: #f3f6fa; --card: #fff; --radius: 14px; --shadow: 0 1px 2px rgba(15,23,42,.04), 0 4px 16px rgba(15,23,42,.05);
  --acc: #1e3a8a; --acc-2: #3b82f6; --acc-soft: #e8efff;
  --ok: #059669; --ok-soft: #e6f7f0; --warn: #d97706; --warn-soft: #fff4e0; --err: #dc2626; --err-soft: #fdecec;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
body[data-cat="eau"] { --acc: #0369a1; --acc-2: #06b6d4; --acc-soft: #e0f6fb; }
body[data-cat="electricite"] { --acc: #b45309; --acc-2: #f59e0b; --acc-soft: #fff5dc; }
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 15px/1.5 var(--font); color: var(--ink); background: var(--bg); }
a { color: var(--acc); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; line-height: 1.25; }
code, .mono { font-family: ui-monospace, Consolas, monospace; font-size: .9em; }
.i { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; vertical-align: middle; }
.muted { color: var(--muted); } .small { font-size: .85em; } .nowrap { white-space: nowrap; } .r { text-align: right; }
.na { color: #94a3b8; font-weight: 500; font-size: .9em; }
[hidden] { display: none !important; }

/* ---------- Connexion ---------- */
body.auth { min-height: 100vh; display: grid; place-items: center; padding: 20px;
  background: radial-gradient(1200px 600px at 10% -10%, #0e7490 0%, transparent 60%), radial-gradient(900px 500px at 110% 110%, #b45309 0%, transparent 55%), var(--navy); }
.auth-card { width: 100%; max-width: 400px; background: #fff; border-radius: 20px; padding: 32px 28px; box-shadow: 0 30px 80px rgba(0,0,0,.35); }
.auth-card h1 { font-size: 1.25rem; margin: 22px 0 14px; }
.auth-card label { display: block; font-size: .85rem; font-weight: 600; color: #334155; margin-bottom: 14px; }
.otp-input { font: 700 1.6rem/1 ui-monospace, Consolas, monospace; letter-spacing: .5em; text-align: center; padding-left: .5em; }
.center-link { text-align: center; margin: 16px 0 0; font-size: .88rem; font-weight: 600; }
.steps-mini { display: flex; gap: 6px; margin-top: 22px; }
.steps-mini span { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: .75rem; font-weight: 700; background: #e7ecf3; color: #64748b; }
.steps-mini span.on { background: var(--navy); color: #fff; }
.steps-mini span.done { background: var(--ok-soft); color: var(--ok); }
.steps-mini + h1 { margin-top: 12px; }
.otp-actions { display: flex; justify-content: space-between; margin-top: 14px; }
.linkbtn { display: inline-flex; align-items: center; gap: 6px; border: 0; background: none; color: var(--acc); font: 600 .85rem var(--font); cursor: pointer; padding: 4px 0; }
.linkbtn .i { width: 15px; height: 15px; }
.auth-card .foot { text-align: center; font-size: .75rem; color: #94a3b8; margin: 22px 0 0; }
.brand-lg { display: flex; align-items: center; gap: 12px; font-size: 1.25rem; }
.brand-lg small { display: block; font-size: .78rem; color: var(--muted); }
.logo { display: inline-flex; align-items: center; justify-content: center; gap: 0; width: 44px; height: 44px; border-radius: 12px;
  background: linear-gradient(135deg, #0891b2, #0b1b33 55%, #f59e0b); color: #fff; }
.logo .i { width: 16px; height: 16px; }
.logo .i + .i { margin-left: -3px; color: #fde68a; }

/* ---------- Formulaires ---------- */
input, select, textarea { width: 100%; font: inherit; color: inherit; padding: 10px 12px; margin-top: 6px; border: 1px solid #d5dbe5; border-radius: 10px; background: #fff; min-height: 42px; }
input:focus, select:focus { outline: none; border-color: var(--acc-2); box-shadow: 0 0 0 3px color-mix(in srgb, var(--acc-2) 20%, transparent); }
input[type="checkbox"] { width: auto; min-height: 0; margin: 0 8px 0 0; }
.field { position: relative; display: block; }
.field .i { position: absolute; left: 12px; top: 50%; margin-top: 3px; transform: translateY(-50%); color: #94a3b8; }
.field input { padding-left: 38px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 8px 14px; border-radius: 10px; border: 1px solid var(--line);
  background: #fff; color: var(--ink); font: 600 .9rem var(--font); cursor: pointer; text-decoration: none !important; white-space: nowrap; }
.btn:hover { border-color: #cbd5e1; background: #f8fafc; }
.btn.primary { background: linear-gradient(135deg, var(--acc), var(--acc-2)); border-color: transparent; color: #fff; }
.btn.primary:hover { filter: brightness(1.06); }
.btn.ghost { background: transparent; }
.btn.sm { min-height: 32px; padding: 4px 10px; font-size: .82rem; }
.btn.lg { min-height: 46px; padding: 10px 20px; font-size: .95rem; box-shadow: 0 6px 18px color-mix(in srgb, var(--acc-2) 35%, transparent); }
.btn.block { width: 100%; margin-top: 6px; min-height: 46px; }
.btn[disabled], .btn.disabled { opacity: .5; cursor: not-allowed; pointer-events: none; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border: 0; border-radius: 9px; background: transparent; color: #475569; cursor: pointer; }
.icon-btn:hover { background: #eef2f7; color: var(--ink); }
.icon-btn.danger { color: #b91c1c; } .icon-btn.danger:hover { background: var(--err-soft); color: var(--err); }
.icon-btn.on { background: var(--acc-soft); color: var(--acc); }
input[readonly] { background: #f8fafc; color: #64748b; } input[readonly]:focus { box-shadow: none; border-color: var(--line); }
[data-countdown].off { color: var(--err); font-weight: 700; }
.btn.danger { color: var(--err); border-color: #f5c2c2; background: #fff; } .btn.danger:hover { background: var(--err-soft); border-color: var(--err); }
.linklike { border: 0; background: none; font: inherit; cursor: pointer; }
form.inline { display: inline; }
.stack { display: grid; gap: 12px; margin-top: 16px; }
.stack label, .form-grid label, .filters label { font-size: .8rem; font-weight: 600; color: #475569; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 14px; }
.form-grid .full { grid-column: 1 / -1; }
.form-grid .check { display: flex; align-items: center; grid-column: 1 / -1; }
.alert { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; margin: 14px 0; font-size: .9rem; }
.alert.err { background: var(--err-soft); color: #991b1b; }
.alert.info { background: var(--warn-soft); color: #92400e; }
.alert.ok { background: var(--ok-soft); color: #065f46; }

/* ---------- Structure ---------- */
.sidebar { position: fixed; inset: 0 auto 0 0; width: 248px; background: var(--navy); color: #cbd5e1; display: flex; flex-direction: column; padding: 18px 12px; z-index: 30; }
.brand { display: flex; align-items: center; gap: 10px; padding: 0 8px 20px; color: #fff; font-size: 1.05rem; }
.brand .logo { width: 36px; height: 36px; border-radius: 10px; }
.sidebar nav { display: grid; gap: 2px; }
.sidebar a, .sidebar .linklike { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 12px; border-radius: 10px; color: #cbd5e1; font-size: .92rem; text-decoration: none; text-align: left; }
.sidebar a:hover, .sidebar .linklike:hover { background: var(--navy-2); color: #fff; }
.sidebar a.on { background: linear-gradient(135deg, var(--acc), var(--acc-2)); color: #fff; }
.nav-bottom { margin-top: auto; border-top: 1px solid rgba(255,255,255,.08); padding-top: 10px; display: grid; gap: 2px; }
.main { margin-left: 248px; min-height: 100vh; }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 14px; padding: 14px 28px; background: rgba(243,246,250,.9); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.topbar h1 { font-size: 1.2rem; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.top-right { display: flex; align-items: center; gap: 14px; }
.seg { display: inline-flex; padding: 3px; background: #e7ecf3; border-radius: 11px; }
.seg button { display: inline-flex; align-items: center; gap: 6px; border: 0; background: transparent; padding: 6px 12px; border-radius: 9px; font: 600 .85rem var(--font); color: #475569; cursor: pointer; }
.seg button.on { background: #fff; color: var(--acc); box-shadow: 0 1px 3px rgba(0,0,0,.08); }
#cat-switch button[data-cat="eau"].on { color: #0369a1; }
#cat-switch button[data-cat="electricite"].on { color: #b45309; }
.seg.sm button { padding: 4px 10px; font-size: .8rem; }
.cat-pill { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 99px; font-size: .82rem; font-weight: 600; }
.cat-pill.eau { background: #e0f6fb; color: #0369a1; } .cat-pill.electricite { background: #fff5dc; color: #b45309; }
.who { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none !important; }
.avatar { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--navy); color: #fff; font-weight: 700; }
.who-txt { display: grid; line-height: 1.2; font-size: .88rem; } .who-txt small { color: var(--muted); }
.view { padding: 24px 28px 48px; max-width: 1400px; }
.view.loading { opacity: .5; pointer-events: none; transition: opacity .15s; }
.only-mobile { display: none; }
.backdrop { display: none; }

/* ---------- Cartes ---------- */
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; margin-bottom: 18px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.card-head h3 { font-size: 1rem; display: flex; align-items: center; gap: 8px; }
.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 18px; align-items: start; }
.cols > .card { margin-bottom: 0; } .cols { margin-bottom: 18px; }
.strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; margin-bottom: 18px; }
.grid-stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; margin-bottom: 18px; }
.stat { display: flex; gap: 14px; background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; min-width: 0; }
.stat-ico { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: var(--acc-soft); color: var(--acc); flex-shrink: 0; }
.stat-body { min-width: 0; display: grid; gap: 2px; }
.stat-label { font-size: .8rem; color: var(--muted); font-weight: 600; }
.stat-value { font-size: 1.45rem; font-weight: 700; letter-spacing: -.01em; overflow-wrap: anywhere; }
.stat-value small { font-size: .8rem; color: var(--muted); font-weight: 600; }
.stat-value .sub { display: block; font-size: .85rem; color: var(--muted); font-weight: 600; }
.stat-sub { font-size: .8rem; color: var(--muted); }
.stat.mini { padding: 14px 16px; } .stat.mini .stat-value { font-size: 1.15rem; } .stat.mini .stat-ico { background: #eef2f7; color: var(--navy); }
.stat.accent { background: linear-gradient(135deg, var(--acc), var(--acc-2)); color: #fff; }
.stat.accent .stat-ico { background: rgba(255,255,255,.18); color: #fff; }
.stat.accent .stat-label, .stat.accent .stat-sub, .stat.accent small, .stat.accent .sub, .stat.accent .na { color: rgba(255,255,255,.85); }
.stat.ok .stat-ico { background: var(--ok-soft); color: var(--ok); }
.stat.warn .stat-ico { background: var(--warn-soft); color: var(--warn); }
.meter-bar { display: block; width: 100%; height: 6px; border-radius: 6px; background: #e7ecf3; margin-top: 6px; overflow: hidden; }
.meter-bar i { display: block; height: 100%; background: var(--ok); }
.stat.warn .meter-bar i { background: var(--warn); }
.meter-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.meter-id { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.meter-id h2 { font-size: 1.15rem; }
.meter-id p { margin: 2px 0 0; }
.meter-ico { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, var(--acc), var(--acc-2)); }
.meter-ico .i { width: 24px; height: 24px; }
.meter-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.meter-actions select { margin: 0; width: auto; min-width: 220px; }
.note { display: flex; align-items: center; gap: 8px; margin: -6px 0 18px; }
.kv { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px 20px; }
.kv > div { display: grid; gap: 2px; min-width: 0; } .kv span { font-size: .78rem; color: var(--muted); font-weight: 600; } .kv strong { font-weight: 600; overflow-wrap: anywhere; }
.list { list-style: none; padding: 0; margin: 0; } .list li { padding: 8px 0; border-bottom: 1px solid var(--line); } .list li:last-child { border: 0; }
.back { display: inline-flex; align-items: center; gap: 6px; margin-bottom: 12px; font-size: .9rem; }
pre.code { background: var(--navy); color: #e2e8f0; padding: 14px; border-radius: 10px; overflow-x: auto; font-size: .82rem; }

/* ---------- Badges ---------- */
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 99px; font-size: .75rem; font-weight: 700; background: #eef2f7; color: #475569; white-space: nowrap; }
.badge .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.badge.ok, .badge.online, .badge.f-payee, .badge.p-confirme { background: var(--ok-soft); color: var(--ok); }
.badge.off, .badge.offline, .badge.f-impayee, .badge.p-echoue { background: var(--err-soft); color: var(--err); }
.badge.f-partielle, .badge.f-attente, .badge.p-en_attente { background: var(--warn-soft); color: var(--warn); }
.badge.inconnu, .badge.na, .badge.f-annulee { background: #eef2f7; color: #64748b; }
.badge.demo { background: #f3e8ff; color: #7e22ce; letter-spacing: .04em; }
.badge.role-admin { background: #e0e7ff; color: #3730a3; } .badge.role-agent { background: #e0f2fe; color: #0369a1; } .badge.role-client { background: #ecfdf5; color: #047857; }

/* ---------- Tableaux, filtres ---------- */
.toolbar { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; flex-wrap: wrap; padding: 14px 16px; }
.filters { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; flex: 1; }
.filters label { min-width: 150px; } .filters .grow { flex: 1; min-width: 220px; }
.filters select, .filters input { margin-top: 4px; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; }
.tabs { display: flex; gap: 6px; margin-bottom: 14px; }
.tabs a { display: inline-flex; gap: 8px; align-items: center; padding: 8px 14px; border-radius: 10px; color: #475569; font-weight: 600; font-size: .9rem; text-decoration: none; }
.tabs a.on { background: #fff; color: var(--acc); box-shadow: var(--shadow); }
.table-wrap { overflow-x: auto; margin: 0 -4px; }
.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th { text-align: left; font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 700; padding: 10px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 11px 10px; border-bottom: 1px solid #f0f3f7; vertical-align: middle; }
.table th.r, .table td.r { text-align: right; }
.table tbody tr:hover { background: #fafbfd; }
.table tfoot th { color: var(--ink); font-size: .85rem; text-transform: none; border-top: 2px solid var(--line); border-bottom: 0; }
.table tr.dim td { opacity: .55; }
.pager { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 14px; font-size: .85rem; color: var(--muted); flex-wrap: wrap; }
.pager div { display: flex; gap: 6px; }
.empty { text-align: center; padding: 40px 16px; color: var(--muted); }
.empty > .i { width: 40px; height: 40px; color: #cbd5e1; margin-bottom: 8px; }
.empty h3 { color: var(--ink); font-size: 1rem; margin-bottom: 6px; }
.empty.big { padding: 80px 16px; } .empty .btn { margin-top: 14px; }

/* ---------- Graphique SVG ---------- */
.chart { width: 100%; height: 260px; position: relative; }
.chart svg { width: 100%; height: 100%; display: block; overflow: visible; }
.chart .bar { fill: var(--acc-2); transition: opacity .1s; } .chart .bar:hover { fill: var(--acc); }
.chart.eau .bar { fill: #22b8d6; } .chart.eau .bar:hover { fill: #0369a1; }
.chart.electricite .bar { fill: #f5a524; } .chart.electricite .bar:hover { fill: #b45309; }
.chart .grid { stroke: #edf1f6; } .chart text { font-size: 11px; fill: #94a3b8; font-family: var(--font); }
.chart .gap { fill: #f1f4f8; }
.chart-sub { margin: -6px 0 6px; }
.card-head .seg[data-tabs] { flex-wrap: wrap; }

/* ---------- Modales, notifications ---------- */
dialog.modal { border: 0; border-radius: 16px; padding: 0; width: min(560px, calc(100vw - 24px)); box-shadow: 0 30px 80px rgba(2,6,23,.35); }
dialog.modal::backdrop { background: rgba(11,27,51,.5); }
dialog.modal form { padding: 20px; }
dialog.modal header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
dialog.modal header h3 { font-size: 1.05rem; }
dialog.modal footer { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }
.toast { position: fixed; right: 20px; bottom: 20px; max-width: 420px; padding: 12px 16px; border-radius: 12px; background: var(--navy); color: #fff; font-size: .9rem; box-shadow: 0 10px 30px rgba(0,0,0,.25);
  transform: translateY(20px); opacity: 0; pointer-events: none; transition: .2s; z-index: 100; }
.toast.show { transform: none; opacity: 1; } .toast.err { background: #b91c1c; } .toast.ok { background: #047857; }
.token-box { font-family: ui-monospace, Consolas, monospace; font-size: .85rem; }
.url-box { resize: vertical; word-break: break-all; }
dialog.modal.wide { width: min(720px, calc(100vw - 24px)); }
dialog.modal form > label { display: block; font-size: .8rem; font-weight: 600; color: #475569; margin-bottom: 12px; }

/* ---------- Clients OSAT SFE : recherche par NIF et formulaire ---------- */
.nif-search { padding: 20px 22px; background: linear-gradient(135deg, #fff 55%, #eef3ff); border: 1px solid #e3eaf6; }
.nif-title { margin-bottom: 14px; } .nif-title h3 { font-size: 1.02rem; color: var(--navy); } .nif-title p { margin: 4px 0 0; }
/* Liste des clients OSAT SFE */
.stat.sfe-off .stat-ico { background: var(--err-soft); color: var(--err); }
.sfe-list { padding: 0; overflow: hidden; }
.sfe-list-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.sfe-list-head h3 { display: flex; align-items: center; gap: 8px; font-size: 1.02rem; } .sfe-list-head p { margin: 4px 0 0; }
.sfe-search { display: flex; gap: 8px; align-items: center; min-width: min(420px, 100%); }
.sfe-search .field { flex: 1; } .sfe-search input { margin-top: 0; }
.sfe-chips { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px 20px; background: #fafbfd; border-bottom: 1px solid var(--line); }
.sfe-chips .chip b { margin-left: 4px; padding: 0 7px; border-radius: 99px; background: #eef2f7; color: #475569; font-size: .72rem; }
.sfe-chips .chip.on b { background: rgba(255,255,255,.2); color: #fff; }
.sfe-list .table-wrap { margin: 0; }
.sfe-table th:first-child, .sfe-table td:first-child { padding-left: 20px; } .sfe-table th:last-child, .sfe-table td:last-child { padding-right: 20px; }
.sfe-table th.c, .sfe-table td.c { text-align: center; }
.sfe-table tbody tr { transition: background .12s; }
.sfe-client { display: flex; align-items: center; gap: 12px; min-width: 220px; }
.sfe-client > div { display: grid; line-height: 1.35; } .sfe-client strong { color: var(--ink); }
.sfe-avatar { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; flex-shrink: 0; font-weight: 800; color: #fff; background: linear-gradient(135deg, #1e3a8a, #0b1b33); }
.badge.sfe-mode { background: #e0e7ff; color: #3730a3; letter-spacing: .03em; }

.sfe-list .pager { padding: 0 20px 16px; }
.sfe-list .empty { padding: 48px 20px; }
.nif-form { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.nif-form .grow { flex: 1; min-width: 240px; font-size: .8rem; font-weight: 600; color: #475569; }
.nif-form input { font-size: 1.05rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; min-height: 46px; }
.nif-form .btn { min-height: 46px; }
.nif-ico { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; background: var(--navy); color: #fff; }
.nif-result { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 14px; }
.nif-result .badge .i { width: 14px; height: 14px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 99px; border: 1px solid var(--line); background: #fff; color: #334155; font-size: .82rem; font-weight: 600; text-decoration: none !important; }
.chip:hover { border-color: #cbd5e1; } .chip.on { background: var(--navy); border-color: var(--navy); color: #fff; }
.chip.add { border-style: dashed; } .chip .i { width: 14px; height: 14px; }
.sfe-form { padding: 0; overflow: hidden; }
.sfe-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 20px; border-bottom: 1px solid var(--line); background: linear-gradient(135deg, #f8faff, #fff); }
.sfe-head .meter-ico { background: linear-gradient(135deg, var(--navy), #1e3a8a); }
.sfe-head h2 { font-size: 1.15rem; } .sfe-head p { margin: 2px 0 0; } .grow { flex: 1; min-width: 0; }
.form-section { border: 0; margin: 0; padding: 18px 20px 20px; border-bottom: 1px solid #f0f3f7; min-width: 0; }
.form-section legend { display: flex; align-items: center; gap: 8px; float: left; width: 100%; margin-bottom: 14px; font-weight: 700; font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--navy); }
.form-section legend .i { color: #1e3a8a; width: 16px; height: 16px; }
.form-section .form-grid { clear: both; }
.form-grid.three { grid-template-columns: repeat(3, 1fr); }
.req { color: var(--err); font-weight: 700; }
.field.reveal input, .field.reveal textarea { padding-right: 46px; }
.field.area textarea { display: block; min-height: 96px; max-height: 420px; resize: vertical; line-height: 1.5; padding-left: 38px; word-break: break-all; overflow-wrap: anywhere; }
.field.area > .i { top: 22px; transform: none; margin-top: 0; }
.field.area .icon-btn { top: 12px; transform: none; margin-top: 0; }
textarea.masked { -webkit-text-security: disc; text-security: disc; }
.field.reveal .icon-btn { position: absolute; right: 4px; top: 50%; margin-top: 3px; transform: translateY(-50%); }
.field.reveal .icon-btn .i { position: static; transform: none; margin: 0; color: #475569; }
.switch-grid { display: grid; grid-template-columns: 1fr; gap: 6px; clear: both; width: 100%; }
.switch-tile { position: relative; display: flex; align-items: center; gap: 10px; padding: 6px 10px 6px 6px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; background: #fff; transition: border-color .15s, background .15s; }
.sw-desc { color: var(--muted); font-size: .76rem; font-weight: 500; margin-left: 6px; }
.switch-btn { border: 0; padding: 0; background: none; cursor: pointer; display: inline-flex; vertical-align: middle; border-radius: 99px; }
.switch-btn:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(5,150,105,.25); }
.switch-btn.on .switch { background: var(--ok); }
.switch-btn.on .switch::before { content: "ON"; right: auto; left: 8px; }
.switch-btn.on .switch i { transform: translateX(28px); }
.switch-btn:disabled { opacity: .6; cursor: wait; }
.switch-tile:hover { border-color: #cbd5e1; }
.switch-tile input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.sw-ico { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; background: #eef2f7; color: #64748b; flex-shrink: 0; transition: .15s; }
.sw-ico .i { width: 15px; height: 15px; }
.sw-txt { flex: 1; min-width: 0; font-size: .86rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.switch { position: relative; width: 52px; height: 24px; border-radius: 99px; background: #cbd5e1; flex-shrink: 0; transition: background .15s; }
.switch::before { content: "OFF"; position: absolute; right: 7px; top: 50%; transform: translateY(-50%); font-size: .6rem; font-weight: 800; letter-spacing: .04em; color: #fff; }
.switch i { position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .15s; }
.switch-tile input:checked ~ .switch { background: var(--ok); }
.switch-tile input:checked ~ .switch::before { content: "ON"; right: auto; left: 8px; }
.switch-tile input:checked ~ .switch i { transform: translateX(28px); }
.switch-tile:has(input:checked) { border-color: #a7e3cb; background: #f6fdf9; }
.switch-tile:has(input:checked) .sw-ico { background: var(--ok-soft); color: var(--ok); }
.switch-tile input:focus-visible ~ .switch { box-shadow: 0 0 0 3px rgba(5,150,105,.25); }
.form-actions { display: flex; align-items: center; justify-content: flex-end; gap: 10px; padding: 16px 20px; background: #fafbfd; flex-wrap: wrap; }
.form-actions > span { margin-right: auto; }

/* ---------- Formulaire utilisateur en etapes ---------- */
.user-form .step { display: flex; align-items: center; gap: 10px; margin: 18px 0 10px; font-weight: 700; font-size: .92rem; color: var(--navy); }
.user-form > .step:first-of-type { margin-top: 4px; }
.step-n { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--navy); color: #fff; font-size: .78rem; }
.label-like { font-size: .8rem; font-weight: 600; color: #475569; margin: 14px 0 8px; }
.pw-row { display: flex; gap: 8px; align-items: center; }
.pw-row input { flex: 1; font-family: ui-monospace, Consolas, monospace; }
.pw-row .btn { margin-top: 6px; min-height: 42px; }
.choice-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.choice { position: relative; cursor: pointer; margin: 0 !important; }
.choice input { position: absolute; opacity: 0; }
.choice-body { display: grid; gap: 3px; height: 100%; padding: 12px; border: 1.5px solid var(--line); border-radius: 12px; background: #fff; transition: .15s; }
.choice-body .i { width: 22px; height: 22px; color: #64748b; margin-bottom: 4px; }
.choice-body strong { font-size: .92rem; color: var(--ink); } .choice-body small { font-size: .76rem; color: var(--muted); font-weight: 500; line-height: 1.35; }
.choice:hover .choice-body { border-color: #cbd5e1; }
.choice input:checked + .choice-body { border-color: #1e3a8a; background: #f2f6ff; box-shadow: 0 0 0 3px rgba(30,58,138,.1); }
.choice input:checked + .choice-body .i { color: #1e3a8a; }
.choice input:focus-visible + .choice-body { box-shadow: 0 0 0 3px rgba(30,58,138,.25); }
.seg-radio { display: inline-flex; flex-wrap: wrap; padding: 3px; background: #e7ecf3; border-radius: 11px; gap: 2px; margin: 0 0 4px; }
.seg-radio label { margin: 0 !important; cursor: pointer; }
.seg-radio input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.seg-radio span { display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border-radius: 9px; font-size: .86rem; font-weight: 600; color: #475569; }
.seg-radio span .i { width: 15px; height: 15px; }
.seg-radio input:checked + span { background: #fff; color: var(--navy); box-shadow: 0 1px 3px rgba(0,0,0,.1); }
.seg-radio input:focus-visible + span { outline: 2px solid #93c5fd; }
.seg-radio.sm span { padding: 5px 12px; font-size: .8rem; }
.user-form .sub { margin-top: 12px; }
.user-form .sub label { display: block; font-size: .8rem; font-weight: 600; color: #475569; margin-top: 10px; }
.meter-picks { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px; max-height: 190px; overflow-y: auto; padding: 2px; }
.pick { margin: 0 !important; cursor: pointer; position: relative; }
.pick input { position: absolute; opacity: 0; }
.pick span { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; font-size: .84rem; background: #fff; }
.pick span small { color: var(--muted); font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pick input:checked + span { border-color: var(--ok); background: #f6fdf9; box-shadow: inset 0 0 0 1px var(--ok); }
.pick input:focus-visible + span { box-shadow: 0 0 0 3px rgba(5,150,105,.25); }
.meters-box { margin-top: 14px; padding: 12px; border: 1px dashed #cbd5e1; border-radius: 12px; background: #fafbfd; }
.meters-box .label-like { display: flex; align-items: center; gap: 6px; margin-top: 0; }
.meters-box .label-like .i { width: 15px; height: 15px; }
.new-meter { display: grid; grid-template-columns: 2fr 1fr; gap: 10px; margin-top: 4px; }
.badge .i { width: 13px; height: 13px; }
.form-error { margin: 0 0 14px; }
.token-actions { margin-top: 12px; }
.blocs-box summary { display: flex; align-items: center; gap: 8px; color: var(--navy); }
.blocs-box summary .i { width: 16px; height: 16px; }
.blocs-grid { grid-template-columns: 1fr 1fr; max-height: 320px; overflow-y: auto; padding: 2px; }
.blocs-grid > div[hidden] { display: none; }
@media (max-width: 600px) { .blocs-grid { grid-template-columns: 1fr; } }
.perm-table th.c, .perm-table td.c { text-align: center; }
.perm-table th.c { font-size: .7rem; cursor: help; }
.perm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 6px; }
.perm-grid .pick span { font-size: .82rem; }
.perm-grid .pick .i { width: 15px; height: 15px; color: #64748b; }
.field-locked { opacity: .55; }
.faq-cat { display: flex; align-items: center; gap: 8px; margin: 22px 0 8px; font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--navy); }
.faq-cat:first-of-type { margin-top: 4px; } .faq-cat .i { width: 16px; height: 16px; color: #1e3a8a; }
.faq-item { border: 1px solid var(--line); border-radius: 12px; margin-bottom: 8px; background: #fff; transition: border-color .15s, box-shadow .15s; }
.faq-item[open] { border-color: #c7d2fe; box-shadow: 0 6px 18px rgba(30,58,138,.06); }
.faq-item summary { list-style: none; cursor: pointer; padding: 13px 44px 13px 16px; font-weight: 600; font-size: .93rem; position: relative; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; position: absolute; right: 16px; top: 50%; transform: translateY(-50%); width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: #eef2f7; color: var(--navy); font-weight: 700; }
.faq-item[open] summary::after { content: "−"; background: var(--navy); color: #fff; }
.faq-a { padding: 0 16px 14px; color: #334155; font-size: .9rem; line-height: 1.6; }
.faq-a p { margin: 6px 0; } .faq-a ul, .faq-a ol { margin: 6px 0; padding-left: 20px; } .faq-a li { margin: 4px 0; }
.faq-a code { background: #eef2f7; padding: 1px 6px; border-radius: 6px; }
.faq-a pre.code { margin: 8px 0; white-space: pre-wrap; word-break: break-all; }
.faq-a .table { font-size: .84rem; }
.toggle-bar { display: flex; justify-content: center; margin: 0 0 18px; }
.toggle-bar .btn[aria-expanded="true"] { background: #eef2f7; }
.otp-code { font: 700 1.05rem ui-monospace, Consolas, monospace; letter-spacing: .18em; color: var(--navy); background: #eef2f7; padding: 3px 8px; border-radius: 8px; }
.token-form { margin-top: 6px; display: flex; gap: 6px; flex-wrap: wrap; }
.pw-row .field.grow { flex: 1; min-width: 0; }
details.adv { margin-top: 18px; border-top: 1px solid var(--line); padding-top: 12px; }
details.adv summary { cursor: pointer; font-size: .85rem; font-weight: 600; color: var(--muted); margin-bottom: 10px; }

/* ---------- Page d'accueil publique ---------- */
html:has(body.home) { scroll-behavior: smooth; scroll-padding-top: 76px; }
body.home { background: #fff; color: #0f172a; }
.h-wrap { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.home h1, .home h2, .home h3 { letter-spacing: -.015em; }

/* En-tete */
.h-top { position: sticky; top: 0; z-index: 40; background: rgba(8,20,40,.86); backdrop-filter: saturate(160%) blur(12px); border-bottom: 1px solid rgba(255,255,255,.06); }
.h-top-in { display: flex; align-items: center; gap: 20px; height: 72px; }
.h-brand { display: flex; align-items: center; gap: 11px; color: #fff; text-decoration: none !important; }
.h-brand .logo { width: 42px; height: 42px; border-radius: 12px; box-shadow: 0 6px 18px rgba(245,158,11,.25); }
.h-brand strong { display: block; letter-spacing: .06em; font-size: .98rem; } .h-brand small { display: block; font-size: .72rem; color: #94a3b8; letter-spacing: .02em; }
.h-nav { display: flex; align-items: center; gap: 2px; margin-left: auto; }
.h-nav a:not(.btn) { position: relative; color: #cbd5e1; padding: 8px 13px; font-size: .9rem; font-weight: 600; text-decoration: none; transition: color .15s; }
.h-nav a:not(.btn)::after { content: ""; position: absolute; left: 13px; right: 13px; bottom: 2px; height: 2px; border-radius: 2px; background: linear-gradient(90deg, #22d3ee, #fbbf24); transform: scaleX(0); transition: transform .2s; }
.h-nav a:not(.btn):hover { color: #fff; } .h-nav a:not(.btn):hover::after { transform: scaleX(1); }
.h-login { margin-left: 10px; }
.h-menu-cb { display: none; }
.h-burger { display: none; margin-left: auto; color: #fff; cursor: pointer; padding: 8px; border-radius: 10px; }
.h-burger .i { width: 24px; height: 24px; }

/* Hero */
.h-hero { position: relative; overflow: hidden; color: #fff; padding: 96px 0 110px;
  background: linear-gradient(160deg, #081428 0%, #0b1b33 45%, #10284f 100%); }
.h-hero::before { content: ""; position: absolute; inset: 0; opacity: .5;
  background-image: linear-gradient(rgba(255,255,255,.05) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.05) 1px, transparent 1px);
  background-size: 44px 44px; mask-image: radial-gradient(ellipse at 60% 40%, #000 30%, transparent 75%); -webkit-mask-image: radial-gradient(ellipse at 60% 40%, #000 30%, transparent 75%); }
.h-glow { position: absolute; border-radius: 50%; filter: blur(80px); opacity: .55; pointer-events: none; }
.h-glow.g1 { width: 460px; height: 460px; background: #f59e0b; top: -160px; right: -80px; opacity: .35; }
.h-glow.g2 { width: 420px; height: 420px; background: #06b6d4; bottom: -200px; left: -120px; opacity: .35; }
.h-hero-in { position: relative; display: grid; grid-template-columns: 1.1fr 1fr; gap: 56px; align-items: center; }
.h-pill { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px; border-radius: 99px; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.14); font-size: .82rem; font-weight: 600; color: #e2e8f0; }
.h-dot { width: 8px; height: 8px; border-radius: 50%; background: #34d399; box-shadow: 0 0 0 4px rgba(52,211,153,.2); }
.h-hero h1 { font-size: clamp(2.2rem, 5.2vw, 3.7rem); line-height: 1.06; margin: 20px 0 18px; font-weight: 800; }
.h-hero h1 span { display: inline-block; background: linear-gradient(90deg, #22d3ee 0%, #a5f3fc 40%, #fbbf24 100%); -webkit-background-clip: text; background-clip: text; color: transparent; }
.h-hero p { font-size: 1.15rem; line-height: 1.65; color: #cbd5e1; max-width: 540px; margin: 0; }
.h-cta { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 32px; }
.home .btn.primary { background: linear-gradient(135deg, #f59e0b, #f97316); box-shadow: 0 10px 26px rgba(249,115,22,.32); }
.home .btn.primary:hover { filter: brightness(1.06); transform: translateY(-1px); }
.btn.h-ghost { background: rgba(255,255,255,.06); color: #fff; border-color: rgba(255,255,255,.22); }
.btn.h-ghost:hover { background: rgba(255,255,255,.12); }
.h-trust { list-style: none; display: flex; flex-wrap: wrap; gap: 10px 22px; padding: 0; margin: 34px 0 0; color: #94a3b8; font-size: .86rem; font-weight: 600; }
.h-trust li { display: flex; align-items: center; gap: 7px; } .h-trust .i { color: #fbbf24; width: 17px; height: 17px; }

/* Maquette du tableau de bord (illustration, sans valeurs) */
.h-mock { border-radius: 20px; background: rgba(255,255,255,.96); color: #0f172a; box-shadow: 0 40px 80px rgba(0,0,0,.45), 0 0 0 1px rgba(255,255,255,.1); overflow: hidden; transform: perspective(1400px) rotateY(-7deg) rotateX(3deg); }
.h-mock-bar { display: flex; align-items: center; gap: 6px; padding: 12px 16px; background: #f1f5f9; border-bottom: 1px solid #e2e8f0; }
.h-mock-bar i { width: 10px; height: 10px; border-radius: 50%; background: #fca5a5; } .h-mock-bar i:nth-child(2) { background: #fcd34d; } .h-mock-bar i:nth-child(3) { background: #86efac; }
.h-mock-bar span { margin-left: 8px; font-size: .76rem; font-weight: 700; color: #64748b; }
.h-mock-body { padding: 18px; display: grid; gap: 14px; }
.h-mock-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.h-mock-tiles .t { padding: 14px; border-radius: 14px; color: #fff; display: grid; gap: 2px; }
.h-mock-tiles .t .i { width: 22px; height: 22px; margin-bottom: 6px; }
.h-mock-tiles .t small { font-size: .72rem; opacity: .9; }
.h-mock-tiles .t.amber { background: linear-gradient(135deg, #f59e0b, #b45309); } .h-mock-tiles .t.cyan { background: linear-gradient(135deg, #06b6d4, #0369a1); }
.h-mock-chart { height: 130px; display: flex; align-items: flex-end; gap: 7px; padding: 14px; border-radius: 14px; background: #f8fafc; border: 1px solid #eef2f7; }
.h-mock-chart span { flex: 1; border-radius: 6px 6px 2px 2px; background: linear-gradient(180deg, #fbbf24, #22d3ee); opacity: .85; }
.h-mock-foot { display: flex; justify-content: space-between; gap: 10px; font-size: .78rem; font-weight: 600; color: #475569; }
.h-mock-foot span { display: flex; align-items: center; gap: 6px; } .h-mock-foot .i { width: 15px; height: 15px; } .h-mock-foot .ok { color: #059669; }

/* Mix : flyer SFE glisse derriere la maquette du tableau de bord */
.h-mix { position: relative; }
.h-flyer { position: absolute; left: -54px; bottom: -30px; width: 195px; z-index: 3; margin: 0;
           background: #fff; padding: 7px 7px 30px; border-radius: 10px;
           transform: rotate(-7deg);
           box-shadow: 0 26px 50px rgba(0,0,0,.55), 0 0 0 1px rgba(255,255,255,.4); }
.h-flyer img { display: block; width: 100%; border-radius: 6px; }
.h-flyer figcaption { position: absolute; left: 0; right: 0; bottom: 7px; display: flex; align-items: center; justify-content: center; gap: 5px;
                      font-size: .62rem; font-weight: 800; color: #0369a1; text-transform: uppercase; letter-spacing: .04em; }
.h-flyer figcaption .i { width: 12px; height: 12px; color: #f59e0b; }

/* Pied de page */
.h-foot { background: #081428; color: #94a3b8; padding: 64px 0 0; }
.h-foot-in { display: grid; grid-template-columns: 1.5fr 1fr 1.3fr 1fr; gap: 36px; }
.h-foot h4 { color: #fff; margin: 0 0 16px; font-size: .95rem; letter-spacing: .02em; }
.h-foot a { display: flex; align-items: center; gap: 10px; color: #94a3b8; padding: 5px 0; font-size: .92rem; text-decoration: none; transition: color .15s; }
.h-foot a:hover { color: #fbbf24; }
.h-foot p { font-size: .92rem; line-height: 1.7; margin: 14px 0 0; }
.h-fico { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; background: rgba(255,255,255,.06); color: #fbbf24; }
.h-fico .i { width: 15px; height: 15px; }
.h-hours { margin: 0; display: grid; gap: 8px; }
.h-hours div { display: flex; justify-content: space-between; gap: 12px; font-size: .9rem; padding-bottom: 8px; border-bottom: 1px dashed rgba(255,255,255,.08); }
.h-hours dt { color: #cbd5e1; } .h-hours dd { margin: 0; }
.h-copy { text-align: center; padding: 22px; margin-top: 48px; border-top: 1px solid rgba(255,255,255,.07); font-size: .82rem; color: #64748b; }
.auth-back { display: block; text-align: center; margin-top: 10px; font-size: .85rem; }

/* Apparition douce au chargement */
@media (prefers-reduced-motion: no-preference) {
  .h-hero-txt > * { animation: h-up .7s ease both; }
  .h-hero-txt > *:nth-child(2) { animation-delay: .08s; } .h-hero-txt > *:nth-child(3) { animation-delay: .16s; }
  .h-hero-txt > *:nth-child(4) { animation-delay: .24s; } .h-hero-txt > *:nth-child(5) { animation-delay: .32s; }
  .h-mock { animation: h-in .9s .2s ease both; }
}
@keyframes h-up { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@keyframes h-in { from { opacity: 0; transform: perspective(1400px) rotateY(-12deg) translateY(20px); } to { opacity: 1; transform: perspective(1400px) rotateY(-7deg) rotateX(3deg); } }

@media (max-width: 1000px) {
  .h-burger { display: inline-flex; }
  .h-nav { position: absolute; top: 72px; left: 0; right: 0; display: none; flex-direction: column; align-items: stretch; gap: 0; padding: 10px 16px 18px; background: #0b1b33; border-bottom: 1px solid rgba(255,255,255,.08); box-shadow: 0 20px 40px rgba(0,0,0,.3); }
  .h-nav a:not(.btn) { padding: 13px 8px; border-bottom: 1px solid rgba(255,255,255,.06); }
  .h-nav a:not(.btn)::after { display: none; }
  .h-login { margin: 14px 0 0; }
  .h-menu-cb:checked ~ .h-nav { display: flex; }
  .h-hero-in { grid-template-columns: 1fr; gap: 44px; }
  .h-mock { transform: none; max-width: 560px; } .h-mock { animation: none; }
  .h-flyer { position: relative; left: auto; bottom: auto; width: 230px; margin: 0 auto -8px; transform: rotate(-3deg); }
  .h-foot-in { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 620px) {
  .h-wrap { padding: 0 18px; }
  .h-hero { padding: 64px 0 76px; }
  .h-foot-in { grid-template-columns: 1fr; }
  .h-brand small { display: none; }
  .h-cta .btn { width: 100%; }
  .h-mock-tiles { grid-template-columns: 1fr; }
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); transition: transform .2s; width: 270px; }
  body.menu-open .sidebar { transform: none; }
  body.menu-open .backdrop { display: block; position: fixed; inset: 0; background: rgba(11,27,51,.45); z-index: 25; }
  .main { margin-left: 0; }
  .only-mobile { display: inline-flex; }
  .brand .only-mobile { margin-left: auto; color: #cbd5e1; }
  .topbar { padding: 10px 14px; gap: 10px; flex-wrap: wrap; }
  .topbar h1 { font-size: 1.05rem; }
  .who-txt { display: none; }
  .view { padding: 16px 14px 40px; }
  .seg button span { display: none; }
  .form-grid.three { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 600px) {
  .form-grid, .form-grid.three, .choice-cards, .new-meter { grid-template-columns: 1fr; }
  .choice-body { grid-template-columns: auto 1fr; align-items: center; column-gap: 10px; }
  .choice-body .i { grid-row: span 2; margin: 0; }
  .nif-ico { display: none; }
  .nif-form .btn, .form-actions .btn { width: 100%; }
  .stat-value { font-size: 1.25rem; }
  .meter-actions, .meter-actions select, .meter-actions .btn { width: 100%; }
  .filters label, .filters .grow { min-width: 100%; }
  .filters .btn, .actions, .actions .btn, .actions form { width: 100%; }
  .chart { height: 210px; }
  .card { padding: 16px; }
}

/* ===== Factures DGI en attente (vue SFE) ===== */
.dgi-fact .table-responsive { margin: 0 -4px; border: 1px solid var(--line); border-radius: 12px; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.dgi-fact .table { font-size: .88rem; }
.dgi-fact .table thead th { background: #f8fafc; border-bottom: 2px solid var(--line); }
.dgi-fact .table-striped tbody tr:nth-of-type(odd) { background: #fafbfd; }
.dgi-fact .table-hover tbody tr:hover { background: #eef4ff; }
.dgi-fact .table.align-middle td { vertical-align: middle; }
.dgi-fact .table tbody tr:last-child td { border-bottom: 0; }
.dgi-fact .btn-sm { min-height: 30px; padding: 4px 12px; font-size: .8rem; border-radius: 8px; }
@media (max-width: 600px) {
  .dgi-fact .table { font-size: .82rem; }
  .dgi-fact .table th, .dgi-fact .table td { padding: 9px 8px; }
}

.toggle-bar.tog-left { justify-content: flex-start; margin-left: -4px; }

/* ===== Envoi DGI AJAX (tableau Factures en attente) ===== */
.toast.top { bottom: auto; top: 20px; }
.dgi-send.busy button { pointer-events: none; }
.dgi-send .dgi-spin { display: none; width: 13px; height: 13px; margin-left: 6px; border: 2px solid rgba(255,255,255,.35); border-top-color: #fff; border-radius: 50%; animation: dgi-rot .7s linear infinite; }
.dgi-send.busy .dgi-spin { display: inline-block; }
.dgi-send.busy .dgi-btn-label { opacity: .65; }
@keyframes dgi-rot { to { transform: rotate(360deg); } }
