/* assets/style.css — Portail Client Kevin Parent */
/* ============================================================
   EXTENSIONS — classes générées par les nouveaux fichiers PHP
   ============================================================ */

/* Layout body */
.layout-body { display: flex; min-height: 100vh; }

/* Sidebar items (alias de .nav-item) */
.sidebar-logo  { padding: 24px 20px 16px; border-bottom: 1px solid rgba(255,255,255,.06); }
.sidebar-brand { display: block; text-decoration: none; font-size: 18px; font-weight: 800; color: #fff; letter-spacing: -.3px; }
.sidebar-brand span { color: var(--violet); }
.sidebar-brand-sub { font-size: 11px; color: var(--slate500); margin-top: 6px; display: block; }

/* Logo image sur fond blanc dans la sidebar sombre */
.sidebar-logo-img {
  display: inline-flex;
  align-items: center;
  background: #fff;
  border-radius: 10px;
  padding: 7px 14px;
}
.sidebar-logo-img img {
  height: 32px;
  width: auto;
  display: block;
  object-fit: contain;
}

/* Logo mobile header */
.mobile-logo-img {
  height: 26px;
  width: auto;
  display: block;
  object-fit: contain;
}

.sidebar-link { display: flex; align-items: center; gap: 10px; padding: 9px 10px; margin: 1px 8px; border-radius: 8px; color: var(--slate400); font-size: 13.5px; font-weight: 500; transition: background .18s, color .18s; position: relative; text-decoration: none; }
.sidebar-link:hover { background: rgba(255,255,255,.06); color: #fff; text-decoration: none; }
.sidebar-link.active { background: linear-gradient(90deg, rgba(91,75,255,.22) 0%, rgba(14,165,233,.10) 100%); color: #fff; }
.sidebar-link-icon { width: 18px; height: 18px; flex-shrink: 0; display: flex; align-items: center; }
.sidebar-link-label { flex: 1; }
.sidebar-badge { background: var(--violet); color: #fff; font-size: 10px; font-weight: 700; padding: 1px 6px; border-radius: 20px; min-width: 18px; text-align: center; margin-left: auto; }

.sidebar-footer { padding: 14px 12px; border-top: 1px solid rgba(255,255,255,.06); }
.sidebar-user { display: flex; align-items: center; gap: 10px; }
.sidebar-avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--violet); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; flex-shrink: 0; }
.sidebar-user-info { flex: 1; min-width: 0; }
.sidebar-user-name { font-size: 13px; font-weight: 600; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user-role { font-size: 11px; color: var(--slate500); margin-top: 1px; }
.sidebar-logout { color: var(--slate500); padding: 6px; border-radius: 6px; display: flex; align-items: center; transition: color .15s, background .15s; }
.sidebar-logout:hover { color: var(--red); background: rgba(239,68,68,.1); text-decoration: none; }

/* Main content alias */
.main-content { margin-left: var(--sidebar-w); flex: 1; min-width: 0; padding: 32px 36px; min-height: 100vh; overflow-x: hidden; background: radial-gradient(900px circle at 100% 0%, rgba(14,165,233,.06), transparent 50%), radial-gradient(700px circle at 0% 30%, rgba(91,75,255,.05), transparent 50%), var(--fond); }

/* Page sub */
.page-sub { font-size: 14px; color: var(--slate500); margin-top: 4px; }

/* Stats grid (4 colonnes fixes) */
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; margin-bottom: 28px; }
.stat-icon--purple { background: rgba(91,75,255,.1);  color: var(--violet); }
.stat-icon--blue   { background: rgba(14,165,233,.1); color: var(--bleu); }
.stat-icon--green  { background: rgba(34,197,94,.1);  color: var(--green); }
.stat-icon--red    { background: rgba(239,68,68,.1);  color: var(--red); }

/* Dashboard two-col */
.dashboard-grid { display: grid; grid-template-columns: 3fr 2fr; gap: 24px; align-items: stretch; }

/* Table helpers */
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table thead tr { border-bottom: 1.5px solid var(--slate200); }
.table th { padding: 8px 12px; text-align: left; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--slate500); }
.table td { padding: 13px 12px; border-bottom: 1px solid var(--slate100); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: none; }
.table-row-link { cursor: pointer; transition: background .12s; }
.table-row-link:hover { background: var(--slate50); }
.table-link { color: var(--slate900); font-weight: 600; }
.table-link:hover { color: var(--violet); }
.table-empty { color: var(--slate500); font-style: italic; padding: 24px 12px; }

/* Progress variants */
.progress-block-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.progress-block-label { font-size: 13px; color: var(--slate500); }
.progress-block-pct   { font-size: 13px; font-weight: 700; color: var(--slate900); }
.progress-mini { height: 4px; background: var(--slate200); border-radius: 10px; overflow: hidden; width: 80px; display: inline-block; vertical-align: middle; }
.progress-mini-bar { height: 100%; background: linear-gradient(90deg, var(--violet), var(--bleu)); border-radius: 10px; }
.progress-mini-label { font-size: 12px; color: var(--slate500); margin-left: 8px; font-weight: 500; }
.progress-bar--lg { height: 10px; }
.progress-fill--green { background: linear-gradient(90deg, #22c55e, #16a34a); }

/* Notifications feed */
.notif-list { display: flex; flex-direction: column; }
.notif-item { display: flex; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--slate100); }
.notif-item:last-child { border-bottom: none; }
.notif-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--violet); margin-top: 6px; flex-shrink: 0; }
.notif-dot--read { background: var(--slate200); }
.notif-body { flex: 1; }
.notif-title { font-size: 13.5px; font-weight: 600; color: var(--slate900); }
.notif-msg   { font-size: 12.5px; color: var(--slate500); margin-top: 2px; }
.notif-time  { font-size: 11.5px; color: var(--slate400); margin-top: 4px; }
.notif-unread .notif-dot { background: var(--violet); }

/* Quick cards (client dashboard) */
.quick-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 28px; }
.quick-card { background: var(--white); border-radius: 14px; box-shadow: var(--shadow); padding: 20px; display: flex; align-items: center; gap: 14px; border: 1.5px solid transparent; text-decoration: none; transition: box-shadow .15s, transform .12s; }
.quick-card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); text-decoration: none; }
.quick-card--alert { border-color: rgba(239,68,68,.25); background: #fff8f8; }
.quick-card--warn  { border-color: rgba(245,158,11,.25); background: #fffbf0; }
.quick-card-icon { width: 42px; height: 42px; border-radius: 10px; background: rgba(91,75,255,.08); color: var(--violet); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.quick-card--alert .quick-card-icon { background: rgba(239,68,68,.08); color: var(--red); }
.quick-card--warn  .quick-card-icon { background: rgba(245,158,11,.08); color: var(--yellow); }
.quick-card-body { flex: 1; }
.quick-card-value    { font-size: 22px; font-weight: 800; color: var(--slate900); line-height: 1; }
.quick-card-value-sm { font-size: 14px; font-weight: 700; color: var(--slate900); line-height: 1.3; }
.quick-card-label    { font-size: 12px; color: var(--slate500); margin-top: 4px; }

/* Project hero (client) */
.project-hero-card { margin-bottom: 24px; }
.project-hero-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 20px; gap: 12px; }
.project-hero-name { font-size: 18px; font-weight: 700; color: var(--slate900); line-height: 1.3; }
.project-type-tag { font-size: 12px; color: var(--slate500); margin-top: 4px; display: block; }
.project-next-step { margin-top: 16px; padding: 12px 16px; background: var(--slate50); border-radius: 8px; display: flex; gap: 12px; align-items: flex-start; border-left: 3px solid var(--violet); }
.next-step-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--slate500); white-space: nowrap; padding-top: 1px; }
.next-step-text  { font-size: 13.5px; color: var(--slate900); font-weight: 500; }
.project-meta { display: flex; gap: 20px; flex-wrap: wrap; margin-top: 12px; }
.project-meta-item { font-size: 12.5px; color: var(--slate500); display: flex; align-items: center; gap: 5px; }

