/* ================================================================
   DLT RAW — Système de design unifié
   Source unique de vérité — dark-first, thème auto via prefers-color-scheme
   Police : Questrial (Google Fonts)
================================================================ */

/* ----------------------------------------------------------------
   1. RESET
---------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
img { display: block; max-width: 100%; }
button, input, textarea { font-family: inherit; }
ul, ol { list-style: none; }
a { color: inherit; text-decoration: none; }
/* L'attribut hidden doit toujours l'emporter (sinon display:flex des panneaux l'annule) */
[hidden] { display: none !important; }

/* Conteneur d'impression (documents PDF) — caché à l'écran */
#print-doc { display: none; }

/* ----------------------------------------------------------------
   2. TOKENS — Dark (défaut)
---------------------------------------------------------------- */
:root {
  color-scheme: light dark;

  /* Brand */
  --red:        #FF1A0D;
  --red-hover:  #D91409;
  --black:      #080808;
  --white:      #FFFCF9;
  --slate:      #33485B;
  --gray:       #899DA9;

  /* Translucide */
  --red-dim:    rgba(255,26,13,0.12);
  --slate-dim:  rgba(51,72,91,0.35);

  /* Typographie */
  --font:  "Questrial", "Helvetica Neue", Arial, sans-serif;

  /* Rayon */
  --r-sm:   8px;
  --r-md:   12px;
  --r-lg:   16px;
  --r-xl:   20px;
  --r-pill: 100px;

  /* Thème — dark par défaut */
  --app-bg:   #080808;
  --rail-bg:  #0a0a0a;
  --s1:       rgba(255,252,249,0.03);
  --s2:       rgba(255,252,249,0.04);
  --s3:       rgba(255,252,249,0.02);
  --h:        rgba(255,252,249,0.06);
  --hs:       rgba(255,252,249,0.04);
  --hk:       rgba(255,252,249,0.10);
  --hkk:      rgba(255,252,249,0.18);
  --track:    rgba(255,252,249,0.06);
  --t1:       #FFFCF9;
  --t2:       #899DA9;
  --t3:       rgba(137,157,169,0.7);

  --success:     #7DD3A0;
  --success-bg:  rgba(125,211,160,0.12);
  --warning:     #E8C547;
  --warning-bg:  rgba(232,197,71,0.12);
  --danger:      var(--red);
  --danger-bg:   rgba(255,26,13,0.12);
  --neutral-bg:  rgba(137,157,169,0.12);
  --info:        #6BA8E8;
  --info-bg:     rgba(107,168,232,0.14);

  --avatar-grad:  linear-gradient(135deg, #33485B, #1a2530);
  --grain-opacity: 0.03;

  --cta-bg:     #FFFCF9;
  --cta-fg:     #080808;
  --cta-border: rgba(255,252,249,0.18);

  --shadow-card: 0 4px 40px rgba(0,0,0,0.30);
  --ease-expo:   cubic-bezier(0.16, 1, 0.32, 1);

  /* Fond applicatif — halo radial subtil (profondeur « Claude »), tout en restant lisible */
  --app-grad: radial-gradient(100% 70% at 50% -10%, rgba(56,110,165,0.06), rgba(56,110,165,0) 60%), radial-gradient(120% 90% at 50% -5%, #0e0e14 0%, var(--app-bg) 55%);
}

/* ----------------------------------------------------------------
   3. TOKENS — Light (prefers-color-scheme)
---------------------------------------------------------------- */
@media (prefers-color-scheme: light) {
  :root {
    --app-bg:   #F2F3F5;
    --rail-bg:  #FFFCF9;
    --s1:       #FFFFFF;
    --s2:       #FFFCF9;
    --s3:       rgba(8,8,8,0.025);
    --h:        rgba(8,8,8,0.08);
    --hs:       rgba(8,8,8,0.05);
    --hk:       rgba(8,8,8,0.14);
    --hkk:      rgba(8,8,8,0.22);
    --track:    rgba(8,8,8,0.08);
    --t1:       #080808;
    --t2:       #475569;
    --t3:       #64748B;

    --success:     #2F8F5C;
    --success-bg:  rgba(47,143,92,0.10);
    --warning:     #9C7700;
    --warning-bg:  rgba(232,197,71,0.20);
    --danger:      #D91409;
    --danger-bg:   rgba(255,26,13,0.10);
    --neutral-bg:  rgba(8,8,8,0.06);
    --info:        #2563EB;
    --info-bg:     rgba(37,99,235,0.10);

    --avatar-grad:  linear-gradient(135deg, #33485B, #5A6A78);
    --grain-opacity: 0.05;

    --cta-bg:     #080808;
    --cta-fg:     #FFFCF9;
    --cta-border: rgba(8,8,8,0.18);

    --shadow-card: 0 4px 40px rgba(8,8,8,0.05);
    --app-grad: radial-gradient(100% 70% at 50% -10%, rgba(51,95,140,0.05), rgba(51,95,140,0) 60%), radial-gradient(120% 90% at 50% -5%, #FCFCFE 0%, var(--app-bg) 55%);
  }
}

/* ----------------------------------------------------------------
   4. BASE
---------------------------------------------------------------- */
html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--app-bg);
  color: var(--t1);
  font-size: 1rem;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

::selection { background: var(--red); color: var(--white); }

/* ----------------------------------------------------------------
   5. ICÔNES (Lucide)
---------------------------------------------------------------- */
svg[data-lucide] { display: block; flex-shrink: 0; }
.ic    { display: block; flex-shrink: 0; }
.ic-xs { width: 12px; height: 12px; }
.ic-sm { width: 14px; height: 14px; }
.ic-md { width: 16px; height: 16px; }
.ic-lg { width: 18px; height: 18px; }
.ic-xl { width: 20px; height: 20px; }

/* ----------------------------------------------------------------
   6. LAYOUT PRINCIPAL
---------------------------------------------------------------- */
.app-shell {
  display: flex;
  height: 100vh;
  background: var(--app-grad);
  color: var(--t1);
  overflow: hidden;
}

.main-col {
  flex: 1;
  overflow: auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  animation: pageFade 0.2s ease both;
}
@keyframes pageFade { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .main-col { animation: none; } }

/* ----------------------------------------------------------------
   7. SIDEBAR
---------------------------------------------------------------- */
.sidebar {
  width: 248px;
  flex-shrink: 0;
  background: var(--rail-bg);
  border-right: 1px solid var(--h);
  display: flex;
  flex-direction: column;
  height: 100%;
  position: relative;
  transition: transform 0.3s var(--ease-expo);
}

.sidebar-logo {
  padding: 28px 24px 36px;
}

.sidebar-logo img {
  height: 32px;
  display: block;
}

.sidebar-nav {
  padding: 0 12px;
  flex: 1;
}

.sidebar-nav-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--t2);
  padding: 0 12px 12px;
  display: block;
}

.sidebar-nav-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sidebar-nav-item a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  text-decoration: none;
  color: var(--t2);
  font-size: 14px;
  background: transparent;
  position: relative;
  transition: color 0.2s, background 0.2s;
}

.sidebar-nav-item a:hover {
  color: var(--t1);
}

.sidebar-nav-item.is-active a {
  color: var(--t1);
  background: rgba(255,252,249,0.04);
}

@media (prefers-color-scheme: light) {
  .sidebar-nav-item.is-active a {
    background: rgba(8,8,8,0.05);
  }
}

.sidebar-nav-item.is-active a::before {
  content: '';
  position: absolute;
  left: 0;
  top: 10px;
  bottom: 10px;
  width: 2px;
  background: var(--red);
  border-radius: 2px;
}

.sidebar-stats {
  margin: 0 16px 16px;
  padding: 16px 16px 18px;
  border-radius: var(--r-md);
  background: var(--s1);
  border: 1px solid var(--hs);
}

.sidebar-stats-month {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--t2);
  margin-bottom: 12px;
}

.sidebar-stats-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 10px;
  font-size: 12px;
}

.sidebar-stats-lbl { color: var(--t2); }
.sidebar-stats-val { color: var(--t1); font-weight: 700; }
.sidebar-stats-val.red { color: var(--red); }

.sidebar-stats-track {
  margin-top: 14px;
  height: 3px;
  background: var(--track);
  border-radius: 2px;
  overflow: hidden;
}

.sidebar-stats-fill {
  height: 100%;
  background: var(--t1);
  border-radius: 2px;
}

.sidebar-stats-foot {
  margin-top: 8px;
  font-size: 11px;
  color: var(--t2);
  display: flex;
  justify-content: space-between;
}

.sidebar-profile {
  border-top: 1px solid var(--h);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.sidebar-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--avatar-grad);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--white);
  letter-spacing: 0.05em;
  flex-shrink: 0;
}

.sidebar-profile-name {
  font-size: 13px;
  color: var(--t1);
  line-height: 1.2;
}

.sidebar-profile-role {
  font-size: 11px;
  color: var(--t2);
  margin-top: 2px;
}

/* Overlay mobile */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(8,8,8,0.55);
  z-index: 99;
  opacity: 0;
  pointer-events: none;   /* sinon l'overlay (display:block sur mobile) capte tous les clics */
  transition: opacity 0.3s;
}

/* ----------------------------------------------------------------
   8. TOPBAR
---------------------------------------------------------------- */
.page-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 28px 40px 24px;
  border-bottom: 1px solid var(--h);
  flex-shrink: 0;
}

.topbar-meta {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--t2);
  margin-bottom: 8px;
}

.topbar-title {
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
  color: var(--t1);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Breadcrumb topbar (client detail) */
.breadcrumb-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 40px;
  border-bottom: 1px solid var(--h);
  flex-shrink: 0;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
}

.breadcrumb-link { color: var(--t2); cursor: pointer; }
.breadcrumb-sep  { color: var(--t2); display: flex; align-items: center; }
.breadcrumb-cur  { color: var(--t1); }

/* ----------------------------------------------------------------
   9. BOUTONS
---------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--r-pill);
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  border: none;
  transition: opacity 0.2s;
}

.btn:hover { opacity: 0.88; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }

/* Jetons atomiques (TOUTE l'app) : ne jamais couper au milieu sur mobile etroit.
   Boutons, pastilles/tags de statut, codes, et valeurs monetaires/numeriques. */
.btn, .btn-text,
.inv-status-pill, .doc-status, .status-pill, .spill, .cond-pill, .conn-status-pill,
.count-pill, .chip-count, .tag, .filter-chip, .view-btn, .portal-inv-tag,
.invoice-id-code,
.stat-val, .obj-amount, .client-mrr-val, .rev-kpi-val, .pipeline-val,
.mat-total, .mat-val, .modal-total-val, .price-main,
.portal-doc-total-val, .ptr-val, .portal-inv-amt {
  white-space: nowrap;
}

.btn-red {
  background: var(--red);
  color: var(--white);
}

.btn-solid {
  background: var(--t1);
  color: var(--app-bg);
}

.btn-ghost {
  background: transparent;
  color: var(--t2);
  border: 1px solid var(--h);
  font-weight: 400;
}

.btn-ghost-strong {
  background: transparent;
  color: var(--t2);
  border: 1px solid var(--hk);
  font-size: 13px;
  font-weight: 700;
}

.btn-ghost-sm {
  padding: 7px 14px;
  font-size: 12px;
  font-weight: 700;
}

.btn-icon-round {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--s2);
  border: 1px solid var(--h);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  flex-shrink: 0;
  transition: opacity 0.2s;
}

.btn-icon-round:hover { opacity: 0.8; }

.btn-icon-sm {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--s2);
  border: 1px solid var(--h);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}

.btn-text {
  background: transparent;
  border: none;
  color: var(--t2);
  font-family: inherit;
  font-size: 12px;
  cursor: pointer;
  padding: 0;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.btn-text:hover { color: var(--t1); }

.notif-dot {
  position: absolute;
  top: 9px;
  right: 10px;
  width: 6px;
  height: 6px;
  background: var(--red);
  border-radius: 50%;
}

/* Notifications — badge numerote + dropdown (hub) */
.notif-badge {
  position: absolute;
  top: -3px; right: -3px;
  min-width: 16px; height: 16px;
  padding: 0 4px;
  border-radius: 8px;
  background: var(--red);
  color: var(--white);
  font-size: 9px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--app-bg);
}
.notif-panel {
  position: fixed;
  z-index: 300;
  width: 320px; max-width: calc(100vw - 24px);
  max-height: 60vh; overflow: auto;
  background: var(--rail-bg);
  border: 1px solid var(--hk);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-card);
  padding: 6px;
}
.notif-panel-head {
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.15em;
  color: var(--t2); padding: 10px 12px 8px;
}
.notif-item { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: var(--r-sm); }
.notif-item:hover { background: var(--s2); }
.notif-item-dot { width: 6px; height: 6px; border-radius: 50%; margin-top: 6px; flex-shrink: 0; background: var(--warning); }
.notif-item-dot.high { background: var(--red); }
.notif-item-dot.ok { background: var(--success); }
.notif-item-title { font-size: 13px; color: var(--t1); font-weight: 700; letter-spacing: -0.01em; }
.notif-item-sub { font-size: 12px; color: var(--t2); margin-top: 2px; }
.notif-empty { font-size: 13px; color: var(--t2); padding: 14px 12px 18px; }

