.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: var(--sidebar) minmax(0, 1fr);
}

.compose-preview {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-soft, #f7f9fc);
  padding: 16px;
}

.compose-preview pre {
  margin: 10px 0 0;
  white-space: pre-wrap;
  font: inherit;
  line-height: 1.55;
}
.compose-signature-notice {
  grid-template-columns: auto 1fr auto;
  align-items: center;
  padding: 12px 14px;
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  background: var(--surface-soft);
}
.compose-signature-notice > img { width: 20px; height: 20px; }
.compose-signature-notice strong,
.compose-signature-notice small { display: block; }
.compose-signature-notice small { margin-top: 3px; font-weight: 500; color: var(--ink-600); }

:where(button, a, input, select, textarea):focus-visible {
  outline: 3px solid rgba(44, 111, 255, 0.42);
  outline-offset: 2px;
}
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar);
  z-index: 40;
  display: flex;
  flex-direction: column;
  padding: 25px 17px 18px;
  background:
    radial-gradient(circle at 20% 0, rgba(25, 96, 180, 0.28), transparent 35%),
    linear-gradient(178deg, var(--navy-950), #06152d 70%, #051125);
  color: #fff;
  border-right: 1px solid rgba(255, 255, 255, 0.05);
}
.brand {
  height: 52px;
  padding: 0 9px;
  display: flex;
  align-items: center;
  gap: 9px;
  text-decoration: none;
}
.brand img {
  width: 142px;
  height: auto;
  filter: none;
}
.brand > span {
  font: 800 9px var(--font-display);
  letter-spacing: 0.08em;
  background: rgba(31, 133, 255, 0.2);
  border: 1px solid rgba(95, 167, 255, 0.28);
  color: #b8d8ff;
  border-radius: 999px;
  padding: 4px 7px;
}
.primary-nav {
  display: grid;
  gap: 5px;
  margin-top: 29px;
}
.nav-item {
  width: 100%;
  height: 45px;
  border-radius: 12px;
  background: transparent;
  color: #aebbd0;
  padding: 0 13px;
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
  font-weight: 680;
}
.nav-item img {
  width: 19px;
  height: 19px;
  filter: brightness(0) invert(1);
  opacity: 0.66;
}
.nav-item:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}
.nav-item.is-active {
  background: linear-gradient(
    100deg,
    rgba(13, 112, 239, 0.98),
    rgba(12, 103, 225, 0.72)
  );
  color: #fff;
  box-shadow: 0 9px 24px rgba(0, 70, 175, 0.26);
}
.nav-item.is-active img {
  opacity: 1;
}
.nav-count {
  margin-left: auto;
  min-width: 20px;
  height: 20px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: #fff;
  color: var(--blue-700);
  font-size: 10px;
  font-weight: 800;
}
.sidebar-bottom {
  display: grid;
  gap: 11px;
  margin-top: auto;
}
.operator-card {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) 34px;
  align-items: center;
  gap: 9px;
  padding: 11px 7px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.09);
}
.operator-avatar {
  width: 36px;
  height: 36px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #147cf7, #4e98ee);
  font: 750 11px var(--font-display);
}
.operator-card strong,
.operator-card small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.operator-card strong {
  font-size: 11px;
}
.operator-card small {
  margin-top: 3px;
  font-size: 9px;
  color: #8696af;
}
.operator-card .icon-button {
  width: 32px;
  height: 32px;
}
.operator-card .icon-button img {
  filter: brightness(0) invert(1);
  opacity: 0.65;
}
.workspace {
  grid-column: 2;
  min-width: 0;
}
.topbar {
  height: var(--topbar);
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 30px;
  background: rgba(247, 250, 253, 0.92);
  border-bottom: 1px solid rgba(214, 224, 236, 0.88);
  backdrop-filter: blur(16px);
}
.mobile-menu {
  display: none;
}
.global-search {
  position: relative;
  flex: 1;
  max-width: 620px;
}
.global-search > img {
  position: absolute;
  left: 15px;
  top: 50%;
  transform: translateY(-50%);
  width: 17px;
  height: 17px;
  opacity: 0.58;
}
.global-search input {
  width: 100%;
  height: 43px;
  padding: 0 58px 0 43px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.88);
  outline: 0;
  color: var(--ink-950);
  font-weight: 550;
}
.global-search input:focus {
  border-color: #9fc8fb;
  box-shadow: 0 0 0 3px rgba(22, 128, 255, 0.09);
  background: #fff;
}
.global-search kbd {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  padding: 3px 7px;
  border: 1px solid #d4ddea;
  border-radius: 6px;
  background: #f5f7fa;
  color: var(--ink-500);
  font: 600 10px var(--font-body);
}
.search-popover {
  position: absolute;
  top: 50px;
  left: 0;
  right: 0;
  max-height: 480px;
  overflow: auto;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  padding: 9px;
}
.search-group-title {
  padding: 9px 10px 5px;
  color: var(--ink-500);
  font: 800 10px var(--font-display);
  letter-spacing: 0.08em;
}
.search-result {
  width: 100%;
  border: 0;
  background: transparent;
  border-radius: 10px;
  padding: 10px;
  display: flex;
  align-items: center;
  gap: 11px;
  text-align: left;
  cursor: pointer;
}
.search-result:hover {
  background: var(--blue-50);
}
.search-result img {
  width: 17px;
  height: 17px;
}
.search-result strong,
.search-result span {
  display: block;
}
.search-result strong {
  font-size: 13px;
}
.search-result span {
  font-size: 11px;
  color: var(--ink-600);
  margin-top: 2px;
}
.topbar-weather {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 9px;
  border: 0;
  background: transparent;
  border-radius: 12px;
  padding: 6px 9px;
  cursor: pointer;
}
.topbar-weather:hover {
  background: #fff;
}
.topbar-weather > img {
  width: 24px;
  height: 24px;
}
.topbar-weather strong,
.topbar-weather small {
  display: block;
  text-align: left;
}
.topbar-weather strong {
  font: 750 13px var(--font-display);
}
.topbar-weather small {
  color: var(--ink-500);
  font-size: 9px;
  margin-top: 2px;
}
.notification-trigger {
  position: relative;
}
.notification-trigger span {
  position: absolute;
  right: -3px;
  top: -3px;
  min-width: 18px;
  height: 18px;
  border-radius: 999px;
  background: var(--red-700);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 9px;
  font-weight: 800;
  border: 2px solid #f7fafd;
}
.notification-panel {
  position: fixed;
  z-index: 90;
  right: 16px;
  top: 16px;
  bottom: 16px;
  width: min(390px, calc(100vw - 32px));
  padding: 20px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: var(--shadow-lg);
  overflow: auto;
}
.notification-panel > header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
}
.notification-panel h2 {
  margin: 0;
  font: 700 21px var(--font-display);
}
.notification-item {
  width: 100%;
  border: 0;
  border-radius: 13px;
  padding: 13px;
  display: flex;
  gap: 11px;
  background: transparent;
  text-align: left;
  cursor: pointer;
}
.notification-item:hover {
  background: var(--surface-soft);
}
.notification-item > img {
  width: 18px;
  height: 18px;
  margin-top: 2px;
}
.notification-item strong,
.notification-item span {
  display: block;
}
.notification-item strong {
  font-size: 13px;
}
.notification-item span {
  margin-top: 3px;
  color: var(--ink-600);
  font-size: 11px;
}
.page-host {
  padding: 32px clamp(22px, 3.1vw, 48px) 56px;
  min-height: calc(100vh - var(--topbar));
}
.page {
  max-width: 1480px;
  margin: 0 auto;
  animation: page-in 220ms var(--ease);
}
@keyframes page-in {
  from {
    opacity: 0.1;
    transform: translateY(5px);
  }
}
.loading-screen {
  min-height: 60vh;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 13px;
  color: var(--ink-600);
}
.loading-screen p {
  margin: 0;
  font-size: 13px;
}
.spinner {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 3px solid var(--line);
  border-top-color: var(--blue-600);
  animation: spin 0.8s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
.page-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 28px;
}
.page-heading h1 {
  margin: 0;
  font: 720 clamp(27px, 3vw, 38px) / 1.14 var(--font-display);
  letter-spacing: -0.035em;
}
.page-heading > div > p:not(.eyebrow) {
  max-width: 680px;
  margin: 8px 0 0;
  color: var(--ink-600);
  font-size: 14px;
}
.heading-actions {
  display: flex;
  gap: 10px;
}
.page-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
}
.page-toolbar .spacer {
  margin-left: auto;
}
.inline-search {
  position: relative;
  flex: 1;
  max-width: 500px;
}
.inline-search > img {
  position: absolute;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  opacity: 0.55;
}
.inline-search input {
  width: 100%;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0 14px 0 39px;
  background: #fff;
  outline: 0;
}
.inline-search input:focus {
  border-color: var(--blue-500);
  box-shadow: 0 0 0 3px rgba(22, 128, 255, 0.1);
}