/* Badge lg */
.badge-lg { padding: 5px 14px; font-size: 13px; }

/* Inline form */
.inline-form { display: inline; }

/* Timeline variants (liste plate sans barre) */
.timeline-item.flat { padding: 14px 0; border-bottom: 1px solid var(--slate100); }
.timeline-icon-box { width: 36px; height: 36px; border-radius: 10px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.timeline-icon-box svg { width: 16px; height: 16px; }
.timeline-body { flex: 1; }
.timeline-author { color: var(--slate400); font-size: 11.5px; }

/* ── Project detail ─────────────────────────────────────────── */
/* Wrapper avec max-width pour éviter l'étirement sur grands écrans */
.project-detail-wrap {
  max-width: 1100px;
  width: 100%;
  overflow: hidden; /* empêche le contenu interne d'étirer la page */
}

/* Hero header : nom + badge + client + actions */
.project-hero {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px 28px;
  margin-bottom: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: 100%;
  box-sizing: border-box;
  min-width: 0;
}
.project-hero-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.project-hero-title {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  width: 100%;
  min-width: 0;
}
.project-hero-title .page-title {
  margin: 0;
  min-width: 0;
  max-width: 100%;
  overflow-wrap: break-word;
  word-break: break-word;
  white-space: normal;
  flex: 1 1 180px;
}
.project-hero-meta {
  font-size: 13px;
  color: var(--slate500);
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  overflow-wrap: break-word;
  word-break: break-all;  /* coupe les emails/URLs longs */
  min-width: 0;
}
.project-hero-meta strong { color: var(--slate700); }
.project-hero-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* Stepper de phases */
.phase-stepper {
  display: flex;
  align-items: center;
  gap: 0;
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px 20px;
  margin-bottom: 20px;
  overflow-x: auto;
}
.phase-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  min-width: 80px;
}
.phase-dot {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  background: var(--slate200);
  color: var(--slate500);
  border: 2px solid var(--slate200);
  transition: all .2s;
}
.phase-step.done .phase-dot {
  background: var(--green);
  border-color: var(--green);
  color: white;
}
.phase-step.active .phase-dot {
  background: var(--violet);
  border-color: var(--violet);
  color: white;
  box-shadow: 0 0 0 4px rgba(91,75,255,.15);
}
.phase-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--slate400);
  text-align: center;
  line-height: 1.2;
  white-space: nowrap;
}
.phase-step.done .phase-label  { color: var(--green); }
.phase-step.active .phase-label { color: var(--violet); }
.phase-line {
  flex: 1;
  height: 2px;
  background: var(--slate200);
  min-width: 16px;
  margin-bottom: 22px; /* aligner avec le centre des dots */
}
.phase-line.done { background: var(--green); }

/* Phase step cliquable (admin) */
.phase-step-form { display: contents; } /* ne pas casser le flex du stepper */
.phase-step-btn {
  all: unset; /* reset bouton */
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  min-width: 80px;
  cursor: pointer;
  border-radius: 10px;
  padding: 6px 4px;
  transition: background .15s;
}
.phase-step-btn:hover { background: rgba(91,75,255,.06); }
.phase-step-btn:focus-visible { outline: 2px solid var(--violet); outline-offset: 2px; }
.phase-step-btn.active .phase-dot { background: var(--violet); border-color: var(--violet); color: white; box-shadow: 0 0 0 4px rgba(91,75,255,.15); }
.phase-step-btn.done .phase-dot  { background: var(--green); border-color: var(--green); color: white; }
.phase-step-btn.done .phase-label  { color: var(--green); }
.phase-step-btn.active .phase-label { color: var(--violet); }
.phase-step-btn:not(.done):not(.active):hover .phase-dot { border-color: var(--violet); color: var(--violet); background: rgba(91,75,255,.07); }
.phase-step-btn:not(.done):not(.active):hover .phase-label { color: var(--violet); }

/* Ancien header (conservé pour compatibilité) */
.project-detail-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.project-detail-title-block { flex: 1; min-width: 0; }
.project-detail-meta { font-size: 13px; color: var(--slate500); margin-top: 6px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.project-detail-actions { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }

.two-col-layout { display: grid; grid-template-columns: 3fr 2fr; gap: 24px; align-items: start; }
.project-sidebar { display: flex; flex-direction: column; gap: 24px; }

/* Project list cards */
.project-cards-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px,1fr)); gap: 20px; }
.project-card { background: var(--white); border-radius: 14px; box-shadow: var(--shadow); padding: 22px; cursor: pointer; transition: box-shadow .15s, transform .12s; display: block; border: 1.5px solid transparent; text-decoration: none; }
.project-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); border-color: rgba(91,75,255,.15); text-decoration: none; }
.project-card-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin-bottom: 8px; }
.project-card-title  { font-size: 15px; font-weight: 700; color: var(--slate900); line-height: 1.3; }
.project-card-client { font-size: 13px; color: var(--slate500); margin-bottom: 4px; }
.project-card-type   { font-size: 12px; color: var(--slate400); margin-bottom: 8px; }
.project-card-footer { font-size: 12px; color: var(--slate500); margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--slate100); }

/* Breadcrumb aliases */
.breadcrumb-link    { color: var(--slate500); }
.breadcrumb-link:hover { color: var(--violet); text-decoration: none; }
.breadcrumb-sep     { color: var(--slate300); margin: 0 2px; }
.breadcrumb-current {
  color: var(--slate700);
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 200px;
  display: inline-block;
  vertical-align: middle;
}

/* Planning list in sidebar (ancien — conservé pour compatibilité) */
.planning-list { display: flex; flex-direction: column; gap: 0; }
.planning-item { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--slate100); align-items: flex-start; }
.planning-item:last-child { border-bottom: none; }
.planning-dot  { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; margin-top: 4px; }
.planning-body { flex: 1; }
.planning-title { font-size: 13.5px; font-weight: 600; color: var(--slate900); }
.planning-date  { font-size: 12px; color: var(--slate500); margin-top: 2px; }
.planning-type  { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; margin-top: 2px; display: block; }

/* Fix padding : contenu direct dans .card sans .card-body */
.card > .timeline        { padding-top: 16px; padding-right: 20px; padding-bottom: 8px; }
.card > .plan-event-list { padding: 8px 16px 4px; }
.card > .resource-list   { padding: 8px 16px 4px; }

/* Nouveau design : Prochains événements */
.plan-event-list { display: flex; flex-direction: column; gap: 2px; }
.plan-event-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 4px;
  border-bottom: 1px solid var(--slate100);
  transition: background .12s;
  border-radius: 8px;
}
.plan-event-item:last-child { border-bottom: none; }
.plan-event-item:hover { background: var(--fond); }

