.button,
.icon-button,
.nav-item,
.topbar-weather,
.text-button,
.client-card,
.task-card,
.appointment-card,
.site-card,
.document-card,
.media-card,
.payment-card,
.menu-item {
  border: 0;
  cursor: pointer;
  transition:
    transform var(--speed) var(--ease),
    background var(--speed) var(--ease),
    border-color var(--speed) var(--ease),
    box-shadow var(--speed) var(--ease),
    color var(--speed) var(--ease);
}
.button {
  min-height: 42px;
  border-radius: var(--radius-sm);
  padding: 0 17px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  font-weight: 750;
  text-decoration: none;
  white-space: nowrap;
}
.button img {
  width: 17px;
  height: 17px;
}
.button.primary {
  background: linear-gradient(135deg, var(--blue-600), #0875f7);
  color: #fff;
  box-shadow: 0 8px 18px rgba(9, 105, 232, 0.2);
}
.button.primary:hover {
  box-shadow: 0 11px 24px rgba(9, 105, 232, 0.28);
  transform: translateY(-1px);
}
.button.secondary {
  background: var(--surface);
  color: var(--ink-800);
  border: 1px solid var(--line);
}
.button.secondary:hover {
  border-color: #bdcbe0;
  background: #fbfdff;
}
.button.tertiary {
  background: transparent;
  color: var(--ink-700);
}
.button.tertiary:hover {
  background: var(--surface-soft);
  color: var(--blue-700);
}
.button.danger {
  background: var(--red-100);
  color: var(--red-700);
}

.app-lock-overlay {
  position: fixed;
  z-index: 10000;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 78% 18%, rgba(42, 126, 255, 0.3), transparent 34%),
    linear-gradient(135deg, #06152d, #0b315f 58%, #075ec7);
}
.app-lock-overlay[hidden] {
  display: none;
}
.app-lock-card {
  display: grid;
  width: min(430px, 100%);
  gap: 15px;
  padding: 36px;
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: var(--radius-xl);
  box-shadow: 0 30px 80px rgba(0, 12, 35, 0.38);
}
.app-lock-card > img {
  width: 56px;
  height: 56px;
  object-fit: contain;
  border-radius: 15px;
}
.app-lock-card .eyebrow {
  margin: 2px 0 -9px;
  color: var(--blue-600);
}
.app-lock-card h2 {
  margin: 0;
  color: var(--ink-950);
  font-size: 28px;
}
.app-lock-card > p:not(.eyebrow) {
  margin: 0 0 3px;
  color: var(--ink-500);
  font-size: 13px;
  line-height: 1.55;
}
/* L'offre « Activer Touch ID » est aussi un <label>, mais sa case et son
   libellé doivent rester côte à côte : cette grille les empilait. */
.app-lock-card label:not(.app-lock-touchid-offre) {
  display: grid;
  gap: 7px;
  color: var(--ink-700);
  font-size: 12px;
  font-weight: 750;
}
/* Les 50 px de haut sont ceux d'un champ de saisie : une case à cocher n'en
   veut pas — elle était étirée en un grand rectangle. */
.app-lock-card input:not([type="checkbox"]) {
  min-height: 50px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 0 14px;
  font: inherit;
  font-size: 20px;
  letter-spacing: 0.24em;
  text-align: center;
}
.app-lock-result {
  color: var(--red-700);
  font-size: 13px;
  line-height: 1.45;
}
.application-locked body {
  overflow: hidden;
}
.button.small {
  min-height: 34px;
  padding: 0 12px;
  font-size: 13px;
  border-radius: 10px;
}
.button.full {
  width: 100%;
}
.button:disabled {
  opacity: 0.48;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

.icon-button {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: var(--surface);
  border: 1px solid var(--line);
}
.icon-button:hover {
  background: var(--blue-50);
  border-color: #bed6f4;
}
.icon-button img {
  width: 18px;
  height: 18px;
}
.icon-button.ghost {
  background: transparent;
  border-color: transparent;
}

.card {
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
.status-badge {
  min-height: 26px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: var(--radius-pill);
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.02em;
  white-space: nowrap;
  background: #edf1f6;
  color: var(--ink-700);
}
.status-badge::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.7;
}
.status-badge.blue {
  background: var(--blue-100);
  color: var(--blue-700);
}
.status-badge.violet {
  background: var(--violet-100);
  color: var(--violet-600);
}
.status-badge.success {
  background: var(--green-100);
  color: var(--green-700);
}
.status-badge.warning {
  background: var(--amber-100);
  color: var(--amber-700);
}
.status-badge.danger {
  background: var(--red-100);
  color: var(--red-700);
}
.status-badge.teal {
  background: var(--teal-100);
  color: var(--teal-600);
}
.status-badge.neutre {
  background: var(--slate-100);
  color: var(--slate-600);
}
.status-badge.cyan {
  background: var(--cyan-100);
  color: var(--cyan-600);
}

.eyebrow {
  margin: 0 0 6px;
  font: 800 11px/1 var(--font-display);
  letter-spacing: 0.12em;
  color: var(--blue-600);
}
.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}
.section-title > div {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.section-title h2,
.section-title h3 {
  margin: 0;
  font: 700 17px/1.3 var(--font-display);
}
.section-title p {
  margin: 3px 0 0;
  color: var(--ink-600);
  font-size: 13px;
}
.section-icon {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: var(--blue-100);
}
.section-icon img {
  width: 18px;
  height: 18px;
}
.section-icon.violet {
  background: var(--violet-100);
}
.section-icon.amber {
  background: var(--amber-100);
}
.section-icon.cyan {
  background: var(--cyan-100);
}
.section-icon.green {
  background: var(--green-100);
}
/* Le bleu est le fond par défaut : la classe est déclarée pour que
   « tone: "blue" » soit explicite à la lecture du code. */
.section-icon.blue {
  background: var(--blue-100);
}
.section-icon.teal {
  background: var(--teal-100);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.client-profile-fields {
  display: contents;
}
.client-profile-fields[hidden] {
  display: none;
}
.form-field {
  display: grid;
  gap: 7px;
  color: var(--ink-700);
  font-size: 12px;
  font-weight: 750;
}
.form-field.full {
  grid-column: 1/-1;
}
.form-field.has-icon > span:first-child {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.field-icon {
  display: inline-flex;
  width: 13px;
  height: 13px;
  flex-shrink: 0;
}
.field-icon img {
  width: 100%;
  height: 100%;
  opacity: .55;
}
.form-field input,
.form-field select,
.form-field textarea,
.inline-field input,
.inline-field select {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  padding: 10px 12px;
  color: var(--ink-950);
  font-weight: 550;
  outline: 0;
}
.form-field textarea {
  min-height: 96px;
  resize: vertical;
}
.portal-live-state {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 12px;
  border: 1px solid var(--line-soft);
  border-radius: 13px;
  background: var(--green-50, #ecfaf5);
}
.portal-live-state > span {
  min-width: 0;
  margin-right: auto;
}
.portal-live-state strong,
.portal-live-state small {
  display: block;
}
.portal-live-state small {
  margin-top: 3px;
  color: var(--ink-500);
}
.portal-selection {
  display: grid;
  max-height: 260px;
  margin-top: 6px;
  overflow: auto;
  border: 1px solid var(--line-soft);
  border-radius: 13px;
}
.portal-selection label {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 11px 13px;
  border-bottom: 1px solid var(--line-soft);
  cursor: pointer;
}
.portal-selection label:last-child {
  border-bottom: 0;
}
.portal-selection label.is-disabled {
  cursor: not-allowed;
  opacity: 0.58;
}
.portal-selection-heading {
  margin: 0;
  padding: 8px 13px;
  color: var(--ink-600);
  background: var(--surface-2, #f4f6fa);
  border-bottom: 1px solid var(--line-soft);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}
.portal-item-copy {
  min-width: 0;
  flex: 1;
}
.portal-visible-control {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  color: var(--ink-600);
  font-size: 12px;
  font-weight: 700;
}
.portal-selection input {
  width: 17px;
  height: 17px;
  accent-color: var(--blue-600);
  flex-shrink: 0;
}
.portal-thumb {
  width: 44px;
  height: 44px;
  border-radius: 9px;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--surface-2, #eef1f6);
}
.portal-thumb-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-500);
}
.portal-thumb-icon svg {
  width: 18px;
  height: 18px;
}
.portal-selection strong,
.portal-selection small {
  display: block;
}
.portal-selection small {
  margin-top: 2px;
  color: var(--ink-500);
}
.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus,
.inline-field input:focus,
.inline-field select:focus {
  border-color: var(--blue-500);
  box-shadow: 0 0 0 3px rgba(22, 128, 255, 0.12);
}
.field-hint {
  font-size: 11px;
  font-weight: 550;
  color: var(--ink-500);
}

.segmented-control {
  display: inline-flex;
  gap: 3px;
  padding: 3px;
  border: 1px solid var(--line);
  background: #edf2f8;
  border-radius: 12px;
}
.segmented-control button {
  border: 0;
  background: transparent;
  border-radius: 9px;
  min-height: 34px;
  padding: 0 12px;
  font-size: 12px;
  font-weight: 750;
  color: var(--ink-600);
  cursor: pointer;
}
.segmented-control button.is-active {
  background: #fff;
  color: var(--navy-950);
  box-shadow: 0 2px 7px rgba(18, 42, 77, 0.1);
}
.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--line);
  overflow: auto;
}
.tabs button {
  border: 0;
  background: transparent;
  padding: 13px 14px;
  color: var(--ink-600);
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
  border-bottom: 2px solid transparent;
}
.tabs button.is-active {
  color: var(--blue-700);
  border-color: var(--blue-600);
}

.empty-state {
  padding: 32px 22px;
  text-align: center;
  color: var(--ink-600);
}
.empty-state img {
  width: 24px;
  height: 24px;
  margin: 0 auto 11px;
  opacity: 0.72;
}
.empty-state h3 {
  margin: 0 0 5px;
  font: 700 15px var(--font-display);
  color: var(--ink-800);
}
.empty-state p {
  margin: 0;
  font-size: 13px;
}

.modal,
.viewer {
  border: 0;
  padding: 0;
  background: transparent;
  overflow: visible;
}
.viewer.is-fullscreen {
  width: 100vw;
  height: 100vh;
  max-width: none;
  max-height: none;
  border-radius: 0;
}
.modal::backdrop,
.viewer::backdrop {
  background: rgba(3, 15, 36, 0.55);
  backdrop-filter: blur(5px);
}
.modal-card {
  width: min(640px, calc(100vw - 32px));
  max-height: calc(100vh - 40px);
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: 22px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.modal-header,
.modal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 20px 22px;
}
.modal-header {
  border-bottom: 1px solid var(--line-soft);
}
.modal-header h2 {
  margin: 0;
  font: 700 21px var(--font-display);
}
.modal-footer {
  border-top: 1px solid var(--line-soft);
  justify-content: flex-end;
}
.modal-body {
  padding: 22px;
  overflow: auto;
}
.viewer {
  width: min(1180px, calc(100vw - 28px));
  height: min(820px, calc(100vh - 28px));
  background: #f5f7fb;
  border-radius: 22px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.viewer > header {
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px 14px 22px;
  background: #fff;
  border-bottom: 1px solid var(--line);
}
.viewer h2 {
  margin: 0;
  font: 700 17px var(--font-display);
}
.viewer-actions {
  display: flex;
  gap: 10px;
}
.viewer-body {
  height: calc(100% - 72px);
  display: grid;
  place-items: center;
  overflow: auto;
}
.viewer-body iframe,
.viewer-body img,
.viewer-body video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border: 0;
}
.viewer-body img { transition: transform 160ms ease; }

.toast-region {
  position: fixed;
  right: 22px;
  top: 22px;
  z-index: 1000;
  display: grid;
  gap: 10px;
  pointer-events: none;
}
.toast {
  width: min(360px, calc(100vw - 32px));
  display: flex;
  gap: 11px;
  align-items: flex-start;
  background: var(--navy-950);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 15px;
  padding: 14px 16px;
  box-shadow: var(--shadow-lg);
  animation: toast-in 220ms var(--ease);
}
.toast img {
  width: 18px;
  height: 18px;
  filter: brightness(0) invert(1);
}
.toast.error {
  background: #661e2a;
}
.toast-navigation {
  width: min(390px, calc(100vw - 32px));
  border: 1px solid rgba(125, 211, 252, 0.34);
  text-align: left;
  cursor: pointer;
  pointer-events: auto;
}
.toast-navigation > span { flex: 1; }
.toast-navigation > svg:last-child { flex: none; margin-left: auto; }
.toast-navigation small {
  display: block;
  margin-top: 7px;
  color: #7dd3fc;
  font-size: 11px;
  font-weight: 750;
}
.toast-navigation:hover,
.toast-navigation:focus-visible { transform: translateY(-1px); border-color: rgba(125, 211, 252, 0.65); }
.toast strong {
  display: block;
  font-size: 13px;
}
.toast p {
  margin: 2px 0 0;
  font-size: 12px;
  opacity: 0.8;
}
@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.98);
  }
}