/* ----------------------------------------------------------------
   10. CHAMP RECHERCHE
---------------------------------------------------------------- */
.search-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  background: var(--s2);
  border: 1px solid var(--h);
  border-radius: var(--r-pill);
  width: 260px;
}

.search-pill input {
  background: transparent;
  border: none;
  outline: none;
  color: var(--t1);
  font-family: inherit;
  font-size: 13px;
  width: 100%;
}

.search-pill input::placeholder { color: var(--t2); }

.search-kbd {
  font-size: 10px;
  color: var(--t2);
  padding: 2px 6px;
  border: 1px solid var(--hk);
  border-radius: 4px;
  white-space: nowrap;
  flex-shrink: 0;
}

/* ----------------------------------------------------------------
   11. BANDEAU STATS (4 colonnes)
---------------------------------------------------------------- */
.stats-band {
  display: flex;
  margin: 32px 40px 0;
  background: var(--s3);
  border: 1px solid var(--h);
  border-radius: var(--r-lg);
  flex-shrink: 0;
}

.stat-cell {
  flex: 1;
  padding: 24px 28px 28px;
  border-right: 1px solid var(--h);
  position: relative;
}

.stat-cell:last-child { border-right: none; }

.stat-lbl {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--t2);
  margin-bottom: 18px;
}

.stat-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.stat-val {
  font-size: 36px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--t1);
  line-height: 1;
}

.stat-val.red { color: var(--red); }

.stat-sub {
  font-size: 14px;
  color: var(--t2);
}

.stat-trend {
  margin-top: 14px;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--t2);
}

.stat-trend.up { color: var(--success); }

/* ----------------------------------------------------------------
   12. CORPS DE PAGE
---------------------------------------------------------------- */
.page-body {
  padding: 32px 40px 48px;
  flex: 1;
}

.page-body-two-col {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 24px;
  padding: 32px 40px 48px;
}

.page-body-padded {
  padding: 28px 40px 48px;
  display: flex;
  flex-direction: column;
  gap: 28px;
  flex: 1;
}

.col-stack {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* ----------------------------------------------------------------
   13. SECTION CARDS
---------------------------------------------------------------- */
.sc {
  background: var(--s3);
  border: 1px solid var(--h);
  border-radius: var(--r-lg);
}

.sc-head {
  padding: 20px 28px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--hs);
}

.sc-head-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.sc-eyebrow {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--t2);
  margin-bottom: 4px;
}

.sc-title {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--t1);
}

.sc-body         { padding: 24px 28px; }
.sc-body-compact { padding: 8px 28px 24px; }
.sc-body-tight   { padding: 4px 28px 16px; }
.sc-body-sm      { padding: 18px 28px 22px; }

/* Card gradient (objectif) */
.sc-gradient {
  background: linear-gradient(180deg, rgba(51,72,91,0.20), rgba(51,72,91,0.05));
  border: 1px solid var(--h);
  border-radius: var(--r-lg);
  padding: 24px 28px 28px;
}

/* ----------------------------------------------------------------
   14. BADGES — COMPTEUR / STATUT
---------------------------------------------------------------- */
.count-pill {
  font-size: 11px;
  padding: 2px 10px;
  border-radius: var(--r-pill);
  letter-spacing: 0.10em;
  text-transform: uppercase;
  display: inline-block;
}

.count-pill.red   { background: var(--danger-bg);  color: var(--red); }
.count-pill.slate { background: var(--neutral-bg); color: var(--t2); }

/* Status pills */
.spill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px 4px 8px;
  border-radius: var(--r-pill);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 700;
}

.spill::before {
  content: '';
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}

.spill-active   { background: var(--success-bg); color: var(--success); }
.spill-prospect { background: var(--danger-bg);  color: var(--red); }
.spill-pause    { background: var(--warning-bg); color: var(--warning); }
.spill-ended    { background: var(--neutral-bg); color: var(--t2); }

/* Status pill (client detail) */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px 5px 10px;
  border-radius: var(--r-pill);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 700;
}

.status-pill::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.status-pill.active   { background: var(--success-bg); color: var(--success); }
.status-pill.prospect { background: var(--danger-bg);  color: var(--red); }
.status-pill.pause    { background: var(--warning-bg); color: var(--warning); }
.status-pill.ended    { background: var(--neutral-bg); color: var(--t2); }

/* Flag pills */
.flag-pill {
  font-size: 9px;
  padding: 2px 8px;
  background: var(--danger-bg);
  color: var(--red);
  border-radius: var(--r-pill);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 700;
  flex-shrink: 0;
  white-space: nowrap;
}

.badge-pill {
  font-size: 9px;
  padding: 2px 8px;
  background: var(--s2);
  color: var(--t2);
  border: 1px solid var(--h);
  border-radius: var(--r-pill);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 700;
  flex-shrink: 0;
  white-space: nowrap;
}

.client-badge {
  font-size: 9px;
  padding: 1px 6px;
  background: var(--neutral-bg);
  color: var(--t2);
  border-radius: var(--r-pill);
  letter-spacing: 0.10em;
  text-transform: uppercase;
  font-weight: 700;
  white-space: nowrap;
}

/* ----------------------------------------------------------------
   15. ALERTES
---------------------------------------------------------------- */
.alert-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 4px;
  border-bottom: 1px solid var(--hs);
}

.alert-row:last-child { border-bottom: none; }

.alert-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--t2);
  flex-shrink: 0;
}

.alert-dot.high {
  background: var(--red);
  box-shadow: 0 0 0 4px var(--danger-bg);
}

.alert-dot.med { background: var(--warning); }
.alert-dot.ok { background: var(--success); }

.alert-meta      { flex: 1; min-width: 0; }
.alert-title     { font-size: 14px; color: var(--t1); line-height: 1.4; }
.alert-sub       { font-size: 12px; color: var(--t2); margin-top: 2px; }

.btn-alert-action {
  background: transparent;
  color: var(--t2);
  border: none;
  font-family: inherit;
  font-size: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 10px;
  border-radius: 6px;
  transition: color 0.2s;
  flex-shrink: 0;
}

.btn-alert-action:hover { color: var(--t1); }

/* ----------------------------------------------------------------
   16. ACTIONS RAPIDES
---------------------------------------------------------------- */
.quick-actions { display: flex; gap: 14px; }

.quick-action {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 16px;
  padding: 22px 24px 24px;
  background: var(--s3);
  border: 1px solid var(--h);
  border-radius: var(--r-lg);
  color: var(--t1);
  font-family: inherit;
  cursor: pointer;
  text-align: left;
  transition: opacity 0.2s;
}

.quick-action:hover { opacity: 0.88; }

.quick-action.accent {
  background: var(--red);
  border: none;
}

.qa-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--danger-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.quick-action.accent .qa-icon { background: rgba(0,0,0,0.18); }

.qa-title { font-size: 15px; font-weight: 700; letter-spacing: -0.01em; }

.qa-desc {
  font-size: 12px;
  color: var(--t2);
  margin-top: 4px;
  line-height: 1.5;
}

.quick-action.accent .qa-desc { color: rgba(255,252,249,0.7); }

/* ----------------------------------------------------------------
   17. SESSIONS / SEMAINE
---------------------------------------------------------------- */
.session-item {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 14px 0;
  border-bottom: 1px solid var(--hs);
}

.session-item:last-child { border-bottom: none; }

.session-day {
  width: 60px;
  flex-shrink: 0;
  font-size: 10px;
  letter-spacing: 0.15em;
  color: var(--t2);
  text-transform: uppercase;
}

.session-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--danger-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.session-title { font-size: 14px; color: var(--t1); line-height: 1.3; }
.session-meta  { font-size: 12px; color: var(--t2); margin-top: 2px; }

/* ----------------------------------------------------------------
   18. ACTIVITÉ RÉCENTE
---------------------------------------------------------------- */
.activity-row {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 12px 0;
  border-bottom: 1px solid var(--hs);
}

.activity-row:last-child { border-bottom: none; }

.activity-time {
  width: 36px;
  font-size: 11px;
  color: var(--t2);
  flex-shrink: 0;
  padding-top: 2px;
}

.activity-dot {
  width: 6px;
  height: 6px;
  margin-top: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--success);
}

.activity-text {
  flex: 1;
  font-size: 13px;
  color: var(--t1);
  line-height: 1.5;
}

.activity-who { color: var(--t2); }

/* ----------------------------------------------------------------
   19. OBJECTIF 90 JOURS
---------------------------------------------------------------- */
.obj-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--t2);
  margin-bottom: 16px;
}

.obj-value {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.obj-amount {
  font-size: 36px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--t1);
}

.obj-target { font-size: 14px; color: var(--t2); }

.obj-track {
  margin-top: 18px;
  height: 6px;
  background: var(--track);
  border-radius: 3px;
  overflow: hidden;
  position: relative;
}

.obj-fill {
  height: 100%;
  background: var(--t1);
  border-radius: 3px;
}

.obj-marker {
  position: absolute;
  top: -3px;
  bottom: -3px;
  width: 2px;
  background: var(--red);
}

.obj-foot {
  margin-top: 12px;
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--t2);
}

.live-dot {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--t2);
}

.live-dot::before {
  content: '';
  width: 6px;
  height: 6px;
  background: var(--success);
  border-radius: 50%;
}

/* ----------------------------------------------------------------
   20. LISTE CLIENTS (TABLE)
---------------------------------------------------------------- */
.filter-bar {
  padding: 20px 40px;
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid var(--h);
  flex-shrink: 0;
}

.filter-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  background: transparent;
  color: var(--t2);
  border: 1px solid var(--h);
  border-radius: var(--r-pill);
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: color 0.2s, background 0.2s, border-color 0.2s;
}

.filter-chip.is-active {
  background: var(--t1);
  color: var(--app-bg);
  border-color: var(--t1);
}

.chip-count {
  font-size: 10px;
  padding: 1px 7px;
  background: var(--s2);
  color: var(--t2);
  border-radius: var(--r-pill);
}

.filter-chip.is-active .chip-count {
  background: rgba(255,252,249,0.18);
  color: var(--white);
}

.filter-sort {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  background: transparent;
  color: var(--t2);
  border: 1px solid var(--h);
  border-radius: var(--r-pill);
  font-family: inherit;
  font-size: 12px;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  margin-left: auto;
}

.ctable-wrap { padding: 16px 40px 48px; }

.ctable-head {
  display: grid;
  grid-template-columns: minmax(260px, 1.4fr) 120px 130px 1fr 120px 40px;
  gap: 16px;
  padding: 12px 16px;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--t2);
}

.ctable-body {
  background: var(--s3);
  border: 1px solid var(--h);
  border-radius: var(--r-lg);
  overflow: hidden;
}

.ctable-row {
  display: grid;
  grid-template-columns: minmax(260px, 1.4fr) 120px 130px 1fr 120px 40px;
  gap: 16px;
  align-items: center;
  padding: 16px;
  border-bottom: 1px solid var(--hs);
  cursor: pointer;
  transition: background 0.2s;
}

.ctable-row:last-child { border-bottom: none; }

.ctable-row:hover { background: rgba(255,252,249,0.02); }

@media (prefers-color-scheme: light) {
  .ctable-row:hover { background: rgba(8,8,8,0.02); }
}

.client-avatar {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--avatar-grad);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--white);
  flex-shrink: 0;
}

