/* components.css — Composants réutilisables (Improved Agency v3.0) */

/* ─── TAB BAR ─────────────────────────────────────────────── */
.tab-bar {
  display: flex;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 4px;
  gap: 3px;
}
.tab-btn {
  flex: 1;
  border: none;
  background: transparent;
  color: var(--text-3);
  padding: 9px 12px;
  border-radius: 10px;
  font-size: 12px; font-weight: 700;
  font-family: var(--font-body);
  cursor: pointer;
  transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
  white-space: nowrap;
  letter-spacing: -0.01em;
}
.tab-btn.active {
  background: var(--bg-2);
  color: var(--text);
  box-shadow: var(--shadow-sm);
}
.tab-btn:not(.active):hover {
  color: var(--text-2);
  background: rgba(0,0,0,0.03);
}

/* Tab Pills (scrollable) */
.tab-pills {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding: 2px 0;
}
.tab-pills::-webkit-scrollbar { display: none; }
.tab-pill {
  flex-shrink: 0;
  border: 1.5px solid var(--border);
  background: var(--bg-2);
  color: var(--text-3);
  padding: 7px 16px;
  border-radius: 20px;
  font-size: 12px; font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  font-family: var(--font-body);
}
.tab-pill.active {
  background: var(--brand);
  color: white;
  border-color: var(--brand);
}

/* ─── TOGGLE SWITCH ───────────────────────────────────────── */
.switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  width: 48px;
  height: 28px;
  flex-shrink: 0;
}
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.slider {
  position: absolute;
  inset: 0;
  background: var(--bg-4);
  border-radius: 28px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1.5px solid var(--border);
}
.slider::before {
  content: '';
  position: absolute;
  height: 20px; width: 20px;
  left: 3px; bottom: 2px;
  background: white;
  border-radius: 50%;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 1px 4px rgba(0,0,0,0.18);
}
.switch input:checked + .slider {
  background: var(--brand);
  border-color: var(--brand-green-dark);
}
.switch input:checked + .slider::before {
  transform: translateX(20px);
}

/* ─── PROGRESS BAR ────────────────────────────────────────── */
.progress-bar-container {
  height: 6px;
  background: var(--bg-3);
  border-radius: 3px;
  overflow: hidden;
}
.progress-bar-fill {
  height: 100%;
  border-radius: 3px;
  background: var(--gradient-brand);
  transition: width 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}
.progress-bar-fill.gold { background: var(--gradient-gold); }
.progress-bar-fill.danger { background: var(--danger); }

/* ─── STEP INDICATOR ──────────────────────────────────────── */
.step-indicator {
  display: flex;
  align-items: center;
  gap: 0;
}
.step-dot {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--bg-3);
  border: 2px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 800;
  color: var(--text-3);
  transition: all 0.3s;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
}
.step-dot.active {
  background: var(--brand);
  border-color: var(--brand);
  color: white;
  box-shadow: var(--shadow-brand);
}
.step-dot.done {
  background: rgba(var(--brand-green-rgb), 0.15);
  border-color: var(--brand);
  color: var(--brand);
}
.step-line {
  flex: 1;
  height: 2px;
  background: var(--border);
  transition: background 0.3s;
  margin: 0 4px;
}
.step-line.done { background: var(--brand); }

/* ─── AMOUNT DISPLAY ──────────────────────────────────────── */
.amount-large {
  font-size: 28px; font-weight: 900;
  color: var(--brand); letter-spacing: -0.03em;
}
.amount-negative { color: var(--danger); }
.amount-positive { color: var(--success); }
.amount-neutral  { color: var(--text-2); }

