/* ═══════════════════════════════════════════════════════════════════════
   FacturaBot — Editorial Industrial Design System
   Palette: brick-ember · dark-walnut · alabaster · silver · pitch-black
   Fonts:   Bricolage Grotesque (display) · IBM Plex Mono (data)
   ═══════════════════════════════════════════════════════════════════════ */

:root {
  /* ── Palette ──────────────────OUI──── */
  --brick:      #b80c09;
  --brick-light:#d4443f;
  --brick-dark: #8a0907;
  --walnut:     #6b2b06;
  --walnut-light:#8b4513;
  --alabaster:  #e5e7e6;
  --silver:     #b7b5b3;
  --pitch:      #141301;

  /* ── Semantic ───────────────────── */
  --bg:         #f2f1ef;
  --bg-card:    #ffffff;
  --bg-sidebar: #1a1708;
  --border:     #d4d2cf;
  --border-focus:#6b2b06;
  --text:       #1a1708;
  --text-muted: #7a7875;
  --accent:     #b80c09;
  --accent-hover:#8a0907;
  --ok:         #1a7a4c;
  --ok-bg:      #e8f5e9;
  --err:        #b80c09;
  --err-bg:     #fce4e4;
  --warn:       #e6960b;
  --warn-bg:    #fff8e1;
  --r:          10px;

  /* ── Shadows ────────────────────── */
  --shadow-sm:  0 1px 3px rgba(20,19,1,.06);
  --shadow-md:  0 4px 12px rgba(20,19,1,.08);
  --shadow-lg:  0 8px 30px rgba(20,19,1,.12);
}

/* ═══ RESET ═══════════════════════════════════════════════════════════ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 15px; scroll-behavior: smooth; }

body {
  font-family: 'Bricolage Grotesque', sans-serif;
  background: var(--bg);
  color: var(--text);
  display: flex;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ═══ SCROLLBAR ═══════════════════════════════════════════════════════ */

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--silver); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ═══ AUTH PAGE ═══════════════════════════════════════════════════════ */

.auth-wrapper {
  display: flex;
  min-height: 100vh;
  width: 100%;
}

.auth-brand {
  flex: 0 0 420px;
  background: var(--pitch);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 60px;
  position: relative;
  overflow: hidden;
}

.auth-brand::before {
  content: '';
  position: absolute;
  top: -100px; right: -100px;
  width: 400px; height: 400px;
  background: var(--brick);
  opacity: .08;
  border-radius: 50%;
}

.auth-brand::after {
  content: '';
  position: absolute;
  bottom: -60px; left: -60px;
  width: 250px; height: 250px;
  background: var(--walnut);
  opacity: .1;
  border-radius: 50%;
}

.auth-brand .logo-big {
  font-size: 38px;
  font-weight: 900;
  color: #fff;
  letter-spacing: -1px;
  z-index: 1;
}

.auth-brand .logo-big span { color: var(--brick); }

.auth-brand .tagline {
  color: var(--silver);
  font-size: 15px;
  margin-top: 12px;
  text-align: center;
  line-height: 1.6;
  z-index: 1;
}

.auth-form-side {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  background: var(--bg);
}

.auth-box {
  width: 100%;
  max-width: 400px;
}

.auth-box h1 {
  font-size: 28px;
  font-weight: 800;
  color: var(--pitch);
  margin-bottom: 4px;
}

.auth-box .auth-sub {
  color: var(--text-muted);
  font-size: 14px;
  margin-bottom: 28px;
}

.auth-toggle {
  display: flex;
  background: var(--alabaster);
  border-radius: 8px;
  padding: 3px;
  margin-bottom: 28px;
}

.auth-toggle button {
  flex: 1;
  padding: 10px;
  border: none;
  border-radius: 6px;
  font-family: 'Bricolage Grotesque', sans-serif;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: all .2s;
  background: transparent;
  color: var(--text-muted);
}

.auth-toggle button.active {
  background: var(--bg-card);
  color: var(--pitch);
  box-shadow: var(--shadow-sm);
}

/* ═══ SIDEBAR ════════════════════════════════════════════════════════ */

.sidebar {
  width: 240px;
  background: var(--bg-sidebar);
  position: fixed;
  top: 60px; left: 0; bottom: 0;
  display: flex;
  flex-direction: column;
  padding: 20px 14px 20px;
  z-index: 100;
  transition: transform .3s;
}

.logo {
  font-size: 22px;
  font-weight: 900;
  color: #fff;
  padding: 0 12px;
  margin-bottom: 32px;
  letter-spacing: -.5px;
}

.logo span { color: var(--brick); }

.nav-section {
  font-size: 10px;
  color: var(--silver);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  font-weight: 700;
  padding: 4px 14px 3px;
  margin-top: 6px;
}

.nav-section:first-of-type { margin-top: 0; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 14px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  color: rgba(255,255,255,.55);
  transition: all .15s;
  margin-bottom: 2px;
  flex-wrap: nowrap;
  white-space: nowrap;
  overflow: hidden;
}

.nav-item:hover {
  background: rgba(255,255,255,.06);
  color: rgba(255,255,255,.85);
}

.nav-item.active {
  background: var(--brick);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(184,12,9,.3);
}

.nav-item .nav-icon {
  width: 20px;
  text-align: center;
  font-size: 15px;
}

.sidebar-footer {
  margin-top: auto;
  padding: 14px;
  border-top: 1px solid rgba(255,255,255,.08);
}

.user-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  padding: 8px;
  border-radius: 8px;
  transition: background .15s;
}

.user-pill:hover { background: rgba(255,255,255,.06); }

.user-avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--walnut);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: 14px;
}

.user-info { flex: 1; min-width: 0; }

.user-name {
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-email {
  font-size: 11px;
  color: var(--silver);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.logout-btn {
  background: none;
  border: none;
  color: var(--silver);
  cursor: pointer;
  font-size: 16px;
  padding: 4px;
  transition: color .15s;
}

.logout-btn:hover { color: var(--brick-light); }

/* ═══ MAIN AREA ══════════════════════════════════════════════════════ */

.main {
  margin-left: 240px;
  margin-top: 60px;
  flex: 1;
  padding: 36px 80px;
}

.page { display: none; }
.page.active { display: block; animation: fadeUp .35s ease; }

/* ═══ APP HEADER ═════════════════════════════════════════════════════ */
.app-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 60px;
  z-index: 800;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px 0 0;
  box-shadow: 0 2px 10px rgba(0,0,0,.07);
}

/* Barre d'accentuation brick en haut */
.app-header::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--brick) 0%, var(--walnut) 100%);
}

/* Zone logo (reprend la couleur sidebar) */
.app-header-logo-zone {
  width: 240px;
  flex-shrink: 0;
  height: 100%;
  background: var(--bg-sidebar);
  display: flex;
  align-items: center;
  padding: 0 20px;
  border-right: 1px solid rgba(255,255,255,.07);
}
.app-header-logo-zone .logo-text {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: 20px;
  font-weight: 900;
  color: #fff;
  letter-spacing: -.5px;
  line-height: 1;
}
.app-header-logo-zone .logo-text span { color: var(--brick); }