/* Bloc date calendrier */
.plan-event-date-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 44px;
  min-height: 48px;
  background: var(--ev-bg, rgba(91,75,255,.10));
  border-radius: 10px;
  gap: 0;
}
.plan-event-day {
  font-size: 18px;
  font-weight: 800;
  line-height: 1.1;
  color: var(--ev-color, var(--violet));
  letter-spacing: -.5px;
}
.plan-event-mon {
  font-size: 9.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--ev-color, var(--violet));
  opacity: .75;
}

/* Contenu */
.plan-event-body { flex: 1; min-width: 0; }
.plan-event-title {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--slate900);
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.plan-event-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 5px;
  flex-wrap: wrap;
}
.plan-event-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 99px;
}
.plan-event-time {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 11px;
  color: var(--slate500);
}

/* Toggle "Notifier le client" dans les modals */
.notify-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--fond);
  border-radius: 9px;
  margin-top: 4px;
}
.notify-toggle {
  position: relative;
  display: inline-block;
  width: 36px;
  height: 20px;
  flex-shrink: 0;
  cursor: pointer;
}
.notify-toggle input { opacity: 0; width: 0; height: 0; position: absolute; }
.notify-slider {
  position: absolute;
  inset: 0;
  background: var(--slate200);
  border-radius: 99px;
  transition: background .2s;
  cursor: pointer;
}
.notify-slider::before {
  content: '';
  position: absolute;
  width: 14px; height: 14px;
  left: 3px; top: 3px;
  background: white;
  border-radius: 50%;
  transition: transform .2s;
  box-shadow: 0 1px 3px rgba(0,0,0,.2);
}
.notify-toggle input:checked + .notify-slider { background: var(--violet); }
.notify-toggle input:checked + .notify-slider::before { transform: translateX(16px); }
.notify-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--slate700);
  cursor: pointer;
  user-select: none;
}

/* Toggle notify global pour le stepper (admin) */
.stepper-notify-bar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 8px 20px 0;
  font-size: 12px;
  color: var(--slate400);
}
.stepper-notify-bar .notify-label { font-size: 12px; color: var(--slate400); }

/* Module Ressources (liens utiles) */
.resource-list { display: flex; flex-direction: column; gap: 2px; }
.resource-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 4px;
  border-bottom: 1px solid var(--slate100);
  transition: background .12s;
  border-radius: 8px;
}
.resource-item:last-child { border-bottom: none; }
.resource-item:hover { background: var(--fond); }
.resource-icon {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  background: rgba(91,75,255,.10);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--violet);
}
.resource-body { flex: 1; min-width: 0; }
.resource-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--slate900);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.resource-url {
  font-size: 11.5px;
  color: var(--slate400);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}
.resource-link {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--violet);
  text-decoration: none;
  flex-shrink: 0;
  padding: 5px 10px;
  background: rgba(91,75,255,.07);
  border-radius: 7px;
  transition: background .15s;
}
.resource-link:hover { background: rgba(91,75,255,.14); text-decoration: none; }

/* Screenshot thumbnail dans resource-item */
.resource-thumb-wrap { flex-shrink: 0; border-radius: 8px; overflow: hidden; width: 52px; height: 38px; display: block; }
.resource-thumb      { width: 52px; height: 38px; object-fit: cover; display: block; transition: opacity .15s; }
.resource-thumb-wrap:hover .resource-thumb { opacity: .85; }

/* Toggle type lien/screenshot dans modal */
.res-type-toggle {
  display: flex;
  background: var(--slate100);
  border-radius: 10px;
  padding: 3px;
  gap: 3px;
  margin-bottom: 20px;
}
.res-type-btn {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 12px;
  border: none;
  background: transparent;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--slate500);
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  transition: all .15s;
}
.res-type-btn.active {
  background: var(--white);
  color: var(--slate900);
  box-shadow: 0 1px 4px rgba(0,0,0,.1);
}