/* ─── LIST ITEM ───────────────────────────────────────────── */
.list-item {
  display: flex; align-items: center; gap: 12px;
  padding: 14px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 16px;
  cursor: pointer;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.2s;
}
.list-item:hover { transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.list-item:active { transform: scale(0.97); }

/* ─── CARD INTERACTIVE (UX) ───────────────────────────────── */
.card-interactive {
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.2s, opacity 0.2s;
}
.card-interactive:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}
.card-interactive:active {
  transform: scale(0.96) translateY(0);
}
.list-item-avatar {
  width: 44px; height: 44px;
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; font-weight: 800;
  flex-shrink: 0;
}
.list-item-content { flex: 1; min-width: 0; }
.list-item-title {
  font-weight: 700; font-size: 15px; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.list-item-sub {
  font-size: 12px; color: var(--text-3); margin-top: 2px;
}
.list-item-right { text-align: right; flex-shrink: 0; }

/* ─── TRANSACTION ITEM ────────────────────────────────────── */
.tx-item {
  display: flex; align-items: center; gap: 12px;
  padding: 14px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 16px;
  animation: fadeUp 0.35s cubic-bezier(0.16,1,0.3,1) both;
}
.tx-icon {
  width: 40px; height: 40px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}
.tx-icon-in    { background: var(--success-bg); }
.tx-icon-out   { background: var(--danger-bg); }
.tx-icon-appro { background: var(--warning-bg); }

/* ─── STATUS LINE (invoice) ───────────────────────────────── */
.status-timeline {
  display: flex; align-items: center; gap: 0;
  padding: 16px;
  position: relative;
}
.status-step {
  display: flex; flex-direction: column; align-items: center;
  gap: 6px; flex: 1;
  position: relative;
}
.status-step-dot {
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--bg-3);
  border: 2px solid var(--border);
  transition: all 0.3s;
}
.status-step.done .status-step-dot   { background: var(--brand); border-color: var(--brand); }
.status-step.current .status-step-dot {
  background: var(--brand-yellow);
  border-color: var(--warning);
  box-shadow: 0 0 0 4px var(--gold-dim);
  animation: pulse-dot 1.5s infinite;
}
.status-step-label {
  font-size: 9px; font-weight: 700;
  color: var(--text-3); text-transform: uppercase;
  letter-spacing: 0.4px; text-align: center;
}
.status-step.done .status-step-label    { color: var(--brand); }
.status-step.current .status-step-label { color: var(--warning); }
.status-step-line {
  position: absolute;
  top: 5px; left: 50%; right: -50%;
  height: 2px;
  background: var(--border);
}
.status-step.done .status-step-line { background: var(--brand); }

/* ─── SUMMARY ROW ─────────────────────────────────────────── */
.summary-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.summary-row:last-child { border-bottom: none; }
.summary-label { font-size: 14px; color: var(--text-3); }
.summary-value { font-size: 14px; font-weight: 700; color: var(--text); }
.summary-row.total .summary-label { font-size: 16px; font-weight: 800; color: var(--text); }
.summary-row.total .summary-value { font-size: 20px; font-weight: 900; color: var(--brand); }

/* ─── SCORE RING ──────────────────────────────────────────── */
.score-ring {
  width: 48px; height: 48px;
  border-radius: 14px;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  border-width: 2.5px; border-style: solid;
  flex-shrink: 0;
}
.score-ring-value {
  font-size: 13px; font-weight: 900; line-height: 1;
}
.score-ring-label {
  font-size: 8px; font-weight: 700; text-transform: uppercase;
  opacity: 0.7;
}

/* ─── PIPELINE STAGES ─────────────────────────────────────── */
.pipeline-col {
  min-width: 280px;
  flex: 1;
  background: var(--bg-3);
  border-radius: 16px;
  padding: 12px;
  display: flex; flex-direction: column; gap: 8px;
}
@media (max-width: 768px) {
  .pipeline-col {
    min-width: 100%;
    margin-bottom: 8px;
  }
}
.pipeline-header {
  font-size: 11px; font-weight: 800;
  text-transform: uppercase; letter-spacing: 0.8px;
  color: var(--text-3);
  padding: 4px 4px 8px;
  display: flex; align-items: center; justify-content: space-between;
}
.pipeline-badge {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 2px 7px;
  font-size: 10px; font-weight: 800;
  color: var(--text-2);
}
.pipeline-card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  cursor: pointer;
  transition: all 0.2s;
}
.pipeline-card:hover  { transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.pipeline-card:active { transform: scale(0.97); }

/* ─── OVERDUE BANNER ──────────────────────────────────────── */
.overdue-banner {
  background: var(--danger-bg);
  border: 1px solid rgba(220, 38, 38, 0.2);
  border-radius: 12px;
  padding: 12px 16px;
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 16px;
}
.overdue-banner-icon {
  font-size: 20px; flex-shrink: 0;
}
.overdue-banner-text {
  flex: 1;
  font-size: 13px; font-weight: 600; color: var(--danger);
  line-height: 1.4;
}

/* ─── AI INSIGHT CARD ─────────────────────────────────────── */
.insight-card {
  background: var(--gold-dim);
  border: 1px solid rgba(var(--brand-yellow-rgb), 0.2);
  border-left: 3px solid var(--brand-yellow);
  border-radius: 0 14px 14px 0;
  padding: 14px 16px;
}
.insight-label {
  font-size: 10px; font-weight: 800;
  color: var(--warning);
  text-transform: uppercase; letter-spacing: 0.8px;
  margin-bottom: 6px;
  display: flex; align-items: center; gap: 6px;
}
.insight-text {
  font-size: 13px; color: var(--text-2); line-height: 1.6;
}

/* ─── KPI GRID ────────────────────────────────────────────── */
.kpi-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.kpi-card-inner {
  padding: 16px;
  border-radius: 20px;
}
.kpi-label {
  font-size: 10px; font-weight: 800;
  text-transform: uppercase; letter-spacing: 0.6px;
  opacity: 0.75; margin-bottom: 6px;
}
.kpi-value {
  font-size: 20px; font-weight: 900;
  letter-spacing: -0.03em; line-height: 1;
}
.kpi-sub {
  font-size: 10px; margin-top: 4px; opacity: 0.65;
}

/* ─── SUPPORT / WHATSAPP ──────────────────────────────────── */
.wa-bubble {
  max-width: 85%;
  padding: 10px 14px;
  font-size: 14px; line-height: 1.5;
  color: #111B21;
  border-radius: 12px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.12);
  position: relative;
  word-break: break-word;
}
.wa-bubble-out {
  background: #D9FDD3;
  border-radius: 12px 0 12px 12px;
  align-self: flex-end;
}
.wa-bubble-in {
  background: white;
  border-radius: 0 12px 12px 12px;
}
.wa-time {
  font-size: 10px; color: #667781; text-align: right; margin-top: 4px;
}

