@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap');

/* ════════════════════════════════════════════════════════
   VOX BATI — Dashboard v11 (CSS v51)
   Design: SaaS App — Dark Header + Light Content
   Palette: Navy #0c1825 · Green #2EE87A · Surface #ffffff
   Font: Inter
   ════════════════════════════════════════════════════════ */

/* ── DESIGN TOKENS ───────────────────────────────────── */
:root {
  /* Brand */
  --brand:          #2EE87A;
  --brand-dark:     #1dbf66;
  --brand-muted:    rgba(46,232,122,.12);
  --brand-glow:     rgba(46,232,122,.25);

  /* Sidebar */
  --sidebar-w:      220px;
  --sidebar-bg:     #0c1825;
  --sidebar-border: rgba(255,255,255,.06);
  --sidebar-hover:  rgba(255,255,255,.08);
  --sidebar-active: rgba(46,232,122,.14);

  /* Surfaces */
  --bg:             #dde8f5;
  --surface:        #ffffff;
  --surface-2:      #f8fafc;
  --border:         #e4e9f0;
  --divider:        #f1f5f9;

  /* Text */
  --text-1:         #0f1923;
  --text-2:         #4a5568;
  --text-3:         #94a3b8;
  --text-inv:       #ffffff;

  /* Semantic */
  --green:          #059669;
  --green-bg:       rgba(5,150,105,.1);
  --yellow:         #d97706;
  --yellow-bg:      rgba(217,119,6,.1);
  --red:            #dc2626;
  --red-bg:         rgba(220,38,38,.1);
  --blue:           #2563eb;
  --blue-bg:        rgba(37,99,235,.1);

  /* Shadows */
  --shadow-xs:      0 1px 2px rgba(0,0,0,.06);
  --shadow-sm:      0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.04);
  --shadow-md:      0 4px 12px rgba(0,0,0,.08), 0 2px 4px rgba(0,0,0,.04);
  --shadow-lg:      0 8px 28px rgba(0,0,0,.10), 0 3px 8px rgba(0,0,0,.05);

  /* Layout */
  --topbar-h:       60px;
  --radius-sm:      8px;
  --radius-md:      12px;
  --radius-lg:      16px;
  --radius-xl:      20px;

  /* Transitions */
  --t:              .15s ease;
  --t-slow:         .3s ease;
}

/* ── RESET ───────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html {
  scroll-behavior: smooth;
  overflow-x: hidden; /* bloque la bande blanche mobile */
}
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text-1);
  line-height: 1.6;
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  overflow-y: hidden;
  max-width: 100vw;
  -webkit-text-size-adjust: 100%;
}
a { color: var(--brand); text-decoration: none; transition: color var(--t); }
a:hover { color: var(--brand-dark); }

/* ══════════════════════════════════════════════════════
   SIDEBAR
══════════════════════════════════════════════════════ */
.sidebar {
  width: var(--sidebar-w);
  background: linear-gradient(180deg, #0c1825 0%, #0f2133 100%);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  overflow: hidden;
  transition: transform var(--t-slow);
  border-right: 1px solid rgba(46,232,122,.08);
}

/* Brand */
.sidebar-brand {
  padding: 14px 14px 10px;
  border-bottom: 1px solid rgba(46,232,122,.1);
  flex-shrink: 0;
  background: linear-gradient(135deg, rgba(46,232,122,.04) 0%, transparent 100%);
}
.brand-logo {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 3px;
  font-family: inherit;
  line-height: 1;
  margin-bottom: 3px;
}
.brand-vox  { color: #ffffff; }
.brand-bati { color: var(--brand); }
.brand-tagline {
  font-size: 9px;
  color: rgba(255,255,255,.35);
  font-weight: 500;
  letter-spacing: .4px;
  font-family: inherit;
}

/* Nav */
.sidebar-nav {
  flex: 1;
  padding: 8px 8px;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.nav-group-label {
  font-size: 8px;
  font-weight: 700;
  color: rgba(46,232,122,.4);
  text-transform: uppercase;
  letter-spacing: 1.2px;
  padding: 8px 10px 3px;
  font-family: inherit;
}
.nav-sep {
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.06), transparent);
  margin: 4px 8px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 10px;
  border-radius: 8px;
  color: rgba(255,255,255,.55);
  font-size: 12.5px;
  font-weight: 500;
  text-decoration: none;
  transition: all .15s ease;
  white-space: nowrap;
  font-family: inherit;
  position: relative;
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}
.nav-item svg { flex-shrink: 0; opacity: .5; transition: all .15s; }
.nav-item:hover {
  background: rgba(255,255,255,.07);
  color: rgba(255,255,255,.95);
  transform: translateX(2px);
}
.nav-item:hover svg { opacity: 1; }
.nav-item.active {
  background: linear-gradient(135deg, rgba(46,232,122,.15), rgba(46,232,122,.08));
  color: var(--brand);
  font-weight: 700;
  border-left: 3px solid var(--brand);
  padding-left: 7px;
}
.nav-item.active svg { opacity: 1; stroke: var(--brand); }
.nav-item.nav-green {
  color: var(--brand); font-weight: 700;
  background: rgba(46,232,122,.06);
  border: 1px solid rgba(46,232,122,.12);
  margin-top: 4px;
}
.nav-item.nav-green:hover { background: rgba(46,232,122,.14); }

/* Nav badge */
.nav-badge {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  background: linear-gradient(135deg, #f59e0b, #ea580c); color: #fff;
  border-radius: 10px; padding: 1px 7px;
  font-size: 10px; font-weight: 700; line-height: 16px;
  box-shadow: 0 2px 6px rgba(245,158,11,.3);
  animation: badgePulse 2s ease-in-out infinite;
}
@keyframes badgePulse { 0%,100% { opacity: 1; } 50% { opacity: .7; } }

/* Sidebar footer */
.sidebar-footer {
  padding: 8px 8px;
  border-top: 1px solid rgba(46,232,122,.08);
  flex-shrink: 0;
}

/* Mobile overlay */
.sidebar-overlay {
  display: none;
  position: fixed; inset: 0;
  z-index: 99;
  background: rgba(0,0,0,.55);
  backdrop-filter: blur(3px);
}
.sidebar-overlay.active { display: block; }

/* ══════════════════════════════════════════════════════
   APP WRAPPER
══════════════════════════════════════════════════════ */
.app-wrapper {
  flex: 1;
  margin-left: var(--sidebar-w);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ══════════════════════════════════════════════════════
   TOPBAR
══════════════════════════════════════════════════════ */
.topbar {
  height: var(--topbar-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: var(--shadow-xs);
  flex-shrink: 0;
}
.topbar-left { display: flex; align-items: center; gap: 12px; }
.topbar-menu-btn {
  display: none;
  width: 36px; height: 36px;
  border: none;
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  cursor: pointer;
  align-items: center; justify-content: center;
  color: var(--text-2);
  transition: all var(--t);
  flex-shrink: 0;
}
.topbar-menu-btn:hover { background: var(--border); color: var(--text-1); }
.topbar-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-1);
  font-family: inherit;
}
.topbar-right { display: flex; align-items: center; gap: 10px; }
.topbar-subtitle { font-size: 12px; color: var(--text-3); font-weight: 500; }

/* ══════════════════════════════════════════════════════
   PAGE CONTENT
══════════════════════════════════════════════════════ */
.page-content {
  flex: 1;
  padding: 24px;
}
.container { width: 100%; }

/* ══════════════════════════════════════════════════════
   KPI GRID
══════════════════════════════════════════════════════ */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}
.kpi-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 20px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  transition: all var(--t);
  position: relative;
  overflow: hidden;
}
.kpi-card::after {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: var(--brand);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}
.kpi-card.kpi-orange::after { background: #f59e0b; }
.kpi-card.kpi-red::after    { background: #ef4444; }
.kpi-card.kpi-blue::after   { background: #3b82f6; }
.kpi-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
  border-color: rgba(46,232,122,.2);
}
.kpi-ca-wide { grid-column: span 2; }
.kpi-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-3);
  font-family: inherit;
  margin-bottom: 8px;
  display: block;
}
.kpi-value {
  font-size: 26px;
  font-weight: 800;
  color: var(--text-1);
  font-family: inherit;
  line-height: 1;
  margin-bottom: 5px;
}
.kpi-sub {
  font-size: 12px;
  color: var(--text-3);
  font-family: inherit;
  line-height: 1.3;
}
.kpi-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 16px; }
.kpi-mini {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  box-shadow: var(--shadow-xs);
}
.kpi-mini .label {
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .8px; color: var(--text-3);
  font-family: inherit;
  margin-bottom: 6px; display: block;
}
.kpi-mini .val {
  font-size: 22px; font-weight: 800; color: var(--text-1);
  font-family: inherit;
}

/* ══════════════════════════════════════════════════════
   SECTIONS / CARDS
══════════════════════════════════════════════════════ */
.section, .section-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: box-shadow var(--t);
}
.section:hover, .section-card:hover { box-shadow: var(--shadow-md); }
.section h2, .section-card h2 {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-1);
  font-family: inherit;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Profile card */
.profile-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.profile-card h2 {
  font-size: 16px; font-weight: 700; color: var(--text-1);
  font-family: inherit; margin-bottom: 16px;
}
.profile-grid { display: grid; grid-template-columns: 1fr; gap: 8px; }
.profile-grid > div {
  padding: 11px 14px;
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 3px;
}
.profile-grid .label {
  font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .8px;
  color: var(--text-3);
  font-family: inherit;
}
.profile-grid span:last-child { font-size: 13px; color: var(--text-1); font-weight: 600; }