/* Zone upload screenshot */
.sc-upload-zone {
  display: block;
  border: 2px dashed var(--slate200);
  border-radius: 12px;
  transition: border-color .15s, background .15s;
  cursor: pointer;
  overflow: hidden;
}
.sc-upload-zone:hover,
.sc-upload-zone.drag-over { border-color: var(--violet); background: rgba(91,75,255,.04); }
.sc-upload-label {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 28px 20px;
  cursor: pointer;
  color: var(--slate400);
  pointer-events: none;
}
.sc-upload-label svg { color: var(--slate300); }
.sc-upload-text { font-size: 13px; color: var(--slate600); text-align: center; }
.sc-upload-text strong { color: var(--violet); }
.sc-upload-sub  { font-size: 11px; color: var(--slate400); }
.sc-upload-zone input[type="file"] {
  position: absolute; top: 0; left: 0;
  width: 100%; height: 100%;
  opacity: 0; cursor: pointer; font-size: 0;
}
/* Preview */
.sc-preview {
  position: relative;
  padding: 8px;
  background: var(--fond);
}
.sc-preview img {
  width: 100%;
  max-height: 180px;
  object-fit: cover;
  border-radius: 8px;
  display: block;
}
.sc-preview-remove {
  position: absolute;
  top: 14px; right: 14px;
  width: 24px; height: 24px;
  border-radius: 50%;
  background: rgba(15,23,42,.6);
  border: none;
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

/* Modal: [hidden] support + data-modal */
.modal-overlay[hidden] { display: none !important; }

/* Form control alias */
.form-control { width: 100%; padding: 10px 13px; border: 1.5px solid var(--slate200); border-radius: 8px; font-size: 14px; color: var(--slate800); background: #fff; outline: none; transition: border-color .15s, box-shadow .15s; font-family: 'Inter', sans-serif; }
.form-control:focus { border-color: var(--violet); box-shadow: 0 0 0 3px rgba(91,75,255,.1); }
textarea.form-control { resize: vertical; min-height: 90px; }
select.form-control { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2394a3b8' d='M6 8L1 3h10L6 8z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; padding-right: 32px; }

/* Empty state sm */
.empty-state-sm { color: var(--slate400); font-size: 13px; padding: 16px 24px; font-style: italic; }

/* Required */
.required { color: var(--red); }

/* Messaging layout */
.messaging-layout { display: flex; background: var(--white); border-radius: 14px; box-shadow: var(--shadow); overflow: hidden; height: calc(100vh - 160px); min-height: 480px; border: 1px solid var(--slate200); }
.messaging-sidebar { width: 280px; border-right: 1px solid var(--slate200); overflow-y: auto; flex-shrink: 0; background: var(--slate50); }
.messaging-main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.messaging-header { display: flex; align-items: center; justify-content: space-between; padding: 16px 24px; border-bottom: 1px solid var(--slate200); background: var(--white); flex-shrink: 0; }
.messaging-header-info { flex: 1; min-width: 0; }
.messaging-conv-title { font-size: 15px; font-weight: 700; color: var(--slate900); }
.messaging-conv-sub   { font-size: 12px; color: var(--slate500); margin-top: 2px; }
.messaging-feed { flex: 1; overflow-y: auto; padding: 20px 24px; display: flex; flex-direction: column; gap: 6px; background: var(--slate50); }
.messaging-empty { display: flex; align-items: center; justify-content: center; height: 100%; color: var(--slate500); font-size: 14px; }
.messaging-no-msg { text-align: center; color: var(--slate500); font-size: 13px; margin: auto; padding: 40px 0; }
.messaging-input-area { padding: 14px 16px; border-top: 1px solid var(--slate200); background: var(--white); flex-shrink: 0; }
.messaging-form { display: flex; align-items: flex-end; gap: 10px; }
.messaging-textarea { flex: 1; resize: none; border: 1.5px solid var(--slate200); border-radius: 12px; padding: 10px 14px; font-size: 13.5px; color: var(--slate800); background: var(--slate50); outline: none; transition: border-color .15s; line-height: 1.5; max-height: 120px; font-family: 'Inter', sans-serif; }
.messaging-textarea:focus { border-color: var(--violet); background: #fff; }
.btn-send { width: 42px; height: 42px; border-radius: 50%; background: var(--violet); color: #fff; border: none; display: flex; align-items: center; justify-content: center; cursor: pointer; flex-shrink: 0; transition: background .15s; }
.btn-send:hover { background: #4a3ae0; }

.conv-item  { display: flex; align-items: center; gap: 11px; padding: 13px 16px; cursor: pointer; border-bottom: 1px solid var(--slate200); transition: background var(--transition); text-decoration: none; }
.conv-item:hover { background: var(--slate100); text-decoration: none; }
.conv-item.active { background: var(--white); border-left: 3px solid var(--violet); }
.conv-avatar { width: 38px; height: 38px; border-radius: 50%; background: var(--violet); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; flex-shrink: 0; }
.conv-body   { flex: 1; min-width: 0; }
.conv-header-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 6px; }
.conv-name   { font-size: 13.5px; font-weight: 700; color: var(--slate900); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conv-time   { font-size: 11px; color: var(--slate400); flex-shrink: 0; }
.conv-project-name { font-size: 12px; color: var(--slate500); margin: 1px 0 3px; }
.conv-preview { font-size: 12.5px; color: var(--slate500); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conv-badge  { background: var(--violet); color: #fff; font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 20px; margin-left: auto; flex-shrink: 0; }

/* Message bubbles */
.msg-row { display: flex; align-items: flex-end; gap: 8px; margin-bottom: 6px; }
.msg-row--me    { justify-content: flex-end; }
.msg-row--other { justify-content: flex-start; }
.msg-avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--slate700); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 700; flex-shrink: 0; }
.msg-bubble-wrap { max-width: 65%; }
.msg-sender-name { font-size: 11.5px; color: var(--slate500); margin-bottom: 4px; font-weight: 500; }
.msg-bubble { padding: 10px 14px; border-radius: 16px; font-size: 13.5px; line-height: 1.55; word-break: break-word; }
.msg-bubble--me    { background: linear-gradient(135deg, var(--violet), var(--bleu)); color: #fff; border-bottom-right-radius: 4px; }
.msg-bubble--other { background: var(--white); color: var(--slate800); border-bottom-left-radius: 4px; box-shadow: 0 1px 3px rgba(0,0,0,.06); }
.msg-time { font-size: 11px; color: var(--slate400); margin-top: 3px; }
.msg-row--me    .msg-time { text-align: right; }
.msg-row--other .msg-time { text-align: left; }
.msg-date-divider { text-align: center; margin: 12px 0; }
.msg-date-divider span { font-size: 11.5px; color: var(--slate400); background: var(--slate50); padding: 3px 10px; border-radius: 20px; }

/* Checklist extended */
.checklist-progress-card { margin-bottom: 24px; }
.checklist-stats-row { display: flex; gap: 28px; flex-wrap: wrap; }
.checklist-stat { text-align: center; }
.checklist-stat-val   { display: block; font-size: 28px; font-weight: 800; line-height: 1; }
.checklist-stat-label { display: block; font-size: 12px; color: var(--slate500); margin-top: 4px; }
.checklist-stat--green  .checklist-stat-val { color: var(--green); }
.checklist-stat--yellow .checklist-stat-val { color: var(--yellow); }
.checklist-stat--red    .checklist-stat-val { color: var(--red); }
.checklist-stat--total  .checklist-stat-val { color: var(--slate900); }
.checklist-list { display: flex; flex-direction: column; gap: 10px; }
.checklist-item { background: var(--white); border-radius: 10px; box-shadow: var(--shadow); padding: 16px 20px; display: flex; align-items: center; gap: 14px; border: 1px solid var(--slate200); }
.checklist-item--done { opacity: .75; }
.checklist-status-icon { width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.checklist-status-icon--valide   { background: rgba(34,197,94,.1);  color: var(--green); }
.checklist-status-icon--recu     { background: rgba(245,158,11,.1); color: var(--yellow); }
.checklist-status-icon--manquant { background: rgba(239,68,68,.1);  color: var(--red); }
.checklist-item-body  { flex: 1; min-width: 0; }
.checklist-item-label { font-size: 14px; font-weight: 600; color: var(--slate800); }
.checklist-label--done { text-decoration: line-through; color: var(--slate500); }
.checklist-item-desc  { font-size: 12.5px; color: var(--slate500); margin-top: 3px; }
.checklist-item-date  { font-size: 11.5px; color: var(--slate400); margin-top: 3px; }
.checklist-item-actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }

/* Responsive extras */
@media (max-width: 1200px) {
  .stats-grid   { grid-template-columns: repeat(2,1fr); }
  .quick-cards  { grid-template-columns: repeat(2,1fr); }
  .dashboard-grid { grid-template-columns: 1fr; }
  .two-col-layout { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .main-content { padding: 20px; }
  .messaging-sidebar { width: 220px; }
}

/* ============================================================
   RESET & BASE
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* ── Marque ───────────────────────────────────── */
  --violet:   #5b4bff;
  --bleu:     #0ea5e9;
  --accent:   #ec4899;
  --dark:     #0f172a;

  /* ── Fond / surfaces ──────────────────────────── */
  --fond:     #fafafa;        /* identique --bg du site principal */
  --white:    #ffffff;

  /* ── Palette slate (Tailwind-compatible) ──────── */
  --slate50:  #f8fafc;
  --slate100: #f4f5f9;        /* légèrement plus chaud = --bg-alt site */
  --slate200: #e4e7ef;        /* identique --border site principal */
  --slate300: #cbd5e1;
  --slate400: #94a3b8;
  --slate500: #64748b;
  --slate600: #475569;
  --slate700: #334155;
  --slate800: #1e293b;
  --slate900: #0f172a;

  /* ── États ────────────────────────────────────── */
  --red:      #ef4444;
  --green:    #059669;        /* --success site principal, plus sobre */
  --yellow:   #d97706;        /* --warning site principal */

  /* ── Layout ───────────────────────────────────── */
  --sidebar-w: 240px;

  /* ── Design tokens (alignés site principal) ───── */
  --radius:    16px;          /* était 12px — cartes plus rondes */
  --radius-sm: 10px;
  --shadow:    0 2px 8px rgba(15,23,42,.06), 0 4px 20px rgba(15,23,42,.05);
  --shadow-md: 0 12px 32px rgba(15,23,42,.10);
  --shadow-lg: 0 32px 80px rgba(15,23,42,.14);
  --transition: .18s ease;
}

html { font-size: 15px; }

body {
  font-family: 'Inter', 'Inter Fallback', system-ui, -apple-system, sans-serif;
  background: var(--fond);
  color: var(--slate800);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}


a { color: var(--violet); text-decoration: none; }
a:hover { text-decoration: underline; }

img { max-width: 100%; display: block; }

/* ============================================================
   SIDEBAR
   ============================================================ */
.sidebar {
  position: fixed;
  top: 0; left: 0;
  width: var(--sidebar-w);
  height: 100vh;
  background: var(--dark);
  display: flex;
  flex-direction: column;
  z-index: 100;
  overflow-y: auto;
  transition: transform var(--transition);
}

.sidebar-header {
  padding: 24px 20px 16px;
  border-bottom: 1px solid rgba(255,255,255,.06);
}

.sidebar-logo {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  letter-spacing: -.3px;
}
.sidebar-logo span { color: var(--violet); }

.sidebar-subtitle {
  font-size: 11px;
  color: var(--slate500);
  margin-top: 2px;
  letter-spacing: .02em;
}

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

.nav-section-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--slate600);
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: 16px 20px 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 20px;
  margin: 1px 8px;
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--slate400);
  transition: background var(--transition), color var(--transition);
  cursor: pointer;
  text-decoration: none;
  position: relative;
}
.nav-item:hover { background: rgba(255,255,255,.06); color: #fff; text-decoration: none; }
.nav-item.active {
  background: linear-gradient(90deg, rgba(91,75,255,.22) 0%, rgba(14,165,233,.10) 100%);
  color: #fff;
}
.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 60%;
  background: linear-gradient(to bottom, var(--violet), var(--bleu));
  border-radius: 0 3px 3px 0;
}

.nav-item svg {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
  opacity: .8;
}
.nav-item.active svg { opacity: 1; }

.nav-badge {
  margin-left: auto;
  background: var(--red);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
}

.sidebar-footer {
  padding: 16px 12px;
  border-top: 1px solid rgba(255,255,255,.06);
}

.user-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-radius: 8px;
  transition: background var(--transition);
  cursor: pointer;
  text-decoration: none;
}
.user-card:hover { background: rgba(255,255,255,.06); text-decoration: none; }
.user-card-name {
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.user-card-role {
  font-size: 11px;
  color: var(--slate500);
}

/* ============================================================
   MAIN CONTENT
   ============================================================ */
.main {
  margin-left: var(--sidebar-w);
  padding: 32px;
  min-height: 100vh;
  background: var(--fond);
}

/* ============================================================
   PAGE HEADER
   ============================================================ */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
  flex-wrap: wrap;
  gap: 12px;
}

.page-header-left { display: flex; flex-direction: column; gap: 4px; }

.page-title {
  font-family: 'Space Grotesk', 'Space Grotesk Fallback', sans-serif;
  font-size: 24px;
  font-weight: 800;
  color: var(--slate900);
  letter-spacing: -.5px;
  line-height: 1.15;
}

.page-subtitle {
  font-size: 13.5px;
  color: var(--slate500);
}

.page-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

/* ============================================================
   BREADCRUMB
   ============================================================ */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  color: var(--slate500);
  margin-bottom: 16px;
}
.breadcrumb a { color: var(--slate500); }
.breadcrumb a:hover { color: var(--violet); text-decoration: none; }
.breadcrumb .sep { color: var(--slate300); }
.breadcrumb .current { color: var(--slate700); font-weight: 500; }

/* ============================================================
   CARDS
   ============================================================ */
.card {
  background: var(--white);
  border: 1px solid var(--slate200);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.card-header {
  padding: 18px 24px;
  border-bottom: 1px solid var(--slate200);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.card-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 15px;
  font-weight: 700;
  color: var(--slate900);
}

.card-body { padding: 24px; }
.card-body-sm { padding: 16px 24px; }
.card-footer {
  padding: 14px 24px;
  border-top: 1px solid var(--slate200);
  background: var(--slate50);
  border-radius: 0 0 var(--radius) var(--radius);
}

/* Stat cards */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--white);
  border: 1px solid var(--slate200);
  border-radius: var(--radius);
  padding: 20px 22px;
  box-shadow: var(--shadow);
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.stat-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.stat-icon svg { width: 20px; height: 20px; }
.stat-icon.violet { background: rgba(91,75,255,.12); color: var(--violet); }
.stat-icon.bleu   { background: rgba(14,165,233,.12); color: var(--bleu); }
.stat-icon.green  { background: rgba(5,150,105,.12);   color: #047857; }
.stat-icon.yellow { background: rgba(217,119,6,.12);  color: #b45309; }
.stat-icon.red    { background: rgba(239,68,68,.12);  color: var(--red); }

.stat-body {}
.stat-value {
  font-family: 'Space Grotesk', 'Space Grotesk Fallback', sans-serif;
  font-size: 28px;
  font-weight: 800;
  color: var(--slate900);
  line-height: 1;
  letter-spacing: -.02em;
}
.stat-label {
  font-size: 12px;
  color: var(--slate500);
  margin-top: 3px;
}

/* ============================================================
   TABLES
   ============================================================ */
.table-wrapper { overflow-x: auto; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}

th {
  background: var(--slate50);
  color: var(--slate500);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  padding: 10px 16px;
  text-align: left;
  border-bottom: 1px solid var(--slate200);
  white-space: nowrap;
}

td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--slate100);
  color: var(--slate700);
  vertical-align: middle;
}

tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--slate50); }

