/* ============================================================
   ADrard — Pages Layout + Responsive
   Breakpoints : mobile < 640px | tablet 641-1024px | desktop > 1024px
   ============================================================ */

#app { min-height: 100vh; }
.app-layout { display: flex; min-height: 100vh; background: var(--bg-subtle); }

/* ══════════════════════════════════════════════════════════
   NAVBAR
   ══════════════════════════════════════════════════════════ */
.navbar {
  position: fixed; top: 0; left: 0; right: 0;
  height: var(--navbar-h);
  background: var(--surface-1);
  border-bottom: 1px solid var(--border-1);
  display: flex; align-items: center;
  padding: 0 var(--sp-6); gap: var(--sp-4);
  z-index: var(--z-sticky);
  box-shadow: var(--shadow-xs);
}
.navbar__logo {
  display: flex; align-items: center; gap: var(--sp-2);
  font-size: var(--text-lg); font-weight: var(--w-extrabold);
  color: var(--primary); letter-spacing: -0.04em;
  text-decoration: none !important; flex-shrink: 0;
}
.navbar__spacer  { flex: 1; }
.navbar__actions { display: flex; align-items: center; gap: var(--sp-3); }
.navbar__avatar  {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--primary); color: white;
  display: flex; align-items: center; justify-content: center;
  font-size: var(--text-xs); font-weight: var(--w-bold);
  flex-shrink: 0;
}

/* Burger — visible uniquement sur mobile/tablette */
.navbar__burger {
  display: none;
  width: 36px; height: 36px; border-radius: var(--r-md);
  align-items: center; justify-content: center;
  cursor: pointer; color: var(--text-2); flex-shrink: 0;
  background: transparent; border: none;
  transition: background var(--t-fast), color var(--t-fast);
}
.navbar__burger:hover { background: var(--bg-muted); color: var(--text-1); }
.navbar__burger svg   { width: 18px; height: 18px; }

/* ══════════════════════════════════════════════════════════
   SIDEBAR
   ══════════════════════════════════════════════════════════ */
.sidebar {
  position: fixed; top: var(--navbar-h); left: 0; bottom: 0;
  width: var(--sidebar-w);
  height: calc(100vh - var(--navbar-h)); /* occupe toute la hauteur sous le header */
  background: var(--surface-1);
  border-right: 1px solid var(--border-1);
  display: flex; flex-direction: column;
  overflow-y: auto; overflow-x: hidden;
  z-index: var(--z-sticky);
  padding: var(--sp-3) var(--sp-3) var(--sp-4); /* moins d'espace vide en haut */
  transition: transform var(--t-slow);
}
.sidebar__section  { margin-bottom: var(--sp-5); }
.sidebar__section:first-child { margin-top: 0; }
.sidebar__label    {
  font-size: var(--text-xs); font-weight: var(--w-semibold);
  color: var(--text-3); letter-spacing: .06em; text-transform: uppercase;
  padding: 0 var(--sp-3); margin-bottom: var(--sp-2);
}
.sidebar__item {
  display: flex; align-items: center; gap: var(--sp-3);
  padding: var(--sp-2) var(--sp-3); border-radius: var(--r-md);
  font-size: var(--text-sm); font-weight: var(--w-medium);
  color: var(--text-2); cursor: pointer;
  transition: all var(--t-base); text-decoration: none !important;
}
.sidebar__item:hover                { background: var(--bg-muted); color: var(--text-1); }
.sidebar__item.active               { background: var(--primary-light); color: var(--blue-700); font-weight: var(--w-semibold); }
.sidebar__icon                      { width: 15px; height: 15px; flex-shrink: 0; color: var(--text-3); transition: color var(--t-base); display: inline-flex; align-items: center; }
.sidebar__item:hover .sidebar__icon { color: var(--text-2); }
.sidebar__item.active .sidebar__icon{ color: var(--primary); }
.sidebar__badge                     { margin-left: auto; }
.sidebar__sub                       { padding-left: var(--sp-8); }
.sidebar__sub .sidebar__item        { font-size: 12.5px; }

/* Overlay sidebar mobile */
.sidebar-overlay {
  display: none;
  position: fixed; inset: 0;
  background: var(--bg-overlay);
  z-index: calc(var(--z-sticky) - 1);
}
.sidebar-overlay.visible { display: block; }