/* ══════════════════════════════════════════════════════
   ALERT BANNERS
══════════════════════════════════════════════════════ */
.alert-banner {
  border-radius: var(--radius-lg);
  margin-bottom: 16px;
  overflow: hidden;
  border: 1px solid rgba(245,158,11,.2);
}
.alert-banner.alert-warning {
  background: rgba(255,252,235,.9);
  border-left: 4px solid #f59e0b;
}
.alert-banner .collapse-toggle { padding: 14px 20px; }
.alert-banner .collapse-content { padding: 0 20px; }
.alert-banner .collapse-content.open { padding: 0 20px 16px; }
.alert-banner.alert-warning .collapse-toggle:hover { background: rgba(245,158,11,.04); }

/* ══════════════════════════════════════════════════════
   COLLAPSIBLE
══════════════════════════════════════════════════════ */
.collapse-toggle {
  display: flex; align-items: center; justify-content: space-between;
  width: 100%; background: none; border: none;
  color: inherit; font: inherit; cursor: pointer;
  padding: 18px 24px; text-align: left;
  min-height: 56px;
  transition: background var(--t);
}
.collapse-toggle:hover { background: var(--surface-2); }
.collapse-toggle .arrow {
  width: 26px; height: 26px;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 50%;
  font-size: 10px; color: var(--text-3); flex-shrink: 0;
  transition: transform var(--t-slow), background var(--t);
}
.collapse-toggle[aria-expanded="true"] .arrow { transform: rotate(180deg); background: var(--brand-muted); }
.collapse-content { overflow: hidden; max-height: 0; transition: max-height .35s ease; }
.collapse-content.open { max-height: 3000px; }

/* ══════════════════════════════════════════════════════
   TABLES
══════════════════════════════════════════════════════ */
.table-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.table-wrapper.has-scroll::after {
  content: '';
  position: absolute; right: 0; top: 0; bottom: 0; width: 28px;
  background: linear-gradient(to left, rgba(255,255,255,.9), transparent);
  pointer-events: none;
}
.table-wrapper.scrolled-end::after { opacity: 0; }
.data-table {
  width: 100%; border-collapse: collapse;
  font-size: 13px; min-width: 500px;
}
.data-table thead {
  background: var(--surface-2);
  border-bottom: 2px solid var(--border);
}
.data-table th {
  text-align: left; padding: 12px 16px;
  font-weight: 700; color: var(--text-2);
  font-size: 11px; text-transform: uppercase;
  letter-spacing: .8px; white-space: nowrap;
  font-family: inherit;
  cursor: pointer; user-select: none;
}
.data-table th:hover { color: var(--text-1); }
.data-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--divider);
  color: var(--text-2);
  font-family: inherit;
  vertical-align: middle;
}
.data-table tbody tr { transition: background var(--t); }
.data-table tbody tr:hover { background: var(--surface-2); }
.data-table tbody tr:last-child td { border-bottom: none; }

/* ══════════════════════════════════════════════════════
   BADGES
══════════════════════════════════════════════════════ */
.badge {
  display: inline-flex; align-items: center;
  padding: 3px 10px; border-radius: 100px;
  font-size: 11px; font-weight: 700;
  white-space: nowrap;
  font-family: inherit;
  letter-spacing: .3px;
}
.badge-actif,.badge-accepté,.badge-signé,.badge-payé,.badge-terminé,.badge-facturé {
  background: var(--green-bg); color: var(--green);
}
.badge-suspendu,.badge-en-attente,.badge-envoyé,.badge-envoyé-client {
  background: var(--yellow-bg); color: var(--yellow);
}
.badge-resilie,.badge-résilié,.badge-refusé,.badge-expiré,
.badge-impayé,.badge-impayé---alerte,.badge-impayé---dernière-chance {
  background: var(--red-bg); color: var(--red);
}
.badge-brouillon { background: rgba(148,163,184,.12); color: var(--text-3); }
.badge-red    { background: var(--red-bg);    color: var(--red); }
.badge-orange { background: var(--yellow-bg); color: var(--yellow); }
.badge-blue   { background: var(--blue-bg);   color: var(--blue); }

/* ══════════════════════════════════════════════════════
   BUTTONS
══════════════════════════════════════════════════════ */
.btn-primary {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 10px 20px;
  background: var(--brand); color: #072210;
  border: none; border-radius: var(--radius-md);
  font-size: 13px; font-weight: 700;
  cursor: pointer; transition: all var(--t);
  font-family: inherit;
  text-decoration: none; white-space: nowrap;
  box-shadow: 0 2px 8px var(--brand-glow);
}
.btn-primary:hover {
  background: var(--brand-dark); color: #072210;
  box-shadow: 0 4px 14px var(--brand-glow);
  transform: translateY(-1px);
}
.btn-secondary {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 10px 18px;
  background: var(--surface); color: var(--text-2);
  border: 1.5px solid var(--border); border-radius: var(--radius-md);
  font-size: 13px; font-weight: 600;
  cursor: pointer; transition: all var(--t);
  font-family: inherit;
  text-decoration: none; white-space: nowrap;
}
.btn-secondary:hover {
  background: var(--surface-2);
  border-color: rgba(46,232,122,.3); color: var(--text-1);
}
.btn-save {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 24px;
  background: var(--brand); color: #072210;
  border: none; border-radius: var(--radius-md);
  font-size: 14px; font-weight: 700;
  cursor: pointer; flex: 1;
  transition: all var(--t);
  font-family: inherit;
  box-shadow: 0 2px 8px var(--brand-glow);
}
.btn-save:hover { background: var(--brand-dark); transform: translateY(-1px); }
.btn-cancel {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 24px;
  background: var(--surface-2); color: var(--text-2);
  border: 1.5px solid var(--border); border-radius: var(--radius-md);
  font-size: 14px; font-weight: 600;
  cursor: pointer; transition: all var(--t);
}
.btn-cancel:hover { background: var(--border); color: var(--text-1); }
.btn-visualiser {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 6px 12px; min-height: 34px;
  background: var(--brand); color: #072210;
  border-radius: var(--radius-sm);
  font-size: 11px; font-weight: 700;
  transition: all var(--t);
  font-family: inherit;
  border: none; cursor: pointer; white-space: nowrap;
}
.btn-visualiser:hover { background: var(--brand-dark); transform: translateY(-1px); }
.btn-download {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 6px 12px; min-height: 34px;
  background: var(--brand-muted); color: var(--green);
  border: 1.5px solid rgba(46,232,122,.2);
  border-radius: var(--radius-sm);
  font-size: 11px; font-weight: 600;
  transition: all var(--t);
  font-family: inherit;
  cursor: pointer; white-space: nowrap;
}
.btn-download:hover { background: rgba(46,232,122,.18); border-color: rgba(46,232,122,.4); }
.btn-signature {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 6px 12px; min-height: 34px;
  background: var(--surface-2); color: var(--text-2);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 11px; font-weight: 600;
  cursor: pointer; transition: all var(--t);
  white-space: nowrap; font-family: inherit;
}
.btn-signature:hover { background: var(--border); }
.btn-signature:disabled { opacity: .5; cursor: not-allowed; }

/* Action buttons (table rows) */
.btn-action {
  padding: 5px; border-radius: var(--radius-sm);
  cursor: pointer; border: 1px solid transparent;
  transition: all var(--t);
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; background: none;
}
.btn-action svg { flex-shrink: 0; }
.btn-action-edit {
  background: var(--surface-2); color: var(--text-2); border-color: var(--border);
}
.btn-action-edit:hover { background: var(--border); color: var(--text-1); }
.btn-action-delete { background: transparent; color: var(--text-3); }
.btn-action-delete:hover { background: var(--red-bg); color: var(--red); border-color: rgba(220,38,38,.2); }

/* Relance action buttons */
.relance-actions {
  display: flex; align-items: center; gap: 8px; flex-wrap: nowrap;
}
.ra-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 5px;
  border: none; border-radius: var(--radius-sm); cursor: pointer;
  font-family: inherit;
  font-size: 12px; font-weight: 700; white-space: nowrap;
  transition: all .15s; line-height: 1;
}
.ra-btn svg { flex-shrink: 0; }
.ra-primary {
  padding: 7px 14px; min-height: 32px;
  background: var(--brand); color: #072210;
  box-shadow: 0 1px 4px rgba(46,232,122,.2);
}
.ra-primary:hover { background: var(--brand-dark); transform: translateY(-1px); box-shadow: 0 3px 8px rgba(46,232,122,.25); }
.ra-group {
  display: inline-flex; border-radius: var(--radius-sm); overflow: hidden;
  border: 1.5px solid var(--border);
}
.ra-group .ra-btn {
  width: 32px; height: 32px; padding: 0;
  border-radius: 0; background: var(--surface);
  border-right: 1px solid var(--border);
}
.ra-group .ra-btn:last-child { border-right: none; }
.ra-success { color: var(--green); }
.ra-success:hover { background: var(--green-bg); }
.ra-info { color: var(--blue); }
.ra-info:hover { background: var(--blue-bg); }
.ra-muted { color: var(--text-3); }
.ra-muted:hover { background: var(--red-bg); color: var(--red); }