.td-main { font-weight: 600; color: var(--slate900); }

/* ============================================================
   BADGES
   ============================================================ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 20px;
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
  line-height: 1.4;
}

.badge-blue   { background: #dbeafe; color: #1d4ed8; }
.badge-green  { background: rgba(5,150,105,.1);  color: #047857; }
.badge-yellow { background: rgba(217,119,6,.1);  color: #92400e; }
.badge-red    { background: #fee2e2; color: #b91c1c; }
.badge-purple { background: #ede9fe; color: #6d28d9; }
.badge-gray   { background: #f1f5f9; color: #475569; }
.badge-indigo { background: #e0e7ff; color: #4338ca; }
.badge-orange { background: #ffedd5; color: #c2410c; }

/* ============================================================
   BOUTONS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 20px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform .15s ease, box-shadow .2s ease, background .15s ease, color .15s ease;
  white-space: nowrap;
  font-family: 'Inter', sans-serif;
  text-decoration: none;
  line-height: 1;
}
.btn:active { transform: scale(.97); }
.btn svg { width: 16px; height: 16px; flex-shrink: 0; }

.btn-primary {
  background: linear-gradient(135deg, var(--violet) 0%, var(--bleu) 100%);
  color: #fff;
  box-shadow: 0 8px 20px rgba(91,75,255,.28);
  border-color: transparent;
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(91,75,255,.38);
  text-decoration: none;
  color: #fff;
}

.btn-ghost {
  background: var(--white);
  color: var(--slate700);
  border-color: var(--slate200);
}
.btn-ghost:hover {
  border-color: var(--violet);
  color: var(--violet);
  background: rgba(91,75,255,.04);
  text-decoration: none;
}

.btn-danger {
  background: #fee2e2;
  color: var(--red);
  border-color: #fecaca;
}
.btn-danger:hover { background: var(--red); color: #fff; text-decoration: none; border-color: var(--red); }

.btn-success {
  background: rgba(5,150,105,.1);
  color: #047857;
  border-color: rgba(5,150,105,.25);
}
.btn-success:hover { background: var(--green); color: #fff; text-decoration: none; border-color: var(--green); }

.btn-sm {
  padding: 6px 13px;
  font-size: 12px;
  border-radius: 8px;
}
.btn-sm svg { width: 14px; height: 14px; }

.btn-full { width: 100%; }

.btn:disabled, .btn[disabled] {
  opacity: .45;
  cursor: not-allowed;
  pointer-events: none;
}

/* ============================================================
   FORMS
   ============================================================ */
.form-group { margin-bottom: 16px; }
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.form-row-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
}