.menu {
  position: absolute;
  z-index: 20;
  min-width: 210px;
  padding: 7px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow-md);
}
.menu-item {
  width: 100%;
  min-height: 38px;
  padding: 0 10px;
  border-radius: 9px;
  background: transparent;
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
  font-size: 13px;
  font-weight: 650;
}
.menu-item:hover {
  background: var(--surface-soft);
}
.menu-item img {
  width: 16px;
  height: 16px;
}

.skeleton {
  min-height: 70px;
  border-radius: 14px;
  background: linear-gradient(90deg, #f0f3f7 25%, #f7f9fb 37%, #f0f3f7 63%);
  background-size: 400% 100%;
  animation: skeleton 1.4s ease infinite;
}
@keyframes skeleton {
  0% {
    background-position: 100% 0;
  }
  100% {
    background-position: 0 0;
  }
}

@media (max-width: 700px) {
  .form-grid {
    grid-template-columns: 1fr;
  }
  .form-field.full {
    grid-column: auto;
  }
  .button {
    min-height: 44px;
  }
  .modal-card {
    width: calc(100vw - 16px);
    max-height: calc(100vh - 16px);
  }
  .modal-header,
  .modal-footer,
  .modal-body {
    padding: 16px;
  }
  .viewer {
    width: calc(100vw - 12px);
    height: calc(100vh - 12px);
  }
  .viewerDownload {
    display: none;
  }
}
.context-action-list {
  display: grid;
  gap: 10px;
}
.modal-card.is-context-menu {
  width: min(420px, calc(100vw - 32px));
}
.modal-card.is-context-menu .modal-body {
  padding: 16px;
}
.modal-card.is-context-menu .context-action-list .button {
  justify-content: flex-start;
}

.mail-html-frame {
  width: 100%;
  min-height: 420px;
  border: 0;
  background: #fff;
}
.mail-text-body {
  padding: 18px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  color: var(--ink-900);
  line-height: 1.55;
}
.mail-text-body a { color: var(--blue-700); text-decoration: underline; }

.mail-attachments {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 14px 18px;
  border-top: 1px solid var(--line);
}
.notification-actions{display:flex;gap:8px;padding:0 18px 12px;flex-wrap:wrap}

/* ---------- Bouton de mise à la corbeille dans une ligne ------------------
   Il vit à l'intérieur d'une carte déjà cliquable : il reste discret au repos
   et ne se révèle qu'au survol ou au focus, pour ne pas concurrencer l'action
   principale de la ligne. La cible garde 36 px, atteignable au doigt. */
.row-trash {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  flex: none;
  margin-left: auto;
  border: 0;
  border-radius: 9px;
  background: none;
  color: var(--text-soft, #7c8aa3);
  opacity: 0;
  cursor: pointer;
  transition: opacity 140ms ease, background 140ms ease, color 140ms ease;
}
.row-trash img { width: 17px; height: 17px; }
.task-card:hover .row-trash,
.task-card:focus-within .row-trash,
.request-mini-wrap:hover .row-trash,
.request-mini-wrap:focus-within .row-trash,
.row-trash:focus-visible {
  opacity: 1;
}
.row-trash:hover,
.row-trash:focus-visible {
  background: rgba(220, 76, 76, 0.12);
  color: #d94b4b;
}
/* Sur écran tactile, il n'y a pas de survol : le bouton reste visible. */
@media (hover: none) {
  .row-trash { opacity: 0.65; }
}

.request-mini-wrap {
  display: flex;
  align-items: stretch;
  gap: 4px;
}
.request-mini-wrap > .request-mini { flex: 1; }

/* ---------- Toast porteur d'une action ---------------------------------- */
.toast-action { align-items: center; gap: 12px; }
.toast-undo {
  flex: none;
  margin-left: auto;
  padding: 7px 13px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.1);
  color: inherit;
  font: inherit;
  font-weight: 650;
  cursor: pointer;
}
.toast-undo:hover,
.toast-undo:focus-visible { background: rgba(255, 255, 255, 0.2); }

/* Recadrage local des photos principales : aperçu 16:10 identique aux cartes. */
.photo-cropper {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface-soft);
}
.photo-crop-frame {
  width: min(100%, 620px);
  aspect-ratio: 16 / 10;
  margin-inline: auto;
  overflow: hidden;
  border-radius: 14px;
  background: var(--navy-950);
}
.photo-crop-frame img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}
.photo-crop-controls {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}
.photo-crop-controls label { display: grid; gap: 6px; font-size: 12px; font-weight: 750; color: var(--text-soft); }
.photo-crop-controls input { width: 100%; }
@media (max-width: 620px) { .photo-crop-controls { grid-template-columns: 1fr; } }