.client-name-cell {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.client-name {
  font-size: 14px;
  color: var(--t1);
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.client-meta-sm {
  font-size: 11px;
  color: var(--t2);
  margin-top: 2px;
}

.ctable-next {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.ctable-next-text {
  font-size: 12px;
  color: var(--t2);
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ctable-arrow { display: flex; justify-content: flex-end; }

/* ----------------------------------------------------------------
   21. CALENDRIER
---------------------------------------------------------------- */
.cal-topbar-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.view-switcher {
  display: flex;
  align-items: center;
  gap: 0;
  padding: 4px;
  background: var(--s2);
  border-radius: var(--r-pill);
  border: 1px solid var(--h);
}

.view-btn {
  padding: 6px 14px;
  background: transparent;
  color: var(--t2);
  border: none;
  border-radius: var(--r-pill);
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.view-btn.is-active {
  background: var(--t1);
  color: var(--app-bg);
}

.cal-legend {
  padding: 16px 40px;
  display: flex;
  align-items: center;
  gap: 24px;
  border-bottom: 1px solid var(--h);
  flex-shrink: 0;
  flex-wrap: wrap;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--t2);
}

.legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.legend-sep { flex: 1; }

.cal-container {
  flex: 1;
  padding: 20px 40px 32px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.cal-days-header {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  margin-bottom: 8px;
}

.cal-day-label {
  padding: 8px 12px;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--t2);
}

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  border: 1px solid var(--h);
  border-radius: var(--r-md);
  overflow: hidden;
  background: var(--s3);
  flex: 1;
  min-height: 520px;
}

.cal-cell {
  border-right: 1px solid var(--hs);
  border-bottom: 1px solid var(--hs);
  padding: 8px 10px;
  min-height: 100px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  position: relative;
}

.cal-cell:nth-child(7n)  { border-right: none; }
.cal-cell:nth-last-child(-n+7) { border-bottom: none; }

.cal-cell.other-month { opacity: 0.35; }
.cal-cell.is-today    { background: var(--s1); }

.cal-cell-num {
  font-size: 12px;
  color: var(--t2);
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: 6px;
}

.cal-cell-num.today { color: var(--red); font-weight: 700; }

.cal-today-tag {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.15em;
}

.cal-event {
  padding: 5px 8px;
  border-radius: 4px;
  font-size: 11px;
  color: var(--t1);
  line-height: 1.3;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
}

.cal-event-text {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Evenements passes : attenues pour distinguer passe / futur */
.cal-event.is-past { opacity: 0.45; }

.cal-more {
  font-size: 10px;
  color: var(--t2);
  padding-left: 8px;
}

.evt-shoot    { background: var(--danger-bg);  border-left: 2px solid var(--red); }
.evt-publish  { background: var(--success-bg); border-left: 2px solid var(--success); }
.evt-delivery { background: var(--warning-bg); border-left: 2px solid var(--warning); }
.evt-internal { background: var(--neutral-bg); border-left: 2px solid var(--t2); }

/* Vue Liste / agenda */
.cal-list { padding: 8px 40px 48px; }
.agenda-group { margin-bottom: 26px; }

.agenda-day-lbl {
  font-size: 11px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--t2);
  margin-bottom: 12px;
}
.agenda-day-lbl.today { color: var(--red); font-weight: 700; }

.agenda-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--s3);
  border: 1px solid var(--h);
  border-left: 3px solid var(--t2);
  border-radius: var(--r-md);
  margin-bottom: 8px;
}
.agenda-item.evt-shoot    { border-left-color: var(--red); }
.agenda-item.evt-publish  { border-left-color: var(--success); }
.agenda-item.evt-delivery { border-left-color: var(--warning); }
.agenda-item.evt-internal { border-left-color: var(--t2); }

.agenda-dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; flex-shrink: 0; opacity: 0.55; }
.agenda-item.evt-shoot    .agenda-dot { background: var(--red); }
.agenda-item.evt-publish  .agenda-dot { background: var(--success); }
.agenda-item.evt-delivery .agenda-dot { background: var(--warning); }
.agenda-item.evt-internal .agenda-dot { background: var(--t2); }

.agenda-title { flex: 1; min-width: 0; font-size: 13px; color: var(--t1); }
.agenda-empty { text-align: center; padding: 32px; }

/* ----------------------------------------------------------------
   22. FINANCES — ONGLETS
---------------------------------------------------------------- */
.page-tabs {
  padding: 20px 40px 0;
  display: flex;
  gap: 28px;
  border-bottom: 1px solid var(--h);
  flex-shrink: 0;
}

.page-tab {
  padding: 12px 0 16px;
  background: transparent;
  color: var(--t2);
  border: none;
  font-family: inherit;
  font-size: 13px;
  font-weight: 400;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  letter-spacing: -0.01em;
  transition: color 0.2s;
}

.page-tab.is-active {
  color: var(--t1);
  font-weight: 700;
  border-bottom-color: var(--red);
}

/* ----------------------------------------------------------------
   23. CALCULATEUR PRIX — STEPPER
---------------------------------------------------------------- */
.stepper {
  display: flex;
  align-items: center;
  gap: 18px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--h);
}

.step-connector {
  width: 24px;
  height: 1px;
  background: var(--hk);
  flex-shrink: 0;
}

.step-dot-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
}

.step-dot {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: transparent;
  border: 1px solid var(--hkk);
  color: var(--t2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
}

.step-dot.done   { background: var(--success); border: none; color: var(--app-bg); }
.step-dot.active { background: var(--red);     border: none; color: var(--white); }

.step-lbl-meta {
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--t2);
}

.step-lbl-name {
  font-size: 13px;
  color: var(--t2);
  letter-spacing: -0.01em;
}

.step-dot-wrap.active .step-lbl-name { color: var(--t1); font-weight: 700; }

/* Grille calculateur */
.calc-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 36px;
  padding-top: 26px;
}

.calc-eyebrow {
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--t2);
  margin-bottom: 6px;
}

.calc-heading {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--t1);
  margin: 0 0 6px;
}

.calc-desc {
  font-size: 13px;
  color: var(--t2);
  line-height: 1.6;
  margin-bottom: 28px;
  max-width: 460px;
}

.calc-field {
  display: flex;
  align-items: center;
  padding: 16px 0;
  border-bottom: 1px solid var(--hs);
  gap: 20px;
}

.calc-field:last-of-type { border-bottom: none; }

.calc-field-info { flex: 1; }
.calc-field-lbl  { font-size: 12px; color: var(--t2); margin-bottom: 4px; }
.calc-field-val  { font-size: 14px; color: var(--t1); }
.calc-field-hint { font-size: 11px; color: var(--t3); margin-top: 4px; }

.btn-modify {
  background: transparent;
  border: 1px solid var(--h);
  color: var(--t2);
  padding: 6px 12px;
  border-radius: var(--r-pill);
  font-family: inherit;
  font-size: 11px;
  cursor: pointer;
  flex-shrink: 0;
}

.calc-actions {
  display: flex;
  gap: 12px;
  margin-top: 28px;
}

/* Panneaux d'étape du calculateur (rendus par js/calc.js) */
.calc-step-panel { display: none; }
.calc-step-panel.is-active { display: block; }

#calc-nav { justify-content: space-between; align-items: center; }

/* Préréglages rapides */
.calc-presets {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 22px;
}

.calc-presets-lbl {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--t2);
  margin-right: 4px;
}

.calc-preset {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 13px;
  background: var(--s2);
  border: 1px solid var(--h);
  border-radius: var(--r-pill);
  color: var(--t1);
  font-family: inherit;
  font-size: 12px;
  cursor: pointer;
  transition: border-color 0.2s;
}

.calc-preset:hover { border-color: var(--hk); }
.calc-preset-last { border-color: var(--hk); color: var(--t2); }

/* Taux horaire effectif */
.price-rate {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 14px;
  margin-bottom: 18px;
  border-radius: var(--r-sm);
  background: var(--s3);
  font-size: 12px;
  color: var(--t2);
}

.price-rate-val { font-size: 14px; font-weight: 700; }
.price-rate-good .price-rate-val { color: var(--success); }
.price-rate-ok   .price-rate-val { color: var(--warning); }
.price-rate-low  .price-rate-val { color: var(--red); }

/* ── Factures : actions de ligne ───────────────────────────── */
.invoice-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 16px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--hs);
}

.btn-text.danger { color: var(--red); }
.btn-text.danger:hover { color: var(--red-hover); }

.invoice-row { cursor: pointer; }

/* ── Modal facture : lignes de service ─────────────────────── */
.line-row {
  display: grid;
  grid-template-columns: 1fr 64px 96px 80px 28px;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.line-row .form-input { padding: 8px 10px; font-size: 13px; }
.line-total { font-size: 13px; font-weight: 700; color: var(--t1); text-align: right; }
.add-line-btn { margin-top: 8px; }

/* Ligne de service simple (proposition / contrat) : desc + prix + suppr, détails dessous */
.line-row-2 {
  display: grid;
  grid-template-columns: 1fr 110px 28px;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.line-row-2 .l-details { grid-column: 1 / -1; }
.line-row-2 .form-input { padding: 8px 10px; font-size: 13px; }

/* Méta + statut des documents (propositions / contrats) */
.doc-meta {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin-top: 8px;
  font-size: 13px;
}

.doc-status {
  font-size: 10px;
  padding: 3px 10px;
  border-radius: var(--r-pill);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 700;
}
.doc-draft   { background: var(--neutral-bg); color: var(--t2); }
.doc-pending { background: var(--warning-bg); color: var(--warning); }
.doc-ok      { background: var(--success-bg); color: var(--success); }
.doc-bad     { background: var(--danger-bg);  color: var(--red); }
.doc-sent    { background: var(--info-bg);    color: var(--info); }

/* Bloc proposition — fiche client */
.prop-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--t1);
  margin-bottom: 4px;
}
.prop-title.prop-empty {
  font-size: 13px;
  font-weight: 400;
  color: var(--t3);
  margin-bottom: 0;
}
.prop-desc {
  font-size: 13px;
  color: var(--t2);
  line-height: 1.5;
  margin-bottom: 10px;
}
.prop-validite {
  font-size: 11px;
  color: var(--t3);
  margin-bottom: 14px;
}
.prop-desc:empty,
.prop-validite:empty { margin-bottom: 0; }

.doc-statut-select {
  background: var(--s2);
  border: 1px solid var(--h);
  border-radius: var(--r-pill);
  color: var(--t1);
  font-family: inherit;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  padding: 4px 10px;
  cursor: pointer;
}
/* Le select EST l'indicateur de statut (couleur par statut) — clic = modifier, plus de badge separe */
.doc-statut-select.doc-draft   { background: var(--neutral-bg); color: var(--t2);      border-color: transparent; }
.doc-statut-select.doc-pending { background: var(--warning-bg); color: var(--warning); border-color: transparent; }
.doc-statut-select.doc-ok      { background: var(--success-bg); color: var(--success); border-color: transparent; }
.doc-statut-select.doc-bad     { background: var(--danger-bg);  color: var(--red);     border-color: transparent; }
.doc-statut-select.doc-sent    { background: var(--info-bg);    color: var(--info);     border-color: transparent; }

/* Clauses (éditeur contrat) : case + description sur 2 lignes */
.check-item-2 { align-items: flex-start; }
.check-item-2 > span { display: flex; flex-direction: column; gap: 2px; }
.ci-name { font-size: 13px; color: var(--t1); font-weight: 700; }
.ci-desc { font-size: 11px; color: var(--t2); }

/* Licences avec durée (éditeur contrat) */
.lic-grid { display: grid; grid-template-columns: 1fr; gap: 10px; }
.lic-row { display: flex; align-items: center; gap: 10px; }
.lic-row .check-item { flex: 1; min-width: 0; }
.lic-row .lic-dur { width: 150px; flex-shrink: 0; padding: 8px 10px; font-size: 12px; }

.acompte-toggle { max-width: 280px; }
.acompte-box { margin-top: 10px; }
.acompte-lbl { font-size: 13px; color: var(--t2); }
.acompte-pct { max-width: 90px; }

.modal-total-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 16px;
  margin-top: 4px;
  border-top: 1px solid var(--h);
  font-size: 13px;
  color: var(--t2);
}

.modal-total-val { font-size: 20px; font-weight: 700; color: var(--t1); }

/* ── Fiche client : blocs dynamiques ───────────────────────── */
.card-empty { font-size: 13px; color: var(--t2); padding: 8px 0; }
.client-block-title { font-size: 14px; letter-spacing: -0.01em; margin-bottom: 6px; }
.client-block-sub { font-size: 12px; line-height: 1.6; margin-bottom: 16px; }
.client-block-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 14px;
  border-top: 1px solid var(--hs);
  font-size: 13px;
}

/* ── Menu popover (⋯) ──────────────────────────────────────── */
.popover-menu {
  position: fixed;
  z-index: 210;
  min-width: 200px;
  padding: 6px;
  background: var(--rail-bg);
  border: 1px solid var(--hk);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-card);
}

.popover-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  background: transparent;
  border: none;
  border-radius: var(--r-sm);
  color: var(--t1);
  font-family: inherit;
  font-size: 13px;
  text-align: left;
  cursor: pointer;
}

.popover-item:hover { background: var(--s2); }
.popover-item.danger { color: var(--red); }

/* Carte d'action proposée par l'agent IA */
.agent-action { border: 1px solid var(--red); background: var(--red-dim); }
.agent-action-title { display: flex; align-items: center; gap: 6px; font-size: 11px; text-transform: uppercase; letter-spacing: 0.12em; color: var(--red); font-weight: 700; margin-bottom: 6px; }
.agent-action-desc { font-size: 13px; color: var(--t1); line-height: 1.5; margin-bottom: 12px; }
.agent-action-btns { display: flex; gap: 8px; justify-content: flex-end; align-items: center; }

/* Utilitaire */
.is-hidden { display: none !important; }

@media (max-width: 560px) {
  .line-row { grid-template-columns: 1fr 52px 80px 28px; }
  .line-row .line-total { display: none; }
  .line-total { display: none; }
}

/* Carte de prix */
.price-card {
  background: var(--s1);
  border: 1px solid var(--h);
  border-radius: var(--r-lg);
  padding: 28px 28px 24px;
  align-self: start;
}

.price-card-eyebrow {
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--t2);
  margin-bottom: 18px;
}

.price-range-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 8px;
}

.price-range-vals { margin-bottom: 18px; }