/* Zone titre de la page */
.app-header-title-zone {
  flex: 1;
  padding: 0 24px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1px;
}
.app-header-title {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: 16px;
  font-weight: 800;
  color: var(--pitch);
  letter-spacing: -.3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.app-header-sub {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 400;
}

/* Zone droite : badges + pill + déconnexion */
.app-header-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* Pill utilisateur dans le header */
.app-header-user-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 10px 5px 6px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  cursor: pointer;
  transition: background .15s;
  max-width: 200px;
}
.app-header-user-pill:hover { background: var(--alabaster); }
.app-header-user-avatar {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--walnut);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.app-header-user-info { line-height: 1.2; overflow: hidden; }
.app-header-user-name {
  font-size: 12px; font-weight: 700;
  color: var(--pitch);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.app-header-user-email {
  font-size: 10px; color: var(--text-muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* Bouton déconnexion header */
/* ═══ PROFILE DROPDOWN ═══════════════════════════════════════════════ */
.profile-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 200px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0,0,0,.14);
  z-index: 2000;
  overflow: hidden;
  animation: dropdownIn .18s cubic-bezier(.16,1,.3,1);
}
@keyframes dropdownIn {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.profile-dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 16px;
  font-size: 13px;
  font-weight: 600;
  color: var(--pitch);
  cursor: pointer;
  transition: background .12s;
}
.profile-dropdown-item:hover { background: var(--alabaster); }
.profile-dropdown-sep {
  height: 1px;
  background: var(--border);
  margin: 2px 0;
}
.profile-dropdown-logout { color: #dc2626; }
.profile-dropdown-logout:hover { background: #fee2e2; color: #991b1b; }

/* Indicateur caret animé */
#profile-pill-wrap.open #profile-pill-caret { transform: rotate(180deg); }
#profile-pill-caret { transition: transform .18s; display: inline-block; }

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ═══ TYPOGRAPHY ═════════════════════════════════════════════════════ */

h1 {
  font-size: 30px;
  font-weight: 900;
  color: var(--pitch);
  letter-spacing: -.5px;
  margin-bottom: 4px;
}

h2 {
  font-size: 16px;
  font-weight: 700;
  color: var(--walnut);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

h2::before {
  content: '';
  width: 3px;
  height: 16px;
  background: var(--brick);
  border-radius: 2px;
}

.page-sub {
  color: var(--text-muted);
  font-size: 14px;
  margin-bottom: 28px;
  line-height: 1.5;
}

/* ═══ CARDS ══════════════════════════════════════════════════════════ */

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 24px;
  margin-bottom: 18px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow .2s;
}

.card:hover { box-shadow: var(--shadow-md); }

/* ═══ FORMS ══════════════════════════════════════════════════════════ */

.field { margin-bottom: 16px; }

label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 5px;
  text-transform: uppercase;
  letter-spacing: .6px;
}

input, select, textarea {
  width: 100%;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  padding: 10px 14px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 13px;
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}

input:focus, select:focus, textarea:focus {
  border-color: var(--walnut);
  box-shadow: 0 0 0 3px rgba(107,43,6,.1);
}

input[type="checkbox"] {
  width: auto;
  accent-color: var(--brick);
}

.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.row3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-top: 8px;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  text-transform: none;
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
}

/* ═══ BUTTONS ════════════════════════════════════════════════════════ */

.btn {
  padding: 11px 20px !important;
  border-radius: 8px;
  font-family: 'Bricolage Grotesque', sans-serif;
  font-weight: 700;
  font-size: 14px !important;
  cursor: pointer;
  border: none;
  transition: all .2s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-primary {
  background: var(--brick);
  color: #fff;
  box-shadow: 0 2px 8px rgba(184,12,9,.2);
}
.btn-primary:hover {
  background: var(--brick-dark);
  box-shadow: 0 4px 14px rgba(184,12,9,.3);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--alabaster);
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-secondary:hover {
  background: var(--border);
}

.btn-danger {
  background: var(--err-bg);
  color: var(--brick);
  border: 1px solid #e8b4b4;
}
.btn-danger:hover {
  background: #f5c7c7;
}

.btn-walnut {
  background: var(--walnut);
  color: #fff;
}
.btn-walnut:hover {
  background: var(--walnut-light);
}

.btn-sm { padding: 7px 14px; font-size: 12px; }
.btn-xs { padding: 5px 10px; font-size: 11px; border-radius: 6px; }

.actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 20px; }

/* ═══ CLIENT SELECTOR BAR ════════════════════════════════════════════ */

.selector-bar {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 12px 18px;
  margin-bottom: 22px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: var(--shadow-sm);
}

.selector-bar label {
  margin: 0;
  white-space: nowrap;
  font-size: 12px;
}

.selector-bar select {
  max-width: 300px;
}

/* ═══ CLIENT LIST ITEMS ══════════════════════════════════════════════ */

/* ═══ CLIENTS TABLE ══════════════════════════════════════════════════ */

#clients-list {
  display: block;
}

/* Wrapper tableau avec entête */
.clients-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.clients-table thead tr {
  border-bottom: 2px solid var(--border);
}

.clients-table th {
  padding: 8px 12px;
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--text-muted);
  white-space: nowrap;
  background: var(--bg-card);
}

.clients-table th.col-chk  { width: 36px; padding-left: 14px; }
.clients-table th.col-name { min-width: 160px; }
.clients-table th.col-id   { min-width: 130px; }
.clients-table th.col-tva  { width: 90px; }
.clients-table th.col-delai{ width: 90px; text-align: center; }
.clients-table th.col-tarifs{ width: 90px; text-align: center; }
.clients-table th.col-mode { width: 100px; }
.clients-table th.col-actions { width: 80px; text-align: right; padding-right: 14px; }

/* Lignes */
.clients-table tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background .15s;
}

.clients-table tbody tr:last-child {
  border-bottom: none;
}

.clients-table tbody tr:hover {
  background: var(--bg-hover, rgba(0,0,0,.03));
}

.clients-table tbody tr:hover .client-row-actions {
  opacity: 1;
}

.clients-table td {
  padding: 9px 12px;
  vertical-align: middle;
  color: var(--pitch);
}

.clients-table td.col-chk { padding-left: 14px; }
.clients-table td.col-actions { padding-right: 14px; text-align: right; }

/* Nom client */
.client-name {
  font-weight: 700;
  font-size: 13px;
  color: var(--pitch);
  cursor: pointer;
}

.client-name:hover {
  color: var(--walnut);
  text-decoration: underline;
}

/* ID colonne — mono */
.client-id-cell {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11.5px;
  color: var(--text-muted);
}

/* Délai centré */
.client-delai-cell {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12px;
  text-align: center;
  color: var(--text-muted);
}

/* Tarifs count centré */
.client-tarifs-cell {
  text-align: center;
}

/* Actions — cachées par défaut, visibles au hover de la ligne */
.client-row-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  opacity: 0;
  transition: opacity .15s;
}

.client-row-actions .btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-muted);
  cursor: pointer;
  transition: all .15s;
}

.client-row-actions .btn-icon:hover {
  border-color: var(--walnut);
  color: var(--walnut);
  background: var(--bg-hover, #faf5f0);
}

.client-row-actions .btn-icon.danger:hover {
  border-color: var(--brick);
  color: var(--brick);
  background: var(--err-bg);
}

/* Compat ancienne classe .client-item gardée pour transition */
.client-item { display: none; }

.client-meta { display: none; }
.client-right { display: none; }

@media (max-width: 700px) {
  .clients-table th.col-id,
  .clients-table td.client-id-cell { display: none; }
  .clients-table th.col-delai,
  .clients-table td.client-delai-cell { display: none; }
}

/* ═══ TAGS / BADGES ══════════════════════════════════════════════════ */

.tag {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 5px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .3px;
}

/* Badge connecteur top-right */
.tag.pennylane {
  background: transparent;
  border: 1px solid rgba(217,119,6,.35);
  color: #92400e;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.tag.axonaut {
  background: transparent;
  border: 1px solid rgba(37,99,235,.3);
  color: #1e40af;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

@media (max-width: 768px) {
  .tag.pennylane,
  .tag.axonaut {
    padding: 5px 9px;
    font-size: 11px;
  }
}

.tag-sandbox { background: var(--ok-bg); color: var(--ok); }
.tag-prod    { background: var(--err-bg); color: var(--brick); }

.badge {
  padding: 3px 8px;
  border-radius: 5px;
  font-size: 11px;
  font-weight: 700;
  font-family: 'IBM Plex Mono', monospace;
}

.badge-ok  { background: var(--ok-bg);  color: var(--ok);  }
.badge-err { background: var(--err-bg); color: var(--err); }

.tariff-count {
  font-size: 12px;
  color: var(--text-muted);
  font-family: 'IBM Plex Mono', monospace;
}

/* ═══ TARIFF ROWS ════════════════════════════════════════════════════ */

.tariff-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr auto;
  gap: 10px;
  align-items: center;
  margin-bottom: 8px;
}

.tariff-row input, .tariff-row select {
  font-size: 12px;
  padding: 8px 10px;
}

.tariff-header {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr auto;
  gap: 10px;
  margin-bottom: 8px;
  padding: 0 2px;
}

.tariff-header label { font-size: 10px; }

/* ═══ STATS GRID ═════════════════════════════════════════════════════ */

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 22px;
  text-align: center;
  box-shadow: var(--shadow-sm);
  transition: transform .2s, box-shadow .2s;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.stat-number {
  font-size: 36px;
  font-weight: 900;
  letter-spacing: -1px;
}

.stat-number.c-brick  { color: var(--brick);  }
.stat-number.c-walnut { color: var(--walnut); }
.stat-number.c-ok     { color: var(--ok);     }
.stat-number.c-warn   { color: var(--warn);   }

.stat-label {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .5px;
}

/* ═══ DROP ZONE ══════════════════════════════════════════════════════ */

.dropzone {
  border: 2px dashed var(--silver);
  border-radius: var(--r);
  padding: 50px 30px;
  text-align: center;
  cursor: pointer;
  transition: all .25s;
  margin-bottom: 18px;
  background: var(--bg-card);
}

.dropzone:hover {
  border-color: var(--walnut);
  background: rgba(107,43,6,.02);
}

.dropzone.dragover {
  border-color: var(--brick);
  background: rgba(184,12,9,.03);
}

.dz-icon { font-size: 40px; margin-bottom: 12px; }
.dz-title { font-size: 16px; font-weight: 700; margin-bottom: 5px; }
.dz-sub   { font-size: 13px; color: var(--text-muted); }

/* ═══ RESULTS TABLE ══════════════════════════════════════════════════ */

.res-header, .res-row {
  display: grid;
  grid-template-columns: 55px 1fr 1fr 80px 90px 1fr;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 7px;
  font-size: 12px;
  font-family: 'IBM Plex Mono', monospace;
  align-items: center;
  margin-bottom: 3px;
}

.res-header {
  background: var(--alabaster);
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: .5px;
}

.res-row-ok  { background: var(--ok-bg); }
.res-row-err { background: var(--err-bg); }

/* ═══ HISTORY TABLE ══════════════════════════════════════════════════ */

.history-item {
  display: grid;
  grid-template-columns: 1fr 1fr 80px 80px 80px 150px;
  gap: 8px;
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 13px;
  align-items: center;
  margin-bottom: 4px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  transition: box-shadow .15s;
}

.history-item:hover { box-shadow: var(--shadow-sm); }

.history-header {
  display: grid;
  grid-template-columns: 1fr 1fr 80px 80px 80px 150px;
  gap: 8px;
  padding: 10px 16px;
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: .5px;
}

/* ═══ ALERTS ═════════════════════════════════════════════════════════ */

.alert {
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 13px;
  margin-bottom: 16px;
  display: block;
  line-height: 1.6;
  word-wrap: break-word;
  overflow-wrap: break-word;
  white-space: normal;
}

.alert-info {
  background: #eef2ff;
  border: 1px solid #c7d2fe;
  color: #3730a3;
}

.alert-empty {
  background: var(--alabaster);
  border: 1px solid var(--border);
  color: var(--text-muted);
  justify-content: center;
  padding: 30px;
}

.file-info {
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 13px;
  background: #eef2ff;
  border: 1px solid #c7d2fe;
  color: #3730a3;
  margin-bottom: 14px;
  font-family: 'IBM Plex Mono', monospace;
}

/* ═══ PREVIEW TABLE ══════════════════════════════════════════════════ */

.preview-table {
  width: 100%;
  border-collapse: collapse;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 13px;
}

.preview-table th {
  text-align: left;
  padding: 8px;
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  font-family: 'Bricolage Grotesque', sans-serif;
  font-weight: 700;
  letter-spacing: .3px;
}

.preview-table td {
  padding: 8px;
  border-top: 1px solid var(--border);
}

.preview-table .total-cell {
  font-weight: 700;
  color: var(--brick);
}

/* ═══ TOAST NOTIFICATIONS ════════════════════════════════════════════ */

.toast-container {
  position: fixed;
  top: 70px;
  right: 20px;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  padding: 14px 20px 14px 16px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 300px;
  max-width: 420px;
  box-shadow: var(--shadow-lg);
  animation: toastIn .4s cubic-bezier(.16,1,.3,1);
  position: relative;
  overflow: hidden;
}

.toast.removing {
  animation: toastOut .3s ease forwards;
}

.toast-success {
  background: #fff;
  color: var(--ok);
  border-left: 4px solid var(--ok);
}

.toast-error {
  background: #fff;
  color: var(--brick);
  border-left: 4px solid var(--brick);
}

.toast-info {
  background: #fff;
  color: var(--walnut);
  border-left: 4px solid var(--walnut);
}

.toast-icon { font-size: 18px; flex-shrink: 0; }

.toast-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  background: currentColor;
  opacity: .3;
  animation: toastProgress 3s linear forwards;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateX(80px) scale(.95); }
  to   { opacity: 1; transform: translateX(0) scale(1); }
}