/* Accueil */
.home-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(310px, 0.82fr);
  gap: 22px;
}
.home-column {
  display: grid;
  gap: 22px;
  align-content: start;
}
.panel {
  padding: 22px;
}
.today-list,
.task-list,
.request-list,
.timeline {
  display: grid;
  gap: 9px;
}
.appointment-card,
.task-card,
.request-card {
  width: 100%;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 13px;
  border: 1px solid transparent;
  border-radius: 14px;
  background: var(--surface-soft);
  text-align: left;
}
.appointment-card:hover,
.task-card:hover,
.request-card:hover {
  border-color: #cadcf2;
  background: #f9fbfe;
  transform: translateY(-1px);
}
.time-tile {
  width: 61px;
  height: 55px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  align-content: center;
  background: var(--blue-100);
  color: var(--blue-700);
}
.time-tile strong {
  font: 750 15px var(--font-display);
}
.time-tile span {
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.08em;
}
.appointment-card h3,
.task-card h3,
.request-card h3 {
  margin: 0;
  font: 700 14px/1.35 var(--font-display);
}
.appointment-card p,
.task-card p,
.request-card p {
  margin: 4px 0 0;
  color: var(--ink-600);
  font-size: 11px;
}
.appointment-card > img,
.task-card > img,
.request-card > img {
  width: 17px;
  height: 17px;
  opacity: 0.55;
}
.task-accent {
  width: 8px;
  height: 38px;
  border-radius: 999px;
  background: var(--amber-700);
}
.task-accent.blue {
  background: var(--blue-600);
}
.task-accent.red {
  background: var(--red-700);
}
.request-avatar {
  width: 41px;
  height: 41px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  background: var(--cyan-100);
  color: var(--cyan-600);
  font: 750 13px var(--font-display);
}
.activity-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.metric-card {
  width: 100%;
  text-align: left;
  color: inherit;
  font: inherit;
  cursor: pointer;
  padding: 15px;
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  background: linear-gradient(145deg, #fff, #f8fbff);
}
.metric-card:hover,
.metric-card:focus-visible {
  border-color: var(--blue-500);
  box-shadow: 0 8px 22px rgba(18, 105, 223, 0.12);
  transform: translateY(-1px);
}
.metric-card span,
.metric-card small {
  display: block;
}
.metric-card span {
  font-size: 10px;
  color: var(--ink-600);
  font-weight: 750;
}
.metric-card strong {
  display: block;
  margin-top: 6px;
  font: 720 22px var(--font-display);
  letter-spacing: -0.03em;
}
.metric-card small {
  margin-top: 4px;
  font-size: 9px;
  color: var(--ink-500);
}
.weather-panel {
  position: relative;
  overflow: hidden;
  color: #fff;
  background:
    radial-gradient(
      circle at 100% 0,
      rgba(74, 170, 255, 0.44),
      transparent 42%
    ),
    linear-gradient(145deg, #0a4ca7, #0879de);
  border-color: transparent;
}
.weather-panel::after {
  content: "";
  position: absolute;
  right: -35px;
  bottom: -55px;
  width: 170px;
  height: 170px;
  border-radius: 50%;
  border: 28px solid rgba(255, 255, 255, 0.08);
}
.weather-head {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}
.weather-head .eyebrow {
  color: #cce4ff;
}
.weather-head h2 {
  margin: 0;
  font: 700 18px var(--font-display);
}
.weather-current {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 22px 0;
}
.weather-current > img {
  width: 45px;
  height: 45px;
  filter: brightness(0) invert(1);
}
.weather-current strong {
  font: 720 42px var(--font-display);
  letter-spacing: -0.05em;
}
.weather-current span {
  font-size: 12px;
  opacity: 0.85;
}
.weather-metrics {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.weather-metrics div {
  padding: 10px;
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(4px);
}
.weather-metrics span,
.weather-metrics strong {
  display: block;
}
.weather-metrics span {
  font-size: 9px;
  opacity: 0.75;
}
.weather-metrics strong {
  margin-top: 4px;
  font-size: 12px;
}

/* Clients */
.client-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(285px, 1fr));
  gap: 16px;
}
.client-card {
  position: relative;
  min-height: 190px;
  padding: 19px;
  border: 1px solid var(--line-soft);
  border-radius: 18px;
  background: #fff;
  text-align: left;
  box-shadow: var(--shadow-sm);
}
.client-card:hover {
  border-color: #bfd5ef;
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.client-card-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}
.client-avatar {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, var(--blue-100), #dcecff);
  color: var(--blue-700);
  font: 750 14px var(--font-display);
}
.client-card h2 {
  margin: 17px 0 3px;
  font: 700 16px var(--font-display);
}
.client-card > p {
  margin: 0;
  color: var(--ink-600);
  font-size: 11px;
}
.client-card-footer {
  position: absolute;
  left: 19px;
  right: 19px;
  bottom: 17px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--line-soft);
  padding-top: 12px;
}
.client-card-footer span {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  color: var(--ink-600);
}
.client-card-footer img {
  width: 14px;
  height: 14px;
}
.client-card-footer > img {
  width: 16px;
  height: 16px;
  opacity: 0.55;
}
.request-band {
  margin-bottom: 20px;
  padding: 18px;
}
.request-band-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 10px;
}
.request-mini {
  border: 1px solid var(--line-soft);
  border-radius: 13px;
  background: var(--surface-soft);
  padding: 13px;
  text-align: left;
  cursor: pointer;
}
.request-mini strong,
.request-mini span {
  display: block;
}
.request-mini strong {
  font-size: 12px;
}
.request-mini span {
  margin-top: 4px;
  color: var(--ink-600);
  font-size: 10px;
}

