/*!
 * Pluriware SMS API Dashboard v4 — feuille de style unique
 * Structure et esprit AdminLTE 4 (sidebar sombre, cartes, small-box/KPI), réécrite
 * sans Bootstrap ni dépendance : aucune ressource externe, compatible CSP stricte.
 */

/* ===================================================================== Variables */
:root {
  color-scheme: light;
  --font: "Source Sans 3", "Source Sans Pro", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "Cascadia Mono", Consolas, "Liberation Mono", monospace;

  --brand: #15925b;
  --brand-600: #11804f;
  --brand-700: #0d6b42;
  --brand-50: #e8f6ef;
  --brand-100: #c9ecd9;

  --bg: #f4f6f9;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --surface-3: #eef2f6;
  --border: #e3e8ef;
  --border-strong: #cdd5df;
  --text: #1e2833;
  --text-2: #4b5768;
  --text-3: #6b7685;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .06);
  --shadow: 0 1px 3px rgba(16, 24, 40, .08), 0 1px 2px rgba(16, 24, 40, .04);
  --shadow-lg: 0 12px 32px rgba(16, 24, 40, .14);
  --focus: 0 0 0 3px rgba(21, 146, 91, .28);

  --sidebar-bg: #1b2532;
  --sidebar-bg-2: #232f3e;
  --sidebar-text: #c2cad5;
  --sidebar-muted: #7c8899;
  --sidebar-active: #15925b;
  --sidebar-w: 256px;
  --sidebar-w-mini: 72px;
  --header-h: 60px;

  --success: #15803d; --success-bg: #e7f6ec; --success-bd: #b9e4c7;
  --warning: #b45309; --warning-bg: #fff4e0; --warning-bd: #fbd9a5;
  --danger:  #c62828; --danger-bg:  #fdecec; --danger-bd:  #f6c1c1;
  --info:    #0369a1; --info-bg:    #e6f3fa; --info-bd:    #b5dcf0;
  --primary: #2563eb; --primary-bg: #e9f0fe;
  --secondary: #64748b; --secondary-bg: #eef1f5;

  /* Palette catégorielle des graphiques (ordre fixe, validée daltonisme) */
  --series-1: #2a78d6; --series-2: #eb6834; --series-3: #1baf7a; --series-4: #eda100;
  --series-5: #e87ba4; --series-6: #008300; --series-7: #6250d6; --series-8: #e34948;
  --series-prev: #9aa5b4;
  --grid: #e9edf2;

  --radius: 10px;
  --radius-sm: 7px;
  --radius-lg: 14px;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #12171e; --surface: #1a2029; --surface-2: #1f2631; --surface-3: #262e3a;
  --border: #2c3542; --border-strong: #3a4554; --text: #e6eaf0; --text-2: #b4bdc9; --text-3: #8b95a3;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3); --shadow: 0 1px 3px rgba(0, 0, 0, .35); --shadow-lg: 0 16px 40px rgba(0, 0, 0, .5);
  --brand-50: #12301f; --brand-100: #1a4a31;
  --sidebar-bg: #0f141a; --sidebar-bg-2: #171e27;
  --success: #4ade80; --success-bg: #12301f; --success-bd: #1f5133;
  --warning: #fbbf24; --warning-bg: #33260d; --warning-bd: #5c4513;
  --danger: #f87171; --danger-bg: #3a1717; --danger-bd: #5f2424;
  --info: #38bdf8; --info-bg: #0f2a3a; --info-bd: #1b4a63;
  --primary: #60a5fa; --primary-bg: #172a46; --secondary: #94a3b8; --secondary-bg: #263040;
  --series-1: #3987e5; --series-2: #d95926; --series-3: #199e70; --series-4: #c98500;
  --series-5: #d55181; --series-6: #0ca30c; --series-7: #9085e9; --series-8: #e66767;
  --series-prev: #6b7685; --grid: #27303c;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #12171e; --surface: #1a2029; --surface-2: #1f2631; --surface-3: #262e3a;
    --border: #2c3542; --border-strong: #3a4554; --text: #e6eaf0; --text-2: #b4bdc9; --text-3: #8b95a3;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3); --shadow: 0 1px 3px rgba(0, 0, 0, .35); --shadow-lg: 0 16px 40px rgba(0, 0, 0, .5);
    --brand-50: #12301f; --brand-100: #1a4a31;
    --sidebar-bg: #0f141a; --sidebar-bg-2: #171e27;
    --success: #4ade80; --success-bg: #12301f; --success-bd: #1f5133;
    --warning: #fbbf24; --warning-bg: #33260d; --warning-bd: #5c4513;
    --danger: #f87171; --danger-bg: #3a1717; --danger-bd: #5f2424;
    --info: #38bdf8; --info-bg: #0f2a3a; --info-bd: #1b4a63;
    --primary: #60a5fa; --primary-bg: #172a46; --secondary: #94a3b8; --secondary-bg: #263040;
    --series-1: #3987e5; --series-2: #d95926; --series-3: #199e70; --series-4: #c98500;
    --series-5: #d55181; --series-6: #0ca30c; --series-7: #9085e9; --series-8: #e66767;
    --series-prev: #6b7685; --grid: #27303c;
  }
}