.price-label-sm { font-size: 11px; color: var(--t2); }
.price-label-md { font-size: 12px; color: var(--t1); font-weight: 700; }
.price-sub-sm   { font-size: 6px; color: var(--t2); }

.price-main {
  font-size: 36px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--t1);
}

.breakdown-lbl {
  font-size: 11px;
  color: var(--t2);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  margin-bottom: 10px;
}

.breakdown-row {
  display: flex;
  justify-content: space-between;
  padding: 9px 0;
  border-bottom: 1px solid var(--hs);
  font-size: 12px;
}

.breakdown-row:last-child { border-bottom: none; }

.price-note {
  margin-top: 16px;
  padding: 10px 14px;
  background: var(--s3);
  border-radius: 10px;
  font-size: 11px;
  color: var(--t2);
  line-height: 1.5;
}

/* Graphique revenus */
.global-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 20px;
}

.rev-chart-meta {
  display: flex;
  gap: 18px;
  justify-content: flex-end;
}

.rev-kpi-lbl {
  font-size: 10px;
  color: var(--t2);
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.rev-kpi-val {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--t1);
}

.chart-area {
  position: relative;
  height: 220px;
  display: flex;
  align-items: flex-end;
  gap: 18px;
  padding: 0 4px;
}

.chart-goal-line {
  position: absolute;
  left: 0;
  right: 0;
  border-top: 1px dashed var(--hk);
}

.chart-goal-lbl {
  position: absolute;
  right: 0;
  top: -18px;
  font-size: 10px;
  color: var(--t2);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  white-space: nowrap;
}

.chart-bar-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  height: 100%;
  justify-content: flex-end;
}

.chart-bar-wrap {
  width: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  height: calc(100% - 22px);
  position: relative;
}

.chart-bar {
  width: 70%;
  border-radius: 6px 6px 0 0;
  background: var(--t1);
  position: relative;
}

.chart-bar.current  { background: var(--red); }
.chart-bar.projected {
  width: 70%;
  background: repeating-linear-gradient(
    45deg, var(--hs), var(--hs) 4px, transparent 4px, transparent 8px
  );
  border: 1px dashed var(--hk);
  border-radius: 6px 6px 0 0;
}

.chart-bar-val {
  position: absolute;
  left: 50%;
  top: -22px;
  transform: translateX(-50%);
  font-size: 11px;
  font-weight: 700;
  color: var(--red);
  white-space: nowrap;
}

.chart-month-lbl {
  font-size: 11px;
  color: var(--t2);
  letter-spacing: 0.10em;
  text-transform: uppercase;
}

.chart-month-lbl.current { color: var(--t1); font-weight: 700; }

/* Pipeline */
.pipeline-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--hs);
}

.pipeline-row:last-child { border-bottom: none; }
.pipeline-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.pipeline-label { font-size: 13px; color: var(--t1); }
.pipeline-count { font-size: 11px; color: var(--t2); margin-top: 2px; }
.pipeline-val   { font-size: 15px; font-weight: 700; letter-spacing: -0.01em; color: var(--t1); }

/* ----------------------------------------------------------------
   24. FICHE CLIENT
---------------------------------------------------------------- */
.client-header {
  padding: 32px 40px 28px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 32px;
  border-bottom: 1px solid var(--h);
  flex-shrink: 0;
  flex-wrap: wrap;
}

.client-header-left   { display: flex; gap: 20px; align-items: center; }

.client-hero-avatar {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  background: var(--avatar-grad);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 700;
  color: var(--white);
  flex-shrink: 0;
}

.client-header-tags {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.client-header-kind {
  font-size: 11px;
  color: var(--t2);
  text-transform: uppercase;
  letter-spacing: 0.15em;
}

.client-hero-name {
  font-size: 34px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
  color: var(--t1);
}

.client-hero-desc {
  margin-top: 8px;
  font-size: 13px;
  color: var(--t2);
}

.client-header-right {
  display: flex;
  align-items: center;
  gap: 24px;
}

.client-mrr        { text-align: right; }
.client-mrr-lbl    { font-size: 10px; text-transform: uppercase; letter-spacing: 0.18em; color: var(--t2); margin-bottom: 6px; }
.client-mrr-val    { font-size: 28px; font-weight: 700; letter-spacing: -0.02em; color: var(--t1); }
.client-mrr-sub    { font-size: 11px; color: var(--t2); margin-top: 4px; }

.client-body {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 24px;
  padding: 28px 40px 48px;
  overflow: auto;
  flex: 1;
}

.client-rail { display: flex; flex-direction: column; gap: 20px; }
.client-main { display: flex; flex-direction: column; gap: 20px; }

/* Infos contact */
.info-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 11px 0;
  border-bottom: 1px solid var(--hs);
}

.info-row:last-child { border-bottom: none; }
.info-row-lbl { font-size: 12px; color: var(--t2); width: 80px; flex-shrink: 0; }
.info-row-val { flex: 1; font-size: 13px; color: var(--t1); }

/* Factures (client detail) */
.invoice-row {
  padding: 16px 0;
  border-bottom: 1px solid var(--hs);
}

.invoice-row:last-child { border-bottom: none; }

/* Listes de documents (onglets Finances) — chaque item devient une carte distincte */
#all-invoices .invoice-row,
#all-props .invoice-row,
#all-contrats .invoice-row {
  padding: 16px 18px;
  margin-bottom: 10px;
  border: 1px solid var(--h);
  border-radius: var(--r-md);
  background: var(--s1);
  transition: border-color 0.2s, background 0.2s;
}
#all-invoices .invoice-row:hover,
#all-props .invoice-row:hover,
#all-contrats .invoice-row:hover { border-color: var(--hk); background: var(--s2); }
#all-invoices .invoice-row:last-child,
#all-props .invoice-row:last-child,
#all-contrats .invoice-row:last-child { margin-bottom: 0; }

.invoice-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.invoice-id-code {
  font-size: 12px;
  color: var(--t2);
  font-family: monospace;
}

.invoice-lbl { font-size: 13px; color: var(--t1); }

.inv-status-pill {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  padding: 3px 10px;
  border-radius: var(--r-pill);
  font-weight: 700;
}

.inv-pending { background: var(--neutral-bg); color: var(--t2); }
.inv-deposit { background: var(--warning-bg); color: var(--warning); }
.inv-paid    { background: var(--success-bg); color: var(--success); }
.inv-overdue { background: var(--danger-bg);  color: var(--red); }

.invoice-progress {
  display: flex;
  align-items: center;
  gap: 18px;
}

.invoice-track {
  flex: 1;
  height: 4px;
  background: var(--track);
  border-radius: 2px;
  overflow: hidden;
}

.invoice-fill   { height: 100%; border-radius: 2px; }
.fill-paid      { background: var(--success); }
.fill-overdue   { background: var(--red); }
.fill-default   { background: var(--t1); }

.invoice-amounts {
  display: flex;
  gap: 6px;
  font-size: 12px;
  color: var(--t2);
  white-space: nowrap;
}

.invoice-due {
  font-size: 11px;
  color: var(--t2);
  width: 80px;
  text-align: right;
  flex-shrink: 0;
}

/* Étapes projet */
.proj-step {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 0;
}

.proj-step-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1.5px solid var(--hkk);
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.proj-step-dot.done    { background: var(--success); border-color: var(--success); }
.proj-step-dot.current { border-color: var(--red); }
.proj-step-dot-inner   { width: 6px; height: 6px; border-radius: 50%; background: var(--red); }

.proj-step-lbl      { flex: 1; font-size: 13px; color: var(--t1); }
.proj-step-lbl.done { color: var(--t2); text-decoration: line-through; }
.proj-step-date     { font-size: 11px; color: var(--t2); }
.proj-step-date.current { color: var(--red); }

.proj-progress-bar {
  margin-top: 14px;
  height: 3px;
  background: var(--track);
  border-radius: 2px;
  overflow: hidden;
}

.proj-progress-fill { height: 100%; background: var(--red); border-radius: 2px; }

/* Calendrier liste (fiche client) */
.event-list-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 0;
  border-bottom: 1px solid var(--hs);
}

.event-list-item:last-child { border-bottom: none; }

.event-date       { width: 42px; flex-shrink: 0; text-align: center; }
.event-date-day   { font-size: 18px; font-weight: 700; letter-spacing: -0.02em; line-height: 1; color: var(--t1); }
.event-date-month { font-size: 9px; color: var(--t2); letter-spacing: 0.15em; margin-top: 2px; }
.event-info       { flex: 1; min-width: 0; }
.event-title-row  { font-size: 13px; color: var(--t1); display: flex; align-items: center; gap: 8px; }
.event-sub-txt    { font-size: 11px; color: var(--t2); margin-top: 2px; }

/* ----------------------------------------------------------------
   25. STUDIO
---------------------------------------------------------------- */
/* Agent chat */
.agent-chat {
  background: var(--rail-bg);
  border: 1px solid var(--hs);
  border-radius: var(--r-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  height: 620px;
}

.agent-chat-head {
  padding: 20px 24px;
  border-bottom: 1px solid var(--h);
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--s3);
}

.agent-avt {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--red);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.05em;
  flex-shrink: 0;
}

.agent-name {
  font-size: 14px;
  color: var(--t1);
  font-weight: 700;
  letter-spacing: -0.01em;
}

.agent-status {
  font-size: 11px;
  color: var(--t2);
  margin-top: 2px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.agent-status-dot {
  width: 5px;
  height: 5px;
  background: var(--success);
  border-radius: 50%;
  flex-shrink: 0;
}

.agent-messages {
  flex: 1;
  overflow: auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.msg-row      { display: flex; }
.msg-row.user { justify-content: flex-end; }

.msg-bubble {
  max-width: 78%;
  padding: 14px 16px;
  border-radius: 18px 18px 18px 4px;
  background: var(--s2);
  border: 1px solid var(--h);
  color: var(--t1);
  font-size: 13px;
  line-height: 1.6;
  white-space: pre-wrap;
}

.msg-row.user .msg-bubble {
  border-radius: 18px 18px 4px 18px;
  background: var(--red);
  color: var(--white);
  border-color: transparent;
}

.agent-input-area {
  padding: 16px;
  border-top: 1px solid var(--h);
  background: var(--s3);
}

.agent-input-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--s2);
  border: 1px solid var(--hk);
  border-radius: var(--r-pill);
}

.agent-input-pill input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--t1);
  font-family: inherit;
  font-size: 13px;
}

.agent-input-pill input::placeholder { color: var(--t3); }

.agent-send {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--red);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}

.agent-prompts {
  margin-top: 10px;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.agent-prompt-chip {
  padding: 5px 12px;
  background: transparent;
  color: var(--t2);
  border: 1px solid var(--hk);
  border-radius: var(--r-pill);
  font-family: inherit;
  font-size: 11px;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
}

.agent-prompt-chip:hover { color: var(--t1); border-color: var(--hkk); }

/* Tableau matériel */
.mat-head {
  display: grid;
  grid-template-columns: minmax(280px, 2fr) 1fr 1fr 110px 110px 72px;
  gap: 16px;
  padding: 12px 16px;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--t2);
}

.mat-body {
  background: var(--s3);
  border: 1px solid var(--h);
  border-radius: var(--r-lg);
  overflow: hidden;
}

.mat-row {
  display: grid;
  grid-template-columns: minmax(280px, 2fr) 1fr 1fr 110px 110px 72px;
  gap: 16px;
  align-items: center;
  padding: 14px 16px;
  border-bottom: 1px solid var(--hs);
}

.mat-row:last-child { border-bottom: none; }

.mat-item-cell {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.mat-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--s2);
  border: 1px solid var(--h);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.mat-name {
  font-size: 13px;
  color: var(--t1);
  font-weight: 700;
  letter-spacing: -0.01em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mat-sn   { font-size: 12px; color: var(--t2); font-family: monospace; }
.mat-date { font-size: 12px; color: var(--t2); }

.cond-pill {
  font-size: 10px;
  padding: 3px 10px;
  border-radius: var(--r-pill);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 700;
  display: inline-block;
}

.cond-excellent { background: var(--success-bg); color: var(--success); }
.cond-bon       { background: var(--neutral-bg); color: var(--t2); }

.mat-val    { text-align: right; font-size: 13px; color: var(--t1); }
.mat-action { display: flex; justify-content: flex-end; gap: 8px; }
.mat-cat    { font-size: 11px; }
.mat-add-row { display: flex; justify-content: flex-end; }
.mat-empty   { padding: 24px 16px; }

.mat-footer {
  margin-top: 14px;
  display: flex;
  justify-content: flex-end;
  gap: 24px;
  padding: 0 16px;
  font-size: 12px;
  color: var(--t2);
}

.mat-total {
  color: var(--t1);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: -0.01em;
}

/* Paramètres & connexions */
.settings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.settings-row {
  display: flex;
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid var(--hs);
}

.settings-row:last-child { border-bottom: none; }
.settings-lbl  { width: 130px; font-size: 12px; color: var(--t2); flex-shrink: 0; }
.settings-val  { flex: 1; min-width: 0; font-size: 13px; color: var(--t1); text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Libellé de section dans un modal de formulaire */
.form-section-lbl {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--t2);
  margin: 22px 0 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--h);
}
.form-section-lbl:first-child { margin-top: 0; }