/* ══════════════════════════════════════════════════════════
   MAIN CONTENT
   ══════════════════════════════════════════════════════════ */
.main-content {
  margin-left: var(--sidebar-w);
  margin-top: var(--navbar-h);
  flex: 1; min-width: 0;
  padding: var(--sp-8);
  max-width: calc(100vw - var(--sidebar-w));
}
.main-content--full { margin-left: 0; max-width: 100%; }

/* ══════════════════════════════════════════════════════════
   PAGE HEADER
   ══════════════════════════════════════════════════════════ */
.page-header         { margin-bottom: var(--sp-8); }
.page-title          { font-size: var(--text-2xl); font-weight: var(--w-bold); color: var(--text-1); letter-spacing: -0.04em; line-height: 1.2; }
.page-subtitle       { font-size: var(--text-sm); color: var(--text-2); margin-top: var(--sp-1); }
.page-header__actions{ display: flex; align-items: center; gap: var(--sp-3); margin-top: var(--sp-4); flex-wrap: wrap; }

/* ══════════════════════════════════════════════════════════
   AUTH LAYOUT
   ══════════════════════════════════════════════════════════ */
.auth-layout       { display: grid; grid-template-columns: 1fr 1fr; min-height: 100vh; }
.auth-layout__form {
  background: #fafafa;
  display: flex; align-items: center; justify-content: center;
  padding: var(--sp-8); overflow-y: auto;
}

/* Panel sticky */
.auth-layout__panel {
  position: sticky; top: 0; height: 100vh; overflow: hidden;
  background: linear-gradient(160deg,#0d1117 0%,#0f172a 50%,#111827 100%);
  display: flex; flex-direction: column;
}
.auth-layout__panel::before {
  content: ''; position: absolute; inset: 0;
  background-image: radial-gradient(rgba(255,255,255,.05) 1px, transparent 1px);
  background-size: 28px 28px; z-index: 0;
}
.auth-layout__panel::after {
  content: ''; position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 55% 40% at 10% 15%, rgba(208,255,3,.08) 0%, transparent 60%),
    radial-gradient(ellipse 60% 55% at 90% 85%, rgba(37,99,235,.16) 0%, transparent 60%);
  z-index: 0;
}
.auth-layout__panel-content {
  position: relative; z-index: 1; flex: 1; min-height: 0;
  overflow-y: auto; overflow-x: hidden; scrollbar-width: none;
  display: flex; flex-direction: column;
  padding: 2.5rem 2.5rem 2rem; gap: 1.5rem;
}
.auth-layout__panel-content::-webkit-scrollbar { display: none; }