/* Dossier */
.dossier-page {
  margin: -32px clamp(-48px, -3.1vw, -22px) -56px;
  max-width: none;
  min-height: calc(100vh - var(--topbar));
  background: #f3f7fb;
}
.dossier-hero {
  padding: 27px clamp(22px, 3.4vw, 54px) 22px;
  background: #fff;
  border-bottom: 1px solid var(--line);
}
.dossier-back {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 0;
  background: transparent;
  color: var(--ink-600);
  font-weight: 700;
  font-size: 12px;
  cursor: pointer;
  padding: 5px 0 15px;
}
.dossier-back img {
  width: 16px;
  height: 16px;
}
.dossier-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
}
.dossier-identity {
  display: flex;
  gap: 14px;
  align-items: center;
}
.dossier-avatar {
  width: 58px;
  height: 58px;
  border-radius: 17px;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, #d8eaff, #f2f7ff);
  color: var(--blue-700);
  font: 750 18px var(--font-display);
}
.dossier-identity h1 {
  margin: 0;
  font: 720 28px/1.2 var(--font-display);
  letter-spacing: -0.03em;
}
.dossier-identity p {
  margin: 6px 0 0;
  color: var(--ink-600);
  font-size: 12px;
}
.dossier-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.dossier-content {
  padding: 22px clamp(22px, 3.4vw, 54px) 52px;
  max-width: 1600px;
  margin: auto;
}
.journey {
  display: grid;
  grid-template-columns: repeat(8, minmax(85px, 1fr));
  position: relative;
  padding: 19px 15px;
  margin-bottom: 18px;
  overflow: auto;
}
.journey::before {
  content: "";
  position: absolute;
  left: 6%;
  right: 6%;
  top: 37px;
  height: 2px;
  background: var(--line);
}
.journey-step {
  position: relative;
  z-index: 1;
  min-width: 90px;
  text-align: center;
}
.journey-dot {
  width: 36px;
  height: 36px;
  margin: 0 auto 8px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  border: 2px solid #dbe3ed;
  background: #fff;
  color: var(--ink-500);
  font: 800 11px var(--font-display);
}
.journey-step.done .journey-dot {
  background: var(--green-700);
  border-color: var(--green-700);
  color: #fff;
}
.journey-step.current .journey-dot {
  background: var(--blue-600);
  border-color: var(--blue-600);
  color: #fff;
  box-shadow: 0 0 0 5px var(--blue-100);
}
.journey-step span {
  font-size: 9px;
  font-weight: 750;
  color: var(--ink-500);
}
.journey-step.done span {
  color: var(--green-700);
}
.journey-step.current span {
  color: var(--blue-700);
}
.next-action {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 17px;
  align-items: center;
  padding: 20px 22px;
  margin-bottom: 18px;
  border: 1px solid #c8dbf3;
  background: linear-gradient(110deg, #fff, #f1f7ff);
  box-shadow: 0 12px 30px rgba(13, 91, 189, 0.08);
}
.next-action-icon {
  width: 50px;
  height: 50px;
  border-radius: 15px;
  display: grid;
  place-items: center;
  background: var(--blue-600);
}
.next-action-icon img {
  width: 23px;
  height: 23px;
  filter: brightness(0) invert(1);
}
.next-action .eyebrow {
  margin-bottom: 4px;
}
.next-action h2 {
  margin: 0;
  font: 720 19px var(--font-display);
}
.next-action p {
  margin: 4px 0 0;
  color: var(--ink-600);
  font-size: 11px;
}
.dossier-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(290px, 0.72fr);
  gap: 18px;
}
.dossier-main,
.dossier-side {
  display: grid;
  gap: 18px;
  align-content: start;
}
.info-card {
  padding: 20px;
}
.contact-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 11px;
}
.contact-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px;
  border-radius: 12px;
  background: var(--surface-soft);
  min-width: 0;
}
.contact-item img {
  width: 17px;
  height: 17px;
  opacity: 0.7;
}
.contact-item span,
.contact-item strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.contact-item span {
  font-size: 9px;
  color: var(--ink-500);
  font-weight: 700;
}
.contact-item strong {
  font-size: 11px;
  margin-top: 2px;
}
.site-list,
.document-list,
.media-grid {
  display: grid;
  gap: 10px;
}
.site-card {
  width: 100%;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 13px;
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  background: var(--surface-soft);
  text-align: left;
}
.site-card:hover {
  border-color: #bfd5ef;
  background: #fff;
}
.site-card > span {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: var(--blue-100);
  display: grid;
  place-items: center;
}
.site-card > span img {
  width: 17px;
  height: 17px;
}
.site-card strong,
.site-card small {
  display: block;
}
.site-card strong {
  font-size: 12px;
}
.site-card small {
  margin-top: 3px;
  color: var(--ink-600);
  font-size: 10px;
}
.site-card > img {
  width: 15px;
  height: 15px;
  opacity: 0.5;
}
.project-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 9px;
}
.project-summary div {
  padding: 12px;
  border-radius: 12px;
  background: var(--surface-soft);
}
.project-summary span,
.project-summary strong {
  display: block;
}
.project-summary span {
  font-size: 9px;
  color: var(--ink-500);
  font-weight: 700;
}
.project-summary strong {
  font-size: 11px;
  margin-top: 4px;
}
.document-card,
.payment-card {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 11px;
  border: 1px solid var(--line-soft);
  border-radius: 13px;
  background: #fff;
  padding: 11px;
  text-align: left;
}
.document-card:hover,
.payment-card:hover {
  border-color: #c2d5ec;
  background: var(--blue-50);
}
.document-card > span,
.payment-card > span {
  width: 37px;
  height: 37px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: var(--violet-100);
}
.payment-card > .status-badge {
  width: auto;
  min-width: 0;
  height: auto;
  padding: 5px 8px;
  display: inline-flex;
  white-space: nowrap;
  justify-self: end;
  background: var(--amber-100);
}