.conn-row {
  display: flex;
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid var(--hs);
  gap: 14px;
}

.conn-row:last-child { border-bottom: none; }

.conn-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--s2);
  border: 1px solid var(--h);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.conn-name { font-size: 13px; color: var(--t1); }
.conn-sub  { font-size: 11px; color: var(--t2); margin-top: 2px; }

.conn-status-pill {
  font-size: 10px;
  padding: 3px 10px;
  border-radius: var(--r-pill);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 700;
  white-space: nowrap;
}

.conn-done { background: var(--success-bg); color: var(--success); }
.conn-warn { background: var(--warning-bg); color: var(--warning); }
.conn-off  { background: var(--neutral-bg); color: var(--t2); }

/* ----------------------------------------------------------------
   26. PORTAIL CLIENT — document à signer (design « Revue »)
   Carte premium sur halos 3D, rituel de signature, état ambre → vert.
   Tokens propres au portail + alias vers le système de l'app.
---------------------------------------------------------------- */
.portal-root {
  /* alias vers les tokens de l'app (le portail reprend les noms du design) */
  --text-1: var(--t1);
  --text-2: var(--t2);
  --text-3: var(--t3);
  --hairline: var(--h);
  --hairline-soft: var(--hs);
  --hairline-strong: var(--hk);
  --hairline-stronger: var(--hkk);
  --ease-out-expo: var(--ease-expo);
  --accent: var(--red);

  /* tokens propres au portail — dark */
  --portal-card-bg: linear-gradient(180deg, rgba(20,20,23,0.85) 0%, rgba(13,13,16,0.90) 100%);
  --portal-card-border: rgba(255,252,249,0.08);
  --portal-card-shadow: 0 1px 0 rgba(255,252,249,0.04) inset, 0 30px 90px -20px rgba(0,0,0,0.75), 0 8px 30px -12px rgba(0,0,0,0.6);
  --portal-inset-bg: rgba(255,252,249,0.02);
  --portal-page-bg: radial-gradient(120% 90% at 50% -10%, #0e0e12 0%, var(--app-bg) 55%);
  --portal-halo-slate: rgba(56,110,165,0.62);
  --portal-halo-red: rgba(255,26,13,0.30);
  --portal-halo-cool: rgba(82,110,150,0.52);
  --portal-halo-success: rgba(125,211,160,0.46);

  --px: 0; --py: 0;
  position: relative;
  min-height: 100vh;
  width: 100%;
  background: var(--portal-page-bg);
  color: var(--text-1);
  overflow-x: hidden;
}

@media (prefers-color-scheme: light) {
  .portal-root {
    --portal-card-bg: rgba(255,255,255,0.80);
    --portal-card-border: rgba(8,8,8,0.07);
    --portal-card-shadow: 0 1px 0 rgba(255,255,255,0.8) inset, 0 30px 80px -24px rgba(8,8,8,0.18), 0 8px 24px -14px rgba(8,8,8,0.12);
    --portal-inset-bg: rgba(8,8,8,0.025);
    --portal-page-bg: radial-gradient(120% 90% at 50% -10%, #FBF9F6 0%, var(--app-bg) 55%);
    --portal-halo-slate: rgba(51,95,140,0.34);
    --portal-halo-red: rgba(255,26,13,0.16);
    --portal-halo-cool: rgba(120,140,170,0.30);
    --portal-halo-success: rgba(47,143,92,0.26);
  }
}

/* ---- atmosphère 3D ---- */
.portal-atmos { position: absolute; inset: -10% -10% 0 -10%; z-index: 0; pointer-events: none; overflow: hidden; perspective: 1000px; transform-style: preserve-3d; }
.portal-halo { position: absolute; border-radius: 50%; filter: blur(58px); will-change: transform; opacity: 0; animation: haloFadeIn 1.6s var(--ease-out-expo) 0.1s forwards; transition: opacity 1.2s ease; }
@keyframes haloFadeIn { to { opacity: 1; } }
.portal-halo--slate { width: 70vmax; height: 70vmax; top: -28vmax; left: 50%; background: radial-gradient(circle at 50% 50%, var(--portal-halo-slate), transparent 62%); transform: translate3d(calc(-50% + var(--px) * -14px), calc(var(--py) * -10px), 0); }
.portal-halo--red { width: 48vmax; height: 48vmax; bottom: -10vmax; right: -8vmax; background: radial-gradient(circle at 50% 50%, var(--portal-halo-red), transparent 60%); transform: translate3d(calc(var(--px) * 18px), calc(var(--py) * 14px), 0); }
.portal-halo--cool { width: 52vmax; height: 52vmax; bottom: -6vmax; left: -14vmax; background: radial-gradient(circle at 50% 50%, var(--portal-halo-cool), transparent 62%); transform: translate3d(calc(var(--px) * -16px), calc(var(--py) * 10px), 0); }
.portal-halo--success { width: 60vmax; height: 60vmax; top: -6vmax; left: 50%; background: radial-gradient(circle at 50% 50%, var(--portal-halo-success), transparent 60%); transform: translate3d(-50%, 0, 0) scale(0.6); opacity: 0; transition: opacity 1.4s ease, transform 1.6s var(--ease-out-expo); }
.portal-root[data-state="accepted"] .portal-halo--success { opacity: 1; transform: translate3d(-50%, 0, 0) scale(1); }
.portal-root[data-state="accepted"] .portal-halo--red { opacity: 0.25; }
@media (prefers-reduced-motion: no-preference) {
  .portal-halo--slate { animation: haloFadeIn 1.6s ease 0.1s forwards, driftA 20s ease-in-out 1.6s infinite; }
  .portal-halo--red   { animation: haloFadeIn 1.6s ease 0.1s forwards, driftB 26s ease-in-out 1.6s infinite; }
  .portal-halo--cool  { animation: haloFadeIn 1.6s ease 0.1s forwards, driftC 23s ease-in-out 1.6s infinite; }
}
@keyframes driftA { 0%,100%{transform:translate3d(calc(-50% + var(--px)*-22px),calc(var(--py)*-16px),0) scale(1);} 50%{transform:translate3d(calc(-50% + 9vmax + var(--px)*-22px),calc(7vmax + var(--py)*-16px),0) scale(1.16);} }
@keyframes driftB { 0%,100%{transform:translate3d(calc(var(--px)*28px),calc(var(--py)*22px),0) scale(1);} 50%{transform:translate3d(calc(-11vmax + var(--px)*28px),calc(-9vmax + var(--py)*22px),0) scale(1.22);} }
@keyframes driftC { 0%,100%{transform:translate3d(calc(var(--px)*-24px),calc(var(--py)*16px),0) scale(1);} 50%{transform:translate3d(calc(10vmax + var(--px)*-24px),calc(-7vmax + var(--py)*16px),0) scale(1.14);} }

/* ---- en-tête ---- */
.portal-topbar { position: relative; z-index: 2; max-width: 1140px; margin: 0 auto; padding: clamp(22px,5vw,34px) clamp(18px,5vw,40px) 0; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.portal-topbar img { height: 26px; width: auto; }
.portal-topbar-info { display: flex; align-items: center; gap: 10px; font-size: 12px; color: var(--text-2); text-align: right; }
.portal-topbar-info .pti-domain { color: var(--text-3); }
.portal-topbar-info .pti-client { color: var(--text-1); font-weight: 700; letter-spacing: 0.01em; }
.portal-dot { width: 4px; height: 4px; border-radius: 50%; background: var(--text-3); flex-shrink: 0; }

/* ---- scène + grille (container queries) ---- */
.portal-stage { position: relative; z-index: 1; perspective: 1600px; container-type: inline-size; container-name: portal; max-width: 1140px; margin: 0 auto; padding: clamp(20px,4vw,38px) clamp(14px,4vw,40px) clamp(48px,8vw,80px); transition: opacity 0.3s ease; }
.portal-root[data-ready="false"] .portal-stage { opacity: 0; }
.portal-layout { display: grid; grid-template-columns: 1fr; gap: clamp(16px,3vw,26px); align-items: start; }

.portal-card { transform-style: preserve-3d; transform: rotateX(calc(var(--py)*-2deg)) rotateY(calc(var(--px)*2deg)) translateZ(0); transition: transform 0.4s var(--ease-out-expo); }
@media (prefers-reduced-motion: reduce) { .portal-card { transform: none !important; } }

.portal-doc-card, .portal-action-card, .portal-track-card {
  background: var(--portal-card-bg);
  -webkit-backdrop-filter: blur(24px) saturate(1.3);
  backdrop-filter: blur(24px) saturate(1.3);
  border: 1px solid var(--portal-card-border);
  border-radius: 22px;
  box-shadow: var(--portal-card-shadow);
  position: relative;
  overflow: hidden;
}
.portal-doc-card { padding: clamp(22px,5.5vw,48px); }
.portal-action-card { padding: clamp(22px,5vw,30px); }
.portal-track-card { padding: clamp(22px,4vw,34px); border-radius: 20px; }

/* ---- contenu du document ---- */
.portal-ref { font-size: 11px; color: var(--text-3); letter-spacing: 0.14em; text-transform: uppercase; }
.portal-greet { font-size: clamp(22px,5vw,30px); font-weight: 700; letter-spacing: -0.02em; line-height: 1.1; color: var(--text-1); margin: clamp(22px,5vw,34px) 0 8px; }
.portal-h1 { font-size: clamp(32px,7vw,50px); font-weight: 700; letter-spacing: -0.03em; line-height: 1.02; margin: 0 0 18px; }
.portal-intro { font-size: clamp(15px,2.4vw,17px); color: var(--text-2); line-height: 1.65; max-width: 540px; margin: 0; }
.portal-rule { height: 1px; background: var(--hairline); margin: clamp(26px,5vw,38px) 0 4px; }
.portal-eyebrow { font-size: 10px; text-transform: uppercase; letter-spacing: 0.22em; color: var(--text-2); margin: 30px 0 12px; }
.portal-h2 { font-size: 20px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.15; margin: 0 0 16px; }

.portal-service { display: flex; align-items: flex-start; gap: 18px; padding: 18px 0; border-bottom: 1px solid var(--hairline-soft); }
.portal-service-name { font-size: 15px; color: var(--text-1); font-weight: 700; letter-spacing: -0.01em; margin-bottom: 4px; }
.portal-service-desc { font-size: 13px; color: var(--text-2); line-height: 1.6; }
.portal-service-qty { font-size: 11px; color: var(--text-3); margin-top: 6px; letter-spacing: 0.04em; }
.portal-service-price { font-size: 15px; color: var(--text-1); font-weight: 700; text-align: right; padding-top: 1px; white-space: nowrap; flex-shrink: 0; }
.portal-doc-total { display: flex; justify-content: space-between; align-items: center; padding-top: 22px; }
.portal-doc-total-lbl { font-size: 12px; color: var(--text-2); letter-spacing: 0.04em; }
.portal-doc-total-val { font-size: 22px; color: var(--text-1); font-weight: 700; letter-spacing: -0.02em; }
.portal-doc-subtotals { display: flex; flex-direction: column; gap: 7px; padding-top: 18px; }
.portal-doc-subrow { display: flex; justify-content: space-between; font-size: 13px; color: var(--text-2); }
.portal-doc-subtotals + .portal-doc-total { padding-top: 14px; margin-top: 12px; border-top: 1px solid var(--hairline); }

/* ---- panneau de signature ---- */
.portal-recap-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.portal-recap-lbl { font-size: 11px; color: var(--text-2); letter-spacing: 0.12em; text-transform: uppercase; }
.portal-pill { display: inline-flex; align-items: center; gap: 8px; font-size: 10px; padding: 6px 13px; border-radius: 100px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.16em; border: 1px solid transparent; white-space: nowrap; background: var(--warning-bg); color: var(--warning); transition: background 0.6s ease, color 0.6s ease; }
.portal-pill-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--warning); box-shadow: 0 0 0 4px var(--warning-bg); transition: background 0.6s ease, box-shadow 0.6s ease; }
.portal-pill.is-accepted { background: var(--success-bg); color: var(--success); }
.portal-pill.is-accepted .portal-pill-dot { background: var(--success); box-shadow: 0 0 0 4px var(--success-bg); }
.portal-total-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.portal-total-row .ptr-lbl { font-size: 12px; color: var(--text-2); letter-spacing: 0.04em; }
.portal-total-row .ptr-val { font-size: clamp(30px,7vw,38px); color: var(--text-1); font-weight: 700; letter-spacing: -0.025em; line-height: 1; }
.portal-terms { font-size: 12px; color: var(--text-3); text-align: right; margin-top: 7px; }
.portal-recap-tax { font-size: 11px; color: var(--text-3); text-align: right; margin-top: 5px; }
.portal-validity { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--hairline); display: flex; align-items: center; gap: 9px; font-size: 13px; color: var(--text-2); }
.portal-validity strong { color: var(--text-1); font-weight: 700; }
.portal-validity .pv-days { color: var(--warning); font-weight: 700; }