label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--slate600);
  margin-bottom: 6px;
  letter-spacing: .01em;
}
label .required { color: var(--red); margin-left: 2px; }

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
input[type="time"],
input[type="tel"],
input[type="url"],
select,
textarea {
  width: 100%;
  padding: 10px 13px;
  border: 1px solid var(--slate200);
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  color: var(--slate800);
  background: var(--fond);
  font-family: 'Inter', sans-serif;
  transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
  outline: none;
}

input:focus, textarea:focus {
  border-color: var(--violet);
  background: var(--white);
  box-shadow: 0 0 0 3px rgba(91,75,255,.12);
}
/* Select séparé : background-color uniquement pour ne pas écraser background-image (flèche SVG) */
select:focus {
  border-color: var(--violet);
  background-color: var(--white);
  box-shadow: 0 0 0 3px rgba(91,75,255,.12);
}

input::placeholder, textarea::placeholder { color: var(--slate400); }

textarea { resize: vertical; min-height: 90px; }

select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2394a3b8' d='M6 8L1 3h10L6 8z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; padding-right: 32px; }

.form-hint { font-size: 11.5px; color: var(--slate400); margin-top: 4px; }
.form-error { font-size: 11.5px; color: var(--red); margin-top: 4px; }

.input-group {
  display: flex;
}
.input-group input { border-radius: 8px 0 0 8px; border-right: none; }
.input-group .input-addon {
  padding: 9px 12px;
  background: var(--slate50);
  border: 1px solid var(--slate200);
  border-radius: 0 8px 8px 0;
  font-size: 13px;
  color: var(--slate500);
  white-space: nowrap;
  display: flex;
  align-items: center;
}

/* ============================================================
   MODAL
   ============================================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,.55);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease;
}
.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal {
  background: var(--white);
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(15,23,42,.22);
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  transform: translateY(16px) scale(.98);
  transition: transform .2s ease;
}
.modal-overlay.active .modal { transform: translateY(0) scale(1); }

.modal-lg { max-width: 760px; }
.modal-xl { max-width: 960px; }

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

.modal-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 16px;
  font-weight: 700;
  color: var(--slate900);
}

.modal-close {
  width: 30px;
  height: 30px;
  border-radius: 6px;
  border: none;
  background: var(--slate100);
  color: var(--slate500);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition);
  flex-shrink: 0;
}
.modal-close:hover { background: var(--slate200); color: var(--slate900); }
.modal-close svg { width: 16px; height: 16px; }

/* La <form> à l'intérieur d'une modale casse la chaîne flex si elle n'est pas flex elle-même */
.modal > form {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.modal-body {
  padding: 24px;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

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

/* ============================================================
   TABS
   ============================================================ */
.tabs {
  display: flex;
  gap: 2px;
  border-bottom: 2px solid var(--slate200);
  margin-bottom: 24px;
}
.tab-btn {
  padding: 10px 18px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--slate500);
  border: none;
  background: none;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: color var(--transition), border-color var(--transition);
  display: flex;
  align-items: center;
  gap: 7px;
  font-family: 'Inter', sans-serif;
}
.tab-btn:hover { color: var(--slate800); }
.tab-btn.active { color: var(--violet); border-bottom-color: var(--violet); }
.tab-btn .badge { font-size: 10px; padding: 1px 6px; }

.tab-content { display: none; }
.tab-content.active { display: block; }

/* ============================================================
   PROGRESS BAR
   ============================================================ */
.progress-bar {
  width: 100%;
  height: 8px;
  background: var(--slate100);
  border-radius: 99px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--violet) 0%, var(--bleu) 100%);
  border-radius: 99px;
  transition: width .6s cubic-bezier(.16,1,.3,1);
}

.progress-bar.lg { height: 12px; border-radius: 99px; }

/* ============================================================
   TIMELINE
   ============================================================ */
.timeline {
  position: relative;
  padding-left: 44px;   /* plus d'espace pour le dot + la ligne */
  display: flex;
  flex-direction: column;
  gap: 0;
}
/* Ligne verticale continue */
.timeline::before {
  content: '';
  position: absolute;
  left: 15px;
  top: 12px;
  bottom: 12px;
  width: 2px;
  background: linear-gradient(to bottom, var(--slate200), var(--slate100));
  border-radius: 2px;
}

.timeline-item {
  position: relative;
  padding-bottom: 28px;
}
.timeline-item:last-child { padding-bottom: 0; }

/* Dot avec ring */
.timeline-dot {
  position: absolute;
  left: -36px;
  top: 16px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
  box-shadow: 0 0 0 4px var(--fond);  /* ring blanc autour du dot */
}
.timeline-dot svg { width: 11px; height: 11px; color: #fff; }

/* Card événement */
.timeline-content {
  background: var(--white);
  border: 1px solid var(--slate100);
  border-radius: 12px;
  padding: 16px 20px;
  box-shadow: 0 1px 4px rgba(15,23,42,.04);
  transition: box-shadow .15s, border-color .15s;
}
.timeline-content:hover {
  box-shadow: 0 4px 16px rgba(15,23,42,.08);
  border-color: var(--slate200);
}

.timeline-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--slate900);
  margin-bottom: 6px;
  line-height: 1.3;
}

.timeline-text {
  font-size: 13px;
  color: var(--slate600);
  line-height: 1.65;
  margin-bottom: 8px;
}

.timeline-date {
  font-size: 11.5px;
  color: var(--slate400);
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 0;
}

/* ============================================================
   CHECKLIST
   ============================================================ */
.checklist-list { display: flex; flex-direction: column; gap: 0; }

.checklist-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 0;
  border-bottom: 1px solid var(--slate100);
}
.checklist-item:last-child { border-bottom: none; }