/* ══════════════════════════════════════════════════════
   FORMS
══════════════════════════════════════════════════════ */
.form-label {
  display: block; margin-bottom: 6px;
  font-weight: 700; color: var(--text-1);
  font-size: 13px; font-family: inherit;
}
.form-input, .form-select {
  width: 100%; padding: 10px 14px; min-height: 42px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 14px; font-family: inherit;
  background: var(--surface); color: var(--text-1);
  transition: all var(--t);
  -webkit-appearance: none; appearance: none;
}
.form-input:focus, .form-select:focus {
  outline: none; border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-muted);
}
.form-input option, .form-select option { background: #fff; color: #212121; }
.form-input optgroup, .form-select optgroup { background: #f8fafc; color: var(--green); font-weight: 700; }
select.form-input, .form-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}
.form-row-2col { display: grid; grid-template-columns: 1fr; gap: 12px; }


/* ══════════════════════════════════════════════════════
   QUICK NAV (compact, mobile)
══════════════════════════════════════════════════════ */
.quick-nav {
  display: flex; gap: 6px;
  margin-bottom: 16px; padding: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow-x: auto; scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  box-shadow: var(--shadow-xs);
}
.quick-nav::-webkit-scrollbar { display: none; }
.quick-nav a {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 7px 14px;
  background: transparent; color: var(--text-2);
  border-radius: var(--radius-sm);
  font-size: 12px; font-weight: 600;
  white-space: nowrap; flex-shrink: 0;
  transition: all var(--t);
  font-family: inherit;
}
.quick-nav a:hover { background: var(--surface-2); color: var(--text-1); }
.quick-nav a.nav-green { background: var(--brand); color: #072210; font-weight: 700; }
.quick-nav a.nav-green:hover { background: var(--brand-dark); }

/* ══════════════════════════════════════════════════════
   INFO TOOLTIP
══════════════════════════════════════════════════════ */
.info-tooltip { cursor: help; display: inline-block; margin-left: 4px; font-size: 14px; opacity: .5; transition: opacity var(--t); }
.info-tooltip:hover { opacity: 1; }

/* ══════════════════════════════════════════════════════
   BTN TOP
══════════════════════════════════════════════════════ */
.btn-top {
  position: fixed; bottom: 24px; right: 24px;
  width: 42px; height: 42px;
  background: var(--brand); color: #072210;
  border: none; border-radius: 50%;
  font-size: 18px; cursor: pointer;
  display: none; align-items: center; justify-content: center;
  z-index: 100; transition: all var(--t);
  box-shadow: 0 4px 16px var(--brand-glow);
}
.btn-top:hover { transform: translateY(-2px); box-shadow: 0 6px 24px var(--brand-glow); }

/* ══════════════════════════════════════════════════════
   FOOTER
══════════════════════════════════════════════════════ */
.app-footer, .dashboard-footer {
  padding: 20px 28px;
  text-align: center;
  font-size: 12px;
  color: var(--text-3);
  border-top: 1px solid var(--border);
  font-family: inherit;
  font-weight: 500;
  background: var(--surface);
  flex-shrink: 0;
}
.app-footer a, .dashboard-footer a { color: var(--text-3); text-decoration: underline; }
.app-footer a:hover, .dashboard-footer a:hover { color: var(--brand); }

/* ══════════════════════════════════════════════════════
   EMPTY STATE
══════════════════════════════════════════════════════ */
.empty-state { text-align: center; padding: 32px 16px; color: var(--text-3); font-size: 13px; font-family: inherit; }

/* ══════════════════════════════════════════════════════
   MODAL
══════════════════════════════════════════════════════ */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.4); z-index: 200;
  display: none; align-items: center; justify-content: center;
  backdrop-filter: blur(4px);
  padding: 20px;
}
.modal-overlay.active { display: flex; }
.modal-panel {
  background: var(--surface);
  width: 100%; max-width: 560px; max-height: 86vh;
  border-radius: var(--radius-xl);
  padding: 24px; overflow-y: auto;
  animation: fadeInScale .2s ease;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
}
@keyframes fadeInScale {
  from { opacity: 0; transform: scale(.95) translateY(10px); }
  to   { opacity: 1; transform: scale(1)  translateY(0); }
}
.modal-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 20px; padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}
.modal-header h3 {
  font-size: 17px; font-weight: 700; color: var(--text-1);
  margin: 0; font-family: inherit;
}
.modal-close {
  width: 34px; height: 34px; border: 1px solid var(--border);
  background: var(--surface-2); border-radius: 50%;
  font-size: 16px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-3); transition: all var(--t);
}
.modal-close:hover { background: var(--border); color: var(--text-1); }

/* ══════════════════════════════════════════════════════
   RADIO CARDS
══════════════════════════════════════════════════════ */
.radio-cards { display: grid; grid-template-columns: 1fr; gap: 10px; margin: 12px 0; }
.radio-card {
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md); padding: 14px 16px;
  cursor: pointer; transition: all var(--t);
  background: var(--surface);
}
.radio-card:hover { border-color: rgba(46,232,122,.4); background: var(--surface-2); }
.radio-card.selected { border-color: var(--brand); background: var(--brand-muted); }
.radio-card input[type="radio"] { display: none; }
.radio-card-title { font-size: 14px; font-weight: 700; color: var(--text-1); margin-bottom: 3px; font-family: inherit; }
.radio-card-desc { font-size: 12px; color: var(--text-3); }

/* ══════════════════════════════════════════════════════
   DOC CARDS
══════════════════════════════════════════════════════ */
.doc-card {
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 16px;
  display: flex; flex-direction: column; gap: 10px;
}
.doc-card h3 { font-size: 13px; font-weight: 700; color: var(--text-1); margin: 0; font-family: inherit; }
.doc-card .doc-status { font-size: 12px; font-weight: 600; }
.doc-card .doc-status.ok      { color: var(--green); }
.doc-card .doc-status.missing { color: var(--text-3); }
.doc-upload-btn {
  width: 100%; padding: 10px; min-height: 40px;
  border: 2px dashed rgba(46,232,122,.3);
  background: var(--brand-muted); color: var(--green);
  border-radius: var(--radius-sm); font-weight: 700;
  cursor: pointer; font-size: 12px; transition: all var(--t);
  font-family: inherit;
}
.doc-upload-btn:hover { background: rgba(46,232,122,.2); border-color: var(--brand); }

/* ══════════════════════════════════════════════════════
   LINK CARDS
══════════════════════════════════════════════════════ */
.link-card {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  padding: 16px 20px; border-radius: var(--radius-md);
  text-decoration: none; font-weight: 700; font-size: 14px;
  text-align: center; transition: all var(--t);
  font-family: inherit;
}
.link-card:hover { transform: translateY(-2px); }
.link-card-green {
  background: var(--surface);
  border: 1.5px solid rgba(46,232,122,.25);
  color: var(--green);
  border-radius: 12px;
  box-shadow: var(--shadow-xs);
}
.link-card-green:hover {
  border-color: var(--brand);
  color: var(--brand);
  box-shadow: 0 3px 12px rgba(46,232,122,.15);
}
.link-card-blue { background: var(--blue-bg); border: 1.5px solid rgba(37,99,235,.2); color: var(--blue); }
.link-card-blue:hover { background: rgba(37,99,235,.14); box-shadow: var(--shadow-md); }

/* ══════════════════════════════════════════════════════
   PAGINATION
══════════════════════════════════════════════════════ */
.pg-btn {
  min-width: 32px; height: 32px; padding: 0 8px;
  border: 1.5px solid var(--border); border-radius: 8px;
  background: var(--surface); color: var(--text-2);
  font-size: 12px; font-weight: 600; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  transition: all .15s; font-family: inherit;
}
.pg-btn:hover { border-color: var(--brand); color: var(--brand); }
.pg-btn.pg-active {
  background: var(--brand); color: #0c1825;
  border-color: var(--brand); pointer-events: none;
}
.pg-dots { font-size: 12px; color: var(--text-3); padding: 0 2px; }

/* ══════════════════════════════════════════════════════
   PHOTO GRID
══════════════════════════════════════════════════════ */
.photo-grid-mobile { display: grid; grid-template-columns: repeat(2,1fr); gap: 10px; }

/* ══════════════════════════════════════════════════════
   RESPONSIVE GRIDS
══════════════════════════════════════════════════════ */
.charts-inner-grid { display: grid; grid-template-columns: 1fr; gap: 16px; }
.docs-grid { display: grid; grid-template-columns: 1fr; gap: 10px; }
.link-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* ══════════════════════════════════════════════════════
   CATALOGUE
══════════════════════════════════════════════════════ */
.catalogue-group {
  margin-bottom: 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
}
.catalogue-group-header {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
}
.catalogue-group-title {
  font-size: 12px; font-weight: 800; color: var(--text-2);
  text-transform: uppercase; letter-spacing: .8px;
  font-family: inherit;
}
.catalogue-group-count {
  font-size: 11px; color: var(--text-3);
  background: var(--surface); border: 1px solid var(--border);
  padding: 2px 10px; border-radius: 100px; font-weight: 600;
}
.catalogue-group .table-wrapper { border: none; }
.catalogue-group .data-table { margin: 0; }
.catalogue-group .data-table thead { background: var(--surface-2); }