/* ---- rituel ---- */
.portal-ritual { margin-top: 20px; transition: opacity 0.4s ease, transform 0.45s var(--ease-out-expo); }
.portal-ritual.is-accepting { opacity: 0.4; transform: translateY(6px); pointer-events: none; }
.portal-field { margin-bottom: 14px; }
.portal-field-label { font-size: 11px; color: var(--text-2); letter-spacing: 0.04em; margin-bottom: 7px; display: block; }
.portal-input { width: 100%; padding: 13px 15px; background: var(--portal-inset-bg); border: 1px solid var(--hairline-strong); border-radius: 12px; color: var(--text-1); font-size: 15px; font-family: inherit; transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease; }
.portal-input::placeholder { color: var(--text-3); }
.portal-input:focus { outline: none; border-color: var(--accent); background: transparent; box-shadow: 0 0 0 3px var(--red-dim); }
.portal-check-row { display: flex; gap: 11px; align-items: flex-start; cursor: pointer; user-select: none; font-size: 13px; line-height: 1.5; color: var(--text-2); margin-bottom: 18px; }
.portal-box { flex-shrink: 0; width: 20px; height: 20px; margin-top: 1px; border: 1.5px solid var(--hairline-stronger); border-radius: 6px; display: flex; align-items: center; justify-content: center; transition: background 0.2s ease, border-color 0.2s ease; }
.portal-check-row[data-checked="true"] .portal-box { background: var(--accent); border-color: var(--accent); }
.portal-box svg { opacity: 0; transform: scale(0.5); transition: opacity 0.2s ease, transform 0.2s ease; }
.portal-check-row[data-checked="true"] .portal-box svg { opacity: 1; transform: scale(1); }

.portal-cta { position: relative; width: 100%; padding: 18px 26px; background: var(--red); color: #FFFCF9; border: none; border-radius: 100px; font-family: inherit; font-size: 16px; font-weight: 700; letter-spacing: -0.01em; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 10px; transition: transform 0.4s var(--ease-out-expo), background 0.3s ease; }
.portal-cta:hover { transform: translateY(-2px); }
.portal-cta:active { transform: translateY(0); }
.portal-cta:disabled { cursor: not-allowed; background: var(--neutral-bg) !important; color: var(--text-3) !important; }
@media (prefers-reduced-motion: no-preference) {
  .portal-cta:not(:disabled)::after { content: ""; position: absolute; inset: 0; border-radius: inherit; box-shadow: 0 0 0 0 rgba(255,26,13,0.45); animation: ctaPulse 3.2s ease-out infinite; pointer-events: none; }
}
@keyframes ctaPulse { 0%{box-shadow:0 0 0 0 rgba(255,26,13,0.40);} 70%{box-shadow:0 0 0 16px rgba(255,26,13,0);} 100%{box-shadow:0 0 0 0 rgba(255,26,13,0);} }
.portal-hint { font-size: 11px; color: var(--text-3); text-align: center; margin-top: 11px; line-height: 1.5; }

/* ---- liens secondaires ---- */
.portal-secondary { display: flex; justify-content: center; gap: 22px; margin-top: 16px; flex-wrap: wrap; }
.portal-link { background: transparent; border: none; cursor: pointer; font-family: inherit; font-size: 12px; color: var(--text-2); letter-spacing: 0.02em; transition: color 0.25s ease; display: inline-flex; align-items: center; gap: 7px; }
.portal-link:hover { color: var(--text-1); }
.portal-decline-wrap { display: flex; justify-content: center; margin-top: 2px; }

/* ---- confirmation (acceptée) ---- */
.portal-confirm { margin-top: 20px; display: flex; align-items: flex-start; gap: 14px; padding: 18px; border-radius: 16px; background: var(--success-bg); border: 1px solid color-mix(in srgb, var(--success) 22%, transparent); }
.portal-confirm-title { font-size: 15.5px; font-weight: 700; color: var(--text-1); letter-spacing: -0.01em; margin-bottom: 4px; }
.portal-confirm-text { font-size: 13px; color: var(--text-2); line-height: 1.55; }
.portal-confirm-text strong { color: var(--text-1); font-weight: 700; }
.portal-check circle { animation: checkRing 0.6s ease forwards; transform-origin: center; transform: scale(0.4); opacity: 0; }
.portal-check polyline { stroke-dasharray: 26; stroke-dashoffset: 26; animation: checkDraw 0.5s var(--ease-out-expo) 0.35s forwards; }
@keyframes checkRing { to { transform: scale(1); opacity: 1; } }
@keyframes checkDraw { to { stroke-dashoffset: 0; } }

/* ---- suivi (après acceptation) ---- */
.portal-track { margin-top: clamp(16px,3vw,26px); }
.portal-track-grid { display: grid; grid-template-columns: 1fr; gap: clamp(16px,3vw,24px); }
.portal-track-eyebrow { font-size: 10px; text-transform: uppercase; letter-spacing: 0.22em; color: var(--text-2); margin-bottom: 12px; }
.portal-track-h2 { font-size: 20px; font-weight: 700; letter-spacing: -0.02em; margin: 0 0 14px; }
.portal-inv { display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--hairline-soft); }
.portal-inv:last-child { border-bottom: none; }
.portal-inv-label { font-size: 14px; color: var(--text-1); font-weight: 700; letter-spacing: -0.01em; }
.portal-inv-due { font-size: 12px; color: var(--text-2); margin-top: 3px; }
.portal-inv-amt { font-size: 16px; color: var(--text-1); font-weight: 700; letter-spacing: -0.01em; }
.portal-inv-tag { font-size: 9px; padding: 4px 9px; border-radius: 100px; text-transform: uppercase; letter-spacing: 0.12em; font-weight: 700; white-space: nowrap; }
.portal-pay { margin-top: 16px; padding: 16px 18px; background: var(--portal-inset-bg); border: 1px solid var(--hairline-soft); border-radius: 14px; }
.portal-pay-title { font-size: 12px; font-weight: 700; color: var(--text-1); letter-spacing: -0.01em; margin-bottom: 6px; }
.portal-pay-text { font-size: 12.5px; color: var(--text-2); line-height: 1.6; }
.portal-pay-text strong { color: var(--text-1); }
.portal-cal { display: flex; align-items: center; gap: 14px; padding: 13px 0; border-bottom: 1px solid var(--hairline-soft); }
.portal-cal:last-child { border-bottom: none; }
.portal-cal-date { width: 42px; text-align: center; flex-shrink: 0; }
.portal-cal-day { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; line-height: 1; color: var(--text-1); }
.portal-cal-month { font-size: 9px; color: var(--text-2); letter-spacing: 0.18em; margin-top: 3px; }
.portal-cal-ic { width: 34px; height: 34px; border-radius: 9px; background: var(--success-bg); display: flex; align-items: center; justify-content: center; flex-shrink: 0; color: var(--success); }
.portal-cal-title { font-size: 13.5px; color: var(--text-1); font-weight: 700; letter-spacing: -0.01em; }
.portal-cal-sub { font-size: 12px; color: var(--text-2); margin-top: 2px; }
.portal-livr { padding: 28px 26px; background: var(--portal-inset-bg); border: 1px dashed var(--hairline-strong); border-radius: 16px; text-align: center; }
.portal-livr-title { font-size: 14px; color: var(--text-1); font-weight: 700; letter-spacing: -0.01em; margin-bottom: 6px; }
.portal-livr-text { font-size: 13px; line-height: 1.6; color: var(--text-2); max-width: 460px; margin: 0 auto; }
.portal-livr-file { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--hairline-soft); color: var(--text-2); }
.portal-livr-file:last-child { border-bottom: none; }
.portal-livr-file > svg { flex-shrink: 0; }
.portal-livr-fname { font-size: 14px; color: var(--text-1); font-weight: 700; letter-spacing: -0.01em; word-break: break-word; }
.portal-livr-fmeta { font-size: 12px; color: var(--text-2); margin-top: 2px; }
.portal-livr-dl { flex-shrink: 0; white-space: nowrap; }
/* livrables côté admin (fiche client) */
.livr-row { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--hs); }
.livr-row:last-child { border-bottom: none; }
.livr-main { flex: 1; min-width: 0; }
.livr-name { font-size: 13px; color: var(--t1); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.livr-meta { font-size: 11px; color: var(--t3); margin-top: 2px; }

/* utilitaires portail (layout interne — pas de style inline dans le JS) */
.portal-root svg { display: block; }
.portal-grow { flex: 1; min-width: 0; }
.portal-inv-main { min-width: 0; }
.portal-inv-right { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.portal-livr-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.portal-livr-head .portal-track-h2 { margin: 0; }
.portal-livr-since { font-size: 11px; color: var(--text-2); letter-spacing: 0.04em; }
.portal-track-empty { padding: 6px 0; font-size: 12px; color: var(--text-2); }

/* ---- squelette de chargement ---- */
.portal-skel { position: relative; overflow: hidden; background: var(--portal-inset-bg); border-radius: 8px; }
.portal-skel::after { content: ""; position: absolute; inset: 0; transform: translateX(-100%); background: linear-gradient(90deg, transparent, rgba(255,252,249,0.06), transparent); animation: portalShimmer 1.3s infinite; }
@keyframes portalShimmer { 100% { transform: translateX(100%); } }
.portal-skel-ref { height: 11px; width: 90px; }
.portal-skel-title { height: 36px; width: 70%; margin: 22px 0 14px; }
.portal-skel-line { height: 14px; width: 100%; margin: 8px 0; }
.portal-skel-line.short { width: 60%; }
.portal-skel-btn { height: 52px; width: 100%; border-radius: 100px; margin-bottom: 14px; }
@media (prefers-reduced-motion: reduce) { .portal-skel::after { animation: none; } }

/* ---- footer de confiance ---- */
.portal-trust { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px 14px; margin-top: clamp(26px,5vw,40px); font-size: 11px; color: var(--text-3); letter-spacing: 0.06em; text-align: center; }
.portal-trust .pt-studio { color: var(--text-2); text-transform: uppercase; letter-spacing: 0.16em; }

/* ---- entrées ---- */
.portal-fade { opacity: 0; transform: translateY(14px); animation: portalRise 0.9s var(--ease-out-expo) forwards; }
@keyframes portalRise { to { opacity: 1; transform: translateY(0); } }
.portal-reveal { animation: portalReveal 0.9s var(--ease-out-expo) both; }
@keyframes portalReveal { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: translateY(0); } }
@media (prefers-reduced-motion: reduce) {
  .portal-fade { opacity: 1; transform: none; animation: none; }
  .portal-reveal { animation: none; }
  .portal-check circle { transform: none; opacity: 1; animation: none; }
  .portal-check polyline { stroke-dashoffset: 0; animation: none; }
}

/* ---- ordi : 2 colonnes + panneau collant ---- */
@container portal (min-width: 760px) {
  .portal-layout { grid-template-columns: minmax(0,1.6fr) minmax(300px,0.92fr); gap: 30px; }
  .portal-action-wrap { position: sticky; top: 26px; }
  .portal-doc-card { padding: clamp(38px,3.6vw,56px); }
  .portal-track-grid { grid-template-columns: 1fr 1fr; }
  .portal-track-grid > .portal-track-wide { grid-column: 1 / -1; }
}

/* ---- impression : PDF propre de la proposition ---- */
@media print {
  .portal-atmos { display: none !important; }
  .portal-layout { grid-template-columns: 1fr !important; gap: 0 !important; }
  .portal-action-wrap { position: static !important; }
  .portal-doc-card, .portal-action-card, .portal-track-card { box-shadow: none !important; -webkit-backdrop-filter: none !important; backdrop-filter: none !important; background: #fff !important; border: 1px solid #e2e2e2 !important; transform: none !important; color: #111 !important; }
  .portal-cta, .portal-secondary, .portal-ritual, .portal-track, .portal-validity { display: none !important; }
}


/* ----------------------------------------------------------------
   27. LOGIN
---------------------------------------------------------------- */
.login-page {
  width: 100%;
  height: 100vh;
  background: var(--app-bg);
  color: var(--t1);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

.login-grad {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 40%, rgba(51,72,91,0.18), transparent 60%);
  pointer-events: none;
}

.login-header {
  padding: 40px 48px;
  position: relative;
  z-index: 1;
}

.login-header img { height: 36px; display: block; }

.login-main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 32px 80px;
  position: relative;
  z-index: 1;
}

.login-card {
  width: 100%;
  max-width: 420px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

.login-eyebrow {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.20em;
  color: var(--red);
  margin-bottom: 28px;
  text-align: center;
}

.login-title {
  font-size: 44px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.05;
  text-align: center;
  margin-bottom: 16px;
  color: var(--t1);
}

.login-sub {
  color: var(--t2);
  text-align: center;
  font-size: 15px;
  line-height: 1.6;
  margin-bottom: 44px;
  max-width: 340px;
  margin-left: auto;
  margin-right: auto;
}

.login-buttons { display: flex; flex-direction: column; gap: 12px; }

.btn-oauth {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 16px 24px;
  background: var(--cta-bg);
  color: var(--cta-fg);
  border: none;
  border-radius: var(--r-pill);
  font-size: 15px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: opacity 0.2s;
}

.btn-oauth:hover  { opacity: 0.88; }

.btn-oauth.secondary {
  background: transparent;
  color: var(--t1);
  border: 1px solid var(--cta-border);
}

.btn-oauth:disabled { opacity: 0.45; cursor: not-allowed; }

.login-fine-print {
  margin-top: 36px;
  font-size: 12px;
  color: var(--t2);
  text-align: center;
  line-height: 1.6;
  opacity: 0.8;
}

.login-footer {
  padding: 0 48px 36px;
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.login-footer-left {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--t2);
}

.login-footer-right {
  font-size: 11px;
  color: var(--t2);
  display: flex;
  align-items: center;
  gap: 8px;
}

.status-dot-red {
  width: 6px;
  height: 6px;
  background: var(--red);
  border-radius: 50%;
  box-shadow: 0 0 0 4px var(--danger-bg);
}

.auth-error {
  display: none;
  padding: 12px 16px;
  background: var(--danger-bg);
  color: var(--red);
  border-radius: var(--r-sm);
  font-size: 13px;
  text-align: center;
  margin-bottom: 16px;
}

.auth-error.show { display: block; }
.auth-error.ok { background: var(--success-bg); color: var(--success); }

/* ── Login : formulaire email/mot de passe + séparateur ── */
.login-form { display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px; }
.login-submit { justify-content: center; }
.login-forgot {
  font-size: 12px; color: var(--t2); text-align: center;
  text-decoration: none; margin-top: 2px;
}
.login-forgot:hover { color: var(--t1); text-decoration: underline; }
.login-sep {
  display: flex; align-items: center; gap: 12px;
  color: var(--t3); font-size: 12px; margin: 4px 0 16px;
}
.login-sep::before, .login-sep::after { content: ''; flex: 1; height: 1px; background: var(--h); }

/* ── Portail : séparateur + champs email/mot de passe d'acceptation ── */
.portal-sep {
  display: flex; align-items: center; gap: 12px;
  color: var(--t3); font-size: 12px; margin: 14px 0;
}
.portal-sep::before, .portal-sep::after { content: ''; flex: 1; height: 1px; background: var(--h); }
.portal-input { margin-bottom: 10px; }

/* ----------------------------------------------------------------
   28. TOAST
---------------------------------------------------------------- */
.toast {
  position: fixed;
  bottom: 28px;
  right: 28px;
  padding: 12px 20px;
  background: var(--t1);
  color: var(--app-bg);
  border-radius: var(--r-sm);
  font-size: 13px;
  font-weight: 700;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.3s, transform 0.3s;
  pointer-events: none;
  z-index: 1000;
}

.toast.show { opacity: 1; transform: translateY(0); }

/* ----------------------------------------------------------------
   29. UTILITAIRES
---------------------------------------------------------------- */
.t1  { color: var(--t1); }
.t2  { color: var(--t2); }
.red { color: var(--red); }
.fw7 { font-weight: 700; }
.mono { font-family: monospace; }
.tr  { text-align: right; }
.flex-1 { flex: 1; }
.flex-gap-8 { display: flex; gap: 8px; }

.section-lbl {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--t2);
  font-weight: 400;
  margin-bottom: 14px;
}

/* ----------------------------------------------------------------
   30. RESPONSIVE
---------------------------------------------------------------- */
@media (max-width: 1100px) {
  .page-body-two-col {
    grid-template-columns: 1fr;
  }
  .global-grid {
    grid-template-columns: 1fr;
  }
  .calc-grid {
    grid-template-columns: 1fr;
  }
  .client-body {
    grid-template-columns: 1fr;
  }
  .settings-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .stats-band {
    flex-wrap: wrap;
    margin: 16px 20px 0;
  }
  .stat-cell {
    min-width: 50%;
    border-right: 1px solid var(--h);
    border-bottom: 1px solid var(--h);
  }
  .stat-cell:nth-child(2n) { border-right: none; }
  .stat-cell:nth-last-child(-n+2) { border-bottom: none; }

  .page-topbar {
    padding: 20px 24px 16px;
    flex-wrap: wrap;
    gap: 12px;
  }
  /* Les actions doivent passer à la ligne au lieu de se chevaucher */
  .topbar-actions {
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px 10px;
  }
  .breadcrumb-bar {
    padding: 12px 20px;
    flex-wrap: nowrap;
    gap: 12px;
  }
  /* Boutons d'action plus petits dans la barre */
  .breadcrumb-bar .btn-icon-round,
  .breadcrumb-bar .hamburger-btn { width: 34px; height: 34px; }
  .breadcrumb { min-width: 0; overflow: hidden; }
  .breadcrumb-cur { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  /* Barre de filtres clients : scroll horizontal (comme le stepper finances) */
  .filter-bar {
    padding: 16px 20px;
    overflow-x: auto;
    flex-wrap: nowrap;
    scrollbar-width: none;
  }
  .filter-bar::-webkit-scrollbar { display: none; }
  .filter-sort { margin-left: 0; }
  /* Stepper du calculateur : scroll horizontal plutôt que chevauchement */
  .stepper { overflow-x: auto; gap: 12px; padding-bottom: 18px; }
  .step-dot-wrap { flex: 0 0 auto; }
  .search-pill { width: 100%; }
  .ctable-wrap { padding: 12px 20px 32px; }
  .ctable-head { display: none; }
  /* Le tableau devient une carte sur mobile (cf. design MobileClientsList) */
  .ctable-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 12px;
  }
  .ctable-row .client-name-cell { flex: 1 1 auto; min-width: 0; order: 1; }
  .ctable-row > div:nth-child(2)  { order: 2; }          /* statut */
  .ctable-arrow { order: 3; margin-left: auto; }
  .ctable-row > div:nth-child(3)  { order: 4; font-size: 13px; }  /* MRR */
  .ctable-next { order: 5; flex: 1 1 100%; }              /* prochaine étape, pleine largeur */
  .ctable-row > .tr { display: none; }                   /* LTV masquée sur mobile */
  .ctable-empty { justify-content: center; padding: 24px 0; }
  .client-body { padding: 16px 20px 32px; }
  /* En-tête fiche client compact sur mobile */
  .client-header {
    padding: 16px 20px;
    gap: 16px;
    align-items: flex-start;
  }
  .client-hero-avatar { width: 48px; height: 48px; font-size: 15px; border-radius: 12px; }
  .client-hero-name { font-size: 24px; }
  .client-header-left { gap: 14px; align-items: flex-start; }
  .client-header-right { width: 100%; justify-content: space-between; gap: 12px; }
  .client-mrr-val { font-size: 22px; }
}

@media (max-width: 700px) {
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    z-index: 100;
    transform: translateX(-100%);
  }
  .sidebar.is-open { transform: translateX(0); }
  .sidebar-overlay { display: block; }
  .sidebar-overlay.is-open { opacity: 1; pointer-events: all; }
  .app-shell { overflow: auto; }
  .main-col  { height: 100vh; }

  .page-topbar { padding: 16px 20px; }
  .topbar-title { font-size: 22px; }
  .search-pill { display: none; }
  .search-kbd  { display: none; }

  .quick-actions { flex-direction: column; }
  /* Matériel : carte sur mobile au lieu d'une grille écrasée */
  .mat-head { display: none; }
  .mat-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 12px;
  }
  .mat-item-cell { flex: 1 1 100%; }
  .mat-sn { display: none; }
  .mat-val { flex: 1; text-align: left; font-weight: 700; }
  .mat-action { margin-left: auto; }
  /* Calendrier : grille scrollable horizontalement, agenda fluide */
  .cal-container { padding: 12px 16px 24px; overflow-x: auto; }
  .cal-days-header, .cal-grid { min-width: 600px; }
  .cal-list { padding: 8px 16px 32px; }
  /* Topbar mobile simplifiee : titre + 1 action primaire (le CTA rouge) ; le reste disparait */
  .view-switcher { display: none; }
  #btn-cal-prev, #btn-cal-today, #btn-cal-next { display: none; }
  .page-topbar .btn-icon-round { display: none; }
  .login-header { padding: 24px 24px; }
  .login-footer { padding: 0 24px 24px; }
  .login-title { font-size: 32px; }
}