/* ========================================================================= Base */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); font-size: 15px; line-height: 1.5; color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; line-height: 1.25; }
p { margin: 0; }
a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-600); text-decoration: underline; }
code, .mono { font-family: var(--mono); font-size: .9em; }
small, .small { font-size: .86em; }
.muted { color: var(--text-3); }
.nowrap { white-space: nowrap; }
.text-danger { color: var(--danger) !important; }
.text-warning { color: var(--warning) !important; }
.text-success { color: var(--success) !important; }
.text-muted { color: var(--text-3) !important; }
.fst-italic { font-style: italic; }
[hidden] { display: none !important; }
.spacer { flex: 1 1 auto; }
.print-only { display: none; }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: 4px; }
.skip-link { position: absolute; left: -9999px; top: 8px; z-index: 100; background: var(--brand); color: #fff; padding: 8px 14px; border-radius: 6px; }
.skip-link:focus { left: 8px; }

.ic { width: 18px; height: 18px; flex: none; vertical-align: -3px; }
.ic-xl { width: 44px; height: 44px; }

/* ===================================================================== Sidebar */
.app-sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--sidebar-w); z-index: 40;
  background: var(--sidebar-bg); color: var(--sidebar-text); display: flex; flex-direction: column;
  transition: width .2s ease, transform .25s ease; box-shadow: 1px 0 0 rgba(255,255,255,.03);
}
.sidebar-brand { height: var(--header-h); display: flex; align-items: center; padding: 0 18px; border-bottom: 1px solid rgba(255,255,255,.06); }
.brand-link { display: flex; align-items: center; gap: 12px; color: #fff; white-space: nowrap; overflow: hidden; }
.brand-link:hover { color: #fff; text-decoration: none; }
.brand-image { width: 36px; height: 29px; object-fit: contain; flex: none; }
.brand-text { font-size: 17px; font-weight: 400; letter-spacing: .2px; }
.brand-text strong { font-weight: 700; }
.sidebar-wrapper { flex: 1; overflow-y: auto; padding: 12px 10px; scrollbar-width: thin; scrollbar-color: #334155 transparent; }
.nav-sidebar { list-style: none; margin: 0; padding: 0; }
.nav-header { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--sidebar-muted); padding: 16px 12px 6px; white-space: nowrap; overflow: hidden; }
.nav-item { margin: 2px 0; }
.nav-link {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 9px 12px; border: 0; border-radius: 8px;
  background: none; color: var(--sidebar-text); font: inherit; font-size: 14.5px; text-align: left; cursor: pointer; white-space: nowrap; overflow: hidden;
}
.nav-link .ic { width: 19px; height: 19px; opacity: .85; }
.nav-link:hover { background: rgba(255,255,255,.06); color: #fff; text-decoration: none; }
.nav-link.active { background: var(--sidebar-active); color: #fff; box-shadow: 0 4px 12px rgba(21,146,91,.35); }
.nav-link.active .ic { opacity: 1; }
.nav-arrow { margin-left: auto; width: 15px !important; height: 15px !important; transition: transform .2s; }
.has-tree.open > .nav-link .nav-arrow { transform: rotate(90deg); }
.has-tree.open > .nav-link { color: #fff; }
.nav-tree { list-style: none; margin: 2px 0 4px; padding: 0 0 0 10px; display: none; }
.has-tree.open > .nav-tree { display: block; }
.nav-tree .nav-link { padding: 7px 12px 7px 20px; font-size: 14px; }
.nav-tree .nav-link.active { background: rgba(21,146,91,.22); box-shadow: none; color: #fff; }
.nav-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .55; flex: none; }
.sidebar-foot { padding: 12px 18px; font-size: 12px; color: var(--sidebar-muted); border-top: 1px solid rgba(255,255,255,.06); white-space: nowrap; overflow: hidden; }
.sidebar-overlay { display: none; }

/* ==================================================================== Structure */
.app-body { margin-left: var(--sidebar-w); min-height: 100vh; display: flex; flex-direction: column; transition: margin-left .2s ease; }
.app-header {
  position: sticky; top: 0; z-index: 30; height: var(--header-h); display: flex; align-items: center; gap: 12px; padding: 0 20px;
  background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: saturate(160%) blur(10px); border-bottom: 1px solid var(--border);
}
.header-title { font-weight: 600; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; opacity: 0; transition: opacity .2s; }
.scrolled .header-title { opacity: 1; }
.header-right { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.app-main { flex: 1; padding: 24px 28px 32px; width: 100%; max-width: 1680px; margin: 0 auto; outline: none; }
.content-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.content-header h1 { font-size: 26px; font-weight: 700; letter-spacing: -.01em; }
.content-header .subtitle { color: var(--text-3); margin-top: 4px; }
.content-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.content-body > * + * { margin-top: 20px; }
.app-footer { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 14px 28px; font-size: 13px; color: var(--text-3); border-top: 1px solid var(--border); background: var(--surface); }
.footer-links { display: flex; gap: 16px; }

/* Sidebar repliée (bureau) */
@media (min-width: 992px) {
  .sidebar-collapsed .app-sidebar { width: var(--sidebar-w-mini); }
  .sidebar-collapsed .app-body { margin-left: var(--sidebar-w-mini); }
  .sidebar-collapsed .brand-text, .sidebar-collapsed .nav-link span, .sidebar-collapsed .nav-arrow,
  .sidebar-collapsed .nav-header, .sidebar-collapsed .sidebar-foot, .sidebar-collapsed .nav-tree { display: none !important; }
  .sidebar-collapsed .nav-link { justify-content: center; padding: 11px 0; }
  .sidebar-collapsed .sidebar-brand { justify-content: center; padding: 0; }
}
/* Mobile / tablette : sidebar en tiroir */
@media (max-width: 991.98px) {
  .app-sidebar { transform: translateX(-100%); box-shadow: var(--shadow-lg); }
  .sidebar-open .app-sidebar { transform: none; }
  .sidebar-open .sidebar-overlay { display: block; position: fixed; inset: 0; background: rgba(15, 23, 42, .45); z-index: 35; }
  .app-body { margin-left: 0; }
  .app-main { padding: 18px 16px 28px; }
  .app-header { padding: 0 12px; }
  .content-header h1 { font-size: 22px; }
}
@media (max-width: 640px) { .hide-sm { display: none !important; } .credit-label, .credit-unit { display: none; } }
@media (max-width: 900px) { .hide-md { display: none !important; } }

/* ===================================================================== En-tête */
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-width: 38px; height: 38px; padding: 0 9px;
  border: 0; border-radius: 9px; background: transparent; color: var(--text-2); cursor: pointer; font: inherit; font-size: 13px; font-weight: 600;
}
.icon-btn:hover { background: var(--surface-3); color: var(--text); text-decoration: none; }
.credit-pill {
  display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 14px; border-radius: 999px; font-size: 13.5px;
  border: 1px solid var(--border); background: var(--surface-2); color: var(--text-2); white-space: nowrap; margin-right: 4px;
}
.credit-pill:hover { text-decoration: none; border-color: var(--border-strong); color: var(--text); }
.credit-pill strong { color: var(--text); font-size: 14.5px; font-variant-numeric: tabular-nums; }
.credit-pill .ic { width: 17px; height: 17px; }
.credit-success .ic { color: var(--success); } .credit-warning { border-color: var(--warning-bd); background: var(--warning-bg); } .credit-warning .ic { color: var(--warning); }
.credit-danger { border-color: var(--danger-bd); background: var(--danger-bg); } .credit-danger .ic, .credit-danger strong { color: var(--danger); }
.credit-label { font-weight: 600; text-transform: uppercase; font-size: 11px; letter-spacing: .05em; color: var(--text-3); }
.credit-unit { color: var(--text-3); }
.theme-light, .theme-dark, .theme-auto { display: none; }
[data-theme-mode="light"] .theme-light, [data-theme-mode="dark"] .theme-dark, [data-theme-mode="auto"] .theme-auto { display: inline-block; }
.user-btn { display: flex; align-items: center; gap: 10px; padding: 4px 8px 4px 4px; border: 0; border-radius: 999px; background: transparent; cursor: pointer; color: var(--text); font: inherit; text-align: left; }
.user-btn:hover { background: var(--surface-3); }
.user-meta { display: flex; flex-direction: column; line-height: 1.15; max-width: 190px; }
.user-name { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-sub { font-size: 12px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.avatar {
  width: 34px; height: 34px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; flex: none;
  background: linear-gradient(135deg, var(--brand), #0f766e); color: #fff; font-weight: 700; font-size: 14px;
}
.avatar-lg { width: 46px; height: 46px; font-size: 18px; }
.avatar-xl { width: 84px; height: 84px; font-size: 32px; box-shadow: 0 0 0 5px var(--brand-50); }
.avatar-soft { background: var(--brand-50); color: var(--brand); }
.avatar-soft .ic { width: 17px; height: 17px; }
.lang-code { font-size: 12px; }

/* ==================================================================== Dropdown */
.dropdown { position: relative; }
.dropdown-menu {
  position: absolute; top: calc(100% + 6px); left: 0; z-index: 50; min-width: 210px; padding: 6px; display: none;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg);
}
.dropdown-menu-end { left: auto; right: 0; }
.dropdown.open > .dropdown-menu { display: block; animation: pop .14s ease-out; }
.dropdown-item {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border: 0; border-radius: 7px; background: none;
  color: var(--text); font: inherit; font-size: 14px; text-align: left; cursor: pointer; white-space: nowrap;
}
.dropdown-item:hover, .dropdown-item.active { background: var(--surface-3); text-decoration: none; color: var(--text); }
.dropdown-item.active { font-weight: 600; }
.dropdown-item .ic { color: var(--text-3); }
.dropdown-item.text-danger .ic { color: var(--danger); }
.dropdown-divider { height: 1px; background: var(--border); margin: 6px 2px; }
.user-menu { min-width: 280px; }
.user-card { display: flex; gap: 12px; align-items: center; padding: 10px 10px 12px; border-bottom: 1px solid var(--border); margin-bottom: 6px; }
.user-card div { display: flex; flex-direction: column; min-width: 0; }
.user-card strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-card small { color: var(--text-3); }
@keyframes pop { from { opacity: 0; transform: translateY(-4px) scale(.98); } to { opacity: 1; transform: none; } }

/* ======================================================================== Cartes */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow); min-width: 0; }
.card-soft { background: var(--surface-2); box-shadow: none; }
.card-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 14px 20px; border-bottom: 1px solid var(--border); min-height: 56px; }
.card-header h2 { font-size: 16.5px; display: flex; align-items: center; gap: 8px; }
.card-header h2 small { font-weight: 400; }
.card-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.card-body { padding: 20px; }
.card-footer { padding: 12px 20px; border-top: 1px solid var(--border); background: var(--surface-2); border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
.card > .table-wrap:last-child { border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-main { grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); }
.grid-side { grid-template-columns: minmax(0, 2fr) minmax(260px, 1fr); align-items: start; }
.grid-profile { grid-template-columns: 300px minmax(0, 1fr); align-items: start; }
@media (max-width: 1100px) { .grid-2, .grid-main, .grid-side, .grid-profile { grid-template-columns: minmax(0, 1fr); } }
.stack > * + * { margin-top: 14px; }
.stack-lg > * + * { margin-top: 22px; }
.narrow { max-width: 680px; margin-left: auto; margin-right: auto; }
.narrow-form { max-width: 520px; }

/* ========================================================================== KPI */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.kpi-grid-5 { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.kpi { position: relative; display: flex; gap: 14px; align-items: flex-start; padding: 18px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow); overflow: hidden; }
.kpi::after { content: ""; position: absolute; right: -28px; bottom: -28px; width: 96px; height: 96px; border-radius: 50%; background: var(--kpi-c, var(--brand)); opacity: .07; }
.kpi-icon { width: 44px; height: 44px; border-radius: 12px; display: flex; align-items: center; justify-content: center; flex: none; background: color-mix(in srgb, var(--kpi-c, var(--brand)) 14%, transparent); color: var(--kpi-c, var(--brand)); }
.kpi-icon .ic { width: 22px; height: 22px; }
.kpi-body { min-width: 0; }
.kpi-label { font-size: 13px; color: var(--text-3); font-weight: 600; }
.kpi-value { font-size: 26px; font-weight: 700; letter-spacing: -.01em; font-variant-numeric: tabular-nums; line-height: 1.2; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi-foot { font-size: 12.5px; margin-top: 4px; color: var(--text-3); }
.kpi-primary { --kpi-c: var(--series-1); } .kpi-success { --kpi-c: #15925b; } .kpi-violet { --kpi-c: var(--series-7); }
.kpi-teal { --kpi-c: var(--series-3); } .kpi-orange { --kpi-c: var(--series-2); } .kpi-pink { --kpi-c: var(--series-5); } .kpi-warning { --kpi-c: #d97706; }
.delta { display: inline-flex; align-items: center; gap: 3px; font-weight: 700; font-size: 12.5px; }
.delta .ic { width: 15px; height: 15px; }
.delta-up { color: var(--success); } .delta-down { color: var(--danger); } .delta-neutral { color: var(--text-3); }

/* ===================================================================== Boutons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 16px;
  border: 1px solid transparent; border-radius: 9px; font: inherit; font-size: 14.5px; font-weight: 600; cursor: pointer; white-space: nowrap;
  transition: background .15s, border-color .15s, box-shadow .15s, transform .05s; text-decoration: none !important;
}
.btn:active { transform: translateY(1px); }
.btn[disabled], .btn.is-loading { opacity: .65; pointer-events: none; }
.btn-primary { background: var(--brand); color: #fff; box-shadow: 0 1px 2px rgba(21,146,91,.35); }
.btn-primary:hover { background: var(--brand-600); color: #fff; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { filter: brightness(.95); color: #fff; }
.btn-outline { background: var(--surface); border-color: var(--border-strong); color: var(--text); }
.btn-outline:hover { background: var(--surface-3); color: var(--text); }
.btn-ghost { background: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--surface-3); color: var(--text); }
.btn-sm { height: 32px; padding: 0 11px; font-size: 13px; border-radius: 8px; }
.btn-sm .ic { width: 15px; height: 15px; }
.btn-lg { height: 46px; font-size: 15.5px; }
.btn-block { width: 100%; }
.link-btn { display: inline-flex; align-items: center; gap: 6px; padding: 0; border: 0; background: none; color: var(--brand); font: inherit; cursor: pointer; }
.link-btn:hover { text-decoration: underline; }
.link-btn[disabled] { color: var(--text-3); cursor: default; text-decoration: none; }
.link-btn .ic { width: 16px; height: 16px; }
.btn-close { border: 0; background: none; font-size: 22px; line-height: 1; color: var(--text-3); cursor: pointer; padding: 2px 6px; border-radius: 6px; }
.btn-close:hover { background: var(--surface-3); color: var(--text); }
.spinner { width: 18px; height: 18px; border: 2.5px solid currentColor; border-right-color: transparent; border-radius: 50%; display: inline-block; animation: spin .7s linear infinite; }
.btn .spinner { width: 15px; height: 15px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ================================================================= Formulaires */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label, .label-row label, .field-range > label { font-size: 13.5px; font-weight: 600; color: var(--text-2); }
.label-row { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.small-link { font-size: 13px; }
.form-control {
  width: 100%; height: 40px; padding: 0 12px; font: inherit; font-size: 14.5px; color: var(--text); background: var(--surface);
  border: 1px solid var(--border-strong); border-radius: 9px; transition: border-color .15s, box-shadow .15s; min-width: 0;
}
.form-control::placeholder { color: var(--text-3); opacity: .8; }
.form-control:hover { border-color: color-mix(in srgb, var(--border-strong) 60%, var(--text-3)); }
.form-control:focus { outline: none; border-color: var(--brand); box-shadow: var(--focus); }
.form-control.is-invalid { border-color: var(--danger); box-shadow: 0 0 0 3px color-mix(in srgb, var(--danger) 20%, transparent); }
.form-control.is-valid { border-color: var(--success); }
.form-control-sm { height: 34px; font-size: 13.5px; }
textarea.form-control { height: auto; padding: 10px 12px; resize: vertical; min-height: 120px; line-height: 1.5; }
select.form-control {
  appearance: none; padding-right: 34px; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--text-3) 50%), linear-gradient(135deg, var(--text-3) 50%, transparent 50%);
  background-position: calc(100% - 17px) 17px, calc(100% - 12px) 17px; background-size: 5px 5px; background-repeat: no-repeat;
}
input[type="datetime-local"].form-control, input[type="date"].form-control { padding-right: 8px; }
.input-icon { position: relative; display: flex; align-items: center; }
.input-icon > .ic { position: absolute; left: 12px; color: var(--text-3); pointer-events: none; width: 17px; height: 17px; }
.input-icon > .form-control { padding-left: 38px; }
.input-icon .pw-toggle { position: absolute; right: 6px; height: 30px; width: 34px; border: 0; background: none; color: var(--text-3); border-radius: 6px; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.input-icon .pw-toggle:hover { background: var(--surface-3); color: var(--text); }
.hint { font-size: 12.8px; color: var(--text-3); display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.hint .ic { width: 15px; height: 15px; }
.otp-input { font-family: var(--mono); font-size: 26px; height: 56px; text-align: center; letter-spacing: .45em; }

.filter-card .card-body { padding: 18px 20px; }
.filter-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 16px 18px; align-items: end; }
.filter-grid-2 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.filter-grid .field-range { grid-column: span 2; }
@media (max-width: 640px) { .filter-grid .field-range { grid-column: auto; } }
.filter-advanced { margin-top: 16px; padding-top: 16px; border-top: 1px dashed var(--border-strong); }
.filter-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.filter-row { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.filter-row .grow { flex: 1 1 280px; }
.filter-row + .hint { margin-top: 10px; }
.range-inputs { position: relative; display: flex; align-items: center; gap: 6px; }
.range-inputs > .ic { position: absolute; left: 12px; color: var(--text-3); pointer-events: none; width: 17px; height: 17px; z-index: 1; }
.range-inputs .form-control:first-of-type { padding-left: 38px; }
.range-sep { color: var(--text-3); flex: none; }
.range-presets-btn { flex: none; border: 1px solid var(--border-strong); height: 40px; }
.range-pop { position: absolute; top: calc(100% + 6px); right: 0; z-index: 45; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: 6px; display: grid; grid-template-columns: 1fr 1fr; gap: 2px; min-width: 300px; animation: pop .14s ease-out; }
.range-pop button { border: 0; background: none; text-align: left; padding: 8px 10px; border-radius: 7px; font: inherit; font-size: 13.5px; color: var(--text); cursor: pointer; }
.range-pop button:hover { background: var(--surface-3); }

/* Segmented control */
.segmented { display: inline-flex; padding: 3px; gap: 2px; background: var(--surface-3); border-radius: 10px; border: 1px solid var(--border); width: max-content; max-width: 100%; }
.segmented label, .segmented .seg { position: relative; margin: 0; cursor: pointer; }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented span, .segmented .seg { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 32px; padding: 0 14px; border-radius: 8px; font-size: 13.5px; font-weight: 600; color: var(--text-2); }
.segmented .seg { padding: 0 10px; }
.segmented input:checked + span, .segmented .seg.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.segmented input:focus-visible + span { box-shadow: var(--focus); }
.segmented-sm span { height: 28px; padding: 0 11px; font-size: 13px; }
.segmented .seg:hover { text-decoration: none; color: var(--text); }

/* Interrupteur */
.switch { display: inline-flex; align-items: center; gap: 9px; cursor: pointer; font-size: 13.5px; font-weight: 600; color: var(--text-2); user-select: none; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch .slider { position: relative; width: 38px; height: 22px; border-radius: 22px; background: var(--border-strong); transition: background .2s; flex: none; }
.switch .slider::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.25); transition: transform .2s; }
.switch input:checked + .slider { background: var(--brand); }
.switch input:checked + .slider::after { transform: translateX(16px); }
.switch input:focus-visible + .slider { box-shadow: var(--focus); }
.switch-sm .slider { width: 32px; height: 18px; } .switch-sm .slider::after { width: 12px; height: 12px; } .switch-sm input:checked + .slider::after { transform: translateX(14px); }

/* Cartes de choix (radio) */
.choice-list { display: grid; gap: 10px; }
.choice-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; }
.choice { position: relative; display: block; cursor: pointer; }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice-body { display: flex; align-items: center; gap: 12px; padding: 13px 14px; border: 1.5px solid var(--border); border-radius: var(--radius); background: var(--surface); transition: border-color .15s, background .15s; }
.choice-body > .ic { width: 22px; height: 22px; color: var(--text-3); }
.choice-body > span { display: flex; flex-direction: column; min-width: 0; }
.choice-body small { color: var(--text-3); }
.choice:hover .choice-body { border-color: var(--border-strong); }
.choice input:checked + .choice-body { border-color: var(--brand); background: var(--brand-50); }
.choice input:checked + .choice-body > .ic { color: var(--brand); }
.choice input:focus-visible + .choice-body { box-shadow: var(--focus); }
.choice-compact .choice-body { padding: 10px 12px; font-size: 14px; font-weight: 600; }
.disclosure { margin-top: 18px; border: 1px solid var(--border); border-radius: var(--radius); padding: 0 14px; }
.disclosure summary { cursor: pointer; padding: 12px 0; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.disclosure[open] { padding-bottom: 14px; }

/* Mot de passe */
.pw-meter { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; margin-top: 4px; }
.pw-meter span { height: 4px; border-radius: 4px; background: var(--surface-3); transition: background .2s; }
.pw-meter[data-level="1"] span:nth-child(-n+1) { background: var(--danger); }
.pw-meter[data-level="2"] span:nth-child(-n+2) { background: #ea7a20; }
.pw-meter[data-level="3"] span:nth-child(-n+3) { background: #d4a20b; }
.pw-meter[data-level="4"] span { background: var(--success); }
.pw-rules { list-style: none; padding: 0; margin: 0; display: grid; gap: 4px; font-size: 13px; color: var(--text-3); }
.pw-rules li { display: flex; align-items: center; gap: 8px; }
.pw-rules .ic { width: 15px; height: 15px; padding: 1px; border-radius: 50%; background: var(--surface-3); color: transparent; }
.pw-rules li.ok { color: var(--success); }
.pw-rules li.ok .ic { background: var(--success); color: #fff; }
.pw-rules code { font-size: 11.5px; }
.pw-match.ok { color: var(--success); } .pw-match.ko { color: var(--danger); }

/* ======================================================================= Tables */
.table-wrap { width: 100%; overflow-x: auto; }
.table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 14px; }
.table th { position: sticky; top: 0; z-index: 1; background: var(--surface-2); color: var(--text-3); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.table td { padding: 11px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: color-mix(in srgb, var(--brand) 4%, var(--surface)); }
.table tfoot th, .table tfoot td { position: static; background: var(--surface-2); color: var(--text); font-size: 14px; text-transform: none; letter-spacing: 0; border-top: 1px solid var(--border-strong); border-bottom: 0; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table th.num { text-align: right; }
.table .actions { text-align: right; }
.table .actions .icon-btn { height: 32px; min-width: 32px; }
.table th[data-sort-key] { cursor: pointer; user-select: none; }
.table th[data-sort-key]:hover { color: var(--text); }
.table th .sort-ind { display: inline-block; margin-left: 4px; opacity: .35; font-size: 10px; }
.table th[aria-sort] .sort-ind { opacity: 1; color: var(--brand); }
.table tr.clickable { cursor: pointer; }
.table tr.row-mo td:first-child { box-shadow: inset 3px 0 0 var(--info); }
.table .id-cell span { display: block; max-width: 190px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.table .msg-cell { min-width: 260px; max-width: 460px; white-space: pre-wrap; word-break: break-word; color: var(--text-2); font-size: 13.5px; }
.table .msg-cell .clip { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.share-col { width: 26%; }
.share { display: flex; align-items: center; gap: 10px; font-variant-numeric: tabular-nums; font-size: 13px; }
.share > span:last-child { min-width: 52px; text-align: right; }
.share-bar { flex: 1; height: 8px; border-radius: 6px; background: var(--surface-3); position: relative; overflow: hidden; }
.share-bar::before { content: ""; position: absolute; inset: 0 auto 0 0; width: var(--w, 0%); background: var(--series-1); border-radius: 6px; }
.amount.pos { color: var(--success); font-weight: 600; } .amount.neg { color: var(--danger); font-weight: 600; }
.table-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-size: 13.5px; color: var(--text-3); }
.table-footer:empty { display: none; }
.pager { display: flex; align-items: center; gap: 4px; }
.pager button { min-width: 34px; height: 34px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text-2); font: inherit; font-size: 13.5px; cursor: pointer; padding: 0 8px; }
.pager button:hover:not([disabled]) { background: var(--surface-3); color: var(--text); }
.pager button.active { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 700; }
.pager button[disabled] { opacity: .45; cursor: default; }
.pager .gap { padding: 0 4px; }
.dt-toolbar { display: flex; justify-content: flex-end; padding: 12px 16px 0; }
.search-box { position: relative; display: flex; align-items: center; }
.search-box .ic { position: absolute; left: 10px; color: var(--text-3); width: 16px; height: 16px; pointer-events: none; }
.search-box .form-control { padding-left: 32px; width: 240px; }
@media (max-width: 640px) { .search-box .form-control { width: 100%; } .search-box { flex: 1; } }

/* ============================================================ Badges, états, puces */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; line-height: 1.4; white-space: nowrap; }
.text-bg-success { background: var(--success-bg); color: var(--success); }
.text-bg-danger { background: var(--danger-bg); color: var(--danger); }
.text-bg-warning { background: var(--warning-bg); color: var(--warning); }
.text-bg-info { background: var(--info-bg); color: var(--info); }
.text-bg-primary { background: var(--primary-bg); color: var(--primary); }
.text-bg-secondary { background: var(--secondary-bg); color: var(--secondary); }
.text-bg-dark { background: #1f2937; color: #f3f4f6; }
.status { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 600; white-space: nowrap; padding: 3px 10px 3px 8px; border-radius: 999px; }
.status .dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; flex: none; }
.status-success { color: var(--success); background: var(--success-bg); }
.status-danger { color: var(--danger); background: var(--danger-bg); }
.status-warning { color: var(--warning); background: var(--warning-bg); }
.status-info { color: var(--info); background: var(--info-bg); }
.status-primary { color: var(--primary); background: var(--primary-bg); }
.status-secondary { color: var(--secondary); background: var(--secondary-bg); }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; background: var(--surface-3); color: var(--text-2); font-size: 12.5px; font-weight: 600; border: 1px solid var(--border); font-family: inherit; cursor: default; }
button.chip { cursor: pointer; }
button.chip:hover { border-color: var(--brand); color: var(--brand); }
.chip .ic { width: 14px; height: 14px; }
.chip-sm { padding: 2px 8px; font-size: 12px; font-weight: 500; }
.chip-warning { background: var(--warning-bg); color: var(--warning); border-color: var(--warning-bd); }
.summary-chips { display: flex; flex-wrap: wrap; gap: 10px; }
.summary-chips:empty { display: none; }
.sum-chip { display: flex; align-items: center; gap: 10px; padding: 10px 16px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-sm); }
.sum-chip strong { font-size: 18px; font-variant-numeric: tabular-nums; }
.sum-chip span { color: var(--text-3); font-size: 13px; }
.sum-chip .dot { width: 10px; height: 10px; border-radius: 50%; }
.dot-success { background: var(--success); } .dot-primary { background: var(--primary); } .dot-danger { background: var(--danger); } .dot-info { background: var(--info); } .dot-warning { background: var(--warning); } .dot-neutral { background: var(--text-3); }

/* ======================================================================= Alertes */
.alert { display: flex; align-items: flex-start; gap: 12px; padding: 13px 16px; border-radius: var(--radius); border: 1px solid; font-size: 14.5px; }
.alert > .ic { margin-top: 2px; }
.alert > div { flex: 1; }
.alert .btn-close { margin: -4px -6px -4px 0; color: inherit; opacity: .6; }
.alert-success { background: var(--success-bg); border-color: var(--success-bd); color: var(--success); }
.alert-danger { background: var(--danger-bg); border-color: var(--danger-bd); color: var(--danger); }
.alert-warning { background: var(--warning-bg); border-color: var(--warning-bd); color: var(--warning); }
.alert-info { background: var(--info-bg); border-color: var(--info-bd); color: var(--info); }
.alert > div { color: var(--text); }
.content-body > .alert + .alert { margin-top: 10px; }

/* ======================================================================== Toasts */
.toast-zone { position: fixed; right: 20px; bottom: 20px; z-index: 90; display: flex; flex-direction: column; gap: 10px; max-width: min(420px, calc(100vw - 40px)); }
.toast { display: flex; gap: 10px; align-items: center; padding: 12px 16px; border-radius: 11px; background: #1f2937; color: #fff; box-shadow: var(--shadow-lg); font-size: 14px; animation: toastin .2s ease-out; }
.toast .ic { color: #4ade80; }
.toast.toast-error .ic { color: #f87171; }
@keyframes toastin { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ======================================================================= Modales */
dialog.modal { border: 0; padding: 0; border-radius: var(--radius-lg); background: var(--surface); color: var(--text); box-shadow: var(--shadow-lg); width: min(560px, calc(100vw - 32px)); max-height: calc(100vh - 48px); }
dialog.modal-lg { width: min(820px, calc(100vw - 32px)); }
dialog.modal::backdrop { background: rgba(15, 23, 42, .55); backdrop-filter: blur(2px); }
dialog.modal[open] { animation: pop .16s ease-out; display: flex; flex-direction: column; }
.modal-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.modal-header h2 { font-size: 17px; }
.modal-body { padding: 20px; overflow: auto; }
.modal-footer { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--border); background: var(--surface-2); }
.detail-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px 20px; }
.detail-grid dt { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--text-3); font-weight: 700; }
.detail-grid dd { margin: 3px 0 0; word-break: break-all; }
.detail-msg { margin-top: 18px; padding: 14px 16px; border-radius: var(--radius); background: var(--surface-2); border: 1px solid var(--border); white-space: pre-wrap; word-break: break-word; }
.detail-timeline { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; flex-wrap: wrap; }
.detail-timeline .step { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-2); }
.detail-timeline .line { flex: 1; min-width: 30px; height: 2px; background: var(--border-strong); }

/* ====================================================================== Onglets */
.tabs { display: flex; gap: 4px; flex-wrap: wrap; }
.tab { border: 0; background: none; font: inherit; font-size: 14.5px; font-weight: 600; color: var(--text-3); padding: 8px 12px; border-radius: 8px; cursor: pointer; position: relative; }
.tab:hover { color: var(--text); background: var(--surface-3); }
.tab.active { color: var(--brand); background: var(--brand-50); }

/* ========================================================== Composants spécifiques */
.empty-state { text-align: center; padding: 48px 20px; color: var(--text-3); display: flex; flex-direction: column; align-items: center; gap: 12px; }
.empty-state h2 { color: var(--text); font-size: 18px; }
.empty-state .ic-xl { color: var(--border-strong); }
.empty-state.small { padding: 32px 20px; }
.loading-block { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 48px; color: var(--text-3); }
.pulse { width: 10px; height: 10px; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 0 rgba(21,128,61,.5); animation: pulse 2s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 10px rgba(21,128,61,0); } 100% { box-shadow: 0 0 0 0 rgba(21,128,61,0); } }
.live-total { display: flex; align-items: baseline; gap: 10px; margin-bottom: 14px; }
.live-total strong { font-size: 34px; font-variant-numeric: tabular-nums; }
.live-total span { color: var(--text-3); }
.stack-bar { display: flex; height: 12px; border-radius: 8px; overflow: hidden; background: var(--surface-3); gap: 2px; margin-bottom: 16px; }
.stack-bar > span { height: 100%; }
.seg-success { background: var(--success); } .seg-primary { background: var(--primary); } .seg-danger { background: var(--danger); } .seg-warning { background: var(--warning); } .seg-info { background: var(--info); }
.live-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.live-list li { display: flex; justify-content: space-between; align-items: center; padding: 6px 0; border-bottom: 1px dashed var(--border); }
.live-list li:last-child { border-bottom: 0; }
.live-list strong { font-variant-numeric: tabular-nums; }
.legend-inline { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-3); }
.lg { width: 14px; height: 3px; border-radius: 3px; display: inline-block; }
.lg-1 { background: var(--series-1); }
.lg-dash { background: repeating-linear-gradient(90deg, var(--series-prev) 0 4px, transparent 4px 7px); }

/* Graphiques */
.chart { position: relative; width: 100%; }
.chart svg { display: block; width: 100%; overflow: visible; }
.chart .axis text, .chart text { fill: var(--text-3); font-size: 11.5px; font-family: var(--font); }
.chart .gridline { stroke: var(--grid); stroke-width: 1; }
.chart .baseline { stroke: var(--border-strong); stroke-width: 1; }
.chart .crosshair { stroke: var(--text-3); stroke-width: 1; stroke-dasharray: 3 3; }
.chart-tip { position: absolute; pointer-events: none; z-index: 5; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-lg); border-radius: 9px; padding: 9px 12px; font-size: 13px; min-width: 150px; white-space: nowrap; transition: opacity .1s; }
.chart-tip .tip-title { font-weight: 700; margin-bottom: 4px; color: var(--text); }
.chart-tip .tip-row { display: flex; align-items: center; gap: 8px; color: var(--text-2); }
.chart-tip .tip-row b { margin-left: auto; padding-left: 14px; color: var(--text); font-variant-numeric: tabular-nums; }
.chart-tip .sw { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.sw-1 { background: var(--series-1); } .sw-2 { background: var(--series-2); } .sw-3 { background: var(--series-3); } .sw-4 { background: var(--series-4); }
.sw-5 { background: var(--series-5); } .sw-6 { background: var(--series-6); } .sw-7 { background: var(--series-7); } .sw-8 { background: var(--series-8); }
.sw-prev { background: var(--series-prev); }
.chart-legend .sw { width: 12px; height: 12px; border-radius: 4px; display: inline-block; }
.chart-legend .sw-dash { width: 16px; height: 3px; border-radius: 2px; background: repeating-linear-gradient(90deg, var(--series-prev) 0 4px, transparent 4px 7px); }
.chart-legend { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 10px; font-size: 13px; color: var(--text-2); }
.chart-legend span { display: inline-flex; align-items: center; gap: 6px; }
.donut-layout { display: grid; grid-template-columns: minmax(180px, 240px) 1fr; gap: 20px; align-items: center; }
@media (max-width: 640px) { .donut-layout { grid-template-columns: 1fr; } }
.donut-legend { display: grid; gap: 8px; font-size: 13.5px; }
.donut-legend .row { display: grid; grid-template-columns: 12px 1fr auto auto; gap: 10px; align-items: center; }
.donut-legend .sw { width: 12px; height: 12px; border-radius: 4px; }
.donut-legend .lbl { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.donut-legend .val { font-variant-numeric: tabular-nums; font-weight: 600; }
.donut-legend .pct { color: var(--text-3); font-variant-numeric: tabular-nums; min-width: 52px; text-align: right; }
.hbars { display: grid; gap: 12px; }
.hbar-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; font-size: 13.5px; }
.hbar-row .lbl { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hbar-row .lbl small { color: var(--text-3); margin-left: 6px; }
.hbar-row .val { font-weight: 600; font-variant-numeric: tabular-nums; }
.hbar-track { grid-column: 1 / -1; height: 9px; border-radius: 6px; background: var(--surface-3); overflow: hidden; }
.hbar-fill { height: 100%; border-radius: 6px; background: var(--series-1); width: 0; transition: width .5s ease; }
.deliv-rate { display: flex; align-items: center; gap: 20px; margin-bottom: 16px; }
.ring { --p: 0; width: 96px; height: 96px; border-radius: 50%; flex: none; display: grid; place-items: center; background: conic-gradient(var(--success) calc(var(--p) * 1%), var(--surface-3) 0); }
.ring span { width: 76px; height: 76px; border-radius: 50%; background: var(--surface); display: grid; place-items: center; font-weight: 700; font-size: 19px; font-variant-numeric: tabular-nums; }

/* Comptes affiliés */
.account-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.account-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow); display: flex; flex-direction: column; overflow: hidden; border-top: 4px solid var(--acc, var(--border-strong)); }
.account-success { --acc: #15925b; } .account-warning { --acc: #ea8a0c; } .account-danger { --acc: var(--danger); } .account-neutral { --acc: #475569; }
.account-card header { display: flex; gap: 12px; align-items: center; padding: 16px 16px 10px; }
.account-id { min-width: 0; }
.account-id h3 { font-size: 15.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.account-id .mono { font-size: 12.5px; }
.account-card dl { margin: 0; padding: 4px 16px 12px; display: grid; gap: 8px; }
.account-card dl > div { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 13.5px; }
.account-card dt { color: var(--text-3); }
.account-card dd { margin: 0; font-weight: 600; }
.credit-val { font-size: 18px; font-variant-numeric: tabular-nums; color: var(--acc); }
.account-card footer { margin-top: auto; display: flex; flex-wrap: wrap; gap: 4px; padding: 8px 10px; border-top: 1px solid var(--border); background: var(--surface-2); }

/* Transfert */
.transfer-flow { display: grid; grid-template-columns: 1fr auto 1fr; gap: 14px; align-items: start; margin-bottom: 18px; }
.transfer-arrow { margin-top: 32px; width: 40px; height: 40px; border-radius: 50%; background: var(--brand-50); color: var(--brand); display: grid; place-items: center; }
@media (max-width: 760px) { .transfer-flow { grid-template-columns: 1fr; } .transfer-arrow { margin: 0 auto; transform: rotate(90deg); } }
.quick-amounts { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.transfer-preview { margin-top: 18px; padding: 14px 16px; border-radius: var(--radius); background: var(--surface-2); border: 1px dashed var(--border-strong); font-size: 14px; }
.transfer-preview.bad { border-color: var(--danger-bd); background: var(--danger-bg); color: var(--danger); }
.timeline { list-style: none; margin: 0; padding: 12px 20px 16px; }
.timeline li { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px dashed var(--border); }
.timeline li:last-child { border-bottom: 0; }
.tl-dot { width: 10px; height: 10px; border-radius: 50%; margin-top: 6px; flex: none; }
.tl-success { background: var(--success); } .tl-danger { background: var(--danger); } .tl-warning { background: var(--warning); }

/* Identifiants */
.cred-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px 14px; border-radius: var(--radius); background: var(--surface-2); border: 1px solid var(--border); }
.cred-label { min-width: 150px; font-weight: 600; color: var(--text-2); font-size: 14px; }
.cred-value { flex: 1; font-size: 15px; word-break: break-all; }

/* Profil */
.profile-card .card-body { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.profile-card h2 { font-size: 18px; margin-top: 8px; word-break: break-all; }
.kv { width: 100%; margin: 12px 0 0; display: grid; text-align: left; }
.kv > div { display: flex; justify-content: space-between; gap: 10px; padding: 9px 0; border-top: 1px solid var(--border); font-size: 14px; }
.kv dt { color: var(--text-3); }
.kv dd { margin: 0; font-weight: 600; text-align: right; word-break: break-all; }
.user-list { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 8px; }
.user-list li { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius); }
.setting-row { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; padding-bottom: 14px; border-bottom: 1px solid var(--border); }
.setting-row h3 { font-size: 16px; margin-bottom: 4px; }
.inline-form { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; padding-top: 10px; }
.inline-form .field { min-width: 260px; }

.prose p + p { margin-top: 10px; }
.prose.small { font-size: 14px; color: var(--text-2); }
.checklist { margin: 0; padding-left: 18px; color: var(--text-2); font-size: 14px; }
.checklist li + li { margin-top: 6px; }
.card-soft h3 { font-size: 15.5px; display: flex; align-items: center; gap: 8px; }
.legal { font-size: 14.5px; line-height: 1.7; color: var(--text-2); }
.legal h1 { font-size: 18px; color: var(--text); margin: 28px 0 10px; padding-top: 12px; border-top: 1px solid var(--border); }
.legal h1:first-of-type { border-top: 0; padding-top: 0; }
.legal h2 { font-size: 15.5px; color: var(--text); margin: 18px 0 6px; }
.legal .placeholder { color: var(--series-1); font-weight: 600; }

/* ==================================================== Pages d'authentification */
.layout-auth { background: var(--bg); }
.auth-shell { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); }
.auth-aside { position: relative; overflow: hidden; color: #fff; background: radial-gradient(1200px 600px at 10% 10%, #1fae6d 0%, transparent 60%), linear-gradient(135deg, #0b5d3a 0%, #0f3d2e 45%, #0b1f2a 100%); display: flex; align-items: center; padding: 56px; }
.auth-aside-inner { position: relative; z-index: 2; max-width: 500px; }
.auth-logo { width: 74px; height: auto; margin-bottom: 28px; }
.auth-aside h2 { font-size: 38px; font-weight: 700; letter-spacing: -.02em; line-height: 1.12; }
.auth-aside p { margin-top: 16px; font-size: 17px; color: rgba(255,255,255,.82); }
.auth-points { list-style: none; margin: 32px 0 0; padding: 0; display: grid; gap: 14px; }
.auth-points li { display: flex; align-items: center; gap: 12px; font-size: 15.5px; color: rgba(255,255,255,.92); }
.auth-points .ic { width: 34px; height: 34px; padding: 8px; border-radius: 10px; background: rgba(255,255,255,.12); }
.auth-bubbles span { position: absolute; border-radius: 50%; border: 1px solid rgba(255,255,255,.12); }
.auth-bubbles span:nth-child(1) { width: 520px; height: 520px; right: -180px; bottom: -200px; }
.auth-bubbles span:nth-child(2) { width: 320px; height: 320px; right: -60px; bottom: -80px; background: rgba(255,255,255,.04); }
.auth-bubbles span:nth-child(3) { width: 140px; height: 140px; left: -40px; top: 60px; background: rgba(255,255,255,.05); }
.auth-main { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 40px 24px; gap: 18px; }
.auth-card { width: 100%; max-width: 430px; background: var(--surface); border: 1px solid var(--border); border-radius: 18px; box-shadow: var(--shadow-lg); padding: 34px 34px 28px; }
.auth-card > * + * { margin-top: 18px; }
.auth-brand { display: flex; align-items: center; gap: 12px; }
.auth-brand-logo { width: 46px; height: 37px; object-fit: contain; background: var(--brand); border-radius: 10px; padding: 5px; }
.auth-brand div { display: flex; flex-direction: column; line-height: 1.2; }
.auth-brand span { font-size: 13px; color: var(--text-3); }
.auth-head h1 { font-size: 24px; font-weight: 700; }
.auth-head p { color: var(--text-3); margin-top: 6px; }
.auth-icon { width: 52px; height: 52px; border-radius: 14px; display: inline-grid; place-items: center; background: var(--brand-50); color: var(--brand); margin-bottom: 14px; }
.auth-icon .ic { width: 26px; height: 26px; }
.auth-icon-warning { background: var(--warning-bg); color: var(--warning); }
.auth-icon-success { background: var(--success-bg); color: var(--success); }
.auth-alt { text-align: center; font-size: 14px; }
.auth-alt.split { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.auth-note { display: flex; gap: 8px; font-size: 12.5px; color: var(--text-3); }
.auth-note .ic { width: 16px; height: 16px; flex: none; margin-top: 1px; }
.auth-langs { display: flex; gap: 14px; font-size: 13px; }
.auth-langs a { color: var(--text-3); display: inline-flex; align-items: center; gap: 6px; }
.auth-langs a.active { color: var(--text); font-weight: 700; }
.auth-copy { font-size: 12px; color: var(--text-3); }
@media (max-width: 900px) { .auth-shell { grid-template-columns: 1fr; } .auth-aside { display: none; } .auth-card { padding: 26px 22px; } }

/* ======================================================================= Impression */
@media print {
  @page { margin: 12mm; }
  body { background: #fff; font-size: 12px; }
  .app-sidebar, .app-header, .app-footer, .filter-card, .content-actions, .card-tools, .toast-zone, .sidebar-overlay, .alert .btn-close, .table-footer, .tabs { display: none !important; }
  .app-body { margin: 0 !important; }
  .app-main { padding: 0; max-width: none; }
  .card, .kpi { box-shadow: none; break-inside: avoid; }
  .tab-panel[hidden] { display: block !important; }
  .print-only { display: block; margin-bottom: 12px; font-size: 14px; }
  .grid-2 { grid-template-columns: 1fr 1fr; }
  .table th { position: static; }
  a { color: inherit; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* Ajustements */
#transfer-form .filter-grid { align-items: start; }
@media (max-width: 640px) {
  .range-inputs { flex-wrap: wrap; }
  .range-inputs .form-control { flex: 1 1 calc(100% - 52px); }
  .range-sep { display: none; }
  .filter-actions .btn-primary { flex: 1 1 auto; }
}

/* Anti-robot */
.hp-field { position: absolute !important; left: -10000px !important; width: 1px; height: 1px; overflow: hidden; }
.recaptcha-box { display: flex; justify-content: center; min-height: 78px; }
.recaptcha-notice { font-size: 11.5px; color: var(--text-3); }