/* ══════════════════════════════════════════════════════
   TOAST NOTIFICATIONS
══════════════════════════════════════════════════════ */
#toast-container {
  position: fixed; top: 20px; right: 20px;
  z-index: 9999; display: flex; flex-direction: column; gap: 8px;
}
.toast {
  padding: 12px 18px; border-radius: var(--radius-md);
  font-size: 13px; font-weight: 600;
  box-shadow: var(--shadow-lg);
  animation: slideInRight .2s ease;
  max-width: 360px;
  font-family: 'Inter', sans-serif;
  border: 1px solid transparent;
}
@keyframes slideInRight {
  from { opacity: 0; transform: translateX(20px); }
  to   { opacity: 1; transform: translateX(0); }
}
.toast-success { background: #f0fdf4; color: var(--green); border-color: rgba(5,150,105,.2); }
.toast-error   { background: #fef2f2; color: var(--red);   border-color: rgba(220,38,38,.2); }
.toast-info    { background: #eff6ff; color: var(--blue);  border-color: rgba(37,99,235,.2); }
.toast-warning { background: #fffbeb; color: var(--yellow);border-color: rgba(217,119,6,.2); }

/* ══════════════════════════════════════════════════════
   BOTTOM TAB BAR (mobile only)
══════════════════════════════════════════════════════ */
.tab-bar {
  display: flex;
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 90;
  background: rgba(255,255,255,.95);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--border);
  padding: 4px 0 calc(4px + env(safe-area-inset-bottom, 0px));
  box-shadow: 0 -4px 20px rgba(0,0,0,.06);
}
.tab-item {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; gap: 2px; padding: 6px 4px;
  color: var(--text-3); text-decoration: none;
  background: none; border: none; font: inherit;
  cursor: pointer; transition: color var(--t);
  -webkit-tap-highlight-color: transparent;
}
.tab-item:active, .tab-item:hover { color: var(--brand); }
.tab-icon  { font-size: 20px; line-height: 1; }
.tab-label { font-size: 10px; font-weight: 700; font-family: inherit; }
.tab-more .tab-icon { font-size: 22px; font-weight: 900; letter-spacing: 2px; }

/* More overlay */
.more-overlay {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(0,0,0,.45); display: none;
  align-items: flex-end; justify-content: center;
  backdrop-filter: blur(4px);
}
.more-overlay.active { display: flex; }
.more-panel {
  width: 100%; max-height: 70vh;
  background: var(--surface);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  padding: 16px 16px calc(16px + env(safe-area-inset-bottom, 0px));
  border-top: 3px solid var(--brand);
  animation: slideUp .25s ease; overflow-y: auto;
  box-shadow: 0 -8px 32px rgba(0,0,0,.1);
}
@keyframes slideUp {
  from { transform: translateY(100%); }
  to   { transform: translateY(0); }
}
.more-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 14px; padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.more-links { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.more-link {
  display: flex; align-items: center; gap: 8px; padding: 14px 12px;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-2); font-size: 13px; font-weight: 600;
  text-decoration: none; transition: all var(--t);
  font-family: inherit;
}
.more-link:hover { background: var(--border); color: var(--text-1); }
.more-link-green { color: var(--green); border-color: rgba(46,232,122,.2); background: var(--brand-muted); }

/* Mobile body padding for tab bar */
body { padding-bottom: 72px; }
.section, .section-card { scroll-margin-top: 72px; }
.btn-top { bottom: 82px; }

/* ══════════════════════════════════════════════════════
   KPI LAYOUT — panel période à gauche + cards à droite
══════════════════════════════════════════════════════ */
.kpi-layout {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  margin: 18px 0 20px;
}
.kpi-period-panel {
  flex: 0 0 168px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: var(--surface);
  border: 2px solid var(--sidebar-bg);
  border-radius: var(--radius-lg);
  padding: 14px 12px;
  box-shadow: var(--shadow-xs);
}
.kpi-period-label {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .8px;
  color: var(--text-3);
  padding: 0 4px;
  margin-bottom: 6px;
}
.kpi-period-btn {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 11px 12px;
  border: none;
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--text-2);
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  width: 100%;
  text-align: left;
  transition: all var(--t);
  line-height: 1.2;
}
.kpi-period-btn:hover {
  background: var(--surface-2);
  color: var(--text-1);
}
.kpi-period-btn.active {
  background: var(--text-1);
  color: #2EE87A;
  font-weight: 700;
}
.kpi-period-date-filter {
  display: none;
  flex-direction: column;
  gap: 6px;
  padding: 10px 4px 4px;
  border-top: 1px solid var(--border);
  margin-top: 6px;
}
.kpi-period-date-filter.open { display: flex; }
.kpi-period-date-filter input[type="date"] {
  padding: 6px 8px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-family: inherit;
  color: var(--text-1);
  background: var(--surface-2);
  outline: none;
  width: 100%;
  box-sizing: border-box;
}
.kpi-period-date-filter input[type="date"]:focus { border-color: var(--brand); }
.kpi-cards-wrap {
  flex: 1;
  min-width: 0;
}
.kpi-cards-wrap .kpi-grid {
  margin-bottom: 0;
}
@media (max-width: 900px) {
  .kpi-layout { flex-direction: column; }
  .kpi-period-panel { flex: none; width: 100%; flex-direction: row; flex-wrap: wrap; gap: 6px; align-items: center; }
  .kpi-period-label { width: 100%; margin-bottom: 0; }
  .kpi-period-btn { flex: 1; min-width: 120px; }
}

/* ══════════════════════════════════════════════════════
   PERIOD TOGGLE
══════════════════════════════════════════════════════ */
.period-toggle {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 4px;
  box-shadow: var(--shadow-xs);
  flex-wrap: wrap;
}
.period-btn {
  padding: 6px 14px;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-3);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--t);
  font-family: inherit;
  white-space: nowrap;
}
.period-btn:hover { background: var(--surface-2); color: var(--text-1); }
.period-btn.active {
  background: var(--text-1);
  color: #fff;
  font-weight: 700;
}
.period-btn.period-btn-date {
  display: flex; align-items: center; gap: 5px;
  color: var(--text-2);
  border: 1.5px solid var(--border);
  margin-left: 4px;
}
.period-btn.period-btn-date:hover { border-color: rgba(46,232,122,.3); color: var(--text-1); }

/* Date filter popup */
.period-date-filter {
  display: none;
  align-items: center; gap: 8px;
  padding: 8px 12px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  flex-wrap: wrap;
}
.period-date-filter.open { display: flex; }
.period-date-filter input[type="date"] {
  padding: 6px 10px; min-height: 36px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 12px; font-family: inherit;
  color: var(--text-1); background: var(--surface-2);
  outline: none;
}
.period-date-filter input[type="date"]:focus { border-color: var(--brand); }
.period-date-filter .period-sep { color: var(--text-3); font-size: 12px; }

/* ══════════════════════════════════════════════════════
   EXPORT BAR
══════════════════════════════════════════════════════ */
.export-bar {
  display: inline-flex;
  align-items: center;
  gap: 0;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-xs);
  background: var(--surface);
}
.export-bar-label {
  display: flex; align-items: center; gap: 6px;
  padding: 9px 14px;
  background: var(--text-1);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .8px;
  font-family: inherit;
  flex-shrink: 0;
}
.export-bar a {
  display: flex; align-items: center;
  padding: 9px 16px;
  font-size: 13px; font-weight: 600;
  color: var(--text-2);
  text-decoration: none;
  transition: all var(--t);
  font-family: inherit;
  border-left: 1px solid var(--border);
  white-space: nowrap;
}
.export-bar a:hover { background: var(--brand-muted); color: var(--green); }

/* ══════════════════════════════════════════════════════
   SECTION HEADER (collapse toggle inner)
══════════════════════════════════════════════════════ */
.section-header {
  display: flex; align-items: center; gap: 10px;
}
.section-header-icon {
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  background: var(--brand-muted);
  border-radius: var(--radius-sm);
  flex-shrink: 0;
}
.section-header-icon svg { stroke: var(--green); }
.section-header-title {
  font-weight: 700; font-size: 14px; color: var(--text-1);
  font-family: inherit;
}
.section-header-badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 22px; height: 22px; padding: 0 7px;
  background: var(--text-1); color: var(--brand);
  font-size: 11px; font-weight: 800;
  border-radius: 11px;
  font-family: inherit;
}
.section-header-badge.badge-warn {
  background: var(--yellow-bg); color: var(--yellow);
}

/* CA card special */
.ca-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: box-shadow var(--t);
  position: relative;
}
.ca-card::after {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, var(--brand), #3b82f6);
}
.ca-card:hover { box-shadow: var(--shadow-md); }
.ca-card-inner {
  display: flex; gap: 24px; align-items: flex-start;
  padding: 20px;
}
.ca-stats { flex: 0 0 130px; }
.ca-divider { width: 1px; background: var(--border); align-self: stretch; min-height: 100px; flex-shrink: 0; }
.ca-chart  { flex: 1; min-width: 0; }

/* Bouton afficher graphique — desktop : caché, mobile : visible */
.btn-toggle-chart { display: none; }
.ca-detail-btn {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 10px;
  background: var(--surface-2); border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 11px; font-weight: 700; color: var(--text-2);
  cursor: pointer; font-family: inherit;
  transition: all var(--t);
}
.ca-detail-btn:hover { background: var(--brand-muted); border-color: rgba(46,232,122,.3); color: var(--green); }