.check-dot {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.check-dot svg { width: 12px; height: 12px; color: #fff; }
.check-dot.manquant { background: var(--slate200); }
.check-dot.manquant svg { color: var(--slate400); }
.check-dot.recu    { background: var(--yellow); }
.check-dot.valide  { background: var(--green); }

.checklist-label { font-size: 13.5px; font-weight: 500; color: var(--slate800); flex: 1; }
.checklist-desc  { font-size: 12px; color: var(--slate500); margin-top: 2px; }

/* ============================================================
   DOCUMENTS
   ============================================================ */
.folder-tabs {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.folder-tab {
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid var(--slate200);
  background: var(--white);
  color: var(--slate500);
  transition: all var(--transition);
  font-family: 'Inter', sans-serif;
}
.folder-tab:hover { background: var(--slate50); color: var(--slate800); }
.folder-tab.active { background: var(--violet); color: #fff; border-color: var(--violet); }

.doc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 14px;
}

.doc-card {
  background: var(--white);
  border: 1px solid var(--slate200);
  border-radius: 10px;
  padding: 18px 16px 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
  transition: box-shadow var(--transition), border-color var(--transition);
  cursor: pointer;
}
.doc-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--slate300);
}

.doc-icon {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.doc-icon svg { width: 26px; height: 26px; }
.doc-icon.pdf     { background: #fee2e2; color: #dc2626; }
.doc-icon.image   { background: #dbeafe; color: #2563eb; }
.doc-icon.zip     { background: #fef9c3; color: #ca8a04; }
.doc-icon.word    { background: #dbeafe; color: #1d4ed8; }
.doc-icon.excel   { background: #dcfce7; color: #15803d; }
.doc-icon.generic { background: var(--slate100); color: var(--slate500); }

.doc-name { font-size: 12.5px; font-weight: 600; color: var(--slate800); word-break: break-word; }
.doc-meta { font-size: 11px; color: var(--slate400); }
.doc-actions { display: flex; gap: 6px; margin-top: 4px; }

/* Drop zone */
.dropzone {
  border: 2px dashed var(--slate300);
  border-radius: 10px;
  padding: 32px;
  text-align: center;
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition);
}
.dropzone:hover, .dropzone.drag-over {
  border-color: var(--violet);
  background: rgba(91,75,255,.04);
}
.dropzone-icon { color: var(--slate400); margin-bottom: 8px; }
.dropzone-icon svg { width: 36px; height: 36px; }
.dropzone-text { font-size: 13.5px; color: var(--slate600); }
.dropzone-hint { font-size: 12px; color: var(--slate400); margin-top: 4px; }

/* ============================================================
   PLANNING
   ============================================================ */
.event-list { display: flex; flex-direction: column; gap: 0; }

.event-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px 0;
  border-bottom: 1px solid var(--slate100);
}
.event-item:last-child { border-bottom: none; }
.event-item.past { opacity: .5; }

.event-date-block {
  text-align: center;
  min-width: 46px;
  background: var(--slate100);
  border-radius: 8px;
  padding: 6px 8px;
  flex-shrink: 0;
}
.event-date-day  { font-family: 'Space Grotesk', sans-serif; font-size: 20px; font-weight: 700; color: var(--slate900); line-height: 1; }
.event-date-mon  { font-size: 11px; font-weight: 600; color: var(--slate500); text-transform: uppercase; }

.event-type-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-top: 6px;
  flex-shrink: 0;
}
.event-type-dot.reunion    { background: var(--violet); }
.event-type-dot.livraison  { background: var(--bleu); }
.event-type-dot.deadline   { background: var(--red); }
.event-type-dot.validation { background: var(--green); }

.event-body { flex: 1; }
.event-title { font-size: 14px; font-weight: 600; color: var(--slate900); }
.event-project { font-size: 12px; color: var(--slate500); }
.event-desc { font-size: 12.5px; color: var(--slate600); margin-top: 3px; }
.event-time { font-size: 12px; color: var(--slate400); margin-top: 3px; }

/* ============================================================
   SUPPORT TICKETS
   ============================================================ */
.ticket-row { cursor: pointer; }

.priority-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 5px;
}
.priority-dot.haute   { background: var(--red); }
.priority-dot.normale { background: var(--yellow); }
.priority-dot.basse   { background: var(--green); }

/* Thread réponses */
.reply-thread { display: flex; flex-direction: column; gap: 16px; }

.reply-item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.reply-bubble {
  background: var(--slate50);
  border: 1px solid var(--slate200);
  border-radius: 10px;
  padding: 12px 16px;
  flex: 1;
}
.reply-bubble.admin {
  background: rgba(91,75,255,.05);
  border-color: rgba(91,75,255,.15);
}

.reply-author { font-size: 12.5px; font-weight: 700; color: var(--slate900); }
.reply-date   { font-size: 11px; color: var(--slate400); margin-left: 8px; }
.reply-content { font-size: 13.5px; color: var(--slate700); margin-top: 6px; line-height: 1.6; }

/* Pièces jointes — affichage dans le thread */
.reply-attachments {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--slate200);
}
.attach-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  background: var(--white);
  border: 1px solid var(--slate200);
  border-radius: 8px;
  text-decoration: none;
  color: var(--slate700);
  font-size: 12px;
  transition: background var(--transition), border-color var(--transition);
  max-width: 240px;
  cursor: pointer;
}
.attach-chip:hover { background: var(--slate50); border-color: var(--violet); color: var(--violet); }
.attach-icon { display: flex; align-items: center; flex-shrink: 0; }
.attach-icon svg { width: 14px; height: 14px; }
.attach-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.attach-size { font-size: 10.5px; color: var(--slate400); flex-shrink: 0; margin-left: 2px; }

/* Pièces jointes — bouton + preview avant envoi */
/* Wrapper : positionné pour superposer l'input réel sur le bouton visuel */
.file-input-wrapper {
  position: relative;
  display: inline-block;
}
/* L'input réel est invisible mais couvre tout le wrapper — le clic natif fonctionne toujours */
.file-input-wrapper input[type="file"] {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  font-size: 0;            /* évite le tooltip du nom fichier */
}

.attach-label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 14px;
  border: 1.5px dashed var(--slate300);
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  color: var(--slate600);
  background: transparent;
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  line-height: 1;
  transition: border-color var(--transition), color var(--transition), background var(--transition);
  user-select: none;
  pointer-events: none;    /* le clic passe à travers vers l'input */
}
/* Hover sur le wrapper (pas sur le label) */
.file-input-wrapper:hover .attach-label { border-color: var(--violet); color: var(--violet); background: rgba(91,75,255,.04); }
.attach-label svg { width: 15px; height: 15px; pointer-events: none; }

.file-preview-list { display: flex; flex-direction: column; gap: 4px; margin-top: 8px; }
.file-preview-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 10px;
  background: var(--slate50);
  border: 1px solid var(--slate200);
  border-radius: 7px;
  font-size: 12.5px;
  color: var(--slate700);
}

/* Layout ticket detail */
.ticket-layout {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 24px;
  align-items: start;
}
@media (max-width: 768px) {
  .ticket-layout { grid-template-columns: 1fr; }
}

/* ============================================================
   AVATAR
   ============================================================ */
.avatar {
  border-radius: 50%;
  background: linear-gradient(135deg, var(--violet) 0%, var(--bleu) 100%);
  color: #fff;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  letter-spacing: .02em;
  flex-shrink: 0;
  font-family: 'Space Grotesk', sans-serif;
}
.avatar-sm  { width: 28px; height: 28px; font-size: 11px; }
.avatar-md  { width: 36px; height: 36px; font-size: 13px; }
.avatar-lg  { width: 48px; height: 48px; font-size: 16px; }
.avatar-xl  { width: 64px; height: 64px; font-size: 20px; }

/* ============================================================
   NOTIFICATION DOT
   ============================================================ */
.notification-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--red);
  position: absolute;
  top: 0;
  right: 0;
}

/* ============================================================
   TOAST
   ============================================================ */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 340px;
  width: 100%;
}

.toast {
  background: var(--white);
  border-radius: 10px;
  padding: 13px 16px;
  box-shadow: 0 8px 32px rgba(15,23,42,.16);
  border-left: 4px solid var(--slate300);
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 13.5px;
  color: var(--slate800);
  animation: toastIn .25s ease;
  cursor: pointer;
}
.toast.success { border-left-color: var(--green); }
.toast.error   { border-left-color: var(--red); }
.toast.info    { border-left-color: var(--bleu); }
.toast-icon { flex-shrink: 0; margin-top: 1px; }
.toast-icon svg { width: 16px; height: 16px; }
.toast.success .toast-icon { color: var(--green); }
.toast.error   .toast-icon { color: var(--red); }
.toast.info    .toast-icon { color: var(--bleu); }
.toast-msg { flex: 1; font-weight: 500; line-height: 1.5; }