/* ─── SIDEBAR BRAND (desktop) ─────────────────────────────── */
#sidebar-brand {
  display: none;
  align-items: center; gap: 10px;
  padding: 20px 16px 16px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.sidebar-brand-text { min-width: 0; flex: 1; }
@media (min-width: 900px) {
  #sidebar-brand { display: flex !important; }
}
.sidebar-logo {
  width: 36px; height: 36px;
  border-radius: 10px;
  border: 1.5px solid rgba(var(--brand-green-rgb), 0.2);
  background: var(--bg-3);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.sidebar-logo img { width: 26px; height: 26px; object-fit: contain; }
.sidebar-title {
  font-size: 15px; font-weight: 800; color: var(--text); line-height: 1.2;
}
.sidebar-sub {
  font-size: 10px; color: var(--text-3); font-weight: 500;
}

/* ─── v5 Components (Spotify-structure lists / sections / stats) ─ */
.page-shell-v5 {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  max-height: 100dvh;
  background: var(--bg);
  overflow: hidden;
}
.page-shell-v5 .page-header {
  background:
    linear-gradient(180deg, rgba(242, 239, 233, 0.92) 0%, rgba(242, 239, 233, 0.78) 100%),
    var(--tribal-url) top center / 360px repeat;
  border-bottom: none;
  padding-bottom: 18px;
}
.page-shell-v5 .page-header__title {
  font-size: clamp(26px, 6vw, 32px);
  font-weight: 900;
  letter-spacing: -0.045em;
  line-height: 1.05;
  white-space: normal;
}
.page-shell-v5--profile .page-header {
  position: absolute;
  top: 0; left: 0; right: 0;
  z-index: 10;
  background: transparent;
  border-bottom: none;
  pointer-events: none;
}
.page-shell-v5--profile .page-header__main,
.page-shell-v5--profile .page-header__actions,
.page-shell-v5--profile .page-back {
  pointer-events: auto;
}
.page-shell-v5--profile .page-back,
.page-shell-v5--profile .page-header__actions .icon-btn {
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(10px);
}
.page-shell-v5 .page-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 8px var(--page-x, 16px) 24px;
}

.v5-section {
  margin-bottom: 22px;
}
.v5-section__title {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-4);
  margin: 0 0 10px 4px;
}

.v5-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md, 14px);
  margin-bottom: 8px;
  cursor: pointer;
  transition: transform var(--motion-fast, 120ms) var(--ease-out, ease),
    border-color var(--motion-fast, 120ms),
    box-shadow var(--motion-fast, 120ms);
  text-align: left;
  width: 100%;
  font-family: inherit;
  color: inherit;
}
.v5-row:active { transform: scale(0.985); }
.v5-row:hover { border-color: var(--border-2); box-shadow: var(--shadow-sm); }
.v5-row__icon {
  width: 44px; height: 44px;
  border-radius: 12px;
  background: rgba(var(--brand-green-rgb), 0.1);
  color: var(--brand);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}