@keyframes toastOut {
  to { opacity: 0; transform: translateX(80px) scale(.95); }
}

@keyframes toastProgress {
  from { width: 100%; }
  to   { width: 0%; }
}

/* ═══ PROFILE PAGE ═══════════════════════════════════════════════════ */

.profile-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 40px;
  text-align: center;
}

.profile-avatar {
  width: 64px; height: 64px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--walnut), var(--brick));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 800;
  font-size: 24px;
}

.profile-info h1 { margin-bottom: 2px; }
.profile-info .page-sub { margin-bottom: 0; }

/* ═══ DASHBOARD ══════════════════════════════════════════════════════ */

.welcome-banner {
  background: linear-gradient(135deg, var(--pitch) 0%, var(--walnut) 100%);
  border-radius: var(--r);
  padding: 32px 36px;
  color: #fff;
  margin-bottom: 28px;
  position: relative;
  overflow: hidden;
}

.welcome-banner::after {
  content: '';
  position: absolute;
  top: -40px; right: -40px;
  width: 200px; height: 200px;
  background: var(--brick);
  opacity: .12;
  border-radius: 50%;
}

.welcome-banner h1 { color: #fff; margin-bottom: 6px; }
.welcome-banner p  { color: var(--silver); font-size: 14px; }

.recent-table { margin-top: 8px; }

.recent-row {
  display: grid;
  grid-template-columns: 1fr 1fr 80px 80px 160px;
  gap: 8px;
  padding: 10px 14px;
  font-size: 13px;
  border-radius: 6px;
  align-items: center;
  margin-bottom: 3px;
}

.recent-row:nth-child(even) { background: var(--alabaster); }

.recent-header {
  display: grid;
  grid-template-columns: 1fr 1fr 80px 80px 160px;
  gap: 8px;
  padding: 8px 14px;
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: .5px;
}

/* ═══ RESPONSIVE ═════════════════════════════════════════════════════ */

@media (max-width: 768px) {
  .sidebar { top: 60px; transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main { margin-left: 0; margin-top: 60px; padding: 20px 16px 40px; }
  .auth-brand { display: none; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .row2 { grid-template-columns: 1fr; }
  .res-header, .res-row { font-size: 10px; grid-template-columns: 40px 1fr 1fr 60px 70px 1fr; }
  .history-item, .history-header { grid-template-columns: 1fr 1fr 60px 60px; }
  .history-item > :nth-child(5),
  .history-item > :nth-child(6),
  .history-header > :nth-child(5),
  .history-header > :nth-child(6) { display: none; }

  /* Header mobile : masquer logo-zone et badges, garder burger+titre+pill */
  .app-header-logo-zone { display: none; }
  .app-header-title-zone { padding: 0 12px; }
  .app-header-right .tag,
  .app-header-right .mode-indicator-badge { display: none; }
  .app-header-user-info { display: none; }
  .app-header-logout span:last-child { display: none; }
  .app-header-logout { padding: 7px 10px; }
}

/* ═══ UTILITY ════════════════════════════════════════════════════════ */

.mt-1  { margin-top: 8px;  }
.mt-2  { margin-top: 16px; }
.mt-3  { margin-top: 24px; }
.mb-1  { margin-bottom: 8px;  }
.mb-2  { margin-bottom: 16px; }
.gap-2 { gap: 16px; }
.flex  { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.hidden { display: none !important; }
.mono { font-family: 'IBM Plex Mono', monospace; }

/* ═══ INDUSTRY MODE — Sélecteur secteur (page Profil) ════════════════ */

.mode-toggle {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.mode-option {
  flex: 1;
  min-width: 200px;
  cursor: pointer;
}

.mode-option input[type="radio"] {
  display: none;
}

.mode-btn {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  border: 2px solid var(--border);
  border-radius: var(--r);
  background: var(--bg);
  transition: all .15s ease;
  user-select: none;
}

.mode-option input:checked + .mode-btn {
  border-color: var(--brick);
  background: #fff8f8;
  box-shadow: 0 0 0 3px rgba(184,12,9,.08);
}

.mode-btn:hover {
  border-color: var(--walnut-light);
  background: var(--bg-card);
}

.mode-icon {
  font-size: 24px;
  flex-shrink: 0;
}

.mode-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--pitch);
}

.mode-desc {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ═══ INDUSTRY INFO CARD — page Tarifs (Mode 2) ══════════════════════ */

.industry-info-card {
  text-align: center;
  padding: 40px 32px;
}

.industry-info-icon {
  font-size: 48px;
  margin-bottom: 16px;
}

.industry-info-card h2 {
  font-size: 20px;
  margin-bottom: 12px;
}

.industry-info-card p {
  font-size: 14px;
  color: var(--text-muted);
  max-width: 480px;
  margin: 0 auto;
  line-height: 1.6;
}

.industry-info-card code {
  background: var(--alabaster);
  padding: 1px 6px;
  border-radius: 4px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12px;
  color: var(--brick);
}

/* ═══ MULTI-CLIENT TOGGLE — page Import (Mode 2) ════════════════════ */

.multi-toggle {
  background: var(--warn-bg);
  border: 1px solid var(--warn);
  border-radius: var(--r);
  padding: 12px 16px;
  margin-bottom: 4px;
}

.multi-toggle .checkbox-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--pitch);
}

/* ═══ RESULTS — Mode 2 header ════════════════════════════════════════ */

.res-header-services {
  grid-template-columns: 50px 1fr 100px 1fr 90px 1fr !important;
}


/* Force même design que mode-badge */
#connector-badge-top.tag.pennylane,
#top-badges-wrap .tag.pennylane {
  background: #fffbeb !important;
  border-color: #d97706 !important;
  color: #92400e !important;
  padding: 7px 12px !important;
  border-radius: 10px !important;
  font-size: 12px !important;
  font-weight: 600 !important;
  box-shadow: 0 2px 8px rgba(0,0,0,.08) !important;
}

#connector-badge-top.tag.axonaut,
#top-badges-wrap .tag.axonaut {
  background: #eff6ff !important;
  border-color: #2563eb !important;
  color: #1e40af !important;
  padding: 7px 12px !important;
  border-radius: 10px !important;
  font-size: 12px !important;
  font-weight: 600 !important;
  box-shadow: 0 2px 8px rgba(0,0,0,.08) !important;
}
/* ════════════════════════════════════════════════════════════════════════
   FacturaBot — Styles complémentaires (Progress bar, Modals, Responsive+)
   ════════════════════════════════════════════════════════════════════════ */