@keyframes toastIn {
  from { opacity: 0; transform: translateX(20px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* ============================================================
   EMPTY STATE
   ============================================================ */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--slate400);
}
.empty-state svg { width: 48px; height: 48px; margin: 0 auto 14px; opacity: .5; }
.empty-state-title { font-size: 15px; font-weight: 600; color: var(--slate600); margin-bottom: 6px; }
.empty-state-sub { font-size: 13px; color: var(--slate400); }

/* ============================================================
   INVOICE LINES (table lignes devis/facture)
   ============================================================ */
.lines-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.lines-table th {
  background: var(--slate50);
  padding: 8px 10px;
  font-size: 11px;
  text-align: left;
  border: 1px solid var(--slate200);
  color: var(--slate500);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
}
.lines-table td {
  padding: 8px 10px;
  border: 1px solid var(--slate200);
  vertical-align: middle;
}
.lines-table tr:hover td { background: var(--slate50); }
.lines-table input { border: none; padding: 4px 6px; font-size: 13px; }
.lines-total {
  text-align: right;
  font-size: 14px;
  font-weight: 700;
  color: var(--slate900);
  padding: 12px 0;
}

/* ============================================================
   FILTERS BAR
   ============================================================ */
.filters-bar {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.filters-bar select, .filters-bar input {
  min-width: 160px;
  width: auto;
  flex: 0 1 auto;
}
.filters-bar .search-input { flex: 1; min-width: 200px; }

/* ============================================================
   ALERT / FLASH
   ============================================================ */
.alert {
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 500;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.alert svg { width: 16px; height: 16px; flex-shrink: 0; }
.alert-success { background: #dcfce7; color: #166534; border: 1px solid #bbf7d0; }
.alert-error   { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }
.alert-info    { background: #dbeafe; color: #1e40af; border: 1px solid #bfdbfe; }
.alert-warning { background: #fef9c3; color: #92400e; border: 1px solid #fef08a; }

/* ============================================================
   CLIENT SWITCH BANNER
   ============================================================ */
.switch-banner {
  background: linear-gradient(135deg, var(--violet) 0%, var(--bleu) 100%);
  color: #fff;
  padding: 10px 20px;
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.switch-banner .btn-exit {
  background: rgba(255,255,255,.2);
  color: #fff;
  border: 1px solid rgba(255,255,255,.3);
  padding: 5px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition);
  font-family: 'Inter', sans-serif;
}
.switch-banner .btn-exit:hover { background: rgba(255,255,255,.3); }

/* ============================================================
   MISC
   ============================================================ */
.divider {
  border: none;
  border-top: 1px solid var(--slate200);
  margin: 20px 0;
}

.text-muted { color: var(--slate500); font-size: 13px; }
.text-sm    { font-size: 12.5px; }
.fw-600     { font-weight: 600; }
.fw-700     { font-weight: 700; }

.flex       { display: flex; }
.flex-center { display: flex; align-items: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.gap-8  { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.mt-4  { margin-top: 4px; }
.mt-8  { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }

/* ============================================================
   MOBILE HEADER & HAMBURGER
   ============================================================ */

/* Mobile header — caché sur desktop */
.mobile-header {
  display: none;
}

/* Overlay (fond sombre) quand sidebar ouverte sur mobile */
.sidebar-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, .55);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  z-index: 150;
  opacity: 0;
  visibility: hidden;
  transition: opacity .25s ease, visibility .25s ease;
}
.sidebar-overlay:not(.hidden) {
  opacity: 1;
  visibility: visible;
}

/* Hamburger */
.hamburger {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  border-radius: 8px;
  transition: background .15s;
}
.hamburger:hover { background: var(--slate100); }
.hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--slate700);
  border-radius: 2px;
  transition: transform .22s ease, opacity .18s ease;
  transform-origin: center;
}
/* Hamburger animé → X quand ouvert */
.hamburger[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger[aria-expanded="true"] span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.hamburger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Bouton fermer sidebar (visible seulement sur mobile) */
.sidebar-close-btn {
  display: none;
  background: rgba(255,255,255,.08);
  border: none;
  color: var(--slate400);
  width: 32px;
  height: 32px;
  border-radius: 8px;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  transition: background .15s, color .15s;
  flex-shrink: 0;
}
.sidebar-close-btn:hover { background: rgba(255,255,255,.15); color: #fff; }
@media (max-width: 768px) {
  .sidebar-close-btn { display: flex; }
}

/* Mobile notif badge */
.mobile-notif-btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  color: var(--slate600);
  border-radius: 50%;
  transition: background .15s, color .15s;
}
.mobile-notif-btn:hover { background: var(--slate100); color: var(--violet); text-decoration: none; }
.mobile-notif-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  min-width: 16px;
  height: 16px;
  background: var(--violet);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  line-height: 1;
}

/* Avatar chip mobile */
.mobile-avatar-chip {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--violet);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 768px) {
  /* Sidebar : fixé, slide depuis la gauche */
  .sidebar {
    transform: translateX(-100%);
    z-index: 200;
    transition: transform .25s cubic-bezier(.4,0,.2,1);
    box-shadow: none;
  }
  .sidebar.open {
    transform: translateX(0);
    box-shadow: 4px 0 32px rgba(15,23,42,.25);
  }

  /* Main content : pas de marge gauche, espace pour le header mobile */
  .main-content {
    margin-left: 0 !important;
    padding: 16px;
    padding-top: calc(56px + 16px); /* hauteur header mobile */
  }

  /* Mobile header — au-dessus de l'overlay (z:150) pour garder le bouton X accessible */
  .mobile-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 56px;
    padding: 0 12px 0 8px;
    background: var(--white);
    border-bottom: 1px solid var(--slate200);
    z-index: 160;
    box-shadow: 0 1px 8px rgba(15,23,42,.06);
  }

  .mobile-logo {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 16px;
    font-weight: 700;
    color: var(--slate900);
    text-decoration: none;
    display: flex;
    align-items: center;
  }
  .mobile-logo:hover { text-decoration: none; }
  .mobile-logo span { color: var(--violet); }
  .mobile-logo img { max-height: 28px; }

  .mobile-header-right {
    display: flex;
    align-items: center;
    gap: 4px;
  }

  /* Sidebar overlay visible */
  .sidebar-overlay.hidden {
    opacity: 0;
    visibility: hidden;
  }

  /* Layout adjustments */
  .page-header { flex-direction: column; align-items: flex-start; gap: 12px; }
  .page-header .page-actions { width: 100%; }
  .form-row, .form-row-3 { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .doc-grid { grid-template-columns: repeat(2, 1fr); }
  .messaging-layout { flex-direction: column; height: auto; min-height: 70vh; }
  .messaging-sidebar { width: 100%; border-right: none; border-bottom: 1px solid var(--slate200); max-height: 220px; flex-shrink: 0; }
  .messaging-feed { min-height: 300px; }

  /* Modals : centrées + pleine largeur, pas de bottom sheet (formulaires trop longs) */
  .modal-overlay { align-items: center; padding: 12px; }
  .modal { border-radius: var(--radius); max-height: 92vh; max-width: 100% !important; }
  .modal-body { overflow-y: auto; -webkit-overflow-scrolling: touch; }
  .modal-lg, .modal-xl { max-width: 100% !important; }

  /* Filtres */
  .filters-bar { flex-direction: column; align-items: stretch; }
  .filters-bar select, .filters-bar input { min-width: unset; width: 100%; }

  /* Tabs scrollables */
  .tabs { overflow-x: auto; flex-wrap: nowrap; -webkit-overflow-scrolling: touch; }
  .tabs::-webkit-scrollbar { display: none; }
}

@media (max-width: 480px) {
  .stat-grid { grid-template-columns: 1fr; }
  .doc-grid { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .mobile-header { height: 52px; }
  .main-content { padding-top: calc(52px + 12px); }
}