.v5-row__icon img { width: 100%; height: 100%; object-fit: cover; }
.v5-row__body { flex: 1; min-width: 0; }
.v5-row__title {
  font-size: 15px; font-weight: 800; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.v5-row__sub {
  font-size: 12px; color: var(--text-3); margin-top: 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.v5-row__meta {
  font-size: 12px; font-weight: 700; color: var(--text-2);
  flex-shrink: 0; text-align: right;
}
.v5-row__chevron { color: var(--text-4); flex-shrink: 0; }

.v5-stat-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 18px;
}
@media (min-width: 900px) {
  .v5-stat-grid { grid-template-columns: repeat(4, 1fr); }
}
.v5-stat {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg, 18px);
  padding: 16px;
  position: relative;
  overflow: hidden;
}
.v5-stat--danger {
  border-color: rgba(220, 38, 38, 0.35);
  box-shadow: inset 3px 0 0 var(--danger);
}
.v5-stat--danger .v5-stat__value { color: var(--danger); }
.v5-stat[data-go] { cursor: pointer; }
.v5-stat[data-go]:hover { border-color: var(--border-2); }
.v5-invoice-row {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md, 14px);
  box-shadow: var(--shadow-sm);
}
.v5-invoice-row:hover { border-color: var(--border-2); }
.v5-stat::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--tribal-url) center / 200px;
  opacity: 0.04;
  pointer-events: none;
}
.v5-stat__label {
  font-size: 11px; font-weight: 800; text-transform: uppercase;
  letter-spacing: 0.06em; color: var(--text-4); margin-bottom: 6px;
  position: relative; z-index: 1;
}
.v5-stat__value {
  font-size: 22px; font-weight: 900; letter-spacing: -0.03em;
  color: var(--text); position: relative; z-index: 1;
}
.v5-stat__hint {
  font-size: 11px; color: var(--text-3); margin-top: 4px;
  position: relative; z-index: 1;
}

.v5-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: var(--radius-pill, 999px);
  font-size: 11px; font-weight: 800;
  background: rgba(var(--brand-green-rgb), 0.1); color: var(--brand);
}

.v5-hero {
  padding: 8px 0 18px;
}
.v5-hero__eyebrow {
  font-size: 11px; font-weight: 800; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--brand); margin-bottom: 6px;
}
.v5-hero__title {
  font-size: clamp(28px, 7vw, 36px); font-weight: 900;
  letter-spacing: -0.045em; line-height: 1.05; color: var(--text);
  margin: 0 0 6px;
}
.v5-hero__sub { font-size: 14px; color: var(--text-3); font-weight: 500; }

.empty-state--tribal {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-xl, 24px);
  border: 1px dashed var(--border-2);
  background: var(--bg-2);
}
.empty-state--tribal::before {
  content: "";
  position: absolute; inset: 0;
  background: var(--tribal-url) center / 280px;
  opacity: 0.05; pointer-events: none;
}

.sheet-box {
  background-image: linear-gradient(180deg, rgba(242,239,233,0.5) 0%, transparent 120px),
    var(--tribal-url);
  background-size: auto, 280px;
  background-position: top, top center;
  background-repeat: no-repeat, repeat;
}
[data-theme="dark"] .sheet-box {
  background-image: linear-gradient(180deg, rgba(15,13,10,0.7) 0%, transparent 120px),
    var(--tribal-url);
}

.sheet.sheet--v5 {
  background-image: linear-gradient(180deg, rgba(242,239,233,0.55) 0%, transparent 120px),
    var(--tribal-url),
    var(--bg);
  background-size: auto, 280px, auto;
  background-position: top, top center, center;
  background-repeat: no-repeat, repeat, no-repeat;
}
[data-theme="dark"] .sheet.sheet--v5 {
  background-image: linear-gradient(180deg, rgba(15,13,10,0.75) 0%, transparent 120px),
    var(--tribal-url),
    var(--bg);
}

.v5-list-stagger > * {
  animation: v5StaggerIn var(--motion-slow, 280ms) var(--ease-out, ease) both;
}
.v5-list-stagger > *:nth-child(1) { animation-delay: 0ms; }
.v5-list-stagger > *:nth-child(2) { animation-delay: 40ms; }
.v5-list-stagger > *:nth-child(3) { animation-delay: 80ms; }
.v5-list-stagger > *:nth-child(4) { animation-delay: 120ms; }
.v5-list-stagger > *:nth-child(5) { animation-delay: 160ms; }
.v5-list-stagger > *:nth-child(6) { animation-delay: 200ms; }
.v5-list-stagger > *:nth-child(n+7) { animation-delay: 240ms; }
@keyframes v5StaggerIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