.quick-access-item {
  position: relative;
}

.quick-access-item .task-card {
  width: 100%;
  padding-right: 3.4rem;
}

.quick-access-dismiss {
  position: absolute;
  top: 50%;
  right: .65rem;
  width: 2rem;
  height: 2rem;
  transform: translateY(-50%);
  opacity: .52;
}

.quick-access-dismiss:hover,
.quick-access-dismiss:focus-visible {
  opacity: 1;
}

.mail-plain-text {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  line-height: 1.6;
}

.mail-plain-text a {
  color: var(--blue-600, #1269df);
  text-decoration: underline;
  text-underline-offset: .16em;
}
.document-card > span img,
.payment-card > span img {
  width: 17px;
  height: 17px;
}
.document-card strong,
.document-card small,
.payment-card strong,
.payment-card small {
  display: block;
}
.document-card strong,
.payment-card strong {
  font-size: 11px;
}
.document-card small,
.payment-card small {
  font-size: 9px;
  color: var(--ink-500);
  margin-top: 3px;
}
.document-card > img,
.payment-card > img {
  width: 15px;
  height: 15px;
  opacity: 0.55;
}
.media-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.media-card {
  position: relative;
  aspect-ratio: 4/3;
  border: 0;
  border-radius: 12px;
  overflow: hidden;
  background: #e8edf4;
}
.media-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.media-card span {
  position: absolute;
  left: 7px;
  bottom: 7px;
  border-radius: 7px;
  background: rgba(5, 17, 37, 0.76);
  color: #fff;
  padding: 4px 6px;
  font-size: 8px;
}

.media-video-placeholder {
  display: grid;
  place-items: center;
  min-height: 120px;
  background: linear-gradient(135deg, #0b2345, #176fd8);
}

.media-video-placeholder img {
  filter: brightness(0) invert(1);
}
.timeline {
  position: relative;
}
.timeline-item {
  position: relative;
  padding: 0 0 16px 25px;
}
.timeline-item::before {
  content: "";
  position: absolute;
  left: 5px;
  top: 12px;
  bottom: -3px;
  width: 1px;
  background: var(--line);
}
.timeline-item:last-child::before {
  display: none;
}
.timeline-item::after {
  content: "";
  position: absolute;
  left: 0;
  top: 5px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--blue-600);
  box-shadow: 0 0 0 4px var(--blue-100);
}
.timeline-item strong,
.timeline-item span {
  display: block;
}
.timeline-item strong {
  font-size: 11px;
}
.timeline-item span {
  margin-top: 3px;
  color: var(--ink-500);
  font-size: 9px;
}

/* Planning */
.calendar-shell {
  overflow: hidden;
}
.calendar-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 15px 18px;
  border-bottom: 1px solid var(--line-soft);
}
.calendar-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}
.calendar-nav strong {
  min-width: 170px;
  text-align: center;
  font: 700 14px var(--font-display);
}
.calendar-week {
  display: grid;
  grid-template-columns: 66px repeat(7, minmax(120px, 1fr));
  min-width: 920px;
}
.calendar-week.day-view {
  grid-template-columns: 66px minmax(520px, 1fr);
  min-width: 640px;
}
.calendar-month {
  display: grid;
  grid-template-columns: repeat(7, minmax(130px, 1fr));
  min-width: 910px;
}
.calendar-month-head {
  padding: 11px;
  border-right: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line);
  color: var(--ink-500);
  font-size: 9px;
  font-weight: 800;
  text-align: center;
  text-transform: uppercase;
}
.calendar-month-day {
  min-height: 126px;
  padding: 8px;
  border-right: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
}
.calendar-month-day > strong { display: block; margin-bottom: 6px; font: 750 12px var(--font-display); }
.calendar-month-day.is-outside { background: var(--surface-soft); color: var(--ink-400); }
.calendar-month-day.today { background: var(--blue-50); }
.calendar-month-day .calendar-event { height: auto; min-height: 42px; margin-bottom: 5px; }
.calendar-month-day .calendar-event span { display: none; }
.calendar-scroll {
  overflow: auto;
}
.calendar-corner,
.calendar-day-head {
  height: 62px;
  border-bottom: 1px solid var(--line);
  border-right: 1px solid var(--line-soft);
}
.calendar-day-head {
  display: grid;
  place-items: center;
  align-content: center;
}
.calendar-day-head span,
.calendar-day-head strong {
  display: block;
}
.calendar-day-head span {
  font-size: 9px;
  color: var(--ink-500);
  font-weight: 800;
  text-transform: uppercase;
}
.calendar-day-head strong {
  margin-top: 3px;
  font: 750 17px var(--font-display);
}
.calendar-day-head.today {
  background: var(--blue-50);
  color: var(--blue-700);
}
.calendar-time {
  height: 76px;
  padding: 8px 9px 0 0;
  border-right: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
  text-align: right;
  color: var(--ink-500);
  font-size: 9px;
}
.calendar-cell {
  position: relative;
  height: 76px;
  padding: 5px;
  border-right: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
}
.calendar-event {
  width: 100%;
  height: 100%;
  overflow: hidden;
  border: 0;
  border-left: 3px solid var(--blue-600);
  border-radius: 9px;
  background: var(--blue-100);
  padding: 7px;
  text-align: left;
  cursor: pointer;
}
.calendar-event:hover {
  filter: saturate(1.1);
  box-shadow: 0 5px 12px rgba(13, 89, 185, 0.12);
}
.calendar-event strong,
.calendar-event span {
  display: block;
}
.calendar-event strong {
  font: 750 11px/1.25 var(--font-display);
}
.calendar-event span {
  margin-top: 3px;
  font-size: 8px;
  color: var(--ink-600);
}
.calendar-event.type-intervention {
  border-color: var(--violet-600);
  background: var(--violet-100);
}
.calendar-event.type-rendez-vous { border-color: #2563eb; background: #dbeafe; }
.calendar-event.type-inspection { border-color: #0891b2; background: #cffafe; }
.calendar-event.type-nettoyage { border-color: #16a34a; background: #dcfce7; }
.calendar-event.type-urgence { border-color: #dc2626; background: #fee2e2; }
.calendar-event.type-sav { border-color: #d97706; background: #fef3c7; }
.calendar-event.type-special-day { border-color: #7c3aed; background: #ede9fe; }
.calendar-legend-row { display: flex; justify-content: flex-end; margin: -6px 0 5px; }
.calendar-legend { display: inline-flex; flex-wrap: wrap; justify-content: flex-end; gap: 4px 11px; max-width: 100%; padding: 6px 10px; border: 1px solid var(--line-soft); border-radius: 999px; background: color-mix(in srgb, var(--surface) 92%, transparent); box-shadow: 0 5px 14px rgba(15, 45, 90, .04); }
.calendar-legend span { position: relative; padding: 2px 0 2px 12px; border: 0; border-radius: 0; background: transparent !important; color: var(--ink-500); font-size: 9px; font-weight: 700; }
.calendar-legend span::before { content: ""; position: absolute; left: 0; top: 50%; width: 6px; height: 6px; border-radius: 50%; background: currentColor; transform: translateY(-50%); }
.calendar-legend .type-rendez-vous { color: #2563eb; }
.calendar-legend .type-inspection { color: #0891b2; }
.calendar-legend .type-nettoyage { color: #16a34a; }
.calendar-legend .type-intervention { color: #7c3aed; }
.calendar-legend .type-urgence { color: #dc2626; }
.calendar-legend .type-sav { color: #d97706; }
.calendar-legend .type-special-day { color: #64748b; }
.special-day-marker {
  display: block;
  max-width: calc(100% - 8px);
  margin: 3px auto 0;
  overflow: hidden;
  border: 0;
  border-radius: 5px;
  background: #ede9fe;
  padding: 2px 5px;
  color: #5b21b6;
  font: 700 8px/1.2 var(--font-display);
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
}
.calendar-day-head:has(.special-day-marker) { height: 76px; }
.calendar-ics-note { margin: 0 0 12px; }

/* Prospection */
.filter-row {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) repeat(3, minmax(140px, auto));
  gap: 10px;
  margin-bottom: 14px;
}
.filter-row select {
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  padding: 0 11px;
}
.bulk-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  padding: 11px 14px;
  border-radius: 13px;
  background: var(--navy-900);
  color: #fff;
}
.bulk-bar strong {
  font-size: 12px;
}
.bulk-bar .button.secondary {
  margin-left: auto;
}
.prospect-list {
  display: grid;
  gap: 8px;
}
.prospect-row {
  display: grid;
  /* Colonnes : sélection, organisation, activité, localisation,
     dernier contact, prochaine action, état. */
  grid-template-columns: 30px minmax(170px, 1.3fr) minmax(120px, 0.8fr) minmax(
      110px,
      0.7fr
    ) minmax(120px, 0.8fr) minmax(130px, 0.9fr) 90px;
  align-items: center;
  gap: 12px;
  padding: 12px 15px;
}
.prospect-row.header {
  padding: 7px 15px;
  background: transparent;
  border: 0;
  box-shadow: none;
  color: var(--ink-500);
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.prospect-row.header > span {
  display: flex;
  align-items: center;
  gap: 5px;
  margin: 0;
}
.prospect-row.header img,
.prospect-row:not(.header) span img {
  display: inline-block;
  width: 13px;
  height: 13px;
  vertical-align: -2px;
}
.prospect-row:not(.header) {
  background: #fff;
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  cursor: pointer;
}
.prospect-row:not(.header):hover {
  border-color: #bfd5ef;
  box-shadow: var(--shadow-sm);
}
.prospect-row strong,
.prospect-row span {
  display: block;
}
.prospect-row strong {
  font-size: 12px;
}
.prospect-row span {
  margin-top: 3px;
  color: var(--ink-600);
  font-size: 9px;
}
.prospect-checkbox {
  width: 17px;
  height: 17px;
  accent-color: var(--blue-600);
}
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 18px;
}
.pagination span {
  font-size: 11px;
  color: var(--ink-600);
}

/* Messagerie */
.mail-shell {
  --mail-folders: 220px;
  --mail-list: 370px;
  height: calc(100vh - var(--topbar) - 102px);
  min-height: 560px;
  display: grid;
  grid-template-columns: var(--mail-folders) 5px var(--mail-list) 5px minmax(360px, 1fr);
  overflow: hidden;
}
.mail-folders {
  padding: 17px;
}
.mail-resizer { cursor: col-resize; background: var(--line-soft); transition: background .15s ease; }
.mail-resizer:hover, .mail-resizer:focus { background: var(--blue-500); outline: none; }
.mail-folder {
  width: 100%;
  height: 39px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0 10px;
  cursor: pointer;
  font-size: 11px;
  font-weight: 700;
}
.mail-folder:hover,
.mail-folder.is-active {
  background: var(--blue-50);
  color: var(--blue-700);
}
.mail-folder img {
  width: 16px;
  height: 16px;
}
.mail-list {
  overflow: auto;
}
.mail-list-head {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 15px;
  background: #fff;
  border-bottom: 1px solid var(--line-soft);
}
.mail-list-head h2 {
  margin: 0;
  font: 700 16px var(--font-display);
}
.mail-message-row {
  width: 100%;
  border: 0;
  border-bottom: 1px solid var(--line-soft);
  background: #fff;
  padding: 14px 15px;
  text-align: left;
  cursor: pointer;
}
.mail-message-row:has(> .mail-message-open){display:grid;grid-template-columns:auto 1fr;gap:9px;align-items:start;padding:10px 12px;cursor:default}
.mail-message-open{min-width:0;width:100%;padding:3px;border:0;background:transparent;text-align:left;cursor:pointer}
.mail-message-open.is-active{color:var(--blue-700)}
.mail-message-row:hover,
.mail-message-row.is-active {
  background: var(--blue-50);
}
.mail-message-row strong,
.mail-message-row span,
.mail-message-row small {
  display: block;
}
.mail-message-row strong {
  font-size: 11px;
}
.mail-message-row span {
  margin-top: 3px;
  font-size: 10px;
  color: var(--ink-700);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mail-message-row small {
  margin-top: 5px;
  color: var(--ink-500);
  font-size: 8px;
}
.mail-reader {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.mail-reader-head {
  padding: 18px 20px;
  border-bottom: 1px solid var(--line-soft);
}
.mail-reader-head { display:flex; align-items:flex-start; justify-content:space-between; gap:16px; }
.mail-reader-head > div { min-width:0; }
.mail-reader-head h2 { overflow-wrap:anywhere; }
.mail-page.is-expanded { position:fixed; inset:0; z-index:80; padding:18px; background:var(--surface-soft); overflow:auto; }
.mail-page.is-expanded .page-heading { display:none; }
.mail-page.is-expanded .mail-shell { height:calc(100vh - 36px); }
.mail-page.is-expanded .mail-folders, .mail-page.is-expanded .mail-list, .mail-page.is-expanded .mail-resizer { display:none; }
.mail-page.is-expanded .mail-shell { display:block; }
.mail-page.is-expanded .mail-reader { height:100%; }
.attachment-grid { display:grid; gap:10px; margin-top:10px; }
.attachment-card { display:grid; grid-template-columns:22px minmax(0,1fr); gap:10px; padding:12px; border:1px solid var(--line-soft); border-radius:12px; }
.attachment-card > img { width:18px; }
.attachment-card span strong, .attachment-card span small { display:block; overflow-wrap:anywhere; }
.attachment-card span small { color:var(--ink-500); margin-top:3px; }
.attachment-card > div { grid-column:1/-1; display:flex; gap:7px; flex-wrap:wrap; }
.media-card-wrap { position:relative; min-width:0; }
.media-card-wrap .media-card { width:100%; }
.media-settings { position:absolute; top:7px; right:7px; width:30px; height:30px; border:0; border-radius:9px; display:grid; place-items:center; background:rgba(7,22,47,.86); cursor:pointer; }
.media-settings img { width:15px; filter:brightness(0) invert(1); }
.mail-reader-head h2 {
  margin: 0;
  font: 700 17px/1.35 var(--font-display);
}
.mail-reader-head p {
  margin: 6px 0 0;
  color: var(--ink-600);
  font-size: 10px;
}
.mail-body {
  padding: 22px;
  overflow: auto;
  font-size: 13px;
  line-height: 1.7;
}
.mail-empty {
  height: 100%;
  display: grid;
  place-items: center;
  align-content: center;
  color: var(--ink-500);
  text-align: center;
}
.mail-empty img {
  width: 28px;
  height: 28px;
  margin-bottom: 10px;
  opacity: 0.55;
}
.mail-empty h3 {
  margin: 0;
  font: 700 14px var(--font-display);
}
.mail-empty p {
  margin: 5px 0 0;
  font-size: 10px;
}

/* Plus */
.module-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(255px, 1fr));
  gap: 15px;
}
.module-card {
  min-height: 165px;
  padding: 19px;
  display: flex;
  flex-direction: column;
  text-decoration: none;
  cursor: pointer;
}
.module-card:hover {
  border-color: #bfd5ef;
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.module-card > span {
  width: 42px;
  height: 42px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  background: var(--blue-100);
}
.module-card > span img {
  width: 19px;
  height: 19px;
}
.module-card h2 {
  margin: 19px 0 5px;
  font: 700 14px var(--font-display);
}
.module-card p {
  margin: 0;
  color: var(--ink-600);
  font-size: 10px;
  line-height: 1.5;
}
.module-card > img {
  width: 16px;
  height: 16px;
  opacity: 0.5;
  margin: 14px 0 0 auto;
}
.module-detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(280px, 0.7fr);
  gap: 18px;
}
.settings-list {
  display: grid;
  gap: 12px;
}
.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 15px;
}
.settings-row h3 {
  margin: 0;
  font: 700 13px var(--font-display);
}
.settings-row p {
  margin: 4px 0 0;
  color: var(--ink-600);
  font-size: 10px;
}
.integration-state {
  padding: 18px;
}
.integration-state h2 {
  margin: 0;
  font: 700 17px var(--font-display);
}
.integration-state p {
  font-size: 11px;
  color: var(--ink-600);
  line-height: 1.6;
}
.qonto-hero {
  padding: 24px;
  color: #fff;
  background:
    radial-gradient(circle at 95% 0, rgba(120, 94, 255, 0.55), transparent 42%),
    linear-gradient(135deg, #26204f, #15234a);
  border-color: transparent;
}
.qonto-hero h2 {
  margin: 13px 0 6px;
  font: 700 21px var(--font-display);
}
.qonto-hero p {
  max-width: 650px;
  margin: 0;
  color: #cbd4e7;
  font-size: 11px;
  line-height: 1.6;
}
.qonto-hero .button {
  margin-top: 18px;
}
.data-list {
  display: grid;
  gap: 9px;
}
.data-row {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) repeat(3, minmax(110px, 0.6fr)) auto;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  border: 1px solid var(--line-soft);
  border-radius: 13px;
}
.data-row strong,
.data-row span {
  display: block;
}
.qonto-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
}
.qonto-actions .button {
  white-space: nowrap;
}
.data-row strong {
  font-size: 11px;
}
.data-row span {
  margin-top: 3px;
  font-size: 9px;
  color: var(--ink-500);
}

.site-card > span:nth-child(2),
.document-card > span:nth-child(2),
.payment-card > span:nth-child(2) {
  width: auto;
  height: auto;
  min-width: 0;
  border-radius: 0;
  background: transparent;
  display: block;
}

@media (max-width: 1180px) {
  :root {
    --sidebar: 214px;
  }
  .home-grid,
  .dossier-layout,
  .module-detail-grid {
    grid-template-columns: 1fr;
  }
  .dossier-side {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .mail-shell {
    --mail-folders: 180px;
    --mail-list: 320px;
  }
  .contact-list {
    grid-template-columns: 1fr 1fr;
  }
  .prospect-row {
    grid-template-columns: 28px minmax(160px, 1.2fr) minmax(
        110px,
        0.8fr
      ) minmax(100px, 0.7fr) minmax(120px, 0.8fr) 85px;
  }
  /* On masque le dernier contact avant la prochaine action : savoir quoi faire
     prime sur savoir ce qui a déjà été fait. */
  .prospect-row > *:nth-child(5) {
    display: none;
  }
  .filter-row {
    grid-template-columns: 1fr 1fr;
  }
}
@media (max-width: 900px) {
  :root {
    --sidebar: 230px;
  }
  .app-shell {
    display: block;
  }
  .sidebar {
    transform: translateX(-102%);
    box-shadow: var(--shadow-lg);
    transition: transform var(--speed) var(--ease);
  }
  .sidebar.is-open {
    transform: translateX(0);
  }
  .workspace {
    min-width: 0;
  }
  .topbar {
    padding: 0 18px;
  }
  .mobile-menu {
    display: grid;
    flex: 0 0 auto;
  }
  .global-search kbd,
  .topbar-weather small {
    display: none;
  }
  .page-host {
    padding: 26px 18px 46px;
  }
  .dossier-page {
    margin: -26px -18px -46px;
  }
  .dossier-side {
    grid-template-columns: 1fr;
  }
  .mail-shell {
    height: auto;
    min-height: 650px;
    grid-template-columns: 160px 1fr;
  }
  .mail-resizer { display:none; }
  .mail-reader {
    grid-column: 1/-1;
    min-height: 400px;
    border-top: 1px solid var(--line);
  }
  .prospect-row {
    grid-template-columns: 28px 1fr minmax(110px, 0.6fr) 85px;
  }
  .prospect-row > *:nth-child(3),
  .prospect-row > *:nth-child(4),
  .prospect-row > *:nth-child(5) {
    display: none;
  }
}
@media (max-width: 650px) {
  .topbar {
    height: 66px;
    gap: 9px;
    padding: 0 12px;
  }
  .global-search input {
    height: 41px;
  }
  .topbar-weather {
    display: none;
  }
  .page-host {
    padding: 22px 13px 38px;
    min-height: calc(100vh - 66px);
  }
  .page-heading {
    align-items: flex-start;
    flex-direction: column;
    margin-bottom: 20px;
  }
  .page-heading h1 {
    font-size: 27px;
  }
  .heading-actions {
    width: 100%;
  }
  .heading-actions .button {
    flex: 1;
  }
  .home-grid {
    gap: 14px;
  }
  .home-column {
    gap: 14px;
  }
  .panel {
    padding: 17px;
  }
  .activity-grid {
    grid-template-columns: 1fr 1fr;
  }
  .appointment-card,
  .task-card,
  .request-card {
    gap: 10px;
    padding: 11px;
  }
  .time-tile {
    width: 53px;
    height: 50px;
  }
  .dossier-page {
    margin: -22px -13px -38px;
    min-height: calc(100vh - 66px);
  }
  .dossier-hero {
    padding: 18px 15px;
  }
  .dossier-head {
    display: block;
  }
  .dossier-actions {
    justify-content: flex-start;
    margin-top: 16px;
  }
  .dossier-actions .button span {
    display: none;
  }
  .dossier-content {
    padding: 14px 13px 38px;
  }
  .journey {
    padding: 15px 7px;
  }
  .journey::before {
    top: 33px;
  }
  .next-action {
    grid-template-columns: auto 1fr;
    padding: 16px;
  }
  .next-action > .button {
    grid-column: 1/-1;
    width: 100%;
  }
  .next-action-icon {
    width: 43px;
    height: 43px;
  }
  .contact-list,
  .project-summary {
    grid-template-columns: 1fr;
  }
  .media-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .request-band-list {
    grid-template-columns: 1fr;
  }
  .page-toolbar {
    flex-wrap: wrap;
  }
  .page-toolbar .inline-search {
    max-width: none;
    flex-basis: 100%;
  }
  .filter-row {
    grid-template-columns: 1fr;
  }
  .filter-row select:nth-of-type(n + 2) {
    display: none;
  }
  .prospect-row {
    grid-template-columns: 27px 1fr 80px;
    padding: 11px;
  }
  .prospect-row > *:nth-child(3),
  .prospect-row > *:nth-child(4),
  .prospect-row > *:nth-child(5),
  .prospect-row > *:nth-child(6) {
    display: none;
  }
  .bulk-bar {
    flex-wrap: wrap;
  }
  .bulk-bar .button.secondary {
    width: 100%;
    margin: 0;
  }
  .mail-shell {
    display: block;
    height: auto;
  }
  .mail-folders {
    display: flex;
    gap: 4px;
    overflow: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .mail-folder {
    width: auto;
    white-space: nowrap;
  }
  .mail-list {
    max-height: 420px;
    border-right: 0;
  }
  .mail-reader {
    min-height: 420px;
  }
  .module-grid {
    grid-template-columns: 1fr;
  }
  .dossier-identity h1 {
    font-size: 23px;
  }
  .notification-panel {
    right: 8px;
    top: 8px;
    bottom: 8px;
    width: calc(100vw - 16px);
  }
}

/* ---------- Synchronisation site → CRM ----------------------------------
   Bouton discret dans la barre du haut : il indique la fraîcheur des données
   et permet de forcer une récupération sans attendre le cycle automatique. */
.topbar-sync {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--muted, #64748b);
  font: 600 12px var(--font-display);
  white-space: nowrap;
  cursor: pointer;
}
.topbar-sync:hover:not(:disabled) {
  background: #fff;
  color: var(--ink, #0f172a);
}
.topbar-sync:disabled {
  cursor: progress;
  opacity: 0.75;
}
.topbar-sync > img {
  width: 16px;
  height: 16px;
  opacity: 0.7;
}
/* Rotation pendant la synchronisation : le retour est immédiatement lisible. */
.topbar-sync.is-syncing > img {
  animation: dn-sync-spin 0.9s linear infinite;
}
@keyframes dn-sync-spin {
  to { transform: rotate(360deg); }
}
@media (prefers-reduced-motion: reduce) {
  .topbar-sync.is-syncing > img { animation: none; }
}
/* Sur petit écran, seul le pictogramme reste : la barre est déjà chargée. */
@media (max-width: 900px) {
  .topbar-sync > span { display: none; }
}

/* ==========================================================================
   Prospection — indicateurs, pipeline et signalement de doublon
   Chaque tuile d'indicateur porte le filtre qui l'a produite : la cliquer
   applique exactement ce filtre, ce qui garantit que le chiffre affiché et la
   liste obtenue ne peuvent pas diverger.
   ========================================================================== */
.prospect-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(125px, 1fr));
  gap: 7px;
  margin-bottom: 10px;
}
.prospect-kpi {
  display: flex;
  flex-direction: row;
  align-items: baseline;
  gap: 7px;
  padding: 8px 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.prospect-kpi:hover {
  border-color: var(--ink-300);
}
.prospect-kpi strong {
  font-size: 17px;
  font-weight: 800;
  line-height: 1.1;
}
.prospect-kpi span {
  color: var(--ink-500);
  font-size: 9.5px;
  font-weight: 700;
}
/* Une bande de couleur porte le sens ; elle ne décore pas la tuile entière,
   pour que six indicateurs côte à côte restent lisibles. */
.prospect-kpi {
  border-left-width: 3px;
}
.prospect-kpi.tone-prospection { border-left-color: #6f5bd6; }
.prospect-kpi.tone-attente { border-left-color: #d98324; }
.prospect-kpi.tone-succes { border-left-color: #1f9d63; }
.prospect-kpi.tone-alerte { border-left-color: #c8453b; }
.prospect-kpi.tone-neutre { border-left-color: var(--ink-300); }
.prospect-kpi.tone-a-traiter { border-left-color: #1672e8; }
.prospect-kpi.tone-a-contacter { border-left-color: #7456d8; }
.prospect-kpi.tone-reponse { border-left-color: #0f8f9d; }
.prospect-kpi.tone-rendez-vous { border-left-color: #315acb; }
.prospect-kpi.tone-converti { border-left-color: #1f9d63; }
.prospect-kpi.is-active {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 22%, transparent);
}

.prospect-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.prospect-doublon {
  color: #c8453b;
  font-size: 10px;
  font-weight: 700;
}

.prospect-pipeline {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(212px, 1fr);
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 8px;
}
.pipeline-column {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
  padding: 10px;
  background: var(--surface-muted, var(--surface));
  border: 1px solid var(--line);
  border-radius: 14px;
}
.pipeline-column.is-active {
  border-color: var(--accent);
}
.pipeline-column > header > button {
  display: flex;
  align-items: center;
  gap: 7px;
  width: 100%;
  padding: 2px;
  background: none;
  border: 0;
  color: inherit;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  cursor: pointer;
}
.pipeline-column > header em {
  margin-left: auto;
  color: var(--ink-500);
  font-style: normal;
  font-weight: 800;
}
.pipeline-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ink-300);
  flex: none;
}
.pipeline-dot.tone-prospection { background: #6f5bd6; }
.pipeline-dot.tone-attente { background: #d98324; }
.pipeline-dot.tone-succes { background: #1f9d63; }
.pipeline-dot.tone-alerte { background: #c8453b; }
.pipeline-cards {
  display: grid;
  gap: 7px;
}
.pipeline-card {
  display: grid;
  gap: 2px;
  padding: 10px 11px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 11px;
  cursor: pointer;
  text-align: left;
}
.pipeline-card:hover,
.pipeline-card:focus-visible {
  border-color: var(--accent);
}
.pipeline-card strong {
  font-size: 12.5px;
  font-weight: 700;
}
.pipeline-card span,
.pipeline-card small {
  color: var(--ink-500);
  font-size: 10.5px;
}
.pipeline-relance {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: #d98324;
  font-weight: 700;
}
.pipeline-vide {
  margin: 0;
  padding: 8px 2px;
  color: var(--ink-500);
  font-size: 10.5px;
}

/* Fiche prospect : alertes contextuelles et historique. */
.prospect-alerte {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 0;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.45;
}
.prospect-alerte img { width: 15px; height: 15px; flex: none; margin-top: 1px; }
.prospect-alerte.tone-doublon {
  border-color: color-mix(in srgb, #c8453b 40%, var(--line));
  background: color-mix(in srgb, #c8453b 7%, transparent);
  color: #8f2f28;
}
.prospect-alerte.tone-recontact {
  border-color: color-mix(in srgb, #d98324 42%, var(--line));
  background: color-mix(in srgb, #d98324 8%, transparent);
  color: #8a5312;
}
.prospect-section-title {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 6px 0 8px;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-500);
}
.prospect-section-title img { width: 14px; height: 14px; }
.prospect-timeline {
  list-style: none;
  margin: 0;
  padding: 0 0 0 16px;
  display: grid;
  gap: 12px;
  border-left: 2px solid var(--line);
}
.prospect-timeline.is-empty {
  padding: 12px 14px;
  border: 1px dashed var(--line);
  border-radius: 12px;
  color: var(--ink-500);
  font-size: 12px;
}
.timeline-entry {
  position: relative;
}
/* La pastille reprend le canal : on repère d'un coup d'œil un appel au milieu
   d'une suite d'emails. */
.timeline-entry::before {
  content: "";
  position: absolute;
  left: -21px;
  top: 4px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--ink-300);
  box-shadow: 0 0 0 3px var(--surface);
}
.timeline-entry.canal-email::before { background: #2c6fff; }
.timeline-entry.canal-appel::before { background: #1f9d63; }
.timeline-entry.canal-sms::before { background: #6f5bd6; }
.timeline-entry.canal-rdv::before { background: #d98324; }
.timeline-entry.canal-note::before { background: #8b95a6; }
.timeline-entry time {
  display: block;
  color: var(--ink-500);
  font-size: 10px;
  font-weight: 700;
}
.timeline-entry strong {
  display: block;
  margin-top: 2px;
  font-size: 12.5px;
}
.timeline-entry p {
  margin: 3px 0 0;
  color: var(--ink-600);
  font-size: 11.5px;
  line-height: 1.45;
}

/* État de l'analyse des réponses : présent mais discret. */
.prospect-toolbar-droite {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.prospect-sync {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--ink-500);
  font-size: 11px;
  font-weight: 600;
}
.prospect-sync img { width: 13px; height: 13px; }
.prospect-sync.tone-erreur { color: #c8453b; }
.prospect-sync.tone-inactif { color: #8a5312; }

/* Remplace les anciens styles inline afin de rester compatible avec la CSP
   stricte du serveur (style-src 'self'). */
.reference-financial-panel { margin-top: 18px; }
.system-control-help { margin-top: 12px; }
.info-modal-detail { margin: 0; color: var(--ink-600); line-height: 1.7; }
.settings-subheading { margin: 8px 0 0; }