/* ----------------------------------------------------------------
   31. HAMBURGER (mobile topbar)
---------------------------------------------------------------- */
.hamburger-btn {
  display: none;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--s2);
  border: 1px solid var(--h);
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}

/* ----------------------------------------------------------------
   31b. BOTTOM NAV (mobile) — remplace le hamburger sous 700px
---------------------------------------------------------------- */
.bottom-nav { display: none; }

@media (max-width: 700px) {
  /* Le hamburger reste masque : la navigation mobile = bottom nav */
  .bottom-nav {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 90;
    background: var(--rail-bg);
    border-top: 1px solid var(--h);
    padding-bottom: env(safe-area-inset-bottom);
  }
  .bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 9px 4px 8px;
    color: var(--t2);
    font-size: 10px;
    letter-spacing: 0.02em;
    transition: color 0.2s;
  }
  .bottom-nav-item .ic { width: 20px; height: 20px; }
  .bottom-nav-item.is-active { color: var(--red); }
  /* Espace pour que le contenu ne passe pas sous la barre */
  .main-col { padding-bottom: calc(60px + env(safe-area-inset-bottom)); }
}

/* ----------------------------------------------------------------
   32. MODAL + FORMULAIRES (composant partagé — js/modal.js)
---------------------------------------------------------------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(8,8,8,0.62);
  backdrop-filter: blur(4px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s var(--ease-expo);
}

.modal-overlay.is-open { opacity: 1; pointer-events: all; }

.modal-card {
  width: 100%;
  max-width: 520px;
  max-height: calc(100vh - 48px);
  display: flex;
  flex-direction: column;
  background: var(--rail-bg);
  border: 1px solid var(--hk);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-card);
  transform: translateY(12px) scale(0.98);
  transition: transform 0.2s var(--ease-expo);
}

.modal-overlay.is-open .modal-card { transform: translateY(0) scale(1); }

.modal-wide { max-width: 760px; }

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 24px;
  border-bottom: 1px solid var(--h);
  flex-shrink: 0;
}

.modal-title {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--t1);
}

.modal-close {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--s2);
  border: 1px solid var(--h);
  color: var(--t2);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: opacity 0.2s;
}

.modal-close:hover { opacity: 0.75; }

.modal-body {
  padding: 22px 24px;
  overflow-y: auto;
}

.modal-foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 24px;
  border-top: 1px solid var(--h);
  flex-shrink: 0;
}

/* ── Primitives de formulaire ──────────────────────────────── */
.form-group { margin-bottom: 18px; }
.form-group:last-child { margin-bottom: 0; }

.form-label {
  display: block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--t2);
  margin-bottom: 8px;
}

.form-hint {
  font-size: 11px;
  color: var(--t3);
  margin-top: 6px;
}
.form-hint a {
  color: var(--red);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.form-hint a:hover { color: var(--red-hover); }

.form-value {
  font-size: 0.95rem;
  color: var(--t1);
  padding: 0.25rem 0;
}
.form-note {
  font-size: 0.8rem;
  color: var(--t2);
  margin-top: 0.5rem;
  font-style: italic;
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 11px 14px;
  background: var(--s2);
  border: 1px solid var(--h);
  border-radius: var(--r-sm);
  color: var(--t1);
  font-family: inherit;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
}

.form-input::placeholder,
.form-textarea::placeholder { color: var(--t2); }

.form-input:focus,
.form-select:focus,
.form-textarea:focus { border-color: var(--hkk); }

.form-input[readonly] {
  background: var(--s1);
  color: var(--t2);
  cursor: default;
}
.form-input[readonly]:focus { border-color: var(--h); }

/* ── Templates : chips de choix (modal proposition) ── */
.tpl-choices { display: flex; flex-wrap: wrap; gap: 8px; }
.tpl-choice {
  font-size: 12px;
  padding: 7px 13px;
  border-radius: var(--r-pill);
  border: 1px solid var(--h);
  background: var(--s2);
  color: var(--t2);
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.tpl-choice:hover { color: var(--t1); border-color: var(--hk); }
.tpl-choice.is-active { background: var(--red-dim); border-color: var(--red); color: var(--red); }

/* ── Templates : liste (Paramètres) ── */
.tpl-row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 0; border-bottom: 1px solid var(--h);
}
.tpl-row:last-child { border-bottom: none; }
.tpl-row.is-off { opacity: 0.55; }
.tpl-info { flex: 1; }
.tpl-name { font-weight: 700; color: var(--t1); }
.tpl-meta { font-size: 12px; color: var(--t2); margin-top: 2px; }
.tpl-actions { display: flex; align-items: center; gap: 10px; }
.tpl-badge { font-size: 10px; text-transform: uppercase; letter-spacing: 0.1em; padding: 3px 8px; border-radius: var(--r-pill); }
.tpl-badge.on  { background: var(--success-bg); color: var(--success); }
.tpl-badge.off { background: var(--neutral-bg); color: var(--t2); }

/* ── Accès : liste d'emails ── */
.access-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 0; border-bottom: 1px solid var(--h);
}
.access-email { color: var(--t1); font-size: 14px; }
.access-default { font-size: 10px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--t3); }
.access-add-row { display: flex; gap: 8px; align-items: center; margin-top: 12px; }
.access-add-row .form-input { flex: 1; }