/* ═══ PROGRESS BAR — Import SSE ═════════════════════════════════════ */
.import-progress-wrap {
  display: none;
  margin-top: 18px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 22px 24px;
  box-shadow: var(--shadow-sm);
}
.import-progress-wrap.active { display: block; animation: fadeUp .3s ease; }

.prog-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 14px;
}
.prog-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--pitch);
  display: flex;
  align-items: center;
  gap: 8px;
}
.prog-title .prog-spinner {
  width: 14px; height: 14px;
  border: 2px solid var(--brick-light);
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin .7s linear infinite;
  display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

.prog-counts {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 13px;
  color: var(--text-muted);
}
.prog-counts .c-ok  { color: var(--ok); font-weight: 700; }
.prog-counts .c-err { color: var(--brick); font-weight: 700; }

.prog-track {
  width: 100%;
  height: 10px;
  background: var(--alabaster);
  border-radius: 99px;
  overflow: hidden;
  position: relative;
}
.prog-bar-ok {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  background: var(--ok);
  border-radius: 99px;
  width: 0%;
  transition: width .35s cubic-bezier(.4,0,.2,1);
}
.prog-bar-err {
  position: absolute;
  top: 0; bottom: 0;
  background: var(--brick);
  border-radius: 99px;
  width: 0%;
  transition: width .35s cubic-bezier(.4,0,.2,1), left .35s cubic-bezier(.4,0,.2,1);
}
.prog-bar-pending {
  position: absolute;
  top: 0; bottom: 0;
  background: linear-gradient(90deg, var(--walnut-light), var(--brick-light));
  border-radius: 99px;
  opacity: .35;
  width: 0%;
  animation: pulse-bar 1.2s ease-in-out infinite;
  transition: width .35s cubic-bezier(.4,0,.2,1), left .35s cubic-bezier(.4,0,.2,1);
}
@keyframes pulse-bar {
  0%,100% { opacity: .25; }
  50%      { opacity: .55; }
}

.prog-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  font-size: 11px;
  color: var(--text-muted);
  font-family: 'IBM Plex Mono', monospace;
}
.prog-eta {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 6px;
  text-align: right;
  font-family: 'IBM Plex Mono', monospace;
}

.import-progress-wrap.done .prog-spinner { display: none; }
.import-progress-wrap.done .prog-bar-pending { display: none; }