/* Logo */
.auth-panel__logo         { font-size: 1rem; font-weight: 800; color: rgba(255,255,255,.7); letter-spacing: -0.02em; padding-bottom: 0.25rem; }
.auth-panel__logo-accent  { color: #D0FF03; }

/* Headline */
.auth-panel__headline-block { border-left: 3px solid #D0FF03; padding-left: 0.875rem; }
.auth-panel__headline       { font-size: clamp(1.4rem,2.2vw,1.8rem); font-weight: 800; color: white; line-height: 1.2; letter-spacing: -0.04em; }
.auth-panel__headline em    { color: #D0FF03; font-style: normal; }
.auth-panel__sub            { font-size: 0.8rem; color: rgba(255,255,255,.45); margin-top: 0.35rem; line-height: 1.45; }

/* Stats grid */
.auth-panel__stats   { display: grid; grid-template-columns: 1fr 1fr; gap: 0.625rem; }
.auth-panel__stat    { background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.14); border-radius: 10px; padding: 0.75rem 1rem; box-shadow: 0 2px 8px rgba(0,0,0,.25); }
.auth-panel__stat-val{ font-size: 1.45rem; font-weight: 800; color: #D0FF03; letter-spacing: -0.05em; line-height: 1; }
.auth-panel__stat-lbl{ font-size: 10px; color: rgba(255,255,255,.48); margin-top: 3px; line-height: 1.3; font-weight: 500; }

/* Features */
.auth-panel__feats      { display: flex; flex-direction: column; gap: 0.5rem; }
.auth-panel__feat       { display: flex; align-items: center; gap: 0.75rem; padding: 0.5rem 0.75rem; background: rgba(255,255,255,.04); border-radius: 8px; border: 1px solid rgba(255,255,255,.07); }
.auth-panel__feat-icon  { width: 28px; height: 28px; border-radius: 6px; background: rgba(208,255,3,.18); border: 1px solid rgba(208,255,3,.3); display: flex; align-items: center; justify-content: center; flex-shrink: 0; color: #D0FF03; }
.auth-panel__feat-icon svg{ width: 13px; height: 13px; }
.auth-panel__feat-text  { font-size: 0.8rem; color: rgba(255,255,255,.72); font-weight: 500; line-height: 1.35; }

/* Testimonial */
.auth-panel__testimonial       { background: rgba(208,255,3,.06); border: 1px solid rgba(208,255,3,.2); border-left: 3px solid #D0FF03; border-radius: 10px; padding: 0.875rem 1rem; box-shadow: 0 2px 8px rgba(0,0,0,.2); }
.auth-panel__testimonial-text  { font-size: 0.78rem; color: rgba(255,255,255,.8); font-style: italic; line-height: 1.55; margin-bottom: 0.625rem; }
.auth-panel__testimonial-author{ display: flex; align-items: center; gap: 0.5rem; }
.auth-panel__testimonial-avatar{ width: 28px; height: 28px; border-radius: 50%; background: linear-gradient(135deg,#3b82f6,#6366f1); display: flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 700; color: white; flex-shrink: 0; }
.auth-panel__testimonial-meta  { flex: 1; min-width: 0; }
.auth-panel__testimonial-name  { font-size: 11px; font-weight: 700; color: rgba(255,255,255,.85); }
.auth-panel__testimonial-role  { font-size: 10px; color: rgba(255,255,255,.4); margin-top: 1px; }
.auth-panel__testimonial-stars { display: flex; gap: 2px; flex-shrink: 0; }

/* Trust badges */
.auth-panel__badges { display: flex; flex-wrap: wrap; gap: 0.625rem; padding-top: 0.875rem; border-top: 1px solid rgba(255,255,255,.1); margin-top: auto; }
.auth-panel__badge  { display: flex; align-items: center; gap: 4px; font-size: 10px; color: rgba(255,255,255,.4); font-weight: 500; background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.08); border-radius: 20px; padding: 3px 8px; }
.auth-panel__badge svg { width: 11px; height: 11px; color: #D0FF03; flex-shrink: 0; }

/* Auth card */
.auth-card           { width: 100%; max-width: 420px; }
.auth-card__top      { display: flex; align-items: center; justify-content: space-between; margin-bottom: 2.25rem; }
.auth-card__logo     { font-size: 1.05rem; font-weight: 800; color: var(--text-1); letter-spacing: -0.04em; }
.auth-card__logo em  { color: var(--primary); font-style: normal; }
.auth-card__back     { display: inline-flex; align-items: center; gap: 4px; font-size: 0.72rem; color: var(--text-3); text-decoration: none; font-weight: 500; padding: 4px 10px; border-radius: 20px; border: 1px solid var(--border-1); transition: all 0.15s; }
.auth-card__back:hover { color: var(--text-2); border-color: var(--border-2); }
.auth-card__back svg { width: 11px; height: 11px; }
.auth-card__badge    { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 600; color: var(--primary); background: var(--primary-light); border: 1px solid var(--blue-200); border-radius: 20px; padding: 4px 11px; margin-bottom: 1rem; }
.auth-card__badge svg{ width: 11px; height: 11px; }
.auth-card__title    { font-size: clamp(1.5rem,2.5vw,1.9rem); font-weight: 800; color: var(--text-1); letter-spacing: -0.04em; line-height: 1.15; margin-bottom: 5px; }
.auth-card__subtitle { font-size: 0.875rem; color: var(--text-2); margin-bottom: 1.75rem; line-height: 1.45; }
.auth-card__form     { display: flex; flex-direction: column; gap: var(--sp-5); }
.auth-card__footer   { text-align: center; margin-top: 1.5rem; padding-top: 1.5rem; border-top: 1px solid var(--border-1); font-size: 0.875rem; color: var(--text-2); }
.auth-card__footer a { color: var(--primary); font-weight: 600; margin-left: 3px; }
.auth-card__divider  { display: flex; align-items: center; gap: var(--sp-3); color: var(--text-3); font-size: var(--text-xs); margin: var(--sp-2) 0; }
.auth-card__divider::before,
.auth-card__divider::after { content: ''; flex: 1; height: 1px; background: var(--border-1); }

/* ══════════════════════════════════════════════════════════
   DASHBOARD
   ══════════════════════════════════════════════════════════ */
.dashboard-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: var(--sp-5); }
.bp-card        { background: var(--surface-1); border: 1px solid var(--border-1); border-radius: var(--r-lg); padding: var(--sp-5); cursor: pointer; box-shadow: 0 1px 3px rgba(0,0,0,.04), 0 1px 2px -1px rgba(0,0,0,.04); transition: box-shadow .22s ease, border-color .22s ease, transform .22s ease; }
.bp-card:hover  { border-color: #93c5fd; box-shadow: 0 6px 18px rgba(37,99,235,.10); transform: translateY(-2px); }
.bp-card__name  { font-size: var(--text-md); font-weight: var(--w-semibold); color: var(--text-1); letter-spacing: -0.02em; margin-bottom: 2px; }
.bp-card__meta  { font-size: var(--text-xs); color: var(--text-3); }
.bp-card__footer{ display: flex; align-items: center; justify-content: space-between; margin-top: var(--sp-4); padding-top: var(--sp-4); border-top: 1px solid var(--border-1); }

/* ══════════════════════════════════════════════════════════
   STATS
   ══════════════════════════════════════════════════════════ */
.stat-grid         { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: var(--sp-4); }
/* ── Stat cards — shadcn style ── */
.stat-card        { background: var(--surface-1); border: 1px solid var(--border-1); border-radius: var(--r-lg); padding: var(--sp-5); box-shadow: 0 1px 3px rgba(0,0,0,.04), 0 1px 2px -1px rgba(0,0,0,.04); transition: box-shadow .22s ease, border-color .22s ease, transform .22s ease; }
.stat-card:hover  { box-shadow: 0 4px 14px rgba(0,0,0,.08); border-color: #cbd5e1; transform: translateY(-1px); }
.stat-card__label { font-size: var(--text-xs); font-weight: var(--w-semibold); color: var(--text-3); letter-spacing: .05em; text-transform: uppercase; margin-bottom: var(--sp-2); }
.stat-card__value { font-size: var(--text-2xl); font-weight: var(--w-bold); color: var(--text-1); letter-spacing: -0.04em; line-height: 1; }
.stat-card__sub   { font-size: var(--text-xs); color: var(--text-3); margin-top: 4px; }
.stat-card__icon  { display:inline-flex;align-items:center;justify-content:center;width:38px;height:38px;border-radius:10px;flex-shrink:0; }
/* Icônes colorées */
.stat-card__icon--blue   { background:#eff6ff; color:#2563eb; }
.stat-card__icon--amber  { background:#fffbeb; color:#d97706; }
.stat-card__icon--green  { background:#f0fdf4; color:#16a34a; }
.stat-card__icon--purple { background:#faf5ff; color:#7c3aed; }

/* ══════════════════════════════════════════════════════════
   FORMS
   ══════════════════════════════════════════════════════════ */
.form-section { display: flex; flex-direction: column; gap: var(--sp-5); }
.form-row     { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-4); }
.form-row--3  { grid-template-columns: 1fr 1fr 1fr; }
.form-row--4  { grid-template-columns: repeat(4, 1fr); }

/* ══════════════════════════════════════════════════════════
   NAVBAR — utilities
   ══════════════════════════════════════════════════════════ */
/* Bell dropdown: keep inside viewport on mobile */
#navbar-bell-menu { max-width: calc(100vw - 32px); }

@media (max-width: 640px) {
  .hide-mobile { display: none !important; }
}

/* ══════════════════════════════════════════════════════════
   RESPONSIVE — Tablette (≤ 1024px)
   ══════════════════════════════════════════════════════════ */
@media (max-width: 1024px) {
  .navbar__burger { display: inline-flex; }

  .sidebar {
    transform: translateX(-100%);
    top: 0;
    padding-top: calc(var(--navbar-h) + var(--sp-4));
    box-shadow: var(--shadow-xl);
    z-index: calc(var(--z-sticky) + 1);
  }
  .sidebar.open { transform: translateX(0); }

  .main-content {
    margin-left: 0;
    max-width: 100%;
    padding: var(--sp-6);
  }

  .auth-layout { grid-template-columns: 1fr 1.1fr; }

  .dashboard-grid { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }

  .form-row--4 { grid-template-columns: 1fr 1fr; }

  .stat-grid { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
}

/* ══════════════════════════════════════════════════════════
   RESPONSIVE — Tablette portrait (≤ 768px)
   ══════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  .main-content { padding: var(--sp-5); }

  .auth-layout { grid-template-columns: 1fr; }
  .auth-layout__panel { display: none !important; }
  .auth-layout__form  { padding: var(--sp-6) var(--sp-5); align-items: flex-start; padding-top: var(--sp-10); }
  .auth-card { max-width: 100%; }

  .dashboard-grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: var(--sp-4); }

  .form-row--3 { grid-template-columns: 1fr 1fr; }
  .form-row--4 { grid-template-columns: 1fr 1fr; }

  .stat-grid { grid-template-columns: repeat(2, 1fr); }

  .page-title    { font-size: var(--text-xl); }
  .page-header   { margin-bottom: var(--sp-6); }

  .page-header__actions { flex-direction: column; align-items: flex-start; gap: var(--sp-2); }

  /* Tables horizontales */
  .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
}

/* ══════════════════════════════════════════════════════════
   RESPONSIVE — Mobile (≤ 640px)
   ══════════════════════════════════════════════════════════ */
@media (max-width: 640px) {
  .navbar { padding: 0 var(--sp-4); gap: var(--sp-2); }
  .navbar__actions { gap: var(--sp-2); }
  .navbar__actions .btn--outline { display: none; } /* cacher boutons optionnels */
  /* Hide plan badge text label on very small screens, keep icon */
  .navbar__actions > span[style*="letter-spacing"] { display: none; }
  /* Bell dropdown: open left-aligned on mobile */
  #navbar-bell-menu { right: auto !important; left: 0 !important; width: min(360px, calc(100vw - 24px)) !important; }
  /* User dropdown: shrink */
  #navbar-user-menu { width: min(220px, calc(100vw - 24px)) !important; }
  /* hide-mobile: already handles username text */

  .main-content { padding: var(--sp-4); }

  .auth-layout__form { padding: var(--sp-5) var(--sp-4); padding-top: var(--sp-8); }
  .auth-card__top    { margin-bottom: 1.5rem; }

  .form-row,
  .form-row--3,
  .form-row--4 { grid-template-columns: 1fr; }

  .dashboard-grid { grid-template-columns: 1fr; }

  .stat-grid { grid-template-columns: repeat(2, 1fr); gap: var(--sp-3); }
  .stat-card { padding: var(--sp-4); }
  .stat-card__value { font-size: var(--text-xl); }

  .page-title { font-size: var(--text-lg); }
  .page-subtitle { font-size: var(--text-xs); }

  /* Boutons pleine largeur dans les footers de formulaire */
  .form-section > div:last-child { flex-wrap: wrap; }

  /* Tableaux financiers : scroll horizontal obligatoire */
  .table-wrap,
  [style*="overflow-x:auto"],
  [style*="overflow-x: auto"] {
    -webkit-overflow-scrolling: touch;
  }

  /* Cartes projet : réduire padding */
  .produit-card,
  .employe-card,
  .loan-card,
  .invest-card {
    border-radius: var(--r-md) !important;
  }
}

/* ══════════════════════════════════════════════════════════
   RESPONSIVE — Très petit mobile (≤ 380px)
   ══════════════════════════════════════════════════════════ */
@media (max-width: 380px) {
  .main-content { padding: var(--sp-3); }
  .navbar { padding: 0 var(--sp-3); }

  .stat-grid { grid-template-columns: 1fr; }

  .auth-layout__form { padding: var(--sp-4) var(--sp-3); }
}

/* ══════════════════════════════════════════════════════════
   SETTINGS LAYOUT
   ══════════════════════════════════════════════════════════ */
.settings-shell          { display:grid; grid-template-columns:220px 1fr; gap:var(--sp-8); align-items:start; }
.settings-nav            { position:sticky; top:calc(var(--navbar-h) + var(--sp-6)); display:flex; flex-direction:column; gap:2px; }
.settings-nav__title     { font-size:var(--text-xs); font-weight:var(--w-semibold); color:var(--text-3); letter-spacing:.06em; text-transform:uppercase; padding:var(--sp-2) var(--sp-3); margin-bottom:var(--sp-2); }
.settings-nav__item      { display:flex; align-items:center; gap:var(--sp-3); padding:var(--sp-2) var(--sp-3); border-radius:var(--r-md); font-size:var(--text-sm); color:var(--text-2); text-decoration:none; transition:background var(--t-base),color var(--t-base); cursor:pointer; }
.settings-nav__item:hover{ background:var(--bg-muted); color:var(--text-1); }
.settings-nav__item.active{ background:var(--primary-light); color:var(--blue-700,#1d4ed8); font-weight:var(--w-semibold); }
.settings-nav__icon      { display:inline-flex; flex-shrink:0; color:var(--text-3); }
.settings-nav__item.active .settings-nav__icon { color:var(--primary); }
.settings-nav__divider   { height:1px; background:var(--border-1); margin:var(--sp-3) 0; }
/* Invoice cards */
.invoice-card            { background:var(--surface-1); border:1px solid var(--border-1); border-radius:var(--r-lg); padding:var(--sp-4) var(--sp-5); box-shadow:0 1px 3px rgba(0,0,0,.04); transition:box-shadow .2s ease; }
.invoice-card:hover      { box-shadow:0 4px 12px rgba(0,0,0,.07); }
/* Privacy rows */
.privacy-row             { display:flex; align-items:center; justify-content:space-between; padding:var(--sp-3) 0; border-bottom:1px solid var(--border-1); cursor:pointer; transition:color .15s; }
.privacy-row:last-child  { border-bottom:none; }
.privacy-row:hover       { color:var(--primary); }
@media (max-width:900px) {
  .settings-shell        { grid-template-columns:1fr; }
  .settings-nav          { position:static; flex-direction:row; flex-wrap:wrap; gap:var(--sp-1); border-bottom:1px solid var(--border-1); padding-bottom:var(--sp-3); margin-bottom:var(--sp-4); }
  .settings-nav__title   { display:none; }
}

/* ══════════════════════════════════════════════════════════
   SETTINGS PLAN — responsive plan cards
   ══════════════════════════════════════════════════════════ */
@media (max-width: 640px) {
  /* Plan cards: 3-col grid → stack */
  .plan-card-row {
    display: flex !important;
    flex-direction: column !important;
    gap: var(--sp-3) !important;
  }
  .plan-card-row > div:nth-child(2) { text-align: left !important; }
  .plan-card-row > div:nth-child(3) { width: 100%; }
  .plan-card-row > div:nth-child(3) .btn { width: 100%; }
  /* Current sub header */
  [style*="display:flex;align-items:center;justify-content:space-between;gap:var(--sp-4)"] {
    flex-direction: column !important;
    align-items: flex-start !important;
  }
}

/* ══════════════════════════════════════════════════════════
   SETTINGS DOCUMENTATION — responsive doc rows
   ══════════════════════════════════════════════════════════ */
@media (max-width: 640px) {
  /* Doc row: icon + label + actions → stack label/actions */
  .doc-row-inner,
  [style*="display:flex;align-items:center;gap:var(--sp-4)"][style*="padding:var(--sp-4)"] {
    flex-wrap: wrap !important;
  }
  /* Devis table: shrink to scroll */
  [style*="overflow-x:auto"] table,
  .table-wrap table {
    min-width: 520px;
  }
}

/* ══════════════════════════════════════════════════════════
   CABINET — responsive tables & client detail
   ══════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  /* Client detail stats: 4-col → 2-col */
  [style*="grid-template-columns:repeat(4,1fr)"] {
    grid-template-columns: repeat(2, 1fr) !important;
  }
  /* Cabinet action buttons row: wrap */
  [style*="display:flex;gap:var(--sp-3);flex-wrap:wrap"] { flex-wrap: wrap !important; }
}
@media (max-width: 640px) {
  /* Clients list header row */
  [style*="display:flex;align-items:center;justify-content:space-between;margin-bottom:var(--sp-6)"] {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: var(--sp-3) !important;
  }
  /* Client card header → stack */
  [style*="display:flex;align-items:flex-start;justify-content:space-between;flex-wrap:wrap;gap:var(--sp-4)"] {
    flex-direction: column !important;
  }
  /* Cabinet tables → horizontal scroll */
  [style*="overflow-x:auto"][style*="border:1px solid"] {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
  }
  /* InvitationsListView table */
  .invitations-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
}