/* Filter select */
.filter-select {
  padding: 7px 30px 7px 10px;
  min-height: 36px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 12px; font-weight: 600;
  color: var(--text-2);
  background: var(--surface)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E")
    no-repeat right 8px center;
  -webkit-appearance: none; appearance: none;
  cursor: pointer;
  transition: all var(--t);
  font-family: inherit;
}
.filter-select:focus { outline: none; border-color: var(--brand); }
.filter-select option { background: #fff; color: #212121; }

/* ══════════════════════════════════════════════════════
   LEGACY COMPAT (dashboard-layout used in artisan.html)
══════════════════════════════════════════════════════ */
.dashboard-layout { display: block; }
.dashboard-main   { width: 100%; }
/* Hide any leftover inline sidebar-nav inside .dashboard-layout */
.dashboard-layout > nav.sidebar-nav { display: none !important; }

/* ══════════════════════════════════════════════════════
   UTILITY / COMPONENT CLASSES
══════════════════════════════════════════════════════ */

/* Admin back button */
.btn-admin-back {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px;
  background: rgba(148,163,184,.08);
  border: 1px solid rgba(148,163,184,.2);
  border-radius: var(--radius-sm);
  color: var(--text-3);
  font-size: 13px; font-weight: 600;
  text-decoration: none; transition: all var(--t);
}
.btn-admin-back:hover { background: rgba(148,163,184,.16); color: var(--text-2); }

/* Progress bar */
.progress-bar { background: var(--surface-2); border-radius: 6px; overflow: hidden; }
.progress-bar.pb-sm { height: 4px; }
.progress-bar.pb-md { height: 6px; }
.progress-bar-fill { height: 100%; border-radius: 6px; transition: width .3s; }
.progress-bar-fill.pb-brand  { background: linear-gradient(90deg, var(--brand), var(--brand-dark)); }
.progress-bar-fill.pb-amber  { background: linear-gradient(90deg, #f59e0b, #d97706); }

/* Tab section buttons (relances, etc.) */
.tab-section-btn {
  padding: 8px 16px;
  border: none; background: none; cursor: pointer;
  font-size: 13px; font-weight: 600;
  color: var(--text-2);
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  font-family: inherit;
  transition: all var(--t);
}
.tab-section-btn:hover { color: var(--text-1); }
.tab-section-btn.active { font-weight: 700; color: var(--text-1); border-bottom-color: var(--text-1); }

/* Refuse button */
.btn-refuse {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 8px;
  background: var(--red-bg); border: 1px solid rgba(220,38,38,.2);
  color: var(--red); border-radius: var(--radius-sm);
  font-size: 11px; font-weight: 600;
  cursor: pointer; transition: all var(--t); white-space: nowrap;
}
.btn-refuse:hover { background: rgba(220,38,38,.15); }

/* Confirm refuse modal */
.btn-confirm-refuse {
  flex: 1; padding: 10px 16px;
  background: rgba(239,68,68,.15); border: 1px solid rgba(239,68,68,.3);
  color: var(--red); border-radius: var(--radius-sm);
  cursor: pointer; font-weight: 600; font-size: 13px;
  transition: all var(--t);
}
.btn-confirm-refuse:hover { background: rgba(239,68,68,.25); }

/* ── SECTION ACTIONS RECOMMANDÉES ─────────────────── */
.reco-list { display: flex; flex-direction: column; gap: 6px; }

.reco-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; border-radius: var(--radius-md);
  flex-wrap: nowrap; transition: opacity .3s;
}
.reco-item-yes        { background: rgba(46,232,122,.06); border: 1px solid rgba(46,232,122,.18); }
.reco-item-no         { background: var(--surface-2); border: 1px solid var(--border); opacity: .7; }
.reco-item-unanswered { background: #ffffff; border: 1.5px solid #e2e8f0; box-shadow: 0 1px 4px rgba(13,27,42,.05); }

.reco-icon {
  flex-shrink: 0; width: 28px; height: 28px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
}
.reco-item-yes        .reco-icon { background: rgba(46,232,122,.12); color: #059669; }
.reco-item-no         .reco-icon { background: var(--surface-2); color: var(--text-3); }
.reco-item-unanswered .reco-icon { background: rgba(245,158,11,.1); color: #d97706; }

.reco-question { font-size: 13px; font-weight: 600; color: var(--text-1); line-height: 1.3; }
.reco-desc     { font-size: 11px; color: var(--text-3); margin-top: 2px; line-height: 1.4; }
.reco-status-yes { font-size: 11px; color: #059669; font-weight: 600; margin-top: 3px; }
.reco-status-no  { font-size: 11px; color: var(--text-3); margin-top: 3px; }

.reco-btns { display: flex; gap: 6px; flex-shrink: 0; flex-wrap: nowrap; margin-left: auto; }
.btn-reco-yes {
  padding: 6px 12px; font-size: 12px; font-weight: 600;
  background: var(--text-1); color: #2EE87A; border: none;
  border-radius: var(--radius-sm); cursor: pointer; white-space: nowrap; transition: all var(--t);
}
.btn-reco-yes:hover { background: #1a2e44; }
.btn-reco-no {
  padding: 6px 12px; font-size: 12px; font-weight: 500;
  background: transparent; border: 1.5px solid var(--border);
  color: var(--text-2); border-radius: var(--radius-sm);
  cursor: pointer; white-space: nowrap; transition: all var(--t);
}
.btn-reco-no:hover { border-color: var(--text-3); color: var(--text-1); }
.btn-reco-skip {
  padding: 6px 10px; font-size: 11px; font-weight: 500;
  background: transparent; border: 1.5px dashed var(--border);
  color: var(--text-3); border-radius: var(--radius-sm);
  cursor: pointer; white-space: nowrap; transition: all var(--t);
}
.btn-reco-skip:hover { border-color: var(--text-3); color: var(--text-2); }

/* Add category button */
.btn-add-cat {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 6px 12px;
  background: var(--surface-2); border: 1px dashed var(--border);
  border-radius: 20px; font-size: 12px; color: var(--text-2);
  cursor: pointer; transition: all var(--t);
}
.btn-add-cat:hover { border-color: rgba(46,232,122,.35); color: var(--brand); }

/* Category tag pill */
.cat-tag-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px;
  background: rgba(46,232,122,.06); border: 1px solid rgba(46,232,122,.15);
  border-radius: 20px; font-size: 12px; color: var(--text-1);
  transition: all var(--t);
}
.cat-tag-pill:hover { background: rgba(46,232,122,.12); border-color: rgba(46,232,122,.3); }
.cat-tag-name { cursor: pointer; }
.cat-tag-name:hover { color: var(--brand); text-decoration: underline; }

/* Photo img hover */
.photo-img { display: block; transition: transform .2s; }
.photo-img:hover { transform: scale(1.05); }

/* Catalogue search input */
.search-input-sm {
  flex: 1; min-width: 200px;
  padding: 8px 12px; min-height: 36px;
  background: var(--surface-2); border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-1); font-size: 13px;
  font-family: inherit;
  outline: none; transition: border-color var(--t);
}
.search-input-sm:focus { border-color: var(--brand); }
.search-input-sm::placeholder { color: var(--text-3); }

/* Inline cat manager box */
.cat-manage-box {
  margin-bottom: 14px;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 10px; overflow: hidden;
}

/* Referral code display */
.referral-code-val {
  font-size: 22px; font-weight: 800; color: var(--brand);
  letter-spacing: 3px; font-family: inherit;
  background: rgba(46,232,122,.06); padding: 8px 16px;
  border-radius: 8px; border: 1px solid rgba(46,232,122,.15);
}

/* RGE section box */
.rge-box {
  padding: 14px;
  background: rgba(46,232,122,.04); border: 1px solid rgba(46,232,122,.12);
  border-radius: var(--radius-sm);
}

/* Section divider */
.section-divider { border-top: 1px solid var(--border); margin-top: 14px; padding-top: 14px; }

/* Sub label uppercase */
.sub-label-uc {
  font-size: 11px; font-weight: 700; color: var(--text-2);
  font-family: inherit;
  letter-spacing: .5px; text-transform: uppercase;
  margin-bottom: 6px;
}

/* ── MODERN KPI IMPROVEMENT v16 ──────────────────── */
/* Larger numbers + visible brand tint */
.kpi-card {
  background: linear-gradient(150deg, var(--surface) 55%, rgba(46,232,122,.07) 100%);
  box-shadow: 0 2px 8px rgba(0,0,0,.07), 0 0 0 1px rgba(46,232,122,.08);
  border-color: rgba(46,232,122,.12);
}
.kpi-card:hover {
  box-shadow: 0 6px 20px rgba(0,0,0,.10), 0 0 0 1px rgba(46,232,122,.18);
  border-color: rgba(46,232,122,.25);
}
.kpi-value { font-size: 42px; letter-spacing: -1px; }
.kpi-label { font-size: 11px; letter-spacing: 1.2px; }

/* CA card: brand gradient top bar */
.ca-card::after { background: linear-gradient(90deg, var(--brand), var(--brand-dark)); }

/* Section headers: more visual weight */
.section-header-title { font-size: 15px; }
.section-card {
  box-shadow: 0 2px 8px rgba(0,0,0,.06);
  border-color: #dde4ef;
}

/* Section header collapse toggle: subtle hover background */
.collapse-toggle:hover .section-header-icon {
  background: var(--brand-muted);
  box-shadow: 0 0 0 2px rgba(46,232,122,.15);
}

/* ── CATALOGUE TABLE — alignement vertical ────────── */
.catalogue-group .data-table td,
.catalogue-group .data-table th {
  vertical-align: middle !important;
  padding-top: 10px !important;
  padding-bottom: 10px !important;
}
.catalogue-group .data-table td .filter-select {
  height: 32px;
  min-height: 32px !important;
  padding: 4px 22px 4px 8px !important;
  line-height: 1.2;
  display: block;
  width: 100%;
  max-width: 130px;
  font-size: 11px;
  vertical-align: middle;
  margin: 0;
}
.catalogue-group .data-table td:last-child {
  text-align: right;
}
.catalogue-group .data-table td:last-child div {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  justify-content: flex-end;
}

/* Barème inputs dans tableau */
.bareme-input {
  width: 80px;
  padding: 5px 8px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text-1);
  font-size: 13px;
  font-family: inherit;
  outline: none;
  transition: border-color var(--t);
  text-align: center;
}
.bareme-input:focus { border-color: var(--brand); }
.bareme-row td { padding: 8px 16px; }

/* Modern filter row */
.filter-row {
  display: flex; gap: 8px; margin-bottom: 14px;
  flex-wrap: wrap; align-items: center;
}

/* Filleul item */
.filleul-item {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 10px;
  background: var(--surface-2); border-radius: var(--radius-sm);
  margin-top: 6px;
}

/* RGPD footer */
.rgpd-footer {
  background: rgba(46,232,122,.02); border: 1px solid rgba(46,232,122,.06);
  border-radius: var(--radius-md); padding: 14px;
  margin: 24px 0; font-size: 12px; color: var(--text-2); line-height: 1.6;
}

/* ══════════════════════════════════════════════════════
   REDESIGN v18 — FULL MODERN OVERHAUL
   "Change everything" — bolder, spacious, dramatic
══════════════════════════════════════════════════════ */

/* Page : bleu nuit clair — dérivé du navy VOX BATI #0c1825 */
body { background: #dde8f5; }

/* ── KPI cards : plus d'espace, plus d'impact ──────── */
.kpi-card {
  padding: 26px 22px 22px;
  background: linear-gradient(145deg, #ffffff 50%, rgba(46,232,122,.08) 100%);
  box-shadow: 0 2px 12px rgba(15,25,35,.07), 0 0 0 1px rgba(46,232,122,.1);
  border-color: rgba(46,232,122,.14);
}
.kpi-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 28px rgba(15,25,35,.11), 0 0 0 1px rgba(46,232,122,.22);
  border-color: rgba(46,232,122,.3);
}
.kpi-value {
  font-size: 48px;
  font-weight: 900;
  letter-spacing: -2px;
  line-height: 1;
  color: var(--text-1);
}
.kpi-label {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1.5px;
  color: var(--text-3);
  margin-bottom: 10px;
}
.kpi-sub {
  font-size: 13px;
  color: var(--text-3);
  margin-top: 8px;
}
.kpi-grid { gap: 14px; margin-bottom: 16px; }

/* ── CA card : colonne stats plus large + gros chiffre ─ */
.ca-card {
  box-shadow: 0 2px 12px rgba(15,25,35,.07);
  border-color: rgba(46,232,122,.14);
  margin-bottom: 20px;
}
.ca-card::after {
  height: 4px;
  background: linear-gradient(90deg, var(--brand), #3bcc72, #1dbf66);
}
.ca-card-inner { padding: 24px 24px; gap: 28px; }
.ca-stats { flex: 0 0 170px; }
.ca-value {
  font-size: 44px !important;
  font-weight: 900 !important;
  letter-spacing: -2px !important;
  line-height: 1 !important;
  color: var(--text-1) !important;
  margin: 6px 0 2px !important;
}
.ca-sub {
  font-size: 12px;
  color: var(--text-3);
  margin-bottom: 14px;
}
.ca-encours-row {
  display: flex;
  align-items: baseline;
  gap: 5px;
}
.ca-encours-val {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-2);
}
.ca-encours-lbl {
  font-size: 11px;
  color: var(--text-3);
}
.ca-total-val {
  font-size: 18px;
  font-weight: 900;
  color: var(--text-1);
  font-family: inherit;
}
.ca-total-lbl {
  font-size: 11px;
  color: var(--text-3);
  font-weight: 600;
}
#kpiCADetails {
  border-top: 1px solid var(--divider);
  padding-top: 12px;
  margin-top: 4px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* ── Period toggle : pill plus moderne ─────────────── */
.period-toggle {
  background: var(--surface);
  border: 1.5px solid rgba(46,232,122,.2);
  border-radius: 50px;
  padding: 3px;
  box-shadow: 0 1px 4px rgba(0,0,0,.08);
  gap: 2px;
}
.period-btn {
  border-radius: 40px;
  font-size: 13px;
  font-weight: 700;
  padding: 7px 16px;
  letter-spacing: .1px;
  transition: all .2s ease;
}
.period-btn.active {
  background: #0d1b2a;
  color: #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,.18);
}

/* ── Section cards : ombre douce, bord bleu nuit ───── */
.section, .section-card {
  border: 1.5px solid rgba(12,24,37,.2);
  box-shadow: 0 2px 10px rgba(15,25,35,.06);
}
/* ── Section profil : bordure verte (brand) ─────────── */
#section-profil {
  border: 2px solid rgba(46,232,122,.45);
  box-shadow: 0 2px 16px rgba(46,232,122,.08), 0 1px 4px rgba(12,24,37,.06);
}
.section-header-title { font-size: 16px; font-weight: 700; }
.section-header-icon {
  width: 36px; height: 36px;
  border-radius: 10px;
  background: rgba(46,232,122,.08);
  border: 1.5px solid rgba(46,232,122,.15);
}
.section-header-badge {
  font-size: 12px;
  padding: 3px 10px;
}

/* ── CA card: brand gradient top bar (override earlier) */
.ca-card::after {
  background: linear-gradient(90deg, var(--brand), var(--brand-dark));
}

/* ══════════════════════════════════════════════════════
   TABLET (600px)
══════════════════════════════════════════════════════ */
@media (min-width: 600px) {
  .profile-grid      { grid-template-columns: repeat(2, 1fr); }
  .form-row-2col     { grid-template-columns: 1fr 1fr; }
  .radio-cards       { grid-template-columns: 1fr 1fr; }
  .charts-inner-grid { grid-template-columns: 1fr 1fr; }
  .docs-grid         { grid-template-columns: 1fr 1fr; }
  .photo-grid-mobile { grid-template-columns: repeat(3, 1fr); gap: 12px; }
  .kpi-grid          { grid-template-columns: repeat(3, 1fr); }

  /* Hide mobile tab bar */
  .tab-bar        { display: none; }
  .more-overlay   { display: none !important; }
  body            { padding-bottom: 0; }
  .btn-top        { bottom: 24px; }
  .section, .section-card { scroll-margin-top: 0; }

  /* Modal centered */
  .modal-overlay.active { align-items: center; }
  .modal-panel { border-radius: var(--radius-xl); }
}

/* ── MODAL MOBILE : s'adapte quand le clavier s'ouvre ── */
@media (max-width: 599px) {
  .modal-overlay {
    align-items: flex-start;
    padding: 8px;
  }
  .modal-panel {
    /* svh = viewport height sans le clavier */
    max-height: calc(100svh - 16px);
    max-height: calc(100vh - 16px); /* fallback */
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: var(--radius-lg);
  }
}

/* ══════════════════════════════════════════════════════
   DESKTOP (1024px)
══════════════════════════════════════════════════════ */
@media (min-width: 1024px) {
  .topbar-menu-btn      { display: none !important; }
  .topbar-brand-mobile  { display: none !important; }
  .quick-nav            { display: none; }
  .kpi-grid          { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
  .docs-grid         { grid-template-columns: repeat(4, 1fr); }
  .photo-grid-mobile { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
  .profile-grid      { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
  .kpi-ca-wide       { grid-column: span 2; }
  .topbar            { padding: 0 32px; }
  .page-content      { padding: 28px 32px; }
}

/* ══════════════════════════════════════════════════════
   EXPORT CSV — bouton en-tête section
══════════════════════════════════════════════════════ */
.btn-export-section {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-left: auto;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .4px;
  text-decoration: none;
  color: var(--text-2);
  background: transparent;
  border: 1.5px solid var(--border);
  transition: background var(--t), color var(--t), border-color var(--t);
}
.btn-export-section:hover {
  background: rgba(46,232,122,.1);
  color: var(--brand);
  border-color: rgba(46,232,122,.3);
}

/* ══════════════════════════════════════════════════════
   TÉLÉCHARGEMENT PDF — bouton icône dans les lignes
══════════════════════════════════════════════════════ */
.btn-dl {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: 1.5px solid var(--border);
  background: transparent;
  color: var(--text-2);
  text-decoration: none;
  transition: background var(--t), color var(--t), border-color var(--t);
  flex-shrink: 0;
}
.btn-dl:hover {
  background: rgba(46,232,122,.1);
  color: var(--brand);
  border-color: rgba(46,232,122,.3);
}

/* ══════════════════════════════════════════════════════
   BARÈME KILOMÉTRIQUE — indicateur scroll horizontal
══════════════════════════════════════════════════════ */
.bareme-scroll-hint {
  display: none; /* caché sur desktop */
}
.bareme-wrapper {
  position: relative;
}
/* Gradient fade droit — indique qu'il y a plus à droite */
.bareme-wrapper::after {
  content: '';
  display: none;
  position: absolute;
  right: 0; top: 0; bottom: 0;
  width: 32px;
  background: linear-gradient(to left, rgba(255,255,255,.95), transparent);
  pointer-events: none;
  z-index: 1;
}
@media (max-width: 599px) {
  .bareme-scroll-hint {
    display: block;
    font-size: 11px;
    color: var(--text-3);
    text-align: center;
    margin-bottom: 6px;
    letter-spacing: .3px;
  }
  .bareme-wrapper::after { display: block; }
}

/* ══════════════════════════════════════════════════════
   MOBILE — SIDEBAR SLIDE-IN
══════════════════════════════════════════════════════ */
/* Logo VOX BATI mobile — caché sur desktop (flex item dans topbar-left) */
.topbar-brand-mobile { display: none; }

@media (max-width: 1023px) {
  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.open {
    transform: translateX(0);
    box-shadow: 4px 0 32px rgba(0,0,0,.25);
  }
  .app-wrapper {
    margin-left: 0;
    overflow-x: hidden;
    width: 100%;
  }
  .topbar-menu-btn {
    display: flex;
    background: rgba(255,255,255,.1);
    color: #ffffff;
  }
  .topbar-menu-btn:hover { background: rgba(255,255,255,.18); color: #fff; }

  /* Topbar noire sur mobile — cohérence avec la sidebar */
  .topbar {
    padding: 0 16px;
    background: var(--sidebar-bg);
    border-bottom-color: rgba(255,255,255,.08);
  }
  .topbar-subtitle { display: none; } /* masqué sur mobile */
  .page-content { padding: 16px; }

  /* Logo VOX BATI — texte seul sur fond noir, plus besoin de pastille */
  .topbar-brand-mobile {
    display: inline-flex;
    align-items: center;
    font-family: inherit;
    font-size: 17px;
    font-weight: 900;
    letter-spacing: .5px;
    margin-left: 6px;
    margin-top: -3px;
  }
  .tbm-vox  { color: var(--brand); }   /* vert vif */
  .tbm-bati { color: #ffffff; }        /* blanc */

  /* Masquer le titre de page sur mobile */
  .topbar-title { display: none; }
}

/* ══════════════════════════════════════════════════════
   V25 — CATALOGUE PRIX + ATTESTATION RC PRO
══════════════════════════════════════════════════════ */

/* Catalogue : table-layout fixe → colonnes alignées entre groupes, scrollbar invisible */
.catalogue-group .data-table {
  table-layout: fixed;
  width: 100%;
  min-width: 0;
}
.catalogue-group .table-wrapper {
  overflow-x: auto;
  scrollbar-width: none;       /* Firefox */
  -ms-overflow-style: none;    /* IE/Edge */
}
.catalogue-group .table-wrapper::-webkit-scrollbar { display: none; } /* Chrome/Safari */
/* Largeurs fixes par colonne : Produit | Marque | Prix HT | Unité | Catégorie | Actions */
.catalogue-group .data-table th:nth-child(1),
.catalogue-group .data-table td:nth-child(1) { width: auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.catalogue-group .data-table th:nth-child(2),
.catalogue-group .data-table td:nth-child(2) { width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.catalogue-group .data-table th:nth-child(3),
.catalogue-group .data-table td:nth-child(3) { width: 100px; text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; padding-right: 18px !important; }
.catalogue-group .data-table th:nth-child(4),
.catalogue-group .data-table td:nth-child(4) { width: 70px; }
.catalogue-group .data-table th:nth-child(5),
.catalogue-group .data-table td:nth-child(5) { width: 145px; }
.catalogue-group .data-table th:nth-child(6),
.catalogue-group .data-table td:nth-child(6) { width: 76px; text-align: right; padding-right: 14px !important; }

/* Colonnes montants HT/TTC : pas de retour à la ligne sur "3 200 €" */
#tableDevis th:nth-child(3), #tableDevis td:nth-child(3),
#tableDevis th:nth-child(4), #tableDevis td:nth-child(4),
#tableFactures th:nth-child(3), #tableFactures td:nth-child(3),
#tableFactures th:nth-child(4), #tableFactures td:nth-child(4) { white-space: nowrap; }

/* ── CATALOGUE MOBILE — 2 lignes par produit ────────── */
@media (max-width: 599px) {
  /* Désactiver table-layout sur mobile */
  .catalogue-group .data-table {
    display: block; min-width: 0 !important;
    table-layout: auto;
  }
  .catalogue-group .data-table thead { display: none; }
  .catalogue-group .data-table tbody { display: block; }

  /* Chaque ligne = grille 2 colonnes / 2 rangées */
  .catalogue-group .data-table tr {
    display: grid !important;
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto;
    gap: 2px 8px;
    padding: 10px 14px;
    border-bottom: 1px solid var(--divider);
  }
  .catalogue-group .data-table td {
    display: block !important;
    padding: 0 !important;
    border: none !important;
    width: auto !important;
    overflow: visible !important;
    white-space: normal !important;
  }

  /* Ligne 1 gauche : Nom produit */
  .catalogue-group .data-table td:nth-child(1) {
    grid-column: 1; grid-row: 1;
    font-weight: 600; font-size: 13px; color: var(--text-1);
  }
  /* Ligne 1 droite : Prix HT */
  .catalogue-group .data-table td:nth-child(3) {
    grid-column: 2; grid-row: 1;
    font-weight: 700; font-size: 13px;
    text-align: right; white-space: nowrap !important;
    padding-right: 0 !important;
    font-variant-numeric: tabular-nums;
  }
  /* Ligne 2 gauche : Marque */
  .catalogue-group .data-table td:nth-child(2) {
    grid-column: 1; grid-row: 2;
    font-size: 11px; color: var(--text-3);
  }
  /* Ligne 2 droite : Boutons actions */
  .catalogue-group .data-table td:nth-child(6) {
    grid-column: 2; grid-row: 2;
    text-align: right;
  }
  /* Masqués sur mobile : Unité + Catégorie */
  .catalogue-group .data-table td:nth-child(4),
  .catalogue-group .data-table td:nth-child(5) {
    display: none !important;
  }
}

/* Bouton upload attestation RC Pro (inline dans form) */
.btn-upload-attestation {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 14px; font-size: 12px; font-weight: 600;
  border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface-2); color: var(--text-2);
  cursor: pointer; transition: all var(--t);
  font-family: inherit;
}
.btn-upload-attestation:hover {
  border-color: var(--brand); color: var(--brand);
  background: var(--brand-muted);
}
.attestation-ok {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 12px; color: var(--green); font-weight: 600;
}

/* ══════════════════════════════════════════════════════
   V28 — MOBILE-FIRST AUDIT FIXES
   Cibles : tables devis/factures/relances, KPI, reco
══════════════════════════════════════════════════════ */
@media (max-width: 599px) {

  /* ── Graphique CA : masqué par défaut, dispo via bouton ─ */
  #caChartSection { display: none; }
  .ca-divider     { display: none; }
  .ca-card-inner  { flex-wrap: wrap; }
  .ca-stats       { flex: 1 1 100%; }

  /* Quand le graphique s'affiche : pleine largeur + hauteur lisible */
  #caChartSection[style*="block"] {
    flex: 1 1 100%;
    border-top: 1px solid var(--border);
    padding-top: 14px;
    margin-top: 4px;
    margin-left: -8px;   /* léger décalage gauche */
    width: calc(100% + 8px);
  }
  #chartCAWrap { height: 260px !important; }

  .btn-toggle-chart {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 10px;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 600;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-2);
    cursor: pointer;
    font-family: inherit;
    transition: all var(--t);
  }
  .btn-toggle-chart:hover { border-color: var(--brand); color: var(--brand); }

  /* ── KPI period panel : boutons en grille 2 colonnes ─ */
  .kpi-period-btn { flex: 0 1 calc(50% - 3px); min-width: 0; }

  /* ── KPI cards : valeurs plus petites ────────────────  */
  .kpi-grid  { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .kpi-card  { padding: 14px 12px; }
  .kpi-value { font-size: 22px; }
  .kpi-ca-wide { grid-column: span 2; }

  /* ── TABLE DEVIS (#tableDevis) : carte 2 lignes ──────  */
  #tableDevis { display: block; min-width: 0 !important; }
  #tableDevis thead { display: none; }
  #tableDevis tbody { display: block; }
  #tableDevis tr {
    display: grid !important;
    grid-template-areas:
      "client client ttc"
      "num    statut action";
    grid-template-columns: auto 1fr auto;
    gap: 4px 10px;
    padding: 12px;
    border-bottom: 1px solid var(--divider);
  }
  #tableDevis td { display: block !important; padding: 0 !important; border: none !important; }
  #tableDevis td:nth-child(1) { grid-area: num;    font-size: 11px; color: var(--text-3); align-self: center; }
  #tableDevis td:nth-child(2) { grid-area: client; font-weight: 600; font-size: 13px; }
  #tableDevis td:nth-child(3) { display: none !important; }           /* HT — masqué */
  #tableDevis td:nth-child(4) { grid-area: ttc;    font-weight: 700; font-size: 14px; align-self: center; white-space: nowrap; }
  #tableDevis td:nth-child(5) { grid-area: statut; align-self: center; }
  #tableDevis td:nth-child(6) { display: none !important; }           /* Envoyé le — masqué */
  #tableDevis td:nth-child(7) { display: none !important; }           /* Signé le — masqué */
  #tableDevis td:nth-child(8) { grid-area: action; align-self: center; justify-self: end; }

  /* ── TABLE FACTURES (#tableFactures) : même structure ─ */
  #tableFactures { display: block; min-width: 0 !important; }
  #tableFactures thead { display: none; }
  #tableFactures tbody { display: block; }
  #tableFactures tr {
    display: grid !important;
    grid-template-areas:
      "client client ttc"
      "num    statut action";
    grid-template-columns: auto 1fr auto;
    gap: 4px 10px;
    padding: 12px;
    border-bottom: 1px solid var(--divider);
  }
  #tableFactures td { display: block !important; padding: 0 !important; border: none !important; }
  #tableFactures td:nth-child(1) { grid-area: num;    font-size: 11px; color: var(--text-3); align-self: center; }
  #tableFactures td:nth-child(2) { grid-area: client; font-weight: 600; font-size: 13px; }
  #tableFactures td:nth-child(3) { display: none !important; }        /* Type — masqué */
  #tableFactures td:nth-child(4) { grid-area: ttc;    font-weight: 700; font-size: 14px; align-self: center; white-space: nowrap; }
  #tableFactures td:nth-child(5) { grid-area: statut; align-self: center; }
  #tableFactures td:nth-child(6) { display: none !important; }        /* Émission — masqué */
  #tableFactures td:nth-child(7) { display: none !important; }        /* Paiement — masqué */
  #tableFactures td:nth-child(8) { grid-area: action; align-self: center; justify-self: end; }

  /* ── TABLES RELANCES (devis + factures) : cartes complètes ─ */
  #panelRelancesDevis .table-wrapper,
  #panelRelancesFactures .table-wrapper { overflow-x: visible; box-shadow: none; border: none; border-radius: 0; background: transparent; }
  #panelRelancesDevis .data-table,
  #panelRelancesFactures .data-table { display: block; min-width: 0 !important; border: none; }
  #panelRelancesDevis .data-table thead,
  #panelRelancesFactures .data-table thead { display: none; }
  #panelRelancesDevis .data-table tbody,
  #panelRelancesFactures .data-table tbody { display: flex; flex-direction: column; gap: 10px; }
  #panelRelancesDevis .data-table tr,
  #panelRelancesFactures .data-table tr {
    display: grid !important;
    grid-template-areas:
      "num   days"
      "client client"
      "amount status"
      "date  date"
      "action action";
    grid-template-columns: 1fr auto;
    row-gap: 3px; column-gap: 10px;
    padding: 12px 14px;
    border-bottom: none;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-xs);
  }
  #panelRelancesDevis .data-table td,
  #panelRelancesFactures .data-table td { display: block !important; padding: 0 !important; border: none !important; }
  /* td 1 — numéro */
  #panelRelancesDevis .data-table td:nth-child(1),
  #panelRelancesFactures .data-table td:nth-child(1) { grid-area: num; font-weight: 700; font-size: 13px; align-self: center; }
  /* td 2 — client */
  #panelRelancesDevis .data-table td:nth-child(2),
  #panelRelancesFactures .data-table td:nth-child(2) { grid-area: client; font-size: 13px; color: var(--text-2); font-weight: 500; }
  /* td 3 — montant TTC */
  #panelRelancesDevis .data-table td:nth-child(3),
  #panelRelancesFactures .data-table td:nth-child(3) { grid-area: amount; font-weight: 700; font-size: 15px; white-space: nowrap; align-self: center; }
  /* td 4 — date envoi */
  #panelRelancesDevis .data-table td:nth-child(4),
  #panelRelancesFactures .data-table td:nth-child(4) { grid-area: date; font-size: 11px; color: var(--text-3); }
  #panelRelancesDevis .data-table td:nth-child(4)::before { content: 'Envoyé le '; }
  #panelRelancesFactures .data-table td:nth-child(4)::before { content: 'Émise le '; }
  /* td 5 — jours d'attente */
  #panelRelancesDevis .data-table td:nth-child(5),
  #panelRelancesFactures .data-table td:nth-child(5) { grid-area: days; text-align: right; align-self: start; }
  /* td 6 — statut relance */
  #panelRelancesDevis .data-table td:nth-child(6),
  #panelRelancesFactures .data-table td:nth-child(6) { grid-area: status; align-self: center; text-align: right; }
  /* td 7 — action */
  #panelRelancesDevis .data-table td:nth-child(7),
  #panelRelancesFactures .data-table td:nth-child(7) { grid-area: action; padding-top: 8px; border-top: 1px solid var(--divider) !important; margin-top: 4px; }
  #panelRelancesDevis .data-table td:nth-child(7) .btn-signature,
  #panelRelancesFactures .data-table td:nth-child(7) .btn-signature { width: 100%; justify-content: center; }

  /* ── RECO ITEMS : colonne sur mobile ─────────────────  */
  .reco-item { flex-direction: column; align-items: flex-start; gap: 10px; flex-wrap: wrap; }
  .reco-btns { width: 100%; justify-content: flex-start; margin-left: 0; flex-wrap: wrap; }
  .btn-reco-yes, .btn-reco-no { flex: 1; text-align: center; justify-content: center; }
  .btn-reco-skip { width: 100%; text-align: center; }

  /* ── SECTION HEADER : wrap sur très petits écrans ────  */
  .section-header { flex-wrap: wrap; gap: 6px; }
  .section-header-title { font-size: 14px; }
  .btn-export-section { padding: 3px 8px; font-size: 10px; }

  /* ── TABLE WRAPPER : no overflow-x sur mobile ────────  */
  .table-wrapper { overflow-x: auto; -webkit-overflow-scrolling: touch; }
}

/* ══════════════════════════════════════════════════════
   V47 — BOTTOM NAV MOBILE
══════════════════════════════════════════════════════ */

/* Barre de navigation fixée en bas (mobile/tablette) */
.bottom-nav { display: none; }

@media (max-width: 1023px) {
  .bottom-nav {
    display: flex;
    position: fixed;
    bottom: 0; left: 0; right: 0;
    height: 62px;
    background: linear-gradient(180deg, #0f2133, #0c1825);
    border-top: 1px solid rgba(46,232,122,.1);
    z-index: 200;
    padding-bottom: env(safe-area-inset-bottom);
    overflow: hidden;
    box-shadow: 0 -4px 20px rgba(0,0,0,.25);
  }
  .bnav-item {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    color: rgba(255,255,255,.35);
    font-size: 8px;
    font-weight: 600;
    letter-spacing: .1px;
    text-transform: uppercase;
    text-decoration: none;
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    position: relative;
    transition: all .15s;
    padding: 6px 2px 4px;
    -webkit-tap-highlight-color: transparent;
  }
  .bnav-item svg { width: 16px; height: 16px; }
  .bnav-item:hover, .bnav-item.active { color: var(--brand); }
  .bnav-item.active::after {
    content: '';
    position: absolute; top: 0; left: 25%; right: 25%;
    height: 2px;
    background: var(--brand);
    border-radius: 0 0 2px 2px;
  }
  .bnav-item svg { flex-shrink: 0; }
  .bnav-badge {
    position: absolute;
    top: 3px; right: calc(50% - 18px);
    background: linear-gradient(135deg, #f59e0b, #ea580c);
    color: #fff;
    border-radius: 10px;
    padding: 0 5px;
    font-size: 8px; font-weight: 700;
    line-height: 14px;
    min-width: 14px; text-align: center;
    box-shadow: 0 1px 4px rgba(245,158,11,.3);
  }
  /* Compenser la hauteur de la bottom nav */
  body:has(.bottom-nav) .page-content { padding-bottom: 80px; }
  body:has(.bottom-nav) .app-footer { display: none; }
}

/* Tag période CA (badge vert sous le label "CA HT") */
.ca-period-tag {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  color: var(--brand-dark);
  background: var(--brand-muted);
  border-radius: 100px;
  padding: 1px 9px;
  margin: 3px 0 4px;
  font-family: inherit;
  letter-spacing: .2px;
  text-transform: uppercase;
}

/* ══════════════════════════════════════════════════════
   V49 — ACTIONS RECOMMANDÉES : HEADER VISIBLE
══════════════════════════════════════════════════════ */

/* Bloc "Actions recommandées" — fond navy, titre blanc, sous-titre vert */
.reco-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: linear-gradient(135deg, var(--sidebar-bg) 0%, #1a3050 100%);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  margin-bottom: 12px;
  border: 1px solid rgba(255,255,255,.06);
}
.reco-section-title {
  font-size: 13px;
  font-weight: 700;
  color: #ffffff;
  font-family: inherit;
  letter-spacing: .2px;
  margin-bottom: 3px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.reco-section-subtitle {
  font-size: 11px;
  font-weight: 600;
  color: var(--brand);
  letter-spacing: .2px;
}

/* Items non répondus : légèrement mis en avant avec une bordure gauche orange */
.reco-item-unanswered {
  background: #ffffff;
  border: 1.5px solid #e2e8f0;
  border-left: 3px solid #f59e0b;
  box-shadow: 0 1px 4px rgba(13,27,42,.05);
}

/* ═══ CLIENTS GRID (cards) ═══ */
.clients-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr));
  gap: 10px;
}
.client-card {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px;
  background: var(--surface, #fff);
  border: 1.5px solid var(--border, #e2e8f0);
  border-radius: 14px;
  text-decoration: none; color: inherit;
  transition: all .18s ease;
  position: relative;
}
.client-card:hover {
  border-color: rgba(46,232,122,.35);
  box-shadow: 0 4px 16px rgba(46,232,122,.12);
  transform: translateY(-2px);
}
/* Favori star */
.client-fav-btn {
  position: absolute; top: 8px; right: 8px;
  background: none; border: none; cursor: pointer;
  padding: 4px; border-radius: 6px;
  color: var(--text-3, #cbd5e1); fill: none;
  transition: all .15s; z-index: 2;
  line-height: 0;
}
.client-fav-btn:hover { color: #f59e0b; transform: scale(1.15); }
.client-fav-btn svg { fill: none; }
.client-card.is-fav .client-fav-btn { color: #f59e0b; }
.client-card.is-fav .client-fav-btn svg { fill: #f59e0b; }
.client-card.is-fav {
  border-color: rgba(245,158,11,.25);
  box-shadow: 0 2px 8px rgba(245,158,11,.08);
}
.client-card-avatar {
  width: 42px; height: 42px; flex-shrink: 0;
  background: linear-gradient(135deg, #2EE87A, #1BA377);
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 15px; font-weight: 800;
  font-family: inherit;
  box-shadow: 0 2px 8px rgba(46,232,122,.2);
}
.client-card-info {
  display: flex; flex-direction: column; flex: 1; min-width: 0;
}
.client-card-name {
  font-size: 14px; font-weight: 700; color: var(--text-1, #0d1b2a);
  font-family: inherit;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.client-card-city {
  font-size: 12px; color: var(--text-3, #6d7280);
  font-family: inherit;
  display: flex; align-items: center; gap: 3px;
}
.client-card-tel {
  font-size: 11px; color: var(--text-3, #94a3b8);
  font-family: inherit;
  font-variant-numeric: tabular-nums;
}
.client-card-arrow {
  flex-shrink: 0; color: var(--text-3, #94a3b8);
  transition: transform .15s, color .15s;
}
.client-card:hover .client-card-arrow {
  color: #2EE87A; transform: translateX(3px);
}
/* Clients limités : masqués par défaut, affichés via JS */
.client-card-hidden { display: none; }
.clients-grid.show-all .client-card-hidden { display: flex; }

/* Bouton "Voir plus / moins" */
.clients-show-more {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  width: 100%; margin-top: 10px; padding: 10px;
  background: var(--surface-2, #f8fafc);
  border: 1.5px dashed var(--border, #e2e8f0);
  border-radius: 12px; cursor: pointer;
  font-size: 13px; font-weight: 600;
  color: var(--text-3, #6d7280);
  font-family: inherit;
  transition: all .15s;
}
.clients-show-more:hover {
  border-color: rgba(46,232,122,.4);
  color: #059669;
  background: rgba(46,232,122,.04);
}
.clients-show-more svg { transition: transform .2s; }
.clients-show-more.expanded svg { transform: rotate(180deg); }

@media (max-width: 640px) {
  .clients-grid { grid-template-columns: 1fr; gap: 8px; }
  .client-card { padding: 12px 14px; }
  .client-card-avatar { width: 38px; height: 38px; font-size: 13px; border-radius: 10px; }
}