/* ─── V5 ONBOARDING POPUP ─────────────────────────────────── */
#v5-confetti-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 10060;
  overflow: hidden;
}
.v5-confetti-piece {
  position: fixed;
  top: -12px;
  opacity: 0.95;
  animation: v5ConfettiFall ease-in forwards;
}
@keyframes v5ConfettiFall {
  to { transform: translateY(110vh) rotate(720deg); opacity: 0; }
}

body.v5-onboarding-open { overflow: hidden; }

.v5-onboarding-overlay {
  position: fixed;
  inset: 0;
  z-index: 10050;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(16px, env(safe-area-inset-top)) 16px max(16px, env(safe-area-inset-bottom));
  background: rgba(15, 13, 10, 0.55);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.35s var(--ease-out, ease), visibility 0.35s;
}
.v5-onboarding-overlay--open {
  opacity: 1;
  visibility: visible;
}

.v5-onboarding-card {
  width: 100%;
  max-width: 520px;
  max-height: min(92dvh, 720px);
  display: flex;
  flex-direction: column;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 28px;
  box-shadow: 0 24px 80px rgba(15, 13, 10, 0.22);
  overflow: hidden;
  transform: scale(0.92) translateY(24px);
  transition: transform 0.45s cubic-bezier(0.34, 1.4, 0.64, 1);
}
.v5-onboarding-overlay--open .v5-onboarding-card {
  transform: scale(1) translateY(0);
}

.v5-onboarding-hero {
  position: relative;
  padding: 28px 24px 22px;
  text-align: center;
  color: #fff;
  background:
    linear-gradient(145deg, rgba(0, 132, 95, 0.95) 0%, rgba(0, 92, 66, 0.98) 55%, rgba(249, 208, 67, 0.35) 100%),
    var(--tribal-url) center / cover;
  overflow: hidden;
}
.v5-onboarding-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 80% 0%, rgba(249, 208, 67, 0.25), transparent 55%);
  pointer-events: none;
}
.v5-onboarding-badge {
  position: relative;
  z-index: 1;
  display: inline-block;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.25);
  margin-bottom: 14px;
}
.v5-onboarding-logo {
  position: relative;
  z-index: 1;
  margin: 0 auto 14px;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.2));
}
.v5-onboarding-title {
  position: relative;
  z-index: 1;
  font-size: clamp(22px, 5vw, 28px);
  font-weight: 900;
  letter-spacing: -0.04em;
  line-height: 1.1;
  margin: 0 0 10px;
}
.v5-onboarding-lead {
  position: relative;
  z-index: 1;
  font-size: 14px;
  line-height: 1.5;
  opacity: 0.92;
  margin: 0 auto 14px;
  max-width: 400px;
}
.v5-onboarding-chips {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
}
.v5-onboarding-chip {
  font-size: 10px;
  font-weight: 800;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.22);
}

.v5-onboarding-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 18px 20px 8px;
  -webkit-overflow-scrolling: touch;
}
.v5-onboarding-section-title {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-4);
  margin-bottom: 12px;
}
.v5-onboarding-guide {
  list-style: none;
  margin: 0 0 16px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.v5-onboarding-guide__item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 12px 14px;
  border-radius: 16px;
  background: var(--bg-3);
  border: 1px solid var(--border);
}
.v5-onboarding-guide__icon {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: rgba(0, 132, 95, 0.12);
  color: var(--brand);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.v5-onboarding-guide__title {
  font-size: 13px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 3px;
}
.v5-onboarding-guide__text {
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--text-2);
}

.v5-onboarding-footer {
  flex-shrink: 0;
  padding: 14px 20px 20px;
  border-top: 1px solid var(--border);
  background: var(--bg-2);
}
.v5-onboarding-counter {
  display: block;
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-4);
  margin-bottom: 10px;
}