/* ── Portail : CTA en lien (état "aucune proposition") ── */
.portal-cta-link {
  display: inline-flex; align-items: center; justify-content: center;
  text-decoration: none; margin-top: 20px;
}

/* ── Portail : boutons OAuth d'acceptation (cohérents avec login .btn-oauth) ── */
.portal-oauth { width: 100%; margin-bottom: 10px; }
.portal-oauth svg { flex-shrink: 0; }
.portal-oauth:last-of-type { margin-bottom: 0; }

.form-textarea { resize: vertical; min-height: 84px; line-height: 1.6; }

.form-select { appearance: none; cursor: pointer; }

.form-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.form-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* ── Cartes d'option (ex. choix de service) ────────────────── */
.option-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
}

.option-card {
  padding: 14px;
  border-radius: var(--r-sm);
  border: 1px solid var(--h);
  background: var(--s2);
  cursor: pointer;
  text-align: center;
  transition: border-color 0.2s, background 0.2s;
}

.option-card:hover { border-color: var(--hk); }

.option-card.selected {
  border-color: var(--red);
  background: var(--red-dim);
}

.option-icon { color: var(--t2); margin-bottom: 6px; display: flex; justify-content: center; }
.option-card.selected .option-icon { color: var(--red); }
.option-name { font-size: 13px; font-weight: 700; color: var(--t1); }
.option-sub  { font-size: 11px; color: var(--t2); margin-top: 2px; }

/* ── Cases / radios en grille ──────────────────────────────── */
.check-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 8px;
}

.check-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: var(--r-sm);
  border: 1px solid var(--h);
  background: var(--s2);
  cursor: pointer;
  font-size: 13px;
  color: var(--t1);
  transition: border-color 0.2s;
}

.check-item:hover { border-color: var(--hk); }
.check-item input { accent-color: var(--red); cursor: pointer; }

/* ── Sliders ───────────────────────────────────────────────── */
.slider-row {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 12px;
}

.slider-label { font-size: 13px; color: var(--t2); min-width: 150px; }
.slider-val   { font-size: 14px; font-weight: 700; color: var(--t1); min-width: 56px; text-align: right; }
.slider-row input[type="range"] { flex: 1; accent-color: var(--red); cursor: pointer; }

@media (max-width: 560px) {
  .modal-card { max-width: 100%; }
  .form-grid-2 { grid-template-columns: 1fr; }
}

/* ----------------------------------------------------------------
   33. DOCUMENTS PDF (gabarit imprimable à la marque — js/document.js)
---------------------------------------------------------------- */
.pv-page { max-width: 800px; margin: 0 auto; background: #fff; color: #111; font-family: var(--font); }

.pv-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
  background: linear-gradient(135deg, #33485B 0%, #899DA9 100%);
  padding: 28px 40px 24px;
}
.pv-logo-img { height: 64px; width: auto; }
.pv-title-block { text-align: right; }
.pv-title { font-size: 38px; font-weight: 700; color: #FFFCF9; letter-spacing: 0.08em; line-height: 1; text-transform: uppercase; }
.pv-num { font-size: 13px; font-weight: 700; color: #FF1A0D; margin-top: 6px; background: rgba(255,255,255,0.12); display: inline-block; padding: 3px 9px; border-radius: 4px; }
.pv-date-block { font-size: 11px; color: rgba(255,252,249,0.85); margin-top: 10px; line-height: 1.7; }
.pv-date-block b { color: #FFFCF9; font-size: 10px; text-transform: uppercase; letter-spacing: 0.1em; }

.pv-redline { height: 4px; background: #FF1A0D; }
.pv-body { padding: 26px 40px 40px; }

.pv-parties { display: grid; grid-template-columns: 1fr 1fr; background: #f5f5f5; border: 1px solid #ddd; margin-bottom: 24px; overflow: hidden; }
.pv-party { padding: 16px 20px; }
.pv-party:first-child { border-right: 1px solid #ddd; }
.pv-party-label { font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.15em; color: #555; margin-bottom: 6px; }
.pv-party-name { font-weight: 700; font-size: 14px; color: #111; }
.pv-party-info { font-size: 12px; color: #555; line-height: 1.6; margin-top: 4px; }

.pv-table { width: 100%; border-collapse: collapse; margin-bottom: 16px; font-size: 12px; }
.pv-table th { background: #111; color: #fff; padding: 11px 14px; font-size: 9px; text-transform: uppercase; letter-spacing: 0.12em; font-weight: 700; }
.pv-th-l { text-align: left; } .pv-th-c { text-align: center; } .pv-th-r { text-align: right; }
.pv-table td { padding: 11px 14px; border-bottom: 1px solid #eee; color: #111; vertical-align: top; }
.pv-table tbody tr:nth-child(even) td { background: #f9f9f9; }
.pv-table td:nth-child(1) { font-weight: 600; }
.pv-table:not(.pv-table-3) td:nth-child(2) { text-align: center; }
.pv-table:not(.pv-table-3) td:nth-child(3), .pv-table:not(.pv-table-3) td:nth-child(4) { text-align: right; font-weight: 600; }
.pv-td-r { text-align: right; font-weight: 600; }

.pv-subtotals { display: flex; flex-direction: column; align-items: flex-end; gap: 5px; margin-bottom: 12px; }
.pv-subtotal-row { display: flex; gap: 40px; font-size: 12px; }
.pv-subtotal-row span:first-child { color: #555; font-weight: 600; }
.pv-subtotal-row span:last-child { text-align: right; min-width: 110px; font-weight: 600; color: #111; }

.pv-total-bar { background: #FF1A0D; color: #fff; padding: 14px 22px; display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }
.pv-total-label { font-size: 14px; font-weight: 700; letter-spacing: 0.1em; }
.pv-total-amount { font-size: 24px; font-weight: 700; letter-spacing: 0.04em; }

.pv-acompte-bar { display: flex; justify-content: space-between; align-items: center; padding: 11px 22px; border: 1px solid #ddd; margin-bottom: 18px; font-size: 12px; }
.pv-acompte-label { color: #555; font-weight: 600; }
.pv-acompte-amount { font-weight: 700; color: #111; }

.pv-h2 { font-size: 18px; font-weight: 700; color: #111; margin: 6px 0 10px; }
.pv-intro { font-size: 12px; color: #333; line-height: 1.7; margin-bottom: 16px; }
.pv-section-title { font-size: 10px; font-weight: 700; color: #FF1A0D; text-transform: uppercase; letter-spacing: 0.15em; margin: 18px 0 10px; }
.pv-approche { font-size: 12px; color: #333; line-height: 1.7; margin-bottom: 8px; }

.pv-conditions { border: 1px solid #eee; }
.pv-cond-row { display: flex; justify-content: space-between; gap: 24px; padding: 9px 14px; border-bottom: 1px solid #f0f0f0; font-size: 12px; }
.pv-cond-row:last-child { border-bottom: none; }
.pv-cond-row span:first-child { color: #555; font-weight: 600; }
.pv-cond-row span:last-child { text-align: right; color: #111; }

.pv-objet { background: #f7f8fa; border-radius: 6px; padding: 12px 16px; font-size: 12px; color: #333; }

/* Clauses contractuelles (encadrés avec texte) */
.pv-clauses { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pv-clause { background: #f7f8fa; border-radius: 6px; padding: 11px 14px; border-left: 3px solid #33485B; }
.pv-clause-title { font-weight: 700; font-size: 12px; color: #33485B; margin-bottom: 4px; }
.pv-clause p { font-size: 11px; color: #5a7080; line-height: 1.5; }

/* Licences */
.pv-licences { background: #f7f8fa; border-radius: 6px; padding: 12px 16px; border-left: 3px solid #33485B; }
.pv-licences-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.pv-licence-tag { font-size: 10px; background: #fff; border: 1px solid #ddd; border-radius: 100px; padding: 3px 10px; color: #33485B; font-weight: 600; }
.pv-licences-text { font-size: 11px; color: #5a7080; line-height: 1.6; }

/* Signature signée */
.pv-sign-label { font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.15em; color: #555; margin-bottom: 6px; }
.pv-sign-name { font-size: 13px; font-weight: 700; color: #111; margin-bottom: 8px; }
.pv-sign-date { font-size: 10px; color: #888; margin-top: 6px; }
.pv-sig-signed { color: #16a34a; font-weight: 700; font-size: 12px; padding: 8px 0; }

.pv-sign { display: flex; gap: 48px; margin-top: 36px; }
.pv-sign-box { flex: 1; font-size: 11px; color: #666; }
.pv-sign-line { border-top: 1px solid #999; margin-bottom: 6px; height: 44px; }

.pv-divider { height: 1px; background: #ddd; margin: 8px 0 14px; }
.pv-notes-title { font-size: 10px; font-weight: 700; color: #FF1A0D; text-transform: uppercase; letter-spacing: 0.15em; margin-bottom: 8px; }
.pv-notes-text { font-size: 11px; color: #555; line-height: 1.7; font-style: italic; }
.pv-mentions { font-size: 10px; color: #888; line-height: 1.6; margin-top: 12px; }
.pv-footer-line { height: 2px; background: #FF1A0D; margin: 24px 0 8px; }
.pv-footer { text-align: center; font-size: 10px; color: #aaa; font-style: italic; }

@media print {
  body.printing { background: #fff !important; }
  body.printing > *:not(#print-doc) { display: none !important; }
  #print-doc { display: block !important; }
  .pv-page { max-width: none; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  @page { size: A4; margin: 0; }
}


/* ----------------------------------------------------------------
   Fiche client — en-tete compact sur mobile (ne plus bloquer ~30% de l'ecran)
---------------------------------------------------------------- */
@media (max-width: 700px) {
  .client-header { padding: 12px 20px 14px; gap: 10px; }
  .client-hero-avatar { width: 40px; height: 40px; font-size: 13px; border-radius: 11px; }
  .client-hero-name { font-size: 20px; }
  .client-hero-desc { display: none; }            /* description verbeuse masquee */
  .client-header-kind { font-size: 11px; }
  .client-mrr-lbl { display: none; }              /* label "Revenu mensuel" masque */
  .client-mrr { display: flex; align-items: baseline; gap: 8px; }  /* valeur + LTV sur une ligne */
  .client-mrr-val { font-size: 18px; }
  .client-mrr-sub { font-size: 11px; }
  .client-header-right { width: 100%; flex-direction: row; align-items: center; justify-content: space-between; gap: 12px; }
  #btn-portal { flex-shrink: 0; }
}


/* ----------------------------------------------------------------
   Mobile — barres horizontales independantes (la page ne bouge pas)
---------------------------------------------------------------- */
@media (max-width: 700px) {
  /* Onglets Finances/Studio : defilement horizontal dans la barre (comme .filter-bar) */
  .page-tabs {
    padding: 16px 20px 0;
    gap: 18px;
    overflow-x: auto;
    flex-wrap: nowrap;
    scrollbar-width: none;
  }
  .page-tabs::-webkit-scrollbar { display: none; }
  .page-tab { white-space: nowrap; flex-shrink: 0; }

  /* Legende calendrier : tout sur une ligne defilante (Interne reste avec Shoot/Publication/Livraison) */
  .cal-legend {
    padding: 12px 20px;
    gap: 16px;
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .cal-legend::-webkit-scrollbar { display: none; }
  .legend-item { flex-shrink: 0; white-space: nowrap; }
  .legend-sep { display: none; }

  /* Filet de securite : aucune page ne defile horizontalement (seules les barres ci-dessus le font) */
  .main-col { overflow-x: hidden; }
}


/* ----------------------------------------------------------------
   Mobile — en-tetes de carte empiles (fin des retours a la ligne mot-a-mot)
---------------------------------------------------------------- */
@media (max-width: 700px) {
  .sc-head { flex-direction: column; align-items: flex-start; justify-content: flex-start; gap: 14px; }
  .rev-chart-meta { justify-content: flex-start; gap: 24px; }
  .invoice-top { flex-wrap: wrap; gap: 8px; }
}

/* ----------------------------------------------------------------
   Mobile — agent studio occupe la hauteur d'ecran (plus de petite boite)
---------------------------------------------------------------- */
@media (max-width: 700px) {
  .page-body { padding: 16px 16px 24px; }
  .agent-chat { height: calc(100vh - 224px); height: calc(100dvh - 224px); min-height: 360px; }
}