/* ═══ GOOGLE BUTTON ══════════════════════════════════════════════════ */
.btn-google {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; padding: 11px 16px; margin-top: 10px;
  background: #fff; color: #3c4043; font-size: 14px; font-weight: 600;
  border: 1.5px solid #dadce0; border-radius: 8px; cursor: pointer;
  transition: box-shadow .15s, background .15s; font-family: inherit;
  text-decoration: none;
}
.btn-google:hover { box-shadow: 0 2px 8px rgba(0,0,0,.15); background: #f8f9fa; }
.btn-google svg  { flex-shrink: 0; }

.auth-divider {
  display: flex; align-items: center; gap: 10px;
  margin: 14px 0 4px; color: #aaa; font-size: 12px;
}
.auth-divider::before, .auth-divider::after {
  content:''; flex:1; height:1px; background: var(--border, #e5e7eb);
}

.verified-banner {
  background: #d1fae5; border: 1px solid #6ee7b7; color: #065f46;
  border-radius: 8px; padding: 10px 14px; font-size: 13px;
  font-weight: 600; text-align: center; margin-bottom: 14px;
}

/* ═══ VALIDATION MODAL ═══════════════════════════════════════════════ */
.modal-backdrop { position: fixed; inset: 0; background: rgba(20,19,1,.55); backdrop-filter: blur(3px); z-index: 2000; display: flex; align-items: center; justify-content: center; animation: fadeIn .2s ease; }
.modal-backdrop.hidden { display: none; }
@keyframes fadeIn { from { opacity:0 } to { opacity:1 } }
.modal { background: var(--bg-card); border: 1px solid var(--border); border-radius: 14px; width: 92%; max-width: 860px; max-height: 85vh; display: flex; flex-direction: column; box-shadow: var(--shadow-lg); animation: slideUp .25s cubic-bezier(.16,1,.3,1); }
@keyframes slideUp { from { opacity:0; transform:translateY(20px) } to { opacity:1; transform:translateY(0) } }
.modal-header { padding: 20px 24px 16px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; flex-shrink: 0; }
.modal-header h3 { font-size: 16px; font-weight: 800; color: var(--pitch); }
.modal-close { width: 32px; height: 32px; border-radius: 8px; border: 1px solid var(--border); background: transparent; cursor: pointer; font-size: 16px; color: var(--text-muted); display: flex; align-items: center; justify-content: center; transition: all .15s; }
.modal-close:hover { background: var(--err-bg); color: var(--brick); }
.modal-body { padding: 20px 24px; overflow-y: auto; flex: 1; }
.modal-footer { padding: 16px 24px; border-top: 1px solid var(--border); display: flex; gap: 10px; justify-content: flex-end; flex-shrink: 0; }
.modal-alert { padding: 10px 14px; border-radius: 8px; font-size: 13px; margin-bottom: 14px; display: flex; align-items: flex-start; gap: 8px; }
.modal-alert-warn { background: var(--warn-bg); border: 1px solid var(--warn); color: #7a5500; }
.modal-alert-ok   { background: var(--ok-bg);   border: 1px solid var(--ok);   color: var(--ok); }
.val-table { width: 100%; border-collapse: collapse; font-size: 12px; font-family: 'IBM Plex Mono', monospace; }
.val-table th { text-align: left; padding: 7px 10px; font-size: 10px; font-family: 'Bricolage Grotesque', sans-serif; color: var(--text-muted); text-transform: uppercase; font-weight: 700; letter-spacing: .4px; background: var(--alabaster); position: sticky; top: 0; }
.val-table td { padding: 7px 10px; border-top: 1px solid var(--border); }
.val-table tr.row-issue td { background: var(--err-bg); }
.val-table td.cell-missing { color: var(--brick); font-weight: 700; }

/* ═══ RESULTS ACTIONS ════════════════════════════════════════════════ */
.results-actions { display: flex; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; align-items: center; }
.results-actions .res-info { flex: 1; font-size: 13px; color: var(--text-muted); }

/* ═══ COLUMN MAPPING MODAL ═══════════════════════════════════════════ */
.map-row { display: flex; align-items: center; gap: 16px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.map-row:last-child { border-bottom: none; }
.map-label { flex: 0 0 150px; font-size: 13px; font-weight: 600; color: var(--pitch); }
.map-required { color: var(--brick); margin-left: 3px; font-weight: 700; }
.map-select-wrap { flex: 1; }
.map-select { width: 100%; padding: 7px 10px; border: 1px solid var(--border); border-radius: 8px; font-size: 13px; background: var(--bg-card); color: var(--pitch); cursor: pointer; }
.map-select-warn { border-color: var(--warn) !important; background: var(--warn-bg) !important; }
.map-select:focus { outline: none; border-color: var(--brick-light); box-shadow: 0 0 0 3px rgba(180,60,60,.1); }
.map-section-title { font-size: 10px; font-weight: 700; letter-spacing: .5px; text-transform: uppercase; color: var(--text-muted); margin: 16px 0 4px; }

/* ═══ MODE INDICATOR BADGE ═══════════════════════════════════════════ */
.mode-indicator-badge {
  position: static;
  padding: 4px 10px;
  border-radius: 6px;
  background: transparent;
  border: 1px solid var(--border);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: default;
}
.mode-indicator-badge .mode-badge-icon { display: none; }
.mode-indicator-badge .mode-badge-label { display: none; }
.mode-indicator-badge.mode-transport { border-color: rgba(180,60,60,.3); color: var(--brick-dark); }
.mode-indicator-badge.mode-services  { border-color: rgba(37,99,235,.3); color: #1e40af; }

/* ═══ TOPBAR MOBILE ══════════════════════════════════════════════════ */
.mobile-topbar {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 56px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  z-index: 900;
  box-shadow: 0 1px 8px rgba(0,0,0,.06);
}
.mobile-logo { font-family: 'Bricolage Grotesque', sans-serif; font-weight: 900; font-size: 20px; color: var(--pitch); letter-spacing: -.5px; }
.mobile-logo span { color: var(--brick); }

.burger-btn {
  width: 40px; height: 40px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: transparent;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 0;
  transition: background .15s;
}
.burger-btn:hover { background: var(--alabaster); }
.burger-btn span {
  display: block;
  width: 18px; height: 2px;
  background: var(--pitch);
  border-radius: 2px;
  transition: transform .28s cubic-bezier(.16,1,.3,1), opacity .2s, width .2s;
}
.burger-btn.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.burger-btn.open span:nth-child(2) { opacity: 0; width: 0; }
.burger-btn.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ═══ SIDEBAR OVERLAY ════════════════════════════════════════════════ */
.sidebar-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(20,19,1,.45);
  backdrop-filter: blur(3px);
  z-index: 950;
  animation: fadeIn .2s ease;
}
.sidebar-overlay.active { display: block; }

/* ═══ CONNECTOR TOGGLE ═══════════════════════════════════════════════ */
.connector-toggle {
  display: flex; gap: 10px; margin-bottom: 18px;
}
.connector-option { flex: 1; }
.connector-option input[type="radio"] { display: none; }
.connector-btn {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px; border: 2px solid var(--border);
  border-radius: 10px; cursor: pointer; transition: all .18s;
  background: var(--bg-card);
}
.connector-option input:checked + .connector-btn {
  border-color: #2563eb;
  background: #eff6ff;
  box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}
.connector-icon { font-size: 22px; flex-shrink: 0; }
.connector-name { font-weight: 700; font-size: 14px; color: var(--pitch); }
.connector-desc { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

/* Badge connecteur actif dans la sidebar */
.connector-badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11px; font-weight: 600; padding: 2px 8px;
  border-radius: 99px; margin-left: 8px; vertical-align: middle;
}
.connector-badge.pennylane { background: #fef3c7; color: #92400e; }
.connector-badge.axonaut   { background: #dbeafe; color: #1e40af; }

/* Status connexion Axonaut */
.axo-status {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; padding: 8px 12px;
  border-radius: 8px; margin-top: 10px;
}
.axo-status.ok   { background: #d1fae5; color: #065f46; border: 1px solid #6ee7b7; }
.axo-status.err  { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }
.axo-status.idle { background: var(--alabaster); color: var(--text-muted); border: 1px solid var(--border); }

/* ═══ PLAN BADGE sidebar ═════════════════════════════════════════════ */
.plan-badge {
  display: inline-flex; align-items: center;
  font-size: 10px; font-weight: 700;
  padding: 2px 7px; border-radius: 4px; margin-left: auto;
  text-transform: uppercase; letter-spacing: .3px;
  flex-shrink: 0; white-space: nowrap;
}
.plan-badge.free { background: #f3f4f6; color: #6b7280; border: 1px solid #d1d5db; }
.plan-badge.pro  { background: #fef3c7; color: #92400e; border: 1px solid #f59e0b; }

/* ═══ PAGE ABONNEMENT ════════════════════════════════════════════════ */
.pricing-wrap { display: flex; gap: 20px; flex-wrap: wrap; margin-bottom: 24px; }
.pricing-card {
  border: 2px solid var(--border); border-radius: 14px; padding: 28px 24px;
  flex: 1; min-width: 240px; background: var(--bg-card); position: relative; transition: box-shadow .2s;
  text-align: center;
}
.pricing-card.pro-card { border-color: #d97706; }
.pricing-card.active-plan { box-shadow: 0 0 0 3px rgba(245,158,11,.18); }
.pricing-card-badge {
  position: absolute; top: -13px; left: 50%; transform: translateX(-50%);
  background: #d97706; color: #fff; font-size: 11px; font-weight: 800;
  padding: 3px 14px; border-radius: 99px; white-space: nowrap;
}
.pricing-title { font-size: 18px; font-weight: 800; color: var(--pitch); }
.pricing-price { font-size: 34px; font-weight: 900; color: var(--pitch); margin: 10px 0 2px; }
.pricing-price span { font-size: 14px; font-weight: 400; color: var(--text-muted); }
.pricing-features { list-style: none; padding: 0; margin: 14px 0 20px; }
.pricing-features li {
  font-size: 13px; color: var(--text-muted); padding: 6px 0;
  display: flex; align-items: center; justify-content: center; gap: 8px; border-bottom: 1px solid var(--border);
}
.pricing-card .btn:not(.btn-full) { display: block; margin: 0 auto; }
.pricing-features li:last-child { border-bottom: none; }
.pricing-features li .fi { flex-shrink: 0; font-style: normal; min-width: 16px; text-align: center; }
.pricing-features li.feat-ok   .fi::before { content: '✓'; color: #16a34a; font-weight: 700; }
.pricing-features li.feat-lock .fi::before { content: '✗'; color: #dc2626; font-weight: 700; }
.plan-current-banner {
  display: flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 16px;
  background: #f0fdf4; border: 1px solid #86efac; border-radius: 10px;
  font-size: 13px; font-weight: 600; color: #15803d; margin-bottom: 20px;
}
.limit-wrap { margin-bottom: 14px; }
.limit-label { display: flex; justify-content: space-between; font-size: 12px; color: var(--text-muted); margin-bottom: 4px; }
.limit-bar { height: 8px; background: var(--alabaster); border-radius: 99px; overflow: hidden; }
.limit-bar-fill { height: 100%; border-radius: 99px; transition: width .5s; }
.limit-bar-fill.ok     { background: var(--ok); }
.limit-bar-fill.warn   { background: #f59e0b; }
.limit-bar-fill.danger { background: var(--brick); }

/* ═══ SIDEBAR ADAPTIVE HEIGHT ════════════════════════════════════════ */
.sidebar {
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
}
.sidebar > :not(.logo):not(.sidebar-footer) { flex-shrink: 0; }
.sidebar .logo { flex-shrink: 0; }
.sidebar .sidebar-footer {
  flex-shrink: 0;
  margin-top: auto;
  position: sticky;
  bottom: 0;
  background: inherit;
  border-top: 1px solid var(--border);
  padding-top: 8px;
}
.sidebar { overflow-y: auto !important; }
.sidebar-footer { position: sticky !important; bottom: 0 !important; }

/* ═══ RESPONSIVE ÉTENDU ══════════════════════════════════════════════ */
@media (max-width: 768px) {
  .mode-indicator-badge { top: 10px; right: 58px; padding: 5px 9px; font-size: 11px; }

  #burger-btn { display: flex !important; }

  .sidebar {
    position: fixed !important;
    top: 60px !important; left: 0; bottom: 0;
    width: 260px !important;
    transform: translateX(-100%);
    transition: transform .3s cubic-bezier(.16,1,.3,1);
    z-index: 1000;
    box-shadow: none;
  }
  .sidebar.open {
    transform: translateX(0);
    box-shadow: 4px 0 24px rgba(0,0,0,.18);
  }

  .main {
    margin-left: 0 !important;
    margin-top: 60px !important;
    padding: 20px 16px 40px !important;
    width: 100% !important;
    box-sizing: border-box;
  }

  .page { padding: 0 !important; }
  .page h1 { font-size: 22px !important; }

  .stats-grid { grid-template-columns: repeat(2, 1fr) !important; gap: 10px !important; }
  .stat-number { font-size: 28px !important; }

  .row2 { grid-template-columns: 1fr !important; }

  .card { padding: 16px !important; }

  .selector-bar { flex-wrap: wrap !important; gap: 8px !important; }
  .selector-bar select { flex: 1 1 100% !important; min-width: 0; }

  .actions { flex-wrap: wrap !important; gap: 8px !important; }
  .actions .btn { flex: 1 1 calc(50% - 4px) !important; text-align: center !important; justify-content: center !important; }

  .dropzone { padding: 32px 16px !important; }

  .val-table { min-width: 560px; }
  #res-table { overflow-x: auto; }
  .recent-header, .history-header { display: none !important; }
  .recent-row, .history-item {
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 4px !important;
    padding: 12px 14px !important;
  }

  .prog-header { flex-wrap: wrap; gap: 8px; }
  .prog-counts { font-size: 12px; }

  .modal { width: 96% !important; max-height: 88vh !important; }
  .modal-body { padding: 14px 16px !important; overflow-x: auto; }
  .modal-footer { padding: 12px 16px !important; flex-wrap: wrap !important; }

  .map-row { flex-wrap: wrap !important; gap: 6px !important; }
  .map-label { flex: 0 0 100% !important; margin-bottom: 2px; }
  .map-select-wrap { width: 100% !important; }

  .results-actions { flex-direction: column !important; align-items: stretch !important; }
  .results-actions .btn { text-align: center; justify-content: center; }

  .auth-wrapper { flex-direction: column !important; min-height: 100dvh; }
  .auth-brand { padding: 48px 24px 28px !important; text-align: center; }
  .auth-brand .tagline { text-align: center; }
  .auth-form-side { padding: 0 20px 48px !important; display: flex; justify-content: center; }
  .auth-box { width: 100% !important; max-width: 420px !important; }

  .tariff-header { display: none !important; }

  .profile-header { flex-direction: column !important; align-items: center !important; gap: 10px !important; }

  .checkbox-row { flex-wrap: wrap; }

  .pricing-wrap { flex-direction: column; }
}

@media (max-width: 400px) {
  .stats-grid { grid-template-columns: 1fr 1fr !important; gap: 8px !important; }
  .stat-number { font-size: 24px !important; }
  .actions .btn { flex: 1 1 100% !important; }
}

@media (max-height: 620px) {
  .sidebar .logo { padding: 14px 20px !important; font-size: 20px !important; }
  .nav-section   { padding: 10px 20px 4px !important; font-size: 9px !important; }
  .nav-item      { padding: 7px 16px !important; font-size: 13px !important; }
  .user-pill     { padding: 8px 12px !important; }
  .user-avatar   { width: 30px !important; height: 30px !important; font-size: 12px !important; }
}

/* ════════════════════════════════════════════════════════════════════════
   FacturaBot — Classes utilitaires (ex inline styles)
   ════════════════════════════════════════════════════════════════════════ */

/* ── App wrapper ───────────────────────────────────────────────────── */
.app-wrapper { width: 100%; }

/* ── Auth buttons ──────────────────────────────────────────────────── */
.btn-full-mt { width: 100%; margin-top: 8px; }
.btn-full    { width: 100%; }
.btn-mt-sm   { margin-top: 8px; }
.btn-mt-lg   { margin-top: 18px; }
.btn-sm-text { font-size: 13px; }
.btn-xs-nowrap { font-size: 12px; white-space: nowrap; }
.btn-auth-center { display: flex; width: fit-content; margin: 14px auto 0; }

/* ── Header badges ─────────────────────────────────────────────────── */
.badge-sublabel {
  font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .4px; opacity: .7;
}
.badge-static { cursor: default; pointer-events: none; }
.badge-static-pos { position: static; cursor: default; pointer-events: none; }
.pos-relative { position: relative; }
.pill-caret { font-size: 10px; color: var(--text-muted); margin-left: 4px; }

/* ── Burger hidden default ─────────────────────────────────────────── */
.burger-btn-hidden { display: none; margin: 0 8px; flex-shrink: 0; }

/* ── Field helpers ─────────────────────────────────────────────────── */
.field-hint  { color: var(--text-muted); font-size: 11px; }
.field-sm    { margin-bottom: 10px; }
.field-sm-b  { margin-bottom: 14px; }
.field-no-mb { margin-bottom: 0; }
.mb-0        { margin-bottom: 0; }
.mt-1        { margin-top: 8px; }
.mt-2-sm     { margin-top: 10px; }

/* ── Notice / alerts ───────────────────────────────────────────────── */
.notice-axo {
  padding: 10px 14px; background: #eff6ff;
  border: 1px solid #93c5fd; border-radius: 8px;
  font-size: 12px; color: #1e40af;
}
.alert-xs {
  margin-top: 10px;
  font-size: 12px;
  line-height: 1.6;
  word-wrap: break-word;
  overflow-wrap: break-word;
  white-space: normal;
  display: block;
}

/* ── Card descriptions ─────────────────────────────────────────────── */
.card-desc    { font-size: 13px; color: var(--text-muted); margin-bottom: 16px; }
.card-desc-md { font-size: 14px; color: var(--text-muted); margin-bottom: 14px; }

/* ── Spacing utilities with text wrapping ──────────────────────────── */
.mt-2-sm {
  margin-top: 10px;
  line-height: 1.6;
  word-wrap: break-word;
  overflow-wrap: break-word;
  white-space: normal;
  display: block;
}

.mt-1 {
  margin-top: 8px;
  line-height: 1.6;
  word-wrap: break-word;
  overflow-wrap: break-word;
  white-space: normal;
  display: block;
}

/* ── Token / password edit ─────────────────────────────────────────── */
.flex-row-8 { display: flex; gap: 8px; align-items: center; }
.flex-row-test { margin-top: 12px; display: flex; gap: 10px; align-items: center; }
.flex-end-row  { display: flex; gap: 10px; justify-content: flex-end; }
.input-disabled {
  flex: 1; background: var(--alabaster);
  color: var(--text-muted); cursor: not-allowed;
}
.token-actions { margin-top: 8px; display: flex; gap: 8px; align-items: center; }
.token-hint    { font-size: 12px; color: var(--text-muted); }
.pw-change-inner {
  margin-top: 14px; padding: 16px;
  border: 1px solid var(--border); border-radius: 10px;
  background: var(--alabaster);
}
.pw-warning { margin-top: 10px; font-size: 12px; color: var(--text-muted); }

/* ── Section sublabels ─────────────────────────────────────────────── */
.section-sublabel {
  font-size: 12px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .4px; color: var(--text-muted); margin-bottom: 10px;
}
/* Variante légèrement plus grande (dans password form) */
.pw-change-inner .section-sublabel { font-size: 12px; margin-bottom: 12px; }

/* ── Profile header top ────────────────────────────────────────────── */
.profile-header-top { margin-bottom: 0; }

/* ── Stats grid 3 colonnes ─────────────────────────────────────────── */
.stats-grid-3 { grid-template-columns: repeat(3, 1fr); }

/* ── Text helpers ──────────────────────────────────────────────────── */
.text-hint    { color: var(--text-muted); font-weight: 400; }
.text-muted-sm { font-size: 13px; color: var(--text-muted); }
.text-hint-xs { font-size: 11px; color: var(--text-muted); margin-top: 6px; }

/* ── Plan icon ─────────────────────────────────────────────────────── */
.plan-icon { font-size: 20px; }

/* ── Overflow x ────────────────────────────────────────────────────── */
.overflow-x { overflow-x: auto; }

/* ── Howto page ────────────────────────────────────────────────────── */
.info-cards-row { display: flex; gap: 14px; flex-wrap: wrap; }
.mb-info { margin-bottom: 18px; }

.info-card {
  flex: 1; min-width: 200px;
  padding: 14px; border-radius: 10px;
}
.info-card-pennylane { border: 2px solid #d97706; background: #fffbeb; }
.info-card-axonaut   { border: 2px solid #2563eb; background: #eff6ff; }
.info-card-neutral   { border: 1px solid var(--border); background: var(--alabaster); }

.info-card-icon { font-size: 20px; margin-bottom: 6px; }
.info-card-title    { font-weight: 700; }
.info-card-title-pl { color: #92400e; }
.info-card-title-axo { color: #1e40af; }
.info-card-title-sm {
  font-weight: 700; font-size: 13px;
  margin-bottom: 8px; color: var(--pitch);
}
.info-card-desc    { font-size: 13px; margin-top: 6px; }
.info-card-desc-pl { color: #78350f; }
.info-card-desc-axo { color: #1e3a8a; }

.info-card-ol {
  font-size: 13px; color: var(--text-muted);
  padding-left: 18px; line-height: 1.9;
}

.howto-list { font-size: 14px; color: var(--text-muted); padding-left: 20px; line-height: 1.9; }
.howto-ol   { font-size: 14px; color: var(--text-muted); padding-left: 20px; line-height: 2; }
.h2-sub     { font-size: 13px; font-weight: 400; color: var(--text-muted); }

/* ── CSV reference tables ──────────────────────────────────────────── */
.ref-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.tr-head   { background: var(--alabaster); }
.tr-extra  { background: #fffbeb; }
.tr-debours { background: #f0fdf4; }
.th-ref {
  padding: 6px 10px; text-align: left;
  border: 1px solid var(--border);
}
.td-ref { padding: 6px 10px; border: 1px solid var(--border); }

/* ── Legal pages (CGV, Mentions) ───────────────────────────────────── */
#page-cgv .card,
#page-mentions .card { text-align: center; }

#page-cgv .card h2,
#page-mentions .card h2,
#page-howto .card h2 {
  justify-content: center !important;
}
#page-cgv .card h2::before,
#page-mentions .card h2::before,
#page-howto .card h2::before { display: none; }

#page-cgv .legal-table-wrap,
#page-mentions .legal-table-wrap { text-align: left; }

.legal-h3 {
  font-size: 14px; font-weight: 800;
  color: var(--pitch); margin: 20px 0 8px;
}
.legal-p      { font-size: 13px; color: var(--text-muted); line-height: 1.7; }
.legal-p-lg   { line-height: 1.9; }
.legal-date   { font-size: 12px; color: var(--text-muted); margin-bottom: 20px; }
.legal-table-wrap {
  border: 1px solid var(--border); border-radius: 10px;
  overflow: hidden; margin-bottom: 12px;
}
.legal-table  { width: 100%; border-collapse: collapse; font-size: 13px; }
.th-legal {
  padding: 10px 14px; text-align: left; font-weight: 700;
  color: var(--pitch); border-bottom: 1px solid var(--border);
}
.td-legal   { padding: 10px 14px; }
.td-bold    { font-weight: 600; }
.td-muted   { color: var(--text-muted); }

/* ── Modal size variants ───────────────────────────────────────────── */
.modal-sm { max-width: 580px; }
.modal-md { max-width: 620px; }
.modal-footer-col { flex-direction: column; align-items: stretch; gap: 12px; }
.mapping-save-label {
  padding: 10px 14px; background: var(--alabaster);
  border-radius: 8px; border: 1px solid var(--border);
}

/* ── Import clients modal ──────────────────────────────────────────── */
.import-params-box {
  background: var(--alabaster); border: 1px solid var(--border);
  border-radius: 10px; padding: 14px; margin-bottom: 16px;
}
.row2-sm  { gap: 10px; }
.search-row { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.search-input {
  flex: 1; padding: 8px 12px;
  border: 1px solid var(--border); border-radius: 8px; font-size: 13px;
}
.imp-cl-list {
  max-height: 340px; overflow-y: auto;
  border: 1px solid var(--border); border-radius: 10px;
}
.loading-placeholder { text-align: center; padding: 32px; color: var(--text-muted); font-size: 13px; }
.loading-icon { font-size: 24px; margin-bottom: 8px; }
.import-summary { margin-top: 10px; font-size: 13px; color: var(--text-muted); text-align: right; }

/* ════════════════════════════════════════════════════════════════════════
   SVG Icons — système d'icônes professionnel
   ════════════════════════════════════════════════════════════════════════ */

/* Base icon */
.icon {
  width: 16px;
  height: 16px;
  display: inline-block;
  vertical-align: middle;
  flex-shrink: 0;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Tailles */
.icon-xl { width: 40px; height: 40px; stroke-width: 1.5; }
.icon-h2 { width: 18px; height: 18px; margin-right: 2px; flex-shrink: 0;}

/* Nav icon container */
.nav-icon {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.nav-icon .icon { width: 15px; height: 15px; }

/* Dropzone icon */
.dz-icon { font-size: unset; margin-bottom: 16px; display: flex; justify-content: center; }
.dz-icon .icon-xl { color: var(--silver); }

/* Mode icon dans le sélecteur secteur */
.mode-icon {
  font-size: unset;
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.mode-icon .icon { width: 22px; height: 22px; }

/* Industry info icon (page tarifs mode 2) */
.industry-info-icon {
  font-size: unset;
  display: flex; justify-content: center;
  margin-bottom: 16px;
  color: var(--walnut);
}

/* Info card icon (howto) */
.info-card-icon {
  margin-bottom: 8px;
  color: inherit;
  display: flex;
}
.info-card-icon .icon { width: 20px; height: 20px; }
.info-card-pennylane .info-card-icon { color: #92400e; }
.info-card-axonaut .info-card-icon   { color: #1e40af; }

/* Loading icon */
.loading-icon { display: flex; justify-content: center; margin-bottom: 8px; color: var(--silver); }
.loading-icon .icon { width: 24px; height: 24px; animation: spin .8s linear infinite; }

/* Profile dropdown icons */
.profile-dropdown-item .icon { width: 15px; height: 15px; }

/* Mode badge icon */
.mode-badge-icon { display: flex; align-items: center; }
.mode-badge-icon .icon { width: 14px; height: 14px; }

/* Connector dot (remplace 🟡 🔵) */
.connector-dot {
  width: 12px; height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
}
.connector-dot-pl  { background: #d97706; box-shadow: 0 0 0 3px rgba(217,119,6,.15); }
.connector-dot-axo { background: #2563eb; box-shadow: 0 0 0 3px rgba(37,99,235,.15); }

/* Connector badge top icon */
#connector-badge-top-icon .icon { width: 14px; height: 14px; }

/* Buttons : gap cohérent avec SVG */
.btn { gap: 7px; }
.btn .icon { width: 14px; height: 14px; }
.btn-sm .icon { width: 13px; height: 13px; }

/* h2 avec icône */
h2 .icon-h2 { color: var(--brick); }

/* Feat icons dans pricing */
.pricing-features li .fi { display: flex; align-items: center; }

/* Verified banner sans emoji */
.verified-banner::before { content: '✓ '; }

/* ── Header chips (connecteur + mode) ─────────────────────────────── */
.hdr-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  cursor: default;
  pointer-events: none;
  white-space: nowrap;
}

/* Point coloré connecteur */
.chip-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}
.tag.pennylane .chip-dot  { background: #d97706; }
.tag.axonaut  .chip-dot   { background: #2563eb; }

/* Barre de séparation mode */
.chip-bar {
  width: 2px; height: 11px;
  border-radius: 2px;
  background: currentColor;
  opacity: .45;
  flex-shrink: 0;
}

/* Override !important sur les badges header pour annuler les anciens styles */
#connector-badge-top.tag.pennylane,
#top-badges-wrap .tag.pennylane {
  background: transparent !important;
  border-color: rgba(217,119,6,.35) !important;
  color: #92400e !important;
  padding: 4px 10px !important;
  border-radius: 6px !important;
  font-size: 12px !important;
  font-weight: 600 !important;
  box-shadow: none !important;
}
#connector-badge-top.tag.axonaut,
#top-badges-wrap .tag.axonaut {
  background: transparent !important;
  border-color: rgba(37,99,235,.3) !important;
  color: #1e40af !important;
  padding: 4px 10px !important;
  border-radius: 6px !important;
  font-size: 12px !important;
  font-weight: 600 !important;
  box-shadow: none !important;
}

/* ── Plan banner dot (remplace étoile) ────────────────────────────── */
.plan-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #15803d;
  flex-shrink: 0;
}

/* Plan icon : on garde la classe pour compat JS */
.plan-icon { display: none; }

/* ── Badge chips visuels (séparés des spans JS) ───────────────────── */
/* On force display:none sur les spans contrôlés par JS */
#connector-badge-top-icon,
#mode-badge-icon { display: none !important; }

/* Dot coloré (connecteur) */
.chip-dot-vis {
  width: 6px; height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
  background: currentColor;
  opacity: .75;
}

/* Barre verticale (mode) */
.chip-bar-vis {
  width: 2px; height: 11px;
  border-radius: 2px;
  flex-shrink: 0;
  background: currentColor;
  opacity: .4;
}

/* ═══ MODALE ATTENTION AVANT IMPORT ASCII ET CSV ═══════════════════════════════════ */

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(20, 19, 1, 0.42);
  backdrop-filter: blur(2px);
}

.hidden {
  display: none !important;
}

.modal {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.modal-sm {
  max-width: 560px;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 24px;
  background: linear-gradient(180deg, #ffffff 0%, #fcfbfa 100%);
  border-bottom: 1px solid var(--border);
}

.modal-header h3 {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-size: 20px;
  font-weight: 700;
  line-height: 1.2;
}

.modal-header h3::before {
  content: "⚠";
  color: var(--brick);
  font-size: 18px;
  line-height: 1;
}

.modal-close {
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: var(--text-muted);
  font-size: 20px;
  cursor: pointer;
  transition: background .18s ease, color .18s ease;
}

.modal-close:hover {
  background: #f3f1ef;
  color: var(--text);
}

.modal-body {
  padding: 24px;
}

.modal-alert {
  display: block;
  width: 100%;
  margin: 0;
  padding: 18px 20px;
  border-radius: 14px;
  font-size: 15px;
  line-height: 1.7;
  white-space: normal;
  word-break: normal;
}

.modal-alert-warn {
  background: linear-gradient(180deg, #fff8f8 0%, #fdf1f1 100%);
  border: 1px solid rgba(184, 12, 9, 0.14);
  border-left: 4px solid var(--accent);
  color: var(--text);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.modal-alert-warn strong {
  color: var(--brick-dark);
  font-weight: 700;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding: 18px 24px 24px;
  border-top: 1px solid var(--border);
  background: #fcfbfa;
}

.btn {
  appearance: none;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 5px 14px;
  min-height: unset;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: transform .15s ease, background .18s ease, border-color .18s ease, box-shadow .18s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-secondary {
  background: #efebe8;
  border-color: var(--border);
  color: var(--text);
}

.btn-secondary:hover {
  background: #e7e2de;
}

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  box-shadow: 0 6px 18px rgba(184, 12, 9, 0.18);
}

.btn-primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}

@media (max-width: 640px) {
  .modal-backdrop {
    padding: 14px;
  }

  .modal-sm {
    max-width: 100%;
  }

  .modal-header,
  .modal-body,
  .modal-footer {
    padding-left: 16px;
    padding-right: 16px;
  }

  .modal-footer {
    flex-direction: column-reverse;
  }

  .btn {
    width: 100%;
  }
}

/* ═══ IMPORT COMPTABLE — 4 onglets ═══════════════════════════════════ */
.ic-tabbar {
  display: flex;
  gap: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-bottom: none;
  border-radius: var(--r) var(--r) 0 0;
  overflow: hidden;
  margin-bottom: 0;
}
.ic-tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 14px 10px 12px;
  background: transparent;
  border: none;
  border-right: 1px solid var(--border);
  border-bottom: 3px solid transparent;
  cursor: pointer;
  transition: background 180ms, border-color 180ms;
  color: var(--text-muted, #666);
  position: relative;
}
.ic-tab:last-child { border-right: none; }
.ic-tab:hover { background: var(--bg, #f2f1ef); }
.ic-tab.active {
  background: var(--bg, #f2f1ef);
  border-bottom-color: var(--brick);
  color: var(--brick);
}
.ic-tab-connector {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  opacity: .7;
  line-height: 1;
}
.ic-tab.active .ic-tab-connector { opacity: 1; }
.ic-tab-format {
  font-size: 15px;
  font-weight: 700;
  line-height: 1;
}
.ic-tab-badge {
  display: inline-block;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .05em;
  padding: 1px 5px;
  border-radius: 3px;
  background: var(--bg-subtle, #e8e6e3);
  color: var(--text-muted, #666);
  margin-top: 2px;
}
.ic-tab.active .ic-tab-badge {
  background: color-mix(in srgb, var(--brick) 12%, transparent);
  color: var(--brick);
}
.ic-panel {
  border-radius: 0 0 var(--r) var(--r) !important;
  border-top-left-radius: 0 !important;
  border-top-right-radius: 0 !important;
  border-top: 1px solid var(--border);
}
@media (max-width: 540px) {
  .ic-tab { padding: 10px 4px 8px; }
  .ic-tab-format { font-size: 13px; }
  .ic-tab-connector { font-size: 10px; }
}

/* ═══ CONFIG — layout bricks + aperçu facture ════════════════════════ */
.cfg-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: start;
}
.cfg-left {
  padding-right: 24px;
  min-width: 0;
}
.cfg-invoice-preview {
  min-width: 0;
  position: sticky;
  top: 16px;
}
.cfg-preview-label {
  font-size: .75rem;
  font-weight: 600;
  color: var(--text-muted, #888);
  text-transform: uppercase;
  letter-spacing: .04em;
  margin: 0 0 6px;
}
.cfg-invoice-wrap {
  position: relative;
  display: block;
  width: 100%;
  border-radius: 6px 0 0 6px;
  overflow: hidden;
  box-shadow: -4px 0 20px rgba(0,0,0,.12);
}
.cfg-invoice-img {
  display: block;
  width: 100%;
  height: auto;
  user-select: none;
}
/* Overlays de surligange */
.cfg-hl {
  position: absolute;
  left: 0;
  right: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease;
  border-radius: 2px;
}
.cfg-hl.visible { opacity: 1; }
.cfg-hl--debit  { background: rgba(99,  102, 241, .28); border: 2px solid rgba(99,102,241,.6); }
.cfg-hl--green  { background: rgba(22,  163,  74, .22); border: 2px solid rgba(22,163,74,.55); }
.cfg-hl--blue   { background: rgba(14,  165, 233, .22); border: 2px solid rgba(14,165,233,.55); }
.cfg-hl--orange { background: rgba(234, 179,   8, .25); border: 2px solid rgba(234,179,8,.6); }

@media (max-width: 860px) {
  .cfg-layout { grid-template-columns: 1fr; }
  .cfg-left { padding-right: 0; }
  .cfg-invoice-preview { position: static; }
  .cfg-invoice-wrap { border-radius: 6px; box-shadow: 0 2px 10px rgba(0,0,0,.13); }
}

/* Table produits comptables — lignes compactes */
.tbl { width: 100%; border-collapse: collapse; font-size: .85rem; }
.tbl thead th { text-align: left; padding: 5px 8px; font-size: .75rem; font-weight: 600; color: var(--text-muted, #888); text-transform: uppercase; letter-spacing: .03em; border-bottom: 1px solid var(--border); }
.tbl tbody td { padding: 4px 8px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.tbl tbody tr:last-child td { border-bottom: none; }


/* ═══ PARAMÈTRES — contenu centré, largeur réduite ══════════════════ */
#pr-panel-info,
#pr-panel-secteur,
#pr-panel-connecteur,
#pr-panel-securite {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

#pr-panel-info > *,
#pr-panel-secteur > *,
#pr-panel-connecteur > *,
#pr-panel-securite > * {
  width: 100%;
  max-width: 30%;
}

#pr-panel-info .field input,
#pr-panel-securite .field input,
#pr-panel-connecteur .field input,
#pr-panel-connecteur .flex-row-8,
#pr-panel-securite .flex-row-8,
#pr-panel-securite .pw-change-inner {
  max-width: 100%;
}

#pr-panel-securite .field .flex-row-8 {
  flex-direction: column;
  align-items: center;
}

#pr-panel-connecteur .field .flex-row-8 {
  flex-direction: column;
  align-items: center;
}

#pr-panel-info .actions,
#pr-panel-secteur .actions,
#pr-panel-connecteur .actions,
#pr-panel-securite .actions {
  justify-content: center;
}

#pr-panel-secteur .mode-toggle,
#pr-panel-connecteur .connector-toggle {
  flex-direction: column;
}

@media (max-width: 860px) {
  #pr-panel-info > *,
  #pr-panel-secteur > *,
  #pr-panel-connecteur > *,
  #pr-panel-securite > * {
    max-width: 100%;
  }
}

/* === PARAMÈTRES : corrections bricks === */

/* H2 centré sans barre latérale */
#pr-panel-info h2,
#pr-panel-secteur h2,
#pr-panel-connecteur h2,
#pr-panel-securite h2 {
  justify-content: center;
}

#pr-panel-info h2::before,
#pr-panel-secteur h2::before,
#pr-panel-connecteur h2::before,
#pr-panel-securite h2::before {
  display: none;
}

/* Bouton "Tester la connexion" centré */
#pr-panel-connecteur .flex-row-test {
  justify-content: center;
}

/* Bloc "Modifier" mot de passe : contenu dans le panel */
#pr-panel-securite {
  overflow: hidden; /* empêche les enfants de déborder */
  contain: layout;  /* le panel devient le bloc de référence pour les largeurs */
}

#pw-change-form {
  width: 30% !important;
  min-width: 280px !important; /* évite que ça soit trop petit sur mobile */
  box-sizing: border-box;
}

#pw-change-form .pw-change-inner,
#pw-change-form input,
#pw-change-form .flex-row-8,
#pw-change-form .pw-warning {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}


/* ── Colonne Compte Débit ───────────────────────────────────────────────── */
.clients-table th.col-debit { width: 110px; font-size: 11px; }
.client-debit-cell {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--walnut);
  white-space: nowrap;
}
.client-debit-cell .debit-empty {
  color: var(--silver);
  font-weight: 400;
  font-style: italic;
}
@media (max-width: 700px) {
  .clients-table th.col-debit,
  .clients-table td.client-debit-cell { display: none; }
}

/* ── Pagination clients à facturer ─────────────────────────────────────── */
.billing-pagination {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 14px 12px 6px;
  justify-content: center;
  flex-wrap: wrap;
}
.pag-info {
  font-size: 11px;
  color: var(--text-muted);
  font-family: 'IBM Plex Mono', monospace;
  margin-left: auto;
  white-space: nowrap;
}
.pag-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 7px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text);
  cursor: pointer;
  transition: all .15s;
  flex-shrink: 0;
}
.pag-btn:hover:not(.disabled) {
  border-color: var(--walnut);
  color: var(--walnut);
  background: #faf5f0;
}
.pag-btn.disabled { opacity: 0.35; cursor: default; }
.pag-pages {
  display: flex;
  align-items: center;
  gap: 3px;
}
.pag-num {
  min-width: 30px;
  height: 30px;
  padding: 0 6px;
  border-radius: 7px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s;
  font-family: 'IBM Plex Mono', monospace;
}
.pag-num:hover { background: var(--alabaster); color: var(--pitch); }
.pag-num.active {
  background: var(--brick);
  color: #fff;
  border-color: var(--brick);
  box-shadow: 0 2px 6px rgba(184,12,9,.2);
}
.pag-ellipsis {
  font-size: 12px;
  color: var(--silver);
  padding: 0 2px;
  user-select: none;
}
@media (max-width: 480px) {
  .pag-info { margin-left: 0; width: 100%; text-align: center; }
}