/* ── Calendrier éditorial (livraison / plan com) ── */
.dlv-cal {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 14px;
}
.dlv-cal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.dlv-cal__title {
  font-size: 15px;
  font-weight: 900;
  color: var(--text);
}
.dlv-cal__nav {
  width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg);
  color: var(--text-2);
  font-size: 20px;
  cursor: pointer;
  font-family: inherit;
}
.dlv-cal__dow {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  margin-bottom: 6px;
}
.dlv-cal__dow span {
  text-align: center;
  font-size: 10px;
  font-weight: 800;
  color: var(--text-4);
  text-transform: uppercase;
}
.dlv-cal__grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}
.dlv-cal__day {
  aspect-ratio: 1;
  min-height: 44px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: var(--bg);
  cursor: pointer;
  font-family: inherit;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 4px;
  transition: border-color 0.15s, background 0.15s, transform 0.1s;
}
.dlv-cal__day:active { transform: scale(0.96); }
.dlv-cal__day--outside { opacity: 0.35; }
.dlv-cal__day--today { border-color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand); }
.dlv-cal__day--has {
  background: color-mix(in srgb, var(--cal-accent, var(--brand)) 12%, var(--bg));
  border-color: color-mix(in srgb, var(--cal-accent, var(--brand)) 35%, transparent);
}
.dlv-cal__day--plan:not(.dlv-cal__day--has):hover {
  border-color: var(--brand);
  background: rgba(var(--brand-green-rgb), 0.06);
}
.dlv-cal__day--plan.dlv-cal__day--has {
  cursor: pointer;
}
.dlv-cal__day--plan.dlv-cal__day--has:hover {
  border-color: color-mix(in srgb, var(--cal-accent, var(--brand)) 55%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--cal-accent, var(--brand)) 35%, transparent);
}
.dlv-cal__num {
  font-size: 13px;
  font-weight: 800;
  color: var(--text);
  line-height: 1;
}
.dlv-cal__dots {
  display: flex;
  gap: 3px;
  align-items: center;
}
.dlv-cal__dots i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  display: block;
}
.dlv-cal__hint {
  font-size: 11px;
  font-weight: 800;
  color: var(--brand);
  opacity: 0.5;
}
.dlv-cal__plan-edit {
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 1px;
  color: var(--text-4);
  line-height: 1;
  margin-top: 1px;
}
.dlv-cal--compact .dlv-cal__day { min-height: 38px; }
.dlv-cal__day--preview {
  min-height: 52px;
  align-items: flex-start;
  padding-top: 6px;
}
.dlv-cal__label {
  font-size: 9px;
  font-weight: 800;
  color: var(--cal-accent, var(--brand));
  line-height: 1.15;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: block;
  margin-top: 2px;
}
.cp-plat-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.cp-plat-chip {
  min-height: 40px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1.5px solid var(--border);
  background: var(--bg);
  font-size: 12px;
  font-weight: 800;
  color: var(--text-2);
  cursor: pointer;
  font-family: inherit;
}
.cp-plat-chip--on {
  border-color: var(--brand);
  background: rgba(var(--brand-green-rgb, 0, 132, 95), 0.12);
  color: var(--brand);
}
.dlv-plan-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--bg);
  margin-bottom: 14px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-2);
}
.dlv-plan-toggle input { width: 18px; height: 18px; accent-color: var(--brand); }
.dlv-plan-toggle--on {
  border-color: var(--brand);
  background: rgba(var(--brand-green-rgb), 0.08);
  color: var(--brand);
}

/* ── Saisie vocale ───────────────────────────────────────────────────────── */
.voice-field-wrap {
  position: relative;
  width: 100%;
}
.voice-field-wrap textarea,
.voice-field-wrap input.form-input,
.voice-field-wrap .gw-composer-input,
.voice-field-wrap [contenteditable] {
  padding-right: 48px !important;
}
.voice-mic-btn {
  position: absolute;
  right: 8px;
  bottom: 8px;
  width: 36px;
  height: 36px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg-2);
  color: var(--text-2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 2;
  padding: 0;
  line-height: 0;
  font-family: inherit;
  transition: background .15s, color .15s, border-color .15s, transform .15s;
}
.voice-mic-btn:hover {
  border-color: var(--brand);
  color: var(--brand);
  background: rgba(var(--brand-green-rgb), 0.08);
}
.voice-mic-btn--on {
  background: #dc2626;
  border-color: #dc2626;
  color: #fff;
  animation: voice-pulse 1.2s ease-in-out infinite;
}
.voice-mic-btn--busy {
  opacity: 0.7;
  pointer-events: none;
}
.voice-mic-btn--disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.voice-field-wrap--listening textarea,
.voice-field-wrap--listening input,
.voice-field-wrap--listening [contenteditable] {
  border-color: #dc2626 !important;
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.12);
}
@keyframes voice-pulse {
  0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.45); }
  50% { transform: scale(1.05); box-shadow: 0 0 0 8px rgba(220, 38, 38, 0); }
}


